From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 01:19:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 144831065672; Sun, 27 Dec 2009 01:19:56 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0341E8FC0A; Sun, 27 Dec 2009 01:19:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBR1Jtto033361; Sun, 27 Dec 2009 01:19:55 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBR1JtP0033359; Sun, 27 Dec 2009 01:19:55 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912270119.nBR1JtP0033359@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 27 Dec 2009 01:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201034 - head/release/picobsd/bridge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 01:19:56 -0000 Author: luigi Date: Sun Dec 27 01:19:55 2009 New Revision: 201034 URL: http://svn.freebsd.org/changeset/base/201034 Log: put back the HZ setting or we see poor timing under qemu MFC after: 3 days Modified: head/release/picobsd/bridge/PICOBSD Modified: head/release/picobsd/bridge/PICOBSD ============================================================================== --- head/release/picobsd/bridge/PICOBSD Sat Dec 26 22:36:05 2009 (r201033) +++ head/release/picobsd/bridge/PICOBSD Sun Dec 27 01:19:55 2009 (r201034) @@ -46,7 +46,9 @@ options IPDIVERT # divert (for natd) # Support for bridging and bandwidth limiting options DUMMYNET device if_bridge -#options HZ=1000 +# Running with less than 1000 seems to give poor timing on +# qemu, so we set HZ explicitly. +options HZ=1000 device random # used by ssh device pci From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 03:43:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 792411065672; Sun, 27 Dec 2009 03:43:19 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6830F8FC17; Sun, 27 Dec 2009 03:43:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBR3hJLe042292; Sun, 27 Dec 2009 03:43:19 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBR3hJMc042290; Sun, 27 Dec 2009 03:43:19 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912270343.nBR3hJMc042290@svn.freebsd.org> From: Doug Barton Date: Sun, 27 Dec 2009 03:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201035 - head/usr.sbin/service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 03:43:19 -0000 Author: dougb Date: Sun Dec 27 03:43:19 2009 New Revision: 201035 URL: http://svn.freebsd.org/changeset/base/201035 Log: Further improve the description, and bump Dd. Modified: head/usr.sbin/service/service.8 Modified: head/usr.sbin/service/service.8 ============================================================================== --- head/usr.sbin/service/service.8 Sun Dec 27 01:19:55 2009 (r201034) +++ head/usr.sbin/service/service.8 Sun Dec 27 03:43:19 2009 (r201035) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2009 +.Dd December 26, 2009 .Dt service 8 .Os .Sh NAME .Nm service -.Nd "manage system services" +.Nd "control (start/stop/etc.) or list system services" .Sh SYNOPSIS .Nm .Fl e From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 03:46:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 801131065672 for ; Sun, 27 Dec 2009 03:46:30 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 1145E8FC17 for ; Sun, 27 Dec 2009 03:46:29 +0000 (UTC) Received: (qmail 8791 invoked by uid 399); 27 Dec 2009 03:46:29 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 27 Dec 2009 03:46:29 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B36D893.5060207@FreeBSD.org> Date: Sat, 26 Dec 2009 19:46:27 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Christian Brueffer References: <200912250958.nBP9wKnV056343@svn.freebsd.org> In-Reply-To: <200912250958.nBP9wKnV056343@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200980 - head/usr.sbin/service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 03:46:30 -0000 Christian Brueffer wrote: > Author: brueffer > Date: Fri Dec 25 09:58:19 2009 > New Revision: 200980 > URL: http://svn.freebsd.org/changeset/base/200980 > > Log: > Provide a better short description and fix SEE ALSO section entries. Thank you for these improvements. :) I would have preferred that you let me know what you had in mind first though, since given your prompting I was able to further improve the description a bit. I did a simple search/replace vs. the example man page and should have fleshed that out a bit. I was not aware of the convention for ports .Xr's, so thank you for that as well. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 06:25:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542F71065697; Sun, 27 Dec 2009 06:25:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 434CC8FC1C; Sun, 27 Dec 2009 06:25:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBR6P4S7045484; Sun, 27 Dec 2009 06:25:04 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBR6P4om045483; Sun, 27 Dec 2009 06:25:04 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912270625.nBR6P4om045483@svn.freebsd.org> From: Doug Barton Date: Sun, 27 Dec 2009 06:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201036 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 06:25:04 -0000 Author: dougb Date: Sun Dec 27 06:25:03 2009 New Revision: 201036 URL: http://svn.freebsd.org/changeset/base/201036 Log: Delete some trailing whitespace Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Dec 27 03:43:19 2009 (r201035) +++ head/etc/rc.subr Sun Dec 27 06:25:03 2009 (r201036) @@ -738,7 +738,7 @@ $command $rc_flags $command_args" if [ -n "$_nice" ]; then if [ -z "$_user" ]; then _doit="sh -c \"$_doit\"" - fi + fi _doit="nice -n $_nice $_doit" fi fi @@ -1063,7 +1063,7 @@ load_rc_config() esac done } - + # # load_rc_config_var name var # Read the rc.conf(5) var for name and set in the From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 06:27:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00E71106568D; Sun, 27 Dec 2009 06:27:10 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E41808FC1E; Sun, 27 Dec 2009 06:27:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBR6R9Ob045607; Sun, 27 Dec 2009 06:27:09 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBR6R9uV045605; Sun, 27 Dec 2009 06:27:09 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912270627.nBR6R9uV045605@svn.freebsd.org> From: Doug Barton Date: Sun, 27 Dec 2009 06:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201038 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 06:27:10 -0000 Author: dougb Date: Sun Dec 27 06:27:09 2009 New Revision: 201038 URL: http://svn.freebsd.org/changeset/base/201038 Log: Update the comments about files ending in .sh Prompted by: Alex Kozlov Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Dec 27 06:26:04 2009 (r201037) +++ head/etc/rc.subr Sun Dec 27 06:27:09 2009 (r201038) @@ -958,10 +958,11 @@ _run_rc_killcmd() # # run_rc_script file arg # Start the script `file' with `arg', and correctly handle the -# return value from the script. If `file' ends with `.sh', it's -# sourced into the current environment. If `file' appears to be -# a backup or scratch file, ignore it. Otherwise if it's -# executable run as a child process. +# return value from the script. +# If `file' ends with `.sh', it's sourced into the current environment +# when $rc_fast_and_loose is set, otherwise it is run as a child process. +# If `file' appears to be a backup or scratch file, ignore it. +# Otherwise if it is executable run as a child process. # run_rc_script() { From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 10:10:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACCE81065672; Sun, 27 Dec 2009 10:10:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C5E68FC18; Sun, 27 Dec 2009 10:10:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRAAdUo051986; Sun, 27 Dec 2009 10:10:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRAAdKh051985; Sun, 27 Dec 2009 10:10:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912271010.nBRAAdKh051985@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 27 Dec 2009 10:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201044 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 10:10:39 -0000 Author: bz Date: Sun Dec 27 10:10:38 2009 New Revision: 201044 URL: http://svn.freebsd.org/changeset/base/201044 Log: Add missing include to make LINT-VIMAGE build as well. Found by: test building an MFC candidate X-MFC with: r200471 Modified: head/sys/nfsclient/krpc_subr.c Modified: head/sys/nfsclient/krpc_subr.c ============================================================================== --- head/sys/nfsclient/krpc_subr.c Sun Dec 27 07:04:27 2009 (r201043) +++ head/sys/nfsclient/krpc_subr.c Sun Dec 27 10:10:38 2009 (r201044) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 10:19:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4391D106566B; Sun, 27 Dec 2009 10:19:11 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 338C48FC13; Sun, 27 Dec 2009 10:19:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRAJBeZ052236; Sun, 27 Dec 2009 10:19:11 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRAJBI4052234; Sun, 27 Dec 2009 10:19:11 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912271019.nBRAJBI4052234@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 27 Dec 2009 10:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201046 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 10:19:11 -0000 Author: luigi Date: Sun Dec 27 10:19:10 2009 New Revision: 201046 URL: http://svn.freebsd.org/changeset/base/201046 Log: diverted packet must re-enter _after_ the matching rule, or we create loops. The divert cookie (that can be set from userland too) contains the matching rule nr, so we must start from nr+1. Reported by: Joe Marcus Clarke Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Sun Dec 27 10:13:31 2009 (r201045) +++ head/sys/netinet/ipfw/ip_fw2.c Sun Dec 27 10:19:10 2009 (r201046) @@ -1173,7 +1173,7 @@ do { \ IPFW_RUNLOCK(chain); return (IP_FW_DENY); /* invalid */ } - f_pos = ipfw_find_rule(chain, skipto, 0); + f_pos = ipfw_find_rule(chain, skipto+1, 0); } } /* reset divert rule to avoid confusion later */ From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 11:56:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8681D1065693; Sun, 27 Dec 2009 11:56:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 763D08FC17; Sun, 27 Dec 2009 11:56:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRBuWGl055891; Sun, 27 Dec 2009 11:56:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRBuW9X055889; Sun, 27 Dec 2009 11:56:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912271156.nBRBuW9X055889@svn.freebsd.org> From: Ed Schouten Date: Sun, 27 Dec 2009 11:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201047 - head/contrib/telnet/telnetd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 11:56:32 -0000 Author: ed Date: Sun Dec 27 11:56:32 2009 New Revision: 201047 URL: http://svn.freebsd.org/changeset/base/201047 Log: Remove unneeded inclusion of and dead variables. Modified: head/contrib/telnet/telnetd/sys_term.c Modified: head/contrib/telnet/telnetd/sys_term.c ============================================================================== --- head/contrib/telnet/telnetd/sys_term.c Sun Dec 27 10:19:10 2009 (r201046) +++ head/contrib/telnet/telnetd/sys_term.c Sun Dec 27 11:56:32 2009 (r201047) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "telnetd.h" #include "pathnames.h" @@ -55,19 +54,6 @@ __FBSDID("$FreeBSD$"); int cleanopen(char *); void scrub_env(void); -struct utmp wtmp; - -#ifdef _PATH_WTMP -char wtmpf[] = _PATH_WTMP; -#else -char wtmpf[] = "/var/log/wtmp"; -#endif -#ifdef _PATH_UTMP -char utmpf[] = _PATH_UTMP; -#else -char utmpf[] = "/var/run/utmp"; -#endif - char *envinit[3]; extern char **environ; From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 12:19:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D782C106568B; Sun, 27 Dec 2009 12:19:33 +0000 (UTC) (envelope-from chris@brueffer.de) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by mx1.freebsd.org (Postfix) with ESMTP id 695FD8FC18; Sun, 27 Dec 2009 12:19:33 +0000 (UTC) Received: from brueffer.de (dslb-092-072-080-168.pools.arcor-ip.net [92.72.80.168]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0Lu38g-1O5KNR3GmU-011Hk6; Sun, 27 Dec 2009 13:19:31 +0100 Received: by brueffer.de (Postfix, from userid 1001) id 23F3E17040; Sun, 27 Dec 2009 12:19:29 +0100 (CET) Date: Sun, 27 Dec 2009 12:19:28 +0100 From: Christian Brueffer To: Doug Barton Message-ID: <20091227111928.GA1881@serenity> References: <200912250958.nBP9wKnV056343@svn.freebsd.org> <4B36D893.5060207@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline In-Reply-To: <4B36D893.5060207@FreeBSD.org> X-Operating-System: FreeBSD 9.0-CURRENT X-PGP-Key: http://people.FreeBSD.org/~brueffer/brueffer.key.asc X-PGP-Fingerprint: A5C8 2099 19FF AACA F41B B29B 6C76 178C A0ED 982D User-Agent: Mutt/1.5.19 (2009-01-05) X-Provags-ID: V01U2FsdGVkX1/4hrhc9Ai1StSJsTYverX9lRLJteqSUbHyv5x 5g3t2wX8XhlOjll0avs0BWiIaHZrKSS/TSiGpQr/sEhWSUR+b0 DqXqSOrEhgtLmKF075hXVKiGcvsmsp2 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200980 - head/usr.sbin/service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 12:19:33 -0000 --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 26, 2009 at 07:46:27PM -0800, Doug Barton wrote: > Christian Brueffer wrote: > > Author: brueffer > > Date: Fri Dec 25 09:58:19 2009 > > New Revision: 200980 > > URL: http://svn.freebsd.org/changeset/base/200980 > >=20 > > Log: > > Provide a better short description and fix SEE ALSO section entries. >=20 > Thank you for these improvements. :) I would have preferred that you > let me know what you had in mind first though, since given your > prompting I was able to further improve the description a bit. I did a > simple search/replace vs. the example man page and should have fleshed > that out a bit. I was not aware of the convention for ports .Xr's, so > thank you for that as well. >=20 Will do next time, sorry. Thanks for taking another look at it! - Christian --=20 Christian Brueffer chris@unixpages.org brueffer@FreeBSD.org GPG Key: http://people.freebsd.org/~brueffer/brueffer.key.asc GPG Fingerprint: A5C8 2099 19FF AACA F41B B29B 6C76 178C A0ED 982D --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAks3Qr8ACgkQbHYXjKDtmC2DvACdGPVRDSOJlBZhOke4CY+PR1Fq stkAn1XQud2W3Rc3H/Iqy6NGAV1ds+fI =EXxP -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 13:05:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95E8B106566B; Sun, 27 Dec 2009 13:05:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84C6C8FC12; Sun, 27 Dec 2009 13:05:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRD5uFr057257; Sun, 27 Dec 2009 13:05:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRD5uRc057255; Sun, 27 Dec 2009 13:05:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912271305.nBRD5uRc057255@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 27 Dec 2009 13:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201048 - head/tools/regression/acltools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 13:05:56 -0000 Author: trasz Date: Sun Dec 27 13:05:56 2009 New Revision: 201048 URL: http://svn.freebsd.org/changeset/base/201048 Log: Make tests for ACL preservation by mv(1) and cp(1) more complete and easier to follow. Modified: head/tools/regression/acltools/tools-crossfs.test Modified: head/tools/regression/acltools/tools-crossfs.test ============================================================================== --- head/tools/regression/acltools/tools-crossfs.test Sun Dec 27 11:56:32 2009 (r201047) +++ head/tools/regression/acltools/tools-crossfs.test Sun Dec 27 13:05:56 2009 (r201048) @@ -56,17 +56,14 @@ $ getfacl -nq posix/xxx > group::r-- > other::r-- -$ rm posix/xxx - -# mv without any ACLs. -$ chmod 456 nfs4/xxx -$ mv nfs4/xxx posix/ +# mv with POSIX.1e ACLs. +$ rm -f posix/xxx +$ rm -f posix/yyy +$ touch posix/xxx +$ chmod 456 posix/xxx $ ls -l posix/xxx | cut -d' ' -f1 > -r--r-xrw- - -# mv with POSIX.1e ACLs. $ setfacl -m u:42:x,g:43:w posix/xxx -$ rm -f posix/yyy $ mv posix/xxx posix/yyy $ getfacl -nq posix/yyy > user::r-- @@ -75,9 +72,30 @@ $ getfacl -nq posix/yyy > group:43:-w- > mask::rwx > other::rw- +$ ls -l posix/yyy | cut -d' ' -f1 +> -r--rwxrw-+ + +# mv from POSIX.1e to none. +$ rm -f posix/xxx +$ rm -f none/xxx +$ touch posix/xxx +$ chmod 345 posix/xxx +$ setfacl -m u:42:x,g:43:w posix/xxx +$ ls -l posix/xxx | cut -d' ' -f1 +> --wxrwxr-x+ +$ mv posix/xxx none/xxx +> mv: failed to set acl entries for none/xxx: Operation not supported +$ ls -l none/xxx | cut -d' ' -f1 +> --wxrwxr-x # mv from POSIX.1e to NFSv4. +$ rm -f posix/xxx $ rm -f nfs4/xxx +$ touch posix/xxx +$ chmod 456 posix/xxx +$ setfacl -m u:42:x,g:43:w posix/xxx +$ ls -l posix/xxx | cut -d' ' -f1 +> -r--rwxrw-+ $ mv posix/yyy nfs4/xxx > mv: failed to set acl entries for nfs4/xxx: Invalid argument $ getfacl -nq nfs4/xxx @@ -87,37 +105,82 @@ $ getfacl -nq nfs4/xxx > group@:rwxp----------:------:allow > everyone@:--x----A-W-Co-:------:deny > everyone@:rw-p--a-R-c--s:------:allow +$ ls -l nfs4/xxx | cut -d' ' -f1 +> -r--rwxrw- # mv with NFSv4 ACLs. -$ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx +$ rm -f nfs4/xxx $ rm -f nfs4/yyy +$ touch nfs4/xxx +$ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx $ mv nfs4/xxx nfs4/yyy $ getfacl -nq nfs4/yyy > user:42:--x-----------:------:allow > group:43:-w------------:------:allow -> owner@:-wxp----------:------:deny -> owner@:r------A-W-Co-:------:allow -> group@:--------------:------:deny -> group@:rwxp----------:------:allow -> everyone@:--x----A-W-Co-:------:deny -> everyone@:rw-p--a-R-c--s:------:allow +> owner@:--x-----------:------:deny +> owner@:rw-p---A-W-Co-:------:allow +> group@:-wxp----------:------:deny +> group@:r-------------:------:allow +> everyone@:-wxp---A-W-Co-:------:deny +> everyone@:r-----a-R-c--s:------:allow +$ ls -l nfs4/yyy | cut -d' ' -f1 +> -rw-r--r--+ -# mv from NFSv4 to POSIX.1e. +# mv from NFSv4 to POSIX.1e without any ACLs. +$ rm -f nfs4/xxx $ rm -f posix/xxx -$ mv nfs4/yyy posix/xxx -> mv: failed to set acl entries for posix/xxx: Invalid argument +$ touch nfs4/xxx +$ chmod 456 nfs4/xxx +$ ls -l nfs4/xxx | cut -d' ' -f1 +> -r--r-xrw- +$ mv nfs4/xxx posix/xxx $ ls -l posix/xxx | cut -d' ' -f1 -> -r--rwxrw- +> -r--r-xrw- -# mv from POSIX.1e to none. -$ setfacl -m u:42:x,g:43:w posix/xxx -$ mv posix/xxx none/xxx +# mv from NFSv4 to none. +$ rm -f nfs4/xxx +$ rm -f none/xxx +$ touch nfs4/xxx +$ chmod 345 nfs4/xxx +$ ls -l nfs4/xxx | cut -d' ' -f1 +> --wxr--r-x +$ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx +$ ls -l nfs4/xxx | cut -d' ' -f1 +> --wxr--r-x+ +$ mv nfs4/xxx none/xxx > mv: failed to set acl entries for none/xxx: Operation not supported $ ls -l none/xxx | cut -d' ' -f1 -> -r--rwxrw- +> --wxr--r-x + +# mv from NFSv4 to POSIX.1e. +$ rm -f nfs4/xxx +$ rm -f posix/xxx +$ touch nfs4/xxx +$ chmod 345 nfs4/xxx +$ ls -l nfs4/xxx | cut -d' ' -f1 +> --wxr--r-x +$ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx +$ ls -l nfs4/xxx | cut -d' ' -f1 +> --wxr--r-x+ +$ mv nfs4/xxx posix/xxx +> mv: failed to set acl entries for posix/xxx: Invalid argument +$ ls -l posix/xxx | cut -d' ' -f1 +> --wxr--r-x # cp with POSIX.1e ACLs. $ rm -f posix/xxx +$ rm -f posix/yyy +$ touch posix/xxx +$ setfacl -m u:42:x,g:43:w posix/xxx +$ ls -l posix/xxx | cut -d' ' -f1 +> -rw-rwxr--+ +$ cp posix/xxx posix/yyy +$ ls -l posix/yyy | cut -d' ' -f1 +> -rw-r-xr-- + +# cp -p with POSIX.1e ACLs. +$ rm -f posix/xxx +$ rm -f posix/yyy $ touch posix/xxx $ setfacl -m u:42:x,g:43:w posix/xxx $ getfacl -nq posix/xxx @@ -127,15 +190,8 @@ $ getfacl -nq posix/xxx > group:43:-w- > mask::rwx > other::r-- - -$ rm -f posix/yyy -$ cp posix/xxx posix/yyy -$ getfacl -nq posix/yyy -> user::rw- -> group::r-x -> other::r-- - -$ rm -f posix/yyy +$ ls -l posix/xxx | cut -d' ' -f1 +> -rw-rwxr--+ $ cp -p posix/xxx posix/yyy $ getfacl -nq posix/yyy > user::rw- @@ -144,35 +200,132 @@ $ getfacl -nq posix/yyy > group:43:-w- > mask::rwx > other::r-- +$ ls -l posix/yyy | cut -d' ' -f1 +> -rw-rwxr--+ -# mv from POSIX.1e to NFSv4. +# cp from POSIX.1e to none. +$ rm -f posix/xxx +$ rm -f none/xxx +$ touch posix/xxx +$ setfacl -m u:42:x,g:43:w posix/xxx +$ ls -l posix/xxx | cut -d' ' -f1 +> -rw-rwxr--+ +$ cp posix/xxx none/xxx +$ ls -l none/xxx | cut -d' ' -f1 +> -rw-r-xr-- + +# cp -p from POSIX.1e to none. +$ rm -f posix/xxx +$ rm -f none/xxx +$ touch posix/xxx +$ setfacl -m u:42:x,g:43:w posix/xxx +$ ls -l posix/xxx | cut -d' ' -f1 +> -rw-rwxr--+ +$ cp -p posix/xxx none/xxx +> cp: failed to set acl entries for none/xxx: Operation not supported +$ ls -l none/xxx | cut -d' ' -f1 +> -rw-rwxr-- + +# cp from POSIX.1e to NFSv4. +$ rm -f posix/xxx +$ rm -f nfs4/xxx +$ touch posix/xxx +$ setfacl -m u:42:x,g:43:w posix/xxx +$ ls -l posix/xxx | cut -d' ' -f1 +> -rw-rwxr--+ +$ cp posix/xxx nfs4/xxx +$ ls -l nfs4/xxx | cut -d' ' -f1 +> -rw-r-xr-- + +# cp -p from POSIX.1e to NFSv4. +$ rm -f posix/xxx $ rm -f nfs4/xxx +$ touch posix/xxx +$ setfacl -m u:42:x,g:43:w posix/xxx +$ ls -l posix/xxx | cut -d' ' -f1 +> -rw-rwxr--+ $ cp -p posix/xxx nfs4/xxx > cp: failed to set acl entries for nfs4/xxx: Invalid argument $ ls -l nfs4/xxx | cut -d' ' -f1 > -rw-rwxr-- # cp with NFSv4 ACLs. +$ rm -f nfs4/xxx +$ rm -f nfs4/yyy +$ touch nfs4/xxx +$ chmod 543 nfs4/xxx $ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx +$ ls -l nfs4/xxx | cut -d' ' -f1 +> -r-xr---wx+ +$ cp nfs4/xxx nfs4/yyy +$ ls -l nfs4/yyy | cut -d' ' -f1 +> -r-xr----x + +# cp -p with NFSv4 ACLs. +$ rm -f nfs4/xxx $ rm -f nfs4/yyy +$ touch nfs4/xxx +$ chmod 543 nfs4/xxx +$ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx $ cp -p nfs4/xxx nfs4/yyy $ getfacl -nq nfs4/yyy > user:42:--x-----------:------:allow > group:43:-w------------:------:allow -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:--------------:------:deny -> group@:rwxp----------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny -> everyone@:r-----a-R-c--s:------:allow +> owner@:-w-p----------:------:deny +> owner@:r-x----A-W-Co-:------:allow +> group@:-wxp----------:------:deny +> group@:r-------------:------:allow +> everyone@:r------A-W-Co-:------:deny +> everyone@:-wxp--a-R-c--s:------:allow +$ ls -l nfs4/yyy | cut -d' ' -f1 +> -r-xr---wx+ + +# cp from NFSv4 to none. +$ rm -f nfs4/xxx +$ rm -f none/xxx +$ touch nfs4/xxx +$ chmod 543 nfs4/xxx +$ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx +$ ls -l nfs4/xxx | cut -d' ' -f1 +> -r-xr---wx+ +$ cp nfs4/xxx none/xxx +$ ls -l none/xxx | cut -d' ' -f1 +> -r-xr----x + +# cp -p from NFSv4 to none. +$ rm -f nfs4/xxx +$ rm -f none/xxx +$ touch nfs4/xxx +$ chmod 543 nfs4/xxx +$ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx +$ ls -l nfs4/xxx | cut -d' ' -f1 +> -r-xr---wx+ +$ cp -p nfs4/xxx none/xxx +> cp: failed to set acl entries for none/xxx: Operation not supported +$ ls -l none/xxx | cut -d' ' -f1 +> -r-xr---wx # cp from NFSv4 to POSIX.1e. +$ rm -f nfs4/xxx $ rm -f posix/xxx +$ touch nfs4/xxx +$ chmod 543 nfs4/xxx +$ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx +$ ls -l nfs4/xxx | cut -d' ' -f1 +> -r-xr---wx+ +$ cp nfs4/xxx posix/xxx +$ ls -l posix/xxx | cut -d' ' -f1 +> -r-xr----x + +# cp -p from NFSv4 to POSIX.1e. +$ rm -f nfs4/xxx +$ rm -f posix/xxx +$ touch nfs4/xxx +$ chmod 543 nfs4/xxx +$ setfacl -a0 u:42:x:allow,g:43:w:allow nfs4/xxx +$ ls -l nfs4/xxx | cut -d' ' -f1 +> -r-xr---wx+ $ cp -p nfs4/xxx posix/xxx > cp: failed to set acl entries for posix/xxx: Invalid argument $ ls -l posix/xxx | cut -d' ' -f1 -> -rw-rwxr-- - -$ cp -p nfs4/yyy none/xxx -> cp: failed to set acl entries for none/xxx: Operation not supported - +> -r-xr---wx From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 16:00:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6FFC1065697; Sun, 27 Dec 2009 16:00:17 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D66BD8FC13; Sun, 27 Dec 2009 16:00:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRG0Hql060679; Sun, 27 Dec 2009 16:00:17 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRG0Hv6060677; Sun, 27 Dec 2009 16:00:17 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <200912271600.nBRG0Hv6060677@svn.freebsd.org> From: Dmitry Morozovsky Date: Sun, 27 Dec 2009 16:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201051 - head/usr.sbin/ypserv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 16:00:18 -0000 Author: marck (doc committer) Date: Sun Dec 27 16:00:17 2009 New Revision: 201051 URL: http://svn.freebsd.org/changeset/base/201051 Log: To remove a server, one should use double backslash, and half of them are eaten by shell. Fix this. MFC after: 2 weeks Modified: head/usr.sbin/ypserv/ypinit.sh Modified: head/usr.sbin/ypserv/ypinit.sh ============================================================================== --- head/usr.sbin/ypserv/ypinit.sh Sun Dec 27 13:56:35 2009 (r201050) +++ head/usr.sbin/ypserv/ypinit.sh Sun Dec 27 16:00:17 2009 (r201051) @@ -298,7 +298,7 @@ do echo "Update the list of hosts running YP servers in domain ${DOMAIN}." echo "Master for this domain is ${MASTER_NAME}." echo "" - echo "First verify old servers, type \\ to remove a server." + echo "First verify old servers, type \\\\ to remove a server." echo "Then add new servers, one per line. When done type a ." echo "" echo " master server : ${HOST}" From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 16:55:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9E861065679; Sun, 27 Dec 2009 16:55:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D806D8FC1A; Sun, 27 Dec 2009 16:55:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRGtiIY061782; Sun, 27 Dec 2009 16:55:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRGtiAm061778; Sun, 27 Dec 2009 16:55:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912271655.nBRGtiAm061778@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Dec 2009 16:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201052 - in head/sys: conf sparc64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 16:55:45 -0000 Author: marius Date: Sun Dec 27 16:55:44 2009 New Revision: 201052 URL: http://svn.freebsd.org/changeset/base/201052 Log: Add a driver for the `Fire' JBus to PCIe bridges found in at least the Sun Fire V215/V245 and Sun Ultra 25/45 machines. This driver also already includes all the code to support the `Oberon' Uranus to PCIe bridges found in the Fujitsu-Siemens based Mx000 machines but due to lack of access to such a system for testing, probing of these bridges is currently disabled. Unfortunately, the event queue mechanism of these bridges for MSIs/ MSI-Xs matches our current MD and MI interrupt frameworks like square pegs fit into round holes so for now we are generous and use one event queue per MSI, which limits us to 35 MSIs/MSI-Xs per Host-PCIe-bridge (we use one event queue for the PCIe error messages). This seems tolerable as long as most devices just use one MSI/MSI-X anyway. Adding knowledge about MSIs/MSI-Xs to the MD interrupt code should allow us to decouple the 1:1 mapping at the cost of no longer being able to bind MSIs/MSI-Xs to specific CPUs as we currently have no reliable way to quiesce a device during the transition of its MSIs/ MSI-Xs to another event queue. This would still require the problem of interrupt storms generated by devices which have no one-shot behavior or can't/don't mask interrupts while the filter/handler is executed (like the older PCIe NICs supported by bge(4)) to be solved though. Committed from: 26C3 Added: head/sys/sparc64/pci/fire.c (contents, props changed) head/sys/sparc64/pci/firereg.h (contents, props changed) head/sys/sparc64/pci/firevar.h (contents, props changed) Modified: head/sys/conf/options.sparc64 Modified: head/sys/conf/options.sparc64 ============================================================================== --- head/sys/conf/options.sparc64 Sun Dec 27 16:00:17 2009 (r201051) +++ head/sys/conf/options.sparc64 Sun Dec 27 16:55:44 2009 (r201052) @@ -8,6 +8,8 @@ SUN4U opt_global.h ATKBD_DFLT_KEYMAP opt_atkbd.h +FIRE_DEBUG opt_fire.h + # Debug IOMMU inserts/removes using diagnostic accesses. This is very loud. IOMMU_DIAG opt_iommu.h Added: head/sys/sparc64/pci/fire.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sparc64/pci/fire.c Sun Dec 27 16:55:44 2009 (r201052) @@ -0,0 +1,2122 @@ +/*- + * Copyright (c) 1999, 2000 Matthew R. Green + * Copyright (c) 2001 - 2003 by Thomas Moestl + * Copyright (c) 2009 by Marius Strobl + * 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. 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 ``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 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. + * + * from: NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp + * from: FreeBSD: psycho.c 183152 2008-09-18 19:45:22Z marius + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for `Fire' JBus to PCI Express and `Oberon' Uranus to PCI Express + * bridges + */ + +#include "opt_fire.h" +#include "opt_ofw_pci.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "pcib_if.h" + +static bus_space_tag_t fire_alloc_bus_tag(struct fire_softc *sc, int type); +static const struct fire_desc *fire_get_desc(device_t dev); +static void fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map, + bus_dmasync_op_t op); +static int fire_get_intrmap(struct fire_softc *sc, u_int ino, + bus_addr_t *intrmapptr, bus_addr_t *intrclrptr); +static void fire_intr_assign(void *arg); +static void fire_intr_clear(void *arg); +static void fire_intr_disable(void *arg); +static void fire_intr_enable(void *arg); +static int fire_intr_register(struct fire_softc *sc, u_int ino); +static void fire_msiq_handler(void *cookie); +static void fire_set_intr(struct fire_softc *sc, u_int index, u_int ino, + driver_filter_t handler, void *arg); +static timecounter_get_t fire_get_timecount; + +/* Interrupt handlers */ +static driver_filter_t fire_dmc_pec; +static driver_filter_t fire_pcie; +static driver_filter_t fire_xcb; + +/* + * Methods + */ +static bus_activate_resource_t fire_activate_resource; +static pcib_alloc_msi_t fire_alloc_msi; +static pcib_alloc_msix_t fire_alloc_msix; +static bus_alloc_resource_t fire_alloc_resource; +static device_attach_t fire_attach; +static bus_deactivate_resource_t fire_deactivate_resource; +static bus_get_dma_tag_t fire_get_dma_tag; +static ofw_bus_get_node_t fire_get_node; +static pcib_map_msi_t fire_map_msi; +static pcib_maxslots_t fire_maxslots; +static device_probe_t fire_probe; +static pcib_read_config_t fire_read_config; +static bus_read_ivar_t fire_read_ivar; +static pcib_release_msi_t fire_release_msi; +static pcib_release_msix_t fire_release_msix; +static bus_release_resource_t fire_release_resource; +static pcib_route_interrupt_t fire_route_interrupt; +static bus_setup_intr_t fire_setup_intr; +static bus_teardown_intr_t fire_teardown_intr; +static pcib_write_config_t fire_write_config; + +static device_method_t fire_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fire_probe), + DEVMETHOD(device_attach, fire_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_read_ivar, fire_read_ivar), + DEVMETHOD(bus_setup_intr, fire_setup_intr), + DEVMETHOD(bus_teardown_intr, fire_teardown_intr), + DEVMETHOD(bus_alloc_resource, fire_alloc_resource), + DEVMETHOD(bus_activate_resource, fire_activate_resource), + DEVMETHOD(bus_deactivate_resource, fire_deactivate_resource), + DEVMETHOD(bus_release_resource, fire_release_resource), + DEVMETHOD(bus_get_dma_tag, fire_get_dma_tag), + + /* pcib interface */ + DEVMETHOD(pcib_maxslots, fire_maxslots), + DEVMETHOD(pcib_read_config, fire_read_config), + DEVMETHOD(pcib_write_config, fire_write_config), + DEVMETHOD(pcib_route_interrupt, fire_route_interrupt), + DEVMETHOD(pcib_alloc_msi, fire_alloc_msi), + DEVMETHOD(pcib_release_msi, fire_release_msi), + DEVMETHOD(pcib_alloc_msix, fire_alloc_msix), + DEVMETHOD(pcib_release_msix, fire_release_msix), + DEVMETHOD(pcib_map_msi, fire_map_msi), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, fire_get_node), + + KOBJMETHOD_END +}; + +static devclass_t fire_devclass; + +DEFINE_CLASS_0(pcib, fire_driver, fire_methods, sizeof(struct fire_softc)); +EARLY_DRIVER_MODULE(fire, nexus, fire_driver, fire_devclass, 0, 0, + BUS_PASS_BUS); +MODULE_DEPEND(fire, nexus, 1, 1, 1); + +static const struct intr_controller fire_ic = { + fire_intr_enable, + fire_intr_disable, + fire_intr_assign, + fire_intr_clear +}; + +struct fire_icarg { + struct fire_softc *fica_sc; + bus_addr_t fica_map; + bus_addr_t fica_clr; +}; + +struct fire_msiqarg { + struct fire_icarg fmqa_fica; + struct mtx fmqa_mtx; + struct fo_msiq_record *fmqa_base; + uint64_t fmqa_head; + uint64_t fmqa_tail; + uint32_t fmqa_msiq; + uint32_t fmqa_msi; +}; + +#define FIRE_PERF_CNT_QLTY 100 + +#define FIRE_SPC_BARRIER(spc, sc, offs, len, flags) \ + bus_barrier((sc)->sc_mem_res[(spc)], (offs), (len), (flags)) +#define FIRE_SPC_READ_8(spc, sc, offs) \ + bus_read_8((sc)->sc_mem_res[(spc)], (offs)) +#define FIRE_SPC_WRITE_8(spc, sc, offs, v) \ + bus_write_8((sc)->sc_mem_res[(spc)], (offs), (v)) + +#ifndef FIRE_DEBUG +#define FIRE_SPC_SET(spc, sc, offs, reg, v) \ + FIRE_SPC_WRITE_8((spc), (sc), (offs), (v)) +#else +#define FIRE_SPC_SET(spc, sc, offs, reg, v) do { \ + device_printf((sc)->sc_dev, reg " 0x%016llx -> 0x%016llx\n", \ + (unsigned long long)FIRE_SPC_READ_8((spc), (sc), (offs)), \ + (unsigned long long)(v)); \ + FIRE_SPC_WRITE_8((spc), (sc), (offs), (v)); \ + } while (0) +#endif + +#define FIRE_PCI_BARRIER(sc, offs, len, flags) \ + FIRE_SPC_BARRIER(FIRE_PCI, (sc), (offs), len, flags) +#define FIRE_PCI_READ_8(sc, offs) \ + FIRE_SPC_READ_8(FIRE_PCI, (sc), (offs)) +#define FIRE_PCI_WRITE_8(sc, offs, v) \ + FIRE_SPC_WRITE_8(FIRE_PCI, (sc), (offs), (v)) +#define FIRE_CTRL_BARRIER(sc, offs, len, flags) \ + FIRE_SPC_BARRIER(FIRE_CTRL, (sc), (offs), len, flags) +#define FIRE_CTRL_READ_8(sc, offs) \ + FIRE_SPC_READ_8(FIRE_CTRL, (sc), (offs)) +#define FIRE_CTRL_WRITE_8(sc, offs, v) \ + FIRE_SPC_WRITE_8(FIRE_CTRL, (sc), (offs), (v)) + +#define FIRE_PCI_SET(sc, offs, v) \ + FIRE_SPC_SET(FIRE_PCI, (sc), (offs), # offs, (v)) +#define FIRE_CTRL_SET(sc, offs, v) \ + FIRE_SPC_SET(FIRE_CTRL, (sc), (offs), # offs, (v)) + +struct fire_desc { + const char *fd_string; + int fd_mode; + const char *fd_name; +}; + +static const struct fire_desc const fire_compats[] = { + { "pciex108e,80f0", FIRE_MODE_FIRE, "Fire" }, +#if 0 + { "pciex108e,80f8", FIRE_MODE_OBERON, "Oberon" }, +#endif + { NULL, 0, NULL } +}; + +static const struct fire_desc * +fire_get_desc(device_t dev) +{ + const struct fire_desc *desc; + const char *compat; + + compat = ofw_bus_get_compat(dev); + if (compat == NULL) + return (NULL); + for (desc = fire_compats; desc->fd_string != NULL; desc++) + if (strcmp(desc->fd_string, compat) == 0) + return (desc); + return (NULL); +} + +static int +fire_probe(device_t dev) +{ + const char *dtype; + + dtype = ofw_bus_get_type(dev); + if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCIE) == 0 && + fire_get_desc(dev) != NULL) { + device_set_desc(dev, "Sun Host-PCIe bridge"); + return (BUS_PROBE_GENERIC); + } + return (ENXIO); +} + +static int +fire_attach(device_t dev) +{ + struct fire_softc *sc; + const struct fire_desc *desc; + struct ofw_pci_msi_ranges msi_ranges; + struct ofw_pci_msi_addr_ranges msi_addr_ranges; + struct ofw_pci_msi_eq_to_devino msi_eq_to_devino; + struct fire_msiqarg *fmqa; + struct timecounter *tc; + struct ofw_pci_ranges *range; + uint64_t ino_bitmap, val; + phandle_t node; + uint32_t prop, prop_array[2]; + int i, j, mode, nrange; + u_int lw; + uint16_t mps; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + desc = fire_get_desc(dev); + mode = desc->fd_mode; + + sc->sc_dev = dev; + sc->sc_node = node; + sc->sc_mode = mode; + sc->sc_flags = 0; + + mtx_init(&sc->sc_msi_mtx, "msi_mtx", NULL, MTX_DEF); + mtx_init(&sc->sc_pcib_mtx, "pcib_mtx", NULL, MTX_SPIN); + + /* + * Fire and Oberon have two register banks: + * (0) per-PBM PCI Express configuration and status registers + * (1) (shared) Fire/Oberon controller configuration and status + * registers + */ + for (i = 0; i < FIRE_NREG; i++) { + j = i; + sc->sc_mem_res[i] = bus_alloc_resource_any(dev, + SYS_RES_MEMORY, &j, RF_ACTIVE); + if (sc->sc_mem_res[i] == NULL) + panic("%s: could not allocate register bank %d", + __func__, i); + } + + if (OF_getprop(node, "portid", &sc->sc_ign, sizeof(sc->sc_ign)) == -1) + panic("%s: could not determine IGN", __func__); + if (OF_getprop(node, "module-revision#", &prop, sizeof(prop)) == -1) + panic("%s: could not determine revision", __func__); + + device_printf(dev, "%s, module-revision %d, IGN %#x\n", + desc->fd_name, prop, sc->sc_ign); + + /* + * Hunt through all the interrupt mapping regs and register + * the interrupt controller for our interrupt vectors. We do + * this early in order to be able to catch stray interrupts. + */ + i = OF_getprop(node, "ino-bitmap", (void *)prop_array, + sizeof(prop_array)); + if (i == -1) + panic("%s: could not get ino-bitmap", __func__); + ino_bitmap = ((uint64_t)prop_array[1] << 32) | prop_array[0]; + for (i = 0; i <= FO_MAX_INO; i++) { + if ((ino_bitmap & (1ULL << i)) == 0) + continue; + j = fire_intr_register(sc, i); + if (j != 0) + device_printf(dev, "could not register interrupt " + "controller for INO %d (%d)\n", i, j); + } + + /* JBC/UBC module initialization */ + FIRE_CTRL_SET(sc, FO_XBC_ERR_LOG_EN, ~0ULL); + FIRE_CTRL_SET(sc, FO_XBC_ERR_STAT_CLR, ~0ULL); + /* not enabled by OpenSolaris */ + FIRE_CTRL_SET(sc, FO_XBC_INT_EN, ~0ULL); + if (sc->sc_mode == FIRE_MODE_FIRE) { + FIRE_CTRL_SET(sc, FIRE_JBUS_PAR_CTRL, + FIRE_JBUS_PAR_CTRL_P_EN); + FIRE_CTRL_SET(sc, FIRE_JBC_FATAL_RST_EN, + ((1ULL << FIRE_JBC_FATAL_RST_EN_SPARE_P_INT_SHFT) & + FIRE_JBC_FATAL_RST_EN_SPARE_P_INT_MASK) | + FIRE_JBC_FATAL_RST_EN_MB_PEA_P_INT | + FIRE_JBC_FATAL_RST_EN_CPE_P_INT | + FIRE_JBC_FATAL_RST_EN_APE_P_INT | + FIRE_JBC_FATAL_RST_EN_PIO_CPE_INT | + FIRE_JBC_FATAL_RST_EN_JTCEEW_P_INT | + FIRE_JBC_FATAL_RST_EN_JTCEEI_P_INT | + FIRE_JBC_FATAL_RST_EN_JTCEER_P_INT); + FIRE_CTRL_SET(sc, FIRE_JBC_CORE_BLOCK_INT_EN, ~0ULL); + } + + /* TLU initialization */ + FIRE_PCI_SET(sc, FO_PCI_TLU_OEVENT_STAT_CLR, + FO_PCI_TLU_OEVENT_S_MASK | FO_PCI_TLU_OEVENT_P_MASK); + /* not enabled by OpenSolaris */ + FIRE_PCI_SET(sc, FO_PCI_TLU_OEVENT_INT_EN, + FO_PCI_TLU_OEVENT_S_MASK | FO_PCI_TLU_OEVENT_P_MASK); + FIRE_PCI_SET(sc, FO_PCI_TLU_UERR_STAT_CLR, + FO_PCI_TLU_UERR_INT_S_MASK | FO_PCI_TLU_UERR_INT_P_MASK); + /* not enabled by OpenSolaris */ + FIRE_PCI_SET(sc, FO_PCI_TLU_UERR_INT_EN, + FO_PCI_TLU_UERR_INT_S_MASK | FO_PCI_TLU_UERR_INT_P_MASK); + FIRE_PCI_SET(sc, FO_PCI_TLU_CERR_STAT_CLR, + FO_PCI_TLU_CERR_INT_S_MASK | FO_PCI_TLU_CERR_INT_P_MASK); + /* not enabled by OpenSolaris */ + FIRE_PCI_SET(sc, FO_PCI_TLU_CERR_INT_EN, + FO_PCI_TLU_CERR_INT_S_MASK | FO_PCI_TLU_CERR_INT_P_MASK); + val = FIRE_PCI_READ_8(sc, FO_PCI_TLU_CTRL) | + ((FO_PCI_TLU_CTRL_L0S_TIM_DFLT << FO_PCI_TLU_CTRL_L0S_TIM_SHFT) & + FO_PCI_TLU_CTRL_L0S_TIM_MASK) | + ((FO_PCI_TLU_CTRL_CFG_DFLT << FO_PCI_TLU_CTRL_CFG_SHFT) & + FO_PCI_TLU_CTRL_CFG_MASK); + if (sc->sc_mode == FIRE_MODE_OBERON) + val &= ~FO_PCI_TLU_CTRL_NWPR_EN; + val |= FO_PCI_TLU_CTRL_CFG_REMAIN_DETECT_QUIET; + FIRE_PCI_SET(sc, FO_PCI_TLU_CTRL, val); + FIRE_PCI_SET(sc, FO_PCI_TLU_DEV_CTRL, 0); + FIRE_PCI_SET(sc, FO_PCI_TLU_LNK_CTRL, FO_PCI_TLU_LNK_CTRL_CLK); + + /* DLU/LPU initialization */ + if (sc->sc_mode == FIRE_MODE_OBERON) + FIRE_PCI_SET(sc, FO_PCI_LPU_INT_MASK, 0); + else + FIRE_PCI_SET(sc, FO_PCI_LPU_RST, 0); + FIRE_PCI_SET(sc, FO_PCI_LPU_LNK_LYR_CFG, + FO_PCI_LPU_LNK_LYR_CFG_VC0_EN); + FIRE_PCI_SET(sc, FO_PCI_LPU_FLW_CTRL_UPDT_CTRL, + FO_PCI_LPU_FLW_CTRL_UPDT_CTRL_FC0_NP_EN | + FO_PCI_LPU_FLW_CTRL_UPDT_CTRL_FC0_P_EN); + if (sc->sc_mode == FIRE_MODE_OBERON) + FIRE_PCI_SET(sc, FO_PCI_LPU_TXLNK_RPLY_TMR_THRS, + (OBERON_PCI_LPU_TXLNK_RPLY_TMR_THRS_DFLT << + FO_PCI_LPU_TXLNK_RPLY_TMR_THRS_SHFT) & + FO_PCI_LPU_TXLNK_RPLY_TMR_THRS_MASK); + else { + switch ((FIRE_PCI_READ_8(sc, FO_PCI_TLU_LNK_STAT) & + FO_PCI_TLU_LNK_STAT_WDTH_MASK) >> + FO_PCI_TLU_LNK_STAT_WDTH_SHFT) { + case 1: + lw = 0; + break; + case 4: + lw = 1; + break; + case 8: + lw = 2; + break; + case 16: + lw = 3; + break; + default: + lw = 0; + } + mps = (FIRE_PCI_READ_8(sc, FO_PCI_TLU_CTRL) & + FO_PCI_TLU_CTRL_CFG_MASK) >> FO_PCI_TLU_CTRL_CFG_SHFT; + i = sizeof(fire_freq_nak_tmr_thrs) / + sizeof(*fire_freq_nak_tmr_thrs); + if (mps >= i); + mps = i - 1; + FIRE_PCI_SET(sc, FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS, + (fire_freq_nak_tmr_thrs[mps][lw] << + FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS_SHFT) & + FO_PCI_LPU_TXLNK_FREQ_LAT_TMR_THRS_MASK); + FIRE_PCI_SET(sc, FO_PCI_LPU_TXLNK_RPLY_TMR_THRS, + (fire_rply_tmr_thrs[mps][lw] << + FO_PCI_LPU_TXLNK_RPLY_TMR_THRS_SHFT) & + FO_PCI_LPU_TXLNK_RPLY_TMR_THRS_MASK); + FIRE_PCI_SET(sc, FO_PCI_LPU_TXLNK_RTR_FIFO_PTR, + ((FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_TL_DFLT << + FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_TL_SHFT) & + FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_TL_MASK) | + ((FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_HD_DFLT << + FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_HD_SHFT) & + FO_PCI_LPU_TXLNK_RTR_FIFO_PTR_HD_MASK)); + FIRE_PCI_SET(sc, FO_PCI_LPU_LTSSM_CFG2, + (FO_PCI_LPU_LTSSM_CFG2_12_TO_DFLT << + FO_PCI_LPU_LTSSM_CFG2_12_TO_SHFT) & + FO_PCI_LPU_LTSSM_CFG2_12_TO_MASK); + FIRE_PCI_SET(sc, FO_PCI_LPU_LTSSM_CFG3, + (FO_PCI_LPU_LTSSM_CFG3_2_TO_DFLT << + FO_PCI_LPU_LTSSM_CFG3_2_TO_SHFT) & + FO_PCI_LPU_LTSSM_CFG3_2_TO_MASK); + FIRE_PCI_SET(sc, FO_PCI_LPU_LTSSM_CFG4, + ((FO_PCI_LPU_LTSSM_CFG4_DATA_RATE_DFLT << + FO_PCI_LPU_LTSSM_CFG4_DATA_RATE_SHFT) & + FO_PCI_LPU_LTSSM_CFG4_DATA_RATE_MASK) | + ((FO_PCI_LPU_LTSSM_CFG4_N_FTS_DFLT << + FO_PCI_LPU_LTSSM_CFG4_N_FTS_SHFT) & + FO_PCI_LPU_LTSSM_CFG4_N_FTS_MASK)); + FIRE_PCI_SET(sc, FO_PCI_LPU_LTSSM_CFG5, 0); + } + + /* ILU initialization */ + FIRE_PCI_SET(sc, FO_PCI_ILU_ERR_STAT_CLR, ~0ULL); + /* not enabled by OpenSolaris */ + FIRE_PCI_SET(sc, FO_PCI_ILU_INT_EN, ~0ULL); + + /* IMU initialization */ + FIRE_PCI_SET(sc, FO_PCI_IMU_ERR_STAT_CLR, ~0ULL); + FIRE_PCI_SET(sc, FO_PCI_IMU_INT_EN, + FIRE_PCI_READ_8(sc, FO_PCI_IMU_INT_EN) & + ~(FO_PCI_IMU_ERR_INT_FATAL_MES_NOT_EN_S | + FO_PCI_IMU_ERR_INT_NFATAL_MES_NOT_EN_S | + FO_PCI_IMU_ERR_INT_COR_MES_NOT_EN_S | + FO_PCI_IMU_ERR_INT_FATAL_MES_NOT_EN_P | + FO_PCI_IMU_ERR_INT_NFATAL_MES_NOT_EN_P | + FO_PCI_IMU_ERR_INT_COR_MES_NOT_EN_P)); + + /* MMU initialization */ + FIRE_PCI_SET(sc, FO_PCI_MMU_ERR_STAT_CLR, + FO_PCI_MMU_ERR_INT_S_MASK | FO_PCI_MMU_ERR_INT_P_MASK); + /* not enabled by OpenSolaris */ + FIRE_PCI_SET(sc, FO_PCI_MMU_INT_EN, + FO_PCI_MMU_ERR_INT_S_MASK | FO_PCI_MMU_ERR_INT_P_MASK); + + /* DMC initialization */ + FIRE_PCI_SET(sc, FO_PCI_DMC_CORE_BLOCK_INT_EN, ~0ULL); + FIRE_PCI_SET(sc, FO_PCI_DMC_DBG_SEL_PORTA, 0); + FIRE_PCI_SET(sc, FO_PCI_DMC_DBG_SEL_PORTB, 0); + + /* PEC initialization */ + FIRE_PCI_SET(sc, FO_PCI_PEC_CORE_BLOCK_INT_EN, ~0ULL); + + /* Establish handlers for interesting interrupts. */ + if ((ino_bitmap & (1ULL << FO_DMC_PEC_INO)) != 0) + fire_set_intr(sc, 1, FO_DMC_PEC_INO, fire_dmc_pec, sc); + if ((ino_bitmap & (1ULL << FO_XCB_INO)) != 0) + fire_set_intr(sc, 0, FO_XCB_INO, fire_xcb, sc); + + /* MSI/MSI-X support */ + if (OF_getprop(node, "#msi", &sc->sc_msi_count, + sizeof(sc->sc_msi_count)) == -1) + panic("%s: could not determine MSI count", __func__); + if (OF_getprop(node, "msi-ranges", &msi_ranges, + sizeof(msi_ranges)) == -1) + sc->sc_msi_first = 0; + else + sc->sc_msi_first = msi_ranges.first; + if (OF_getprop(node, "msi-data-mask", &sc->sc_msi_data_mask, + sizeof(sc->sc_msi_data_mask)) == -1) + panic("%s: could not determine MSI data mask", __func__); + if (OF_getprop(node, "msix-data-width", &sc->sc_msix_data_width, + sizeof(sc->sc_msix_data_width)) > 0) + sc->sc_flags |= FIRE_MSIX; + if (OF_getprop(node, "msi-address-ranges", &msi_addr_ranges, + sizeof(msi_addr_ranges)) == -1) + panic("%s: could not determine MSI address ranges", __func__); + sc->sc_msi_addr32 = OFW_PCI_MSI_ADDR_RANGE_32(&msi_addr_ranges); + sc->sc_msi_addr64 = OFW_PCI_MSI_ADDR_RANGE_64(&msi_addr_ranges); + if (OF_getprop(node, "#msi-eqs", &sc->sc_msiq_count, + sizeof(sc->sc_msiq_count)) == -1) + panic("%s: could not determine MSI event queue count", + __func__); + if (OF_getprop(node, "msi-eq-size", &sc->sc_msiq_size, + sizeof(sc->sc_msiq_size)) == -1) + panic("%s: could not determine MSI event queue size", + __func__); + if (OF_getprop(node, "msi-eq-to-devino", &msi_eq_to_devino, + sizeof(msi_eq_to_devino)) == -1 && + OF_getprop(node, "msi-eq-devino", &msi_eq_to_devino, + sizeof(msi_eq_to_devino)) == -1) { + sc->sc_msiq_first = 0; + sc->sc_msiq_ino_first = FO_EQ_FIRST_INO; + } else { + sc->sc_msiq_first = msi_eq_to_devino.eq_first; + sc->sc_msiq_ino_first = msi_eq_to_devino.devino_first; + } + if (sc->sc_msiq_ino_first < FO_EQ_FIRST_INO || + sc->sc_msiq_ino_first + sc->sc_msiq_count - 1 > FO_EQ_LAST_INO) + panic("%s: event queues exceed INO range", __func__); + sc->sc_msi_bitmap = malloc(roundup2(sc->sc_msi_count, NBBY) / NBBY, + M_DEVBUF, M_NOWAIT | M_ZERO); + if (sc->sc_msi_bitmap == NULL) + panic("%s: could not malloc MSI bitmap", __func__); + sc->sc_msi_msiq_table = malloc(sc->sc_msi_count * + sizeof(*sc->sc_msi_msiq_table), M_DEVBUF, M_NOWAIT | M_ZERO); + if (sc->sc_msi_msiq_table == NULL) + panic("%s: could not malloc MSI-MSI event queue table", + __func__); + sc->sc_msiq_bitmap = malloc(roundup2(sc->sc_msiq_count, NBBY) / NBBY, + M_DEVBUF, M_NOWAIT | M_ZERO); + if (sc->sc_msiq_bitmap == NULL) + panic("%s: could not malloc MSI event queue bitmap", __func__); + j = FO_EQ_RECORD_SIZE * FO_EQ_NRECORDS * sc->sc_msiq_count; + sc->sc_msiq = contigmalloc(j, M_DEVBUF, M_NOWAIT, 0, ~0UL, + FO_EQ_ALIGNMENT, 0); + if (sc->sc_msiq == NULL) + panic("%s: could not contigmalloc MSI event queue", __func__); + memset(sc->sc_msiq, 0, j); + FIRE_PCI_SET(sc, FO_PCI_EQ_BASE_ADDR, FO_PCI_EQ_BASE_ADDR_BYPASS | + (pmap_kextract((vm_offset_t)sc->sc_msiq) & + FO_PCI_EQ_BASE_ADDR_MASK)); + for (i = 0; i < sc->sc_msi_count; i++) { + j = (i + sc->sc_msi_first) << 3; + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + j, + FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + j) & + ~FO_PCI_MSI_MAP_V); + } + for (i = 0; i < sc->sc_msiq_count; i++) { + j = i + sc->sc_msiq_ino_first; + if ((ino_bitmap & (1ULL << j)) == 0) { + mtx_lock(&sc->sc_msi_mtx); + setbit(sc->sc_msiq_bitmap, i); + mtx_unlock(&sc->sc_msi_mtx); + } + fmqa = intr_vectors[INTMAP_VEC(sc->sc_ign, j)].iv_icarg; + mtx_init(&fmqa->fmqa_mtx, "msiq_mtx", NULL, MTX_SPIN); + fmqa->fmqa_base = + (struct fo_msiq_record *)((caddr_t)sc->sc_msiq + + (FO_EQ_RECORD_SIZE * FO_EQ_NRECORDS * i)); + j = i + sc->sc_msiq_first; + fmqa->fmqa_msiq = j; + j <<= 3; + fmqa->fmqa_head = FO_PCI_EQ_HD_BASE + j; + fmqa->fmqa_tail = FO_PCI_EQ_TL_BASE + j; + FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_CLR_BASE + j, + FO_PCI_EQ_CTRL_CLR_COVERR | FO_PCI_EQ_CTRL_CLR_E2I | + FO_PCI_EQ_CTRL_CLR_DIS); + FIRE_PCI_WRITE_8(sc, fmqa->fmqa_tail, + (0 << FO_PCI_EQ_TL_SHFT) & FO_PCI_EQ_TL_MASK); + FIRE_PCI_WRITE_8(sc, fmqa->fmqa_head, + (0 << FO_PCI_EQ_HD_SHFT) & FO_PCI_EQ_HD_MASK); + } + FIRE_PCI_SET(sc, FO_PCI_MSI_32_BIT_ADDR, sc->sc_msi_addr32 & + FO_PCI_MSI_32_BIT_ADDR_MASK); + FIRE_PCI_SET(sc, FO_PCI_MSI_64_BIT_ADDR, sc->sc_msi_addr64 & + FO_PCI_MSI_64_BIT_ADDR_MASK); + + /* + * Establish a handler for interesting PCIe messages and disable + * unintersting ones. + */ + mtx_lock(&sc->sc_msi_mtx); + for (i = 0; i < sc->sc_msiq_count; i++) { + if (isclr(sc->sc_msiq_bitmap, i) != 0) { + j = i; + break; + } + } + if (i == sc->sc_msiq_count) { + mtx_unlock(&sc->sc_msi_mtx); + panic("%s: no spare event queue for PCIe messages", __func__); + } + setbit(sc->sc_msiq_bitmap, j); + mtx_unlock(&sc->sc_msi_mtx); + i = INTMAP_VEC(sc->sc_ign, j + sc->sc_msiq_ino_first); + if (bus_set_resource(dev, SYS_RES_IRQ, 2, i, 1) != 0) + panic("%s: failed to add interrupt for PCIe messages", + __func__); + fire_set_intr(sc, 2, INTINO(i), fire_pcie, intr_vectors[i].iv_icarg); + j += sc->sc_msiq_first; + /* + * "Please note that setting the EQNUM field to a value larger than + * 35 will yield unpredictable results." + */ + if (j > 35) + panic("%s: invalid queue for PCIe messages (%d)", + __func__, j); + FIRE_PCI_SET(sc, FO_PCI_ERR_COR, FO_PCI_ERR_PME_V | + ((j << FO_PCI_ERR_PME_EQNUM_SHFT) & FO_PCI_ERR_PME_EQNUM_MASK)); + FIRE_PCI_SET(sc, FO_PCI_ERR_NONFATAL, FO_PCI_ERR_PME_V | + ((j << FO_PCI_ERR_PME_EQNUM_SHFT) & FO_PCI_ERR_PME_EQNUM_MASK)); + FIRE_PCI_SET(sc, FO_PCI_ERR_FATAL, FO_PCI_ERR_PME_V | + ((j << FO_PCI_ERR_PME_EQNUM_SHFT) & FO_PCI_ERR_PME_EQNUM_MASK)); + FIRE_PCI_SET(sc, FO_PCI_PM_PME, 0); + FIRE_PCI_SET(sc, FO_PCI_PME_TO_ACK, 0); + FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_SET_BASE + (j << 3), + FO_PCI_EQ_CTRL_SET_EN); + +#define TC_COUNTER_MAX_MASK 0xffffffff + + /* + * Setup JBC/UBC performance counter 0 in bus cycle counting + * mode as timecounter. Unfortunately, at least with Fire all + * JBus-driven performance counters just don't advance in bus + * cycle counting mode. + */ + if (device_get_unit(dev) == 0) { + FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT0, 0); + FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT1, 0); + FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT_SEL, + (FO_XBC_PRF_CNT_NONE << FO_XBC_PRF_CNT_CNT1_SHFT) | + (FO_XBC_PRF_CNT_XB_CLK << FO_XBC_PRF_CNT_CNT0_SHFT)); +#ifdef FIRE_DEBUG + device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", + (long long unsigned)FIRE_CTRL_READ_8(sc, + FO_XBC_PRF_CNT0)); + device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", + (long long unsigned)FIRE_CTRL_READ_8(sc, + FO_XBC_PRF_CNT0)); +#endif + tc = malloc(sizeof(*tc), M_DEVBUF, M_NOWAIT | M_ZERO); + if (tc == NULL) + panic("%s: could not malloc timecounter", __func__); + tc->tc_get_timecount = fire_get_timecount; + tc->tc_poll_pps = NULL; + tc->tc_counter_mask = TC_COUNTER_MAX_MASK; + if (OF_getprop(OF_peer(0), "clock-frequency", &prop, + sizeof(prop)) == -1) + panic("%s: could not determine clock frequency", + __func__); + tc->tc_frequency = prop; + tc->tc_name = strdup(device_get_nameunit(dev), M_DEVBUF); + tc->tc_quality = -FIRE_PERF_CNT_QLTY; + tc->tc_priv = sc; + tc_init(tc); + } + + /* + * Set up the IOMMU. Both Fire and Oberon have one per PBM, but + * neither has a streaming buffer. + */ + memcpy(&sc->sc_dma_methods, &iommu_dma_methods, + sizeof(sc->sc_dma_methods)); + sc->sc_is.is_flags = IOMMU_FIRE | IOMMU_PRESERVE_PROM; + if (sc->sc_mode == FIRE_MODE_OBERON) { + sc->sc_is.is_flags |= IOMMU_FLUSH_CACHE; + sc->sc_is.is_pmaxaddr = IOMMU_MAXADDR(OBERON_IOMMU_BITS); + } else { + sc->sc_dma_methods.dm_dmamap_sync = fire_dmamap_sync; + sc->sc_is.is_pmaxaddr = IOMMU_MAXADDR(FIRE_IOMMU_BITS); + } + sc->sc_is.is_sb[0] = sc->sc_is.is_sb[1] = 0; + /* Punch in our copies. */ + sc->sc_is.is_bustag = rman_get_bustag(sc->sc_mem_res[FIRE_PCI]); + sc->sc_is.is_bushandle = rman_get_bushandle(sc->sc_mem_res[FIRE_PCI]); + sc->sc_is.is_iommu = FO_PCI_MMU; + val = FIRE_PCI_READ_8(sc, FO_PCI_MMU + IMR_CTL); + iommu_init(device_get_nameunit(sc->sc_dev), &sc->sc_is, 7, -1, 0); +#ifdef FIRE_DEBUG + device_printf(dev, "FO_PCI_MMU + IMR_CTL 0x%016llx -> 0x%016llx\n", + (long long unsigned)val, (long long unsigned)sc->sc_is.is_cr); +#endif + + /* Initialize memory and I/O rmans. */ + sc->sc_pci_io_rman.rm_type = RMAN_ARRAY; + sc->sc_pci_io_rman.rm_descr = "Fire PCI I/O Ports"; + if (rman_init(&sc->sc_pci_io_rman) != 0 || + rman_manage_region(&sc->sc_pci_io_rman, 0, FO_IO_SIZE) != 0) + panic("%s: failed to set up I/O rman", __func__); + sc->sc_pci_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_pci_mem_rman.rm_descr = "Fire PCI Memory"; + if (rman_init(&sc->sc_pci_mem_rman) != 0 || + rman_manage_region(&sc->sc_pci_mem_rman, 0, FO_MEM_SIZE) != 0) + panic("%s: failed to set up memory rman", __func__); + + nrange = OF_getprop_alloc(node, "ranges", sizeof(*range), + (void **)&range); + /* + * Make sure that the expected ranges are present. The + * OFW_PCI_CS_MEM64 one is not currently used though. + */ + if (nrange != FIRE_NRANGE) + panic("%s: unsupported number of ranges", __func__); + /* + * Find the addresses of the various bus spaces. + * There should not be multiple ones of one kind. + * The physical start addresses of the ranges are the configuration, + * memory and I/O handles. + */ + for (i = 0; i < FIRE_NRANGE; i++) { + j = OFW_PCI_RANGE_CS(&range[i]); + if (sc->sc_pci_bh[j] != 0) + panic("%s: duplicate range for space %d", + __func__, j); + sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); + } + free(range, M_OFWPROP); + + /* Allocate our tags. */ + sc->sc_pci_memt = fire_alloc_bus_tag(sc, PCI_MEMORY_BUS_SPACE); + sc->sc_pci_iot = fire_alloc_bus_tag(sc, PCI_IO_BUS_SPACE); + sc->sc_pci_cfgt = fire_alloc_bus_tag(sc, PCI_CONFIG_BUS_SPACE); + if (bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0, + sc->sc_is.is_pmaxaddr, ~0, NULL, NULL, sc->sc_is.is_pmaxaddr, + 0xff, 0xffffffff, 0, NULL, NULL, &sc->sc_pci_dmat) != 0) + panic("%s: bus_dma_tag_create failed", __func__); + /* Customize the tag. */ + sc->sc_pci_dmat->dt_cookie = &sc->sc_is; + sc->sc_pci_dmat->dt_mt = &sc->sc_dma_methods; + + /* + * Get the bus range from the firmware. + * NB: Neither Fire nor Oberon support PCI bus reenumeration. + */ + i = OF_getprop(node, "bus-range", (void *)prop_array, + sizeof(prop_array)); + if (i == -1) + panic("%s: could not get bus-range", __func__); + if (i != sizeof(prop_array)) + panic("%s: broken bus-range (%d)", __func__, i); + sc->sc_pci_secbus = prop_array[0]; + sc->sc_pci_subbus = prop_array[1]; + if (bootverbose != 0) + device_printf(dev, "bus range %u to %u; PCI bus %d\n", + sc->sc_pci_secbus, sc->sc_pci_subbus, sc->sc_pci_secbus); + + ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(ofw_pci_intr_t)); + +#define FIRE_SYSCTL_ADD_UINT(name, arg, desc) \ + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), \ + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, \ + (name), CTLFLAG_RD, (arg), 0, (desc)) + + FIRE_SYSCTL_ADD_UINT("ilu_err", &sc->sc_stats_ilu_err, + "ILU unknown errors"); + FIRE_SYSCTL_ADD_UINT("jbc_ce_async", &sc->sc_stats_jbc_ce_async, + "JBC correctable errors"); + FIRE_SYSCTL_ADD_UINT("jbc_unsol_int", &sc->sc_stats_jbc_unsol_int, + "JBC unsolicited interrupt ACK/NACK errors"); + FIRE_SYSCTL_ADD_UINT("jbc_unsol_rd", &sc->sc_stats_jbc_unsol_rd, + "JBC unsolicited read response errors"); + FIRE_SYSCTL_ADD_UINT("mmu_err", &sc->sc_stats_mmu_err, "MMU errors"); + FIRE_SYSCTL_ADD_UINT("tlu_ce", &sc->sc_stats_tlu_ce, + "DLU/TLU correctable errors"); + FIRE_SYSCTL_ADD_UINT("tlu_oe_non_fatal", + &sc->sc_stats_tlu_oe_non_fatal, + "DLU/TLU other event non-fatal errors summary"), + FIRE_SYSCTL_ADD_UINT("tlu_oe_rx_err", &sc->sc_stats_tlu_oe_rx_err, + "DLU/TLU receive other event errors"), + FIRE_SYSCTL_ADD_UINT("tlu_oe_tx_err", &sc->sc_stats_tlu_oe_tx_err, + "DLU/TLU transmit other event errors"), + FIRE_SYSCTL_ADD_UINT("ubc_dmardue", &sc->sc_stats_ubc_dmardue, + "UBC DMARDUE erros"); + +#undef FIRE_SYSCTL_ADD_UINT + + device_add_child(dev, "pci", -1); + return (bus_generic_attach(dev)); +} + +static void +fire_set_intr(struct fire_softc *sc, u_int index, u_int ino, + driver_filter_t handler, void *arg) +{ + u_long vec; + int rid; + + rid = index; + sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); + if (sc->sc_irq_res[index] == NULL || + INTINO(vec = rman_get_start(sc->sc_irq_res[index])) != ino || + INTIGN(vec) != sc->sc_ign || + intr_vectors[vec].iv_ic != &fire_ic || + bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], + INTR_TYPE_MISC | INTR_FAST, handler, NULL, arg, + &sc->sc_ihand[index]) != 0) + panic("%s: failed to set up interrupt %d", __func__, index); +} + +static int +fire_intr_register(struct fire_softc *sc, u_int ino) +{ + struct fire_icarg *fica; + bus_addr_t intrclr, intrmap; + int error; + + if (fire_get_intrmap(sc, ino, &intrmap, &intrclr) == 0) + return (ENXIO); + fica = malloc((ino >= FO_EQ_FIRST_INO && ino <= FO_EQ_LAST_INO) ? + sizeof(struct fire_msiqarg) : sizeof(struct fire_icarg), M_DEVBUF, + M_NOWAIT); + if (fica == NULL) + return (ENOMEM); + fica->fica_sc = sc; + fica->fica_map = intrmap; + fica->fica_clr = intrclr; + error = (intr_controller_register(INTMAP_VEC(sc->sc_ign, ino), + &fire_ic, fica)); + if (error != 0) + free(fica, M_DEVBUF); + return (error); +} + +static int +fire_get_intrmap(struct fire_softc *sc, u_int ino, bus_addr_t *intrmapptr, + bus_addr_t *intrclrptr) +{ + + if (ino > FO_MAX_INO) { + device_printf(sc->sc_dev, "out of range INO %d requested\n", + ino); + return (0); + } + + ino <<= 3; + if (intrmapptr != NULL) + *intrmapptr = FO_PCI_INT_MAP_BASE + ino; + if (intrclrptr != NULL) + *intrclrptr = FO_PCI_INT_CLR_BASE + ino; + return (1); +} + +/* + * Interrupt handlers + */ +static int +fire_dmc_pec(void *arg) +{ + struct fire_softc *sc; + device_t dev; + uint64_t cestat, dmcstat, ilustat, imustat, mcstat, mmustat, mmutfar; + uint64_t mmutfsr, oestat, pecstat, uestat, val; + u_int fatal, oenfatal; + + fatal = 0; + sc = arg; + dev = sc->sc_dev; + mtx_lock_spin(&sc->sc_pcib_mtx); + mcstat = FIRE_PCI_READ_8(sc, FO_PCI_MULTI_CORE_ERR_STAT); + if ((mcstat & FO_PCI_MULTI_CORE_ERR_STAT_DMC) != 0) { + dmcstat = FIRE_PCI_READ_8(sc, FO_PCI_DMC_CORE_BLOCK_ERR_STAT); + if ((dmcstat & FO_PCI_DMC_CORE_BLOCK_INT_EN_IMU) != 0) { + imustat = FIRE_PCI_READ_8(sc, FO_PCI_IMU_INT_STAT); + device_printf(dev, "IMU error %#llx\n", + (unsigned long long)imustat); + if ((imustat & + FO_PCI_IMU_ERR_INT_EQ_NOT_EN_P) != 0) { + fatal = 1; + val = FIRE_PCI_READ_8(sc, + FO_PCI_IMU_SCS_ERR_LOG); + device_printf(dev, "SCS error log %#llx\n", + (unsigned long long)val); + } + if ((imustat & FO_PCI_IMU_ERR_INT_EQ_OVER_P) != 0) { + fatal = 1; + val = FIRE_PCI_READ_8(sc, + FO_PCI_IMU_EQS_ERR_LOG); + device_printf(dev, "EQS error log %#llx\n", + (unsigned long long)val); + } + if ((imustat & (FO_PCI_IMU_ERR_INT_MSI_MAL_ERR_P | + FO_PCI_IMU_ERR_INT_MSI_PAR_ERR_P | + FO_PCI_IMU_ERR_INT_PMEACK_MES_NOT_EN_P | + FO_PCI_IMU_ERR_INT_PMPME_MES_NOT_EN_P | + FO_PCI_IMU_ERR_INT_FATAL_MES_NOT_EN_P | + FO_PCI_IMU_ERR_INT_NFATAL_MES_NOT_EN_P | + FO_PCI_IMU_ERR_INT_COR_MES_NOT_EN_P | + FO_PCI_IMU_ERR_INT_MSI_NOT_EN_P)) != 0) { + fatal = 1; + val = FIRE_PCI_READ_8(sc, + FO_PCI_IMU_RDS_ERR_LOG); + device_printf(dev, "RDS error log %#llx\n", + (unsigned long long)val); + } + } + if ((dmcstat & FO_PCI_DMC_CORE_BLOCK_INT_EN_MMU) != 0) { + fatal = 1; + mmustat = FIRE_PCI_READ_8(sc, FO_PCI_MMU_INT_STAT); + mmutfar = FIRE_PCI_READ_8(sc, + FO_PCI_MMU_TRANS_FAULT_ADDR); + mmutfsr = FIRE_PCI_READ_8(sc, + FO_PCI_MMU_TRANS_FAULT_STAT); + if ((mmustat & (FO_PCI_MMU_ERR_INT_TBW_DPE_P | + FO_PCI_MMU_ERR_INT_TBW_ERR_P | + FO_PCI_MMU_ERR_INT_TBW_UDE_P | + FO_PCI_MMU_ERR_INT_TBW_DME_P | + FO_PCI_MMU_ERR_INT_TTC_CAE_P | + FIRE_PCI_MMU_ERR_INT_TTC_DPE_P | + OBERON_PCI_MMU_ERR_INT_TTC_DUE_P | + FO_PCI_MMU_ERR_INT_TRN_ERR_P)) != 0) + fatal = 1; + else { + sc->sc_stats_mmu_err++; + FIRE_PCI_WRITE_8(sc, FO_PCI_MMU_ERR_STAT_CLR, + mmustat); + } + device_printf(dev, + "MMU error %#llx: TFAR %#llx TFSR %#llx\n", + (unsigned long long)mmustat, + (unsigned long long)mmutfar, + (unsigned long long)mmutfsr); + } + } + if ((mcstat & FO_PCI_MULTI_CORE_ERR_STAT_PEC) != 0) { + pecstat = FIRE_PCI_READ_8(sc, FO_PCI_PEC_CORE_BLOCK_INT_STAT); + if ((pecstat & FO_PCI_PEC_CORE_BLOCK_INT_STAT_UERR) != 0) { + fatal = 1; + uestat = FIRE_PCI_READ_8(sc, + FO_PCI_TLU_UERR_INT_STAT); + device_printf(dev, + "DLU/TLU uncorrectable error %#llx\n", + (unsigned long long)uestat); + if ((uestat & (FO_PCI_TLU_UERR_INT_UR_P | + OBERON_PCI_TLU_UERR_INT_POIS_P | + FO_PCI_TLU_UERR_INT_MFP_P | + FO_PCI_TLU_UERR_INT_ROF_P | + FO_PCI_TLU_UERR_INT_UC_P | + FIRE_PCI_TLU_UERR_INT_PP_P | + OBERON_PCI_TLU_UERR_INT_POIS_P)) != 0) { + val = FIRE_PCI_READ_8(sc, + FO_PCI_TLU_RX_UERR_HDR1_LOG); + device_printf(dev, + "receive header log %#llx\n", + (unsigned long long)val); + val = FIRE_PCI_READ_8(sc, + FO_PCI_TLU_RX_UERR_HDR2_LOG); + device_printf(dev, + "receive header log 2 %#llx\n", + (unsigned long long)val); + } + if ((uestat & FO_PCI_TLU_UERR_INT_CTO_P) != 0) { + val = FIRE_PCI_READ_8(sc, + FO_PCI_TLU_TX_UERR_HDR1_LOG); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 18:04:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64AF21065697; Sun, 27 Dec 2009 18:04:06 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A8278FC1F; Sun, 27 Dec 2009 18:04:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRI46VL063099; Sun, 27 Dec 2009 18:04:06 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRI45Ex063077; Sun, 27 Dec 2009 18:04:05 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912271804.nBRI45Ex063077@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 27 Dec 2009 18:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201053 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 18:04:06 -0000 Author: jilles Date: Sun Dec 27 18:04:05 2009 New Revision: 201053 URL: http://svn.freebsd.org/changeset/base/201053 Log: sh: Various warning fixes (from WARNS=6 NO_WERROR=1): - const - initializations to silence -Wuninitialized (it was safe anyway) - remove nested extern declarations - rename "index" locals to "idx" Modified: head/bin/sh/arith.y head/bin/sh/cd.c head/bin/sh/eval.c head/bin/sh/eval.h head/bin/sh/exec.c head/bin/sh/expand.c head/bin/sh/histedit.c head/bin/sh/input.c head/bin/sh/jobs.c head/bin/sh/main.c head/bin/sh/miscbltin.c head/bin/sh/mkbuiltins head/bin/sh/mkinit.c head/bin/sh/mksyntax.c head/bin/sh/mystring.c head/bin/sh/options.c head/bin/sh/options.h head/bin/sh/parser.c head/bin/sh/parser.h head/bin/sh/var.c head/bin/sh/var.h Modified: head/bin/sh/arith.y ============================================================================== --- head/bin/sh/arith.y Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/arith.y Sun Dec 27 18:04:05 2009 (r201053) @@ -314,7 +314,7 @@ yyerror(const char *s) int expcmd(int argc, char **argv) { - char *p; + const char *p; char *concat; char **ap; arith_t i; Modified: head/bin/sh/cd.c ============================================================================== --- head/bin/sh/cd.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/cd.c Sun Dec 27 18:04:05 2009 (r201053) @@ -79,7 +79,7 @@ STATIC char *cdcomppath; int cdcmd(int argc, char **argv) { - char *dest; + const char *dest; const char *path; char *p; struct stat statb; Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/eval.c Sun Dec 27 18:04:05 2009 (r201053) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #endif -MKINIT int evalskip; /* set if we are skipping commands */ +int evalskip; /* set if we are skipping commands */ STATIC int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ @@ -407,8 +407,7 @@ evalsubshell(union node *n, int flags) flags &=~ EV_TESTED; redirect(n->nredir.redirect, 0); evaltree(n->nredir.n, flags | EV_EXIT); /* never returns */ - } - if (! backgnd) { + } else if (! backgnd) { INTOFF; exitstatus = waitforjob(jp, (int *)NULL); INTON; @@ -849,7 +848,7 @@ evalcommand(union node *cmd, int flags, listsetvar(cmdenviron); commandname = argv[0]; argptr = argv + 1; - optptr = NULL; /* initialize nextopt */ + nextopt_optptr = NULL; /* initialize nextopt */ builtin_flags = flags; exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv); flushall(); Modified: head/bin/sh/eval.h ============================================================================== --- head/bin/sh/eval.h Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/eval.h Sun Dec 27 18:04:05 2009 (r201053) @@ -35,6 +35,7 @@ extern char *commandname; /* currently executing command */ extern int exitstatus; /* exit status of last command */ +extern int oexitstatus; /* saved exit status */ extern struct strlist *cmdenviron; /* environment for builtin command */ Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/exec.c Sun Dec 27 18:04:05 2009 (r201053) @@ -109,7 +109,7 @@ STATIC void delete_cmd_entry(void); */ void -shellexec(char **argv, char **envp, const char *path, int index) +shellexec(char **argv, char **envp, const char *path, int idx) { char *cmdname; int e; @@ -120,7 +120,7 @@ shellexec(char **argv, char **envp, cons } else { e = ENOENT; while ((cmdname = padvance(&path, argv[0])) != NULL) { - if (--index < 0 && pathopt == NULL) { + if (--idx < 0 && pathopt == NULL) { tryexec(cmdname, argv, envp); if (errno != ENOENT && errno != ENOTDIR) e = errno; @@ -268,17 +268,17 @@ hashcmd(int argc __unused, char **argv _ STATIC void printentry(struct tblentry *cmdp, int verbose) { - int index; + int idx; const char *path; char *name; if (cmdp->cmdtype == CMDNORMAL) { - index = cmdp->param.index; + idx = cmdp->param.index; path = pathval(); do { name = padvance(&path, cmdp->cmdname); stunalloc(name); - } while (--index >= 0); + } while (--idx >= 0); out1str(name); } else if (cmdp->cmdtype == CMDBUILTIN) { out1fmt("builtin %s", cmdp->cmdname); @@ -314,7 +314,7 @@ find_command(const char *name, struct cm const char *path) { struct tblentry *cmdp; - int index; + int idx; int prev; char *fullname; struct stat statb; @@ -354,11 +354,11 @@ find_command(const char *name, struct cm } e = ENOENT; - index = -1; + idx = -1; loop: while ((fullname = padvance(&path, name)) != NULL) { stunalloc(fullname); - index++; + idx++; if (pathopt) { if (prefix("builtin", pathopt)) { if ((i = find_builtin(name, &spec)) < 0) @@ -377,8 +377,8 @@ loop: } } /* if rehash, don't redo absolute path names */ - if (fullname[0] == '/' && index <= prev) { - if (index < prev) + if (fullname[0] == '/' && idx <= prev) { + if (idx < prev) goto loop; TRACE(("searchexec \"%s\": no change\n", name)); goto success; @@ -415,7 +415,7 @@ loop: INTOFF; cmdp = cmdlookup(name, 1); cmdp->cmdtype = CMDNORMAL; - cmdp->param.index = index; + cmdp->param.index = idx; INTON; goto success; } @@ -494,18 +494,18 @@ void changepath(const char *newval) { const char *old, *new; - int index; + int idx; int firstchange; int bltin; old = pathval(); new = newval; firstchange = 9999; /* assume no change */ - index = 0; + idx = 0; bltin = -1; for (;;) { if (*old != *new) { - firstchange = index; + firstchange = idx; if ((*old == '\0' && *new == ':') || (*old == ':' && *new == '\0')) firstchange++; @@ -514,9 +514,9 @@ changepath(const char *newval) if (*new == '\0') break; if (*new == '%' && bltin < 0 && prefix("builtin", new + 1)) - bltin = index; + bltin = idx; if (*new == ':') { - index++; + idx++; } new++, old++; } @@ -724,15 +724,14 @@ typecmd_impl(int argc, char **argv, int { struct cmdentry entry; struct tblentry *cmdp; - char **pp; + const char *const *pp; struct alias *ap; int i; - int error = 0; - extern char *const parsekwd[]; + int error1 = 0; for (i = 1; i < argc; i++) { /* First look at the keywords */ - for (pp = (char **)parsekwd; *pp; pp++) + for (pp = parsekwd; *pp; pp++) if (**pp == *argv[i] && equal(*pp, argv[i])) break; @@ -793,7 +792,7 @@ typecmd_impl(int argc, char **argv, int if (cmd != TYPECMD_SMALLV) outfmt(out2, "%s: %s\n", argv[i], strerror(errno)); - error |= 127; + error1 |= 127; } } break; @@ -818,11 +817,11 @@ typecmd_impl(int argc, char **argv, int default: if (cmd != TYPECMD_SMALLV) outfmt(out2, "%s: not found\n", argv[i]); - error |= 127; + error1 |= 127; break; } } - return error; + return error1; } /* Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/expand.c Sun Dec 27 18:04:05 2009 (r201053) @@ -855,7 +855,6 @@ varvalue(char *name, int quoted, int sub int num; char *p; int i; - extern int oexitstatus; char sep; char **ap; char const *syntax; @@ -979,7 +978,7 @@ ifsbreakup(char *string, struct arglist char *start; char *p; char *q; - char *ifs; + const char *ifs; const char *ifsspc; int had_param_ch = 0; Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/histedit.c Sun Dec 27 18:04:05 2009 (r201053) @@ -164,19 +164,19 @@ int histcmd(int argc, char **argv) { int ch; - char *editor = NULL; + const char *editor = NULL; HistEvent he; int lflg = 0, nflg = 0, rflg = 0, sflg = 0; int i, retval; - char *firststr, *laststr; + const char *firststr, *laststr; int first, last, direction; - char *pat = NULL, *repl; + char *pat = NULL, *repl = NULL; static int active = 0; struct jmploc jmploc; struct jmploc *savehandler; char editfilestr[PATH_MAX]; char *volatile editfile; - FILE *efp; + FILE *efp = NULL; int oldhistnum; if (hist == NULL) Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/input.c Sun Dec 27 18:04:05 2009 (r201053) @@ -93,7 +93,7 @@ struct parsefile { int plinno = 1; /* input line number */ -MKINIT int parsenleft; /* copy of parsefile->nleft */ +int parsenleft; /* copy of parsefile->nleft */ MKINIT int parselleft; /* copy of parsefile->lleft */ char *parsenextc; /* copy of parsefile->nextc */ MKINIT struct parsefile basepf; /* top level input file */ @@ -111,9 +111,9 @@ static int preadfd(void); INCLUDE "input.h" INCLUDE "error.h" -INIT { - extern char basebuf[]; +MKINIT char basebuf[]; +INIT { basepf.nextc = basepf.buf = basebuf; } Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/jobs.c Sun Dec 27 18:04:05 2009 (r201053) @@ -92,7 +92,7 @@ STATIC struct job *getjob(char *); STATIC pid_t dowait(int, struct job *); STATIC pid_t waitproc(int, int *); STATIC void cmdtxt(union node *); -STATIC void cmdputs(char *); +STATIC void cmdputs(const char *); #if JOBS STATIC void setcurjob(struct job *); STATIC void deljob(struct job *); @@ -1083,7 +1083,7 @@ cmdtxt(union node *n) { union node *np; struct nodelist *lp; - char *p; + const char *p; int i; char s[2]; @@ -1212,9 +1212,10 @@ redir: STATIC void -cmdputs(char *s) +cmdputs(const char *s) { - char *p, *q; + const char *p; + char *q; char c; int subtype = 0; Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/main.c Sun Dec 27 18:04:05 2009 (r201053) @@ -77,7 +77,7 @@ int rootpid; int rootshell; struct jmploc main_handler; -STATIC void read_profile(char *); +STATIC void read_profile(const char *); STATIC char *find_dot_file(char *); /* @@ -248,7 +248,7 @@ cmdloop(int top) */ STATIC void -read_profile(char *name) +read_profile(const char *name) { int fd; @@ -334,8 +334,6 @@ dotcmd(int argc, char **argv) int exitcmd(int argc, char **argv) { - extern int oexitstatus; - if (stoppedjobs()) return 0; if (argc > 1) Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/miscbltin.c Sun Dec 27 18:04:05 2009 (r201053) @@ -93,7 +93,7 @@ readcmd(int argc __unused, char **argv _ char c; int rflag; char *prompt; - char *ifs; + const char *ifs; char *p; int startword; int status; @@ -254,7 +254,7 @@ readcmd(int argc __unused, char **argv _ int -umaskcmd(int argc __unused, char **argv) +umaskcmd(int argc __unused, char **argv __unused) { char *ap; int mask; Modified: head/bin/sh/mkbuiltins ============================================================================== --- head/bin/sh/mkbuiltins Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/mkbuiltins Sun Dec 27 18:04:05 2009 (r201053) @@ -88,7 +88,7 @@ tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJ awk '{ printf "#define %s %d\n", $1, NR-1}' echo ' struct builtincmd { - char *name; + const char *name; int code; int special; }; Modified: head/bin/sh/mkinit.c ============================================================================== --- head/bin/sh/mkinit.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/mkinit.c Sun Dec 27 18:04:05 2009 (r201053) @@ -102,9 +102,9 @@ struct block { */ struct event { - char *name; /* name of event (e.g. INIT) */ - char *routine; /* name of routine called on event */ - char *comment; /* comment describing routine */ + const char *name; /* name of event (e.g. INIT) */ + const char *routine; /* name of routine called on event */ + const char *comment; /* comment describing routine */ struct text code; /* code for handling event */ }; @@ -140,7 +140,7 @@ struct event event[] = { }; -char *curfile; /* current file */ +const char *curfile; /* current file */ int linno; /* current line */ char *header_files[200]; /* list of header files */ struct text defines; /* #define statements */ @@ -148,20 +148,20 @@ struct text decls; /* declarations */ int amiddecls; /* for formatting */ -void readfile(char *); -int match(char *, char *); -int gooddefine(char *); -void doevent(struct event *, FILE *, char *); +void readfile(const char *); +int match(const char *, const char *); +int gooddefine(const char *); +void doevent(struct event *, FILE *, const char *); void doinclude(char *); void dodecl(char *, FILE *); void output(void); -void addstr(char *, struct text *); +void addstr(const char *, struct text *); void addchar(int, struct text *); void writetext(struct text *, FILE *); -FILE *ckfopen(char *, char *); +FILE *ckfopen(const char *, const char *); void *ckmalloc(size_t); -char *savestr(char *); -void error(char *); +char *savestr(const char *); +void error(const char *); #define equal(s1, s2) (strcmp(s1, s2) == 0) @@ -170,9 +170,9 @@ main(int argc __unused, char *argv[]) { char **ap; - header_files[0] = "\"shell.h\""; - header_files[1] = "\"mystring.h\""; - header_files[2] = "\"init.h\""; + header_files[0] = savestr("\"shell.h\""); + header_files[1] = savestr("\"mystring.h\""); + header_files[2] = savestr("\"init.h\""); for (ap = argv + 1 ; *ap ; ap++) readfile(*ap); output(); @@ -186,7 +186,7 @@ main(int argc __unused, char *argv[]) */ void -readfile(char *fname) +readfile(const char *fname) { FILE *fp; char line[1024]; @@ -230,9 +230,9 @@ readfile(char *fname) int -match(char *name, char *line) +match(const char *name, const char *line) { - char *p, *q; + const char *p, *q; p = name, q = line; while (*p) { @@ -246,9 +246,9 @@ match(char *name, char *line) int -gooddefine(char *line) +gooddefine(const char *line) { - char *p; + const char *p; if (! match("#define", line)) return 0; /* not a define */ @@ -269,11 +269,11 @@ gooddefine(char *line) void -doevent(struct event *ep, FILE *fp, char *fname) +doevent(struct event *ep, FILE *fp, const char *fname) { char line[1024]; int indent; - char *p; + const char *p; sprintf(line, "\n /* from %s: */\n", fname); addstr(line, &ep->code); @@ -407,7 +407,7 @@ output(void) */ void -addstr(char *s, struct text *text) +addstr(const char *s, struct text *text) { while (*s) { if (--text->nleft < 0) @@ -452,7 +452,7 @@ writetext(struct text *text, FILE *fp) } FILE * -ckfopen(char *file, char *mode) +ckfopen(const char *file, const char *mode) { FILE *fp; @@ -474,7 +474,7 @@ ckmalloc(size_t nbytes) } char * -savestr(char *s) +savestr(const char *s) { char *p; @@ -484,7 +484,7 @@ savestr(char *s) } void -error(char *msg) +error(const char *msg) { if (curfile != NULL) fprintf(stderr, "%s:%d: ", curfile, linno); Modified: head/bin/sh/mksyntax.c ============================================================================== --- head/bin/sh/mksyntax.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/mksyntax.c Sun Dec 27 18:04:05 2009 (r201053) @@ -55,8 +55,8 @@ __FBSDID("$FreeBSD$"); struct synclass { - char *name; - char *comment; + const char *name; + const char *comment; }; /* Syntax classes */ @@ -101,16 +101,16 @@ static char writer[] = "\ static FILE *cfile; static FILE *hfile; -static char *syntax[513]; +static const char *syntax[513]; static int base; static int size; /* number of values which a char variable can have */ static int nbits; /* number of bits in a character */ static int digit_contig;/* true if digits are contiguous */ -static void filltable(char *); +static void filltable(const char *); static void init(void); -static void add(char *, char *); -static void print(char *); +static void add(const char *, const char *); +static void print(const char *); static void output_type_macros(void); static void digit_convert(void); @@ -259,7 +259,7 @@ main(int argc __unused, char **argv __un */ static void -filltable(char *dftval) +filltable(const char *dftval) { int i; @@ -293,7 +293,7 @@ init(void) */ static void -add(char *p, char *type) +add(const char *p, const char *type) { while (*p) syntax[*p++ + base] = type; @@ -306,7 +306,7 @@ add(char *p, char *type) */ static void -print(char *name) +print(const char *name) { int i; int col; @@ -338,7 +338,7 @@ print(char *name) * contiguous, we can test for them quickly. */ -static char *macro[] = { +static const char *macro[] = { "#define is_digit(c)\t((is_type+SYNBASE)[c] & ISDIGIT)", "#define is_eof(c)\t((c) == PEOF)", "#define is_alpha(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && isalpha((unsigned char) (c)))", @@ -351,7 +351,7 @@ static char *macro[] = { static void output_type_macros(void) { - char **pp; + const char **pp; if (digit_contig) macro[0] = "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)"; Modified: head/bin/sh/mystring.c ============================================================================== --- head/bin/sh/mystring.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/mystring.c Sun Dec 27 18:04:05 2009 (r201053) @@ -108,7 +108,7 @@ int number(const char *s) { if (! is_number(s)) - error("Illegal number: %s", (char *)s); + error("Illegal number: %s", s); return atoi(s); } Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/options.c Sun Dec 27 18:04:05 2009 (r201053) @@ -64,7 +64,7 @@ char *arg0; /* value of $0 */ struct shparam shellparam; /* current positional parameters */ char **argptr; /* argument list for builtin commands */ char *shoptarg; /* set by nextopt (like getopt) */ -char *optptr; /* used by nextopt */ +char *nextopt_optptr; /* used by nextopt */ char *minusc; /* argument to -c option */ @@ -560,7 +560,7 @@ nextopt(const char *optstring) const char *q; char c; - if ((p = optptr) == NULL || *p == '\0') { + if ((p = nextopt_optptr) == NULL || *p == '\0') { p = *argptr; if (p == NULL || *p != '-' || *++p == '\0') return '\0'; @@ -581,6 +581,6 @@ nextopt(const char *optstring) shoptarg = p; p = NULL; } - optptr = p; + nextopt_optptr = p; return c; } Modified: head/bin/sh/options.h ============================================================================== --- head/bin/sh/options.h Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/options.h Sun Dec 27 18:04:05 2009 (r201053) @@ -102,7 +102,7 @@ extern char *arg0; /* $0 */ extern struct shparam shellparam; /* $@ */ extern char **argptr; /* argument list for builtin commands */ extern char *shoptarg; /* set by nextopt */ -extern char *optptr; /* used by nextopt */ +extern char *nextopt_optptr; /* used by nextopt */ void procargs(int, char **); void optschanged(void); Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/parser.c Sun Dec 27 18:04:05 2009 (r201053) @@ -113,7 +113,7 @@ STATIC int xxreadtoken(void); STATIC int readtoken1(int, char const *, char *, int); STATIC int noexpand(char *); STATIC void synexpect(int); -STATIC void synerror(char *); +STATIC void synerror(const char *); STATIC void setprompt(int); @@ -1547,7 +1547,7 @@ synexpect(int token) STATIC void -synerror(char *msg) +synerror(const char *msg) { if (commandname) outfmt(&errout, "%s: %d: ", commandname, startlinno); @@ -1579,13 +1579,14 @@ getprompt(void *unused __unused) static char ps[PROMPTLEN]; char *fmt; int i, j, trim; + static char internal_error[] = ""; /* * Select prompt format. */ switch (whichprompt) { case 0: - fmt = ""; + fmt = nullstr; break; case 1: fmt = ps1val(); @@ -1594,7 +1595,7 @@ getprompt(void *unused __unused) fmt = ps2val(); break; default: - return ""; + return internal_error; } /* Modified: head/bin/sh/parser.h ============================================================================== --- head/bin/sh/parser.h Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/parser.h Sun Dec 27 18:04:05 2009 (r201053) @@ -73,6 +73,7 @@ extern int tokpushback; #define NEOF ((union node *)&tokpushback) extern int whichprompt; /* 1 == PS1, 2 == PS2 */ +extern const char *const parsekwd[]; union node *parsecmd(int); Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/var.c Sun Dec 27 18:04:05 2009 (r201053) @@ -132,9 +132,9 @@ STATIC int localevar(const char *); #ifdef mkinit INCLUDE "var.h" +MKINIT char **environ; INIT { char **envp; - extern char **environ; initvar(); for (envp = environ ; *envp ; envp++) { @@ -258,11 +258,11 @@ setvar(const char *name, const char *val STATIC int localevar(const char *s) { - static char *lnames[7] = { + static const char *lnames[7] = { "ALL", "COLLATE", "CTYPE", "MONETARY", "NUMERIC", "TIME", NULL }; - char **ss; + const char **ss; if (*s != 'L') return 0; @@ -469,9 +469,9 @@ environment(void) * VSTACK set since these are currently allocated on the stack. */ -#ifdef mkinit MKINIT void shprocvar(void); +#ifdef mkinit SHELLPROC { shprocvar(); } Modified: head/bin/sh/var.h ============================================================================== --- head/bin/sh/var.h Sun Dec 27 16:55:44 2009 (r201052) +++ head/bin/sh/var.h Sun Dec 27 18:04:05 2009 (r201053) @@ -108,7 +108,6 @@ void listsetvar(struct strlist *); char *lookupvar(const char *); char *bltinlookup(const char *, int); char **environment(void); -void shprocvar(void); int showvarscmd(int, char **); int exportcmd(int, char **); int localcmd(int, char **); From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 18:32:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1185106566B; Sun, 27 Dec 2009 18:32:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 878168FC0C; Sun, 27 Dec 2009 18:32:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRIWivj063748; Sun, 27 Dec 2009 18:32:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRIWiOv063746; Sun, 27 Dec 2009 18:32:44 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912271832.nBRIWiOv063746@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 27 Dec 2009 18:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201056 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 18:32:44 -0000 Author: jilles Date: Sun Dec 27 18:32:44 2009 New Revision: 201056 URL: http://svn.freebsd.org/changeset/base/201056 Log: sh: Change varinit to use const better. Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sun Dec 27 18:25:44 2009 (r201055) +++ head/bin/sh/var.c Sun Dec 27 18:32:44 2009 (r201056) @@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$"); struct varinit { struct var *var; int flags; - char *text; + const char *text; void (*func)(const char *); }; @@ -94,27 +94,27 @@ STATIC struct var voptind; STATIC const struct varinit varinit[] = { #ifndef NO_HISTORY - { &vhistsize, VSTRFIXED|VTEXTFIXED|VUNSET, "HISTSIZE=", + { &vhistsize, VUNSET, "HISTSIZE=", sethistsize }, #endif - { &vifs, VSTRFIXED|VTEXTFIXED, "IFS= \t\n", + { &vifs, 0, "IFS= \t\n", NULL }, - { &vmail, VSTRFIXED|VTEXTFIXED|VUNSET, "MAIL=", + { &vmail, VUNSET, "MAIL=", NULL }, - { &vmpath, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPATH=", + { &vmpath, VUNSET, "MAILPATH=", NULL }, - { &vpath, VSTRFIXED|VTEXTFIXED, "PATH=" _PATH_DEFPATH, + { &vpath, 0, "PATH=" _PATH_DEFPATH, changepath }, - { &vppid, VSTRFIXED|VTEXTFIXED|VUNSET, "PPID=", + { &vppid, VUNSET, "PPID=", NULL }, /* * vps1 depends on uid */ - { &vps2, VSTRFIXED|VTEXTFIXED, "PS2=> ", + { &vps2, 0, "PS2=> ", NULL }, - { &vps4, VSTRFIXED|VTEXTFIXED, "PS4=+ ", + { &vps4, 0, "PS4=+ ", NULL }, - { &voptind, VSTRFIXED|VTEXTFIXED, "OPTIND=1", + { &voptind, 0, "OPTIND=1", getoptsreset }, { NULL, 0, NULL, NULL } @@ -164,8 +164,8 @@ initvar(void) vpp = hashvar(ip->text); vp->next = *vpp; *vpp = vp; - vp->text = ip->text; - vp->flags = ip->flags; + vp->text = __DECONST(char *, ip->text); + vp->flags = ip->flags | VSTRFIXED | VTEXTFIXED; vp->func = ip->func; } } @@ -176,7 +176,7 @@ initvar(void) vpp = hashvar("PS1="); vps1.next = *vpp; *vpp = &vps1; - vps1.text = geteuid() ? "PS1=$ " : "PS1=# "; + vps1.text = __DECONST(char *, geteuid() ? "PS1=$ " : "PS1=# "); vps1.flags = VSTRFIXED|VTEXTFIXED; } if ((vppid.flags & VEXPORT) == 0) { From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 19:11:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84DD0106566B; Sun, 27 Dec 2009 19:11:06 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 296EC8FC0C; Sun, 27 Dec 2009 19:11:06 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 0FA621CE29; Sun, 27 Dec 2009 20:11:05 +0100 (CET) Date: Sun, 27 Dec 2009 20:11:04 +0100 From: Ed Schouten To: Doug Barton Message-ID: <20091227191104.GZ64905@hoeg.nl> References: <200912200134.nBK1YCAA048942@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IbHvapklzsHS+ltG" Content-Disposition: inline In-Reply-To: <200912200134.nBK1YCAA048942@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200743 - in head/usr.sbin: . service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 19:11:06 -0000 --IbHvapklzsHS+ltG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Doug, Even though I think having a help-feature is nice, just expecting users to open up the proper manual page seems to be our tradition. Because of that, I think we should change the usage-output to conform a bit more with other applications. We should also display "-l | -r" instead of "-l|r". What do you think about the following patch? %%% Index: service.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 --- service.8 (revision 201047) +++ service.8 (working copy) @@ -35,7 +35,7 @@ .Fl e .Nm .Op Fl v -.Fl l|r +.Fl l | r .Nm .Op Fl v .Ar start|stop|etc. Index: service.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- service.sh (revision 201047) +++ service.sh (working copy) @@ -30,24 +30,14 @@ load_rc_config 'XXX' =20 usage () { - echo '' - echo 'Usage:' - echo "${0##*/} -e" - echo "${0##*/} [-v] -l|r" - echo "${0##*/} [-v] start|stop|etc." - echo "${0##*/} -h" - echo '' - echo '-e Show services that are enabled' - echo "-l List all scripts in /etc/rc.d and $local_startup" - echo '-r Show the results of boot time rcorder' - echo '-v Verbose' - echo '' + echo "usage: ${0##*/} -e" + echo " ${0##*/} [-v] -l | -r" + echo " ${0##*/} [-v] start|stop|etc." } =20 while getopts 'ehlrv' COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in e) ENABLED=3Deopt ;; - h) usage ; exit 0 ;; l) LIST=3Dlopt ;; r) RCORDER=3Dropt ;; v) VERBOSE=3Dvopt ;; %%% --=20 Ed Schouten WWW: http://80386.nl/ --IbHvapklzsHS+ltG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAks3sUgACgkQ52SDGA2eCwW28wCeMXcYnGNXtpBA9jWVav/9OQJT Ga0An0LtWGAApweAuaDR1oDvqQ0VdQ1c =mB2X -----END PGP SIGNATURE----- --IbHvapklzsHS+ltG-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 19:12:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF38A106568D; Sun, 27 Dec 2009 19:12:36 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id A7B418FC1B; Sun, 27 Dec 2009 19:12:36 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 20E191CE29; Sun, 27 Dec 2009 20:12:36 +0100 (CET) Date: Sun, 27 Dec 2009 20:12:36 +0100 From: Ed Schouten To: Doug Barton Message-ID: <20091227191236.GA64905@hoeg.nl> References: <200912200134.nBK1YCAA048942@svn.freebsd.org> <20091227191104.GZ64905@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ak8hjYkpflR+EuKl" Content-Disposition: inline In-Reply-To: <20091227191104.GZ64905@hoeg.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200743 - in head/usr.sbin: . service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 19:12:37 -0000 --Ak8hjYkpflR+EuKl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > while getopts 'ehlrv' COMMAND_LINE_ARGUMENT ; do ^ Should be removed here as well, of course. --=20 Ed Schouten WWW: http://80386.nl/ --Ak8hjYkpflR+EuKl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAks3saQACgkQ52SDGA2eCwWbxwCffXrCMa3/pf5CniBQy5J7TXqI M2gAnikw9rz+ttfZMqetXhxwagzwsaZk =Ws2T -----END PGP SIGNATURE----- --Ak8hjYkpflR+EuKl-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 20:43:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A186F1065695; Sun, 27 Dec 2009 20:43:51 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from lupus.usap.gov (lupus.usap.gov [157.132.252.33]) by mx1.freebsd.org (Postfix) with ESMTP id 584B88FC1F; Sun, 27 Dec 2009 20:43:51 +0000 (UTC) Received: from den-ex2.usap.gov [157.132.247.25] by lupus.usap.gov with XWall v3.44 ; Sun, 27 Dec 2009 13:29:08 -0700 Received: from spo-exchange-03.usap.gov ([157.132.28.81]) by DEN-EX2.usap.gov with Microsoft SMTPSVC(6.0.3790.3959); Sun, 27 Dec 2009 13:28:49 -0700 Received: from wanderer.tachypleus.net ([157.132.24.95]) by spo-exchange-03.usap.gov with Microsoft SMTPSVC(6.0.3790.3959); Mon, 28 Dec 2009 09:23:19 +1300 Message-ID: <4B37C22F.8010400@freebsd.org> Date: Mon, 28 Dec 2009 09:23:11 +1300 From: Nathan Whitehorn User-Agent: Thunderbird 2.0.0.23 (X11/20091207) MIME-Version: 1.0 To: Marius Strobl References: <200912271655.nBRGtiAm061778@svn.freebsd.org> In-Reply-To: <200912271655.nBRGtiAm061778@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 27 Dec 2009 20:23:19.0382 (UTC) FILETIME=[6DCE1F60:01CA8732] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201052 - in head/sys: conf sparc64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 20:43:51 -0000 Marius Strobl wrote: > Author: marius > Date: Sun Dec 27 16:55:44 2009 > New Revision: 201052 > URL: http://svn.freebsd.org/changeset/base/201052 > > Log: > Add a driver for the `Fire' JBus to PCIe bridges found in at least > the Sun Fire V215/V245 and Sun Ultra 25/45 machines. This driver also > already includes all the code to support the `Oberon' Uranus to PCIe > bridges found in the Fujitsu-Siemens based Mx000 machines but due to > lack of access to such a system for testing, probing of these bridges > is currently disabled. > > Nice! I think you missed a '+sparc64/pci/fire.c optional pci' in sys/conf/files.sparc64, though. -Nathan From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 21:13:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5571910656A4; Sun, 27 Dec 2009 21:13:53 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 465C48FC15; Sun, 27 Dec 2009 21:13:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRLDrBF067454; Sun, 27 Dec 2009 21:13:53 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRLDr88067452; Sun, 27 Dec 2009 21:13:53 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912272113.nBRLDr88067452@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 27 Dec 2009 21:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201059 - head/release/picobsd/build X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 21:13:53 -0000 Author: luigi Date: Sun Dec 27 21:13:53 2009 New Revision: 201059 URL: http://svn.freebsd.org/changeset/base/201059 Log: fix a typo (not that it matters) Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Sun Dec 27 20:39:58 2009 (r201058) +++ head/release/picobsd/build/picobsd Sun Dec 27 21:13:53 2009 (r201059) @@ -167,7 +167,7 @@ create_includes_and_libraries2() { # opt local no log "create_includes_and_libraries2() for ${SRC}" if [ ${OSVERSION} -ge 600000 ] ; then - no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITOUT_CDDL=1" + no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 21:14:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26BFB1065693; Sun, 27 Dec 2009 21:14:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16CD58FC18; Sun, 27 Dec 2009 21:14:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRLEtXq067509; Sun, 27 Dec 2009 21:14:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRLEtEq067506; Sun, 27 Dec 2009 21:14:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912272114.nBRLEtEq067506@svn.freebsd.org> From: Ed Schouten Date: Sun, 27 Dec 2009 21:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201060 - head/usr.sbin/rwhod X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 21:14:56 -0000 Author: ed Date: Sun Dec 27 21:14:55 2009 New Revision: 201060 URL: http://svn.freebsd.org/changeset/base/201060 Log: Let rwhod use libulog. I am not planning on providing a mechanism tot stat() the database files directly. The disadvantage of this, is that rwhod will now be a little bit more heavy than it used to be. It normally used to fstat() the file descriptor to see whether the file had changed, but this is now impossible to implement, meaning we have to parse the entire utmp file each 180 seconds. This is probably not an issue on modern 16-way servers, but if it turns out to be a problem, we'll think of something. Modified: head/usr.sbin/rwhod/Makefile head/usr.sbin/rwhod/rwhod.c Modified: head/usr.sbin/rwhod/Makefile ============================================================================== --- head/usr.sbin/rwhod/Makefile Sun Dec 27 21:13:53 2009 (r201059) +++ head/usr.sbin/rwhod/Makefile Sun Dec 27 21:14:55 2009 (r201060) @@ -7,4 +7,7 @@ MAN= rwhod.8 # XXX breaks on Alpha due to alignment constraints #WARNS?= 4 +DPADD= ${LIBULOG} +LDADD= -lulog + .include Modified: head/usr.sbin/rwhod/rwhod.c ============================================================================== --- head/usr.sbin/rwhod/rwhod.c Sun Dec 27 21:13:53 2009 (r201059) +++ head/usr.sbin/rwhod/rwhod.c Sun Dec 27 21:14:55 2009 (r201060) @@ -67,8 +67,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _ULOG_POSIX_NAMES +#include #include -#include #include #include @@ -146,7 +147,7 @@ struct neighbor { struct neighbor *neighbors; struct whod mywd; struct servent *sp; -int s, utmpf; +int s; #define WHDRSIZE (int)(sizeof(mywd) - sizeof(mywd.wd_we)) @@ -231,11 +232,6 @@ main(int argc, char *argv[]) *cp = '\0'; strncpy(mywd.wd_hostname, myname, sizeof(mywd.wd_hostname) - 1); mywd.wd_hostname[sizeof(mywd.wd_hostname) - 1] = '\0'; - utmpf = open(_PATH_UTMP, O_RDONLY|O_CREAT, 0644); - if (utmpf < 0) { - syslog(LOG_ERR, "%s: %m", _PATH_UTMP); - exit(1); - } getboottime(0); if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { syslog(LOG_ERR, "socket: %m"); @@ -383,73 +379,43 @@ verify(name, maxlen) return (size > 0); } -int utmptime; -int utmpent; -int utmpsize = 0; -struct utmp *utmp; -int alarmcount; - void -onalrm(signo) - int signo __unused; +onalrm(int signo __unused) { - register struct neighbor *np; - register struct whoent *we = mywd.wd_we, *wlast; - register int i; + struct neighbor *np; + struct whoent *we = mywd.wd_we, *wend; struct stat stb; + struct utmpx *ut; + static int alarmcount = 0; double avenrun[3]; time_t now; - int cc; + int i, cc; now = time(NULL); if (alarmcount % 10 == 0) getboottime(0); alarmcount++; - (void) fstat(utmpf, &stb); - if ((stb.st_mtime != utmptime) || (stb.st_size > utmpsize)) { - utmptime = stb.st_mtime; - if (stb.st_size > utmpsize) { - utmpsize = stb.st_size + 10 * sizeof(struct utmp); - utmp = (struct utmp *)reallocf(utmp, utmpsize); - if (utmp == NULL) { - syslog(LOG_WARNING, "malloc failed"); - utmpsize = 0; - goto done; - } - } - (void) lseek(utmpf, (off_t)0, L_SET); - cc = read(utmpf, (char *)utmp, stb.st_size); - if (cc < 0) { - syslog(LOG_ERR, "read(%s): %m", _PATH_UTMP); - goto done; - } - wlast = &mywd.wd_we[1024 / sizeof(struct whoent) - 1]; - utmpent = cc / sizeof(struct utmp); - for (i = 0; i < utmpent; i++) - if (utmp[i].ut_name[0]) { - memcpy(we->we_utmp.out_line, utmp[i].ut_line, - sizeof(utmp[i].ut_line)); - memcpy(we->we_utmp.out_name, utmp[i].ut_name, - sizeof(utmp[i].ut_name)); - we->we_utmp.out_time = htonl(utmp[i].ut_time); - if (we >= wlast) - break; - we++; - } - utmpent = we - mywd.wd_we; + wend = &mywd.wd_we[1024 / sizeof(struct whoent)]; + setutxent(); + while ((ut = getutxent()) != NULL && we < wend) { + if (ut->ut_type != USER_PROCESS) + continue; + strncpy(we->we_utmp.out_line, ut->ut_line, + sizeof(we->we_utmp.out_line)); + strncpy(we->we_utmp.out_name, ut->ut_user, + sizeof(we->we_utmp.out_name)); + we->we_utmp.out_time = + htonl(_time_to_time32(ut->ut_tv.tv_sec)); + we++; } + endutxent(); - /* - * The test on utmpent looks silly---after all, if no one is - * logged on, why worry about efficiency?---but is useful on - * (e.g.) compute servers. - */ - if (utmpent && chdir(_PATH_DEV)) { + if (chdir(_PATH_DEV)) { syslog(LOG_ERR, "chdir(%s): %m", _PATH_DEV); exit(1); } - we = mywd.wd_we; - for (i = 0; i < utmpent; i++) { + wend = we; + for (we = mywd.wd_we; we < wend; we++) { if (stat(we->we_utmp.out_line, &stb) >= 0) we->we_idle = htonl(now - stb.st_atime); we++; @@ -457,7 +423,7 @@ onalrm(signo) (void)getloadavg(avenrun, sizeof(avenrun)/sizeof(avenrun[0])); for (i = 0; i < 3; i++) mywd.wd_loadav[i] = htonl((u_long)(avenrun[i] * 100)); - cc = (char *)we - (char *)&mywd; + cc = (char *)wend - (char *)&mywd; mywd.wd_sendtime = htonl(_time_to_time32(time(NULL))); mywd.wd_vers = WHODVERSION; mywd.wd_type = WHODTYPE_STATUS; @@ -485,11 +451,10 @@ onalrm(signo) } else (void) sendto(s, (char *)&mywd, cc, 0, np->n_addr, np->n_addrlen); } - if (utmpent && chdir(_PATH_RWHODIR)) { + if (chdir(_PATH_RWHODIR)) { syslog(LOG_ERR, "chdir(%s): %m", _PATH_RWHODIR); exit(1); } -done: (void) alarm(AL_INTERVAL); } From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 21:17:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34C4D1065698; Sun, 27 Dec 2009 21:17:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 253358FC1F; Sun, 27 Dec 2009 21:17:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRLHWqQ067624; Sun, 27 Dec 2009 21:17:32 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRLHWCG067621; Sun, 27 Dec 2009 21:17:32 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912272117.nBRLHWCG067621@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 27 Dec 2009 21:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201061 - in head/release/picobsd: build floppy.tree/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 21:17:32 -0000 Author: luigi Date: Sun Dec 27 21:17:31 2009 New Revision: 201061 URL: http://svn.freebsd.org/changeset/base/201061 Log: dhclient needs to have /var/empty and a _dhcp user (it also needs /sbin/dhclient-script, will handle that later) Modified: head/release/picobsd/build/mfs.mtree head/release/picobsd/floppy.tree/etc/master.passwd Modified: head/release/picobsd/build/mfs.mtree ============================================================================== --- head/release/picobsd/build/mfs.mtree Sun Dec 27 21:14:55 2009 (r201060) +++ head/release/picobsd/build/mfs.mtree Sun Dec 27 21:17:31 2009 (r201061) @@ -58,6 +58,8 @@ var db .. + empty + .. run .. spool Modified: head/release/picobsd/floppy.tree/etc/master.passwd ============================================================================== --- head/release/picobsd/floppy.tree/etc/master.passwd Sun Dec 27 21:14:55 2009 (r201060) +++ head/release/picobsd/floppy.tree/etc/master.passwd Sun Dec 27 21:17:31 2009 (r201061) @@ -1,3 +1,4 @@ +# $FreeBSD$ root:$1$xOOaGnKU$U9QdsCI40XXcCUMBN.7Az.:0:0::0:0:Charlie &:/root:/bin/sh toor:*:0:0::0:0:Bourne-again Superuser:/root: daemon:*:1:1::0:0:Owner of many system processes:/root:/nonexistent @@ -5,4 +6,5 @@ operator:*:2:20::0:0:System &:/usr/guest bin:*:3:7::0:0:Binaries Commands and Source,,,:/:/nonexistent tty:*:4:65533::0:0:Tty Sandbox:/:/nonexistent nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/nonexistent +_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin user:*:1002:1002:Sample User:0:0:user:/home/user:/bin/sh From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 21:58:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1702F1065672; Sun, 27 Dec 2009 21:58:49 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05EEE8FC17; Sun, 27 Dec 2009 21:58:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRLwnqv068713; Sun, 27 Dec 2009 21:58:49 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRLwmZD068706; Sun, 27 Dec 2009 21:58:48 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912272158.nBRLwmZD068706@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 27 Dec 2009 21:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201062 - in head/release/picobsd: floppy.tree/sbin qemu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 21:58:49 -0000 Author: luigi Date: Sun Dec 27 21:58:48 2009 New Revision: 201062 URL: http://svn.freebsd.org/changeset/base/201062 Log: add a 'qemu' floppy type, useful for running tests on new kernels Added: head/release/picobsd/floppy.tree/sbin/ head/release/picobsd/floppy.tree/sbin/dhclient-script (contents, props changed) head/release/picobsd/qemu/ head/release/picobsd/qemu/PICOBSD (contents, props changed) head/release/picobsd/qemu/PICOBSD.hints (contents, props changed) head/release/picobsd/qemu/config (contents, props changed) head/release/picobsd/qemu/crunch.conf (contents, props changed) head/release/picobsd/qemu/floppy.tree.exclude (contents, props changed) Added: head/release/picobsd/floppy.tree/sbin/dhclient-script ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/picobsd/floppy.tree/sbin/dhclient-script Sun Dec 27 21:58:48 2009 (r201062) @@ -0,0 +1,384 @@ +#!/bin/sh +# +# $OpenBSD: dhclient-script,v 1.6 2004/05/06 18:22:41 claudio Exp $ +# $FreeBSD$ +# +# Copyright (c) 2003 Kenneth R Westerback +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +# + +ARP=/usr/sbin/arp +HOSTNAME=/bin/hostname +IFCONFIG='/sbin/ifconfig -n' + +LOCALHOST=127.0.0.1 + +if [ -x /usr/bin/logger ]; then + LOGGER="/usr/bin/logger -s -p user.notice -t dhclient" +else + LOGGER=echo +fi + +# +# Helper functions that implement common actions. +# + +check_hostname() { + current_hostname=`$HOSTNAME` + if [ -z "$current_hostname" ]; then + $LOGGER "New Hostname ($interface): $new_host_name" + $HOSTNAME $new_host_name + elif [ "$current_hostname" = "$old_host_name" -a \ + "$new_host_name" != "$old_host_name" ]; then + $LOGGER "New Hostname ($interface): $new_host_name" + $HOSTNAME $new_host_name + fi +} + +arp_flush() { + arp -an -i $interface | \ + sed -n -e 's/^.*(\(.*\)) at .*$/arp -d \1/p' | \ + sh >/dev/null 2>&1 +} + +delete_old_address() { + eval "$IFCONFIG $interface inet -alias $old_ip_address $medium" +} + +add_new_address() { + eval "$IFCONFIG $interface \ + inet $new_ip_address \ + netmask $new_subnet_mask \ + broadcast $new_broadcast_address \ + $medium" + + $LOGGER "New IP Address ($interface): $new_ip_address" + $LOGGER "New Subnet Mask ($interface): $new_subnet_mask" + $LOGGER "New Broadcast Address ($interface): $new_broadcast_address" + $LOGGER "New Routers ($interface): $new_routers" +} + +delete_old_alias() { + if [ -n "$alias_ip_address" ]; then + $IFCONFIG $interface inet -alias $alias_ip_address > /dev/null 2>&1 + #route delete $alias_ip_address $LOCALHOST > /dev/null 2>&1 + fi +} + +add_new_alias() { + if [ -n "$alias_ip_address" ]; then + $IFCONFIG $interface inet alias $alias_ip_address netmask \ + $alias_subnet_mask + #route add $alias_ip_address $LOCALHOST + fi +} + +fill_classless_routes() { + set $1 + while [ $# -ge 5 ]; do + if [ $1 -eq 0 ]; then + route="default" + elif [ $1 -le 8 ]; then + route="$2.0.0.0/$1" + shift + elif [ $1 -le 16 ]; then + route="$2.$3.0.0/$1" + shift; shift + elif [ $1 -le 24 ]; then + route="$2.$3.$4.0/$1" + shift; shift; shift + else + route="$2.$3.$4.$5/$1" + shift; shift; shift; shift + fi + shift + router="$1.$2.$3.$4" + classless_routes="$classless_routes $route $router" + shift; shift; shift; shift + done +} + +delete_old_routes() { + #route delete "$old_ip_address" $LOCALHOST >/dev/null 2>&1 + if [ -n "$old_classless_routes" ]; then + fill_classless_routes "$old_classless_routes" + set $classless_routes + while [ $# -gt 1 ]; do + route delete "$1" "$2" + shift; shift + done + return 0; + fi + + # If we supported multiple default routes, we'd be removing each + # one here. We don't so just delete the default route if it's + # through our interface. + if is_default_interface; then + route delete default >/dev/null 2>&1 + fi + + if [ -n "$old_static_routes" ]; then + set $old_static_routes + while [ $# -gt 1 ]; do + route delete "$1" "$2" + shift; shift + done + fi + + arp_flush +} + +add_new_routes() { + #route add $new_ip_address $LOCALHOST >/dev/null 2>&1 + + # RFC 3442: If the DHCP server returns both a Classless Static + # Routes option and a Router option, the DHCP client MUST ignore + # the Router option. + # + # DHCP clients that support this option (Classless Static Routes) + # MUST NOT install the routes specified in the Static Routes + # option (option code 33) if both a Static Routes option and the + # Classless Static Routes option are provided. + + if [ -n "$new_classless_routes" ]; then + fill_classless_routes "$new_classless_routes" + $LOGGER "New Classless Static Routes ($interface): $classless_routes" + set $classless_routes + while [ $# -gt 1 ]; do + if [ "0.0.0.0" = "$2" ]; then + route add "$1" -iface "$interface" + else + route add "$1" "$2" + fi + shift; shift + done + return + fi + + for router in $new_routers; do + if is_default_interface; then + + if [ "$new_ip_address" = "$router" ]; then + route add default -iface $router >/dev/null 2>&1 + else + route add default $router >/dev/null 2>&1 + fi + fi + # 2nd and subsequent default routers error out, so explicitly + # stop processing the list after the first one. + break + done + + if [ -n "$new_static_routes" ]; then + $LOGGER "New Static Routes ($interface): $new_static_routes" + set $new_static_routes + while [ $# -gt 1 ]; do + route add $1 $2 + shift; shift + done + fi +} + +add_new_resolv_conf() { + # XXX Old code did not create/update resolv.conf unless both + # $new_domain_name and $new_domain_name_servers were provided. PR + # #3135 reported some ISP's only provide $new_domain_name_servers and + # thus broke the script. This code creates the resolv.conf if either + # are provided. + + local tmpres=/var/run/resolv.conf.${interface} + rm -f $tmpres + + if [ -n "$new_domain_name" ]; then + echo "search $new_domain_name" >>$tmpres + fi + + if [ -n "$new_domain_name_servers" ]; then + for nameserver in $new_domain_name_servers; do + echo "nameserver $nameserver" >>$tmpres + done + fi + + if [ -f $tmpres ]; then + if [ -f /etc/resolv.conf.tail ]; then + cat /etc/resolv.conf.tail >>$tmpres + fi + + # When resolv.conf is not changed actually, we don't + # need to update it. + # If /usr is not mounted yet, we cannot use cmp, then + # the following test fails. In such case, we simply + # ignore an error and do update resolv.conf. + if cmp -s $tmpres /etc/resolv.conf; then + rm -f $tmpres + return 0 + fi 2>/dev/null + + # In case (e.g. during OpenBSD installs) /etc/resolv.conf + # is a symbolic link, take care to preserve the link and write + # the new data in the correct location. + + if [ -f /etc/resolv.conf ]; then + cat /etc/resolv.conf > /etc/resolv.conf.save + fi + cat $tmpres > /etc/resolv.conf + rm -f $tmpres + + # Try to ensure correct ownership and permissions. + chown -RL root:wheel /etc/resolv.conf + chmod -RL 644 /etc/resolv.conf + + return 0 + fi + + return 1 +} + +# Must be used on exit. Invokes the local dhcp client exit hooks, if any. +exit_with_hooks() { + exit_status=$1 + if [ -f /etc/dhclient-exit-hooks ]; then + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script + exit $exit_status +} + +# Get the interface with the current ipv4 default route on it using only +# commands that are available prior to /usr being mounted. +is_default_interface() +{ + routeget="`route -n get -inet default`" + oldifs="$IFS" + IFS=" +" + defif= + for line in $routeget ; do + case $line in + *interface:*) + defif=${line##*: } + ;; + esac + done + IFS=${oldifs} + + if [ -z "$defif" -o "$defif" = "$interface" ]; then + return 0 + else + return 1 + fi +} + +# +# Start of active code. +# + +# Invoke the local dhcp client enter hooks, if they exist. +if [ -f /etc/dhclient-enter-hooks ]; then + exit_status=0 + . /etc/dhclient-enter-hooks + # allow the local script to abort processing of this state + # local script must set exit_status variable to nonzero. + if [ $exit_status -ne 0 ]; then + exit $exit_status + fi +fi + +case $reason in +MEDIUM) + eval "$IFCONFIG $interface $medium" + eval "$IFCONFIG $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1 + sleep 1 + ;; + +PREINIT) + delete_old_alias + $IFCONFIG $interface inet alias 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255.255 up + ;; + +ARPCHECK|ARPSEND) + ;; + +BOUND|RENEW|REBIND|REBOOT) + check_hostname + if [ -n "$old_ip_address" ]; then + if [ "$old_ip_address" != "$alias_ip_address" ]; then + delete_old_alias + fi + if [ "$old_ip_address" != "$new_ip_address" ]; then + delete_old_address + delete_old_routes + fi + fi + if [ "$reason" = BOUND ] || \ + [ "$reason" = REBOOT ] || \ + [ -z "$old_ip_address" ] || \ + [ "$old_ip_address" != "$new_ip_address" ]; then + add_new_address + add_new_routes + fi + if [ "$new_ip_address" != "$alias_ip_address" ]; then + add_new_alias + fi + if is_default_interface; then + add_new_resolv_conf + fi + ;; + +EXPIRE|FAIL) + delete_old_alias + if [ -n "$old_ip_address" ]; then + delete_old_address + delete_old_routes + fi + if [ -x $ARP ]; then + $ARP -d -a -i $interface + fi + # XXX Why add alias we just deleted above? + add_new_alias + if is_default_interface; then + if [ -f /etc/resolv.conf.save ]; then + cat /etc/resolv.conf.save > /etc/resolv.conf + fi + fi + ;; + +TIMEOUT) + delete_old_alias + add_new_address + sleep 1 + if [ -n "$new_routers" ]; then + $LOGGER "New Routers ($interface): $new_routers" + set "$new_routers" + if ping -q -c 1 -t 1 "$1"; then + if [ "$new_ip_address" != "$alias_ip_address" ]; then + add_new_alias + fi + add_new_routes + if ! is_default_interface; then + exit_with_hooks 0 + fi + if add_new_resolv_conf; then + exit_with_hooks 0 + fi + fi + fi + eval "$IFCONFIG $interface inet -alias $new_ip_address $medium" + delete_old_routes + exit_with_hooks 1 + ;; +esac + +exit_with_hooks 0 Added: head/release/picobsd/qemu/PICOBSD ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/picobsd/qemu/PICOBSD Sun Dec 27 21:58:48 2009 (r201062) @@ -0,0 +1,122 @@ +# +# $FreeBSD$ +# A configuration file to run tests on qemu. +# We disable SMP because it does not work well with qemu, and set HZ=1000 +# to avoid it being overridden. +# +# Line starting with #PicoBSD contains PicoBSD build parameters +#marker def_sz init MFS_inodes floppy_inodes +#PicoBSD 8000 init 8192 32768 +options MD_ROOT_SIZE=8000 # same as def_sz + +hints "PICOBSD.hints" + +# values accessible through getenv() +# env "PICOBSD.env" + +#cpu I486_CPU +cpu I586_CPU +cpu I686_CPU +ident PICOBSD + +#options SMP +#device apic + +options SCHED_4BSD # mandatory to have one scheduler +#options MATH_EMULATE #Support for x87 emulation +options INET #InterNETworking +#options INET6 +options FFS #Berkeley Fast Filesystem +#options BOOTP #Use BOOTP to obtain IP address/hostname +options MD_ROOT #MD is a potential root device + +#options NFS #Network Filesystem +#options NFS_ROOT #NFS usable as root device, NFS required + +#options MSDOSFS #MSDOS Filesystem +#options CD9660 #ISO 9660 Filesystem +#options CD9660_ROOT #CD-ROM usable as root, CD9660 required +#options DEVFS #Device Filesystem +#options PROCFS #Process filesystem +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] + +options KDB +options DDB + +options IPFIREWALL +options IPFIREWALL_DEFAULT_TO_ACCEPT +options IPDIVERT # divert (for natd) + +# Support for bridging and bandwidth limiting +options DUMMYNET +device if_bridge +# Running with less than 1000 seems to give poor timing on +# qemu, so we set HZ explicitly. +options HZ=1000 + +device random # used by ssh +device pci + +# Floppy drives +device fdc + +# ATA and ATAPI devices +#device ata +#device atadisk # ATA disk drives +#device atapicd # ATAPI CDROM drives +#options ATA_STATIC_ID #Static device numbering + +# atkbdc0 controls both the keyboard and the PS/2 mouse +device atkbdc # At keyboard controller +device atkbd +#device psm # do we need the mouse ?? + +device vga # VGA screen + +# syscons is the default console driver, resembling an SCO console +device sc + +# Serial (COM) ports +device uart + +# Audio support +#device pcm + +# PCCARD (PCMCIA) support +#device card # pccard bus +#device pcic # PCMCIA bridge + +# Parallel port +#device ppc +#device ppbus # Parallel port bus (required) +#device lpt # Printer +#device plip # TCP/IP over parallel +#device ppi # Parallel port interface device + +# +# The following Ethernet NICs are all PCI devices. +# +device miibus +device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device nfe # nVidia nForce MCP on-board Ethernet +#device xl # 3Com +device rl # RealTek 8129/8139 +device re # RealTek 8139C+/8169/8169S/8110S +device sis # National/SiS +device dc # DEC/Intel 21143 and various workalikes +device ed + +device loop # Network loopback +device ether # Ethernet support +device tun # Packet tunnel. +device pty # Pseudo-ttys (telnet etc) +device md # Memory "disks" +#device gif 4 # IPv6 and IPv4 tunneling +#device faith 1 # IPv6-to-IPv4 relaying (translation) +device tap + +#options DEVICE_POLLING + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +device bpf # Berkeley packet filter Added: head/release/picobsd/qemu/PICOBSD.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/picobsd/qemu/PICOBSD.hints Sun Dec 27 21:58:48 2009 (r201062) @@ -0,0 +1,39 @@ +# $FreeBSD$ +hint.fdc.0.at="isa" +hint.fdc.0.port="0x3F0" +hint.fdc.0.irq="6" +hint.fdc.0.drq="2" +hint.fd.0.at="fdc0" +hint.fd.0.drive="0" +hint.ata.0.at="isa" +hint.ata.0.port="0x1F0" +hint.ata.0.irq="14" +hint.ata.1.at="isa" +hint.ata.1.port="0x170" +hint.ata.1.irq="15" +hint.atkbdc.0.at="isa" +hint.atkbdc.0.port="0x060" +hint.atkbd.0.at="atkbdc" +hint.atkbd.0.irq="1" +hint.psm.0.at="atkbdc" +hint.psm.0.irq="12" +hint.vga.0.at="isa" +hint.sc.0.at="isa" +hint.npx.0.at="nexus" +hint.npx.0.port="0x0F0" +hint.npx.0.irq="13" +hint.uart.0.at="isa" +hint.uart.0.port="0x3F8" +hint.uart.0.flags="0x10" +hint.uart.0.irq="4" +hint.uart.1.at="isa" +hint.uart.1.port="0x2F8" +hint.uart.1.irq="3" +hint.ed.0.at="isa" +hint.ed.0.port="0x280" +hint.ed.0.irq="5" +hint.ed.0.maddr="0xd8000" +hint.ed.1.at="isa" +hint.ed.1.port="0x300" +hint.ed.1.irq="5" +hint.ed.1.maddr="0xd0000" Added: head/release/picobsd/qemu/config ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/picobsd/qemu/config Sun Dec 27 21:58:48 2009 (r201062) @@ -0,0 +1,6 @@ +# configuration for picobsd build script. +# $FreeBSD$ +# it should only contain variable definitions -- it is sourced +# by the shell much like rc.conf* files + +fd_size="4096" Added: head/release/picobsd/qemu/crunch.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/picobsd/qemu/crunch.conf Sun Dec 27 21:58:48 2009 (r201062) @@ -0,0 +1,192 @@ +# +# $FreeBSD$ +# +# Configuration file for "qemu" images.. +# +# Depending on your needs, you will almost surely need to +# add/remove/change programs according to your needs. +# Remember that some programs require matching kernel options to +# enable device drivers etc. +# +# To figure out how much space is used by each program, do +# +# size build_dir-bridge/crunch/*lo +# +# Remember that programs require libraries, which add up to the +# total size. The final binary is build_dir-bridge/mfs.tree/stand/crunch +# and you can check which libraries it uses with +# +# ldd build_dir-bridge/mfs.tree/stand/crunch + +# crunchgen configuration to build the crunched binary, see "man crunchgen" +# We need to specify generic build options, the places where to look +# for sources, and the list of program and libraries we want to put +# in the crunched binary. +# +# NOTE: the string "/usr/src" below will be automatically replaced with +# the path set in the 'build' script. + +# Default build options. Basically tell the Makefiles +# that to use the most compact possible version of the code. + +buildopts -DNO_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH +buildopts -DTRACEROUTE_NO_IPSEC -DNO_INET6 +buildopts -DWITHOUT_IPX + +# Directories where to look for sources of various binaries. +# @__CWD__@ is a magic keyword in the picobsd's (Makefile.conf) +# which is replaced with the directory with the picobsd configuration +# corresponding to your image. This way you can have custom sources +# in that directory overriding system programs. + +srcdirs @__CWD__@/src + +# Some programs are especially written for PicoBSD and reside in +# release/picobsd/tinyware. +# Put this entry near the head of the list to override standard binaries. + +srcdirs /usr/src/release/picobsd/tinyware + +# Other standard locations for sources. +# If a program uses its own source directory, add + +srcdirs /usr/src/bin +srcdirs /usr/src/sbin/i386 +srcdirs /usr/src/sbin +srcdirs /usr/src/usr.bin +srcdirs /usr/src/gnu/usr.bin +srcdirs /usr/src/usr.sbin +srcdirs /usr/src/libexec + +# For programs that reside in different places, the best option +# is to use the command "special XXX srcdir YYY" where XXX is the +# program name and YYY is the directory path. +# "special XXX ..." can be used to specify more options, see again +# the crunchgen manpage. + +#--- Basic configuraton +# init is always necessary (unless you have a replacement, oinit) +progs init + +# fsck is almost always necessary, unless you have everything on the +# image and use 'tar' or something similar to read/write raw blocks +# from the floppy. + +progs fsck + +# ifconfig is needed if you want to configure interfaces. +progs ifconfig + +# You will also need a shell and a bunch of utilities. +# The standard shell is not that large, but you need many +# external programs. In fact most of them do not take much space +# as they merely issue a system call, and print the result. +# For a more compact version of shell and utilities, you could +# try busybox, however most system management commands in busybox +# will not work as they use linux-specific interfaces. + +progs sh +ln sh -sh + +# the small utilities +progs echo +progs pwd mkdir rmdir +progs chmod chown +ln chown chgrp +progs mv ln cp rm ls +progs cat tail tee +progs test +ln test [ + +progs less +ln less more +progs mount +progs minigzip +ln minigzip gzip +progs kill +progs df +progs ps +progs ns # this is the picobsd version +ln ns netstat +progs vm +progs hostname +progs login +progs getty +progs stty +progs w +progs msg +ln msg dmesg +progs reboot + +progs sysctl +progs swapon +progs pwd_mkdb +progs umount +progs du +progs passwd + +progs route + +# If you want to run natd, remember the alias library +progs natd +libs_so -lalias # natd +progs tcpdump +special tcpdump srcdir /usr/src/usr.sbin/tcpdump/tcpdump +libs_so -lpcap # used by tcpdump + +# ppp is rather large. Note that as of Jan.01, RELEASE_CRUNCH +# makes ppp not use libalias, so you cannot have aliasing. +#progs ppp + +# You need an editor. ee is relatively small, though there are +# smaller ones. vi is much larger. +# The editor also usually need a curses library. +progs ee + +progs arp + +# these require libgeom +# progs bsdlabel fdisk mdconfig + +progs kldload kldunload kldstat +progs kldxref +progs grep +libs_so -lgnuregex -lbz2 +# dhclient-script requires 'sed' +progs dhclient +progs sed +progs date +progs time +progs ping +#progs routed +progs ipfw +progs traceroute +progs mdmfs +ln mdmfs mount_mfs +# Various filesystem support -- remember to enable the kernel parts +# progs mount_msdosfs +progs mount_nfs +# progs mount_cd9660 +ln mount_nfs nfs +ln mount_cd9660 cd9660 +#progs newfs +#ln newfs mount_mfs +# ln mount_msdosfs msdos + +# For a small ssh client/server use dropbear + +# Now the libraries +libs_so -lc # the C library +libs_so -ll # used by sh (really ?) +libs_so -lufs # used by mount +### ee uses ncurses but as a dependency +#libs_so -lncurses +libs_so -lm +libs_so -ledit -lutil +libs_so -lcrypt +libs_so -lkvm +libs_so -lz +libs_so -lbsdxml +libs_so -lsbuf +libs_so -ljail # used by ifconfig +libs_so -lulog Added: head/release/picobsd/qemu/floppy.tree.exclude ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/picobsd/qemu/floppy.tree.exclude Sun Dec 27 21:58:48 2009 (r201062) @@ -0,0 +1,2 @@ +etc/snmpd.conf +etc/ppp From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 22:26:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 993E81065679; Sun, 27 Dec 2009 22:26:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A2A58FC17; Sun, 27 Dec 2009 22:26:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRMQTuB069324; Sun, 27 Dec 2009 22:26:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRMQTu8069322; Sun, 27 Dec 2009 22:26:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912272226.nBRMQTu8069322@svn.freebsd.org> From: Ed Schouten Date: Sun, 27 Dec 2009 22:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201064 - head/lib/libulog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 22:26:29 -0000 Author: ed Date: Sun Dec 27 22:26:29 2009 New Revision: 201064 URL: http://svn.freebsd.org/changeset/base/201064 Log: Parse DEAD_PROCESS entries properly. The TTY line name should always be set for DEAD_PROCESS entries right now. When we parse a clean utmp entry, we don't want to interpret it as a DEAD_PROCESS entry if the TTY has never been used yet. Modified: head/lib/libulog/ulog_getutxent.c Modified: head/lib/libulog/ulog_getutxent.c ============================================================================== --- head/lib/libulog/ulog_getutxent.c Sun Dec 27 22:13:19 2009 (r201063) +++ head/lib/libulog/ulog_getutxent.c Sun Dec 27 22:26:29 2009 (r201064) @@ -71,7 +71,7 @@ ulog_futmp_to_utmpx(const struct futmp * utx->ut_type = NEW_TIME; else if (MATCH(user, "shutdown") && MATCH(line, "~")) utx->ut_type = SHUTDOWN_TIME; - else if (MATCH(user, "") && MATCH(host, "")) { + else if (MATCH(user, "") && MATCH(host, "") && !MATCH(line, "")) { utx->ut_type = DEAD_PROCESS; /* XXX: ut_id and ut_pid missing. ut_line not needed. */ COPY_STRING(line); From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 23:13:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C6DC1065670; Sun, 27 Dec 2009 23:13:18 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53D638FC13; Sun, 27 Dec 2009 23:13:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRNDIYJ070503; Sun, 27 Dec 2009 23:13:18 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRNDIqv070501; Sun, 27 Dec 2009 23:13:18 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912272313.nBRNDIqv070501@svn.freebsd.org> From: Doug Barton Date: Sun, 27 Dec 2009 23:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201069 - head/usr.sbin/service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 23:13:18 -0000 Author: dougb Date: Sun Dec 27 23:13:18 2009 New Revision: 201069 URL: http://svn.freebsd.org/changeset/base/201069 Log: Update the "-l or -r" usage to better conform to the standard Submitted by: ed Modified: head/usr.sbin/service/service.8 Modified: head/usr.sbin/service/service.8 ============================================================================== --- head/usr.sbin/service/service.8 Sun Dec 27 22:50:25 2009 (r201068) +++ head/usr.sbin/service/service.8 Sun Dec 27 23:13:18 2009 (r201069) @@ -35,7 +35,7 @@ .Fl e .Nm .Op Fl v -.Fl l|r +.Fl l | r .Nm .Op Fl v .Ar start|stop|etc. From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 23:15:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E23EA106566C; Sun, 27 Dec 2009 23:15:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2DB08FC13; Sun, 27 Dec 2009 23:15:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRNFNEa070586; Sun, 27 Dec 2009 23:15:23 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBRNFNga070584; Sun, 27 Dec 2009 23:15:23 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912272315.nBRNFNga070584@svn.freebsd.org> From: Doug Barton Date: Sun, 27 Dec 2009 23:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201070 - head/usr.sbin/service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 23:15:24 -0000 Author: dougb Date: Sun Dec 27 23:15:23 2009 New Revision: 201070 URL: http://svn.freebsd.org/changeset/base/201070 Log: Update the "-l or -r" usage to better conform to the standard Submitted by: ed Modified: head/usr.sbin/service/service.sh Modified: head/usr.sbin/service/service.sh ============================================================================== --- head/usr.sbin/service/service.sh Sun Dec 27 23:13:18 2009 (r201069) +++ head/usr.sbin/service/service.sh Sun Dec 27 23:15:23 2009 (r201070) @@ -33,7 +33,7 @@ usage () { echo '' echo 'Usage:' echo "${0##*/} -e" - echo "${0##*/} [-v] -l|r" + echo "${0##*/} [-v] -l | -r" echo "${0##*/} [-v] start|stop|etc." echo "${0##*/} -h" echo '' From owner-svn-src-head@FreeBSD.ORG Sun Dec 27 23:18:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2191A1065679 for ; Sun, 27 Dec 2009 23:18:52 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id A80458FC16 for ; Sun, 27 Dec 2009 23:18:51 +0000 (UTC) Received: (qmail 15307 invoked by uid 399); 27 Dec 2009 23:18:49 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 27 Dec 2009 23:18:49 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B37EB58.5000704@FreeBSD.org> Date: Sun, 27 Dec 2009 15:18:48 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Ed Schouten References: <200912200134.nBK1YCAA048942@svn.freebsd.org> <20091227191104.GZ64905@hoeg.nl> In-Reply-To: <20091227191104.GZ64905@hoeg.nl> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200743 - in head/usr.sbin: . service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 27 Dec 2009 23:18:52 -0000 Ed Schouten wrote: > Doug, > > Even though I think having a help-feature is nice, just expecting users > to open up the proper manual page seems to be our tradition. Because of > that, I think we should change the usage-output to conform a bit more > with other applications. Sorry, I don't agree. There is nothing wrong with providing the user with the information easily at hand, especially for something so simple. I am not going to ask you to _add_ this kind of functionality to things that you write, but I'm not going to take it _out_ of things that I write. :) > We should also display "-l | -r" instead of "-l|r". That I have no problem with. I made the change in both places, thank you for the suggestion. I accidentally made the change in two commits, but it's done in any case. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 00:42:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85FB2106566B; Mon, 28 Dec 2009 00:42:42 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 737078FC13; Mon, 28 Dec 2009 00:42:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS0ggiY073016; Mon, 28 Dec 2009 00:42:42 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS0ggwo073014; Mon, 28 Dec 2009 00:42:42 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912280042.nBS0ggwo073014@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Dec 2009 00:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201071 - head/sys/dev/usb/quirk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 00:42:42 -0000 Author: thompsa Date: Mon Dec 28 00:42:42 2009 New Revision: 201071 URL: http://svn.freebsd.org/changeset/base/201071 Log: Compact USB_VENDOR_X and USB_PRODUCT_Y in the quirk tables. Modified: head/sys/dev/usb/quirk/usb_quirk.c Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Sun Dec 27 23:15:23 2009 (r201070) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Dec 28 00:42:42 2009 (r201071) @@ -73,498 +73,373 @@ struct usb_quirk_entry { static struct mtx usb_quirk_mtx; +#define USB_QUIRK_VP(v,p,l,h,...) \ + { .vid = (v), .pid = (p), .lo_rev = (l), .hi_rev = (h), \ + .quirks = { __VA_ARGS__ } } #define USB_QUIRK(v,p,l,h,...) \ - .vid = (v), .pid = (p), .lo_rev = (l), .hi_rev = (h), .quirks = { __VA_ARGS__ } + USB_QUIRK_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, l, h, __VA_ARGS__) + static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { - {USB_QUIRK(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_LCM, - 0x0000, 0xFFFF, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4, - 0x094, 0x094, UQ_SWAP_UNICODE)}, - {USB_QUIRK(USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, - 0x0a2, 0x0a2, UQ_BAD_ADC)}, - {USB_QUIRK(USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, - 0x0a2, 0x0a2, UQ_AU_NO_XU)}, - {USB_QUIRK(USB_VENDOR_ALTEC, USB_PRODUCT_ALTEC_ADA70, - 0x103, 0x103, UQ_BAD_ADC)}, - {USB_QUIRK(USB_VENDOR_ALTEC, USB_PRODUCT_ALTEC_ASC495, - 0x000, 0x000, UQ_BAD_AUDIO)}, - {USB_QUIRK(USB_VENDOR_QTRONIX, USB_PRODUCT_QTRONIX_980N, - 0x110, 0x110, UQ_SPUR_BUT_UP)}, - {USB_QUIRK(USB_VENDOR_ALCOR2, USB_PRODUCT_ALCOR2_KBD_HUB, - 0x001, 0x001, UQ_SPUR_BUT_UP)}, - {USB_QUIRK(USB_VENDOR_MCT, USB_PRODUCT_MCT_HUB0100, - 0x102, 0x102, UQ_BUS_POWERED)}, - {USB_QUIRK(USB_VENDOR_MCT, USB_PRODUCT_MCT_USB232, - 0x102, 0x102, UQ_BUS_POWERED)}, - {USB_QUIRK(USB_VENDOR_TI, USB_PRODUCT_TI_UTUSB41, - 0x110, 0x110, UQ_POWER_CLAIM)}, - {USB_QUIRK(USB_VENDOR_TELEX, USB_PRODUCT_TELEX_MIC1, - 0x009, 0x009, UQ_AU_NO_FRAC)}, - {USB_QUIRK(USB_VENDOR_SILICONPORTALS, - USB_PRODUCT_SILICONPORTALS_YAPPHONE, - 0x100, 0x100, UQ_AU_INP_ASYNC)}, - {USB_QUIRK(USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_UN53B, - 0x0000, 0xFFFF, UQ_NO_STRINGS)}, - {USB_QUIRK(USB_VENDOR_ELSA, USB_PRODUCT_ELSA_MODEM1, - 0x0000, 0xFFFF, UQ_CFG_INDEX_1)}, + USB_QUIRK(ASUS, LCM, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(INSIDEOUT, EDGEPORT4, 0x094, 0x094, UQ_SWAP_UNICODE), + USB_QUIRK(DALLAS, J6502, 0x0a2, 0x0a2, UQ_BAD_ADC), + USB_QUIRK(DALLAS, J6502, 0x0a2, 0x0a2, UQ_AU_NO_XU), + USB_QUIRK(ALTEC, ADA70, 0x103, 0x103, UQ_BAD_ADC), + USB_QUIRK(ALTEC, ASC495, 0x000, 0x000, UQ_BAD_AUDIO), + USB_QUIRK(QTRONIX, 980N, 0x110, 0x110, UQ_SPUR_BUT_UP), + USB_QUIRK(ALCOR2, KBD_HUB, 0x001, 0x001, UQ_SPUR_BUT_UP), + USB_QUIRK(MCT, HUB0100, 0x102, 0x102, UQ_BUS_POWERED), + USB_QUIRK(MCT, USB232, 0x102, 0x102, UQ_BUS_POWERED), + USB_QUIRK(TI, UTUSB41, 0x110, 0x110, UQ_POWER_CLAIM), + USB_QUIRK(TELEX, MIC1, 0x009, 0x009, UQ_AU_NO_FRAC), + USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC), + USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS), + USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* * XXX The following quirks should have a more specific revision * number: */ - {USB_QUIRK(USB_VENDOR_HP, USB_PRODUCT_HP_895C, - 0x0000, 0xFFFF, UQ_BROKEN_BIDIR)}, - {USB_QUIRK(USB_VENDOR_HP, USB_PRODUCT_HP_880C, - 0x0000, 0xFFFF, UQ_BROKEN_BIDIR)}, - {USB_QUIRK(USB_VENDOR_HP, USB_PRODUCT_HP_815C, - 0x0000, 0xFFFF, UQ_BROKEN_BIDIR)}, - {USB_QUIRK(USB_VENDOR_HP, USB_PRODUCT_HP_810C, - 0x0000, 0xFFFF, UQ_BROKEN_BIDIR)}, - {USB_QUIRK(USB_VENDOR_HP, USB_PRODUCT_HP_830C, - 0x0000, 0xFFFF, UQ_BROKEN_BIDIR)}, - {USB_QUIRK(USB_VENDOR_HP, USB_PRODUCT_HP_1220C, - 0x0000, 0xFFFF, UQ_BROKEN_BIDIR)}, - {USB_QUIRK(USB_VENDOR_XEROX, USB_PRODUCT_XEROX_WCM15, - 0x0000, 0xFFFF, UQ_BROKEN_BIDIR)}, + USB_QUIRK(HP, 895C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), + USB_QUIRK(HP, 880C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), + USB_QUIRK(HP, 815C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), + USB_QUIRK(HP, 810C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), + USB_QUIRK(HP, 830C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), + USB_QUIRK(HP, 1220C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), + USB_QUIRK(XEROX, WCM15, 0x0000, 0xffff, UQ_BROKEN_BIDIR), /* Devices which should be ignored by uhid */ - {USB_QUIRK(USB_VENDOR_APC, USB_PRODUCT_APC_UPS, - 0x0000, 0xFFFF, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F6C550AVR, - 0x0000, 0xFFFF, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_CYBERPOWER, - USB_PRODUCT_CYBERPOWER_1500CAVRLCD, - 0x0000, 0xFFFF, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_DELORME, USB_PRODUCT_DELORME_EARTHMATE, - 0x0000, 0xFFFF, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_ITUNERNET, USB_PRODUCT_ITUNERNET_USBLCD2X20, - 0x0000, 0xFFFF, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_ITUNERNET, USB_PRODUCT_ITUNERNET_USBLCD4X20, - 0x0000, 0xFFFF, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_MGE, USB_PRODUCT_MGE_UPS1, - 0x0000, 0xFFFF, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_MGE, USB_PRODUCT_MGE_UPS2, - 0x0000, 0xFFFF, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE, - 0x0000, 0xFFFF, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_3G, - 0x0000, 0xFFFF, UQ_HID_IGNORE)}, + USB_QUIRK(APC, UPS, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(BELKIN, F6C550AVR, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(CYBERPOWER, 1500CAVRLCD, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(DELORME, EARTHMATE, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(ITUNERNET, USBLCD2X20, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(ITUNERNET, USBLCD4X20, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(MGE, UPS1, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(MGE, UPS2, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(APPLE, IPHONE, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(APPLE, IPHONE_3G, 0x0000, 0xffff, UQ_HID_IGNORE), /* Devices which should be ignored by both ukbd and uhid */ - {USB_QUIRK(USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_WISPY1A, - 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY1B, - 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE)}, - {USB_QUIRK(USB_VENDOR_TENX, USB_PRODUCT_TENX_UAUDIO0, - 0x0101, 0x0101, UQ_AUDIO_SWAP_LR)}, + USB_QUIRK(CYPRESS, WISPY1A, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE), + USB_QUIRK(METAGEEK, WISPY1B, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE), + USB_QUIRK(TENX, UAUDIO0, 0x0101, 0x0101, UQ_AUDIO_SWAP_LR), /* MS keyboards do weird things */ - {USB_QUIRK(USB_VENDOR_MICROSOFT, - USB_PRODUCT_MICROSOFT_WLINTELLIMOUSE, - 0x0000, 0xFFFF, UQ_MS_LEADING_BYTE)}, - {USB_QUIRK(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY24X, - 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE)}, + USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x0000, 0xffff, UQ_MS_LEADING_BYTE), + USB_QUIRK(METAGEEK, WISPY24X, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE), /* umodem(4) device quirks */ - {USB_QUIRK(USB_VENDOR_METRICOM, USB_PRODUCT_METRICOM_RICOCHET_GS, - 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA)}, - {USB_QUIRK(USB_VENDOR_SANYO, USB_PRODUCT_SANYO_SCP4900, - 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA)}, - {USB_QUIRK(USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_T720C, - 0x001, 0x001, UQ_ASSUME_CM_OVER_DATA)}, - {USB_QUIRK(USB_VENDOR_EICON, USB_PRODUCT_EICON_DIVA852, - 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA)}, - {USB_QUIRK(USB_VENDOR_SIEMENS2, USB_PRODUCT_SIEMENS2_ES75, - 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA)}, - {USB_QUIRK(USB_VENDOR_QUALCOMM, USB_PRODUCT_QUALCOMM_CDMA_MSM, - 0x0000, 0xFFFF, UQ_ASSUME_CM_OVER_DATA)}, - {USB_QUIRK(USB_VENDOR_QUALCOMM2, USB_PRODUCT_QUALCOMM2_CDMA_MSM, - 0x0000, 0xFFFF, UQ_ASSUME_CM_OVER_DATA)}, - {USB_QUIRK(USB_VENDOR_CURITEL, USB_PRODUCT_CURITEL_UM175, - 0x0000, 0xFFFF, UQ_ASSUME_CM_OVER_DATA)}, + USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(SANYO, SCP4900, 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(MOTOROLA2, T720C, 0x001, 0x001, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(EICON, DIVA852, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(SIEMENS2, ES75, 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(QUALCOMM, CDMA_MSM, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(QUALCOMM2, CDMA_MSM, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(CURITEL, UM175, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), /* USB Mass Storage Class Quirks */ - {USB_QUIRK(USB_VENDOR_ASAHIOPTICAL, 0, - 0x0000, 0xFFFF, UQ_MSC_NO_RS_CLEAR_UA, UQ_MATCH_VENDOR_ONLY)}, - {USB_QUIRK(USB_VENDOR_ADDON, USB_PRODUCT_ADDON_ATTACHE, 0x0000, - 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_ADDON, USB_PRODUCT_ADDON_A256MB, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_ADDON, USB_PRODUCT_ADDON_DISKPRO512, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_ADDONICS2, USB_PRODUCT_ADDONICS2_CABLE_205, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_AIPTEK, USB_PRODUCT_AIPTEK_POCKETCAM3M, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_AIPTEK2, USB_PRODUCT_AIPTEK2_SUNPLUS_TECH, - 0x0000, 0xFFFF, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_ALCOR, USB_PRODUCT_ALCOR_SDCR_6335, - 0x0000, 0xFFFF, UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_ALCOR, USB_PRODUCT_ALCOR_AU6390, - 0x0000, 0xFFFF, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_ALCOR, USB_PRODUCT_ALCOR_UMCR_9361, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_ALCOR, USB_PRODUCT_ALCOR_TRANSCEND, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_ASAHIOPTICAL, USB_PRODUCT_ASAHIOPTICAL_OPTIO230, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_ASAHIOPTICAL, USB_PRODUCT_ASAHIOPTICAL_OPTIO330, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_USB2SCSI, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_CASIO, USB_PRODUCT_CASIO_QV_DIGICAM, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_CCYU, USB_PRODUCT_CCYU_ED1064, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_CENTURY, USB_PRODUCT_CENTURY_EX35QUAT, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, + USB_QUIRK_VP(USB_VENDOR_ASAHIOPTICAL, 0, UQ_MSC_NO_RS_CLEAR_UA, + UQ_MATCH_VENDOR_ONLY), + USB_QUIRK(ADDON, ATTACHE, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(ADDON, A256MB, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(ADDON, DISKPRO512, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(ADDONICS2, CABLE_205, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(AIPTEK, POCKETCAM3M, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(AIPTEK2, SUNPLUS_TECH, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(ALCOR, SDCR_6335, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY, + UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(ALCOR, AU6390, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(ALCOR, UMCR_9361, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(ALCOR, TRANSCEND, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(ASAHIOPTICAL, OPTIO230, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(ASAHIOPTICAL, OPTIO330, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(BELKIN, USB2SCSI, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(CASIO, QV_DIGICAM, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(CCYU, ED1064, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(CENTURY, EX35QUAT, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, + UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(CYPRESS, XX6830XX, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, + UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(DESKNOTE, UCR_61S2B, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(DMI, CFSM_RW, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI, + UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(EPSON, STYLUS_875DC, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(EPSON, STYLUS_895, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(FEIYA, 5IN1, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(FREECOM, DVD, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(FUJIPHOTO, MASS0100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_RS_CLEAR_UA), + USB_QUIRK(GENESYS, GL641USB2IDE, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, + UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(GENESYS, GL641USB2IDE_2, 0x0000, 0xffff, + UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, - UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_XX6830XX, - 0x0000, 0xFFFF, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_DESKNOTE, USB_PRODUCT_DESKNOTE_UCR_61S2B, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_DMI, USB_PRODUCT_DMI_CFSM_RW, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_EPSON, USB_PRODUCT_EPSON_STYLUS_875DC, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_EPSON, USB_PRODUCT_EPSON_STYLUS_895, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_FEIYA, USB_PRODUCT_FEIYA_5IN1, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_FREECOM, USB_PRODUCT_FREECOM_DVD, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_FUJIPHOTO, USB_PRODUCT_FUJIPHOTO_MASS0100, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI_I, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_NO_RS_CLEAR_UA)}, - {USB_QUIRK(USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB2IDE, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE, - UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB2IDE_2, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB_2, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_WRONG_CSWSIG)}, - {USB_QUIRK(USB_VENDOR_HAGIWARA, USB_PRODUCT_HAGIWARA_FG, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_HAGIWARA, USB_PRODUCT_HAGIWARA_FGSM, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_HITACHI, USB_PRODUCT_HITACHI_DVDCAM_DZ_MV100A, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_HITACHI, USB_PRODUCT_HITACHI_DVDCAM_USB, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI_I, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_HP, USB_PRODUCT_HP_CDW4E, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_ATAPI)}, - {USB_QUIRK(USB_VENDOR_HP, USB_PRODUCT_HP_CDW8200, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI_I, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_START_STOP)}, - {USB_QUIRK(USB_VENDOR_IMAGINATION, USB_PRODUCT_IMAGINATION_DBX1, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_WRONG_CSWSIG)}, - {USB_QUIRK(USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_USBCABLE, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_START_STOP, UQ_MSC_ALT_IFACE_1)}, - {USB_QUIRK(USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_ATAPI, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_RBC)}, - {USB_QUIRK(USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_STORAGE_V2, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_RBC)}, - {USB_QUIRK(USB_VENDOR_IODATA, USB_PRODUCT_IODATA_IU_CD2, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_IODATA, USB_PRODUCT_IODATA_DVR_UEH8, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_IOMEGA, USB_PRODUCT_IOMEGA_ZIP100, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_TEST_UNIT_READY)}, /* XXX ZIP drives can also use ATAPI */ - {USB_QUIRK(USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_FINECAM_L3, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_FINECAM_S3X, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_FINECAM_S4, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_FINECAM_S5, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_LACIE, USB_PRODUCT_LACIE_HD, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_RBC)}, - {USB_QUIRK(USB_VENDOR_LEXAR, USB_PRODUCT_LEXAR_CF_READER, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_LEXAR, USB_PRODUCT_LEXAR_JUMPSHOT, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_LOGITEC, USB_PRODUCT_LOGITEC_LDR_H443SU2, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_LOGITEC, USB_PRODUCT_LOGITEC_LDR_H443U2, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI,)}, - {USB_QUIRK(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_DUBPXXG, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_MICROTECH, USB_PRODUCT_MICROTECH_DPCM, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_START_STOP)}, - {USB_QUIRK(USB_VENDOR_MICROTECH, USB_PRODUCT_MICROTECH_SCSIDB25, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_MICROTECH, USB_PRODUCT_MICROTECH_SCSIHD50, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_MINOLTA, USB_PRODUCT_MINOLTA_E223, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_MINOLTA, USB_PRODUCT_MINOLTA_F300, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_MITSUMI, USB_PRODUCT_MITSUMI_CDRRW, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI | UQ_MSC_FORCE_PROTO_ATAPI)}, - {USB_QUIRK(USB_VENDOR_MITSUMI, USB_PRODUCT_MITSUMI_FDD, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_E398, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_INQUIRY_EVPD, UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_MPMAN, 0, - 0x0000, 0xFFFF, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY)}, - {USB_QUIRK(USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_RS_CLEAR_UA)}, - {USB_QUIRK(USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY2, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_ATAPI)}, - {USB_QUIRK(USB_VENDOR_MYSON, USB_PRODUCT_MYSON_HEDEN, - 0x0000, 0xFFFF, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_MYSON, USB_PRODUCT_MYSON_HEDEN_8813, - 0x0000, 0xFFFF, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_MYSON, USB_PRODUCT_MYSON_STARREADER, - 0x0000, 0xFFFF, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND3260, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_FORCE_SHORT_INQ)}, - {USB_QUIRK(USB_VENDOR_NETAC, USB_PRODUCT_NETAC_CF_CARD, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_NETAC, USB_PRODUCT_NETAC_ONLYDISK, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_CLIK_40, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_NIKON, USB_PRODUCT_NIKON_D300, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_OLYMPUS, USB_PRODUCT_OLYMPUS_C1, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_WRONG_CSWSIG)}, - {USB_QUIRK(USB_VENDOR_OLYMPUS, USB_PRODUCT_OLYMPUS_C700, - 0x0000, 0xFFFF, UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_SDS_HOTFIND_D, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_CFMS_RW, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_CFSM_COMBO, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_CFSM_READER, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_CFSM_READER2, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_MDCFE_B_CF_READER, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_MDSM_B_READER, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_READER, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_UCF100, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_NO_INQUIRY | UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_ONSPEC2, USB_PRODUCT_ONSPEC2_IMAGEMATE_SDDR55, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_KXL840AN, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_KXLCB20AN, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_KXLCB35AN, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_LS120CAM, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_UFI)}, - {USB_QUIRK(USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_SPE3030CC, - 0x0000, 0xFFFF, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_PLEXTOR, USB_PRODUCT_PLEXTOR_40_12_40U, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_TEST_UNIT_READY)}, - {USB_QUIRK(USB_VENDOR_PNY, USB_PRODUCT_PNY_ATTACHE2, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_START_STOP)}, - {USB_QUIRK(USB_VENDOR_SAMSUNG_TECHWIN, USB_PRODUCT_SAMSUNG_TECHWIN_DIGIMAX_410, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDDR05A, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_READ_CAP_OFFBY1, UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDDR09, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDDR12, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_READ_CAP_OFFBY1, UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDCZ2_256, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDCZ4_128, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDCZ4_256, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDDR31, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_READ_CAP_OFFBY1)}, - {USB_QUIRK(USB_VENDOR_SCANLOGIC, USB_PRODUCT_SCANLOGIC_SL11R, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSB, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI_I, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_START_STOP, UQ_MSC_SHUTTLE_INIT)}, - {USB_QUIRK(USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_CDRW, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_ATAPI)}, - {USB_QUIRK(USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_CF, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_ATAPI)}, - {USB_QUIRK(USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSBATAPI, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_ATAPI)}, - {USB_QUIRK(USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSBCFSM, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSCSI, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_HIFD, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_SDDR09, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_ZIOMMC, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_SIGMATEL, USB_PRODUCT_SIGMATEL_I_BEAD100, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_SHUTTLE_INIT)}, - {USB_QUIRK(USB_VENDOR_SIIG, USB_PRODUCT_SIIG_WINTERREADER, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_SKANHEX, USB_PRODUCT_SKANHEX_MD_7425, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_SKANHEX, USB_PRODUCT_SKANHEX_SX_520Z, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_HANDYCAM, - 0x0500, 0x0500, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_RBC, - UQ_MSC_RBC_PAD_TO_12)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_40_MS, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC, - 0x0500, 0x0500, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_RBC, - UQ_MSC_RBC_PAD_TO_12)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC, - 0x0600, 0x0600, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_RBC, - UQ_MSC_RBC_PAD_TO_12)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_RBC)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_HANDYCAM, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_RBC)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_MSC, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_RBC)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_MS_MSC_U03, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_UFI, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_MS_NW_MS7, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_MS_PEG_N760C, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_MSACUS1, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_SONY, USB_PRODUCT_SONY_PORTABLE_HDD_V2, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_SUPERTOP, USB_PRODUCT_SUPERTOP_IDE, - 0x0000, 0xFFFF, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_TAUGA, USB_PRODUCT_TAUGA_CAMERAMATE, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_TEAC, USB_PRODUCT_TEAC_FD05PUB, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_UFI)}, - {USB_QUIRK(USB_VENDOR_TECLAST, USB_PRODUCT_TECLAST_TLC300, - 0x0000, 0xFFFF, UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_TREK, USB_PRODUCT_TREK_MEMKEY, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE_8MB, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_C3310, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_UFI)}, - {USB_QUIRK(USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_MP3, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_RBC)}, - {USB_QUIRK(USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_T33520, - 0x0000, 0xFFFF, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_TWINMOS, USB_PRODUCT_TWINMOS_MDIV, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI)}, - {USB_QUIRK(USB_VENDOR_VIA, USB_PRODUCT_VIA_USB2IDEBRIDGE, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_VIVITAR, USB_PRODUCT_VIVITAR_35XX, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_WESTERN, USB_PRODUCT_WESTERN_COMBO, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_WESTERN, USB_PRODUCT_WESTERN_EXTHDD, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_WESTERN, USB_PRODUCT_WESTERN_MYBOOK, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY_EVPD)}, - {USB_QUIRK(USB_VENDOR_WESTERN, USB_PRODUCT_WESTERN_MYPASSWORD, - 0x0000, 0xFFFF, UQ_MSC_FORCE_SHORT_INQ)}, - {USB_QUIRK(USB_VENDOR_WINMAXGROUP, USB_PRODUCT_WINMAXGROUP_FLASH64MC, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY)}, - {USB_QUIRK(USB_VENDOR_YANO, USB_PRODUCT_YANO_FW800HD, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE)}, - {USB_QUIRK(USB_VENDOR_YANO, USB_PRODUCT_YANO_U640MO, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI_I, UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_FORCE_SHORT_INQ)}, - {USB_QUIRK(USB_VENDOR_YEDATA, USB_PRODUCT_YEDATA_FLASHBUSTERU, - 0x0000, 0x007F, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_UFI, - UQ_MSC_NO_RS_CLEAR_UA, UQ_MSC_FLOPPY_SPEED, - UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_YEDATA, USB_PRODUCT_YEDATA_FLASHBUSTERU, - 0x0080, 0x0080, UQ_MSC_FORCE_WIRE_CBI_I, UQ_MSC_FORCE_PROTO_UFI, - UQ_MSC_NO_RS_CLEAR_UA, UQ_MSC_FLOPPY_SPEED, - UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_YEDATA, USB_PRODUCT_YEDATA_FLASHBUSTERU, - 0x0081, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI_I, UQ_MSC_FORCE_PROTO_UFI, - UQ_MSC_NO_RS_CLEAR_UA, UQ_MSC_FLOPPY_SPEED, UQ_MSC_NO_GETMAXLUN)}, - {USB_QUIRK(USB_VENDOR_ZORAN, USB_PRODUCT_ZORAN_EX20DSC, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_ATAPI)}, - {USB_QUIRK(USB_VENDOR_MEIZU, USB_PRODUCT_MEIZU_M6_SL, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_INQUIRY, UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_ACTIONS, USB_PRODUCT_ACTIONS_MP4, - 0x0000, 0xFFFF, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_NO_SYNC_CACHE)}, - {USB_QUIRK(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_GMSC, - 0x0000, 0xFFFF, UQ_MSC_NO_SYNC_CACHE)}, + UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(GENESYS, GL641USB, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, + UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(GENESYS, GL641USB_2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_WRONG_CSWSIG), + USB_QUIRK(HAGIWARA, FG, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(HAGIWARA, FGSM, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(HITACHI, DVDCAM_DZ_MV100A, 0x0000, 0xffff, + UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, + UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(HITACHI, DVDCAM_USB, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(HP, CDW4E, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_ATAPI), + USB_QUIRK(HP, CDW8200, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_TEST_UNIT_READY, + UQ_MSC_NO_START_STOP), + USB_QUIRK(IMAGINATION, DBX1, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_WRONG_CSWSIG), + USB_QUIRK(INSYSTEM, USBCABLE, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_TEST_UNIT_READY, + UQ_MSC_NO_START_STOP, UQ_MSC_ALT_IFACE_1), + USB_QUIRK(INSYSTEM, ATAPI, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_RBC), + USB_QUIRK(INSYSTEM, STORAGE_V2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_RBC), + USB_QUIRK(IODATA, IU_CD2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(IODATA, DVR_UEH8, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(IOMEGA, ZIP100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, + UQ_MSC_NO_TEST_UNIT_READY), /* XXX ZIP drives can also use ATAPI */ + USB_QUIRK(KYOCERA, FINECAM_L3, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(KYOCERA, FINECAM_S3X, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(KYOCERA, FINECAM_S4, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(KYOCERA, FINECAM_S5, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(LACIE, HD, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_RBC), + USB_QUIRK(LEXAR, CF_READER, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(LEXAR, JUMPSHOT, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(LOGITEC, LDR_H443SU2, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(LOGITEC, LDR_H443U2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI,), + USB_QUIRK(MELCO, DUBPXXG, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, + UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(MICROTECH, DPCM, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_TEST_UNIT_READY, + UQ_MSC_NO_START_STOP), + USB_QUIRK(MICROTECH, SCSIDB25, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(MICROTECH, SCSIHD50, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(MINOLTA, E223, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(MINOLTA, F300, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(MITSUMI, CDRRW, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI | + UQ_MSC_FORCE_PROTO_ATAPI), + USB_QUIRK(MITSUMI, FDD, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(MOTOROLA2, E398, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, + UQ_MSC_NO_INQUIRY_EVPD, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK_VP(USB_VENDOR_MPMAN, 0, UQ_MSC_NO_SYNC_CACHE, + UQ_MATCH_VENDOR_ONLY), + USB_QUIRK(MSYSTEMS, DISKONKEY, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_GETMAXLUN, + UQ_MSC_NO_RS_CLEAR_UA), + USB_QUIRK(MSYSTEMS, DISKONKEY2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_ATAPI), + USB_QUIRK(MYSON, HEDEN, 0x0000, 0xffff, UQ_MSC_IGNORE_RESIDUE, + UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(MYSON, HEDEN_8813, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(MYSON, STARREADER, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(NEODIO, ND3260, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ), + USB_QUIRK(NETAC, CF_CARD, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(NETAC, ONLYDISK, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(NETCHIP, CLIK_40, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_ATAPI, + UQ_MSC_NO_INQUIRY), + USB_QUIRK(NIKON, D300, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(OLYMPUS, C1, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_WRONG_CSWSIG), + USB_QUIRK(OLYMPUS, C700, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(ONSPEC, SDS_HOTFIND_D, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(ONSPEC, CFMS_RW, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(ONSPEC, CFSM_COMBO, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(ONSPEC, CFSM_READER, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(ONSPEC, CFSM_READER2, 0x0000, 0xffff, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(ONSPEC, MDCFE_B_CF_READER, 0x0000, 0xffff, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(ONSPEC, MDSM_B_READER, 0x0000, 0xffff, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(ONSPEC, READER, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(ONSPEC, UCF100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY | UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(ONSPEC2, IMAGEMATE_SDDR55, 0x0000, 0xffff, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(PANASONIC, KXL840AN, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(PANASONIC, KXLCB20AN, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(PANASONIC, KXLCB35AN, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(PANASONIC, LS120CAM, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_UFI), + USB_QUIRK(PHILIPS, SPE3030CC, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(PLEXTOR, 40_12_40U, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_TEST_UNIT_READY), + USB_QUIRK(PNY, ATTACHE2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE, + UQ_MSC_NO_START_STOP), + USB_QUIRK_VP(USB_VENDOR_SAMSUNG_TECHWIN, + USB_PRODUCT_SAMSUNG_TECHWIN_DIGIMAX_410, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(SANDISK, SDDR05A, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1, + UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(SANDISK, SDDR09, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI, + UQ_MSC_READ_CAP_OFFBY1, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(SANDISK, SDDR12, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1, + UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(SANDISK, SDCZ2_256, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(SANDISK, SDCZ4_128, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(SANDISK, SDCZ4_256, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(SANDISK, SDDR31, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1), + USB_QUIRK(SCANLOGIC, SL11R, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(SHUTTLE, EUSB, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_TEST_UNIT_READY, + UQ_MSC_NO_START_STOP, UQ_MSC_SHUTTLE_INIT), + USB_QUIRK(SHUTTLE, CDRW, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_ATAPI), + USB_QUIRK(SHUTTLE, CF, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_ATAPI), + USB_QUIRK(SHUTTLE, EUSBATAPI, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_ATAPI), + USB_QUIRK(SHUTTLE, EUSBCFSM, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(SHUTTLE, EUSCSI, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(SHUTTLE, HIFD, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(SHUTTLE, SDDR09, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI, + UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(SHUTTLE, ZIOMMC, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(SIGMATEL, I_BEAD100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_SHUTTLE_INIT), + USB_QUIRK(SIIG, WINTERREADER, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(SKANHEX, MD_7425, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(SKANHEX, SX_520Z, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(SONY, HANDYCAM, 0x0500, 0x0500, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_RBC, UQ_MSC_RBC_PAD_TO_12), + USB_QUIRK(SONY, CLIE_40_MS, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(SONY, DSC, 0x0500, 0x0500, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_RBC, UQ_MSC_RBC_PAD_TO_12), + USB_QUIRK(SONY, DSC, 0x0600, 0x0600, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_RBC, UQ_MSC_RBC_PAD_TO_12), + USB_QUIRK(SONY, DSC, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_RBC), + USB_QUIRK(SONY, HANDYCAM, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_RBC), + USB_QUIRK(SONY, MSC, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_RBC), + USB_QUIRK(SONY, MS_MSC_U03, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_UFI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(SONY, MS_NW_MS7, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(SONY, MS_PEG_N760C, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(SONY, MSACUS1, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(SONY, PORTABLE_HDD_V2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(SUPERTOP, IDE, 0x0000, 0xffff, UQ_MSC_IGNORE_RESIDUE, + UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(TAUGA, CAMERAMATE, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(TEAC, FD05PUB, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_UFI), + USB_QUIRK(TECLAST, TLC300, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY, + UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(TREK, MEMKEY, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(TREK, THUMBDRIVE_8MB, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(TRUMPION, C3310, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_UFI), + USB_QUIRK(TRUMPION, MP3, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_RBC), + USB_QUIRK(TRUMPION, T33520, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(TWINMOS, MDIV, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(VIA, USB2IDEBRIDGE, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(VIVITAR, 35XX, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(WESTERN, COMBO, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, + UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(WESTERN, EXTHDD, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, + UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(WESTERN, MYBOOK, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY_EVPD), + USB_QUIRK(WESTERN, MYPASSWORD, 0x0000, 0xffff, UQ_MSC_FORCE_SHORT_INQ), + USB_QUIRK(WINMAXGROUP, FLASH64MC, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(YANO, FW800HD, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, + UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(YANO, U640MO, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_FORCE_SHORT_INQ), + USB_QUIRK(YEDATA, FLASHBUSTERU, 0x0000, 0x007F, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_UFI, UQ_MSC_NO_RS_CLEAR_UA, UQ_MSC_FLOPPY_SPEED, + UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(YEDATA, FLASHBUSTERU, 0x0080, 0x0080, UQ_MSC_FORCE_WIRE_CBI_I, + UQ_MSC_FORCE_PROTO_UFI, UQ_MSC_NO_RS_CLEAR_UA, UQ_MSC_FLOPPY_SPEED, + UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(YEDATA, FLASHBUSTERU, 0x0081, 0xFFFF, UQ_MSC_FORCE_WIRE_CBI_I, + UQ_MSC_FORCE_PROTO_UFI, UQ_MSC_NO_RS_CLEAR_UA, UQ_MSC_FLOPPY_SPEED, + UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(ZORAN, EX20DSC, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, + UQ_MSC_FORCE_PROTO_ATAPI), + USB_QUIRK(MEIZU, M6_SL, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(ACTIONS, MP4, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(ASUS, GMSC, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), }; +#undef USB_QUIRK_VP #undef USB_QUIRK static const char *usb_quirk_str[USB_QUIRK_MAX] = { From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 00:51:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8871D1065696; Mon, 28 Dec 2009 00:51:00 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 676808FC21; Mon, 28 Dec 2009 00:51:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS0p0ZW073214; Mon, 28 Dec 2009 00:51:00 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS0p0aq073212; Mon, 28 Dec 2009 00:51:00 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912280051.nBS0p0aq073212@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 28 Dec 2009 00:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201072 - head/release/picobsd/build X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 00:51:00 -0000 Author: luigi Date: Mon Dec 28 00:51:00 2009 New Revision: 201072 URL: http://svn.freebsd.org/changeset/base/201072 Log: more support to import files and libraries from the host. Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Mon Dec 28 00:42:42 2009 (r201071) +++ head/release/picobsd/build/picobsd Mon Dec 28 00:51:00 2009 (r201072) @@ -568,10 +568,17 @@ do_links() { # rootdir varname # find_progs is a helper function to locate the named programs # or libraries in ${o_objdir} or ${_SHLIBDIRPREFIX}, # and return the full pathnames. -# Sets ${u_progs} to the list of programs, and ${u_libs} +# Called as "find_progs [-L libpath] [-P binpath] prog1 prog2 ... " +# On return it sets ${u_progs} to the list of programs, and ${u_libs} # to the list of shared libraries used. +# +# '-L path' can be used to specify a search path for libraries +# (which searches in $path/lib:$path/usr/lib:$path/usr/local/lib +# '-P binpath' can be used to specify a search path for programs +# (which searches in a lot of places in the subtree) +# -L must be the first, followed by -P # -# You can use it e.g. in a local configuration file by writing +# You can use it e.g. in a local confign file by writing # # do_copyfiles_user() { # local dst=$1 @@ -580,41 +587,60 @@ do_links() { # rootdir varname # cp -p ${u_libs} ${dst}/lib # mkdir -p ${dst}/libexec # find_progs ld-elf.so.1 -# cp -p ${u_progs} ${dst}/libexec +# cp -p ${u_progs} ${dst}/libexec # ignore errors # } find_progs() { # programs local i + local oo=${o_objdir:-${_SHLIBDIRPREFIX}} # default objdir + local lp=$oo/lib # default lib.prefix + local o="" # additional objdir + if [ x"$1" = "x-L" -a -d "$2" ] ; then # set lib search path + o=$2; shift; shift + lp="$lp:$o/lib:$o/usr/lib:$o/usr/local/lib" + o="-P $o" + fi u_progs="`find_progs_helper $*`" - local o=${o_objdir:-${_SHLIBDIRPREFIX}} - log "looking for libs for $u_progs in $_SHLIBDIRPREFIX" + log "looking for libs for <$u_progs> in $lp" [ -z "${u_progs}" ] && return 1 # not found, error - i="`LD_LIBRARY_PATH=$o/lib ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`" - u_libs="`find_progs_helper $i`" + i="`( LD_LIBRARY_PATH=$lp ldd ${u_progs} ) | \ + grep -v '^/' | awk '{print $1}' | sort | uniq`" + u_libs="`find_progs_helper $o $i`" return 0 } find_progs_helper() { # programs + local dir=${o_objdir:-${_SHLIBDIRPREFIX}/..} + local ldir="" + if [ x"$1" = "x-P" -a -d "$2" ] ; then # set path + ldir=$2; shift; shift + fi local progs="$*" - local i o places names - local subdirs="bin sbin usr.bin usr.sbin libexec lib \ + local subdirs=". local/bin local/sbin local/lib local/libexec \ + bin sbin usr.bin usr.sbin libexec lib \ gnu/usr.bin gnu/lib \ secure/usr.bin secure/usr.sbin secure/libexec secure/lib" - names="" # files to search - o="" + local names="" # files to search + local o="" + local i for i in $progs ; do - # plain programs come out verbatim + # full pathnames are just listed [ -f "$i" ] && echo $i && continue names="${names} ${o} -name $i" o="-o" done [ -z "${names}" ] && return 0 - places="" # places to search - o=${o_objdir:-${_SHLIBDIRPREFIX}/..} + local places="" # places to search for i in $subdirs ; do - [ -d "${o}/${i}" ] && places="${places} ${o}/${i}" + [ -d "${dir}/${i}" ] && places="${places} ${dir}/${i}" done - find ${places} -type f \( ${names} \) + if [ -n "${ldir}" ] ; then + for i in $subdirs ; do + [ -d "${ldir}/${i}" ] && places="${places} ${ldir}/${i}" + done + fi + # use maxdepth 3 because some libs are way down + find ${places} -maxdepth 3 -type f \( ${names} \) } # Populate the memory filesystem with binaries and non-variable From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 01:02:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D858106566B; Mon, 28 Dec 2009 01:02:45 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DA1F8FC1C; Mon, 28 Dec 2009 01:02:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS12jR6073475; Mon, 28 Dec 2009 01:02:45 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS12jTJ073473; Mon, 28 Dec 2009 01:02:45 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912280102.nBS12jTJ073473@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 28 Dec 2009 01:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201073 - head/release/picobsd/build X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 01:02:45 -0000 Author: luigi Date: Mon Dec 28 01:02:45 2009 New Revision: 201073 URL: http://svn.freebsd.org/changeset/base/201073 Log: clear leftover from previous computations Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Mon Dec 28 00:51:00 2009 (r201072) +++ head/release/picobsd/build/picobsd Mon Dec 28 01:02:45 2009 (r201073) @@ -600,6 +600,7 @@ find_progs() { # programs lp="$lp:$o/lib:$o/usr/lib:$o/usr/local/lib" o="-P $o" fi + u_libs="" u_progs="`find_progs_helper $*`" log "looking for libs for <$u_progs> in $lp" [ -z "${u_progs}" ] && return 1 # not found, error From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 01:23:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16EAD106566C; Mon, 28 Dec 2009 01:23:14 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 98F8B8FC13; Mon, 28 Dec 2009 01:23:13 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id nBS1NBQw066354; Mon, 28 Dec 2009 02:23:11 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id nBS1NB1p066353; Mon, 28 Dec 2009 02:23:11 +0100 (CET) (envelope-from marius) Date: Mon, 28 Dec 2009 02:23:11 +0100 From: Marius Strobl To: Nathan Whitehorn Message-ID: <20091228012310.GB43157@alchemy.franken.de> References: <200912271655.nBRGtiAm061778@svn.freebsd.org> <4B37C22F.8010400@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B37C22F.8010400@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201052 - in head/sys: conf sparc64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 01:23:14 -0000 On Mon, Dec 28, 2009 at 09:23:11AM +1300, Nathan Whitehorn wrote: > Marius Strobl wrote: > >Author: marius > >Date: Sun Dec 27 16:55:44 2009 > >New Revision: 201052 > >URL: http://svn.freebsd.org/changeset/base/201052 > > > >Log: > > Add a driver for the `Fire' JBus to PCIe bridges found in at least > > the Sun Fire V215/V245 and Sun Ultra 25/45 machines. This driver also > > already includes all the code to support the `Oberon' Uranus to PCIe > > bridges found in the Fujitsu-Siemens based Mx000 machines but due to > > lack of access to such a system for testing, probing of these bridges > > is currently disabled. > > > > > Nice! I think you missed a '+sparc64/pci/fire.c > optional pci' in sys/conf/files.sparc64, though. I deliberately haven't connected it to the build, yet, as these machines need the problem of the netboot device being left opened by the loader properly fixed. I thought I had a proper MI fix for this but re-reading the commit message that turned on the open- close-dance for every file access back on I think that the U-Boot support probably is abusing the closes to do post-transfer cleanup thus requiring the current behavior. Currently I'm waiting for raj@ to confirm whether this is the case so we can check other options. Marius From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 01:25:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A5D91065672; Mon, 28 Dec 2009 01:25:05 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60DCB8FC1B; Mon, 28 Dec 2009 01:25:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS1P57f074033; Mon, 28 Dec 2009 01:25:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS1P51q074030; Mon, 28 Dec 2009 01:25:05 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912280125.nBS1P51q074030@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 28 Dec 2009 01:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201076 - head/release/picobsd/qemu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 01:25:05 -0000 Author: luigi Date: Mon Dec 28 01:25:05 2009 New Revision: 201076 URL: http://svn.freebsd.org/changeset/base/201076 Log: make the memory filesystem larger, and add an example on how to import files from the host Modified: head/release/picobsd/qemu/PICOBSD head/release/picobsd/qemu/config Modified: head/release/picobsd/qemu/PICOBSD ============================================================================== --- head/release/picobsd/qemu/PICOBSD Mon Dec 28 01:17:24 2009 (r201075) +++ head/release/picobsd/qemu/PICOBSD Mon Dec 28 01:25:05 2009 (r201076) @@ -6,8 +6,8 @@ # # Line starting with #PicoBSD contains PicoBSD build parameters #marker def_sz init MFS_inodes floppy_inodes -#PicoBSD 8000 init 8192 32768 -options MD_ROOT_SIZE=8000 # same as def_sz +#PicoBSD 18000 init 8192 32768 +options MD_ROOT_SIZE=18000 # same as def_sz hints "PICOBSD.hints" Modified: head/release/picobsd/qemu/config ============================================================================== --- head/release/picobsd/qemu/config Mon Dec 28 01:17:24 2009 (r201075) +++ head/release/picobsd/qemu/config Mon Dec 28 01:25:05 2009 (r201076) @@ -3,4 +3,24 @@ # it should only contain variable definitions -- it is sourced # by the shell much like rc.conf* files -fd_size="4096" +fd_size="8192" + +# To copy individual files you can use the function do_copyfiles_user +# as below (find_progs locates the programs and their libraries, +# then you manually copy them. +#copy_files=" +#" +do_copyfiles_user() { + local dst=$1 # the destination root + log "--- put the libraries in /usr/lib to avoid conflicts" + mkdir -p ${dst}/usr/lib + log "-- import dropbear from its build directory --" + find_progs -L / -P /usr/ports/security/dropbear/work/dropbear-0.52 \ + dbclient dropbear + cp -p ${u_progs} ${dst}/bin + cp -p ${u_libs} ${dst}/usr/lib + log "--- also import ssh, scp and sshd ---" + find_progs -L / /usr/bin/ssh /usr/bin/scp /usr/sbin/sshd + cp -p ${u_progs} ${dst}/bin + cp -p ${u_libs} ${dst}/usr/lib +} From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 01:31:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D017106568B; Mon, 28 Dec 2009 01:31:05 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from lupus.usap.gov (lupus.usap.gov [157.132.252.33]) by mx1.freebsd.org (Postfix) with ESMTP id 675238FC12; Mon, 28 Dec 2009 01:31:04 +0000 (UTC) Received: from den-ex2.usap.gov [157.132.247.25] by lupus.usap.gov with XWall v3.44 ; Sun, 27 Dec 2009 18:31:03 -0700 Received: from spo-exchange-03.usap.gov ([157.132.28.81]) by DEN-EX2.usap.gov with Microsoft SMTPSVC(6.0.3790.3959); Sun, 27 Dec 2009 18:31:02 -0700 Received: from wanderer.tachypleus.net ([157.132.24.95]) by spo-exchange-03.usap.gov with Microsoft SMTPSVC(6.0.3790.3959); Mon, 28 Dec 2009 14:30:54 +1300 Message-ID: <4B380A4C.60002@freebsd.org> Date: Mon, 28 Dec 2009 14:30:52 +1300 From: Nathan Whitehorn User-Agent: Thunderbird 2.0.0.23 (X11/20091207) MIME-Version: 1.0 To: Marius Strobl References: <200912271655.nBRGtiAm061778@svn.freebsd.org> <4B37C22F.8010400@freebsd.org> <20091228012310.GB43157@alchemy.franken.de> In-Reply-To: <20091228012310.GB43157@alchemy.franken.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Dec 2009 01:30:54.0043 (UTC) FILETIME=[65A3EAB0:01CA875D] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201052 - in head/sys: conf sparc64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 01:31:05 -0000 Marius Strobl wrote: > On Mon, Dec 28, 2009 at 09:23:11AM +1300, Nathan Whitehorn wrote: > >> Marius Strobl wrote: >> >>> Author: marius >>> Date: Sun Dec 27 16:55:44 2009 >>> New Revision: 201052 >>> URL: http://svn.freebsd.org/changeset/base/201052 >>> >>> Log: >>> Add a driver for the `Fire' JBus to PCIe bridges found in at least >>> the Sun Fire V215/V245 and Sun Ultra 25/45 machines. This driver also >>> already includes all the code to support the `Oberon' Uranus to PCIe >>> bridges found in the Fujitsu-Siemens based Mx000 machines but due to >>> lack of access to such a system for testing, probing of these bridges >>> is currently disabled. >>> >>> >>> >> Nice! I think you missed a '+sparc64/pci/fire.c >> optional pci' in sys/conf/files.sparc64, though. >> > > I deliberately haven't connected it to the build, yet, as these > machines need the problem of the netboot device being left opened > by the loader properly fixed. I thought I had a proper MI fix for > this but re-reading the commit message that turned on the open- > close-dance for every file access back on I think that the U-Boot > support probably is abusing the closes to do post-transfer cleanup > thus requiring the current behavior. Currently I'm waiting for > raj@ to confirm whether this is the case so we can check other > options. > > Marius Makes sense. A fix for that issue would be nice -- netboot is completely non-functional with the stock loader on OF based PowerPC machines at the moment because of this problem as well. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 01:50:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFC06106566C; Mon, 28 Dec 2009 01:50:23 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE24D8FC12; Mon, 28 Dec 2009 01:50:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS1oNbj074540; Mon, 28 Dec 2009 01:50:23 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS1oNWh074537; Mon, 28 Dec 2009 01:50:23 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280150.nBS1oNWh074537@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 01:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201077 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 01:50:23 -0000 Author: kientzle Date: Mon Dec 28 01:50:23 2009 New Revision: 201077 URL: http://svn.freebsd.org/changeset/base/201077 Log: Update format manpages for libarchive. Modified: head/lib/libarchive/libarchive-formats.5 head/lib/libarchive/tar.5 Modified: head/lib/libarchive/libarchive-formats.5 ============================================================================== --- head/lib/libarchive/libarchive-formats.5 Mon Dec 28 01:25:05 2009 (r201076) +++ head/lib/libarchive/libarchive-formats.5 Mon Dec 28 01:50:23 2009 (r201077) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2003-2007 Tim Kientzle +.\" Copyright (c) 2003-2009 Tim Kientzle .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2009 +.Dd December 27, 2009 .Dt libarchive-formats 5 .Os .Sh NAME @@ -45,7 +45,8 @@ limitations of the current library suppo Note that just because a format is supported by libarchive does not imply that a program that uses libarchive will support that format. Applications that use libarchive specify which formats they wish -to support. +to support, though many programs do use libarchive convenience +functions to enable all supported formats. .Ss Tar Formats The .Xr libarchive 3 @@ -83,8 +84,8 @@ library can read and write POSIX-complia archives. Pax interchange format archives are an extension of the older ustar format that adds a separate entry with additional attributes stored -as key/value pairs. -The presence of this additional entry is the only difference between +as key/value pairs immediately before each regular entry. +The presence of these additional entries is the only difference between pax interchange format and the older ustar format. The extended attributes are of unlimited length and are stored as UTF-8 Unicode strings. @@ -131,16 +132,30 @@ This name is limited to 100 bytes. Extended attributes, file flags, and other extended security information cannot be stored. .It -Archive entries are limited to 2 gigabytes in size. +Archive entries are limited to 8 gigabytes in size. .El Note that the pax interchange format has none of these restrictions. .El .Pp -The libarchive library can also read a variety of commonly-used extensions to +The libarchive library also reads a variety of commonly-used extensions to the basic tar format. -In particular, it supports base-256 values in certain numeric fields. -This essentially removes the limitations on file size, modification time, +These extensions are recognized automatically whenever they appear. +.Bl -tag -width indent +.It Numeric extensions. +The POSIX standards require fixed-length numeric fields to be written with +some character position reserved for terminators. +Libarchive allows these fields to be written without terminator characters. +This extends the allowable range; in particular, ustar archives with this +extension can support entries up to 64 gigabytes in size. +Libarchive also recognizes base-256 values in most numeric fields. +This essentially removes all limitations on file size, modification time, and device numbers. +.It Solaris extensions +Libarchive recognizes ACL and extended attribute records written +by Solaris tar. +Currently, libarchive only has support for old-style ACLs; the +newer NFSv4 ACLs are recognized but discarded. +.El .Pp The first tar program appeared in Seventh Edition Unix in 1979. The first official standard for the tar file format was the @@ -159,13 +174,13 @@ A cpio archive stores each entry as a fi by a variable-length filename and variable-length data. Unlike the tar format, the cpio format does only minimal padding of the header or file data. -There are a variety of cpio formats, which differ primarily in +There are several cpio variants, which differ primarily in how they store the initial header: some store the values as octal or hexadecimal numbers in ASCII, others as binary values of varying byte order and length. .Bl -tag -width indent .It Cm binary -The libarchive library can read both big-endian and little-endian +The libarchive library transparently reads both big-endian and little-endian variants of the original binary cpio format. This format used 32-bit binary values for file size and mtime, and 16-bit binary values for the other fields. @@ -243,20 +258,24 @@ shardump archives less portable than pla .Ss ISO9660 format Libarchive can read and extract from files containing ISO9660-compliant CDROM images. -It also has partial support for Rockridge extensions. In many cases, this can remove the need to burn a physical CDROM just in order to read the files contained in an ISO9660 image. It also avoids security and complexity issues that come with virtual mounts and loopback devices. +Libarchive supports the most common Rockridge extensions and has partial +support for Joliet extensions. +If both extensions are present, the Joliet extensions will be +used and the Rockridge extensions will be ignored. +In particular, this can create problems with hardlinks and symlinks, +which are supported by Rockridge but not by Joliet. .Ss Zip format -Libarchive can extract from most zip format archives, including -jar archives, archives that use Zip64 extensions and many -self-extracting zip archives. -It currently only supports uncompressed entries and entries -compressed with the +Libarchive can read and write zip format archives that have +uncompressed entries and entries compressed with the .Dq deflate algorithm. Older zip compression algorithms are not supported. +It can extract jar archives, archives that use Zip64 extensions and many +self-extracting zip archives. Libarchive reads Zip archives as they are being streamed, which allows it to read archives of arbitrary size. It currently does not use the central directory; this @@ -273,7 +292,20 @@ The ar format has never been standardise There are two common variants: the GNU format derived from SVR4, and the BSD format, which first appeared in 4.4BSD. -Libarchive provides read and write support for both variants. +The two differ primarily in their handling of filenames +longer than 15 characters: +the GNU/SVR4 variant writes a filename table at the beginning of the archive; +the BSD format stores each long filename in an extension +area adjacent to the entry. +Libarchive can read both extensions, +including archives that may include both types of long filenames. +Programs using libarchive can write GNU/SVR4 format +if they provide a filename table to be written into +the archive before any of the entries. +Any entries whose names are not in the filename table +will be written using BSD-style long filenames. +This can cause problems for programs such as +GNU ld that do not support the BSD-style long filenames. .Ss mtree Libarchive can read and write files in .Xr mtree 5 @@ -287,20 +319,29 @@ the NetBSD and FreeBSD versions of although many of the keywords cannot currently be stored in an .Tn archive_entry object. -When reading, libarchive supports an extension that allows it -to obtain the contents of the files described by the -.Xr mtree 5 -description from files on disk. When writing, libarchive supports use of the .Xr archive_write_set_options 3 interface to specify which keywords should be included in the output. -This includes the ability to compute hash entries such -as +If libarchive was compiled with access to suitable +cryptographic libraries (such as the OpenSSL libraries), +it can compute hash entries such as .Cm sha512 or .Cm md5 from file data being written to the mtree writer. +.Pp +When reading an mtree file, libarchive will locate the corresponding +files on disk using the +.Cm contents +keyword if present or the regular filename. +If it can locate and open the file on disk, it will use that +to fill in any metadata that is missing from the mtree file +and will read the file contents and return those to the program +using libarchive. +If it cannot locate and open the file on disk, libarchive +will return an error for any attempt to read the entry +body. .Sh SEE ALSO .Xr ar 1 , .Xr cpio 1 , Modified: head/lib/libarchive/tar.5 ============================================================================== --- head/lib/libarchive/tar.5 Mon Dec 28 01:25:05 2009 (r201076) +++ head/lib/libarchive/tar.5 Mon Dec 28 01:50:23 2009 (r201077) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 19, 2009 +.Dd December 27, 2009 .Dt tar 5 .Os .Sh NAME @@ -55,8 +55,11 @@ number of records with each I/O operatio These .Dq blocks are always a multiple of the record size. -The most common block size\(emand the maximum supported by historic -implementations\(emis 10240 bytes or 20 records. +The maximum block size supported by early +implementations was 10240 bytes or 20 records. +This is still the default for most implementations +although block sizes of 1MiB (2048 records) or larger are +commonly used with modern high-speed tape drives. (Note: the terms .Dq block and @@ -272,16 +275,19 @@ when they are set and the corresponding the system. .It Va devmajor , Va devminor Major and minor numbers for character device or block device entry. -.It Va prefix -First part of pathname. +.It Va name , Va prefix If the pathname is too long to fit in the 100 bytes provided by the standard format, it can be split at any .Pa / -character with the first portion going here. +character with the first portion going into the prefix field. If the prefix field is not empty, the reader will prepend the prefix value and a .Pa / character to the regular name field to obtain the full pathname. +The standard does not require a trailing +.Pa / +character on directory names, though most implementations still +include this for compatibility reasons. .El .Pp Note that all unused bytes must be set to @@ -308,7 +314,7 @@ unless they fill the entire field. happens to have a .Pa / as the 156th character.) -POSIX requires numeric fields to be zero-padded in the front, and allows +POSIX requires numeric fields to be zero-padded in the front, and requires them to be terminated with either space or .Dv NUL characters. @@ -809,9 +815,17 @@ John Gilmore's .Nm pdtar public-domain implementation (circa 1987) was highly influential and formed the basis of -.Nm GNU tar . +.Nm GNU tar +(circa 1988). Joerg Shilling's .Nm star archiver is another open-source (GPL) archiver (originally developed circa 1985) which features complete support for pax interchange format. +.Pp +This documentation was written as part of the +.Nm libarchive +and +.Nm bsdtar +project by +.An Tim Kientzle Aq kientzle@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:01:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FE411065698; Mon, 28 Dec 2009 02:01:43 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 163878FC17; Mon, 28 Dec 2009 02:01:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS21gNY074849; Mon, 28 Dec 2009 02:01:42 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS21gch074847; Mon, 28 Dec 2009 02:01:42 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280201.nBS21gch074847@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201079 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:01:43 -0000 Author: kientzle Date: Mon Dec 28 02:01:42 2009 New Revision: 201079 URL: http://svn.freebsd.org/changeset/base/201079 Log: Update the hard-coded configuration for libarchive. Modified: head/lib/libarchive/config_freebsd.h Modified: head/lib/libarchive/config_freebsd.h ============================================================================== --- head/lib/libarchive/config_freebsd.h Mon Dec 28 01:53:52 2009 (r201078) +++ head/lib/libarchive/config_freebsd.h Mon Dec 28 02:01:42 2009 (r201079) @@ -28,6 +28,7 @@ /* FreeBSD 5.0 and later have ACL and extattr support. */ #if __FreeBSD__ > 4 #define HAVE_ACL_CREATE_ENTRY 1 +#define HAVE_ACL_GET_LINK_NP 1 #define HAVE_ACL_GET_PERM_NP 1 #define HAVE_ACL_INIT 1 #define HAVE_ACL_SET_FD 1 @@ -50,6 +51,7 @@ #define HAVE_SHA512 1 #endif +#define HAVE_BSDXML_H 1 #define HAVE_BZLIB_H 1 #define HAVE_CHFLAGS 1 #define HAVE_CHOWN 1 @@ -60,6 +62,7 @@ #define HAVE_DECL_STRERROR_R 1 #define HAVE_DECL_UINT32_MAX 1 #define HAVE_DECL_UINT64_MAX 1 +#define HAVE_DIRENT_H 1 #define HAVE_EFTYPE 1 #define HAVE_EILSEQ 1 #define HAVE_ERRNO_H 1 @@ -81,12 +84,13 @@ #define HAVE_LCHMOD 1 #define HAVE_LCHOWN 1 #define HAVE_LIMITS_H 1 +#define HAVE_LINK 1 +#define HAVE_LSTAT 1 #define HAVE_LUTIMES 1 #define HAVE_MALLOC 1 #define HAVE_MD5 1 #define HAVE_MD5_H 1 #define HAVE_MEMMOVE 1 -#define HAVE_MEMSET 1 #define HAVE_MKDIR 1 #define HAVE_MKFIFO 1 #define HAVE_MKNOD 1 @@ -95,7 +99,6 @@ #define HAVE_POLL_H 1 #define HAVE_PWD_H 1 #define HAVE_READLINK 1 -#define HAVE_RIPEMD_H #define HAVE_RMD160 1 #define HAVE_SELECT 1 #define HAVE_SETENV 1 @@ -118,6 +121,8 @@ #define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1 #define HAVE_STRUCT_STAT_ST_FLAGS 1 #define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1 +#define HAVE_SYMLINK 1 +#define HAVE_SYS_CDEFS_H 1 #define HAVE_SYS_IOCTL_H 1 #define HAVE_SYS_SELECT_H 1 #define HAVE_SYS_STAT_H 1 @@ -140,7 +145,6 @@ #define HAVE_WMEMCMP 1 #define HAVE_WMEMCPY 1 #define HAVE_ZLIB_H 1 -#define STDC_HEADERS 1 #define TIME_WITH_SYS_TIME 1 /* FreeBSD 4 and earlier lack intmax_t/uintmax_t */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:03:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E1D61065695; Mon, 28 Dec 2009 02:03:54 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46CC58FC1B; Mon, 28 Dec 2009 02:03:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS23srH074925; Mon, 28 Dec 2009 02:03:54 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS23spa074923; Mon, 28 Dec 2009 02:03:54 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280203.nBS23spa074923@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201080 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:03:54 -0000 Author: kientzle Date: Mon Dec 28 02:03:54 2009 New Revision: 201080 URL: http://svn.freebsd.org/changeset/base/201080 Log: Remove some unused variables and dead assignments. Modified: head/lib/libarchive/archive_write_set_compression_none.c Modified: head/lib/libarchive/archive_write_set_compression_none.c ============================================================================== --- head/lib/libarchive/archive_write_set_compression_none.c Mon Dec 28 02:01:42 2009 (r201079) +++ head/lib/libarchive/archive_write_set_compression_none.c Mon Dec 28 02:03:54 2009 (r201080) @@ -208,11 +208,10 @@ archive_compressor_none_finish(struct ar ssize_t target_block_length; ssize_t bytes_written; int ret; - int ret2; struct archive_none *state; state = (struct archive_none *)a->compressor.data; - ret = ret2 = ARCHIVE_OK; + ret = ARCHIVE_OK; if (a->client_writer == NULL) { archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, "No write callback is registered? " @@ -225,7 +224,6 @@ archive_compressor_none_finish(struct ar block_length = state->buffer_size - state->avail; /* Tricky calculation to determine size of last block */ - target_block_length = block_length; if (a->bytes_in_last_block <= 0) /* Default or Zero: pad to full block */ target_block_length = a->bytes_per_block; From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:04:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5493106566B; Mon, 28 Dec 2009 02:04:42 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C525C8FC13; Mon, 28 Dec 2009 02:04:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS24gMU074976; Mon, 28 Dec 2009 02:04:42 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS24gw5074974; Mon, 28 Dec 2009 02:04:42 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280204.nBS24gw5074974@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201081 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:04:42 -0000 Author: kientzle Date: Mon Dec 28 02:04:42 2009 New Revision: 201081 URL: http://svn.freebsd.org/changeset/base/201081 Log: Remove a dead assignment. Modified: head/lib/libarchive/archive_write_set_compression_gzip.c Modified: head/lib/libarchive/archive_write_set_compression_gzip.c ============================================================================== --- head/lib/libarchive/archive_write_set_compression_gzip.c Mon Dec 28 02:03:54 2009 (r201080) +++ head/lib/libarchive/archive_write_set_compression_gzip.c Mon Dec 28 02:04:42 2009 (r201081) @@ -365,7 +365,6 @@ archive_compressor_gzip_finish(struct ar block_length = state->stream.next_out - state->compressed; /* Tricky calculation to determine size of last block. */ - target_block_length = block_length; if (a->bytes_in_last_block <= 0) /* Default or Zero: pad to full block */ target_block_length = a->bytes_per_block; From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:05:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1052D106568F; Mon, 28 Dec 2009 02:05:29 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 002D18FC1A; Mon, 28 Dec 2009 02:05:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS25S2D075034; Mon, 28 Dec 2009 02:05:28 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS25Soo075032; Mon, 28 Dec 2009 02:05:28 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280205.nBS25Soo075032@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201082 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:05:29 -0000 Author: kientzle Date: Mon Dec 28 02:05:28 2009 New Revision: 201082 URL: http://svn.freebsd.org/changeset/base/201082 Log: Catch certain gzip failures at close time. Modified: head/lib/libarchive/archive_read_support_compression_gzip.c Modified: head/lib/libarchive/archive_read_support_compression_gzip.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_gzip.c Mon Dec 28 02:04:42 2009 (r201081) +++ head/lib/libarchive/archive_read_support_compression_gzip.c Mon Dec 28 02:05:28 2009 (r201082) @@ -411,6 +411,8 @@ gzip_filter_read(struct archive_read_fil /* Consume the stream trailer; release the * decompression library. */ ret = consume_trailer(self); + if (ret < ARCHIVE_OK) + return (ret); break; default: /* Return an error. */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:09:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61951106568D; Mon, 28 Dec 2009 02:09:57 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 517C28FC13; Mon, 28 Dec 2009 02:09:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS29vvi075154; Mon, 28 Dec 2009 02:09:57 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS29viN075152; Mon, 28 Dec 2009 02:09:57 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280209.nBS29viN075152@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201083 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:09:57 -0000 Author: kientzle Date: Mon Dec 28 02:09:57 2009 New Revision: 201083 URL: http://svn.freebsd.org/changeset/base/201083 Log: Compatibility fix for some older systems with non-POSIX getgrnam_r/getpwnam_r and a minor style fix for the hash function. Modified: head/lib/libarchive/archive_write_disk_set_standard_lookup.c Modified: head/lib/libarchive/archive_write_disk_set_standard_lookup.c ============================================================================== --- head/lib/libarchive/archive_write_disk_set_standard_lookup.c Mon Dec 28 02:05:28 2009 (r201082) +++ head/lib/libarchive/archive_write_disk_set_standard_lookup.c Mon Dec 28 02:09:57 2009 (r201083) @@ -125,6 +125,7 @@ lookup_gid(void *private_data, const cha int r; for (;;) { + result = &grent; /* Old getgrnam_r ignores last arg. */ r = getgrnam_r(gname, &grent, buffer, bufsize, &result); if (r == 0) break; @@ -184,6 +185,7 @@ lookup_uid(void *private_data, const cha int r; for (;;) { + result = &pwent; /* Old getpwnam_r ignores last arg. */ r = getpwnam_r(uname, &pwent, buffer, bufsize, &result); if (r == 0) break; @@ -230,8 +232,8 @@ hash(const char *p) as used by ELF for hashing function names. */ unsigned g, h = 0; while (*p != '\0') { - h = ( h << 4 ) + *p++; - if (( g = h & 0xF0000000 )) { + h = (h << 4) + *p++; + if ((g = h & 0xF0000000) != 0) { h ^= g >> 24; h &= 0x0FFFFFFF; } From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:14:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7AF2106566B; Mon, 28 Dec 2009 02:14:09 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A725A8FC12; Mon, 28 Dec 2009 02:14:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2E9rp075287; Mon, 28 Dec 2009 02:14:09 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2E9Zi075285; Mon, 28 Dec 2009 02:14:09 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280214.nBS2E9Zi075285@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201084 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:14:09 -0000 Author: kientzle Date: Mon Dec 28 02:14:09 2009 New Revision: 201084 URL: http://svn.freebsd.org/changeset/base/201084 Log: Sync with googlecode some changes that have no impact on FreeBSD. Modified: head/lib/libarchive/archive_read_disk_entry_from_file.c Modified: head/lib/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/lib/libarchive/archive_read_disk_entry_from_file.c Mon Dec 28 02:09:57 2009 (r201083) +++ head/lib/libarchive/archive_read_disk_entry_from_file.c Mon Dec 28 02:14:09 2009 (r201084) @@ -103,7 +103,7 @@ archive_read_disk_entry_from_file(struct * open file descriptor which we can use in the subsequent lookups. */ if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) { if (fd < 0) - fd = open(pathname, O_RDONLY | O_NONBLOCK); + fd = open(pathname, O_RDONLY | O_NONBLOCK | O_BINARY); if (fd >= 0) { unsigned long stflags; int r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags); @@ -114,6 +114,11 @@ archive_read_disk_entry_from_file(struct #endif if (st == NULL) { + /* TODO: On Windows, use GetFileInfoByHandle() here. + * Using Windows stat() call is badly broken, but + * even the stat() wrapper has problems because + * 'struct stat' is broken on Windows. + */ #if HAVE_FSTAT if (fd >= 0) { if (fstat(fd, &s) != 0) From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:17:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F9761065670; Mon, 28 Dec 2009 02:17:15 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F6608FC13; Mon, 28 Dec 2009 02:17:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2HFML075382; Mon, 28 Dec 2009 02:17:15 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2HFMT075380; Mon, 28 Dec 2009 02:17:15 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280217.nBS2HFMT075380@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201085 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:17:15 -0000 Author: kientzle Date: Mon Dec 28 02:17:15 2009 New Revision: 201085 URL: http://svn.freebsd.org/changeset/base/201085 Log: Compatibility: I found some more compilers that don't like 'inline' keyword. Protection: Discourage people from using this header outside libarchive. Modified: head/lib/libarchive/archive_endian.h Modified: head/lib/libarchive/archive_endian.h ============================================================================== --- head/lib/libarchive/archive_endian.h Mon Dec 28 02:14:09 2009 (r201084) +++ head/lib/libarchive/archive_endian.h Mon Dec 28 02:17:15 2009 (r201085) @@ -28,6 +28,10 @@ * Borrowed from FreeBSD's */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + /* Note: This is a purely internal header! */ /* Do not use this outside of libarchive internal code! */ @@ -41,7 +45,7 @@ * - SGI MIPSpro * - Microsoft Visual C++ 6.0 (supposedly newer versions too) */ -#if defined(__WATCOMC__) || defined(__sgi) +#if defined(__WATCOMC__) || defined(__sgi) || defined(__hpux) || defined(__BORLANDC__) #define inline #elif defined(_MSC_VER) #define inline __inline From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:17:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5597B1065672; Mon, 28 Dec 2009 02:17:54 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 454BE8FC13; Mon, 28 Dec 2009 02:17:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2Hs1m075428; Mon, 28 Dec 2009 02:17:54 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2HsXU075426; Mon, 28 Dec 2009 02:17:54 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280217.nBS2HsXU075426@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201086 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:17:54 -0000 Author: kientzle Date: Mon Dec 28 02:17:53 2009 New Revision: 201086 URL: http://svn.freebsd.org/changeset/base/201086 Log: Discourage people from using this header outside of libarchive. Modified: head/lib/libarchive/archive_write_disk_private.h Modified: head/lib/libarchive/archive_write_disk_private.h ============================================================================== --- head/lib/libarchive/archive_write_disk_private.h Mon Dec 28 02:17:15 2009 (r201085) +++ head/lib/libarchive/archive_write_disk_private.h Mon Dec 28 02:17:53 2009 (r201086) @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + #ifndef ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED #define ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:18:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13422106568B; Mon, 28 Dec 2009 02:18:27 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 033F38FC1C; Mon, 28 Dec 2009 02:18:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2IQpa075478; Mon, 28 Dec 2009 02:18:26 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2IQoU075476; Mon, 28 Dec 2009 02:18:26 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280218.nBS2IQoU075476@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201087 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:18:27 -0000 Author: kientzle Date: Mon Dec 28 02:18:26 2009 New Revision: 201087 URL: http://svn.freebsd.org/changeset/base/201087 Log: Enforce this as an internal-only header. Modified: head/lib/libarchive/filter_fork.h Modified: head/lib/libarchive/filter_fork.h ============================================================================== --- head/lib/libarchive/filter_fork.h Mon Dec 28 02:17:53 2009 (r201086) +++ head/lib/libarchive/filter_fork.h Mon Dec 28 02:18:26 2009 (r201087) @@ -25,6 +25,10 @@ * $FreeBSD$ */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + #ifndef FILTER_FORK_H #define FILTER_FORK_H From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:18:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFA6610656AA; Mon, 28 Dec 2009 02:18:55 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF7ED8FC28; Mon, 28 Dec 2009 02:18:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2Itdm075521; Mon, 28 Dec 2009 02:18:55 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2IteI075519; Mon, 28 Dec 2009 02:18:55 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280218.nBS2IteI075519@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201088 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:18:55 -0000 Author: kientzle Date: Mon Dec 28 02:18:55 2009 New Revision: 201088 URL: http://svn.freebsd.org/changeset/base/201088 Log: Allow more formats to be active at a time; discourage outside use. Modified: head/lib/libarchive/archive_read_private.h Modified: head/lib/libarchive/archive_read_private.h ============================================================================== --- head/lib/libarchive/archive_read_private.h Mon Dec 28 02:18:26 2009 (r201087) +++ head/lib/libarchive/archive_read_private.h Mon Dec 28 02:18:55 2009 (r201088) @@ -25,6 +25,10 @@ * $FreeBSD$ */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + #ifndef ARCHIVE_READ_PRIVATE_H_INCLUDED #define ARCHIVE_READ_PRIVATE_H_INCLUDED @@ -160,7 +164,7 @@ struct archive_read { int (*read_data)(struct archive_read *, const void **, size_t *, off_t *); int (*read_data_skip)(struct archive_read *); int (*cleanup)(struct archive_read *); - } formats[8]; + } formats[9]; struct archive_format_descriptor *format; /* Active format. */ /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:20:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8F011065670; Mon, 28 Dec 2009 02:20:23 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D893C8FC19; Mon, 28 Dec 2009 02:20:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2KNhl075596; Mon, 28 Dec 2009 02:20:23 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2KNe6075594; Mon, 28 Dec 2009 02:20:23 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280220.nBS2KNe6075594@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201089 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:20:24 -0000 Author: kientzle Date: Mon Dec 28 02:20:23 2009 New Revision: 201089 URL: http://svn.freebsd.org/changeset/base/201089 Log: Portability: terminate abnormally via abort() instead of segfault, watch the return value from write(), and avoid signed arithmetic on unsigned values. Modified: head/lib/libarchive/archive_check_magic.c Modified: head/lib/libarchive/archive_check_magic.c ============================================================================== --- head/lib/libarchive/archive_check_magic.c Mon Dec 28 02:18:55 2009 (r201088) +++ head/lib/libarchive/archive_check_magic.c Mon Dec 28 02:20:23 2009 (r201089) @@ -50,7 +50,16 @@ __FBSDID("$FreeBSD$"); static void errmsg(const char *m) { - write(2, m, strlen(m)); + size_t s = strlen(m); + ssize_t written; + + while (s > 0) { + written = write(2, m, strlen(m)); + if (written <= 0) + return; + m += written; + s -= written; + } } static void @@ -60,8 +69,7 @@ diediedie(void) /* Cause a breakpoint exception */ DebugBreak(); #endif - *(char *)0 = 1; /* Deliberately segfault and force a coredump. */ - _exit(1); /* If that didn't work, just exit with an error. */ + abort(); /* Terminate the program abnormally. */ } static const char * @@ -85,7 +93,7 @@ write_all_states(unsigned int states) unsigned int lowbit; /* A trick for computing the lowest set bit. */ - while ((lowbit = states & (-states)) != 0) { + while ((lowbit = states & (1 + ~states)) != 0) { states &= ~lowbit; /* Clear the low bit. */ errmsg(state_name(lowbit)); if (states != 0) From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:22:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B5C6106566C; Mon, 28 Dec 2009 02:22:05 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 416F38FC0C; Mon, 28 Dec 2009 02:22:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2M52q075683; Mon, 28 Dec 2009 02:22:05 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2M5X9075681; Mon, 28 Dec 2009 02:22:05 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280222.nBS2M5X9075681@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201090 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:22:05 -0000 Author: kientzle Date: Mon Dec 28 02:22:04 2009 New Revision: 201090 URL: http://svn.freebsd.org/changeset/base/201090 Log: Portability: * some non-FreeBSD platforms do actually define __FBSDID() in sys/cdefs.h * Borland C Modified: head/lib/libarchive/archive_platform.h Modified: head/lib/libarchive/archive_platform.h ============================================================================== --- head/lib/libarchive/archive_platform.h Mon Dec 28 02:20:23 2009 (r201089) +++ head/lib/libarchive/archive_platform.h Mon Dec 28 02:22:04 2009 (r201090) @@ -25,6 +25,8 @@ * $FreeBSD$ */ +/* !!ONLY FOR USE INTERNALLY TO LIBARCHIVE!! */ + /* * This header is the first thing included in any of the libarchive * source files. As far as possible, platform-specific issues should @@ -50,17 +52,27 @@ #error Oops: No config.h and no pre-built configuration in archive_platform.h. #endif +/* It should be possible to get rid of this by extending the feature-test + * macros to cover Windows API functions, probably along with non-trivial + * refactoring of code to find structures that sit more cleanly on top of + * either Windows or Posix APIs. */ +#if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__) +#include "archive_windows.h" +#endif + /* * The config files define a lot of feature macros. The following * uses those macros to select/define replacements and include key * headers as required. */ -/* No non-FreeBSD platform will have __FBSDID, so just define it here. */ -#ifdef __FreeBSD__ -#include /* For __FBSDID */ -#else -/* Just leaving this macro replacement empty leads to a dangling semicolon. */ +/* Get a real definition for __FBSDID if we can */ +#if HAVE_SYS_CDEFS_H +#include +#endif + +/* If not, define it so as to avoid dangling semicolons. */ +#ifndef __FBSDID #define __FBSDID(a) struct _undefined_hack #endif @@ -72,6 +84,26 @@ #include #endif +/* Borland warns about its own constants! */ +#if defined(__BORLANDC__) +# if HAVE_DECL_UINT64_MAX +# undef UINT64_MAX +# undef HAVE_DECL_UINT64_MAX +# endif +# if HAVE_DECL_UINT64_MIN +# undef UINT64_MIN +# undef HAVE_DECL_UINT64_MIN +# endif +# if HAVE_DECL_INT64_MAX +# undef INT64_MAX +# undef HAVE_DECL_INT64_MAX +# endif +# if HAVE_DECL_INT64_MIN +# undef INT64_MIN +# undef HAVE_DECL_INT64_MIN +# endif +#endif + /* Some platforms lack the standard *_MAX definitions. */ #if !HAVE_DECL_SIZE_MAX #define SIZE_MAX (~(size_t)0) From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:22:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9034D106568B; Mon, 28 Dec 2009 02:22:41 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF6B8FC22; Mon, 28 Dec 2009 02:22:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2MfxW075729; Mon, 28 Dec 2009 02:22:41 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2MfJi075727; Mon, 28 Dec 2009 02:22:41 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280222.nBS2MfJi075727@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201091 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:22:41 -0000 Author: kientzle Date: Mon Dec 28 02:22:41 2009 New Revision: 201091 URL: http://svn.freebsd.org/changeset/base/201091 Log: Remove dead assignment. Modified: head/lib/libarchive/archive_write_set_compression_bzip2.c Modified: head/lib/libarchive/archive_write_set_compression_bzip2.c ============================================================================== --- head/lib/libarchive/archive_write_set_compression_bzip2.c Mon Dec 28 02:22:04 2009 (r201090) +++ head/lib/libarchive/archive_write_set_compression_bzip2.c Mon Dec 28 02:22:41 2009 (r201091) @@ -291,7 +291,6 @@ archive_compressor_bzip2_finish(struct a block_length = state->stream.next_out - state->compressed; /* Tricky calculation to determine size of last block. */ - target_block_length = block_length; if (a->bytes_in_last_block <= 0) /* Default or Zero: pad to full block */ target_block_length = a->bytes_per_block; From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:26:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F924106566C; Mon, 28 Dec 2009 02:26:07 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F7598FC1A; Mon, 28 Dec 2009 02:26:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2Q6M5075821; Mon, 28 Dec 2009 02:26:06 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2Q6lu075819; Mon, 28 Dec 2009 02:26:06 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280226.nBS2Q6lu075819@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201092 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:26:07 -0000 Author: kientzle Date: Mon Dec 28 02:26:06 2009 New Revision: 201092 URL: http://svn.freebsd.org/changeset/base/201092 Log: Discourage outside use of this internal header. Modified: head/lib/libarchive/archive_string.h Modified: head/lib/libarchive/archive_string.h ============================================================================== --- head/lib/libarchive/archive_string.h Mon Dec 28 02:22:41 2009 (r201091) +++ head/lib/libarchive/archive_string.h Mon Dec 28 02:26:06 2009 (r201092) @@ -26,6 +26,10 @@ * */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + #ifndef ARCHIVE_STRING_H_INCLUDED #define ARCHIVE_STRING_H_INCLUDED From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:28:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3C5D106566B; Mon, 28 Dec 2009 02:28:44 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9AFB8FC08; Mon, 28 Dec 2009 02:28:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2Sitn075909; Mon, 28 Dec 2009 02:28:44 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2SiNx075905; Mon, 28 Dec 2009 02:28:44 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280228.nBS2SiNx075905@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201093 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:28:45 -0000 Author: kientzle Date: Mon Dec 28 02:28:44 2009 New Revision: 201093 URL: http://svn.freebsd.org/changeset/base/201093 Log: Portability: Set the file descriptor to binary mode on Win32 Modified: head/lib/libarchive/archive_read_open_file.c head/lib/libarchive/archive_read_open_filename.c head/lib/libarchive/archive_write_open_fd.c Modified: head/lib/libarchive/archive_read_open_file.c ============================================================================== --- head/lib/libarchive/archive_read_open_file.c Mon Dec 28 02:26:06 2009 (r201092) +++ head/lib/libarchive/archive_read_open_file.c Mon Dec 28 02:28:44 2009 (r201093) @@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_FCNTL_H #include #endif +#ifdef HAVE_IO_H +#include +#endif #ifdef HAVE_STDLIB_H #include #endif @@ -94,6 +97,10 @@ archive_read_open_FILE(struct archive *a } else mine->can_skip = 0; +#if defined(__CYGWIN__) || defined(_WIN32) + setmode(fileno(mine->f), O_BINARY); +#endif + return (archive_read_open2(a, mine, NULL, file_read, file_skip, file_close)); } Modified: head/lib/libarchive/archive_read_open_filename.c ============================================================================== --- head/lib/libarchive/archive_read_open_filename.c Mon Dec 28 02:26:06 2009 (r201092) +++ head/lib/libarchive/archive_read_open_filename.c Mon Dec 28 02:28:44 2009 (r201093) @@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_FCNTL_H #include #endif +#ifdef HAVE_IO_H +#include +#endif #ifdef HAVE_STDLIB_H #include #endif @@ -96,6 +99,9 @@ archive_read_open_filename(struct archiv */ filename = ""; /* Normalize NULL to "" */ fd = 0; +#if defined(__CYGWIN__) || defined(_WIN32) + setmode(0, O_BINARY); +#endif } else { fd = open(filename, O_RDONLY | O_BINARY); if (fd < 0) { Modified: head/lib/libarchive/archive_write_open_fd.c ============================================================================== --- head/lib/libarchive/archive_write_open_fd.c Mon Dec 28 02:26:06 2009 (r201092) +++ head/lib/libarchive/archive_write_open_fd.c Mon Dec 28 02:28:44 2009 (r201093) @@ -32,6 +32,12 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_ERRNO_H #include #endif +#ifdef HAVE_FCNTL_H +#include +#endif +#ifdef HAVE_IO_H +#include +#endif #ifdef HAVE_STDLIB_H #include #endif @@ -64,6 +70,9 @@ archive_write_open_fd(struct archive *a, return (ARCHIVE_FATAL); } mine->fd = fd; +#if defined(__CYGWIN__) || defined(_WIN32) + setmode(mine->fd, O_BINARY); +#endif return (archive_write_open(a, mine, file_open, file_write, file_close)); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:29:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F09D8106566B; Mon, 28 Dec 2009 02:29:21 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E00328FC12; Mon, 28 Dec 2009 02:29:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2TLHk075959; Mon, 28 Dec 2009 02:29:21 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2TLK7075957; Mon, 28 Dec 2009 02:29:21 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280229.nBS2TLK7075957@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201094 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:29:22 -0000 Author: kientzle Date: Mon Dec 28 02:29:21 2009 New Revision: 201094 URL: http://svn.freebsd.org/changeset/base/201094 Log: Eliminate an unused assignment. Modified: head/lib/libarchive/archive_read_support_compression_compress.c Modified: head/lib/libarchive/archive_read_support_compression_compress.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_compress.c Mon Dec 28 02:28:44 2009 (r201093) +++ head/lib/libarchive/archive_read_support_compression_compress.c Mon Dec 28 02:29:21 2009 (r201094) @@ -229,8 +229,8 @@ compress_bidder_init(struct archive_read /* XXX MOVE THE FOLLOWING OUT OF INIT() XXX */ - code = getbits(self, 8); /* Skip first signature byte. */ - code = getbits(self, 8); /* Skip second signature byte. */ + (void)getbits(self, 8); /* Skip first signature byte. */ + (void)getbits(self, 8); /* Skip second signature byte. */ code = getbits(self, 8); state->maxcode_bits = code & 0x1f; From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:33:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBD00106568D; Mon, 28 Dec 2009 02:33:22 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB8B78FC1B; Mon, 28 Dec 2009 02:33:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2XMIG076096; Mon, 28 Dec 2009 02:33:22 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2XM4k076094; Mon, 28 Dec 2009 02:33:22 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280233.nBS2XM4k076094@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201095 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:33:22 -0000 Author: kientzle Date: Mon Dec 28 02:33:22 2009 New Revision: 201095 URL: http://svn.freebsd.org/changeset/base/201095 Log: Remove an unused variable and an unnecessary increment. Modified: head/lib/libarchive/archive_string.c Modified: head/lib/libarchive/archive_string.c ============================================================================== --- head/lib/libarchive/archive_string.c Mon Dec 28 02:29:21 2009 (r201094) +++ head/lib/libarchive/archive_string.c Mon Dec 28 02:33:22 2009 (r201095) @@ -291,12 +291,10 @@ __archive_string_utf8_w(struct archive_s int wc, wc2;/* Must be large enough for a 21-bit Unicode code point. */ const char *src; int n; - int err; ws = (wchar_t *)malloc((as->length + 1) * sizeof(wchar_t)); if (ws == NULL) __archive_errx(1, "Out of memory"); - err = 0; dest = ws; src = as->s; while (*src != '\0') { @@ -344,7 +342,7 @@ __archive_string_utf8_w(struct archive_s } else *dest++ = wc; } - *dest++ = L'\0'; + *dest = L'\0'; return (ws); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:41:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A4EB106566B; Mon, 28 Dec 2009 02:41:28 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08DFE8FC20; Mon, 28 Dec 2009 02:41:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2fSAR076345; Mon, 28 Dec 2009 02:41:28 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2fRfn076339; Mon, 28 Dec 2009 02:41:27 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280241.nBS2fRfn076339@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201096 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:41:28 -0000 Author: kientzle Date: Mon Dec 28 02:41:27 2009 New Revision: 201096 URL: http://svn.freebsd.org/changeset/base/201096 Log: Various portability fixes, plus: * New "ino64" field. * New UTF8 interfaces for hardlink/symlink updates Added: head/lib/libarchive/archive_entry_xattr.c (contents, props changed) Modified: head/lib/libarchive/Makefile head/lib/libarchive/archive_entry.c head/lib/libarchive/archive_entry.h head/lib/libarchive/archive_entry_private.h Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Mon Dec 28 02:33:22 2009 (r201095) +++ head/lib/libarchive/Makefile Mon Dec 28 02:41:27 2009 (r201096) @@ -34,6 +34,7 @@ SRCS= archive_check_magic.c \ archive_entry_stat.c \ archive_entry_strmode.c \ archive_entry_link_resolver.c \ + archive_entry_xattr.c \ archive_read.c \ archive_read_data_into_fd.c \ archive_read_disk.c \ Modified: head/lib/libarchive/archive_entry.c ============================================================================== --- head/lib/libarchive/archive_entry.c Mon Dec 28 02:33:22 2009 (r201095) +++ head/lib/libarchive/archive_entry.c Mon Dec 28 02:41:27 2009 (r201096) @@ -32,12 +32,12 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef MAJOR_IN_MKDEV +#if MAJOR_IN_MKDEV #include -#else -#ifdef MAJOR_IN_SYSMACROS +#define HAVE_MAJOR +#elif MAJOR_IN_SYSMACROS #include -#endif +#define HAVE_MAJOR #endif #ifdef HAVE_LIMITS_H #include @@ -75,6 +75,13 @@ __FBSDID("$FreeBSD$"); #undef max #define max(a, b) ((a)>(b)?(a):(b)) +#if !defined(HAVE_MAJOR) && !defined(major) +/* Replacement for major/minor/makedev. */ +#define major(x) ((int)(0x00ff & ((x) >> 8))) +#define minor(x) ((int)(0xffff00ff & (x))) +#define makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min))) +#endif + /* Play games to come up with a suitable makedev() definition. */ #ifdef __QNXNTO__ /* QNX. */ @@ -215,7 +222,7 @@ static const wchar_t * aes_get_wcs(struct aes *aes) { wchar_t *w; - int r; + size_t r; /* Return WCS form if we already have it. */ if (aes->aes_set & AES_SET_WCS) @@ -233,7 +240,7 @@ aes_get_wcs(struct aes *aes) if (w == NULL) __archive_errx(1, "No memory for aes_get_wcs()"); r = mbstowcs(w, aes->aes_mbs.s, wcs_length); - if (r > 0) { + if (r != (size_t)-1 && r != 0) { w[r] = 0; aes->aes_set |= AES_SET_WCS; return (aes->aes_wcs = w); @@ -618,6 +625,12 @@ archive_entry_ino(struct archive_entry * return (entry->ae_stat.aest_ino); } +int64_t +archive_entry_ino64(struct archive_entry *entry) +{ + return (entry->ae_stat.aest_ino); +} + mode_t archive_entry_mode(struct archive_entry *entry) { @@ -818,6 +831,13 @@ archive_entry_set_ino(struct archive_ent } void +archive_entry_set_ino64(struct archive_entry *entry, int64_t ino) +{ + entry->stat_valid = 0; + entry->ae_stat.aest_ino = ino; +} + +void archive_entry_set_hardlink(struct archive_entry *entry, const char *target) { aes_set_mbs(&entry->ae_hardlink, target); @@ -847,6 +867,16 @@ archive_entry_copy_hardlink_w(struct arc entry->ae_set &= ~AE_SET_HARDLINK; } +int +archive_entry_update_hardlink_utf8(struct archive_entry *entry, const char *target) +{ + if (target != NULL) + entry->ae_set |= AE_SET_HARDLINK; + else + entry->ae_set &= ~AE_SET_HARDLINK; + return (aes_update_utf8(&entry->ae_hardlink, target)); +} + void archive_entry_set_atime(struct archive_entry *entry, time_t t, long ns) { @@ -1095,6 +1125,16 @@ archive_entry_copy_symlink_w(struct arch entry->ae_set &= ~AE_SET_SYMLINK; } +int +archive_entry_update_symlink_utf8(struct archive_entry *entry, const char *linkname) +{ + if (linkname != NULL) + entry->ae_set |= AE_SET_SYMLINK; + else + entry->ae_set &= ~AE_SET_SYMLINK; + return (aes_update_utf8(&entry->ae_symlink, linkname)); +} + void archive_entry_set_uid(struct archive_entry *entry, uid_t u) { @@ -1186,7 +1226,7 @@ archive_entry_acl_add_entry_w(struct arc archive_entry_acl_add_entry_w_len(entry, type, permset, tag, id, name, wcslen(name)); } -void +static void archive_entry_acl_add_entry_w_len(struct archive_entry *entry, int type, int permset, int tag, int id, const wchar_t *name, size_t len) { @@ -1595,7 +1635,7 @@ __archive_entry_acl_parse_w(struct archi const wchar_t *end; } field[4], name; - int fields; + int fields, n; int type, tag, permset, id; wchar_t sep; @@ -1615,6 +1655,10 @@ __archive_entry_acl_parse_w(struct archi ++fields; } while (sep == L':'); + /* Set remaining fields to blank. */ + for (n = fields; n < 4; ++n) + field[n].start = field[n].end = NULL; + /* Check for a numeric ID in field 1 or 3. */ id = -1; isint_w(field[1].start, field[1].end, &id); @@ -1626,7 +1670,7 @@ __archive_entry_acl_parse_w(struct archi * Solaris extension: "defaultuser::rwx" is the * default ACL corresponding to "user::rwx", etc. */ - if (field[0].end-field[0].start > 7 + if (field[0].end - field[0].start > 7 && wmemcmp(field[0].start, L"default", 7) == 0) { type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; field[0].start += 7; @@ -1653,7 +1697,7 @@ __archive_entry_acl_parse_w(struct archi } else if (prefix_w(field[0].start, field[0].end, L"other")) { if (fields == 2 && field[1].start < field[1].end - && ismode_w(field[1].start, field[2].end, &permset)) { + && ismode_w(field[1].start, field[1].end, &permset)) { /* This is Solaris-style "other:rwx" */ } else if (fields == 3 && field[1].start == field[1].end @@ -1687,98 +1731,6 @@ __archive_entry_acl_parse_w(struct archi } /* - * extended attribute handling - */ - -void -archive_entry_xattr_clear(struct archive_entry *entry) -{ - struct ae_xattr *xp; - - while (entry->xattr_head != NULL) { - xp = entry->xattr_head->next; - free(entry->xattr_head->name); - free(entry->xattr_head->value); - free(entry->xattr_head); - entry->xattr_head = xp; - } - - entry->xattr_head = NULL; -} - -void -archive_entry_xattr_add_entry(struct archive_entry *entry, - const char *name, const void *value, size_t size) -{ - struct ae_xattr *xp; - - for (xp = entry->xattr_head; xp != NULL; xp = xp->next) - ; - - if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL) - /* XXX Error XXX */ - return; - - xp->name = strdup(name); - if ((xp->value = malloc(size)) != NULL) { - memcpy(xp->value, value, size); - xp->size = size; - } else - xp->size = 0; - - xp->next = entry->xattr_head; - entry->xattr_head = xp; -} - - -/* - * returns number of the extended attribute entries - */ -int -archive_entry_xattr_count(struct archive_entry *entry) -{ - struct ae_xattr *xp; - int count = 0; - - for (xp = entry->xattr_head; xp != NULL; xp = xp->next) - count++; - - return count; -} - -int -archive_entry_xattr_reset(struct archive_entry * entry) -{ - entry->xattr_p = entry->xattr_head; - - return archive_entry_xattr_count(entry); -} - -int -archive_entry_xattr_next(struct archive_entry * entry, - const char **name, const void **value, size_t *size) -{ - if (entry->xattr_p) { - *name = entry->xattr_p->name; - *value = entry->xattr_p->value; - *size = entry->xattr_p->size; - - entry->xattr_p = entry->xattr_p->next; - - return (ARCHIVE_OK); - } else { - *name = NULL; - *value = NULL; - *size = (size_t)0; - return (ARCHIVE_WARN); - } -} - -/* - * end of xattr handling - */ - -/* * Parse a string to a positive decimal integer. Returns true if * the string is non-empty and consists only of decimal digits, * false otherwise. @@ -1814,6 +1766,8 @@ ismode_w(const wchar_t *start, const wch { const wchar_t *p; + if (start >= end) + return (0); p = start; *permset = 0; while (p < end) { @@ -1988,6 +1942,18 @@ static struct flag { { "nouunlnk", L"nouunlnk", UF_NOUNLINK, 0 }, { "nouunlink", L"nouunlink", UF_NOUNLINK, 0 }, #endif +#ifdef EXT2_UNRM_FL + { "nouunlink", L"nouunlink", EXT2_UNRM_FL, 0}, +#endif + +#ifdef EXT2_BTREE_FL + { "nobtree", L"nobtree", EXT2_BTREE_FL, 0 }, +#endif + +#ifdef EXT2_ECOMPR_FL + { "nocomperr", L"nocomperr", EXT2_ECOMPR_FL, 0 }, +#endif + #ifdef EXT2_COMPR_FL /* 'c' */ { "nocompress", L"nocompress", EXT2_COMPR_FL, 0 }, #endif @@ -1995,6 +1961,46 @@ static struct flag { #ifdef EXT2_NOATIME_FL /* 'A' */ { "noatime", L"noatime", 0, EXT2_NOATIME_FL}, #endif + +#ifdef EXT2_DIRTY_FL + { "nocompdirty",L"nocompdirty", EXT2_DIRTY_FL, 0}, +#endif + +#ifdef EXT2_COMPRBLK_FL +#ifdef EXT2_NOCOMPR_FL + { "nocomprblk", L"nocomprblk", EXT2_COMPRBLK_FL, EXT2_NOCOMPR_FL}, +#else + { "nocomprblk", L"nocomprblk", EXT2_COMPRBLK_FL, 0}, +#endif +#endif +#ifdef EXT2_DIRSYNC_FL + { "nodirsync", L"nodirsync", EXT2_DIRSYNC_FL, 0}, +#endif +#ifdef EXT2_INDEX_FL + { "nohashidx", L"nohashidx", EXT2_INDEX_FL, 0}, +#endif +#ifdef EXT2_IMAGIC_FL + { "noimagic", L"noimagic", EXT2_IMAGIC_FL, 0}, +#endif +#ifdef EXT3_JOURNAL_DATA_FL + { "nojournal", L"nojournal", EXT3_JOURNAL_DATA_FL, 0}, +#endif +#ifdef EXT2_SECRM_FL + { "nosecuredeletion",L"nosecuredeletion",EXT2_SECRM_FL, 0}, +#endif +#ifdef EXT2_SYNC_FL + { "nosync", L"nosync", EXT2_SYNC_FL, 0}, +#endif +#ifdef EXT2_NOTAIL_FL + { "notail", L"notail", 0, EXT2_NOTAIL_FL}, +#endif +#ifdef EXT2_TOPDIR_FL + { "notopdir", L"notopdir", EXT2_TOPDIR_FL, 0}, +#endif +#ifdef EXT2_RESERVED_FL + { "noreserved", L"noreserved", EXT2_RESERVED_FL, 0}, +#endif + { NULL, NULL, 0, 0 } }; Modified: head/lib/libarchive/archive_entry.h ============================================================================== --- head/lib/libarchive/archive_entry.h Mon Dec 28 02:33:22 2009 (r201095) +++ head/lib/libarchive/archive_entry.h Mon Dec 28 02:41:27 2009 (r201096) @@ -40,14 +40,25 @@ #include /* for wchar_t */ #include +#if defined(_WIN32) && !defined(__CYGWIN__) +#include +#endif + /* Get appropriate definitions of standard POSIX-style types. */ /* These should match the types used in 'struct stat' */ #if defined(_WIN32) && !defined(__CYGWIN__) #define __LA_INT64_T __int64 -#define __LA_UID_T unsigned int -#define __LA_GID_T unsigned int -#define __LA_DEV_T unsigned int -#define __LA_MODE_T unsigned short +# if defined(__BORLANDC__) +# define __LA_UID_T uid_t +# define __LA_GID_T gid_t +# define __LA_DEV_T dev_t +# define __LA_MODE_T mode_t +# else +# define __LA_UID_T short +# define __LA_GID_T short +# define __LA_DEV_T unsigned int +# define __LA_MODE_T unsigned short +# endif #else #include #define __LA_INT64_T int64_t @@ -194,6 +205,7 @@ __LA_DECL const wchar_t *archive_entry_g __LA_DECL const char *archive_entry_hardlink(struct archive_entry *); __LA_DECL const wchar_t *archive_entry_hardlink_w(struct archive_entry *); __LA_DECL __LA_INO_T archive_entry_ino(struct archive_entry *); +__LA_DECL __LA_INT64_T archive_entry_ino64(struct archive_entry *); __LA_DECL __LA_MODE_T archive_entry_mode(struct archive_entry *); __LA_DECL time_t archive_entry_mtime(struct archive_entry *); __LA_DECL long archive_entry_mtime_nsec(struct archive_entry *); @@ -227,6 +239,10 @@ __LA_DECL const wchar_t *archive_entry_u __LA_DECL void archive_entry_set_atime(struct archive_entry *, time_t, long); __LA_DECL void archive_entry_unset_atime(struct archive_entry *); +#if defined(_WIN32) && !defined(__CYGWIN__) +__LA_DECL void archive_entry_copy_bhfi(struct archive_entry *, + BY_HANDLE_FILE_INFORMATION *); +#endif __LA_DECL void archive_entry_set_birthtime(struct archive_entry *, time_t, long); __LA_DECL void archive_entry_unset_birthtime(struct archive_entry *); __LA_DECL void archive_entry_set_ctime(struct archive_entry *, time_t, long); @@ -251,7 +267,14 @@ __LA_DECL int archive_entry_update_gname __LA_DECL void archive_entry_set_hardlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_hardlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *); +__LA_DECL int archive_entry_update_hardlink_utf8(struct archive_entry *, const char *); +#if ARCHIVE_VERSION_NUMBER >= 3000000 +/* Starting with libarchive 3.0, this will be synonym for ino64. */ +__LA_DECL void archive_entry_set_ino(struct archive_entry *, __LA_INT64_T); +#else __LA_DECL void archive_entry_set_ino(struct archive_entry *, unsigned long); +#endif +__LA_DECL void archive_entry_set_ino64(struct archive_entry *, __LA_INT64_T); __LA_DECL void archive_entry_set_link(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_link(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_link_w(struct archive_entry *, const wchar_t *); @@ -274,6 +297,7 @@ __LA_DECL void archive_entry_copy_source __LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); +__LA_DECL int archive_entry_update_symlink_utf8(struct archive_entry *, const char *); __LA_DECL void archive_entry_set_uid(struct archive_entry *, __LA_UID_T); __LA_DECL void archive_entry_set_uname(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_uname(struct archive_entry *, const char *); Modified: head/lib/libarchive/archive_entry_private.h ============================================================================== --- head/lib/libarchive/archive_entry_private.h Mon Dec 28 02:33:22 2009 (r201095) +++ head/lib/libarchive/archive_entry_private.h Mon Dec 28 02:41:27 2009 (r201096) @@ -25,6 +25,10 @@ * $FreeBSD$ */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + #ifndef ARCHIVE_ENTRY_PRIVATE_H_INCLUDED #define ARCHIVE_ENTRY_PRIVATE_H_INCLUDED @@ -115,7 +119,7 @@ struct archive_entry { int64_t aest_birthtime; uint32_t aest_birthtime_nsec; gid_t aest_gid; - ino_t aest_ino; + int64_t aest_ino; mode_t aest_mode; uint32_t aest_nlink; uint64_t aest_size; Added: head/lib/libarchive/archive_entry_xattr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/archive_entry_xattr.c Mon Dec 28 02:41:27 2009 (r201096) @@ -0,0 +1,158 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * 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(S) ``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(S) 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 "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_LIMITS_H +#include +#endif +#ifdef HAVE_LINUX_FS_H +#include /* for Linux file flags */ +#endif +/* + * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h. + * As the include guards don't agree, the order of include is important. + */ +#ifdef HAVE_LINUX_EXT2_FS_H +#include /* for Linux file flags */ +#endif +#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__) +#include /* for Linux file flags */ +#endif +#include +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_WCHAR_H +#include +#endif + +#include "archive.h" +#include "archive_entry.h" +#include "archive_private.h" +#include "archive_entry_private.h" + +/* + * extended attribute handling + */ + +void +archive_entry_xattr_clear(struct archive_entry *entry) +{ + struct ae_xattr *xp; + + while (entry->xattr_head != NULL) { + xp = entry->xattr_head->next; + free(entry->xattr_head->name); + free(entry->xattr_head->value); + free(entry->xattr_head); + entry->xattr_head = xp; + } + + entry->xattr_head = NULL; +} + +void +archive_entry_xattr_add_entry(struct archive_entry *entry, + const char *name, const void *value, size_t size) +{ + struct ae_xattr *xp; + + for (xp = entry->xattr_head; xp != NULL; xp = xp->next) + ; + + if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL) + /* XXX Error XXX */ + return; + + xp->name = strdup(name); + if ((xp->value = malloc(size)) != NULL) { + memcpy(xp->value, value, size); + xp->size = size; + } else + xp->size = 0; + + xp->next = entry->xattr_head; + entry->xattr_head = xp; +} + + +/* + * returns number of the extended attribute entries + */ +int +archive_entry_xattr_count(struct archive_entry *entry) +{ + struct ae_xattr *xp; + int count = 0; + + for (xp = entry->xattr_head; xp != NULL; xp = xp->next) + count++; + + return count; +} + +int +archive_entry_xattr_reset(struct archive_entry * entry) +{ + entry->xattr_p = entry->xattr_head; + + return archive_entry_xattr_count(entry); +} + +int +archive_entry_xattr_next(struct archive_entry * entry, + const char **name, const void **value, size_t *size) +{ + if (entry->xattr_p) { + *name = entry->xattr_p->name; + *value = entry->xattr_p->value; + *size = entry->xattr_p->size; + + entry->xattr_p = entry->xattr_p->next; + + return (ARCHIVE_OK); + } else { + *name = NULL; + *value = NULL; + *size = (size_t)0; + return (ARCHIVE_WARN); + } +} + +/* + * end of xattr handling + */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:45:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 123C61065672; Mon, 28 Dec 2009 02:45:57 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01E878FC14; Mon, 28 Dec 2009 02:45:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2juo0076475; Mon, 28 Dec 2009 02:45:56 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2juhD076473; Mon, 28 Dec 2009 02:45:56 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280245.nBS2juhD076473@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201097 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:45:57 -0000 Author: kientzle Date: Mon Dec 28 02:45:56 2009 New Revision: 201097 URL: http://svn.freebsd.org/changeset/base/201097 Log: Portability fixes. Modified: head/lib/libarchive/archive.h Modified: head/lib/libarchive/archive.h ============================================================================== --- head/lib/libarchive/archive.h Mon Dec 28 02:41:27 2009 (r201096) +++ head/lib/libarchive/archive.h Mon Dec 28 02:45:56 2009 (r201097) @@ -35,12 +35,16 @@ * this header! If you must conditionalize, use predefined compiler and/or * platform macros. */ +#if defined(__BORLANDC__) && __BORLANDC__ >= 0x560 +# define __LA_STDINT_H +#elif !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX) && !defined(__BORLANDC__) +# define __LA_STDINT_H +#endif #include #include /* Linux requires this for off_t */ -#if !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX) -/* Header unavailable on Watcom C or MS Visual C++ or SFU. */ -#include /* int64_t, etc. */ +#ifdef __LA_STDINT_H +# include __LA_STDINT_H /* int64_t, etc. */ #endif #include /* For FILE * */ @@ -53,8 +57,13 @@ # else # define __LA_SSIZE_T long # endif -#define __LA_UID_T unsigned int -#define __LA_GID_T unsigned int +# if defined(__BORLANDC__) +# define __LA_UID_T uid_t +# define __LA_GID_T gid_t +# else +# define __LA_UID_T short +# define __LA_GID_T short +# endif #else #include /* ssize_t, uid_t, and gid_t */ #define __LA_INT64_T int64_t From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:58:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C47181065679; Mon, 28 Dec 2009 02:58:14 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B36B48FC16; Mon, 28 Dec 2009 02:58:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS2wEVm076750; Mon, 28 Dec 2009 02:58:14 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS2wEDw076742; Mon, 28 Dec 2009 02:58:14 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280258.nBS2wEDw076742@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201098 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 02:58:14 -0000 Author: kientzle Date: Mon Dec 28 02:58:14 2009 New Revision: 201098 URL: http://svn.freebsd.org/changeset/base/201098 Log: New archive_file_count() utility. Modified: head/lib/libarchive/Makefile head/lib/libarchive/archive.h head/lib/libarchive/archive_private.h head/lib/libarchive/archive_read.c head/lib/libarchive/archive_util.3 head/lib/libarchive/archive_util.c head/lib/libarchive/archive_virtual.c Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Mon Dec 28 02:45:56 2009 (r201097) +++ head/lib/libarchive/Makefile Mon Dec 28 02:58:14 2009 (r201098) @@ -224,6 +224,7 @@ MLINKS+= archive_util.3 archive_compress MLINKS+= archive_util.3 archive_compression_name.3 MLINKS+= archive_util.3 archive_errno.3 MLINKS+= archive_util.3 archive_error_string.3 +MLINKS+= archive_util.3 archive_file_count.3 MLINKS+= archive_util.3 archive_format.3 MLINKS+= archive_util.3 archive_format_name.3 MLINKS+= archive_util.3 archive_set_error.3 Modified: head/lib/libarchive/archive.h ============================================================================== --- head/lib/libarchive/archive.h Mon Dec 28 02:45:56 2009 (r201097) +++ head/lib/libarchive/archive.h Mon Dec 28 02:58:14 2009 (r201098) @@ -713,6 +713,7 @@ __LA_DECL void archive_set_error(struc const char *fmt, ...); __LA_DECL void archive_copy_error(struct archive *dest, struct archive *src); +__LA_DECL int archive_file_count(struct archive *); #ifdef __cplusplus } Modified: head/lib/libarchive/archive_private.h ============================================================================== --- head/lib/libarchive/archive_private.h Mon Dec 28 02:45:56 2009 (r201097) +++ head/lib/libarchive/archive_private.h Mon Dec 28 02:58:14 2009 (r201098) @@ -25,6 +25,10 @@ * $FreeBSD$ */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + #ifndef ARCHIVE_PRIVATE_H_INCLUDED #define ARCHIVE_PRIVATE_H_INCLUDED @@ -87,9 +91,11 @@ struct archive { const char *compression_name; /* Position in UNCOMPRESSED data stream. */ - off_t file_position; + int64_t file_position; /* Position in COMPRESSED data stream. */ - off_t raw_position; + int64_t raw_position; + /* Number of file entries processed. */ + int file_count; int archive_error_number; const char *error; @@ -107,4 +113,12 @@ int __archive_parse_options(const char * #define err_combine(a,b) ((a) < (b) ? (a) : (b)) +#if defined(__BORLANDC__) || (defined(_MSC_VER) && _MSC_VER <= 1300) +# define ARCHIVE_LITERAL_LL(x) x##i64 +# define ARCHIVE_LITERAL_ULL(x) x##ui64 +#else +# define ARCHIVE_LITERAL_LL(x) x##ll +# define ARCHIVE_LITERAL_ULL(x) x##ull +#endif + #endif Modified: head/lib/libarchive/archive_read.c ============================================================================== --- head/lib/libarchive/archive_read.c Mon Dec 28 02:45:56 2009 (r201097) +++ head/lib/libarchive/archive_read.c Mon Dec 28 02:58:14 2009 (r201098) @@ -386,6 +386,7 @@ archive_read_next_header2(struct archive ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, "archive_read_next_header"); + ++_a->file_count; archive_entry_clear(entry); archive_clear_error(&a->archive); Modified: head/lib/libarchive/archive_util.3 ============================================================================== --- head/lib/libarchive/archive_util.3 Mon Dec 28 02:45:56 2009 (r201097) +++ head/lib/libarchive/archive_util.3 Mon Dec 28 02:58:14 2009 (r201098) @@ -34,6 +34,7 @@ .Nm archive_copy_error , .Nm archive_errno , .Nm archive_error_string , +.Nm archive_file_count , .Nm archive_format , .Nm archive_format_name , .Nm archive_set_error @@ -53,6 +54,8 @@ .Ft const char * .Fn archive_error_string "struct archive *" .Ft int +.Fn archive_file_count "struct archive *" +.Ft int .Fn archive_format "struct archive *" .Ft const char * .Fn archive_format_name "struct archive *" @@ -92,6 +95,12 @@ obtained from passing the result of .Fn archive_errno to .Xr strerror 3 . +.It Fn archive_file_count +Returns a count of the number of files processed by this archive object. +The count is incremented by calls to +.Xr archive_write_header +or +.Xr archive_read_next_header . .It Fn archive_format Returns a numeric code indicating the format of the current archive entry. Modified: head/lib/libarchive/archive_util.c ============================================================================== --- head/lib/libarchive/archive_util.c Mon Dec 28 02:45:56 2009 (r201097) +++ head/lib/libarchive/archive_util.c Mon Dec 28 02:58:14 2009 (r201098) @@ -100,6 +100,11 @@ archive_error_string(struct archive *a) return ("(Empty error message)"); } +int +archive_file_count(struct archive *a) +{ + return (a->file_count); +} int archive_format(struct archive *a) @@ -182,9 +187,14 @@ void __archive_errx(int retvalue, const char *msg) { static const char *msg1 = "Fatal Internal Error in libarchive: "; - write(2, msg1, strlen(msg1)); - write(2, msg, strlen(msg)); - write(2, "\n", 1); + size_t s; + + s = write(2, msg1, strlen(msg1)); + (void)s; /* UNUSED */ + s = write(2, msg, strlen(msg)); + (void)s; /* UNUSED */ + s = write(2, "\n", 1); + (void)s; /* UNUSED */ exit(retvalue); } Modified: head/lib/libarchive/archive_virtual.c ============================================================================== --- head/lib/libarchive/archive_virtual.c Mon Dec 28 02:45:56 2009 (r201097) +++ head/lib/libarchive/archive_virtual.c Mon Dec 28 02:58:14 2009 (r201098) @@ -66,6 +66,7 @@ archive_read_finish(struct archive *a) int archive_write_header(struct archive *a, struct archive_entry *entry) { + ++a->file_count; return ((a->vtable->archive_write_header)(a, entry)); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:03:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AE7C1065679; Mon, 28 Dec 2009 03:03:01 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A93D8FC23; Mon, 28 Dec 2009 03:03:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS331ZX077004; Mon, 28 Dec 2009 03:03:01 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS3319p077002; Mon, 28 Dec 2009 03:03:01 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280303.nBS3319p077002@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201099 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:03:01 -0000 Author: kientzle Date: Mon Dec 28 03:03:00 2009 New Revision: 201099 URL: http://svn.freebsd.org/changeset/base/201099 Log: Use new ino64 interface. Modified: head/lib/libarchive/archive_write.c Modified: head/lib/libarchive/archive_write.c ============================================================================== --- head/lib/libarchive/archive_write.c Mon Dec 28 02:58:14 2009 (r201098) +++ head/lib/libarchive/archive_write.c Mon Dec 28 03:03:00 2009 (r201099) @@ -312,7 +312,6 @@ archive_write_open(struct archive *_a, v struct archive_write *a = (struct archive_write *)_a; int ret; - ret = ARCHIVE_OK; __archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_NEW, "archive_write_open"); archive_clear_error(&a->archive); @@ -423,7 +422,7 @@ _archive_write_header(struct archive *_a if (a->skip_file_dev != 0 && archive_entry_dev(entry) == a->skip_file_dev && a->skip_file_ino != 0 && - archive_entry_ino(entry) == a->skip_file_ino) { + archive_entry_ino64(entry) == a->skip_file_ino) { archive_set_error(&a->archive, 0, "Can't add archive to itself"); return (ARCHIVE_FAILED); From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:05:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62193106568B; Mon, 28 Dec 2009 03:05:32 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37D3C8FC14; Mon, 28 Dec 2009 03:05:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS35WAB077084; Mon, 28 Dec 2009 03:05:32 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS35WiU077081; Mon, 28 Dec 2009 03:05:32 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280305.nBS35WiU077081@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201100 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:05:32 -0000 Author: kientzle Date: Mon Dec 28 03:05:31 2009 New Revision: 201100 URL: http://svn.freebsd.org/changeset/base/201100 Log: Use ino64 interface. Modified: head/lib/libarchive/archive_entry_link_resolver.c head/lib/libarchive/archive_entry_stat.c Modified: head/lib/libarchive/archive_entry_link_resolver.c ============================================================================== --- head/lib/libarchive/archive_entry_link_resolver.c Mon Dec 28 03:03:00 2009 (r201099) +++ head/lib/libarchive/archive_entry_link_resolver.c Mon Dec 28 03:05:31 2009 (r201100) @@ -249,7 +249,7 @@ find_entry(struct archive_entry_linkreso struct links_entry *le; int hash, bucket; dev_t dev; - ino_t ino; + int64_t ino; /* Free a held entry. */ if (res->spare != NULL) { @@ -264,15 +264,15 @@ find_entry(struct archive_entry_linkreso return (NULL); dev = archive_entry_dev(entry); - ino = archive_entry_ino(entry); - hash = dev ^ ino; + ino = archive_entry_ino64(entry); + hash = (int)(dev ^ ino); /* Try to locate this entry in the links cache. */ bucket = hash % res->number_buckets; for (le = res->buckets[bucket]; le != NULL; le = le->next) { if (le->hash == hash && dev == archive_entry_dev(le->canonical) - && ino == archive_entry_ino(le->canonical)) { + && ino == archive_entry_ino64(le->canonical)) { /* * Decrement link count each time and release * the entry if it hits zero. This saves @@ -350,7 +350,7 @@ insert_entry(struct archive_entry_linkre if (res->number_entries > res->number_buckets * 2) grow_hash(res); - hash = archive_entry_dev(entry) ^ archive_entry_ino(entry); + hash = archive_entry_dev(entry) ^ archive_entry_ino64(entry); bucket = hash % res->number_buckets; /* If we could allocate the entry, record it. */ Modified: head/lib/libarchive/archive_entry_stat.c ============================================================================== --- head/lib/libarchive/archive_entry_stat.c Mon Dec 28 03:03:00 2009 (r201099) +++ head/lib/libarchive/archive_entry_stat.c Mon Dec 28 03:05:31 2009 (r201100) @@ -72,7 +72,7 @@ archive_entry_stat(struct archive_entry st->st_dev = archive_entry_dev(entry); st->st_gid = archive_entry_gid(entry); st->st_uid = archive_entry_uid(entry); - st->st_ino = archive_entry_ino(entry); + st->st_ino = archive_entry_ino64(entry); st->st_nlink = archive_entry_nlink(entry); st->st_rdev = archive_entry_rdev(entry); st->st_size = archive_entry_size(entry); From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:06:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A519106568B; Mon, 28 Dec 2009 03:06:27 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79EE28FC0A; Mon, 28 Dec 2009 03:06:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS36RkO077136; Mon, 28 Dec 2009 03:06:27 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS36RfV077134; Mon, 28 Dec 2009 03:06:27 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280306.nBS36RfV077134@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201101 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:06:27 -0000 Author: kientzle Date: Mon Dec 28 03:06:27 2009 New Revision: 201101 URL: http://svn.freebsd.org/changeset/base/201101 Log: Include limits.h; remove unused variable. Modified: head/lib/libarchive/archive_read_support_format_ar.c Modified: head/lib/libarchive/archive_read_support_format_ar.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_ar.c Mon Dec 28 03:05:31 2009 (r201100) +++ head/lib/libarchive/archive_read_support_format_ar.c Mon Dec 28 03:06:27 2009 (r201101) @@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_LIMITS_H +#include +#endif #include "archive.h" #include "archive_entry.h" @@ -134,7 +137,6 @@ archive_read_format_ar_cleanup(struct ar static int archive_read_format_ar_bid(struct archive_read *a) { - struct ar *ar; const void *h; if (a->archive.archive_format != 0 && @@ -142,8 +144,6 @@ archive_read_format_ar_bid(struct archiv ARCHIVE_FORMAT_AR) return(0); - ar = (struct ar *)(a->format->data); - /* * Verify the 8-byte file signature. * TODO: Do we need to check more than this? From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:11:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ED61106566B; Mon, 28 Dec 2009 03:11:36 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DBF48FC18; Mon, 28 Dec 2009 03:11:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS3BaDU077457; Mon, 28 Dec 2009 03:11:36 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS3BaPU077454; Mon, 28 Dec 2009 03:11:36 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280311.nBS3BaPU077454@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201102 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:11:36 -0000 Author: kientzle Date: Mon Dec 28 03:11:36 2009 New Revision: 201102 URL: http://svn.freebsd.org/changeset/base/201102 Log: Handle Zip CRC validation for uncompressed Zip archives even on platforms that lack zlib. Added: head/lib/libarchive/archive_crc32.h (contents, props changed) Modified: head/lib/libarchive/archive_read_support_format_zip.c Added: head/lib/libarchive/archive_crc32.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/archive_crc32.h Mon Dec 28 03:11:36 2009 (r201102) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2009 Joerg Sonnenberger + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + +/* + * When zlib is unavailable, we should still be able to validate + * uncompressed zip archives. That requires us to be able to compute + * the CRC32 check value. This is a drop-in compatible replacement + * for crc32() from zlib. It's slower than the zlib implementation, + * but still pretty fast: This runs about 300MB/s on my 3GHz P4 + * compared to about 800MB/s for the zlib implementation. + */ +static unsigned long +crc32(unsigned long crc, const void *_p, size_t len) +{ + unsigned long crc2, b, i; + const unsigned char *p = _p; + static volatile int crc_tbl_inited = 0; + static unsigned long crc_tbl[256]; + + if (!crc_tbl_inited) { + for (b = 0; b < 256; ++b) { + crc2 = b; + for (i = 8; i > 0; --i) { + if (crc2 & 1) + crc2 = (crc2 >> 1) ^ 0xedb88320UL; + else + crc2 = (crc2 >> 1); + } + crc_tbl[b] = crc2; + } + crc_tbl_inited = 1; + } + + crc = crc ^ 0xffffffffUL; + while (len--) + crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8); + return (crc ^ 0xffffffffUL); +} Modified: head/lib/libarchive/archive_read_support_format_zip.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_zip.c Mon Dec 28 03:06:27 2009 (r201101) +++ head/lib/libarchive/archive_read_support_format_zip.c Mon Dec 28 03:11:36 2009 (r201102) @@ -36,10 +36,6 @@ __FBSDID("$FreeBSD$"); #include #ifdef HAVE_ZLIB_H #include -#else -/* Hmmm... This is necessary, but means that we can't correctly extract - * even uncompressed entries on platforms that lack zlib. */ -#define crc32(crc, buf, len) (unsigned long)0 #endif #include "archive.h" @@ -48,6 +44,10 @@ __FBSDID("$FreeBSD$"); #include "archive_read_private.h" #include "archive_endian.h" +#ifndef HAVE_ZLIB_H +#include "archive_crc32.h" +#endif + struct zip { /* entry_bytes_remaining is the number of bytes we expect. */ int64_t entry_bytes_remaining; @@ -540,8 +540,7 @@ archive_read_format_zip_read_data(struct return (r); /* Update checksum */ if (*size) - zip->entry_crc32 = - crc32(zip->entry_crc32, *buff, *size); + zip->entry_crc32 = crc32(zip->entry_crc32, *buff, *size); /* If we hit the end, swallow any end-of-data marker. */ if (zip->end_of_entry) { if (zip->flags & ZIP_LENGTH_AT_END) { From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:13:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EED721065670; Mon, 28 Dec 2009 03:13:51 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE8DD8FC13; Mon, 28 Dec 2009 03:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS3DpZW077529; Mon, 28 Dec 2009 03:13:51 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS3Dpe6077527; Mon, 28 Dec 2009 03:13:51 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280313.nBS3Dpe6077527@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201103 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:13:52 -0000 Author: kientzle Date: Mon Dec 28 03:13:49 2009 New Revision: 201103 URL: http://svn.freebsd.org/changeset/base/201103 Log: O_BINARY for Windows. Modified: head/lib/libarchive/archive_read_open_fd.c Modified: head/lib/libarchive/archive_read_open_fd.c ============================================================================== --- head/lib/libarchive/archive_read_open_fd.c Mon Dec 28 03:11:36 2009 (r201102) +++ head/lib/libarchive/archive_read_open_fd.c Mon Dec 28 03:13:49 2009 (r201103) @@ -32,6 +32,12 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_ERRNO_H #include #endif +#ifdef HAVE_FCNTL_H +#include +#endif +#ifdef HAVE_IO_H +#include +#endif #ifdef HAVE_STDLIB_H #include #endif @@ -95,6 +101,9 @@ archive_read_open_fd(struct archive *a, mine->can_skip = 1; } else mine->can_skip = 0; +#if defined(__CYGWIN__) || defined(_WIN32) + setmode(mine->fd, O_BINARY); +#endif return (archive_read_open2(a, mine, NULL, file_read, file_skip, file_close)); From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:14:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B8FA106568B; Mon, 28 Dec 2009 03:14:30 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B3678FC13; Mon, 28 Dec 2009 03:14:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS3EU9A077577; Mon, 28 Dec 2009 03:14:30 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS3EUKC077575; Mon, 28 Dec 2009 03:14:30 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280314.nBS3EUKC077575@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201104 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:14:30 -0000 Author: kientzle Date: Mon Dec 28 03:14:30 2009 New Revision: 201104 URL: http://svn.freebsd.org/changeset/base/201104 Log: Remove unused variable. Modified: head/lib/libarchive/archive_write_set_compression_program.c Modified: head/lib/libarchive/archive_write_set_compression_program.c ============================================================================== --- head/lib/libarchive/archive_write_set_compression_program.c Mon Dec 28 03:13:49 2009 (r201103) +++ head/lib/libarchive/archive_write_set_compression_program.c Mon Dec 28 03:14:30 2009 (r201104) @@ -230,11 +230,9 @@ static int archive_compressor_program_write(struct archive_write *a, const void *buff, size_t length) { - struct private_data *state; ssize_t ret; const char *buf; - state = (struct private_data *)a->compressor.data; if (a->client_writer == NULL) { archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, "No write callback is registered? " From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:20:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09D8F106568B; Mon, 28 Dec 2009 03:20:55 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBF1E8FC08; Mon, 28 Dec 2009 03:20:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS3Ks73077739; Mon, 28 Dec 2009 03:20:54 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS3Ksv3077737; Mon, 28 Dec 2009 03:20:54 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280320.nBS3Ksv3077737@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201105 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:20:55 -0000 Author: kientzle Date: Mon Dec 28 03:20:54 2009 New Revision: 201105 URL: http://svn.freebsd.org/changeset/base/201105 Log: Discourage external use of this header. Modified: head/lib/libarchive/archive_read_disk_private.h Modified: head/lib/libarchive/archive_read_disk_private.h ============================================================================== --- head/lib/libarchive/archive_read_disk_private.h Mon Dec 28 03:14:30 2009 (r201104) +++ head/lib/libarchive/archive_read_disk_private.h Mon Dec 28 03:20:54 2009 (r201105) @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + #ifndef ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED #define ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:24:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 840C9106566C; Mon, 28 Dec 2009 03:24:56 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7234E8FC16; Mon, 28 Dec 2009 03:24:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS3Oux9077851; Mon, 28 Dec 2009 03:24:56 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS3OuhO077849; Mon, 28 Dec 2009 03:24:56 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280324.nBS3OuhO077849@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201106 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:24:56 -0000 Author: kientzle Date: Mon Dec 28 03:24:56 2009 New Revision: 201106 URL: http://svn.freebsd.org/changeset/base/201106 Log: Fix line endings. Modified: head/lib/libarchive/archive_read_support_format_raw.c Modified: head/lib/libarchive/archive_read_support_format_raw.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_raw.c Mon Dec 28 03:20:54 2009 (r201105) +++ head/lib/libarchive/archive_read_support_format_raw.c Mon Dec 28 03:24:56 2009 (r201106) @@ -1,187 +1,187 @@ -/*- - * Copyright (c) 2003-2009 Tim Kientzle - * 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(S) ``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(S) 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 "archive_platform.h" -__FBSDID("$FreeBSD$"); - -#ifdef HAVE_ERRNO_H -#include -#endif -#include -#ifdef HAVE_STDLIB_H -#include -#endif - -#include "archive.h" -#include "archive_entry.h" -#include "archive_private.h" -#include "archive_read_private.h" - -struct raw_info { - int64_t offset; /* Current position in the file. */ - int end_of_file; -}; - -static int archive_read_format_raw_bid(struct archive_read *); -static int archive_read_format_raw_cleanup(struct archive_read *); -static int archive_read_format_raw_read_data(struct archive_read *, - const void **, size_t *, off_t *); -static int archive_read_format_raw_read_data_skip(struct archive_read *); -static int archive_read_format_raw_read_header(struct archive_read *, - struct archive_entry *); - -int -archive_read_support_format_raw(struct archive *_a) -{ - struct raw_info *info; - struct archive_read *a = (struct archive_read *)_a; - int r; - - info = (struct raw_info *)calloc(1, sizeof(*info)); - if (info == NULL) { - archive_set_error(&a->archive, ENOMEM, - "Can't allocate raw_info data"); - return (ARCHIVE_FATAL); - } - - r = __archive_read_register_format(a, - info, - "raw", - archive_read_format_raw_bid, - NULL, - archive_read_format_raw_read_header, - archive_read_format_raw_read_data, - archive_read_format_raw_read_data_skip, - archive_read_format_raw_cleanup); - if (r != ARCHIVE_OK) - free(info); - return (r); -} - -/* - * Bid 1 if this is a non-empty file. Anyone who can really support - * this should outbid us, so it should generally be safe to use "raw" - * in conjunction with other formats. But, this could really confuse - * folks if there are bid errors or minor file damage, so we don't - * include "raw" as part of support_format_all(). - */ -static int -archive_read_format_raw_bid(struct archive_read *a) -{ - const char *p; - - if ((p = __archive_read_ahead(a, 1, NULL)) == NULL) - return (-1); - return (1); -} - -/* - * Mock up a fake header. - */ -static int -archive_read_format_raw_read_header(struct archive_read *a, - struct archive_entry *entry) -{ - struct raw_info *info; - - info = (struct raw_info *)(a->format->data); - if (info->end_of_file) - return (ARCHIVE_EOF); - - a->archive.archive_format = ARCHIVE_FORMAT_RAW; - a->archive.archive_format_name = "Raw data"; - archive_entry_set_pathname(entry, "data"); - /* XXX should we set mode to mimic a regular file? XXX */ - /* I'm deliberately leaving most fields unset here. */ - return (ARCHIVE_OK); -} - -static int -archive_read_format_raw_read_data(struct archive_read *a, - const void **buff, size_t *size, off_t *offset) -{ - struct raw_info *info; - ssize_t avail; - - info = (struct raw_info *)(a->format->data); - if (info->end_of_file) - return (ARCHIVE_EOF); - - /* Get whatever bytes are immediately available. */ - *buff = __archive_read_ahead(a, 1, &avail); - if (avail > 0) { - /* Consume and return the bytes we just read */ - __archive_read_consume(a, avail); - *size = avail; - *offset = info->offset; - info->offset += *size; - return (ARCHIVE_OK); - } else if (0 == avail) { - /* Record and return end-of-file. */ - info->end_of_file = 1; - *size = 0; - *offset = info->offset; - return (ARCHIVE_EOF); - } else { - /* Record and return an error. */ - *size = 0; - *offset = info->offset; - return (avail); - } - return (ARCHIVE_OK); -} - -static int -archive_read_format_raw_read_data_skip(struct archive_read *a) -{ - struct raw_info *info; - off_t bytes_skipped; - int64_t request = 1024 * 1024 * 1024UL; /* Skip 1 GB at a time. */ - - info = (struct raw_info *)(a->format->data); - if (info->end_of_file) - return (ARCHIVE_EOF); - info->end_of_file = 1; - - for (;;) { - bytes_skipped = __archive_read_skip_lenient(a, request); - if (bytes_skipped < 0) - return (ARCHIVE_FATAL); - if (bytes_skipped < request) - return (ARCHIVE_OK); - /* We skipped all the bytes we asked for. There might - * be more, so try again. */ - } -} - -static int -archive_read_format_raw_cleanup(struct archive_read *a) -{ - struct raw_info *info; - - info = (struct raw_info *)(a->format->data); - free(info); - a->format->data = NULL; - return (ARCHIVE_OK); -} +/*- + * Copyright (c) 2003-2009 Tim Kientzle + * 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(S) ``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(S) 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 "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#include +#ifdef HAVE_STDLIB_H +#include +#endif + +#include "archive.h" +#include "archive_entry.h" +#include "archive_private.h" +#include "archive_read_private.h" + +struct raw_info { + int64_t offset; /* Current position in the file. */ + int end_of_file; +}; + +static int archive_read_format_raw_bid(struct archive_read *); +static int archive_read_format_raw_cleanup(struct archive_read *); +static int archive_read_format_raw_read_data(struct archive_read *, + const void **, size_t *, off_t *); +static int archive_read_format_raw_read_data_skip(struct archive_read *); +static int archive_read_format_raw_read_header(struct archive_read *, + struct archive_entry *); + +int +archive_read_support_format_raw(struct archive *_a) +{ + struct raw_info *info; + struct archive_read *a = (struct archive_read *)_a; + int r; + + info = (struct raw_info *)calloc(1, sizeof(*info)); + if (info == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate raw_info data"); + return (ARCHIVE_FATAL); + } + + r = __archive_read_register_format(a, + info, + "raw", + archive_read_format_raw_bid, + NULL, + archive_read_format_raw_read_header, + archive_read_format_raw_read_data, + archive_read_format_raw_read_data_skip, + archive_read_format_raw_cleanup); + if (r != ARCHIVE_OK) + free(info); + return (r); +} + +/* + * Bid 1 if this is a non-empty file. Anyone who can really support + * this should outbid us, so it should generally be safe to use "raw" + * in conjunction with other formats. But, this could really confuse + * folks if there are bid errors or minor file damage, so we don't + * include "raw" as part of support_format_all(). + */ +static int +archive_read_format_raw_bid(struct archive_read *a) +{ + const char *p; + + if ((p = __archive_read_ahead(a, 1, NULL)) == NULL) + return (-1); + return (1); +} + +/* + * Mock up a fake header. + */ +static int +archive_read_format_raw_read_header(struct archive_read *a, + struct archive_entry *entry) +{ + struct raw_info *info; + + info = (struct raw_info *)(a->format->data); + if (info->end_of_file) + return (ARCHIVE_EOF); + + a->archive.archive_format = ARCHIVE_FORMAT_RAW; + a->archive.archive_format_name = "Raw data"; + archive_entry_set_pathname(entry, "data"); + /* XXX should we set mode to mimic a regular file? XXX */ + /* I'm deliberately leaving most fields unset here. */ + return (ARCHIVE_OK); +} + +static int +archive_read_format_raw_read_data(struct archive_read *a, + const void **buff, size_t *size, off_t *offset) +{ + struct raw_info *info; + ssize_t avail; + + info = (struct raw_info *)(a->format->data); + if (info->end_of_file) + return (ARCHIVE_EOF); + + /* Get whatever bytes are immediately available. */ + *buff = __archive_read_ahead(a, 1, &avail); + if (avail > 0) { + /* Consume and return the bytes we just read */ + __archive_read_consume(a, avail); + *size = avail; + *offset = info->offset; + info->offset += *size; + return (ARCHIVE_OK); + } else if (0 == avail) { + /* Record and return end-of-file. */ + info->end_of_file = 1; + *size = 0; + *offset = info->offset; + return (ARCHIVE_EOF); + } else { + /* Record and return an error. */ + *size = 0; + *offset = info->offset; + return (avail); + } + return (ARCHIVE_OK); +} + +static int +archive_read_format_raw_read_data_skip(struct archive_read *a) +{ + struct raw_info *info; + off_t bytes_skipped; + int64_t request = 1024 * 1024 * 1024UL; /* Skip 1 GB at a time. */ + + info = (struct raw_info *)(a->format->data); + if (info->end_of_file) + return (ARCHIVE_EOF); + info->end_of_file = 1; + + for (;;) { + bytes_skipped = __archive_read_skip_lenient(a, request); + if (bytes_skipped < 0) + return (ARCHIVE_FATAL); + if (bytes_skipped < request) + return (ARCHIVE_OK); + /* We skipped all the bytes we asked for. There might + * be more, so try again. */ + } +} + +static int +archive_read_format_raw_cleanup(struct archive_read *a) +{ + struct raw_info *info; + + info = (struct raw_info *)(a->format->data); + free(info); + a->format->data = NULL; + return (ARCHIVE_OK); +} From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:25:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 835BE1065672; Mon, 28 Dec 2009 03:25:33 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72F228FC19; Mon, 28 Dec 2009 03:25:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS3PXnN077906; Mon, 28 Dec 2009 03:25:33 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS3PX13077904; Mon, 28 Dec 2009 03:25:33 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280325.nBS3PX13077904@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201107 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:25:33 -0000 Author: kientzle Date: Mon Dec 28 03:25:33 2009 New Revision: 201107 URL: http://svn.freebsd.org/changeset/base/201107 Log: Remove an unused variable and an unreachable statement. Modified: head/lib/libarchive/archive_read_support_format_raw.c Modified: head/lib/libarchive/archive_read_support_format_raw.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_raw.c Mon Dec 28 03:24:56 2009 (r201106) +++ head/lib/libarchive/archive_read_support_format_raw.c Mon Dec 28 03:25:33 2009 (r201107) @@ -89,9 +89,8 @@ archive_read_support_format_raw(struct a static int archive_read_format_raw_bid(struct archive_read *a) { - const char *p; - if ((p = __archive_read_ahead(a, 1, NULL)) == NULL) + if (__archive_read_ahead(a, 1, NULL) == NULL) return (-1); return (1); } @@ -149,7 +148,6 @@ archive_read_format_raw_read_data(struct *offset = info->offset; return (avail); } - return (ARCHIVE_OK); } static int From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:28:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A72561065672; Mon, 28 Dec 2009 03:28:21 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D36F8FC1B; Mon, 28 Dec 2009 03:28:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS3SLGU077986; Mon, 28 Dec 2009 03:28:21 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS3SLND077982; Mon, 28 Dec 2009 03:28:21 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280328.nBS3SLND077982@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201108 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:28:21 -0000 Author: kientzle Date: Mon Dec 28 03:28:21 2009 New Revision: 201108 URL: http://svn.freebsd.org/changeset/base/201108 Log: Fix some unused variables and dead assignments. Modified: head/lib/libarchive/archive_read_support_compression_bzip2.c head/lib/libarchive/archive_write_set_compression_xz.c head/lib/libarchive/archive_write_set_format_ar.c Modified: head/lib/libarchive/archive_read_support_compression_bzip2.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_bzip2.c Mon Dec 28 03:25:33 2009 (r201107) +++ head/lib/libarchive/archive_read_support_compression_bzip2.c Mon Dec 28 03:28:21 2009 (r201108) @@ -210,12 +210,11 @@ static ssize_t bzip2_filter_read(struct archive_read_filter *self, const void **p) { struct private_data *state; - size_t read_avail, decompressed; + size_t decompressed; const char *read_buf; ssize_t ret; state = (struct private_data *)self->data; - read_avail = 0; if (state->eof) { *p = NULL; @@ -348,7 +347,7 @@ bzip2_filter_close(struct archive_read_f free(state->out_block); free(state); - return (ARCHIVE_OK); + return (ret); } #endif /* HAVE_BZLIB_H */ Modified: head/lib/libarchive/archive_write_set_compression_xz.c ============================================================================== --- head/lib/libarchive/archive_write_set_compression_xz.c Mon Dec 28 03:25:33 2009 (r201107) +++ head/lib/libarchive/archive_write_set_compression_xz.c Mon Dec 28 03:28:21 2009 (r201108) @@ -323,7 +323,6 @@ archive_compressor_xz_finish(struct arch block_length = state->stream.next_out - state->compressed; /* Tricky calculation to determine size of last block. */ - target_block_length = block_length; if (a->bytes_in_last_block <= 0) /* Default or Zero: pad to full block */ target_block_length = a->bytes_per_block; Modified: head/lib/libarchive/archive_write_set_format_ar.c ============================================================================== --- head/lib/libarchive/archive_write_set_format_ar.c Mon Dec 28 03:25:33 2009 (r201107) +++ head/lib/libarchive/archive_write_set_format_ar.c Mon Dec 28 03:28:21 2009 (r201108) @@ -145,7 +145,6 @@ archive_write_ar_header(struct archive_w const char *filename; int64_t size; - ret = 0; append_fn = 0; ar = (struct ar_w *)a->format_data; ar->is_strtab = 0; From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:30:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB9AF106566B; Mon, 28 Dec 2009 03:30:31 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAF548FC08; Mon, 28 Dec 2009 03:30:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS3UVqR078064; Mon, 28 Dec 2009 03:30:31 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS3UVe9078062; Mon, 28 Dec 2009 03:30:31 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280330.nBS3UVe9078062@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201109 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:30:32 -0000 Author: kientzle Date: Mon Dec 28 03:30:31 2009 New Revision: 201109 URL: http://svn.freebsd.org/changeset/base/201109 Log: Compatibility with old systems with non-POSIX getpwuid_r/getgrgid_r. Modified: head/lib/libarchive/archive_read_disk_set_standard_lookup.c Modified: head/lib/libarchive/archive_read_disk_set_standard_lookup.c ============================================================================== --- head/lib/libarchive/archive_read_disk_set_standard_lookup.c Mon Dec 28 03:28:21 2009 (r201108) +++ head/lib/libarchive/archive_read_disk_set_standard_lookup.c Mon Dec 28 03:30:31 2009 (r201109) @@ -195,6 +195,7 @@ lookup_uname_helper(struct name_cache *c if (cache->buff == NULL) return (NULL); for (;;) { + result = &pwent; /* Old getpwuid_r ignores last arg. */ r = getpwuid_r((uid_t)id, &pwent, cache->buff, cache->buff_size, &result); if (r == 0) @@ -243,6 +244,7 @@ lookup_gname_helper(struct name_cache *c if (cache->buff == NULL) return (NULL); for (;;) { + result = &grent; /* Old getgrgid_r ignores last arg. */ r = getgrgid_r((gid_t)id, &grent, cache->buff, cache->buff_size, &result); if (r == 0) From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:31:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03FC1106568B; Mon, 28 Dec 2009 03:31:30 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7E218FC20; Mon, 28 Dec 2009 03:31:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS3VTBr078122; Mon, 28 Dec 2009 03:31:29 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS3VTKd078120; Mon, 28 Dec 2009 03:31:29 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280331.nBS3VTKd078120@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201110 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:31:30 -0000 Author: kientzle Date: Mon Dec 28 03:31:29 2009 New Revision: 201110 URL: http://svn.freebsd.org/changeset/base/201110 Log: Clarify an example so Linux folks won't keep getting confused by this point. Modified: head/lib/libarchive/archive_write.3 Modified: head/lib/libarchive/archive_write.3 ============================================================================== --- head/lib/libarchive/archive_write.3 Mon Dec 28 03:30:31 2009 (r201109) +++ head/lib/libarchive/archive_write.3 Mon Dec 28 03:31:29 2009 (r201110) @@ -453,6 +453,9 @@ and .Xr close 2 system calls. .Bd -literal -offset indent +#ifdef __linux__ +#define _FILE_OFFSET_BITS 64 +#endif #include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 03:33:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0493E106568B; Mon, 28 Dec 2009 03:33:06 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E84808FC1E; Mon, 28 Dec 2009 03:33:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS3X5Ih078200; Mon, 28 Dec 2009 03:33:05 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS3X5Yu078198; Mon, 28 Dec 2009 03:33:05 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280333.nBS3X5Yu078198@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 03:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201111 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 03:33:06 -0000 Author: kientzle Date: Mon Dec 28 03:33:05 2009 New Revision: 201111 URL: http://svn.freebsd.org/changeset/base/201111 Log: Remove some dead assignments, fix some declarations. Modified: head/lib/libarchive/archive_write_set_compression_compress.c Modified: head/lib/libarchive/archive_write_set_compression_compress.c ============================================================================== --- head/lib/libarchive/archive_write_set_compression_compress.c Mon Dec 28 03:31:29 2009 (r201110) +++ head/lib/libarchive/archive_write_set_compression_compress.c Mon Dec 28 03:33:05 2009 (r201111) @@ -243,7 +243,6 @@ output_code(struct archive_write *a, int int bits, ret, clear_flg, bit_offset; clear_flg = ocode == CLEAR; - bits = state->code_len; /* * Since ocode is always >= 8 bits, only need to mask the first @@ -426,10 +425,9 @@ archive_compressor_compress_finish(struc ssize_t block_length, target_block_length, bytes_written; int ret; struct private_data *state; - unsigned tocopy; + size_t tocopy; state = (struct private_data *)a->compressor.data; - ret = 0; if (a->client_writer == NULL) { archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, "No write callback is registered? " From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 06:59:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69EA81065679; Mon, 28 Dec 2009 06:59:36 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59CA48FC1B; Mon, 28 Dec 2009 06:59:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS6xaa3081936; Mon, 28 Dec 2009 06:59:36 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS6xass081934; Mon, 28 Dec 2009 06:59:36 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280659.nBS6xass081934@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 06:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201112 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 06:59:36 -0000 Author: kientzle Date: Mon Dec 28 06:59:35 2009 New Revision: 201112 URL: http://svn.freebsd.org/changeset/base/201112 Log: Portability. Modified: head/lib/libarchive/archive_read_support_compression_program.c Modified: head/lib/libarchive/archive_read_support_compression_program.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_program.c Mon Dec 28 03:33:05 2009 (r201111) +++ head/lib/libarchive/archive_read_support_compression_program.c Mon Dec 28 06:59:35 2009 (r201112) @@ -205,7 +205,7 @@ program_bidder_bid(struct archive_read_f /* No match, so don't bid. */ if (memcmp(p, state->signature, state->signature_len) != 0) return (0); - return (state->signature_len * 8); + return ((int)state->signature_len * 8); } /* Otherwise, bid once and then never bid again. */ @@ -251,6 +251,7 @@ child_stop(struct archive_read_filter *s return (ARCHIVE_WARN); } +#if !defined(_WIN32) || defined(__CYGWIN__) if (WIFSIGNALED(state->exit_status)) { #ifdef SIGPIPE /* If the child died because we stopped reading before @@ -267,6 +268,7 @@ child_stop(struct archive_read_filter *s WTERMSIG(state->exit_status)); return (ARCHIVE_WARN); } +#endif /* !_WIN32 || __CYGWIN__ */ if (WIFEXITED(state->exit_status)) { if (WEXITSTATUS(state->exit_status) == 0) From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 09:26:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 329FA106568F; Mon, 28 Dec 2009 09:26:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 236E08FC08; Mon, 28 Dec 2009 09:26:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS9QlQu084816; Mon, 28 Dec 2009 09:26:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS9QlUT084814; Mon, 28 Dec 2009 09:26:47 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912280926.nBS9QlUT084814@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 28 Dec 2009 09:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201114 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 09:26:47 -0000 Author: trasz Date: Mon Dec 28 09:26:46 2009 New Revision: 201114 URL: http://svn.freebsd.org/changeset/base/201114 Log: Add references to termios-related stuff. Modified: head/share/man/man4/termios.4 Modified: head/share/man/man4/termios.4 ============================================================================== --- head/share/man/man4/termios.4 Mon Dec 28 09:18:15 2009 (r201113) +++ head/share/man/man4/termios.4 Mon Dec 28 09:26:46 2009 (r201114) @@ -1577,3 +1577,10 @@ after is set according to the values in the header .In sys/ttydefaults.h . +.Sh SEE ALSO +.Xr stty 1 , +.Xr tcgetsid 3 , +.Xr tcsendbreak 3 , +.Xr tcsetattr 3 , +.Xr tcsetsid 3 , +.Xr tty 4 From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 09:28:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76F34106566B; Mon, 28 Dec 2009 09:28:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 675F68FC0C; Mon, 28 Dec 2009 09:28:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS9SMbp084879; Mon, 28 Dec 2009 09:28:22 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS9SM8M084877; Mon, 28 Dec 2009 09:28:22 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912280928.nBS9SM8M084877@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 28 Dec 2009 09:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201115 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 09:28:22 -0000 Author: trasz Date: Mon Dec 28 09:28:22 2009 New Revision: 201115 URL: http://svn.freebsd.org/changeset/base/201115 Log: Line discipline support is gone; update tty(4) manual page to reflect this. Reviewed by: ed Modified: head/share/man/man4/tty.4 Modified: head/share/man/man4/tty.4 ============================================================================== --- head/share/man/man4/tty.4 Mon Dec 28 09:26:46 2009 (r201114) +++ head/share/man/man4/tty.4 Mon Dec 28 09:28:22 2009 (r201115) @@ -88,47 +88,6 @@ The remainder of this man page is concer with describing details of using and controlling terminal devices at a low level, such as that possibly required by a program wishing to provide features similar to those provided by the system. -.Ss Line disciplines -A terminal file is used like any other file in the system in that -it can be opened, read, and written to using standard system -calls. -For each existing terminal file, there is a software processing module -called a -.Em "line discipline" -is associated with it. -The -.Em "line discipline" -essentially glues the low level device driver code with the high -level generic interface routines (such as -.Xr read 2 -and -.Xr write 2 ) , -and is responsible for implementing the semantics associated -with the device. -When a terminal file is first opened by a program, the default -.Em "line discipline" -called the -.Dv termios -line discipline is associated with the file. -This is the primary -line discipline that is used in most cases and provides the semantics -that users normally associate with a terminal. -When the -.Dv termios -line discipline is in effect, the terminal file behaves and is -operated according to the rules described in -.Xr termios 4 . -Please refer to that man page for a full description of the terminal -semantics. -The operations described here -generally represent features common -across all -.Em "line disciplines" , -however some of these calls may not -make sense in conjunction with a line discipline other than -.Dv termios , -and some may not be supported by the underlying -hardware (or lack thereof, as in the case of ptys). .Ss Terminal File Operations All of the following operations are invoked using the .Xr ioctl 2 @@ -154,39 +113,24 @@ parameter (if any) are listed. For example, the first entry says .Pp -.D1 Em "TIOCSETD int *ldisc" +.D1 Em "TIOCSPGRP int *tpgrp" .Pp and would be called on the terminal associated with file descriptor zero by the following code fragment: .Bd -literal - int ldisc; + int pgrp; - ldisc = TTYDISC; - ioctl(0, TIOCSETD, &ldisc); + pgrp = getpgrp(); + ioctl(0, TIOCSPGRP, &pgrp); .Ed .Ss Terminal File Request Descriptions .Bl -tag -width TIOCGWINSZ .It Dv TIOCSETD Fa int *ldisc -Change to the new line discipline pointed to by +This call is obsolete but left for compatibility. +Before +.Fx 8.0 , +it would change to the new line discipline pointed to by .Fa ldisc . -The available line disciplines are listed in -.In sys/ttycom.h -and currently are: -.Pp -.Bl -tag -width NETGRAPHDISC -compact -.It TTYDISC -Termios interactive line discipline. -.It TABLDISC -Tablet line discipline. -.It SLIPDISC -Serial IP line discipline. -.It PPPDISC -PPP line discipline. -.It NETGRAPHDISC -Netgraph -.Xr ng_tty 4 -line discipline. -.El .Pp .It Dv TIOCGETD Fa int *ldisc Return the current line discipline in the integer pointed to by From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 09:32:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A90D106568B; Mon, 28 Dec 2009 09:32:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B73D8FC0A; Mon, 28 Dec 2009 09:32:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS9WkT5085017; Mon, 28 Dec 2009 09:32:46 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS9WkTF085014; Mon, 28 Dec 2009 09:32:46 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912280932.nBS9WkTF085014@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 28 Dec 2009 09:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201116 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 09:32:46 -0000 Author: trasz Date: Mon Dec 28 09:32:45 2009 New Revision: 201116 URL: http://svn.freebsd.org/changeset/base/201116 Log: Change u3g(4) and ucom(4) to not refer to pppd(8), which is gone. Modified: head/share/man/man4/u3g.4 head/share/man/man4/ucom.4 Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Mon Dec 28 09:28:22 2009 (r201115) +++ head/share/man/man4/u3g.4 Mon Dec 28 09:32:45 2009 (r201116) @@ -76,7 +76,7 @@ Sierra MC875U, MC8775U, etc. for the complete list of supported cards for each vendor mentioned above.) .Pp -The supported 3G cards provide the necessary modem port for ppp, pppd, or mpd +The supported 3G cards provide the necessary modem port for ppp, or mpd connections as well as extra ports (depending on the specific device) to provide other functions (additional command port, diagnostic port, SIM toolkit port). Modified: head/share/man/man4/ucom.4 ============================================================================== --- head/share/man/man4/ucom.4 Mon Dec 28 09:28:22 2009 (r201115) +++ head/share/man/man4/ucom.4 Mon Dec 28 09:32:45 2009 (r201116) @@ -68,7 +68,7 @@ driver shows a behavior like a This means that normal programs such as .Xr tip 1 or -.Xr pppd 8 +.Xr ppp 8 can be used to access the device. .Pp The From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 09:37:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58E2E106568F; Mon, 28 Dec 2009 09:37:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49C378FC1B; Mon, 28 Dec 2009 09:37:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS9bY6i085163; Mon, 28 Dec 2009 09:37:34 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS9bY56085161; Mon, 28 Dec 2009 09:37:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912280937.nBS9bY56085161@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 28 Dec 2009 09:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201117 - head/usr.sbin/ppp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 09:37:34 -0000 Author: trasz Date: Mon Dec 28 09:37:33 2009 New Revision: 201117 URL: http://svn.freebsd.org/changeset/base/201117 Log: Don't refer to pppd(8). Modified: head/usr.sbin/ppp/ppp.8.m4 Modified: head/usr.sbin/ppp/ppp.8.m4 ============================================================================== --- head/usr.sbin/ppp/ppp.8.m4 Mon Dec 28 09:32:45 2009 (r201116) +++ head/usr.sbin/ppp/ppp.8.m4 Mon Dec 28 09:37:33 2009 (r201117) @@ -44,10 +44,10 @@ changecom(,)dnl This is a user process .Em PPP software package. -Normally, +Sometimes, .Em PPP is implemented as a part of the kernel (e.g., as managed by -.Xr pppd 8 ) +.Nm pppd ) and it is thus somewhat hard to debug and/or modify its behaviour. However, in this implementation .Em PPP @@ -2701,7 +2701,7 @@ program. Note: There is a problem negotiating .Ar deflate capabilities with -.Xr pppd 8 +.Nm pppd - a .Em PPP implementation available under many operating systems. @@ -2734,7 +2734,7 @@ Default: Disabled and Denied. This is a variance of the .Ar deflate option, allowing negotiation with the -.Xr pppd 8 +.Nm pppd program. Refer to the .Ar deflate @@ -2882,7 +2882,7 @@ acts as the authenticatee with both prot the protocols are used alternately in response to challenges. .Pp Note: If only LANMan is enabled, -.Xr pppd 8 +.Nm pppd (version 2.3.5) misbehaves when acting as authenticatee. It provides both the NT and the LANMan answers, but also suggests that only the NT answer @@ -6091,7 +6091,6 @@ ifdef({LOCALRAD},{},{.Xr libradius 3 , .Xr named 8 , .Xr ping 8 , .Xr pppctl 8 , -.Xr pppd 8 , .Xr pppoed 8 , .Xr route 8 , .Xr sshd 8 , From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 09:41:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21F6B1065672; Mon, 28 Dec 2009 09:41:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12C818FC12; Mon, 28 Dec 2009 09:41:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBS9fD7U085266; Mon, 28 Dec 2009 09:41:13 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS9fDew085263; Mon, 28 Dec 2009 09:41:13 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912280941.nBS9fDew085263@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 28 Dec 2009 09:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201118 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 09:41:14 -0000 Author: trasz Date: Mon Dec 28 09:41:13 2009 New Revision: 201118 URL: http://svn.freebsd.org/changeset/base/201118 Log: Bump manual page dates. Modified: head/share/man/man4/termios.4 head/share/man/man4/tty.4 Modified: head/share/man/man4/termios.4 ============================================================================== --- head/share/man/man4/termios.4 Mon Dec 28 09:37:33 2009 (r201117) +++ head/share/man/man4/termios.4 Mon Dec 28 09:41:13 2009 (r201118) @@ -32,7 +32,7 @@ .\" @(#)termios.4 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd December 26, 2009 .Dt TERMIOS 4 .Os .Sh NAME Modified: head/share/man/man4/tty.4 ============================================================================== --- head/share/man/man4/tty.4 Mon Dec 28 09:37:33 2009 (r201117) +++ head/share/man/man4/tty.4 Mon Dec 28 09:41:13 2009 (r201118) @@ -32,7 +32,7 @@ .\" @(#)tty.4 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd June 27, 2007 +.Dd December 26, 2009 .Dt TTY 4 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 10:12:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79F52106566B; Mon, 28 Dec 2009 10:12:35 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 514728FC0C; Mon, 28 Dec 2009 10:12:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSACZ6H086021; Mon, 28 Dec 2009 10:12:35 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSACZbe086019; Mon, 28 Dec 2009 10:12:35 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912281012.nBSACZbe086019@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 28 Dec 2009 10:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201120 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 10:12:35 -0000 Author: luigi Date: Mon Dec 28 10:12:35 2009 New Revision: 201120 URL: http://svn.freebsd.org/changeset/base/201120 Log: explain details of operation of table lookups, and improve portability Modified: head/sys/netinet/ipfw/ip_fw_table.c Modified: head/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_table.c Mon Dec 28 10:02:06 2009 (r201119) +++ head/sys/netinet/ipfw/ip_fw_table.c Mon Dec 28 10:12:35 2009 (r201120) @@ -79,6 +79,18 @@ struct table_entry { u_int32_t value; }; +/* + * The radix code expects addr and mask to be array of bytes, + * with the first byte being the length of the array. rn_inithead + * is called with the offset in bits of the lookup key within the + * array. If we use a sockaddr_in as the underlying type, + * sin_len is conveniently located at offset 0, sin_addr is at + * offset 4 and normally aligned. + * But for portability, let's avoid assumption and make the code explicit + */ +#define KEY_LEN(v) *((uint8_t *)&(v)) +#define KEY_OFS (8*offsetof(struct sockaddr_in, sin_addr)) + int ipfw_add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, uint8_t mlen, uint32_t value) @@ -94,7 +106,7 @@ ipfw_add_table_entry(struct ip_fw_chain if (ent == NULL) return (ENOMEM); ent->value = value; - ent->addr.sin_len = ent->mask.sin_len = 8; + KEY_LEN(ent->addr) = KEY_LEN(ent->mask) = 8; ent->mask.sin_addr.s_addr = htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); ent->addr.sin_addr.s_addr = addr & ent->mask.sin_addr.s_addr; IPFW_WLOCK(ch); @@ -119,7 +131,7 @@ ipfw_del_table_entry(struct ip_fw_chain if (tbl >= IPFW_TABLES_MAX) return (EINVAL); rnh = ch->tables[tbl]; - sa.sin_len = mask.sin_len = 8; + KEY_LEN(sa) = KEY_LEN(mask) = 8; mask.sin_addr.s_addr = htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); sa.sin_addr.s_addr = addr & mask.sin_addr.s_addr; IPFW_WLOCK(ch); @@ -179,7 +191,7 @@ ipfw_init_tables(struct ip_fw_chain *ch) uint16_t j; for (i = 0; i < IPFW_TABLES_MAX; i++) { - if (!rn_inithead((void **)&ch->tables[i], 32)) { + if (!rn_inithead((void **)&ch->tables[i], KEY_OFS)) { for (j = 0; j < i; j++) { (void) ipfw_flush_table(ch, j); } @@ -200,7 +212,7 @@ ipfw_lookup_table(struct ip_fw_chain *ch if (tbl >= IPFW_TABLES_MAX) return (0); rnh = ch->tables[tbl]; - sa.sin_len = 8; + KEY_LEN(sa) = 8; sa.sin_addr.s_addr = addr; ent = (struct table_entry *)(rnh->rnh_lookup(&sa, NULL, rnh)); if (ent != NULL) { From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 10:19:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 269D0106568B; Mon, 28 Dec 2009 10:19:54 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 172728FC1B; Mon, 28 Dec 2009 10:19:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSAJrFR086212; Mon, 28 Dec 2009 10:19:53 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSAJrDR086210; Mon, 28 Dec 2009 10:19:53 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912281019.nBSAJrDR086210@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 28 Dec 2009 10:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201121 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 10:19:54 -0000 Author: luigi Date: Mon Dec 28 10:19:53 2009 New Revision: 201121 URL: http://svn.freebsd.org/changeset/base/201121 Log: readability fixes -- add braces on large blocks, remove unnecessary initializations Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Mon Dec 28 10:12:35 2009 (r201120) +++ head/sys/netinet/ipfw/ip_dummynet.c Mon Dec 28 10:19:53 2009 (r201121) @@ -566,13 +566,6 @@ set_ticks(struct mbuf *m, struct dn_flow ret = div64( (m->m_pkthdr.len * 8 + q->extra_bits) * hz - q->numbytes + p->bandwidth - 1 , p->bandwidth); -#if 0 - printf("%s %d extra_bits %d numb %d ret %d\n", - __FUNCTION__, __LINE__, - (int)(q->extra_bits & 0xffffffff), - (int)(q->numbytes & 0xffffffff), - (int)(ret & 0xffffffff)); -#endif if (ret < 0) ret = 0; return ret; @@ -945,8 +938,8 @@ dummynet_task(void *context, int pending } /* Sweep pipes trying to expire idle flow_queues. */ - for (i = 0; i < HASHSIZE; i++) - SLIST_FOREACH(pipe, &pipehash[i], next) + for (i = 0; i < HASHSIZE; i++) { + SLIST_FOREACH(pipe, &pipehash[i], next) { if (pipe->idle_heap.elements > 0 && DN_KEY_LT(pipe->idle_heap.p[0].key, pipe->V)) { struct dn_flow_queue *q = @@ -957,6 +950,8 @@ dummynet_task(void *context, int pending q->S = q->F + 1; pipe->sum -= q->fs->weight; } + } + } DUMMYNET_UNLOCK(); @@ -1055,8 +1050,8 @@ expire_queues(struct dn_flow_set *fs) if (fs->last_expired == time_uptime) return 0 ; fs->last_expired = time_uptime ; - for (i = 0 ; i <= fs->rq_size ; i++) /* last one is overflow */ - for (prev=NULL, q = fs->rq[i] ; q != NULL ; ) + for (i = 0 ; i <= fs->rq_size ; i++) { /* last one is overflow */ + for (prev=NULL, q = fs->rq[i] ; q != NULL ; ) { if (!QUEUE_IS_IDLE(q)) { prev = q ; q = q->next ; @@ -1070,6 +1065,8 @@ expire_queues(struct dn_flow_set *fs) fs->rq_elements-- ; free(old_q, M_DUMMYNET); } + } + } return initial_elements - fs->rq_elements ; } @@ -1929,14 +1926,16 @@ config_pipe(struct dn_pipe *p) static void fs_remove_from_heap(struct dn_heap *h, struct dn_flow_set *fs) { - int i = 0, found = 0 ; - for (; i < h->elements ;) + int i, found; + + for (i = found = 0 ; i < h->elements ;) { if ( ((struct dn_flow_queue *)h->p[i].object)->fs == fs) { h->elements-- ; h->p[i] = h->p[h->elements] ; found++ ; } else i++ ; + } if (found) heapify(h); } @@ -1947,17 +1946,16 @@ fs_remove_from_heap(struct dn_heap *h, s static void pipe_remove_from_heap(struct dn_heap *h, struct dn_pipe *p) { - if (h->elements > 0) { - int i = 0 ; + int i; + for (i=0; i < h->elements ; i++ ) { - if (h->p[i].object == p) { /* found it */ - h->elements-- ; - h->p[i] = h->p[h->elements] ; - heapify(h); - break ; - } + if (h->p[i].object == p) { /* found it */ + h->elements-- ; + h->p[i] = h->p[h->elements] ; + heapify(h); + break ; + } } - } } /* @@ -2017,14 +2015,16 @@ delete_pipe(struct dn_pipe *p) SLIST_REMOVE(&pipehash[HASH(pipe->pipe_nr)], pipe, dn_pipe, next); /* Remove all references to this pipe from flow_sets. */ - for (i = 0; i < HASHSIZE; i++) - SLIST_FOREACH(fs, &flowsethash[i], next) + for (i = 0; i < HASHSIZE; i++) { + SLIST_FOREACH(fs, &flowsethash[i], next) { if (fs->pipe == pipe) { printf("dummynet: ++ ref to pipe %d from fs %d\n", p->pipe_nr, fs->fs_nr); fs->pipe = NULL ; purge_flow_set(fs, 0); } + } + } fs_remove_from_heap(&ready_heap, &(pipe->fs)); purge_pipe(pipe); /* remove all data associated to this pipe */ /* remove reference to here from extract_heap and wfq_ready_heap */ @@ -2073,7 +2073,7 @@ dn_copy_set(struct dn_flow_set *set, cha DUMMYNET_LOCK_ASSERT(); - for (i = 0 ; i <= set->rq_size ; i++) + for (i = 0 ; i <= set->rq_size ; i++) { for (q = set->rq[i] ; q ; q = q->next, qp++ ) { if (q->hash_slot != i) printf("dummynet: ++ at %d: wrong slot (have %d, " @@ -2088,6 +2088,7 @@ dn_copy_set(struct dn_flow_set *set, cha qp->head = qp->tail = NULL ; qp->fs = NULL ; } + } if (copied != set->rq_elements) printf("dummynet: ++ wrong count, have %d should be %d\n", copied, set->rq_elements); @@ -2137,7 +2138,7 @@ dummynet_get(struct sockopt *sopt) DUMMYNET_UNLOCK(); buf = malloc(size, M_TEMP, M_WAITOK); DUMMYNET_LOCK(); - if (size == dn_calc_size()) + if (size >= dn_calc_size()) break; free(buf, M_TEMP); buf = NULL; @@ -2147,7 +2148,7 @@ dummynet_get(struct sockopt *sopt) return ENOBUFS ; } bp = buf; - for (i = 0; i < HASHSIZE; i++) + for (i = 0; i < HASHSIZE; i++) { SLIST_FOREACH(pipe, &pipehash[i], next) { struct dn_pipe *pipe_bp = (struct dn_pipe *)bp; @@ -2176,8 +2177,9 @@ dummynet_get(struct sockopt *sopt) bp += sizeof(*pipe) ; bp = dn_copy_set(&(pipe->fs), bp); } + } - for (i = 0; i < HASHSIZE; i++) + for (i = 0; i < HASHSIZE; i++) { SLIST_FOREACH(fs, &flowsethash[i], next) { struct dn_flow_set *fs_bp = (struct dn_flow_set *)bp; @@ -2189,6 +2191,7 @@ dummynet_get(struct sockopt *sopt) bp += sizeof(*fs); bp = dn_copy_set(fs, bp); } + } DUMMYNET_UNLOCK(); From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 10:47:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3ECED1065679; Mon, 28 Dec 2009 10:47:05 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28D158FC1A; Mon, 28 Dec 2009 10:47:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSAl59t088149; Mon, 28 Dec 2009 10:47:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSAl4hL088135; Mon, 28 Dec 2009 10:47:04 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912281047.nBSAl4hL088135@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 28 Dec 2009 10:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201122 - in head/sys: net netgraph netinet netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 10:47:05 -0000 Author: luigi Date: Mon Dec 28 10:47:04 2009 New Revision: 201122 URL: http://svn.freebsd.org/changeset/base/201122 Log: bring in several cleanups tested in ipfw3-head branch, namely: r201011 - move most of ng_ipfw.h into ip_fw_private.h, as this code is ipfw-specific. This removes a dependency on ng_ipfw.h from some files. - move many equivalent definitions of direction (IN, OUT) for reinjected packets into ip_fw_private.h - document the structure of the packet tags used for dummynet and netgraph; r201049 - merge some common code to attach/detach hooks into a single function. r201055 - remove some duplicated code in ip_fw_pfil. The input and output processing uses almost exactly the same code so there is no need to use two separate hooks. ip_fw_pfil.o goes from 2096 to 1382 bytes of .text r201057 (see the svn log for full details) - macros to make the conversion of ip_len and ip_off between host and network format more explicit r201113 (the remaining parts) - readability fixes -- put braces around some large for() blocks, localize variables so the compiler does not think they are uninitialized, do not insist on precise allocation size if we have more than we need. r201119 - when doing a lookup, keys must be in big endian format because this is what the radix code expects (this fixes a bug in the recently-introduced 'lookup' option) No ABI changes in this commit. MFC after: 1 week Modified: head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c head/sys/netgraph/ng_ipfw.c head/sys/netgraph/ng_ipfw.h head/sys/netinet/in.h head/sys/netinet/ip_dummynet.h head/sys/netinet/ipfw/ip_dummynet.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_dynamic.c head/sys/netinet/ipfw/ip_fw_log.c head/sys/netinet/ipfw/ip_fw_nat.c head/sys/netinet/ipfw/ip_fw_pfil.c head/sys/netinet/ipfw/ip_fw_private.h head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/net/if_bridge.c Mon Dec 28 10:47:04 2009 (r201122) @@ -3041,13 +3041,17 @@ bridge_pfil(struct mbuf **mp, struct ifn /* XXX this section is also in if_ethersubr.c */ if (V_ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { - struct dn_pkt_tag *dn_tag; + struct m_tag *mtag; error = -1; - dn_tag = ip_dn_claim_tag(*mp); - if (dn_tag == NULL) { + mtag = m_tag_find(*mp, PACKET_TAG_DUMMYNET, NULL); + if (mtag == NULL) { args.slot = 0; } else { + struct dn_pkt_tag *dn_tag; + + mtag->m_tag_id = PACKET_TAG_NONE; + dn_tag = (struct dn_pkt_tag *)(mtag + 1); if (dn_tag->slot != 0 && V_fw_one_pass) /* packet already partially processed */ goto ipfwpass; @@ -3081,7 +3085,7 @@ bridge_pfil(struct mbuf **mp, struct ifn * packet will return to us via bridge_dummynet(). */ args.oif = ifp; - ip_dn_io_ptr(mp, DN_TO_IFB_FWD, &args); + ip_dn_io_ptr(mp, DIR_FWD | PROTO_IFB, &args); return (error); } Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/net/if_ethersubr.c Mon Dec 28 10:47:04 2009 (r201122) @@ -467,13 +467,16 @@ ether_ipfw_chk(struct mbuf **m0, struct struct mbuf *m; int i; struct ip_fw_args args; - struct dn_pkt_tag *dn_tag; + struct m_tag *mtag; - dn_tag = ip_dn_claim_tag(*m0); - - if (dn_tag == NULL) { + mtag = m_tag_find(*m0, PACKET_TAG_DUMMYNET, NULL); + if (mtag == NULL) { args.slot = 0; } else { + struct dn_pkt_tag *dn_tag; + + mtag->m_tag_id = PACKET_TAG_NONE; + dn_tag = (struct dn_pkt_tag *)(mtag + 1); if (dn_tag->slot != 0 && V_fw_one_pass) /* dummynet packet, already partially processed */ return (1); @@ -532,6 +535,7 @@ ether_ipfw_chk(struct mbuf **m0, struct return 1; if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) { + int dir; /* * Pass the pkt to dummynet, which consumes it. * If shared, make a copy and keep the original. @@ -547,7 +551,8 @@ ether_ipfw_chk(struct mbuf **m0, struct */ *m0 = NULL ; } - ip_dn_io_ptr(&m, dst ? DN_TO_ETH_OUT: DN_TO_ETH_DEMUX, &args); + dir = PROTO_LAYER2 | (dst ? DIR_OUT : DIR_IN); + ip_dn_io_ptr(&m, dir, &args); return 0; } /* Modified: head/sys/netgraph/ng_ipfw.c ============================================================================== --- head/sys/netgraph/ng_ipfw.c Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/netgraph/ng_ipfw.c Mon Dec 28 10:47:04 2009 (r201122) @@ -234,7 +234,7 @@ ng_ipfw_rcvdata(hook_p hook, item_p item }; switch (ngit->dir) { - case NG_IPFW_OUT: + case DIR_OUT: { struct ip *ip; @@ -249,7 +249,7 @@ ng_ipfw_rcvdata(hook_p hook, item_p item return ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); } - case NG_IPFW_IN: + case DIR_IN: ip_input(m); return (0); default: @@ -298,7 +298,7 @@ ng_ipfw_input(struct mbuf **m0, int dir, ngit->rule_id = fwa->rule_id; ngit->chain_id = fwa->chain_id; ngit->dir = dir; - ngit->ifp = fwa->oif; +// ngit->ifp = fwa->oif; /* XXX do we use it ? */ m_tag_prepend(m, &ngit->mt); } else Modified: head/sys/netgraph/ng_ipfw.h ============================================================================== --- head/sys/netgraph/ng_ipfw.h Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/netgraph/ng_ipfw.h Mon Dec 28 10:47:04 2009 (r201122) @@ -26,27 +26,7 @@ * $FreeBSD$ */ +#ifndef _NG_IPFW_H +#define _NG_IPFW_H #define NG_IPFW_NODE_TYPE "ipfw" -#define NGM_IPFW_COOKIE 1105988990 - -#ifdef _KERNEL - -typedef int ng_ipfw_input_t(struct mbuf **, int, struct ip_fw_args *, int); -extern ng_ipfw_input_t *ng_ipfw_input_p; -#define NG_IPFW_LOADED (ng_ipfw_input_p != NULL) - -struct ng_ipfw_tag { - struct m_tag mt; /* tag header */ - uint32_t slot; /* slot for next rule */ - uint32_t rulenum; /* matching rule number */ - uint32_t rule_id; /* matching rule id */ - uint32_t chain_id; /* ruleset id */ - struct ifnet *ifp; /* interface, for ip_output */ - int dir; -#define NG_IPFW_OUT 0 -#define NG_IPFW_IN 1 -}; - -#define TAGSIZ (sizeof(struct ng_ipfw_tag) - sizeof(struct m_tag)) - -#endif /* _KERNEL */ +#endif /* _NG_IPFW_H */ Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/netinet/in.h Mon Dec 28 10:47:04 2009 (r201122) @@ -734,6 +734,32 @@ void in_ifdetach(struct ifnet *); #define sintosa(sin) ((struct sockaddr *)(sin)) #define ifatoia(ifa) ((struct in_ifaddr *)(ifa)) +/* + * Historically, BSD keeps ip_len and ip_off in host format + * when doing layer 3 processing, and this often requires + * to translate the format back and forth. + * To make the process explicit, we define a couple of macros + * that also take into account the fact that at some point + * we may want to keep those fields always in net format. + */ + +#if (BYTE_ORDER == BIG_ENDIAN) || defined(HAVE_NET_IPLEN) +#define SET_NET_IPLEN(p) do {} while (0) +#define SET_HOST_IPLEN(p) do {} while (0) +#else +#define SET_NET_IPLEN(p) do { \ + struct ip *h_ip = (p); \ + h_ip->ip_len = htons(h_ip->ip_len); \ + h_ip->ip_off = htons(h_ip->ip_off); \ + } while (0) + +#define SET_HOST_IPLEN(p) do { \ + struct ip *h_ip = (p); \ + h_ip->ip_len = ntohs(h_ip->ip_len); \ + h_ip->ip_off = ntohs(h_ip->ip_off); \ + } while (0) +#endif /* !HAVE_NET_IPLEN */ + #endif /* _KERNEL */ /* INET6 stuff */ Modified: head/sys/netinet/ip_dummynet.h ============================================================================== --- head/sys/netinet/ip_dummynet.h Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/netinet/ip_dummynet.h Mon Dec 28 10:47:04 2009 (r201122) @@ -110,21 +110,19 @@ struct dn_heap { * them that carries their dummynet state. This is used within * the dummynet code as well as outside when checking for special * processing requirements. + * Note that the first part is the reinject info and is common to + * other forms of packet reinjection. */ struct dn_pkt_tag { + /* first part, reinject info */ uint32_t slot; /* slot of next rule to use */ uint32_t rulenum; /* matching rule number */ uint32_t rule_id; /* matching rule id */ uint32_t chain_id; /* ruleset id */ + + /* second part, dummynet specific */ int dn_dir; /* action when packet comes out. */ -#define DN_TO_IP_OUT 1 -#define DN_TO_IP_IN 2 -/* Obsolete: #define DN_TO_BDG_FWD 3 */ -#define DN_TO_ETH_DEMUX 4 -#define DN_TO_ETH_OUT 5 -#define DN_TO_IP6_IN 6 -#define DN_TO_IP6_OUT 7 -#define DN_TO_IFB_FWD 8 + /* see ip_fw_private.h */ dn_key output_time; /* when the pkt is due for delivery */ struct ifnet *ifp; /* interface, for ip_output */ @@ -377,21 +375,4 @@ struct dn_pipe_max { SLIST_HEAD(dn_pipe_head, dn_pipe); -#ifdef _KERNEL - -/* - * Return the dummynet tag; if any. - * Make sure that the dummynet tag is not reused by lower layers. - */ -static __inline struct dn_pkt_tag * -ip_dn_claim_tag(struct mbuf *m) -{ - struct m_tag *mtag = m_tag_find(m, PACKET_TAG_DUMMYNET, NULL); - if (mtag != NULL) { - mtag->m_tag_id = PACKET_TAG_NONE; - return ((struct dn_pkt_tag *)(mtag + 1)); - } else - return (NULL); -} -#endif #endif /* _IP_DUMMYNET_H */ Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/netinet/ipfw/ip_dummynet.c Mon Dec 28 10:47:04 2009 (r201122) @@ -551,7 +551,6 @@ transmit_event(struct dn_pipe *pipe, str } #define div64(a, b) ((int64_t)(a) / (int64_t)(b)) -#define DN_TO_DROP 0xffff /* * Compute how many ticks we have to wait before being able to send * a packet. This is computed as the "wire time" for the packet @@ -589,7 +588,7 @@ compute_extra_bits(struct mbuf *pkt, str if (index >= p->loss_level) { struct dn_pkt_tag *dt = dn_tag_get(pkt); if (dt) - dt->dn_dir = DN_TO_DROP; + dt->dn_dir = DIR_DROP; } return extra_bits; } @@ -964,49 +963,48 @@ dummynet_task(void *context, int pending static void dummynet_send(struct mbuf *m) { - struct dn_pkt_tag *pkt; struct mbuf *n; - struct ip *ip; - int dst; for (; m != NULL; m = n) { + struct ifnet *ifp; + int dst; + n = m->m_nextpkt; m->m_nextpkt = NULL; if (m_tag_first(m) == NULL) { - pkt = NULL; /* probably unnecessary */ - dst = DN_TO_DROP; + dst = DIR_DROP; } else { - pkt = dn_tag_get(m); + struct dn_pkt_tag *pkt = dn_tag_get(m); dst = pkt->dn_dir; + ifp = pkt->ifp; } switch (dst) { - case DN_TO_IP_OUT: + case DIR_OUT: ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); break ; - case DN_TO_IP_IN : - ip = mtod(m, struct ip *); - ip->ip_len = htons(ip->ip_len); - ip->ip_off = htons(ip->ip_off); + case DIR_IN : + /* put header in network format for ip_input() */ + SET_NET_IPLEN(mtod(m, struct ip *)); netisr_dispatch(NETISR_IP, m); break; #ifdef INET6 - case DN_TO_IP6_IN: + case DIR_IN | PROTO_IPV6: netisr_dispatch(NETISR_IPV6, m); break; - case DN_TO_IP6_OUT: + case DIR_OUT | PROTO_IPV6: ip6_output(m, NULL, NULL, IPV6_FORWARDING, NULL, NULL, NULL); break; #endif - case DN_TO_IFB_FWD: + case DIR_FWD | PROTO_IFB: /* DN_TO_IFB_FWD: */ if (bridge_dn_p != NULL) - ((*bridge_dn_p)(m, pkt->ifp)); + ((*bridge_dn_p)(m, ifp)); else printf("dummynet: if_bridge not loaded\n"); break; - case DN_TO_ETH_DEMUX: + case DIR_IN | PROTO_LAYER2: /* DN_TO_ETH_DEMUX: */ /* * The Ethernet code assumes the Ethernet header is * contiguous in the first mbuf header. @@ -1020,17 +1018,17 @@ dummynet_send(struct mbuf *m) } ether_demux(m->m_pkthdr.rcvif, m); break; - case DN_TO_ETH_OUT: - ether_output_frame(pkt->ifp, m); + case DIR_OUT | PROTO_LAYER2: /* N_TO_ETH_OUT: */ + ether_output_frame(ifp, m); break; - case DN_TO_DROP: + case DIR_DROP: /* drop the packet after some time */ dn_free_pkt(m); break; default: - printf("dummynet: bad switch %d!\n", pkt->dn_dir); + printf("dummynet: bad switch %d!\n", dst); dn_free_pkt(m); break; } @@ -1545,8 +1543,8 @@ dummynet_io(struct mbuf **m0, int dir, s } } done: - if (head == m && dir != DN_TO_IFB_FWD && dir != DN_TO_ETH_DEMUX && - dir != DN_TO_ETH_OUT) { /* Fast io. */ + if (head == m && (dir & PROTO_LAYER2) == 0 ) { + /* Fast io. */ io_pkt_fast++; if (m->m_nextpkt != NULL) printf("dummynet: fast io: pkt chain detected!\n"); @@ -1810,13 +1808,15 @@ config_pipe(struct dn_pipe *p) pipe->idle_heap.size = pipe->idle_heap.elements = 0; pipe->idle_heap.offset = offsetof(struct dn_flow_queue, heap_pos); - } else + } else { /* Flush accumulated credit for all queues. */ - for (i = 0; i <= pipe->fs.rq_size; i++) + for (i = 0; i <= pipe->fs.rq_size; i++) { for (q = pipe->fs.rq[i]; q; q = q->next) { q->numbytes = p->burst + (io_fast ? p->bandwidth : 0); } + } + } pipe->bandwidth = p->bandwidth; pipe->burst = p->burst; Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/netinet/ipfw/ip_fw2.c Mon Dec 28 10:47:04 2009 (r201122) @@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -83,8 +82,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #ifdef INET6 @@ -591,7 +588,7 @@ send_reject6(struct ip_fw_args *args, in * sends a reject message, consuming the mbuf passed as an argument. */ static void -send_reject(struct ip_fw_args *args, int code, int ip_len, struct ip *ip) +send_reject(struct ip_fw_args *args, int code, int iplen, struct ip *ip) { #if 0 @@ -607,8 +604,7 @@ send_reject(struct ip_fw_args *args, int if (code != ICMP_REJECT_RST) { /* Send an ICMP unreach */ /* We need the IP header in host order for icmp_error(). */ if (args->eh != NULL) { - ip->ip_len = ntohs(ip->ip_len); - ip->ip_off = ntohs(ip->ip_off); + SET_HOST_IPLEN(ip); } icmp_error(args->m, ICMP_UNREACH, code, 0L, 0); } else if (args->f_id.proto == IPPROTO_TCP) { @@ -851,12 +847,12 @@ ipfw_chk(struct ip_fw_args *args) * src_ip, dst_ip ip addresses, in NETWORK format. * Only valid for IPv4 packets. */ - u_int8_t proto; - u_int16_t src_port = 0, dst_port = 0; /* NOTE: host format */ + uint8_t proto; + uint16_t src_port = 0, dst_port = 0; /* NOTE: host format */ struct in_addr src_ip, dst_ip; /* NOTE: network format */ - u_int16_t ip_len=0; + uint16_t iplen=0; int pktlen; - u_int16_t etype = 0; /* Host order stored ether type */ + uint16_t etype = 0; /* Host order stored ether type */ /* * dyn_dir = MATCH_UNKNOWN when rules unchecked, @@ -1094,14 +1090,17 @@ do { \ proto = ip->ip_p; src_ip = ip->ip_src; dst_ip = ip->ip_dst; - if (args->eh != NULL) { /* layer 2 packets are as on the wire */ - offset = ntohs(ip->ip_off) & IP_OFFMASK; - ip_len = ntohs(ip->ip_len); - } else { +#ifndef HAVE_NET_IPLEN + if (args->eh == NULL) { /* on l3 these are in host format */ offset = ip->ip_off & IP_OFFMASK; - ip_len = ip->ip_len; + iplen = ip->ip_len; + } else +#endif /* !HAVE_NET_IPLEN */ + { /* otherwise they are in net format */ + offset = ntohs(ip->ip_off) & IP_OFFMASK; + iplen = ntohs(ip->ip_len); } - pktlen = ip_len < pktlen ? ip_len : pktlen; + pktlen = iplen < pktlen ? iplen : pktlen; if (offset == 0) { switch (proto) { @@ -1144,6 +1143,7 @@ do { \ IPFW_RUNLOCK(chain); return (IP_FW_PASS); /* accept */ } + /* XXX divert should be handled same as other tags */ mtag = m_tag_find(m, PACKET_TAG_DIVERT, NULL); if (args->slot) { /* @@ -1355,27 +1355,29 @@ do { \ case O_IP_SRC_LOOKUP: case O_IP_DST_LOOKUP: if (is_ipv4) { - uint32_t a = + uint32_t key = (cmd->opcode == O_IP_DST_LOOKUP) ? dst_ip.s_addr : src_ip.s_addr; uint32_t v = 0; if (cmdlen > F_INSN_SIZE(ipfw_insn_u32)) { - /* generic lookup */ + /* generic lookup. The key must be + * in 32bit big-endian format. + */ v = ((ipfw_insn_u32 *)cmd)->d[1]; if (v == 0) - a = dst_ip.s_addr; + key = dst_ip.s_addr; else if (v == 1) - a = src_ip.s_addr; + key = src_ip.s_addr; else if (offset != 0) break; else if (proto != IPPROTO_TCP && proto != IPPROTO_UDP) break; else if (v == 2) - a = dst_port; + key = htonl(dst_port); else if (v == 3) - a = src_port; + key = htons(src_port); else if (v == 4 || v == 5) { check_uidgid( (ipfw_insn_u32 *)cmd, @@ -1384,14 +1386,15 @@ do { \ src_ip, src_port, &ucred_cache, &ucred_lookup, args->inp); if (v == 4 /* O_UID */) - a = ucred_cache->cr_uid; + key = ucred_cache->cr_uid; else if (v == 5 /* O_JAIL */) - a = ucred_cache->cr_prison->pr_id; + key = ucred_cache->cr_prison->pr_id; + key = htonl(key); } else break; } - match = ipfw_lookup_table(chain, cmd->arg1, a, - &v); + match = ipfw_lookup_table(chain, + cmd->arg1, key, &v); if (!match) break; if (cmdlen == F_INSN_SIZE(ipfw_insn_u32)) @@ -1514,7 +1517,7 @@ do { \ int i; if (cmd->opcode == O_IPLEN) - x = ip_len; + x = iplen; else if (cmd->opcode == O_IPTTL) x = ip->ip_ttl; else /* must be IPID */ @@ -1549,7 +1552,7 @@ do { \ int i; tcp = TCP(ulp); - x = ip_len - + x = iplen - ((ip->ip_hl + tcp->th_off) << 2); if (cmdlen == 1) { match = (cmd->arg1 == x); @@ -2022,7 +2025,7 @@ do { \ is_icmp_query(ICMP(ulp))) && !(m->m_flags & (M_BCAST|M_MCAST)) && !IN_MULTICAST(ntohl(dst_ip.s_addr))) { - send_reject(args, cmd->arg1, ip_len, ip); + send_reject(args, cmd->arg1, iplen, ip); m = args->m; } /* FALLTHROUGH */ @@ -2124,8 +2127,13 @@ do { \ f->bcnt += pktlen; l = 0; /* in any case exit inner loop */ - ip_off = (args->eh != NULL) ? - ntohs(ip->ip_off) : ip->ip_off; +#ifndef HAVE_NET_IPLEN + if (args->eh == NULL) + ip_off = ip->ip_off; + else +#endif /* !HAVE_NET_IPLEN */ + ip_off = ntohs(ip->ip_off); + /* if not fragmented, go to next rule */ if ((ip_off & (IP_MF | IP_OFFMASK)) == 0) break; @@ -2135,8 +2143,7 @@ do { \ * from layer2. */ if (args->eh != NULL) { - ip->ip_len = ntohs(ip->ip_len); - ip->ip_off = ntohs(ip->ip_off); + SET_HOST_IPLEN(ip); } args->m = m = ip_reass(m); @@ -2153,9 +2160,10 @@ do { \ ip = mtod(m, struct ip *); hlen = ip->ip_hl << 2; - /* revert len & off for layer2 pkts */ - if (args->eh != NULL) - ip->ip_len = htons(ip->ip_len); + /* revert len. & off to net format if needed */ + if (args->eh != NULL) { + SET_NET_IPLEN(ip); + } ip->ip_sum = 0; if (hlen == sizeof(struct ip)) ip->ip_sum = in_cksum_hdr(ip); @@ -2364,7 +2372,7 @@ vnet_ipfw_init(const void *unused) */ V_ip_fw_ctl_ptr = ipfw_ctl; V_ip_fw_chk_ptr = ipfw_chk; - error = ipfw_attach_hooks(); + error = ipfw_attach_hooks(1); return (error); } @@ -2384,10 +2392,7 @@ vnet_ipfw_uninit(const void *unused) * Then grab, release and grab again the WLOCK so we make * sure the update is propagated and nobody will be in. */ - ipfw_unhook(); -#ifdef INET6 - ipfw6_unhook(); -#endif + (void)ipfw_attach_hooks(0 /* detach */); V_ip_fw_chk_ptr = NULL; V_ip_fw_ctl_ptr = NULL; IPFW_UH_WLOCK(chain); Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_dynamic.c Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/netinet/ipfw/ip_fw_dynamic.c Mon Dec 28 10:47:04 2009 (r201122) @@ -1002,7 +1002,11 @@ ipfw_send_pkt(struct mbuf *replyto, stru h->ip_hl = sizeof(*h) >> 2; h->ip_tos = IPTOS_LOWDELAY; h->ip_off = 0; +#ifdef HAVE_NET_IPLEN /* XXX do we handle layer2 ? */ + h->ip_len = htons(len); +#else h->ip_len = len; +#endif h->ip_ttl = V_ip_defttl; h->ip_sum = 0; break; Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/netinet/ipfw/ip_fw_log.c Mon Dec 28 10:47:04 2009 (r201122) @@ -87,6 +87,12 @@ __FBSDID("$FreeBSD$"); #define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0 #define SNP(buf) buf, sizeof(buf) +#ifdef WITHOUT_BPF +void +ipfw_log_bpf(int onoff) +{ +} +#else /* !WITHOUT_BPF */ static struct ifnet *log_if; /* hook to attach to bpf */ /* we use this dummy function for all ifnet callbacks */ @@ -128,6 +134,7 @@ ipfw_log_bpf(int onoff) log_if = NULL; } } +#endif /* !WITHOUT_BPF */ /* * We enter here when we have a rule with O_LOG. @@ -138,12 +145,12 @@ ipfw_log(struct ip_fw *f, u_int hlen, st struct mbuf *m, struct ifnet *oif, u_short offset, uint32_t tablearg, struct ip *ip) { - struct ether_header *eh = args->eh; char *action; int limit_reached = 0; char action2[40], proto[128], fragment[32]; if (V_fw_verbose == 0) { +#ifndef WITHOUT_BPF struct m_hdr mh; if (log_if == NULL || log_if->if_bpf == NULL) @@ -160,16 +167,15 @@ ipfw_log(struct ip_fw *f, u_int hlen, st mh.mh_data = "DDDDDDSSSSSS\x08\x00"; if (args->f_id.addr_type == 4) { /* restore wire format */ - ip->ip_off = ntohs(ip->ip_off); - ip->ip_len = ntohs(ip->ip_len); + SET_NET_IPLEN(ip); } } BPF_MTAP(log_if, (struct mbuf *)&mh); if (args->eh == NULL && args->f_id.addr_type == 4) { /* restore host format */ - ip->ip_off = htons(ip->ip_off); - ip->ip_len = htons(ip->ip_len); + SET_HOST_IPLEN(ip); } +#endif /* !WITHOUT_BPF */ return; } /* the old 'log' function */ @@ -404,12 +410,15 @@ ipfw_log(struct ip_fw *f, u_int hlen, st #endif { int ip_off, ip_len; - if (eh != NULL) { /* layer 2 packets are as on the wire */ - ip_off = ntohs(ip->ip_off); - ip_len = ntohs(ip->ip_len); - } else { +#ifndef HAVE_NET_IPLEN + if (args->eh == NULL) { ip_off = ip->ip_off; ip_len = ip->ip_len; + } else +#endif /* !HAVE_NET_IPLEN */ + { + ip_off = ntohs(ip->ip_off); + ip_len = ntohs(ip->ip_len); } if (ip_off & (IP_MF | IP_OFFMASK)) snprintf(SNPARGS(fragment, 0), Modified: head/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_nat.c Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/netinet/ipfw/ip_fw_nat.c Mon Dec 28 10:47:04 2009 (r201122) @@ -29,14 +29,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include #include -#include -#include #include #define IPFW_INTERNAL /* Access to protected data structures in ip_fw.h. */ @@ -223,8 +220,7 @@ ipfw_nat(struct ip_fw_args *args, struct } ip = mtod(mcl, struct ip *); if (args->eh == NULL) { - ip->ip_len = htons(ip->ip_len); - ip->ip_off = htons(ip->ip_off); + SET_NET_IPLEN(ip); } /* @@ -302,11 +298,11 @@ ipfw_nat(struct ip_fw_args *args, struct struct udphdr *uh; u_short cksum; - ip->ip_len = ntohs(ip->ip_len); + /* XXX check if ip_len can stay in net format */ cksum = in_pseudo( ip->ip_src.s_addr, ip->ip_dst.s_addr, - htons(ip->ip_p + ip->ip_len - (ip->ip_hl << 2)) + htons(ip->ip_p + ntohs(ip->ip_len) - (ip->ip_hl << 2)) ); switch (ip->ip_p) { @@ -333,14 +329,10 @@ ipfw_nat(struct ip_fw_args *args, struct in_delayed_cksum(mcl); mcl->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } - ip->ip_len = htons(ip->ip_len); } - if (args->eh == NULL) { - ip->ip_len = ntohs(ip->ip_len); - ip->ip_off = ntohs(ip->ip_off); + SET_HOST_IPLEN(ip); } - args->m = mcl; return (IP_FW_NAT); } Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Mon Dec 28 10:19:53 2009 (r201121) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Mon Dec 28 10:47:04 2009 (r201122) @@ -46,9 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include @@ -64,8 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include static VNET_DEFINE(int, fw_enable) = 1; @@ -85,9 +81,7 @@ ip_divert_packet_t *ip_divert_ptr = NULL ng_ipfw_input_t *ng_ipfw_input_p = NULL; /* Forward declarations. */ -static int ipfw_divert(struct mbuf **, int, int); -#define DIV_DIR_IN 1 -#define DIV_DIR_OUT 0 +static void ipfw_divert(struct mbuf **, int, int); #ifdef SYSCTL_NODE SYSCTL_DECL(_net_inet_ip_fw); @@ -102,162 +96,32 @@ SYSCTL_VNET_PROC(_net_inet6_ip6_fw, OID_ #endif /* INET6 */ #endif /* SYSCTL_NODE */ -int -ipfw_check_in(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, - struct inpcb *inp) -{ - struct ip_fw_args args; - struct ng_ipfw_tag *ng_tag; - struct m_tag *dn_tag; - int ipfw = 0; - int divert; - int tee; -#ifdef IPFIREWALL_FORWARD - struct m_tag *fwd_tag; -#endif - - KASSERT(dir == PFIL_IN, ("ipfw_check_in wrong direction!")); - - bzero(&args, sizeof(args)); - - ng_tag = (struct ng_ipfw_tag *)m_tag_locate(*m0, NGM_IPFW_COOKIE, 0, - NULL); - if (ng_tag != NULL) { - KASSERT(ng_tag->dir == NG_IPFW_IN, - ("ng_ipfw tag with wrong direction")); - args.slot = ng_tag->slot; - args.rulenum = ng_tag->rulenum; - args.rule_id = ng_tag->rule_id; - args.chain_id = ng_tag->chain_id; - m_tag_delete(*m0, (struct m_tag *)ng_tag); - } - -again: - dn_tag = m_tag_find(*m0, PACKET_TAG_DUMMYNET, NULL); - if (dn_tag != NULL){ - struct dn_pkt_tag *dt; - - dt = (struct dn_pkt_tag *)(dn_tag+1); - args.slot = dt->slot; - args.rulenum = dt->rulenum; - args.rule_id = dt->rule_id; - args.chain_id = dt->chain_id; - m_tag_delete(*m0, dn_tag); - } - - args.m = *m0; - args.inp = inp; - tee = 0; - - if (V_fw_one_pass == 0 || args.slot == 0) { - ipfw = ipfw_chk(&args); - *m0 = args.m; - } else - ipfw = IP_FW_PASS; - - KASSERT(*m0 != NULL || ipfw == IP_FW_DENY, ("%s: m0 is NULL", - __func__)); - - switch (ipfw) { - case IP_FW_PASS: - if (args.next_hop == NULL) - goto pass; - -#ifdef IPFIREWALL_FORWARD - fwd_tag = m_tag_get(PACKET_TAG_IPFORWARD, - sizeof(struct sockaddr_in), M_NOWAIT); - if (fwd_tag == NULL) - goto drop; - bcopy(args.next_hop, (fwd_tag+1), sizeof(struct sockaddr_in)); - m_tag_prepend(*m0, fwd_tag); - - if (in_localip(args.next_hop->sin_addr)) - (*m0)->m_flags |= M_FASTFWD_OURS; - goto pass; -#endif - break; /* not reached */ - - case IP_FW_DENY: - goto drop; - break; /* not reached */ - - case IP_FW_DUMMYNET: - if (ip_dn_io_ptr == NULL) - goto drop; - if (mtod(*m0, struct ip *)->ip_v == 4) - ip_dn_io_ptr(m0, DN_TO_IP_IN, &args); - else if (mtod(*m0, struct ip *)->ip_v == 6) - ip_dn_io_ptr(m0, DN_TO_IP6_IN, &args); - if (*m0 != NULL) - goto again; - return 0; /* packet consumed */ - - case IP_FW_TEE: - tee = 1; - /* fall through */ - - case IP_FW_DIVERT: - divert = ipfw_divert(m0, DIV_DIR_IN, tee); - if (divert) { - *m0 = NULL; - return 0; /* packet consumed */ - } else { - args.slot = 0; - goto again; /* continue with packet */ - } - - case IP_FW_NGTEE: - if (!NG_IPFW_LOADED) - goto drop; - (void)ng_ipfw_input_p(m0, NG_IPFW_IN, &args, 1); - goto again; /* continue with packet */ - - case IP_FW_NETGRAPH: - if (!NG_IPFW_LOADED) - goto drop; - return ng_ipfw_input_p(m0, NG_IPFW_IN, &args, 0); - - case IP_FW_NAT: - goto again; /* continue with packet */ - - case IP_FW_REASS: - goto again; - - default: - KASSERT(0, ("%s: unknown retval", __func__)); - } - -drop: - if (*m0) - m_freem(*m0); - *m0 = NULL; - return (EACCES); -pass: - return 0; /* not filtered */ -} - -int -ipfw_check_out(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, +/* + * The pfilter hook to pass packets to ipfw_chk and then to + * dummynet, divert, netgraph or other modules. + * The packet may be consumed. + */ +static int +ipfw_check_hook(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, struct inpcb *inp) { struct ip_fw_args args; struct ng_ipfw_tag *ng_tag; struct m_tag *dn_tag; - int ipfw = 0; - int divert; - int tee; + int ipfw; + int ret; #ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; #endif - KASSERT(dir == PFIL_OUT, ("ipfw_check_out wrong direction!")); - + /* convert dir to IPFW values */ + dir = (dir == PFIL_IN) ? DIR_IN : DIR_OUT; bzero(&args, sizeof(args)); ng_tag = (struct ng_ipfw_tag *)m_tag_locate(*m0, NGM_IPFW_COOKIE, 0, NULL); if (ng_tag != NULL) { - KASSERT(ng_tag->dir == NG_IPFW_OUT, + KASSERT(ng_tag->dir == dir, ("ng_ipfw tag with wrong direction")); args.slot = ng_tag->slot; args.rulenum = ng_tag->rulenum; @@ -280,9 +144,8 @@ again: } args.m = *m0; - args.oif = ifp; + args.oif = dir == DIR_OUT ? ifp : NULL; args.inp = inp; - tee = 0; if (V_fw_one_pass == 0 || args.slot == 0) { ipfw = ipfw_chk(&args); @@ -293,255 +156,209 @@ again: KASSERT(*m0 != NULL || ipfw == IP_FW_DENY, ("%s: m0 is NULL", __func__)); + /* breaking out of the switch means drop */ + ret = 0; /* default return value for pass */ switch (ipfw) { case IP_FW_PASS: + /* next_hop may be set by ipfw_chk */ if (args.next_hop == NULL) - goto pass; -#ifdef IPFIREWALL_FORWARD - /* Overwrite existing tag. */ - fwd_tag = m_tag_find(*m0, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag == NULL) { + break; /* pass */ +#ifndef IPFIREWALL_FORWARD + ret = EACCES; +#else + /* Incoming packets should not be tagged so we do not + * m_tag_find. Outgoing packets may be tagged, so we + * reuse the tag if present. + */ + fwd_tag = (dir == DIR_IN) ? NULL : + m_tag_find(*m0, PACKET_TAG_IPFORWARD, NULL); + if (fwd_tag != NULL) { + m_tag_unlink(*m0, fwd_tag); + } else { fwd_tag = m_tag_get(PACKET_TAG_IPFORWARD, sizeof(struct sockaddr_in), M_NOWAIT); - if (fwd_tag == NULL) - goto drop; - } else - m_tag_unlink(*m0, fwd_tag); + if (fwd_tag == NULL) { + ret = EACCES; + break; /* i.e. drop */ + } + } bcopy(args.next_hop, (fwd_tag+1), sizeof(struct sockaddr_in)); m_tag_prepend(*m0, fwd_tag); if (in_localip(args.next_hop->sin_addr)) (*m0)->m_flags |= M_FASTFWD_OURS; - goto pass; #endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 10:48:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09192106566B; Mon, 28 Dec 2009 10:48:02 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE4028FC24; Mon, 28 Dec 2009 10:48:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSAm1JZ088200; Mon, 28 Dec 2009 10:48:01 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSAm1G3088198; Mon, 28 Dec 2009 10:48:01 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912281048.nBSAm1G3088198@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 28 Dec 2009 10:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201123 - head/lib/libnetgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 10:48:02 -0000 Author: luigi Date: Mon Dec 28 10:48:01 2009 New Revision: 201123 URL: http://svn.freebsd.org/changeset/base/201123 Log: this file is also affected by the ipfw changes Modified: head/lib/libnetgraph/debug.c Modified: head/lib/libnetgraph/debug.c ============================================================================== --- head/lib/libnetgraph/debug.c Mon Dec 28 10:47:04 2009 (r201122) +++ head/lib/libnetgraph/debug.c Mon Dec 28 10:48:01 2009 (r201123) @@ -76,6 +76,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include /* the NGM cookie is here */ #include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 12:29:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50A18106568F; Mon, 28 Dec 2009 12:29:14 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26A3E8FC22; Mon, 28 Dec 2009 12:29:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSCTE9v090328; Mon, 28 Dec 2009 12:29:14 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSCTEhX090323; Mon, 28 Dec 2009 12:29:14 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912281229.nBSCTEhX090323@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 28 Dec 2009 12:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201124 - in head: lib/libnetgraph sys/netgraph sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 12:29:14 -0000 Author: luigi Date: Mon Dec 28 12:29:13 2009 New Revision: 201124 URL: http://svn.freebsd.org/changeset/base/201124 Log: bring the NGM_IPFW_COOKIE back into ng_ipfw.h, libnetgraph expects to find it there. Unfortunately this reintroduces the dependency on ip_fw_pfil.c Modified: head/lib/libnetgraph/debug.c head/sys/netgraph/ng_ipfw.h head/sys/netinet/ipfw/ip_fw_pfil.c head/sys/netinet/ipfw/ip_fw_private.h Modified: head/lib/libnetgraph/debug.c ============================================================================== --- head/lib/libnetgraph/debug.c Mon Dec 28 10:48:01 2009 (r201123) +++ head/lib/libnetgraph/debug.c Mon Dec 28 12:29:13 2009 (r201124) @@ -76,8 +76,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include /* the NGM cookie is here */ #include #include #include Modified: head/sys/netgraph/ng_ipfw.h ============================================================================== --- head/sys/netgraph/ng_ipfw.h Mon Dec 28 10:48:01 2009 (r201123) +++ head/sys/netgraph/ng_ipfw.h Mon Dec 28 12:29:13 2009 (r201124) @@ -29,4 +29,5 @@ #ifndef _NG_IPFW_H #define _NG_IPFW_H #define NG_IPFW_NODE_TYPE "ipfw" +#define NGM_IPFW_COOKIE 1105988990 #endif /* _NG_IPFW_H */ Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Mon Dec 28 10:48:01 2009 (r201123) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Mon Dec 28 12:29:13 2009 (r201124) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/netinet/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netinet/ipfw/ip_fw_private.h Mon Dec 28 10:48:01 2009 (r201123) +++ head/sys/netinet/ipfw/ip_fw_private.h Mon Dec 28 12:29:13 2009 (r201124) @@ -272,7 +272,6 @@ extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; /* netgraph prototypes */ -#define NGM_IPFW_COOKIE 1105988990 typedef int ng_ipfw_input_t(struct mbuf **, int, struct ip_fw_args *, int); extern ng_ipfw_input_t *ng_ipfw_input_p; From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 12:37:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC903106566B; Mon, 28 Dec 2009 12:37:10 +0000 (UTC) (envelope-from rbgarga@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id DD9648FC17; Mon, 28 Dec 2009 12:37:09 +0000 (UTC) Received: by ewy26 with SMTP id 26so7281896ewy.3 for ; Mon, 28 Dec 2009 04:36:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=igRs9RCp0ok5saQeHsiXBBI0uq/oL9UT2vt+mutaWVg=; b=rnHT8GekjpBuT2NGLeTgtRvy2ONESKFU4Sk5c+9wIbmuztMCKk+IDXVVaVIH4fDUTS bL8ExBBgvHIBfMJSsJt91l9fnKZNo23/CBP/tmLyuVv6p1B/kYC5Vz4xi8qOGW/BJ5Vy 5unb95X6tJypkcdH5e/Ti/ROg16fm7g8BPWs4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=m43XJ9QP2XLMdMg52doAbJSJsme2zh1F768dM1gRppYZZ68opM7a5UQKLd6q3ZFw9G alyGdnhnIH1Ej5//n3cBNSXFjn5hzeGJvQdxW2hHC+EzP0DolFjG7kDouQ9L+3wJschD 3NyueVpGsOmyCpm9vVzEna2vytx/3wkl74PuA= MIME-Version: 1.0 Received: by 10.216.88.143 with SMTP id a15mr5459486wef.206.1262003819203; Mon, 28 Dec 2009 04:36:59 -0800 (PST) In-Reply-To: <200912281048.nBSAm1G3088198@svn.freebsd.org> References: <200912281048.nBSAm1G3088198@svn.freebsd.org> From: Renato Botelho Date: Mon, 28 Dec 2009 10:36:39 -0200 Message-ID: <747dc8f30912280436n65e3bdf8g4bd931cb37fbaffe@mail.gmail.com> To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201123 - head/lib/libnetgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 12:37:10 -0000 On Mon, Dec 28, 2009 at 8:48 AM, Luigi Rizzo wrote: > Author: luigi > Date: Mon Dec 28 10:48:01 2009 > New Revision: 201123 > URL: http://svn.freebsd.org/changeset/base/201123 > > Log: > =A0this file is also affected by the ipfw changes > > Modified: > =A0head/lib/libnetgraph/debug.c > > Modified: head/lib/libnetgraph/debug.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/lib/libnetgraph/debug.c =A0 =A0 =A0 =A0Mon Dec 28 10:47:04 2009 = =A0 =A0 =A0 =A0(r201122) > +++ head/lib/libnetgraph/debug.c =A0 =A0 =A0 =A0Mon Dec 28 10:48:01 2009 = =A0 =A0 =A0 =A0(r201123) > @@ -76,6 +76,8 @@ __FBSDID("$FreeBSD$"); > =A0#include > =A0#include > =A0#include > +#include > +#include /* the NGM cookie is here */ > =A0#include > =A0#include > =A0#include > _______________________________________________ > 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" > After this commit i got this error: root@botelhor:/usr/src/lib/libnetgraph# make depend rm -f .depend mkdep -f .depend -a /usr/src/lib/libnetgraph/sock.c /usr/src/lib/libnetgraph/msg.c /usr/src/lib/libnetgraph/debug.c /usr/src/lib/libnetgraph/debug.c:80:64: error: netinet/ip_fw_private.h: No such file or directory mkdep: compile failed *** Error code 1 Stop in /usr/src/lib/libnetgraph. I noted ip_fw_private.h is under netinet/ipfw subdir, and this dir is not o= n LDIRS in /usr/src/include/Makefile. I'll try to fix my local build and report you if I have success. Regards --=20 Renato Botelho From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 14:09:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C18051065695; Mon, 28 Dec 2009 14:09:46 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A64A58FC34; Mon, 28 Dec 2009 14:09:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSE9kjl092226; Mon, 28 Dec 2009 14:09:46 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSE9kUt092224; Mon, 28 Dec 2009 14:09:46 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912281409.nBSE9kUt092224@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 28 Dec 2009 14:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201125 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 14:09:46 -0000 Author: luigi Date: Mon Dec 28 14:09:46 2009 New Revision: 201125 URL: http://svn.freebsd.org/changeset/base/201125 Log: + remove an unused #define print_ip; + remove two unnecessary initializations in ip_output; + localize 'len'; + introduce a temporary variable n to count the number of fragments, the compiler seems unable to identify a common subexpression (written 3 times, used twice); + document some assumptions on ip_len and ip_hl Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Dec 28 12:29:13 2009 (r201124) +++ head/sys/netinet/ip_output.c Mon Dec 28 14:09:46 2009 (r201125) @@ -84,12 +84,6 @@ __FBSDID("$FreeBSD$"); #include -#define print_ip(x, a, y) printf("%s %d.%d.%d.%d%s",\ - x, (ntohl(a.s_addr)>>24)&0xFF,\ - (ntohl(a.s_addr)>>16)&0xFF,\ - (ntohl(a.s_addr)>>8)&0xFF,\ - (ntohl(a.s_addr))&0xFF, y); - VNET_DEFINE(u_short, ip_id); #ifdef MBUF_STRESS_TEST @@ -108,6 +102,7 @@ extern struct protosw inetsw[]; /* * IP output. The packet in mbuf chain m contains a skeletal IP * header (with len, off, ttl, proto, tos, src, dst). + * ip_len and ip_off are in host format. * The mbuf chain containing the packet will be freed. * The mbuf opt, if present, will not be freed. * In the IP forwarding case, the packet will arrive with options already @@ -118,13 +113,14 @@ ip_output(struct mbuf *m, struct mbuf *o struct ip_moptions *imo, struct inpcb *inp) { struct ip *ip; - struct ifnet *ifp = NULL; /* keep compiler happy */ + struct ifnet *ifp; struct mbuf *m0; int hlen = sizeof (struct ip); int mtu; - int len, error = 0; + int n; /* scratchpad */ + int error = 0; int nortfree = 0; - struct sockaddr_in *dst = NULL; /* keep compiler happy */ + struct sockaddr_in *dst; struct in_ifaddr *ia = NULL; int isbroadcast, sw_csum; struct route iproute; @@ -163,10 +159,10 @@ ip_output(struct mbuf *m, struct mbuf *o } if (opt) { - len = 0; + int len = 0; m = ip_insertoptions(m, opt, &len); if (len != 0) - hlen = len; + hlen = len; /* ip->ip_hl is updated above */ } ip = mtod(m, struct ip *); @@ -187,6 +183,7 @@ ip_output(struct mbuf *m, struct mbuf *o ip->ip_id = ip_newid(); IPSTAT_INC(ips_localout); } else { + /* Header already set, fetch hlen from there */ hlen = ip->ip_hl << 2; } @@ -425,18 +422,15 @@ again: * packet or packet fragments, unless ALTQ is enabled on the given * interface in which case packetdrop should be done by queueing. */ + n = ip->ip_len / mtu + 1; /* how many fragments ? */ + if ( #ifdef ALTQ - if ((!ALTQ_IS_ENABLED(&ifp->if_snd)) && - ((ifp->if_snd.ifq_len + ip->ip_len / mtu + 1) >= - ifp->if_snd.ifq_maxlen)) -#else - if ((ifp->if_snd.ifq_len + ip->ip_len / mtu + 1) >= - ifp->if_snd.ifq_maxlen) + (!ALTQ_IS_ENABLED(&ifp->if_snd)) && #endif /* ALTQ */ - { + (ifp->if_snd.ifq_len + n) >= ifp->if_snd.ifq_maxlen ) { error = ENOBUFS; IPSTAT_INC(ips_odropped); - ifp->if_snd.ifq_drops += (ip->ip_len / ifp->if_mtu + 1); + ifp->if_snd.ifq_drops += n; goto bad; } From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 14:16:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D39E106566B; Mon, 28 Dec 2009 14:16:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6259B8FC12; Mon, 28 Dec 2009 14:16:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSEGepN092470; Mon, 28 Dec 2009 14:16:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSEGeUR092468; Mon, 28 Dec 2009 14:16:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912281416.nBSEGeUR092468@svn.freebsd.org> From: Marius Strobl Date: Mon, 28 Dec 2009 14:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201126 - head/sys/sparc64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 14:16:40 -0000 Author: marius Date: Mon Dec 28 14:16:40 2009 New Revision: 201126 URL: http://svn.freebsd.org/changeset/base/201126 Log: Account for firmware versions which include the CDMA interrupts in the OFW device tree. MFC after: 3 days Modified: head/sys/sparc64/pci/schizo.c Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Mon Dec 28 14:09:46 2009 (r201125) +++ head/sys/sparc64/pci/schizo.c Mon Dec 28 14:16:40 2009 (r201126) @@ -628,31 +628,44 @@ schizo_attach(device_t dev) /* * According to the Schizo Errata I-13, consistent DMA flushing/ * syncing is FUBAR in version < 5 (i.e. revision < 2.3) bridges, - * so we can't use it and need to live with the consequences. - * With Schizo version >= 5, CDMA flushing/syncing is usable - * but requires the the workaround described in Schizo Errata - * I-23. With Tomatillo and XMITS, CDMA flushing/syncing works - * as expected, Tomatillo version <= 4 (i.e. revision <= 2.3) - * bridges additionally require a block store after a write to - * TOMXMS_PCI_DMA_SYNC_PEND though. + * so we can't use it and need to live with the consequences. With + * Schizo version >= 5, CDMA flushing/syncing is usable but requires + * the workaround described in Schizo Errata I-23. With Tomatillo + * and XMITS, CDMA flushing/syncing works as expected, Tomatillo + * version <= 4 (i.e. revision <= 2.3) bridges additionally require + * a block store after a write to TOMXMS_PCI_DMA_SYNC_PEND though. */ if ((sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver >= 5) || sc->sc_mode == SCHIZO_MODE_TOM || sc->sc_mode == SCHIZO_MODE_XMS) { sc->sc_flags |= SCHIZO_FLAGS_CDMA; if (sc->sc_mode == SCHIZO_MODE_SCZ) { - n = STX_CDMA_A_INO + sc->sc_half; - if (bus_set_resource(dev, SYS_RES_IRQ, 5, - INTMAP_VEC(sc->sc_ign, n), 1) != 0) - panic("%s: failed to add CDMA interrupt", - __func__); - i = schizo_intr_register(sc, n); - if (i != 0) - panic("%s: could not register interrupt " - "controller for CDMA (%d)", __func__, i); - (void)schizo_get_intrmap(sc, n, NULL, - &sc->sc_cdma_clr); sc->sc_cdma_state = SCHIZO_CDMA_STATE_DONE; - schizo_set_intr(sc, 5, n, schizo_cdma); + /* + * Some firmware versions include the CDMA interrupt + * at RID 4 but most don't. With the latter we add + * it ourselves at the spare RID 5. + */ + n = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, + 4)); + if (n == STX_CDMA_A_INO || n == STX_CDMA_B_INO) { + (void)schizo_get_intrmap(sc, n, NULL, + &sc->sc_cdma_clr); + schizo_set_intr(sc, 4, n, schizo_cdma); + } else { + n = STX_CDMA_A_INO + sc->sc_half; + if (bus_set_resource(dev, SYS_RES_IRQ, 5, + INTMAP_VEC(sc->sc_ign, n), 1) != 0) + panic("%s: failed to add CDMA " + "interrupt", __func__); + i = schizo_intr_register(sc, n); + if (i != 0) + panic("%s: could not register " + "interrupt controller for CDMA " + "(%d)", __func__, i); + (void)schizo_get_intrmap(sc, n, NULL, + &sc->sc_cdma_clr); + schizo_set_intr(sc, 5, n, schizo_cdma); + } } if (sc->sc_mode == SCHIZO_MODE_TOM && sc->sc_ver <= 4) sc->sc_flags |= SCHIZO_FLAGS_BSWAR; From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 14:48:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97C29106568D; Mon, 28 Dec 2009 14:48:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 862F98FC15; Mon, 28 Dec 2009 14:48:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSEmWRZ093353; Mon, 28 Dec 2009 14:48:32 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSEmWmB093351; Mon, 28 Dec 2009 14:48:32 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912281448.nBSEmWmB093351@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 28 Dec 2009 14:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201131 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 14:48:32 -0000 Author: luigi Date: Mon Dec 28 14:48:32 2009 New Revision: 201131 URL: http://svn.freebsd.org/changeset/base/201131 Log: introduce a local variable rte acting as a cache of ro->ro_rt within ip_output, achieving (in random order of importance): - a reduction of the number of 'r's in the source code; - improved legibility; - a reduction of 64 bytes in the .text Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Dec 28 14:47:25 2009 (r201130) +++ head/sys/netinet/ip_output.c Mon Dec 28 14:48:32 2009 (r201131) @@ -124,6 +124,7 @@ ip_output(struct mbuf *m, struct mbuf *o struct in_ifaddr *ia = NULL; int isbroadcast, sw_csum; struct route iproute; + struct rtentry *rte; /* cache for ro->ro_rt */ struct in_addr odst; #ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag = NULL; @@ -196,18 +197,19 @@ again: * The address family should also be checked in case of sharing the * cache with IPv6. */ - if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 || + rte = ro->ro_rt; + if (rte && ((rte->rt_flags & RTF_UP) == 0 || dst->sin_family != AF_INET || dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { if (!nortfree) - RTFREE(ro->ro_rt); - ro->ro_rt = (struct rtentry *)NULL; + RTFREE(rte); + rte = ro->ro_rt = (struct rtentry *)NULL; ro->ro_lle = (struct llentry *)NULL; } #ifdef IPFIREWALL_FORWARD - if (ro->ro_rt == NULL && fwd_tag == NULL) { + if (rte == NULL && fwd_tag == NULL) { #else - if (ro->ro_rt == NULL) { + if (rte == NULL) { #endif bzero(dst, sizeof(*dst)); dst->sin_family = AF_INET; @@ -257,7 +259,7 @@ again: * as this is probably required in all cases for correct * operation (as it is for ARP). */ - if (ro->ro_rt == NULL) + if (rte == NULL) { #ifdef RADIX_MPATH rtalloc_mpath_fib(ro, ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr), @@ -266,7 +268,9 @@ again: in_rtalloc_ign(ro, 0, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); #endif - if (ro->ro_rt == NULL) { + rte = ro->ro_rt; + } + if (rte == NULL) { #ifdef IPSEC /* * There is no route for this packet, but it is @@ -280,14 +284,14 @@ again: error = EHOSTUNREACH; goto bad; } - ia = ifatoia(ro->ro_rt->rt_ifa); + ia = ifatoia(rte->rt_ifa); ifa_ref(&ia->ia_ifa); - ifp = ro->ro_rt->rt_ifp; - ro->ro_rt->rt_rmx.rmx_pksent++; - if (ro->ro_rt->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway; - if (ro->ro_rt->rt_flags & RTF_HOST) - isbroadcast = (ro->ro_rt->rt_flags & RTF_BROADCAST); + ifp = rte->rt_ifp; + rte->rt_rmx.rmx_pksent++; + if (rte->rt_flags & RTF_GATEWAY) + dst = (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); } @@ -295,7 +299,7 @@ again: * Calculate MTU. If we have a route that is up, use that, * otherwise use the interface's MTU. */ - if (ro->ro_rt != NULL && (ro->ro_rt->rt_flags & (RTF_UP|RTF_HOST))) { + if (rte != NULL && (rte->rt_flags & (RTF_UP|RTF_HOST))) { /* * This case can happen if the user changed the MTU * of an interface after enabling IP on it. Because @@ -303,9 +307,9 @@ again: * them, there is no way for one to update all its * routes when the MTU is changed. */ - if (ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu) - ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu; - mtu = ro->ro_rt->rt_rmx.rmx_mtu; + if (rte->rt_rmx.rmx_mtu > ifp->if_mtu) + rte->rt_rmx.rmx_mtu = ifp->if_mtu; + mtu = rte->rt_rmx.rmx_mtu; } else { mtu = ifp->if_mtu; } From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 15:35:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A58DC106566B; Mon, 28 Dec 2009 15:35:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A59F8FC16; Mon, 28 Dec 2009 15:35:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSFZdaj094489; Mon, 28 Dec 2009 15:35:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSFZdBi094487; Mon, 28 Dec 2009 15:35:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912281535.nBSFZdBi094487@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Dec 2009 15:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201134 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 15:35:39 -0000 Author: kib Date: Mon Dec 28 15:35:39 2009 New Revision: 201134 URL: http://svn.freebsd.org/changeset/base/201134 Log: Add a knob to allow reclaim of the directory vnodes that are source of the namecache records. The reclamation is not enabled by default because for typical workload it would make namecache unusable, but large nested directory tree easily puts any process that accesses filesystem into 1 second wait for vlru. Reported by: yar (long time ago) MFC after: 3 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Dec 28 15:06:44 2009 (r201133) +++ head/sys/kern/vfs_subr.c Mon Dec 28 15:35:39 2009 (r201134) @@ -152,6 +152,10 @@ SYSCTL_LONG(_vfs, OID_AUTO, wantfreevnod static u_long freevnodes; SYSCTL_LONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, &freevnodes, 0, ""); +static int vlru_allow_cache_src; +SYSCTL_INT(_vfs, OID_AUTO, vlru_allow_cache_src, CTLFLAG_RW, + &vlru_allow_cache_src, 0, "Allow vlru to reclaim source vnode"); + /* * Various variables used for debugging the new implementation of * reassignbuf(). @@ -643,7 +647,9 @@ vlrureclaim(struct mount *mp) * If it's been deconstructed already, it's still * referenced, or it exceeds the trigger, skip it. */ - if (vp->v_usecount || !LIST_EMPTY(&(vp)->v_cache_src) || + if (vp->v_usecount || + (!vlru_allow_cache_src && + !LIST_EMPTY(&(vp)->v_cache_src)) || (vp->v_iflag & VI_DOOMED) != 0 || (vp->v_object != NULL && vp->v_object->resident_page_count > trigger)) { VI_UNLOCK(vp); @@ -668,7 +674,9 @@ vlrureclaim(struct mount *mp) * interlock, the other thread will be unable to drop the * vnode lock before our VOP_LOCK() call fails. */ - if (vp->v_usecount || !LIST_EMPTY(&(vp)->v_cache_src) || + if (vp->v_usecount || + (!vlru_allow_cache_src && + !LIST_EMPTY(&(vp)->v_cache_src)) || (vp->v_object != NULL && vp->v_object->resident_page_count > trigger)) { VOP_UNLOCK(vp, LK_INTERLOCK); From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 17:57:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B06F11065694; Mon, 28 Dec 2009 17:57:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5FF8FC19; Mon, 28 Dec 2009 17:57:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSHvbiE097179; Mon, 28 Dec 2009 17:57:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSHvbsA097175; Mon, 28 Dec 2009 17:57:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912281757.nBSHvbsA097175@svn.freebsd.org> From: Xin LI Date: Mon, 28 Dec 2009 17:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201135 - in head: sbin/umount usr.sbin/rpc.umntall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 17:57:37 -0000 Author: delphij Date: Mon Dec 28 17:57:37 2009 New Revision: 201135 URL: http://svn.freebsd.org/changeset/base/201135 Log: Make umount(8) WARNS=6 clean: - Cast delimiter width to integer [1] - Solve name conflicts against system header - Constify parameters to avoid qualifier conflict PR: bin/140017 [1] Submitted by: Ulrich SpĂśrlein [1] MFC after: 1 month Sponsored by: iXsystems, Inc Modified: head/sbin/umount/Makefile head/sbin/umount/umount.c head/usr.sbin/rpc.umntall/mounttab.c Modified: head/sbin/umount/Makefile ============================================================================== --- head/sbin/umount/Makefile Mon Dec 28 15:35:39 2009 (r201134) +++ head/sbin/umount/Makefile Mon Dec 28 17:57:37 2009 (r201135) @@ -4,7 +4,6 @@ PROG= umount SRCS= umount.c vfslist.c mounttab.c -WARNS?= 0 MAN= umount.8 MOUNT= ${.CURDIR}/../mount Modified: head/sbin/umount/umount.c ============================================================================== --- head/sbin/umount/umount.c Mon Dec 28 15:35:39 2009 (r201134) +++ head/sbin/umount/umount.c Mon Dec 28 17:57:37 2009 (r201135) @@ -75,7 +75,7 @@ char **makevfslist (const char *); size_t mntinfo (struct statfs **); int namematch (struct addrinfo *); int parsehexfsid(const char *hex, fsid_t *fsid); -int sacmp (struct sockaddr *, struct sockaddr *); +int sacmp (void *, void *); int umountall (char **); int checkname (char *, char **); int umountfs(struct statfs *sfs); @@ -225,7 +225,7 @@ umountall(char **typelist) * Do magic checks on mountpoint/device/fsid, and then call unmount(2). */ int -checkname(char *name, char **typelist) +checkname(char *mntname, char **typelist) { char buf[MAXPATHLEN]; struct statfs sfsbuf; @@ -238,25 +238,25 @@ checkname(char *name, char **typelist) /* * 1. Check if the name exists in the mounttable. */ - sfs = checkmntlist(name); + sfs = checkmntlist(mntname); /* * 2. Remove trailing slashes if there are any. After that * we look up the name in the mounttable again. */ if (sfs == NULL) { - len = strlen(name); - while (len > 1 && name[len - 1] == '/') - name[--len] = '\0'; - sfs = checkmntlist(name); + len = strlen(mntname); + while (len > 1 && mntname[len - 1] == '/') + mntname[--len] = '\0'; + sfs = checkmntlist(mntname); } /* * 3. Check if the deprecated NFS syntax with an '@' has been used * and translate it to the ':' syntax. Look up the name in the * mount table again. */ - if (sfs == NULL && (delimp = strrchr(name, '@')) != NULL) { - snprintf(buf, sizeof(buf), "%s:%.*s", delimp + 1, delimp - name, - name); + if (sfs == NULL && (delimp = strrchr(mntname, '@')) != NULL) { + snprintf(buf, sizeof(buf), "%s:%.*s", delimp + 1, + (int)(delimp - mntname), mntname); len = strlen(buf); while (len > 1 && buf[len - 1] == '/') buf[--len] = '\0'; @@ -271,28 +271,28 @@ checkname(char *name, char **typelist) * mount list and reality. * We also do this if an ambiguous mount point was specified. */ - if (sfs == NULL || (getmntentry(NULL, name, NULL, FIND) != NULL && - getmntentry(NULL, name, NULL, CHECKUNIQUE) == NULL)) { - if (statfs(name, &sfsbuf) != 0) { - warn("%s: statfs", name); - } else if (stat(name, &sb) != 0) { - warn("%s: stat", name); + if (sfs == NULL || (getmntentry(NULL, mntname, NULL, FIND) != NULL && + getmntentry(NULL, mntname, NULL, CHECKUNIQUE) == NULL)) { + if (statfs(mntname, &sfsbuf) != 0) { + warn("%s: statfs", mntname); + } else if (stat(mntname, &sb) != 0) { + warn("%s: stat", mntname); } else if (S_ISDIR(sb.st_mode)) { - /* Check that `name' is the root directory. */ + /* Check that `mntname' is the root directory. */ dev = sb.st_dev; - snprintf(buf, sizeof(buf), "%s/..", name); + snprintf(buf, sizeof(buf), "%s/..", mntname); if (stat(buf, &sb) != 0) { warn("%s: stat", buf); } else if (sb.st_dev == dev) { warnx("%s: not a file system root directory", - name); + mntname); return (1); } else sfs = &sfsbuf; } } if (sfs == NULL) { - warnx("%s: unknown file system", name); + warnx("%s: unknown file system", mntname); return (1); } if (checkvfsname(sfs->f_fstypename, typelist)) @@ -469,15 +469,16 @@ getmntentry(const char *fromname, const } int -sacmp(struct sockaddr *sa1, struct sockaddr *sa2) +sacmp(void *sa1, void *sa2) { void *p1, *p2; int len; - if (sa1->sa_family != sa2->sa_family) + if (((struct sockaddr *)sa1)->sa_family != + ((struct sockaddr *)sa2)->sa_family) return (1); - switch (sa1->sa_family) { + switch (((struct sockaddr *)sa1)->sa_family) { case AF_INET: p1 = &((struct sockaddr_in *)sa1)->sin_addr; p2 = &((struct sockaddr_in *)sa2)->sin_addr; @@ -520,18 +521,18 @@ namematch(struct addrinfo *ai) } struct statfs * -checkmntlist(char *name) +checkmntlist(char *mntname) { struct statfs *sfs; fsid_t fsid; sfs = NULL; - if (parsehexfsid(name, &fsid) == 0) + if (parsehexfsid(mntname, &fsid) == 0) sfs = getmntentry(NULL, NULL, &fsid, FIND); if (sfs == NULL) - sfs = getmntentry(NULL, name, NULL, FIND); + sfs = getmntentry(NULL, mntname, NULL, FIND); if (sfs == NULL) - sfs = getmntentry(name, NULL, NULL, FIND); + sfs = getmntentry(mntname, NULL, NULL, FIND); return (sfs); } Modified: head/usr.sbin/rpc.umntall/mounttab.c ============================================================================== --- head/usr.sbin/rpc.umntall/mounttab.c Mon Dec 28 15:35:39 2009 (r201134) +++ head/usr.sbin/rpc.umntall/mounttab.c Mon Dec 28 17:57:37 2009 (r201135) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); struct mtablist *mtabhead; -static void badline(char *field, char *bad); +static void badline(const char *field, const char *bad); /* * Add an entry to PATH_MOUNTTAB for each mounted NFS filesystem, @@ -69,12 +69,12 @@ add_mtab(char *hostp, char *dirp) { * Read mounttab line for line and return struct mtablist. */ int -read_mtab() { +read_mtab(void) { struct mtablist **mtabpp, *mtabp; char *hostp, *dirp, *cp; char str[STRSIZ]; char *timep, *endp; - time_t time; + time_t actiontime; u_long ultmp; FILE *mtabfile; @@ -86,7 +86,7 @@ read_mtab() { return (0); } } - time = 0; + actiontime = 0; mtabpp = &mtabhead; while (fgets(str, STRSIZ, mtabfile) != NULL) { cp = str; @@ -113,13 +113,13 @@ read_mtab() { badline("time", timep); continue; } - time = ultmp; + actiontime = ultmp; if ((mtabp = malloc(sizeof (struct mtablist))) == NULL) { syslog(LOG_ERR, "malloc"); fclose(mtabfile); return (0); } - mtabp->mtab_time = time; + mtabp->mtab_time = actiontime; memmove(mtabp->mtab_host, hostp, MNTNAMLEN); mtabp->mtab_host[MNTNAMLEN - 1] = '\0'; memmove(mtabp->mtab_dirp, dirp, MNTPATHLEN); @@ -218,7 +218,7 @@ free_mtab() { * Print bad lines to syslog. */ static void -badline(char *field, char *bad) { +badline(const char *field, const char *bad) { syslog(LOG_ERR, "bad mounttab %s field '%s'", field, (bad == NULL) ? "" : bad); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 18:51:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF78D1065692; Mon, 28 Dec 2009 18:51:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF33E8FC12; Mon, 28 Dec 2009 18:51:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSIpQQ8098506; Mon, 28 Dec 2009 18:51:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSIpQta098504; Mon, 28 Dec 2009 18:51:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912281851.nBSIpQta098504@svn.freebsd.org> From: Xin LI Date: Mon, 28 Dec 2009 18:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201137 - head/lib/libexpat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 18:51:26 -0000 Author: delphij Date: Mon Dec 28 18:51:26 2009 New Revision: 201137 URL: http://svn.freebsd.org/changeset/base/201137 Log: Grammar fix. Submitted by: Kenyon Ralph MFC after: 1 week Modified: head/lib/libexpat/libbsdxml.3 Modified: head/lib/libexpat/libbsdxml.3 ============================================================================== --- head/lib/libexpat/libbsdxml.3 Mon Dec 28 18:32:50 2009 (r201136) +++ head/lib/libexpat/libbsdxml.3 Mon Dec 28 18:51:26 2009 (r201137) @@ -40,7 +40,7 @@ library is a verbatim copy of the eXpat .Pp The .Nm -library is intended to use within the +library is intended to be used within the .Fx base system only. Use of the From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 18:59:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B0501065672; Mon, 28 Dec 2009 18:59:13 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A5638FC39; Mon, 28 Dec 2009 18:59:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSIxD0i098684; Mon, 28 Dec 2009 18:59:13 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSIxDqS098682; Mon, 28 Dec 2009 18:59:13 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <200912281859.nBSIxDqS098682@svn.freebsd.org> From: "Justin T. Gibbs" Date: Mon, 28 Dec 2009 18:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201138 - head/sys/dev/xen/blkfront X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 18:59:13 -0000 Author: gibbs Date: Mon Dec 28 18:59:13 2009 New Revision: 201138 URL: http://svn.freebsd.org/changeset/base/201138 Log: Correct alignment and boundary constraints in blkfront's bus dma tag. The blkif interface in Xen requires all I/O to be 512 byte aligned with each segment bounded by a 4k page. Note: This submission only documents the proper contraints for blkif I/O. The alignment code in busdma does not yet handle alignment constraints correctly in all cases. Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Mon Dec 28 18:51:26 2009 (r201137) +++ head/sys/dev/xen/blkfront/blkfront.c Mon Dec 28 18:59:13 2009 (r201138) @@ -450,7 +450,7 @@ blkfront_attach(device_t dev) /* Allocate parent DMA tag */ if (bus_dma_tag_create( NULL, /* parent */ - 4096, 0, /* algnmnt, boundary */ + 512, 4096, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ @@ -733,7 +733,7 @@ connect(struct xb_softc *sc) /** * Handle the change of state of the backend to Closing. We must delete our * device-layer structures now, to ensure that writes are flushed through to - * the backend. Once is this done, we can switch to Closed in + * the backend. Once this is done, we can switch to Closed in * acknowledgement. */ static void From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 19:08:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51532106566B; Mon, 28 Dec 2009 19:08:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 23C9F8FC17; Mon, 28 Dec 2009 19:08:54 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id CB2C946B46; Mon, 28 Dec 2009 14:08:53 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 8D0E98A01D; Mon, 28 Dec 2009 14:08:52 -0500 (EST) From: John Baldwin To: Jack F Vogel Date: Mon, 28 Dec 2009 13:57:04 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200911111913.nABJDewR004319@svn.freebsd.org> In-Reply-To: <200911111913.nABJDewR004319@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912281357.04461.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 28 Dec 2009 14:08:52 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199192 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 19:08:54 -0000 On Wednesday 11 November 2009 2:13:40 pm Jack F Vogel wrote: > Author: jfv > Date: Wed Nov 11 19:13:40 2009 > New Revision: 199192 > URL: http://svn.freebsd.org/changeset/base/199192 > > Log: > With an i386 kernel the igb driver can cause a > page fault panic on initialization due to a large > number of bounce pages being allocated. This is due > to the dma tag requiring page alignment on mbuf mapping. > This was removed some time back from the ixgbe driver > and is not needed here either. > > Modified: > head/sys/dev/e1000/if_igb.c > > Modified: head/sys/dev/e1000/if_igb.c > ============================================================================== > --- head/sys/dev/e1000/if_igb.c Wed Nov 11 19:00:12 2009 (r199191) > +++ head/sys/dev/e1000/if_igb.c Wed Nov 11 19:13:40 2009 (r199192) > @@ -2654,7 +2654,7 @@ igb_dma_malloc(struct adapter *adapter, > int error; > > error = bus_dma_tag_create(bus_get_dma_tag(adapter->dev), /* parent */ > - IGB_DBA_ALIGN, 0, /* alignment, bounds */ > + 1, 0, /* alignment, bounds */ > BUS_SPACE_MAXADDR, /* lowaddr */ > BUS_SPACE_MAXADDR, /* highaddr */ > NULL, NULL, /* filter, filterarg */ em(4) still has EM_DBA_ALIGN for em_dma_alloc(), but it uses '1' for the align for RX and TX buffers. Should this specific tag be changed back to using IGB_DBA_ALIGN or should em(4) be changed to use '1' for em_dma_alloc()? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 19:23:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8246C10656EF; Mon, 28 Dec 2009 19:23:40 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-qy0-f176.google.com (mail-qy0-f176.google.com [209.85.221.176]) by mx1.freebsd.org (Postfix) with ESMTP id D19A38FC17; Mon, 28 Dec 2009 19:23:39 +0000 (UTC) Received: by qyk6 with SMTP id 6so4493297qyk.3 for ; Mon, 28 Dec 2009 11:23:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=8aIFGzd1sN+Sit4ytpzCxnoOdo47fwwHYsap1AJwkPA=; b=Oc6IlZhWQXvhHBa2mPavdGls2omKFZVlNSMAf4ilNzwJd9jZujPJv6y1HGj1R1Ismo gVfGTKc7k//uW5hhi99df7jJwwp81ufXOZdFB31oWexYriU71tdCvGhxyMBddIUlOB2l BKL7iXIeIRfGy/9kvsUyKDHEx5H+eeSaeIXTs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=qx1MhQOPVXpNnJsXGu3Wxg5IxWCr7AhcvRITf/PNyuOD79GKrhdTVrK9DksBqzHIJU mzFq/9niFGvm5zAuMztE6zZMmZHKGc1onVj24yVOXOUiulCiiLF5lov2dgvIxaSrU5Z5 Yz4MKKsUsBe8xC2BrGYhsKRkLvo+30Xrtlo58= Received: by 10.224.127.14 with SMTP id e14mr2568945qas.346.1262028210283; Mon, 28 Dec 2009 11:23:30 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 4sm32354151qwe.35.2009.12.28.11.23.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Dec 2009 11:23:29 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 28 Dec 2009 11:22:18 -0800 From: Pyun YongHyeon Date: Mon, 28 Dec 2009 11:22:18 -0800 To: John Baldwin Message-ID: <20091228192218.GB1166@michelle.cdnetworks.com> References: <200911111913.nABJDewR004319@svn.freebsd.org> <200912281357.04461.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912281357.04461.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199192 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: 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, 28 Dec 2009 19:23:40 -0000 On Mon, Dec 28, 2009 at 01:57:04PM -0500, John Baldwin wrote: > On Wednesday 11 November 2009 2:13:40 pm Jack F Vogel wrote: > > Author: jfv > > Date: Wed Nov 11 19:13:40 2009 > > New Revision: 199192 > > URL: http://svn.freebsd.org/changeset/base/199192 > > > > Log: > > With an i386 kernel the igb driver can cause a > > page fault panic on initialization due to a large > > number of bounce pages being allocated. This is due > > to the dma tag requiring page alignment on mbuf mapping. > > This was removed some time back from the ixgbe driver > > and is not needed here either. > > > > Modified: > > head/sys/dev/e1000/if_igb.c > > > > Modified: head/sys/dev/e1000/if_igb.c > > > ============================================================================== > > --- head/sys/dev/e1000/if_igb.c Wed Nov 11 19:00:12 2009 (r199191) > > +++ head/sys/dev/e1000/if_igb.c Wed Nov 11 19:13:40 2009 (r199192) > > @@ -2654,7 +2654,7 @@ igb_dma_malloc(struct adapter *adapter, > > int error; > > > > error = bus_dma_tag_create(bus_get_dma_tag(adapter->dev), /* parent */ > > - IGB_DBA_ALIGN, 0, /* alignment, bounds */ > > + 1, 0, /* alignment, bounds */ > > BUS_SPACE_MAXADDR, /* lowaddr */ > > BUS_SPACE_MAXADDR, /* highaddr */ > > NULL, NULL, /* filter, filterarg */ > > em(4) still has EM_DBA_ALIGN for em_dma_alloc(), but it uses '1' for the align > for RX and TX buffers. Should this specific tag be changed back to using > IGB_DBA_ALIGN or should em(4) be changed to use '1' for em_dma_alloc()? > I think em(4) is right. 82576 GbE datasheet says 16 bytes alignment restrictions for TX/RX descriptors(page 265 and page 284). I remember IGB_DBA_ALIGN was chosen to align on 128 byte boundary to optimize cache line effect because descriptor length should be multiple of 128 bytes. > -- > John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 20:08:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE39E10656A6; Mon, 28 Dec 2009 20:08:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCDF78FC19; Mon, 28 Dec 2009 20:08:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSK81oN000102; Mon, 28 Dec 2009 20:08:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSK81bw099996; Mon, 28 Dec 2009 20:08:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912282008.nBSK81bw099996@svn.freebsd.org> From: Alexander Motin Date: Mon, 28 Dec 2009 20:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201139 - in head/sys: cam/ata geom sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 20:08:02 -0000 Author: mav Date: Mon Dec 28 20:08:01 2009 New Revision: 201139 URL: http://svn.freebsd.org/changeset/base/201139 Log: Add BIO_DELETE support to ada(4): - For SSDs use TRIM feature of DATA SET MANAGEMENT command, as defined by ACS-2 specification working draft. - For CompactFlash use CFA ERASE command, same as ad(4) does. With this patch, `newfs -E /dev/ada1` was able to restore write speed of my heavily weared OCZ Vertex SSD (firmware 1.4) up to the initial level for the most part of it's capacity. Previous 1.3 firmware, even reportiong TRIM capabilty bit set, was not working, reporting ABORT error for every DSM command. I have no idea whether it is normal, but for some reason it takes 200ms to handle any TRIM command on this drive, that was making delete extremely slow. But TRIM command is able to accept long list of LBAs and the length of that list seems doesn't affect it's execution time. Implemented request clusting algorithm allowed me to rise delete rate up to reasonable numbers, when many parallel DELETE requests running. Modified: head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_da.c head/sys/geom/geom_dev.c head/sys/sys/ata.h Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Mon Dec 28 18:59:13 2009 (r201138) +++ head/sys/cam/ata/ata_all.c Mon Dec 28 20:08:01 2009 (r201139) @@ -75,6 +75,11 @@ ata_op_string(struct ata_cmd *cmd) switch (cmd->command) { case 0x00: return ("NOP"); case 0x03: return ("CFA_REQUEST_EXTENDED_ERROR"); + case 0x06: + switch (cmd->features) { + case 0x01: return ("DSM TRIM"); + } + return "DSM"; case 0x08: return ("DEVICE_RESET"); case 0x20: return ("READ"); case 0x24: return ("READ48"); @@ -338,7 +343,8 @@ ata_48bit_cmd(struct ccb_ataio *ataio, u cmd == ATA_WRITE_DMA_FUA48 || cmd == ATA_WRITE_DMA_QUEUED48 || cmd == ATA_WRITE_DMA_QUEUED_FUA48 || - cmd == ATA_WRITE_STREAM_DMA48) + cmd == ATA_WRITE_STREAM_DMA48 || + cmd == ATA_DATA_SET_MANAGEMENT) ataio->cmd.flags |= CAM_ATAIO_DMA; ataio->cmd.command = cmd; ataio->cmd.features = features; Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Dec 28 18:59:13 2009 (r201138) +++ head/sys/cam/ata/ata_da.c Mon Dec 28 20:08:01 2009 (r201139) @@ -74,8 +74,10 @@ typedef enum { ADA_FLAG_CAN_DMA = 0x010, ADA_FLAG_NEED_OTAG = 0x020, ADA_FLAG_WENT_IDLE = 0x040, + ADA_FLAG_CAN_TRIM = 0x080, ADA_FLAG_OPEN = 0x100, - ADA_FLAG_SCTX_INIT = 0x200 + ADA_FLAG_SCTX_INIT = 0x200, + ADA_FLAG_CAN_CFA = 0x400 } ada_flags; typedef enum { @@ -86,6 +88,7 @@ typedef enum { ADA_CCB_BUFFER_IO = 0x03, ADA_CCB_WAITING = 0x04, ADA_CCB_DUMP = 0x05, + ADA_CCB_TRIM = 0x06, ADA_CCB_TYPE_MASK = 0x0F, } ada_ccb_state; @@ -101,13 +104,23 @@ struct disk_params { u_int64_t sectors; /* Total number sectors */ }; +#define TRIM_MAX_BLOCKS 4 +#define TRIM_MAX_RANGES TRIM_MAX_BLOCKS * 64 +struct trim_request { + uint8_t data[TRIM_MAX_RANGES * 8]; + struct bio *bps[TRIM_MAX_RANGES]; +}; + struct ada_softc { struct bio_queue_head bio_queue; + struct bio_queue_head trim_queue; ada_state state; ada_flags flags; ada_quirks quirks; int ordered_tag_count; int outstanding_cmds; + int trim_max_ranges; + int trim_running; struct disk_params params; struct disk *disk; union ccb saved_ccb; @@ -115,6 +128,7 @@ struct ada_softc { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; struct callout sendordered_c; + struct trim_request trim_req; }; struct ada_quirk_entry { @@ -309,6 +323,18 @@ adaclose(struct disk *dp) return (0); } +static void +adaschedule(struct cam_periph *periph) +{ + struct ada_softc *softc = (struct ada_softc *)periph->softc; + + if (bioq_first(&softc->bio_queue) || + (!softc->trim_running && bioq_first(&softc->trim_queue))) { + /* Have more work to do, so ensure we stay scheduled */ + xpt_schedule(periph, CAM_PRIORITY_NORMAL); + } +} + /* * Actually translate the requested transfer into one the physical driver * can understand. The transfer is described by a buf and will include @@ -341,12 +367,16 @@ adastrategy(struct bio *bp) /* * Place it in the queue of disk activities for this disk */ - bioq_disksort(&softc->bio_queue, bp); + if (bp->bio_cmd == BIO_DELETE && + (softc->flags & ADA_FLAG_CAN_TRIM)) + bioq_disksort(&softc->trim_queue, bp); + else + bioq_disksort(&softc->bio_queue, bp); /* * Schedule ourselves for performing the work. */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + adaschedule(periph); cam_periph_unlock(periph); return; @@ -485,6 +515,7 @@ adaoninvalidate(struct cam_periph *perip * with XPT_ABORT_CCB. */ bioq_flush(&softc->bio_queue, NULL, ENXIO); + bioq_flush(&softc->trim_queue, NULL, ENXIO); disk_gone(softc->disk); xpt_print(periph->path, "lost device\n"); @@ -618,6 +649,7 @@ adaregister(struct cam_periph *periph, v } bioq_init(&softc->bio_queue); + bioq_init(&softc->trim_queue); if (cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA) softc->flags |= ADA_FLAG_CAN_DMA; @@ -628,6 +660,17 @@ adaregister(struct cam_periph *periph, v if (cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ && cgd->inq_flags & SID_CmdQue) softc->flags |= ADA_FLAG_CAN_NCQ; + if (cgd->ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) { + softc->flags |= ADA_FLAG_CAN_TRIM; + 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); + } + } + if (cgd->ident_data.support.command2 & ATA_SUPPORT_CFA) + softc->flags |= ADA_FLAG_CAN_CFA; softc->state = ADA_STATE_NORMAL; periph->softc = softc; @@ -672,7 +715,7 @@ adaregister(struct cam_periph *periph, v maxio = DFLTPHYS; /* traditional default */ else if (maxio > MAXPHYS) maxio = MAXPHYS; /* for safety */ - if (cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) + if (softc->flags & ADA_FLAG_CAN_48BIT) maxio = min(maxio, 65536 * softc->params.secsize); else /* 28bit ATA command limit */ maxio = min(maxio, 256 * softc->params.secsize); @@ -681,6 +724,10 @@ 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))) + softc->disk->d_flags |= DISKFLAG_CANDELETE; strlcpy(softc->disk->d_ident, cgd->serial_num, MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1)); @@ -743,13 +790,10 @@ adastart(struct cam_periph *periph, unio switch (softc->state) { case ADA_STATE_NORMAL: { - /* Pull a buffer from the queue and get going on it */ struct bio *bp; + u_int8_t tag_code; - /* - * See if there is a buf with work for us to do.. - */ - bp = bioq_first(&softc->bio_queue); + /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); @@ -758,115 +802,188 @@ adastart(struct cam_periph *periph, unio periph_links.sle); periph->immediate_priority = CAM_PRIORITY_NONE; wakeup(&periph->ccb_list); - } else if (bp == NULL) { + /* Have more work to do, so ensure we stay scheduled */ + adaschedule(periph); + break; + } + /* Run TRIM if not running yet. */ + if (!softc->trim_running && + (bp = bioq_first(&softc->trim_queue)) != 0) { + struct trim_request *req = &softc->trim_req; + struct bio *bp1; + int bps = 0, ranges = 0; + + softc->trim_running = 1; + bzero(req, sizeof(*req)); + bp1 = bp; + do { + uint64_t lba = bp1->bio_pblkno; + int count = bp1->bio_bcount / + softc->params.secsize; + + bioq_remove(&softc->trim_queue, bp1); + while (count > 0) { + int c = min(count, 0xffff); + int off = ranges * 8; + + req->data[off + 0] = lba & 0xff; + req->data[off + 1] = (lba >> 8) & 0xff; + req->data[off + 2] = (lba >> 16) & 0xff; + req->data[off + 3] = (lba >> 24) & 0xff; + req->data[off + 4] = (lba >> 32) & 0xff; + req->data[off + 5] = (lba >> 40) & 0xff; + req->data[off + 6] = c & 0xff; + req->data[off + 7] = (c >> 8) & 0xff; + lba += c; + count -= c; + ranges++; + } + req->bps[bps++] = bp1; + bp1 = bioq_first(&softc->trim_queue); + if (bp1 == NULL || + bp1->bio_bcount / softc->params.secsize > + (softc->trim_max_ranges - ranges) * 0xffff) + break; + } while (1); + cam_fill_ataio(ataio, + ada_retry_count, + adadone, + CAM_DIR_OUT, + 0, + req->data, + ((ranges + 63) / 64) * 512, + ada_default_timeout * 1000); + ata_48bit_cmd(ataio, ATA_DATA_SET_MANAGEMENT, + ATA_DSM_TRIM, 0, (ranges + 63) / 64); + start_ccb->ccb_h.ccb_state = ADA_CCB_TRIM; + goto out; + } + /* Run regular command. */ + bp = bioq_first(&softc->bio_queue); + if (bp == NULL) { xpt_release_ccb(start_ccb); - } else { - u_int8_t tag_code; - - bioq_remove(&softc->bio_queue, bp); - - if ((softc->flags & ADA_FLAG_NEED_OTAG) != 0) { - softc->flags &= ~ADA_FLAG_NEED_OTAG; - softc->ordered_tag_count++; - tag_code = 0; - } else { - tag_code = 1; - } - switch (bp->bio_cmd) { - case BIO_READ: - case BIO_WRITE: - { - uint64_t lba = bp->bio_pblkno; - uint16_t count = bp->bio_bcount / softc->params.secsize; + break; + } + bioq_remove(&softc->bio_queue, bp); - cam_fill_ataio(ataio, - ada_retry_count, - adadone, - bp->bio_cmd == BIO_READ ? - CAM_DIR_IN : CAM_DIR_OUT, - tag_code, - bp->bio_data, - bp->bio_bcount, - ada_default_timeout*1000); + if ((softc->flags & ADA_FLAG_NEED_OTAG) != 0) { + softc->flags &= ~ADA_FLAG_NEED_OTAG; + softc->ordered_tag_count++; + tag_code = 0; + } else { + tag_code = 1; + } + switch (bp->bio_cmd) { + case BIO_READ: + case BIO_WRITE: + { + uint64_t lba = bp->bio_pblkno; + uint16_t count = bp->bio_bcount / softc->params.secsize; - if ((softc->flags & ADA_FLAG_CAN_NCQ) && tag_code) { + cam_fill_ataio(ataio, + ada_retry_count, + adadone, + bp->bio_cmd == BIO_READ ? + CAM_DIR_IN : CAM_DIR_OUT, + tag_code, + bp->bio_data, + bp->bio_bcount, + ada_default_timeout*1000); + + if ((softc->flags & ADA_FLAG_CAN_NCQ) && tag_code) { + if (bp->bio_cmd == BIO_READ) { + ata_ncq_cmd(ataio, ATA_READ_FPDMA_QUEUED, + lba, count); + } else { + ata_ncq_cmd(ataio, ATA_WRITE_FPDMA_QUEUED, + lba, count); + } + } else if ((softc->flags & ADA_FLAG_CAN_48BIT) && + (lba + count >= ATA_MAX_28BIT_LBA || + count > 256)) { + if (softc->flags & ADA_FLAG_CAN_DMA) { + if (bp->bio_cmd == BIO_READ) { + ata_48bit_cmd(ataio, ATA_READ_DMA48, + 0, lba, count); + } else { + ata_48bit_cmd(ataio, ATA_WRITE_DMA48, + 0, lba, count); + } + } else { if (bp->bio_cmd == BIO_READ) { - ata_ncq_cmd(ataio, ATA_READ_FPDMA_QUEUED, - lba, count); + ata_48bit_cmd(ataio, ATA_READ_MUL48, + 0, lba, count); } else { - ata_ncq_cmd(ataio, ATA_WRITE_FPDMA_QUEUED, - lba, count); + ata_48bit_cmd(ataio, ATA_WRITE_MUL48, + 0, lba, count); } - } else if ((softc->flags & ADA_FLAG_CAN_48BIT) && - (lba + count >= ATA_MAX_28BIT_LBA || - count > 256)) { - if (softc->flags & ADA_FLAG_CAN_DMA) { - if (bp->bio_cmd == BIO_READ) { - ata_48bit_cmd(ataio, ATA_READ_DMA48, - 0, lba, count); - } else { - ata_48bit_cmd(ataio, ATA_WRITE_DMA48, - 0, lba, count); - } + } + } else { + if (count == 256) + count = 0; + if (softc->flags & ADA_FLAG_CAN_DMA) { + if (bp->bio_cmd == BIO_READ) { + ata_28bit_cmd(ataio, ATA_READ_DMA, + 0, lba, count); } else { - if (bp->bio_cmd == BIO_READ) { - ata_48bit_cmd(ataio, ATA_READ_MUL48, - 0, lba, count); - } else { - ata_48bit_cmd(ataio, ATA_WRITE_MUL48, - 0, lba, count); - } + ata_28bit_cmd(ataio, ATA_WRITE_DMA, + 0, lba, count); } } else { - if (count == 256) - count = 0; - if (softc->flags & ADA_FLAG_CAN_DMA) { - if (bp->bio_cmd == BIO_READ) { - ata_28bit_cmd(ataio, ATA_READ_DMA, - 0, lba, count); - } else { - ata_28bit_cmd(ataio, ATA_WRITE_DMA, - 0, lba, count); - } + if (bp->bio_cmd == BIO_READ) { + ata_28bit_cmd(ataio, ATA_READ_MUL, + 0, lba, count); } else { - if (bp->bio_cmd == BIO_READ) { - ata_28bit_cmd(ataio, ATA_READ_MUL, - 0, lba, count); - } else { - ata_28bit_cmd(ataio, ATA_WRITE_MUL, - 0, lba, count); - } + ata_28bit_cmd(ataio, ATA_WRITE_MUL, + 0, lba, count); } } } - break; - case BIO_FLUSH: - cam_fill_ataio(ataio, - 1, - adadone, - CAM_DIR_NONE, - 0, - NULL, - 0, - ada_default_timeout*1000); + break; + } + case BIO_DELETE: + { + uint64_t lba = bp->bio_pblkno; + uint16_t count = bp->bio_bcount / softc->params.secsize; - if (softc->flags & ADA_FLAG_CAN_48BIT) - ata_48bit_cmd(ataio, ATA_FLUSHCACHE48, 0, 0, 0); - else - ata_28bit_cmd(ataio, ATA_FLUSHCACHE, 0, 0, 0); - break; - } - start_ccb->ccb_h.ccb_state = ADA_CCB_BUFFER_IO; - start_ccb->ccb_h.ccb_bp = bp; - softc->outstanding_cmds++; - xpt_action(start_ccb); - bp = bioq_first(&softc->bio_queue); + cam_fill_ataio(ataio, + ada_retry_count, + adadone, + CAM_DIR_NONE, + 0, + NULL, + 0, + ada_default_timeout*1000); + + if (count >= 256) + count = 0; + ata_28bit_cmd(ataio, ATA_CFA_ERASE, 0, lba, count); + break; } - - if (bp != NULL) { - /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + case BIO_FLUSH: + cam_fill_ataio(ataio, + 1, + adadone, + CAM_DIR_NONE, + 0, + NULL, + 0, + ada_default_timeout*1000); + + if (softc->flags & ADA_FLAG_CAN_48BIT) + ata_48bit_cmd(ataio, ATA_FLUSHCACHE48, 0, 0, 0); + else + ata_28bit_cmd(ataio, ATA_FLUSHCACHE, 0, 0, 0); + break; } + start_ccb->ccb_h.ccb_state = ADA_CCB_BUFFER_IO; +out: + start_ccb->ccb_h.ccb_bp = bp; + softc->outstanding_cmds++; + xpt_action(start_ccb); + + /* May have more work to do, so ensure we stay scheduled */ + adaschedule(periph); break; } } @@ -882,6 +999,7 @@ adadone(struct cam_periph *periph, union ataio = &done_ccb->ataio; switch (ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) { case ADA_CCB_BUFFER_IO: + case ADA_CCB_TRIM: { struct bio *bp; @@ -908,13 +1026,6 @@ adadone(struct cam_periph *periph, union "Invalidating pack\n"); softc->flags |= ADA_FLAG_PACK_INVALID; } - - /* - * return all queued I/O with EIO, so that - * the client can retry these I/Os in the - * proper order should it attempt to recover. - */ - bioq_flush(&softc->bio_queue, NULL, EIO); bp->bio_error = error; bp->bio_resid = bp->bio_bcount; bp->bio_flags |= BIO_ERROR; @@ -940,8 +1051,27 @@ adadone(struct cam_periph *periph, union softc->outstanding_cmds--; if (softc->outstanding_cmds == 0) softc->flags |= ADA_FLAG_WENT_IDLE; - - biodone(bp); + if ((ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) == + ADA_CCB_TRIM) { + struct trim_request *req = + (struct trim_request *)ataio->data_ptr; + int i; + + for (i = 1; i < softc->trim_max_ranges && + req->bps[i]; i++) { + struct bio *bp1 = req->bps[i]; + + bp1->bio_resid = bp->bio_resid; + bp1->bio_error = bp->bio_error; + if (bp->bio_flags & BIO_ERROR) + bp1->bio_flags |= BIO_ERROR; + biodone(bp1); + } + softc->trim_running = 0; + biodone(bp); + adaschedule(periph); + } else + biodone(bp); break; } case ADA_CCB_WAITING: Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Mon Dec 28 18:59:13 2009 (r201138) +++ head/sys/geom/geom_dev.c Mon Dec 28 20:08:01 2009 (r201139) @@ -299,8 +299,8 @@ g_dev_ioctl(struct cdev *dev, u_long cmd } while (length > 0) { chunk = length; - if (chunk > 1024 * cp->provider->sectorsize) - chunk = 1024 * cp->provider->sectorsize; + if (chunk > 65536 * cp->provider->sectorsize) + chunk = 65536 * cp->provider->sectorsize; error = g_delete_data(cp, offset, chunk); length -= chunk; offset += chunk; Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Mon Dec 28 18:59:13 2009 (r201138) +++ head/sys/sys/ata.h Mon Dec 28 20:08:01 2009 (r201139) @@ -101,7 +101,9 @@ struct ata_params { /*066*/ u_int16_t mwdmarec; /* rec. M/W DMA time ns */ /*067*/ u_int16_t pioblind; /* min. PIO cycle w/o flow */ /*068*/ u_int16_t pioiordy; /* min. PIO cycle IORDY flow */ - u_int16_t reserved69; +/*069*/ u_int16_t support3; +#define ATA_SUPPORT_RZAT 0x0020 +#define ATA_SUPPORT_DRAT 0x4000 u_int16_t reserved70; /*071*/ u_int16_t rlsovlap; /* rel time (us) for overlap */ /*072*/ u_int16_t rlsservice; /* rel time (us) for service */ @@ -204,7 +206,8 @@ struct ata_params { u_int16_t lba_size48_2; u_int16_t lba_size48_3; u_int16_t lba_size48_4; - u_int16_t reserved104[2]; + u_int16_t reserved104; +/*105*/ u_int16_t max_dsm_blocks; /*106*/ u_int16_t pss; #define ATA_PSS_LSPPS 0x000F #define ATA_PSS_LSSABOVE512 0x1000 @@ -230,7 +233,10 @@ struct ata_params { /*162*/ u_int16_t cfa_kms_support; /*163*/ u_int16_t cfa_trueide_modes; /*164*/ u_int16_t cfa_memory_modes; - u_int16_t reserved165[11]; + u_int16_t reserved165[4]; +/*169*/ u_int16_t support_dsm; +#define ATA_SUPPORT_DSM_TRIM 0x0001 + u_int16_t reserved170[6]; /*176*/ u_int8_t media_serial[60]; /*206*/ u_int16_t sct; u_int16_t reserved206[2]; @@ -284,6 +290,8 @@ struct ata_params { #define ATA_NOP 0x00 /* NOP */ #define ATA_NF_FLUSHQUEUE 0x00 /* flush queued cmd's */ #define ATA_NF_AUTOPOLL 0x01 /* start autopoll function */ +#define ATA_DATA_SET_MANAGEMENT 0x06 +#define ATA_DSM_TRIM 0x01 #define ATA_DEVICE_RESET 0x08 /* reset device */ #define ATA_READ 0x20 /* read */ #define ATA_READ48 0x24 /* read 48bit LBA */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 20:54:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FA4E1065697; Mon, 28 Dec 2009 20:54:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EBA78FC26; Mon, 28 Dec 2009 20:54:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSKsYNs001079; Mon, 28 Dec 2009 20:54:34 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSKsYj2001070; Mon, 28 Dec 2009 20:54:34 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912282054.nBSKsYj2001070@svn.freebsd.org> From: Ed Schouten Date: Mon, 28 Dec 2009 20:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201140 - head/usr.bin/finger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 20:54:34 -0000 Author: ed Date: Mon Dec 28 20:54:34 2009 New Revision: 201140 URL: http://svn.freebsd.org/changeset/base/201140 Log: Migrate finger(1) away from . Unfortunately it also uses lastlog, which means we must resort to local extensions of the utmpx-interface. Because the user name and TTY name are now nul-terminated, there is no need to copy around strings as often. Modified: head/usr.bin/finger/Makefile head/usr.bin/finger/extern.h head/usr.bin/finger/finger.c head/usr.bin/finger/finger.h head/usr.bin/finger/lprint.c head/usr.bin/finger/net.c head/usr.bin/finger/sprint.c head/usr.bin/finger/util.c Modified: head/usr.bin/finger/Makefile ============================================================================== --- head/usr.bin/finger/Makefile Mon Dec 28 20:08:01 2009 (r201139) +++ head/usr.bin/finger/Makefile Mon Dec 28 20:54:34 2009 (r201140) @@ -5,4 +5,7 @@ PROG= finger SRCS= finger.c lprint.c net.c sprint.c util.c MAN= finger.1 finger.conf.5 +DPADD= ${LIBULOG} +LDADD= -lulog + .include Modified: head/usr.bin/finger/extern.h ============================================================================== --- head/usr.bin/finger/extern.h Mon Dec 28 20:08:01 2009 (r201139) +++ head/usr.bin/finger/extern.h Mon Dec 28 20:54:34 2009 (r201140) @@ -51,8 +51,8 @@ extern int invoker_root; /* Invoked by void enter_lastlog(PERSON *); PERSON *enter_person(struct passwd *); -void enter_where(struct utmp *, PERSON *); -PERSON *find_person(const char *); +void enter_where(struct utmpx *, PERSON *); +PERSON *find_person(char *); int hide(struct passwd *); void lflag_print(void); int match(struct passwd *, const char *); Modified: head/usr.bin/finger/finger.c ============================================================================== --- head/usr.bin/finger/finger.c Mon Dec 28 20:08:01 2009 (r201139) +++ head/usr.bin/finger/finger.c Mon Dec 28 20:54:34 2009 (r201140) @@ -82,8 +82,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _ULOG_POSIX_NAMES +#include #include -#include #include #include "finger.h" @@ -233,29 +234,26 @@ loginlist(void) PERSON *pn; DBT data, key; struct passwd *pw; - struct utmp user; + struct utmpx *user; int r, sflag1; - char name[UT_NAMESIZE + 1]; if (kflag) errx(1, "can't list logins without reading utmp"); - if (!freopen(_PATH_UTMP, "r", stdin)) - err(1, "%s", _PATH_UTMP); - name[UT_NAMESIZE] = '\0'; - while (fread((char *)&user, sizeof(user), 1, stdin) == 1) { - if (!user.ut_name[0]) + setutxent(); + while ((user = getutxent()) != NULL) { + if (user->ut_type != USER_PROCESS) continue; - if ((pn = find_person(user.ut_name)) == NULL) { - bcopy(user.ut_name, name, UT_NAMESIZE); - if ((pw = getpwnam(name)) == NULL) + if ((pn = find_person(user->ut_user)) == NULL) { + if ((pw = getpwnam(user->ut_user)) == NULL) continue; if (hide(pw)) continue; pn = enter_person(pw); } - enter_where(&user, pn); + enter_where(user, pn); } + endutxent(); if (db && lflag) for (sflag1 = R_FIRST;; sflag1 = R_NEXT) { PERSON *tmp; @@ -275,7 +273,7 @@ userlist(int argc, char **argv) { PERSON *pn; DBT data, key; - struct utmp user; + struct utmpx *user; struct passwd *pw; int r, sflag1, *used, *ip; char **ap, **nargv, **np, **p; @@ -384,15 +382,15 @@ net: for (p = nargv; *p;) { * Scan thru the list of users currently logged in, saving * appropriate data whenever a match occurs. */ - if (!freopen(_PATH_UTMP, "r", stdin)) - err(1, "%s", _PATH_UTMP); - while (fread((char *)&user, sizeof(user), 1, stdin) == 1) { - if (!user.ut_name[0]) + setutxent(); + while ((user = getutxent()) != NULL) { + if (user->ut_type != USER_PROCESS) continue; - if ((pn = find_person(user.ut_name)) == NULL) + if ((pn = find_person(user->ut_user)) == NULL) continue; - enter_where(&user, pn); + enter_where(user, pn); } + endutxent(); if (db) for (sflag1 = R_FIRST;; sflag1 = R_NEXT) { PERSON *tmp; Modified: head/usr.bin/finger/finger.h ============================================================================== --- head/usr.bin/finger/finger.h Mon Dec 28 20:08:01 2009 (r201139) +++ head/usr.bin/finger/finger.h Mon Dec 28 20:54:34 2009 (r201140) @@ -62,8 +62,8 @@ typedef struct where { short writable; /* tty is writable */ time_t loginat; /* time of (last) login */ time_t idletime; /* how long idle (if logged in) */ - char tty[UT_LINESIZE+1]; /* null terminated tty line */ - char host[UT_HOSTSIZE+1]; /* null terminated remote host name */ + char tty[sizeof ((struct utmpx *)0)->ut_line]; /* tty line */ + char host[sizeof ((struct utmpx *)0)->ut_host]; /* host name */ } WHERE; #define UNPRIV_NAME "nobody" /* Preferred privilege level */ Modified: head/usr.bin/finger/lprint.c ============================================================================== --- head/usr.bin/finger/lprint.c Mon Dec 28 20:08:01 2009 (r201139) +++ head/usr.bin/finger/lprint.c Mon Dec 28 20:54:34 2009 (r201140) @@ -56,8 +56,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _ULOG_POSIX_NAMES +#include #include -#include #include "finger.h" #include "pathnames.h" Modified: head/usr.bin/finger/net.c ============================================================================== --- head/usr.bin/finger/net.c Mon Dec 28 20:08:01 2009 (r201139) +++ head/usr.bin/finger/net.c Mon Dec 28 20:54:34 2009 (r201140) @@ -54,8 +54,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _ULOG_POSIX_NAMES +#include #include -#include #include "finger.h" static void cleanup(int sig); Modified: head/usr.bin/finger/sprint.c ============================================================================== --- head/usr.bin/finger/sprint.c Mon Dec 28 20:08:01 2009 (r201139) +++ head/usr.bin/finger/sprint.c Mon Dec 28 20:54:34 2009 (r201140) @@ -43,6 +43,7 @@ static char sccsid[] = "@(#)sprint.c 8.3 #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -52,7 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#define _ULOG_POSIX_NAMES +#include #include "finger.h" static void stimeprint(WHERE *); @@ -88,7 +90,7 @@ sflag_print(void) */ #define MAXREALNAME 16 #define MAXHOSTNAME 17 /* in reality, hosts are never longer than 16 */ - (void)printf("%-*s %-*s%s %s\n", UT_NAMESIZE, "Login", MAXREALNAME, + (void)printf("%-*s %-*s%s %s\n", MAXLOGNAME, "Login", MAXREALNAME, "Name", " TTY Idle Login Time ", (gflag) ? "" : oflag ? "Office Phone" : "Where"); @@ -105,7 +107,7 @@ sflag_print(void) namelen = MAXREALNAME; if (w->info == LOGGEDIN && !w->writable) --namelen; /* leave space before `*' */ - (void)printf("%-*.*s %-*.*s", UT_NAMESIZE, UT_NAMESIZE, + (void)printf("%-*.*s %-*.*s", MAXLOGNAME, MAXLOGNAME, pn->name, MAXREALNAME, namelen, pn->realname ? pn->realname : ""); if (!w->loginat) { Modified: head/usr.bin/finger/util.c ============================================================================== --- head/usr.bin/finger/util.c Mon Dec 28 20:08:01 2009 (r201139) +++ head/usr.bin/finger/util.c Mon Dec 28 20:54:34 2009 (r201140) @@ -56,8 +56,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _ULOG_POSIX_NAMES +#include #include -#include #include "finger.h" #include "pathnames.h" @@ -109,29 +110,18 @@ void enter_lastlog(PERSON *pn) { WHERE *w; - static int opened, fd; - struct lastlog ll; + struct ulog_utmpx *ut; char doit = 0; - /* some systems may not maintain lastlog, don't report errors. */ - if (!opened) { - fd = open(_PATH_LASTLOG, O_RDONLY, 0); - opened = 1; - } - if (fd == -1 || - lseek(fd, (long)pn->uid * sizeof(ll), SEEK_SET) != - (long)pn->uid * sizeof(ll) || - read(fd, (char *)&ll, sizeof(ll)) != sizeof(ll)) { - /* as if never logged in */ - ll.ll_line[0] = ll.ll_host[0] = '\0'; - ll.ll_time = 0; - } + ulog_setutxfile(UTXI_USER, NULL); + ut = ulog_getutxuser(pn->name); if ((w = pn->whead) == NULL) doit = 1; - else if (ll.ll_time != 0) { + else if (ut != NULL && ut->ut_type == USER_PROCESS) { /* if last login is earlier than some current login */ for (; !doit && w != NULL; w = w->next) - if (w->info == LOGGEDIN && w->loginat < ll.ll_time) + if (w->info == LOGGEDIN && + w->loginat < ut->ut_tv.tv_sec) doit = 1; /* * and if it's not any of the current logins @@ -140,32 +130,29 @@ enter_lastlog(PERSON *pn) */ for (w = pn->whead; doit && w != NULL; w = w->next) if (w->info == LOGGEDIN && - strncmp(w->tty, ll.ll_line, UT_LINESIZE) == 0) + strcmp(w->tty, ut->ut_line) == 0) doit = 0; } - if (doit) { + if (ut != NULL && doit) { w = walloc(pn); w->info = LASTLOG; - bcopy(ll.ll_line, w->tty, UT_LINESIZE); - w->tty[UT_LINESIZE] = 0; - bcopy(ll.ll_host, w->host, UT_HOSTSIZE); - w->host[UT_HOSTSIZE] = 0; - w->loginat = ll.ll_time; + strcpy(w->tty, ut->ut_line); + strcpy(w->host, ut->ut_host); + w->loginat = ut->ut_tv.tv_sec; } + ulog_endutxent(); } void -enter_where(struct utmp *ut, PERSON *pn) +enter_where(struct utmpx *ut, PERSON *pn) { WHERE *w; w = walloc(pn); w->info = LOGGEDIN; - bcopy(ut->ut_line, w->tty, UT_LINESIZE); - w->tty[UT_LINESIZE] = 0; - bcopy(ut->ut_host, w->host, UT_HOSTSIZE); - w->host[UT_HOSTSIZE] = 0; - w->loginat = (time_t)ut->ut_time; + strcpy(w->tty, ut->ut_line); + strcpy(w->host, ut->ut_host); + w->loginat = ut->ut_tv.tv_sec; find_idle_and_ttywrite(w); } @@ -205,14 +192,12 @@ enter_person(struct passwd *pw) } PERSON * -find_person(const char *name) +find_person(char *name) { struct passwd *pw; - int cnt; DBT data, key; PERSON *p; - char buf[UT_NAMESIZE + 1]; if (!db) return(NULL); @@ -220,12 +205,8 @@ find_person(const char *name) if ((pw = getpwnam(name)) && hide(pw)) return(NULL); - /* Name may be only UT_NAMESIZE long and not NUL terminated. */ - for (cnt = 0; cnt < UT_NAMESIZE && *name; ++name, ++cnt) - buf[cnt] = *name; - buf[cnt] = '\0'; - key.data = buf; - key.size = cnt; + key.data = name; + key.size = strlen(name); if ((*db->get)(db, &key, &data, 0)) return (NULL); From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 21:03:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 360C11065692; Mon, 28 Dec 2009 21:03:15 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id B01A28FC19; Mon, 28 Dec 2009 21:03:14 +0000 (UTC) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 475BDC97DE; Mon, 28 Dec 2009 16:03:14 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 28 Dec 2009 16:03:14 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=GJkKsknW5IWb548QMGPt+l/GTM8=; b=PbHUuHBKM4khO0DamivG9i6bwJdKjZafvLFcv80x4fdueQKsbwNnAjTrrcZOrw4/9dtYxODHJBtvQG4TcY602vXztafEGA/Cngzyiy4QQgeQkat6FqXdq6xmalkzgtenp1c111A2QWUFY1+lLE7QCTOoQXxvqhnbYTb9wPQNB98= X-Sasl-enc: PMq3jE+JDDyFy9ppHNfssNr6dqSABKTfzGuNpaZLYpiy 1262034193 Received: from [192.168.123.18] (cpc2-dals7-0-0-cust253.hari.cable.virginmedia.com [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 84E4D49B443; Mon, 28 Dec 2009 16:03:13 -0500 (EST) Message-ID: <4B391D10.5080602@incunabulum.net> Date: Mon, 28 Dec 2009 21:03:12 +0000 From: Bruce Simpson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Alexander Motin References: <200912282008.nBSK81bw099996@svn.freebsd.org> In-Reply-To: <200912282008.nBSK81bw099996@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201139 - in head/sys: cam/ata geom sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 21:03:15 -0000 On 28/12/2009 20:08, Alexander Motin wrote: > Author: mav > Date: Mon Dec 28 20:08:01 2009 > New Revision: 201139 > URL: http://svn.freebsd.org/changeset/base/201139 > > Log: > Add BIO_DELETE support to ada(4): > - For SSDs use TRIM feature of DATA SET MANAGEMENT command, as defined by > ACS-2 specification working draft. > - For CompactFlash use CFA ERASE command, same as ad(4) does. > A thought popped into my head as I read this. Is anyone implementing these ATA commands, intended for CF and SSD devices, in e.g. VirtualBox, QEMU? They could probably help out with block allocation for copy-on-write disk images there. Just a thought. cheers, BMS From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 21:14:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80DE11065692; Mon, 28 Dec 2009 21:14:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C2408FC0C; Mon, 28 Dec 2009 21:14:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSLEJJR001564; Mon, 28 Dec 2009 21:14:19 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSLEJVj001562; Mon, 28 Dec 2009 21:14:19 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912282114.nBSLEJVj001562@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 28 Dec 2009 21:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201141 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 21:14:20 -0000 Author: bz Date: Mon Dec 28 21:14:18 2009 New Revision: 201141 URL: http://svn.freebsd.org/changeset/base/201141 Log: Make the compiler happy after r201125: - + remove two unnecessary initializations in ip_output; + + remove one unnecessary initializations in ip_output; Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Dec 28 20:54:34 2009 (r201140) +++ head/sys/netinet/ip_output.c Mon Dec 28 21:14:18 2009 (r201141) @@ -113,7 +113,7 @@ ip_output(struct mbuf *m, struct mbuf *o struct ip_moptions *imo, struct inpcb *inp) { struct ip *ip; - struct ifnet *ifp; + struct ifnet *ifp = NULL; /* keep compiler happy */ struct mbuf *m0; int hlen = sizeof (struct ip); int mtu; From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 21:54:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB7551065672; Mon, 28 Dec 2009 21:54:01 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id DDA098FC1C; Mon, 28 Dec 2009 21:54:00 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id A5AB573098; Mon, 28 Dec 2009 23:01:44 +0100 (CET) Date: Mon, 28 Dec 2009 23:01:44 +0100 From: Luigi Rizzo To: "Bjoern A. Zeeb" Message-ID: <20091228220144.GA38493@onelab2.iet.unipi.it> References: <200912282114.nBSLEJVj001562@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912282114.nBSLEJVj001562@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201141 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 21:54:02 -0000 On Mon, Dec 28, 2009 at 09:14:19PM +0000, Bjoern A. Zeeb wrote: > Author: bz > Date: Mon Dec 28 21:14:18 2009 > New Revision: 201141 > URL: http://svn.freebsd.org/changeset/base/201141 > > Log: > Make the compiler happy after r201125: > - + remove two unnecessary initializations in ip_output; > + + remove one unnecessary initializations in ip_output; does it give a warning or an error ? I tried a buildkernel (i386) and also a picobsd build and neither give any warning. cheers luigi > Modified: > head/sys/netinet/ip_output.c > > Modified: head/sys/netinet/ip_output.c > ============================================================================== > --- head/sys/netinet/ip_output.c Mon Dec 28 20:54:34 2009 (r201140) > +++ head/sys/netinet/ip_output.c Mon Dec 28 21:14:18 2009 (r201141) > @@ -113,7 +113,7 @@ ip_output(struct mbuf *m, struct mbuf *o > struct ip_moptions *imo, struct inpcb *inp) > { > struct ip *ip; > - struct ifnet *ifp; > + struct ifnet *ifp = NULL; /* keep compiler happy */ > struct mbuf *m0; > int hlen = sizeof (struct ip); > int mtu; From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 21:58:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB7541065695; Mon, 28 Dec 2009 21:58:32 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 92B728FC15; Mon, 28 Dec 2009 21:58:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 44B1B7C353; Tue, 29 Dec 2009 10:58:31 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TGgmdi3hC1We; Tue, 29 Dec 2009 10:58:26 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Tue, 29 Dec 2009 10:58:26 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 24C7A11432; Tue, 29 Dec 2009 10:58:26 +1300 (NZDT) Date: Tue, 29 Dec 2009 10:58:26 +1300 From: Andrew Thompson To: Luigi Rizzo Message-ID: <20091228215825.GC49597@citylink.fud.org.nz> References: <200912282114.nBSLEJVj001562@svn.freebsd.org> <20091228220144.GA38493@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091228220144.GA38493@onelab2.iet.unipi.it> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r201141 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 21:58:33 -0000 On Mon, Dec 28, 2009 at 11:01:44PM +0100, Luigi Rizzo wrote: > On Mon, Dec 28, 2009 at 09:14:19PM +0000, Bjoern A. Zeeb wrote: > > Author: bz > > Date: Mon Dec 28 21:14:18 2009 > > New Revision: 201141 > > URL: http://svn.freebsd.org/changeset/base/201141 > > > > Log: > > Make the compiler happy after r201125: > > - + remove two unnecessary initializations in ip_output; > > + + remove one unnecessary initializations in ip_output; > > does it give a warning or an error ? I tried a buildkernel (i386) and > also a picobsd build and neither give any warning. http://lists.freebsd.org/pipermail/freebsd-current/2009-December/014633.html http://lists.freebsd.org/pipermail/freebsd-current/2009-December/014634.html http://lists.freebsd.org/pipermail/freebsd-current/2009-December/014637.html Andrew From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 22:14:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6A1D1065679; Mon, 28 Dec 2009 22:14:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6D2A8FC0A; Mon, 28 Dec 2009 22:14:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSMEnQQ002678; Mon, 28 Dec 2009 22:14:49 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSMEnNL002676; Mon, 28 Dec 2009 22:14:49 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912282214.nBSMEnNL002676@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 28 Dec 2009 22:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201142 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 22:14:49 -0000 Author: trasz Date: Mon Dec 28 22:14:49 2009 New Revision: 201142 URL: http://svn.freebsd.org/changeset/base/201142 Log: The net/if_slvar.h header is long gone. Modified: head/share/man/man4/ifmib.4 Modified: head/share/man/man4/ifmib.4 ============================================================================== --- head/share/man/man4/ifmib.4 Mon Dec 28 21:14:18 2009 (r201141) +++ head/share/man/man4/ifmib.4 Mon Dec 28 22:14:49 2009 (r201142) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 15, 1996 +.Dd October 28, 2009 .Dt IFMIB 4 .Os .Sh NAME @@ -165,12 +165,6 @@ interfaces, the structure is called and implements a superset of the .Tn "RFC 1650" MIB for Ethernet-like networks. -.\" This will eventually be defined in an ethermib(4) page. -For -.Dv IFT_SLIP , -the structure is a -.Dq Li struct sl_softc -.Pq In net/if_slvar.h . .Sh SEE ALSO .Xr sysctl 3 , .Xr intro 4 , From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 22:15:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 457851065703; Mon, 28 Dec 2009 22:15:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 324E18FC08; Mon, 28 Dec 2009 22:15:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSMFC1M002736; Mon, 28 Dec 2009 22:15:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSMFCw3002728; Mon, 28 Dec 2009 22:15:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912282215.nBSMFCw3002728@svn.freebsd.org> From: Xin LI Date: Mon, 28 Dec 2009 22:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201143 - in head: cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolar... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 22:15:12 -0000 Author: delphij Date: Mon Dec 28 22:15:11 2009 New Revision: 201143 URL: http://svn.freebsd.org/changeset/base/201143 Log: Apply OpenSolaris revision 8012 which brings our zpool to version 14, making it possible for zpools created on OpenSolaris 2009.06 be used on FreeBSD. PR: kern/141800 Submitted by: mm Reviewed by: pjd, trasz Obtained from: OpenSolaris MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Dec 28 22:14:49 2009 (r201142) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Dec 28 22:15:11 2009 (r201143) @@ -3488,6 +3488,8 @@ zpool_do_upgrade(int argc, char **argv) (void) printf(gettext(" 11 Improved scrub performance\n")); (void) printf(gettext(" 12 Snapshot properties\n")); (void) printf(gettext(" 13 snapused property\n")); + (void) printf(gettext(" 14 passthrough-x aclinherit " + "support\n")); (void) printf(gettext("For more information on a particular " "version, including supported releases, see:\n\n")); (void) printf("http://www.opensolaris.org/os/community/zfs/" Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Mon Dec 28 22:14:49 2009 (r201142) +++ head/sys/cddl/boot/zfs/zfsimpl.h Mon Dec 28 22:15:11 2009 (r201143) @@ -479,13 +479,14 @@ typedef enum { #define SPA_VERSION_11 11ULL #define SPA_VERSION_12 12ULL #define SPA_VERSION_13 13ULL +#define SPA_VERSION_14 14ULL /* * When bumping up SPA_VERSION, make sure GRUB ZFS understand the on-disk * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*}, * and do the appropriate changes. */ -#define SPA_VERSION SPA_VERSION_13 -#define SPA_VERSION_STRING "13" +#define SPA_VERSION SPA_VERSION_14 +#define SPA_VERSION_STRING "14" /* * Symbolic names for the changes that caused a SPA_VERSION switch. @@ -520,6 +521,7 @@ typedef enum { #define SPA_VERSION_DSL_SCRUB SPA_VERSION_11 #define SPA_VERSION_SNAP_PROPS SPA_VERSION_12 #define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13 +#define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14 /* * The following are configuration names used in the nvlist describing a pool's Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Dec 28 22:14:49 2009 (r201142) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Dec 28 22:15:11 2009 (r201143) @@ -97,6 +97,7 @@ zfs_prop_init(void) { "restricted", ZFS_ACL_RESTRICTED }, { "passthrough", ZFS_ACL_PASSTHROUGH }, { "secure", ZFS_ACL_RESTRICTED }, /* bkwrd compatability */ + { "passthrough-x", ZFS_ACL_PASSTHROUGH_X }, { NULL } }; @@ -173,7 +174,7 @@ zfs_prop_init(void) "discard | groupmask | passthrough", "ACLMODE", acl_mode_table); register_index(ZFS_PROP_ACLINHERIT, "aclinherit", ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, - "discard | noallow | restricted | passthrough", + "discard | noallow | restricted | passthrough | passthrough-x", "ACLINHERIT", acl_inherit_table); register_index(ZFS_PROP_COPIES, "copies", 1, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Mon Dec 28 22:14:49 2009 (r201142) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Mon Dec 28 22:15:11 2009 (r201143) @@ -26,8 +26,6 @@ #ifndef _SYS_FS_ZFS_ACL_H #define _SYS_FS_ZFS_ACL_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef _KERNEL #include #endif @@ -180,6 +178,7 @@ typedef struct zfs_acl { #define ZFS_ACL_GROUPMASK 2 #define ZFS_ACL_PASSTHROUGH 3 #define ZFS_ACL_RESTRICTED 4 +#define ZFS_ACL_PASSTHROUGH_X 5 struct znode; struct zfsvfs; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Dec 28 22:14:49 2009 (r201142) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Dec 28 22:15:11 2009 (r201143) @@ -1663,7 +1663,8 @@ zfs_ace_can_use(znode_t *zp, uint16_t ac * inherit inheritable ACEs from parent */ static zfs_acl_t * -zfs_acl_inherit(znode_t *zp, zfs_acl_t *paclp, boolean_t *need_chmod) +zfs_acl_inherit(znode_t *zp, zfs_acl_t *paclp, uint64_t mode, + boolean_t *need_chmod) { zfsvfs_t *zfsvfs = zp->z_zfsvfs; void *pacep; @@ -1676,112 +1677,123 @@ zfs_acl_inherit(znode_t *zp, zfs_acl_t * size_t ace_size; void *data1, *data2; size_t data1sz, data2sz; - enum vtype vntype = ZTOV(zp)->v_type; + boolean_t vdir = ZTOV(zp)->v_type == VDIR; + boolean_t vreg = ZTOV(zp)->v_type == VREG; + boolean_t passthrough, passthrough_x, noallow; + + passthrough_x = + zfsvfs->z_acl_inherit == ZFS_ACL_PASSTHROUGH_X; + passthrough = passthrough_x || + zfsvfs->z_acl_inherit == ZFS_ACL_PASSTHROUGH; + noallow = + zfsvfs->z_acl_inherit == ZFS_ACL_NOALLOW; *need_chmod = B_TRUE; pacep = NULL; aclp = zfs_acl_alloc(paclp->z_version); - if (zfsvfs->z_acl_inherit != ZFS_ACL_DISCARD) { - while (pacep = zfs_acl_next_ace(paclp, pacep, &who, - &access_mask, &iflags, &type)) { + if (zfsvfs->z_acl_inherit == ZFS_ACL_DISCARD) + return (aclp); + while (pacep = zfs_acl_next_ace(paclp, pacep, &who, + &access_mask, &iflags, &type)) { - /* - * don't inherit bogus ACEs - */ - if (!zfs_acl_valid_ace_type(type, iflags)) - continue; + /* + * don't inherit bogus ACEs + */ + if (!zfs_acl_valid_ace_type(type, iflags)) + continue; - if (zfsvfs->z_acl_inherit == ZFS_ACL_NOALLOW && - type == ALLOW) - continue; + if (noallow && type == ALLOW) + continue; - ace_size = aclp->z_ops.ace_size(pacep); + ace_size = aclp->z_ops.ace_size(pacep); - if (!zfs_ace_can_use(zp, iflags)) - continue; + if (!zfs_ace_can_use(zp, iflags)) + continue; - /* - * If owner@, group@, or everyone@ inheritable - * then zfs_acl_chmod() isn't needed. - */ - if (zfsvfs->z_acl_inherit == - ZFS_ACL_PASSTHROUGH && - ((iflags & (ACE_OWNER|ACE_EVERYONE)) || - ((iflags & OWNING_GROUP) == - OWNING_GROUP)) && (vntype == VREG || - (vntype == VDIR && - (iflags & ACE_DIRECTORY_INHERIT_ACE)))) - *need_chmod = B_FALSE; - - aclnode = zfs_acl_node_alloc(ace_size); - list_insert_tail(&aclp->z_acl, aclnode); - acep = aclnode->z_acldata; - zfs_set_ace(aclp, acep, access_mask, type, - who, iflags|ACE_INHERITED_ACE); + /* + * If owner@, group@, or everyone@ inheritable + * then zfs_acl_chmod() isn't needed. + */ + if (passthrough && + ((iflags & (ACE_OWNER|ACE_EVERYONE)) || + ((iflags & OWNING_GROUP) == + OWNING_GROUP)) && (vreg || (vdir && (iflags & + ACE_DIRECTORY_INHERIT_ACE)))) { + *need_chmod = B_FALSE; + + if (!vdir && passthrough_x && + ((mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0)) { + access_mask &= ~ACE_EXECUTE; + } + } + + aclnode = zfs_acl_node_alloc(ace_size); + list_insert_tail(&aclp->z_acl, aclnode); + acep = aclnode->z_acldata; + + zfs_set_ace(aclp, acep, access_mask, type, + who, iflags|ACE_INHERITED_ACE); + + /* + * Copy special opaque data if any + */ + if ((data1sz = paclp->z_ops.ace_data(pacep, &data1)) != 0) { + VERIFY((data2sz = aclp->z_ops.ace_data(acep, + &data2)) == data1sz); + bcopy(data1, data2, data2sz); + } + aclp->z_acl_count++; + aclnode->z_ace_count++; + aclp->z_acl_bytes += aclnode->z_size; + newflags = aclp->z_ops.ace_flags_get(acep); + + if (vdir) + aclp->z_hints |= ZFS_INHERIT_ACE; + + if ((iflags & ACE_NO_PROPAGATE_INHERIT_ACE) || !vdir) { + newflags &= ~ALL_INHERIT; + aclp->z_ops.ace_flags_set(acep, + newflags|ACE_INHERITED_ACE); + zfs_restricted_update(zfsvfs, aclp, acep); + continue; + } + + ASSERT(vdir); + + newflags = aclp->z_ops.ace_flags_get(acep); + if ((iflags & (ACE_FILE_INHERIT_ACE | + ACE_DIRECTORY_INHERIT_ACE)) != + ACE_FILE_INHERIT_ACE) { + aclnode2 = zfs_acl_node_alloc(ace_size); + list_insert_tail(&aclp->z_acl, aclnode2); + acep2 = aclnode2->z_acldata; + zfs_set_ace(aclp, acep2, + access_mask, type, who, + iflags|ACE_INHERITED_ACE); + newflags |= ACE_INHERIT_ONLY_ACE; + aclp->z_ops.ace_flags_set(acep, newflags); + newflags &= ~ALL_INHERIT; + aclp->z_ops.ace_flags_set(acep2, + newflags|ACE_INHERITED_ACE); /* * Copy special opaque data if any */ - if ((data1sz = paclp->z_ops.ace_data(pacep, + if ((data1sz = aclp->z_ops.ace_data(acep, &data1)) != 0) { - VERIFY((data2sz = aclp->z_ops.ace_data(acep, + VERIFY((data2sz = + aclp->z_ops.ace_data(acep2, &data2)) == data1sz); - bcopy(data1, data2, data2sz); + bcopy(data1, data2, data1sz); } aclp->z_acl_count++; - aclnode->z_ace_count++; + aclnode2->z_ace_count++; aclp->z_acl_bytes += aclnode->z_size; - newflags = aclp->z_ops.ace_flags_get(acep); - - if (vntype == VDIR) - aclp->z_hints |= ZFS_INHERIT_ACE; - - if ((iflags & ACE_NO_PROPAGATE_INHERIT_ACE) || - (vntype != VDIR)) { - newflags &= ~ALL_INHERIT; - aclp->z_ops.ace_flags_set(acep, - newflags|ACE_INHERITED_ACE); - zfs_restricted_update(zfsvfs, aclp, acep); - continue; - } - - ASSERT(vntype == VDIR); - - newflags = aclp->z_ops.ace_flags_get(acep); - if ((iflags & (ACE_FILE_INHERIT_ACE | - ACE_DIRECTORY_INHERIT_ACE)) != - ACE_FILE_INHERIT_ACE) { - aclnode2 = zfs_acl_node_alloc(ace_size); - list_insert_tail(&aclp->z_acl, aclnode2); - acep2 = aclnode2->z_acldata; - zfs_set_ace(aclp, acep2, - access_mask, type, who, - iflags|ACE_INHERITED_ACE); - newflags |= ACE_INHERIT_ONLY_ACE; - aclp->z_ops.ace_flags_set(acep, newflags); - newflags &= ~ALL_INHERIT; - aclp->z_ops.ace_flags_set(acep2, - newflags|ACE_INHERITED_ACE); - - /* - * Copy special opaque data if any - */ - if ((data1sz = aclp->z_ops.ace_data(acep, - &data1)) != 0) { - VERIFY((data2sz = - aclp->z_ops.ace_data(acep2, - &data2)) == data1sz); - bcopy(data1, data2, data1sz); - } - aclp->z_acl_count++; - aclnode2->z_ace_count++; - aclp->z_acl_bytes += aclnode->z_size; - zfs_restricted_update(zfsvfs, aclp, acep2); - } else { - newflags |= ACE_INHERIT_ONLY_ACE; - aclp->z_ops.ace_flags_set(acep, - newflags|ACE_INHERITED_ACE); - } + zfs_restricted_update(zfsvfs, aclp, acep2); + } else { + newflags |= ACE_INHERIT_ONLY_ACE; + aclp->z_ops.ace_flags_set(acep, + newflags|ACE_INHERITED_ACE); } } return (aclp); @@ -1876,7 +1888,7 @@ zfs_perm_init(znode_t *zp, znode_t *pare mutex_enter(&parent->z_acl_lock); VERIFY(0 == zfs_acl_node_read(parent, &paclp, B_FALSE)); mutex_exit(&parent->z_acl_lock); - aclp = zfs_acl_inherit(zp, paclp, &need_chmod); + aclp = zfs_acl_inherit(zp, paclp, mode, &need_chmod); zfs_acl_free(paclp); } else { aclp = zfs_acl_alloc(zfs_acl_version_zp(zp)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Dec 28 22:14:49 2009 (r201142) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Dec 28 22:15:11 2009 (r201143) @@ -1491,6 +1491,14 @@ zfs_set_prop_nvlist(const char *name, nv if (zpl_earlier_version(name, ZPL_VERSION_FUID)) return (ENOTSUP); break; + + case ZFS_PROP_ACLINHERIT: + if (nvpair_type(elem) == DATA_TYPE_UINT64 && + nvpair_value_uint64(elem, &intval) == 0) + if (intval == ZFS_ACL_PASSTHROUGH_X && + zfs_earlier_version(name, + SPA_VERSION_PASSTHROUGH_X)) + return (ENOTSUP); } } Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Dec 28 22:14:49 2009 (r201142) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Dec 28 22:15:11 2009 (r201143) @@ -253,13 +253,14 @@ typedef enum zfs_cache_type { #define SPA_VERSION_11 11ULL #define SPA_VERSION_12 12ULL #define SPA_VERSION_13 13ULL +#define SPA_VERSION_14 14ULL /* * When bumping up SPA_VERSION, make sure GRUB ZFS understands the on-disk * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*}, * and do the appropriate changes. */ -#define SPA_VERSION SPA_VERSION_13 -#define SPA_VERSION_STRING "13" +#define SPA_VERSION SPA_VERSION_14 +#define SPA_VERSION_STRING "14" /* * Symbolic names for the changes that caused a SPA_VERSION switch. @@ -294,6 +295,7 @@ typedef enum zfs_cache_type { #define SPA_VERSION_DSL_SCRUB SPA_VERSION_11 #define SPA_VERSION_SNAP_PROPS SPA_VERSION_12 #define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13 +#define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14 /* * ZPL version - rev'd whenever an incompatible on-disk format change From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 22:23:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02A6910656AE; Mon, 28 Dec 2009 22:23:05 +0000 (UTC) (envelope-from emss.mail@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id 295418FC0A; Mon, 28 Dec 2009 22:23:03 +0000 (UTC) Received: by ewy26 with SMTP id 26so7812751ewy.3 for ; Mon, 28 Dec 2009 14:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received :x-virus-scanned:received:received:to:cc:subject:from:in-reply-to :references:x-operating-system:date:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=s0Rk3fQzpsxh9E+PZOlpiWh/OxrVRNSq8aY47NNek5Q=; b=VY/h0QIUbWNXICUumTcGi6jHbrdXyBdt5TMH+ojEtOrmppzFZfmPi5Lw03Gtr+ZK/z Ckabz9nuqbl3TYKS7lVtTWQHM4qq3zfmwjai77MFL0Tah190bax3n0ZNWEI04Y2RyDDp lJnOwap5sxR3DvELI+fUQ4vaGxUVvWLFxV3Z4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:x-virus-scanned:to:cc:subject:from:in-reply-to:references :x-operating-system:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; b=oa0CuxGHr42XMKMQlaQZLxuH9vj7uh1SEs8b11fq7f2WYkmz0gfvlioPpLCfJ22iQr hJHgbLhM0O1tHSKJqgWGligAC+wKOuBlh2/htO0B2jwHSTTysYMirzZxNk2m8ukCOWNJ fwFilzSGygYtRuQcAA+0aNZZBiI5C3AGwZOf8= Received: by 10.213.97.91 with SMTP id k27mr7343818ebn.51.1262037480537; Mon, 28 Dec 2009 13:58:00 -0800 (PST) Received: from srvbsdfenssv.interne.associated-bears.org (LCaen-151-92-21-48.w217-128.abo.wanadoo.fr [217.128.200.48]) by mx.google.com with ESMTPS id 24sm25040154eyx.30.2009.12.28.13.57.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Dec 2009 13:58:00 -0800 (PST) Sender: Eric Masson Received: from localhost (localhost [127.0.0.1]) by srvbsdfenssv.interne.associated-bears.org (Postfix) with ESMTP id 449C11D5F1; Mon, 28 Dec 2009 22:57:58 +0100 (CET) X-Virus-Scanned: amavisd-new at interne.associated-bears.org Received: from srvbsdfenssv.interne.associated-bears.org ([127.0.0.1]) by localhost (srvbsdfenssv.interne.associated-bears.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5cYnggwUpC28; Mon, 28 Dec 2009 22:57:54 +0100 (CET) Received: by srvbsdfenssv.interne.associated-bears.org (Postfix, from userid 1001) id C5BA11D525; Mon, 28 Dec 2009 22:57:54 +0100 (CET) To: Luigi Rizzo From: Eric Masson In-Reply-To: <20091228220144.GA38493@onelab2.iet.unipi.it> (Luigi Rizzo's message of "Mon, 28 Dec 2009 23:01:44 +0100") References: <200912282114.nBSLEJVj001562@svn.freebsd.org> <20091228220144.GA38493@onelab2.iet.unipi.it> X-Operating-System: FreeBSD 8.0-RELEASE-p1 amd64 Date: Mon, 28 Dec 2009 22:57:54 +0100 Message-ID: <867hs6n4m5.fsf@srvbsdfenssv.interne.associated-bears.org> User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.5-b28 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r201141 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 22:23:05 -0000 Luigi Rizzo writes: Hello, > does it give a warning or an error ? I tried a buildkernel (i386) and > also a picobsd build and neither give any warning. Warning treated as error, bz@'commit fixes -current build. -- Excusez-moi pour ce message perso mais y'a urgence. Régis X de Chambéry et Thierry Y de Strasbourg sont priés de prendre contact avec le Bureau de LUCCAS par mail. -+- In : GNU - Le bonheur c'est simple comme un coup de fil -+- From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 22:24:54 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D1931065672; Mon, 28 Dec 2009 22:24:54 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id D8DA98FC1C; Mon, 28 Dec 2009 22:24:53 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 4C147A5CC9D; Tue, 29 Dec 2009 06:24:52 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id MlUsN7IzpMkK; Tue, 29 Dec 2009 06:24:44 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 8B260A5CC2C; Tue, 29 Dec 2009 06:24:42 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=uIW9t29nNlvdBrnK8GM0yUSsg3LmBc563fD9Rbc9lEjYANuDqdCsdO1o8aLb2Snyg ku8ypYsaIBXAhMTxOmoSg== Message-ID: <4B393025.1000606@delphij.net> Date: Mon, 28 Dec 2009 14:24:37 -0800 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20091220 Thunderbird/3.0 ThunderBrowse/3.2.6.8 MIME-Version: 1.0 To: Xin LI References: <200912282215.nBSMFCw3002728@svn.freebsd.org> In-Reply-To: <200912282215.nBSMFCw3002728@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r201143 - in head: cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolar... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: 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, 28 Dec 2009 22:24:54 -0000 On 2009/12/28 14:15, Xin LI wrote: > Author: delphij > Date: Mon Dec 28 22:15:11 2009 > New Revision: 201143 > URL: http://svn.freebsd.org/changeset/base/201143 > > Log: > Apply OpenSolaris revision 8012 which brings our zpool to version 14, Sorry but this should read: > Apply OpenSolaris revision *8053* which brings our zpool to version 14, > making it possible for zpools created on OpenSolaris 2009.06 be used > on FreeBSD. -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 22:56:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E86C61065679; Mon, 28 Dec 2009 22:56:30 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4DB28FC14; Mon, 28 Dec 2009 22:56:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSMuUo9003733; Mon, 28 Dec 2009 22:56:30 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSMuUV9003701; Mon, 28 Dec 2009 22:56:30 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <200912282256.nBSMuUV9003701@svn.freebsd.org> From: Antoine Brodin Date: Mon, 28 Dec 2009 22:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201145 - in head: bin/pkill lib/libc/gen lib/libgssapi lib/librpcsec_gss sbin/fsck_ffs sbin/ggate/ggated sbin/natd sbin/routed sys/boot/ofw/libofw sys/dev/ksyms sys/dev/led sys/dev/md ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 22:56:32 -0000 Author: antoine Date: Mon Dec 28 22:56:30 2009 New Revision: 201145 URL: http://svn.freebsd.org/changeset/base/201145 Log: (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument. Fix some wrong usages. Note: this does not affect generated binaries as this argument is not used. PR: 137213 Submitted by: Eygene Ryabinkin (initial version) MFC after: 1 month Modified: head/bin/pkill/pkill.c head/lib/libc/gen/sem.c head/lib/libgssapi/gss_mech_switch.c head/lib/librpcsec_gss/rpcsec_gss_conf.c head/lib/librpcsec_gss/svc_rpcsec_gss.c head/sbin/fsck_ffs/gjournal.c head/sbin/ggate/ggated/ggated.c head/sbin/natd/natd.c head/sbin/routed/if.c head/sys/boot/ofw/libofw/ofw_disk.c head/sys/dev/ksyms/ksyms.c head/sys/dev/led/led.c head/sys/dev/md/md.c head/sys/dev/sound/pcm/channel.c head/sys/dev/sound/pcm/sndstat.c head/sys/geom/gate/g_gate.c head/sys/ia64/ia64/sscdisk.c head/sys/kern/kern_conf.c head/sys/kern/kern_jail.c head/sys/kern/uipc_accf.c head/sys/kern/vfs_mount.c head/sys/netgraph/atm/uni/ng_uni.c head/sys/netgraph/ng_base.c head/sys/netinet/ip_encap.c head/sys/netinet/libalias/alias_mod.c head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c head/sys/vm/uma_core.c head/tools/regression/geom/ConfCmp/ConfCmp.c head/usr.sbin/cpucontrol/cpucontrol.c head/usr.sbin/pmcstat/pmcstat_log.c head/usr.sbin/ypserv/yp_main.c Modified: head/bin/pkill/pkill.c ============================================================================== --- head/bin/pkill/pkill.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/bin/pkill/pkill.c Mon Dec 28 22:56:30 2009 (r201145) @@ -113,14 +113,14 @@ static int cflags = REG_EXTENDED; static kvm_t *kd; static pid_t mypid; -static struct listhead euidlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead ruidlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead rgidlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead pgrplist = SLIST_HEAD_INITIALIZER(list); -static struct listhead ppidlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead tdevlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead sidlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead jidlist = SLIST_HEAD_INITIALIZER(list); +static struct listhead euidlist = SLIST_HEAD_INITIALIZER(euidlist); +static struct listhead ruidlist = SLIST_HEAD_INITIALIZER(ruidlist); +static struct listhead rgidlist = SLIST_HEAD_INITIALIZER(rgidlist); +static struct listhead pgrplist = SLIST_HEAD_INITIALIZER(pgrplist); +static struct listhead ppidlist = SLIST_HEAD_INITIALIZER(ppidlist); +static struct listhead tdevlist = SLIST_HEAD_INITIALIZER(tdevlist); +static struct listhead sidlist = SLIST_HEAD_INITIALIZER(sidlist); +static struct listhead jidlist = SLIST_HEAD_INITIALIZER(jidlist); static void usage(void) __attribute__((__noreturn__)); static int killact(const struct kinfo_proc *); Modified: head/lib/libc/gen/sem.c ============================================================================== --- head/lib/libc/gen/sem.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/lib/libc/gen/sem.c Mon Dec 28 22:56:30 2009 (r201145) @@ -73,7 +73,7 @@ static sem_t sem_alloc(unsigned int value, semid_t semid, int system_sem); static void sem_free(sem_t sem); -static LIST_HEAD(, sem) named_sems = LIST_HEAD_INITIALIZER(&named_sems); +static LIST_HEAD(, sem) named_sems = LIST_HEAD_INITIALIZER(named_sems); static pthread_mutex_t named_sems_mtx = PTHREAD_MUTEX_INITIALIZER; __weak_reference(__sem_init, sem_init); Modified: head/lib/libgssapi/gss_mech_switch.c ============================================================================== --- head/lib/libgssapi/gss_mech_switch.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/lib/libgssapi/gss_mech_switch.c Mon Dec 28 22:56:30 2009 (r201145) @@ -42,7 +42,7 @@ #endif struct _gss_mech_switch_list _gss_mechs = - SLIST_HEAD_INITIALIZER(&_gss_mechs); + SLIST_HEAD_INITIALIZER(_gss_mechs); gss_OID_set _gss_mech_oids; /* Modified: head/lib/librpcsec_gss/rpcsec_gss_conf.c ============================================================================== --- head/lib/librpcsec_gss/rpcsec_gss_conf.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/lib/librpcsec_gss/rpcsec_gss_conf.c Mon Dec 28 22:56:30 2009 (r201145) @@ -55,7 +55,7 @@ struct mech_info { }; SLIST_HEAD(mech_info_list, mech_info); -static struct mech_info_list mechs = SLIST_HEAD_INITIALIZER(&mechs); +static struct mech_info_list mechs = SLIST_HEAD_INITIALIZER(mechs); static const char **mech_names; struct qop_info { @@ -66,7 +66,7 @@ struct qop_info { }; SLIST_HEAD(qop_info_list, qop_info); -static struct qop_info_list qops = SLIST_HEAD_INITIALIZER(&qops); +static struct qop_info_list qops = SLIST_HEAD_INITIALIZER(qops); static int _rpc_gss_string_to_oid(const char* s, gss_OID oid) Modified: head/lib/librpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/lib/librpcsec_gss/svc_rpcsec_gss.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/lib/librpcsec_gss/svc_rpcsec_gss.c Mon Dec 28 22:56:30 2009 (r201145) @@ -90,7 +90,7 @@ struct svc_rpc_gss_callback { rpc_gss_callback_t cb_callback; }; static SLIST_HEAD(svc_rpc_gss_callback_list, svc_rpc_gss_callback) - svc_rpc_gss_callbacks = SLIST_HEAD_INITIALIZER(&svc_rpc_gss_callbacks); + svc_rpc_gss_callbacks = SLIST_HEAD_INITIALIZER(svc_rpc_gss_callbacks); struct svc_rpc_gss_svc_name { SLIST_ENTRY(svc_rpc_gss_svc_name) sn_link; @@ -102,7 +102,7 @@ struct svc_rpc_gss_svc_name { u_int sn_version; }; static SLIST_HEAD(svc_rpc_gss_svc_name_list, svc_rpc_gss_svc_name) - svc_rpc_gss_svc_names = SLIST_HEAD_INITIALIZER(&svc_rpc_gss_svc_names); + svc_rpc_gss_svc_names = SLIST_HEAD_INITIALIZER(svc_rpc_gss_svc_names); enum svc_rpc_gss_client_state { CLIENT_NEW, /* still authenticating */ Modified: head/sbin/fsck_ffs/gjournal.c ============================================================================== --- head/sbin/fsck_ffs/gjournal.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sbin/fsck_ffs/gjournal.c Mon Dec 28 22:56:30 2009 (r201145) @@ -86,7 +86,7 @@ struct cgchain { #define MAX_CACHED_CGS 1024 static unsigned ncgs = 0; -static LIST_HEAD(, cgchain) cglist = LIST_HEAD_INITIALIZER(&cglist); +static LIST_HEAD(, cgchain) cglist = LIST_HEAD_INITIALIZER(cglist); static const char *devnam; static struct uufsd *disk = NULL; Modified: head/sbin/ggate/ggated/ggated.c ============================================================================== --- head/sbin/ggate/ggated/ggated.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sbin/ggate/ggated/ggated.c Mon Dec 28 22:56:30 2009 (r201145) @@ -99,8 +99,8 @@ static TAILQ_HEAD(, ggd_request) outqueu pthread_mutex_t inqueue_mtx, outqueue_mtx; pthread_cond_t inqueue_cond, outqueue_cond; -static SLIST_HEAD(, ggd_export) exports = SLIST_HEAD_INITIALIZER(&exports); -static LIST_HEAD(, ggd_connection) connections = LIST_HEAD_INITIALIZER(&connection); +static SLIST_HEAD(, ggd_export) exports = SLIST_HEAD_INITIALIZER(exports); +static LIST_HEAD(, ggd_connection) connections = LIST_HEAD_INITIALIZER(connections); static void *recv_thread(void *arg); static void *disk_thread(void *arg); Modified: head/sbin/natd/natd.c ============================================================================== --- head/sbin/natd/natd.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sbin/natd/natd.c Mon Dec 28 22:56:30 2009 (r201145) @@ -68,7 +68,7 @@ struct instance { int divertInOut; }; -static LIST_HEAD(, instance) root = LIST_HEAD_INITIALIZER(&root); +static LIST_HEAD(, instance) root = LIST_HEAD_INITIALIZER(root); struct libalias *mla; struct instance *mip; Modified: head/sbin/routed/if.c ============================================================================== --- head/sbin/routed/if.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sbin/routed/if.c Mon Dec 28 22:56:30 2009 (r201145) @@ -42,7 +42,7 @@ __RCSID("$Revision: 2.27 $"); #endif struct ifhead ifnet = LIST_HEAD_INITIALIZER(ifnet); /* all interfaces */ -struct ifhead remote_if = LIST_HEAD_INITIALIZER(ifnet); /* remote interfaces */ +struct ifhead remote_if = LIST_HEAD_INITIALIZER(remote_if); /* remote interfaces */ /* hash table for all interfaces, big enough to tolerate ridiculous * numbers of IP aliases. Crazy numbers of aliases such as 7000 Modified: head/sys/boot/ofw/libofw/ofw_disk.c ============================================================================== --- head/sys/boot/ofw/libofw/ofw_disk.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/boot/ofw/libofw/ofw_disk.c Mon Dec 28 22:56:30 2009 (r201145) @@ -67,7 +67,7 @@ struct opened_dev { SLIST_ENTRY(opened_dev) link; }; -SLIST_HEAD(, opened_dev) opened_devs = SLIST_HEAD_INITIALIZER(opened_dev); +SLIST_HEAD(, opened_dev) opened_devs = SLIST_HEAD_INITIALIZER(opened_devs); static int ofwd_init(void) Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/dev/ksyms/ksyms.c Mon Dec 28 22:56:30 2009 (r201145) @@ -94,7 +94,7 @@ struct ksyms_softc { static struct mtx ksyms_mtx; static struct cdev *ksyms_dev; static LIST_HEAD(, ksyms_softc) ksyms_list = - LIST_HEAD_INITIALIZER(&ksyms_list); + LIST_HEAD_INITIALIZER(ksyms_list); static const char ksyms_shstrtab[] = "\0" STR_SYMTAB "\0" STR_STRTAB "\0" STR_SHSTRTAB "\0"; Modified: head/sys/dev/led/led.c ============================================================================== --- head/sys/dev/led/led.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/dev/led/led.c Mon Dec 28 22:56:30 2009 (r201145) @@ -40,7 +40,7 @@ struct ledsc { static struct unrhdr *led_unit; static struct mtx led_mtx; static struct sx led_sx; -static LIST_HEAD(, ledsc) led_list = LIST_HEAD_INITIALIZER(&led_list); +static LIST_HEAD(, ledsc) led_list = LIST_HEAD_INITIALIZER(led_list); static struct callout led_ch; static MALLOC_DEFINE(M_LED, "LED", "LED driver"); Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/dev/md/md.c Mon Dec 28 22:56:30 2009 (r201145) @@ -152,7 +152,7 @@ struct g_class g_md_class = { DECLARE_GEOM_CLASS(g_md_class, g_md); -static LIST_HEAD(, md_s) md_softc_list = LIST_HEAD_INITIALIZER(&md_softc_list); +static LIST_HEAD(, md_s) md_softc_list = LIST_HEAD_INITIALIZER(md_softc_list); #define NINDIR (PAGE_SIZE / sizeof(uintptr_t)) #define NMASK (NINDIR-1) Modified: head/sys/dev/sound/pcm/channel.c ============================================================================== --- head/sys/dev/sound/pcm/channel.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/dev/sound/pcm/channel.c Mon Dec 28 22:56:30 2009 (r201145) @@ -220,7 +220,7 @@ MTX_SYSINIT(pcm_syncgroup, &snd_pcm_sync * * See SNDCTL_DSP_SYNCGROUP for more information. */ -struct pcm_synclist snd_pcm_syncgroups = SLIST_HEAD_INITIALIZER(head); +struct pcm_synclist snd_pcm_syncgroups = SLIST_HEAD_INITIALIZER(snd_pcm_syncgroups); static void chn_lockinit(struct pcm_channel *c, int dir) Modified: head/sys/dev/sound/pcm/sndstat.c ============================================================================== --- head/sys/dev/sound/pcm/sndstat.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/dev/sound/pcm/sndstat.c Mon Dec 28 22:56:30 2009 (r201145) @@ -79,7 +79,7 @@ static int sndstat_files = 0; } \ } while (0) -static SLIST_HEAD(, sndstat_entry) sndstat_devlist = SLIST_HEAD_INITIALIZER(none); +static SLIST_HEAD(, sndstat_entry) sndstat_devlist = SLIST_HEAD_INITIALIZER(sndstat_devlist); int snd_verbose = 1; TUNABLE_INT("hw.snd.verbose", &snd_verbose); Modified: head/sys/geom/gate/g_gate.c ============================================================================== --- head/sys/geom/gate/g_gate.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/geom/gate/g_gate.c Mon Dec 28 22:56:30 2009 (r201145) @@ -72,7 +72,7 @@ static struct cdevsw g_gate_cdevsw = { static LIST_HEAD(, g_gate_softc) g_gate_list = - LIST_HEAD_INITIALIZER(&g_gate_list); + LIST_HEAD_INITIALIZER(g_gate_list); static struct mtx g_gate_list_mtx; Modified: head/sys/ia64/ia64/sscdisk.c ============================================================================== --- head/sys/ia64/ia64/sscdisk.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/ia64/ia64/sscdisk.c Mon Dec 28 22:56:30 2009 (r201145) @@ -76,7 +76,7 @@ MALLOC_DEFINE(M_SSC, "ssc_disk", "Simula static d_strategy_t sscstrategy; -static LIST_HEAD(, ssc_s) ssc_softc_list = LIST_HEAD_INITIALIZER(&ssc_softc_list); +static LIST_HEAD(, ssc_s) ssc_softc_list = LIST_HEAD_INITIALIZER(ssc_softc_list); struct ssc_s { int unit; Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/kern/kern_conf.c Mon Dec 28 22:56:30 2009 (r201145) @@ -63,7 +63,7 @@ static struct cdev *make_dev_credv(int f static struct cdev_priv_list cdevp_free_list = TAILQ_HEAD_INITIALIZER(cdevp_free_list); static SLIST_HEAD(free_cdevsw, cdevsw) cdevsw_gt_post_list = - SLIST_HEAD_INITIALIZER(); + SLIST_HEAD_INITIALIZER(cdevsw_gt_post_list); void dev_lock(void) Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/kern/kern_jail.c Mon Dec 28 22:56:30 2009 (r201145) @@ -87,7 +87,7 @@ struct prison prison0 = { .pr_securelevel = -1, .pr_childmax = JAIL_MAX, .pr_hostuuid = DEFAULT_HOSTUUID, - .pr_children = LIST_HEAD_INITIALIZER(&prison0.pr_children), + .pr_children = LIST_HEAD_INITIALIZER(prison0.pr_children), #ifdef VIMAGE .pr_flags = PR_HOST|PR_VNET, #else Modified: head/sys/kern/uipc_accf.c ============================================================================== --- head/sys/kern/uipc_accf.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/kern/uipc_accf.c Mon Dec 28 22:56:30 2009 (r201145) @@ -54,7 +54,7 @@ MTX_SYSINIT(accept_filter, &accept_filte #define ACCEPT_FILTER_UNLOCK() mtx_unlock(&accept_filter_mtx) static SLIST_HEAD(, accept_filter) accept_filtlsthd = - SLIST_HEAD_INITIALIZER(&accept_filtlsthd); + SLIST_HEAD_INITIALIZER(accept_filtlsthd); MALLOC_DEFINE(M_ACCF, "accf", "accept filter data"); Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/kern/vfs_mount.c Mon Dec 28 22:56:30 2009 (r201145) @@ -1354,7 +1354,7 @@ struct root_hold_token { }; static LIST_HEAD(, root_hold_token) root_holds = - LIST_HEAD_INITIALIZER(&root_holds); + LIST_HEAD_INITIALIZER(root_holds); static int root_mount_complete; Modified: head/sys/netgraph/atm/uni/ng_uni.c ============================================================================== --- head/sys/netgraph/atm/uni/ng_uni.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/netgraph/atm/uni/ng_uni.c Mon Dec 28 22:56:30 2009 (r201145) @@ -771,18 +771,18 @@ struct unimem_debug { LIST_HEAD(unimem_debug_list, unimem_debug); static struct unimem_debug_list nguni_freemem[UNIMEM_TYPES] = { - LIST_HEAD_INITIALIZER(unimem_debug), - LIST_HEAD_INITIALIZER(unimem_debug), - LIST_HEAD_INITIALIZER(unimem_debug), - LIST_HEAD_INITIALIZER(unimem_debug), - LIST_HEAD_INITIALIZER(unimem_debug), + LIST_HEAD_INITIALIZER(nguni_freemem[0]), + LIST_HEAD_INITIALIZER(nguni_freemem[1]), + LIST_HEAD_INITIALIZER(nguni_freemem[2]), + LIST_HEAD_INITIALIZER(nguni_freemem[3]), + LIST_HEAD_INITIALIZER(nguni_freemem[4]), }; static struct unimem_debug_list nguni_usedmem[UNIMEM_TYPES] = { - LIST_HEAD_INITIALIZER(unimem_debug), - LIST_HEAD_INITIALIZER(unimem_debug), - LIST_HEAD_INITIALIZER(unimem_debug), - LIST_HEAD_INITIALIZER(unimem_debug), - LIST_HEAD_INITIALIZER(unimem_debug), + LIST_HEAD_INITIALIZER(nguni_usedmem[0]), + LIST_HEAD_INITIALIZER(nguni_usedmem[1]), + LIST_HEAD_INITIALIZER(nguni_usedmem[2]), + LIST_HEAD_INITIALIZER(nguni_usedmem[3]), + LIST_HEAD_INITIALIZER(nguni_usedmem[4]), }; static struct mtx nguni_unilist_mtx; Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/netgraph/ng_base.c Mon Dec 28 22:56:30 2009 (r201145) @@ -120,7 +120,7 @@ struct ng_node ng_deadnode = { 0, /* numhooks */ NULL, /* private */ 0, /* ID */ - LIST_HEAD_INITIALIZER(ng_deadnode.hooks), + LIST_HEAD_INITIALIZER(ng_deadnode.nd_hooks), {}, /* all_nodes list entry */ {}, /* id hashtable list entry */ { 0, Modified: head/sys/netinet/ip_encap.c ============================================================================== --- head/sys/netinet/ip_encap.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/netinet/ip_encap.c Mon Dec 28 22:56:30 2009 (r201145) @@ -103,7 +103,7 @@ static void encap_fillarg(struct mbuf *, */ static struct mtx encapmtx; MTX_SYSINIT(encapmtx, &encapmtx, "encapmtx", MTX_DEF); -LIST_HEAD(, encaptab) encaptab = LIST_HEAD_INITIALIZER(&encaptab); +LIST_HEAD(, encaptab) encaptab = LIST_HEAD_INITIALIZER(encaptab); /* * We currently keey encap_init() for source code compatibility reasons -- Modified: head/sys/netinet/libalias/alias_mod.c ============================================================================== --- head/sys/netinet/libalias/alias_mod.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/netinet/libalias/alias_mod.c Mon Dec 28 22:56:30 2009 (r201145) @@ -52,11 +52,11 @@ __FBSDID("$FreeBSD$"); #endif /* Protocol and userland module handlers chains. */ -LIST_HEAD(handler_chain, proto_handler) handler_chain = LIST_HEAD_INITIALIZER(foo); +LIST_HEAD(handler_chain, proto_handler) handler_chain = LIST_HEAD_INITIALIZER(handler_chain); #ifdef _KERNEL struct rwlock handler_rw; #endif -SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(foo); +SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(dll_chain); #ifdef _KERNEL Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Dec 28 22:56:30 2009 (r201145) @@ -100,7 +100,7 @@ struct svc_rpc_gss_callback { rpc_gss_callback_t cb_callback; }; static SLIST_HEAD(svc_rpc_gss_callback_list, svc_rpc_gss_callback) - svc_rpc_gss_callbacks = SLIST_HEAD_INITIALIZER(&svc_rpc_gss_callbacks); + svc_rpc_gss_callbacks = SLIST_HEAD_INITIALIZER(svc_rpc_gss_callbacks); struct svc_rpc_gss_svc_name { SLIST_ENTRY(svc_rpc_gss_svc_name) sn_link; @@ -112,7 +112,7 @@ struct svc_rpc_gss_svc_name { u_int sn_version; }; static SLIST_HEAD(svc_rpc_gss_svc_name_list, svc_rpc_gss_svc_name) - svc_rpc_gss_svc_names = SLIST_HEAD_INITIALIZER(&svc_rpc_gss_svc_names); + svc_rpc_gss_svc_names = SLIST_HEAD_INITIALIZER(svc_rpc_gss_svc_names); enum svc_rpc_gss_client_state { CLIENT_NEW, /* still authenticating */ Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/sys/vm/uma_core.c Mon Dec 28 22:56:30 2009 (r201145) @@ -122,14 +122,14 @@ static MALLOC_DEFINE(M_UMAHASH, "UMAHash static int bucketdisable = 1; /* Linked list of all kegs in the system */ -static LIST_HEAD(,uma_keg) uma_kegs = LIST_HEAD_INITIALIZER(&uma_kegs); +static LIST_HEAD(,uma_keg) uma_kegs = LIST_HEAD_INITIALIZER(uma_kegs); /* This mutex protects the keg list */ static struct mtx uma_mtx; /* Linked list of boot time pages */ static LIST_HEAD(,uma_slab) uma_boot_pages = - LIST_HEAD_INITIALIZER(&uma_boot_pages); + LIST_HEAD_INITIALIZER(uma_boot_pages); /* This mutex protects the boot time pages list */ static struct mtx uma_boot_pages_mtx; Modified: head/tools/regression/geom/ConfCmp/ConfCmp.c ============================================================================== --- head/tools/regression/geom/ConfCmp/ConfCmp.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/tools/regression/geom/ConfCmp/ConfCmp.c Mon Dec 28 22:56:30 2009 (r201145) @@ -74,7 +74,7 @@ struct ref { char *k2; }; -LIST_HEAD(, ref) refs = LIST_HEAD_INITIALIZER(&refs); +LIST_HEAD(, ref) refs = LIST_HEAD_INITIALIZER(refs); static struct node * new_node(void) Modified: head/usr.sbin/cpucontrol/cpucontrol.c ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/usr.sbin/cpucontrol/cpucontrol.c Mon Dec 28 22:56:30 2009 (r201145) @@ -83,7 +83,7 @@ struct datadir { const char *path; SLIST_ENTRY(datadir) next; }; -static SLIST_HEAD(, datadir) datadirs = SLIST_HEAD_INITIALIZER(&datadirs); +static SLIST_HEAD(, datadir) datadirs = SLIST_HEAD_INITIALIZER(datadirs); struct ucode_handler { ucode_probe_t *probe; Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/usr.sbin/pmcstat/pmcstat_log.c Mon Dec 28 22:56:30 2009 (r201145) @@ -141,7 +141,7 @@ struct pmcstat_pmcrecord { }; static LIST_HEAD(,pmcstat_pmcrecord) pmcstat_pmcs = - LIST_HEAD_INITIALIZER(&pmcstat_pmcs); + LIST_HEAD_INITIALIZER(pmcstat_pmcs); /* Modified: head/usr.sbin/ypserv/yp_main.c ============================================================================== --- head/usr.sbin/ypserv/yp_main.c Mon Dec 28 22:44:19 2009 (r201144) +++ head/usr.sbin/ypserv/yp_main.c Mon Dec 28 22:56:30 2009 (r201145) @@ -98,14 +98,14 @@ struct socklistent { SLIST_ENTRY(socklistent) sle_next; }; static SLIST_HEAD(, socklistent) sle_head = - SLIST_HEAD_INITIALIZER(&sle_head); + SLIST_HEAD_INITIALIZER(sle_head); struct bindaddrlistent { const char *ble_hostname; SLIST_ENTRY(bindaddrlistent) ble_next; }; static SLIST_HEAD(, bindaddrlistent) ble_head = - SLIST_HEAD_INITIALIZER(&ble_head); + SLIST_HEAD_INITIALIZER(ble_head); static char *servname = "0"; From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 23:01:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A27021065694; Mon, 28 Dec 2009 23:01:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 916538FC0C; Mon, 28 Dec 2009 23:01:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSN1OUR003949; Mon, 28 Dec 2009 23:01:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSN1Odv003945; Mon, 28 Dec 2009 23:01:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912282301.nBSN1Odv003945@svn.freebsd.org> From: Ed Schouten Date: Mon, 28 Dec 2009 23:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201146 - head/libexec/rpc.rusersd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 28 Dec 2009 23:01:24 -0000 Author: ed Date: Mon Dec 28 23:01:24 2009 New Revision: 201146 URL: http://svn.freebsd.org/changeset/base/201146 Log: Perform cleanups to rpc.rusersd: - Perform whitespace fixes. Use tabs instead of 8 spaces. - Make it build at WARNS=6. Modified: head/libexec/rpc.rusersd/Makefile head/libexec/rpc.rusersd/rusers_proc.c head/libexec/rpc.rusersd/rusersd.c Modified: head/libexec/rpc.rusersd/Makefile ============================================================================== --- head/libexec/rpc.rusersd/Makefile Mon Dec 28 22:56:30 2009 (r201145) +++ head/libexec/rpc.rusersd/Makefile Mon Dec 28 23:01:24 2009 (r201146) @@ -4,6 +4,8 @@ PROG = rpc.rusersd SRCS = rusersd.c rusers_proc.c MAN = rpc.rusersd.8 +WARNS?= 6 + DPADD= ${LIBRPCSVC} ${LIBUTIL} LDADD= -lrpcsvc -lutil Modified: head/libexec/rpc.rusersd/rusers_proc.c ============================================================================== --- head/libexec/rpc.rusersd/rusers_proc.c Mon Dec 28 22:56:30 2009 (r201145) +++ head/libexec/rpc.rusersd/rusers_proc.c Mon Dec 28 23:01:24 2009 (r201146) @@ -83,18 +83,20 @@ typedef char ut_line_t[UT_LINESIZE+1]; typedef char ut_name_t[UT_NAMESIZE+1]; typedef char ut_host_t[UT_HOSTSIZE+1]; -utmpidle utmp_idle[MAXUSERS]; -rutmp old_utmp[MAXUSERS]; -ut_line_t line[MAXUSERS]; -ut_name_t name[MAXUSERS]; -ut_host_t host[MAXUSERS]; +static utmpidle utmp_idle[MAXUSERS]; +static rutmp old_utmp[MAXUSERS]; +static ut_line_t line[MAXUSERS]; +static ut_name_t name[MAXUSERS]; +static ut_host_t host[MAXUSERS]; extern int from_inetd; -FILE *ufp; +void rusers_service(struct svc_req *, SVCXPRT *); + +static FILE *ufp; #ifdef XIDLE -Display *dpy; +static Display *dpy; static jmp_buf openAbort; @@ -106,211 +108,213 @@ abortOpen(void) XqueryIdle(char *display) { - int first_event, first_error; - Time IdleTime; + int first_event, first_error; + Time IdleTime; - (void) signal (SIGALRM, abortOpen); - (void) alarm ((unsigned) 10); - if (!setjmp (openAbort)) { - if (!(dpy= XOpenDisplay(display))) { - syslog(LOG_ERR, "Cannot open display %s", display); - return(-1); - } - if (XidleQueryExtension(dpy, &first_event, &first_error)) { - if (!XGetIdleTime(dpy, &IdleTime)) { - syslog(LOG_ERR, "%s: unable to get idle time", display); - return(-1); - } - } - else { - syslog(LOG_ERR, "%s: Xidle extension not loaded", display); - return(-1); - } - XCloseDisplay(dpy); - } - else { - syslog(LOG_ERR, "%s: server grabbed for over 10 seconds", display); - return(-1); - } - (void) signal (SIGALRM, SIG_DFL); - (void) alarm ((unsigned) 0); + (void) signal (SIGALRM, abortOpen); + (void) alarm ((unsigned) 10); + if (!setjmp (openAbort)) { + if (!(dpy= XOpenDisplay(display))) { + syslog(LOG_ERR, "Cannot open display %s", display); + return(-1); + } + if (XidleQueryExtension(dpy, &first_event, &first_error)) { + if (!XGetIdleTime(dpy, &IdleTime)) { + syslog(LOG_ERR, "%s: unable to get idle time", display); + return(-1); + } + } else { + syslog(LOG_ERR, "%s: Xidle extension not loaded", display); + return(-1); + } + XCloseDisplay(dpy); + } else { + syslog(LOG_ERR, "%s: server grabbed for over 10 seconds", display); + return(-1); + } + (void) signal (SIGALRM, SIG_DFL); + (void) alarm ((unsigned) 0); - IdleTime /= 1000; - return((IdleTime + 30) / 60); + IdleTime /= 1000; + return((IdleTime + 30) / 60); } #endif static u_int -getidle(char *tty, char *display) +getidle(const char *tty, const char *display __unused) { - struct stat st; - char devname[PATH_MAX]; - time_t now; - u_long idle; - - /* - * If this is an X terminal or console, then try the - * XIdle extension - */ + struct stat st; + char ttyname[PATH_MAX]; + time_t now; + u_long idle; + + /* + * If this is an X terminal or console, then try the + * XIdle extension + */ #ifdef XIDLE - if (display && *display && (idle = XqueryIdle(display)) >= 0) - return(idle); + if (display && *display && (idle = XqueryIdle(display)) >= 0) + return(idle); #endif - idle = 0; - if (*tty == 'X') { - u_long kbd_idle, mouse_idle; + idle = 0; + if (*tty == 'X') { + u_long kbd_idle, mouse_idle; #if !defined(__FreeBSD__) - kbd_idle = getidle("kbd", NULL); + kbd_idle = getidle("kbd", NULL); #else - kbd_idle = getidle("vga", NULL); + kbd_idle = getidle("vga", NULL); #endif - mouse_idle = getidle("mouse", NULL); - idle = (kbd_idle < mouse_idle)?kbd_idle:mouse_idle; - } - else { - sprintf(devname, "%s/%s", _PATH_DEV, tty); - if (stat(devname, &st) < 0) { + mouse_idle = getidle("mouse", NULL); + idle = (kbd_idle < mouse_idle)?kbd_idle:mouse_idle; + } else { + sprintf(ttyname, "%s/%s", _PATH_DEV, tty); + if (stat(ttyname, &st) < 0) { #ifdef DEBUG - printf("%s: %s\n", devname, strerror(errno)); + printf("%s: %s\n", ttyname, strerror(errno)); #endif - return(-1); - } - time(&now); + return(-1); + } + time(&now); #ifdef DEBUG - printf("%s: now=%d atime=%d\n", devname, now, - st.st_atime); + printf("%s: now=%d atime=%d\n", ttyname, now, + st.st_atime); #endif - idle = now - st.st_atime; - idle = (idle + 30) / 60; /* secs->mins */ - } - if (idle < 0) idle = 0; + idle = now - st.st_atime; + idle = (idle + 30) / 60; /* secs->mins */ + } - return(idle); + return(idle); } static utmpidlearr * -do_names_2(int all) +do_names_2(void) { - static utmpidlearr ut; + static utmpidlearr ut; struct utmp usr; - int nusers = 0; + int nusers = 0; - bzero((char *)&ut, sizeof(ut)); - ut.utmpidlearr_val = &utmp_idle[0]; + bzero((char *)&ut, sizeof(ut)); + ut.utmpidlearr_val = &utmp_idle[0]; ufp = fopen(_PATH_UTMP, "r"); - if (!ufp) { - syslog(LOG_ERR, "%m"); - return(&ut); - } - - /* only entries with both name and line fields */ - while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1 && - nusers < MAXUSERS) - if (*usr.ut_name && *usr.ut_line && + if (!ufp) { + syslog(LOG_ERR, "%m"); + return(&ut); + } + + /* only entries with both name and line fields */ + while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1 && + nusers < MAXUSERS) + if (*usr.ut_name && *usr.ut_line && strncmp(usr.ut_name, IGNOREUSER, - sizeof(usr.ut_name)) + sizeof(usr.ut_name)) #ifdef OSF - && usr.ut_type == USER_PROCESS + && usr.ut_type == USER_PROCESS #endif - ) { - utmp_idle[nusers].ui_utmp.ut_time = - usr.ut_time; - utmp_idle[nusers].ui_idle = - getidle(usr.ut_line, usr.ut_host); - utmp_idle[nusers].ui_utmp.ut_line = line[nusers]; - strncpy(line[nusers], usr.ut_line, UT_LINESIZE); - utmp_idle[nusers].ui_utmp.ut_name = name[nusers]; - strncpy(name[nusers], usr.ut_name, UT_NAMESIZE); - utmp_idle[nusers].ui_utmp.ut_host = host[nusers]; - strncpy(host[nusers], usr.ut_host, UT_HOSTSIZE); + ) { + utmp_idle[nusers].ui_utmp.ut_time = + usr.ut_time; + utmp_idle[nusers].ui_idle = + getidle(usr.ut_line, usr.ut_host); + utmp_idle[nusers].ui_utmp.ut_line = line[nusers]; + strncpy(line[nusers], usr.ut_line, UT_LINESIZE); + utmp_idle[nusers].ui_utmp.ut_name = name[nusers]; + strncpy(name[nusers], usr.ut_name, UT_NAMESIZE); + utmp_idle[nusers].ui_utmp.ut_host = host[nusers]; + strncpy(host[nusers], usr.ut_host, UT_HOSTSIZE); /* Make sure entries are NUL terminated */ line[nusers][UT_LINESIZE] = name[nusers][UT_NAMESIZE] = host[nusers][UT_HOSTSIZE] = '\0'; - nusers++; - } + nusers++; + } - ut.utmpidlearr_len = nusers; - fclose(ufp); - return(&ut); + ut.utmpidlearr_len = nusers; + fclose(ufp); + return(&ut); } -int * -rusers_num(void) +static int * +rusers_num(void *argp __unused, struct svc_req *rqstp __unused) { - static int num_users = 0; + static int num_users = 0; struct utmp usr; - ufp = fopen(_PATH_UTMP, "r"); - if (!ufp) { - syslog(LOG_ERR, "%m"); - return(NULL); - } - - /* only entries with both name and line fields */ - while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) - if (*usr.ut_name && *usr.ut_line && + ufp = fopen(_PATH_UTMP, "r"); + if (!ufp) { + syslog(LOG_ERR, "%m"); + return(NULL); + } + + /* only entries with both name and line fields */ + while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) + if (*usr.ut_name && *usr.ut_line && strncmp(usr.ut_name, IGNOREUSER, - sizeof(usr.ut_name)) + sizeof(usr.ut_name)) #ifdef OSF - && usr.ut_type == USER_PROCESS + && usr.ut_type == USER_PROCESS #endif - ) { - num_users++; - } + ) { + num_users++; + } - fclose(ufp); - return(&num_users); + fclose(ufp); + return(&num_users); } static utmparr * -do_names_1(int all) +do_names_1(void) { - utmpidlearr *utidle; - static utmparr ut; - int i; + utmpidlearr *utidle; + static utmparr ut; + unsigned int i; + + bzero((char *)&ut, sizeof(ut)); + + utidle = do_names_2(); + if (utidle) { + ut.utmparr_len = utidle->utmpidlearr_len; + ut.utmparr_val = &old_utmp[0]; + for (i = 0; i < ut.utmparr_len; i++) + bcopy(&utmp_idle[i].ui_utmp, &old_utmp[i], + sizeof(old_utmp[0])); - bzero((char *)&ut, sizeof(ut)); - - utidle = do_names_2(all); - if (utidle) { - ut.utmparr_len = utidle->utmpidlearr_len; - ut.utmparr_val = &old_utmp[0]; - for (i = 0; i < ut.utmparr_len; i++) - bcopy(&utmp_idle[i].ui_utmp, &old_utmp[i], - sizeof(old_utmp[0])); - - } + } - return(&ut); + return(&ut); } utmpidlearr * -rusersproc_names_2_svc(void *argp, struct svc_req *rqstp) +rusersproc_names_2_svc(void *argp __unused, struct svc_req *rqstp __unused) { - return(do_names_2(0)); + + return (do_names_2()); } utmpidlearr * -rusersproc_allnames_2_svc(void *argp, struct svc_req *rqstp) +rusersproc_allnames_2_svc(void *argp __unused, struct svc_req *rqstp __unused) { - return(do_names_2(1)); + + return (do_names_2()); } utmparr * -rusersproc_names_1_svc(void *argp, struct svc_req *rqstp) +rusersproc_names_1_svc(void *argp __unused, struct svc_req *rqstp __unused) { - return(do_names_1(0)); + + return (do_names_1()); } utmparr * -rusersproc_allnames_1_svc(void *argp, struct svc_req *rqstp) +rusersproc_allnames_1_svc(void *argp __unused, struct svc_req *rqstp __unused) { - return(do_names_1(1)); + + return (do_names_1()); } +typedef void *(*rusersproc_t)(void *, struct svc_req *); + void rusers_service(struct svc_req *rqstp, SVCXPRT *transp) { @@ -318,8 +322,8 @@ rusers_service(struct svc_req *rqstp, SV int fill; } argument; char *result; - bool_t (*xdr_argument)(), (*xdr_result)(); - char *(*local)(); + xdrproc_t xdr_argument, xdr_result; + rusersproc_t local; switch (rqstp->rq_proc) { case NULLPROC: @@ -327,43 +331,43 @@ rusers_service(struct svc_req *rqstp, SV goto leave; case RUSERSPROC_NUM: - xdr_argument = xdr_void; - xdr_result = xdr_int; - local = (char *(*)()) rusers_num; + xdr_argument = (xdrproc_t)xdr_void; + xdr_result = (xdrproc_t)xdr_int; + local = (rusersproc_t)rusers_num; break; case RUSERSPROC_NAMES: - xdr_argument = xdr_void; - xdr_result = xdr_utmpidlearr; - switch (rqstp->rq_vers) { - case RUSERSVERS_ORIG: - local = (char *(*)()) rusersproc_names_1_svc; - break; - case RUSERSVERS_IDLE: - local = (char *(*)()) rusersproc_names_2_svc; - break; - default: - svcerr_progvers(transp, RUSERSVERS_ORIG, RUSERSVERS_IDLE); - goto leave; - /*NOTREACHED*/ - } + xdr_argument = (xdrproc_t)xdr_void; + xdr_result = (xdrproc_t)xdr_utmpidlearr; + switch (rqstp->rq_vers) { + case RUSERSVERS_ORIG: + local = (rusersproc_t)rusersproc_names_1_svc; + break; + case RUSERSVERS_IDLE: + local = (rusersproc_t)rusersproc_names_2_svc; + break; + default: + svcerr_progvers(transp, RUSERSVERS_ORIG, RUSERSVERS_IDLE); + goto leave; + /*NOTREACHED*/ + } break; case RUSERSPROC_ALLNAMES: - xdr_argument = xdr_void; - xdr_result = xdr_utmpidlearr; - switch (rqstp->rq_vers) { - case RUSERSVERS_ORIG: - local = (char *(*)()) rusersproc_allnames_1_svc; - break; - case RUSERSVERS_IDLE: - local = (char *(*)()) rusersproc_allnames_2_svc; - break; - default: - svcerr_progvers(transp, RUSERSVERS_ORIG, RUSERSVERS_IDLE); - goto leave; - /*NOTREACHED*/ - } + xdr_argument = (xdrproc_t)xdr_void; + xdr_result = (xdrproc_t)xdr_utmpidlearr; + switch (rqstp->rq_vers) { + case RUSERSVERS_ORIG: + local = (rusersproc_t)rusersproc_allnames_1_svc; + break; + case RUSERSVERS_IDLE: + local = (rusersproc_t)rusersproc_allnames_2_svc; + break; + default: + svcerr_progvers(transp, RUSERSVERS_ORIG, RUSERSVERS_IDLE); + goto leave; + /*NOTREACHED*/ + } break; default: @@ -385,6 +389,6 @@ rusers_service(struct svc_req *rqstp, SV exit(1); } leave: - if (from_inetd) - exit(0); + if (from_inetd) + exit(0); } Modified: head/libexec/rpc.rusersd/rusersd.c ============================================================================== --- head/libexec/rpc.rusersd/rusersd.c Mon Dec 28 22:56:30 2009 (r201145) +++ head/libexec/rpc.rusersd/rusersd.c Mon Dec 28 23:01:24 2009 (r201146) @@ -49,42 +49,42 @@ extern void rusers_service(struct svc_re int from_inetd = 1; -void +static void cleanup(int sig __unused) { - (void) rpcb_unset(RUSERSPROG, RUSERSVERS_IDLE, NULL); - (void) rpcb_unset(RUSERSPROG, RUSERSVERS_ORIG, NULL); - exit(0); + (void) rpcb_unset(RUSERSPROG, RUSERSVERS_IDLE, NULL); + (void) rpcb_unset(RUSERSPROG, RUSERSVERS_ORIG, NULL); + exit(0); } int -main(int argc, char *argv[]) +main(int argc __unused, char *argv[] __unused) { - SVCXPRT *transp; + SVCXPRT *transp = NULL; /* Keep compiler happy. */ int ok; struct sockaddr_storage from; socklen_t fromlen; - /* - * See if inetd started us - */ + /* + * See if inetd started us + */ fromlen = sizeof(from); - if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) { - from_inetd = 0; - } + if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) { + from_inetd = 0; + } - if (!from_inetd) { - daemon(0, 0); + if (!from_inetd) { + daemon(0, 0); - (void) rpcb_unset(RUSERSPROG, RUSERSVERS_IDLE, NULL); - (void) rpcb_unset(RUSERSPROG, RUSERSVERS_ORIG, NULL); + (void) rpcb_unset(RUSERSPROG, RUSERSVERS_IDLE, NULL); + (void) rpcb_unset(RUSERSPROG, RUSERSVERS_ORIG, NULL); (void) signal(SIGINT, cleanup); (void) signal(SIGTERM, cleanup); (void) signal(SIGHUP, cleanup); - } + } - openlog("rpc.rusersd", LOG_CONS|LOG_PID, LOG_DAEMON); + openlog("rpc.rusersd", LOG_CONS|LOG_PID, LOG_DAEMON); if (from_inetd) { transp = svc_tli_create(0, NULL, NULL, 0, 0); @@ -112,7 +112,7 @@ main(int argc, char *argv[]) exit(1); } - svc_run(); + svc_run(); syslog(LOG_ERR, "svc_run returned"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 23:12:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99D25106566C; Mon, 28 Dec 2009 23:12:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 726448FC1A; Mon, 28 Dec 2009 23:12:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSNCChV004222; Mon, 28 Dec 2009 23:12:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSNCCeh004220; Mon, 28 Dec 2009 23:12:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912282312.nBSNCCeh004220@svn.freebsd.org> From: Ed Schouten Date: Mon, 28 Dec 2009 23:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201148 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 23:12:12 -0000 Author: ed Date: Mon Dec 28 23:12:12 2009 New Revision: 201148 URL: http://svn.freebsd.org/changeset/base/201148 Log: Don't forget to use `void' for sched_balance(). It has no arguments. Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Mon Dec 28 23:01:47 2009 (r201147) +++ head/sys/kern/sched_ule.c Mon Dec 28 23:12:12 2009 (r201148) @@ -774,7 +774,7 @@ sched_balance_group(struct cpu_group *cg } static void -sched_balance() +sched_balance(void) { struct tdq *tdq; From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 23:12:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F9CA1065679; Mon, 28 Dec 2009 23:12:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 269658FC13; Mon, 28 Dec 2009 23:12:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBSNCumG004268; Mon, 28 Dec 2009 23:12:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBSNCuOL004266; Mon, 28 Dec 2009 23:12:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912282312.nBSNCuOL004266@svn.freebsd.org> From: Ed Schouten Date: Mon, 28 Dec 2009 23:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201149 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 23:12:56 -0000 Author: ed Date: Mon Dec 28 23:12:55 2009 New Revision: 201149 URL: http://svn.freebsd.org/changeset/base/201149 Log: Use ANSI declarations instead of K&R. Modified: head/sys/sys/file.h Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Mon Dec 28 23:12:12 2009 (r201148) +++ head/sys/sys/file.h Mon Dec 28 23:12:55 2009 (r201149) @@ -216,87 +216,62 @@ static __inline fo_stat_t fo_stat; static __inline fo_close_t fo_close; static __inline int -fo_read(fp, uio, active_cred, flags, td) - struct file *fp; - struct uio *uio; - struct ucred *active_cred; - int flags; - struct thread *td; +fo_read(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) { return ((*fp->f_ops->fo_read)(fp, uio, active_cred, flags, td)); } static __inline int -fo_write(fp, uio, active_cred, flags, td) - struct file *fp; - struct uio *uio; - struct ucred *active_cred; - int flags; - struct thread *td; +fo_write(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) { return ((*fp->f_ops->fo_write)(fp, uio, active_cred, flags, td)); } static __inline int -fo_truncate(fp, length, active_cred, td) - struct file *fp; - off_t length; - struct ucred *active_cred; - struct thread *td; +fo_truncate(struct file *fp, off_t length, struct ucred *active_cred, + struct thread *td) { return ((*fp->f_ops->fo_truncate)(fp, length, active_cred, td)); } static __inline int -fo_ioctl(fp, com, data, active_cred, td) - struct file *fp; - u_long com; - void *data; - struct ucred *active_cred; - struct thread *td; +fo_ioctl(struct file *fp, u_long com, void *data, struct ucred *active_cred, + struct thread *td) { return ((*fp->f_ops->fo_ioctl)(fp, com, data, active_cred, td)); } static __inline int -fo_poll(fp, events, active_cred, td) - struct file *fp; - int events; - struct ucred *active_cred; - struct thread *td; +fo_poll(struct file *fp, int events, struct ucred *active_cred, + struct thread *td) { return ((*fp->f_ops->fo_poll)(fp, events, active_cred, td)); } static __inline int -fo_stat(fp, sb, active_cred, td) - struct file *fp; - struct stat *sb; - struct ucred *active_cred; - struct thread *td; +fo_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, + struct thread *td) { return ((*fp->f_ops->fo_stat)(fp, sb, active_cred, td)); } static __inline int -fo_close(fp, td) - struct file *fp; - struct thread *td; +fo_close(struct file *fp, struct thread *td) { return ((*fp->f_ops->fo_close)(fp, td)); } static __inline int -fo_kqfilter(fp, kn) - struct file *fp; - struct knote *kn; +fo_kqfilter(struct file *fp, struct knote *kn) { return ((*fp->f_ops->fo_kqfilter)(fp, kn)); From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 00:02:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1F55106568B; Tue, 29 Dec 2009 00:02:57 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1C508FC0C; Tue, 29 Dec 2009 00:02:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT02vjH005282; Tue, 29 Dec 2009 00:02:57 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT02v55005280; Tue, 29 Dec 2009 00:02:57 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912290002.nBT02v55005280@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 29 Dec 2009 00:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201150 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 00:02:57 -0000 Author: luigi Date: Tue Dec 29 00:02:57 2009 New Revision: 201150 URL: http://svn.freebsd.org/changeset/base/201150 Log: we really need htonl() here, see the comment a few lines above in the code. Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Mon Dec 28 23:12:55 2009 (r201149) +++ head/sys/netinet/ipfw/ip_fw2.c Tue Dec 29 00:02:57 2009 (r201150) @@ -1377,7 +1377,7 @@ do { \ else if (v == 2) key = htonl(dst_port); else if (v == 3) - key = htons(src_port); + key = htonl(src_port); else if (v == 4 || v == 5) { check_uidgid( (ipfw_insn_u32 *)cmd, From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 02:35:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44D9F1065695; Tue, 29 Dec 2009 02:35:51 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 354C98FC21; Tue, 29 Dec 2009 02:35:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT2Zpio008197; Tue, 29 Dec 2009 02:35:51 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT2ZpBs008195; Tue, 29 Dec 2009 02:35:51 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200912290235.nBT2ZpBs008195@svn.freebsd.org> From: Joseph Koshy Date: Tue, 29 Dec 2009 02:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201151 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 02:35:51 -0000 Author: jkoshy Date: Tue Dec 29 02:35:50 2009 New Revision: 201151 URL: http://svn.freebsd.org/changeset/base/201151 Log: Use VFS_{LOCK,UNLOCK}_GIANT() around the call to vrele(). Reviewed by: kib Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Dec 29 00:02:57 2009 (r201150) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Dec 29 02:35:50 2009 (r201151) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1625,6 +1626,7 @@ pmc_log_kernel_mappings(struct pmc *pm) static void pmc_log_process_mappings(struct pmc_owner *po, struct proc *p) { + int locked; vm_map_t map; struct vnode *vp; struct vmspace *vm; @@ -1733,7 +1735,11 @@ pmc_log_process_mappings(struct pmc_owne freepath = NULL; pmc_getfilename(vp, &fullpath, &freepath); last_vp = vp; + + locked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); + VFS_UNLOCK_GIANT(locked); + vp = NULL; pmclog_process_map_in(po, p->p_pid, start_addr, fullpath); if (freepath) From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 04:48:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 940AC1065695 for ; Tue, 29 Dec 2009 04:48:42 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id CBB928FC19 for ; Tue, 29 Dec 2009 04:48:41 +0000 (UTC) Received: (qmail 24807 invoked by uid 399); 29 Dec 2009 04:48:41 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 29 Dec 2009 04:48:41 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B398A2A.40002@FreeBSD.org> Date: Mon, 28 Dec 2009 20:48:42 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Ruslan Ermilov References: <200912211943.nBLJhNUU038425@svn.freebsd.org> <200912211459.21766.jhb@freebsd.org> <20091221220004.GA42400@alchemy.franken.de> <20091221.211648.632868945383134253.imp@bsdimp.com> <4B3129CD.20908@FreeBSD.org> <20091224144136.GA28793@edoofus.dev.vega.ru> In-Reply-To: <20091224144136.GA28793@edoofus.dev.vega.ru> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200797 - head/lib/libc/stdtime X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 04:48:42 -0000 Ruslan Ermilov wrote: > If you take GNU binutils/compiler from ports, I think we can already > do this, and without any changes to the build architecture. It's > just a matter of defining several make(1) variables, like CC, CXX, > CPP, LD, AS, NM, AR, specifying full paths of the desired binaries, > plus some environment variables (at least STRIPBIN, so that install(1) > calls the correct strip(1) binary). Could you detail this on the wiki? I think that would be a good place to start ... -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 05:00:01 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7E94106566B for ; Tue, 29 Dec 2009 05:00:01 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 566078FC19 for ; Tue, 29 Dec 2009 05:00:01 +0000 (UTC) Received: (qmail 5435 invoked by uid 399); 29 Dec 2009 05:00:00 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 29 Dec 2009 05:00:00 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B398CD1.306@FreeBSD.org> Date: Mon, 28 Dec 2009 21:00:01 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: "M. Warner Losh" References: <20091221220004.GA42400@alchemy.franken.de> <20091221.211648.632868945383134253.imp@bsdimp.com> <4B3129CD.20908@FreeBSD.org> <20091226.012231.475505532728794904.imp@bsdimp.com> In-Reply-To: <20091226.012231.475505532728794904.imp@bsdimp.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200797 - head/lib/libc/stdtime X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 05:00:01 -0000 M. Warner Losh wrote: > In message: <4B3129CD.20908@FreeBSD.org> > Doug Barton writes: > : M. Warner Losh wrote: > : > We really need newer binutils in the tree. > : > > : > And we need a way to compiler gplv3 binutils into the system for folks > : > that can do that without consequences... But many modern processors > : > need to have the gplv3 version of binutils and that will be a > : > continuing problem. One advantage of FreeBSD is its integration, > : > rather than having to play version whack-a-mole like you do with > : > embedded Linux. > : > : When "we" last had the gplv3 discussion there were two lines of > : thought that were proposed. One is "import llvm/clang" and the other > : was "improve the infrastructure to support toolchains from ports." I > : know that the llvm/clang project is moving forward, and I think that's > : a great long-term direction. > > Assuming that it supports the architectures we need well, which at the > present time it isn't clear that it will... The details of what compiler we use in the base aren't really interesting to me for the purpose of this discussion. I hope that we can find a BSD licensed alternative that's suitable for the base, but I think we are already getting left behind in terms of "things that require more recent compilers" and it's only going to get worse. > : In the short term I think we are well served on all fronts to modify > : the build architecture to better support compilers from ports. This > : would actually help with the llvm/clang testing too, and sidestep the > : problems of gplv3 stuff being in the base. TMK there has been no work > : on this direction at all, which is disappointing. > > The problem is that it really isn't a terribly viable solution, so why > waste a bunch of time on it? You're disregarding this as a possible solution because the concept doesn't fit your idea of what's possible or desirable. With all due respect I think closing your mind to the possibility is premature. > Does the build-world stop in the middle and rebuild stuff? Huh? Are you asking whether a world build with a compiler from ports should rebuild the port(s)? If so, I think the answer is pretty obviously no. > Right now we have finely matched libraries and > compilers, how does one address that problem with the compiler out in > the ports? One could argue that the current situation is actually not desirable, and making it more "plug and play" is a good goal regardless of what compiler we use. > You'll need a matched set of binutils as well (well, > matched meaning known compatible here), and the build system has a > strong bias towards the compiler knowing which ones to use.. These > problems can all be surmounted, but it just feels like a big kludge. Funny, I feel the same way about the current system. :) Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 05:20:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4836C106566C; Tue, 29 Dec 2009 05:20:13 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3411B8FC08; Tue, 29 Dec 2009 05:20:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT5KDfe011637; Tue, 29 Dec 2009 05:20:13 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT5KDs9011635; Tue, 29 Dec 2009 05:20:13 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290520.nBT5KDs9011635@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 05:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201155 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 05:20:13 -0000 Author: kientzle Date: Tue Dec 29 05:20:12 2009 New Revision: 201155 URL: http://svn.freebsd.org/changeset/base/201155 Log: 64-bit ino support and discourage bad use of this header. Modified: head/lib/libarchive/archive_write_private.h Modified: head/lib/libarchive/archive_write_private.h ============================================================================== --- head/lib/libarchive/archive_write_private.h Tue Dec 29 04:34:39 2009 (r201154) +++ head/lib/libarchive/archive_write_private.h Tue Dec 29 05:20:12 2009 (r201155) @@ -25,6 +25,10 @@ * $FreeBSD$ */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + #ifndef ARCHIVE_WRITE_PRIVATE_H_INCLUDED #define ARCHIVE_WRITE_PRIVATE_H_INCLUDED @@ -37,7 +41,7 @@ struct archive_write { /* Dev/ino of the archive being written. */ dev_t skip_file_dev; - ino_t skip_file_ino; + int64_t skip_file_ino; /* Utility: Pointer to a block of nulls. */ const unsigned char *nulls; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 05:28:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B821106568B; Tue, 29 Dec 2009 05:28:29 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4623C8FC13; Tue, 29 Dec 2009 05:28:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT5SSEx011860; Tue, 29 Dec 2009 05:28:28 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT5SSkK011858; Tue, 29 Dec 2009 05:28:28 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290528.nBT5SSkK011858@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 05:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201156 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 05:28:29 -0000 Author: kientzle Date: Tue Dec 29 05:28:28 2009 New Revision: 201156 URL: http://svn.freebsd.org/changeset/base/201156 Log: Various style and portability fixes, including: * Enforce option interface can only be used before the archive is opened * Correctly handle large skips on platforms with 32-bit off_t * Use int64_t instead of off_t Modified: head/lib/libarchive/archive_read.c Modified: head/lib/libarchive/archive_read.c ============================================================================== --- head/lib/libarchive/archive_read.c Tue Dec 29 05:20:12 2009 (r201155) +++ head/lib/libarchive/archive_read.c Tue Dec 29 05:28:28 2009 (r201156) @@ -121,6 +121,9 @@ archive_read_set_format_options(struct a size_t i; int len, r; + __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, + "archive_read_set_format_options"); + if (s == NULL || *s == '\0') return (ARCHIVE_OK); a = (struct archive_read *)_a; @@ -165,12 +168,14 @@ archive_read_set_filter_options(struct a char key[64], val[64]; int len, r; + __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, + "archive_read_set_filter_options"); + if (s == NULL || *s == '\0') return (ARCHIVE_OK); a = (struct archive_read *)_a; __archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_set_filter_options"); - filter = a->filter; len = 0; for (filter = a->filter; filter != NULL; filter = filter->upstream) { bidder = filter->bidder; @@ -206,6 +211,10 @@ archive_read_set_options(struct archive { int r; + __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, + "archive_read_set_options"); + archive_clear_error(_a); + r = archive_read_set_format_options(_a, s); if (r != ARCHIVE_OK) return (r); @@ -242,13 +251,26 @@ client_read_proxy(struct archive_read_fi static int64_t client_skip_proxy(struct archive_read_filter *self, int64_t request) { - int64_t r; + int64_t ask, get, total; + /* Limit our maximum seek request to 1GB on platforms + * with 32-bit off_t (such as Windows). */ + int64_t skip_limit = ((int64_t)1) << (sizeof(off_t) * 8 - 2); + if (self->archive->client.skipper == NULL) return (0); - r = (self->archive->client.skipper)(&self->archive->archive, - self->data, request); - self->archive->archive.raw_position += r; - return (r); + total = 0; + for (;;) { + ask = request; + if (ask > skip_limit) + ask = skip_limit; + get = (self->archive->client.skipper)(&self->archive->archive, + self->data, ask); + if (get == 0) + return (total); + request -= get; + self->archive->archive.raw_position += get; + total += get; + } } static int @@ -277,6 +299,7 @@ archive_read_open2(struct archive *_a, v __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_open"); + archive_clear_error(&a->archive); if (client_reader == NULL) __archive_errx(1, @@ -736,7 +759,7 @@ _archive_read_close(struct archive *_a) /* * Release memory and other resources. */ -int +static int _archive_read_finish(struct archive *_a) { struct archive_read *a = (struct archive_read *)_a; @@ -1121,6 +1144,8 @@ __archive_read_skip(struct archive_read if (skipped == request) return (skipped); /* We hit EOF before we satisfied the skip request. */ + if (skipped < 0) // Map error code to 0 for error message below. + skipped = 0; archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Truncated input file (needed %jd bytes, only %jd available)", @@ -1140,7 +1165,7 @@ __archive_read_skip_lenient(struct archi int64_t __archive_read_filter_skip(struct archive_read_filter *filter, int64_t request) { - off_t bytes_skipped, total_bytes_skipped = 0; + int64_t bytes_skipped, total_bytes_skipped = 0; size_t min; if (filter->fatal) @@ -1155,7 +1180,7 @@ __archive_read_filter_skip(struct archiv total_bytes_skipped += bytes_skipped; } if (filter->client_avail > 0) { - min = minimum(request, (off_t)filter->client_avail); + min = minimum(request, (int64_t)filter->client_avail); bytes_skipped = __archive_read_filter_consume(filter, min); request -= bytes_skipped; total_bytes_skipped += bytes_skipped; @@ -1189,10 +1214,8 @@ __archive_read_filter_skip(struct archiv * have to use ordinary reads to finish out the request. */ while (request > 0) { - const void* dummy_buffer; ssize_t bytes_read; - dummy_buffer = __archive_read_filter_ahead(filter, - 1, &bytes_read); + (void)__archive_read_filter_ahead(filter, 1, &bytes_read); if (bytes_read < 0) return (bytes_read); if (bytes_read == 0) { From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 05:30:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4ED0106568B; Tue, 29 Dec 2009 05:30:23 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C12788FC13; Tue, 29 Dec 2009 05:30:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT5UN8h011934; Tue, 29 Dec 2009 05:30:23 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT5UNwM011932; Tue, 29 Dec 2009 05:30:23 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290530.nBT5UNwM011932@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 05:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201157 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 05:30:23 -0000 Author: kientzle Date: Tue Dec 29 05:30:23 2009 New Revision: 201157 URL: http://svn.freebsd.org/changeset/base/201157 Log: Catch decompression failures earlier. In particular, this gives immediate feedback if we fail to fork an external decompression program. Modified: head/lib/libarchive/archive_read.c Modified: head/lib/libarchive/archive_read.c ============================================================================== --- head/lib/libarchive/archive_read.c Tue Dec 29 05:28:28 2009 (r201156) +++ head/lib/libarchive/archive_read.c Tue Dec 29 05:30:23 2009 (r201157) @@ -354,6 +354,7 @@ build_stream(struct archive_read *a) int number_bidders, i, bid, best_bid; struct archive_read_filter_bidder *bidder, *best_bidder; struct archive_read_filter *filter; + ssize_t avail; int r; for (;;) { @@ -392,6 +393,13 @@ build_stream(struct archive_read *a) free(filter); return (r); } + /* Verify the filter by asking it for some data. */ + __archive_read_filter_ahead(filter, 1, &avail); + if (avail < 0) { + /* If the read failed, bail out now. */ + free(filter); + return (avail); + } a->filter = filter; } } From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 05:35:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A57AB1065694; Tue, 29 Dec 2009 05:35:40 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9101F8FC16; Tue, 29 Dec 2009 05:35:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT5Ze6U012111; Tue, 29 Dec 2009 05:35:40 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT5Zegm012109; Tue, 29 Dec 2009 05:35:40 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290535.nBT5Zegm012109@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 05:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201159 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 05:35:40 -0000 Author: kientzle Date: Tue Dec 29 05:35:40 2009 New Revision: 201159 URL: http://svn.freebsd.org/changeset/base/201159 Log: Various fixes when creating objects on disk: * Write xattrs last instead of first (required on platforms that use system xattrs for security attributes) * Better handling of chdir() failures * Don't bother trying to shorten files via seek()/write() * Fix build on systems that lack link()/symlink()/mknod() * Prefer futimens()/utimensat() when they're present Modified: head/lib/libarchive/archive_write_disk.c Modified: head/lib/libarchive/archive_write_disk.c ============================================================================== --- head/lib/libarchive/archive_write_disk.c Tue Dec 29 05:35:25 2009 (r201158) +++ head/lib/libarchive/archive_write_disk.c Tue Dec 29 05:35:40 2009 (r201159) @@ -442,20 +442,23 @@ _archive_write_header(struct archive *_a ret = restore_entry(a); /* - * On the GNU tar mailing list, some people working with new - * Linux filesystems observed that system xattrs used as - * layout hints need to be restored before the file contents - * are written, so this can't be done at file close. + * TODO: There are rumours that some extended attributes must + * be restored before file data is written. If this is true, + * then we either need to write all extended attributes both + * before and after restoring the data, or find some rule for + * determining which must go first and which last. Due to the + * many ways people are using xattrs, this may prove to be an + * intractable problem. */ - if (a->todo & TODO_XATTR) { - int r2 = set_xattrs(a); - if (r2 < ret) ret = r2; - } #ifdef HAVE_FCHDIR /* If we changed directory above, restore it here. */ if (a->restore_pwd >= 0) { - fchdir(a->restore_pwd); + r = fchdir(a->restore_pwd); + if (r != 0) { + archive_set_error(&a->archive, errno, "chdir() failure"); + ret = ARCHIVE_FATAL; + } close(a->restore_pwd); a->restore_pwd = -1; } @@ -692,15 +695,18 @@ _archive_write_finish_entry(struct archi } #endif /* - * Explicitly stat the file as some platforms might not - * implement the XSI option to extend files via ftruncate. + * Not all platforms implement the XSI option to + * extend files via ftruncate. Stat() the file again + * to see what happened. */ a->pst = NULL; if ((ret = _archive_write_disk_lazy_stat(a)) != ARCHIVE_OK) return (ret); - if (a->st.st_size != a->filesize) { + /* We can use lseek()/write() to extend the file if + * ftruncate didn't work or isn't available. */ + if (a->st.st_size < a->filesize) { const char nul = '\0'; - if (lseek(a->fd, a->st.st_size - 1, SEEK_SET) < 0) { + if (lseek(a->fd, a->filesize - 1, SEEK_SET) < 0) { archive_set_error(&a->archive, errno, "Seek failed"); return (ARCHIVE_FATAL); @@ -747,6 +753,17 @@ _archive_write_finish_entry(struct archi int r2 = set_acls(a); if (r2 < ret) ret = r2; } + + /* + * Security-related extended attributes (such as + * security.capability on Linux) have to be restored last, + * since they're implicitly removed by other file changes. + */ + if (a->todo & TODO_XATTR) { + int r2 = set_xattrs(a); + if (r2 < ret) ret = r2; + } + /* * Some flags prevent file modification; they must be restored after * file contents are written. @@ -1057,7 +1074,7 @@ restore_entry(struct archive_write_disk * the failed system call. Note: This function should only ever perform * a single system call. */ -int +static int create_filesystem_object(struct archive_write_disk *a) { /* Create the entry. */ @@ -1069,6 +1086,9 @@ create_filesystem_object(struct archive_ /* Since link(2) and symlink(2) don't handle modes, we're done here. */ linkname = archive_entry_hardlink(a->entry); if (linkname != NULL) { +#if !HAVE_LINK + return (EPERM); +#else r = link(linkname, a->name) ? errno : 0; /* * New cpio and pax formats allow hardlink entries @@ -1091,10 +1111,16 @@ create_filesystem_object(struct archive_ r = errno; } return (r); +#endif } linkname = archive_entry_symlink(a->entry); - if (linkname != NULL) + if (linkname != NULL) { +#if HAVE_SYMLINK return symlink(linkname, a->name) ? errno : 0; +#else + return (EPERM); +#endif + } /* * The remaining system calls all set permissions, so let's @@ -1126,22 +1152,22 @@ create_filesystem_object(struct archive_ * S_IFCHR for the mknod() call. This is correct. */ r = mknod(a->name, mode | S_IFCHR, archive_entry_rdev(a->entry)); + break; #else /* TODO: Find a better way to warn about our inability * to restore a char device node. */ return (EINVAL); #endif /* HAVE_MKNOD */ - break; case AE_IFBLK: #ifdef HAVE_MKNOD r = mknod(a->name, mode | S_IFBLK, archive_entry_rdev(a->entry)); + break; #else /* TODO: Find a better way to warn about our inability * to restore a block device node. */ return (EINVAL); #endif /* HAVE_MKNOD */ - break; case AE_IFDIR: mode = (mode | MINIMUM_DIR_MODE) & MAXIMUM_DIR_MODE; r = mkdir(a->name, mode); @@ -1161,12 +1187,12 @@ create_filesystem_object(struct archive_ case AE_IFIFO: #ifdef HAVE_MKFIFO r = mkfifo(a->name, mode); + break; #else /* TODO: Find a better way to warn about our inability * to restore a fifo. */ return (EINVAL); #endif /* HAVE_MKFIFO */ - break; } /* All the system calls above set errno on failure. */ @@ -1394,9 +1420,15 @@ current_fixup(struct archive_write_disk * scan the path and both can be optimized by comparing against other * recent paths. */ +/* TODO: Extend this to support symlinks on Windows Vista and later. */ static int check_symlinks(struct archive_write_disk *a) { +#if !defined(HAVE_LSTAT) + /* Platform doesn't have lstat, so we can't look for symlinks. */ + (void)a; /* UNUSED */ + return (ARCHIVE_OK); +#else char *pn, *p; char c; int r; @@ -1477,6 +1509,7 @@ check_symlinks(struct archive_write_disk /* We've checked and/or cleaned the whole path, so remember it. */ archive_strcpy(&a->path_safe, a->name); return (ARCHIVE_OK); +#endif } #if defined(_WIN32) || defined(__CYGWIN__) @@ -1661,8 +1694,6 @@ create_dir(struct archive_write_disk *a, mode_t mode_final, mode; int r; - r = ARCHIVE_OK; - /* Check for special names and just skip them. */ slash = strrchr(path, '/'); if (slash == NULL) @@ -1806,11 +1837,31 @@ set_ownership(struct archive_write_disk return (ARCHIVE_WARN); } -#ifdef HAVE_UTIMES + +#if defined(HAVE_UTIMENSAT) && defined(HAVE_FUTIMENS) +/* + * utimensat() and futimens() are defined in POSIX.1-2008. They provide ns + * resolution and setting times on fd and on symlinks, too. + */ +static int +set_time(int fd, int mode, const char *name, + time_t atime, long atime_nsec, + time_t mtime, long mtime_nsec) +{ + struct timespec ts[2]; + ts[0].tv_sec = atime; + ts[0].tv_nsec = atime_nsec; + ts[1].tv_sec = mtime; + ts[1].tv_nsec = mtime_nsec; + if (fd >= 0) + return futimens(fd, ts); + return utimensat(AT_FDCWD, name, ts, AT_SYMLINK_NOFOLLOW); +} +#elif HAVE_UTIMES /* - * The utimes()-family functions provide high resolution and + * The utimes()-family functions provide Âľs-resolution and * a way to set time on an fd or a symlink. We prefer them - * when they're available. + * when they're available and utimensat/futimens aren't there. */ static int set_time(int fd, int mode, const char *name, From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 05:41:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97F13106566C; Tue, 29 Dec 2009 05:41:57 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83E438FC14; Tue, 29 Dec 2009 05:41:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT5fvaI012293; Tue, 29 Dec 2009 05:41:57 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT5fvPL012291; Tue, 29 Dec 2009 05:41:57 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290541.nBT5fvPL012291@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 05:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201160 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 05:41:57 -0000 Author: kientzle Date: Tue Dec 29 05:41:57 2009 New Revision: 201160 URL: http://svn.freebsd.org/changeset/base/201160 Log: Various style fixes to the 'newc' cpio writer: * Warn about truncation of ino * Use a macro to hide the somewhat obscure pad-to-multiple-of-4 calculation * Eliminate some unused variables Modified: head/lib/libarchive/archive_write_set_format_cpio_newc.c Modified: head/lib/libarchive/archive_write_set_format_cpio_newc.c ============================================================================== --- head/lib/libarchive/archive_write_set_format_cpio_newc.c Tue Dec 29 05:35:40 2009 (r201159) +++ head/lib/libarchive/archive_write_set_format_cpio_newc.c Tue Dec 29 05:41:57 2009 (r201160) @@ -75,6 +75,9 @@ struct cpio_header_newc { char c_checksum[8]; }; +/* Logic trick: difference between 'n' and next multiple of 4 */ +#define PAD4(n) (3 & (1 + ~(n))) + /* * Set output format to 'cpio' format. */ @@ -111,28 +114,34 @@ archive_write_set_format_cpio_newc(struc static int archive_write_newc_header(struct archive_write *a, struct archive_entry *entry) { + int64_t ino; struct cpio *cpio; const char *p, *path; - int pathlength, ret; + int pathlength, ret, ret2; struct cpio_header_newc h; int pad; cpio = (struct cpio *)a->format_data; - ret = 0; + ret2 = ARCHIVE_OK; path = archive_entry_pathname(entry); - pathlength = strlen(path) + 1; /* Include trailing null. */ + pathlength = (int)strlen(path) + 1; /* Include trailing null. */ memset(&h, 0, sizeof(h)); format_hex(0x070701, &h.c_magic, sizeof(h.c_magic)); - format_hex(archive_entry_devmajor(entry), &h.c_devmajor, sizeof(h.c_devmajor)); - format_hex(archive_entry_devminor(entry), &h.c_devminor, sizeof(h.c_devminor)); - if (archive_entry_ino(entry) > 0xffffffff) { - archive_set_error(&a->archive, ERANGE, "large inode number truncated"); - ret = ARCHIVE_WARN; + format_hex(archive_entry_devmajor(entry), &h.c_devmajor, + sizeof(h.c_devmajor)); + format_hex(archive_entry_devminor(entry), &h.c_devminor, + sizeof(h.c_devminor)); + + ino = archive_entry_ino64(entry); + if (ino > 0xffffffff) { + archive_set_error(&a->archive, ERANGE, + "large inode number truncated"); + ret2 = ARCHIVE_WARN; } - format_hex(archive_entry_ino(entry) & 0xffffffff, &h.c_ino, sizeof(h.c_ino)); + format_hex(ino & 0xffffffff, &h.c_ino, sizeof(h.c_ino)); format_hex(archive_entry_mode(entry), &h.c_mode, sizeof(h.c_mode)); format_hex(archive_entry_uid(entry), &h.c_uid, sizeof(h.c_uid)); format_hex(archive_entry_gid(entry), &h.c_gid, sizeof(h.c_gid)); @@ -169,24 +178,26 @@ archive_write_newc_header(struct archive ret = (a->compressor.write)(a, path, pathlength); if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); - pad = 0x3 & - (pathlength + sizeof(struct cpio_header_newc)); + pad = PAD4(pathlength + sizeof(struct cpio_header_newc)); if (pad) ret = (a->compressor.write)(a, "\0\0\0", pad); if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); cpio->entry_bytes_remaining = archive_entry_size(entry); - cpio->padding = 3 & (-cpio->entry_bytes_remaining); + cpio->padding = PAD4(cpio->entry_bytes_remaining); /* Write the symlink now. */ if (p != NULL && *p != '\0') { ret = (a->compressor.write)(a, p, strlen(p)); if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); - pad = 0x3 & -strlen(p); + pad = PAD4(strlen(p)); ret = (a->compressor.write)(a, "\0\0\0", pad); } + if (ret == ARCHIVE_OK) + ret = ret2; return (ret); } @@ -235,17 +246,15 @@ format_hex_recursive(int64_t v, char *p, return (v); v = format_hex_recursive(v, p+1, s-1); *p = "0123456789abcdef"[v & 0xf]; - return (v >>= 4); + return (v >> 4); } static int archive_write_newc_finish(struct archive_write *a) { - struct cpio *cpio; int er; struct archive_entry *trailer; - cpio = (struct cpio *)a->format_data; trailer = archive_entry_new(); archive_entry_set_nlink(trailer, 1); archive_entry_set_pathname(trailer, "TRAILER!!!"); @@ -269,10 +278,10 @@ static int archive_write_newc_finish_entry(struct archive_write *a) { struct cpio *cpio; - int to_write, ret; + size_t to_write; + int ret; cpio = (struct cpio *)a->format_data; - ret = ARCHIVE_OK; while (cpio->entry_bytes_remaining > 0) { to_write = cpio->entry_bytes_remaining < a->null_length ? cpio->entry_bytes_remaining : a->null_length; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 05:44:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E72891065692; Tue, 29 Dec 2009 05:44:39 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D35998FC1C; Tue, 29 Dec 2009 05:44:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT5idgV012381; Tue, 29 Dec 2009 05:44:39 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT5idd3012379; Tue, 29 Dec 2009 05:44:39 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290544.nBT5idd3012379@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 05:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201161 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 05:44:40 -0000 Author: kientzle Date: Tue Dec 29 05:44:39 2009 New Revision: 201161 URL: http://svn.freebsd.org/changeset/base/201161 Log: Style fixes to tar reader: For portability, prefer int64_t to off_t. Improve numeric overflow handling when parsing. Fix some variable types. Eliminate some unused results. Modified: head/lib/libarchive/archive_read_support_format_tar.c Modified: head/lib/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_tar.c Tue Dec 29 05:41:57 2009 (r201160) +++ head/lib/libarchive/archive_read_support_format_tar.c Tue Dec 29 05:44:39 2009 (r201161) @@ -159,10 +159,10 @@ struct tar { wchar_t *pax_entry; size_t pax_entry_length; int header_recursion_depth; - off_t entry_bytes_remaining; - off_t entry_offset; - off_t entry_padding; - off_t realsize; + int64_t entry_bytes_remaining; + int64_t entry_offset; + int64_t entry_padding; + int64_t realsize; struct sparse_block *sparse_list; struct sparse_block *sparse_last; int64_t sparse_offset; @@ -509,7 +509,7 @@ archive_read_format_tar_read_data(struct static int archive_read_format_tar_skip(struct archive_read *a) { - off_t bytes_skipped; + int64_t bytes_skipped; struct tar* tar; tar = (struct tar *)(a->format->data); @@ -552,7 +552,7 @@ tar_read_header(struct archive_read *a, return (bytes); if (bytes < 512) { /* Short read or EOF. */ /* Try requesting just one byte and see what happens. */ - h = __archive_read_ahead(a, 1, &bytes); + (void)__archive_read_ahead(a, 1, &bytes); if (bytes == 0) { /* * The archive ends at a 512-byte boundary but @@ -773,7 +773,7 @@ header_Solaris_ACL(struct archive_read * } p++; } - switch (type & ~0777777) { + switch ((int)type & ~0777777) { case 01000000: /* POSIX.1e ACL */ break; @@ -1196,7 +1196,7 @@ pax_header(struct archive_read *a, struc struct archive_entry *entry, char *attr) { size_t attr_length, l, line_length; - char *line, *p; + char *p; char *key, *value; int err, err2; @@ -1212,7 +1212,7 @@ pax_header(struct archive_read *a, struc /* Parse decimal length field at start of line. */ line_length = 0; l = attr_length; - line = p = attr; /* Record start of line. */ + p = attr; /* Record start of line. */ while (l>0) { if (*p == ' ') { p++; @@ -1630,7 +1630,7 @@ pax_time(const char *p, int64_t *ps, lon digit = *p - '0'; if (s > limit || (s == limit && digit > last_digit_limit)) { - s = UINT64_MAX; + s = INT64_MAX; break; } s = (s * 10) + digit; @@ -1929,7 +1929,7 @@ gnu_sparse_10_atol(struct archive_read * return (ARCHIVE_WARN); digit = *p - '0'; if (l > limit || (l == limit && digit > last_digit_limit)) - l = UINT64_MAX; /* Truncate on overflow. */ + l = INT64_MAX; /* Truncate on overflow. */ else l = (l * base) + digit; p++; @@ -2035,7 +2035,7 @@ tar_atol8(const char *p, unsigned char_c digit = *p - '0'; while (digit >= 0 && digit < base && char_cnt-- > 0) { if (l>limit || (l == limit && digit > last_digit_limit)) { - l = UINT64_MAX; /* Truncate on overflow. */ + l = INT64_MAX; /* Truncate on overflow. */ break; } l = (l * base) + digit; @@ -2071,7 +2071,7 @@ tar_atol10(const char *p, unsigned char_ digit = *p - '0'; while (digit >= 0 && digit < base && char_cnt-- > 0) { if (l > limit || (l == limit && digit > last_digit_limit)) { - l = UINT64_MAX; /* Truncate on overflow. */ + l = INT64_MAX; /* Truncate on overflow. */ break; } l = (l * base) + digit; @@ -2189,7 +2189,7 @@ utf8_decode(struct tar *tar, const char /* Ensure pax_entry buffer is big enough. */ if (tar->pax_entry_length <= length) { - wchar_t *old_entry = tar->pax_entry; + wchar_t *old_entry; if (tar->pax_entry_length <= 0) tar->pax_entry_length = 1024; @@ -2217,7 +2217,7 @@ utf8_decode(struct tar *tar, const char src += n; length -= n; } - *dest++ = L'\0'; + *dest = L'\0'; return (tar->pax_entry); } @@ -2318,7 +2318,7 @@ base64_decode(const char *s, size_t len, /* If the decode table is not yet initialized, prepare it. */ if (decode_table[digits[1]] != 1) { - size_t i; + unsigned i; memset(decode_table, 0xff, sizeof(decode_table)); for (i = 0; i < sizeof(digits); i++) decode_table[digits[i]] = i; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 05:47:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0CFB106566C; Tue, 29 Dec 2009 05:47:47 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C7A28FC13; Tue, 29 Dec 2009 05:47:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT5ll5G012490; Tue, 29 Dec 2009 05:47:47 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT5llcM012489; Tue, 29 Dec 2009 05:47:47 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290547.nBT5llcM012489@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 05:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201162 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 05:47:47 -0000 Author: kientzle Date: Tue Dec 29 05:47:46 2009 New Revision: 201162 URL: http://svn.freebsd.org/changeset/base/201162 Log: Style and portability fixes for pax writer. Mostly very routine, except for: * Use ino64 where appropriate * Don't pass atime or nsec to ustar formatter Modified: head/lib/libarchive/archive_write_set_format_pax.c Modified: head/lib/libarchive/archive_write_set_format_pax.c ============================================================================== --- head/lib/libarchive/archive_write_set_format_pax.c Tue Dec 29 05:44:39 2009 (r201161) +++ head/lib/libarchive/archive_write_set_format_pax.c Tue Dec 29 05:47:46 2009 (r201162) @@ -307,7 +307,7 @@ add_pax_attr(struct archive_string *as, * PAX attributes have the following layout: * <=> */ - len = 1 + strlen(key) + 1 + strlen(value) + 1; + len = 1 + (int)strlen(key) + 1 + (int)strlen(value) + 1; /* * The field includes the length of the field, so @@ -362,7 +362,7 @@ archive_write_pax_header_xattrs(struct p url_encoded_name = url_encode(name); if (url_encoded_name != NULL) { /* Convert narrow-character to wide-character. */ - int wcs_length = strlen(url_encoded_name); + size_t wcs_length = strlen(url_encoded_name); wcs_name = (wchar_t *)malloc((wcs_length + 1) * sizeof(wchar_t)); if (wcs_name == NULL) __archive_errx(1, "No memory for xattr conversion"); @@ -479,7 +479,7 @@ archive_write_pax_header(struct archive_ path = archive_entry_pathname(entry_main); path_w = archive_entry_pathname_w(entry_main); if (path != NULL && path_w == NULL) { - archive_set_error(&a->archive, EILSEQ, + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Can't translate pathname '%s' to UTF-8", path); ret = ARCHIVE_WARN; hdrcharset = "BINARY"; @@ -487,7 +487,7 @@ archive_write_pax_header(struct archive_ uname = archive_entry_uname(entry_main); uname_w = archive_entry_uname_w(entry_main); if (uname != NULL && uname_w == NULL) { - archive_set_error(&a->archive, EILSEQ, + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Can't translate uname '%s' to UTF-8", uname); ret = ARCHIVE_WARN; hdrcharset = "BINARY"; @@ -495,7 +495,7 @@ archive_write_pax_header(struct archive_ gname = archive_entry_gname(entry_main); gname_w = archive_entry_gname_w(entry_main); if (gname != NULL && gname_w == NULL) { - archive_set_error(&a->archive, EILSEQ, + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Can't translate gname '%s' to UTF-8", gname); ret = ARCHIVE_WARN; hdrcharset = "BINARY"; @@ -509,7 +509,7 @@ archive_write_pax_header(struct archive_ linkpath_w = archive_entry_symlink_w(entry_main); } if (linkpath != NULL && linkpath_w == NULL) { - archive_set_error(&a->archive, EILSEQ, + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Can't translate linkpath '%s' to UTF-8", linkpath); ret = ARCHIVE_WARN; hdrcharset = "BINARY"; @@ -625,7 +625,7 @@ archive_write_pax_header(struct archive_ } /* If numeric GID is too large, add 'gid' to pax extended attrs. */ - if (archive_entry_gid(entry_main) >= (1 << 18)) { + if ((unsigned int)archive_entry_gid(entry_main) >= (1 << 18)) { add_pax_attr_int(&(pax->pax_header), "gid", archive_entry_gid(entry_main)); need_extension = 1; @@ -650,7 +650,7 @@ archive_write_pax_header(struct archive_ } /* If numeric UID is too large, add 'uid' to pax extended attrs. */ - if (archive_entry_uid(entry_main) >= (1 << 18)) { + if ((unsigned int)archive_entry_uid(entry_main) >= (1 << 18)) { add_pax_attr_int(&(pax->pax_header), "uid", archive_entry_uid(entry_main)); need_extension = 1; @@ -819,7 +819,7 @@ archive_write_pax_header(struct archive_ add_pax_attr_int(&(pax->pax_header), "SCHILY.dev", archive_entry_dev(entry_main)); add_pax_attr_int(&(pax->pax_header), "SCHILY.ino", - archive_entry_ino(entry_main)); + archive_entry_ino64(entry_main)); add_pax_attr_int(&(pax->pax_header), "SCHILY.nlink", archive_entry_nlink(entry_main)); @@ -887,7 +887,6 @@ archive_write_pax_header(struct archive_ uid_t uid; gid_t gid; mode_t mode; - long ns; pax_attr_entry = archive_entry_new(); p = archive_entry_pathname(entry_main); @@ -897,12 +896,12 @@ archive_write_pax_header(struct archive_ archive_strlen(&(pax->pax_header))); /* Copy uid/gid (but clip to ustar limits). */ uid = archive_entry_uid(entry_main); - if (uid >= 1 << 18) - uid = (1 << 18) - 1; + if ((unsigned int)uid >= 1 << 18) + uid = (uid_t)(1 << 18) - 1; archive_entry_set_uid(pax_attr_entry, uid); gid = archive_entry_gid(entry_main); - if (gid >= 1 << 18) - gid = (1 << 18) - 1; + if ((unsigned int)gid >= 1 << 18) + gid = (gid_t)(1 << 18) - 1; archive_entry_set_gid(pax_attr_entry, gid); /* Copy mode over (but not setuid/setgid bits) */ mode = archive_entry_mode(entry_main); @@ -925,17 +924,12 @@ archive_write_pax_header(struct archive_ /* Copy mtime, but clip to ustar limits. */ s = archive_entry_mtime(entry_main); - ns = archive_entry_mtime_nsec(entry_main); - if (s < 0) { s = 0; ns = 0; } - if (s > 0x7fffffff) { s = 0x7fffffff; ns = 0; } - archive_entry_set_mtime(pax_attr_entry, s, ns); - - /* Ditto for atime. */ - s = archive_entry_atime(entry_main); - ns = archive_entry_atime_nsec(entry_main); - if (s < 0) { s = 0; ns = 0; } - if (s > 0x7fffffff) { s = 0x7fffffff; ns = 0; } - archive_entry_set_atime(pax_attr_entry, s, ns); + if (s < 0) { s = 0; } + if (s >= 0x7fffffff) { s = 0x7fffffff; } + archive_entry_set_mtime(pax_attr_entry, s, 0); + + /* Standard ustar doesn't support atime. */ + archive_entry_set_atime(pax_attr_entry, 0, 0); /* Standard ustar doesn't support ctime. */ archive_entry_set_ctime(pax_attr_entry, 0, 0); @@ -949,7 +943,8 @@ archive_write_pax_header(struct archive_ if (r != 0) { const char *msg = "archive_write_pax_header: " "'x' header failed?! This can't happen.\n"; - write(2, msg, strlen(msg)); + size_t u = write(2, msg, strlen(msg)); + (void)u; /* UNUSED */ exit(1); } r = (a->compressor.write)(a, paxbuff, 512); @@ -1030,7 +1025,7 @@ build_ustar_entry_name(char *dest, const char *p; int need_slash = 0; /* Was there a trailing slash? */ size_t suffix_length = 99; - int insert_length; + size_t insert_length; /* Length of additional dir element to be added. */ if (insert == NULL) @@ -1124,7 +1119,7 @@ build_ustar_entry_name(char *dest, const p += filename_end - filename; if (need_slash) *p++ = '/'; - *p++ = '\0'; + *p = '\0'; return (dest); } @@ -1215,13 +1210,11 @@ build_pax_attribute_name(char *dest, con static int archive_write_pax_finish(struct archive_write *a) { - struct pax *pax; int r; if (a->compressor.write == NULL) return (ARCHIVE_OK); - pax = (struct pax *)a->format_data; r = write_nulls(a, 512 * 2); return (r); } @@ -1256,7 +1249,8 @@ archive_write_pax_finish_entry(struct ar static int write_nulls(struct archive_write *a, size_t padding) { - int ret, to_write; + int ret; + size_t to_write; while (padding > 0) { to_write = padding < a->null_length ? padding : a->null_length; @@ -1387,6 +1381,6 @@ base64_encode(const char *s, size_t len) break; } /* Add trailing NUL character so output is a valid C string. */ - *d++ = '\0'; + *d = '\0'; return (out); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 05:50:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0020106566B; Tue, 29 Dec 2009 05:50:34 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC0568FC0A; Tue, 29 Dec 2009 05:50:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT5oYwt012582; Tue, 29 Dec 2009 05:50:34 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT5oYU2012580; Tue, 29 Dec 2009 05:50:34 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290550.nBT5oYU2012580@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 05:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201163 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 05:50:35 -0000 Author: kientzle Date: Tue Dec 29 05:50:34 2009 New Revision: 201163 URL: http://svn.freebsd.org/changeset/base/201163 Log: Be a little more skeptical of dev/ino matches when reading cpio files. This eliminates some false-positives in the hardlink detection logic. Modified: head/lib/libarchive/archive_read_support_format_cpio.c Modified: head/lib/libarchive/archive_read_support_format_cpio.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_cpio.c Tue Dec 29 05:47:46 2009 (r201162) +++ head/lib/libarchive/archive_read_support_format_cpio.c Tue Dec 29 05:50:34 2009 (r201163) @@ -92,7 +92,7 @@ struct links_entry { struct links_entry *previous; int links; dev_t dev; - ino_t ino; + int64_t ino; char *name; }; @@ -727,51 +727,51 @@ atol16(const char *p, unsigned char_cnt) static void record_hardlink(struct cpio *cpio, struct archive_entry *entry) { - struct links_entry *le; + struct links_entry *le; dev_t dev; - ino_t ino; + int64_t ino; if (archive_entry_nlink(entry) <= 1) return; dev = archive_entry_dev(entry); - ino = archive_entry_ino(entry); + ino = archive_entry_ino64(entry); - /* - * First look in the list of multiply-linked files. If we've - * already dumped it, convert this entry to a hard link entry. - */ - for (le = cpio->links_head; le; le = le->next) { - if (le->dev == dev && le->ino == ino) { - archive_entry_copy_hardlink(entry, le->name); - - if (--le->links <= 0) { - if (le->previous != NULL) - le->previous->next = le->next; - if (le->next != NULL) - le->next->previous = le->previous; - if (cpio->links_head == le) - cpio->links_head = le->next; + /* + * First look in the list of multiply-linked files. If we've + * already dumped it, convert this entry to a hard link entry. + */ + for (le = cpio->links_head; le; le = le->next) { + if (le->dev == dev && le->ino == ino) { + archive_entry_copy_hardlink(entry, le->name); + + if (--le->links <= 0) { + if (le->previous != NULL) + le->previous->next = le->next; + if (le->next != NULL) + le->next->previous = le->previous; + if (cpio->links_head == le) + cpio->links_head = le->next; free(le->name); - free(le); - } + free(le); + } - return; - } - } + return; + } + } - le = (struct links_entry *)malloc(sizeof(struct links_entry)); + le = (struct links_entry *)malloc(sizeof(struct links_entry)); if (le == NULL) __archive_errx(1, "Out of memory adding file to list"); - if (cpio->links_head != NULL) - cpio->links_head->previous = le; - le->next = cpio->links_head; - le->previous = NULL; - cpio->links_head = le; - le->dev = dev; - le->ino = ino; - le->links = archive_entry_nlink(entry) - 1; - le->name = strdup(archive_entry_pathname(entry)); + if (cpio->links_head != NULL) + cpio->links_head->previous = le; + le->next = cpio->links_head; + le->previous = NULL; + cpio->links_head = le; + le->dev = dev; + le->ino = ino; + le->links = archive_entry_nlink(entry) - 1; + le->name = strdup(archive_entry_pathname(entry)); if (le->name == NULL) __archive_errx(1, "Out of memory adding file to list"); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 05:52:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2FE61065692; Tue, 29 Dec 2009 05:52:13 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B64748FC14; Tue, 29 Dec 2009 05:52:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT5qDHK012698; Tue, 29 Dec 2009 05:52:13 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT5qDeQ012696; Tue, 29 Dec 2009 05:52:13 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290552.nBT5qDeQ012696@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 05:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201165 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 05:52:14 -0000 Author: kientzle Date: Tue Dec 29 05:52:13 2009 New Revision: 201165 URL: http://svn.freebsd.org/changeset/base/201165 Log: Minor style fixes plus a fix for an obscure crash on certain malformed mtree files. Modified: head/lib/libarchive/archive_read_support_format_mtree.c Modified: head/lib/libarchive/archive_read_support_format_mtree.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_mtree.c Tue Dec 29 05:51:24 2009 (r201164) +++ head/lib/libarchive/archive_read_support_format_mtree.c Tue Dec 29 05:52:13 2009 (r201165) @@ -196,7 +196,7 @@ mtree_bid(struct archive_read *a) return (-1); if (strncmp(p, signature, strlen(signature)) == 0) - return (8 * strlen(signature)); + return (8 * (int)strlen(signature)); return (0); } @@ -398,7 +398,6 @@ read_mtree(struct archive_read *a, struc global = NULL; last_entry = NULL; - r = ARCHIVE_OK; for (counter = 1; ; ++counter) { len = readline(a, mtree, &p, 256); @@ -588,8 +587,7 @@ parse_file(struct archive_read *a, struc if (archive_entry_filetype(entry) == AE_IFREG || archive_entry_filetype(entry) == AE_IFDIR) { - mtree->fd = open(path, - O_RDONLY | O_BINARY); + mtree->fd = open(path, O_RDONLY | O_BINARY); if (mtree->fd == -1 && (errno != ENOENT || archive_strlen(&mtree->contents_name) > 0)) { @@ -1038,11 +1036,7 @@ parse_escapes(char *src, struct mtree_en char *dest = src; char c; - /* - * The current directory is somewhat special, it should be archived - * only once as it will confuse extraction otherwise. - */ - if (strcmp(src, ".") == 0) + if (mentry != NULL && strcmp(src, ".") == 0) mentry->full = 1; while (*src != '\0') { @@ -1161,7 +1155,7 @@ mtree_atol10(char **p) digit = **p - '0'; while (digit >= 0 && digit < base) { if (l > limit || (l == limit && digit > last_digit_limit)) { - l = UINT64_MAX; /* Truncate on overflow. */ + l = INT64_MAX; /* Truncate on overflow. */ break; } l = (l * base) + digit; @@ -1202,7 +1196,7 @@ mtree_atol16(char **p) digit = -1; while (digit >= 0 && digit < base) { if (l > limit || (l == limit && digit > last_digit_limit)) { - l = UINT64_MAX; /* Truncate on overflow. */ + l = INT64_MAX; /* Truncate on overflow. */ break; } l = (l * base) + digit; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 05:58:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E4B7106568D; Tue, 29 Dec 2009 05:58:41 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AACD8FC1A; Tue, 29 Dec 2009 05:58:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT5wfAu012846; Tue, 29 Dec 2009 05:58:41 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT5wfO7012844; Tue, 29 Dec 2009 05:58:41 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290558.nBT5wfO7012844@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 05:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201166 - head/usr.bin/ar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 05:58:41 -0000 Author: kientzle Date: Tue Dec 29 05:58:40 2009 New Revision: 201166 URL: http://svn.freebsd.org/changeset/base/201166 Log: ar only needs to support ar format. Modified: head/usr.bin/ar/acpyacc.y head/usr.bin/ar/read.c Modified: head/usr.bin/ar/acpyacc.y ============================================================================== --- head/usr.bin/ar/acpyacc.y Tue Dec 29 05:52:13 2009 (r201165) +++ head/usr.bin/ar/acpyacc.y Tue Dec 29 05:58:40 2009 (r201166) @@ -251,7 +251,7 @@ arscp_open(char *fname) if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); archive_read_support_compression_all(a); - archive_read_support_format_all(a); + archive_read_support_format_ar(a); AC(archive_read_open_file(a, fname, DEF_BLKSZ)); if ((r = archive_read_next_header(a, &entry))) bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); Modified: head/usr.bin/ar/read.c ============================================================================== --- head/usr.bin/ar/read.c Tue Dec 29 05:52:13 2009 (r201165) +++ head/usr.bin/ar/read.c Tue Dec 29 05:58:40 2009 (r201166) @@ -88,7 +88,7 @@ read_archive(struct bsdar *bsdar, char m if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); archive_read_support_compression_all(a); - archive_read_support_format_all(a); + archive_read_support_format_ar(a); AC(archive_read_open_file(a, bsdar->filename, DEF_BLKSZ)); for (;;) { From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 06:06:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C33C1065670; Tue, 29 Dec 2009 06:06:20 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 682A58FC14; Tue, 29 Dec 2009 06:06:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT66KRT013091; Tue, 29 Dec 2009 06:06:20 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT66Ku7013090; Tue, 29 Dec 2009 06:06:20 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290606.nBT66Ku7013090@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 06:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201167 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 06:06:20 -0000 Author: kientzle Date: Tue Dec 29 06:06:20 2009 New Revision: 201167 URL: http://svn.freebsd.org/changeset/base/201167 Log: If we're linking against liblzma, allow the decompressor to use up to 1<<30 bytes of memory, which is required for some streams. Also, try to make the taster more discriminating about raw lzma streams. The detection here is still really weak, though; please use xz instead of lzma. Modified: head/lib/libarchive/archive_read_support_compression_xz.c Modified: head/lib/libarchive/archive_read_support_compression_xz.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_xz.c Tue Dec 29 05:58:40 2009 (r201166) +++ head/lib/libarchive/archive_read_support_compression_xz.c Tue Dec 29 06:06:20 2009 (r201167) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #endif #include "archive.h" +#include "archive_endian.h" #include "archive_private.h" #include "archive_read_private.h" @@ -205,37 +206,100 @@ lzma_bidder_bid(struct archive_read_filt { const unsigned char *buffer; ssize_t avail; + uint32_t dicsize; + uint64_t uncompressed_size; int bits_checked; (void)self; /* UNUSED */ - buffer = __archive_read_filter_ahead(filter, 6, &avail); + buffer = __archive_read_filter_ahead(filter, 14, &avail); if (buffer == NULL) return (0); - /* First byte of raw LZMA stream is always 0x5d. */ + /* First byte of raw LZMA stream is commonly 0x5d. + * The first byte is a special number, which consists of + * three parameters of LZMA compression, a number of literal + * context bits(which is from 0 to 8, default is 3), a number + * of literal pos bits(which is from 0 to 4, default is 0), + * a number of pos bits(which is from 0 to 4, default is 2). + * The first byte is made by + * (pos bits * 5 + literal pos bit) * 9 + * literal contest bit, + * and so the default value in this field is + * (2 * 5 + 0) * 9 + 3 = 0x5d. + * lzma of LZMA SDK has options to change those parameters. + * It means a range of this field is from 0 to 224. And lzma of + * XZ Utils with option -e records 0x5e in this field. */ + /* NOTE: If this checking of the first byte increases false + * recognition, we should allow only 0x5d and 0x5e for the first + * byte of LZMA stream. */ bits_checked = 0; - if (buffer[0] != 0x5d) - return (0); - bits_checked += 8; - - /* Second through fifth bytes are dictionary code, stored in - * little-endian order. The two least-significant bytes are - * always zero. */ - if (buffer[1] != 0 || buffer[2] != 0) + if (buffer[0] > (4 * 5 + 4) * 9 + 8) return (0); - bits_checked += 16; - - /* ??? TODO: Fix this. ??? */ - /* NSIS format check uses this, but I've seen tar.lzma - * archives where this byte is 0xff, not 0. Can it - * ever be anything other than 0 or 0xff? - */ -#if 0 - if (buffer[5] != 0) + /* Most likely value in the first byte of LZMA stream. */ + if (buffer[0] == 0x5d || buffer[0] == 0x5e) + bits_checked += 8; + + /* Sixth through fourteenth bytes are uncompressed size, + * stored in little-endian order. `-1' means uncompressed + * size is unknown and lzma of XZ Utils always records `-1' + * in this field. */ + uncompressed_size = archive_le64dec(buffer+5); + if (uncompressed_size == (uint64_t)ARCHIVE_LITERAL_LL(-1)) + bits_checked += 64; + + /* Second through fifth bytes are dictionary size, stored in + * little-endian order. The minimum dictionary size is + * 1 << 12(4KiB) which the lzma of LZMA SDK uses with option + * -d12 and the maxinam dictionary size is 1 << 27(128MiB) + * which the one uses with option -d27. + * NOTE: A comment of LZMA SDK source code says this dictionary + * range is from 1 << 12 to 1 << 30. */ + dicsize = archive_le32dec(buffer+1); + switch (dicsize) { + case 0x00001000:/* lzma of LZMA SDK option -d12. */ + case 0x00002000:/* lzma of LZMA SDK option -d13. */ + case 0x00004000:/* lzma of LZMA SDK option -d14. */ + case 0x00008000:/* lzma of LZMA SDK option -d15. */ + case 0x00010000:/* lzma of XZ Utils option -0 and -1. + * lzma of LZMA SDK option -d16. */ + case 0x00020000:/* lzma of LZMA SDK option -d17. */ + case 0x00040000:/* lzma of LZMA SDK option -d18. */ + case 0x00080000:/* lzma of XZ Utils option -2. + * lzma of LZMA SDK option -d19. */ + case 0x00100000:/* lzma of XZ Utils option -3. + * lzma of LZMA SDK option -d20. */ + case 0x00200000:/* lzma of XZ Utils option -4. + * lzma of LZMA SDK option -d21. */ + case 0x00400000:/* lzma of XZ Utils option -5. + * lzma of LZMA SDK option -d22. */ + case 0x00800000:/* lzma of XZ Utils option -6. + * lzma of LZMA SDK option -d23. */ + case 0x01000000:/* lzma of XZ Utils option -7. + * lzma of LZMA SDK option -d24. */ + case 0x02000000:/* lzma of XZ Utils option -8. + * lzma of LZMA SDK option -d25. */ + case 0x04000000:/* lzma of XZ Utils option -9. + * lzma of LZMA SDK option -d26. */ + case 0x08000000:/* lzma of LZMA SDK option -d27. */ + bits_checked += 32; + break; + default: + /* If a memory usage for encoding was not enough on + * the platform where LZMA stream was made, lzma of + * XZ Utils automatically decreased the dictionary + * size to enough memory for encoding by 1Mi bytes + * (1 << 20).*/ + if (dicsize <= 0x03F00000 && dicsize >= 0x00300000 && + (dicsize & ((1 << 20)-1)) == 0 && + bits_checked == 8 + 64) { + bits_checked += 32; + break; + } + /* Otherwise dictionary size is unlikely. But it is + * possible that someone makes lzma stream with + * liblzma/LZMA SDK in one's dictionary size. */ return (0); - bits_checked += 8; -#endif + } /* TODO: The above test is still very weak. It would be * good to do better. */ @@ -304,11 +368,11 @@ xz_lzma_bidder_init(struct archive_read_ */ if (self->code == ARCHIVE_COMPRESSION_XZ) ret = lzma_stream_decoder(&(state->stream), - (1U << 23) + (1U << 21),/* memlimit */ + (1U << 30),/* memlimit */ LZMA_CONCATENATED); else ret = lzma_alone_decoder(&(state->stream), - (1U << 23) + (1U << 21));/* memlimit */ + (1U << 30));/* memlimit */ if (ret == LZMA_OK) return (ARCHIVE_OK); From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 06:15:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AB0D106566B; Tue, 29 Dec 2009 06:15:32 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5646C8FC1B; Tue, 29 Dec 2009 06:15:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT6FWrZ013318; Tue, 29 Dec 2009 06:15:32 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT6FWi0013312; Tue, 29 Dec 2009 06:15:32 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290615.nBT6FWi0013312@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 06:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201168 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 06:15:32 -0000 Author: kientzle Date: Tue Dec 29 06:15:32 2009 New Revision: 201168 URL: http://svn.freebsd.org/changeset/base/201168 Log: Zip write support for libarchive. The initial implementation was developed by Anselm Strauss as part of Google Summer of Code 2008, then completed by Joerg Sonnenberger. Added: head/lib/libarchive/archive_write_set_format_zip.c (contents, props changed) Modified: head/lib/libarchive/Makefile head/lib/libarchive/archive.h head/lib/libarchive/archive_write_set_format.c head/lib/libarchive/archive_write_set_format_by_name.c Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Tue Dec 29 06:06:20 2009 (r201167) +++ head/lib/libarchive/Makefile Tue Dec 29 06:15:32 2009 (r201168) @@ -87,6 +87,7 @@ SRCS= archive_check_magic.c \ archive_write_set_format_pax.c \ archive_write_set_format_shar.c \ archive_write_set_format_ustar.c \ + archive_write_set_format_zip.c \ filter_fork.c # Man pages to be installed. Modified: head/lib/libarchive/archive.h ============================================================================== --- head/lib/libarchive/archive.h Tue Dec 29 06:06:20 2009 (r201167) +++ head/lib/libarchive/archive.h Tue Dec 29 06:15:32 2009 (r201168) @@ -538,6 +538,7 @@ __LA_DECL int archive_write_set_format __LA_DECL int archive_write_set_format_shar(struct archive *); __LA_DECL int archive_write_set_format_shar_dump(struct archive *); __LA_DECL int archive_write_set_format_ustar(struct archive *); +__LA_DECL int archive_write_set_format_zip(struct archive *); __LA_DECL int archive_write_open(struct archive *, void *, archive_open_callback *, archive_write_callback *, archive_close_callback *); Modified: head/lib/libarchive/archive_write_set_format.c ============================================================================== --- head/lib/libarchive/archive_write_set_format.c Tue Dec 29 06:06:20 2009 (r201167) +++ head/lib/libarchive/archive_write_set_format.c Tue Dec 29 06:15:32 2009 (r201168) @@ -53,6 +53,7 @@ struct { int code; int (*setter)(struct { ARCHIVE_FORMAT_TAR_PAX_RESTRICTED, archive_write_set_format_pax_restricted }, { ARCHIVE_FORMAT_TAR_USTAR, archive_write_set_format_ustar }, + { ARCHIVE_FORMAT_ZIP, archive_write_set_format_zip }, { 0, NULL } }; Modified: head/lib/libarchive/archive_write_set_format_by_name.c ============================================================================== --- head/lib/libarchive/archive_write_set_format_by_name.c Tue Dec 29 06:06:20 2009 (r201167) +++ head/lib/libarchive/archive_write_set_format_by_name.c Tue Dec 29 06:15:32 2009 (r201168) @@ -57,6 +57,7 @@ struct { const char *name; int (*setter) { "shar", archive_write_set_format_shar }, { "shardump", archive_write_set_format_shar_dump }, { "ustar", archive_write_set_format_ustar }, + { "zip", archive_write_set_format_zip }, { NULL, NULL } }; Added: head/lib/libarchive/archive_write_set_format_zip.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/archive_write_set_format_zip.c Tue Dec 29 06:15:32 2009 (r201168) @@ -0,0 +1,667 @@ +/*- + * Copyright (c) 2008 Anselm Strauss + * Copyright (c) 2009 Joerg Sonnenberger + * 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(S) ``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(S) 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. + */ + +/* + * Development supported by Google Summer of Code 2008. + */ + +/* + * The current implementation is very limited: + * + * - No encryption support. + * - No ZIP64 support. + * - No support for splitting and spanning. + * - Only supports regular file and folder entries. + * + * Note that generally data in ZIP files is little-endian encoded, + * with some exceptions. + * + * TODO: Since Libarchive is generally 64bit oriented, but this implementation + * does not yet support sizes exceeding 32bit, it is highly fragile for + * big archives. This should change when ZIP64 is finally implemented, otherwise + * some serious checking has to be done. + * + */ + +#include "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_ZLIB_H +#include +#endif + +#include "archive.h" +#include "archive_endian.h" +#include "archive_entry.h" +#include "archive_private.h" +#include "archive_write_private.h" + +#ifndef HAVE_ZLIB_H +#include "archive_crc32.h" +#endif + +#define ZIP_SIGNATURE_LOCAL_FILE_HEADER 0x04034b50 +#define ZIP_SIGNATURE_DATA_DESCRIPTOR 0x08074b50 +#define ZIP_SIGNATURE_FILE_HEADER 0x02014b50 +#define ZIP_SIGNATURE_CENTRAL_DIRECTORY_END 0x06054b50 +#define ZIP_SIGNATURE_EXTRA_TIMESTAMP 0x5455 +#define ZIP_SIGNATURE_EXTRA_UNIX 0x7855 +#define ZIP_VERSION_EXTRACT 0x0014 /* ZIP version 2.0 is needed. */ +#define ZIP_VERSION_BY 0x0314 /* Made by UNIX, using ZIP version 2.0. */ +#define ZIP_FLAGS 0x08 /* Flagging bit 3 (count from 0) for using data descriptor. */ + +enum compression { + COMPRESSION_STORE = 0 +#ifdef HAVE_ZLIB_H + , + COMPRESSION_DEFLATE = 8 +#endif +}; + +static ssize_t archive_write_zip_data(struct archive_write *, const void *buff, size_t s); +static int archive_write_zip_finish(struct archive_write *); +static int archive_write_zip_destroy(struct archive_write *); +static int archive_write_zip_finish_entry(struct archive_write *); +static int archive_write_zip_header(struct archive_write *, struct archive_entry *); +static unsigned int dos_time(const time_t); +static size_t path_length(struct archive_entry *); +static int write_path(struct archive_entry *, struct archive_write *); + +struct zip_local_file_header { + char signature[4]; + char version[2]; + char flags[2]; + char compression[2]; + char timedate[4]; + char crc32[4]; + char compressed_size[4]; + char uncompressed_size[4]; + char filename_length[2]; + char extra_length[2]; +}; + +struct zip_file_header { + char signature[4]; + char version_by[2]; + char version_extract[2]; + char flags[2]; + char compression[2]; + char timedate[4]; + char crc32[4]; + char compressed_size[4]; + char uncompressed_size[4]; + char filename_length[2]; + char extra_length[2]; + char comment_length[2]; + char disk_number[2]; + char attributes_internal[2]; + char attributes_external[4]; + char offset[4]; +}; + +struct zip_data_descriptor { + char signature[4]; /* Not mandatory, but recommended by specification. */ + char crc32[4]; + char compressed_size[4]; + char uncompressed_size[4]; +}; + +struct zip_extra_data_local { + char time_id[2]; + char time_size[2]; + char time_flag[1]; + char mtime[4]; + char atime[4]; + char ctime[4]; + char unix_id[2]; + char unix_size[2]; + char unix_uid[2]; + char unix_gid[2]; +}; + +struct zip_extra_data_central { + char time_id[2]; + char time_size[2]; + char time_flag[1]; + char mtime[4]; + char unix_id[2]; + char unix_size[2]; +}; + +struct zip_file_header_link { + struct zip_file_header_link *next; + struct archive_entry *entry; + off_t offset; + unsigned long crc32; + off_t compressed_size; + enum compression compression; +}; + +struct zip { + struct zip_data_descriptor data_descriptor; + struct zip_file_header_link *central_directory; + struct zip_file_header_link *central_directory_end; + int64_t offset; + int64_t written_bytes; + int64_t remaining_data_bytes; + enum compression compression; + +#ifdef HAVE_ZLIB_H + z_stream stream; + size_t len_buf; + unsigned char *buf; +#endif +}; + +struct zip_central_directory_end { + char signature[4]; + char disk[2]; + char start_disk[2]; + char entries_disk[2]; + char entries[2]; + char size[4]; + char offset[4]; + char comment_length[2]; +}; + +static int +archive_write_zip_options(struct archive_write *a, const char *key, + const char *value) +{ + struct zip *zip = a->format_data; + + if (strcmp(key, "compression") == 0) { + if (strcmp(value, "deflate") == 0) { +#ifdef HAVE_ZLIB_H + zip->compression = COMPRESSION_DEFLATE; +#else + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "deflate compression not supported"); + return ARCHIVE_WARN; +#endif + } else if (strcmp(value, "store") == 0) + zip->compression = COMPRESSION_STORE; + else + return (ARCHIVE_WARN); + return (ARCHIVE_OK); + } + return (ARCHIVE_WARN); +} + +int +archive_write_set_format_zip(struct archive *_a) +{ + struct archive_write *a = (struct archive_write *)_a; + struct zip *zip; + + /* If another format was already registered, unregister it. */ + if (a->format_destroy != NULL) + (a->format_destroy)(a); + + zip = (struct zip *) malloc(sizeof(*zip)); + if (zip == NULL) { + archive_set_error(&a->archive, ENOMEM, "Can't allocate zip data"); + return (ARCHIVE_FATAL); + } + zip->central_directory = NULL; + zip->central_directory_end = NULL; + zip->offset = 0; + zip->written_bytes = 0; + zip->remaining_data_bytes = 0; + +#ifdef HAVE_ZLIB_H + zip->compression = COMPRESSION_DEFLATE; + zip->len_buf = 65536; + zip->buf = malloc(zip->len_buf); + if (zip->buf == NULL) { + archive_set_error(&a->archive, ENOMEM, "Can't allocate compression buffer"); + return (ARCHIVE_FATAL); + } +#else + zip->compression = COMPRESSION_STORE; +#endif + + a->format_data = zip; + + a->pad_uncompressed = 0; /* Actually not needed for now, since no compression support yet. */ + a->format_name = "zip"; + a->format_options = archive_write_zip_options; + a->format_write_header = archive_write_zip_header; + a->format_write_data = archive_write_zip_data; + a->format_finish_entry = archive_write_zip_finish_entry; + a->format_finish = archive_write_zip_finish; + a->format_destroy = archive_write_zip_destroy; + a->archive.archive_format = ARCHIVE_FORMAT_ZIP; + a->archive.archive_format_name = "ZIP"; + + archive_le32enc(&zip->data_descriptor.signature, + ZIP_SIGNATURE_DATA_DESCRIPTOR); + + return (ARCHIVE_OK); +} + +static int +archive_write_zip_header(struct archive_write *a, struct archive_entry *entry) +{ + struct zip *zip; + struct zip_local_file_header h; + struct zip_extra_data_local e; + struct zip_data_descriptor *d; + struct zip_file_header_link *l; + int ret; + int64_t size; + mode_t type; + + /* Entries other than a regular file or a folder are skipped. */ + type = archive_entry_filetype(entry); + if ((type != AE_IFREG) & (type != AE_IFDIR)) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Filetype not supported"); + return ARCHIVE_FAILED; + }; + + /* Directory entries should have a size of 0. */ + if (type == AE_IFDIR) + archive_entry_set_size(entry, 0); + + zip = a->format_data; + d = &zip->data_descriptor; + size = archive_entry_size(entry); + zip->remaining_data_bytes = size; + + /* Append archive entry to the central directory data. */ + l = (struct zip_file_header_link *) malloc(sizeof(*l)); + if (l == NULL) { + archive_set_error(&a->archive, ENOMEM, "Can't allocate zip header data"); + return (ARCHIVE_FATAL); + } + l->entry = archive_entry_clone(entry); + /* Initialize the CRC variable and potentially the local crc32(). */ + l->crc32 = crc32(0, NULL, 0); + l->compression = zip->compression; + l->compressed_size = 0; + l->next = NULL; + if (zip->central_directory == NULL) { + zip->central_directory = l; + } else { + zip->central_directory_end->next = l; + } + zip->central_directory_end = l; + + /* Store the offset of this header for later use in central directory. */ + l->offset = zip->written_bytes; + + memset(&h, 0, sizeof(h)); + archive_le32enc(&h.signature, ZIP_SIGNATURE_LOCAL_FILE_HEADER); + archive_le16enc(&h.version, ZIP_VERSION_EXTRACT); + archive_le16enc(&h.flags, ZIP_FLAGS); + archive_le16enc(&h.compression, zip->compression); + archive_le32enc(&h.timedate, dos_time(archive_entry_mtime(entry))); + archive_le16enc(&h.filename_length, (uint16_t)path_length(entry)); + + switch (zip->compression) { + case COMPRESSION_STORE: + /* Setting compressed and uncompressed sizes even when specification says + * to set to zero when using data descriptors. Otherwise the end of the + * data for an entry is rather difficult to find. */ + archive_le32enc(&h.compressed_size, size); + archive_le32enc(&h.uncompressed_size, size); + break; +#ifdef HAVE_ZLIB_H + case COMPRESSION_DEFLATE: + archive_le32enc(&h.uncompressed_size, size); + + zip->stream.zalloc = Z_NULL; + zip->stream.zfree = Z_NULL; + zip->stream.opaque = Z_NULL; + zip->stream.next_out = zip->buf; + zip->stream.avail_out = zip->len_buf; + if (deflateInit2(&zip->stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, + -15, 8, Z_DEFAULT_STRATEGY) != Z_OK) { + archive_set_error(&a->archive, ENOMEM, "Can't init deflate compressor"); + return (ARCHIVE_FATAL); + } + break; +#endif + } + + /* Formatting extra data. */ + archive_le16enc(&h.extra_length, sizeof(e)); + archive_le16enc(&e.time_id, ZIP_SIGNATURE_EXTRA_TIMESTAMP); + archive_le16enc(&e.time_size, sizeof(e.time_flag) + + sizeof(e.mtime) + sizeof(e.atime) + sizeof(e.ctime)); + e.time_flag[0] = 0x07; + archive_le32enc(&e.mtime, archive_entry_mtime(entry)); + archive_le32enc(&e.atime, archive_entry_atime(entry)); + archive_le32enc(&e.ctime, archive_entry_ctime(entry)); + + archive_le16enc(&e.unix_id, ZIP_SIGNATURE_EXTRA_UNIX); + archive_le16enc(&e.unix_size, sizeof(e.unix_uid) + sizeof(e.unix_gid)); + archive_le16enc(&e.unix_uid, archive_entry_uid(entry)); + archive_le16enc(&e.unix_gid, archive_entry_gid(entry)); + + archive_le32enc(&d->uncompressed_size, size); + + ret = (a->compressor.write)(a, &h, sizeof(h)); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + zip->written_bytes += sizeof(h); + + ret = write_path(entry, a); + if (ret <= ARCHIVE_OK) + return (ARCHIVE_FATAL); + zip->written_bytes += ret; + + ret = (a->compressor.write)(a, &e, sizeof(e)); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + zip->written_bytes += sizeof(e); + + return (ARCHIVE_OK); +} + +static ssize_t +archive_write_zip_data(struct archive_write *a, const void *buff, size_t s) +{ + int ret; + struct zip *zip = a->format_data; + struct zip_file_header_link *l = zip->central_directory_end; + + if ((int64_t)s > zip->remaining_data_bytes) + s = (size_t)zip->remaining_data_bytes; + + if (s == 0) return 0; + + switch (zip->compression) { + case COMPRESSION_STORE: + ret = (a->compressor.write)(a, buff, s); + if (ret != ARCHIVE_OK) return (ret); + zip->written_bytes += s; + zip->remaining_data_bytes -= s; + l->compressed_size += s; + l->crc32 = crc32(l->crc32, buff, s); + return (s); +#if HAVE_ZLIB_H + case COMPRESSION_DEFLATE: + zip->stream.next_in = (unsigned char*)(uintptr_t)buff; + zip->stream.avail_in = s; + do { + ret = deflate(&zip->stream, Z_NO_FLUSH); + if (ret == Z_STREAM_ERROR) + return (ARCHIVE_FATAL); + if (zip->stream.avail_out == 0) { + ret = (a->compressor.write)(a, zip->buf, zip->len_buf); + if (ret != ARCHIVE_OK) + return (ret); + l->compressed_size += zip->len_buf; + zip->written_bytes += zip->len_buf; + zip->stream.next_out = zip->buf; + zip->stream.avail_out = zip->len_buf; + } + } while (zip->stream.avail_in != 0); + zip->remaining_data_bytes -= s; + /* If we have it, use zlib's fast crc32() */ + l->crc32 = crc32(l->crc32, buff, s); + return (s); +#endif + + default: + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ZIP compression type"); + return ARCHIVE_FATAL; + } +} + +static int +archive_write_zip_finish_entry(struct archive_write *a) +{ + /* Write the data descripter after file data has been written. */ + int ret; + struct zip *zip = a->format_data; + struct zip_data_descriptor *d = &zip->data_descriptor; + struct zip_file_header_link *l = zip->central_directory_end; +#if HAVE_ZLIB_H + size_t reminder; +#endif + + switch(zip->compression) { + case COMPRESSION_STORE: + break; +#if HAVE_ZLIB_H + case COMPRESSION_DEFLATE: + for (;;) { + ret = deflate(&zip->stream, Z_FINISH); + if (ret == Z_STREAM_ERROR) + return (ARCHIVE_FATAL); + reminder = zip->len_buf - zip->stream.avail_out; + ret = (a->compressor.write)(a, zip->buf, reminder); + if (ret != ARCHIVE_OK) + return (ret); + l->compressed_size += reminder; + zip->written_bytes += reminder; + zip->stream.next_out = zip->buf; + if (zip->stream.avail_out != 0) + break; + zip->stream.avail_out = zip->len_buf; + } + deflateEnd(&zip->stream); + break; +#endif + } + + archive_le32enc(&d->crc32, l->crc32); + archive_le32enc(&d->compressed_size, l->compressed_size); + ret = (a->compressor.write)(a, d, sizeof(*d)); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + zip->written_bytes += sizeof(*d); + return (ARCHIVE_OK); +} + +static int +archive_write_zip_finish(struct archive_write *a) +{ + struct zip *zip; + struct zip_file_header_link *l; + struct zip_file_header h; + struct zip_central_directory_end end; + struct zip_extra_data_central e; + off_t offset_start, offset_end; + int entries; + int ret; + + zip = a->format_data; + l = zip->central_directory; + + /* + * Formatting central directory file header fields that are fixed for all entries. + * Fields not used (and therefor 0) are: + * + * - comment_length + * - disk_number + * - attributes_internal + */ + memset(&h, 0, sizeof(h)); + archive_le32enc(&h.signature, ZIP_SIGNATURE_FILE_HEADER); + archive_le16enc(&h.version_by, ZIP_VERSION_BY); + archive_le16enc(&h.version_extract, ZIP_VERSION_EXTRACT); + archive_le16enc(&h.flags, ZIP_FLAGS); + + entries = 0; + offset_start = zip->written_bytes; + + /* Formatting individual header fields per entry and + * writing each entry. */ + while (l != NULL) { + archive_le16enc(&h.compression, l->compression); + archive_le32enc(&h.timedate, dos_time(archive_entry_mtime(l->entry))); + archive_le32enc(&h.crc32, l->crc32); + archive_le32enc(&h.compressed_size, l->compressed_size); + archive_le32enc(&h.uncompressed_size, archive_entry_size(l->entry)); + archive_le16enc(&h.filename_length, (uint16_t)path_length(l->entry)); + archive_le16enc(&h.extra_length, sizeof(e)); + archive_le16enc(&h.attributes_external[2], archive_entry_mode(l->entry)); + archive_le32enc(&h.offset, l->offset); + + /* Formatting extra data. */ + archive_le16enc(&e.time_id, ZIP_SIGNATURE_EXTRA_TIMESTAMP); + archive_le16enc(&e.time_size, sizeof(e.mtime) + sizeof(e.time_flag)); + e.time_flag[0] = 0x07; + archive_le32enc(&e.mtime, archive_entry_mtime(l->entry)); + archive_le16enc(&e.unix_id, ZIP_SIGNATURE_EXTRA_UNIX); + archive_le16enc(&e.unix_size, 0x0000); + + ret = (a->compressor.write)(a, &h, sizeof(h)); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + zip->written_bytes += sizeof(h); + + ret = write_path(l->entry, a); + if (ret <= ARCHIVE_OK) + return (ARCHIVE_FATAL); + zip->written_bytes += ret; + + ret = (a->compressor.write)(a, &e, sizeof(e)); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + zip->written_bytes += sizeof(e); + + l = l->next; + entries++; + } + offset_end = zip->written_bytes; + + /* Formatting end of central directory. */ + memset(&end, 0, sizeof(end)); + archive_le32enc(&end.signature, ZIP_SIGNATURE_CENTRAL_DIRECTORY_END); + archive_le16enc(&end.entries_disk, entries); + archive_le16enc(&end.entries, entries); + archive_le32enc(&end.size, offset_end - offset_start); + archive_le32enc(&end.offset, offset_start); + + /* Writing end of central directory. */ + ret = (a->compressor.write)(a, &end, sizeof(end)); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + zip->written_bytes += sizeof(end); + return (ARCHIVE_OK); +} + +static int +archive_write_zip_destroy(struct archive_write *a) +{ + struct zip *zip; + struct zip_file_header_link *l; + + zip = a->format_data; + while (zip->central_directory != NULL) { + l = zip->central_directory; + zip->central_directory = l->next; + archive_entry_free(l->entry); + free(l); + } +#ifdef HAVE_ZLIB_H + free(zip->buf); +#endif + free(zip); + a->format_data = NULL; + return (ARCHIVE_OK); +} + +/* Convert into MSDOS-style date/time. */ +static unsigned int +dos_time(const time_t unix_time) +{ + struct tm *t; + unsigned int dt; + + /* This will not preserve time when creating/extracting the archive + * on two systems with different time zones. */ + t = localtime(&unix_time); + + dt = 0; + dt += ((t->tm_year - 80) & 0x7f) << 9; + dt += ((t->tm_mon + 1) & 0x0f) << 5; + dt += (t->tm_mday & 0x1f); + dt <<= 16; + dt += (t->tm_hour & 0x1f) << 11; + dt += (t->tm_min & 0x3f) << 5; + dt += (t->tm_sec & 0x3e) >> 1; /* Only counting every 2 seconds. */ + return dt; +} + +static size_t +path_length(struct archive_entry *entry) +{ + mode_t type; + const char *path; + + type = archive_entry_filetype(entry); + path = archive_entry_pathname(entry); + + if ((type == AE_IFDIR) & (path[strlen(path) - 1] != '/')) { + return strlen(path) + 1; + } else { + return strlen(path); + } +} + +static int +write_path(struct archive_entry *entry, struct archive_write *archive) +{ + int ret; + const char *path; + mode_t type; + size_t written_bytes; + + path = archive_entry_pathname(entry); + type = archive_entry_filetype(entry); + written_bytes = 0; + + ret = (archive->compressor.write)(archive, path, strlen(path)); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + written_bytes += strlen(path); + + /* Folders are recognized by a traling slash. */ + if ((type == AE_IFDIR) & (path[strlen(path) - 1] != '/')) { + ret = (archive->compressor.write)(archive, "/", 1); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + written_bytes += 1; + } + + return ((int)written_bytes); +} From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 06:27:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE3AD106566B; Tue, 29 Dec 2009 06:27:19 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB4DA8FC0C; Tue, 29 Dec 2009 06:27:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT6RJKg013560; Tue, 29 Dec 2009 06:27:19 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT6RJKH013558; Tue, 29 Dec 2009 06:27:19 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290627.nBT6RJKH013558@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 06:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201169 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 06:27:19 -0000 Author: kientzle Date: Tue Dec 29 06:27:19 2009 New Revision: 201169 URL: http://svn.freebsd.org/changeset/base/201169 Log: Clear extraneous error messages. Modified: head/lib/libarchive/archive_read_support_compression_all.c Modified: head/lib/libarchive/archive_read_support_compression_all.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_all.c Tue Dec 29 06:15:32 2009 (r201168) +++ head/lib/libarchive/archive_read_support_compression_all.c Tue Dec 29 06:27:19 2009 (r201169) @@ -50,5 +50,7 @@ archive_read_support_compression_all(str * "as much as possible." Clients who need specific * compression should enable those individually so they can * verify the level of support. */ + /* Clear any warning messages set by the above functions. */ + archive_clear_error(a); return (ARCHIVE_OK); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 06:34:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7726A106568F; Tue, 29 Dec 2009 06:34:23 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 641C38FC1C; Tue, 29 Dec 2009 06:34:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT6YNWm013714; Tue, 29 Dec 2009 06:34:23 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT6YNrV013712; Tue, 29 Dec 2009 06:34:23 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290634.nBT6YNrV013712@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 06:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201170 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 06:34:23 -0000 Author: kientzle Date: Tue Dec 29 06:34:23 2009 New Revision: 201170 URL: http://svn.freebsd.org/changeset/base/201170 Log: Essentially eliminate problems with false hardlinks in POSIX cpio archives by generating synthetic ino values and mapping values from disk into the new values. Modified: head/lib/libarchive/archive_write_set_format_cpio.c Modified: head/lib/libarchive/archive_write_set_format_cpio.c ============================================================================== --- head/lib/libarchive/archive_write_set_format_cpio.c Tue Dec 29 06:27:19 2009 (r201169) +++ head/lib/libarchive/archive_write_set_format_cpio.c Tue Dec 29 06:34:23 2009 (r201170) @@ -54,6 +54,12 @@ static int64_t format_octal_recursive(in struct cpio { uint64_t entry_bytes_remaining; + + int64_t ino_next; + + struct { int64_t old; int new;} *ino_list; + size_t ino_list_size; + size_t ino_list_next; }; struct cpio_header { @@ -103,35 +109,102 @@ archive_write_set_format_cpio(struct arc return (ARCHIVE_OK); } +/* + * Ino values are as long as 64 bits on some systems; cpio format + * only allows 18 bits and relies on the ino values to identify hardlinked + * files. So, we can't merely "hash" the ino numbers since collisions + * would corrupt the archive. Instead, we generate synthetic ino values + * to store in the archive and maintain a map of original ino values to + * synthetic ones so we can preserve hardlink information. + * + * TODO: Make this more efficient. It's not as bad as it looks (most + * files don't have any hardlinks and we don't do any work here for those), + * but it wouldn't be hard to do better. + * + * TODO: Work with dev/ino pairs here instead of just ino values. + */ +static int +synthesize_ino_value(struct cpio *cpio, struct archive_entry *entry) +{ + int64_t ino = archive_entry_ino64(entry); + int ino_new; + size_t i; + + /* + * If no index number was given, don't assign one. In + * particular, this handles the end-of-archive marker + * correctly by giving it a zero index value. (This is also + * why we start our synthetic index numbers with one below.) + */ + if (ino == 0) + return (0); + + /* Don't store a mapping if we don't need to. */ + if (archive_entry_nlink(entry) < 2) { + return ++cpio->ino_next; + } + + /* Look up old ino; if we have it, this is a hardlink + * and we reuse the same value. */ + for (i = 0; i < cpio->ino_list_next; ++i) { + if (cpio->ino_list[i].old == ino) + return (cpio->ino_list[i].new); + } + + /* Assign a new index number. */ + ino_new = ++cpio->ino_next; + + /* Ensure space for the new mapping. */ + if (cpio->ino_list_size <= cpio->ino_list_next) { + size_t newsize = cpio->ino_list_size < 512 + ? 512 : cpio->ino_list_size * 2; + void *newlist = realloc(cpio->ino_list, + sizeof(cpio->ino_list[0]) * newsize); + if (newlist == NULL) + return (-1); + + cpio->ino_list_size = newsize; + cpio->ino_list = newlist; + } + + /* Record and return the new value. */ + cpio->ino_list[cpio->ino_list_next].old = ino; + cpio->ino_list[cpio->ino_list_next].new = ino_new; + ++cpio->ino_list_next; + return (ino_new); +} + static int archive_write_cpio_header(struct archive_write *a, struct archive_entry *entry) { struct cpio *cpio; const char *p, *path; - int pathlength, ret; + int pathlength, ret, ret2; + int64_t ino; struct cpio_header h; cpio = (struct cpio *)a->format_data; - ret = 0; + ret2 = ARCHIVE_OK; path = archive_entry_pathname(entry); - pathlength = strlen(path) + 1; /* Include trailing null. */ + pathlength = (int)strlen(path) + 1; /* Include trailing null. */ memset(&h, 0, sizeof(h)); format_octal(070707, &h.c_magic, sizeof(h.c_magic)); format_octal(archive_entry_dev(entry), &h.c_dev, sizeof(h.c_dev)); - /* - * TODO: Generate artificial inode numbers rather than just - * re-using the ones off the disk. That way, the 18-bit c_ino - * field only limits the number of files in the archive. - */ - if ((int)archive_entry_ino(entry) > 0777777) { + + ino = synthesize_ino_value(cpio, entry); + if (ino < 0) { + archive_set_error(&a->archive, ENOMEM, + "No memory for ino translation table"); + return (ARCHIVE_FATAL); + } else if (ino > 0777777) { archive_set_error(&a->archive, ERANGE, - "large inode number truncated"); - ret = ARCHIVE_WARN; + "Too many files for this cpio format"); + return (ARCHIVE_FATAL); } + format_octal(ino & 0777777, &h.c_ino, sizeof(h.c_ino)); - format_octal(archive_entry_ino(entry) & 0777777, &h.c_ino, sizeof(h.c_ino)); format_octal(archive_entry_mode(entry), &h.c_mode, sizeof(h.c_mode)); format_octal(archive_entry_uid(entry), &h.c_uid, sizeof(h.c_uid)); format_octal(archive_entry_gid(entry), &h.c_gid, sizeof(h.c_gid)); @@ -170,6 +243,8 @@ archive_write_cpio_header(struct archive if (p != NULL && *p != '\0') ret = (a->compressor.write)(a, p, strlen(p)); + if (ret == ARCHIVE_OK) + ret = ret2; return (ret); } @@ -218,17 +293,15 @@ format_octal_recursive(int64_t v, char * return (v); v = format_octal_recursive(v, p+1, s-1); *p = '0' + (v & 7); - return (v >>= 3); + return (v >> 3); } static int archive_write_cpio_finish(struct archive_write *a) { - struct cpio *cpio; int er; struct archive_entry *trailer; - cpio = (struct cpio *)a->format_data; trailer = archive_entry_new(); /* nlink = 1 here for GNU cpio compat. */ archive_entry_set_nlink(trailer, 1); @@ -244,6 +317,7 @@ archive_write_cpio_destroy(struct archiv struct cpio *cpio; cpio = (struct cpio *)a->format_data; + free(cpio->ino_list); free(cpio); a->format_data = NULL; return (ARCHIVE_OK); @@ -253,7 +327,8 @@ static int archive_write_cpio_finish_entry(struct archive_write *a) { struct cpio *cpio; - int to_write, ret; + size_t to_write; + int ret; cpio = (struct cpio *)a->format_data; ret = ARCHIVE_OK; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 06:39:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2836A106566B; Tue, 29 Dec 2009 06:39:08 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1466F8FC0A; Tue, 29 Dec 2009 06:39:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT6d85r013840; Tue, 29 Dec 2009 06:39:08 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT6d8uT013837; Tue, 29 Dec 2009 06:39:08 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912290639.nBT6d8uT013837@svn.freebsd.org> From: Tim Kientzle Date: Tue, 29 Dec 2009 06:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201171 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 06:39:08 -0000 Author: kientzle Date: Tue Dec 29 06:39:07 2009 New Revision: 201171 URL: http://svn.freebsd.org/changeset/base/201171 Log: Rationalize the support for cryptographic hashes. Added: head/lib/libarchive/archive_hash.h (contents, props changed) Modified: head/lib/libarchive/archive_write_set_format_mtree.c Added: head/lib/libarchive/archive_hash.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/archive_hash.h Tue Dec 29 06:39:07 2009 (r201171) @@ -0,0 +1,196 @@ +/*- + * Copyright (c) 2009 Joerg Sonnenberger + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + +/* + * Hash function support in various Operating Systems: + * + * NetBSD: + * - MD5 and SHA1 in libc: without _ after algorithm name + * - SHA2 in libc: with _ after algorithm name + * + * OpenBSD: + * - MD5, SHA1 and SHA2 in libc: without _ after algorithm name + * - OpenBSD 4.4 and earlier have SHA2 in libc with _ after algorithm name + * + * DragonFly and FreeBSD (XXX not used yet): + * - MD5 and SHA1 in libmd: without _ after algorithm name + * - SHA256: with _ after algorithm name + * + * OpenSSL: + * - MD5, SHA1 and SHA2 in libcrypto: with _ after algorithm name + */ + +#if defined(HAVE_MD5_H) && defined(HAVE_MD5INIT) +# include +# define ARCHIVE_HAS_MD5 +typedef MD5_CTX archive_md5_ctx; +# define archive_md5_init(ctx) MD5Init(ctx) +# define archive_md5_final(ctx, buf) MD5Final(buf, ctx) +# define archive_md5_update(ctx, buf, n) MD5Update(ctx, buf, n) +#elif defined(HAVE_OPENSSL_MD5_H) +# include +# define ARCHIVE_HAS_MD5 +typedef MD5_CTX archive_md5_ctx; +# define archive_md5_init(ctx) MD5_Init(ctx) +# define archive_md5_final(ctx, buf) MD5_Final(buf, ctx) +# define archive_md5_update(ctx, buf, n) MD5_Update(ctx, buf, n) +#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_MD5) +# define ARCHIVE_HAS_MD5 +typedef MD5_CTX archive_md5_ctx; +# define archive_md5_init(ctx) MD5_Init(ctx) +# define archive_md5_final(ctx, buf) MD5_Final(buf, ctx) +# define archive_md5_update(ctx, buf, n) MD5_Update(ctx, buf, n) +#endif + +#if defined(HAVE_RMD160_H) && defined(HAVE_RMD160INIT) +# include +# define ARCHIVE_HAS_RMD160 +typedef RMD160_CTX archive_rmd160_ctx; +# define archive_rmd160_init(ctx) RMD160Init(ctx) +# define archive_rmd160_final(ctx, buf) RMD160Final(buf, ctx) +# define archive_rmd160_update(ctx, buf, n) RMD160Update(ctx, buf, n) +#elif defined(HAVE_OPENSSL_RIPEMD_H) +# include +# define ARCHIVE_HAS_RMD160 +typedef RIPEMD160_CTX archive_rmd160_ctx; +# define archive_rmd160_init(ctx) RIPEMD160_Init(ctx) +# define archive_rmd160_final(ctx, buf) RIPEMD160_Final(buf, ctx) +# define archive_rmd160_update(ctx, buf, n) RIPEMD160_Update(ctx, buf, n) +#endif + +#if defined(HAVE_SHA1_H) && defined(HAVE_SHA1INIT) +# include +# define ARCHIVE_HAS_SHA1 +typedef SHA1_CTX archive_sha1_ctx; +# define archive_sha1_init(ctx) SHA1Init(ctx) +# define archive_sha1_final(ctx, buf) SHA1Final(buf, ctx) +# define archive_sha1_update(ctx, buf, n) SHA1Update(ctx, buf, n) +#elif defined(HAVE_OPENSSL_SHA_H) +# include +# define ARCHIVE_HAS_SHA1 +typedef SHA_CTX archive_sha1_ctx; +# define archive_sha1_init(ctx) SHA1_Init(ctx) +# define archive_sha1_final(ctx, buf) SHA1_Final(buf, ctx) +# define archive_sha1_update(ctx, buf, n) SHA1_Update(ctx, buf, n) +#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA1) +# define ARCHIVE_HAS_SHA1 +typedef SHA1_CTX archive_sha1_ctx; +# define archive_sha1_init(ctx) SHA1_Init(ctx) +# define archive_sha1_final(ctx, buf) SHA1_Final(buf, ctx) +# define archive_sha1_update(ctx, buf, n) SHA1_Update(ctx, buf, n) +#endif + +#if defined(HAVE_SHA2_H) && defined(HAVE_SHA256_INIT) +# include +# define ARCHIVE_HAS_SHA256 +typedef SHA256_CTX archive_sha256_ctx; +# define archive_sha256_init(ctx) SHA256_Init(ctx) +# define archive_sha256_final(ctx, buf) SHA256_Final(buf, ctx) +# define archive_sha256_update(ctx, buf, n) SHA256_Update(ctx, buf, n) +#elif defined(HAVE_SHA2_H) && defined(HAVE_SHA256INIT) +# include +# define ARCHIVE_HAS_SHA256 +typedef SHA256_CTX archive_sha256_ctx; +# define archive_sha256_init(ctx) SHA256Init(ctx) +# define archive_sha256_final(ctx, buf) SHA256Final(buf, ctx) +# define archive_sha256_update(ctx, buf, n) SHA256Update(ctx, buf, n) +#elif defined(HAVE_OPENSSL_SHA_H) && defined(HAVE_OPENSSL_SHA256_INIT) +# include +# define ARCHIVE_HAS_SHA256 +typedef SHA256_CTX archive_sha256_ctx; +# define archive_sha256_init(ctx) SHA256_Init(ctx) +# define archive_sha256_final(ctx, buf) SHA256_Final(buf, ctx) +# define archive_sha256_update(ctx, buf, n) SHA256_Update(ctx, buf, n) +#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA_256) +# define ARCHIVE_HAS_SHA256 +typedef SHA256_CTX archive_sha256_ctx; +# define archive_sha256_init(ctx) SHA256_Init(ctx) +# define archive_sha256_final(ctx, buf) SHA256_Final(buf, ctx) +# define archive_sha256_update(ctx, buf, n) SHA256_Update(ctx, buf, n) +#endif + +#if defined(HAVE_SHA2_H) && defined(HAVE_SHA384_INIT) +# include +# define ARCHIVE_HAS_SHA384 +typedef SHA384_CTX archive_sha384_ctx; +# define archive_sha384_init(ctx) SHA384_Init(ctx) +# define archive_sha384_final(ctx, buf) SHA384_Final(buf, ctx) +# define archive_sha384_update(ctx, buf, n) SHA384_Update(ctx, buf, n) +#elif defined(HAVE_SHA2_H) && defined(HAVE_SHA384INIT) +# include +# define ARCHIVE_HAS_SHA384 +typedef SHA384_CTX archive_sha384_ctx; +# define archive_sha384_init(ctx) SHA384Init(ctx) +# define archive_sha384_final(ctx, buf) SHA384Final(buf, ctx) +# define archive_sha384_update(ctx, buf, n) SHA384Update(ctx, buf, n) +#elif defined(HAVE_OPENSSL_SHA_H) && defined(HAVE_OPENSSL_SHA384_INIT) +# include +# define ARCHIVE_HAS_SHA384 +typedef SHA512_CTX archive_sha384_ctx; +# define archive_sha384_init(ctx) SHA384_Init(ctx) +# define archive_sha384_final(ctx, buf) SHA384_Final(buf, ctx) +# define archive_sha384_update(ctx, buf, n) SHA384_Update(ctx, buf, n) +#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA_384) +# define ARCHIVE_HAS_SHA384 +typedef SHA512_CTX archive_sha384_ctx; +# define archive_sha384_init(ctx) SHA384_Init(ctx) +# define archive_sha384_final(ctx, buf) SHA384_Final(buf, ctx) +# define archive_sha384_update(ctx, buf, n) SHA384_Update(ctx, buf, n) +#endif + +#if defined(HAVE_SHA2_H) && defined(HAVE_SHA512_INIT) +# include +# define ARCHIVE_HAS_SHA512 +typedef SHA512_CTX archive_sha512_ctx; +# define archive_sha512_init(ctx) SHA512_Init(ctx) +# define archive_sha512_final(ctx, buf) SHA512_Final(buf, ctx) +# define archive_sha512_update(ctx, buf, n) SHA512_Update(ctx, buf, n) +#elif defined(HAVE_SHA2_H) && defined(HAVE_SHA512INIT) +# include +# define ARCHIVE_HAS_SHA512 +typedef SHA512_CTX archive_sha512_ctx; +# define archive_sha512_init(ctx) SHA512Init(ctx) +# define archive_sha512_final(ctx, buf) SHA512Final(buf, ctx) +# define archive_sha512_update(ctx, buf, n) SHA512Update(ctx, buf, n) +#elif defined(HAVE_OPENSSL_SHA_H) && defined(HAVE_OPENSSL_SHA512_INIT) +# include +# define ARCHIVE_HAS_SHA512 +typedef SHA512_CTX archive_sha512_ctx; +# define archive_sha512_init(ctx) SHA512_Init(ctx) +# define archive_sha512_final(ctx, buf) SHA512_Final(buf, ctx) +# define archive_sha512_update(ctx, buf, n) SHA512_Update(ctx, buf, n) +#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA_512) +# define ARCHIVE_HAS_SHA512 +typedef SHA512_CTX archive_sha512_ctx; +# define archive_sha512_init(ctx) SHA512_Init(ctx) +# define archive_sha512_final(ctx, buf) SHA512_Final(buf, ctx) +# define archive_sha512_update(ctx, buf, n) SHA512_Update(ctx, buf, n) +#endif Modified: head/lib/libarchive/archive_write_set_format_mtree.c ============================================================================== --- head/lib/libarchive/archive_write_set_format_mtree.c Tue Dec 29 06:34:23 2009 (r201170) +++ head/lib/libarchive/archive_write_set_format_mtree.c Tue Dec 29 06:39:07 2009 (r201171) @@ -33,45 +33,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef HAVE_MD5_H -#include -#else -#ifdef HAVE_OPENSSL_MD5_H -#include -#endif /* HAVE_OPENSSL_MD5_H */ -#endif /* HAVE_MD5_H */ -#ifdef HAVE_OPENSSL_RIPEMD_H -#include -#else /* HAVE_OPENSSL_RIPEMD_H */ -#ifdef HAVE_RIPEMD_H -#include -#endif -#ifdef HAVE_RMD160_H -#include -#endif -#endif /* HAVE_OPENSSL_RIPEMD_H */ -#ifdef HAVE_OPENSSL_SHA_H -#include -#else /* HAVE_OPENSSL_SHA_H */ -#ifdef HAVE_SHA_H -#include -#endif -#ifdef HAVE_SHA1_H -#include -#endif -#ifdef HAVE_SHA2_H -#include -#endif -#ifdef HAVE_SHA256_H -#include -#endif -#endif /* HAVE_OPENSSL_SHA_H */ #include "archive.h" #include "archive_entry.h" #include "archive_private.h" #include "archive_write_private.h" +#include "archive_hash.h" + #define INDENTNAMELEN 15 #define MAXLINELEN 80 @@ -97,33 +66,23 @@ struct mtree_writer { int compute_sum; uint32_t crc; uint64_t crc_len; -#ifdef HAVE_MD5 - MD5_CTX md5ctx; -#endif -#if defined(HAVE_OPENSSL_RIPEMD_H) || defined(HAVE_RIPEMD_H) - RIPEMD160_CTX rmd160ctx; -#elif defined(HAVE_RMD160_H) - RMD160_CTX rmd160ctx; -#endif -#ifdef HAVE_SHA1 -#if defined(HAVE_OPENSSL_SHA_H) || defined(HAVE_SHA_H) - SHA_CTX sha1ctx; -#else - SHA1_CTX sha1ctx; +#ifdef ARCHIVE_HAS_MD5 + archive_md5_ctx md5ctx; #endif +#ifdef ARCHIVE_HAS_RMD160 + archive_rmd160_ctx rmd160ctx; #endif -#ifdef HAVE_SHA256 - SHA256_CTX sha256ctx; +#ifdef ARCHIVE_HAS_SHA1 + archive_sha1_ctx sha1ctx; #endif -#ifdef HAVE_SHA384 -#if defined(HAVE_OPENSSL_SHA_H) - SHA512_CTX sha384ctx; -#else - SHA384_CTX sha384ctx; +#ifdef ARCHIVE_HAS_SHA256 + archive_sha256_ctx sha256ctx; #endif +#ifdef ARCHIVE_HAS_SHA384 + archive_sha384_ctx sha384ctx; #endif -#ifdef HAVE_SHA512 - SHA512_CTX sha512ctx; +#ifdef ARCHIVE_HAS_SHA512 + archive_sha512_ctx sha512ctx; #endif /* Keyword options */ int keys; @@ -614,51 +573,51 @@ archive_write_mtree_header(struct archiv mtree->crc_len = 0; } else mtree->compute_sum &= ~F_CKSUM; -#ifdef HAVE_MD5 +#ifdef ARCHIVE_HAS_MD5 if ((mtree->keys & F_MD5) != 0 && archive_entry_filetype(entry) == AE_IFREG) { mtree->compute_sum |= F_MD5; - MD5Init(&mtree->md5ctx); + archive_md5_init(&mtree->md5ctx); } else mtree->compute_sum &= ~F_MD5; #endif -#ifdef HAVE_RMD160 +#ifdef ARCHIVE_HAS_RMD160 if ((mtree->keys & F_RMD160) != 0 && archive_entry_filetype(entry) == AE_IFREG) { mtree->compute_sum |= F_RMD160; - RIPEMD160_Init(&mtree->rmd160ctx); + archive_rmd160_init(&mtree->rmd160ctx); } else mtree->compute_sum &= ~F_RMD160; #endif -#ifdef HAVE_SHA1 +#ifdef ARCHIVE_HAS_SHA1 if ((mtree->keys & F_SHA1) != 0 && archive_entry_filetype(entry) == AE_IFREG) { mtree->compute_sum |= F_SHA1; - SHA1_Init(&mtree->sha1ctx); + archive_sha1_init(&mtree->sha1ctx); } else mtree->compute_sum &= ~F_SHA1; #endif -#ifdef HAVE_SHA256 +#ifdef ARCHIVE_HAS_SHA256 if ((mtree->keys & F_SHA256) != 0 && archive_entry_filetype(entry) == AE_IFREG) { mtree->compute_sum |= F_SHA256; - SHA256_Init(&mtree->sha256ctx); + archive_sha256_init(&mtree->sha256ctx); } else mtree->compute_sum &= ~F_SHA256; #endif -#ifdef HAVE_SHA384 +#ifdef ARCHIVE_HAS_SHA384 if ((mtree->keys & F_SHA384) != 0 && archive_entry_filetype(entry) == AE_IFREG) { mtree->compute_sum |= F_SHA384; - SHA384_Init(&mtree->sha384ctx); + archive_sha384_init(&mtree->sha384ctx); } else mtree->compute_sum &= ~F_SHA384; #endif -#ifdef HAVE_SHA512 +#ifdef ARCHIVE_HAS_SHA512 if ((mtree->keys & F_SHA512) != 0 && archive_entry_filetype(entry) == AE_IFREG) { mtree->compute_sum |= F_SHA512; - SHA512_Init(&mtree->sha512ctx); + archive_sha512_init(&mtree->sha512ctx); } else mtree->compute_sum &= ~F_SHA512; #endif @@ -666,7 +625,9 @@ archive_write_mtree_header(struct archiv return (ARCHIVE_OK); } -#if defined(HAVE_MD5) || defined(HAVE_RMD160) || defined(HAVE_SHA1) || defined(HAVE_SHA256) || defined(HAVE_SHA384) || defined(HAVE_SHA512) +#if defined(ARCHIVE_HAS_MD5) || defined(ARCHIVE_HAS_RMD160) || \ + defined(ARCHIVE_HAS_SHA1) || defined(ARCHIVE_HAS_SHA256) || \ + defined(ARCHIVE_HAS_SHA384) || defined(ARCHIVE_HAS_SHA512) static void strappend_bin(struct archive_string *s, const unsigned char *bin, int n) { @@ -799,56 +760,56 @@ archive_write_mtree_finish_entry(struct archive_string_sprintf(str, " cksum=%ju", (uintmax_t)mtree->crc); } -#ifdef HAVE_MD5 +#ifdef ARCHIVE_HAS_MD5 if (mtree->compute_sum & F_MD5) { unsigned char buf[16]; - MD5Final(buf, &mtree->md5ctx); + archive_md5_final(&mtree->md5ctx, buf); archive_strcat(str, " md5digest="); strappend_bin(str, buf, sizeof(buf)); } #endif -#ifdef HAVE_RMD160 +#ifdef ARCHIVE_HAS_RMD160 if (mtree->compute_sum & F_RMD160) { unsigned char buf[20]; - RIPEMD160_Final(buf, &mtree->rmd160ctx); + archive_rmd160_final(&mtree->rmd160ctx, buf); archive_strcat(str, " rmd160digest="); strappend_bin(str, buf, sizeof(buf)); } #endif -#ifdef HAVE_SHA1 +#ifdef ARCHIVE_HAS_SHA1 if (mtree->compute_sum & F_SHA1) { unsigned char buf[20]; - SHA1_Final(buf, &mtree->sha1ctx); + archive_sha1_final(&mtree->sha1ctx, buf); archive_strcat(str, " sha1digest="); strappend_bin(str, buf, sizeof(buf)); } #endif -#ifdef HAVE_SHA256 +#ifdef ARCHIVE_HAS_SHA256 if (mtree->compute_sum & F_SHA256) { unsigned char buf[32]; - SHA256_Final(buf, &mtree->sha256ctx); + archive_sha256_final(&mtree->sha256ctx, buf); archive_strcat(str, " sha256digest="); strappend_bin(str, buf, sizeof(buf)); } #endif -#ifdef HAVE_SHA384 +#ifdef ARCHIVE_HAS_SHA384 if (mtree->compute_sum & F_SHA384) { unsigned char buf[48]; - SHA384_Final(buf, &mtree->sha384ctx); + archive_sha384_final(&mtree->sha384ctx, buf); archive_strcat(str, " sha384digest="); strappend_bin(str, buf, sizeof(buf)); } #endif -#ifdef HAVE_SHA512 +#ifdef ARCHIVE_HAS_SHA512 if (mtree->compute_sum & F_SHA512) { unsigned char buf[64]; - SHA512_Final(buf, &mtree->sha512ctx); + archive_sha512_final(&mtree->sha512ctx, buf); archive_strcat(str, " sha512digest="); strappend_bin(str, buf, sizeof(buf)); } @@ -893,35 +854,35 @@ archive_write_mtree_data(struct archive_ * Compute a POSIX 1003.2 checksum */ const unsigned char *p; - int nn; + size_t nn; for (nn = n, p = buff; nn--; ++p) COMPUTE_CRC(mtree->crc, *p); mtree->crc_len += n; } -#ifdef HAVE_MD5 +#ifdef ARCHIVE_HAS_MD5 if (mtree->compute_sum & F_MD5) - MD5Update(&mtree->md5ctx, buff, n); + archive_md5_update(&mtree->md5ctx, buff, n); #endif -#ifdef HAVE_RMD160 +#ifdef ARCHIVE_HAS_RMD160 if (mtree->compute_sum & F_RMD160) - RIPEMD160_Update(&mtree->rmd160ctx, buff, n); + archive_rmd160_update(&mtree->rmd160ctx, buff, n); #endif -#ifdef HAVE_SHA1 +#ifdef ARCHIVE_HAS_SHA1 if (mtree->compute_sum & F_SHA1) - SHA1_Update(&mtree->sha1ctx, buff, n); + archive_sha1_update(&mtree->sha1ctx, buff, n); #endif -#ifdef HAVE_SHA256 +#ifdef ARCHIVE_HAS_SHA256 if (mtree->compute_sum & F_SHA256) - SHA256_Update(&mtree->sha256ctx, buff, n); + archive_sha256_update(&mtree->sha256ctx, buff, n); #endif -#ifdef HAVE_SHA384 +#ifdef ARCHIVE_HAS_SHA384 if (mtree->compute_sum & F_SHA384) - SHA384_Update(&mtree->sha384ctx, buff, n); + archive_sha384_update(&mtree->sha384ctx, buff, n); #endif -#ifdef HAVE_SHA512 +#ifdef ARCHIVE_HAS_SHA512 if (mtree->compute_sum & F_SHA512) - SHA512_Update(&mtree->sha512ctx, buff, n); + archive_sha512_update(&mtree->sha512ctx, buff, n); #endif return (n); } @@ -988,11 +949,9 @@ archive_write_mtree_options(struct archi keybit = F_SLINK; break; case 'm': -#ifdef HAVE_MD5 if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0) keybit = F_MD5; -#endif if (strcmp(key, "mode") == 0) keybit = F_MODE; break; @@ -1000,35 +959,25 @@ archive_write_mtree_options(struct archi if (strcmp(key, "nlink") == 0) keybit = F_NLINK; break; -#ifdef HAVE_RMD160 case 'r': if (strcmp(key, "ripemd160digest") == 0 || strcmp(key, "rmd160") == 0 || strcmp(key, "rmd160digest") == 0) keybit = F_RMD160; break; -#endif case 's': -#ifdef HAVE_SHA1 if (strcmp(key, "sha1") == 0 || strcmp(key, "sha1digest") == 0) keybit = F_SHA1; -#endif -#ifdef HAVE_SHA256 if (strcmp(key, "sha256") == 0 || strcmp(key, "sha256digest") == 0) keybit = F_SHA256; -#endif -#ifdef HAVE_SHA384 if (strcmp(key, "sha384") == 0 || strcmp(key, "sha384digest") == 0) keybit = F_SHA384; -#endif -#ifdef HAVE_SHA384 if (strcmp(key, "sha512") == 0 || strcmp(key, "sha512digest") == 0) keybit = F_SHA512; -#endif if (strcmp(key, "size") == 0) keybit = F_SIZE; break; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 08:42:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B1841065679; Tue, 29 Dec 2009 08:42:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49D618FC18; Tue, 29 Dec 2009 08:42:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT8gxqW016730; Tue, 29 Dec 2009 08:42:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT8gx2N016727; Tue, 29 Dec 2009 08:42:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912290842.nBT8gx2N016727@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 08:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201175 - in head/games/fortune: strfile unstr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 08:42:59 -0000 Author: ed Date: Tue Dec 29 08:42:58 2009 New Revision: 201175 URL: http://svn.freebsd.org/changeset/base/201175 Log: Use ANSI C function declarations. Modified: head/games/fortune/strfile/strfile.c head/games/fortune/unstr/unstr.c Modified: head/games/fortune/strfile/strfile.c ============================================================================== --- head/games/fortune/strfile/strfile.c Tue Dec 29 07:19:52 2009 (r201174) +++ head/games/fortune/strfile/strfile.c Tue Dec 29 08:42:58 2009 (r201175) @@ -146,7 +146,8 @@ static void usage(void); * CHUNKSIZE blocks; if the latter, we just write each pointer, * and then seek back to the beginning to write in the table. */ -int main(int ac, char *av[]) +int +main(int ac, char *av[]) { char *sp, dc; FILE *inf, *outf; @@ -264,9 +265,8 @@ int main(int ac, char *av[]) /* * This routine evaluates arguments from the command line */ -void getargs(argc, argv) -int argc; -char **argv; +void +getargs(int argc, char **argv) { int ch; @@ -318,7 +318,8 @@ char **argv; } } -void usage() +void +usage(void) { (void) fprintf(stderr, "strfile [-Ciorsx] [-c char] source_file [output_file]\n"); @@ -329,9 +330,8 @@ void usage() * add_offset: * Add an offset to the list, or write it out, as appropriate. */ -void add_offset(fp, off) -FILE *fp; -off_t off; +void +add_offset(FILE *fp, off_t off) { off_t beoff; @@ -349,7 +349,8 @@ off_t off; * do_order: * Order the strings alphabetically (possibly ignoring case). */ -void do_order() +void +do_order(void) { uint32_t i; off_t *lp; @@ -368,8 +369,8 @@ void do_order() Tbl.str_flags |= STR_ORDERED; } -static int stable_collate_range_cmp(c1, c2) - int c1, c2; +static int +stable_collate_range_cmp(int c1, int c2) { static char s1[2], s2[2]; int ret; @@ -385,8 +386,8 @@ static int stable_collate_range_cmp(c1, * cmp_str: * Compare two strings in the file */ -int cmp_str(s1, s2) -const void *s1, *s2; +int +cmp_str(const void *s1, const void *s2) { const STR *p1, *p2; int c1, c2; @@ -441,7 +442,8 @@ const void *s1, *s2; * not to randomize across delimiter boundaries. All * randomization is done within each block. */ -void randomize() +void +randomize(void) { uint32_t cnt, i; off_t tmp; Modified: head/games/fortune/unstr/unstr.c ============================================================================== --- head/games/fortune/unstr/unstr.c Tue Dec 29 07:19:52 2009 (r201174) +++ head/games/fortune/unstr/unstr.c Tue Dec 29 08:42:58 2009 (r201175) @@ -79,7 +79,8 @@ FILE *Inf, *Dataf; void order_unstr(STRFILE *); /* ARGSUSED */ -int main(int ac, char **av) +int +main(int ac, char **av) { static STRFILE tbl; /* description table */ @@ -109,8 +110,8 @@ int main(int ac, char **av) exit(0); } -void order_unstr(tbl) -STRFILE *tbl; +void +order_unstr(STRFILE *tbl) { uint32_t i; char *sp; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 08:43:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E95EB1065670; Tue, 29 Dec 2009 08:43:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D933A8FC18; Tue, 29 Dec 2009 08:43:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT8hWi5016778; Tue, 29 Dec 2009 08:43:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT8hW0B016776; Tue, 29 Dec 2009 08:43:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912290843.nBT8hW0B016776@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 08:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201176 - head/games/number X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 08:43:33 -0000 Author: ed Date: Tue Dec 29 08:43:32 2009 New Revision: 201176 URL: http://svn.freebsd.org/changeset/base/201176 Log: Use ANSI C function declarations. Modified: head/games/number/number.c Modified: head/games/number/number.c ============================================================================== --- head/games/number/number.c Tue Dec 29 08:42:58 2009 (r201175) +++ head/games/number/number.c Tue Dec 29 08:43:32 2009 (r201176) @@ -125,8 +125,7 @@ main(int argc, char *argv[]) } void -convert(line) - char *line; +convert(char *line) { int flen, len, rval; char *p, *fraction; @@ -194,9 +193,7 @@ badnum: errx(1, "illegal number: %s", } int -unit(len, p) - int len; - char *p; +unit(int len, char *p) { int off, rval; @@ -230,9 +227,7 @@ unit(len, p) } int -number(p, len) - char *p; - int len; +number(char *p, int len) { int val, rval; @@ -270,8 +265,7 @@ number(p, len) } void -pfract(len) - int len; +pfract(int len) { static char const * const pref[] = { "", "ten-", "hundred-" }; @@ -289,7 +283,7 @@ pfract(len) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: number [-l] [# ...]\n"); exit(1); From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 08:45:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CA4C106568F; Tue, 29 Dec 2009 08:45:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 435528FC15; Tue, 29 Dec 2009 08:45:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT8j8BH016859; Tue, 29 Dec 2009 08:45:08 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT8j8Xp016857; Tue, 29 Dec 2009 08:45:08 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912290845.nBT8j8Xp016857@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 08:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201177 - head/bin/kenv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 08:45:08 -0000 Author: ed Date: Tue Dec 29 08:45:07 2009 New Revision: 201177 URL: http://svn.freebsd.org/changeset/base/201177 Log: Add missing `void' for function without arguments. Modified: head/bin/kenv/kenv.c Modified: head/bin/kenv/kenv.c ============================================================================== --- head/bin/kenv/kenv.c Tue Dec 29 08:43:32 2009 (r201176) +++ head/bin/kenv/kenv.c Tue Dec 29 08:45:07 2009 (r201177) @@ -118,7 +118,7 @@ main(int argc, char **argv) } static int -kdumpenv() +kdumpenv(void) { char *buf, *cp; int buflen, envlen; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 08:45:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDCEB106578E; Tue, 29 Dec 2009 08:45:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD7B78FC1F; Tue, 29 Dec 2009 08:45:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT8jRQe016906; Tue, 29 Dec 2009 08:45:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT8jRBX016904; Tue, 29 Dec 2009 08:45:27 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912290845.nBT8jRBX016904@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 29 Dec 2009 08:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201178 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 08:45:27 -0000 Author: trasz Date: Tue Dec 29 08:45:27 2009 New Revision: 201178 URL: http://svn.freebsd.org/changeset/base/201178 Log: SLIP is gone; remove its mutex from witness. Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Dec 29 08:45:07 2009 (r201177) +++ head/sys/kern/subr_witness.c Tue Dec 29 08:45:27 2009 (r201178) @@ -552,12 +552,6 @@ static struct witness_order_list_entry o { "so_snd", &lock_class_mtx_sleep }, { NULL, NULL }, /* - * SLIP - */ - { "slip_mtx", &lock_class_mtx_sleep }, - { "slip sc_mtx", &lock_class_mtx_sleep }, - { NULL, NULL }, - /* * netatalk */ { "ddp_list_mtx", &lock_class_mtx_sleep }, From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 08:45:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21C411065672; Tue, 29 Dec 2009 08:45:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECB5E8FC12; Tue, 29 Dec 2009 08:45:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT8joFE016949; Tue, 29 Dec 2009 08:45:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT8joGs016947; Tue, 29 Dec 2009 08:45:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912290845.nBT8joGs016947@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 08:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201179 - head/bin/pax X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 08:45:51 -0000 Author: ed Date: Tue Dec 29 08:45:50 2009 New Revision: 201179 URL: http://svn.freebsd.org/changeset/base/201179 Log: Add missing `void' for function without arguments. Modified: head/bin/pax/ftree.c Modified: head/bin/pax/ftree.c ============================================================================== --- head/bin/pax/ftree.c Tue Dec 29 08:45:27 2009 (r201178) +++ head/bin/pax/ftree.c Tue Dec 29 08:45:50 2009 (r201179) @@ -219,7 +219,7 @@ ftree_sel(ARCHD *arcn) */ void -ftree_notsel() +ftree_notsel(void) { if (ftent != NULL) (void)fts_set(ftsp, ftent, FTS_SKIP); From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 08:49:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E733E1065676; Tue, 29 Dec 2009 08:49:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6E1B8FC15; Tue, 29 Dec 2009 08:49:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT8nhu7017067; Tue, 29 Dec 2009 08:49:43 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT8nh7c017065; Tue, 29 Dec 2009 08:49:43 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912290849.nBT8nh7c017065@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 08:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201180 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 08:49:44 -0000 Author: ed Date: Tue Dec 29 08:49:43 2009 New Revision: 201180 URL: http://svn.freebsd.org/changeset/base/201180 Log: Add missing `void' for functions without arguments. While there, rename die_you_gravy_sucking_pig_dog() to something that's less moronic. Modified: head/sbin/shutdown/shutdown.c Modified: head/sbin/shutdown/shutdown.c ============================================================================== --- head/sbin/shutdown/shutdown.c Tue Dec 29 08:45:50 2009 (r201179) +++ head/sbin/shutdown/shutdown.c Tue Dec 29 08:49:43 2009 (r201180) @@ -93,7 +93,7 @@ static char mbuf[BUFSIZ]; static const char *nosync, *whom; static void badtime(void); -static void die_you_gravy_sucking_pig_dog(void); +static void perform_shutdown(void); static void finish(int); static void getoffset(char *); static void loop(void); @@ -258,7 +258,7 @@ loop(void) if (!tp->timeleft) break; } - die_you_gravy_sucking_pig_dog(); + perform_shutdown(); } static jmp_buf alarmbuf; @@ -325,7 +325,7 @@ timeout(int signo __unused) } static void -die_you_gravy_sucking_pig_dog() +perform_shutdown(void) { char *empty_environ[] = { NULL }; @@ -499,7 +499,7 @@ finish(int signo __unused) } static void -badtime() +badtime(void) { errx(1, "bad time format"); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 08:54:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7661D106568B; Tue, 29 Dec 2009 08:54:03 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D33D8FC26; Tue, 29 Dec 2009 08:54:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT8s3ER017199; Tue, 29 Dec 2009 08:54:03 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT8s3fv017197; Tue, 29 Dec 2009 08:54:03 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912290854.nBT8s3fv017197@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 08:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201181 - head/usr.bin/wc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 08:54:03 -0000 Author: ed Date: Tue Dec 29 08:54:03 2009 New Revision: 201181 URL: http://svn.freebsd.org/changeset/base/201181 Log: Add missing `void' keyword for function without arguments. Modified: head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Tue Dec 29 08:49:43 2009 (r201180) +++ head/usr.bin/wc/wc.c Tue Dec 29 08:54:03 2009 (r201181) @@ -287,7 +287,7 @@ word: gotsp = 1; } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: wc [-Lclmw] [file ...]\n"); exit(1); From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 09:13:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8F03106566C; Tue, 29 Dec 2009 09:13:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF87C8FC16; Tue, 29 Dec 2009 09:13:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT9DKgB017729; Tue, 29 Dec 2009 09:13:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBT9DKOX017727; Tue, 29 Dec 2009 09:13:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912290913.nBT9DKOX017727@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 09:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201182 - head/sbin/reboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 09:13:21 -0000 Author: ed Date: Tue Dec 29 09:13:20 2009 New Revision: 201182 URL: http://svn.freebsd.org/changeset/base/201182 Log: Add forgotten `void' keyword. This function has no arguments. Modified: head/sbin/reboot/reboot.c Modified: head/sbin/reboot/reboot.c ============================================================================== --- head/sbin/reboot/reboot.c Tue Dec 29 08:54:03 2009 (r201181) +++ head/sbin/reboot/reboot.c Tue Dec 29 09:13:20 2009 (r201182) @@ -231,7 +231,7 @@ usage(void) } static u_int -get_pageins() +get_pageins(void) { u_int pageins; size_t len; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 10:13:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06653106568B; Tue, 29 Dec 2009 10:13:46 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D10418FC15; Tue, 29 Dec 2009 10:13:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTADjXP019478; Tue, 29 Dec 2009 10:13:45 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTADjaa019476; Tue, 29 Dec 2009 10:13:45 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200912291013.nBTADjaa019476@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 29 Dec 2009 10:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201189 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 10:13:46 -0000 Author: edwin Date: Tue Dec 29 10:13:45 2009 New Revision: 201189 URL: http://svn.freebsd.org/changeset/base/201189 Log: MFV of tzdata2009u, r201187 Bangladesh will change its clock back to Standard Time on Dec 31, 2009. MFC after: now Modified: head/share/zoneinfo/asia Directory Properties: head/share/zoneinfo/ (props changed) Modified: head/share/zoneinfo/asia ============================================================================== --- head/share/zoneinfo/asia Tue Dec 29 10:12:23 2009 (r201188) +++ head/share/zoneinfo/asia Tue Dec 29 10:13:45 2009 (r201189) @@ -1,4 +1,4 @@ -# @(#)asia 8.48 +# @(#)asia 8.50 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -196,6 +196,41 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # # http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html # +# From Alexander Krivenyshev (2009-12-24): +# According to Bangladesh newspaper "The Daily Star," +# Bangladesh will change its clock back to Standard Time on Dec 31, 2009. +# +# Clock goes back 1-hr on Dec 31 night. +# +# http://www.thedailystar.net/newDesign/news-details.php?nid=119228 +# +# and +# +# http://www.worldtimezone.com/dst_news/dst_news_bangladesh05.html +# +# +# "...The government yesterday decided to put the clock back by one hour +# on December 31 midnight and the new time will continue until March 31, +# 2010 midnight. The decision came at a cabinet meeting at the Prime +# Minister's Office last night..." + +# From Danvin Ruangchan (2009-12-24): +# ...the news mentions DST will be turned off again 7 months after March +# 31st on Oct 31, 2010. + +# From Arthur David Olson (2009-12-26): +# Indeed, "The government will advance again the Banglasdesh Standard +# Time by one one hour on March 31 next year by enforcing the Daylight +# Saving Time (DST) for seven months. It will continue till October 31 +# until further notice." I take that last sentence as the +# establishment of a rule. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Dhaka 2009 only - Jun 29 23:00 1 S +Rule Dhaka 2010 only - Jan 1 0:00 - - +Rule Dhaka 2010 max - Mar 31 23:00 1 S +Rule Dhaka 2010 max - Nov 1 0:00 - - + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 5:53:20 - HMT 1941 Oct # Howrah Mean Time? @@ -203,8 +238,8 @@ Zone Asia/Dhaka 6:01:40 - LMT 1890 5:30 - IST 1942 Sep 6:30 - BURT 1951 Sep 30 6:00 - DACT 1971 Mar 26 # Dacca Time - 6:00 - BDT 2009 Jun 19 23:00 # Bangladesh Time - 6:00 1:00 BDST + 6:00 - BDT 2009 + 6:00 Dhaka BD%sT # Bhutan # Zone NAME GMTOFF RULES FORMAT [UNTIL] From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 10:28:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18CDE106568D; Tue, 29 Dec 2009 10:28:21 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 082508FC0A; Tue, 29 Dec 2009 10:28:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTASKFu019919; Tue, 29 Dec 2009 10:28:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTASKLq019915; Tue, 29 Dec 2009 10:28:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912291028.nBTASKLq019915@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 10:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201192 - head/libexec/rpc.rusersd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 10:28:21 -0000 Author: ed Date: Tue Dec 29 10:28:20 2009 New Revision: 201192 URL: http://svn.freebsd.org/changeset/base/201192 Log: Make rpc.ruserd work with utmpx/libulog. Because strings are now null-terminated, I've decided to just use an array of utmpx structures, instead of the separated strings. This means we just copy the entire utmpx structure and point to the strings within the structures directly. Modified: head/libexec/rpc.rusersd/Makefile head/libexec/rpc.rusersd/rusers_proc.c head/libexec/rpc.rusersd/rusersd.c Modified: head/libexec/rpc.rusersd/Makefile ============================================================================== --- head/libexec/rpc.rusersd/Makefile Tue Dec 29 10:15:13 2009 (r201191) +++ head/libexec/rpc.rusersd/Makefile Tue Dec 29 10:28:20 2009 (r201192) @@ -6,8 +6,8 @@ MAN = rpc.rusersd.8 WARNS?= 6 -DPADD= ${LIBRPCSVC} ${LIBUTIL} -LDADD= -lrpcsvc -lutil +DPADD= ${LIBRPCSVC} ${LIBULOG} ${LIBUTIL} +LDADD= -lrpcsvc -lulog -lutil #.if exists(/usr/X11R6/include/X11/extensions/xidle.h) #CFLAGS+= -DXIDLE Modified: head/libexec/rpc.rusersd/rusers_proc.c ============================================================================== --- head/libexec/rpc.rusersd/rusers_proc.c Tue Dec 29 10:15:13 2009 (r201191) +++ head/libexec/rpc.rusersd/rusers_proc.c Tue Dec 29 10:28:20 2009 (r201192) @@ -45,56 +45,27 @@ static const char rcsid[] = #include #include #include -#include +#define _ULOG_POSIX_NAMES +#include #ifdef XIDLE #include #include #include #endif -#define utmp rutmp #include -#undef utmp - -#define IGNOREUSER "sleeper" - -#ifdef OSF -#define _PATH_UTMP UTMP_FILE -#endif - -#ifndef _PATH_UTMP -#define _PATH_UTMP "/etc/utmp" -#endif #ifndef _PATH_DEV #define _PATH_DEV "/dev" #endif -#ifndef UT_LINESIZE -#define UT_LINESIZE sizeof(((struct utmp *)0)->ut_line) -#endif -#ifndef UT_NAMESIZE -#define UT_NAMESIZE sizeof(((struct utmp *)0)->ut_name) -#endif -#ifndef UT_HOSTSIZE -#define UT_HOSTSIZE sizeof(((struct utmp *)0)->ut_host) -#endif - -typedef char ut_line_t[UT_LINESIZE+1]; -typedef char ut_name_t[UT_NAMESIZE+1]; -typedef char ut_host_t[UT_HOSTSIZE+1]; - static utmpidle utmp_idle[MAXUSERS]; -static rutmp old_utmp[MAXUSERS]; -static ut_line_t line[MAXUSERS]; -static ut_name_t name[MAXUSERS]; -static ut_host_t host[MAXUSERS]; +static utmp old_utmp[MAXUSERS]; +static struct utmpx utmp_list[MAXUSERS]; extern int from_inetd; void rusers_service(struct svc_req *, SVCXPRT *); -static FILE *ufp; - #ifdef XIDLE static Display *dpy; @@ -190,48 +161,33 @@ static utmpidlearr * do_names_2(void) { static utmpidlearr ut; - struct utmp usr; + struct utmpx *usr; int nusers = 0; - bzero((char *)&ut, sizeof(ut)); + memset(&ut, 0, sizeof(ut)); ut.utmpidlearr_val = &utmp_idle[0]; - ufp = fopen(_PATH_UTMP, "r"); - if (!ufp) { - syslog(LOG_ERR, "%m"); - return(&ut); - } + setutxent(); + while ((usr = getutxent()) != NULL && nusers < MAXUSERS) { + if (usr->ut_type != USER_PROCESS) + continue; + + memcpy(&utmp_list[nusers], usr, sizeof(*usr)); + utmp_idle[nusers].ui_utmp.ut_time = usr->ut_tv.tv_sec; + utmp_idle[nusers].ui_idle = + getidle(usr->ut_line, usr->ut_host); + utmp_idle[nusers].ui_utmp.ut_line = + utmp_list[nusers].ut_line; + utmp_idle[nusers].ui_utmp.ut_name = + utmp_list[nusers].ut_user; + utmp_idle[nusers].ui_utmp.ut_host = + utmp_list[nusers].ut_host; - /* only entries with both name and line fields */ - while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1 && - nusers < MAXUSERS) - if (*usr.ut_name && *usr.ut_line && - strncmp(usr.ut_name, IGNOREUSER, - sizeof(usr.ut_name)) -#ifdef OSF - && usr.ut_type == USER_PROCESS -#endif - ) { - utmp_idle[nusers].ui_utmp.ut_time = - usr.ut_time; - utmp_idle[nusers].ui_idle = - getidle(usr.ut_line, usr.ut_host); - utmp_idle[nusers].ui_utmp.ut_line = line[nusers]; - strncpy(line[nusers], usr.ut_line, UT_LINESIZE); - utmp_idle[nusers].ui_utmp.ut_name = name[nusers]; - strncpy(name[nusers], usr.ut_name, UT_NAMESIZE); - utmp_idle[nusers].ui_utmp.ut_host = host[nusers]; - strncpy(host[nusers], usr.ut_host, UT_HOSTSIZE); - - /* Make sure entries are NUL terminated */ - line[nusers][UT_LINESIZE] = - name[nusers][UT_NAMESIZE] = - host[nusers][UT_HOSTSIZE] = '\0'; - nusers++; - } + nusers++; + } + endutxent(); ut.utmpidlearr_len = nusers; - fclose(ufp); return(&ut); } @@ -239,27 +195,16 @@ static int * rusers_num(void *argp __unused, struct svc_req *rqstp __unused) { static int num_users = 0; - struct utmp usr; - - ufp = fopen(_PATH_UTMP, "r"); - if (!ufp) { - syslog(LOG_ERR, "%m"); - return(NULL); + struct utmpx *usr; + + setutxent(); + while ((usr = getutxent()) != NULL) { + if (usr->ut_type != USER_PROCESS) + continue; + num_users++; } - - /* only entries with both name and line fields */ - while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) - if (*usr.ut_name && *usr.ut_line && - strncmp(usr.ut_name, IGNOREUSER, - sizeof(usr.ut_name)) -#ifdef OSF - && usr.ut_type == USER_PROCESS -#endif - ) { - num_users++; - } - - fclose(ufp); + endutxent(); + return(&num_users); } Modified: head/libexec/rpc.rusersd/rusersd.c ============================================================================== --- head/libexec/rpc.rusersd/rusersd.c Tue Dec 29 10:15:13 2009 (r201191) +++ head/libexec/rpc.rusersd/rusersd.c Tue Dec 29 10:28:20 2009 (r201192) @@ -41,9 +41,7 @@ static const char rcsid[] = #include #include #include -#define utmp rutmp #include -#undef utmp extern void rusers_service(struct svc_req *, SVCXPRT *); From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 11:27:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2BD41065679; Tue, 29 Dec 2009 11:27:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85F488FC18; Tue, 29 Dec 2009 11:27:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTBRpcr022775; Tue, 29 Dec 2009 11:27:51 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTBRpNp022774; Tue, 29 Dec 2009 11:27:51 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200912291127.nBTBRpNp022774@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 29 Dec 2009 11:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201193 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 11:27:51 -0000 Author: ume Date: Tue Dec 29 11:27:51 2009 New Revision: 201193 URL: http://svn.freebsd.org/changeset/base/201193 Log: Add missing me6 rules. Now, the IPv6 rules become equivalent to the IPv4 rules. Reported by: David Horn Modified: head/etc/rc.firewall Modified: head/etc/rc.firewall ============================================================================== --- head/etc/rc.firewall Tue Dec 29 10:28:20 2009 (r201192) +++ head/etc/rc.firewall Tue Dec 29 11:27:51 2009 (r201193) @@ -230,18 +230,30 @@ case ${firewall_type} in # Allow setup of incoming email ${fwcmd} add pass tcp from any to me 25 setup + if [ -n "$net6" ]; then + ${fwcmd} add pass tcp from any to me6 25 setup + fi # Allow setup of outgoing TCP connections only ${fwcmd} add pass tcp from me to any setup + if [ -n "$net6" ]; then + ${fwcmd} add pass tcp from me6 to any setup + fi # Disallow setup of all other TCP connections ${fwcmd} add deny tcp from any to any setup # Allow DNS queries out in the world ${fwcmd} add pass udp from me to any 53 keep-state + if [ -n "$net6" ]; then + ${fwcmd} add pass udp from me6 to any 53 keep-state + fi # Allow NTP queries out in the world ${fwcmd} add pass udp from me to any 123 keep-state + if [ -n "$net6" ]; then + ${fwcmd} add pass udp from me6 to any 123 keep-state + fi # Everything else is denied by default, unless the # IPFIREWALL_DEFAULT_TO_ACCEPT option is set in your kernel @@ -388,14 +400,25 @@ case ${firewall_type} in # Allow setup of incoming email ${fwcmd} add pass tcp from any to me 25 setup + if [ -n "$inet6" ]; then + ${fwcmd} add pass tcp from any to me6 25 setup + fi # Allow access to our DNS ${fwcmd} add pass tcp from any to me 53 setup ${fwcmd} add pass udp from any to me 53 ${fwcmd} add pass udp from me 53 to any + if [ -n "$inet6" ]; then + ${fwcmd} add pass tcp from any to me6 53 setup + ${fwcmd} add pass udp from any to me6 53 + ${fwcmd} add pass udp from me6 53 to any + fi # Allow access to our WWW ${fwcmd} add pass tcp from any to me 80 setup + if [ -n "$inet6" ]; then + ${fwcmd} add pass tcp from any to me6 80 setup + fi # Reject&Log all setup of incoming connections from the outside ${fwcmd} add deny log ip4 from any to any in via ${oif} setup proto tcp @@ -409,9 +432,15 @@ case ${firewall_type} in # Allow DNS queries out in the world ${fwcmd} add pass udp from me to any 53 keep-state + if [ -n "$inet6" ]; then + ${fwcmd} add pass udp from me6 to any 53 keep-state + fi # Allow NTP queries out in the world ${fwcmd} add pass udp from me to any 123 keep-state + if [ -n "$inet6" ]; then + ${fwcmd} add pass udp from me6 to any 123 keep-state + fi # Everything else is denied by default, unless the # IPFIREWALL_DEFAULT_TO_ACCEPT option is set in your kernel From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 12:47:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B13F10656AA; Tue, 29 Dec 2009 12:47:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE268FC20; Tue, 29 Dec 2009 12:47:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTClmSX024551; Tue, 29 Dec 2009 12:47:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTClmFC024548; Tue, 29 Dec 2009 12:47:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912291247.nBTClmFC024548@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 29 Dec 2009 12:47:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201194 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 12:47:48 -0000 Author: kib Date: Tue Dec 29 12:47:47 2009 New Revision: 201194 URL: http://svn.freebsd.org/changeset/base/201194 Log: Use clock_gettime(CLOCK_SECOND) instead of gettimeofday(2) for implementation of time(3). CLOCK_SECOND is much faster. No objections from: phk Submitted by: Valentin Nechayev MFC after: 1 week Modified: head/lib/libc/gen/time.c Modified: head/lib/libc/gen/time.c ============================================================================== --- head/lib/libc/gen/time.c Tue Dec 29 11:27:51 2009 (r201193) +++ head/lib/libc/gen/time.c Tue Dec 29 12:47:47 2009 (r201194) @@ -37,13 +37,12 @@ __FBSDID("$FreeBSD$"); #include time_t -time(t) - time_t *t; +time(time_t *t) { - struct timeval tt; + struct timespec tt; time_t retval; - if (gettimeofday(&tt, (struct timezone *)0) < 0) + if (clock_gettime(CLOCK_SECOND, &tt) < 0) retval = -1; else retval = tt.tv_sec; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 13:35:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 396211065695; Tue, 29 Dec 2009 13:35:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FA488FC14; Tue, 29 Dec 2009 13:35:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTDZJZf025720; Tue, 29 Dec 2009 13:35:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTDZIh3025716; Tue, 29 Dec 2009 13:35:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912291335.nBTDZIh3025716@svn.freebsd.org> From: John Baldwin Date: Tue, 29 Dec 2009 13:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201196 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 13:35:19 -0000 Author: jhb Date: Tue Dec 29 13:35:18 2009 New Revision: 201196 URL: http://svn.freebsd.org/changeset/base/201196 Log: Change vlan interfaces to cope more usefully with the parent interface being renamed. Previously the vlan interfaces would lose their configuration as if the parent interface had been physically removed. Now vlan interfaces ignore rename events. - Add a new ifnet flag (IFF_RENAMING) that is set while an ifnet is being renamed. This flag can be checked in ifnet departure/arrival event handlers to treat rename events differently. - Change the ifnet departure event handler in the if_vlan(4) driver to ignore departure events due to a trunk interface being renamed. Reviewed by: brooks, rwatson MFC after: 1 week Modified: head/sys/net/if.c head/sys/net/if.h head/sys/net/if_vlan.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Dec 29 13:14:13 2009 (r201195) +++ head/sys/net/if.c Tue Dec 29 13:35:18 2009 (r201196) @@ -2095,6 +2095,14 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (EINVAL); if (ifunit(new_name) != NULL) return (EEXIST); + + /* + * XXX: Locking. Nothing else seems to lock if_flags, + * and there are numerous other races with the + * ifunit() checks not being atomic with namespace + * changes (renames, vmoves, if_attach, etc). + */ + ifp->if_flags |= IFF_RENAMING; /* Announce the departure of the interface. */ rt_ifannouncemsg(ifp, IFAN_DEPARTURE); @@ -2129,6 +2137,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp); /* Announce the return of the interface. */ rt_ifannouncemsg(ifp, IFAN_ARRIVAL); + + ifp->if_flags &= ~IFF_RENAMING; break; #ifdef VIMAGE Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Tue Dec 29 13:14:13 2009 (r201195) +++ head/sys/net/if.h Tue Dec 29 13:35:18 2009 (r201196) @@ -150,6 +150,7 @@ struct if_data { #define IFF_MONITOR 0x40000 /* (n) user-requested monitor mode */ #define IFF_STATICARP 0x80000 /* (n) static ARP */ #define IFF_DYING 0x200000 /* (n) interface is winding down */ +#define IFF_RENAMING 0x400000 /* (n) interface is being renamed */ /* * Old names for driver flags so that user space tools can continue to use Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Dec 29 13:14:13 2009 (r201195) +++ head/sys/net/if_vlan.c Tue Dec 29 13:35:18 2009 (r201196) @@ -466,7 +466,8 @@ vlan_setmulti(struct ifnet *ifp) * A handler for network interface departure events. * Track departure of trunks here so that we don't access invalid * pointers or whatever if a trunk is ripped from under us, e.g., - * by ejecting its hot-plug card. + * by ejecting its hot-plug card. However, if an ifnet is simply + * being renamed, then there's no need to tear down the state. */ static void vlan_ifdetach(void *arg __unused, struct ifnet *ifp) @@ -481,6 +482,10 @@ vlan_ifdetach(void *arg __unused, struct if (ifp->if_vlantrunk == NULL) return; + /* If the ifnet is just being renamed, don't do anything. */ + if (ifp->if_flags & IFF_RENAMING) + return; + VLAN_LOCK(); /* * OK, it's a trunk. Loop over and detach all vlan's on it. From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 14:00:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D57E106568B; Tue, 29 Dec 2009 14:00:17 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D7F78FC0A; Tue, 29 Dec 2009 14:00:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTE0HdE026304; Tue, 29 Dec 2009 14:00:17 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTE0Hl1026302; Tue, 29 Dec 2009 14:00:17 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <200912291400.nBTE0Hl1026302@svn.freebsd.org> From: Philip Paeps Date: Tue, 29 Dec 2009 14:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201198 - head/sys/dev/mge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 14:00:17 -0000 Author: philip Date: Tue Dec 29 14:00:17 2009 New Revision: 201198 URL: http://svn.freebsd.org/changeset/base/201198 Log: Fix autonegotiation: tell the MAC where to find the PHY. Fix crashes in the detach path. Submitted by: Kristof Provost MFC after: 1 month Modified: head/sys/dev/mge/if_mge.c Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Tue Dec 29 13:55:15 2009 (r201197) +++ head/sys/dev/mge/if_mge.c Tue Dec 29 14:00:17 2009 (r201198) @@ -611,6 +611,7 @@ static int mge_attach(device_t dev) { struct mge_softc *sc; + struct mii_softc *miisc; struct ifnet *ifp; uint8_t hwaddr[ETHER_ADDR_LEN]; int i, error ; @@ -689,13 +690,15 @@ mge_attach(device_t dev) error = mii_phy_probe(dev, &sc->miibus, mge_ifmedia_upd, mge_ifmedia_sts); if (error) { device_printf(dev, "MII failed to find PHY\n"); - if_free(ifp); - sc->ifp = NULL; mge_detach(dev); return (error); } sc->mii = device_get_softc(sc->miibus); + /* Tell the MAC where to find the PHY so autoneg works */ + miisc = LIST_FIRST(&sc->mii->mii_phys); + MGE_WRITE(sc, MGE_REG_PHYDEV, miisc->mii_phy); + /* Attach interrupt handlers */ for (i = 0; i < 2; ++i) { error = bus_setup_intr(dev, sc->res[1 + i], @@ -704,7 +707,7 @@ mge_attach(device_t dev) if (error) { device_printf(dev, "could not setup %s\n", mge_intrs[i].description); - ether_ifdetach(sc->ifp); + mge_detach(dev); return (error); } } @@ -729,6 +732,9 @@ mge_detach(device_t dev) /* Stop and release all interrupts */ for (i = 0; i < 2; ++i) { + if (!sc->ih_cookie[i]) + continue; + error = bus_teardown_intr(dev, sc->res[1 + i], sc->ih_cookie[i]); if (error) device_printf(dev, "could not release %s\n", From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 14:03:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB4881065670; Tue, 29 Dec 2009 14:03:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9F2C8FC15; Tue, 29 Dec 2009 14:03:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTE3cuN026423; Tue, 29 Dec 2009 14:03:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTE3c7c026420; Tue, 29 Dec 2009 14:03:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912291403.nBTE3c7c026420@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Dec 2009 14:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201199 - head/sys/sparc64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 14:03:39 -0000 Author: marius Date: Tue Dec 29 14:03:38 2009 New Revision: 201199 URL: http://svn.freebsd.org/changeset/base/201199 Log: - Prefer i and j over i and n for temporary integer variables. - Wrap/shorten too long lines. - Remove a redundant variable and an unnecessary cast in schizo(4). Modified: head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/schizo.c Modified: head/sys/sparc64/pci/psycho.c ============================================================================== --- head/sys/sparc64/pci/psycho.c Tue Dec 29 14:00:17 2009 (r201198) +++ head/sys/sparc64/pci/psycho.c Tue Dec 29 14:03:38 2009 (r201199) @@ -183,9 +183,9 @@ struct psycho_dma_sync { void *pds_arg; /* argument for the handler */ void *pds_cookie; /* parent bus int. cookie */ device_t pds_ppb; /* farest PCI-PCI bridge */ - uint8_t pds_bus; /* bus of farest PCI device */ - uint8_t pds_slot; /* slot of farest PCI device */ - uint8_t pds_func; /* func. of farest PCI device */ + uint8_t pds_bus; /* bus of farest PCI dev. */ + uint8_t pds_slot; /* slot of farest PCI dev. */ + uint8_t pds_func; /* func. of farest PCI dev. */ }; #define PSYCHO_READ8(sc, off) \ @@ -207,8 +207,8 @@ struct psycho_dma_sync { * "Hummingbird" is the UltraSPARC IIe onboard UPA to PCI bridge. It's * basically the same as Sabre but without an APB underneath it. * - * "Psycho" and "Psycho+" are dual UPA to PCI bridges. They sit on the UPA bus - * and manage two PCI buses. "Psycho" has two 64-bit 33MHz buses, while + * "Psycho" and "Psycho+" are dual UPA to PCI bridges. They sit on the UPA + * bus and manage two PCI buses. "Psycho" has two 64-bit 33MHz buses, while * "Psycho+" controls both a 64-bit 33Mhz and a 64-bit 66Mhz PCI bus. You * will usually find a "Psycho+" since I don't think the original "Psycho" * ever shipped, and if it did it would be in the U30. @@ -265,7 +265,8 @@ psycho_get_desc(device_t dev) rv = psycho_find_desc(psycho_models, ofw_bus_get_model(dev)); if (rv == NULL) - rv = psycho_find_desc(psycho_compats, ofw_bus_get_compat(dev)); + rv = psycho_find_desc(psycho_compats, + ofw_bus_get_compat(dev)); return (rv); } @@ -297,7 +298,7 @@ psycho_attach(device_t dev) uint32_t dvmabase, prop, prop_array[2]; int32_t rev; u_int rerun, ver; - int i, n; + int i, j; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); @@ -463,12 +464,12 @@ psycho_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, PSYCHO_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - n = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (n != PSYCHO_NRANGE) + if (i != PSYCHO_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -476,11 +477,12 @@ psycho_attach(device_t dev) * The physical start addresses of the ranges are the configuration, * memory and I/O handles. */ - for (n = 0; n < PSYCHO_NRANGE; n++) { - i = OFW_PCI_RANGE_CS(&range[n]); - if (sc->sc_pci_bh[i] != 0) - panic("%s: duplicate range for space %d", __func__, i); - sc->sc_pci_bh[i] = OFW_PCI_RANGE_PHYS(&range[n]); + for (i = 0; i < PSYCHO_NRANGE; i++) { + j = OFW_PCI_RANGE_CS(&range[i]); + if (sc->sc_pci_bh[j] != 0) + panic("%s: duplicate range for space %d", + __func__, j); + sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -498,8 +500,8 @@ psycho_attach(device_t dev) * vectors. We do this early in order to be able to catch * stray interrupts. */ - for (n = 0; n <= PSYCHO_MAX_INO; n++) { - if (psycho_find_intrmap(sc, n, &intrmap, &intrclr, + for (i = 0; i <= PSYCHO_MAX_INO; i++) { + if (psycho_find_intrmap(sc, i, &intrmap, &intrclr, NULL) == 0) continue; pica = malloc(sizeof(*pica), M_DEVBUF, M_NOWAIT); @@ -517,21 +519,21 @@ psycho_attach(device_t dev) */ device_printf(dev, "intr map (INO %d, %s) %#lx: %#lx, clr: %#lx\n", - n, intrmap <= PSR_PCIB3_INT_MAP ? "PCI" : "OBIO", - (u_long)intrmap, (u_long)PSYCHO_READ8(sc, intrmap), - (u_long)intrclr); - PSYCHO_WRITE8(sc, intrmap, INTMAP_VEC(sc->sc_ign, n)); + i, intrmap <= PSR_PCIB3_INT_MAP ? "PCI" : "OBIO", + (u_long)intrmap, (u_long)PSYCHO_READ8(sc, + intrmap), (u_long)intrclr); + PSYCHO_WRITE8(sc, intrmap, INTMAP_VEC(sc->sc_ign, i)); PSYCHO_WRITE8(sc, intrclr, 0); PSYCHO_WRITE8(sc, intrmap, - INTMAP_ENABLE(INTMAP_VEC(sc->sc_ign, n), + INTMAP_ENABLE(INTMAP_VEC(sc->sc_ign, i), PCPU_GET(mid))); #endif - i = intr_controller_register(INTMAP_VEC(sc->sc_ign, n), - &psycho_ic, pica); - if (i != 0) + j = intr_controller_register(INTMAP_VEC(sc->sc_ign, + i), &psycho_ic, pica); + if (j != 0) device_printf(dev, "could not register " "interrupt controller for INO %d (%d)\n", - n, i); + i, j); } if (sc->sc_mode == PSYCHO_MODE_PSYCHO) @@ -585,12 +587,12 @@ psycho_attach(device_t dev) sc->sc_pci_dmat->dt_cookie = sc->sc_is; sc->sc_pci_dmat->dt_mt = &iommu_dma_methods; - n = OF_getprop(node, "bus-range", (void *)prop_array, + i = OF_getprop(node, "bus-range", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get bus-range", __func__); - if (n != sizeof(prop_array)) - panic("%s: broken bus-range (%d)", __func__, n); + if (i != sizeof(prop_array)) + panic("%s: broken bus-range (%d)", __func__, i); if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", prop_array[0], prop_array[1], prop_array[0]); @@ -659,15 +661,15 @@ psycho_attach(device_t dev) PCIB_WRITE_CONFIG(dev, sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, PCIR_LATTIMER, OFW_PCI_LATENCY, 1); - for (n = PCIR_VENDOR; n < PCIR_STATUS; n += sizeof(uint16_t)) - le16enc(&sc->sc_pci_hpbcfg[n], bus_space_read_2( + for (i = PCIR_VENDOR; i < PCIR_STATUS; i += sizeof(uint16_t)) + le16enc(&sc->sc_pci_hpbcfg[i], bus_space_read_2( sc->sc_pci_cfgt, sc->sc_pci_bh[OFW_PCI_CS_CONFIG], PSYCHO_CONF_OFF(sc->sc_pci_secbus, PCS_DEVICE, - PCS_FUNC, n))); - for (n = PCIR_REVID; n <= PCIR_BIST; n += sizeof(uint8_t)) - sc->sc_pci_hpbcfg[n] = bus_space_read_1(sc->sc_pci_cfgt, + PCS_FUNC, i))); + for (i = PCIR_REVID; i <= PCIR_BIST; i += sizeof(uint8_t)) + sc->sc_pci_hpbcfg[i] = bus_space_read_1(sc->sc_pci_cfgt, sc->sc_pci_bh[OFW_PCI_CS_CONFIG], PSYCHO_CONF_OFF( - sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, n)); + sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, i)); ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(ofw_pci_intr_t)); /* @@ -696,8 +698,8 @@ psycho_set_intr(struct psycho_softc *sc, int rid; rid = index; - sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, - &rid, RF_ACTIVE); + sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_irq_res[index] == NULL && intrmap >= PSR_POWER_INT_MAP) { /* * These interrupts aren't mandatory and not available @@ -706,7 +708,8 @@ psycho_set_intr(struct psycho_softc *sc, return; } if (sc->sc_irq_res[index] == NULL || - INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != sc->sc_ign || + INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != + sc->sc_ign || INTVEC(PSYCHO_READ8(sc, intrmap)) != vec || intr_vectors[vec].iv_ic != &psycho_ic || bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], @@ -716,8 +719,8 @@ psycho_set_intr(struct psycho_softc *sc, } static int -psycho_find_intrmap(struct psycho_softc *sc, u_int ino, bus_addr_t *intrmapptr, - bus_addr_t *intrclrptr, bus_addr_t *intrdiagptr) +psycho_find_intrmap(struct psycho_softc *sc, u_int ino, + bus_addr_t *intrmapptr, bus_addr_t *intrclrptr, bus_addr_t *intrdiagptr) { bus_addr_t intrclr, intrmap; uint64_t diag; @@ -877,7 +880,7 @@ psycho_wakeup(void *arg) { struct psycho_softc *sc = arg; - /* Gee, we don't really have a framework to deal with this properly. */ + /* We don't really have a framework to deal with this properly. */ device_printf(sc->sc_dev, "power management wakeup\n"); return (FILTER_HANDLED); } @@ -994,8 +997,8 @@ psycho_read_config(device_t dev, u_int b } static void -psycho_write_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, - uint32_t val, int width) +psycho_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t val, int width) { struct psycho_softc *sc; bus_space_handle_t bh; @@ -1031,8 +1034,9 @@ psycho_route_interrupt(device_t bridge, sc = device_get_softc(bridge); pintr = pin; - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, + ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + maskbuf)) return (mintr); /* * If this is outside of the range for an intpin, it's likely a full @@ -1054,7 +1058,8 @@ psycho_route_interrupt(device_t bridge, intrmap = PSR_PCIA0_INT_MAP + 8 * (pci_get_slot(dev) - 1 + 3 * sc->sc_half); mintr = INTINO(PSYCHO_READ8(sc, intrmap)) + pin - 1; - device_printf(bridge, "guessing interrupt %d for device %d.%d pin %d\n", + device_printf(bridge, + "guessing interrupt %d for device %d.%d pin %d\n", (int)mintr, pci_get_slot(dev), pci_get_function(dev), pin); return (mintr); } @@ -1285,8 +1290,8 @@ psycho_alloc_resource(device_t bus, devi if (start != end) panic("%s: XXX: interrupt range", __func__); start = end = INTMAP_VEC(sc->sc_ign, end); - return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, - rid, start, end, count, flags)); + return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, + type, rid, start, end, count, flags)); } switch (type) { case SYS_RES_MEMORY: @@ -1401,7 +1406,8 @@ psycho_alloc_bus_tag(struct psycho_softc { bus_space_tag_t bt; - bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, + M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Tue Dec 29 14:00:17 2009 (r201198) +++ head/sys/sparc64/pci/schizo.c Tue Dec 29 14:03:38 2009 (r201199) @@ -182,9 +182,9 @@ struct schizo_dma_sync { void *sds_cookie; uint64_t sds_syncval; device_t sds_ppb; /* farest PCI-PCI bridge */ - uint8_t sds_bus; /* bus of farest PCI device */ - uint8_t sds_slot; /* slot of farest PCI device */ - uint8_t sds_func; /* func. of farest PCI device */ + uint8_t sds_bus; /* bus of farest PCI dev. */ + uint8_t sds_slot; /* slot of farest PCI dev. */ + uint8_t sds_func; /* func. of farest PCI dev. */ }; #define SCHIZO_PERF_CNT_QLTY 100 @@ -262,7 +262,7 @@ schizo_attach(device_t dev) uint64_t ino_bitmap, reg; phandle_t node; uint32_t prop, prop_array[2]; - int i, mode, n, nrange, rid, tsbsize; + int i, j, mode, rid, tsbsize; sc = device_get_softc(dev); node = ofw_bus_get_node(dev); @@ -291,18 +291,18 @@ schizo_attach(device_t dev) */ sc->sc_half = (bus_get_resource_start(dev, SYS_RES_MEMORY, STX_PCI) >> 20) & 1; - for (n = 0; n < (mode == SCHIZO_MODE_SCZ ? SCZ_NREG : TOM_NREG); - n++) { - rid = n; - sc->sc_mem_res[n] = bus_alloc_resource_any(dev, + for (i = 0; i < (mode == SCHIZO_MODE_SCZ ? SCZ_NREG : TOM_NREG); + i++) { + rid = i; + sc->sc_mem_res[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, (((mode == SCHIZO_MODE_SCZ && ((sc->sc_half == 1 && - n == STX_PCI) || n == STX_CTRL)) || + i == STX_PCI) || i == STX_CTRL)) || (mode == SCHIZO_MODE_TOM && sc->sc_half == 0 && - n == STX_CTRL)) ? RF_SHAREABLE : 0) | RF_ACTIVE); - if (sc->sc_mem_res[n] == NULL) + i == STX_CTRL)) ? RF_SHAREABLE : 0) | RF_ACTIVE); + if (sc->sc_mem_res[i] == NULL) panic("%s: could not allocate register bank %d", - __func__, n); + __func__, i); } /* @@ -335,7 +335,8 @@ schizo_attach(device_t dev) if (OF_getprop(node, "portid", &sc->sc_ign, sizeof(sc->sc_ign)) == -1) panic("%s: could not determine IGN", __func__); - if (OF_getprop(node, "version#", &sc->sc_ver, sizeof(sc->sc_ver)) == -1) + if (OF_getprop(node, "version#", &sc->sc_ver, sizeof(sc->sc_ver)) == + -1) panic("%s: could not determine version", __func__); if (OF_getprop(node, "clock-frequency", &prop, sizeof(prop)) == -1) prop = 33000000; @@ -399,21 +400,21 @@ schizo_attach(device_t dev) * This is complicated by the fact that a pair of Schizo PBMs * shares one IGN. */ - n = OF_getprop(node, "ino-bitmap", (void *)prop_array, + i = OF_getprop(node, "ino-bitmap", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get ino-bitmap", __func__); ino_bitmap = ((uint64_t)prop_array[1] << 32) | prop_array[0]; - for (n = 0; n <= STX_MAX_INO; n++) { - if ((ino_bitmap & (1ULL << n)) == 0) + for (i = 0; i <= STX_MAX_INO; i++) { + if ((ino_bitmap & (1ULL << i)) == 0) continue; - if (n == STX_FB0_INO || n == STX_FB1_INO) + if (i == STX_FB0_INO || i == STX_FB1_INO) /* Leave for upa(4). */ continue; - i = schizo_intr_register(sc, n); - if (i != 0) + j = schizo_intr_register(sc, i); + if (j != 0) device_printf(dev, "could not register interrupt " - "controller for INO %d (%d)\n", n, i); + "controller for INO %d (%d)\n", i, j); } /* @@ -466,9 +467,9 @@ schizo_attach(device_t dev) tsbsize = (x); \ break; \ - n = OF_getprop(node, "virtual-dma", (void *)prop_array, + i = OF_getprop(node, "virtual-dma", (void *)prop_array, sizeof(prop_array)); - if (n == -1 || n != sizeof(prop_array)) + if (i == -1 || i != sizeof(prop_array)) schizo_iommu_init(sc, 7, -1); else { switch (prop_array[1]) { @@ -502,13 +503,12 @@ schizo_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, STX_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - nrange = OF_getprop_alloc(node, "ranges", sizeof(*range), - (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (nrange != STX_NRANGE) + if (i != STX_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -516,11 +516,12 @@ schizo_attach(device_t dev) * The physical start addresses of the ranges are the configuration, * memory and I/O handles. */ - for (n = 0; n < STX_NRANGE; n++) { - i = OFW_PCI_RANGE_CS(&range[n]); - if (sc->sc_pci_bh[i] != 0) - panic("%s: duplicate range for space %d", __func__, i); - sc->sc_pci_bh[i] = OFW_PCI_RANGE_PHYS(&range[n]); + for (i = 0; i < STX_NRANGE; i++) { + j = OFW_PCI_RANGE_CS(&range[i]); + if (sc->sc_pci_bh[j] != 0) + panic("%s: duplicate range for space %d", + __func__, j); + sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -543,12 +544,12 @@ schizo_attach(device_t dev) * Get the bus range from the firmware. * NB: Tomatillos don't support PCI bus reenumeration. */ - n = OF_getprop(node, "bus-range", (void *)prop_array, + i = OF_getprop(node, "bus-range", (void *)prop_array, sizeof(prop_array)); - if (n == -1) + if (i == -1) panic("%s: could not get bus-range", __func__); - if (n != sizeof(prop_array)) - panic("%s: broken bus-range (%d)", __func__, n); + if (i != sizeof(prop_array)) + panic("%s: broken bus-range (%d)", __func__, i); if (bootverbose) device_printf(dev, "bus range %u to %u; PCI bus %d\n", prop_array[0], prop_array[1], prop_array[0]); @@ -636,7 +637,8 @@ schizo_attach(device_t dev) * a block store after a write to TOMXMS_PCI_DMA_SYNC_PEND though. */ if ((sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver >= 5) || - sc->sc_mode == SCHIZO_MODE_TOM || sc->sc_mode == SCHIZO_MODE_XMS) { + sc->sc_mode == SCHIZO_MODE_TOM || + sc->sc_mode == SCHIZO_MODE_XMS) { sc->sc_flags |= SCHIZO_FLAGS_CDMA; if (sc->sc_mode == SCHIZO_MODE_SCZ) { sc->sc_cdma_state = SCHIZO_CDMA_STATE_DONE; @@ -645,26 +647,26 @@ schizo_attach(device_t dev) * at RID 4 but most don't. With the latter we add * it ourselves at the spare RID 5. */ - n = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, + i = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, 4)); - if (n == STX_CDMA_A_INO || n == STX_CDMA_B_INO) { - (void)schizo_get_intrmap(sc, n, NULL, + if (i == STX_CDMA_A_INO || i == STX_CDMA_B_INO) { + (void)schizo_get_intrmap(sc, i, NULL, &sc->sc_cdma_clr); - schizo_set_intr(sc, 4, n, schizo_cdma); + schizo_set_intr(sc, 4, i, schizo_cdma); } else { - n = STX_CDMA_A_INO + sc->sc_half; + i = STX_CDMA_A_INO + sc->sc_half; if (bus_set_resource(dev, SYS_RES_IRQ, 5, - INTMAP_VEC(sc->sc_ign, n), 1) != 0) + INTMAP_VEC(sc->sc_ign, i), 1) != 0) panic("%s: failed to add CDMA " "interrupt", __func__); - i = schizo_intr_register(sc, n); - if (i != 0) + j = schizo_intr_register(sc, i); + if (j != 0) panic("%s: could not register " "interrupt controller for CDMA " - "(%d)", __func__, i); - (void)schizo_get_intrmap(sc, n, NULL, + "(%d)", __func__, j); + (void)schizo_get_intrmap(sc, i, NULL, &sc->sc_cdma_clr); - schizo_set_intr(sc, 5, n, schizo_cdma); + schizo_set_intr(sc, 5, i, schizo_cdma); } } if (sc->sc_mode == SCHIZO_MODE_TOM && sc->sc_ver <= 4) @@ -692,11 +694,11 @@ schizo_set_intr(struct schizo_softc *sc, int rid; rid = index; - sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, - &rid, RF_ACTIVE); + sc->sc_irq_res[index] = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_irq_res[index] == NULL || - INTIGN(vec = rman_get_start(sc->sc_irq_res[index])) != sc->sc_ign || - INTINO(vec) != ino || + INTINO(vec = rman_get_start(sc->sc_irq_res[index])) != ino || + INTIGN(vec) != sc->sc_ign || intr_vectors[vec].iv_ic != &schizo_ic || bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], INTR_TYPE_MISC | INTR_FAST, handler, NULL, sc, @@ -732,8 +734,8 @@ schizo_intr_register(struct schizo_softc } static int -schizo_get_intrmap(struct schizo_softc *sc, u_int ino, bus_addr_t *intrmapptr, - bus_addr_t *intrclrptr) +schizo_get_intrmap(struct schizo_softc *sc, u_int ino, + bus_addr_t *intrmapptr, bus_addr_t *intrclrptr) { bus_addr_t intrclr, intrmap; uint64_t mr; @@ -967,8 +969,8 @@ schizo_read_config(device_t dev, u_int b } static void -schizo_write_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, - uint32_t val, int width) +schizo_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t val, int width) { struct schizo_softc *sc; bus_space_handle_t bh; @@ -1003,8 +1005,9 @@ schizo_route_interrupt(device_t bridge, sc = device_get_softc(bridge); pintr = pin; - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, + ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + maskbuf)) return (mintr); device_printf(bridge, "could not route pin %d for device %d.%d\n", @@ -1039,8 +1042,8 @@ schizo_dma_sync_stub(void *arg) (void)PCIB_READ_CONFIG(sds->sds_ppb, sds->sds_bus, sds->sds_slot, sds->sds_func, PCIR_VENDOR, 2); - for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_DONE, - SCHIZO_CDMA_STATE_PENDING) == 0;) + for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, + SCHIZO_CDMA_STATE_DONE, SCHIZO_CDMA_STATE_PENDING) == 0;) ; SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, 1); microuptime(&cur); @@ -1309,8 +1312,8 @@ schizo_alloc_resource(device_t bus, devi if (start != end) panic("%s: XXX: interrupt range", __func__); start = end = INTMAP_VEC(sc->sc_ign, end); - return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, - rid, start, end, count, flags)); + return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, + type, rid, start, end, count, flags)); } switch (type) { case SYS_RES_MEMORY: @@ -1425,7 +1428,7 @@ schizo_alloc_bus_tag(struct schizo_softc { bus_space_tag_t bt; - bt = (bus_space_tag_t)malloc(sizeof(struct bus_space_tag), M_DEVBUF, + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 14:06:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D910F1065672; Tue, 29 Dec 2009 14:06:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8CC08FC1C; Tue, 29 Dec 2009 14:06:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTE6aEh026514; Tue, 29 Dec 2009 14:06:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTE6a7Y026512; Tue, 29 Dec 2009 14:06:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912291406.nBTE6a7Y026512@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Dec 2009 14:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201200 - head/sys/sparc64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 14:06:36 -0000 Author: marius Date: Tue Dec 29 14:06:36 2009 New Revision: 201200 URL: http://svn.freebsd.org/changeset/base/201200 Log: - Remove a redundant variable and an unnecessary cast. - Fix whitespace. Modified: head/sys/sparc64/pci/fire.c Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Tue Dec 29 14:03:38 2009 (r201199) +++ head/sys/sparc64/pci/fire.c Tue Dec 29 14:06:36 2009 (r201200) @@ -290,7 +290,7 @@ fire_attach(device_t dev) uint64_t ino_bitmap, val; phandle_t node; uint32_t prop, prop_array[2]; - int i, j, mode, nrange; + int i, j, mode; u_int lw; uint16_t mps; @@ -725,13 +725,12 @@ fire_attach(device_t dev) rman_manage_region(&sc->sc_pci_mem_rman, 0, FO_MEM_SIZE) != 0) panic("%s: failed to set up memory rman", __func__); - nrange = OF_getprop_alloc(node, "ranges", sizeof(*range), - (void **)&range); + i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* * Make sure that the expected ranges are present. The * OFW_PCI_CS_MEM64 one is not currently used though. */ - if (nrange != FIRE_NRANGE) + if (i != FIRE_NRANGE) panic("%s: unsupported number of ranges", __func__); /* * Find the addresses of the various bus spaces. @@ -743,7 +742,7 @@ fire_attach(device_t dev) j = OFW_PCI_RANGE_CS(&range[i]); if (sc->sc_pci_bh[j] != 0) panic("%s: duplicate range for space %d", - __func__, j); + __func__, j); sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } free(range, M_OFWPROP); @@ -2101,7 +2100,7 @@ fire_alloc_bus_tag(struct fire_softc *sc { bus_space_tag_t bt; - bt = (bus_space_tag_t)malloc(sizeof(struct bus_space_tag), M_DEVBUF, + bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, M_NOWAIT | M_ZERO); if (bt == NULL) panic("%s: out of memory", __func__); From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 14:29:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31C431065693; Tue, 29 Dec 2009 14:29:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21C398FC13; Tue, 29 Dec 2009 14:29:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTET9j7027034; Tue, 29 Dec 2009 14:29:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTET9J5027031; Tue, 29 Dec 2009 14:29:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912291429.nBTET9J5027031@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 29 Dec 2009 14:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201201 - in head/lib/libc: gen sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 14:29:09 -0000 Author: kib Date: Tue Dec 29 14:29:08 2009 New Revision: 201201 URL: http://svn.freebsd.org/changeset/base/201201 Log: Document CLOCK_SECOND, add cross-reference from time(3) to clock_gettime(2). Based on submission by: pluknet gmail com MFC after: 3 days Modified: head/lib/libc/gen/time.3 head/lib/libc/sys/clock_gettime.2 Modified: head/lib/libc/gen/time.3 ============================================================================== --- head/lib/libc/gen/time.3 Tue Dec 29 14:06:36 2009 (r201200) +++ head/lib/libc/gen/time.3 Tue Dec 29 14:29:08 2009 (r201201) @@ -66,6 +66,7 @@ The function may fail for any of the reasons described in .Xr gettimeofday 2 . .Sh SEE ALSO +.Xr clock_gettime 2 , .Xr gettimeofday 2 , .Xr ctime 3 .Sh STANDARDS Modified: head/lib/libc/sys/clock_gettime.2 ============================================================================== --- head/lib/libc/sys/clock_gettime.2 Tue Dec 29 14:06:36 2009 (r201200) +++ head/lib/libc/sys/clock_gettime.2 Tue Dec 29 14:29:08 2009 (r201201) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2006 +.Dd December 29, 2009 .Dt CLOCK_GETTIME 2 .Os .Sh NAME @@ -70,10 +70,13 @@ which starts at zero when the kernel boo monotonically in SI seconds while the machine is running, .Dv CLOCK_VIRTUAL for time that increments only when -the CPU is running in user mode on behalf of the calling process, or +the CPU is running in user mode on behalf of the calling process, .Dv CLOCK_PROF for time that increments when the CPU is running in user or -kernel mode. +kernel mode, or +.Dv CLOCK_SECOND +which returns the current second without performing a full time counter +query, using in-kernel cached value of current second. .Pp The structure pointed to by .Fa tp From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 15:48:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C443106568B; Tue, 29 Dec 2009 15:48:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B2178FC0A; Tue, 29 Dec 2009 15:48:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTFm5IS028645; Tue, 29 Dec 2009 15:48:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTFm5xd028643; Tue, 29 Dec 2009 15:48:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912291548.nBTFm5xd028643@svn.freebsd.org> From: John Baldwin Date: Tue, 29 Dec 2009 15:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201202 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 15:48:05 -0000 Author: jhb Date: Tue Dec 29 15:48:04 2009 New Revision: 201202 URL: http://svn.freebsd.org/changeset/base/201202 Log: Use reallocf() to simplify some logic. MFC after: 2 weeks Modified: head/usr.sbin/arp/arp.c Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Tue Dec 29 14:29:08 2009 (r201201) +++ head/usr.sbin/arp/arp.c Tue Dec 29 15:48:04 2009 (r201202) @@ -493,7 +493,7 @@ search(u_long addr, action_fn *action) { int mib[6]; size_t needed; - char *lim, *buf, *newbuf, *next; + char *lim, *buf, *next; struct rt_msghdr *rtm; struct sockaddr_inarp *sin2; struct sockaddr_dl *sdl; @@ -516,13 +516,9 @@ search(u_long addr, action_fn *action) return 0; buf = NULL; for (;;) { - newbuf = realloc(buf, needed); - if (newbuf == NULL) { - if (buf != NULL) - free(buf); + buf = reallocf(buf, needed); + if (buf == NULL) errx(1, "could not reallocate memory"); - } - buf = newbuf; st = sysctl(mib, 6, buf, &needed, NULL, 0); if (st == 0 || errno != ENOMEM) break; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 15:58:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A145B106566C; Tue, 29 Dec 2009 15:58:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 763348FC15; Tue, 29 Dec 2009 15:58:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTFwACs028926; Tue, 29 Dec 2009 15:58:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTFwAXE028924; Tue, 29 Dec 2009 15:58:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912291558.nBTFwAXE028924@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 29 Dec 2009 15:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201204 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 15:58:10 -0000 Author: kib Date: Tue Dec 29 15:58:10 2009 New Revision: 201204 URL: http://svn.freebsd.org/changeset/base/201204 Log: Document _FAST and _PRECISE clocks. Submitted by: Valentin Nechayev MFC after: 3 days Modified: head/lib/libc/sys/clock_gettime.2 Modified: head/lib/libc/sys/clock_gettime.2 ============================================================================== --- head/lib/libc/sys/clock_gettime.2 Tue Dec 29 15:48:51 2009 (r201203) +++ head/lib/libc/sys/clock_gettime.2 Tue Dec 29 15:58:10 2009 (r201204) @@ -59,25 +59,44 @@ used by a clock which is specified by The .Fa clock_id argument -can be one of five values: -.Dv CLOCK_REALTIME +can be one of the following values: +.Dv CLOCK_REALTIME , +.Dv CLOCK_REALTIME_PRECISE , +.Dv CLOCK_REALTIME_FAST for time that increments as -a wall clock should, -.Dv CLOCK_MONOTONIC -which increments in SI seconds, -.Dv CLOCK_UPTIME +a wall clock should; +.Dv CLOCK_MONOTONIC , +.Dv CLOCK_MONOTONIC_PRECISE , +.Dv CLOCK_MONOTONIC_FAST +which increments in SI seconds; +.Dv CLOCK_UPTIME , +.Dv CLOCK_UPTIME_PRECISE , +.Dv CLOCK_UPTIME_FAST which starts at zero when the kernel boots and increments -monotonically in SI seconds while the machine is running, +monotonically in SI seconds while the machine is running; .Dv CLOCK_VIRTUAL for time that increments only when -the CPU is running in user mode on behalf of the calling process, +the CPU is running in user mode on behalf of the calling process; .Dv CLOCK_PROF for time that increments when the CPU is running in user or -kernel mode, or +kernel mode; or .Dv CLOCK_SECOND which returns the current second without performing a full time counter query, using in-kernel cached value of current second. .Pp +The clock IDs +.Fa CLOCK_REALTIME_FAST , +.Fa CLOCK_MONOTONIC_FAST , +.Fa CLOCK_UPTIME_FAST +are analogs of corresponding IDs without _FAST suffix but do not perform +a full time counter query, so their accuracy is one timer tick. +Similarly, +.Fa CLOCK_REALTIME_PRECISE , +.Fa CLOCK_MONOTONIC_PRECISE , +.Fa CLOCK_UPTIME_PRECISE +are used to get the most exact value as possible, at the expense of +execution time. +.Pp The structure pointed to by .Fa tp is defined in @@ -91,7 +110,8 @@ struct timespec { }; .Ed .Pp -Only the super-user may set the time of day. +Only the super-user may set the time of day, using only +.Fa CLOCK_REALTIME . If the system securelevel is greater than 1 (see .Xr init 8 ) , the time may only be advanced. @@ -137,3 +157,13 @@ and .Fn clock_getres system calls conform to .St -p1003.1b-93 . +The clock IDs +.Fa CLOCK_REALTIME_FAST , +.Fa CLOCK_REALTIME_PRECISE , +.Fa CLOCK_MONOTONIC_FAST , +.Fa CLOCK_MONOTONIC_PRECISE , +.Fa CLOCK_UPTIME , +.Fa CLOCK_UPTIME_FAST , +.Fa CLOCK_UPTIME_PRECISE , +.Fa CLOCK_SECOND +are FreeBSD extensions to the POSIX interface. From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 19:44:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 440801065679 for ; Tue, 29 Dec 2009 19:44:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id BBBE98FC2B for ; Tue, 29 Dec 2009 19:44:44 +0000 (UTC) Received: (qmail 3852 invoked by uid 399); 29 Dec 2009 19:44:43 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 29 Dec 2009 19:44:43 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B3A5C2E.5080701@FreeBSD.org> Date: Tue, 29 Dec 2009 11:44:46 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Ed Schouten References: <200912290849.nBT8nh7c017065@svn.freebsd.org> In-Reply-To: <200912290849.nBT8nh7c017065@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201180 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 19:44:45 -0000 Ed Schouten wrote: > While there, rename die_you_gravy_sucking_pig_dog() to something that's > less moronic. Boo! IMO the fact that at least some of our sources have some personality is a feature. :) Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 19:47:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1A8B1065698; Tue, 29 Dec 2009 19:47:34 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C6418FC1C; Tue, 29 Dec 2009 19:47:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTJlY4x034181; Tue, 29 Dec 2009 19:47:34 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTJlY7a034177; Tue, 29 Dec 2009 19:47:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912291947.nBTJlY7a034177@svn.freebsd.org> From: Rui Paulo Date: Tue, 29 Dec 2009 19:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201209 - in head/sys: conf contrib/dev/iwn dev/iwn modules/iwnfw modules/iwnfw/iwn1000 modules/iwnfw/iwn4965 modules/iwnfw/iwn5000 modules/iwnfw/iwn6000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 19:47:34 -0000 Author: rpaulo Date: Tue Dec 29 19:47:34 2009 New Revision: 201209 URL: http://svn.freebsd.org/changeset/base/201209 Log: iwn(4) update. Notable changes: * new firmware * untested support for 1000 and 6000 series * bgscan support * remove unnecessary RXON changes * allow setting of country/regdomain by enforcing channel flags read from the EEPROM * suspend/resume fixes * RF kill switch fixes * LED adjustments * several bus_dma*() related fixes * addressed some LORs * many other bug fixes Submitted by: Bernhard Schmidt Obtained from: Brandon Gooch (LED related changes), Benjamin Kaduk (LOR fixes), OpenBSD Added: head/sys/contrib/dev/iwn/iwlwifi-1000-128.50.3.1.fw.uu head/sys/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu head/sys/contrib/dev/iwn/iwlwifi-5000-8.24.2.12.fw.uu head/sys/contrib/dev/iwn/iwlwifi-6000-9.176.4.1.fw.uu head/sys/modules/iwnfw/iwn1000/ head/sys/modules/iwnfw/iwn1000/Makefile (contents, props changed) head/sys/modules/iwnfw/iwn6000/ head/sys/modules/iwnfw/iwn6000/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/contrib/dev/iwn/iwlwifi-4965-228.57.2.23.fw.uu head/sys/contrib/dev/iwn/iwlwifi-5000-5.4.A.11.fw.uu head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnreg.h head/sys/dev/iwn/if_iwnvar.h head/sys/modules/iwnfw/Makefile head/sys/modules/iwnfw/iwn4965/Makefile head/sys/modules/iwnfw/iwn5000/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Dec 29 17:38:50 2009 (r201208) +++ head/sys/conf/files Tue Dec 29 19:47:34 2009 (r201209) @@ -1082,6 +1082,20 @@ iwi_monitor.fw optional iwimonitorfw | no-obj no-implicit-rule \ clean "iwi_monitor.fw" dev/iwn/if_iwn.c optional iwn +iwn1000fw.c optional iwn1000fw | iwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn1000.fw:iwn1000fw -miwn1000fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwn1000fw.c" +iwn1000fw.fwo optional iwn1000fw | iwnfw \ + dependency "iwn1000.fw" \ + compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn1000.fw" \ + no-implicit-rule \ + clean "iwn1000fw.fwo" +iwn1000.fw optional iwn1000fw | iwnfw \ + dependency ".PHONY" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-1000-128.50.3.1.fw.uu" \ + no-obj no-implicit-rule \ + clean "iwn1000.fw" iwn4965fw.c optional iwn4965fw | iwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwn4965.fw:iwn4965fw -miwn4965fw -c${.TARGET}" \ no-implicit-rule before-depend local \ @@ -1093,7 +1107,7 @@ iwn4965fw.fwo optional iwn4965fw | iwn clean "iwn4965fw.fwo" iwn4965.fw optional iwn4965fw | iwnfw \ dependency ".PHONY" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-228.57.2.23.fw.uu" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \ no-obj no-implicit-rule \ clean "iwn4965.fw" iwn5000fw.c optional iwn5000fw | iwnfw \ @@ -1107,7 +1121,7 @@ iwn5000fw.fwo optional iwn5000fw | iwnf clean "iwn5000fw.fwo" iwn5000.fw optional iwn5000fw | iwnfw \ dependency ".PHONY" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5000-5.4.A.11.fw.uu" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5000-8.24.2.12.fw.uu" \ no-obj no-implicit-rule \ clean "iwn5000.fw" iwn5150fw.c optional iwn5150fw | iwnfw \ @@ -1124,6 +1138,20 @@ iwn5150.fw optional iwn5150fw | iwnfw compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu" \ no-obj no-implicit-rule \ clean "iwn5150.fw" +iwn6000fw.c optional iwn6000fw | iwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn6000.fw:iwn6000fw -miwn6000fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwn6000fw.c" +iwn6000fw.fwo optional iwn6000fw | iwnfw \ + dependency "iwn6000.fw" \ + compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000.fw" \ + no-implicit-rule \ + clean "iwn6000fw.fwo" +iwn6000.fw optional iwn6000fw | iwnfw \ + dependency ".PHONY" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000-9.176.4.1.fw.uu" \ + no-obj no-implicit-rule \ + clean "iwn6000.fw" dev/ixgb/if_ixgb.c optional ixgb dev/ixgb/ixgb_ee.c optional ixgb dev/ixgb/ixgb_hw.c optional ixgb Added: head/sys/contrib/dev/iwn/iwlwifi-1000-128.50.3.1.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/iwn/iwlwifi-1000-128.50.3.1.fw.uu Tue Dec 29 19:47:34 2009 (r201209) @@ -0,0 +1,5920 @@ +Copyright (c) 2006-2009, Intel Corporation. +All rights reserved. + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +* Redistributions must reproduce the above copyright notice and the + following disclaimer in the documentation and/or other materials + provided with the distribution. +* Neither the name of Intel Corporation nor the names of its suppliers + may be used to endorse or promote products derived from this software + without specific prior written permission. +* No reverse engineering, decompilation, or disassembly of this software + is permitted. + +Limited patent license. Intel Corporation grants a world-wide, +royalty-free, non-exclusive license under patents it now or hereafter +owns or controls to make, have made, use, import, offer to sell and +sell ("Utilize") this software, but solely to the extent that any +such patent is necessary to Utilize the software alone, or in +combination with an operating system licensed under an approved Open +Source license as listed by the Open Source Initiative at +http://opensource.org/licenses. The patent license shall not apply to +any other combinations which include this software. No hardware per +se is licensed hereunder. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. +begin-base64 644 iwlwifi-1000-128.50.3.1.fw.uu +AQMygLA0AABE4wEAAMAAAHC5AQAAwAAAAAAAACAggA8AAEAAaSAAAGkgQABpIAAAaSBAACAggA8A +AOgAaSAAAGkgQABpIAAAaSBAACAggA8AAIgFaSAAAGkgQABpIAAASiAAAEohAABKIgAASiMAAEok +AABKJQAASiYAAEonAABKIAAQSiEAEEoiABBKIwAQSiQAEEolABBKJgAQSicAEEogACBKIQAgSiIA +IEojACBKJAAgSiUAIEomACBKJwAgSiAAMEohADAKJIA/gAAAwEEsnDBALJwwQiQcNAoigD+AAERZ +CiMANwYPAABKJgBwaSBAAEomAHBKJgBwSiYAcEomAHAAFgBwgAB0BEB4ICBAhwAAAAAAAAAAAAAK +yM9xoADIHw4ZGIALyA8ZGIAMyBAZGIANEgI2AMhEeBEZGIAOyC0ZGIDgfuHE/BzIvvwcSL7hwOHB +4cLhw/wcCLH8HEix/ByIsfwcyLH8HAiy/BxIsvwciLL8HMiy/BwIv2okgBDhxGokwBDhxPHAz3Cg +ANAbFIDPcYAAcAQEIICPz1EE4QChCvIvKQEAz3CAAGAJ8CBAAEB42v/RwMHEayTAEMHEaySAEMHE +n3QEFAs0BBQKNAQUCTQEFAg0BBQHNAQUBjQEFAU0BBQENMHDwcLBwcHAwcRFLH4QCiZAfsHEaySA +FMHEICBAhwrIh7gKGhgwC8ibuAsaGDAMyAwaGDANyIe4DRoYMA7IhSDDDw4aGDDgfuB48cAKyJW4 +ChoYMAvIm7gLGhgwDciKuI24kLgNGhgwz3CAAIgKGIiB4Av0DcjPcQAAbAqsuA0aGDCuDSAAD9jR +wOB+4HjPcIAARJsAgIYg/oEI9A3IBSCADwAAANQNGhgwRPHgePHAz3EDAEANz3CgAKggLaDPcoAA +sAQgggFpAKLeDCABSNjPcIAAxAglgCOBIIHHcQAAiBOGDMAH0fHgeM9wgADECBUEwAfgePHA4gtA +AYDgz3aAAHAEBvKB4Ab0AdgD8ADYC66A4QbygeEG9AHYA/AA2AqugOIG8oHiBvQB2APwANgMrgDY +z3WgAMgfGB0YkAuOgOCKIRAADvIIjoDgDPLPcAMAQA1FHRgQMKUC2BgdGJAD8DGlCo6A4BryCY6A +4Bbyz3ABAETjIB0YkM9wgAAoACEdGJDPcIAAbAQiHRiQGBUAlkUgAAMYHRiQDI6A4AfyGBUAloUg +AQQYHRiQgOMY8gDYlLjPdoAApAQApnHYBrg6D+AA/Nkghs9wAABMHCoP4ACfuRgVAJaFuBgdGJBl +A0ABz3Gqqru7z3CfALj/NqA2oDagNqDPcaAAyDsOgYi4DqFpIEAA/vHgePHApcFBwELBDBwAMRAc +QDHPcYAAfFo0GcAPMBkADywZwA4oGYAOJBlADs9wgAB8WiAYQAvPcIAAfFocGAALz3CAAHxaGBjA +Cs9wgAB8WhQYgArPcIAAfFoQGMAIz3CAAHxaDBiACM9wgAB8WggYQAjPcYAAAFqAGQAIfBnAB3gZ +gAd0GUAHcBkAB2wZAAdoGYAGZBlABmAZAAZcGcAFWBmABVQZQAVQGQAFTBnABEgZgAREGUAEQBkA +BO+hzqGtoYyhLBnAAigZgAIkGUACIBkAAhwZwAEYGYABFBlAARAZAAFjoWogAAPYGQAAaiDAAtQZ +AABqIIAC0BkAAGogQAHIGQAAaiAAAcQZAABqIMAAwBkAAGoggAC8GQAAaiBAALgZAABqIAAAtBkA +AGoggAHMGQAA0NifuM9xnwC4/x2hz3CAAAAAxIBTJcQ1UybFNde6AebTvsSgUyPABAUmjh/Q/gAA +1qEFIIAPsP4AABahGIFTJ841AN2UuBihQMMBwALByXMMFAYwSgpgARAUBzDPcKAAtA+8oE4LQAGG +DeAAqXAI2ADZSg3gAJm5FvHgePHA8ghgAXvYyglgAdfZz3GAAHxaNBnADzAZAA8sGcAOKBmADiQZ +QA7PcIAAfFogGEALz3CAAHxaHBgAC89wgAB8WhgYwArPcIAAfFoUGIAKz3CAAHxaEBjACM9wgAB8 +WgwYgAjPcIAAfFoIGEAIz3GAAABagBkACHwZwAd4GYAHdBlAB3AZAAdsGQAHaBmABmQZQAZgGQAG +XBnABVgZgAVUGUAFUBkABUwZwARIGYAERBlABEAZAATvoc6hraGMoSwZwAIoGYACJBlAAiAZAAIc +GcABGBmAARQZQAEQGQABY6FqIAAD2BkAAGogwALUGQAAaiCAAtAZAABqIEAByBkAAGogAAHEGQAA +aiDAAMAZAABqIIAAvBkAAGogQAC4GQAAaiAAALQZAABqIIABzBkAAOt2z3WgAMgfGRURls9wAABE +HN4IIAEKIMAvWnDPcIAAZBYjgM9znwC4/893gAAAAASHgOEB4NO4JPIZFQKWUSLAgB7yXYNA3p++ +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 +AACfBQXY4fMgwAAcBDCE4Mohyw/KIssHyiOLDwAAowWmB+v/yiBrAYbgAdnCIUoAz3CAAM4GIKih +wNHA4H7gePwciLb8HEi2/BwItvwcyLX8HIi1/BxItfwcCLX8HMi0/ByItPwcSLT8HAi0/BzIs/wc +iLP8HEiz4H7geATcON018OB4BNw03TPw4HgE3DDdMfDgeATcLN0v8OB4BNwo3S3w4HgE3CTdK/Dg +eATcIN0p8OB4BNwc3Sfw4HgE3BjdJfDgeATcFN0j8OB4BNwQ3SHw4HgE3AzdH/DgeATcCN0c8OB4 +BNwE3RnwNBQaMDAUGTAsFBgwKBQXMCQUFjAgFBUwHBQUMBgUEzAUFBIwEBQRMAwUEDACxwHGsCRN +M7AkHzPgfvHASg/P/89zgABUEEODAN/PdaAALCCwhdJq1H5+ZqWmBKYB4owiAoAmpkOjhfcCg+Oj +AeACo30Hz//geADYz3GgAMgfGKEZoQHYDqHgfuB48cD6Du//OXEZcshx6HIB3c92oADIH7OmBd/P +dYAAwA/gpQGlBMBIpQmlFYYnpQqlGIYYHUARC6UZhhQdABEMpaAWABBkpQ2lpBYAEAwdABIOpagW +ABAIHUASD6XPcAEAMoAQpZ4Pr/8k2AQggA8AAAD4EaWOD6//ANgSpVMnwHUTpQHIVB0AFxalEhYA +llAdABcXpRMWAJbPcoAAwA8YpRQWAJZKJEB5GaUVFgCWANkapSQWAJYbpRYWAJYcpc9wgAAoDxCA +HaXPcIAAwA94GIAKz3CAAMAPfBjACs9wgAA8EAQYAAuEGkALz3CgAMgcCICIGgAAqCCAAvAiQwDP +cJ8AuP8B4XagWQbP/+B+4HjgfuB44H7geOB+4HgA2Za5z3CgAKwvPKDgfuB48cChwYtwCgyv/wHZ +QNjmD6//QMC+C4//ocDRwOB+4HjxwAohwA/rcgXYMNuKJMMP1QKv/rhz4HjgfuB44H7geOB+4Hjg +fuB44H8B2OB+4HjgfuB44H8B2PHAag3P/6/BCHcA3s9woABkLvAg0gMZEhA2GRrYM/XYBbh6Ca// +6XEZyM91oADUBxodGJAPFRGWGRUAloDgLPLA5kX3GRUOlvzxABYAQAAWBUAAHEAxIMCc4D/0gcBa +C6//DtkjwGG4Y8AMwIDgDvLPcZ8AuP8aoS3AG6EDwB6hz3AAbAQAGaEPHViUTg7ABQ8VEZbPcKAA +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 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 20:08:44 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5A79106566B; Tue, 29 Dec 2009 20:08:44 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id 9E04F8FC1A; Tue, 29 Dec 2009 20:08:44 +0000 (UTC) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id nBTK8hdT017304; Tue, 29 Dec 2009 14:08:43 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Tue, 29 Dec 2009 14:08:43 -0600 (CST) From: "Sean C. Farley" To: Doug Barton In-Reply-To: <4B3A5C2E.5080701@FreeBSD.org> Message-ID: References: <200912290849.nBT8nh7c017065@svn.freebsd.org> <4B3A5C2E.5080701@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.8 required=4.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ed Schouten Subject: Re: svn commit: r201180 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 20:08:44 -0000 On Tue, 29 Dec 2009, Doug Barton wrote: > Ed Schouten wrote: >> While there, rename die_you_gravy_sucking_pig_dog() to something that's >> less moronic. > > Boo! IMO the fact that at least some of our sources have some > personality is a feature. :) How about alt_shutdown_die_die_die()? :) Sean -- scf@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 20:14:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACA93106568F; Tue, 29 Dec 2009 20:14:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B8908FC08; Tue, 29 Dec 2009 20:14:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTKEd6B034723; Tue, 29 Dec 2009 20:14:39 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTKEdR9034721; Tue, 29 Dec 2009 20:14:39 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912292014.nBTKEdR9034721@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 29 Dec 2009 20:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201210 - head/secure X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 20:14:39 -0000 Author: trasz Date: Tue Dec 29 20:14:39 2009 New Revision: 201210 URL: http://svn.freebsd.org/changeset/base/201210 Log: Remove pppd, it's gone. Modified: head/secure/Makefile Modified: head/secure/Makefile ============================================================================== --- head/secure/Makefile Tue Dec 29 19:47:34 2009 (r201209) +++ head/secure/Makefile Tue Dec 29 20:14:39 2009 (r201210) @@ -7,8 +7,7 @@ SUBDIR= lib libexec usr.bin usr.sbin # These are the programs which depend on crypto, but not Kerberos. SPROGS= lib/libfetch lib/libpam lib/libradius lib/libtelnet \ bin/ed libexec/telnetd usr.bin/fetch usr.bin/telnet \ - usr.sbin/pkg_install usr.sbin/ppp usr.sbin/pppd \ - usr.sbin/tcpdump/tcpdump + usr.sbin/pkg_install usr.sbin/ppp usr.sbin/tcpdump/tcpdump .if ${MK_SENDMAIL} != "no" SPROGS+=usr.sbin/sendmail .endif From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 20:15:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DCB4106566C; Tue, 29 Dec 2009 20:15:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CB588FC15; Tue, 29 Dec 2009 20:15:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTKFNNq034785; Tue, 29 Dec 2009 20:15:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTKFNIq034783; Tue, 29 Dec 2009 20:15:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912292015.nBTKFNIq034783@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 29 Dec 2009 20:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201211 - head/usr.sbin/crunch/examples X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 20:15:23 -0000 Author: trasz Date: Tue Dec 29 20:15:23 2009 New Revision: 201211 URL: http://svn.freebsd.org/changeset/base/201211 Log: Remove pppd and SLIP-related stuff. Modified: head/usr.sbin/crunch/examples/really-big.conf Modified: head/usr.sbin/crunch/examples/really-big.conf ============================================================================== --- head/usr.sbin/crunch/examples/really-big.conf Tue Dec 29 20:14:39 2009 (r201210) +++ head/usr.sbin/crunch/examples/really-big.conf Tue Dec 29 20:15:23 2009 (r201211) @@ -27,7 +27,7 @@ progs badsect bim clri disklabel dmesg d progs ifconfig init mknod modload modunload mount mount_isofs progs mount_lofs mount_msdosfs mount_portalfs mountd progs newfs nfsd nfsiod ping quotacheck reboot restore route routed savecore -progs shutdown slattach swapon ttyflags tunefs umount +progs shutdown swapon ttyflags tunefs umount # shell scripts: fastboot ln dump rdump @@ -71,7 +71,7 @@ progs ac accton amd arp bad144 catman ch progs dev_mkdb diskpart edquota flcopy gettable grfinfo hilinfo htable inetd progs iostat iteconfig kvm_mkdb mtree named portmap pppd progs pstat pwd_mkdb quot quotaon rarpd rbootd repquota rmt rpc.bootparamd -progs rwhod sa sliplogin slstats spray sysctl syslogd tcpdump +progs rwhod sa spray sysctl syslogd tcpdump progs traceroute trpt trsp update vipw vnconfig ypbind yppoll ypset special amd srcdir /usr/src/usr.sbin/amd/amd From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 20:15:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30CA11065697; Tue, 29 Dec 2009 20:15:53 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07C418FC23; Tue, 29 Dec 2009 20:15:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTKFqlA034828; Tue, 29 Dec 2009 20:15:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTKFqWC034827; Tue, 29 Dec 2009 20:15:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912292015.nBTKFqWC034827@svn.freebsd.org> From: Rui Paulo Date: Tue, 29 Dec 2009 20:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201212 - head/sys/contrib/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 20:15:53 -0000 Author: rpaulo Date: Tue Dec 29 20:15:52 2009 New Revision: 201212 URL: http://svn.freebsd.org/changeset/base/201212 Log: Delete old firmware. Deleted: head/sys/contrib/dev/iwn/iwlwifi-4965-228.57.2.23.fw.uu head/sys/contrib/dev/iwn/iwlwifi-5000-5.4.A.11.fw.uu From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 20:20:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B6CB106566B; Tue, 29 Dec 2009 20:20:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 783188FC18; Tue, 29 Dec 2009 20:20:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTKKpqZ034957; Tue, 29 Dec 2009 20:20:51 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTKKpwj034953; Tue, 29 Dec 2009 20:20:51 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912292020.nBTKKpwj034953@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 29 Dec 2009 20:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201213 - in head: . etc/mtree share/examples share/examples/pppd share/examples/slattach share/examples/sliplogin share/examples/startslip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 20:20:51 -0000 Author: trasz Date: Tue Dec 29 20:20:51 2009 New Revision: 201213 URL: http://svn.freebsd.org/changeset/base/201213 Log: Remove examples for pppd and SLIP-related stuff. Deleted: head/share/examples/pppd/ head/share/examples/slattach/ head/share/examples/sliplogin/ head/share/examples/startslip/ Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.usr.dist head/share/examples/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Dec 29 20:15:52 2009 (r201212) +++ head/ObsoleteFiles.inc Tue Dec 29 20:20:51 2009 (r201213) @@ -14,6 +14,29 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20091229: remove no longer relevant examples +OLD_FILES+=usr/share/examples/pppd/auth-down.sample +OLD_FILES+=usr/share/examples/pppd/auth-up.sample +OLD_FILES+=usr/share/examples/pppd/chap-secrets.sample +OLD_FILES+=usr/share/examples/pppd/chat.sh.sample +OLD_FILES+=usr/share/examples/pppd/ip-down.sample +OLD_FILES+=usr/share/examples/pppd/ip-up.sample +OLD_FILES+=usr/share/examples/pppd/options.sample +OLD_FILES+=usr/share/examples/pppd/pap-secrets.sample +OLD_FILES+=usr/share/examples/pppd/ppp.deny.sample +OLD_FILES+=usr/share/examples/pppd/ppp.shells.sample +OLD_DIRS+=usr/share/examples/pppd +OLD_FILES+=usr/share/examples/slattach/unit-command.sh +OLD_DIRS+=usr/share/examples/slattach +OLD_FILES+=usr/share/examples/sliplogin/slip.hosts +OLD_FILES+=usr/share/examples/sliplogin/slip.login +OLD_FILES+=usr/share/examples/sliplogin/slip.logout +OLD_FILES+=usr/share/examples/sliplogin/slip.slparms +OLD_DIRS+=usr/share/examples/sliplogin +OLD_FILES+=usr/share/examples/startslip/sldown.sh +OLD_FILES+=usr/share/examples/startslip/slip.sh +OLD_FILES+=usr/share/examples/startslip/slup.sh +OLD_DIRS+=usr/share/examples/startslip # 20091202: unify rc.firewall and rc.firewall6. OLD_FILES+=etc/rc.d/ip6fw OLD_FILES+=etc/rc.firewall6 Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Tue Dec 29 20:15:52 2009 (r201212) +++ head/etc/mtree/BSD.usr.dist Tue Dec 29 20:20:51 2009 (r201213) @@ -265,8 +265,6 @@ .. ppp .. - pppd - .. printing .. scsi_target @@ -283,16 +281,10 @@ srcs .. .. - slattach - .. - sliplogin - .. smbfs print .. .. - startslip - .. sunrpc dir .. Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Tue Dec 29 20:15:52 2009 (r201212) +++ head/share/examples/Makefile Tue Dec 29 20:20:51 2009 (r201213) @@ -24,13 +24,9 @@ LDIRS= BSD_daemon \ portal \ ppi \ ppp \ - pppd \ printing \ ses \ scsi_target \ - slattach \ - sliplogin \ - startslip \ sunrpc XFILES= BSD_daemon/FreeBSD.pfa \ @@ -135,16 +131,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ ppp/ppp.secret.sample \ ppp/ppp.secret.span-isp \ ppp/ppp.secret.span-isp.working \ - pppd/auth-down.sample \ - pppd/auth-up.sample \ - pppd/chap-secrets.sample \ - pppd/chat.sh.sample \ - pppd/ip-down.sample \ - pppd/ip-up.sample \ - pppd/options.sample \ - pppd/pap-secrets.sample \ - pppd/ppp.deny.sample \ - pppd/ppp.shells.sample \ printing/README \ printing/diablo-if-net \ printing/hpdf \ @@ -187,14 +173,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ scsi_target/scsi_target.h \ scsi_target/scsi_target.8 \ scsi_target/scsi_cmds.c \ - slattach/unit-command.sh \ - sliplogin/slip.hosts \ - sliplogin/slip.login \ - sliplogin/slip.logout \ - sliplogin/slip.slparms \ - startslip/sldown.sh \ - startslip/slip.sh \ - startslip/slup.sh \ sunrpc/Makefile \ sunrpc/dir/Makefile \ sunrpc/dir/dir.x \ From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 20:26:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBD251065672; Tue, 29 Dec 2009 20:26:05 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 7EAA48FC12; Tue, 29 Dec 2009 20:26:04 +0000 (UTC) Received: by bwz5 with SMTP id 5so7305708bwz.3 for ; Tue, 29 Dec 2009 12:25:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=E95v6YB39uNd9k/jR/gHH6qYdR7+Ybw8wgkn0p7eZ0c=; b=eMuiWDd+dSMSRut1EB1kV3rFNH6FKhsp26ABxhYdy7JaRm8mEgDDwE29koXcyU9PFr f7Zgkj4ZdpCPAM0tsFwD+Ociu75wOV3tN9M8ILBUxwYo0iZhRTr/cjxra2tXO3kBtcDP MdGwduBtSenEIkmUACZGmobrg6EYb2Li9ggzA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=u5MgneVf89ibYMzm3O7MrHVcUP8LqbQMEAyOQn9b+ThNtadQyOvjxDZqFW4oWzH6Uk rir2SAimvqV0485YjTBq75TdOZcCPmVL0szHxE3fO5Qt75RU75OLhHHEt4FnZ7QFJwoY lVonXTotEXIBSESK23GK6mX31lEGKK/dBN3Ow= MIME-Version: 1.0 Received: by 10.204.8.151 with SMTP id h23mr6507306bkh.194.1262118353717; Tue, 29 Dec 2009 12:25:53 -0800 (PST) In-Reply-To: <4B3A5C2E.5080701@FreeBSD.org> References: <200912290849.nBT8nh7c017065@svn.freebsd.org> <4B3A5C2E.5080701@FreeBSD.org> Date: Tue, 29 Dec 2009 23:25:53 +0300 Message-ID: From: pluknet To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r201180 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 20:26:05 -0000 2009/12/29 Doug Barton : > Ed Schouten wrote: >> =A0 While there, rename die_you_gravy_sucking_pig_dog() to something tha= t's >> =A0 less moronic. > > Boo! IMO the fact that at least some of our sources have some > personality is a feature. :) > Although, it came not so long ago (Net/2 or bit earlier), it became a popular expression to designate a recipe for freeing resources when you just can't wait for garbage collection (c). :) http://digg.com/programming/Die_You_Gravy_Sucking_Pig_Dog --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 20:30:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DF68106566B; Tue, 29 Dec 2009 20:30:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D1098FC1F; Tue, 29 Dec 2009 20:30:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTKUo7m035176; Tue, 29 Dec 2009 20:30:50 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTKUo9G035174; Tue, 29 Dec 2009 20:30:50 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912292030.nBTKUo9G035174@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 29 Dec 2009 20:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201214 - head/usr.sbin/crunch/examples X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 20:30:51 -0000 Author: trasz Date: Tue Dec 29 20:30:50 2009 New Revision: 201214 URL: http://svn.freebsd.org/changeset/base/201214 Log: Remove extra space introduced by the previous commit. Submitted by: rwatson Modified: head/usr.sbin/crunch/examples/really-big.conf Modified: head/usr.sbin/crunch/examples/really-big.conf ============================================================================== --- head/usr.sbin/crunch/examples/really-big.conf Tue Dec 29 20:20:51 2009 (r201213) +++ head/usr.sbin/crunch/examples/really-big.conf Tue Dec 29 20:30:50 2009 (r201214) @@ -27,7 +27,7 @@ progs badsect bim clri disklabel dmesg d progs ifconfig init mknod modload modunload mount mount_isofs progs mount_lofs mount_msdosfs mount_portalfs mountd progs newfs nfsd nfsiod ping quotacheck reboot restore route routed savecore -progs shutdown swapon ttyflags tunefs umount +progs shutdown swapon ttyflags tunefs umount # shell scripts: fastboot ln dump rdump From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 21:01:02 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AB3B106568D; Tue, 29 Dec 2009 21:01:02 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 74A438FC12; Tue, 29 Dec 2009 21:01:00 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 4EE84A5DED5; Wed, 30 Dec 2009 05:00:49 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id Seb4xgu8F0sk; Wed, 30 Dec 2009 05:00:38 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 807B0A5DEC7; Wed, 30 Dec 2009 05:00:35 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=wrE1pUkmrWDWw+jo99o5sqSPFuubPsABmgkJ0h03bnMfB7nLJ0qEN7FX/3awnCpgf RtoMuFEk1kxe5JHAWLqXw== Message-ID: <4B3A6DEB.5070306@delphij.net> Date: Tue, 29 Dec 2009 13:00:27 -0800 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20091220 Thunderbird/3.0 ThunderBrowse/3.2.6.8 MIME-Version: 1.0 To: Rui Paulo References: <200912291947.nBTJlY7a034177@svn.freebsd.org> In-Reply-To: <200912291947.nBTJlY7a034177@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r201209 - in head/sys: conf contrib/dev/iwn dev/iwn modules/iwnfw modules/iwnfw/iwn1000 modules/iwnfw/iwn4965 modules/iwnfw/iwn5000 modules/iwnfw/iwn6000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: 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, 29 Dec 2009 21:01:02 -0000 On 2009/12/29 11:47, Rui Paulo wrote: > Author: rpaulo > Date: Tue Dec 29 19:47:34 2009 > New Revision: 201209 > URL: http://svn.freebsd.org/changeset/base/201209 > > Log: > iwn(4) update. Notable changes: > * new firmware > * untested support for 1000 and 6000 series > * bgscan support > * remove unnecessary RXON changes > * allow setting of country/regdomain by enforcing channel flags read > from the EEPROM > * suspend/resume fixes > * RF kill switch fixes > * LED adjustments > * several bus_dma*() related fixes > * addressed some LORs > * many other bug fixes > > Submitted by: Bernhard Schmidt > Obtained from: Brandon Gooch (LED > related changes), Benjamin Kaduk > (LOR fixes), OpenBSD Thanks! -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 21:03:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBECB106566B; Tue, 29 Dec 2009 21:03:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAEB38FC13; Tue, 29 Dec 2009 21:03:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTL3ag6035949; Tue, 29 Dec 2009 21:03:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTL3aw2035945; Tue, 29 Dec 2009 21:03:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912292103.nBTL3aw2035945@svn.freebsd.org> From: John Baldwin Date: Tue, 29 Dec 2009 21:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201215 - in head: etc etc/defaults share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 21:03:37 -0000 Author: jhb Date: Tue Dec 29 21:03:36 2009 New Revision: 201215 URL: http://svn.freebsd.org/changeset/base/201215 Log: Add support for configuring vlan(4) interfaces as child devices similar to wlan(4) interfaces. vlan(4) interfaces are listed via a new 'vlans_' variable. If a vlan interface is a number, then that number is treated as the vlan tag for the interface and the interface will be named '.'. Otherwise, the vlan tag must be provided via a vlan parameter in a 'create_args_' variable. While I'm here, fix a few nits in rc.conf(5) and mention create_args_ in the description of cloned_interfaces. Reviewed by: brooks MFC after: 2 weeks Modified: head/etc/defaults/rc.conf head/etc/network.subr head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Dec 29 20:30:50 2009 (r201214) +++ head/etc/defaults/rc.conf Tue Dec 29 21:03:36 2009 (r201215) @@ -213,6 +213,8 @@ ifconfig_lo0="inet 127.0.0.1" # default #ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry #ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. +#vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device +#create_arg_vlan0="vlan 102" # vlan tag for vlan0 device #wlans_ath0="wlan0" # wlan(4) interfaces for ath0 device #wlandebug_wlan0="scan+auth+assoc" # Set debug flags with wlanddebug(8) #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Tue Dec 29 20:30:50 2009 (r201214) +++ head/etc/network.subr Tue Dec 29 21:03:36 2009 (r201215) @@ -971,7 +971,7 @@ clone_down() # childif_create() { - local cfg child child_wlans create_args debug_flags ifn i + local cfg child child_vlans child_wlans create_args debug_flags ifn i cfg=1 ifn=$1 @@ -999,6 +999,32 @@ childif_create() fi done + # Create vlan interfaces + child_vlans=`get_if_var $ifn vlans_IF` + + if [ -n "${child_vlans}" ]; then + load_kld if_vlan + fi + + for child in ${child_vlans}; do + if expr $child : '[1-9][0-9]*$' >/dev/null 2>&1; then + child="${ifn}.${child}" + create_args=`get_if_var $child create_args_IF` + ifconfig $child create ${create_args} && cfg=0 + else + create_args="vlandev $ifn `get_if_var $child create_args_IF`" + if expr $child : 'vlan[0-9][0-9]*$' >/dev/null 2>&1; then + ifconfig $child create ${create_args} && cfg=0 + else + i=`ifconfig vlan create ${create_args}` + ifconfig $i name $child && cfg=0 + fi + fi + if autoif $child; then + ifn_start $child + fi + done + return ${cfg} } @@ -1007,11 +1033,31 @@ childif_create() # childif_destroy() { - local cfg child child_wlans ifn + local cfg child child_vlans child_wlans ifn cfg=1 child_wlans="`get_if_var $ifn wlans_IF` `get_if_var $ifn vaps_IF`" for child in ${child_wlans}; do + if ! ifexists $child; then + continue + fi + if autoif $child; then + ifn_stop $child + fi + ifconfig $child destroy && cfg=0 + done + + child_vlans=`get_if_var $ifn vlans_IF` + for child in ${child_vlans}; do + if expr $child : '[1-9][0-9]*$' >/dev/null 2>&1; then + child="${ifn}.${child}" + fi + if ! ifexists $child; then + continue + fi + if autoif $child; then + ifn_stop $child + fi ifconfig $child destroy && cfg=0 done Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Tue Dec 29 20:30:50 2009 (r201214) +++ head/share/man/man5/rc.conf.5 Tue Dec 29 21:03:36 2009 (r201215) @@ -1156,6 +1156,45 @@ and variables. .Pp If a +.Va vlans_ Ns Aq Ar interface +variable is set, +a +.Xr vlan 4 +interface will be created for each item in the list with the +.Ar vlandev +argument set to +.Ar interface . +If a vlan interface's name is a number, +then that number is used as the vlan tag and the new vlan interface is +named +.Ar interface . Ns Ar tag . +Otherwise, +the vlan tag must be specified via a +.Va vlan +parameter in the +.Va create_args_ Ns Aq Ar interface +variable. +.Pp +To create a vlan device named +.Li em0.101 +on +.Li em0 +with the vlan tag 101: +.Bd -literal +vlans_em0="101" +.Ed +.Pp +To create a vlan device named +.Li myvlan +on +.Li em0 +with the vlan tag 102: +.Bd -literal +vlans_em0="myvlan" +create_args_myvlan="vlan 102" +.Ed +.Pp +If a .Va wlans_ Ns Aq Ar interface variable is set, an @@ -1222,7 +1261,7 @@ Finally, you can add options in this variable, in addition to the .Pa /etc/start_if. Ns Aq Ar interface file. -For instance, configure an +For instance, to configure an .Xr ath 4 wireless device in station mode with an address obtained via DHCP, using WPA authentication and 802.11b mode, it is @@ -1244,7 +1283,7 @@ This is intended to replace the no longe .Va pccard_ifconfig variable. .Pp -It is also possible to rename interface by doing: +It is also possible to rename an interface by doing: .Bd -literal ifconfig_ed0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" @@ -1355,6 +1394,12 @@ the IPv6-preferred one is used. Default .It Va cloned_interfaces .Pq Vt str Set to the list of clonable network interfaces to create on this host. +Further cloning arguments may be passed to the +.Xr ifconfig 8 +.Cm create +command for each interface by setting the +.Va create_args_ Ns Aq Ar interface +variable. Entries in .Va cloned_interfaces are automatically appended to From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 21:06:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A351065679; Tue, 29 Dec 2009 21:06:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 094578FC16; Tue, 29 Dec 2009 21:06:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTL6n6W036068; Tue, 29 Dec 2009 21:06:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTL6nxQ036066; Tue, 29 Dec 2009 21:06:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912292106.nBTL6nxQ036066@svn.freebsd.org> From: John Baldwin Date: Tue, 29 Dec 2009 21:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201216 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 21:06:50 -0000 Author: jhb Date: Tue Dec 29 21:06:49 2009 New Revision: 201216 URL: http://svn.freebsd.org/changeset/base/201216 Log: Remove a trailing reference to the obsolete vaps_ variable. Reviewed by: brooks MFC after: 3 days Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Tue Dec 29 21:03:36 2009 (r201215) +++ head/etc/network.subr Tue Dec 29 21:06:49 2009 (r201216) @@ -1036,7 +1036,7 @@ childif_destroy() local cfg child child_vlans child_wlans ifn cfg=1 - child_wlans="`get_if_var $ifn wlans_IF` `get_if_var $ifn vaps_IF`" + child_wlans=`get_if_var $ifn wlans_IF` for child in ${child_wlans}; do if ! ifexists $child; then continue From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 21:07:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29CF71065698; Tue, 29 Dec 2009 21:07:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1949B8FC29; Tue, 29 Dec 2009 21:07:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTL7HqZ036116; Tue, 29 Dec 2009 21:07:17 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTL7HOd036112; Tue, 29 Dec 2009 21:07:17 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912292107.nBTL7HOd036112@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 21:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201217 - in head: libexec/rtld-aout sbin/ldconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 21:07:18 -0000 Author: ed Date: Tue Dec 29 21:07:17 2009 New Revision: 201217 URL: http://svn.freebsd.org/changeset/base/201217 Log: ANSIfy ldconfig and the aout bits it still uses from rtld-aout. (Why is aout support still there?) Modified: head/libexec/rtld-aout/shlib.c head/libexec/rtld-aout/support.c head/sbin/ldconfig/ldconfig.c Modified: head/libexec/rtld-aout/shlib.c ============================================================================== --- head/libexec/rtld-aout/shlib.c Tue Dec 29 21:06:49 2009 (r201216) +++ head/libexec/rtld-aout/shlib.c Tue Dec 29 21:07:17 2009 (r201217) @@ -82,8 +82,7 @@ add_search_dir(const char *name) } void -add_search_path(path) -char *path; +add_search_path(char *path) { register char *cp, *dup; @@ -98,7 +97,7 @@ char *path; } void -std_search_path() +std_search_path(void) { int i, n; @@ -115,9 +114,7 @@ std_search_path() */ int -getdewey(dewey, cp) -int dewey[]; -char *cp; +getdewey(int dewey[], char *cp) { int i, n; @@ -142,9 +139,7 @@ char *cp; * Return 0 if equal. */ int -cmpndewey(d1, n1, d2, n2) -int d1[], d2[]; -int n1, n2; +cmpndewey(int d1[], int n1, int d2[], int n2) { register int i; @@ -185,10 +180,7 @@ int n1, n2; */ char * -findshlib(name, majorp, minorp, do_dot_a) -char *name; -int *majorp, *minorp; -int do_dot_a; +findshlib(char *name, int *majorp, int *minorp, int do_dot_a) { int i; @@ -212,8 +204,7 @@ int do_dot_a; */ char * -find_lib_file(name) - const char *name; +find_lib_file(const char *name) { int i; @@ -261,12 +252,7 @@ find_lib_file(name) */ char * -search_lib_dir(dir, name, majorp, minorp, do_dot_a) - char *dir; - char *name; - int *majorp; - int *minorp; - int do_dot_a; +search_lib_dir(char *dir, char *name, int *majorp, int *minorp, int do_dot_a) { size_t namelen; DIR *dd; Modified: head/libexec/rtld-aout/support.c ============================================================================== --- head/libexec/rtld-aout/support.c Tue Dec 29 21:06:49 2009 (r201216) +++ head/libexec/rtld-aout/support.c Tue Dec 29 21:07:17 2009 (r201217) @@ -38,8 +38,7 @@ #include "support.h" char * -concat(s1, s2, s3) - const char *s1, *s2, *s3; +concat(const char *s1, const char *s2, const char *s3) { int len = 1; char *s; @@ -61,8 +60,7 @@ concat(s1, s2, s3) } void * -xmalloc(n) - size_t n; +xmalloc(size_t n) { char *p = malloc(n); @@ -73,9 +71,7 @@ xmalloc(n) } void * -xrealloc(p, n) - void *p; - size_t n; +xrealloc(void *p, size_t n) { p = realloc(p, n); Modified: head/sbin/ldconfig/ldconfig.c ============================================================================== --- head/sbin/ldconfig/ldconfig.c Tue Dec 29 21:06:49 2009 (r201216) +++ head/sbin/ldconfig/ldconfig.c Tue Dec 29 21:07:17 2009 (r201217) @@ -222,7 +222,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: ldconfig [-32] [-aout | -elf] [-Rimrsv] [-f hints_file] [directory | file ...]\n"); @@ -230,9 +230,7 @@ usage() } int -dofile(fname, silent) -char *fname; -int silent; +dofile(char *fname, int silent) { FILE *hfp; char buf[MAXPATHLEN]; @@ -269,9 +267,7 @@ int silent; } int -dodir(dir, silent) -char *dir; -int silent; +dodir(char *dir, int silent) { DIR *dd; struct dirent *dp; @@ -328,9 +324,7 @@ int silent; } static void -enter(dir, file, name, dewey, ndewey) -char *dir, *file, *name; -int dewey[], ndewey; +enter(char *dir, char *file, char *name, int dewey[], int ndewey) { struct shlib_list *shp; @@ -391,7 +385,7 @@ hinthash(char *cp, int vmajor) } int -buildhints() +buildhints(void) { struct hints_header hdr; struct hints_bucket *blist; @@ -523,7 +517,7 @@ buildhints() } static int -readhints() +readhints(void) { int fd; void *addr; @@ -623,7 +617,7 @@ readhints() } static void -listhints() +listhints(void) { struct shlib_list *shp; int i; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 21:41:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F389D1065694; Tue, 29 Dec 2009 21:41:38 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by mx1.freebsd.org (Postfix) with ESMTP id BF3B38FC0C; Tue, 29 Dec 2009 21:41:38 +0000 (UTC) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 1076AC9197; Tue, 29 Dec 2009 16:41:38 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Tue, 29 Dec 2009 16:41:38 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=BGi/qGbTtw1z5NN4ErZj81lDX3g=; b=fdfoOJumjKnjSGPbixiMdoOVmyplmLjyNAcTB1patMTNy/9ii/03eFIZjzIHq3i0zulfY4xcYvOf5QVzEx66RGi9LecQXQIK6N/HxyoegRaKF7E6fDrjv9TYcCGAnhgXpjqcwLoAIGyz5LHTod8JhepqZ6HU5cz+LL1rAMOkkIU= X-Sasl-enc: YkcGntdtBXSjozU6Qvi4Dth8da+7TvDdGTok7n45F426 1262122897 Received: from [192.168.123.18] (cpc2-dals7-0-0-cust253.hari.cable.virginmedia.com [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 6497539116; Tue, 29 Dec 2009 16:41:37 -0500 (EST) Message-ID: <4B3A778F.90508@incunabulum.net> Date: Tue, 29 Dec 2009 21:41:35 +0000 From: Bruce Simpson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Konstantin Belousov References: <200912291558.nBTFwAXE028924@svn.freebsd.org> In-Reply-To: <200912291558.nBTFwAXE028924@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201204 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 21:41:39 -0000 On 29/12/2009 15:58, Konstantin Belousov wrote: > Author: kib > Date: Tue Dec 29 15:58:10 2009 > New Revision: 201204 > URL: http://svn.freebsd.org/changeset/base/201204 > > Log: > Document _FAST and _PRECISE clocks. > I saw a speed increase with CLOCK_MONOTONIC_FAST vs CLOCK_MONOTONIC during pmcstat and kcachegrind profiling of a process which makes a lot of calls to clock_gettime(). Thanks for doing this. best, BMS From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 21:49:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2869C106568D; Tue, 29 Dec 2009 21:49:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18A1C8FC13; Tue, 29 Dec 2009 21:49:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTLnBfk037255; Tue, 29 Dec 2009 21:49:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTLnBAF037252; Tue, 29 Dec 2009 21:49:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912292149.nBTLnBAF037252@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Dec 2009 21:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201222 - head/sys/dev/siis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 21:49:12 -0000 Author: mav Date: Tue Dec 29 21:49:11 2009 New Revision: 201222 URL: http://svn.freebsd.org/changeset/base/201222 Log: Usually these controllers are able to automatically decode command code to get required command protocol. But they have no idea about new commands, such as DATA SET MANAGEMENT (TRIM). As soon as this info any way provided by CAM, give controller specific instructions. Modified: head/sys/dev/siis/siis.c head/sys/dev/siis/siis.h Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Tue Dec 29 21:41:55 2009 (r201221) +++ head/sys/dev/siis/siis.c Tue Dec 29 21:49:11 2009 (r201222) @@ -1000,13 +1000,29 @@ siis_execute_transaction(struct siis_slo ctp->protocol_override = 0; ctp->transfer_count = 0; /* Special handling for Soft Reset command. */ - if ((ccb->ccb_h.func_code == XPT_ATA_IO) && - (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL)) { - ctp->control |= htole16(SIIS_PRB_SOFT_RESET); + if (ccb->ccb_h.func_code == XPT_ATA_IO) { + if (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) { + ctp->control |= htole16(SIIS_PRB_SOFT_RESET); + } else { + ctp->control |= htole16(SIIS_PRB_PROTOCOL_OVERRIDE); + if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { + ctp->protocol_override |= + htole16(SIIS_PRB_PROTO_NCQ); + } + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { + ctp->protocol_override |= + htole16(SIIS_PRB_PROTO_READ); + } else + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) { + ctp->protocol_override |= + htole16(SIIS_PRB_PROTO_WRITE); + } + } } else if (ccb->ccb_h.func_code == XPT_SCSI_IO) { - if (ccb->ccb_h.flags & CAM_DIR_IN) + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) ctp->control |= htole16(SIIS_PRB_PACKET_READ); - if (ccb->ccb_h.flags & CAM_DIR_OUT) + else + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) ctp->control |= htole16(SIIS_PRB_PACKET_WRITE); } /* Setup the FIS for this request */ Modified: head/sys/dev/siis/siis.h ============================================================================== --- head/sys/dev/siis/siis.h Tue Dec 29 21:41:55 2009 (r201221) +++ head/sys/dev/siis/siis.h Tue Dec 29 21:49:11 2009 (r201222) @@ -304,6 +304,12 @@ struct siis_cmd { #define SIIS_PRB_INTERRUPT_MASK 0x0040 #define SIIS_PRB_SOFT_RESET 0x0080 u_int16_t protocol_override; +#define SIIS_PRB_PROTO_PACKET 0x0001 +#define SIIS_PRB_PROTO_TCQ 0x0002 +#define SIIS_PRB_PROTO_NCQ 0x0004 +#define SIIS_PRB_PROTO_READ 0x0008 +#define SIIS_PRB_PROTO_WRITE 0x0010 +#define SIIS_PRB_PROTO_TRANSPARENT 0x0020 u_int32_t transfer_count; u_int8_t fis[24]; union { From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 21:51:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41D0B1065670; Tue, 29 Dec 2009 21:51:29 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DD5A8FC20; Tue, 29 Dec 2009 21:51:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTLpTQJ037377; Tue, 29 Dec 2009 21:51:29 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTLpSFF037340; Tue, 29 Dec 2009 21:51:28 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200912292151.nBTLpSFF037340@svn.freebsd.org> From: Robert Noland Date: Tue, 29 Dec 2009 21:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201223 - in head/sys: amd64/amd64 arm/arm dev/adlink dev/agp dev/bktr dev/drm dev/fb dev/firewire dev/hifn dev/ksyms dev/sound/pcm dev/syscons dev/tdfx i386/i386 i386/xbox ia64/ia64 is... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 21:51:29 -0000 Author: rnoland Date: Tue Dec 29 21:51:28 2009 New Revision: 201223 URL: http://svn.freebsd.org/changeset/base/201223 Log: Update d_mmap() to accept vm_ooffset_t and vm_memattr_t. This replaces d_mmap() with the d_mmap2() implementation and also changes the type of offset to vm_ooffset_t. Purge d_mmap2(). All driver modules will need to be rebuilt since D_VERSION is also bumped. Reviewed by: jhb@ MFC after: Not in this lifetime... Modified: head/sys/amd64/amd64/mem.c head/sys/arm/arm/mem.c head/sys/dev/adlink/adlink.c head/sys/dev/agp/agp.c head/sys/dev/bktr/bktr_os.c head/sys/dev/drm/drm_vm.c head/sys/dev/fb/creator.c head/sys/dev/fb/fb.c head/sys/dev/fb/fbreg.h head/sys/dev/fb/machfb.c head/sys/dev/fb/s3_pci.c head/sys/dev/fb/vesa.c head/sys/dev/fb/vga.c head/sys/dev/fb/vgareg.h head/sys/dev/firewire/fwdev.c head/sys/dev/firewire/fwmem.c head/sys/dev/hifn/hifn7751.c head/sys/dev/ksyms/ksyms.c head/sys/dev/sound/pcm/dsp.c head/sys/dev/syscons/syscons.c head/sys/dev/tdfx/tdfx_pci.c head/sys/i386/i386/elan-mmcr.c head/sys/i386/i386/mem.c head/sys/i386/xbox/xboxfb.c head/sys/ia64/ia64/mem.c head/sys/isa/vga_isa.c head/sys/kern/kern_conf.c head/sys/kern/subr_devstat.c head/sys/kern/tty.c head/sys/mips/mips/mem.c head/sys/pc98/cbus/gdc.c head/sys/powerpc/ofw/ofw_syscons.c head/sys/powerpc/powerpc/mem.c head/sys/sys/conf.h head/sys/sys/ttydevsw.h head/sys/vm/device_pager.c Modified: head/sys/amd64/amd64/mem.c ============================================================================== --- head/sys/amd64/amd64/mem.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/amd64/amd64/mem.c Tue Dec 29 21:51:28 2009 (r201223) @@ -144,8 +144,8 @@ kmemphys: */ /* ARGSUSED */ int -memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, - int prot __unused) +memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot __unused, vm_memattr_t *memattr __unused) { if (dev2unit(dev) == CDEV_MINOR_MEM) *paddr = offset; Modified: head/sys/arm/arm/mem.c ============================================================================== --- head/sys/arm/arm/mem.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/arm/arm/mem.c Tue Dec 29 21:51:28 2009 (r201223) @@ -153,8 +153,8 @@ memrw(struct cdev *dev, struct uio *uio, /* ARGSUSED */ int -memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, - int prot __unused) +memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot __unused, vm_memattr_t *memattr __unused) { if (dev2unit(dev) == CDEV_MINOR_MEM) *paddr = offset; Modified: head/sys/dev/adlink/adlink.c ============================================================================== --- head/sys/dev/adlink/adlink.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/adlink/adlink.c Tue Dec 29 21:51:28 2009 (r201223) @@ -161,7 +161,8 @@ adlink_intr(void *arg) } static int -adlink_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) +adlink_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) { struct softc *sc; vm_offset_t o; Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/agp/agp.c Tue Dec 29 21:51:28 2009 (r201223) @@ -868,7 +868,8 @@ agp_ioctl(struct cdev *kdev, u_long cmd, } static int -agp_mmap(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot) +agp_mmap(struct cdev *kdev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { device_t dev = kdev->si_drv1; struct agp_softc *sc = device_get_softc(dev); Modified: head/sys/dev/bktr/bktr_os.c ============================================================================== --- head/sys/dev/bktr/bktr_os.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/bktr/bktr_os.c Tue Dec 29 21:51:28 2009 (r201223) @@ -794,7 +794,8 @@ bktr_ioctl( struct cdev *dev, ioctl_cmd_ * */ static int -bktr_mmap( struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot ) +bktr_mmap( struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr ) { int unit; bktr_ptr_t bktr; Modified: head/sys/dev/drm/drm_vm.c ============================================================================== --- head/sys/dev/drm/drm_vm.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/drm/drm_vm.c Tue Dec 29 21:51:28 2009 (r201223) @@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$"); #include "dev/drm/drmP.h" #include "dev/drm/drm.h" -int drm_mmap(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr, - int prot) +int drm_mmap(struct cdev *kdev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { struct drm_device *dev = drm_get_device_from_kdev(kdev); struct drm_file *file_priv = NULL; Modified: head/sys/dev/fb/creator.c ============================================================================== --- head/sys/dev/fb/creator.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/fb/creator.c Tue Dec 29 21:51:28 2009 (r201223) @@ -692,8 +692,8 @@ creator_blank_display(video_adapter_t *a } static int -creator_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr, - int prot) +creator_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { return (EINVAL); @@ -1048,8 +1048,8 @@ creator_fb_ioctl(struct cdev *dev, u_lon } static int -creator_fb_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, - int prot) +creator_fb_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { struct creator_softc *sc; int i; Modified: head/sys/dev/fb/fb.c ============================================================================== --- head/sys/dev/fb/fb.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/fb/fb.c Tue Dec 29 21:51:28 2009 (r201223) @@ -511,10 +511,10 @@ int genfbioctl(genfb_softc_t *sc, video_ return error; } -int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp, vm_offset_t offset, - vm_offset_t *paddr, int prot) +int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp, vm_ooffset_t offset, + vm_offset_t *paddr, int prot, vm_memattr_t *memattr) { - return vidd_mmap(adp, offset, paddr, prot); + return vidd_mmap(adp, offset, paddr, prot, memattr); } #endif /* FB_INSTALL_CDEV */ Modified: head/sys/dev/fb/fbreg.h ============================================================================== --- head/sys/dev/fb/fbreg.h Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/fb/fbreg.h Tue Dec 29 21:51:28 2009 (r201223) @@ -131,8 +131,8 @@ typedef int vi_blank_display_t(video_ada #define V_DISPLAY_STAND_BY 2 #define V_DISPLAY_SUSPEND 3 */ -typedef int vi_mmap_t(video_adapter_t *adp, vm_offset_t offset, - vm_paddr_t *paddr, int prot); +typedef int vi_mmap_t(video_adapter_t *adp, vm_ooffset_t offset, + vm_paddr_t *paddr, int prot, vm_memattr_t *memattr); typedef int vi_ioctl_t(video_adapter_t *adp, u_long cmd, caddr_t data); typedef int vi_clear_t(video_adapter_t *adp); typedef int vi_fill_rect_t(video_adapter_t *adp, int val, int x, int y, @@ -228,8 +228,9 @@ typedef struct video_switch { (height), (celsize), (blink)) #define vidd_blank_display(adp, mode) \ (*vidsw[(adp)->va_index]->blank_display)((adp), (mode)) -#define vidd_mmap(adp, offset, paddr, prot) \ - (*vidsw[(adp)->va_index]->mmap)((adp), (offset), (paddr), (prot)) +#define vidd_mmap(adp, offset, paddr, prot, memattr) \ + (*vidsw[(adp)->va_index]->mmap)((adp), (offset), (paddr), \ + (prot), (memattr)) #define vidd_ioctl(adp, cmd, data) \ (*vidsw[(adp)->va_index]->ioctl)((adp), (cmd), (data)) #define vidd_clear(adp) \ @@ -317,7 +318,8 @@ int genfbwrite(genfb_softc_t *sc, video int genfbioctl(genfb_softc_t *sc, video_adapter_t *adp, u_long cmd, caddr_t arg, int flag, struct thread *td); int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp, - vm_offset_t offset, vm_offset_t *paddr, int prot); + vm_ooffset_t offset, vm_offset_t *paddr, + int prot, vm_memattr_t *memattr); #endif /* FB_INSTALL_CDEV */ Modified: head/sys/dev/fb/machfb.c ============================================================================== --- head/sys/dev/fb/machfb.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/fb/machfb.c Tue Dec 29 21:51:28 2009 (r201223) @@ -837,8 +837,8 @@ machfb_blank_display(video_adapter_t *ad } static int -machfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr, - int prot) +machfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { struct machfb_softc *sc; video_info_t *vi; Modified: head/sys/dev/fb/s3_pci.c ============================================================================== --- head/sys/dev/fb/s3_pci.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/fb/s3_pci.c Tue Dec 29 21:51:28 2009 (r201223) @@ -388,10 +388,10 @@ s3lfb_blank_display(video_adapter_t *adp } static int -s3lfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr, - int prot) +s3lfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { - return (*prevvidsw->mmap)(adp, offset, paddr, prot); + return (*prevvidsw->mmap)(adp, offset, paddr, prot, memattr); } static int Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/fb/vesa.c Tue Dec 29 21:51:28 2009 (r201223) @@ -1528,12 +1528,12 @@ vesa_blank_display(video_adapter_t *adp, } static int -vesa_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr, - int prot) +vesa_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { #if VESA_DEBUG > 0 - printf("vesa_mmap(): window:0x%tx, buffer:0x%tx, offset:0x%tx\n", + printf("vesa_mmap(): window:0x%tx, buffer:0x%tx, offset:0x%jx\n", adp->va_info.vi_window, adp->va_info.vi_buffer, offset); #endif @@ -1546,7 +1546,7 @@ vesa_mmap(video_adapter_t *adp, vm_offse *paddr = adp->va_info.vi_buffer + offset; return (0); } - return ((*prevvidsw->mmap)(adp, offset, paddr, prot)); + return ((*prevvidsw->mmap)(adp, offset, paddr, prot, memattr)); } static int Modified: head/sys/dev/fb/vga.c ============================================================================== --- head/sys/dev/fb/vga.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/fb/vga.c Tue Dec 29 21:51:28 2009 (r201223) @@ -144,10 +144,10 @@ vga_ioctl(struct cdev *dev, vga_softc_t } int -vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_offset_t offset, vm_offset_t *paddr, - int prot) +vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_ooffset_t offset, + vm_offset_t *paddr, int prot, vm_memattr_t *memattr) { - return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot); + return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot, memattr); } #endif /* FB_INSTALL_CDEV */ @@ -2465,8 +2465,8 @@ vga_blank_display(video_adapter_t *adp, * all adapters */ static int -vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr, - int prot) +vga_mmap_buf(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { if (adp->va_info.vi_flags & V_INFO_LINEAR) return -1; Modified: head/sys/dev/fb/vgareg.h ============================================================================== --- head/sys/dev/fb/vgareg.h Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/fb/vgareg.h Tue Dec 29 21:51:28 2009 (r201223) @@ -88,8 +88,8 @@ int vga_read(struct cdev *dev, vga_soft int vga_write(struct cdev *dev, vga_softc_t *sc, struct uio *uio, int flag); int vga_ioctl(struct cdev *dev, vga_softc_t *sc, u_long cmd, caddr_t arg, int flag, struct thread *td); -int vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_offset_t offset, - vm_offset_t *paddr, int prot); +int vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_ooffset_t offset, + vm_offset_t *paddr, int prot, vm_memattr_t *memattr); #endif extern int (*vga_sub_configure)(int flags); Modified: head/sys/dev/firewire/fwdev.c ============================================================================== --- head/sys/dev/firewire/fwdev.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/firewire/fwdev.c Tue Dec 29 21:51:28 2009 (r201223) @@ -884,7 +884,8 @@ static int #if defined(__DragonFly__) || __FreeBSD_version < 500102 fw_mmap (struct cdev *dev, vm_offset_t offset, int nproto) #else -fw_mmap (struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nproto) +fw_mmap (struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nproto, vm_memattr_t *memattr) #endif { @@ -892,7 +893,7 @@ fw_mmap (struct cdev *dev, vm_offset_t o #if defined(__DragonFly__) || __FreeBSD_version < 500102 return fwmem_mmap(dev, offset, nproto); #else - return fwmem_mmap(dev, offset, paddr, nproto); + return fwmem_mmap(dev, offset, paddr, nproto, memattr); #endif return EINVAL; Modified: head/sys/dev/firewire/fwmem.c ============================================================================== --- head/sys/dev/firewire/fwmem.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/firewire/fwmem.c Tue Dec 29 21:51:28 2009 (r201223) @@ -445,7 +445,8 @@ int #if defined(__DragonFly__) || __FreeBSD_version < 500102 fwmem_mmap (struct cdev *dev, vm_offset_t offset, int nproto) #else -fwmem_mmap (struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nproto) +fwmem_mmap (struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nproto, vm_memattr_t *memattr) #endif { return EINVAL; Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/hifn/hifn7751.c Tue Dec 29 21:51:28 2009 (r201223) @@ -2929,8 +2929,8 @@ hifn_write_reg_1(struct hifn_softc *sc, * */ static int -vulcanpk_mmap(struct cdev *dev, vm_offset_t offset, - vm_paddr_t *paddr, int nprot) +vulcanpk_mmap(struct cdev *dev, vm_ooffset_t offset, + vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) { struct hifn_softc *sc; vm_paddr_t pd; @@ -2942,7 +2942,8 @@ vulcanpk_mmap(struct cdev *dev, vm_offse b = rman_get_virtual(sc->sc_bar1res); #if 0 - printf("vpk mmap: %p(%08x) offset=%d\n", b, pd, offset); + printf("vpk mmap: %p(%016llx) offset=%lld\n", b, + (unsigned long long)pd, offset); hexdump(b, HIFN_1_PUB_MEMEND, "vpk", 0); #endif Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/ksyms/ksyms.c Tue Dec 29 21:51:28 2009 (r201223) @@ -589,8 +589,8 @@ ksyms_ioctl(struct cdev *dev, u_long cmd /* ARGUSED */ static int -ksyms_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, - int prot __unused) +ksyms_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot __unused, vm_memattr_t *memattr __unused) { struct ksyms_softc *sc; int error; Modified: head/sys/dev/sound/pcm/dsp.c ============================================================================== --- head/sys/dev/sound/pcm/dsp.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/sound/pcm/dsp.c Tue Dec 29 21:51:28 2009 (r201223) @@ -2179,7 +2179,8 @@ dsp_poll(struct cdev *i_dev, int events, } static int -dsp_mmap(struct cdev *i_dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) +dsp_mmap(struct cdev *i_dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) { struct snddev_info *d; struct pcm_channel *wrch, *rdch, *c; Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/syscons/syscons.c Tue Dec 29 21:51:28 2009 (r201223) @@ -3431,14 +3431,15 @@ next_code: } static int -sctty_mmap(struct tty *tp, vm_offset_t offset, vm_paddr_t *paddr, int nprot) +sctty_mmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) { scr_stat *scp; scp = sc_get_stat(tp); if (scp != scp->sc->cur_scp) return -1; - return vidd_mmap(scp->sc->adp, offset, paddr, nprot); + return vidd_mmap(scp->sc->adp, offset, paddr, nprot, memattr); } static int Modified: head/sys/dev/tdfx/tdfx_pci.c ============================================================================== --- head/sys/dev/tdfx/tdfx_pci.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/dev/tdfx/tdfx_pci.c Tue Dec 29 21:51:28 2009 (r201223) @@ -421,7 +421,8 @@ tdfx_close(struct cdev *dev, int fflag, } static int -tdfx_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) +tdfx_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) { /* * mmap(2) is called by a user process to request that an area of memory Modified: head/sys/i386/i386/elan-mmcr.c ============================================================================== --- head/sys/i386/i386/elan-mmcr.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/i386/i386/elan-mmcr.c Tue Dec 29 21:51:28 2009 (r201223) @@ -416,7 +416,8 @@ elan_watchdog(void *foo __unused, u_int } static int -elan_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) +elan_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) { if (offset >= 0x1000) Modified: head/sys/i386/i386/mem.c ============================================================================== --- head/sys/i386/i386/mem.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/i386/i386/mem.c Tue Dec 29 21:51:28 2009 (r201223) @@ -163,8 +163,8 @@ memrw(struct cdev *dev, struct uio *uio, */ /* ARGSUSED */ int -memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, - int prot __unused) +memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot __unused, vm_memattr_t *memattr __unused) { if (dev2unit(dev) == CDEV_MINOR_MEM) *paddr = offset; Modified: head/sys/i386/xbox/xboxfb.c ============================================================================== --- head/sys/i386/xbox/xboxfb.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/i386/xbox/xboxfb.c Tue Dec 29 21:51:28 2009 (r201223) @@ -521,8 +521,8 @@ xboxfb_blank_display(video_adapter_t *ad } static int -xboxfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr, - int prot) +xboxfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { return (EINVAL); } Modified: head/sys/ia64/ia64/mem.c ============================================================================== --- head/sys/ia64/ia64/mem.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/ia64/ia64/mem.c Tue Dec 29 21:51:28 2009 (r201223) @@ -148,7 +148,8 @@ kmemphys: * instead of going through read/write */ int -memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) +memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { /* * /dev/mem is the only one that makes sense through this Modified: head/sys/isa/vga_isa.c ============================================================================== --- head/sys/isa/vga_isa.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/isa/vga_isa.c Tue Dec 29 21:51:28 2009 (r201223) @@ -278,9 +278,11 @@ isavga_ioctl(struct cdev *dev, u_long cm } static int -isavga_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) +isavga_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { - return (vga_mmap(dev, VGA_SOFTC(VGA_UNIT(dev)), offset, paddr, prot)); + return (vga_mmap(dev, VGA_SOFTC(VGA_UNIT(dev)), offset, paddr, prot, + memattr)); } #endif /* FB_INSTALL_CDEV */ Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/kern/kern_conf.c Tue Dec 29 21:51:28 2009 (r201223) @@ -302,7 +302,7 @@ static struct cdevsw dead_cdevsw = { #define no_read (d_read_t *)enodev #define no_write (d_write_t *)enodev #define no_ioctl (d_ioctl_t *)enodev -#define no_mmap (d_mmap2_t *)enodev +#define no_mmap (d_mmap_t *)enodev #define no_kqfilter (d_kqfilter_t *)enodev #define no_mmap_single (d_mmap_single_t *)enodev @@ -469,7 +469,7 @@ giant_kqfilter(struct cdev *dev, struct } static int -giant_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot, +giant_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) { struct cdevsw *dsw; @@ -479,11 +479,8 @@ giant_mmap(struct cdev *dev, vm_offset_t if (dsw == NULL) return (ENXIO); mtx_lock(&Giant); - if (dsw->d_gianttrick->d_flags & D_MMAP2) - retval = dsw->d_gianttrick->d_mmap2(dev, offset, paddr, nprot, - memattr); - else - retval = dsw->d_gianttrick->d_mmap(dev, offset, paddr, nprot); + retval = dsw->d_gianttrick->d_mmap(dev, offset, paddr, nprot, + memattr); mtx_unlock(&Giant); dev_relthread(dev); return (retval); @@ -595,8 +592,7 @@ prep_cdevsw(struct cdevsw *devsw) return; } - if (devsw->d_version != D_VERSION_01 && - devsw->d_version != D_VERSION_02) { + if (devsw->d_version != D_VERSION_03) { printf( "WARNING: Device driver \"%s\" has wrong version %s\n", devsw->d_name == NULL ? "???" : devsw->d_name, @@ -608,18 +604,16 @@ prep_cdevsw(struct cdevsw *devsw) devsw->d_ioctl = dead_ioctl; devsw->d_poll = dead_poll; devsw->d_mmap = dead_mmap; + devsw->d_mmap_single = dead_mmap_single; devsw->d_strategy = dead_strategy; devsw->d_dump = dead_dump; devsw->d_kqfilter = dead_kqfilter; } - if (devsw->d_version == D_VERSION_01) - devsw->d_mmap_single = NULL; if (devsw->d_flags & D_NEEDGIANT) { if (devsw->d_gianttrick == NULL) { memcpy(dsw2, devsw, sizeof *dsw2); devsw->d_gianttrick = dsw2; - devsw->d_flags |= D_MMAP2; dsw2 = NULL; } } @@ -640,7 +634,7 @@ prep_cdevsw(struct cdevsw *devsw) FIXUP(d_write, no_write, giant_write); FIXUP(d_ioctl, no_ioctl, giant_ioctl); FIXUP(d_poll, no_poll, giant_poll); - FIXUP(d_mmap2, no_mmap, giant_mmap); + FIXUP(d_mmap, no_mmap, giant_mmap); FIXUP(d_strategy, no_strategy, giant_strategy); FIXUP(d_kqfilter, no_kqfilter, giant_kqfilter); FIXUP(d_mmap_single, no_mmap_single, giant_mmap_single); Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/kern/subr_devstat.c Tue Dec 29 21:51:28 2009 (r201223) @@ -449,7 +449,8 @@ static TAILQ_HEAD(, statspage) pagelist static MALLOC_DEFINE(M_DEVSTAT, "devstat", "Device statistics"); static int -devstat_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) +devstat_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) { struct statspage *spp; Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/kern/tty.c Tue Dec 29 21:51:28 2009 (r201223) @@ -603,7 +603,8 @@ ttydev_poll(struct cdev *dev, int events } static int -ttydev_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) +ttydev_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) { struct tty *tp = dev->si_drv1; int error; @@ -613,7 +614,7 @@ ttydev_mmap(struct cdev *dev, vm_offset_ error = ttydev_enter(tp); if (error) return (-1); - error = ttydevsw_mmap(tp, offset, paddr, nprot); + error = ttydevsw_mmap(tp, offset, paddr, nprot, memattr); tty_unlock(tp); return (error); @@ -905,8 +906,8 @@ ttydevsw_defmodem(struct tty *tp, int si } static int -ttydevsw_defmmap(struct tty *tp, vm_offset_t offset, vm_paddr_t *paddr, - int nprot) +ttydevsw_defmmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) { return (-1); Modified: head/sys/mips/mips/mem.c ============================================================================== --- head/sys/mips/mips/mem.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/mips/mips/mem.c Tue Dec 29 21:51:28 2009 (r201223) @@ -173,7 +173,8 @@ memrw(dev, uio, flags) /*ARGSUSED*/ int -memmmap(struct cdev *dev, vm_offset_t off, vm_paddr_t *paddr, int prot) +memmmap(struct cdev *dev, vm_ooffset_t off, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { return (EOPNOTSUPP); Modified: head/sys/pc98/cbus/gdc.c ============================================================================== --- head/sys/pc98/cbus/gdc.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/pc98/cbus/gdc.c Tue Dec 29 21:51:28 2009 (r201223) @@ -395,12 +395,13 @@ gdcioctl(struct cdev *dev, u_long cmd, c } static int -gdcmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) +gdcmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { gdc_softc_t *sc; sc = GDC_SOFTC(GDC_UNIT(dev)); - return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot); + return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot, memattr); } #endif /* FB_INSTALL_CDEV */ @@ -1337,8 +1338,8 @@ gdc_blank_display(video_adapter_t *adp, * Mmap frame buffer. */ static int -gdc_mmap_buf(video_adapter_t *adp, vm_offset_t offset, vm_offset_t *paddr, - int prot) +gdc_mmap_buf(video_adapter_t *adp, vm_ooffset_t offset, vm_offset_t *paddr, + int prot, vm_memattr_t *memattr) { /* FIXME: is this correct? XXX */ if (offset > VIDEO_BUF_SIZE - PAGE_SIZE) Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/powerpc/ofw/ofw_syscons.c Tue Dec 29 21:51:28 2009 (r201223) @@ -624,8 +624,8 @@ ofwfb_blank_display(video_adapter_t *adp } static int -ofwfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr, - int prot) +ofwfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { struct ofwfb_softc *sc; int i; Modified: head/sys/powerpc/powerpc/mem.c ============================================================================== --- head/sys/powerpc/powerpc/mem.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/powerpc/powerpc/mem.c Tue Dec 29 21:51:28 2009 (r201223) @@ -161,7 +161,8 @@ kmem_direct_mapped: v = uio->uio_offset; * instead of going through read/write */ int -memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) +memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) { /* * /dev/mem is the only one that makes sense through this Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/sys/conf.h Tue Dec 29 21:51:28 2009 (r201223) @@ -135,9 +135,7 @@ typedef int d_read_t(struct cdev *dev, s typedef int d_write_t(struct cdev *dev, struct uio *uio, int ioflag); typedef int d_poll_t(struct cdev *dev, int events, struct thread *td); typedef int d_kqfilter_t(struct cdev *dev, struct knote *kn); -typedef int d_mmap_t(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, - int nprot); -typedef int d_mmap2_t(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, +typedef int d_mmap_t(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr); typedef int d_mmap_single_t(struct cdev *cdev, vm_ooffset_t *offset, vm_size_t size, struct vm_object **object, int nprot); @@ -172,7 +170,6 @@ typedef int dumper_t( #define D_PSEUDO 0x00200000 /* make_dev() can return NULL */ #define D_NEEDGIANT 0x00400000 /* driver want Giant */ #define D_NEEDMINOR 0x00800000 /* driver uses clone_create() */ -#define D_MMAP2 0x01000000 /* driver uses d_mmap2() */ /* * Version numbers. @@ -180,7 +177,8 @@ typedef int dumper_t( #define D_VERSION_00 0x20011966 #define D_VERSION_01 0x17032005 /* Add d_uid,gid,mode & kind */ #define D_VERSION_02 0x28042009 /* Add d_mmap_single */ -#define D_VERSION D_VERSION_02 +#define D_VERSION_03 0x17122009 /* d_mmap takes memattr,vm_ooffset_t */ +#define D_VERSION D_VERSION_03 /* * Flags used for internal housekeeping @@ -201,10 +199,7 @@ struct cdevsw { d_write_t *d_write; d_ioctl_t *d_ioctl; d_poll_t *d_poll; - union { - d_mmap_t *old; - d_mmap2_t *new; - } __d_mmap; + d_mmap_t *d_mmap; d_strategy_t *d_strategy; dumper_t *d_dump; d_kqfilter_t *d_kqfilter; @@ -222,8 +217,6 @@ struct cdevsw { SLIST_ENTRY(cdevsw) postfree_list; } __d_giant; }; -#define d_mmap __d_mmap.old -#define d_mmap2 __d_mmap.new #define d_gianttrick __d_giant.gianttrick #define d_postfree_list __d_giant.postfree_list Modified: head/sys/sys/ttydevsw.h ============================================================================== --- head/sys/sys/ttydevsw.h Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/sys/ttydevsw.h Tue Dec 29 21:51:28 2009 (r201223) @@ -48,8 +48,8 @@ typedef int tsw_ioctl_t(struct tty *tp, struct thread *td); typedef int tsw_param_t(struct tty *tp, struct termios *t); typedef int tsw_modem_t(struct tty *tp, int sigon, int sigoff); -typedef int tsw_mmap_t(struct tty *tp, vm_offset_t offset, - vm_paddr_t * paddr, int nprot); +typedef int tsw_mmap_t(struct tty *tp, vm_ooffset_t offset, + vm_paddr_t * paddr, int nprot, vm_memattr_t *memattr); typedef void tsw_pktnotify_t(struct tty *tp, char event); typedef void tsw_free_t(void *softc); @@ -142,11 +142,12 @@ ttydevsw_modem(struct tty *tp, int sigon } static __inline int -ttydevsw_mmap(struct tty *tp, vm_offset_t offset, vm_paddr_t *paddr, int nprot) +ttydevsw_mmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) { MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_mmap(tp, offset, paddr, nprot); + return tp->t_devsw->tsw_mmap(tp, offset, paddr, nprot, memattr); } static __inline void Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Tue Dec 29 21:49:11 2009 (r201222) +++ head/sys/vm/device_pager.c Tue Dec 29 21:51:28 2009 (r201223) @@ -93,17 +93,6 @@ dev_pager_init() UMA_ZONE_NOFREE|UMA_ZONE_VM); } -static __inline int -dev_mmap(struct cdevsw *csw, struct cdev *dev, vm_offset_t offset, - vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) -{ - - if (csw->d_flags & D_MMAP2) - return (csw->d_mmap2(dev, offset, paddr, nprot, memattr)); - else - return (csw->d_mmap(dev, offset, paddr, nprot)); -} - /* * MPSAFE */ @@ -116,7 +105,7 @@ dev_pager_alloc(void *handle, vm_ooffset vm_pindex_t pindex; unsigned int npages; vm_paddr_t paddr; - vm_offset_t off; + vm_ooffset_t off; vm_memattr_t dummy; struct cdevsw *csw; @@ -145,7 +134,7 @@ dev_pager_alloc(void *handle, vm_ooffset */ npages = OFF_TO_IDX(size); for (off = foff; npages--; off += PAGE_SIZE) - if (dev_mmap(csw, dev, off, &paddr, (int)prot, &dummy) != 0) { + if (csw->d_mmap(dev, off, &paddr, (int)prot, &dummy) != 0) { dev_relthread(dev); return (NULL); } @@ -242,7 +231,7 @@ dev_pager_getpages(object, m, count, req td = curthread; fpop = td->td_fpop; td->td_fpop = NULL; - ret = dev_mmap(csw, dev, (vm_offset_t)offset << PAGE_SHIFT, &paddr, + ret = csw->d_mmap(dev, (vm_ooffset_t)offset << PAGE_SHIFT, &paddr, PROT_READ, &memattr); KASSERT(ret == 0, ("dev_pager_getpage: map function returns error")); td->td_fpop = fpop; From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 22:32:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 636DD1065672; Tue, 29 Dec 2009 22:32:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3ACCF8FC1D; Tue, 29 Dec 2009 22:32:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTMWiaL038285; Tue, 29 Dec 2009 22:32:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTMWihG038283; Tue, 29 Dec 2009 22:32:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912292232.nBTMWihG038283@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 22:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201224 - head/usr.bin/wall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 22:32:44 -0000 Author: ed Date: Tue Dec 29 22:32:43 2009 New Revision: 201224 URL: http://svn.freebsd.org/changeset/base/201224 Log: Add missing `void' keyword. Modified: head/usr.bin/wall/wall.c Modified: head/usr.bin/wall/wall.c ============================================================================== --- head/usr.bin/wall/wall.c Tue Dec 29 21:51:28 2009 (r201223) +++ head/usr.bin/wall/wall.c Tue Dec 29 22:32:43 2009 (r201224) @@ -180,7 +180,7 @@ main(int argc, char *argv[]) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: wall [-g group] [file]\n"); exit(1); From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 22:33:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A3FC1065692; Tue, 29 Dec 2009 22:33:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 119FE8FC22; Tue, 29 Dec 2009 22:33:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTMX7uC038344; Tue, 29 Dec 2009 22:33:07 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTMX7dk038342; Tue, 29 Dec 2009 22:33:07 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912292233.nBTMX7dk038342@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 22:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201225 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 22:33:08 -0000 Author: ed Date: Tue Dec 29 22:33:07 2009 New Revision: 201225 URL: http://svn.freebsd.org/changeset/base/201225 Log: Add missing `void' keyword. Modified: head/usr.bin/make/job.c Modified: head/usr.bin/make/job.c ============================================================================== --- head/usr.bin/make/job.c Tue Dec 29 22:32:43 2009 (r201224) +++ head/usr.bin/make/job.c Tue Dec 29 22:33:07 2009 (r201225) @@ -485,7 +485,7 @@ catch_child(int sig __unused) /** */ void -Proc_Init() +Proc_Init(void) { /* * Catch SIGCHLD so that we get kicked out of select() when we From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 22:33:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F7F7106568F; Tue, 29 Dec 2009 22:33:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA2258FC12; Tue, 29 Dec 2009 22:33:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTMXrQ5038394; Tue, 29 Dec 2009 22:33:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTMXr43038388; Tue, 29 Dec 2009 22:33:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912292233.nBTMXr43038388@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 22:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201226 - in head/usr.sbin/pkg_install: add create delete info version X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 22:33:54 -0000 Author: ed Date: Tue Dec 29 22:33:53 2009 New Revision: 201226 URL: http://svn.freebsd.org/changeset/base/201226 Log: Add missing `void' keywords. Modified: head/usr.sbin/pkg_install/add/main.c head/usr.sbin/pkg_install/create/main.c head/usr.sbin/pkg_install/delete/main.c head/usr.sbin/pkg_install/info/main.c head/usr.sbin/pkg_install/version/main.c Modified: head/usr.sbin/pkg_install/add/main.c ============================================================================== --- head/usr.sbin/pkg_install/add/main.c Tue Dec 29 22:33:07 2009 (r201225) +++ head/usr.sbin/pkg_install/add/main.c Tue Dec 29 22:33:53 2009 (r201226) @@ -344,7 +344,7 @@ getpackagesite(void) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: pkg_add [-viInfFrRMSK] [-t template] [-p prefix] [-P prefix] [-C chrootdir]", Modified: head/usr.sbin/pkg_install/create/main.c ============================================================================== --- head/usr.sbin/pkg_install/create/main.c Tue Dec 29 22:33:07 2009 (r201225) +++ head/usr.sbin/pkg_install/create/main.c Tue Dec 29 22:33:53 2009 (r201226) @@ -249,7 +249,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "usage: pkg_create [-YNOhjnvyz] [-C conflicts] [-P pkgs] [-p prefix]", Modified: head/usr.sbin/pkg_install/delete/main.c ============================================================================== --- head/usr.sbin/pkg_install/delete/main.c Tue Dec 29 22:33:07 2009 (r201225) +++ head/usr.sbin/pkg_install/delete/main.c Tue Dec 29 22:33:53 2009 (r201226) @@ -170,7 +170,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: pkg_delete [-dDfGinrvxX] [-p prefix] pkg-name ...", Modified: head/usr.sbin/pkg_install/info/main.c ============================================================================== --- head/usr.sbin/pkg_install/info/main.c Tue Dec 29 22:33:07 2009 (r201225) +++ head/usr.sbin/pkg_install/info/main.c Tue Dec 29 22:33:53 2009 (r201226) @@ -282,7 +282,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", "usage: pkg_info [-bcdDEfgGiIjkKLmopPqQrRsvVxX] [-e package] [-l prefix]", Modified: head/usr.sbin/pkg_install/version/main.c ============================================================================== --- head/usr.sbin/pkg_install/version/main.c Tue Dec 29 22:33:07 2009 (r201225) +++ head/usr.sbin/pkg_install/version/main.c Tue Dec 29 22:33:53 2009 (r201226) @@ -127,7 +127,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n%s\n", "usage: pkg_version [-hIoqv] [-l limchar] [-L limchar] [[-X] -s string] [-O origin] [index]", From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 22:53:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E143106568B; Tue, 29 Dec 2009 22:53:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A48D8FC16; Tue, 29 Dec 2009 22:53:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTMrSC3038893; Tue, 29 Dec 2009 22:53:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTMrR5m038869; Tue, 29 Dec 2009 22:53:27 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912292253.nBTMrR5m038869@svn.freebsd.org> From: Ed Schouten Date: Tue, 29 Dec 2009 22:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201227 - in head: sbin/comcontrol sbin/mount sbin/mount_msdosfs sbin/mount_nullfs sbin/rcorder usr.bin/find usr.bin/gencat usr.bin/mklocale usr.sbin/config usr.sbin/cpucontrol usr.sbin... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 22:53:28 -0000 Author: ed Date: Tue Dec 29 22:53:27 2009 New Revision: 201227 URL: http://svn.freebsd.org/changeset/base/201227 Log: ANSIfy almost all applications that use WARNS=6. I was considering committing all these patches one by one, but as discussed with brooks@, there is no need to do this. If we ever need/want to merge these changes back, it is still possible to do this per application. Modified: head/sbin/comcontrol/comcontrol.c head/sbin/mount/vfslist.c head/sbin/mount_msdosfs/mount_msdosfs.c head/sbin/mount_nullfs/mount_nullfs.c head/sbin/rcorder/ealloc.c head/sbin/rcorder/hash.c head/sbin/rcorder/rcorder.c head/usr.bin/find/function.c head/usr.bin/gencat/gencat.c head/usr.bin/mklocale/lex.l head/usr.bin/mklocale/yacc.y head/usr.sbin/config/lang.l head/usr.sbin/cpucontrol/cpucontrol.c head/usr.sbin/eeprom/eeprom.c head/usr.sbin/fifolog/lib/getdate.y head/usr.sbin/lastlogin/lastlogin.c head/usr.sbin/nfsd/nfsd.c head/usr.sbin/pmcannotate/pmcannotate.c head/usr.sbin/powerd/powerd.c head/usr.sbin/sa/main.c head/usr.sbin/sa/pdb.c head/usr.sbin/sa/usrdb.c head/usr.sbin/watchdogd/watchdogd.c Modified: head/sbin/comcontrol/comcontrol.c ============================================================================== --- head/sbin/comcontrol/comcontrol.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/sbin/comcontrol/comcontrol.c Tue Dec 29 22:53:27 2009 (r201227) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); static void usage(void); static void -usage() +usage(void) { fprintf(stderr, "usage: comcontrol [dtrwait ] [drainwait ]\n"); Modified: head/sbin/mount/vfslist.c ============================================================================== --- head/sbin/mount/vfslist.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/sbin/mount/vfslist.c Tue Dec 29 22:53:27 2009 (r201227) @@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$"); static int skipvfs; int -checkvfsname(vfsname, vfslist) - const char *vfsname; - const char **vfslist; +checkvfsname(const char *vfsname, const char **vfslist) { if (vfslist == NULL) @@ -60,8 +58,7 @@ checkvfsname(vfsname, vfslist) } const char ** -makevfslist(fslist) - char *fslist; +makevfslist(char *fslist) { const char **av; int i; Modified: head/sbin/mount_msdosfs/mount_msdosfs.c ============================================================================== --- head/sbin/mount_msdosfs/mount_msdosfs.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/sbin/mount_msdosfs/mount_msdosfs.c Tue Dec 29 22:53:27 2009 (r201227) @@ -229,8 +229,7 @@ main(int argc, char **argv) } gid_t -a_gid(s) - char *s; +a_gid(char *s) { struct group *gr; char *gname; @@ -249,8 +248,7 @@ a_gid(s) } uid_t -a_uid(s) - char *s; +a_uid(char *s) { struct passwd *pw; char *uname; @@ -269,8 +267,7 @@ a_uid(s) } mode_t -a_mask(s) - char *s; +a_mask(char *s) { int done, rv; char *ep; @@ -287,7 +284,7 @@ a_mask(s) } void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n%s\n", "usage: mount_msdosfs [-9ls] [-D DOS_codepage] [-g gid] [-L locale]", Modified: head/sbin/mount_nullfs/mount_nullfs.c ============================================================================== --- head/sbin/mount_nullfs/mount_nullfs.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/sbin/mount_nullfs/mount_nullfs.c Tue Dec 29 22:53:27 2009 (r201227) @@ -116,9 +116,7 @@ main(int argc, char *argv[]) } int -subdir(p, dir) - const char *p; - const char *dir; +subdir(const char *p, const char *dir) { int l; @@ -133,7 +131,7 @@ subdir(p, dir) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: mount_nullfs [-o options] target mount-point\n"); Modified: head/sbin/rcorder/ealloc.c ============================================================================== --- head/sbin/rcorder/ealloc.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/sbin/rcorder/ealloc.c Tue Dec 29 22:53:27 2009 (r201227) @@ -58,7 +58,7 @@ static void enomem(void); * die when out of memory. */ static void -enomem() +enomem(void) { errx(2, "Cannot allocate memory."); } @@ -68,8 +68,7 @@ enomem() * malloc, but die on error. */ void * -emalloc(len) - size_t len; +emalloc(size_t len) { void *p; @@ -83,8 +82,7 @@ emalloc(len) * strdup, but die on error. */ char * -estrdup(str) - const char *str; +estrdup(const char *str) { char *p; @@ -98,9 +96,7 @@ estrdup(str) * realloc, but die on error. */ void * -erealloc(ptr, size) - void *ptr; - size_t size; +erealloc(void *ptr, size_t size) { if ((ptr = realloc(ptr, size)) == NULL) enomem(); @@ -112,9 +108,7 @@ erealloc(ptr, size) * calloc, but die on error. */ void * -ecalloc(nmemb, size) - size_t nmemb; - size_t size; +ecalloc(size_t nmemb, size_t size) { void *ptr; Modified: head/sbin/rcorder/hash.c ============================================================================== --- head/sbin/rcorder/hash.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/sbin/rcorder/hash.c Tue Dec 29 22:53:27 2009 (r201227) @@ -103,9 +103,9 @@ static void RebuildTable(Hash_Table *); */ void -Hash_InitTable(t, numBuckets) - register Hash_Table *t; /* Structure to use to hold table. */ - int numBuckets; /* How many buckets to create for starters. +Hash_InitTable( + register Hash_Table *t, /* Structure to use to hold table. */ + int numBuckets) /* How many buckets to create for starters. * This number is rounded up to a power of * two. If <= 0, a reasonable default is * chosen. The table will grow in size later @@ -150,8 +150,7 @@ Hash_InitTable(t, numBuckets) */ void -Hash_DeleteTable(t) - Hash_Table *t; +Hash_DeleteTable(Hash_Table *t) { register struct Hash_Entry **hp, *h, *nexth = NULL; register int i; @@ -190,9 +189,9 @@ Hash_DeleteTable(t) */ Hash_Entry * -Hash_FindEntry(t, key) - Hash_Table *t; /* Hash table to search. */ - char *key; /* A hash key. */ +Hash_FindEntry( + Hash_Table *t, /* Hash table to search. */ + char *key) /* A hash key. */ { register Hash_Entry *e; register unsigned h; @@ -227,10 +226,10 @@ Hash_FindEntry(t, key) */ Hash_Entry * -Hash_CreateEntry(t, key, newPtr) - register Hash_Table *t; /* Hash table to search. */ - char *key; /* A hash key. */ - Boolean *newPtr; /* Filled in with TRUE if new entry created, +Hash_CreateEntry( + register Hash_Table *t, /* Hash table to search. */ + char *key, /* A hash key. */ + Boolean *newPtr) /* Filled in with TRUE if new entry created, * FALSE otherwise. */ { register Hash_Entry *e; @@ -294,9 +293,7 @@ Hash_CreateEntry(t, key, newPtr) */ void -Hash_DeleteEntry(t, e) - Hash_Table *t; - Hash_Entry *e; +Hash_DeleteEntry(Hash_Table *t, Hash_Entry *e) { register Hash_Entry **hp, *p; @@ -335,9 +332,9 @@ Hash_DeleteEntry(t, e) */ Hash_Entry * -Hash_EnumFirst(t, searchPtr) - Hash_Table *t; /* Table to be searched. */ - register Hash_Search *searchPtr;/* Area in which to keep state +Hash_EnumFirst( + Hash_Table *t, /* Table to be searched. */ + register Hash_Search *searchPtr)/* Area in which to keep state * about search.*/ { searchPtr->tablePtr = t; @@ -365,8 +362,8 @@ Hash_EnumFirst(t, searchPtr) */ Hash_Entry * -Hash_EnumNext(searchPtr) - register Hash_Search *searchPtr; /* Area used to keep state about +Hash_EnumNext( + register Hash_Search *searchPtr) /* Area used to keep state about search. */ { register Hash_Entry *e; @@ -411,8 +408,7 @@ Hash_EnumNext(searchPtr) */ static void -RebuildTable(t) - register Hash_Table *t; +RebuildTable(register Hash_Table *t) { register Hash_Entry *e, *next = NULL, **hp, **xp; register int i, mask; Modified: head/sbin/rcorder/rcorder.c ============================================================================== --- head/sbin/rcorder/rcorder.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/sbin/rcorder/rcorder.c Tue Dec 29 22:53:27 2009 (r201227) @@ -153,9 +153,7 @@ void generate_ordering(void); int main(int, char *[]); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch; @@ -199,7 +197,7 @@ main(argc, argv) * initialise various variables. */ void -initialize() +initialize(void) { fn_head = &fn_head_s; @@ -210,10 +208,7 @@ initialize() /* generic function to insert a new strnodelist element */ void -strnode_add(listp, s, fnode) - strnodelist **listp; - char *s; - filenode *fnode; +strnode_add(strnodelist **listp, char *s, filenode *fnode) { strnodelist *ent; @@ -235,8 +230,7 @@ strnode_add(listp, s, fnode) * fill in the bits, and put it in the filenode linked list */ filenode * -filenode_new(filename) - char *filename; +filenode_new(char *filename) { filenode *temp; @@ -264,9 +258,7 @@ filenode_new(filename) * add a requirement to a filenode. */ void -add_require(fnode, s) - filenode *fnode; - char *s; +add_require(filenode *fnode, char *s) { Hash_Entry *entry; f_reqnode *rnode; @@ -286,9 +278,7 @@ add_require(fnode, s) * have a head node, create one here. */ void -add_provide(fnode, s) - filenode *fnode; - char *s; +add_provide(filenode *fnode, char *s) { Hash_Entry *entry; f_provnode *f_pnode; @@ -367,9 +357,7 @@ add_provide(fnode, s) * put the BEFORE: lines to a list and handle them later. */ void -add_before(fnode, s) - filenode *fnode; - char *s; +add_before(filenode *fnode, char *s) { strnodelist *bf_ent; @@ -384,9 +372,7 @@ add_before(fnode, s) * add a key to a filenode. */ void -add_keyword(fnode, s) - filenode *fnode; - char *s; +add_keyword(filenode *fnode, char *s) { strnode_add(&fnode->keyword_list, s, fnode); @@ -397,9 +383,7 @@ add_keyword(fnode, s) * add_require() to do the real work. */ void -parse_require(node, buffer) - filenode *node; - char *buffer; +parse_require(filenode *node, char *buffer) { char *s; @@ -413,9 +397,7 @@ parse_require(node, buffer) * add_provide() to do the real work. */ void -parse_provide(node, buffer) - filenode *node; - char *buffer; +parse_provide(filenode *node, char *buffer) { char *s; @@ -429,9 +411,7 @@ parse_provide(node, buffer) * add_before() to do the real work. */ void -parse_before(node, buffer) - filenode *node; - char *buffer; +parse_before(filenode *node, char *buffer) { char *s; @@ -445,9 +425,7 @@ parse_before(node, buffer) * add_keyword() to do the real work. */ void -parse_keywords(node, buffer) - filenode *node; - char *buffer; +parse_keywords(filenode *node, char *buffer) { char *s; @@ -461,8 +439,7 @@ parse_keywords(node, buffer) * for provision and requirement lines, building the graphs as needed. */ void -crunch_file(filename) - char *filename; +crunch_file(char *filename) { FILE *fp; char *buf; @@ -534,8 +511,7 @@ crunch_file(filename) } Hash_Entry * -make_fake_provision(node) - filenode *node; +make_fake_provision(filenode *node) { Hash_Entry *entry; f_provnode *f_pnode; @@ -581,7 +557,7 @@ make_fake_provision(node) * that provisions filenode for P. */ void -insert_before() +insert_before(void) { Hash_Entry *entry, *fake_prov_entry; provnode *pnode; @@ -619,7 +595,7 @@ insert_before() * lines into graph(s). */ void -crunch_all_files() +crunch_all_files(void) { int i; @@ -644,9 +620,7 @@ crunch_all_files() * provision. */ void -satisfy_req(rnode, filename) - f_reqnode *rnode; - char *filename; +satisfy_req(f_reqnode *rnode, char *filename) { Hash_Entry *entry; provnode *head; @@ -687,8 +661,7 @@ satisfy_req(rnode, filename) } int -skip_ok(fnode) - filenode *fnode; +skip_ok(filenode *fnode) { strnodelist *s; strnodelist *k; @@ -702,8 +675,7 @@ skip_ok(fnode) } int -keep_ok(fnode) - filenode *fnode; +keep_ok(filenode *fnode) { strnodelist *s; strnodelist *k; @@ -728,8 +700,7 @@ keep_ok(fnode) * Circular dependancies will cause problems if we do. */ void -do_file(fnode) - filenode *fnode; +do_file(filenode *fnode) { f_reqnode *r, *r_tmp; f_provnode *p, *p_tmp; @@ -812,7 +783,7 @@ do_file(fnode) } void -generate_ordering() +generate_ordering(void) { /* Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.bin/find/function.c Tue Dec 29 22:53:27 2009 (r201227) @@ -770,7 +770,7 @@ done: *argvp = argv + 1; /* Finish any pending -exec ... {} + functions. */ void -finish_execplus() +finish_execplus(void) { PLAN *p; Modified: head/usr.bin/gencat/gencat.c ============================================================================== --- head/usr.bin/gencat/gencat.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.bin/gencat/gencat.c Tue Dec 29 22:53:27 2009 (r201227) @@ -130,7 +130,7 @@ void usage(void); int main(int, char **); void -usage() +usage(void) { fprintf(stderr, "usage: %s catfile msgfile ...\n", getprogname()); exit(1); Modified: head/usr.bin/mklocale/lex.l ============================================================================== --- head/usr.bin/mklocale/lex.l Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.bin/mklocale/lex.l Tue Dec 29 22:53:27 2009 (r201227) @@ -170,7 +170,7 @@ ENCODING { return(ENCODING); } #if !defined(yywrap) int -yywrap() +yywrap(void) { return(1); } Modified: head/usr.bin/mklocale/yacc.y ============================================================================== --- head/usr.bin/mklocale/yacc.y Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.bin/mklocale/yacc.y Tue Dec 29 22:53:27 2009 (r201227) @@ -266,22 +266,20 @@ main(int ac, char *av[]) } static void -usage() +usage(void) { fprintf(stderr, "usage: mklocale [-d] [-o output] [source]\n"); exit(1); } void -yyerror(s) - const char *s; +yyerror(const char *s) { fprintf(stderr, "%s\n", s); } static void * -xmalloc(sz) - unsigned int sz; +xmalloc(unsigned int sz) { void *r = malloc(sz); if (!r) @@ -290,8 +288,7 @@ xmalloc(sz) } static uint32_t * -xlalloc(sz) - unsigned int sz; +xlalloc(unsigned int sz) { uint32_t *r = (uint32_t *)malloc(sz * sizeof(uint32_t)); if (!r) @@ -300,9 +297,7 @@ xlalloc(sz) } static uint32_t * -xrelalloc(old, sz) - uint32_t *old; - unsigned int sz; +xrelalloc(uint32_t *old, unsigned int sz) { uint32_t *r = (uint32_t *)realloc((char *)old, sz * sizeof(uint32_t)); @@ -312,10 +307,7 @@ xrelalloc(old, sz) } void -set_map(map, list, flag) - rune_map *map; - rune_list *list; - uint32_t flag; +set_map(rune_map *map, rune_list *list, uint32_t flag) { while (list) { rune_list *nlist = list->next; @@ -325,9 +317,7 @@ set_map(map, list, flag) } void -set_digitmap(map, list) - rune_map *map; - rune_list *list; +set_digitmap(rune_map *map, rune_list *list) { int32_t i; @@ -347,10 +337,7 @@ set_digitmap(map, list) } void -add_map(map, list, flag) - rune_map *map; - rune_list *list; - uint32_t flag; +add_map(rune_map *map, rune_list *list, uint32_t flag) { int32_t i; rune_list *lr = 0; @@ -555,7 +542,7 @@ add_map(map, list, flag) } static void -dump_tables() +dump_tables(void) { int x, first_d, curr_d; rune_list *list; Modified: head/usr.sbin/config/lang.l ============================================================================== --- head/usr.sbin/config/lang.l Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/config/lang.l Tue Dec 29 22:53:27 2009 (r201227) @@ -285,7 +285,7 @@ include(const char *fname, int ateof) * Terminate the most recent inclusion. */ static int -endinclude() +endinclude(void) { struct incl *in; int ateof; Modified: head/usr.sbin/cpucontrol/cpucontrol.c ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/cpucontrol/cpucontrol.c Tue Dec 29 22:53:27 2009 (r201227) @@ -102,7 +102,7 @@ static int do_update(const char *dev); static void datadir_add(const char *path); static void __dead2 -usage() +usage(void) { const char *name; Modified: head/usr.sbin/eeprom/eeprom.c ============================================================================== --- head/usr.sbin/eeprom/eeprom.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/eeprom/eeprom.c Tue Dec 29 22:53:27 2009 (r201227) @@ -146,7 +146,7 @@ action(char *line) } static void -dump_config() +dump_config(void) { ofwo_dump(); Modified: head/usr.sbin/fifolog/lib/getdate.y ============================================================================== --- head/usr.sbin/fifolog/lib/getdate.y Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/fifolog/lib/getdate.y Tue Dec 29 22:53:27 2009 (r201227) @@ -762,7 +762,7 @@ LookupWord(char *buff) static int -yylex() +yylex(void) { char c; char *p; Modified: head/usr.sbin/lastlogin/lastlogin.c ============================================================================== --- head/usr.sbin/lastlogin/lastlogin.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/lastlogin/lastlogin.c Tue Dec 29 22:53:27 2009 (r201227) @@ -49,9 +49,7 @@ static void output(struct ulog_utmpx *); static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch, i; struct ulog_utmpx *u; @@ -102,7 +100,7 @@ output(struct ulog_utmpx *u) } static void -usage() +usage(void) { fprintf(stderr, "usage: lastlogin [user ...]\n"); exit(1); Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/nfsd/nfsd.c Tue Dec 29 22:53:27 2009 (r201227) @@ -842,7 +842,7 @@ setbindhost(struct addrinfo **ai, const } void -usage() +usage(void) { (void)fprintf(stderr, "usage: nfsd %s\n", USAGE); exit(1); @@ -868,7 +868,7 @@ reapchild(__unused int signo) } void -unregistration() +unregistration(void) { if ((!rpcb_unset(NFS_PROGRAM, 2, NULL)) || (!rpcb_unset(NFS_PROGRAM, 3, NULL))) @@ -876,7 +876,7 @@ unregistration() } void -killchildren() +killchildren(void) { int i; Modified: head/usr.sbin/pmcannotate/pmcannotate.c ============================================================================== --- head/usr.sbin/pmcannotate/pmcannotate.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/pmcannotate/pmcannotate.c Tue Dec 29 22:53:27 2009 (r201227) @@ -325,7 +325,7 @@ fqueue_compact(float th) * Flush the first-level aggregates queue. */ static void -fqueue_deleteall() +fqueue_deleteall(void) { struct aggent *agg; @@ -472,7 +472,7 @@ fqueue_insertgen(void) * Flush the raw entries general queue. */ static void -general_deleteall() +general_deleteall(void) { struct entry *obj; Modified: head/usr.sbin/powerd/powerd.c ============================================================================== --- head/usr.sbin/powerd/powerd.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/powerd/powerd.c Tue Dec 29 22:53:27 2009 (r201227) @@ -259,7 +259,7 @@ get_freq_id(int freq, int *freqs, int nu * to APM. If nothing succeeds, we'll just run in default mode. */ static void -acline_init() +acline_init(void) { acline_mib_len = 4; Modified: head/usr.sbin/sa/main.c ============================================================================== --- head/usr.sbin/sa/main.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/sa/main.c Tue Dec 29 22:53:27 2009 (r201227) @@ -300,7 +300,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: sa [-abcdDfijkKlmnqrstu] [-P file] [-U file] [-v cutoff] [file ...]\n"); Modified: head/usr.sbin/sa/pdb.c ============================================================================== --- head/usr.sbin/sa/pdb.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/sa/pdb.c Tue Dec 29 22:53:27 2009 (r201227) @@ -94,14 +94,14 @@ v1_to_v2(DBT *key __unused, DBT *data) /* Copy pdb_file to in-memory pacct_db. */ int -pacct_init() +pacct_init(void) { return (db_copy_in(&pacct_db, pdb_file, "process accounting", NULL, v1_to_v2)); } void -pacct_destroy() +pacct_destroy(void) { db_destroy(pacct_db, "process accounting"); } @@ -150,14 +150,14 @@ pacct_add(const struct cmdinfo *ci) /* Copy in-memory pacct_db to pdb_file. */ int -pacct_update() +pacct_update(void) { return (db_copy_out(pacct_db, pdb_file, "process accounting", NULL)); } void -pacct_print() +pacct_print(void) { BTREEINFO bti; DBT key, data, ndata; Modified: head/usr.sbin/sa/usrdb.c ============================================================================== --- head/usr.sbin/sa/usrdb.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/sa/usrdb.c Tue Dec 29 22:53:27 2009 (r201227) @@ -97,7 +97,7 @@ v1_to_v2(DBT *key, DBT *data) /* Copy usrdb_file to in-memory usracct_db. */ int -usracct_init() +usracct_init(void) { BTREEINFO bti; @@ -109,7 +109,7 @@ usracct_init() } void -usracct_destroy() +usracct_destroy(void) { db_destroy(usracct_db, "user accounting"); } @@ -166,7 +166,7 @@ usracct_add(const struct cmdinfo *ci) /* Copy in-memory usracct_db to usrdb_file. */ int -usracct_update() +usracct_update(void) { BTREEINFO bti; @@ -178,7 +178,7 @@ usracct_update() } void -usracct_print() +usracct_print(void) { DBT key, data; struct userinfo uistore, *ui = &uistore; Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Tue Dec 29 22:33:53 2009 (r201226) +++ head/usr.sbin/watchdogd/watchdogd.c Tue Dec 29 22:53:27 2009 (r201227) @@ -149,7 +149,7 @@ sighandler(int signum) * Open the watchdog device. */ static int -watchdog_init() +watchdog_init(void) { fd = open("/dev/" _PATH_WATCHDOG, O_RDWR); @@ -220,7 +220,7 @@ watchdog_onoff(int onoff) * Tell user how to use the program. */ static void -usage() +usage(void) { if (is_daemon) fprintf(stderr, "usage: watchdogd [-d] [-e cmd] [-I file] [-s sleep] [-t timeout]\n"); From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 23:28:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C0271065670; Tue, 29 Dec 2009 23:28:14 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C1338FC15; Tue, 29 Dec 2009 23:28:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTNSDiL039962; Tue, 29 Dec 2009 23:28:13 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTNSDRB039960; Tue, 29 Dec 2009 23:28:13 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <200912292328.nBTNSDRB039960@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 29 Dec 2009 23:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201234 - head/sys/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 23:28:14 -0000 Author: gibbs Date: Tue Dec 29 23:28:13 2009 New Revision: 201234 URL: http://svn.freebsd.org/changeset/base/201234 Log: Correct bug introduced while purging the -ERRNO Linuxism from the grant table API. Valid grant refs are in the range of positive 32bit integers. ENOSPACE, being 29, is also a positive integer. Return GNTTAB_LIST_END (-1) instead when gnttab_claim_grant_reference() fails. Modified: head/sys/xen/gnttab.c Modified: head/sys/xen/gnttab.c ============================================================================== --- head/sys/xen/gnttab.c Tue Dec 29 23:27:15 2009 (r201233) +++ head/sys/xen/gnttab.c Tue Dec 29 23:28:13 2009 (r201234) @@ -325,7 +325,7 @@ gnttab_claim_grant_reference(grant_ref_t grant_ref_t g = *private_head; if (unlikely(g == GNTTAB_LIST_END)) - return (ENOSPC); + return (g); *private_head = gnttab_entry(g); return (g); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 29 23:31:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BDCE106566B; Tue, 29 Dec 2009 23:31:21 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BD3D8FC1A; Tue, 29 Dec 2009 23:31:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBTNVLtU040110; Tue, 29 Dec 2009 23:31:21 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBTNVLod040108; Tue, 29 Dec 2009 23:31:21 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <200912292331.nBTNVLod040108@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 29 Dec 2009 23:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201236 - head/sys/dev/xen/blkfront X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 29 Dec 2009 23:31:21 -0000 Author: gibbs Date: Tue Dec 29 23:31:21 2009 New Revision: 201236 URL: http://svn.freebsd.org/changeset/base/201236 Log: In blkif_queue_cb(), test the return value from gnttab_claim_grant_reference() for >= 0 instead of != ENOSPC. Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Tue Dec 29 23:30:16 2009 (r201235) +++ head/sys/dev/xen/blkfront/blkfront.c Tue Dec 29 23:31:21 2009 (r201236) @@ -960,7 +960,7 @@ blkif_queue_cb(void *arg, bus_dma_segmen /* install a grant reference. */ ref = gnttab_claim_grant_reference(&cm->gref_head); - KASSERT( ref != ENOSPC, ("grant_reference failed") ); + KASSERT( ref >= 0, ("grant_reference failed") ); gnttab_grant_foreign_access_ref( ref, From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 00:14:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B2CF1065672; Wed, 30 Dec 2009 00:14:55 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 909D68FC12; Wed, 30 Dec 2009 00:14:54 +0000 (UTC) Received: by fxm27 with SMTP id 27so11182894fxm.3 for ; Tue, 29 Dec 2009 16:14:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Deeq05QrY7X9IpAr0P9RR+H5SGxGGRG2abwB3nj+O2w=; b=uH/QljqM4/Adbu1qUVaJfJQp9K0EG4tAQoGNhaSSxbFnSL1bZ7Devwn4KfvDU74x/C QOI82nK2dhFeuuULFmOUUEY/jx1BaiTy+/7ZIlBOvE9e/5icmW0X/xPfKWcLkyXwzOi5 NAulNdkBMbWBU9YpZXXjfUfgBfo4XzyFQSbEA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=kh3gRxr8ccYWh37ErVIzMFvyOJN+CKBf+ME2ZbEPy2RV7kSBzvxiZnUggUW63CUX2B +moid9ZkxTUVTcGw1otlxgJ7b6sXbWYTr+aqdZlh08dFZy47o9O0fiiKBxn15MJ7nC3T c0dcg3jP1nCWWqePbVt8Y/cL628c3I4Vz9tKk= MIME-Version: 1.0 Received: by 10.239.179.98 with SMTP id c34mr1989567hbg.17.1262132088485; Tue, 29 Dec 2009 16:14:48 -0800 (PST) In-Reply-To: <200912290849.nBT8nh7c017065@svn.freebsd.org> References: <200912290849.nBT8nh7c017065@svn.freebsd.org> Date: Tue, 29 Dec 2009 22:14:48 -0200 Message-ID: From: "Carlos A. M. dos Santos" To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201180 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 00:14:55 -0000 On Tue, Dec 29, 2009 at 6:49 AM, Ed Schouten wrote: > Author: ed > Date: Tue Dec 29 08:49:43 2009 > New Revision: 201180 > URL: http://svn.freebsd.org/changeset/base/201180 > > Log: > =A0Add missing `void' for functions without arguments. Ok. > =A0While there, rename die_you_gravy_sucking_pig_dog() to something that'= s > =A0less moronic. Would you consider reverting this? die_you_gravy_sucking_pig_dog is part of the BSD history, just like "you are not expected to understand this" belongs to the Unix history. --=20 My preferred quotation of Robert Louis Stevenson is "You cannot make an omelette without breaking eggs". Not because I like the omelettes, but because I like the sound of eggs being broken. From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 01:07:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96247106566B; Wed, 30 Dec 2009 01:07:55 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 3CE3C8FC20; Wed, 30 Dec 2009 01:07:55 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id CE6C714DA125; Wed, 30 Dec 2009 02:07:52 +0100 (CET) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MOmtRuCVFrlO; Wed, 30 Dec 2009 02:07:41 +0100 (CET) Received: from [192.168.1.105] (catv-89-132-179-104.catv.broadband.hu [89.132.179.104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id B71D314DA0F1; Wed, 30 Dec 2009 02:07:41 +0100 (CET) Message-ID: <4B3AA7DC.1040606@FreeBSD.org> Date: Wed, 30 Dec 2009 02:07:40 +0100 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; es-ES; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Ed Schouten References: <200912292253.nBTMrR5m038869@svn.freebsd.org> In-Reply-To: <200912292253.nBTMrR5m038869@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201227 - in head: sbin/comcontrol sbin/mount sbin/mount_msdosfs sbin/mount_nullfs sbin/rcorder usr.bin/find usr.bin/gencat usr.bin/mklocale usr.sbin/config usr.sbin/cpucontrol usr.sbin... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 01:07:55 -0000 El 2009. 12. 29. 23:53, Ed Schouten escribiĂł: > Author: ed > Date: Tue Dec 29 22:53:27 2009 > New Revision: 201227 > URL: http://svn.freebsd.org/changeset/base/201227 > > Log: > ANSIfy almost all applications that use WARNS=6. > > I was considering committing all these patches one by one, but as > discussed with brooks@, there is no need to do this. If we ever > need/want to merge these changes back, it is still possible to do this > per application. > I wonder if it would be worth to invent a WARNS=7 level, which would be WARNS=6 + ANSI. Although ANSI-conformance isn't a -Wfoo flag, which is WARNS for but conforming ANSI means a higher level cleannes, which is demanded, so I think it wouldn't really contradict to the semantics of WARNS. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 01:14:07 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2B2B106566C; Wed, 30 Dec 2009 01:14:06 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B3DEF8FC2C; Wed, 30 Dec 2009 01:14:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBU17MxO093325; Tue, 29 Dec 2009 18:07:22 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 29 Dec 2009 18:07:57 -0700 (MST) Message-Id: <20091229.180757.951589869071195982.imp@bsdimp.com> To: scf@FreeBSD.org From: "M. Warner Losh" In-Reply-To: References: <200912290849.nBT8nh7c017065@svn.freebsd.org> <4B3A5C2E.5080701@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, dougb@FreeBSD.org, ed@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201180 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 01:14:07 -0000 In message: "Sean C. Farley" writes: : On Tue, 29 Dec 2009, Doug Barton wrote: : : > Ed Schouten wrote: : >> While there, rename die_you_gravy_sucking_pig_dog() to something : >> that's : >> less moronic. : > : > Boo! IMO the fact that at least some of our sources have some : > personality is a feature. :) : : How about alt_shutdown_die_die_die()? :) my_name_is_enigo_montoya_you_killed_my_father_prepare_to_die() Warner From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 01:53:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E037106566B; Wed, 30 Dec 2009 01:53:51 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by mx1.freebsd.org (Postfix) with ESMTP id 3E7858FC22; Wed, 30 Dec 2009 01:53:50 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 4so2993269eyf.9 for ; Tue, 29 Dec 2009 17:53:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=B1xq/UhPAIQgeZihRfoyOlJnMtTPg9t4BeNiYG3vHgA=; b=XICyNJG1WJkfG48YLfd8j02P4jWRoDJpEPryvYcGf5MHciw27ZRRMCd1W6G4/BP1Ka 8gMWOraqn3j0YfnBIeOYDS/ps/hUae11vONQjkwD8t7gNL9EhnBUQN4DVE1Id2N7eqFN 1UseJhDdt7Gk3pHXx9pmLn7TfduBM0cnRqB+Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=V8m9xLARYdHu3r651yCximwgcXlbA+mWih9E8XEbyObRI3rIUkI6boYwW4DpQzn+TA LGFkHz/jbaA+XyMR2oaxeitKQ5GzwBSCy1kGXEFkcDbOvSmBjuN5BU7emuw0I02y/ilW OPpdTBpgTVx9N40ZCAFEbBlkbsKmd9xTYvHfI= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.88.68 with SMTP id z46mr6082376wee.27.1262138018150; Tue, 29 Dec 2009 17:53:38 -0800 (PST) In-Reply-To: References: <200912290849.nBT8nh7c017065@svn.freebsd.org> From: Ivan Voras Date: Wed, 30 Dec 2009 02:53:18 +0100 X-Google-Sender-Auth: 62384d77ad7c709c Message-ID: <9bbcef730912291753w533b04ffhb7462f624db499bf@mail.gmail.com> To: "Carlos A. M. dos Santos" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r201180 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 01:53:51 -0000 2009/12/30 Carlos A. M. dos Santos : > On Tue, Dec 29, 2009 at 6:49 AM, Ed Schouten wrote: >> Author: ed >> Date: Tue Dec 29 08:49:43 2009 >> New Revision: 201180 >> URL: http://svn.freebsd.org/changeset/base/201180 >> >> Log: >> =C2=A0Add missing `void' for functions without arguments. > > Ok. > >> =C2=A0While there, rename die_you_gravy_sucking_pig_dog() to something t= hat's >> =C2=A0less moronic. > > Would you consider reverting this? die_you_gravy_sucking_pig_dog is > part of the BSD history, just like "you are not expected to understand > this" belongs to the Unix history. Oh definitely keep die_you_gravy_sucking_pig_dog() - it really is one of the better known landmarks of BSD-dom :) (and I was also against backing out the IP evil-bit support :) ) Too much seriousness is a bad thing! From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 05:30:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAE511065698; Wed, 30 Dec 2009 05:30:35 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C942E8FC20; Wed, 30 Dec 2009 05:30:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBU5UZF2047854; Wed, 30 Dec 2009 05:30:35 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBU5UZiS047852; Wed, 30 Dec 2009 05:30:35 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912300530.nBU5UZiS047852@svn.freebsd.org> From: Tim Kientzle Date: Wed, 30 Dec 2009 05:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201246 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 05:30:36 -0000 Author: kientzle Date: Wed Dec 30 05:30:35 2009 New Revision: 201246 URL: http://svn.freebsd.org/changeset/base/201246 Log: Merge Michihiro NAKAJIMA's significant work on the ISO9660 reader from googlecode: * Support for zisofs compressed entries * Support for relocated deep directories * Direct calculation of link counts for accurate nlink values even on images that lack Rockridge extensions * Faster handling of the internal file lists. * Better detection of ISO variants Modified: head/lib/libarchive/archive_read_support_format_iso9660.c Modified: head/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_iso9660.c Wed Dec 30 03:59:45 2009 (r201245) +++ head/lib/libarchive/archive_read_support_format_iso9660.c Wed Dec 30 05:30:35 2009 (r201246) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2003-2007 Tim Kientzle * Copyright (c) 2009 Andreas Henriksson + * Copyright (c) 2009 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,8 +40,12 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#ifdef HAVE_ZLIB_H +#include +#endif #include "archive.h" +#include "archive_endian.h" #include "archive_entry.h" #include "archive_private.h" #include "archive_read_private.h" @@ -73,6 +78,8 @@ __FBSDID("$FreeBSD$"); * the file body. This strategy allows us to read most compliant * CDs with a single pass through the data, as required by libarchive. */ +#define LOGICAL_BLOCK_SIZE 2048 +#define SYSTEM_AREA_BLOCK 16 /* Structure of on-disk primary volume descriptor. */ #define PVD_type_offset 0 @@ -158,6 +165,8 @@ __FBSDID("$FreeBSD$"); #define SVD_version_offset (SVD_id_offset + SVD_id_size) #define SVD_version_size 1 /* ... */ +#define SVD_reserved1_offset 72 +#define SVD_reserved1_size 8 #define SVD_volume_space_size_offset 80 #define SVD_volume_space_size_size 8 #define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size) @@ -165,9 +174,16 @@ __FBSDID("$FreeBSD$"); /* ... */ #define SVD_logical_block_size_offset 128 #define SVD_logical_block_size_size 4 +#define SVD_type_L_path_table_offset 140 +#define SVD_type_M_path_table_offset 148 /* ... */ #define SVD_root_directory_record_offset 156 #define SVD_root_directory_record_size 34 +#define SVD_file_structure_version_offset 881 +#define SVD_reserved2_offset 882 +#define SVD_reserved2_size 1 +#define SVD_reserved3_offset 1395 +#define SVD_reserved3_size 653 /* ... */ /* FIXME: validate correctness of last SVD entry offset. */ @@ -198,60 +214,145 @@ __FBSDID("$FreeBSD$"); #define DR_name_len_size 1 #define DR_name_offset 33 +#ifdef HAVE_ZLIB_H +static const unsigned char zisofs_magic[8] = { + 0x37, 0xE4, 0x53, 0x96, 0xC9, 0xDB, 0xD6, 0x07 +}; + +struct zisofs { + /* Set 1 if this file compressed by paged zlib */ + int pz; + int pz_log2_bs; /* Log2 of block size */ + uint64_t pz_uncompressed_size; + + int initialized; + unsigned char *uncompressed_buffer; + size_t uncompressed_buffer_size; + + uint32_t pz_offset; + unsigned char header[16]; + size_t header_avail; + int header_passed; + unsigned char *block_pointers; + size_t block_pointers_alloc; + size_t block_pointers_size; + size_t block_pointers_avail; + size_t block_off; + uint32_t block_avail; + + z_stream stream; + int stream_valid; +}; +#else +struct zisofs { + /* Set 1 if this file compressed by paged zlib */ + int pz; +}; +#endif + +struct content { + uint64_t offset;/* Offset on disk. */ + uint64_t size; /* File size in bytes. */ + struct content *next; +}; + /* In-memory storage for a directory record. */ struct file_info { struct file_info *parent; + struct file_info *next; int refcount; - uint64_t offset; /* Offset on disk. */ - uint64_t size; /* File size in bytes. */ - uint64_t ce_offset; /* Offset of CE */ - uint64_t ce_size; /* Size of CE */ - time_t birthtime; /* File created time. */ - time_t mtime; /* File last modified time. */ - time_t atime; /* File last accessed time. */ - time_t ctime; /* File attribute change time. */ - uint64_t rdev; /* Device number */ + int subdirs; + uint64_t key; /* Heap Key. */ + uint64_t offset; /* Offset on disk. */ + uint64_t size; /* File size in bytes. */ + uint32_t ce_offset; /* Offset of CE. */ + uint32_t ce_size; /* Size of CE. */ + char re; /* Having RRIP "RE" extension. */ + uint64_t cl_offset; /* Having RRIP "CL" extension. */ + int birthtime_is_set; + time_t birthtime; /* File created time. */ + time_t mtime; /* File last modified time. */ + time_t atime; /* File last accessed time. */ + time_t ctime; /* File attribute change time. */ + uint64_t rdev; /* Device number. */ mode_t mode; uid_t uid; gid_t gid; - ino_t inode; + int64_t number; int nlinks; struct archive_string name; /* Pathname */ char name_continues; /* Non-zero if name continues */ struct archive_string symlink; char symlink_continues; /* Non-zero if link continues */ + /* Set 1 if this file compressed by paged zlib(zisofs) */ + int pz; + int pz_log2_bs; /* Log2 of block size */ + uint64_t pz_uncompressed_size; + /* Set 1 if this file is multi extent. */ + int multi_extent; + struct { + struct content *first; + struct content **last; + } contents; + char exposed; }; +struct heap_queue { + struct file_info **files; + int allocated; + int used; +}; struct iso9660 { int magic; #define ISO9660_MAGIC 0x96609660 - int option_ignore_joliet; + int opt_support_joliet; + int opt_support_rockridge; struct archive_string pathname; - char seenRockridge; /* Set true if RR extensions are used. */ - unsigned char suspOffset; + char seenRockridge; /* Set true if RR extensions are used. */ + char seenSUSP; /* Set true if SUSP is beging used. */ char seenJoliet; - uint64_t previous_offset; - uint64_t previous_size; + unsigned char suspOffset; + struct file_info *rr_moved; + struct heap_queue re_dirs; + struct heap_queue cl_files; + struct read_ce_queue { + struct read_ce_req { + uint64_t offset;/* Offset of CE on disk. */ + struct file_info *file; + } *reqs; + int cnt; + int allocated; + } read_ce_req; + + int64_t previous_number; struct archive_string previous_pathname; - /* TODO: Make this a heap for fast inserts and deletions. */ - struct file_info **pending_files; - int pending_files_allocated; - int pending_files_used; + struct heap_queue pending_files; + struct { + struct file_info *first; + struct file_info **last; + } cache_files; uint64_t current_position; ssize_t logical_block_size; uint64_t volume_size; /* Total size of volume in bytes. */ + int32_t volume_block;/* Total size of volume in logical blocks. */ + + struct vd { + int location; /* Location of Extent. */ + uint32_t size; + } primary, joliet; off_t entry_sparse_offset; int64_t entry_bytes_remaining; + struct zisofs entry_zisofs; + struct content *entry_content; }; -static void add_entry(struct iso9660 *iso9660, struct file_info *file); static int archive_read_format_iso9660_bid(struct archive_read *); static int archive_read_format_iso9660_options(struct archive_read *, const char *, const char *); @@ -268,25 +369,48 @@ static void dump_isodirrec(FILE *, const static time_t time_from_tm(struct tm *); static time_t isodate17(const unsigned char *); static time_t isodate7(const unsigned char *); +static int isBootRecord(struct iso9660 *, const unsigned char *); +static int isVolumePartition(struct iso9660 *, const unsigned char *); +static int isVDSetTerminator(struct iso9660 *, const unsigned char *); static int isJolietSVD(struct iso9660 *, const unsigned char *); +static int isSVD(struct iso9660 *, const unsigned char *); +static int isEVD(struct iso9660 *, const unsigned char *); static int isPVD(struct iso9660 *, const unsigned char *); -static struct file_info *next_entry(struct iso9660 *); +static struct file_info *next_cache_entry(struct iso9660 *iso9660); static int next_entry_seek(struct archive_read *a, struct iso9660 *iso9660, struct file_info **pfile); static struct file_info * - parse_file_info(struct iso9660 *iso9660, + parse_file_info(struct archive_read *a, struct file_info *parent, const unsigned char *isodirrec); -static void parse_rockridge(struct iso9660 *iso9660, +static int parse_rockridge(struct archive_read *a, struct file_info *file, const unsigned char *start, const unsigned char *end); +static int register_CE(struct archive_read *a, int32_t location, + struct file_info *file); +static int read_CE(struct archive_read *a, struct iso9660 *iso9660); static void parse_rockridge_NM1(struct file_info *, const unsigned char *, int); static void parse_rockridge_SL1(struct file_info *, const unsigned char *, int); static void parse_rockridge_TF1(struct file_info *, const unsigned char *, int); +static void parse_rockridge_ZF1(struct file_info *, + const unsigned char *, int); static void release_file(struct iso9660 *, struct file_info *); static unsigned toi(const void *p, int n); +static inline void cache_add_entry(struct iso9660 *iso9660, + struct file_info *file); +static inline void cache_add_to_next_of_parent(struct iso9660 *iso9660, + struct file_info *file); +static inline struct file_info *cache_get_entry(struct iso9660 *iso9660); +static void heap_add_entry(struct heap_queue *heap, + struct file_info *file, uint64_t key); +static struct file_info *heap_get_entry(struct heap_queue *heap); + +#define add_entry(iso9660, file) \ + heap_add_entry(&((iso9660)->pending_files), file, file->offset) +#define next_entry(iso9660) \ + heap_get_entry(&((iso9660)->pending_files)) int archive_read_support_format_iso9660(struct archive *_a) @@ -302,6 +426,12 @@ archive_read_support_format_iso9660(stru } memset(iso9660, 0, sizeof(*iso9660)); iso9660->magic = ISO9660_MAGIC; + iso9660->cache_files.first = NULL; + iso9660->cache_files.last = &(iso9660->cache_files.first); + /* Enable to support Joliet extensions by default. */ + iso9660->opt_support_joliet = 1; + /* Enable to support Rock Ridge extensions by default. */ + iso9660->opt_support_rockridge = 1; r = __archive_read_register_format(a, iso9660, @@ -325,10 +455,10 @@ static int archive_read_format_iso9660_bid(struct archive_read *a) { struct iso9660 *iso9660; - ssize_t bytes_read, brsvd; + ssize_t bytes_read; const void *h; - const unsigned char *p, *psvd; - int bid; + const unsigned char *p; + int seenTerminator; iso9660 = (struct iso9660 *)(a->format->data); @@ -337,34 +467,56 @@ archive_read_format_iso9660_bid(struct a * 8 sectors of the volume descriptor table. Of course, * if the I/O layer gives us more, we'll take it. */ - h = __archive_read_ahead(a, 32768 + 8*2048, &bytes_read); +#define RESERVED_AREA (SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE) + h = __archive_read_ahead(a, + RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE, + &bytes_read); if (h == NULL) return (-1); p = (const unsigned char *)h; /* Skip the reserved area. */ - bytes_read -= 32768; - p += 32768; - - /* Check each volume descriptor to locate possible SVD with Joliet. */ - for (brsvd = bytes_read, psvd = p; - !iso9660->option_ignore_joliet && brsvd > 2048; - brsvd -= 2048, psvd += 2048) { - bid = isJolietSVD(iso9660, psvd); - if (bid > 0) - return (bid); - if (*p == '\177') /* End-of-volume-descriptor marker. */ - break; - } + bytes_read -= RESERVED_AREA; + p += RESERVED_AREA; - /* Check each volume descriptor to locate the PVD. */ - for (; bytes_read > 2048; bytes_read -= 2048, p += 2048) { - bid = isPVD(iso9660, p); - if (bid > 0) - return (bid); - if (*p == '\177') /* End-of-volume-descriptor marker. */ + /* Check each volume descriptor. */ + seenTerminator = 0; + for (; bytes_read > LOGICAL_BLOCK_SIZE; + bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) { + /* Do not handle undefined Volume Descriptor Type. */ + if (p[0] >= 4 && p[0] <= 254) + return (0); + /* Standard Identifier must be "CD001" */ + if (memcmp(p + 1, "CD001", 5) != 0) + return (0); + if (!iso9660->primary.location) { + if (isPVD(iso9660, p)) + continue; + } + if (!iso9660->joliet.location) { + if (isJolietSVD(iso9660, p)) + continue; + } + if (isBootRecord(iso9660, p)) + continue; + if (isEVD(iso9660, p)) + continue; + if (isSVD(iso9660, p)) + continue; + if (isVolumePartition(iso9660, p)) + continue; + if (isVDSetTerminator(iso9660, p)) { + seenTerminator = 1; break; + } + return (0); } + /* + * ISO 9660 format must have Primary Volume Descriptor and + * Volume Descriptor Set Terminator. + */ + if (seenTerminator && iso9660->primary.location > 16) + return (48); /* We didn't find a valid PVD; return a bid of zero. */ return (0); @@ -383,9 +535,14 @@ archive_read_format_iso9660_options(stru strcmp(val, "ignore") == 0 || strcmp(val, "disable") == 0 || strcmp(val, "0") == 0) - iso9660->option_ignore_joliet = 1; + iso9660->opt_support_joliet = 0; else - iso9660->option_ignore_joliet = 0; + iso9660->opt_support_joliet = 1; + return (ARCHIVE_OK); + } + if (strcmp(key, "rockridge") == 0 || + strcmp(key, "Rockridge") == 0) { + iso9660->opt_support_rockridge = val != NULL; return (ARCHIVE_OK); } @@ -396,17 +553,80 @@ archive_read_format_iso9660_options(stru } static int -isJolietSVD(struct iso9660 *iso9660, const unsigned char *h) +isBootRecord(struct iso9660 *iso9660, const unsigned char *h) { - struct file_info *file; - const unsigned char *p; + (void)iso9660; /* UNUSED */ - /* Type 2 means it's a SVD. */ - if (h[SVD_type_offset] != 2) + /* Type of the Volume Descriptor Boot Record must be 0. */ + if (h[0] != 0) + return (0); + + /* Volume Descriptor Version must be 1. */ + if (h[6] != 1) + return (0); + + return (1); +} + +static int +isVolumePartition(struct iso9660 *iso9660, const unsigned char *h) +{ + int32_t location; + + /* Type of the Volume Partition Descriptor must be 3. */ + if (h[0] != 3) + return (0); + + /* Volume Descriptor Version must be 1. */ + if (h[6] != 1) + return (0); + /* Unused Field */ + if (h[7] != 0) + return (0); + + location = archive_le32dec(h + 72); + if (location <= SYSTEM_AREA_BLOCK || + location >= iso9660->volume_block) + return (0); + if ((uint32_t)location != archive_be32dec(h + 76)) + return (0); + + return (1); +} + +static int +isVDSetTerminator(struct iso9660 *iso9660, const unsigned char *h) +{ + int i; + + (void)iso9660; /* UNUSED */ + + /* Type of the Volume Descriptor Set Terminator must be 255. */ + if (h[0] != 255) + return (0); + + /* Volume Descriptor Version must be 1. */ + if (h[6] != 1) return (0); - /* ID must be "CD001" */ - if (memcmp(h + SVD_id_offset, "CD001", 5) != 0) + /* Reserved field must be 0. */ + for (i = 7; i < 2048; ++i) + if (h[i] != 0) + return (0); + + return (1); +} + +static int +isJolietSVD(struct iso9660 *iso9660, const unsigned char *h) +{ + const unsigned char *p; + ssize_t logical_block_size; + int32_t volume_block; + + /* Check if current sector is a kind of Supplementary Volume + * Descriptor. */ + if (!isSVD(iso9660, h)) return (0); /* FIXME: do more validations according to joliet spec. */ @@ -431,23 +651,160 @@ isJolietSVD(struct iso9660 *iso9660, con } else /* not joliet */ return (0); - iso9660->logical_block_size = toi(h + SVD_logical_block_size_offset, 2); - if (iso9660->logical_block_size <= 0) + logical_block_size = + archive_le16dec(h + SVD_logical_block_size_offset); + volume_block = archive_le32dec(h + SVD_volume_space_size_offset); + + iso9660->logical_block_size = logical_block_size; + iso9660->volume_block = volume_block; + iso9660->volume_size = logical_block_size * (uint64_t)volume_block; + /* Read Root Directory Record in Volume Descriptor. */ + p = h + SVD_root_directory_record_offset; + iso9660->joliet.location = archive_le32dec(p + DR_extent_offset); + iso9660->joliet.size = archive_le32dec(p + DR_size_offset); + + return (48); +} + +static int +isSVD(struct iso9660 *iso9660, const unsigned char *h) +{ + const unsigned char *p; + ssize_t logical_block_size; + int32_t volume_block; + int32_t location; + int i; + + (void)iso9660; /* UNUSED */ + + /* Type 2 means it's a SVD. */ + if (h[SVD_type_offset] != 2) return (0); - iso9660->volume_size = iso9660->logical_block_size - * (uint64_t)toi(h + SVD_volume_space_size_offset, 4); + /* Reserved field must be 0. */ + for (i = 0; i < SVD_reserved1_size; ++i) + if (h[SVD_reserved1_offset + i] != 0) + return (0); + for (i = 0; i < SVD_reserved2_size; ++i) + if (h[SVD_reserved2_offset + i] != 0) + return (0); + for (i = 0; i < SVD_reserved3_size; ++i) + if (h[SVD_reserved3_offset + i] != 0) + return (0); -#if DEBUG - fprintf(stderr, "Joliet UCS-2 level %d with " - "logical block size:%d, volume size:%d\n", - iso9660->seenJoliet, - iso9660->logical_block_size, iso9660->volume_size); -#endif + /* File structure version must be 1 for ISO9660/ECMA119. */ + if (h[SVD_file_structure_version_offset] != 1) + return (0); + + logical_block_size = + archive_le16dec(h + SVD_logical_block_size_offset); + if (logical_block_size <= 0) + return (0); + + volume_block = archive_le32dec(h + SVD_volume_space_size_offset); + if (volume_block <= SYSTEM_AREA_BLOCK+4) + return (0); + + /* Location of Occurrence of Type L Path Table must be + * available location, + * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + location = archive_le32dec(h+SVD_type_L_path_table_offset); + if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + return (0); + + /* Location of Occurrence of Type M Path Table must be + * available location, + * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + location = archive_be32dec(h+SVD_type_M_path_table_offset); + if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + return (0); + + /* Read Root Directory Record in Volume Descriptor. */ + p = h + SVD_root_directory_record_offset; + if (p[DR_length_offset] != 34) + return (0); + + return (48); +} + +static int +isEVD(struct iso9660 *iso9660, const unsigned char *h) +{ + const unsigned char *p; + ssize_t logical_block_size; + int32_t volume_block; + int32_t location; + int i; + + (void)iso9660; /* UNUSED */ + + /* Type of the Enhanced Volume Descriptor must be 2. */ + if (h[PVD_type_offset] != 2) + return (0); + + /* EVD version must be 2. */ + if (h[PVD_version_offset] != 2) + return (0); + + /* Reserved field must be 0. */ + if (h[PVD_reserved1_offset] != 0) + return (0); + + /* Reserved field must be 0. */ + for (i = 0; i < PVD_reserved2_size; ++i) + if (h[PVD_reserved2_offset + i] != 0) + return (0); + + /* Reserved field must be 0. */ + for (i = 0; i < PVD_reserved3_size; ++i) + if (h[PVD_reserved3_offset + i] != 0) + return (0); + + /* Logical block size must be > 0. */ + /* I've looked at Ecma 119 and can't find any stronger + * restriction on this field. */ + logical_block_size = + archive_le16dec(h + PVD_logical_block_size_offset); + if (logical_block_size <= 0) + return (0); + + volume_block = + archive_le32dec(h + PVD_volume_space_size_offset); + if (volume_block <= SYSTEM_AREA_BLOCK+4) + return (0); + + /* File structure version must be 2 for ISO9660:1999. */ + if (h[PVD_file_structure_version_offset] != 2) + return (0); + + /* Location of Occurrence of Type L Path Table must be + * available location, + * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + location = archive_le32dec(h+PVD_type_1_path_table_offset); + if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + return (0); + + /* Location of Occurrence of Type M Path Table must be + * available location, + * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + location = archive_be32dec(h+PVD_type_m_path_table_offset); + if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + return (0); + + /* Reserved field must be 0. */ + for (i = 0; i < PVD_reserved4_size; ++i) + if (h[PVD_reserved4_offset + i] != 0) + return (0); - /* Store the root directory in the pending list. */ - file = parse_file_info(iso9660, NULL, h + SVD_root_directory_record_offset); - add_entry(iso9660, file); + /* Reserved field must be 0. */ + for (i = 0; i < PVD_reserved5_size; ++i) + if (h[PVD_reserved5_offset + i] != 0) + return (0); + + /* Read Root Directory Record in Volume Descriptor. */ + p = h + PVD_root_directory_record_offset; + if (p[DR_length_offset] != 34) + return (0); return (48); } @@ -455,17 +812,16 @@ isJolietSVD(struct iso9660 *iso9660, con static int isPVD(struct iso9660 *iso9660, const unsigned char *h) { - struct file_info *file; + const unsigned char *p; + ssize_t logical_block_size; + int32_t volume_block; + int32_t location; int i; /* Type of the Primary Volume Descriptor must be 1. */ if (h[PVD_type_offset] != 1) return (0); - /* ID must be "CD001" */ - if (memcmp(h + PVD_id_offset, "CD001", 5) != 0) - return (0); - /* PVD version must be 1. */ if (h[PVD_version_offset] != 1) return (0); @@ -487,17 +843,32 @@ isPVD(struct iso9660 *iso9660, const uns /* Logical block size must be > 0. */ /* I've looked at Ecma 119 and can't find any stronger * restriction on this field. */ - iso9660->logical_block_size = toi(h + PVD_logical_block_size_offset, 2); - if (iso9660->logical_block_size <= 0) + logical_block_size = + archive_le16dec(h + PVD_logical_block_size_offset); + if (logical_block_size <= 0) return (0); - iso9660->volume_size = iso9660->logical_block_size - * (uint64_t)toi(h + PVD_volume_space_size_offset, 4); + volume_block = archive_le32dec(h + PVD_volume_space_size_offset); + if (volume_block <= SYSTEM_AREA_BLOCK+4) + return (0); /* File structure version must be 1 for ISO9660/ECMA119. */ if (h[PVD_file_structure_version_offset] != 1) return (0); + /* Location of Occurrence of Type L Path Table must be + * available location, + * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + location = archive_le32dec(h+PVD_type_1_path_table_offset); + if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + return (0); + + /* Location of Occurrence of Type M Path Table must be + * available location, + * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + location = archive_be32dec(h+PVD_type_m_path_table_offset); + if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + return (0); /* Reserved field must be 0. */ for (i = 0; i < PVD_reserved4_size; ++i) @@ -512,19 +883,239 @@ isPVD(struct iso9660 *iso9660, const uns /* XXX TODO: Check other values for sanity; reject more * malformed PVDs. XXX */ - /* Store the root directory in the pending list. */ - file = parse_file_info(iso9660, NULL, h + PVD_root_directory_record_offset); - add_entry(iso9660, file); + /* Read Root Directory Record in Volume Descriptor. */ + p = h + PVD_root_directory_record_offset; + if (p[DR_length_offset] != 34) + return (0); + + iso9660->logical_block_size = logical_block_size; + iso9660->volume_block = volume_block; + iso9660->volume_size = logical_block_size * (uint64_t)volume_block; + iso9660->primary.location = archive_le32dec(p + DR_extent_offset); + iso9660->primary.size = archive_le32dec(p + DR_size_offset); + return (48); } static int +read_children(struct archive_read *a, struct file_info *parent) +{ + struct iso9660 *iso9660; + const unsigned char *b, *p; + struct file_info *multi; + size_t step; + + iso9660 = (struct iso9660 *)(a->format->data); + if (iso9660->current_position > parent->offset) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Ignoring out-of-order directory (%s) %jd > %jd", + parent->name.s, + iso9660->current_position, + parent->offset); + return (ARCHIVE_WARN); + } + if (parent->offset + parent->size > iso9660->volume_size) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Directory is beyond end-of-media: %s", + parent->name); + return (ARCHIVE_WARN); + } + if (iso9660->current_position < parent->offset) { + int64_t skipsize; + + skipsize = parent->offset - iso9660->current_position; + skipsize = __archive_read_skip(a, skipsize); + if (skipsize < 0) + return ((int)skipsize); + iso9660->current_position = parent->offset; + } + + step = ((parent->size + iso9660->logical_block_size -1) / + iso9660->logical_block_size) * iso9660->logical_block_size; + b = __archive_read_ahead(a, step, NULL); + if (b == NULL) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Failed to read full block when scanning " + "ISO9660 directory list"); + return (ARCHIVE_FATAL); + } + __archive_read_consume(a, step); + iso9660->current_position += step; + multi = NULL; + while (step) { + p = b; + b += iso9660->logical_block_size; + step -= iso9660->logical_block_size; + for (; *p != 0 && p < b && p + *p <= b; p += *p) { + struct file_info *child; + + /* N.B.: these special directory identifiers + * are 8 bit "values" even on a + * Joliet CD with UCS-2 (16bit) encoding. + */ + + /* Skip '.' entry. */ + if (*(p + DR_name_len_offset) == 1 + && *(p + DR_name_offset) == '\0') + continue; + /* Skip '..' entry. */ + if (*(p + DR_name_len_offset) == 1 + && *(p + DR_name_offset) == '\001') + continue; + child = parse_file_info(a, parent, p); + if (child == NULL) + return (ARCHIVE_FATAL); + if (child->cl_offset) + heap_add_entry(&(iso9660->cl_files), + child, child->cl_offset); + else { + if (child->multi_extent || multi != NULL) { + struct content *con; + + if (multi == NULL) { + multi = child; + multi->contents.first = NULL; + multi->contents.last = + &(multi->contents.first); + } + con = malloc(sizeof(struct content)); + if (con == NULL) { + release_file(iso9660, child); + archive_set_error( + &a->archive, ENOMEM, + "No memory for " + "multi extent"); + return (ARCHIVE_FATAL); + } + con->offset = child->offset; + con->size = child->size; + con->next = NULL; + *multi->contents.last = con; + multi->contents.last = &(con->next); + if (multi == child) + add_entry(iso9660, child); + else { + multi->size += child->size; + if (!child->multi_extent) + multi = NULL; + release_file(iso9660, child); + } + } else + add_entry(iso9660, child); + } + } + } + + /* Read data which recorded by RRIP "CE" extension. */ + if (read_CE(a, iso9660) != ARCHIVE_OK) + return (ARCHIVE_FATAL); + + return (ARCHIVE_OK); +} + +static int +relocate_dir(struct iso9660 *iso9660, struct file_info *file) +{ + struct file_info *re; + + re = heap_get_entry(&(iso9660->re_dirs)); + while (re != NULL && re->offset < file->cl_offset) { + /* This case is wrong pattern. + * But dont't reject this directory entry to be robust. */ + cache_add_entry(iso9660, re); + re = heap_get_entry(&(iso9660->re_dirs)); + } + if (re == NULL) + /* This case is wrong pattern. */ + return (0); + if (re->offset == file->cl_offset) { + re->parent->refcount--; + re->parent->subdirs--; + re->parent = file->parent; + re->parent->refcount++; + re->parent->subdirs++; + cache_add_to_next_of_parent(iso9660, re); + return (1); + } else + /* This case is wrong pattern. */ + heap_add_entry(&(iso9660->re_dirs), re, re->offset); + return (0); +} + +static int +read_entries(struct archive_read *a) +{ + struct iso9660 *iso9660; + struct file_info *file; + int r; + + iso9660 = (struct iso9660 *)(a->format->data); + + while ((file = next_entry(iso9660)) != NULL && + (file->mode & AE_IFMT) == AE_IFDIR) { + r = read_children(a, file); + if (r != ARCHIVE_OK) + return (r); + + if (iso9660->seenRockridge && + file->parent != NULL && + file->parent->parent == NULL && + iso9660->rr_moved == NULL && + (strcmp(file->name.s, "rr_moved") == 0 || + strcmp(file->name.s, ".rr_moved") == 0)) { + iso9660->rr_moved = file; + } else if (file->re) + heap_add_entry(&(iso9660->re_dirs), file, + file->offset); + else + cache_add_entry(iso9660, file); + } + if (file != NULL) + add_entry(iso9660, file); + + if (iso9660->rr_moved != NULL) { + /* + * Relocate directory which rr_moved has. + */ + while ((file = heap_get_entry(&(iso9660->cl_files))) != NULL) { + relocate_dir(iso9660, file); + release_file(iso9660, file); + } + + /* If rr_moved directory still has children, + * Add rr_moved into pending_files to show + */ + if (iso9660->rr_moved->subdirs) { + cache_add_entry(iso9660, iso9660->rr_moved); + /* If entries which have "RE" extension are still + * remaining(this case is unlikely except ISO image + * is broken), the entries won't be exposed. */ + while ((file = heap_get_entry(&(iso9660->re_dirs))) != NULL) + cache_add_entry(iso9660, file); + } else { + iso9660->rr_moved->parent->subdirs--; + release_file(iso9660, iso9660->rr_moved); + } + } else { + /* + * In case ISO image is broken. If the name of rr_moved + * directory has been changed by damage, subdirectories + * of rr_moved entry won't be exposed. + */ + while ((file = heap_get_entry(&(iso9660->re_dirs))) != NULL) + cache_add_entry(iso9660, file); + } + + return (ARCHIVE_OK); +} + +static int archive_read_format_iso9660_read_header(struct archive_read *a, struct archive_entry *entry) { struct iso9660 *iso9660; struct file_info *file; - int r; + int r, rd_r; iso9660 = (struct iso9660 *)(a->format->data); @@ -533,6 +1124,94 @@ archive_read_format_iso9660_read_header( a->archive.archive_format_name = "ISO9660"; } + if (iso9660->current_position == 0) { + int64_t skipsize; + struct vd *vd; + const void *block; + char seenJoliet; + + vd = &(iso9660->primary); + if (!iso9660->opt_support_joliet) + iso9660->seenJoliet = 0; + if (iso9660->seenJoliet && + vd->location > iso9660->joliet.location) + /* This condition is unlikely; by way of caution. */ + vd = &(iso9660->joliet); + + skipsize = LOGICAL_BLOCK_SIZE * vd->location; + skipsize = __archive_read_skip(a, skipsize); + if (skipsize < 0) + return ((int)skipsize); + iso9660->current_position = skipsize; + + block = __archive_read_ahead(a, vd->size, NULL); + if (block == NULL) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "Failed to read full block when scanning " + "ISO9660 directory list"); + return (ARCHIVE_FATAL); + } + + /* + * While reading Root Directory, flag seenJoliet + * must be zero to avoid converting special name + * 0x00(Current Directory) and next byte to UCS2. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 05:59:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BDC51065693; Wed, 30 Dec 2009 05:59:22 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDD218FC1F; Wed, 30 Dec 2009 05:59:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBU5xLvZ048419; Wed, 30 Dec 2009 05:59:21 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBU5xL6a048415; Wed, 30 Dec 2009 05:59:21 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912300559.nBU5xL6a048415@svn.freebsd.org> From: Tim Kientzle Date: Wed, 30 Dec 2009 05:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201247 - head/lib/libarchive/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 05:59:22 -0000 Author: kientzle Date: Wed Dec 30 05:59:21 2009 New Revision: 201247 URL: http://svn.freebsd.org/changeset/base/201247 Log: A raft of test changes and improvements from the Googlecode repository. In particular, this includes tests for the new features I've merged over the last few days. Added: head/lib/libarchive/test/test_compat_cpio.c (contents, props changed) head/lib/libarchive/test/test_compat_cpio_1.cpio.uu (contents, props changed) head/lib/libarchive/test/test_compat_lzma.c (contents, props changed) head/lib/libarchive/test/test_compat_lzma_1.tlz.uu (contents, props changed) head/lib/libarchive/test/test_compat_lzma_2.tlz.uu (contents, props changed) head/lib/libarchive/test/test_compat_lzma_3.tlz.uu (contents, props changed) head/lib/libarchive/test/test_fuzz_1.iso.Z.uu (contents, props changed) head/lib/libarchive/test/test_read_format_ar.ar.uu (contents, props changed) head/lib/libarchive/test/test_read_format_cpio_bin_lzma.c (contents, props changed) head/lib/libarchive/test/test_read_format_iso.iso.Z.uu (contents, props changed) head/lib/libarchive/test/test_read_format_iso_joliet.iso.Z.uu (contents, props changed) head/lib/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu (contents, props changed) head/lib/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu (contents, props changed) head/lib/libarchive/test/test_read_format_iso_multi_extent.c (contents, props changed) head/lib/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu (contents, props changed) head/lib/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu (contents, props changed) head/lib/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu (contents, props changed) head/lib/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu (contents, props changed) head/lib/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu (contents, props changed) head/lib/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu (contents, props changed) head/lib/libarchive/test/test_read_format_isojoliet_long.c (contents, props changed) head/lib/libarchive/test/test_read_format_isojoliet_rr.c (contents, props changed) head/lib/libarchive/test/test_read_format_isorr_ce.c (contents, props changed) head/lib/libarchive/test/test_read_format_isorr_new_bz2.c (contents, props changed) head/lib/libarchive/test/test_read_format_isorr_rr_moved.c (contents, props changed) head/lib/libarchive/test/test_read_format_isozisofs_bz2.c (contents, props changed) head/lib/libarchive/test/test_read_format_mtree.mtree.uu (contents, props changed) head/lib/libarchive/test/test_read_format_tlz.c (contents, props changed) head/lib/libarchive/test/test_write_disk_symlink.c (contents, props changed) head/lib/libarchive/test/test_write_format_zip.c (contents, props changed) head/lib/libarchive/test/test_write_format_zip_empty.c (contents, props changed) head/lib/libarchive/test/test_write_format_zip_no_compression.c (contents, props changed) Modified: head/lib/libarchive/test/Makefile head/lib/libarchive/test/main.c head/lib/libarchive/test/test.h head/lib/libarchive/test/test_acl_pax.c head/lib/libarchive/test/test_compat_bzip2.c head/lib/libarchive/test/test_compat_solaris_tar_acl.c head/lib/libarchive/test/test_entry.c head/lib/libarchive/test/test_entry_strmode.c head/lib/libarchive/test/test_extattr_freebsd.c head/lib/libarchive/test/test_fuzz.c head/lib/libarchive/test/test_open_fd.c head/lib/libarchive/test/test_open_file.c head/lib/libarchive/test/test_pax_filename_encoding.c head/lib/libarchive/test/test_read_compress_program.c head/lib/libarchive/test/test_read_data_large.c head/lib/libarchive/test/test_read_disk.c head/lib/libarchive/test/test_read_disk_entry_from_file.c head/lib/libarchive/test/test_read_extract.c head/lib/libarchive/test/test_read_format_ar.c head/lib/libarchive/test/test_read_format_cpio_bin_bz2.c head/lib/libarchive/test/test_read_format_iso_gz.c head/lib/libarchive/test/test_read_format_isojoliet_bz2.c head/lib/libarchive/test/test_read_format_isorr_bz2.c head/lib/libarchive/test/test_read_format_mtree.c head/lib/libarchive/test/test_read_format_pax_bz2.c head/lib/libarchive/test/test_read_format_tar.c head/lib/libarchive/test/test_read_format_tbz.c head/lib/libarchive/test/test_read_large.c head/lib/libarchive/test/test_tar_large.c head/lib/libarchive/test/test_write_compress_program.c head/lib/libarchive/test/test_write_disk.c head/lib/libarchive/test/test_write_disk_failures.c head/lib/libarchive/test/test_write_disk_hardlink.c head/lib/libarchive/test/test_write_disk_perms.c head/lib/libarchive/test/test_write_disk_secure.c head/lib/libarchive/test/test_write_disk_sparse.c head/lib/libarchive/test/test_write_disk_times.c head/lib/libarchive/test/test_write_format_cpio_empty.c head/lib/libarchive/test/test_write_format_cpio_newc.c head/lib/libarchive/test/test_write_format_cpio_odc.c head/lib/libarchive/test/test_write_format_tar_ustar.c Modified: head/lib/libarchive/test/Makefile ============================================================================== --- head/lib/libarchive/test/Makefile Wed Dec 30 05:30:35 2009 (r201246) +++ head/lib/libarchive/test/Makefile Wed Dec 30 05:59:21 2009 (r201247) @@ -14,8 +14,10 @@ TESTS= \ test_archive_api_feature.c \ test_bad_fd.c \ test_compat_bzip2.c \ + test_compat_cpio.c \ test_compat_gtar.c \ test_compat_gzip.c \ + test_compat_lzma.c \ test_compat_solaris_tar_acl.c \ test_compat_tar_hardlink.c \ test_compat_xz.c \ @@ -42,6 +44,7 @@ TESTS= \ test_read_format_cpio_bin_be.c \ test_read_format_cpio_bin_bz2.c \ test_read_format_cpio_bin_gz.c \ + test_read_format_cpio_bin_lzma.c \ test_read_format_cpio_bin_xz.c \ test_read_format_cpio_odc.c \ test_read_format_cpio_svr4_gzip.c \ @@ -51,8 +54,15 @@ TESTS= \ test_read_format_gtar_lzma.c \ test_read_format_gtar_sparse.c \ test_read_format_iso_gz.c \ + test_read_format_iso_multi_extent.c \ + test_read_format_isorr_rr_moved.c \ test_read_format_isojoliet_bz2.c \ + test_read_format_isojoliet_long.c \ + test_read_format_isojoliet_rr.c \ test_read_format_isorr_bz2.c \ + test_read_format_isorr_ce.c \ + test_read_format_isorr_new_bz2.c \ + test_read_format_isozisofs_bz2.c \ test_read_format_mtree.c \ test_read_format_pax_bz2.c \ test_read_format_raw.c \ @@ -60,6 +70,7 @@ TESTS= \ test_read_format_tar_empty_filename.c \ test_read_format_tbz.c \ test_read_format_tgz.c \ + test_read_format_tlz.c \ test_read_format_txz.c \ test_read_format_tz.c \ test_read_format_zip.c \ @@ -82,6 +93,7 @@ TESTS= \ test_write_disk_perms.c \ test_write_disk_secure.c \ test_write_disk_sparse.c \ + test_write_disk_symlink.c \ test_write_disk_times.c \ test_write_format_ar.c \ test_write_format_cpio.c \ @@ -94,6 +106,9 @@ TESTS= \ test_write_format_tar.c \ test_write_format_tar_empty.c \ test_write_format_tar_ustar.c \ + test_write_format_zip.c \ + test_write_format_zip_empty.c \ + test_write_format_zip_no_compression.c \ test_write_open_memory.c @@ -108,16 +123,12 @@ NO_MAN=yes PROG=libarchive_test INTERNALPROG=yes # Don't install this; it's just for testing -DPADD=${LIBBZ2} ${LIBZ} +DPADD=${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBCRYPTO} ${LIBBSDXML} CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" -LDADD= -lz -lbz2 -lmd -lcrypto +LDADD= -lz -lbz2 -lmd -lcrypto -lbsdxml CFLAGS+= -g CFLAGS+= -I${LA_SRCDIR} -I. -# Uncomment to build and test lzma support via liblzmadec -#CFLAGS+= -I/usr/local/include -DHAVE_LIBLZMADEC=1 -DHAVE_LZMADEC_H=1 -#LDADD+= -L/usr/local/lib -llzmadec - # Uncomment to build and test lzma and xz support via liblzma #CFLAGS+= -I/usr/local/include -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 #LDADD+= -L/usr/local/lib -llzma @@ -125,11 +136,11 @@ CFLAGS+= -I${LA_SRCDIR} -I. # Uncomment to link against dmalloc #LDADD+= -L/usr/local/lib -ldmalloc #CFLAGS+= -I/usr/local/include -DUSE_DMALLOC -WARNS=6 +#WARNS=6 # Build libarchive_test and run it. check test: libarchive_test - ./libarchive_test -v -r ${.CURDIR} + ./libarchive_test -r ${.CURDIR} # list.h is just a list of all tests, as indicated by DEFINE_TEST macro lines list.h: ${TESTS} Makefile Modified: head/lib/libarchive/test/main.c ============================================================================== --- head/lib/libarchive/test/main.c Wed Dec 30 05:30:35 2009 (r201246) +++ head/lib/libarchive/test/main.c Wed Dec 30 05:59:21 2009 (r201247) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2003-2009 Tim Kientzle * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,74 +23,142 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * Various utility routines useful for test programs. - * Each test program is linked against this file. - */ #include "test.h" - #include #include #include #include -#if defined(_WIN32) && !defined(__CYGWIN__) -#include -#include -#include -#endif /* * This same file is used pretty much verbatim for all test harnesses. * * The next few lines are the only differences. + * TODO: Move this into a separate configuration header, have all test + * suites share one copy of this file. */ +__FBSDID("$FreeBSD$"); +#define KNOWNREF "test_compat_gtar_1.tar.uu" +#define ENVBASE "LIBARCHIVE" /* Prefix for environment variables. */ #undef PROGRAM /* Testing a library, not a program. */ #define LIBRARY "libarchive" -#define ENVBASE "LIBARCHIVE" /* Prefix for environment variables. */ #define EXTRA_DUMP(x) archive_error_string((struct archive *)(x)) #define EXTRA_VERSION archive_version() -#define KNOWNREF "test_compat_gtar_1.tar.uu" -__FBSDID("$FreeBSD$"); /* - * "list.h" is simply created by "grep DEFINE_TEST"; it has - * a line like - * DEFINE_TEST(test_function) - * for each test. - * Include it here with a suitable DEFINE_TEST to declare all of the - * test functions. + * + * Windows support routines + * + * Note: Configuration is a tricky issue. Using HAVE_* feature macros + * in the test harness is dangerous because they cover up + * configuration errors. The classic example of this is omitting a + * configure check. If libarchive and libarchive_test both look for + * the same feature macro, such errors are hard to detect. Platform + * macros (e.g., _WIN32 or __GNUC__) are a little better, but can + * easily lead to very messy code. It's best to limit yourself + * to only the most generic programming techniques in the test harness + * and thus avoid conditionals altogether. Where that's not possible, + * try to minimize conditionals by grouping platform-specific tests in + * one place (e.g., test_acl_freebsd) or by adding new assert() + * functions (e.g., assertMakeHardlink()) to cover up platform + * differences. Platform-specific coding in libarchive_test is often + * a symptom that some capability is missing from libarchive itself. */ -#undef DEFINE_TEST -#define DEFINE_TEST(name) void name(void); -#include "list.h" +#if defined(_WIN32) && !defined(__CYGWIN__) +#include +#include +#ifndef F_OK +#define F_OK (0) +#endif +#ifndef S_ISDIR +#define S_ISDIR(m) ((m) & _S_IFDIR) +#endif +#ifndef S_ISREG +#define S_ISREG(m) ((m) & _S_IFREG) +#endif +#if !defined(__BORLANDC__) +#define access _access +#define chdir _chdir +#endif +#ifndef fileno +#define fileno _fileno +#endif +/*#define fstat _fstat64*/ +#if !defined(__BORLANDC__) +#define getcwd _getcwd +#endif +#define lstat stat +/*#define lstat _stat64*/ +/*#define stat _stat64*/ +#define rmdir _rmdir +#if !defined(__BORLANDC__) +#define strdup _strdup +#define umask _umask +#endif +#define int64_t __int64 +#endif -/* Interix doesn't define these in a standard header. */ -#if __INTERIX__ -extern char *optarg; -extern int optind; +#if defined(HAVE__CrtSetReportMode) +# include #endif -/* Enable core dump on failure. */ -static int dump_on_failure = 0; -/* Default is to remove temp dirs for successful tests. */ -static int keep_temp_files = 0; -/* Default is to print some basic information about each test. */ -static int quiet_flag = 0; -/* Default is to summarize repeated failures. */ -static int verbose = 0; -/* Cumulative count of component failures. */ -static int failures = 0; -/* Cumulative count of skipped component tests. */ -static int skips = 0; -/* Cumulative count of assertions. */ -static int assertions = 0; +#if defined(_WIN32) && !defined(__CYGWIN__) +void *GetFunctionKernel32(const char *name) +{ + static HINSTANCE lib; + static int set; + if (!set) { + set = 1; + lib = LoadLibrary("kernel32.dll"); + } + if (lib == NULL) { + fprintf(stderr, "Can't load kernel32.dll?!\n"); + exit(1); + } + return (void *)GetProcAddress(lib, name); +} -/* Directory where uuencoded reference files can be found. */ -static const char *refdir; +static int +my_CreateSymbolicLinkA(const char *linkname, const char *target, int flags) +{ + static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, DWORD); + static int set; + if (!set) { + set = 1; + f = GetFunctionKernel32("CreateSymbolicLinkA"); + } + return f == NULL ? 0 : (*f)(linkname, target, flags); +} +static int +my_CreateHardLinkA(const char *linkname, const char *target) +{ + static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES); + static int set; + if (!set) { + set = 1; + f = GetFunctionKernel32("CreateHardLinkA"); + } + return f == NULL ? 0 : (*f)(linkname, target, NULL); +} -#if defined(_WIN32) && !defined(__CYGWIN__) +int +my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi) +{ + HANDLE h; + int r; + memset(bhfi, 0, sizeof(*bhfi)); + h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (h == INVALID_HANDLE_VALUE) + return (0); + r = GetFileInformationByHandle(h, bhfi); + CloseHandle(h); + return (r); +} +#endif + +#if defined(HAVE__CrtSetReportMode) static void invalid_parameter_handler(const wchar_t * expression, const wchar_t * function, const wchar_t * file, @@ -98,123 +166,181 @@ invalid_parameter_handler(const wchar_t { /* nop */ } - #endif /* - * My own implementation of the standard assert() macro emits the - * message in the same format as GCC (file:line: message). - * It also includes some additional useful information. - * This makes it a lot easier to skim through test failures in - * Emacs. ;-) * - * It also supports a few special features specifically to simplify - * test harnesses: - * failure(fmt, args) -- Stores a text string that gets - * printed if the following assertion fails, good for - * explaining subtle tests. + * OPTIONS FLAGS + * */ -static char msg[4096]; -/* - * For each test source file, we remember how many times each - * failure was reported. - */ -static const char *failed_filename = NULL; -static struct line { - int line; - int count; - int critical; -} failed_lines[1000]; +/* Enable core dump on failure. */ +static int dump_on_failure = 0; +/* Default is to remove temp dirs and log data for successful tests. */ +static int keep_temp_files = 0; +/* Default is to just report pass/fail for each test. */ +static int verbosity = 0; +#define VERBOSITY_SUMMARY_ONLY -1 /* -q */ +#define VERBOSITY_PASSFAIL 0 /* Default */ +#define VERBOSITY_LIGHT_REPORT 1 /* -v */ +#define VERBOSITY_FULL 2 /* -vv */ +/* A few places generate even more output for verbosity > VERBOSITY_FULL, + * mostly for debugging the test harness itself. */ +/* Cumulative count of assertion failures. */ +static int failures = 0; +/* Cumulative count of reported skips. */ +static int skips = 0; +/* Cumulative count of assertions checked. */ +static int assertions = 0; + +/* Directory where uuencoded reference files can be found. */ +static const char *refdir; /* - * Called at the beginning of each assert() function. + * Report log information selectively to console and/or disk log. */ +static int log_console = 0; +static FILE *logfile; static void -count_assertion(const char *file, int line) +vlogprintf(const char *fmt, va_list ap) { - (void)file; /* UNUSED */ - (void)line; /* UNUSED */ - ++assertions; - /* Uncomment to print file:line after every assertion. - * Verbose, but occasionally useful in tracking down crashes. */ - /* printf("Checked %s:%d\n", file, line); */ +#ifdef va_copy + va_list lfap; + va_copy(lfap, ap); +#endif + if (log_console) + vfprintf(stdout, fmt, ap); + if (logfile != NULL) +#ifdef va_copy + vfprintf(logfile, fmt, lfap); + va_end(lfap); +#else + vfprintf(logfile, fmt, ap); +#endif } -/* - * Count this failure; return the number of previous failures. - */ -static int -previous_failures(const char *filename, int line, int critical) +static void +logprintf(const char *fmt, ...) { - unsigned int i; - int count; - - if (failed_filename == NULL || strcmp(failed_filename, filename) != 0) - memset(failed_lines, 0, sizeof(failed_lines)); - failed_filename = filename; + va_list ap; + va_start(ap, fmt); + vlogprintf(fmt, ap); + va_end(ap); +} - for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) { - if (failed_lines[i].line == line) { - count = failed_lines[i].count; - failed_lines[i].count++; - return (count); - } - if (failed_lines[i].line == 0) { - failed_lines[i].line = line; - failed_lines[i].count = 1; - failed_lines[i].critical = critical; - return (0); - } - } - return (0); +/* Set up a message to display only if next assertion fails. */ +static char msgbuff[4096]; +static const char *msg, *nextmsg; +void +failure(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vsprintf(msgbuff, fmt, ap); + va_end(ap); + nextmsg = msgbuff; } /* * Copy arguments into file-local variables. + * This was added to permit vararg assert() functions without needing + * variadic wrapper macros. Turns out that the vararg capability is almost + * never used, so almost all of the vararg assertions can be simplified + * by removing the vararg capability and reworking the wrapper macro to + * pass __FILE__, __LINE__ directly into the function instead of using + * this hook. I suspect this machinery is used so rarely that we + * would be better off just removing it entirely. That would simplify + * the code here noticably. */ static const char *test_filename; static int test_line; static void *test_extra; -void test_setup(const char *filename, int line) +void assertion_setup(const char *filename, int line) { test_filename = filename; test_line = line; } +/* Called at the beginning of each assert() function. */ +static void +assertion_count(const char *file, int line) +{ + (void)file; /* UNUSED */ + (void)line; /* UNUSED */ + ++assertions; + /* Proper handling of "failure()" message. */ + msg = nextmsg; + nextmsg = NULL; + /* Uncomment to print file:line after every assertion. + * Verbose, but occasionally useful in tracking down crashes. */ + /* printf("Checked %s:%d\n", file, line); */ +} + /* - * Inform user that we're skipping a test. + * For each test source file, we remember how many times each + * assertion was reported. Cleared before each new test, + * used by test_summarize(). */ -void -test_skipping(const char *fmt, ...) +static struct line { + int count; + int skip; +} failed_lines[10000]; + +/* Count this failure, setup up log destination and handle initial report. */ +static void +failure_start(const char *filename, int line, const char *fmt, ...) { va_list ap; - if (previous_failures(test_filename, test_line, 0)) - return; + /* Record another failure for this line. */ + ++failures; + /* test_filename = filename; */ + failed_lines[line].count++; + + /* Determine whether to log header to console. */ + switch (verbosity) { + case VERBOSITY_LIGHT_REPORT: + log_console = (failed_lines[line].count < 2); + break; + default: + log_console = (verbosity >= VERBOSITY_FULL); + } + /* Log file:line header for this failure */ va_start(ap, fmt); - fprintf(stderr, " *** SKIPPING: "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); +#if _MSC_VER + logprintf("%s(%d): ", filename, line); +#else + logprintf("%s:%d: ", filename, line); +#endif + vlogprintf(fmt, ap); va_end(ap); - ++skips; + logprintf("\n"); + + if (msg != NULL && msg[0] != '\0') { + logprintf(" Description: %s\n", msg); + msg = NULL; + } + + /* Determine whether to log details to console. */ + if (verbosity == VERBOSITY_LIGHT_REPORT) + log_console = 0; } -/* Common handling of failed tests. */ +/* Complete reporting of failed tests. */ +/* + * The 'extra' hook here is used by libarchive to include libarchive + * error messages with assertion failures. It could also be used + * to add strerror() output, for example. Just define the EXTRA_DUMP() + * macro appropriately. + */ static void -report_failure(void *extra) +failure_finish(void *extra) { - if (msg[0] != '\0') { - fprintf(stderr, " Description: %s\n", msg); - msg[0] = '\0'; - } - + (void)extra; /* UNUSED (maybe) */ #ifdef EXTRA_DUMP if (extra != NULL) - fprintf(stderr, " detail: %s\n", EXTRA_DUMP(extra)); -#else - (void)extra; /* UNUSED */ + logprintf(" detail: %s\n", EXTRA_DUMP(extra)); #endif if (dump_on_failure) { @@ -225,203 +351,154 @@ report_failure(void *extra) } } -/* - * Summarize repeated failures in the just-completed test file. - * The reports above suppress multiple failures from the same source - * line; this reports on any tests that did fail multiple times. - */ -static int -summarize_comparator(const void *a0, const void *b0) -{ - const struct line *a = a0, *b = b0; - if (a->line == 0 && b->line == 0) - return (0); - if (a->line == 0) - return (1); - if (b->line == 0) - return (-1); - return (a->line - b->line); -} - -static void -summarize(void) -{ - unsigned int i; - - qsort(failed_lines, sizeof(failed_lines)/sizeof(failed_lines[0]), - sizeof(failed_lines[0]), summarize_comparator); - for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) { - if (failed_lines[i].line == 0) - break; - if (failed_lines[i].count > 1 && failed_lines[i].critical) - fprintf(stderr, "%s:%d: Failed %d times\n", - failed_filename, failed_lines[i].line, - failed_lines[i].count); - } - /* Clear the failure history for the next file. */ - memset(failed_lines, 0, sizeof(failed_lines)); -} - -/* Set up a message to display only after a test fails. */ +/* Inform user that we're skipping some checks. */ void -failure(const char *fmt, ...) +test_skipping(const char *fmt, ...) { + char buff[1024]; va_list ap; + va_start(ap, fmt); - vsprintf(msg, fmt, ap); + vsprintf(buff, fmt, ap); va_end(ap); + /* failure_start() isn't quite right, but is awfully convenient. */ + failure_start(test_filename, test_line, "SKIPPING: %s", buff); + --failures; /* Undo failures++ in failure_start() */ + /* Don't failure_finish() here. */ + /* Mark as skip, so doesn't count as failed test. */ + failed_lines[test_line].skip = 1; + ++skips; } +/* + * + * ASSERTIONS + * + */ + /* Generic assert() just displays the failed condition. */ int -test_assert(const char *file, int line, int value, const char *condition, void *extra) +assertion_assert(const char *file, int line, int value, + const char *condition, void *extra) { - count_assertion(file, line); - if (value) { - msg[0] = '\0'; - return (value); + assertion_count(file, line); + if (!value) { + failure_start(file, line, "Assertion failed: %s", condition); + failure_finish(extra); } - failures ++; - if (!verbose && previous_failures(file, line, 1)) - return (value); - fprintf(stderr, "%s:%d: Assertion failed\n", file, line); - fprintf(stderr, " Condition: %s\n", condition); - report_failure(extra); return (value); } -/* assertEqualInt() displays the values of the two integers. */ +/* chdir() and report any errors */ int -test_assert_equal_int(const char *file, int line, - int v1, const char *e1, int v2, const char *e2, void *extra) +assertion_chdir(const char *file, int line, const char *pathname) { - count_assertion(file, line); - if (v1 == v2) { - msg[0] = '\0'; + assertion_count(file, line); + if (chdir(pathname) == 0) return (1); - } - failures ++; - if (!verbose && previous_failures(file, line, 1)) - return (0); - fprintf(stderr, "%s:%d: Assertion failed: Ints not equal\n", - file, line); - fprintf(stderr, " %s=%d\n", e1, v1); - fprintf(stderr, " %s=%d\n", e2, v2); - report_failure(extra); + failure_start(file, line, "chdir(\"%s\")", pathname); + failure_finish(NULL); + return (0); + +} + +/* Verify two integers are equal. */ +int +assertion_equal_int(const char *file, int line, + long long v1, const char *e1, long long v2, const char *e2, void *extra) +{ + assertion_count(file, line); + if (v1 == v2) + return (1); + failure_start(file, line, "%s != %s", e1, e2); + logprintf(" %s=%lld (0x%llx, 0%llo)\n", e1, v1, v1, v1); + logprintf(" %s=%lld (0x%llx, 0%llo)\n", e2, v2, v2, v2); + failure_finish(extra); return (0); } -static void strdump(const char *p) +static void strdump(const char *e, const char *p) { + const char *q = p; + + logprintf(" %s = ", e); if (p == NULL) { - fprintf(stderr, "(null)"); + logprintf("NULL"); return; } - fprintf(stderr, "\""); + logprintf("\""); while (*p != '\0') { unsigned int c = 0xff & *p++; switch (c) { - case '\a': fprintf(stderr, "\a"); break; - case '\b': fprintf(stderr, "\b"); break; - case '\n': fprintf(stderr, "\n"); break; - case '\r': fprintf(stderr, "\r"); break; + case '\a': printf("\a"); break; + case '\b': printf("\b"); break; + case '\n': printf("\n"); break; + case '\r': printf("\r"); break; default: if (c >= 32 && c < 127) - fprintf(stderr, "%c", c); + logprintf("%c", c); else - fprintf(stderr, "\\x%02X", c); + logprintf("\\x%02X", c); } } - fprintf(stderr, "\""); + logprintf("\""); + logprintf(" (length %d)\n", q == NULL ? -1 : (int)strlen(q)); } -/* assertEqualString() displays the values of the two strings. */ +/* Verify two strings are equal, dump them if not. */ int -test_assert_equal_string(const char *file, int line, +assertion_equal_string(const char *file, int line, const char *v1, const char *e1, const char *v2, const char *e2, void *extra) { - count_assertion(file, line); - if (v1 == NULL || v2 == NULL) { - if (v1 == v2) { - msg[0] = '\0'; - return (1); - } - } else if (strcmp(v1, v2) == 0) { - msg[0] = '\0'; + assertion_count(file, line); + if (v1 == v2 || (v1 != NULL && v2 != NULL && strcmp(v1, v2) == 0)) return (1); - } - failures ++; - if (!verbose && previous_failures(file, line, 1)) - return (0); - fprintf(stderr, "%s:%d: Assertion failed: Strings not equal\n", - file, line); - fprintf(stderr, " %s = ", e1); - strdump(v1); - fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : (int)strlen(v1)); - fprintf(stderr, " %s = ", e2); - strdump(v2); - fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : (int)strlen(v2)); - report_failure(extra); + failure_start(file, line, "%s != %s", e1, e2); + strdump(e1, v1); + strdump(e2, v2); + failure_finish(extra); return (0); } -static void wcsdump(const wchar_t *w) +static void +wcsdump(const char *e, const wchar_t *w) { + logprintf(" %s = ", e); if (w == NULL) { - fprintf(stderr, "(null)"); + logprintf("(null)"); return; } - fprintf(stderr, "\""); + logprintf("\""); while (*w != L'\0') { unsigned int c = *w++; if (c >= 32 && c < 127) - fprintf(stderr, "%c", c); + logprintf("%c", c); else if (c < 256) - fprintf(stderr, "\\x%02X", c); + logprintf("\\x%02X", c); else if (c < 0x10000) - fprintf(stderr, "\\u%04X", c); + logprintf("\\u%04X", c); else - fprintf(stderr, "\\U%08X", c); + logprintf("\\U%08X", c); } - fprintf(stderr, "\""); + logprintf("\"\n"); } -/* assertEqualWString() displays the values of the two strings. */ +/* Verify that two wide strings are equal, dump them if not. */ int -test_assert_equal_wstring(const char *file, int line, +assertion_equal_wstring(const char *file, int line, const wchar_t *v1, const char *e1, const wchar_t *v2, const char *e2, void *extra) { - count_assertion(file, line); - if (v1 == NULL) { - if (v2 == NULL) { - msg[0] = '\0'; - return (1); - } - } else if (v2 == NULL) { - if (v1 == NULL) { - msg[0] = '\0'; - return (1); - } - } else if (wcscmp(v1, v2) == 0) { - msg[0] = '\0'; + assertion_count(file, line); + if (v1 == v2 || wcscmp(v1, v2) == 0) return (1); - } - failures ++; - if (!verbose && previous_failures(file, line, 1)) - return (0); - fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n", - file, line); - fprintf(stderr, " %s = ", e1); - wcsdump(v1); - fprintf(stderr, "\n"); - fprintf(stderr, " %s = ", e2); - wcsdump(v2); - fprintf(stderr, "\n"); - report_failure(extra); + failure_start(file, line, "%s != %s", e1, e2); + wcsdump(e1, v1); + wcsdump(e2, v2); + failure_finish(extra); return (0); } @@ -436,35 +513,40 @@ hexdump(const char *p, const char *ref, size_t i, j; char sep; + if (p == NULL) { + logprintf("(null)\n"); + return; + } for(i=0; i < l; i+=16) { - fprintf(stderr, "%04x", (unsigned)(i + offset)); + logprintf("%04x", (unsigned)(i + offset)); sep = ' '; for (j = 0; j < 16 && i + j < l; j++) { if (ref != NULL && p[i + j] != ref[i + j]) sep = '_'; - fprintf(stderr, "%c%02x", sep, 0xff & (int)p[i+j]); + logprintf("%c%02x", sep, 0xff & (int)p[i+j]); if (ref != NULL && p[i + j] == ref[i + j]) sep = ' '; } for (; j < 16; j++) { - fprintf(stderr, "%c ", sep); + logprintf("%c ", sep); sep = ' '; } - fprintf(stderr, "%c", sep); + logprintf("%c", sep); for (j=0; j < 16 && i + j < l; j++) { int c = p[i + j]; if (c >= ' ' && c <= 126) - fprintf(stderr, "%c", c); + logprintf("%c", c); else - fprintf(stderr, "."); + logprintf("."); } - fprintf(stderr, "\n"); + logprintf("\n"); } } -/* assertEqualMem() displays the values of the two memory blocks. */ +/* Verify that two blocks of memory are the same, display the first + * block of differences if they're not. */ int -test_assert_equal_mem(const char *file, int line, +assertion_equal_mem(const char *file, int line, const void *_v1, const char *e1, const void *_v2, const char *e2, size_t l, const char *ld, void *extra) @@ -473,200 +555,906 @@ test_assert_equal_mem(const char *file, const char *v2 = (const char *)_v2; size_t offset; - count_assertion(file, line); - if (v1 == NULL || v2 == NULL) { - if (v1 == v2) { - msg[0] = '\0'; - return (1); - } - } else if (memcmp(v1, v2, l) == 0) { - msg[0] = '\0'; + assertion_count(file, line); + if (v1 == v2 || (v1 != NULL && v2 != NULL && memcmp(v1, v2, l) == 0)) return (1); - } - failures ++; - if (!verbose && previous_failures(file, line, 1)) - return (0); - fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n", - file, line); - fprintf(stderr, " size %s = %d\n", ld, (int)l); + + failure_start(file, line, "%s != %s", e1, e2); + logprintf(" size %s = %d\n", ld, (int)l); /* Dump 48 bytes (3 lines) so that the first difference is * in the second line. */ offset = 0; while (l > 64 && memcmp(v1, v2, 32) == 0) { - /* The first two lines agree, so step forward one line. */ + /* Two lines agree, so step forward one line. */ v1 += 16; v2 += 16; l -= 16; offset += 16; } - fprintf(stderr, " Dump of %s\n", e1); + logprintf(" Dump of %s\n", e1); hexdump(v1, v2, l < 64 ? l : 64, offset); - fprintf(stderr, " Dump of %s\n", e2); + logprintf(" Dump of %s\n", e2); hexdump(v2, v1, l < 64 ? l : 64, offset); - fprintf(stderr, "\n"); - report_failure(extra); + logprintf("\n"); + failure_finish(extra); return (0); } +/* Verify that the named file exists and is empty. */ int -test_assert_empty_file(const char *f1fmt, ...) +assertion_empty_file(const char *f1fmt, ...) { char buff[1024]; char f1[1024]; struct stat st; va_list ap; ssize_t s; - int fd; - + FILE *f; + assertion_count(test_filename, test_line); va_start(ap, f1fmt); vsprintf(f1, f1fmt, ap); va_end(ap); if (stat(f1, &st) != 0) { - fprintf(stderr, "%s:%d: Could not stat: %s\n", test_filename, test_line, f1); - report_failure(NULL); + failure_start(test_filename, test_line, "Stat failed: %s", f1); + failure_finish(NULL); return (0); } if (st.st_size == 0) return (1); - failures ++; - if (!verbose && previous_failures(test_filename, test_line, 1)) - return (0); - - fprintf(stderr, "%s:%d: File not empty: %s\n", test_filename, test_line, f1); - fprintf(stderr, " File size: %d\n", (int)st.st_size); - fprintf(stderr, " Contents:\n"); - fd = open(f1, O_RDONLY); - if (fd < 0) { - fprintf(stderr, " Unable to open %s\n", f1); + failure_start(test_filename, test_line, "File should be empty: %s", f1); + logprintf(" File size: %d\n", (int)st.st_size); + logprintf(" Contents:\n"); + f = fopen(f1, "rb"); + if (f == NULL) { + logprintf(" Unable to open %s\n", f1); } else { - s = sizeof(buff) < st.st_size ? sizeof(buff) : st.st_size; - s = read(fd, buff, s); + s = ((off_t)sizeof(buff) < st.st_size) ? + (ssize_t)sizeof(buff) : (ssize_t)st.st_size; + s = fread(buff, 1, s, f); hexdump(buff, NULL, s, 0); + fclose(f); } - report_failure(NULL); + failure_finish(NULL); return (0); } -/* assertEqualFile() asserts that two files have the same contents. */ +/* Verify that the named file exists and is not empty. */ +int +assertion_non_empty_file(const char *f1fmt, ...) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 06:12:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CC71106566B; Wed, 30 Dec 2009 06:12:04 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AB978FC22; Wed, 30 Dec 2009 06:12:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBU6C429048737; Wed, 30 Dec 2009 06:12:04 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBU6C4o9048730; Wed, 30 Dec 2009 06:12:04 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912300612.nBU6C4o9048730@svn.freebsd.org> From: Tim Kientzle Date: Wed, 30 Dec 2009 06:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201248 - in head/lib/libarchive: . test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 06:12:04 -0000 Author: kientzle Date: Wed Dec 30 06:12:03 2009 New Revision: 201248 URL: http://svn.freebsd.org/changeset/base/201248 Log: UU decoder. Now that libarchive can recursively taste input streams, you can do things like this: tar xvf archive.tar.gz.uu Added: head/lib/libarchive/archive_read_support_compression_uu.c (contents, props changed) head/lib/libarchive/test/test_read_uu.c (contents, props changed) Modified: head/lib/libarchive/Makefile head/lib/libarchive/archive.h head/lib/libarchive/archive_read_support_compression_all.c head/lib/libarchive/test/Makefile Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Wed Dec 30 05:59:21 2009 (r201247) +++ head/lib/libarchive/Makefile Wed Dec 30 06:12:03 2009 (r201248) @@ -51,6 +51,7 @@ SRCS= archive_check_magic.c \ archive_read_support_compression_gzip.c \ archive_read_support_compression_none.c \ archive_read_support_compression_program.c \ + archive_read_support_compression_uu.c \ archive_read_support_compression_xz.c \ archive_read_support_format_all.c \ archive_read_support_format_ar.c \ Modified: head/lib/libarchive/archive.h ============================================================================== --- head/lib/libarchive/archive.h Wed Dec 30 05:59:21 2009 (r201247) +++ head/lib/libarchive/archive.h Wed Dec 30 06:12:03 2009 (r201248) @@ -241,6 +241,7 @@ typedef int archive_close_callback(struc #define ARCHIVE_COMPRESSION_PROGRAM 4 #define ARCHIVE_COMPRESSION_LZMA 5 #define ARCHIVE_COMPRESSION_XZ 6 +#define ARCHIVE_COMPRESSION_UU 7 /* * Codes returned by archive_format. @@ -316,6 +317,7 @@ __LA_DECL int archive_read_support_com (struct archive *, const char *, const void * /* match */, size_t); +__LA_DECL int archive_read_support_compression_uu(struct archive *); __LA_DECL int archive_read_support_compression_xz(struct archive *); __LA_DECL int archive_read_support_format_all(struct archive *); Modified: head/lib/libarchive/archive_read_support_compression_all.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_all.c Wed Dec 30 05:59:21 2009 (r201247) +++ head/lib/libarchive/archive_read_support_compression_all.c Wed Dec 30 06:12:03 2009 (r201248) @@ -44,6 +44,8 @@ archive_read_support_compression_all(str archive_read_support_compression_lzma(a); /* Xz falls back to "unxz" command-line program. */ archive_read_support_compression_xz(a); + /* The decode code doesn't use an outside library. */ + archive_read_support_compression_uu(a); /* Note: We always return ARCHIVE_OK here, even if some of the * above return ARCHIVE_WARN. The intent here is to enable Added: head/lib/libarchive/archive_read_support_compression_uu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/archive_read_support_compression_uu.c Wed Dec 30 06:12:03 2009 (r201248) @@ -0,0 +1,627 @@ +/*- + * Copyright (c) 2009 Michihiro NAKAJIMA + * 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(S) ``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(S) 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 "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include "archive.h" +#include "archive_private.h" +#include "archive_read_private.h" + +struct uudecode { + int64_t total; + unsigned char *in_buff; +#define IN_BUFF_SIZE (1024) + int in_cnt; + size_t in_allocated; + unsigned char *out_buff; +#define OUT_BUFF_SIZE (64 * 1024) + int state; +#define ST_FIND_HEAD 0 +#define ST_READ_UU 1 +#define ST_UUEND 2 +#define ST_READ_BASE64 3 +}; + +static int uudecode_bidder_bid(struct archive_read_filter_bidder *, + struct archive_read_filter *filter); +static int uudecode_bidder_init(struct archive_read_filter *); + +static ssize_t uudecode_filter_read(struct archive_read_filter *, + const void **); +static int uudecode_filter_close(struct archive_read_filter *); + +int +archive_read_support_compression_uu(struct archive *_a) +{ + struct archive_read *a = (struct archive_read *)_a; + struct archive_read_filter_bidder *bidder; + + bidder = __archive_read_get_bidder(a); + archive_clear_error(_a); + if (bidder == NULL) + return (ARCHIVE_FATAL); + + bidder->data = NULL; + bidder->bid = uudecode_bidder_bid; + bidder->init = uudecode_bidder_init; + bidder->options = NULL; + bidder->free = NULL; + return (ARCHIVE_OK); +} + +static const unsigned char ascii[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '\n', 0, 0, '\r', 0, 0, /* 00 - 0F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 30 - 3F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, /* 70 - 7F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */ +}; + +static const unsigned char uuchar[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 30 - 3F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 60 - 6F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 70 - 7F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */ +}; + +static const unsigned char base64[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, /* 20 - 2F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, /* 30 - 3F */ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 50 - 5F */ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 70 - 7F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */ +}; + +static const int base64num[128] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 62, 0, 0, 0, 63, /* 20 - 2F */ + 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 0, 0, 0, 0, 0, 0, /* 30 - 3F */ + 0, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, /* 40 - 4F */ + 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 0, 0, 0, 0, 0, /* 50 - 5F */ + 0, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, /* 60 - 6F */ + 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 0, 0, 0, 0, 0, /* 70 - 7F */ +}; + +static ssize_t +get_line(const unsigned char *b, ssize_t avail, ssize_t *nlsize) +{ + ssize_t len; + + len = 0; + while (len < avail) { + switch (ascii[*b]) { + case 0: /* Non-ascii character or control character. */ + if (nlsize != NULL) + *nlsize = 0; + return (-1); + case '\r': + if (avail-len > 1 && b[1] == '\n') { + if (nlsize != NULL) + *nlsize = 2; + return (len+2); + } + /* FALL THROUGH */ + case '\n': + if (nlsize != NULL) + *nlsize = 1; + return (len+1); + case 1: + b++; + len++; + break; + } + } + if (nlsize != NULL) + *nlsize = 0; + return (avail); +} + +static ssize_t +bid_get_line(struct archive_read_filter *filter, + const unsigned char **b, ssize_t *avail, ssize_t *ravail, ssize_t *nl) +{ + ssize_t len; + int quit; + + quit = 0; + if (*avail == 0) { + *nl = 0; + len = 0; + } else + len = get_line(*b, *avail, nl); + /* + * Read bytes more while it does not reach the end of line. + */ + while (*nl == 0 && len == *avail && !quit) { + ssize_t diff = *ravail - *avail; + + *b = __archive_read_filter_ahead(filter, 160 + *ravail, avail); + if (*b == NULL) { + if (*ravail >= *avail) + return (0); + /* Reading bytes reaches the end of file. */ + *b = __archive_read_filter_ahead(filter, *avail, avail); + quit = 1; + } + *ravail = *avail; + *b += diff; + *avail -= diff; + len = get_line(*b, *avail, nl); + } + return (len); +} + +#define UUDECODE(c) (((c) - 0x20) & 0x3f) + +static int +uudecode_bidder_bid(struct archive_read_filter_bidder *self, + struct archive_read_filter *filter) +{ + const unsigned char *b; + ssize_t avail, ravail; + ssize_t len, nl; + int l; + int firstline; + + (void)self; /* UNUSED */ + + b = __archive_read_filter_ahead(filter, 1, &avail); + if (b == NULL) + return (0); + + firstline = 20; + ravail = avail; + for (;;) { + len = bid_get_line(filter, &b, &avail, &ravail, &nl); + if (len < 0 || nl == 0) + return (0);/* Binary data. */ + if (memcmp(b, "begin ", 6) == 0 && len - nl >= 11) + l = 6; + else if (memcmp(b, "begin-base64 ", 13) == 0 && len - nl >= 18) + l = 13; + else + l = 0; + + if (l > 0 && (b[l] < '0' || b[l] > '7' || + b[l+1] < '0' || b[l+1] > '7' || + b[l+2] < '0' || b[l+2] > '7' || b[l+3] != ' ')) + l = 0; + + b += len; + avail -= len; + if (l) + break; + firstline = 0; + } + if (!avail) + return (0); + len = bid_get_line(filter, &b, &avail, &ravail, &nl); + if (len < 0 || nl == 0) + return (0);/* There are non-ascii characters. */ + avail -= len; + + if (l == 6) { + if (!uuchar[*b]) + return (0); + /* Get a length of decoded bytes. */ + l = UUDECODE(*b++); len--; + if (l > 45) + /* Normally, maximum length is 45(character 'M'). */ + return (0); + while (l && len-nl > 0) { + if (l > 0) { + if (!uuchar[*b++]) + return (0); + if (!uuchar[*b++]) + return (0); + len -= 2; + --l; + } + if (l > 0) { + if (!uuchar[*b++]) + return (0); + --len; + --l; + } + if (l > 0) { + if (!uuchar[*b++]) + return (0); + --len; + --l; + } + } + if (len-nl < 0) + return (0); + if (len-nl == 1 && + (uuchar[*b] || /* Check sum. */ + (*b >= 'a' && *b <= 'z'))) {/* Padding data(MINIX). */ + ++b; + --len; + } + b += nl; + if (avail && uuchar[*b]) + return (firstline+30); + } + if (l == 13) { + while (len-nl > 0) { + if (!base64[*b++]) + return (0); + --len; + } + b += nl; + + if (avail >= 5 && memcmp(b, "====\n", 5) == 0) + return (firstline+40); + if (avail >= 6 && memcmp(b, "====\r\n", 6) == 0) + return (firstline+40); + if (avail > 0 && base64[*b]) + return (firstline+30); + } + + return (0); +} + +static int +uudecode_bidder_init(struct archive_read_filter *self) +{ + struct uudecode *uudecode; + void *out_buff; + void *in_buff; + + self->code = ARCHIVE_COMPRESSION_UU; + self->name = "uu"; + self->read = uudecode_filter_read; + self->skip = NULL; /* not supported */ + self->close = uudecode_filter_close; + + uudecode = (struct uudecode *)calloc(sizeof(*uudecode), 1); + out_buff = malloc(OUT_BUFF_SIZE); + in_buff = malloc(IN_BUFF_SIZE); + if (uudecode == NULL || out_buff == NULL || in_buff == NULL) { + archive_set_error(&self->archive->archive, ENOMEM, + "Can't allocate data for uudecode"); + free(uudecode); + free(out_buff); + free(in_buff); + return (ARCHIVE_FATAL); + } + + self->data = uudecode; + uudecode->in_buff = in_buff; + uudecode->in_cnt = 0; + uudecode->in_allocated = IN_BUFF_SIZE; + uudecode->out_buff = out_buff; + uudecode->state = ST_FIND_HEAD; + + return (ARCHIVE_OK); +} + +static int +ensure_in_buff_size(struct archive_read_filter *self, + struct uudecode *uudecode, size_t size) +{ + + if (size > uudecode->in_allocated) { + unsigned char *ptr; + size_t newsize; + + newsize = uudecode->in_allocated << 1; + ptr = malloc(newsize); + if (ptr == NULL || + newsize < uudecode->in_allocated) { + free(ptr); + archive_set_error(&self->archive->archive, + ENOMEM, + "Can't allocate data for uudecode"); + return (ARCHIVE_FATAL); + } + if (uudecode->in_cnt) + memmove(ptr, uudecode->in_buff, + uudecode->in_cnt); + free(uudecode->in_buff); + uudecode->in_buff = ptr; + uudecode->in_allocated = newsize; + } + return (ARCHIVE_OK); +} + +static ssize_t +uudecode_filter_read(struct archive_read_filter *self, const void **buff) +{ + struct uudecode *uudecode; + const unsigned char *b, *d; + unsigned char *out; + ssize_t avail_in, ravail; + ssize_t used; + ssize_t total; + ssize_t len, llen, nl; + + uudecode = (struct uudecode *)self->data; + +read_more: + d = __archive_read_filter_ahead(self->upstream, 1, &avail_in); + if (d == NULL && avail_in < 0) + return (ARCHIVE_FATAL); + /* Quiet a code analyzer; make sure avail_in must be zero + * when d is NULL. */ + if (d == NULL) + avail_in = 0; + used = 0; + total = 0; + out = uudecode->out_buff; + ravail = avail_in; + if (uudecode->in_cnt) { + /* + * If there is remaining data which is saved by + * previous calling, use it first. + */ + if (ensure_in_buff_size(self, uudecode, + avail_in + uudecode->in_cnt) != ARCHIVE_OK) + return (ARCHIVE_FATAL); + memcpy(uudecode->in_buff + uudecode->in_cnt, + d, avail_in); + d = uudecode->in_buff; + avail_in += uudecode->in_cnt; + uudecode->in_cnt = 0; + } + for (;used < avail_in; d += llen, used += llen) { + int l, body; + + b = d; + len = get_line(b, avail_in - used, &nl); + if (len < 0) { + /* Non-ascii character is found. */ + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Insufficient compressed data"); + return (ARCHIVE_FATAL); + } + llen = len; + if (nl == 0) { + /* + * Save remaining data which does not contain + * NL('\n','\r'). + */ + if (ensure_in_buff_size(self, uudecode, len) + != ARCHIVE_OK) + return (ARCHIVE_FATAL); + if (uudecode->in_buff != b) + memmove(uudecode->in_buff, b, len); + uudecode->in_cnt = len; + if (total == 0) { + /* Do not return 0; it means end-of-file. + * We should try to read bytes more. */ + __archive_read_filter_consume( + self->upstream, ravail); + goto read_more; + } + break; + } + if (total + len * 2 > OUT_BUFF_SIZE) + break; + switch (uudecode->state) { + default: + case ST_FIND_HEAD: + if (len - nl > 13 && memcmp(b, "begin ", 6) == 0) + l = 6; + else if (len - nl > 18 && + memcmp(b, "begin-base64 ", 13) == 0) + l = 13; + else + l = 0; + if (l != 0 && b[l] >= '0' && b[l] <= '7' && + b[l+1] >= '0' && b[l+1] <= '7' && + b[l+2] >= '0' && b[l+2] <= '7' && b[l+3] == ' ') { + if (l == 6) + uudecode->state = ST_READ_UU; + else + uudecode->state = ST_READ_BASE64; + } + break; + case ST_READ_UU: + body = len - nl; + if (!uuchar[*b] || body <= 0) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Insufficient compressed data"); + return (ARCHIVE_FATAL); + } + /* Get length of undecoded bytes of curent line. */ + l = UUDECODE(*b++); + body--; + if (l > body) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Insufficient compressed data"); + return (ARCHIVE_FATAL); + } + if (l == 0) { + uudecode->state = ST_UUEND; + break; + } + while (l > 0) { + int n = 0; + + if (l > 0) { + if (!uuchar[b[0]] || !uuchar[b[1]]) + break; + n = UUDECODE(*b++) << 18; + n |= UUDECODE(*b++) << 12; + *out++ = n >> 16; total++; + --l; + } + if (l > 0) { + if (!uuchar[b[0]]) + break; + n |= UUDECODE(*b++) << 6; + *out++ = (n >> 8) & 0xFF; total++; + --l; + } + if (l > 0) { + if (!uuchar[b[0]]) + break; + n |= UUDECODE(*b++); + *out++ = n & 0xFF; total++; + --l; + } + } + if (l) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Insufficient compressed data"); + return (ARCHIVE_FATAL); + } + break; + case ST_UUEND: + if (len - nl == 3 && memcmp(b, "end ", 3) == 0) + uudecode->state = ST_FIND_HEAD; + else { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Insufficient compressed data"); + return (ARCHIVE_FATAL); + } + break; + case ST_READ_BASE64: + l = len - nl; + if (l >= 3 && b[0] == '=' && b[1] == '=' && + b[2] == '=') { + uudecode->state = ST_FIND_HEAD; + break; + } + while (l > 0) { + int n = 0; + + if (l > 0) { + if (!base64[b[0]] || !base64[b[1]]) + break; + n = base64num[*b++] << 18; + n |= base64num[*b++] << 12; + *out++ = n >> 16; total++; + l -= 2; + } + if (l > 0) { + if (*b == '=') + break; + if (!base64[*b]) + break; + n |= base64num[*b++] << 6; + *out++ = (n >> 8) & 0xFF; total++; + --l; + } + if (l > 0) { + if (*b == '=') + break; + if (!base64[*b]) + break; + n |= base64num[*b++]; + *out++ = n & 0xFF; total++; + --l; + } + } + if (l && *b != '=') { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Insufficient compressed data"); + return (ARCHIVE_FATAL); + } + break; + } + } + + __archive_read_filter_consume(self->upstream, ravail); + + *buff = uudecode->out_buff; + uudecode->total += total; + return (total); +} + +static int +uudecode_filter_close(struct archive_read_filter *self) +{ + struct uudecode *uudecode; + + uudecode = (struct uudecode *)self->data; + free(uudecode->in_buff); + free(uudecode->out_buff); + free(uudecode); + + return (ARCHIVE_OK); +} + Modified: head/lib/libarchive/test/Makefile ============================================================================== --- head/lib/libarchive/test/Makefile Wed Dec 30 05:59:21 2009 (r201247) +++ head/lib/libarchive/test/Makefile Wed Dec 30 06:12:03 2009 (r201248) @@ -78,6 +78,7 @@ TESTS= \ test_read_pax_truncated.c \ test_read_position.c \ test_read_truncated.c \ + test_read_uu.c \ test_tar_filenames.c \ test_tar_large.c \ test_ustar_filenames.c \ Added: head/lib/libarchive/test/test_read_uu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/test/test_read_uu.c Wed Dec 30 06:12:03 2009 (r201248) @@ -0,0 +1,134 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2009 Michihiro NAKAJIMA + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +static const char archive[] = { +"begin 644 test_read_uu.Z\n" +"M'YV0+@`('$BPH,&#\"!,J7,BP(4(8$&_4J`$\"`,08$F%4O)AQ(\\2/(#7&@#%C\n" +"M!@T8-##.L`$\"QL@:-F(``%'#H/1A2\n" +"IHU\"0%9=*G4JUJM6K6+-JWO8,.*'4NVK-FS:-.J7\n" +"Received: from libarchive (localhost [127.0.0.1])\n" +" by libarchive (8.14.2/8.14.2) with ESMTP id m5233UT1006448\n" +" for ; Mon, 2 Jun 2008 03:03:31 GMT\n" +" (envelope-from uudecode@libarchive)\n" +"Received: (from uudecode@localhost)\n" +" by libarchive (8.14.2/8.14.2/Submit) id m5233U3e006406\n" +" for uudecode; Mon, 2 Jun 2008 03:03:30 GMT\n" +" (envelope-from root)\n" +"Date: Mon, 2 Jun 2008 03:03:30 GMT\n" +"From: Libarchive Test \n" +"Message-Id: <200806020303.m5233U3e006406@libarchive>\n" +"To: uudecode@libarchive\n" +"Subject: Libarchive uudecode test\n" +"\n" +"* Redistribution and use in source and binary forms, with or without\n" +"* modification, are permitted provided that the following conditions\n" +"* are met:\n" +"\n" +"01234567890abcdeghijklmnopqrstuvwxyz\n" +"01234567890ABCEFGHIJKLMNOPQRSTUVWXYZ\n" +"\n" +}; + +static void +test_read_uu_sub(const char *uudata, size_t uusize) +{ + struct archive_entry *ae; + struct archive *a; + char *buff; + int extra; + + assert(NULL != (buff = malloc(uusize + 64 * 1024))); + if (buff == NULL) + return; + for (extra = 0; extra <= 64; extra = extra==0?1:extra*2) { + size_t size = extra * 1024; + char *p = buff; + + /* Add extra text size of which is from 1K bytes to + * 64Kbytes before uuencoded data. */ + while (size) { + if (size > sizeof(extradata)-1) { + memcpy(p, extradata, sizeof(extradata)-1); + p += sizeof(extradata)-1; + size -= sizeof(extradata)-1; + } else { + memcpy(p, extradata, size-1); + p += size-1; + *p++ = '\n';/* the last of extra text must have + * '\n' character. */ + break; + } + } + memcpy(p, uudata, uusize); + size = extra * 1024 + uusize; + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_compression_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + read_open_memory(a, buff, size, 2)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + failure("archive_compression_name(a)=\"%s\"", + archive_compression_name(a)); + assertEqualInt(archive_compression(a), + ARCHIVE_COMPRESSION_COMPRESS); + failure("archive_format_name(a)=\"%s\"", + archive_format_name(a)); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + } + free(buff); +} + +DEFINE_TEST(test_read_uu) +{ + /* Read the traditional uuencoded data. */ + test_read_uu_sub(archive, sizeof(archive)-1); + /* Read the Base64 uuencoded data. */ + test_read_uu_sub(archive64, sizeof(archive64)-1); +} + From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 06:22:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFE69106566C; Wed, 30 Dec 2009 06:22:37 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 80D848FC0C; Wed, 30 Dec 2009 06:22:37 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 63CCC1CD23; Wed, 30 Dec 2009 07:22:36 +0100 (CET) Date: Wed, 30 Dec 2009 07:22:36 +0100 From: Ed Schouten To: Gabor Kovesdan Message-ID: <20091230062236.GI64905@hoeg.nl> References: <200912292253.nBTMrR5m038869@svn.freebsd.org> <4B3AA7DC.1040606@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BIjZOsiIjIIrFhuO" Content-Disposition: inline In-Reply-To: <4B3AA7DC.1040606@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201227 - in head: sbin/comcontrol sbin/mount sbin/mount_msdosfs sbin/mount_nullfs sbin/rcorder usr.bin/find usr.bin/gencat usr.bin/mklocale usr.sbin/config usr.sbin/cpucontrol usr.sbin... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 06:22:38 -0000 --BIjZOsiIjIIrFhuO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Gabor, * Gabor Kovesdan wrote: > I wonder if it would be worth to invent a WARNS=3D7 level, which would > be WARNS=3D6 + ANSI. Although ANSI-conformance isn't a -Wfoo flag, > which is WARNS for but conforming ANSI means a higher level > cleannes, which is demanded, so I think it wouldn't really > contradict to the semantics of WARNS. So far I've been using -Wold-style-definition, which I've been using make these changes. I am planning on just adding that to WARNS=3D6, considering that almost all the code at WARNS=3D6 builds with this flag enabled now. I'd rather not add a WARNS=3D7, because then I'm afraid almost nobody will know about its existence, causing it to be mostly ignored. In an ideal world, I think we should get rid of WARNS. We could just enable all -W flags by default, except -Werror. That way people would be invited to fix the warnings over time. --=20 Ed Schouten WWW: http://80386.nl/ --BIjZOsiIjIIrFhuO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEUEARECAAYFAks68asACgkQ52SDGA2eCwUY1gCfZ1+AHZn2eYCBTzCEHp2TnfM+ /r8Al2c55mx66BqOWIMXr1og2m+koHs= =J67I -----END PGP SIGNATURE----- --BIjZOsiIjIIrFhuO-- From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 06:25:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E8651065693; Wed, 30 Dec 2009 06:25:20 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EFC08FC1C; Wed, 30 Dec 2009 06:25:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBU6PKil049129; Wed, 30 Dec 2009 06:25:20 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBU6PJHk049127; Wed, 30 Dec 2009 06:25:20 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912300625.nBU6PJHk049127@svn.freebsd.org> From: Tim Kientzle Date: Wed, 30 Dec 2009 06:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201249 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 06:25:20 -0000 Author: kientzle Date: Wed Dec 30 06:25:19 2009 New Revision: 201249 URL: http://svn.freebsd.org/changeset/base/201249 Log: Libarchive in FreeBSD is now synced up with 2.7.901a from libarchive.googlecode.com Modified: head/lib/libarchive/archive.h Modified: head/lib/libarchive/archive.h ============================================================================== --- head/lib/libarchive/archive.h Wed Dec 30 06:12:03 2009 (r201248) +++ head/lib/libarchive/archive.h Wed Dec 30 06:25:19 2009 (r201249) @@ -127,13 +127,13 @@ extern "C" { * (ARCHIVE_API_VERSION * 1000000 + ARCHIVE_API_FEATURE * 1000) * #endif */ -#define ARCHIVE_VERSION_NUMBER 2007000 +#define ARCHIVE_VERSION_NUMBER 2007901 __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_STRING "libarchive 2.7.0" +#define ARCHIVE_VERSION_STRING "libarchive 2.7.901a" __LA_DECL const char * archive_version_string(void); #if ARCHIVE_VERSION_NUMBER < 3000000 From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 06:28:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E5C91065693; Wed, 30 Dec 2009 06:28:30 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F2218FC2A; Wed, 30 Dec 2009 06:28:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBU6SUt3049223; Wed, 30 Dec 2009 06:28:30 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBU6SUgI049221; Wed, 30 Dec 2009 06:28:30 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912300628.nBU6SUgI049221@svn.freebsd.org> From: Tim Kientzle Date: Wed, 30 Dec 2009 06:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201250 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 06:28:30 -0000 Author: kientzle Date: Wed Dec 30 06:28:30 2009 New Revision: 201250 URL: http://svn.freebsd.org/changeset/base/201250 Log: Reserve constants for RPM unwrapper and XAR reader. Modified: head/lib/libarchive/archive.h Modified: head/lib/libarchive/archive.h ============================================================================== --- head/lib/libarchive/archive.h Wed Dec 30 06:25:19 2009 (r201249) +++ head/lib/libarchive/archive.h Wed Dec 30 06:28:30 2009 (r201250) @@ -242,6 +242,7 @@ typedef int archive_close_callback(struc #define ARCHIVE_COMPRESSION_LZMA 5 #define ARCHIVE_COMPRESSION_XZ 6 #define ARCHIVE_COMPRESSION_UU 7 +#define ARCHIVE_COMPRESSION_RPM 8 /* * Codes returned by archive_format. @@ -283,6 +284,7 @@ typedef int archive_close_callback(struc #define ARCHIVE_FORMAT_AR_BSD (ARCHIVE_FORMAT_AR | 2) #define ARCHIVE_FORMAT_MTREE 0x80000 #define ARCHIVE_FORMAT_RAW 0x90000 +#define ARCHIVE_FORMAT_XAR 0xA0000 /*- * Basic outline for reading an archive: From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 06:28:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 976AD106576C; Wed, 30 Dec 2009 06:28:37 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-px0-f190.google.com (mail-px0-f190.google.com [209.85.216.190]) by mx1.freebsd.org (Postfix) with ESMTP id C744D8FC36; Wed, 30 Dec 2009 06:28:36 +0000 (UTC) Received: by pxi28 with SMTP id 28so7956410pxi.7 for ; Tue, 29 Dec 2009 22:28:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=aE1NDxk6Rstc/zPHo8Aks25dEX4HSLq/z+JWhkSFA/g=; b=ChAVTomLfBOg6Zk1ZlvRWWiDHeYwmLt1LLKivHLAEsAQ5hUeQVXCCZdMvBDBKa31KP 9uoOhoJVzYARv13XoQA1qnsMwcmEZV2admknZAPztRIUNuR9qeVJQh9iZ2q9uc0rzg0b zx7wxc+o61n6AYXBHtewtxcUPVFX79iwiZmuM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Pw6wDBOR1pN2pHmGIbG3Az9fKQntnPiSsTzKPbfMNmixaXZtdgWszDoPu/BoHkZKkF VOenh6zd66caFakDSNXaLl2ACZy3JI2vuZwpsXskgHBdOnqu7pprNOESCxKp08VpdCTT 12dL+HTedYNNM62jrZ0Lc/U7jcOyYjAxk5lpA= MIME-Version: 1.0 Received: by 10.114.187.7 with SMTP id k7mr4446980waf.106.1262154507325; Tue, 29 Dec 2009 22:28:27 -0800 (PST) In-Reply-To: <20091230062236.GI64905@hoeg.nl> References: <200912292253.nBTMrR5m038869@svn.freebsd.org> <4B3AA7DC.1040606@FreeBSD.org> <20091230062236.GI64905@hoeg.nl> Date: Tue, 29 Dec 2009 22:28:27 -0800 Message-ID: From: Xin LI To: Ed Schouten Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Gabor Kovesdan Subject: Re: svn commit: r201227 - in head: sbin/comcontrol sbin/mount sbin/mount_msdosfs sbin/mount_nullfs sbin/rcorder usr.bin/find usr.bin/gencat usr.bin/mklocale usr.sbin/config usr.sbin/cpucontrol usr.sbin... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 06:28:37 -0000 On Tue, Dec 29, 2009 at 10:22 PM, Ed Schouten wrote: > Hi Gabor, > > * Gabor Kovesdan wrote: >> I wonder if it would be worth to invent a WARNS=7 level, which would >> be WARNS=6 + ANSI. Although ANSI-conformance isn't a -Wfoo flag, >> which is WARNS for but conforming ANSI means a higher level >> cleannes, which is demanded, so I think it wouldn't really >> contradict to the semantics of WARNS. > > So far I've been using -Wold-style-definition, which I've been using > make these changes. I am planning on just adding that to WARNS=6, > considering that almost all the code at WARNS=6 builds with this flag > enabled now. > > I'd rather not add a WARNS=7, because then I'm afraid almost nobody will > know about its existence, causing it to be mostly ignored. In an ideal > world, I think we should get rid of WARNS. We could just enable all -W > flags by default, except -Werror. That way people would be invited to > fix the warnings over time. Probably leaving -Werror by default is better... Without -Werror I think there is fewer chance that these issues being noticed. The point of having -Werror is that it means a build break (at the developers' local machine, or tinderbox if he or she didn't do a full universe build), loud enough and can be fixed early rather than letting them go. Historically we only disable -Werror when major compiler change, etc. Cheers, -- Xin LI http://www.delphij.net From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 06:28:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CAF510657E5; Wed, 30 Dec 2009 06:28:48 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB0A8FC45; Wed, 30 Dec 2009 06:28:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBU6SlTm049263; Wed, 30 Dec 2009 06:28:47 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBU6Slrn049261; Wed, 30 Dec 2009 06:28:47 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200912300628.nBU6Slrn049261@svn.freebsd.org> From: Colin Percival Date: Wed, 30 Dec 2009 06:28:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201251 - head/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 06:28:48 -0000 Author: cperciva Date: Wed Dec 30 06:28:47 2009 New Revision: 201251 URL: http://svn.freebsd.org/changeset/base/201251 Log: Add undocumented 'portsnap alfred' command, which runs (fetch|cron) based on whether fd 0 is a terminal, and then runs (extract|update) based on whether ${PORTSDIR} exists. Requested by: alfred MFC after: 1 month Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.sh Wed Dec 30 06:28:30 2009 (r201250) +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Wed Dec 30 06:28:47 2009 (r201251) @@ -140,7 +140,7 @@ parse_cmdline() { if [ ! -z "${SERVERNAME}" ]; then usage; fi shift; SERVERNAME="$1" ;; - cron | extract | fetch | update) + cron | extract | fetch | update | alfred) COMMANDS="${COMMANDS} $1" ;; *) @@ -1040,6 +1040,22 @@ cmd_update() { update_run || exit 1 } +# Alfred command. Run 'fetch' or 'cron' depending on +# whether stdin is a terminal; then run 'update' or +# 'extract' depending on whether ${PORTSDIR} exists. +cmd_alfred() { + if [ -t 0 ]; then + cmd_fetch + else + cmd_cron + fi + if [ -d ${PORTSDIR} ]; then + cmd_update + else + cmd_extract + fi +} + #### Entry point # Make sure we find utilities from the base system From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 06:36:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 805AC106568F; Wed, 30 Dec 2009 06:36:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 706A38FC1C; Wed, 30 Dec 2009 06:36:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBU6agB6049476; Wed, 30 Dec 2009 06:36:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBU6agD6049473; Wed, 30 Dec 2009 06:36:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912300636.nBU6agD6049473@svn.freebsd.org> From: Ed Schouten Date: Wed, 30 Dec 2009 06:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201252 - in head: sbin/umount usr.sbin/rpc.umntall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 06:36:42 -0000 Author: ed Date: Wed Dec 30 06:36:42 2009 New Revision: 201252 URL: http://svn.freebsd.org/changeset/base/201252 Log: Let umount build with -Wold-style-definition. Modified: head/sbin/umount/umount.c head/usr.sbin/rpc.umntall/mounttab.c Modified: head/sbin/umount/umount.c ============================================================================== --- head/sbin/umount/umount.c Wed Dec 30 06:28:47 2009 (r201251) +++ head/sbin/umount/umount.c Wed Dec 30 06:36:42 2009 (r201252) @@ -588,7 +588,7 @@ xdr_dir(XDR *xdrsp, char *dirp) } void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n", Modified: head/usr.sbin/rpc.umntall/mounttab.c ============================================================================== --- head/usr.sbin/rpc.umntall/mounttab.c Wed Dec 30 06:28:47 2009 (r201251) +++ head/usr.sbin/rpc.umntall/mounttab.c Wed Dec 30 06:36:42 2009 (r201252) @@ -52,7 +52,8 @@ static void badline(const char *field, c * so the client can notify the NFS server even after reboot. */ int -add_mtab(char *hostp, char *dirp) { +add_mtab(char *hostp, char *dirp) +{ FILE *mtabfile; if ((mtabfile = fopen(PATH_MOUNTTAB, "a")) == NULL) @@ -69,7 +70,8 @@ add_mtab(char *hostp, char *dirp) { * Read mounttab line for line and return struct mtablist. */ int -read_mtab(void) { +read_mtab(void) +{ struct mtablist **mtabpp, *mtabp; char *hostp, *dirp, *cp; char str[STRSIZ]; @@ -137,7 +139,8 @@ read_mtab(void) { * Unlink PATH_MOUNTAB if no entry is left. */ int -write_mtab(int verbose) { +write_mtab(int verbose) +{ struct mtablist *mtabp, *mp; FILE *mtabfile; int line; @@ -180,7 +183,8 @@ write_mtab(int verbose) { * Mark the entries as clean where RPC calls have been done successfully. */ void -clean_mtab(char *hostp, char *dirp, int verbose) { +clean_mtab(char *hostp, char *dirp, int verbose) +{ struct mtablist *mtabp; char *host; @@ -205,7 +209,8 @@ clean_mtab(char *hostp, char *dirp, int * Free struct mtablist mtab. */ void -free_mtab() { +free_mtab(void) +{ struct mtablist *mtabp; while ((mtabp = mtabhead) != NULL) { @@ -218,7 +223,8 @@ free_mtab() { * Print bad lines to syslog. */ static void -badline(const char *field, const char *bad) { +badline(const char *field, const char *bad) +{ syslog(LOG_ERR, "bad mounttab %s field '%s'", field, (bad == NULL) ? "" : bad); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 06:37:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E4901065676; Wed, 30 Dec 2009 06:37:59 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45E888FC16; Wed, 30 Dec 2009 06:37:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBU6bxHH049542; Wed, 30 Dec 2009 06:37:59 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBU6bxMT049541; Wed, 30 Dec 2009 06:37:59 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912300637.nBU6bxMT049541@svn.freebsd.org> From: Tim Kientzle Date: Wed, 30 Dec 2009 06:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201253 - head/lib/libarchive/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 06:37:59 -0000 Author: kientzle Date: Wed Dec 30 06:37:58 2009 New Revision: 201253 URL: http://svn.freebsd.org/changeset/base/201253 Log: Remove some test files that are no longer used. Deleted: head/lib/libarchive/test/test_fuzz_1.iso.uu head/lib/libarchive/test/test_read_format_iso_gz.iso.gz.uu head/lib/libarchive/test/test_read_format_isojoliet_bz2.iso.bz2.uu head/lib/libarchive/test/test_read_format_isojolietrr_bz2.iso.bz2.uu head/lib/libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 06:40:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B81A106568B; Wed, 30 Dec 2009 06:40:31 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id F3CE38FC08; Wed, 30 Dec 2009 06:40:30 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 660C41CD23; Wed, 30 Dec 2009 07:40:30 +0100 (CET) Date: Wed, 30 Dec 2009 07:40:30 +0100 From: Ed Schouten To: Xin LI Message-ID: <20091230064030.GK64905@hoeg.nl> References: <200912292253.nBTMrR5m038869@svn.freebsd.org> <4B3AA7DC.1040606@FreeBSD.org> <20091230062236.GI64905@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8886epFSn6hdKcg1" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Gabor Kovesdan Subject: Re: svn commit: r201227 - in head: sbin/comcontrol sbin/mount sbin/mount_msdosfs sbin/mount_nullfs sbin/rcorder usr.bin/find usr.bin/gencat usr.bin/mklocale usr.sbin/config usr.sbin/cpucontrol usr.sbin... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 06:40:31 -0000 --8886epFSn6hdKcg1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Xin LI wrote: > On Tue, Dec 29, 2009 at 10:22 PM, Ed Schouten wrote: > > Hi Gabor, > > > > * Gabor Kovesdan wrote: > >> I wonder if it would be worth to invent a WARNS=3D7 level, which would > >> be WARNS=3D6 + ANSI. Although ANSI-conformance isn't a -Wfoo flag, > >> which is WARNS for but conforming ANSI means a higher level > >> cleannes, which is demanded, so I think it wouldn't really > >> contradict to the semantics of WARNS. > > > > So far I've been using -Wold-style-definition, which I've been using > > make these changes. I am planning on just adding that to WARNS=3D6, > > considering that almost all the code at WARNS=3D6 builds with this flag > > enabled now. > > > > I'd rather not add a WARNS=3D7, because then I'm afraid almost nobody w= ill > > know about its existence, causing it to be mostly ignored. In an ideal > > world, I think we should get rid of WARNS. We could just enable all -W > > flags by default, except -Werror. That way people would be invited to > > fix the warnings over time. >=20 > Probably leaving -Werror by default is better... Without -Werror I > think there is fewer chance that these issues being noticed. The > point of having -Werror is that it means a build break (at the > developers' local machine, or tinderbox if he or she didn't do a full > universe build), loud enough and can be fixed early rather than > letting them go. Historically we only disable -Werror when major > compiler change, etc. Sure. We should just enable it in Makefile.inc by default, but basically my proposal is to just reduce the entire warnings thing to just two options: - Have all warnings enabled, but not -Werror. - Have all warnings enabled and also -Werror. Where we enable the latter is another discussion. (Almost happy new year), --=20 Ed Schouten WWW: http://80386.nl/ --8886epFSn6hdKcg1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAks69d4ACgkQ52SDGA2eCwVuWQCfSBkwvys90kOiQge0F+1D8UlH VikAmwShn5gcwekZsXlR6ZUHOTWCYj6s =/bSD -----END PGP SIGNATURE----- --8886epFSn6hdKcg1-- From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 07:09:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 956CF1065670; Wed, 30 Dec 2009 07:09:47 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-pw0-f44.google.com (mail-pw0-f44.google.com [209.85.160.44]) by mx1.freebsd.org (Postfix) with ESMTP id 536F28FC1D; Wed, 30 Dec 2009 07:09:47 +0000 (UTC) Received: by pwi15 with SMTP id 15so7917727pwi.3 for ; Tue, 29 Dec 2009 23:09:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=LCAUDvwWGluhc+acmg5AYrYAUUzakvAbtfn2L9DqF9U=; b=p4r4hJ2GGPdXE8Sr6+SdcrqU1AO3hp1y8HSWGBdOTIXS2xKkTN5DewM/ng22YrxIVX SFxLd/2JPhlRevDMxbx/mkZV0VkOlsGjjD6hnyBiUFe700/v+GRhCF5ULxGccS2Keq+K VANaDqEa/VNjX9iHXKpnzimujObjhgkHc4V0A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=DU2zxeQ09hHDHYH5NH6EGJQiI4UZwVde2HUy8MvsrX49PhC51Us1BbzUXhQ2Ozx4jS 1MkjtgQbaXwMTlHj9l8XIptu+pj9I/uCpNrBE23OKwOn7GtZzIRa4HyxAeJIni2d7f2N 87Yot62+e4Ntcv2YMRTFn7146UNJv41ZYGsm0= MIME-Version: 1.0 Received: by 10.115.117.9 with SMTP id u9mr12185617wam.172.1262156977391; Tue, 29 Dec 2009 23:09:37 -0800 (PST) In-Reply-To: <20091230064030.GK64905@hoeg.nl> References: <200912292253.nBTMrR5m038869@svn.freebsd.org> <4B3AA7DC.1040606@FreeBSD.org> <20091230062236.GI64905@hoeg.nl> <20091230064030.GK64905@hoeg.nl> Date: Tue, 29 Dec 2009 23:09:37 -0800 Message-ID: From: Xin LI To: Ed Schouten Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Gabor Kovesdan Subject: Re: svn commit: r201227 - in head: sbin/comcontrol sbin/mount sbin/mount_msdosfs sbin/mount_nullfs sbin/rcorder usr.bin/find usr.bin/gencat usr.bin/mklocale usr.sbin/config usr.sbin/cpucontrol usr.sbin... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 07:09:47 -0000 On Tue, Dec 29, 2009 at 10:40 PM, Ed Schouten wrote: > * Xin LI wrote: >> On Tue, Dec 29, 2009 at 10:22 PM, Ed Schouten wrote: >> > Hi Gabor, >> > >> > * Gabor Kovesdan wrote: >> >> I wonder if it would be worth to invent a WARNS=3D7 level, which woul= d >> >> be WARNS=3D6 + ANSI. Although ANSI-conformance isn't a -Wfoo flag, >> >> which is WARNS for but conforming ANSI means a higher level >> >> cleannes, which is demanded, so I think it wouldn't really >> >> contradict to the semantics of WARNS. >> > >> > So far I've been using -Wold-style-definition, which I've been using >> > make these changes. I am planning on just adding that to WARNS=3D6, >> > considering that almost all the code at WARNS=3D6 builds with this fla= g >> > enabled now. >> > >> > I'd rather not add a WARNS=3D7, because then I'm afraid almost nobody = will >> > know about its existence, causing it to be mostly ignored. In an ideal >> > world, I think we should get rid of WARNS. We could just enable all -W >> > flags by default, except -Werror. That way people would be invited to >> > fix the warnings over time. >> >> Probably leaving -Werror by default is better... =C2=A0Without -Werror I >> think there is fewer chance that these issues being noticed. =C2=A0The >> point of having -Werror is that it means a build break (at the >> developers' local machine, or tinderbox if he or she didn't do a full >> universe build), loud enough and can be fixed early rather than >> letting them go. =C2=A0Historically we only disable -Werror when major >> compiler change, etc. > > Sure. We should just enable it in Makefile.inc by default, but basically > my proposal is to just reduce the entire warnings thing to just two > options: > > - Have all warnings enabled, but not -Werror. > - Have all warnings enabled and also -Werror. > > Where we enable the latter is another discussion. Oh... There are a lot of contributed code that can not even pass WARNS=3D1 :) Also there are some code "for historical reasons" must cast off qualifiers, etc., currently our build system have warning levels assigned at module level, which could be inconvenient for this policy to be effective (e.g. a 100-files module with 95 files WARNS=3D6 clean and 5 rest are only WARNS=3D4 clean, we can use WARNS=3D4 and WERROR=3D1 to make sure that no file would get worse, but with WARNS=3D=3D= =3D6 and WERROR either 1 or 0, we could lose the ability to limit the bit rot, except we convert all these 5 files as a wholesale :) > (Almost happy new year), Happy new year! Cheers, --=20 Xin LI http://www.delphij.net From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 08:52:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7408106566B; Wed, 30 Dec 2009 08:52:13 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6B208FC08; Wed, 30 Dec 2009 08:52:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBU8qDBq052182; Wed, 30 Dec 2009 08:52:13 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBU8qD5l052180; Wed, 30 Dec 2009 08:52:13 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <200912300852.nBU8qD5l052180@svn.freebsd.org> From: Shteryana Shopova Date: Wed, 30 Dec 2009 08:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201254 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 08:52:13 -0000 Author: syrinx Date: Wed Dec 30 08:52:13 2009 New Revision: 201254 URL: http://svn.freebsd.org/changeset/base/201254 Log: Make sure the multicast forwarding cache entry's stall queue is properly initialized before trying to insert an entry into it. PR: kern/142052 Reviewed by: bms MFC after: now Modified: head/sys/netinet/ip_mroute.c Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Wed Dec 30 06:37:58 2009 (r201253) +++ head/sys/netinet/ip_mroute.c Wed Dec 30 08:52:13 2009 (r201254) @@ -1386,6 +1386,15 @@ fail: rt->mfc_rp.s_addr = INADDR_ANY; rt->mfc_bw_meter = NULL; + /* initialize pkt counters per src-grp */ + rt->mfc_pkt_cnt = 0; + rt->mfc_byte_cnt = 0; + rt->mfc_wrong_if = 0; + timevalclear(&rt->mfc_last_assert); + + TAILQ_INIT(&rt->mfc_stall); + rt->mfc_nstall = 0; + /* link into table */ LIST_INSERT_HEAD(&mfchashtbl[hash], rt, mfc_hash); TAILQ_INSERT_HEAD(&rt->mfc_stall, rte, rte_link); From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 09:17:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAAE71065679; Wed, 30 Dec 2009 09:17:08 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-pw0-f44.google.com (mail-pw0-f44.google.com [209.85.160.44]) by mx1.freebsd.org (Postfix) with ESMTP id 63E308FC1D; Wed, 30 Dec 2009 09:17:07 +0000 (UTC) Received: by pwi15 with SMTP id 15so7965339pwi.3 for ; Wed, 30 Dec 2009 01:17:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:cc; bh=wHAv+VKI4DLm2icFWgvO37VGCvWdoEQWRFPOAsKNNmA=; b=RHIEolrJPsPrrFXgxlor+2enYe5wCStj2WVG7ZZt8wh3Ukxc2tBDeKC8JKDTHktqg8 txAZBVNti/RDkQr90DBPQRwdsPHTSwUsaEkzAxpyJz+8gR+DPwLULcJpjPQxxGwETRgy +ZtxPj0HtlLkyQ5ts0T14pxp5LxqhozwG64m4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:x-mailer:mime-version:subject:date:cc; b=SnKo9YiJPjF3yW04Gp8lKdWtCNiAMuGFOmdVc/3ajnpgqo+TaiT9xR35nkv2ketvCd rvy6xjBb3/eyT2Cy6rULyPgpKykbIVBWLlJWJ46/aLQXynG3yguDEKQgtPhcapXFuxcW +Xt0CiIyqCU86yhEMI4o0KxxzWYFXX0VaJ98U= Received: by 10.142.6.10 with SMTP id 10mr12280590wff.48.1262162751729; Wed, 30 Dec 2009 00:45:51 -0800 (PST) Received: from ?10.104.48.184? ([166.205.138.209]) by mx.google.com with ESMTPS id 20sm13328369pzk.13.2009.12.30.00.45.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 30 Dec 2009 00:45:50 -0800 (PST) References: <200912290849.nBT8nh7c017065@svn.freebsd.org> <4B3A5C2E.5080701@FreeBSD.org> <20091229.180757.951589869071195982.imp@bsdimp.com> Message-Id: From: Garrett Cooper To: "M. Warner Losh" In-Reply-To: <20091229.180757.951589869071195982.imp@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Date: Wed, 30 Dec 2009 00:45:42 -0800 Cc: "dougb@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "ed@FreeBSD.org" , "src-committers@FreeBSD.org" , "svn-src-head@FreeBSD.org" , "scf@FreeBSD.org" Subject: Re: svn commit: r201180 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 09:17:08 -0000 On Dec 29, 2009, at 5:07 PM, "M. Warner Losh" wrote: > In message: > "Sean C. Farley" writes: > : On Tue, 29 Dec 2009, Doug Barton wrote: > : > : > Ed Schouten wrote: > : >> While there, rename die_you_gravy_sucking_pig_dog() to > something > : >> that's > : >> less moronic. > : > > : > Boo! IMO the fact that at least some of our sources have some > : > personality is a feature. :) > : > : How about alt_shutdown_die_die_die()? :) > > my_name_is_enigo_montoya_you_killed_my_father_prepare_to_die() hit_ctrl_alt_delete_and_pop_cork_to_continue() ? From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 11:40:57 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E2FA106568B; Wed, 30 Dec 2009 11:40:57 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 0CA0A8FC57; Wed, 30 Dec 2009 11:40:56 +0000 (UTC) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id CD8A2EB4880; Wed, 30 Dec 2009 13:40:55 +0200 (EET) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 83EDC44FE3; Wed, 30 Dec 2009 13:40:58 +0200 (EET) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KFptEonC3oS2; Wed, 30 Dec 2009 13:40:58 +0200 (EET) Received: from kobe.laptop (ppp-94-64-238-171.home.otenet.gr [94.64.238.171]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 2257244FDF; Wed, 30 Dec 2009 13:40:58 +0200 (EET) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id nBUBes35003650 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 30 Dec 2009 13:40:54 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id nBUBerlF003647; Wed, 30 Dec 2009 13:40:53 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Rui Paulo References: <200912291947.nBTJlY7a034177@svn.freebsd.org> Date: Wed, 30 Dec 2009 13:40:53 +0200 In-Reply-To: <200912291947.nBTJlY7a034177@svn.freebsd.org> (Rui Paulo's message of "Tue, 29 Dec 2009 19:47:34 +0000 (UTC)") Message-ID: <871vichepm.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201209 - in head/sys: conf contrib/dev/iwn dev/iwn modules/iwnfw modules/iwnfw/iwn1000 modules/iwnfw/iwn4965 modules/iwnfw/iwn5000 modules/iwnfw/iwn6000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 11:40:57 -0000 On Tue, 29 Dec 2009 19:47:34 +0000 (UTC), Rui Paulo wrote: > Author: rpaulo > Date: Tue Dec 29 19:47:34 2009 > New Revision: 201209 > URL: http://svn.freebsd.org/changeset/base/201209 > > Log: > iwn(4) update. Notable changes: > * new firmware > * untested support for 1000 and 6000 series > * bgscan support > * remove unnecessary RXON changes > * allow setting of country/regdomain by enforcing channel flags read > from the EEPROM > * suspend/resume fixes > * RF kill switch fixes > * LED adjustments > * several bus_dma*() related fixes > * addressed some LORs > * many other bug fixes First of all thanks for all the updates :-) The new firmware seems to have a few problems when it tries to initialize my laptop's iwn0 interface. The laptop is a Thinkpad X61s, with an Intel 4965AGN wireless adapter: # pciconf -lv iwn0@pci0:3:0:0: class=0x028000 card=0x11108086 chip=0x42308086 rev=0x61 hdr=0x00 vendor = 'Intel Corporation' device = 'Intel Wireless WiFi Link 4965AGN (Intel 4965AGN)' class = network When wpa_supplicant is trying to associate with the new firmware in place I see in /var/log/messages: : Dec 30 13:10:43 kobe kernel: wlan0: Ethernet address: 00:1d:e0:6d:b8:27 : Dec 30 13:10:43 kobe wpa_supplicant[2928]: Failed to initiate AP scan. : Dec 30 13:10:44 kobe kernel: firmware error log: : Dec 30 13:10:44 kobe kernel: error type = "SYSASSERT" (0x00000005) : Dec 30 13:10:44 kobe kernel: program counter = 0x0000147C : Dec 30 13:10:44 kobe kernel: source line = 0x0000058B : Dec 30 13:10:44 kobe kernel: error data = 0x0000058B00000000 : Dec 30 13:10:44 kobe kernel: branch link = 0x0000145A00001492 : Dec 30 13:10:44 kobe kernel: interrupt link = 0x000006DE00000000 : Dec 30 13:10:44 kobe kernel: time = 7310 : Dec 30 13:10:44 kobe kernel: driver status: : Dec 30 13:10:44 kobe kernel: tx ring 0: qid=0 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 1: qid=1 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 2: qid=2 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 3: qid=3 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 4: qid=4 cur=5 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 5: qid=5 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 6: qid=6 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 7: qid=7 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 8: qid=8 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 9: qid=9 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 10: qid=10 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 11: qid=11 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 12: qid=12 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 13: qid=13 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 14: qid=14 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: tx ring 15: qid=15 cur=0 queued=0 : Dec 30 13:10:44 kobe kernel: rx ring: cur=6 : Dec 30 13:10:45 kobe kernel: iwn0: iwn_config: could not set TX power : Dec 30 13:10:45 kobe kernel: iwn0: iwn_init_locked: could not configure device, error 35 : Dec 30 13:10:53 kobe wpa_supplicant[2928]: Failed to initiate AP scan. Going back to my last kernel from Dec 27 works fine (I am sending this message over a wlan0 interface with that version of the firmware). From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 14:29:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D62D7106566C; Wed, 30 Dec 2009 14:29:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A584B8FC12; Wed, 30 Dec 2009 14:29:03 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 524DD46B51; Wed, 30 Dec 2009 09:29:03 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 936348A01D; Wed, 30 Dec 2009 09:29:02 -0500 (EST) From: John Baldwin To: "M. Warner Losh" Date: Wed, 30 Dec 2009 08:42:55 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912290849.nBT8nh7c017065@svn.freebsd.org> <20091229.180757.951589869071195982.imp@bsdimp.com> In-Reply-To: <20091229.180757.951589869071195982.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912300842.55311.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 30 Dec 2009 09:29:02 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: dougb@freebsd.org, svn-src-all@freebsd.org, ed@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org, scf@freebsd.org Subject: Re: svn commit: r201180 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 14:29:03 -0000 On Tuesday 29 December 2009 8:07:57 pm M. Warner Losh wrote: > In message: > "Sean C. Farley" writes: > : On Tue, 29 Dec 2009, Doug Barton wrote: > : > : > Ed Schouten wrote: > : >> While there, rename die_you_gravy_sucking_pig_dog() to something > : >> that's > : >> less moronic. > : > > : > Boo! IMO the fact that at least some of our sources have some > : > personality is a feature. :) > : > : How about alt_shutdown_die_die_die()? :) > > my_name_is_enigo_montoya_you_killed_my_father_prepare_to_die() Stop saying that! :) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 14:41:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6192E1065670; Wed, 30 Dec 2009 14:41:02 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 522248FC0A; Wed, 30 Dec 2009 14:41:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUEf2EF061830; Wed, 30 Dec 2009 14:41:02 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUEf2Rv061828; Wed, 30 Dec 2009 14:41:02 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200912301441.nBUEf2Rv061828@svn.freebsd.org> From: Matt Jacob Date: Wed, 30 Dec 2009 14:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201257 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 14:41:02 -0000 Author: mjacob Date: Wed Dec 30 14:41:02 2009 New Revision: 201257 URL: http://svn.freebsd.org/changeset/base/201257 Log: Removing pre-commit review on isp(4). It's time to let people have their way with it, if they so choose. I've been fooling with it since 1997. Enough. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Wed Dec 30 11:46:38 2009 (r201256) +++ head/MAINTAINERS Wed Dec 30 14:41:02 2009 (r201257) @@ -48,7 +48,6 @@ iostat(8) ken Pre-commit review requeste cd(4) ken Pre-commit review requested. pass(4) ken Pre-commit review requested. ch(4) ken Pre-commit review requested. -isp(4) mjacob Pre-commit review requested. em(4) jfv Pre-commit review requested. tdfx(4) cokane Just keep me informed of changes, try not to break it. sendmail gshapiro Pre-commit review requested. From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 15:01:23 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FB41106568F; Wed, 30 Dec 2009 15:01:23 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id 660A28FC1E; Wed, 30 Dec 2009 15:01:23 +0000 (UTC) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id nBUF1JuY041965; Wed, 30 Dec 2009 09:01:19 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Wed, 30 Dec 2009 09:01:19 -0600 (CST) From: "Sean C. Farley" To: "M. Warner Losh" In-Reply-To: <20091229.180757.951589869071195982.imp@bsdimp.com> Message-ID: References: <200912290849.nBT8nh7c017065@svn.freebsd.org> <4B3A5C2E.5080701@FreeBSD.org> <20091229.180757.951589869071195982.imp@bsdimp.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.8 required=4.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, dougb@FreeBSD.org, ed@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201180 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 15:01:23 -0000 On Tue, 29 Dec 2009, M. Warner Losh wrote: > In message: > "Sean C. Farley" writes: > : On Tue, 29 Dec 2009, Doug Barton wrote: > : > : > Ed Schouten wrote: > : >> While there, rename die_you_gravy_sucking_pig_dog() to something > : >> that's > : >> less moronic. > : > > : > Boo! IMO the fact that at least some of our sources have some > : > personality is a feature. :) > : > : How about alt_shutdown_die_die_die()? :) > > my_name_is_enigo_montoya_you_killed_my_father_prepare_to_die() I am not sure it means what I think it means. ;) Sean -- scf@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 15:44:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1208E106568F; Wed, 30 Dec 2009 15:44:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 025F48FC1A; Wed, 30 Dec 2009 15:44:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUFia9U063148; Wed, 30 Dec 2009 15:44:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUFiaOS063146; Wed, 30 Dec 2009 15:44:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912301544.nBUFiaOS063146@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 30 Dec 2009 15:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201258 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 15:44:37 -0000 Author: jilles Date: Wed Dec 30 15:44:36 2009 New Revision: 201258 URL: http://svn.freebsd.org/changeset/base/201258 Log: Remove the current directory from _PATH_STDPATH. Modified: head/include/paths.h Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Wed Dec 30 14:41:02 2009 (r201257) +++ head/include/paths.h Wed Dec 30 15:44:36 2009 (r201258) @@ -42,7 +42,7 @@ /* Default search path. */ #define _PATH_DEFPATH "/usr/bin:/bin" /* All standard utilities path. */ -#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin:" +#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" /* Locate system binaries. */ #define _PATH_SYSPATH "/sbin:/usr/sbin" From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 15:55:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2136E106566C; Wed, 30 Dec 2009 15:55:46 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 570798FC0A; Wed, 30 Dec 2009 15:55:44 +0000 (UTC) Received: by fxm27 with SMTP id 27so11586562fxm.3 for ; Wed, 30 Dec 2009 07:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=k2eTS206Sau1mUYMt/nuuKdX0jchvItydseICEs1hQM=; b=Kbt45o21fPE0xqCwh8gsEAoBl26BgqDYKekbbPF6bd0Bs/cVjc5b+Xdc3joeKHdb2O OUbHSukCTIVS1mtPeMxdqhsHFeu1ndou/9WqkBtcGf9qM6O/I/GMoXfrLpxTUxHe6uP+ bBKImZFHzFzK7IpopCLUVHwDKelESVBju7kVk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=uloKlHaPsV9IC61qvdEibC6CWsdbnmLpJLNO4A8KlPZb0CwA0mh/eHJRTlHbsLTzPT A2bMMLZdL0QdXuzANzCuFmH/AmY+QGRDmqlxV1m0wdodu4rWQgKPfDOSHWsuMNoD1O1t JxVxW2RhwA8NcoxZhM3tAwwxqOOaaUpJc+JkE= Received: by 10.223.7.21 with SMTP id b21mr12860929fab.104.1262188536593; Wed, 30 Dec 2009 07:55:36 -0800 (PST) Received: from ?10.0.10.2? (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by mx.google.com with ESMTPS id 16sm4632091fxm.12.2009.12.30.07.55.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 30 Dec 2009 07:55:35 -0800 (PST) Sender: Rui Paulo Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <871vichepm.fsf@kobe.laptop> Date: Wed, 30 Dec 2009 15:55:34 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4B746056-56D0-4B39-BB01-57BC6097AB4B@FreeBSD.org> References: <200912291947.nBTJlY7a034177@svn.freebsd.org> <871vichepm.fsf@kobe.laptop> To: Giorgos Keramidas X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201209 - in head/sys: conf contrib/dev/iwn dev/iwn modules/iwnfw modules/iwnfw/iwn1000 modules/iwnfw/iwn4965 modules/iwnfw/iwn5000 modules/iwnfw/iwn6000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 15:55:46 -0000 On 30 Dec 2009, at 11:40, Giorgos Keramidas wrote: > On Tue, 29 Dec 2009 19:47:34 +0000 (UTC), Rui Paulo = wrote: >> Author: rpaulo >> Date: Tue Dec 29 19:47:34 2009 >> New Revision: 201209 >> URL: http://svn.freebsd.org/changeset/base/201209 >>=20 >> Log: >> iwn(4) update. Notable changes: >> * new firmware >> * untested support for 1000 and 6000 series >> * bgscan support >> * remove unnecessary RXON changes >> * allow setting of country/regdomain by enforcing channel flags read >> from the EEPROM >> * suspend/resume fixes >> * RF kill switch fixes >> * LED adjustments >> * several bus_dma*() related fixes >> * addressed some LORs >> * many other bug fixes >=20 > First of all thanks for all the updates :-) >=20 > The new firmware seems to have a few problems when it tries to > initialize my laptop's iwn0 interface. The laptop is a Thinkpad X61s, > with an Intel 4965AGN wireless adapter: >=20 > # pciconf -lv > iwn0@pci0:3:0:0: class=3D0x028000 card=3D0x11108086 = chip=3D0x42308086 rev=3D0x61 hdr=3D0x00 > vendor =3D 'Intel Corporation' > device =3D 'Intel Wireless WiFi Link 4965AGN (Intel 4965AGN)' > class =3D network >=20 > When wpa_supplicant is trying to associate with the new firmware in > place I see in /var/log/messages: >=20 > : Dec 30 13:10:43 kobe kernel: wlan0: Ethernet address: = 00:1d:e0:6d:b8:27 > : Dec 30 13:10:43 kobe wpa_supplicant[2928]: Failed to initiate AP = scan. > : Dec 30 13:10:44 kobe kernel: firmware error log: > : Dec 30 13:10:44 kobe kernel: error type =3D "SYSASSERT" = (0x00000005) > : Dec 30 13:10:44 kobe kernel: program counter =3D 0x0000147C > : Dec 30 13:10:44 kobe kernel: source line =3D 0x0000058B > : Dec 30 13:10:44 kobe kernel: error data =3D 0x0000058B00000000 > : Dec 30 13:10:44 kobe kernel: branch link =3D 0x0000145A00001492 > : Dec 30 13:10:44 kobe kernel: interrupt link =3D 0x000006DE00000000 > : Dec 30 13:10:44 kobe kernel: time =3D 7310 > : Dec 30 13:10:44 kobe kernel: driver status: > : Dec 30 13:10:44 kobe kernel: tx ring 0: qid=3D0 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 1: qid=3D1 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 2: qid=3D2 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 3: qid=3D3 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 4: qid=3D4 cur=3D5 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 5: qid=3D5 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 6: qid=3D6 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 7: qid=3D7 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 8: qid=3D8 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 9: qid=3D9 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 10: qid=3D10 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 11: qid=3D11 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 12: qid=3D12 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 13: qid=3D13 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 14: qid=3D14 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: tx ring 15: qid=3D15 cur=3D0 queued=3D0= > : Dec 30 13:10:44 kobe kernel: rx ring: cur=3D6 > : Dec 30 13:10:45 kobe kernel: iwn0: iwn_config: could not set TX = power > : Dec 30 13:10:45 kobe kernel: iwn0: iwn_init_locked: could not = configure device, error 35 > : Dec 30 13:10:53 kobe wpa_supplicant[2928]: Failed to initiate AP = scan. >=20 > Going back to my last kernel from Dec 27 works fine (I am sending this > message over a wlan0 interface with that version of the firmware). Did you try using the old firmware with the new driver? -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 15:59:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28A311065695; Wed, 30 Dec 2009 15:59:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 182078FC13; Wed, 30 Dec 2009 15:59:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUFxeSe063471; Wed, 30 Dec 2009 15:59:40 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUFxevP063468; Wed, 30 Dec 2009 15:59:40 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912301559.nBUFxevP063468@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 30 Dec 2009 15:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201259 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 15:59:41 -0000 Author: jilles Date: Wed Dec 30 15:59:40 2009 New Revision: 201259 URL: http://svn.freebsd.org/changeset/base/201259 Log: sh: arith: Return only 0 and 1 from && and ||. This agrees with C, POSIX and other shells. Added: head/tools/regression/bin/sh/expansion/arith1.0 (contents, props changed) Modified: head/bin/sh/arith.y Modified: head/bin/sh/arith.y ============================================================================== --- head/bin/sh/arith.y Wed Dec 30 15:44:36 2009 (r201258) +++ head/bin/sh/arith.y Wed Dec 30 15:59:40 2009 (r201259) @@ -85,9 +85,9 @@ expr: ARITH_LPAREN expr ARITH_RPAREN { $$ = $2; } | expr ARITH_OR expr - { $$ = $1 ? $1 : $3 ? $3 : 0; } | + { $$ = $1 || $3; } | expr ARITH_AND expr - { $$ = $1 ? ( $3 ? $3 : 0 ) : 0; } | + { $$ = $1 && $3; } | expr ARITH_BOR expr { $$ = $1 | $3; } | expr ARITH_BXOR expr Added: head/tools/regression/bin/sh/expansion/arith1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/arith1.0 Wed Dec 30 15:59:40 2009 (r201259) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +failures=0 + +check() { + if [ $(($1)) != $2 ]; then + failures=$((failures+1)) + echo "For $1, expected $2 actual $(($1))" + fi +} + +check "0&&0" 0 +check "1&&0" 0 +check "0&&1" 0 +check "1&&1" 1 +check "2&&2" 1 +check "1&&2" 1 +check "1<<40&&1<<40" 1 +check "1<<40&&4" 1 + +check "0||0" 0 +check "1||0" 1 +check "0||1" 1 +check "1||1" 1 +check "2||2" 1 +check "1||2" 1 +check "1<<40||1<<40" 1 +check "1<<40||4" 1 + +exit $((failures != 0)) From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 16:02:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26D3610656F4; Wed, 30 Dec 2009 16:02:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 971FF8FC0C; Wed, 30 Dec 2009 16:02:44 +0000 (UTC) Received: from c220-239-235-55.carlnfd3.nsw.optusnet.com.au (c220-239-235-55.carlnfd3.nsw.optusnet.com.au [220.239.235.55]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id nBUG2ck4016976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 31 Dec 2009 03:02:42 +1100 Date: Thu, 31 Dec 2009 03:02:38 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Doug Barton In-Reply-To: <4B3A5C2E.5080701@FreeBSD.org> Message-ID: <20091231030107.K48283@delplex.bde.org> References: <200912290849.nBT8nh7c017065@svn.freebsd.org> <4B3A5C2E.5080701@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r201180 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 16:02:45 -0000 On Tue, 29 Dec 2009, Doug Barton wrote: > Ed Schouten wrote: >> While there, rename die_you_gravy_sucking_pig_dog() to something that's >> less moronic. > > Boo! IMO the fact that at least some of our sources have some > personality is a feature. :) A comment is apparently missing (though it goes without saying). From tunefs(8): .\" Take this out and a Unix Daemon will dog your steps from now until .\" the time_t's wrap around. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 16:06:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE7131065695; Wed, 30 Dec 2009 16:06:33 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 50F998FC16; Wed, 30 Dec 2009 16:06:33 +0000 (UTC) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 1CB13EB48E2; Wed, 30 Dec 2009 18:06:32 +0200 (EET) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id D9B6C44FE4; Wed, 30 Dec 2009 18:06:34 +0200 (EET) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u+KeCPac-Dfv; Wed, 30 Dec 2009 18:06:34 +0200 (EET) Received: from kobe.laptop (ppp-94-64-238-171.home.otenet.gr [94.64.238.171]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 9549C44FE3; Wed, 30 Dec 2009 18:06:34 +0200 (EET) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id nBUG6UF1004956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 30 Dec 2009 18:06:30 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id nBUG6U0J004953; Wed, 30 Dec 2009 18:06:30 +0200 (EET) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Rui Paulo References: <200912291947.nBTJlY7a034177@svn.freebsd.org> <871vichepm.fsf@kobe.laptop> <4B746056-56D0-4B39-BB01-57BC6097AB4B@FreeBSD.org> Date: Wed, 30 Dec 2009 18:06:29 +0200 In-Reply-To: <4B746056-56D0-4B39-BB01-57BC6097AB4B@FreeBSD.org> (Rui Paulo's message of "Wed, 30 Dec 2009 15:55:34 +0000") Message-ID: <87bphgfnui.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201209 - in head/sys: conf contrib/dev/iwn dev/iwn modules/iwnfw modules/iwnfw/iwn1000 modules/iwnfw/iwn4965 modules/iwnfw/iwn5000 modules/iwnfw/iwn6000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 16:06:34 -0000 On Wed, 30 Dec 2009 15:55:34 +0000, Rui Paulo wrote: > On 30 Dec 2009, at 11:40, Giorgos Keramidas wrote: >> First of all thanks for all the updates :-) >> >> The new firmware seems to have a few problems when it tries to >> initialize my laptop's iwn0 interface. The laptop is a Thinkpad X61s, >> with an Intel 4965AGN wireless adapter: >> : Dec 30 13:10:45 kobe kernel: iwn0: iwn_config: could not set TX power >> : Dec 30 13:10:45 kobe kernel: iwn0: iwn_init_locked: could not configure device, error 35 >> : Dec 30 13:10:53 kobe wpa_supplicant[2928]: Failed to initiate AP scan. >> >> Going back to my last kernel from Dec 27 works fine (I am sending this >> message over a wlan0 interface with that version of the firmware). > > Did you try using the old firmware with the new driver? No, but I will try it later tonight. Thanks :) From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 16:56:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C42701065694; Wed, 30 Dec 2009 16:56:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A7FA8FC21; Wed, 30 Dec 2009 16:56:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUGuoMH064746; Wed, 30 Dec 2009 16:56:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUGuoOC064741; Wed, 30 Dec 2009 16:56:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912301656.nBUGuoOC064741@svn.freebsd.org> From: Ed Schouten Date: Wed, 30 Dec 2009 16:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201261 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 16:56:50 -0000 Author: ed Date: Wed Dec 30 16:56:50 2009 New Revision: 201261 URL: http://svn.freebsd.org/changeset/base/201261 Log: Add missing `void' keywords. Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l head/sys/dev/aic7xxx/aicasm/aicasm_scan.l head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm.c Wed Dec 30 16:37:58 2009 (r201260) +++ head/sys/dev/aic7xxx/aicasm/aicasm.c Wed Dec 30 16:56:50 2009 (r201261) @@ -306,7 +306,7 @@ main(int argc, char *argv[]) } static void -usage() +usage(void) { (void)fprintf(stderr, @@ -318,7 +318,7 @@ usage() } static void -back_patch() +back_patch(void) { struct instruction *cur_instr; @@ -347,7 +347,7 @@ back_patch() } static void -output_code() +output_code(void) { struct instruction *cur_instr; patch_t *cur_patch; @@ -733,7 +733,7 @@ stop(const char *string, int err_code) } struct instruction * -seq_alloc() +seq_alloc(void) { struct instruction *new_instr; @@ -747,7 +747,7 @@ seq_alloc() } critical_section_t * -cs_alloc() +cs_alloc(void) { critical_section_t *new_cs; @@ -761,7 +761,7 @@ cs_alloc() } scope_t * -scope_alloc() +scope_alloc(void) { scope_t *new_scope; Modified: head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Wed Dec 30 16:37:58 2009 (r201260) +++ head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Wed Dec 30 16:56:50 2009 (r201261) @@ -152,7 +152,7 @@ MCARG [^(), \t]+ %% int -mmwrap() +mmwrap(void) { stop("EOF encountered in macro call", EX_DATAERR); return (1); Modified: head/sys/dev/aic7xxx/aicasm/aicasm_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Wed Dec 30 16:37:58 2009 (r201260) +++ head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Wed Dec 30 16:56:50 2009 (r201261) @@ -590,7 +590,7 @@ next_substitution(struct symbol *mac_sym } int -yywrap() +yywrap(void) { include_t *include; Modified: head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c Wed Dec 30 16:37:58 2009 (r201260) +++ head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c Wed Dec 30 16:56:50 2009 (r201261) @@ -129,7 +129,7 @@ symbol_delete(symbol_t *symbol) } void -symtable_open() +symtable_open(void) { symtable = dbopen(/*filename*/NULL, O_CREAT | O_NONBLOCK | O_RDWR, /*mode*/0, DB_HASH, @@ -143,7 +143,7 @@ symtable_open() } void -symtable_close() +symtable_close(void) { if (symtable != NULL) { DBT key; From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 17:16:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 863881065797; Wed, 30 Dec 2009 17:16:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75DFF8FC14; Wed, 30 Dec 2009 17:16:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUHGnwr065164; Wed, 30 Dec 2009 17:16:49 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUHGnc4065162; Wed, 30 Dec 2009 17:16:49 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912301716.nBUHGnc4065162@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 30 Dec 2009 17:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201262 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 17:16:49 -0000 Author: jilles Date: Wed Dec 30 17:16:49 2009 New Revision: 201262 URL: http://svn.freebsd.org/changeset/base/201262 Log: Fix memory leak when parsing backticks (``). Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Wed Dec 30 16:56:50 2009 (r201261) +++ head/bin/sh/parser.c Wed Dec 30 17:16:49 2009 (r201262) @@ -1311,11 +1311,16 @@ parsebackq: { int savelen; int saveprompt; const int bq_startlinno = plinno; + char *volatile ostr = NULL; + struct parsefile *const savetopfile = getcurrentfile(); str = NULL; if (setjmp(jmploc.loc)) { + popfilesupto(savetopfile); if (str) ckfree(str); + if (ostr) + ckfree(ostr); handler = savehandler; if (exception == EXERROR) { startlinno = bq_startlinno; @@ -1335,13 +1340,12 @@ parsebackq: { /* We must read until the closing backquote, giving special treatment to some slashes, and then push the string and reread it as input, interpreting it normally. */ - char *out; + char *oout; int c; - int savelen; - char *str; + int olen; - STARTSTACKSTR(out); + STARTSTACKSTR(oout); for (;;) { if (needprompt) { setprompt(2); @@ -1368,7 +1372,7 @@ parsebackq: { } if (c != '\\' && c != '`' && c != '$' && (!dblquote || c != '"')) - STPUTC('\\', out); + STPUTC('\\', oout); break; case '\n': @@ -1384,16 +1388,16 @@ parsebackq: { default: break; } - STPUTC(c, out); + STPUTC(c, oout); } done: - STPUTC('\0', out); - savelen = out - stackblock(); - if (savelen > 0) { - str = ckmalloc(savelen); - memcpy(str, stackblock(), savelen); - setinputstring(str, 1); - } + STPUTC('\0', oout); + olen = oout - stackblock(); + INTOFF; + ostr = ckmalloc(olen); + memcpy(ostr, stackblock(), olen); + setinputstring(ostr, 1); + INTON; } nlpp = &bqlist; while (*nlpp) @@ -1435,6 +1439,12 @@ done: str = NULL; INTON; } + if (ostr) { + INTOFF; + ckfree(ostr); + ostr = NULL; + INTON; + } handler = savehandler; if (arinest || dblquote) USTPUTC(CTLBACKQ | CTLQUOTE, out); From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 17:23:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A0F61065693; Wed, 30 Dec 2009 17:23:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A2DF8FC14; Wed, 30 Dec 2009 17:23:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUHNRHl065386; Wed, 30 Dec 2009 17:23:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUHNRKm065384; Wed, 30 Dec 2009 17:23:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912301723.nBUHNRKm065384@svn.freebsd.org> From: Alexander Motin Date: Wed, 30 Dec 2009 17:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201264 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 17:23:28 -0000 Author: mav Date: Wed Dec 30 17:23:27 2009 New Revision: 201264 URL: http://svn.freebsd.org/changeset/base/201264 Log: Call wakeup() only for the first request on the queue. Modified: head/sys/geom/geom_io.c Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Wed Dec 30 17:22:00 2009 (r201263) +++ head/sys/geom/geom_io.c Wed Dec 30 17:23:27 2009 (r201264) @@ -391,6 +391,7 @@ void g_io_request(struct bio *bp, struct g_consumer *cp) { struct g_provider *pp; + int first; KASSERT(cp != NULL, ("NULL cp in g_io_request")); KASSERT(bp != NULL, ("NULL bp in g_io_request")); @@ -463,12 +464,14 @@ g_io_request(struct bio *bp, struct g_co pp->nstart++; cp->nstart++; + first = TAILQ_EMPTY(&g_bio_run_down.bio_queue); TAILQ_INSERT_TAIL(&g_bio_run_down.bio_queue, bp, bio_queue); g_bio_run_down.bio_queue_length++; g_bioq_unlock(&g_bio_run_down); /* Pass it on down. */ - wakeup(&g_wait_down); + if (first) + wakeup(&g_wait_down); } void @@ -476,6 +479,7 @@ g_io_deliver(struct bio *bp, int error) { struct g_consumer *cp; struct g_provider *pp; + int first; KASSERT(bp != NULL, ("NULL bp in g_io_deliver")); pp = bp->bio_to; @@ -536,11 +540,13 @@ g_io_deliver(struct bio *bp, int error) pp->nend++; if (error != ENOMEM) { bp->bio_error = error; + first = TAILQ_EMPTY(&g_bio_run_up.bio_queue); TAILQ_INSERT_TAIL(&g_bio_run_up.bio_queue, bp, bio_queue); bp->bio_flags |= BIO_ONQUEUE; g_bio_run_up.bio_queue_length++; g_bioq_unlock(&g_bio_run_up); - wakeup(&g_wait_up); + if (first) + wakeup(&g_wait_up); return; } g_bioq_unlock(&g_bio_run_up); From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 18:00:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2205106566C; Wed, 30 Dec 2009 18:00:53 +0000 (UTC) (envelope-from ports@logvinov.com) Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by mx1.freebsd.org (Postfix) with ESMTP id 586ED8FC0C; Wed, 30 Dec 2009 18:00:53 +0000 (UTC) Received: by gxk10 with SMTP id 10so11637103gxk.3 for ; Wed, 30 Dec 2009 10:00:45 -0800 (PST) Received: by 10.101.182.39 with SMTP id j39mr7499388anp.134.1262194322816; Wed, 30 Dec 2009 09:32:02 -0800 (PST) Received: from incubus.bsd ([222.131.32.21]) by mx.google.com with ESMTPS id 35sm5510619yxh.51.2009.12.30.09.32.00 (version=SSLv3 cipher=RC4-MD5); Wed, 30 Dec 2009 09:32:02 -0800 (PST) Message-ID: <4B3B8EB2.7040505@logvinov.com> Date: Thu, 31 Dec 2009 01:32:34 +0800 From: Alexander Logvinov User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; ru-RU; rv:1.9.1.5) Gecko/20091224 Thunderbird/3.0 MIME-Version: 1.0 To: Rui Paulo References: <200912291947.nBTJlY7a034177@svn.freebsd.org> In-Reply-To: <200912291947.nBTJlY7a034177@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201209 - in head/sys: conf contrib/dev/iwn dev/iwn modules/iwnfw modules/iwnfw/iwn1000 modules/iwnfw/iwn4965 modules/iwnfw/iwn5000 modules/iwnfw/iwn6000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 18:00:54 -0000 Hello! On 30.12.2009 03:47 Rui Paulo wrote: > Author: rpaulo > Log: > iwn(4) update. Notable changes: Thanks! Now I don't have any problem with this http://lists.freebsd.org/pipermail/freebsd-mobile/2009-November/011806.html . -- Best regards, Alexander Logvinov PGP: 0x1C47D5C0 http://people.freebsd.org/~avl/avl.asc From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 18:15:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59C8D106566B; Wed, 30 Dec 2009 18:15:26 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 475098FC2F; Wed, 30 Dec 2009 18:15:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUIFQlx066778; Wed, 30 Dec 2009 18:15:26 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUIFQjQ066769; Wed, 30 Dec 2009 18:15:26 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912301815.nBUIFQjQ066769@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 30 Dec 2009 18:15:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201269 - in head/sys: conf ia64/ia64 ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 18:15:26 -0000 Author: marcel Date: Wed Dec 30 18:15:25 2009 New Revision: 201269 URL: http://svn.freebsd.org/changeset/base/201269 Log: Revamp bus_space access functions: o Optimize for memory mapped I/O by making all I/O port acceses function calls and marking the test for the IA64_BUS_SPACE_IO tag with __predict_false(). Implement the I/O port access functions in a new file, called bus_machdep.c. o Change the bus_space_handle_t for memory mapped I/O to the virtual address rather than the physical address. This eliminates the PA->VA translation for every I/O access. The handle for I/O port access is still the port number. o Move inb(), outb(), inw(), outw(), inl(), outl(), and their string variants from cpufunc.h and define them in bus.h. On ia64 these are not CPU functions at all. In bus.h they are merely aliases for the new I/O port access functions defined in bus_machdep.h. o Handle the ACPI resource bug in nexus_set_resource(). There we can do it once so that we don't have to worry about it whenever we need to write to an I/O port that is really a memory mapped address. The upshot of this change is that the KBI is better defined and that I/O port access always involves a function call, allowing us to change the actual implementation without breaking the KBI. For memory mapped I/O the virtual address is abstracted, so that we can change the VA->PA mapping in the kernel without causing an KBI breakage. The exception at this time is for bus_space_map() and bus_space_unmap(). MFC after: 1 week. Added: head/sys/ia64/ia64/bus_machdep.c (contents, props changed) Modified: head/sys/conf/files.ia64 head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/mp_machdep.c head/sys/ia64/ia64/nexus.c head/sys/ia64/ia64/sys_machdep.c head/sys/ia64/include/bus.h head/sys/ia64/include/cpufunc.h Modified: head/sys/conf/files.ia64 ============================================================================== --- head/sys/conf/files.ia64 Wed Dec 30 17:55:20 2009 (r201268) +++ head/sys/conf/files.ia64 Wed Dec 30 18:15:25 2009 (r201269) @@ -72,6 +72,7 @@ ia64/ia32/ia32_reg.c optional compat_ia ia64/ia32/ia32_signal.c optional compat_ia32 ia64/ia32/ia32_trap.c optional compat_ia32 ia64/ia64/autoconf.c standard +ia64/ia64/bus_machdep.c standard ia64/ia64/busdma_machdep.c standard ia64/ia64/clock.c standard ia64/ia64/context.S standard Added: head/sys/ia64/ia64/bus_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/ia64/ia64/bus_machdep.c Wed Dec 30 18:15:25 2009 (r201269) @@ -0,0 +1,356 @@ +/*- + * Copyright (c) 2009 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +extern u_long ia64_port_base; + +#define __PIO_ADDR(port) \ + (void *)(ia64_port_base | (((port) & 0xfffc) << 10) | ((port) & 0xFFF)) + +uint8_t +bus_space_read_io_1(u_long port) +{ + uint8_t v; + + ia64_mf(); + v = ia64_ld1(__PIO_ADDR(port)); + ia64_mf_a(); + ia64_mf(); + return (v); +} + +uint16_t +bus_space_read_io_2(u_long port) +{ + uint16_t v; + + ia64_mf(); + v = ia64_ld2(__PIO_ADDR(port)); + ia64_mf_a(); + ia64_mf(); + return (v); +} + +uint32_t +bus_space_read_io_4(u_long port) +{ + uint32_t v; + + ia64_mf(); + v = ia64_ld4(__PIO_ADDR(port)); + ia64_mf_a(); + ia64_mf(); + return (v); +} + +#if 0 +uint64_t +bus_space_read_io_8(u_long port) +{ +} +#endif + +void +bus_space_write_io_1(u_long port, uint8_t val) +{ + + ia64_mf(); + ia64_st1(__PIO_ADDR(port), val); + ia64_mf_a(); + ia64_mf(); +} + +void +bus_space_write_io_2(u_long port, uint16_t val) +{ + + ia64_mf(); + ia64_st2(__PIO_ADDR(port), val); + ia64_mf_a(); + ia64_mf(); +} + +void +bus_space_write_io_4(u_long port, uint32_t val) +{ + + ia64_mf(); + ia64_st4(__PIO_ADDR(port), val); + ia64_mf_a(); + ia64_mf(); +} + +#if 0 +void +bus_space_write_io_8(u_long port, uint64_t val) +{ +} +#endif + +void +bus_space_read_multi_io_1(u_long port, uint8_t *ptr, size_t count) +{ + + while (count-- > 0) + *ptr++ = bus_space_read_io_1(port); +} + +void +bus_space_read_multi_io_2(u_long port, uint16_t *ptr, size_t count) +{ + + while (count-- > 0) + *ptr++ = bus_space_read_io_2(port); +} + +void +bus_space_read_multi_io_4(u_long port, uint32_t *ptr, size_t count) +{ + + while (count-- > 0) + *ptr++ = bus_space_read_io_4(port); +} + +#if 0 +void +bus_space_read_multi_io_8(u_long port, uint64_t *ptr, size_t count) +{ +} +#endif + +void +bus_space_write_multi_io_1(u_long port, const uint8_t *ptr, size_t count) +{ + + while (count-- > 0) + bus_space_write_io_1(port, *ptr++); +} + +void +bus_space_write_multi_io_2(u_long port, const uint16_t *ptr, size_t count) +{ + + while (count-- > 0) + bus_space_write_io_2(port, *ptr++); +} + +void +bus_space_write_multi_io_4(u_long port, const uint32_t *ptr, size_t count) +{ + + while (count-- > 0) + bus_space_write_io_4(port, *ptr++); +} + +#if 0 +void +bus_space_write_multi_io_8(u_long port, const uint64_t *ptr, size_t count) +{ +} +#endif + +void +bus_space_read_region_io_1(u_long port, uint8_t *ptr, size_t count) +{ + + while (count-- > 0) { + *ptr++ = bus_space_read_io_1(port); + port += 1; + } +} + +void +bus_space_read_region_io_2(u_long port, uint16_t *ptr, size_t count) +{ + + while (count-- > 0) { + *ptr++ = bus_space_read_io_2(port); + port += 2; + } +} + +void +bus_space_read_region_io_4(u_long port, uint32_t *ptr, size_t count) +{ + + while (count-- > 0) { + *ptr++ = bus_space_read_io_4(port); + port += 4; + } +} + +#if 0 +void bus_space_read_region_io_8(u_long, uint64_t *, size_t); +#endif + +void +bus_space_write_region_io_1(u_long port, const uint8_t *ptr, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_1(port, *ptr++); + port += 1; + } +} + +void +bus_space_write_region_io_2(u_long port, const uint16_t *ptr, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_2(port, *ptr++); + port += 2; + } +} + +void +bus_space_write_region_io_4(u_long port, const uint32_t *ptr, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_4(port, *ptr++); + port += 4; + } +} + +#if 0 +void +bus_space_write_region_io_8(u_long port, const uint64_t *ptr, size_t count) +{ +} +#endif + +void +bus_space_set_region_io_1(u_long port, uint8_t val, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_1(port, val); + port += 1; + } +} + +void +bus_space_set_region_io_2(u_long port, uint16_t val, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_2(port, val); + port += 2; + } +} + +void +bus_space_set_region_io_4(u_long port, uint32_t val, size_t count) +{ + + while (count-- > 0) { + bus_space_write_io_4(port, val); + port += 4; + } +} + +#if 0 +void +bus_space_set_region_io_8(u_long port, uint64_t val, size_t count) +{ +} +#endif + +void +bus_space_copy_region_io_1(u_long src, u_long dst, size_t count) +{ + long delta; + uint8_t val; + + if (src < dst) { + src += count - 1; + dst += count - 1; + delta = -1; + } else + delta = 1; + + while (count-- > 0) { + val = bus_space_read_io_1(src); + bus_space_write_io_1(dst, val); + src += delta; + dst += delta; + } +} + +void +bus_space_copy_region_io_2(u_long src, u_long dst, size_t count) +{ + long delta; + uint16_t val; + + if (src < dst) { + src += 2 * (count - 1); + dst += 2 * (count - 1); + delta = -2; + } else + delta = 2; + + while (count-- > 0) { + val = bus_space_read_io_2(src); + bus_space_write_io_2(dst, val); + src += delta; + dst += delta; + } +} + +void +bus_space_copy_region_io_4(u_long src, u_long dst, size_t count) +{ + long delta; + uint32_t val; + + if (src < dst) { + src += 4 * (count - 1); + dst += 4 * (count - 1); + delta = -4; + } else + delta = 4; + + while (count-- > 0) { + val = bus_space_read_io_4(src); + bus_space_write_io_4(dst, val); + src += delta; + dst += delta; + } +} + +#if 0 +void +bus_space_copy_region_io_8(u_long src, u_long dst, size_t count) +{ +} +#endif Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Wed Dec 30 17:55:20 2009 (r201268) +++ head/sys/ia64/ia64/machdep.c Wed Dec 30 18:15:25 2009 (r201269) @@ -930,16 +930,6 @@ ia64_init(void) return (ret); } -void * -ia64_ioport_address(u_int port) -{ - uint64_t addr; - - addr = (port > 0xffff) ? IA64_PHYS_TO_RR6((uint64_t)port) : - ia64_port_base | ((port & 0xfffc) << 10) | (port & 0xFFF); - return ((void *)addr); -} - uint64_t ia64_get_hcdp(void) { Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Wed Dec 30 17:55:20 2009 (r201268) +++ head/sys/ia64/ia64/mp_machdep.c Wed Dec 30 18:15:25 2009 (r201269) @@ -366,7 +366,7 @@ ipi_send(struct pcpu *cpu, int ipi) volatile uint64_t *pipi; uint64_t vector; - pipi = __MEMIO_ADDR(ia64_lapic_address | + pipi = (void *)IA64_PHYS_TO_RR6(ia64_lapic_address | ((cpu->pc_md.lid & LID_SAPIC_MASK) >> 12)); vector = (uint64_t)(ipi_vector[ipi] & 0xff); KASSERT(vector != 0, ("IPI %d is not assigned a vector", ipi)); Modified: head/sys/ia64/ia64/nexus.c ============================================================================== --- head/sys/ia64/ia64/nexus.c Wed Dec 30 17:55:20 2009 (r201268) +++ head/sys/ia64/ia64/nexus.c Wed Dec 30 18:15:25 2009 (r201269) @@ -389,26 +389,23 @@ nexus_alloc_resource(device_t bus, devic static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) + struct resource *r) { - vm_paddr_t paddr, psize; + vm_paddr_t paddr; void *vaddr; - /* - * If this is a memory resource, map it into the kernel. - */ + paddr = rman_get_start(r); + switch (type) { case SYS_RES_IOPORT: rman_set_bustag(r, IA64_BUS_SPACE_IO); - rman_set_bushandle(r, rman_get_start(r)); + rman_set_bushandle(r, paddr); break; case SYS_RES_MEMORY: - paddr = rman_get_start(r); - psize = rman_get_size(r); - vaddr = pmap_mapdev(paddr, psize); - rman_set_virtual(r, vaddr); + vaddr = pmap_mapdev(paddr, rman_get_size(r)); rman_set_bustag(r, IA64_BUS_SPACE_MEM); - rman_set_bushandle(r, (bus_space_handle_t) paddr); + rman_set_bushandle(r, (bus_space_handle_t) vaddr); + rman_set_virtual(r, vaddr); break; } return (rman_activate_resource(r)); @@ -488,11 +485,27 @@ nexus_get_reslist(device_t dev, device_t } static int -nexus_set_resource(device_t dev, device_t child, int type, int rid, u_long start, u_long count) +nexus_set_resource(device_t dev, device_t child, int type, int rid, + u_long start, u_long count) { struct nexus_device *ndev = DEVTONX(child); struct resource_list *rl = &ndev->nx_resources; + if (type == SYS_RES_IOPORT && start > (0x10000 - count)) { + /* + * Work around a firmware bug in the HP rx2660, where in ACPI + * an I/O port is really a memory mapped I/O address. The bug + * is in the GAS that describes the address and in particular + * the SpaceId field. The field should not say the address is + * an I/O port when it is in fact an I/O memory address. + */ + if (bootverbose) + printf("%s: invalid port range (%#lx-%#lx); " + "assuming I/O memory range.\n", __func__, start, + start + count - 1); + type = SYS_RES_MEMORY; + } + /* XXX this should return a success/failure indicator */ resource_list_add(rl, type, rid, start, start + count - 1, count); return(0); Modified: head/sys/ia64/ia64/sys_machdep.c ============================================================================== --- head/sys/ia64/ia64/sys_machdep.c Wed Dec 30 17:55:20 2009 (r201268) +++ head/sys/ia64/ia64/sys_machdep.c Wed Dec 30 18:15:25 2009 (r201269) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/ia64/include/bus.h ============================================================================== --- head/sys/ia64/include/bus.h Wed Dec 30 17:55:20 2009 (r201268) +++ head/sys/ia64/include/bus.h Wed Dec 30 18:15:25 2009 (r201269) @@ -1,3 +1,29 @@ +/*- + * Copyright (c) 2009 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + /* $NetBSD: bus.h,v 1.12 1997/10/01 08:25:15 fvdl Exp $ */ /*- @@ -76,11 +102,25 @@ #include /* + * I/O port reads with ia32 semantics. + */ +#define inb bus_space_read_io_1 +#define inw bus_space_read_io_2 +#define inl bus_space_read_io_4 + +#define outb bus_space_write_io_1 +#define outw bus_space_write_io_2 +#define outl bus_space_write_io_4 + +/* * Values for the ia64 bus space tag, not to be used directly by MI code. */ #define IA64_BUS_SPACE_IO 0 /* space is i/o space */ #define IA64_BUS_SPACE_MEM 1 /* space is mem space */ +#define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */ +#define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */ + #define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFF #define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF #define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFF @@ -90,24 +130,21 @@ #define BUS_SPACE_UNRESTRICTED (~0) + /* * Map a region of device bus space into CPU virtual address space. */ - -static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, - bus_size_t size, int flags, - bus_space_handle_t *bshp); - static __inline int -bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, - bus_size_t size __unused, int flags __unused, - bus_space_handle_t *bshp) +bus_space_map(bus_space_tag_t bst, bus_addr_t addr, bus_size_t size __unused, + int flags __unused, bus_space_handle_t *bshp) { - *bshp = addr; + *bshp = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? addr : IA64_PHYS_TO_RR6(addr); return (0); } + /* * Unmap a region of device bus space. */ @@ -123,7 +160,7 @@ bus_space_unmap(bus_space_tag_t bst __un */ static __inline int bus_space_subregion(bus_space_tag_t bst, bus_space_handle_t bsh, - bus_size_t ofs, bus_size_t size, bus_space_handle_t *nbshp) + bus_size_t ofs, bus_size_t size __unused, bus_space_handle_t *nbshp) { *nbshp = bsh + ofs; return (0); @@ -149,12 +186,9 @@ bus_space_free(bus_space_tag_t bst, bus_ /* * Bus read/write barrier method. */ -#define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */ -#define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */ - static __inline void -bus_space_barrier(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, - bus_size_t size, int flags) +bus_space_barrier(bus_space_tag_t bst __unused, bus_space_handle_t bsh __unused, + bus_size_t ofs __unused, bus_size_t size __unused, int flags __unused) { ia64_mf_a(); ia64_mf(); @@ -166,40 +200,53 @@ bus_space_barrier(bus_space_tag_t bst, b * tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The * data is returned. */ +uint8_t bus_space_read_io_1(u_long); +uint16_t bus_space_read_io_2(u_long); +uint32_t bus_space_read_io_4(u_long); +uint64_t bus_space_read_io_8(u_long); + static __inline uint8_t bus_space_read_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint8_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - return (ia64_ld1(bsp)); + uint8_t val; + + val = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? bus_space_read_io_1(bsh + ofs) + : ia64_ld1((void *)(bsh + ofs)); + return (val); } static __inline uint16_t bus_space_read_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint16_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - return (ia64_ld2(bsp)); + uint16_t val; + + val = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? bus_space_read_io_2(bsh + ofs) + : ia64_ld2((void *)(bsh + ofs)); + return (val); } static __inline uint32_t bus_space_read_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint32_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - return (ia64_ld4(bsp)); + uint32_t val; + + val = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? bus_space_read_io_4(bsh + ofs) + : ia64_ld4((void *)(bsh + ofs)); + return (val); } static __inline uint64_t bus_space_read_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint64_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - return (ia64_ld8(bsp)); + uint64_t val; + + val = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? bus_space_read_io_8(bsh + ofs) + : ia64_ld8((void *)(bsh + ofs)); + return (val); } @@ -208,44 +255,53 @@ bus_space_read_8(bus_space_tag_t bst, bu * tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The * data is passed by value. */ +void bus_space_write_io_1(u_long, uint8_t); +void bus_space_write_io_2(u_long, uint16_t); +void bus_space_write_io_4(u_long, uint32_t); +void bus_space_write_io_8(u_long, uint64_t); + static __inline void bus_space_write_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val) { - uint8_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - ia64_st1(bsp, val); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_io_1(bsh + ofs, val); + else + ia64_st1((void *)(bsh + ofs), val); } static __inline void bus_space_write_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val) { - uint16_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - ia64_st2(bsp, val); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_io_2(bsh + ofs, val); + else + ia64_st2((void *)(bsh + ofs), val); } static __inline void bus_space_write_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val) { - uint32_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - ia64_st4(bsp, val); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_io_4(bsh + ofs, val); + else + ia64_st4((void *)(bsh + ofs), val); } static __inline void bus_space_write_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val) { - uint64_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - ia64_st8(bsp, val); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_io_8(bsh + ofs, val); + else + ia64_st8((void *)(bsh + ofs), val); } @@ -254,48 +310,61 @@ bus_space_write_8(bus_space_tag_t bst, b * ofs tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The * data is returned in the buffer passed by reference. */ +void bus_space_read_multi_io_1(u_long, uint8_t *, size_t); +void bus_space_read_multi_io_2(u_long, uint16_t *, size_t); +void bus_space_read_multi_io_4(u_long, uint32_t *, size_t); +void bus_space_read_multi_io_8(u_long, uint64_t *, size_t); + static __inline void bus_space_read_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - uint8_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - *bufp++ = ia64_ld1(bsp); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_multi_io_1(bsh + ofs, bufp, count); + else { + while (count-- > 0) + *bufp++ = ia64_ld1((void *)(bsh + ofs)); + } } static __inline void bus_space_read_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - uint16_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - *bufp++ = ia64_ld2(bsp); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_multi_io_2(bsh + ofs, bufp, count); + else { + while (count-- > 0) + *bufp++ = ia64_ld2((void *)(bsh + ofs)); + } } static __inline void bus_space_read_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - uint32_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - *bufp++ = ia64_ld4(bsp); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_multi_io_4(bsh + ofs, bufp, count); + else { + while (count-- > 0) + *bufp++ = ia64_ld4((void *)(bsh + ofs)); + } } static __inline void bus_space_read_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - uint64_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - *bufp++ = ia64_ld8(bsp); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_multi_io_8(bsh + ofs, bufp, count); + else { + while (count-- > 0) + *bufp++ = ia64_ld8((void *)(bsh + ofs)); + } } @@ -304,48 +373,61 @@ bus_space_read_multi_8(bus_space_tag_t b * ofs tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The * data is read from the buffer passed by reference. */ +void bus_space_write_multi_io_1(u_long, const uint8_t *, size_t); +void bus_space_write_multi_io_2(u_long, const uint16_t *, size_t); +void bus_space_write_multi_io_4(u_long, const uint32_t *, size_t); +void bus_space_write_multi_io_8(u_long, const uint64_t *, size_t); + static __inline void bus_space_write_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - uint8_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - ia64_st1(bsp, *bufp++); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_multi_io_1(bsh + ofs, bufp, count); + else { + while (count-- > 0) + ia64_st1((void *)(bsh + ofs), *bufp++); + } } static __inline void bus_space_write_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *bufp, size_t count) { - uint16_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - ia64_st2(bsp, *bufp++); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_multi_io_2(bsh + ofs, bufp, count); + else { + while (count-- > 0) + ia64_st2((void *)(bsh + ofs), *bufp++); + } } static __inline void bus_space_write_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *bufp, size_t count) { - uint32_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - ia64_st4(bsp, *bufp++); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_multi_io_4(bsh + ofs, bufp, count); + else { + while (count-- > 0) + ia64_st4((void *)(bsh + ofs), *bufp++); + } } static __inline void bus_space_write_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *bufp, size_t count) { - uint64_t *bsp; - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - while (count-- > 0) - ia64_st8(bsp, *bufp++); + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_write_multi_io_8(bsh + ofs, bufp, count); + else { + while (count-- > 0) + ia64_st8((void *)(bsh + ofs), *bufp++); + } } @@ -355,16 +437,22 @@ bus_space_write_multi_8(bus_space_tag_t * data is written to the buffer passed by reference and read from successive * bus space addresses. Access is unordered. */ +void bus_space_read_region_io_1(u_long, uint8_t *, size_t); +void bus_space_read_region_io_2(u_long, uint16_t *, size_t); +void bus_space_read_region_io_4(u_long, uint32_t *, size_t); +void bus_space_read_region_io_8(u_long, uint64_t *, size_t); + static __inline void bus_space_read_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - uint8_t *bsp; - while (count-- > 0) { - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - *bufp++ = ia64_ld1(bsp); - ofs += 1; + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_region_io_1(bsh + ofs, bufp, count); + else { + uint8_t *bsp = (void *)(bsh + ofs); + while (count-- > 0) + *bufp++ = ia64_ld1(bsp++); } } @@ -372,12 +460,13 @@ static __inline void bus_space_read_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - uint16_t *bsp; - while (count-- > 0) { - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - *bufp++ = ia64_ld2(bsp); - ofs += 2; + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_region_io_2(bsh + ofs, bufp, count); + else { + uint16_t *bsp = (void *)(bsh + ofs); + while (count-- > 0) + *bufp++ = ia64_ld2(bsp++); } } @@ -385,12 +474,13 @@ static __inline void bus_space_read_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - uint32_t *bsp; - while (count-- > 0) { - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - *bufp++ = ia64_ld4(bsp); - ofs += 4; + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_region_io_4(bsh + ofs, bufp, count); + else { + uint32_t *bsp = (void *)(bsh + ofs); + while (count-- > 0) + *bufp++ = ia64_ld4(bsp++); } } @@ -398,12 +488,13 @@ static __inline void bus_space_read_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - uint64_t *bsp; - while (count-- > 0) { - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - *bufp++ = ia64_ld8(bsp); - ofs += 8; + + if (__predict_false(bst == IA64_BUS_SPACE_IO)) + bus_space_read_region_io_8(bsh + ofs, bufp, count); + else { + uint64_t *bsp = (void *)(bsh + ofs); + while (count-- > 0) + *bufp++ = ia64_ld8(bsp++); } } @@ -414,16 +505,22 @@ bus_space_read_region_8(bus_space_tag_t * data is read from the buffer passed by reference and written to successive * bus space addresses. Access is unordered. */ +void bus_space_write_region_io_1(u_long, const uint8_t *, size_t); +void bus_space_write_region_io_2(u_long, const uint16_t *, size_t); +void bus_space_write_region_io_4(u_long, const uint32_t *, size_t); +void bus_space_write_region_io_8(u_long, const uint64_t *, size_t); + static __inline void bus_space_write_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - uint8_t *bsp; - while (count-- > 0) { - bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : - __MEMIO_ADDR(bsh + ofs); - ia64_st1(bsp, *bufp++); - ofs += 1; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 19:06:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48F86106568F; Wed, 30 Dec 2009 19:06:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 385DE8FC13; Wed, 30 Dec 2009 19:06:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUJ6HbL067910; Wed, 30 Dec 2009 19:06:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUJ6HTv067908; Wed, 30 Dec 2009 19:06:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912301906.nBUJ6HTv067908@svn.freebsd.org> From: John Baldwin Date: Wed, 30 Dec 2009 19:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201270 - head/lib/libc/stdtime X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 19:06:17 -0000 Author: jhb Date: Wed Dec 30 19:06:16 2009 New Revision: 201270 URL: http://svn.freebsd.org/changeset/base/201270 Log: Use _once() to initialize the pthread key for thread-local storage to hold the results of gmtime() instead of using a pthread mutex directly. MFC after: 1 week Modified: head/lib/libc/stdtime/localtime.c Modified: head/lib/libc/stdtime/localtime.c ============================================================================== --- head/lib/libc/stdtime/localtime.c Wed Dec 30 18:15:25 2009 (r201269) +++ head/lib/libc/stdtime/localtime.c Wed Dec 30 19:06:16 2009 (r201270) @@ -237,6 +237,9 @@ static char lcl_TZname[TZ_STRLEN_MAX + static int lcl_is_set; static pthread_once_t gmt_once = PTHREAD_ONCE_INIT; static pthread_rwlock_t lcl_rwlock = PTHREAD_RWLOCK_INITIALIZER; +static pthread_once_t gmtime_once = PTHREAD_ONCE_INIT; +static pthread_key_t gmtime_key; +static int gmtime_key_error; static pthread_once_t localtime_once = PTHREAD_ONCE_INIT; static pthread_key_t localtime_key; static int localtime_key_error; @@ -1510,27 +1513,24 @@ struct tm * const tmp; return result; } +static void +gmtime_key_init(void) +{ + + gmtime_key_error = _pthread_key_create(&gmtime_key, free); +} + struct tm * gmtime(timep) const time_t * const timep; { - static pthread_mutex_t gmtime_mutex = PTHREAD_MUTEX_INITIALIZER; - static pthread_key_t gmtime_key = -1; struct tm *p_tm; - int r; if (__isthreaded != 0) { - if (gmtime_key < 0) { - _pthread_mutex_lock(&gmtime_mutex); - if (gmtime_key < 0) { - if ((r = _pthread_key_create(&gmtime_key, - free)) != 0) { - _pthread_mutex_unlock(&gmtime_mutex); - errno = r; - return(NULL); - } - } - _pthread_mutex_unlock(&gmtime_mutex); + _once(&gmtime_once, gmtime_key_init); + if (gmtime_key_error != 0) { + errno = gmtime_key_error; + return(NULL); } /* * Changed to follow POSIX.1 threads standard, which From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 19:42:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1CF31065670; Wed, 30 Dec 2009 19:42:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0EA68FC1C; Wed, 30 Dec 2009 19:42:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUJgRdw068880; Wed, 30 Dec 2009 19:42:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUJgRq3068878; Wed, 30 Dec 2009 19:42:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912301942.nBUJgRq3068878@svn.freebsd.org> From: John Baldwin Date: Wed, 30 Dec 2009 19:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201275 - head/sys/dev/mpt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 19:42:27 -0000 Author: jhb Date: Wed Dec 30 19:42:27 2009 New Revision: 201275 URL: http://svn.freebsd.org/changeset/base/201275 Log: Use a constant instead of a magic number for the flag that enables decoding of a device ROM. Modified: head/sys/dev/mpt/mpt_pci.c Modified: head/sys/dev/mpt/mpt_pci.c ============================================================================== --- head/sys/dev/mpt/mpt_pci.c Wed Dec 30 19:38:57 2009 (r201274) +++ head/sys/dev/mpt/mpt_pci.c Wed Dec 30 19:42:27 2009 (r201275) @@ -485,7 +485,7 @@ mpt_pci_attach(device_t dev) * Make sure we've disabled the ROM. */ data = pci_read_config(dev, PCIR_BIOS, 4); - data &= ~1; + data &= ~PCIM_BIOS_ENABLE; pci_write_config(dev, PCIR_BIOS, data, 4); /* From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 19:44:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83CCA106568B; Wed, 30 Dec 2009 19:44:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7306A8FC27; Wed, 30 Dec 2009 19:44:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUJiV0h068967; Wed, 30 Dec 2009 19:44:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUJiVBZ068965; Wed, 30 Dec 2009 19:44:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912301944.nBUJiVBZ068965@svn.freebsd.org> From: John Baldwin Date: Wed, 30 Dec 2009 19:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201276 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 19:44:31 -0000 Author: jhb Date: Wed Dec 30 19:44:31 2009 New Revision: 201276 URL: http://svn.freebsd.org/changeset/base/201276 Log: - Assert that a reserved resource returned via resource_list_alloc() is not active. - Fix bus_generic_rl_(alloc|release)_resource() to not attempt to fetch a resource list for grandchild devices, but just pass those requests up to the parent directly. This worked by accident previously, but it is better to not let bus drivers try to operate on devices they do not manage. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Dec 30 19:42:27 2009 (r201275) +++ head/sys/kern/subr_bus.c Wed Dec 30 19:44:31 2009 (r201276) @@ -2898,8 +2898,11 @@ resource_list_busy(struct resource_list rle = resource_list_find(rl, type, rid); if (rle == NULL || rle->res == NULL) return (0); - if ((rle->flags & (RLE_RESERVED | RLE_ALLOCATED)) == RLE_RESERVED) + if ((rle->flags & (RLE_RESERVED | RLE_ALLOCATED)) == RLE_RESERVED) { + KASSERT(!(rman_get_flags(rle->res) & RF_ACTIVE), + ("reserved resource is active")); return (0); + } return (1); } @@ -3801,6 +3804,10 @@ bus_generic_rl_release_resource(device_t { struct resource_list * rl = NULL; + if (device_get_parent(child) != dev) + return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, + type, rid, r)); + rl = BUS_GET_RESOURCE_LIST(dev, child); if (!rl) return (EINVAL); @@ -3821,6 +3828,10 @@ bus_generic_rl_alloc_resource(device_t d { struct resource_list * rl = NULL; + if (device_get_parent(child) != dev) + return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, + type, rid, start, end, count, flags)); + rl = BUS_GET_RESOURCE_LIST(dev, child); if (!rl) return (NULL); From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 19:46:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C806106566C; Wed, 30 Dec 2009 19:46:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B9658FC15; Wed, 30 Dec 2009 19:46:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUJkAb3069053; Wed, 30 Dec 2009 19:46:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUJkAlx069050; Wed, 30 Dec 2009 19:46:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912301946.nBUJkAlx069050@svn.freebsd.org> From: John Baldwin Date: Wed, 30 Dec 2009 19:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201277 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 19:46:10 -0000 Author: jhb Date: Wed Dec 30 19:46:09 2009 New Revision: 201277 URL: http://svn.freebsd.org/changeset/base/201277 Log: Remove no longer used pci_release_resource(). Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_private.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Dec 30 19:44:31 2009 (r201276) +++ head/sys/dev/pci/pci.c Wed Dec 30 19:46:09 2009 (r201277) @@ -3700,25 +3700,6 @@ pci_alloc_resource(device_t dev, device_ } int -pci_release_resource(device_t dev, device_t child, int type, int rid, - struct resource *r) -{ - - if (device_get_parent(child) != dev) - return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, - type, rid, r)); - - /* - * For BARs we don't actually want to release the resource. - * Instead, we deactivate the resource if needed and then give - * ownership of the BAR back to the bus. This is handled for us - * in resource_list_release() since we use resource_list_reserve() - * for BARs. - */ - return (bus_generic_rl_release_resource(dev, child, type, rid, r)); -} - -int pci_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Wed Dec 30 19:44:31 2009 (r201276) +++ head/sys/dev/pci/pci_private.h Wed Dec 30 19:46:09 2009 (r201277) @@ -82,8 +82,6 @@ int pci_msix_count_method(device_t dev, struct resource *pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); -int pci_release_resource(device_t dev, device_t child, int type, - int rid, struct resource *r); int pci_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r); void pci_delete_resource(device_t dev, device_t child, From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 20:42:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 077BE1065672; Wed, 30 Dec 2009 20:42:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA4AA8FC21; Wed, 30 Dec 2009 20:42:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUKg7g7070275; Wed, 30 Dec 2009 20:42:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUKg72W070273; Wed, 30 Dec 2009 20:42:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912302042.nBUKg72W070273@svn.freebsd.org> From: John Baldwin Date: Wed, 30 Dec 2009 20:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201278 - head/sys/dev/cardbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 20:42:08 -0000 Author: jhb Date: Wed Dec 30 20:42:07 2009 New Revision: 201278 URL: http://svn.freebsd.org/changeset/base/201278 Log: Use bus_*() rather than bus_space_*(). Modified: head/sys/dev/cardbus/cardbus_cis.c Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 19:46:09 2009 (r201277) +++ head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 20:42:07 2009 (r201278) @@ -402,16 +402,11 @@ static int cardbus_read_tuple_mem(device_t cbdev, struct resource *res, uint32_t start, uint32_t *off, int *tupleid, int *len, uint8_t *tupledata) { - bus_space_tag_t bt; - bus_space_handle_t bh; int ret; - bt = rman_get_bustag(res); - bh = rman_get_bushandle(res); - - *tupleid = bus_space_read_1(bt, bh, start + *off); - *len = bus_space_read_1(bt, bh, start + *off + 1); - bus_space_read_region_1(bt, bh, *off + start + 2, tupledata, *len); + *tupleid = bus_read_1(res, start + *off); + *len = bus_read_1(res, start + *off + 1); + bus_read_region_1(res, *off + start + 2, tupledata, *len); ret = 0; *off += *len + 2; return (ret); @@ -488,8 +483,6 @@ cardbus_read_tuple_init(device_t cbdev, /* Flip to the right ROM image if CIS is in ROM */ if (space == PCIM_CIS_ASI_ROM) { - bus_space_tag_t bt; - bus_space_handle_t bh; uint32_t imagesize; uint32_t imagebase = 0; uint32_t pcidata; @@ -497,12 +490,9 @@ cardbus_read_tuple_init(device_t cbdev, int romnum = 0; int imagenum; - bt = rman_get_bustag(res); - bh = rman_get_bushandle(res); - imagenum = (*start & PCIM_CIS_ROM_MASK) >> 28; for (romnum = 0;; romnum++) { - romsig = bus_space_read_2(bt, bh, + romsig = bus_read_2(res, imagebase + CARDBUS_EXROM_SIGNATURE); if (romsig != 0xaa55) { device_printf(cbdev, "Bad header in rom %d: " @@ -522,9 +512,9 @@ cardbus_read_tuple_init(device_t cbdev, break; /* Find out where the next Option ROM image is */ - pcidata = imagebase + bus_space_read_2(bt, bh, + pcidata = imagebase + bus_read_2(res, imagebase + CARDBUS_EXROM_DATA_PTR); - imagesize = bus_space_read_2(bt, bh, + imagesize = bus_read_2(res, pcidata + CARDBUS_EXROM_DATA_IMAGE_LENGTH); if (imagesize == 0) { @@ -541,7 +531,7 @@ cardbus_read_tuple_init(device_t cbdev, /* Image size is in 512 byte units */ imagesize <<= 9; - if ((bus_space_read_1(bt, bh, pcidata + + if ((bus_read_1(res, pcidata + CARDBUS_EXROM_DATA_INDICATOR) & 0x80) != 0) { device_printf(cbdev, "Cannot find CIS in " "Option ROM\n"); From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 20:47:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74387106566B; Wed, 30 Dec 2009 20:47:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 626838FC0A; Wed, 30 Dec 2009 20:47:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUKlEVM070420; Wed, 30 Dec 2009 20:47:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUKlEF5070416; Wed, 30 Dec 2009 20:47:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912302047.nBUKlEF5070416@svn.freebsd.org> From: John Baldwin Date: Wed, 30 Dec 2009 20:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201279 - in head/sys/dev: cardbus pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 20:47:14 -0000 Author: jhb Date: Wed Dec 30 20:47:14 2009 New Revision: 201279 URL: http://svn.freebsd.org/changeset/base/201279 Log: Teach the PCI bus driver to handle PCIR_BIOS BARs properly and remove special handling for the PCIR_BIOS decoding enable bit from the cardbus driver. The PCIR_BIOS BAR does include type bits like other BARs. Instead, it is always a 32-bit non-prefetchable memory BAR where the low bit is used as a flag to enable decoding. Reviewed by: imp Modified: head/sys/dev/cardbus/cardbus_cis.c head/sys/dev/pci/pci.c head/sys/dev/pci/pci_private.h Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 20:42:07 2009 (r201278) +++ head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 20:47:14 2009 (r201279) @@ -430,9 +430,6 @@ cardbus_read_tuple_finish(device_t cbdev { if (res != CIS_CONFIG_SPACE) { bus_release_resource(child, SYS_RES_MEMORY, rid, res); - if (rid == PCIM_CIS_ASI_ROM) - pci_write_config(child, rid, pci_read_config(child, - rid, 4) & ~PCIR_BIOS, 4); } } @@ -477,9 +474,6 @@ cardbus_read_tuple_init(device_t cbdev, return (NULL); } DEVPRINTF((cbdev, "CIS Mapped to %#lx\n", rman_get_start(res))); - if (*rid == PCIR_BIOS) - pci_write_config(child, *rid, - rman_get_start(res) | PCIM_BIOS_ENABLE, 4); /* Flip to the right ROM image if CIS is in ROM */ if (space == PCIM_CIS_ASI_ROM) { Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Dec 30 20:42:07 2009 (r201278) +++ head/sys/dev/pci/pci.c Wed Dec 30 20:47:14 2009 (r201279) @@ -80,6 +80,8 @@ static pci_addr_t pci_mapbase(uint64_t m static const char *pci_maptype(uint64_t mapreg); static int pci_mapsize(uint64_t testval); static int pci_maprange(uint64_t mapreg); +static pci_addr_t pci_rombase(uint64_t mapreg); +static int pci_romsize(uint64_t testval); static void pci_fixancient(pcicfgregs *cfg); static int pci_printf(pcicfgregs *cfg, const char *fmt, ...); @@ -142,7 +144,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_alloc_resource, pci_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_activate_resource, pci_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), DEVMETHOD(bus_child_pnpinfo_str, pci_child_pnpinfo_str_method), DEVMETHOD(bus_child_location_str, pci_child_location_str_method), @@ -388,6 +390,34 @@ pci_mapsize(uint64_t testval) return (ln2size); } +/* return base address of device ROM */ + +static pci_addr_t +pci_rombase(uint64_t mapreg) +{ + + return (mapreg & PCIM_BIOS_ADDR_MASK); +} + +/* return log2 of map size decided for device ROM */ + +static int +pci_romsize(uint64_t testval) +{ + int ln2size; + + testval = pci_rombase(testval); + ln2size = 0; + if (testval != 0) { + while ((testval & 1) == 0) + { + ln2size++; + testval >>= 1; + } + } + return (ln2size); +} + /* return log2 of address range supported by map register */ static int @@ -2280,6 +2310,21 @@ pci_read_bar(device_t dev, int reg, pci_ int ln2range; uint16_t cmd; + /* + * The device ROM BAR is special. It is always a 32-bit + * memory BAR. Bit 0 is special and should not be set when + * sizing the BAR. + */ + if (reg == PCIR_BIOS) { + map = pci_read_config(dev, reg, 4); + pci_write_config(dev, reg, 0xfffffffe, 4); + testval = pci_read_config(dev, reg, 4); + pci_write_config(dev, reg, map, 4); + *mapp = map; + *testvalp = testval; + return; + } + map = pci_read_config(dev, reg, 4); ln2range = pci_maprange(map); if (ln2range == 64) @@ -2327,6 +2372,10 @@ pci_write_bar(device_t dev, int reg, pci int ln2range; map = pci_read_config(dev, reg, 4); + + /* The device ROM BAR is always 32-bits. */ + if (reg == PCIR_BIOS) + return; ln2range = pci_maprange(map); pci_write_config(dev, reg, base, 4); if (ln2range == 64) @@ -3579,10 +3628,11 @@ pci_reserve_map(device_t dev, device_t c pci_read_bar(child, *rid, &map, &testval); /* Ignore a BAR with a base of 0. */ - if (pci_mapbase(testval) == 0) + if ((*rid == PCIR_BIOS && pci_rombase(testval) == 0) || + pci_mapbase(testval) == 0) goto out; - if (PCI_BAR_MEM(testval)) { + if (PCI_BAR_MEM(testval) || *rid == PCIR_BIOS) { if (type != SYS_RES_MEMORY) { if (bootverbose) device_printf(dev, @@ -3608,8 +3658,13 @@ pci_reserve_map(device_t dev, device_t c * actually uses and we would otherwise have a * situation where we might allocate the excess to * another driver, which won't work. + * + * Device ROM BARs use a different mask value. */ - mapsize = pci_mapsize(testval); + if (*rid == PCIR_BIOS) + mapsize = pci_romsize(testval); + else + mapsize = pci_mapsize(testval); count = 1UL << mapsize; if (RF_ALIGNMENT(flags) < mapsize) flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize); @@ -3711,6 +3766,10 @@ pci_activate_resource(device_t dev, devi /* Enable decoding in the command register when activating BARs. */ if (device_get_parent(child) == dev) { + /* Device ROMs need their decoding explicitly enabled. */ + if (rid == PCIR_BIOS) + pci_write_config(child, rid, rman_get_start(r) | + PCIM_BIOS_ENABLE, 4); switch (type) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: @@ -3721,6 +3780,22 @@ pci_activate_resource(device_t dev, devi return (error); } +int +pci_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r) +{ + int error; + + error = bus_generic_deactivate_resource(dev, child, type, rid, r); + if (error) + return (error); + + /* Disable decoding for device ROMs. */ + if (rid == PCIR_BIOS) + pci_write_config(child, rid, rman_get_start(r), 4); + return (0); +} + void pci_delete_resource(device_t dev, device_t child, int type, int rid) { Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Wed Dec 30 20:42:07 2009 (r201278) +++ head/sys/dev/pci/pci_private.h Wed Dec 30 20:47:14 2009 (r201279) @@ -84,6 +84,8 @@ struct resource *pci_alloc_resource(devi u_int flags); int pci_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r); +int pci_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r); void pci_delete_resource(device_t dev, device_t child, int type, int rid); struct resource_list *pci_get_resource_list (device_t dev, device_t child); From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 20:49:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AF7C10656A5; Wed, 30 Dec 2009 20:49:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59BA28FC16; Wed, 30 Dec 2009 20:49:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUKnDHw070492; Wed, 30 Dec 2009 20:49:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUKnDIx070490; Wed, 30 Dec 2009 20:49:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912302049.nBUKnDIx070490@svn.freebsd.org> From: John Baldwin Date: Wed, 30 Dec 2009 20:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201280 - head/sys/dev/cardbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 20:49:13 -0000 Author: jhb Date: Wed Dec 30 20:49:13 2009 New Revision: 201280 URL: http://svn.freebsd.org/changeset/base/201280 Log: Delete the CIS resource after releasing it. This is needed when the CIS is stored in a BAR since the CIS BAR is mapped before the PCI bus driver enumerates all the BARs. Without this change, the PCI bus driver would attempt to initialize a BAR that was already allocated resulting in a panic. Modified: head/sys/dev/cardbus/cardbus_cis.c Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 20:47:14 2009 (r201279) +++ head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 20:49:13 2009 (r201280) @@ -430,6 +430,7 @@ cardbus_read_tuple_finish(device_t cbdev { if (res != CIS_CONFIG_SPACE) { bus_release_resource(child, SYS_RES_MEMORY, rid, res); + bus_delete_resource(child, SYS_RES_MEMORY, rid); } } @@ -492,8 +493,8 @@ cardbus_read_tuple_init(device_t cbdev, device_printf(cbdev, "Bad header in rom %d: " "[%x] %04x\n", romnum, imagebase + CARDBUS_EXROM_SIGNATURE, romsig); - bus_release_resource(child, SYS_RES_MEMORY, - *rid, res); + cardbus_read_tuple_finish(cbdev, child, *rid, + res); *rid = 0; return (NULL); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 21:35:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309B31065692; Wed, 30 Dec 2009 21:35:35 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19B4A8FC12; Wed, 30 Dec 2009 21:35:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBULZZSL072268; Wed, 30 Dec 2009 21:35:35 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBULZYnT072258; Wed, 30 Dec 2009 21:35:34 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200912302135.nBULZYnT072258@svn.freebsd.org> From: Qing Li Date: Wed, 30 Dec 2009 21:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201282 - in head: sys/net sys/netinet sys/netinet6 usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 21:35:35 -0000 Author: qingli Date: Wed Dec 30 21:35:34 2009 New Revision: 201282 URL: http://svn.freebsd.org/changeset/base/201282 Log: The proxy arp entries could not be added into the system over the IFF_POINTOPOINT link types. The reason was due to the routing entry returned from the kernel covering the remote end is of an interface type that does not support ARP. This patch fixes this problem by providing a hint to the kernel routing code, which indicates the prefix route instead of the PPP host route should be returned to the caller. Since a host route to the local end point is also added into the routing table, and there could be multiple such instantiations due to multiple PPP links can be created with the same local end IP address, this patch also fixes the loopback route installation failure problem observed prior to this patch. The reference count of loopback route to local end would be either incremented or decremented. The first instantiation would create the entry and the last removal would delete the route entry. MFC after: 5 days Modified: head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h head/sys/net/if_var.h head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c head/sys/netinet/in.c head/sys/netinet6/in6.c head/usr.sbin/arp/arp.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Wed Dec 30 21:00:54 2009 (r201281) +++ head/sys/net/if_llatbl.c Wed Dec 30 21:35:34 2009 (r201282) @@ -274,7 +274,9 @@ lla_rt_output(struct rt_msghdr *rtm, str #ifdef INET if (dst->sa_family == AF_INET && ((struct sockaddr_inarp *)dst)->sin_other != 0) { - struct rtentry *rt = rtalloc1(dst, 0, 0); + struct rtentry *rt; + ((struct sockaddr_inarp *)dst)->sin_other = 0; + rt = rtalloc1(dst, 0, 0); if (rt == NULL || !(rt->rt_flags & RTF_HOST)) { log(LOG_INFO, "%s: RTM_ADD publish " "(proxy only) is invalid\n", Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Wed Dec 30 21:00:54 2009 (r201281) +++ head/sys/net/if_llatbl.h Wed Dec 30 21:35:34 2009 (r201282) @@ -159,7 +159,7 @@ struct lltable { const struct sockaddr *mask); struct llentry * (*llt_lookup)(struct lltable *, u_int flags, const struct sockaddr *l3addr); - int (*llt_rtcheck)(struct ifnet *, + int (*llt_rtcheck)(struct ifnet *, u_int flags, const struct sockaddr *); int (*llt_dump)(struct lltable *, struct sysctl_req *); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed Dec 30 21:00:54 2009 (r201281) +++ head/sys/net/if_var.h Wed Dec 30 21:35:34 2009 (r201282) @@ -710,6 +710,7 @@ struct ifaddr { struct mtx ifa_mtx; }; #define IFA_ROUTE RTF_UP /* route installed */ +#define IFA_RTSELF RTF_HOST /* loopback route to self installed */ /* for compatibility with other BSDs */ #define ifa_list ifa_link @@ -843,6 +844,7 @@ void if_ref(struct ifnet *); void if_rele(struct ifnet *); int if_setlladdr(struct ifnet *, const u_char *, int); void if_up(struct ifnet *); +/*void ifinit(void);*/ /* declared in systm.h for main() */ int ifioctl(struct socket *, u_long, caddr_t, struct thread *); int ifpromisc(struct ifnet *, int); struct ifnet *ifunit(const char *); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Wed Dec 30 21:00:54 2009 (r201281) +++ head/sys/net/route.c Wed Dec 30 21:35:34 2009 (r201282) @@ -98,8 +98,6 @@ VNET_DEFINE(struct rtstat, rtstat); #define V_rttrash VNET(rttrash) #define V_rtstat VNET(rtstat) -static void rt_maskedcopy(struct sockaddr *, - struct sockaddr *, struct sockaddr *); /* compare two sockaddr structures */ #define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) @@ -1322,7 +1320,7 @@ rt_setgate(struct rtentry *rt, struct so return (0); } -static void +void rt_maskedcopy(struct sockaddr *src, struct sockaddr *dst, struct sockaddr *netmask) { register u_char *cp1 = (u_char *)src; Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Wed Dec 30 21:00:54 2009 (r201281) +++ head/sys/net/route.h Wed Dec 30 21:35:34 2009 (r201282) @@ -384,6 +384,7 @@ void rt_missmsg(int, struct rt_addrinfo void rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *); void rt_newmaddrmsg(int, struct ifmultiaddr *); int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *); +void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); /* * Note the following locking behavior: Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Wed Dec 30 21:00:54 2009 (r201281) +++ head/sys/net/rtsock.c Wed Dec 30 21:35:34 2009 (r201282) @@ -60,6 +60,7 @@ #include #include +#include #ifdef INET6 #include #endif @@ -622,6 +623,27 @@ route_output(struct mbuf *m, struct sock } } #endif + /* + * If performing proxied L2 entry insertion, and + * the actual PPP host entry is found, perform + * another search to retrieve the prefix route of + * the local end point of the PPP link. + */ + if ((rtm->rtm_flags & RTF_ANNOUNCE) && + (rt->rt_ifp->if_flags & IFF_POINTOPOINT)) { + struct sockaddr laddr; + rt_maskedcopy(rt->rt_ifa->ifa_addr, + &laddr, + rt->rt_ifa->ifa_netmask); + /* + * refactor rt and no lock operation necessary + */ + rt = (struct rtentry *)rnh->rnh_matchaddr(&laddr, rnh); + if (rt == NULL) { + RADIX_NODE_HEAD_RUNLOCK(rnh); + senderr(ESRCH); + } + } RT_LOCK(rt); RT_ADDREF(rt); RADIX_NODE_HEAD_RUNLOCK(rnh); Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Dec 30 21:00:54 2009 (r201281) +++ head/sys/netinet/in.c Wed Dec 30 21:35:34 2009 (r201282) @@ -924,9 +924,25 @@ in_ifinit(struct ifnet *ifp, struct in_i /* * add a loopback route to self */ - if (V_useloopback && !(ifp->if_flags & IFF_LOOPBACK)) - error = ifa_add_loopback_route((struct ifaddr *)ia, + if (V_useloopback && !(ifp->if_flags & IFF_LOOPBACK)) { + struct route ia_ro; + + bzero(&ia_ro, sizeof(ia_ro)); + *((struct sockaddr_in *)(&ia_ro.ro_dst)) = ia->ia_addr; + rtalloc_ign_fib(&ia_ro, 0, 0); + if ((ia_ro.ro_rt != NULL) && (ia_ro.ro_rt->rt_ifp != NULL) && + (ia_ro.ro_rt->rt_ifp == V_loif)) { + RT_LOCK(ia_ro.ro_rt); + RT_ADDREF(ia_ro.ro_rt); + RTFREE_LOCKED(ia_ro.ro_rt); + } else + error = ifa_add_loopback_route((struct ifaddr *)ia, (struct sockaddr *)&ia->ia_addr); + if (error == 0) + ia->ia_flags |= IFA_RTSELF; + if (ia_ro.ro_rt != NULL) + RTFREE(ia_ro.ro_rt); + } return (error); } @@ -1043,7 +1059,7 @@ in_scrubprefix(struct in_ifaddr *target) { struct in_ifaddr *ia; struct in_addr prefix, mask, p; - int error; + int error = 0; struct sockaddr_in prefix0, mask0; /* @@ -1057,9 +1073,28 @@ in_scrubprefix(struct in_ifaddr *target) * deletion is unconditional. */ if ((target->ia_addr.sin_addr.s_addr != INADDR_ANY) && - !(target->ia_ifp->if_flags & IFF_LOOPBACK)) { - error = ifa_del_loopback_route((struct ifaddr *)target, + !(target->ia_ifp->if_flags & IFF_LOOPBACK) && + (target->ia_flags & IFA_RTSELF)) { + struct route ia_ro; + int freeit = 0; + + bzero(&ia_ro, sizeof(ia_ro)); + *((struct sockaddr_in *)(&ia_ro.ro_dst)) = target->ia_addr; + rtalloc_ign_fib(&ia_ro, 0, 0); + if ((ia_ro.ro_rt != NULL) && (ia_ro.ro_rt->rt_ifp != NULL) && + (ia_ro.ro_rt->rt_ifp == V_loif)) { + RT_LOCK(ia_ro.ro_rt); + if (ia_ro.ro_rt->rt_refcnt <= 1) + freeit = 1; + else + RT_REMREF(ia_ro.ro_rt); + RTFREE_LOCKED(ia_ro.ro_rt); + } + if (freeit) + error = ifa_del_loopback_route((struct ifaddr *)target, (struct sockaddr *)&target->ia_addr); + if (error == 0) + target->ia_flags &= ~IFA_RTSELF; /* remove arp cache */ arp_ifscrub(target->ia_ifp, IA_SIN(target)->sin_addr.s_addr); } @@ -1317,7 +1352,7 @@ in_lltable_prefix_free(struct lltable *l static int -in_lltable_rtcheck(struct ifnet *ifp, const struct sockaddr *l3addr) +in_lltable_rtcheck(struct ifnet *ifp, u_int flags, const struct sockaddr *l3addr) { struct rtentry *rt; @@ -1326,7 +1361,8 @@ in_lltable_rtcheck(struct ifnet *ifp, co /* XXX rtalloc1 should take a const param */ rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0); - if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || rt->rt_ifp != ifp) { + if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || + ((rt->rt_ifp != ifp) && !(flags & LLE_PUB))) { #ifdef DIAGNOSTIC log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n", inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); @@ -1378,7 +1414,7 @@ in_lltable_lookup(struct lltable *llt, u * verify this. */ if (!(flags & LLE_IFADDR) && - in_lltable_rtcheck(ifp, l3addr) != 0) + in_lltable_rtcheck(ifp, flags, l3addr) != 0) goto done; lle = in_lltable_new(l3addr, flags); Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Dec 30 21:00:54 2009 (r201281) +++ head/sys/netinet6/in6.c Wed Dec 30 21:35:34 2009 (r201282) @@ -1200,8 +1200,12 @@ in6_purgeaddr(struct ifaddr *ifa) * The check for the current setting of "nd6_useloopback" * is not needed. */ - error = ifa_del_loopback_route((struct ifaddr *)ia, - (struct sockaddr *)&ia->ia_addr); + if (ia->ia_flags & IFA_RTSELF) { + error = ifa_del_loopback_route((struct ifaddr *)ia, + (struct sockaddr *)&ia->ia_addr); + if (error == 0) + ia->ia_flags &= ~IFA_RTSELF; + } /* stop DAD processing */ nd6_dad_stop(ifa); @@ -1762,6 +1766,8 @@ in6_ifinit(struct ifnet *ifp, struct in6 || (ifp->if_flags & IFF_LOOPBACK))) { error = ifa_add_loopback_route((struct ifaddr *)ia, (struct sockaddr *)&ia->ia_addr); + if (error == 0) + ia->ia_flags |= IFA_RTSELF; } /* Add ownaddr as loopback rtentry, if necessary (ex. on p2p link). */ @@ -2347,7 +2353,9 @@ in6_lltable_prefix_free(struct lltable * } static int -in6_lltable_rtcheck(struct ifnet *ifp, const struct sockaddr *l3addr) +in6_lltable_rtcheck(struct ifnet *ifp, + u_int flags, + const struct sockaddr *l3addr) { struct rtentry *rt; char ip6buf[INET6_ADDRSTRLEN]; @@ -2415,7 +2423,7 @@ in6_lltable_lookup(struct lltable *llt, * verify this. */ if (!(flags & LLE_IFADDR) && - in6_lltable_rtcheck(ifp, l3addr) != 0) + in6_lltable_rtcheck(ifp, flags, l3addr) != 0) return NULL; lle = in6_lltable_new(l3addr, flags); Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Wed Dec 30 21:00:54 2009 (r201281) +++ head/usr.sbin/arp/arp.c Wed Dec 30 21:35:34 2009 (r201282) @@ -326,7 +326,6 @@ set(int argc, char **argv) doing_proxy = 1; if (argc && strncmp(argv[1], "only", 3) == 0) { proxy_only = 1; - dst->sin_other = SIN_PROXY; argc--; argv++; } } else if (strncmp(argv[0], "blackhole", 9) == 0) { @@ -365,33 +364,30 @@ set(int argc, char **argv) sdl_m.sdl_alen = ETHER_ADDR_LEN; } } - for (;;) { /* try at most twice */ - rtm = rtmsg(RTM_GET, dst, &sdl_m); - if (rtm == NULL) { - warn("%s", host); - return (1); - } - addr = (struct sockaddr_inarp *)(rtm + 1); - sdl = (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)addr); - if (addr->sin_addr.s_addr != dst->sin_addr.s_addr) - break; - if (sdl->sdl_family == AF_LINK && - !(rtm->rtm_flags & RTF_GATEWAY) && - valid_type(sdl->sdl_type) ) - break; - if (doing_proxy == 0) { - printf("set: can only proxy for %s\n", host); - return (1); - } - if (dst->sin_other & SIN_PROXY) { - printf("set: proxy entry exists for non 802 device\n"); - return (1); - } - dst->sin_other = SIN_PROXY; - proxy_only = 1; + + /* + * In the case a proxy-arp entry is being added for + * a remote end point, the RTF_ANNOUNCE flag in the + * RTM_GET command is an indication to the kernel + * routing code that the interface associated with + * the prefix route covering the local end of the + * PPP link should be returned, on which ARP applies. + */ + rtm = rtmsg(RTM_GET, dst, &sdl_m); + if (rtm == NULL) { + warn("%s", host); + return (1); + } + addr = (struct sockaddr_inarp *)(rtm + 1); + sdl = (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)addr); + if (addr->sin_addr.s_addr == dst->sin_addr.s_addr) { + printf("set: proxy entry exists for non 802 device\n"); + return (1); } - if (sdl->sdl_family != AF_LINK) { + if ((sdl->sdl_family != AF_LINK) || + (rtm->rtm_flags & RTF_GATEWAY) || + !valid_type(sdl->sdl_type)) { printf("cannot intuit interface index and type for %s\n", host); return (1); } @@ -436,7 +432,11 @@ delete(char *host, int do_proxy) dst = getaddr(host); if (dst == NULL) return (1); - dst->sin_other = do_proxy; + + /* + * Perform a regular entry delete first. + */ + flags &= ~RTF_ANNOUNCE; /* * setup the data structure to notify the kernel @@ -471,11 +471,16 @@ delete(char *host, int do_proxy) break; } - if (dst->sin_other & SIN_PROXY) { + /* + * Regualar entry delete failed, now check if there + * is a proxy-arp entry to remove. + */ + if (flags & RTF_ANNOUNCE) { fprintf(stderr, "delete: cannot locate %s\n",host); return (1); } - dst->sin_other = SIN_PROXY; + + flags |= RTF_ANNOUNCE; } rtm->rtm_flags |= RTF_LLDATA; if (rtmsg(RTM_DELETE, dst, NULL) != NULL) { @@ -485,6 +490,7 @@ delete(char *host, int do_proxy) return (1); } + /* * Search the arp table and do some action on matching entries */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 21:46:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2EB71065676; Wed, 30 Dec 2009 21:46:33 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90B8A8FC18; Wed, 30 Dec 2009 21:46:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBULkXZF072545; Wed, 30 Dec 2009 21:46:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBULkXnq072543; Wed, 30 Dec 2009 21:46:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912302146.nBULkXnq072543@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 30 Dec 2009 21:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201283 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 21:46:33 -0000 Author: jilles Date: Wed Dec 30 21:46:33 2009 New Revision: 201283 URL: http://svn.freebsd.org/changeset/base/201283 Log: sh: Ensure funcnest is decremented if there was an error in the function. This will be important when things like 'command eval f' will be possible. Currently, the funcnest = 0 assignment in RESET (called when returning to the top level after an error in interactive mode) is really sufficient. Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Wed Dec 30 21:35:34 2009 (r201282) +++ head/bin/sh/eval.c Wed Dec 30 21:46:33 2009 (r201283) @@ -792,20 +792,20 @@ evalcommand(union node *cmd, int flags, unreffunc(cmdentry.u.func); poplocalvars(); localvars = savelocalvars; + funcnest--; handler = savehandler; longjmp(handler->loc, 1); } handler = &jmploc; + funcnest++; INTON; for (sp = varlist.list ; sp ; sp = sp->next) mklocal(sp->text); - funcnest++; exitstatus = oexitstatus; if (flags & EV_TESTED) evaltree(getfuncnode(cmdentry.u.func), EV_TESTED); else evaltree(getfuncnode(cmdentry.u.func), 0); - funcnest--; INTOFF; unreffunc(cmdentry.u.func); poplocalvars(); @@ -813,6 +813,7 @@ evalcommand(union node *cmd, int flags, freeparam(&shellparam); shellparam = saveparam; handler = savehandler; + funcnest--; popredir(); INTON; if (evalskip == SKIPFUNC) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 21:51:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7525B106566B; Wed, 30 Dec 2009 21:51:23 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A2508FC18; Wed, 30 Dec 2009 21:51:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBULpN9d072943; Wed, 30 Dec 2009 21:51:23 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBULpNQN072941; Wed, 30 Dec 2009 21:51:23 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200912302151.nBULpNQN072941@svn.freebsd.org> From: Qing Li Date: Wed, 30 Dec 2009 21:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201284 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 21:51:23 -0000 Author: qingli Date: Wed Dec 30 21:51:23 2009 New Revision: 201284 URL: http://svn.freebsd.org/changeset/base/201284 Log: Multiple IPv6 addresses of the same prefix can be installed on the same interface. The first address will install the prefix route into the kernel routing table and that prefix will be marked as on-link. Without RADIX_MPATH enabled, the other address aliases of the same prefix will update the prefix reference count but no other routes will be installed. Consequently the prefixes associated with these addresses would not be marked as on-link. As such, incoming packets destined to these address aliases will fail the ND6 on-link check on input. This patch fixes the above problem by searching the kernel routing table and try to find an on-link prefix on the given interface. MFC after: 5 days Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Wed Dec 30 21:46:33 2009 (r201283) +++ head/sys/netinet6/nd6.c Wed Dec 30 21:51:23 2009 (r201284) @@ -935,8 +935,28 @@ nd6_is_new_addr_neighbor(struct sockaddr if (pr->ndpr_ifp != ifp) continue; - if (!(pr->ndpr_stateflags & NDPRF_ONLINK)) - continue; + if (!(pr->ndpr_stateflags & NDPRF_ONLINK)) { + struct rtentry *rt; + rt = rtalloc1((struct sockaddr *)&pr->ndpr_prefix, 0, 0); + if (rt == NULL) + continue; + /* + * This is the case where multiple interfaces + * have the same prefix, but only one is installed + * into the routing table and that prefix entry + * is not the one being examined here. In the case + * where RADIX_MPATH is enabled, multiple route + * entries (of the same rt_key value) will be + * installed because the interface addresses all + * differ. + */ + if (!IN6_ARE_ADDR_EQUAL(&pr->ndpr_prefix.sin6_addr, + &((struct sockaddr_in6 *)rt_key(rt))->sin6_addr)) { + RTFREE_LOCKED(rt); + continue; + } + RTFREE_LOCKED(rt); + } if (IN6_ARE_MASKED_ADDR_EQUAL(&pr->ndpr_prefix.sin6_addr, &addr->sin6_addr, &pr->ndpr_mask)) From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 22:13:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E97C9106566B; Wed, 30 Dec 2009 22:13:01 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D71D28FC12; Wed, 30 Dec 2009 22:13:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUMD1pP073810; Wed, 30 Dec 2009 22:13:01 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUMD1PA073808; Wed, 30 Dec 2009 22:13:01 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200912302213.nBUMD1PA073808@svn.freebsd.org> From: Qing Li Date: Wed, 30 Dec 2009 22:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201285 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 22:13:02 -0000 Author: qingli Date: Wed Dec 30 22:13:01 2009 New Revision: 201285 URL: http://svn.freebsd.org/changeset/base/201285 Log: Consolidate the route message generation code for when address aliases were added or deleted. The announced route entry for an address alias is no longer empty because this empty route entry was causing some route daemon to fail and exit abnormally. MFC after: 5 days Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Dec 30 21:51:23 2009 (r201284) +++ head/sys/netinet/in.c Wed Dec 30 22:13:01 2009 (r201285) @@ -950,6 +950,49 @@ in_ifinit(struct ifnet *ifp, struct in_i #define rtinitflags(x) \ ((((x)->ia_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) != 0) \ ? RTF_HOST : 0) + +/* + * Generate a routing message when inserting or deleting + * an interface address alias. + */ +static void in_addralias_rtmsg(int cmd, struct in_addr *prefix, + struct in_ifaddr *target) +{ + struct route pfx_ro; + struct sockaddr_in *pfx_addr; + struct rtentry msg_rt; + + /* QL: XXX + * This is a bit questionable because there is no + * additional route entry added/deleted for an address + * alias. Therefore this route report is inaccurate. + */ + bzero(&pfx_ro, sizeof(pfx_ro)); + pfx_addr = (struct sockaddr_in *)(&pfx_ro.ro_dst); + pfx_addr->sin_len = sizeof(*pfx_addr); + pfx_addr->sin_family = AF_INET; + pfx_addr->sin_addr = *prefix; + rtalloc_ign_fib(&pfx_ro, 0, 0); + if (pfx_ro.ro_rt != NULL) { + msg_rt = *pfx_ro.ro_rt; + + /* QL: XXX + * Point the gateway to the new interface + * address as if a new prefix route entry has + * been added through the new address alias. + * All other parts of the rtentry is accurate, + * e.g., rt_key, rt_mask, rt_ifp etc. + */ + msg_rt.rt_gateway = + (struct sockaddr *)&target->ia_addr; + rt_newaddrmsg(cmd, + (struct ifaddr *)target, + 0, &msg_rt); + RTFREE(pfx_ro.ro_rt); + } + return; +} + /* * Check if we have a route for the given prefix already or add one accordingly. */ @@ -997,40 +1040,7 @@ in_addprefix(struct in_ifaddr *target, i IN_IFADDR_RUNLOCK(); return (EEXIST); } else { - struct route pfx_ro; - struct sockaddr_in *pfx_addr; - struct rtentry msg_rt; - - /* QL: XXX - * This is a bit questionable because there is no - * additional route entry added for an address alias. - * Therefore this route report is inaccurate. Perhaps - * it's better to supply a empty rtentry as how it - * is done in in_scrubprefix(). - */ - bzero(&pfx_ro, sizeof(pfx_ro)); - pfx_addr = (struct sockaddr_in *)(&pfx_ro.ro_dst); - pfx_addr->sin_len = sizeof(*pfx_addr); - pfx_addr->sin_family = AF_INET; - pfx_addr->sin_addr = prefix; - rtalloc_ign_fib(&pfx_ro, 0, 0); - if (pfx_ro.ro_rt != NULL) { - msg_rt = *pfx_ro.ro_rt; - /* QL: XXX - * Point the gateway to the given interface - * address as if a new prefix route entry has - * been added through the new address alias. - * All other parts of the rtentry is accurate, - * e.g., rt_key, rt_mask, rt_ifp etc. - */ - msg_rt.rt_gateway = - (struct sockaddr *)&ia->ia_addr; - rt_newaddrmsg(RTM_ADD, - (struct ifaddr *)target, - 0, &msg_rt); - RTFREE(pfx_ro.ro_rt); - } - + in_addralias_rtmsg(RTM_ADD, &prefix, target); IN_IFADDR_RUNLOCK(); return (0); } @@ -1099,20 +1109,6 @@ in_scrubprefix(struct in_ifaddr *target) arp_ifscrub(target->ia_ifp, IA_SIN(target)->sin_addr.s_addr); } - if ((target->ia_flags & IFA_ROUTE) == 0) { - struct rtentry rt; - - /* QL: XXX - * Report a blank rtentry when a route has not been - * installed for the given interface address. - */ - bzero(&rt, sizeof(rt)); - rt_newaddrmsg(RTM_DELETE, - (struct ifaddr *)target, - 0, &rt); - return (0); - } - if (rtinitflags(target)) prefix = target->ia_dstaddr.sin_addr; else { @@ -1121,6 +1117,11 @@ in_scrubprefix(struct in_ifaddr *target) prefix.s_addr &= mask.s_addr; } + if ((target->ia_flags & IFA_ROUTE) == 0) { + in_addralias_rtmsg(RTM_DELETE, &prefix, target); + return (0); + } + IN_IFADDR_RLOCK(); TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if (rtinitflags(ia)) From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 22:34:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 351EA106566B; Wed, 30 Dec 2009 22:34:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 235F48FC15; Wed, 30 Dec 2009 22:34:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUMYRoR074454; Wed, 30 Dec 2009 22:34:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUMYRHf074452; Wed, 30 Dec 2009 22:34:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912302234.nBUMYRHf074452@svn.freebsd.org> From: John Baldwin Date: Wed, 30 Dec 2009 22:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201286 - head/sys/dev/cardbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 22:34:27 -0000 Author: jhb Date: Wed Dec 30 22:34:26 2009 New Revision: 201286 URL: http://svn.freebsd.org/changeset/base/201286 Log: Fix an error case I missed in the previous change so that the CIS resource is fully cleaned up if we fail to find the CIS in the devices ROM. Modified: head/sys/dev/cardbus/cardbus_cis.c Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 22:13:01 2009 (r201285) +++ head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 22:34:26 2009 (r201286) @@ -530,8 +530,8 @@ cardbus_read_tuple_init(device_t cbdev, CARDBUS_EXROM_DATA_INDICATOR) & 0x80) != 0) { device_printf(cbdev, "Cannot find CIS in " "Option ROM\n"); - bus_release_resource(child, SYS_RES_MEMORY, - *rid, res); + cardbus_read_tuple_finish(cbdev, child, *rid, + res); *rid = 0; return (NULL); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 22:37:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AA9C106568B; Wed, 30 Dec 2009 22:37:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 590A18FC17; Wed, 30 Dec 2009 22:37:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUMbSjU074749; Wed, 30 Dec 2009 22:37:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUMbSvc074747; Wed, 30 Dec 2009 22:37:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912302237.nBUMbSvc074747@svn.freebsd.org> From: John Baldwin Date: Wed, 30 Dec 2009 22:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201287 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 22:37:28 -0000 Author: jhb Date: Wed Dec 30 22:37:28 2009 New Revision: 201287 URL: http://svn.freebsd.org/changeset/base/201287 Log: Actually set RLE_ALLOCATED when allocating a reserved resource so that resource_list_release() will later release the resource instead of failing. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Dec 30 22:34:26 2009 (r201286) +++ head/sys/kern/subr_bus.c Wed Dec 30 22:37:28 2009 (r201287) @@ -3063,12 +3063,12 @@ resource_list_alloc(struct resource_list if (rle->flags & RLE_RESERVED) { if (rle->flags & RLE_ALLOCATED) return (NULL); - else if ((flags & RF_ACTIVE) && + if ((flags & RF_ACTIVE) && bus_activate_resource(child, type, *rid, rle->res) != 0) return (NULL); - else - return (rle->res); + rle->flags |= RLE_ALLOCATED; + return (rle->res); } panic("resource_list_alloc: resource entry is busy"); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 22:46:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 477C61065696; Wed, 30 Dec 2009 22:46:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35D138FC1A; Wed, 30 Dec 2009 22:46:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUMk9xw075017; Wed, 30 Dec 2009 22:46:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUMk9Ta075013; Wed, 30 Dec 2009 22:46:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912302246.nBUMk9Ta075013@svn.freebsd.org> From: Ed Schouten Date: Wed, 30 Dec 2009 22:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201289 - in head/usr.bin: lex yacc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 22:46:09 -0000 Author: ed Date: Wed Dec 30 22:46:08 2009 New Revision: 201289 URL: http://svn.freebsd.org/changeset/base/201289 Log: Let both yacc and lex generate code that passes -Wold-style-definition. Both these tools emit code where several functions have no `void' keyword placed in the arugment list when the function has no arguments. Modified: head/usr.bin/lex/flex.skl head/usr.bin/lex/initscan.c head/usr.bin/yacc/skeleton.c Modified: head/usr.bin/lex/flex.skl ============================================================================== --- head/usr.bin/lex/flex.skl Wed Dec 30 22:40:30 2009 (r201288) +++ head/usr.bin/lex/flex.skl Wed Dec 30 22:46:08 2009 (r201289) @@ -747,7 +747,7 @@ void yyFlexLexer::LexerOutput( const cha */ %- -static int yy_get_next_buffer() +static int yy_get_next_buffer(void) %+ int yyFlexLexer::yy_get_next_buffer() %* @@ -883,7 +883,7 @@ int yyFlexLexer::yy_get_next_buffer() /* yy_get_previous_state - get the state just before the EOB char was reached */ %- -static yy_state_type yy_get_previous_state() +static yy_state_type yy_get_previous_state(void) %+ yy_state_type yyFlexLexer::yy_get_previous_state() %* @@ -982,7 +982,7 @@ void yyFlexLexer::yyunput( int c, char* #ifdef __cplusplus static int yyinput() #else -static int input() +static int input(void) #endif %+ int yyFlexLexer::yyinput() Modified: head/usr.bin/lex/initscan.c ============================================================================== --- head/usr.bin/lex/initscan.c Wed Dec 30 22:40:30 2009 (r201288) +++ head/usr.bin/lex/initscan.c Wed Dec 30 22:46:08 2009 (r201289) @@ -2894,7 +2894,7 @@ case YY_STATE_EOF(LINEDIR): * EOB_ACT_END_OF_FILE - end of file */ -static int yy_get_next_buffer() +static int yy_get_next_buffer(void) { char *dest = yy_current_buffer->yy_ch_buf; char *source = yytext_ptr; @@ -3026,7 +3026,7 @@ static int yy_get_next_buffer() /* yy_get_previous_state - get the state just before the EOB char was reached */ -static yy_state_type yy_get_previous_state() +static yy_state_type yy_get_previous_state(void) { yy_state_type yy_current_state; char *yy_cp; @@ -3138,7 +3138,7 @@ char *yy_bp; #ifdef __cplusplus static int yyinput() #else -static int input() +static int input(void) #endif { int c; Modified: head/usr.bin/yacc/skeleton.c ============================================================================== --- head/usr.bin/yacc/skeleton.c Wed Dec 30 22:40:30 2009 (r201288) +++ head/usr.bin/yacc/skeleton.c Wed Dec 30 22:46:08 2009 (r201289) @@ -140,7 +140,11 @@ const char *header[] = const char *body[] = { "/* allocate initial stack or double stack size, up to YYMAXDEPTH */", + "#if defined(__cplusplus) || __STDC__", + "static int yygrowstack(void)", + "#else", "static int yygrowstack()", + "#endif", "{", " int newsize, i;", " short *newss;", From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 23:01:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3B02106566C; Wed, 30 Dec 2009 23:01:49 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E21388FC08; Wed, 30 Dec 2009 23:01:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUN1n02075673; Wed, 30 Dec 2009 23:01:49 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUN1nE5075671; Wed, 30 Dec 2009 23:01:49 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200912302301.nBUN1nE5075671@svn.freebsd.org> From: Ruslan Ermilov Date: Wed, 30 Dec 2009 23:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201290 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 23:01:50 -0000 Author: ru Date: Wed Dec 30 23:01:49 2009 New Revision: 201290 URL: http://svn.freebsd.org/changeset/base/201290 Log: Treat an empty argument as an error, instead of fetching the contents of the root directory. MFC after: 1 week Modified: head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Wed Dec 30 22:46:08 2009 (r201289) +++ head/usr.bin/fetch/fetch.c Wed Dec 30 23:01:49 2009 (r201290) @@ -340,6 +340,11 @@ fetch(char *URL, const char *path) fetchDebug = 1; /* parse URL */ + url = NULL; + if (*URL == '\0') { + warnx("empty URL"); + goto failure; + } if ((url = fetchParseURL(URL)) == NULL) { warnx("%s: parse error", URL); goto failure; From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 23:14:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E37F1065672; Wed, 30 Dec 2009 23:14:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C4648FC1A; Wed, 30 Dec 2009 23:14:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUNE4g7076018; Wed, 30 Dec 2009 23:14:04 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUNE4GD076016; Wed, 30 Dec 2009 23:14:04 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912302314.nBUNE4GD076016@svn.freebsd.org> From: Doug Barton Date: Wed, 30 Dec 2009 23:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201291 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 23:14:04 -0000 Author: dougb Date: Wed Dec 30 23:14:03 2009 New Revision: 201291 URL: http://svn.freebsd.org/changeset/base/201291 Log: Add some patches contributed by jhb: 1. Don't prompt the user for "-U but no db" error if we're using -a 2. Add an option to delete stale rc.d files automatically if the user has DELETE_STALE_RC_FILES in their rc file. Lack of command line option for this is not an oversight. 3. Add []'s around the terminal $ for the $FreeBSD$ test for -F For one bug raised by jhb I did a more thorough solution: There were a lot of things that "snuck in" between the end of the test for -r and the start of the comparison. One of them is the creation of the mtree db, as pointed out by jhb. Fix this problem more thoroughly by moving the end of the test down to where it should/used to be, right before the comparison. As a result, indent the interloping code to match. Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Wed Dec 30 23:01:49 2009 (r201290) +++ head/usr.sbin/mergemaster/mergemaster.sh Wed Dec 30 23:14:03 2009 (r201291) @@ -358,7 +358,11 @@ case "${AUTO_UPGRADE}" in echo " Skipping auto-upgrade on this run." echo " It will be created for the next run when this one is complete." echo '' - press_to_continue + case "${AUTO_RUN}" in + '') + press_to_continue + ;; + esac unset AUTO_UPGRADE fi ;; @@ -665,31 +669,32 @@ case "${RERUN}" in for file in ${IGNORE_FILES}; do test -e ${TEMPROOT}/${file} && unlink ${TEMPROOT}/${file} done - ;; # End of the "RERUN" test -esac -# We really don't want to have to deal with files like login.conf.db, pwd.db, -# or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. -# Prompt the user to do so below, as needed. -# -rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd - -# We only need to compare things like freebsd.cf once -find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null - -# Delete stuff we do not need to keep the mtree database small, -# and to make the actual comparison faster. -find ${TEMPROOT}/usr -type l -delete 2>/dev/null -find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null -find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null + # We really don't want to have to deal with files like login.conf.db, pwd.db, + # or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. + # Prompt the user to do so below, as needed. + # + rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd + + # We only need to compare things like freebsd.cf once + find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null -# Build the mtree database in a temporary location. -MTREENEW=`mktemp -t mergemaster.mtree` -case "${PRE_WORLD}" in -'') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null - ;; -*) # We don't want to mess with the mtree database on a pre-world run. - ;; + # Delete stuff we do not need to keep the mtree database small, + # and to make the actual comparison faster. + find ${TEMPROOT}/usr -type l -delete 2>/dev/null + find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null + find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null + + # Build the mtree database in a temporary location. + MTREENEW=`mktemp -t mergemaster.mtree` + case "${PRE_WORLD}" in + '') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null + ;; + *) # We don't want to mess with the mtree database on a pre-world run or + # when re-scanning a previously-built tree. + ;; + esac + ;; # End of the "RERUN" test esac # Get ready to start comparing files @@ -965,6 +970,12 @@ if [ -z "${PRE_WORLD}" -a -z "${RERUN}" esac sleep 2 ;; + *) + if [ -n "${DELETE_STALE_RC_FILES}" ]; then + echo ' *** Deleting ... ' + rm ${STALE_RC_FILES} + echo ' done.' + fi esac ;; esac @@ -1093,7 +1104,7 @@ for COMPFILE in `find . -type f | sort`; # If the user chose the -F option, test for that before proceeding # if [ -n "$FREEBSD_ID" ]; then - if diff -q -I'[$]FreeBSD:.*$' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \ + if diff -q -I'[$]FreeBSD.*[$]' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \ /dev/null 2>&1; then if mm_install "${COMPFILE}"; then echo "*** Updated revision control Id for ${DESTDIR}${COMPFILE#.}" From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 23:16:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50C491065672; Wed, 30 Dec 2009 23:16:15 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E90A8FC1A; Wed, 30 Dec 2009 23:16:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUNGF87076114; Wed, 30 Dec 2009 23:16:15 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUNGFbE076112; Wed, 30 Dec 2009 23:16:15 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912302316.nBUNGFbE076112@svn.freebsd.org> From: Doug Barton Date: Wed, 30 Dec 2009 23:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201292 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 23:16:15 -0000 Author: dougb Date: Wed Dec 30 23:16:14 2009 New Revision: 201292 URL: http://svn.freebsd.org/changeset/base/201292 Log: Document the DELETE_STALE_RC_FILES option introduced in r201291. This is an "rc file only" option by design. While I'm here, update the comments in the example rc file to indicate which command line options they relate to, and correct the defaults for a couple of options. Modified: head/usr.sbin/mergemaster/mergemaster.8 Modified: head/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.8 Wed Dec 30 23:14:03 2009 (r201291) +++ head/usr.sbin/mergemaster/mergemaster.8 Wed Dec 30 23:16:14 2009 (r201292) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2009 +.Dd December 30, 2009 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -320,44 +320,44 @@ with all values commented out: # These are options for mergemaster, with their default values listed # The following options have command line overrides # -# The target architecture (unset by default) +# The target architecture (-A, unset by default) #ARCHSTRING='TARGET_ARCH=' # -# Sourcedir is the directory to do the 'make' in (where the new files are) +# Sourcedir is the directory to do the 'make' in (-m) #SOURCEDIR='/usr/src' # -# Directory to install the temporary root environment into +# Directory to install the temporary root environment into (-t) #TEMPROOT='/var/tmp/temproot' # -# Specify the destination directory for the installed files +# Specify the destination directory for the installed files (-D) #DESTDIR= # -# Strict comparison skips the VCS Id test and compares every file +# Strict comparison skips the VCS Id test and compares every file (-s) #STRICT=no # -# Type of diff, such as unified, context, etc. +# Type of diff, such as unified, context, etc. (-c) #DIFF_FLAG='-u' # -# Install the new file if it differs only by VCS Id ($FreeBSD) +# Install the new file if it differs only by VCS Id ($FreeBSD, -F) #FREEBSD_ID= # -# Verbose mode includes more details and additional checks +# Verbose mode includes more details and additional checks (-v) #VERBOSE= # -# Automatically install files that do not exist on the system already +# Automatically install files that do not exist on the system already (-i) #AUTO_INSTALL= # -# Automatically upgrade files that have not been user modified +# Automatically upgrade files that have not been user modified (-U) #AUTO_UPGRADE= # -# Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf -#COMP_CONFS=yes +# Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf (-C) +#COMP_CONFS= # -# Preserve files that you replace -#PRESERVE_FILES=yes +# Preserve files that you replace (-P) +#PRESERVE_FILES= #PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S` # -# The umask for mergemaster to compare the default file's modes to +# The umask for mergemaster to compare the default file's modes to (-u) #NEW_UMASK=022 # # The following options have no command line overrides @@ -377,6 +377,9 @@ with all values commented out: # If you set 'yes' above, make sure to include the PATH to your pager #PATH=/bin:/usr/bin:/usr/sbin # +# Delete stale files in /etc/rc.d without prompting +#DELETE_STALE_RC_FILES= +# # Specify the path to scripts to run before the comparison starts, # and/or after the script has finished its work #MM_PRE_COMPARE_SCRIPT= From owner-svn-src-head@FreeBSD.ORG Wed Dec 30 23:26:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E987106568F; Wed, 30 Dec 2009 23:26:30 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23C358FC1B; Wed, 30 Dec 2009 23:26:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUNQUwt076671; Wed, 30 Dec 2009 23:26:30 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUNQT5b076669; Wed, 30 Dec 2009 23:26:29 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912302326.nBUNQT5b076669@svn.freebsd.org> From: Doug Barton Date: Wed, 30 Dec 2009 23:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201293 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 30 Dec 2009 23:26:30 -0000 Author: dougb Date: Wed Dec 30 23:26:29 2009 New Revision: 201293 URL: http://svn.freebsd.org/changeset/base/201293 Log: It's not necessary to include both Op and Fl for command line options included in the text, so use only the latter. Clarify that using -U doesn't make sense in combination with -a Modified: head/usr.sbin/mergemaster/mergemaster.8 Modified: head/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.8 Wed Dec 30 23:16:14 2009 (r201292) +++ head/usr.sbin/mergemaster/mergemaster.8 Wed Dec 30 23:26:29 2009 (r201293) @@ -61,10 +61,10 @@ down, populating that environment with t files. You can specify a different source directory with the -.Op Fl m +.Fl m command line option, or specify the destination directory with the -.Op Fl D +.Fl D option. It then compares each file in that environment to its installed counterpart. @@ -91,10 +91,10 @@ compares the files themselves. You can also specify that the script ignore the Id strings and compare every file with the -.Op Fl s +.Fl s option. Using the -.Op Fl F +.Fl F option .Nm will install the new file for you if they differ only by @@ -126,7 +126,7 @@ installing an updated version of this fi probably run .Xr pwd_mkdb 8 with the -.Op Fl p +.Fl p option to rebuild your password databases and recreate .Pa /etc/passwd . @@ -198,11 +198,13 @@ If the directory exists, it creates a new one in a previously non-existent directory. This option unsets the verbose flag, -but is compatible with all other options. +but other than +.Fl U +it is compatible with all other options. Setting -.Op Fl a +.Fl a makes -.Op Fl w +.Fl w superfluous. .It Fl h Display usage and help information. @@ -253,7 +255,7 @@ instead of the default Add the date and time to the name of the temporary root directory. If -.Op Fl t +.Fl t is specified, this option must follow it if you want the date added too. .It Fl u Ar N From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 00:01:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAC2E106566C for ; Thu, 31 Dec 2009 00:01:49 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 6514D8FC13 for ; Thu, 31 Dec 2009 00:01:48 +0000 (UTC) Received: (qmail 27180 invoked by uid 399); 31 Dec 2009 00:01:48 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 31 Dec 2009 00:01:48 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B3BE9EF.60400@FreeBSD.org> Date: Wed, 30 Dec 2009 16:01:51 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Ruslan Ermilov References: <200912302301.nBUN1nE5075671@svn.freebsd.org> In-Reply-To: <200912302301.nBUN1nE5075671@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201290 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 00:01:50 -0000 Ruslan Ermilov wrote: > Author: ru > Date: Wed Dec 30 23:01:49 2009 > New Revision: 201290 > URL: http://svn.freebsd.org/changeset/base/201290 > > Log: > Treat an empty argument as an error, instead of fetching the > contents of the root directory. I'm pretty sure that you just broke portmaster's package functionality with this change. I'm doing: fetch -q -o - ${sitepath} 2>/dev/null to get the list of what is available on the package sites. Is there a reason that you need to make this change? Doug > Modified: > head/usr.bin/fetch/fetch.c > > Modified: head/usr.bin/fetch/fetch.c > ============================================================================== > --- head/usr.bin/fetch/fetch.c Wed Dec 30 22:46:08 2009 (r201289) > +++ head/usr.bin/fetch/fetch.c Wed Dec 30 23:01:49 2009 (r201290) > @@ -340,6 +340,11 @@ fetch(char *URL, const char *path) > fetchDebug = 1; > > /* parse URL */ > + url = NULL; > + if (*URL == '\0') { > + warnx("empty URL"); > + goto failure; > + } > if ((url = fetchParseURL(URL)) == NULL) { > warnx("%s: parse error", URL); > goto failure; > -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 00:07:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4323C1065670; Thu, 31 Dec 2009 00:07:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18A688FC15; Thu, 31 Dec 2009 00:07:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBV07QcI078240; Thu, 31 Dec 2009 00:07:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBV07Qqb078236; Thu, 31 Dec 2009 00:07:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912310007.nBV07Qqb078236@svn.freebsd.org> From: Ed Schouten Date: Thu, 31 Dec 2009 00:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201300 - in head: . share/mk sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 00:07:27 -0000 Author: ed Date: Thu Dec 31 00:07:26 2009 New Revision: 201300 URL: http://svn.freebsd.org/changeset/base/201300 Log: Disable K&R style function definitions for WARNS=6. Unfortunately there are two slight problems with that: - Yacc and lex might generate code that generates warnings because of this. Require yacc and lex to be rebuilt during bootstrap. I'm not incrementing __FreeBSD_version here, because I assume someone else will do this eventually. - When running `make buildkernel', it uses share/mk from the source treeo to build aicasm. Because aicasm also depends on lex, this would break. Lower WARNS to 5 for now. We should just increment it to 6 again somewhere in the very far future. Modified: head/Makefile.inc1 head/share/mk/bsd.sys.mk head/sys/dev/aic7xxx/aicasm/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Dec 31 00:06:52 2009 (r201299) +++ head/Makefile.inc1 Thu Dec 31 00:07:26 2009 (r201300) @@ -940,6 +940,11 @@ _mklocale= usr.bin/mklocale _sed= usr.bin/sed .endif +.if ${BOOTSTRAPPING} < 900006 +_lex= usr.bin/lex +_yacc= usr.bin/yacc +.endif + .if ${BOOTSTRAPPING} < 700018 _gensnmptree= usr.sbin/bsnmpd/gensnmptree .endif @@ -966,6 +971,8 @@ bootstrap-tools: ${_mklocale} \ usr.bin/rpcgen \ ${_sed} \ + ${_lex} \ + ${_yacc} \ usr.bin/xinstall \ ${_gensnmptree} \ usr.sbin/config \ Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Thu Dec 31 00:06:52 2009 (r201299) +++ head/share/mk/bsd.sys.mk Thu Dec 31 00:07:26 2009 (r201300) @@ -47,7 +47,8 @@ CWARNFLAGS += -Wreturn-type -Wcast-qual . endif # BDECFLAGS . if ${WARNS} >= 6 -CWARNFLAGS += -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls +CWARNFLAGS += -Wchar-subscripts -Winline -Wnested-externs\ + -Wredundant-decls -Wold-style-definition . endif . if ${WARNS} >= 2 && ${WARNS} <= 4 # XXX Delete -Wuninitialized by default for now -- the compiler doesn't Modified: head/sys/dev/aic7xxx/aicasm/Makefile ============================================================================== --- head/sys/dev/aic7xxx/aicasm/Makefile Thu Dec 31 00:06:52 2009 (r201299) +++ head/sys/dev/aic7xxx/aicasm/Makefile Thu Dec 31 00:07:26 2009 (r201300) @@ -15,7 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} DPADD= ${LIBL} LDADD= -ll -WARNS?= 6 +WARNS?= 5 # Correct path for kernel builds # Don't rely on the kernel's .depend file From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 00:55:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 943EF106566C; Thu, 31 Dec 2009 00:55:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 834EB8FC16; Thu, 31 Dec 2009 00:55:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBV0togp080912; Thu, 31 Dec 2009 00:55:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBV0toKC080909; Thu, 31 Dec 2009 00:55:50 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912310055.nBV0toKC080909@svn.freebsd.org> From: Andrew Thompson Date: Thu, 31 Dec 2009 00:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201318 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 00:55:50 -0000 Author: thompsa Date: Thu Dec 31 00:55:50 2009 New Revision: 201318 URL: http://svn.freebsd.org/changeset/base/201318 Log: Add new device ID to uipaq driver PR: usb/141936 Submitted by: HASHI Hiroaki Modified: head/sys/dev/usb/serial/uipaq.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uipaq.c ============================================================================== --- head/sys/dev/usb/serial/uipaq.c Thu Dec 31 00:30:45 2009 (r201317) +++ head/sys/dev/usb/serial/uipaq.c Thu Dec 31 00:55:50 2009 (r201318) @@ -1015,6 +1015,8 @@ static const struct usb_device_id uipaq_ /**/ {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_WZERO3ES, 0)}, /**/ + {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_WZERO3ADES, 0)}, + /**/ {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_WILLCOM03, 0)}, /* Symbol USB Sync */ {USB_VPI(USB_VENDOR_SYMBOL, 0x2000, 0)}, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Dec 31 00:30:45 2009 (r201317) +++ head/sys/dev/usb/usbdevs Thu Dec 31 00:55:50 2009 (r201318) @@ -2405,6 +2405,7 @@ product SHARP SL5600 0x8006 Zaurus SL-5 product SHARP SLC700 0x8007 Zaurus SL-C700 PDA product SHARP SLC750 0x9031 Zaurus SL-C750 PDA product SHARP WZERO3ES 0x9123 W-ZERO3 ES Smartphone +product SHARP WZERO3ADES 0x91ac Advanced W-ZERO3 ES Smartphone product SHARP WILLCOM03 0x9242 WILLCOM03 /* Shuttle Technology products */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 01:09:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A480106568B; Thu, 31 Dec 2009 01:09:16 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A7068FC1D; Thu, 31 Dec 2009 01:09:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBV19GQl081377; Thu, 31 Dec 2009 01:09:16 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBV19GqV081375; Thu, 31 Dec 2009 01:09:16 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200912310109.nBV19GqV081375@svn.freebsd.org> From: Qing Li Date: Thu, 31 Dec 2009 01:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201319 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 01:09:16 -0000 Author: qingli Date: Thu Dec 31 01:09:16 2009 New Revision: 201319 URL: http://svn.freebsd.org/changeset/base/201319 Log: Remove a deleted comment line that was brought back by my previous commit. MFC after: 5 days Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Dec 31 00:55:50 2009 (r201318) +++ head/sys/net/if_var.h Thu Dec 31 01:09:16 2009 (r201319) @@ -844,7 +844,6 @@ void if_ref(struct ifnet *); void if_rele(struct ifnet *); int if_setlladdr(struct ifnet *, const u_char *, int); void if_up(struct ifnet *); -/*void ifinit(void);*/ /* declared in systm.h for main() */ int ifioctl(struct socket *, u_long, caddr_t, struct thread *); int ifpromisc(struct ifnet *, int); struct ifnet *ifunit(const char *); From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 01:37:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FA78106568D; Thu, 31 Dec 2009 01:37:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 770CF8FC15; Thu, 31 Dec 2009 01:37:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBV1bQ4W081988; Thu, 31 Dec 2009 01:37:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBV1bQNn081986; Thu, 31 Dec 2009 01:37:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912310137.nBV1bQNn081986@svn.freebsd.org> From: Ed Schouten Date: Thu, 31 Dec 2009 01:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201320 - head/lib/libgeom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 01:37:26 -0000 Author: ed Date: Thu Dec 31 01:37:26 2009 New Revision: 201320 URL: http://svn.freebsd.org/changeset/base/201320 Log: Add missing `void' keyword. Modified: head/lib/libgeom/geom_getxml.c Modified: head/lib/libgeom/geom_getxml.c ============================================================================== --- head/lib/libgeom/geom_getxml.c Thu Dec 31 01:09:16 2009 (r201319) +++ head/lib/libgeom/geom_getxml.c Thu Dec 31 01:37:26 2009 (r201320) @@ -36,7 +36,7 @@ #include "libgeom.h" char * -geom_getxml() +geom_getxml(void) { char *p; size_t l = 0; From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 01:38:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 698AE1065695; Thu, 31 Dec 2009 01:38:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40EB98FC16; Thu, 31 Dec 2009 01:38:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBV1cDgr082053; Thu, 31 Dec 2009 01:38:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBV1cDjD082051; Thu, 31 Dec 2009 01:38:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912310138.nBV1cDjD082051@svn.freebsd.org> From: Ed Schouten Date: Thu, 31 Dec 2009 01:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201321 - head/lib/libugidfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 01:38:13 -0000 Author: ed Date: Thu Dec 31 01:38:12 2009 New Revision: 201321 URL: http://svn.freebsd.org/changeset/base/201321 Log: Remove an unused variable. Modified: head/lib/libugidfw/ugidfw.c Modified: head/lib/libugidfw/ugidfw.c ============================================================================== --- head/lib/libugidfw/ugidfw.c Thu Dec 31 01:37:26 2009 (r201320) +++ head/lib/libugidfw/ugidfw.c Thu Dec 31 01:38:12 2009 (r201321) @@ -770,7 +770,6 @@ bsde_parse_fsid(char *spec, struct fsid { size_t len; struct statfs buf; - int i; if (statfs(spec, &buf) < 0) { len = snprintf(errstr, buflen, "Unable to get id for %s: %s", From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 04:07:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 457FC1065670; Thu, 31 Dec 2009 04:07:06 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 293188FC14; Thu, 31 Dec 2009 04:07:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBV47EmO085380; Thu, 31 Dec 2009 04:07:14 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBV47EXV085378; Thu, 31 Dec 2009 04:07:14 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912310407.nBV47EXV085378@svn.freebsd.org> From: Doug Barton Date: Thu, 31 Dec 2009 04:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201323 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 04:07:06 -0000 Author: dougb Date: Thu Dec 31 04:07:13 2009 New Revision: 201323 URL: http://svn.freebsd.org/changeset/base/201323 Log: If we are using -p it does not make any sense to even create the MTREENEW file since it will never be used. Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Thu Dec 31 03:25:27 2009 (r201322) +++ head/usr.sbin/mergemaster/mergemaster.sh Thu Dec 31 04:07:13 2009 (r201323) @@ -686,9 +686,9 @@ case "${RERUN}" in find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null # Build the mtree database in a temporary location. - MTREENEW=`mktemp -t mergemaster.mtree` case "${PRE_WORLD}" in - '') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null + '') MTREENEW=`mktemp -t mergemaster.mtree` + mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null ;; *) # We don't want to mess with the mtree database on a pre-world run or # when re-scanning a previously-built tree. From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 04:16:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAF74106566B; Thu, 31 Dec 2009 04:16:18 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF01A8FC13; Thu, 31 Dec 2009 04:16:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBV4GIVH085629; Thu, 31 Dec 2009 04:16:18 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBV4GI8u085627; Thu, 31 Dec 2009 04:16:18 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200912310416.nBV4GI8u085627@svn.freebsd.org> From: Matt Jacob Date: Thu, 31 Dec 2009 04:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201325 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 04:16:18 -0000 Author: mjacob Date: Thu Dec 31 04:16:18 2009 New Revision: 201325 URL: http://svn.freebsd.org/changeset/base/201325 Log: Create a Node WWN from the *Port* WWN, not vice versa, for 2400s. If the NAA is type 2, the Node WWN is the Port WWN with the 12 bits of port (48..60) cleared. This iff a wwn fetched from NVRAM is zero. MFC after: 1 week Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Dec 31 04:16:13 2009 (r201324) +++ head/sys/dev/isp/isp.c Thu Dec 31 04:16:18 2009 (r201325) @@ -8350,11 +8350,6 @@ isp_parse_nvram_2400(ispsoftc_t *isp, ui ISP2400_NVRAM_FIRMWARE_OPTIONS3(nvram_data)); wwn = ISP2400_NVRAM_PORT_NAME(nvram_data); - if (wwn) { - if ((wwn >> 60) != 2 && (wwn >> 60) != 5) { - wwn = 0; - } - } fcp->isp_wwpn_nvram = wwn; wwn = ISP2400_NVRAM_NODE_NAME(nvram_data); @@ -8363,6 +8358,10 @@ isp_parse_nvram_2400(ispsoftc_t *isp, ui wwn = 0; } } + if (wwn == 0 && (fcp->isp_wwpn_nvram >> 60) == 2) { + wwn = fcp->isp_wwpn_nvram; + wwn &= ~((uint64_t) 0xfff << 48); + } fcp->isp_wwnn_nvram = wwn; if (ISP2400_NVRAM_EXCHANGE_COUNT(nvram_data)) { From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 06:42:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EE51106566B for ; Thu, 31 Dec 2009 06:42:32 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id B30EB8FC18 for ; Thu, 31 Dec 2009 06:42:31 +0000 (UTC) Received: (qmail 29413 invoked by uid 399); 31 Dec 2009 06:42:30 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 31 Dec 2009 06:42:30 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B3C47DA.2030809@FreeBSD.org> Date: Wed, 30 Dec 2009 22:42:34 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Ruslan Ermilov References: <200912302301.nBUN1nE5075671@svn.freebsd.org> <4B3BE9EF.60400@FreeBSD.org> In-Reply-To: <4B3BE9EF.60400@FreeBSD.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201290 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 06:42:32 -0000 Doug Barton wrote: > Ruslan Ermilov wrote: >> Author: ru >> Date: Wed Dec 30 23:01:49 2009 >> New Revision: 201290 >> URL: http://svn.freebsd.org/changeset/base/201290 >> >> Log: >> Treat an empty argument as an error, instead of fetching the >> contents of the root directory. > > I'm pretty sure that you just broke portmaster's package functionality > with this change. EPREMATUREPANIC, sorry. AFAICS what I'm using fetch for still works in portmaster after this change. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 08:36:54 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75F51106566C; Thu, 31 Dec 2009 08:36:54 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 28ADC8FC14; Thu, 31 Dec 2009 08:36:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 9890F9CB08A; Thu, 31 Dec 2009 09:34:23 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M63E3rQes4zD; Thu, 31 Dec 2009 09:34:21 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 270BB9CB147; Thu, 31 Dec 2009 09:34:21 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id nBV8YLlO044670; Thu, 31 Dec 2009 09:34:21 +0100 (CET) (envelope-from rdivacky) Date: Thu, 31 Dec 2009 09:34:21 +0100 From: Roman Divacky To: Ed Schouten Message-ID: <20091231083420.GA44599@freebsd.org> References: <200912302246.nBUMk9Ta075013@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912302246.nBUMk9Ta075013@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201289 - in head/usr.bin: lex yacc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 08:36:54 -0000 On Wed, Dec 30, 2009 at 10:46:09PM +0000, Ed Schouten wrote: > Author: ed > Date: Wed Dec 30 22:46:08 2009 > New Revision: 201289 > URL: http://svn.freebsd.org/changeset/base/201289 > > Log: > Let both yacc and lex generate code that passes -Wold-style-definition. > > Both these tools emit code where several functions have no `void' > keyword placed in the arugment list when the function has no arguments. > > Modified: > head/usr.bin/lex/flex.skl > head/usr.bin/lex/initscan.c > head/usr.bin/yacc/skeleton.c yacc update is in progress. From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 09:33:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47053106566B; Thu, 31 Dec 2009 09:33:19 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 304B08FC16; Thu, 31 Dec 2009 09:33:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBV9XJPq092351; Thu, 31 Dec 2009 09:33:19 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBV9XJI7092350; Thu, 31 Dec 2009 09:33:19 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200912310933.nBV9XJI7092350@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 31 Dec 2009 09:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201333 - in head/tools/regression/usr.bin/make: archives/fmt_44bsd archives/fmt_44bsd_mod archives/fmt_oldbsd basic/t0 basic/t1 basic/t2 basic/t3 shell/builtin shell/path shell/path_se... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 09:33:19 -0000 Author: obrien Date: Thu Dec 31 09:33:18 2009 New Revision: 201333 URL: http://svn.freebsd.org/changeset/base/201333 Log: Delete the svn:mime-type property from these text files. Modified: Directory Properties: head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.1 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.2 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.3 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.4 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.5 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.6 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.status.7 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.2 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.3 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.4 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.5 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.6 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stderr.7 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.2 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.3 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.4 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.5 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.6 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd/expected.stdout.7 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.1 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.2 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.3 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.4 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.5 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.6 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.status.7 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.2 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.3 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.4 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.5 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.6 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.7 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.2 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.3 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.4 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.5 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.6 (props changed) head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.7 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.1 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.2 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.3 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.4 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.5 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.6 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.status.7 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.2 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.3 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.4 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.5 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.6 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stderr.7 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.2 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.3 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.4 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.5 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.6 (props changed) head/tools/regression/usr.bin/make/archives/fmt_oldbsd/expected.stdout.7 (props changed) head/tools/regression/usr.bin/make/basic/t0/expected.status.1 (props changed) head/tools/regression/usr.bin/make/basic/t0/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/basic/t0/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/basic/t1/expected.status.1 (props changed) head/tools/regression/usr.bin/make/basic/t1/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/basic/t1/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/basic/t2/expected.status.1 (props changed) head/tools/regression/usr.bin/make/basic/t2/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/basic/t2/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/basic/t3/expected.status.1 (props changed) head/tools/regression/usr.bin/make/basic/t3/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/basic/t3/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/shell/builtin/expected.status.1 (props changed) head/tools/regression/usr.bin/make/shell/builtin/expected.status.2 (props changed) head/tools/regression/usr.bin/make/shell/builtin/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/shell/builtin/expected.stderr.2 (props changed) head/tools/regression/usr.bin/make/shell/builtin/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/shell/builtin/expected.stdout.2 (props changed) head/tools/regression/usr.bin/make/shell/path/expected.status.1 (props changed) head/tools/regression/usr.bin/make/shell/path/expected.status.2 (props changed) head/tools/regression/usr.bin/make/shell/path/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/shell/path/expected.stderr.2 (props changed) head/tools/regression/usr.bin/make/shell/path/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/shell/path/expected.stdout.2 (props changed) head/tools/regression/usr.bin/make/shell/path_select/expected.status.1 (props changed) head/tools/regression/usr.bin/make/shell/path_select/expected.status.2 (props changed) head/tools/regression/usr.bin/make/shell/path_select/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/shell/path_select/expected.stderr.2 (props changed) head/tools/regression/usr.bin/make/shell/path_select/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/shell/path_select/expected.stdout.2 (props changed) head/tools/regression/usr.bin/make/shell/replace/expected.status.1 (props changed) head/tools/regression/usr.bin/make/shell/replace/expected.status.2 (props changed) head/tools/regression/usr.bin/make/shell/replace/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/shell/replace/expected.stderr.2 (props changed) head/tools/regression/usr.bin/make/shell/replace/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/shell/replace/expected.stdout.2 (props changed) head/tools/regression/usr.bin/make/shell/select/expected.status.1 (props changed) head/tools/regression/usr.bin/make/shell/select/expected.status.2 (props changed) head/tools/regression/usr.bin/make/shell/select/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/shell/select/expected.stderr.2 (props changed) head/tools/regression/usr.bin/make/shell/select/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/shell/select/expected.stdout.2 (props changed) head/tools/regression/usr.bin/make/suffixes/basic/expected.status.1 (props changed) head/tools/regression/usr.bin/make/suffixes/basic/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/suffixes/basic/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/suffixes/src_wild1/expected.status.1 (props changed) head/tools/regression/usr.bin/make/suffixes/src_wild1/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/suffixes/src_wild1/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/suffixes/src_wild2/expected.status.1 (props changed) head/tools/regression/usr.bin/make/suffixes/src_wild2/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/suffixes/src_wild2/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/syntax/enl/expected.status.1 (props changed) head/tools/regression/usr.bin/make/syntax/enl/expected.status.2 (props changed) head/tools/regression/usr.bin/make/syntax/enl/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/syntax/enl/expected.stderr.2 (props changed) head/tools/regression/usr.bin/make/syntax/enl/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/syntax/enl/expected.stdout.2 (props changed) head/tools/regression/usr.bin/make/syntax/semi/expected.status.1 (props changed) head/tools/regression/usr.bin/make/syntax/semi/expected.status.2 (props changed) head/tools/regression/usr.bin/make/syntax/semi/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/syntax/semi/expected.stderr.2 (props changed) head/tools/regression/usr.bin/make/syntax/semi/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/syntax/semi/expected.stdout.2 (props changed) head/tools/regression/usr.bin/make/variables/modifier_M/expected.status.1 (props changed) head/tools/regression/usr.bin/make/variables/modifier_M/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/variables/modifier_M/expected.stdout.1 (props changed) head/tools/regression/usr.bin/make/variables/t0/expected.status.1 (props changed) head/tools/regression/usr.bin/make/variables/t0/expected.stderr.1 (props changed) head/tools/regression/usr.bin/make/variables/t0/expected.stdout.1 (props changed) From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 10:00:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3896C106568F; Thu, 31 Dec 2009 10:00:38 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 268D58FC13; Thu, 31 Dec 2009 10:00:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVA0cHY092954; Thu, 31 Dec 2009 10:00:38 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVA0cT9092952; Thu, 31 Dec 2009 10:00:38 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200912311000.nBVA0cT9092952@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 31 Dec 2009 10:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201334 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 10:00:38 -0000 Author: obrien Date: Thu Dec 31 10:00:37 2009 New Revision: 201334 URL: http://svn.freebsd.org/changeset/base/201334 Log: Happy New Year 2010! :-) Modified: head/COPYRIGHT Modified: head/COPYRIGHT ============================================================================== --- head/COPYRIGHT Thu Dec 31 09:33:18 2009 (r201333) +++ head/COPYRIGHT Thu Dec 31 10:00:37 2009 (r201334) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2009 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 12:05:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 916CD1065672; Thu, 31 Dec 2009 12:05:48 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F8938FC20; Thu, 31 Dec 2009 12:05:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVC5mxh097220; Thu, 31 Dec 2009 12:05:48 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVC5mdt097215; Thu, 31 Dec 2009 12:05:48 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912311205.nBVC5mdt097215@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 31 Dec 2009 12:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201339 - in head/sys/boot/pc98: libpc98 loader X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 12:05:48 -0000 Author: nyan Date: Thu Dec 31 12:05:48 2009 New Revision: 201339 URL: http://svn.freebsd.org/changeset/base/201339 Log: Add setting machine type support to the loader. MFC after: 2 week Added: head/sys/boot/pc98/libpc98/libpc98.h (contents, props changed) head/sys/boot/pc98/libpc98/pc98_sys.c (contents, props changed) Modified: head/sys/boot/pc98/libpc98/Makefile head/sys/boot/pc98/loader/main.c Modified: head/sys/boot/pc98/libpc98/Makefile ============================================================================== --- head/sys/boot/pc98/libpc98/Makefile Thu Dec 31 11:49:13 2009 (r201338) +++ head/sys/boot/pc98/libpc98/Makefile Thu Dec 31 12:05:48 2009 (r201339) @@ -8,7 +8,7 @@ INTERNALLIB= SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c \ biospci.c biossmap.c bootinfo.c bootinfo32.c \ comconsole.c devicename.c elf32_freebsd.c \ - i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ + i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c # Enable PXE TFTP or NFS support, not both. Added: head/sys/boot/pc98/libpc98/libpc98.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/pc98/libpc98/libpc98.h Thu Dec 31 12:05:48 2009 (r201339) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * 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$ + */ + +void set_machine_type(void); Added: head/sys/boot/pc98/libpc98/pc98_sys.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/pc98/libpc98/pc98_sys.c Thu Dec 31 12:05:48 2009 (r201339) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#define _KERNEL +#include + +/* + * Set machine type to PC98_SYSTEM_PARAMETER. + */ +void +set_machine_type(void) +{ + int i; + u_long ret, data; + + /* PC98_SYSTEM_PARAMETER (0x501) */ + ret = ((*(u_char *)PTOV(0xA1501)) & 0x08) >> 3; + + /* Wait V-SYNC */ + while (inb(0x60) & 0x20) {} + while (!(inb(0x60) & 0x20)) {} + + /* ANK 'A' font */ + outb(0xa1, 0x00); + outb(0xa3, 0x41); + + /* M_NORMAL, use CG window (all NEC OK) */ + for (i = data = 0; i < 4; i++) + data += *((u_long *)PTOV(0xA4000) + i); /* 0xa4000 */ + if (data == 0x6efc58fc) /* DA data */ + ret |= M_NEC_PC98; + else + ret |= M_EPSON_PC98; + ret |= (inb(0x42) & 0x20) ? M_8M : 0; + + /* PC98_SYSTEM_PARAMETER(0x400) */ + if ((*(u_char *)PTOV(0xA1400)) & 0x80) + ret |= M_NOTE; + if (ret & M_NEC_PC98) { + /* PC98_SYSTEM_PARAMETER(0x458) */ + if ((*(u_char *)PTOV(0xA1458)) & 0x80) + ret |= M_H98; + else + ret |= M_NOT_H98; + } else + ret |= M_NOT_H98; + + (*(u_long *)PTOV(0xA1620)) = ret; +} Modified: head/sys/boot/pc98/loader/main.c ============================================================================== --- head/sys/boot/pc98/loader/main.c Thu Dec 31 11:49:13 2009 (r201338) +++ head/sys/boot/pc98/loader/main.c Thu Dec 31 12:05:48 2009 (r201339) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386/libi386.h" +#include "libpc98/libpc98.h" #include "btxv86.h" #define KARGS_FLAGS_CD 0x1 @@ -81,6 +82,9 @@ main(void) { int i; + /* Set machine type to PC98_SYSTEM_PARAMETER. */ + set_machine_type(); + /* Pick up arguments */ kargs = (void *)__args; initial_howto = kargs->howto; From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 12:17:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ECD6106566C; Thu, 31 Dec 2009 12:17:39 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 248C88FC0A; Thu, 31 Dec 2009 12:17:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVCHdQh097477; Thu, 31 Dec 2009 12:17:39 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVCHdoj097474; Thu, 31 Dec 2009 12:17:39 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912311217.nBVCHdoj097474@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 31 Dec 2009 12:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201340 - in head/sys/boot: common pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 12:17:39 -0000 Author: nyan Date: Thu Dec 31 12:17:38 2009 New Revision: 201340 URL: http://svn.freebsd.org/changeset/base/201340 Log: Don't use 15M-16M area on pc98. It's reserved for some devices. MFC after: 2 week Modified: head/sys/boot/common/module.c head/sys/boot/pc98/Makefile.inc Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Thu Dec 31 12:05:48 2009 (r201339) +++ head/sys/boot/common/module.c Thu Dec 31 12:17:38 2009 (r201340) @@ -351,6 +351,9 @@ file_loadraw(char *type, char *name) char *cp; int fd, got; vm_offset_t laddr; +#ifdef PC98 + struct stat st; +#endif /* We can't load first */ if ((file_findfile(NULL, NULL)) == NULL) { @@ -372,6 +375,14 @@ file_loadraw(char *type, char *name) return(CMD_ERROR); } +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + if (loadaddr < 0x1000000 && + fstat(fd, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif + laddr = loadaddr; for (;;) { /* read in 4k chunks; size is not really important */ @@ -477,6 +488,14 @@ mod_loadkld(const char *kldname, int arg ; do { +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + struct stat st; + if (loadaddr < 0x1000000 && + stat(filename, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif err = file_load(filename, loadaddr, &fp); if (err) break; Modified: head/sys/boot/pc98/Makefile.inc ============================================================================== --- head/sys/boot/pc98/Makefile.inc Thu Dec 31 12:05:48 2009 (r201339) +++ head/sys/boot/pc98/Makefile.inc Thu Dec 31 12:17:38 2009 (r201340) @@ -7,7 +7,7 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ - -Os + -Os -DPC98 LDFLAGS+= -nostdlib # BTX components From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 12:26:18 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D4251065692; Thu, 31 Dec 2009 12:26:18 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id CB3DB8FC15; Thu, 31 Dec 2009 12:26:17 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id nBVCQEK0070512; Thu, 31 Dec 2009 21:26:16 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Thu, 31 Dec 2009 21:25:19 +0900 (JST) Message-Id: <20091231.212519.27847876.nyan@FreeBSD.org> To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: TAKAHASHI Yoshihiro In-Reply-To: <200912311205.nBVC5mdt097215@svn.freebsd.org> <200912311217.nBVCHdoj097474@svn.freebsd.org> References: <200912311205.nBVC5mdt097215@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r201339 - in head/sys/boot/pc98: libpc98 loader X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 12:26:18 -0000 > Author: nyan > Date: Thu Dec 31 12:05:48 2009 > New Revision: 201339 > URL: http://svn.freebsd.org/changeset/base/201339 > > Log: > Add setting machine type support to the loader. > Author: nyan > Date: Thu Dec 31 12:17:38 2009 > New Revision: 201340 > URL: http://svn.freebsd.org/changeset/base/201340 > > Log: > Don't use 15M-16M area on pc98. It's reserved for some devices. Oops, I forgot to add the following. Tested by: SATOU Tomokazu ( tomo1770 _ maple _ ocn _ ne _ jp ), WATANABE Kazuhiro ( CQG00620 _ nifty _ ne _ jp ) and nyan --- TAKAHASHI Yoshihiro From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 12:47:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 034BE106566C; Thu, 31 Dec 2009 12:47:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C62B08FC1D; Thu, 31 Dec 2009 12:47:22 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 790D346B52; Thu, 31 Dec 2009 07:47:22 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id AB93B8A01F; Thu, 31 Dec 2009 07:47:14 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Date: Wed, 30 Dec 2009 17:49:45 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912302237.nBUMbSvc074747@svn.freebsd.org> In-Reply-To: <200912302237.nBUMbSvc074747@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912301749.45853.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 31 Dec 2009 07:47:14 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.0 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_12_24,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r201287 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 12:47:23 -0000 On Wednesday 30 December 2009 5:37:28 pm John Baldwin wrote: > Author: jhb > Date: Wed Dec 30 22:37:28 2009 > New Revision: 201287 > URL: http://svn.freebsd.org/changeset/base/201287 > > Log: > Actually set RLE_ALLOCATED when allocating a reserved resource so that > resource_list_release() will later release the resource instead of failing. In theory this change along with several others committed today should resolve many (most?) of the cardbus panics since my changes to the PCI bus driver to use resource_list_reserve(). For folks willing to be guinea pigs there are some further refinements to the PCI/cardbus code for removing PCI devices in the current version of http://www.FreeBSD.org/~jhb/patches/cardbus.patch -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 15:03:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ACEC106568B; Thu, 31 Dec 2009 15:03:33 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7928D8FC1D; Thu, 31 Dec 2009 15:03:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVF3XRw028719; Thu, 31 Dec 2009 15:03:33 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVF3XOF028715; Thu, 31 Dec 2009 15:03:33 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912311503.nBVF3XOF028715@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 31 Dec 2009 15:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201342 - head/sys/boot/pc98/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 15:03:33 -0000 Author: nyan Date: Thu Dec 31 15:03:33 2009 New Revision: 201342 URL: http://svn.freebsd.org/changeset/base/201342 Log: Reimplement the boot2 for pc98 completely. It's based on the newest i386's one and has the advantage of: - ELF binary support. - UFS2 filesystem support. - Many FreeBSD slices support on a disk. Tested by: SATOU Tomokazu ( tomo1770 _ maple _ ocn _ ne _ jp ), WATANABE Kazuhiro ( CQG00620 _ nifty _ ne _ jp ) and nyan MFC after: 2 week Happy New Year in Japan!! Added: head/sys/boot/pc98/boot2/boot1.S (contents, props changed) head/sys/boot/pc98/boot2/boot2.c (contents, props changed) Deleted: head/sys/boot/pc98/boot2/asm.S head/sys/boot/pc98/boot2/asm.h head/sys/boot/pc98/boot2/bios.S head/sys/boot/pc98/boot2/boot.c head/sys/boot/pc98/boot2/boot.h head/sys/boot/pc98/boot2/boot2.S head/sys/boot/pc98/boot2/dinode.h head/sys/boot/pc98/boot2/disk.c head/sys/boot/pc98/boot2/fs.h head/sys/boot/pc98/boot2/inode.h head/sys/boot/pc98/boot2/io.c head/sys/boot/pc98/boot2/probe_keyboard.c head/sys/boot/pc98/boot2/quota.h head/sys/boot/pc98/boot2/serial.S head/sys/boot/pc98/boot2/serial_16550.S head/sys/boot/pc98/boot2/serial_8251.S head/sys/boot/pc98/boot2/start.S head/sys/boot/pc98/boot2/sys.c head/sys/boot/pc98/boot2/table.c Modified: head/sys/boot/pc98/boot2/Makefile Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Thu Dec 31 12:58:08 2009 (r201341) +++ head/sys/boot/pc98/boot2/Makefile Thu Dec 31 15:03:33 2009 (r201342) @@ -1,119 +1,104 @@ # $FreeBSD$ -# -PROG= boot -# Order is very important on the SRCS line for this prog -SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S -SRCS+= probe_keyboard.c io.c disk.c sys.c - -BINMODE= 444 -CFLAGS= -Os -mrtd \ - -fno-guess-branch-probability \ - -fno-unit-at-a-time \ - -D_KERNEL -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT} -CFLAGS+= -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK} -CFLAGS+= -I${.CURDIR}/../../.. -I. - -# By default, if a serial port is going to be used as console, use COM1 -# (aka /dev/ttyd0). -#BOOT_COMCONSOLE_PORT?=0x30 -BOOT_COMCONSOLE_PORT?=0x238 -BOOT_COMCONSOLE_CLK?=16 -BOOT_COMCONSOLE_MODE=0x0c -CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \ - -DCOMCONSOLE_CLK=${BOOT_COMCONSOLE_CLK} \ - -DCOMCONSOLE_MODE=${BOOT_COMCONSOLE_MODE} - -# feature not implemented -BOOT_COMCONSOLE_SPEED?=9600 -CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} +FILES= boot boot1 boot2 + +NM?= nm + +BOOT_COMCONSOLE_PORT?= 0x238 +BOOT_COMCONSOLE_SPEED?= 9600 +B2SIOFMT?= 0x3 + +REL1= 0x700 +ORG1= 0 +ORG2= 0x2000 + +# Decide level of UFS support. +BOOT2_UFS?= UFS1_AND_UFS2 +#BOOT2_UFS?= UFS2_ONLY +#BOOT2_UFS?= UFS1_ONLY + +CFLAGS= -Os \ + -fno-guess-branch-probability \ + -fomit-frame-pointer \ + -fno-unit-at-a-time \ + -mno-align-long-strings \ + -mrtd \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ + -D${BOOT2_UFS} \ + -DFLAGS=${BOOT_BOOT1_FLAGS} \ + -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ + -DSIOFMT=${B2SIOFMT} \ + -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ + -I${.CURDIR}/../../.. \ + -I${.CURDIR}/../../i386/boot2 \ + -I${.CURDIR}/../../common \ + -I${.CURDIR}/../btx/lib -I. \ + -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ + -Winline --param max-inline-insns-single=100 # Set machine type to PC98_SYSTEM_PARAMETER -CFLAGS+= -DSET_MACHINE_TYPE +#CFLAGS+= -DSET_MACHINE_TYPE # Initialize the bi_bios_geom using the BIOS geometry -CFLAGS+= -DGET_BIOSGEOM +#CFLAGS+= -DGET_BIOSGEOM + +LDFLAGS=-static -N --gc-sections + +# Pick up ../Makefile.inc early. +.include + +.PATH: ${.CURDIR}/../../i386/boot2 + +CLEANFILES= boot + +boot: boot1 boot2 + cat boot1 boot2 > boot + +CLEANFILES+= boot1 boot1.out boot1.o + +boot1: boot1.out + objcopy -S -O binary boot1.out ${.TARGET} + +boot1.out: boot1.o + ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o + +CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ + boot2.s boot2.s.tmp boot2.h sio.o + +boot2: boot2.ld + @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 + dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync + +boot2.ld: boot2.ldr boot2.bin ${BTXKERN} + btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ + -o ${.TARGET} -P 1 boot2.bin + +boot2.ldr: + dd if=/dev/zero of=${.TARGET} bs=276 count=1 + +boot2.bin: boot2.out + objcopy -S -O binary boot2.out ${.TARGET} + +boot2.out: ${BTXCRT} boot2.o sio.o + ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} -# Enable code to take the default boot string from a fixed location on the -# disk. See nextboot(8) and README.386BSD for more info. -#CFLAGS+= -DNAMEBLOCK -#CFLAGS+= -DNAMEBLOCK_WRITEBACK - -# Bias the conversion from the BIOS drive number to the FreeBSD unit number -# for hard disks. This may be useful for people booting in a mixed IDE/SCSI -# environment (set BOOT_HD_BIAS to the number of IDE drives). -#CFLAGS+= -DBOOT_HD_BIAS=1 -# -# Details: this only applies if BOOT_HD_BIAS > 0. If the BIOS drive number -# for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to -# be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS). E.g., -# BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:da(0,a) instead of -# 1:wd(1,a). If `da' is given explicitly, then the drive is assumed to be -# SCSI and have BIOS drive number (da_unit_number + BOOT_HD_BIAS). E.g., -# BOOT_HD_BIAS=1 makes da(0,a) correspond to 1:da(0,a) instead of 0:da(0,a). - -CLEANFILES+= boot.nohdr boot.strip boot.ldr boot1 boot2 sizetest -LDFLAGS+= -N -Ttext 0 -e start -NO_SHARED= YES -NO_MAN= -STRIP= - -# tunable timeout parameter, waiting for keypress, calibrated in ms -BOOTWAIT?= 5000 -# tunable timeout during string input, calibrated in ms -#TIMEOUT?= 30000 - -# Location that boot2 is loaded at -BOOTSEG= 0x1000 - -# Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned -BOOTSTACK= 0xFFF0 - -boot.nohdr: boot - objcopy -S -O binary boot boot.nohdr - ls -l boot.nohdr - -boot.ldr: boot.nohdr - dd if=boot.nohdr of=boot.ldr bs=8192 count=1 conv=sync - -boot1: boot.nohdr - dd if=boot.nohdr of=boot1 bs=512 count=1 - -boot2: boot.nohdr - dd if=boot.nohdr of=boot2 bs=512 skip=1 - @dd if=boot2 skip=14 of=sizetest 2> /dev/null - @if [ -s sizetest ] ; then \ - echo "boot2 is too big" >&2 ; \ - rm boot2 ; \ - exit 2 ; \ - fi - -all: boot.ldr boot1 boot2 - -install: - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - boot.ldr ${DESTDIR}${BINDIR}/boot - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - boot1 boot2 ${DESTDIR}${BINDIR} - -# If it's not there, don't consider it a target -.if exists(${.CURDIR}/../../../pc98/include) -beforedepend ${OBJS}: machine - -machine: - ln -sf ${.CURDIR}/../../../pc98/include machine - -.endif - -.if exists(${.CURDIR}/../../../i386/include) -beforedepend ${OBJS}: i386 +boot2.o: boot2.s -i386: - ln -sf ${.CURDIR}/../../../i386/include i386 +SRCS= boot2.c boot2.h -.endif +boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c + ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c + sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s + rm -f boot2.s.tmp -CLEANFILES+= machine i386 +boot2.h: boot1.out + ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T (read|putc)/ \ + { x = $$1 - ORG1; \ + printf("#define %sORG %#x\n", toupper($$3), REL1 + x) }' \ + ORG1=`printf "%d" ${ORG1}` \ + REL1=`printf "%d" ${REL1}` > ${.TARGET} -CWARNFLAGS!= ${MAKE} -f bsd.own.mk -f ${.CURDIR}/../../../conf/kern.mk -V CWARNFLAGS .include Added: head/sys/boot/pc98/boot2/boot1.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/pc98/boot2/boot1.S Thu Dec 31 15:03:33 2009 (r201342) @@ -0,0 +1,395 @@ +/*- + * Copyright (c) 2008-2009 TAKAHASHI Yoshihiro + * 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$ + */ + +/* Memory Locations */ + .set STACK_OFF,0x6000 # Stack offset + .set LOAD_SIZE,8192 # Load size + .set DAUA,0x0584 # DA/UA + .set MEM_REL,0x700 # Relocation address + .set MEM_ARG,0x900 # Arguments + .set MEM_BUF,0x8cec # Load area + .set MEM_BTX,0x9000 # BTX start + .set MEM_JMP,0x9010 # BTX entry point + .set MEM_USR,0xa000 # Client start + +/* PC98 machine type from sys/pc98/pc98/pc98_machdep.h */ + .set MEM_SYS, 0xa100 # System common area segment + .set PC98_MACHINE_TYPE, 0x0620 # PC98 machine type + .set EPSON_ID, 0x0624 # EPSON machine id + + .set M_NEC_PC98, 0x0001 + .set M_EPSON_PC98, 0x0002 + .set M_NOT_H98, 0x0010 + .set M_H98, 0x0020 + .set M_NOTE, 0x0040 + .set M_NORMAL, 0x1000 + .set M_8M, 0x8000 + +/* Partition Constants */ + .set PRT_OFF,0x1be # Partition offset + +/* Misc. Constants */ + .set SIZ_PAG,0x1000 # Page size + .set SIZ_SEC,0x200 # Sector size + + .set NSECT,0x10 + + .globl start + .globl read + .globl putc + .code16 + +start: jmp main + +boot_cyl: .org 4 + .ascii "IPL1 " + +main: cld + + /* Setup the stack */ + xor %si,%si + mov %si,%ss + mov $STACK_OFF,%sp + + push %cx + + /* Relocate ourself to MEM_REL */ + push %cs + pop %ds + mov %si,%es + mov $MEM_REL,%di + mov $SIZ_SEC,%cx + rep + movsb + + /* Transfer PC-9801 system common area */ + xor %ax,%ax + mov %ax,%si + mov %ax,%ds + mov %ax,%di + mov $MEM_SYS,%ax + mov %ax,%es + mov $0x0600,%cx + rep + movsb + + /* Transfer EPSON machine type */ + mov $0xfd00,%ax + mov %ax,%ds + mov (0x804),%eax + and $0x00ffffff,%eax + mov %eax,%es:(EPSON_ID) + + /* Set machine type to PC98_SYSTEM_PARAMETER */ +#ifdef SET_MACHINE_TYPE + call set_machine_type +#else + mov $M_NEC_PC98+M_NOT_H98,%eax + mov %eax,%es:(PC98_MACHINE_TYPE) +#endif + + /* Setup graphic screen */ + mov $0x42,%ah /* 640x400 */ + mov $0xc0,%ch + int $0x18 + mov $0x40,%ah /* graph on */ + int $0x18 + + /* Setup text screen */ + mov $0x0a00,%ax /* 80x25 */ + int $0x18 + mov $0x0c,%ah /* text on */ + int $0x18 + mov $0x13,%ah /* cursor home */ + xor %dx,%dx + int $0x18 + mov $0x11,%ah /* cursor on */ + int $0x18 + + /* Setup keyboard */ + mov $0x03,%ah + int $0x18 + + pop %cx + + /* bootstrap passes */ + xor %edi,%edi + mov %di,%ds + mov %di,%es + mov %cs,%bx + cmp $0x1fe0,%bx + jz boot_fd + cmp $0x1fc0,%bx + jnz boot_hd + xor %cx,%cx + mov (DAUA),%al + and $0xf0,%al + cmp $0x30,%al + jz boot_fd + cmp $0x90,%al + jnz boot_hd +boot_fd: xor %cx,%cx + jmp boot_load +boot_hd: test %cx,%cx + jnz boot_load + mov %cs:(boot_cyl),%cx +boot_load: mov %cx,MEM_ARG /* Save cylinder number */ + mov %cx,%di + xor %dx,%dx + mov $LOAD_SIZE,%bx + mov $MEM_BUF,%bp + push %cs + callw read + jc error + + /* Transfer boot2.bin */ + mov $MEM_BTX,%bx + mov 0xa(%bx),%si /* BTX size */ + add %bx,%si /* start of boot2.bin */ + mov $MEM_USR+SIZ_PAG*2,%di + mov $MEM_BTX+(NSECT-1)*SIZ_SEC,%cx + sub %si,%cx + rep + movsb + + /* Enable A20 */ + xor %ax,%ax + outb %al,$0xf2 + mov $0x02,%al + outb %al,$0xf6 + + /* Start BTX */ + ljmp $0x0000,$MEM_JMP + +/* + * Reads sectors from the disk. + * Call with: + * + * %bx - bytes to read + * %cx - cylinder + * %dh - head + * %dl - sector + * %edi - lba + * %es:(%bp) - buffer to read data into + */ +read: xor %ax,%ax + mov %ax,%ds + mov $0x06,%ah + mov (DAUA),%al + mov %ax,%si + and $0xf0,%al + cmp $0x30,%al /* 1.44MB FDD */ + jz read_fd + cmp $0x90,%al /* 1MB FDD */ + jz read_fd + cmp $0xa0,%al /* Is SCSI device? */ + jnz read_load + push %cx + mov %si,%cx + and $0x0f,%cl + inc %cl + mov (0x482),%ah + shr %cl,%ah /* Is SCSI HDD? */ + pop %cx + jc read_load + and $0xff7f,%si /* SCSI MO */ + mov %di,%cx + shr $16,%di + mov %di,%dx + jmp read_load +read_fd: or $0xd000,%si + or $0x0200,%cx + inc %dx +read_load: mov %si,%ax + int $0x1b + lret + +/* + * Print out the error message, wait for a keypress, and then reboot + * the machine. + */ +error: push %cs + pop %ds + mov $msg_eread,%si + call putstr + xor %ax,%ax /* Get keypress */ + int $0x18 + xor %ax,%ax /* CPU reset */ + outb %al,$0xf0 +halt: hlt + jmp halt /* Spin */ + +/* + * Display a null-terminated string. + */ +putstr.0: push %cs + callw putc +putstr: lodsb + test %al,%al + jne putstr.0 + ret + +/* + * Display a single char. + */ +putc: pusha + xor %dx,%dx + mov %dx,%ds + mov MEM_REL+cursor-start,%di + mov $0xa000,%bx + mov %bx,%es + mov $(80*2),%cx + + cmp $0x08,%al + je putc.bs + cmp $0x0d,%al + je putc.cr + cmp $0x0a,%al + je putc.lf + cmp $0x5c,%al /* \ */ + jne 1f + mov $0xfc,%al +1: movb $0xe1,%es:0x2000(%di) + stosw + jmp putc.scr +putc.bs: test %di,%di + jz putc.move + dec %di + dec %di + movb $0xe1,%es:0x2000(%di) + movw $0x20,%es:(%di) + jmp putc.move +putc.cr: mov %di,%ax + div %cx + sub %dx,%di + jmp putc.move +putc.lf: add %cx,%di +putc.scr: cmp $(80*2*25),%di /* Scroll screen */ + jb putc.move + push %ds + mov %bx,%ds + mov $(80*2),%si + xor %di,%di + mov $(80*24/2),%cx + rep + movsl + xor %ax,%ax + mov $0x20,%al + mov $80,%cl + rep + stosw + pop %ds + mov $(80*24*2),%di +putc.move: mov %di,MEM_REL+cursor-start /* Move cursor */ + mov $0x13,%ah + mov %di,%dx + int $0x18 + popa + lret + +cursor: .word 0 + +#ifdef SET_MACHINE_TYPE +/* + * Set machine type to PC98_SYSTEM_PARAMETER. + */ +set_machine_type: + xor %edx,%edx + mov %dx,%ds +// mov $MEM_SYS,%ax +// mov %ax,%es + + /* Wait V-SYNC */ +vsync.1: inb $0x60,%al + test $0x20,%al + jnz vsync.1 +vsync.2: inb $0x60,%al + test $0x20,%al + jz vsync.2 + + /* ANK 'A' font */ + xor %al,%al + outb %al,$0xa1 + mov $0x41,%al + outb %al,$0xa3 + + /* Get 'A' font from CG window */ + push %ds + mov $0xa400,%ax + mov %ax,%ds + xor %eax,%eax + xor %bx,%bx + mov $4,%cx +font.1: add (%bx),%eax + add $4,%bx + loop font.1 + pop %ds + cmp $0x6efc58fc,%eax + jnz m_epson + +m_pc98: or $M_NEC_PC98,%edx + mov $0x0458,%bx + mov (%bx),%al + test $0x80,%al + jz m_not_h98 + or $M_H98,%edx + jmp 1f +m_epson: or $M_EPSON_PC98,%edx +m_not_h98: or $M_NOT_H98,%edx + +1: inb $0x42,%al + test $0x20,%al + jz 1f + or $M_8M,%edx + +1: mov $0x0400,%bx + mov (%bx),%al + test $0x80,%al + jz 1f + or $M_NOTE,%edx + +1: mov $PC98_MACHINE_TYPE,%bx + mov %edx,%es:(%bx) + ret +#endif + +/* Messages */ + +msg_eread: .asciz "Error\r\n" + + .org PRT_OFF,0x90 + +/* Partition table */ + + .fill 0x30,0x1,0x0 + .byte 0x80, 0x00, 0x01, 0x00 + .byte 0xa5, 0xff, 0xff, 0xff + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x50, 0xc3, 0x00, 0x00 + + .word 0xaa55 # Magic number Added: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/pc98/boot2/boot2.c Thu Dec 31 15:03:33 2009 (r201342) @@ -0,0 +1,842 @@ +/*- + * Copyright (c) 2008-2009 TAKAHASHI Yoshihiro + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#include "boot2.h" +#include "lib.h" + +#define IO_KEYBOARD 1 +#define IO_SERIAL 2 + +#define SECOND 1 /* Circa that many ticks in a second. */ + +#define RBX_ASKNAME 0x0 /* -a */ +#define RBX_SINGLE 0x1 /* -s */ +/* 0x2 is reserved for log2(RB_NOSYNC). */ +/* 0x3 is reserved for log2(RB_HALT). */ +/* 0x4 is reserved for log2(RB_INITNAME). */ +#define RBX_DFLTROOT 0x5 /* -r */ +#define RBX_KDB 0x6 /* -d */ +/* 0x7 is reserved for log2(RB_RDONLY). */ +/* 0x8 is reserved for log2(RB_DUMP). */ +/* 0x9 is reserved for log2(RB_MINIROOT). */ +#define RBX_CONFIG 0xa /* -c */ +#define RBX_VERBOSE 0xb /* -v */ +#define RBX_SERIAL 0xc /* -h */ +#define RBX_CDROM 0xd /* -C */ +/* 0xe is reserved for log2(RB_POWEROFF). */ +#define RBX_GDB 0xf /* -g */ +#define RBX_MUTE 0x10 /* -m */ +/* 0x11 is reserved for log2(RB_SELFTEST). */ +/* 0x12 is reserved for boot programs. */ +/* 0x13 is reserved for boot programs. */ +#define RBX_PAUSE 0x14 /* -p */ +#define RBX_QUIET 0x15 /* -q */ +#define RBX_NOINTR 0x1c /* -n */ +/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ +#define RBX_DUAL 0x1d /* -D */ +/* 0x1f is reserved for log2(RB_BOOTINFO). */ + +/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ +#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ + OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ + OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ + OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ + OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ + OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) + +#define PATH_CONFIG "/boot.config" +#define PATH_BOOT3 "/boot/loader" +#define PATH_KERNEL "/boot/kernel/kernel" + +#define ARGS 0x900 +#define NOPT 14 +#define NDEV 3 +#define V86_CY(x) ((x) & PSL_C) +#define V86_ZR(x) ((x) & PSL_Z) + +#define DRV_DISK 0xf0 +#define DRV_UNIT 0x0f + +#define TYPE_AD 0 +#define TYPE_DA 1 +#define TYPE_FD 2 + +#define OPT_SET(opt) (1 << (opt)) +#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) + +extern uint32_t _end; + +static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ +static const unsigned char flags[NOPT] = { + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE +}; + +static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; +static const unsigned char dev_maj[NDEV] = {30, 4, 2}; +static const unsigned char dev_daua[NDEV] = {0x80, 0xa0, 0x90}; + +static struct dsk { + unsigned daua; + unsigned type; + unsigned disk; + unsigned unit; + unsigned head; + unsigned sec; + unsigned slice; + unsigned part; + unsigned start; +} dsk; +static char cmd[512], cmddup[512]; +static char kname[1024]; +static uint32_t opts; +static int comspeed = SIOSPD; +static struct bootinfo bootinfo; +static uint8_t ioctrl = IO_KEYBOARD; + +void exit(int); +static void load(void); +static int parse(void); +static int xfsread(ino_t, void *, size_t); +static int dskread(void *, unsigned, unsigned); +static void printf(const char *,...); +static void putchar(int); +static uint32_t memsize(void); +static int drvread(void *, unsigned); +static int keyhit(unsigned); +static int xputc(int); +static int xgetc(int); +static int getc(int); + +static void memcpy(void *, const void *, int); +static void +memcpy(void *dst, const void *src, int len) +{ + const char *s = src; + char *d = dst; + + while (len--) + *d++ = *s++; +} + +static inline int +strcmp(const char *s1, const char *s2) +{ + for (; *s1 == *s2 && *s1; s1++, s2++); + return (unsigned char)*s1 - (unsigned char)*s2; +} + +#define UFS_SMALL_CGBASE +#include "ufsread.c" + +static inline int +xfsread(ino_t inode, void *buf, size_t nbyte) +{ + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return -1; + } + return 0; +} + +static inline uint32_t +memsize(void) +{ + u_char *p = (u_char *)PTOV(0); + + return *(p + 0x401) * 128 * 1024 + *(u_int16_t *)(p + 0x594) * 1024 * 1024; +} + +static inline void +getstr(void) +{ + char *s; + int c; + + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); + } + } +} + +static inline void +putc(int c) +{ + + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = PUTCORG; /* call to putc in boot1 */ + v86.eax = c; + v86int(); + v86.ctl = V86_FLAGS; +} + +static inline int +is_scsi_hd(void) +{ + + if ((*(u_char *)PTOV(0x482) >> dsk.unit) & 0x01) + return 1; + + return 0; +} + +static inline void +fix_sector_size(void) +{ + u_char *p; + + p = (u_char *)PTOV(0x460 + dsk.unit * 4); /* SCSI equipment parameter */ + + if ((p[0] & 0x1f) == 7) { /* SCSI MO */ + if (!(p[3] & 0x30)) { /* 256B / sector */ + p[3] |= 0x10; /* forced set 512B / sector */ + p[3 + 0xa1000] |= 0x10; + } + } +} + +static inline uint32_t +get_diskinfo(void) +{ + + if (dsk.disk == 0x30) { /* 1440KB FD */ + /* 80 cylinders, 2 heads, 18 sectors */ + return (80 << 16) | (2 << 8) | 18; + } else if (dsk.disk == 0x90) { /* 1200KB FD */ + /* 80 cylinders, 2 heads, 15 sectors */ + return (80 << 16) | (2 << 8) | 15; + } else if (dsk.disk == 0x80 || is_scsi_hd()) { /* IDE or SCSI HDD */ + v86.addr = 0x1b; + v86.eax = 0x8400 | dsk.daua; + v86int(); + return (v86.ecx << 16) | v86.edx; + } + + /* SCSI MO or CD */ + fix_sector_size(); /* SCSI MO */ + + /* other SCSI devices */ + return (65535 << 16) | (8 << 8) | 32; +} + +static void +set_dsk(void) +{ + uint32_t di; + + di = get_diskinfo(); + + dsk.head = (di >> 8) & 0xff; + dsk.sec = di & 0xff; + dsk.start = 0; +} + +#ifdef GET_BIOSGEOM +static uint32_t +bd_getbigeom(int bunit) +{ + int hds = 0; + int unit = 0x80; /* IDE HDD */ + u_int addr = 0x55d; + + while (unit < 0xa7) { + if (*(u_char *)PTOV(addr) & (1 << (unit & 0x0f))) + if (hds++ == bunit) + break; + + if (unit >= 0xA0) { + int media = ((unsigned *)PTOV(0x460))[unit & 0x0F] & 0x1F; + + if (media == 7 && hds++ == bunit) /* SCSI MO */ + return(0xFFFE0820); /* C:65535 H:8 S:32 */ + } + if (++unit == 0x84) { + unit = 0xA0; /* SCSI HDD */ + addr = 0x482; + } + } + if (unit == 0xa7) + return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ + v86.addr = 0x1b; + v86.eax = 0x8400 | unit; + v86int(); + if (v86.efl & 0x1) + return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ + return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff); +} +#endif + +static int +check_slice(void) +{ + struct pc98_partition *dp; + char *sec; + unsigned i, cyl; + + sec = dmadat->secbuf; + cyl = *(uint16_t *)PTOV(ARGS); + set_dsk(); + + if (dsk.type == TYPE_FD) + return (WHOLE_DISK_SLICE); + if (drvread(sec, DOSBBSECTOR + 1)) + return (WHOLE_DISK_SLICE); /* Read error */ + dp = (void *)(sec + DOSPARTOFF); + for (i = 0; i < NDOSPART; i++) { + if (dp[i].dp_mid == DOSMID_386BSD) { + if (dp[i].dp_scyl <= cyl && cyl <= dp[i].dp_ecyl) + return (BASE_SLICE + i); + } + } + + return (WHOLE_DISK_SLICE); +} + +int +main(void) +{ +#ifdef GET_BIOSGEOM + int i; +#endif + int autoboot; + ino_t ino; + + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.daua = *(uint8_t *)PTOV(0x584); + dsk.disk = dsk.daua & DRV_DISK; + dsk.unit = dsk.daua & DRV_UNIT; + if (dsk.disk == 0x80) + dsk.type = TYPE_AD; + else if (dsk.disk == 0xa0) + dsk.type = TYPE_DA; + else /* if (dsk.disk == 0x30 || dsk.disk == 0x90) */ + dsk.type = TYPE_FD; + dsk.slice = check_slice(); +#ifdef GET_BIOSGEOM + for (i = 0; i < N_BIOS_GEOM; i++) + bootinfo.bi_bios_geom[i] = bd_getbigeom(i); +#endif + bootinfo.bi_version = BOOTINFO_VERSION; + bootinfo.bi_size = sizeof(bootinfo); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 16:13:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C98E4106566C; Thu, 31 Dec 2009 16:13:33 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B73E38FC08; Thu, 31 Dec 2009 16:13:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVGDXO4043985; Thu, 31 Dec 2009 16:13:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVGDXL8043978; Thu, 31 Dec 2009 16:13:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912311613.nBVGDXL8043978@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 31 Dec 2009 16:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201343 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 16:13:33 -0000 Author: jilles Date: Thu Dec 31 16:13:33 2009 New Revision: 201343 URL: http://svn.freebsd.org/changeset/base/201343 Log: sh: Allow command -pv and command -pV (lookup using _PATH_STDPATH). Added: head/tools/regression/bin/sh/builtins/command6.0 (contents, props changed) head/tools/regression/bin/sh/builtins/command6.0.stdout (contents, props changed) head/tools/regression/bin/sh/builtins/command7.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/exec.c head/bin/sh/exec.h Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Thu Dec 31 15:03:33 2009 (r201342) +++ head/bin/sh/eval.c Thu Dec 31 16:13:33 2009 (r201343) @@ -1023,7 +1023,7 @@ commandcmd(int argc, char **argv) if (cmd != -1) { if (argc != 1) error("wrong number of arguments"); - return typecmd_impl(2, argv - 1, cmd); + return typecmd_impl(2, argv - 1, cmd, path); } if (argc != 0) { old = handler; Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Thu Dec 31 15:03:33 2009 (r201342) +++ head/bin/sh/exec.c Thu Dec 31 16:13:33 2009 (r201343) @@ -720,7 +720,7 @@ unsetfunc(const char *name) */ int -typecmd_impl(int argc, char **argv, int cmd) +typecmd_impl(int argc, char **argv, int cmd, const char *path) { struct cmdentry entry; struct tblentry *cmdp; @@ -729,6 +729,9 @@ typecmd_impl(int argc, char **argv, int int i; int error1 = 0; + if (path != pathval()) + clearcmdentry(0); + for (i = 1; i < argc; i++) { /* First look at the keywords */ for (pp = parsekwd; *pp; pp++) @@ -761,17 +764,17 @@ typecmd_impl(int argc, char **argv, int } else { /* Finally use brute force */ - find_command(argv[i], &entry, 0, pathval()); + find_command(argv[i], &entry, 0, path); } switch (entry.cmdtype) { case CMDNORMAL: { if (strchr(argv[i], '/') == NULL) { - const char *path = pathval(); + const char *path2 = path; char *name; int j = entry.u.index; do { - name = padvance(&path, argv[i]); + name = padvance(&path2, argv[i]); stunalloc(name); } while (--j >= 0); if (cmd == TYPECMD_SMALLV) @@ -821,6 +824,10 @@ typecmd_impl(int argc, char **argv, int break; } } + + if (path != pathval()) + clearcmdentry(0); + return error1; } @@ -831,5 +838,5 @@ typecmd_impl(int argc, char **argv, int int typecmd(int argc, char **argv) { - return typecmd_impl(argc, argv, TYPECMD_TYPE); + return typecmd_impl(argc, argv, TYPECMD_TYPE, pathval()); } Modified: head/bin/sh/exec.h ============================================================================== --- head/bin/sh/exec.h Thu Dec 31 15:03:33 2009 (r201342) +++ head/bin/sh/exec.h Thu Dec 31 16:13:33 2009 (r201343) @@ -71,6 +71,6 @@ void deletefuncs(void); void addcmdentry(const char *, struct cmdentry *); void defun(const char *, union node *); int unsetfunc(const char *); -int typecmd_impl(int, char **, int); +int typecmd_impl(int, char **, int, const char *); int typecmd(int, char **); void clearcmdentry(int); Added: head/tools/regression/bin/sh/builtins/command6.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/command6.0 Thu Dec 31 16:13:33 2009 (r201343) @@ -0,0 +1,15 @@ +# $FreeBSD$ +PATH=/var/empty +command -pV ls +command -pV true +command -pV /bin/ls + +fun() { +} +command -pV fun +command -pV break +command -pV if +command -pV { + +alias foo=bar +command -pV foo Added: head/tools/regression/bin/sh/builtins/command6.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/command6.0.stdout Thu Dec 31 16:13:33 2009 (r201343) @@ -0,0 +1,8 @@ +ls is /bin/ls +true is a shell builtin +/bin/ls is /bin/ls +fun is a shell function +break is a special shell builtin +if is a shell keyword +{ is a shell keyword +foo is an alias for bar Added: head/tools/regression/bin/sh/builtins/command7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/command7.0 Thu Dec 31 16:13:33 2009 (r201343) @@ -0,0 +1,29 @@ +# $FreeBSD$ + +failures=0 + +check() { + if ! eval "[ $* ]"; then + echo "Failed: $*" + : $((failures += 1)) + fi +} + +check '"$(PATH=/libexec command -V ld-elf.so.1)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"' +check '"$(PATH=/libexec command -V ld-elf.so.1; :)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"' +check '"$(PATH=/libexec command -pv ld-elf.so.1)" = ""' +check '"$(PATH=/libexec command -pv ld-elf.so.1; :)" = ""' + +PATH=/libexec:$PATH + +check '"$(command -V ld-elf.so.1)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"' +check '"$(command -V ld-elf.so.1; :)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"' +check '"$(command -pv ld-elf.so.1)" = ""' +check '"$(command -pv ld-elf.so.1; :)" = ""' + +PATH=/libexec + +check '"$(command -v ls)" = ""' +check '"$(command -pv ls)" = "/bin/ls"' + +exit $((failures > 0)) From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 17:44:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CF87106566B; Thu, 31 Dec 2009 17:44:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69FE68FC15; Thu, 31 Dec 2009 17:44:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVHiO27063855; Thu, 31 Dec 2009 17:44:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVHiOFx063853; Thu, 31 Dec 2009 17:44:24 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912311744.nBVHiOFx063853@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 31 Dec 2009 17:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201344 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 17:44:24 -0000 Author: jilles Date: Thu Dec 31 17:44:24 2009 New Revision: 201344 URL: http://svn.freebsd.org/changeset/base/201344 Log: sh: Use PATH= assignment in type. Example: PATH=/var/empty; PATH=/bin type ls Added: head/tools/regression/bin/sh/builtins/type2.0 (contents, props changed) Modified: head/bin/sh/exec.c Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Thu Dec 31 16:13:33 2009 (r201343) +++ head/bin/sh/exec.c Thu Dec 31 17:44:24 2009 (r201344) @@ -838,5 +838,5 @@ typecmd_impl(int argc, char **argv, int int typecmd(int argc, char **argv) { - return typecmd_impl(argc, argv, TYPECMD_TYPE, pathval()); + return typecmd_impl(argc, argv, TYPECMD_TYPE, bltinlookup("PATH", 1)); } Added: head/tools/regression/bin/sh/builtins/type2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/type2.0 Thu Dec 31 17:44:24 2009 (r201344) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +failures=0 + +check() { + if ! eval "$*"; then + echo "Failed: $*" + : $((failures += 1)) + fi +} + +check 'PATH=/libexec type ld-elf.so.1 >/dev/null' +check '! PATH=/libexec type ls 2>/dev/null' + +PATH=/libexec:$PATH + +check 'type ld-elf.so.1 >/dev/null' + +PATH=/libexec + +check 'type ld-elf.so.1 >/dev/null' +check '! type ls 2>/dev/null' +check 'PATH=/bin type ls >/dev/null' +check '! PATH=/bin type ld-elf.so.1 2>/dev/null' + +exit $((failures > 0)) From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 18:02:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 964DE1065672; Thu, 31 Dec 2009 18:02:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8395C8FC12; Thu, 31 Dec 2009 18:02:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVI2mWW067947; Thu, 31 Dec 2009 18:02:48 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVI2mPk067944; Thu, 31 Dec 2009 18:02:48 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200912311802.nBVI2mPk067944@svn.freebsd.org> From: Rick Macklem Date: Thu, 31 Dec 2009 18:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201345 - head/sys/fs/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 18:02:48 -0000 Author: rmacklem Date: Thu Dec 31 18:02:48 2009 New Revision: 201345 URL: http://svn.freebsd.org/changeset/base/201345 Log: Fix the experimental NFS client so that it can create Unix domain sockets on an NFSv4 mount point. It was generating incorrect XDR in the request for this case. Tested by: infofarmer MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Thu Dec 31 17:44:24 2009 (r201344) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Thu Dec 31 18:02:48 2009 (r201345) @@ -1626,10 +1626,15 @@ nfsrpc_mknod(vnode_t dvp, char *name, in return (ENAMETOOLONG); NFSCL_REQSTART(nd, NFSPROC_MKNOD, dvp); if (nd->nd_flag & ND_NFSV4) { - NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); - *tl++ = vtonfsv34_type(vtyp); - *tl++ = txdr_unsigned(NFSMAJOR(rdev)); - *tl = txdr_unsigned(NFSMINOR(rdev)); + if (vtyp == VBLK || vtyp == VCHR) { + NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); + *tl++ = vtonfsv34_type(vtyp); + *tl++ = txdr_unsigned(NFSMAJOR(rdev)); + *tl = txdr_unsigned(NFSMINOR(rdev)); + } else { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = vtonfsv34_type(vtyp); + } } (void) nfsm_strtom(nd, name, namelen); if (nd->nd_flag & ND_NFSV3) { From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 18:52:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 339AF106566B; Thu, 31 Dec 2009 18:52:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 210E58FC15; Thu, 31 Dec 2009 18:52:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVIqxSs078988; Thu, 31 Dec 2009 18:52:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVIqxrV078985; Thu, 31 Dec 2009 18:52:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912311852.nBVIqxrV078985@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 31 Dec 2009 18:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201347 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 18:52:59 -0000 Author: kib Date: Thu Dec 31 18:52:58 2009 New Revision: 201347 URL: http://svn.freebsd.org/changeset/base/201347 Log: Allow swap out of the kernel stack for the thread with priority greater or equial then PSOCK, not less or equial. Higher priority has lesser numerical value. Existing test does not allow for swapout of the thread waiting for advisory lock, for exiting child or sleeping for timeout. On the other hand, high-priority waiters of VFS/VM events can be swapped out. Tested by: pho Reviewed by: jhb MFC after: 1 week Modified: head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Thu Dec 31 18:28:40 2009 (r201346) +++ head/sys/kern/sched_4bsd.c Thu Dec 31 18:52:58 2009 (r201347) @@ -913,7 +913,7 @@ sched_sleep(struct thread *td, int pri) td->td_sched->ts_slptime = 0; if (pri) sched_prio(td, pri); - if (TD_IS_SUSPENDED(td) || pri <= PSOCK) + if (TD_IS_SUSPENDED(td) || pri >= PSOCK) td->td_flags |= TDF_CANSWAP; } Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Dec 31 18:28:40 2009 (r201346) +++ head/sys/kern/sched_ule.c Thu Dec 31 18:52:58 2009 (r201347) @@ -1909,7 +1909,7 @@ sched_sleep(struct thread *td, int prio) THREAD_LOCK_ASSERT(td, MA_OWNED); td->td_slptick = ticks; - if (TD_IS_SUSPENDED(td) || prio <= PSOCK) + if (TD_IS_SUSPENDED(td) || prio >= PSOCK) td->td_flags |= TDF_CANSWAP; if (static_boost == 1 && prio) sched_prio(td, prio); From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 19:36:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BCFD1065676; Thu, 31 Dec 2009 19:36:51 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A2308FC1C; Thu, 31 Dec 2009 19:36:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVJapb5088608; Thu, 31 Dec 2009 19:36:51 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVJapTu088606; Thu, 31 Dec 2009 19:36:51 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200912311936.nBVJapTu088606@svn.freebsd.org> From: Maxim Konovalov Date: Thu, 31 Dec 2009 19:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201348 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 19:36:51 -0000 Author: maxim Date: Thu Dec 31 19:36:51 2009 New Revision: 201348 URL: http://svn.freebsd.org/changeset/base/201348 Log: o Correct URL to announcements collection. PR: docs/142204 Submitted by: Jason Helfman MFC after: 1 week Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Thu Dec 31 18:52:58 2009 (r201347) +++ head/share/misc/bsd-family-tree Thu Dec 31 19:36:51 2009 (r201348) @@ -543,7 +543,7 @@ Andreas Klemm, Lars Köller. If you're go Die freien BSD-Varianten von Unix. c't April 1997, page 368ff. BSD Release Announcements collection. -URL: http://www.de.FreeBSD.org/de/ftp/releases/ +URL: http://www.FreeBSD.org/releases/ BSD Hypertext Man Pages URL: http://www.FreeBSD.org/cgi/man.cgi From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 19:40:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C10511065670; Thu, 31 Dec 2009 19:40:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 967B78FC0C; Thu, 31 Dec 2009 19:40:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVJepLW089504; Thu, 31 Dec 2009 19:40:51 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVJepke089503; Thu, 31 Dec 2009 19:40:51 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200912311940.nBVJepke089503@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Dec 2009 19:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201349 - head/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 19:40:51 -0000 Author: brooks Date: Thu Dec 31 19:40:51 2009 New Revision: 201349 URL: http://svn.freebsd.org/changeset/base/201349 Log: Ignore .glimpse_* files as generated by the glimpse target. Also ignore cscope.* files. Modified: Directory Properties: head/sys/ (props changed) From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 20:29:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B4301065694; Thu, 31 Dec 2009 20:29:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 381E88FC17; Thu, 31 Dec 2009 20:29:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVKTxNe000514; Thu, 31 Dec 2009 20:29:59 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVKTxmd000506; Thu, 31 Dec 2009 20:29:59 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200912312029.nBVKTxmd000506@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Dec 2009 20:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201350 - in head: lib/libc/sys sys/kern sys/net sys/sys tools/regression/fifo/fifo_misc usr.bin/truss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 20:29:59 -0000 Author: brooks Date: Thu Dec 31 20:29:58 2009 New Revision: 201350 URL: http://svn.freebsd.org/changeset/base/201350 Log: The devices that supported EVFILT_NETDEV kqueue filters were removed in r195175. Remove all definitions, documentation, and usage. fifo_misc.c: Remove all kqueue tests as fifo_io.c performs all those that would have remained. Reviewed by: rwatson MFC after: 3 weeks X-MFC note: don't change vlan_link_state() function signature Modified: head/lib/libc/sys/kqueue.2 head/sys/kern/kern_event.c head/sys/net/if.c head/sys/net/if_vlan.c head/sys/sys/event.h head/tools/regression/fifo/fifo_misc/fifo_misc.c head/usr.bin/truss/syscalls.c Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Thu Dec 31 19:40:51 2009 (r201349) +++ head/lib/libc/sys/kqueue.2 Thu Dec 31 20:29:58 2009 (r201350) @@ -438,19 +438,6 @@ There is a system wide limit on the numb which is controlled by the .Va kern.kq_calloutmax sysctl. -.It Dv EVFILT_NETDEV -Takes a descriptor to a network interface as the identifier, and the events to watch for in -.Va fflags . -It returns, when one or more of the requested events occur on the descriptor. -The events to monitor are: -.Bl -tag -width XXNOTE_LINKDOWN -.It Dv NOTE_LINKUP -The link is up. -.It Dv NOTE_LINKDOWN -The link is down. -.It Dv NOTE_LINKINV -The link state is invalid. -.El .Pp On return, .Va fflags @@ -595,13 +582,6 @@ system and this manual page were written .An Jonathan Lemon Aq jlemon@FreeBSD.org . .Sh BUGS The -.Dv EVFILT_NETDEV -filter is currently only implemented for devices that use the -.Xr miibus 4 -driver for LINKUP and LINKDOWN operations. -Therefore, it will not work with many non-ethernet devices. -.Pp -The .Fa timeout value is limited to 24 hours; longer timeouts will be silently reinterpreted as 24 hours. Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Dec 31 19:40:51 2009 (r201349) +++ head/sys/kern/kern_event.c Thu Dec 31 20:29:58 2009 (r201350) @@ -279,7 +279,7 @@ static struct { { &proc_filtops }, /* EVFILT_PROC */ { &sig_filtops }, /* EVFILT_SIGNAL */ { &timer_filtops }, /* EVFILT_TIMER */ - { &file_filtops }, /* EVFILT_NETDEV */ + { &null_filtops }, /* former EVFILT_NETDEV */ { &fs_filtops }, /* EVFILT_FS */ { &null_filtops }, /* EVFILT_LIO */ { &user_filtops }, /* EVFILT_USER */ Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Dec 31 19:40:51 2009 (r201349) +++ head/sys/net/if.c Thu Dec 31 20:29:58 2009 (r201350) @@ -1819,7 +1819,7 @@ if_route(struct ifnet *ifp, int flag, in #endif } -void (*vlan_link_state_p)(struct ifnet *, int); /* XXX: private from if_vlan */ +void (*vlan_link_state_p)(struct ifnet *); /* XXX: private from if_vlan */ void (*vlan_trunk_cap_p)(struct ifnet *); /* XXX: private from if_vlan */ /* @@ -1845,19 +1845,12 @@ do_link_state_change(void *arg, int pend { struct ifnet *ifp = (struct ifnet *)arg; int link_state = ifp->if_link_state; - int link; CURVNET_SET(ifp->if_vnet); /* Notify that the link state has changed. */ rt_ifmsg(ifp); - if (link_state == LINK_STATE_UP) - link = NOTE_LINKUP; - else if (link_state == LINK_STATE_DOWN) - link = NOTE_LINKDOWN; - else - link = NOTE_LINKINV; if (ifp->if_vlantrunk != NULL) - (*vlan_link_state_p)(ifp, link); + (*vlan_link_state_p)(ifp); if ((ifp->if_type == IFT_ETHER || ifp->if_type == IFT_L2VLAN) && IFP2AC(ifp)->ac_netgraph != NULL) Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Dec 31 19:40:51 2009 (r201349) +++ head/sys/net/if_vlan.c Thu Dec 31 20:29:58 2009 (r201350) @@ -188,7 +188,7 @@ static int vlan_setmulti(struct ifnet *i static int vlan_unconfig(struct ifnet *ifp); static int vlan_unconfig_locked(struct ifnet *ifp); static int vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag); -static void vlan_link_state(struct ifnet *ifp, int link); +static void vlan_link_state(struct ifnet *ifp); static void vlan_capabilities(struct ifvlan *ifv); static void vlan_trunk_capabilities(struct ifnet *ifp); @@ -525,7 +525,7 @@ restart: extern void (*vlan_input_p)(struct ifnet *, struct mbuf *); /* For if_link_state_change() eyes only... */ -extern void (*vlan_link_state_p)(struct ifnet *, int); +extern void (*vlan_link_state_p)(struct ifnet *); static int vlan_modevent(module_t mod, int type, void *data) @@ -1231,7 +1231,7 @@ vlan_setflags(struct ifnet *ifp, int sta /* Inform all vlans that their parent has changed link state */ static void -vlan_link_state(struct ifnet *ifp, int link) +vlan_link_state(struct ifnet *ifp) { struct ifvlantrunk *trunk = ifp->if_vlantrunk; struct ifvlan *ifv; Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Thu Dec 31 19:40:51 2009 (r201349) +++ head/sys/sys/event.h Thu Dec 31 20:29:58 2009 (r201350) @@ -38,7 +38,7 @@ #define EVFILT_PROC (-5) /* attached to struct proc */ #define EVFILT_SIGNAL (-6) /* attached to struct proc */ #define EVFILT_TIMER (-7) /* timers */ -#define EVFILT_NETDEV (-8) /* network devices */ +/* EVFILT_NETDEV (-8) no longer supported */ #define EVFILT_FS (-9) /* filesystem events */ #define EVFILT_LIO (-10) /* attached to lio requests */ #define EVFILT_USER (-11) /* User events */ @@ -131,13 +131,6 @@ struct kevent { #define NOTE_TRACKERR 0x00000002 /* could not track child */ #define NOTE_CHILD 0x00000004 /* am a child process */ -/* - * data/hint flags for EVFILT_NETDEV, shared with userspace - */ -#define NOTE_LINKUP 0x0001 /* link is up */ -#define NOTE_LINKDOWN 0x0002 /* link is down */ -#define NOTE_LINKINV 0x0004 /* link state is invalid */ - struct knote; SLIST_HEAD(klist, knote); struct kqueue; Modified: head/tools/regression/fifo/fifo_misc/fifo_misc.c ============================================================================== --- head/tools/regression/fifo/fifo_misc/fifo_misc.c Thu Dec 31 19:40:51 2009 (r201349) +++ head/tools/regression/fifo/fifo_misc/fifo_misc.c Thu Dec 31 20:29:58 2009 (r201350) @@ -148,114 +148,6 @@ test_truncate(void) cleanfifo("testfifo", -1, -1); } -struct filter_entry { - int fe_filter; - const char *fe_name; - int fe_error; - const char *fe_errorname; -}; - -static const struct filter_entry good_filter_types[] = { - { EVFILT_READ, "EVFILT_READ", 0, "0" }, - { EVFILT_WRITE, "EVFILT_WRITE", 0, "0" }, -#if WORKING_EVFILT_VNODE_ON_FIFOS - { EVFILT_VNODE, "EVFILT_VNODE", EINVAL, "EINVAL" }, -#endif -}; -static const int good_filter_types_len = sizeof(good_filter_types) / - sizeof(good_filter_types[0]); - -static const struct filter_entry bad_filter_types[] = { - { EVFILT_NETDEV, "EVFILT_NETDEV", EINVAL, "EINVAL" }, -}; -static const int bad_filter_types_len = sizeof(bad_filter_types) / - sizeof(bad_filter_types[0]); - -/* - * kqueue event-related tests are in fifo_io.c; however, that tests only - * valid invocations of kqueue. Check to make sure that some invalid filters - * that are generally allowed on file descriptors are not allowed to be - * registered with kqueue, and that if attempts are made, we get the right - * error. - */ -static void -test_kqueue(void) -{ - int kqueue_fd, reader_fd, writer_fd; - struct kevent kev_set; - struct timespec timeout; - int i, ret; - - makefifo("testfifo", __func__); - - if (openfifo("testfifo", __func__, &reader_fd, &writer_fd) < 0) { - warn("%s: openfifo", __func__); - cleanfifo("testfifo", -1, -1); - exit(-1); - } - - kqueue_fd = kqueue(); - if (kqueue_fd < 0) { - warn("%s: kqueue", __func__); - cleanfifo("testfifo", reader_fd, writer_fd); - exit(-1); - } - - timeout.tv_sec = 0; - timeout.tv_nsec = 0; - - for (i = 0; i < good_filter_types_len; i++) { - bzero(&kev_set, sizeof(kev_set)); - EV_SET(&kev_set, reader_fd, good_filter_types[i].fe_filter, - EV_ADD, 0, 0, 0); - ret = kevent(kqueue_fd, &kev_set, 1, NULL, 0, &timeout); - if (ret < 0) { - warn("%s: kevent: adding good filter %s", __func__, - good_filter_types[i].fe_name); - close(kqueue_fd); - cleanfifo("testfifo", reader_fd, writer_fd); - exit(-1); - } - bzero(&kev_set, sizeof(kev_set)); - EV_SET(&kev_set, reader_fd, good_filter_types[i].fe_filter, - EV_DELETE, 0, 0, 0); - ret = kevent(kqueue_fd, &kev_set, 1, NULL, 0, &timeout); - if (ret < 0) { - warn("%s: kevent: deleting good filter %s", __func__, - good_filter_types[i].fe_name); - close(kqueue_fd); - cleanfifo("testfifo", reader_fd, writer_fd); - exit(-1); - } - } - - for (i = 0; i < bad_filter_types_len; i++) { - bzero(&kev_set, sizeof(kev_set)); - EV_SET(&kev_set, reader_fd, bad_filter_types[i].fe_filter, - EV_ADD, 0, 0, 0); - ret = kevent(kqueue_fd, &kev_set, 1, NULL, 0, &timeout); - if (ret >= 0) { - warnx("%s: kevent: bad filter %s succeeded, expected " - "EINVAL", __func__, bad_filter_types[i].fe_name); - close(kqueue_fd); - cleanfifo("testfifo", reader_fd, writer_fd); - exit(-1); - } - if (errno != bad_filter_types[i].fe_error) { - warn("%s: kevent: bad filter %s failed with error " - "not %s", __func__, - bad_filter_types[i].fe_name, - bad_filter_types[i].fe_errorname); - close(kqueue_fd); - cleanfifo("testfifo", reader_fd, writer_fd); - exit(-1); - } - } - - close(kqueue_fd); - cleanfifo("testfifo", reader_fd, writer_fd); -} - static int test_ioctl_setclearflag(int fd, int flag, const char *testname, const char *fdname, const char *flagname) @@ -345,7 +237,6 @@ main(int argc, char *argv[]) test_lseek(); test_truncate(); - test_kqueue(); test_ioctl(); return (0); Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Dec 31 19:40:51 2009 (r201349) +++ head/usr.bin/truss/syscalls.c Thu Dec 31 20:29:58 2009 (r201350) @@ -275,7 +275,7 @@ struct xlat { static struct xlat kevent_filters[] = { X(EVFILT_READ) X(EVFILT_WRITE) X(EVFILT_AIO) X(EVFILT_VNODE) X(EVFILT_PROC) X(EVFILT_SIGNAL) X(EVFILT_TIMER) - X(EVFILT_NETDEV) X(EVFILT_FS) X(EVFILT_READ) XEND + X(EVFILT_FS) X(EVFILT_READ) XEND }; static struct xlat kevent_flags[] = { From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 20:44:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F3C5106568B; Thu, 31 Dec 2009 20:44:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F36FB8FC0C; Thu, 31 Dec 2009 20:44:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVKicZa003817; Thu, 31 Dec 2009 20:44:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVKicMb003815; Thu, 31 Dec 2009 20:44:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912312044.nBVKicMb003815@svn.freebsd.org> From: John Baldwin Date: Thu, 31 Dec 2009 20:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201351 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 20:44:39 -0000 Author: jhb Date: Thu Dec 31 20:44:38 2009 New Revision: 201351 URL: http://svn.freebsd.org/changeset/base/201351 Log: Use stricter checking to match possible vlan clones by not allowing extra garbage characters around or within the tag. Reviewed by: brooks MFC after: 3 days Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Dec 31 20:29:58 2009 (r201350) +++ head/sys/net/if_vlan.c Thu Dec 31 20:44:38 2009 (r201351) @@ -582,7 +582,7 @@ vlan_clone_match_ethertag(struct if_clon { const char *cp; struct ifnet *ifp; - int t = 0; + int t; /* Check for . style interface names. */ IFNET_RLOCK_NOSLEEP(); @@ -592,13 +592,15 @@ vlan_clone_match_ethertag(struct if_clon if (strncmp(ifp->if_xname, name, strlen(ifp->if_xname)) != 0) continue; cp = name + strlen(ifp->if_xname); - if (*cp != '.') + if (*cp++ != '.') continue; - for(; *cp != '\0'; cp++) { - if (*cp < '0' || *cp > '9') - continue; + if (*cp == '\0') + continue; + t = 0; + for(; *cp >= '0' && *cp <= '9'; cp++) t = (t * 10) + (*cp - '0'); - } + if (*cp != '\0') + continue; if (tag != NULL) *tag = t; break; From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 20:55:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F1C81065695; Thu, 31 Dec 2009 20:55:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 634A08FC15; Thu, 31 Dec 2009 20:55:58 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id E22F246B17; Thu, 31 Dec 2009 15:55:57 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 6DB688A01B; Thu, 31 Dec 2009 15:55:45 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Date: Thu, 31 Dec 2009 15:47:54 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912312044.nBVKicMb003815@svn.freebsd.org> In-Reply-To: <200912312044.nBVKicMb003815@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912311547.54045.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 31 Dec 2009 15:55:45 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r201351 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 20:55:58 -0000 On Thursday 31 December 2009 3:44:38 pm John Baldwin wrote: > Author: jhb > Date: Thu Dec 31 20:44:38 2009 > New Revision: 201351 > URL: http://svn.freebsd.org/changeset/base/201351 > > Log: > Use stricter checking to match possible vlan clones by not allowing extra > garbage characters around or within the tag. Previously some odd clone requests such as 'em0.102a', 'em0.10a3bc', and 'em0.foo.104' would have succeeded creating interfaces equivalent to em0.102, em0.103, and em0.104. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 20:56:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBB921065670; Thu, 31 Dec 2009 20:56:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBEC78FC20; Thu, 31 Dec 2009 20:56:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVKuSZ4006453; Thu, 31 Dec 2009 20:56:28 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVKuSDS006451; Thu, 31 Dec 2009 20:56:28 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200912312056.nBVKuSDS006451@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Dec 2009 20:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201352 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 20:56:29 -0000 Author: brooks Date: Thu Dec 31 20:56:28 2009 New Revision: 201352 URL: http://svn.freebsd.org/changeset/base/201352 Log: If a filter has already been added, actually return EEXIST when trying at add it again. MFC after: 1 week Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Dec 31 20:44:38 2009 (r201351) +++ head/sys/kern/kern_event.c Thu Dec 31 20:56:28 2009 (r201352) @@ -867,6 +867,7 @@ kqueue_add_filteropts(int filt, struct f { int error; + error = 0; if (filt > 0 || filt + EVFILT_SYSCOUNT < 0) { printf( "trying to add a filterop that is out of range: %d is beyond %d\n", @@ -883,7 +884,7 @@ kqueue_add_filteropts(int filt, struct f } mtx_unlock(&filterops_lock); - return (0); + return (error); } int From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 22:01:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CAB5106566C; Thu, 31 Dec 2009 22:01:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D6A38FC1A; Thu, 31 Dec 2009 22:01:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVM1Hjs020708; Thu, 31 Dec 2009 22:01:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVM1Hmu020706; Thu, 31 Dec 2009 22:01:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912312201.nBVM1Hmu020706@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 31 Dec 2009 22:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201354 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 22:01:18 -0000 Author: jilles Date: Thu Dec 31 22:01:17 2009 New Revision: 201354 URL: http://svn.freebsd.org/changeset/base/201354 Log: sh(1): Correct two places where "$@" lacked necessary quotes. MFC after: 1 week Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Thu Dec 31 21:08:13 2009 (r201353) +++ head/bin/sh/sh.1 Thu Dec 31 22:01:17 2009 (r201354) @@ -865,7 +865,7 @@ command is: If .Ic in and the following words are omitted, -.Ic in Li $@ +.Ic in Li \&"$@\&" is used instead. The words are expanded, and then the list is executed repeatedly with the variable set to each word in turn. @@ -1080,7 +1080,7 @@ and is .Dq Li "def ghi" , then -.Dq Li $@ +.Li \&"$@\&" expands to the two arguments: .Bd -literal -offset indent From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 22:22:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C09E51065695; Thu, 31 Dec 2009 22:22:48 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: from exhub015-1.exch015.msoutlookonline.net (exhub015-1.exch015.msoutlookonline.net [207.5.72.93]) by mx1.freebsd.org (Postfix) with ESMTP id A9F2D8FC14; Thu, 31 Dec 2009 22:22:48 +0000 (UTC) Received: from philip.hq.rws (174.79.184.239) by smtpx15.msoutlookonline.net (207.5.72.103) with Microsoft SMTP Server (TLS) id 8.2.176.0; Thu, 31 Dec 2009 14:12:42 -0800 Message-ID: <4B3D21D8.5030301@p6m7g8.com> Date: Thu, 31 Dec 2009 22:12:40 +0000 From: "Philip M. Gollucci" Organization: P6M7G8 Inc. User-Agent: Thunderbird 2.0.0.23 (X11/20091208) MIME-Version: 1.0 To: Xin LI References: <200912282215.nBSMFCw3002728@svn.freebsd.org> In-Reply-To: <200912282215.nBSMFCw3002728@svn.freebsd.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201143 - in head: cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolar... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 22:22:48 -0000 Question, So this is not like when we went from v6 to v13 and you had to do both installkernel + installworld for zfs to re-initialize correctly on the next reboot ? If it is its a pretty big issue for people with ZFSROOT or zfs only systems as it forces them to get the kernel right on the 1st go b/c our loader can't boot off of snapshots (like sun). In that case, I (non src/ person) object to any mfc, it its not the case, excellent! Xin LI wrote: > Author: delphij > Date: Mon Dec 28 22:15:11 2009 > New Revision: 201143 > URL: http://svn.freebsd.org/changeset/base/201143 > > Log: > Apply OpenSolaris revision 8012 which brings our zpool to version 14, > making it possible for zpools created on OpenSolaris 2009.06 be used > on FreeBSD. > > PR: kern/141800 > Submitted by: mm > Reviewed by: pjd, trasz > Obtained from: OpenSolaris > MFC after: 2 weeks > > Modified: > head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c > head/sys/cddl/boot/zfs/zfsimpl.h > head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h > > Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Dec 28 22:14:49 2009 (r201142) > +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Dec 28 22:15:11 2009 (r201143) > @@ -3488,6 +3488,8 @@ zpool_do_upgrade(int argc, char **argv) > (void) printf(gettext(" 11 Improved scrub performance\n")); > (void) printf(gettext(" 12 Snapshot properties\n")); > (void) printf(gettext(" 13 snapused property\n")); > + (void) printf(gettext(" 14 passthrough-x aclinherit " > + "support\n")); > (void) printf(gettext("For more information on a particular " > "version, including supported releases, see:\n\n")); > (void) printf("http://www.opensolaris.org/os/community/zfs/" > > Modified: head/sys/cddl/boot/zfs/zfsimpl.h > ============================================================================== > --- head/sys/cddl/boot/zfs/zfsimpl.h Mon Dec 28 22:14:49 2009 (r201142) > +++ head/sys/cddl/boot/zfs/zfsimpl.h Mon Dec 28 22:15:11 2009 (r201143) > @@ -479,13 +479,14 @@ typedef enum { > #define SPA_VERSION_11 11ULL > #define SPA_VERSION_12 12ULL > #define SPA_VERSION_13 13ULL > +#define SPA_VERSION_14 14ULL > /* > * When bumping up SPA_VERSION, make sure GRUB ZFS understand the on-disk > * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*}, > * and do the appropriate changes. > */ > -#define SPA_VERSION SPA_VERSION_13 > -#define SPA_VERSION_STRING "13" > +#define SPA_VERSION SPA_VERSION_14 > +#define SPA_VERSION_STRING "14" > > /* > * Symbolic names for the changes that caused a SPA_VERSION switch. > @@ -520,6 +521,7 @@ typedef enum { > #define SPA_VERSION_DSL_SCRUB SPA_VERSION_11 > #define SPA_VERSION_SNAP_PROPS SPA_VERSION_12 > #define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13 > +#define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14 > > /* > * The following are configuration names used in the nvlist describing a pool's > > Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Dec 28 22:14:49 2009 (r201142) > +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Dec 28 22:15:11 2009 (r201143) > @@ -97,6 +97,7 @@ zfs_prop_init(void) > { "restricted", ZFS_ACL_RESTRICTED }, > { "passthrough", ZFS_ACL_PASSTHROUGH }, > { "secure", ZFS_ACL_RESTRICTED }, /* bkwrd compatability */ > + { "passthrough-x", ZFS_ACL_PASSTHROUGH_X }, > { NULL } > }; > > @@ -173,7 +174,7 @@ zfs_prop_init(void) > "discard | groupmask | passthrough", "ACLMODE", acl_mode_table); > register_index(ZFS_PROP_ACLINHERIT, "aclinherit", ZFS_ACL_RESTRICTED, > PROP_INHERIT, ZFS_TYPE_FILESYSTEM, > - "discard | noallow | restricted | passthrough", > + "discard | noallow | restricted | passthrough | passthrough-x", > "ACLINHERIT", acl_inherit_table); > register_index(ZFS_PROP_COPIES, "copies", 1, > PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Mon Dec 28 22:14:49 2009 (r201142) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Mon Dec 28 22:15:11 2009 (r201143) > @@ -26,8 +26,6 @@ > #ifndef _SYS_FS_ZFS_ACL_H > #define _SYS_FS_ZFS_ACL_H > > -#pragma ident "%Z%%M% %I% %E% SMI" > - > #ifdef _KERNEL > #include > #endif > @@ -180,6 +178,7 @@ typedef struct zfs_acl { > #define ZFS_ACL_GROUPMASK 2 > #define ZFS_ACL_PASSTHROUGH 3 > #define ZFS_ACL_RESTRICTED 4 > +#define ZFS_ACL_PASSTHROUGH_X 5 > > struct znode; > struct zfsvfs; > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Dec 28 22:14:49 2009 (r201142) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Dec 28 22:15:11 2009 (r201143) > @@ -1663,7 +1663,8 @@ zfs_ace_can_use(znode_t *zp, uint16_t ac > * inherit inheritable ACEs from parent > */ > static zfs_acl_t * > -zfs_acl_inherit(znode_t *zp, zfs_acl_t *paclp, boolean_t *need_chmod) > +zfs_acl_inherit(znode_t *zp, zfs_acl_t *paclp, uint64_t mode, > + boolean_t *need_chmod) > { > zfsvfs_t *zfsvfs = zp->z_zfsvfs; > void *pacep; > @@ -1676,112 +1677,123 @@ zfs_acl_inherit(znode_t *zp, zfs_acl_t * > size_t ace_size; > void *data1, *data2; > size_t data1sz, data2sz; > - enum vtype vntype = ZTOV(zp)->v_type; > + boolean_t vdir = ZTOV(zp)->v_type == VDIR; > + boolean_t vreg = ZTOV(zp)->v_type == VREG; > + boolean_t passthrough, passthrough_x, noallow; > + > + passthrough_x = > + zfsvfs->z_acl_inherit == ZFS_ACL_PASSTHROUGH_X; > + passthrough = passthrough_x || > + zfsvfs->z_acl_inherit == ZFS_ACL_PASSTHROUGH; > + noallow = > + zfsvfs->z_acl_inherit == ZFS_ACL_NOALLOW; > > *need_chmod = B_TRUE; > pacep = NULL; > aclp = zfs_acl_alloc(paclp->z_version); > - if (zfsvfs->z_acl_inherit != ZFS_ACL_DISCARD) { > - while (pacep = zfs_acl_next_ace(paclp, pacep, &who, > - &access_mask, &iflags, &type)) { > + if (zfsvfs->z_acl_inherit == ZFS_ACL_DISCARD) > + return (aclp); > + while (pacep = zfs_acl_next_ace(paclp, pacep, &who, > + &access_mask, &iflags, &type)) { > > - /* > - * don't inherit bogus ACEs > - */ > - if (!zfs_acl_valid_ace_type(type, iflags)) > - continue; > + /* > + * don't inherit bogus ACEs > + */ > + if (!zfs_acl_valid_ace_type(type, iflags)) > + continue; > > - if (zfsvfs->z_acl_inherit == ZFS_ACL_NOALLOW && > - type == ALLOW) > - continue; > + if (noallow && type == ALLOW) > + continue; > > - ace_size = aclp->z_ops.ace_size(pacep); > + ace_size = aclp->z_ops.ace_size(pacep); > > - if (!zfs_ace_can_use(zp, iflags)) > - continue; > + if (!zfs_ace_can_use(zp, iflags)) > + continue; > > - /* > - * If owner@, group@, or everyone@ inheritable > - * then zfs_acl_chmod() isn't needed. > - */ > - if (zfsvfs->z_acl_inherit == > - ZFS_ACL_PASSTHROUGH && > - ((iflags & (ACE_OWNER|ACE_EVERYONE)) || > - ((iflags & OWNING_GROUP) == > - OWNING_GROUP)) && (vntype == VREG || > - (vntype == VDIR && > - (iflags & ACE_DIRECTORY_INHERIT_ACE)))) > - *need_chmod = B_FALSE; > - > - aclnode = zfs_acl_node_alloc(ace_size); > - list_insert_tail(&aclp->z_acl, aclnode); > - acep = aclnode->z_acldata; > - zfs_set_ace(aclp, acep, access_mask, type, > - who, iflags|ACE_INHERITED_ACE); > + /* > + * If owner@, group@, or everyone@ inheritable > + * then zfs_acl_chmod() isn't needed. > + */ > + if (passthrough && > + ((iflags & (ACE_OWNER|ACE_EVERYONE)) || > + ((iflags & OWNING_GROUP) == > + OWNING_GROUP)) && (vreg || (vdir && (iflags & > + ACE_DIRECTORY_INHERIT_ACE)))) { > + *need_chmod = B_FALSE; > + > + if (!vdir && passthrough_x && > + ((mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0)) { > + access_mask &= ~ACE_EXECUTE; > + } > + } > + > + aclnode = zfs_acl_node_alloc(ace_size); > + list_insert_tail(&aclp->z_acl, aclnode); > + acep = aclnode->z_acldata; > + > + zfs_set_ace(aclp, acep, access_mask, type, > + who, iflags|ACE_INHERITED_ACE); > + > + /* > + * Copy special opaque data if any > + */ > + if ((data1sz = paclp->z_ops.ace_data(pacep, &data1)) != 0) { > + VERIFY((data2sz = aclp->z_ops.ace_data(acep, > + &data2)) == data1sz); > + bcopy(data1, data2, data2sz); > + } > + aclp->z_acl_count++; > + aclnode->z_ace_count++; > + aclp->z_acl_bytes += aclnode->z_size; > + newflags = aclp->z_ops.ace_flags_get(acep); > + > + if (vdir) > + aclp->z_hints |= ZFS_INHERIT_ACE; > + > + if ((iflags & ACE_NO_PROPAGATE_INHERIT_ACE) || !vdir) { > + newflags &= ~ALL_INHERIT; > + aclp->z_ops.ace_flags_set(acep, > + newflags|ACE_INHERITED_ACE); > + zfs_restricted_update(zfsvfs, aclp, acep); > + continue; > + } > + > + ASSERT(vdir); > + > + newflags = aclp->z_ops.ace_flags_get(acep); > + if ((iflags & (ACE_FILE_INHERIT_ACE | > + ACE_DIRECTORY_INHERIT_ACE)) != > + ACE_FILE_INHERIT_ACE) { > + aclnode2 = zfs_acl_node_alloc(ace_size); > + list_insert_tail(&aclp->z_acl, aclnode2); > + acep2 = aclnode2->z_acldata; > + zfs_set_ace(aclp, acep2, > + access_mask, type, who, > + iflags|ACE_INHERITED_ACE); > + newflags |= ACE_INHERIT_ONLY_ACE; > + aclp->z_ops.ace_flags_set(acep, newflags); > + newflags &= ~ALL_INHERIT; > + aclp->z_ops.ace_flags_set(acep2, > + newflags|ACE_INHERITED_ACE); > > /* > * Copy special opaque data if any > */ > - if ((data1sz = paclp->z_ops.ace_data(pacep, > + if ((data1sz = aclp->z_ops.ace_data(acep, > &data1)) != 0) { > - VERIFY((data2sz = aclp->z_ops.ace_data(acep, > + VERIFY((data2sz = > + aclp->z_ops.ace_data(acep2, > &data2)) == data1sz); > - bcopy(data1, data2, data2sz); > + bcopy(data1, data2, data1sz); > } > aclp->z_acl_count++; > - aclnode->z_ace_count++; > + aclnode2->z_ace_count++; > aclp->z_acl_bytes += aclnode->z_size; > - newflags = aclp->z_ops.ace_flags_get(acep); > - > - if (vntype == VDIR) > - aclp->z_hints |= ZFS_INHERIT_ACE; > - > - if ((iflags & ACE_NO_PROPAGATE_INHERIT_ACE) || > - (vntype != VDIR)) { > - newflags &= ~ALL_INHERIT; > - aclp->z_ops.ace_flags_set(acep, > - newflags|ACE_INHERITED_ACE); > - zfs_restricted_update(zfsvfs, aclp, acep); > - continue; > - } > - > - ASSERT(vntype == VDIR); > - > - newflags = aclp->z_ops.ace_flags_get(acep); > - if ((iflags & (ACE_FILE_INHERIT_ACE | > - ACE_DIRECTORY_INHERIT_ACE)) != > - ACE_FILE_INHERIT_ACE) { > - aclnode2 = zfs_acl_node_alloc(ace_size); > - list_insert_tail(&aclp->z_acl, aclnode2); > - acep2 = aclnode2->z_acldata; > - zfs_set_ace(aclp, acep2, > - access_mask, type, who, > - iflags|ACE_INHERITED_ACE); > - newflags |= ACE_INHERIT_ONLY_ACE; > - aclp->z_ops.ace_flags_set(acep, newflags); > - newflags &= ~ALL_INHERIT; > - aclp->z_ops.ace_flags_set(acep2, > - newflags|ACE_INHERITED_ACE); > - > - /* > - * Copy special opaque data if any > - */ > - if ((data1sz = aclp->z_ops.ace_data(acep, > - &data1)) != 0) { > - VERIFY((data2sz = > - aclp->z_ops.ace_data(acep2, > - &data2)) == data1sz); > - bcopy(data1, data2, data1sz); > - } > - aclp->z_acl_count++; > - aclnode2->z_ace_count++; > - aclp->z_acl_bytes += aclnode->z_size; > - zfs_restricted_update(zfsvfs, aclp, acep2); > - } else { > - newflags |= ACE_INHERIT_ONLY_ACE; > - aclp->z_ops.ace_flags_set(acep, > - newflags|ACE_INHERITED_ACE); > - } > + zfs_restricted_update(zfsvfs, aclp, acep2); > + } else { > + newflags |= ACE_INHERIT_ONLY_ACE; > + aclp->z_ops.ace_flags_set(acep, > + newflags|ACE_INHERITED_ACE); > } > } > return (aclp); > @@ -1876,7 +1888,7 @@ zfs_perm_init(znode_t *zp, znode_t *pare > mutex_enter(&parent->z_acl_lock); > VERIFY(0 == zfs_acl_node_read(parent, &paclp, B_FALSE)); > mutex_exit(&parent->z_acl_lock); > - aclp = zfs_acl_inherit(zp, paclp, &need_chmod); > + aclp = zfs_acl_inherit(zp, paclp, mode, &need_chmod); > zfs_acl_free(paclp); > } else { > aclp = zfs_acl_alloc(zfs_acl_version_zp(zp)); > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Dec 28 22:14:49 2009 (r201142) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Dec 28 22:15:11 2009 (r201143) > @@ -1491,6 +1491,14 @@ zfs_set_prop_nvlist(const char *name, nv > if (zpl_earlier_version(name, ZPL_VERSION_FUID)) > return (ENOTSUP); > break; > + > + case ZFS_PROP_ACLINHERIT: > + if (nvpair_type(elem) == DATA_TYPE_UINT64 && > + nvpair_value_uint64(elem, &intval) == 0) > + if (intval == ZFS_ACL_PASSTHROUGH_X && > + zfs_earlier_version(name, > + SPA_VERSION_PASSTHROUGH_X)) > + return (ENOTSUP); > } > } > > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Dec 28 22:14:49 2009 (r201142) > +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Dec 28 22:15:11 2009 (r201143) > @@ -253,13 +253,14 @@ typedef enum zfs_cache_type { > #define SPA_VERSION_11 11ULL > #define SPA_VERSION_12 12ULL > #define SPA_VERSION_13 13ULL > +#define SPA_VERSION_14 14ULL > /* > * When bumping up SPA_VERSION, make sure GRUB ZFS understands the on-disk > * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*}, > * and do the appropriate changes. > */ > -#define SPA_VERSION SPA_VERSION_13 > -#define SPA_VERSION_STRING "13" > +#define SPA_VERSION SPA_VERSION_14 > +#define SPA_VERSION_STRING "14" > > /* > * Symbolic names for the changes that caused a SPA_VERSION switch. > @@ -294,6 +295,7 @@ typedef enum zfs_cache_type { > #define SPA_VERSION_DSL_SCRUB SPA_VERSION_11 > #define SPA_VERSION_SNAP_PROPS SPA_VERSION_12 > #define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13 > +#define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14 > > /* > * ZPL version - rev'd whenever an incompatible on-disk format change > _______________________________________________ > 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" -- ------------------------------------------------------------------------ 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354 VP Apache Infrastructure; Member, Apache Software Foundation Committer, FreeBSD Foundation Consultant, P6M7G8 Inc. Sr. System Admin, Ridecharge Inc. Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 22:32:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF234106566C; Thu, 31 Dec 2009 22:32:53 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id 62CE38FC0C; Thu, 31 Dec 2009 22:32:53 +0000 (UTC) Received: by pzk15 with SMTP id 15so9066669pzk.3 for ; Thu, 31 Dec 2009 14:32:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=9oT+M2H/EWMls7FUX4AJeSLGD33nTHhfAMCLm0qVmWY=; b=qxVAtMxj7F/5+ymQBq4rHENwP/lH8SV0D3XPX7Nbkq0yYmlEf85A9Il+afLayob4i7 Q4+yFTEtBDR8sFW0YQNao1m1AUavTqwqU+KuOHQyf3mgRZsyJWjGLtTiH/X/bDixE9Mh umTe3zqnBw4FB9jAKPS3IhGlVBgYgQAeyQijs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=wq1vLgE+MyqVDA/RZaf/aG+8OQ3bwjRz3gCHvk/U2lyIOTqTrrtI59uJGu9iPhWI57 nZ7zE4FliuWRmTz/iuVlu8i6tqcu4Z8V3WlrhXZd+xpis6cM1aTfIRx8UGxPvBlXPJGr YKjabcssuIGWigix3LDdYLS2J3bTB8G88/HLQ= MIME-Version: 1.0 Received: by 10.115.26.7 with SMTP id d7mr13808663waj.12.1262298770368; Thu, 31 Dec 2009 14:32:50 -0800 (PST) In-Reply-To: <4B3D21D8.5030301@p6m7g8.com> References: <200912282215.nBSMFCw3002728@svn.freebsd.org> <4B3D21D8.5030301@p6m7g8.com> Date: Thu, 31 Dec 2009 14:32:50 -0800 Message-ID: From: Xin LI To: "Philip M. Gollucci" Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r201143 - in head: cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolar... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 31 Dec 2009 22:32:53 -0000 Hi, Philip, On Thu, Dec 31, 2009 at 2:12 PM, Philip M. Gollucci wrote: > Question, > > So this is not like when we went from v6 to v13 and you had to do both > installkernel + installworld for zfs to re-initialize correctly on the next > reboot ? > > If it is its a pretty big issue for people with ZFSROOT or zfs only systems > as it forces them to get the kernel right on the 1st go b/c our loader can't > boot off of snapshots (like sun). I'm not very sure what are you talking about (I never had a problem during the ZFSv6 -> ZFSv13 transistion when I had ZFS as root), maybe I have overlooked something? What was the problem you had when going from ZFSv6 to ZFSv13? The change between ZFSv13 and ZFSv14 (actually, this commit only adds ZFSv14 support which is necessary for importing OpenSolaris 2009.06 zpools, we are still a few revisions behind) is quite minimal one and have almost no impact to our codebase at this moment. Importing older zpool won't change anything on it (say, if it was v6, it's still v6, etc), and I personally didn't have any manual interaction on my desktop (the only difference is that it's using UFS as / and boot and mount ZFS in a sparse manner). What I would do is to build and install a kernel that supports ZFSv14, see how it's going, then upgrade the zpool at a later time when I have full backup, for zfs as root the 'zpool upgrade' may have some problem IIRC (the reason why I don't use ZFS as root FS anymore is because I couldn't rollback root ZFS to a previously taken snapshot, and once the ZFS gets screwed up one have to boot from a rescue disc) but others should be just fine. Cheers, -- Xin LI http://www.delphij.net From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 22:33:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD1741065679; Thu, 31 Dec 2009 22:33:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDA798FC14; Thu, 31 Dec 2009 22:33:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVMXw6M027953; Thu, 31 Dec 2009 22:33:58 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVMXwI2027951; Thu, 31 Dec 2009 22:33:58 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912312233.nBVMXwI2027951@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 31 Dec 2009 22:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201355 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 22:33:58 -0000 Author: jilles Date: Thu Dec 31 22:33:58 2009 New Revision: 201355 URL: http://svn.freebsd.org/changeset/base/201355 Log: sh(1): document ulimit -w (swapuse rlimit). MFC after: 1 week Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Thu Dec 31 22:01:17 2009 (r201354) +++ head/bin/sh/sh.1 Thu Dec 31 22:33:58 2009 (r201355) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd October 24, 2009 +.Dd December 31, 2009 .Dt SH 1 .Os .Sh NAME @@ -2137,7 +2137,7 @@ and not found. For aliases the alias expansion is printed; for commands and tracked aliases the complete pathname of the command is printed. -.It Ic ulimit Oo Fl HSabcdflmnpstuv Oc Op Ar limit +.It Ic ulimit Oo Fl HSabcdflmnpstuvw Oc Op Ar limit Set or display resource limits (see .Xr getrlimit 2 ) . If @@ -2201,6 +2201,9 @@ The maximal amount of CPU time to be use The maximal number of simultaneous processes for this user ID. .It Fl v Ar virtualmem The maximal virtual size of a process, in kilobytes. +.It Fl w Ar swapuse +The maximum amount of swap space reserved or used for this user ID, +in kilobytes. .El .It Ic umask Oo Fl S Oc Op Ar mask Set the file creation mask (see