From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 11 05:59:39 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B98110657B4; Sun, 11 Jan 2009 05:59:39 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 487168FC19; Sun, 11 Jan 2009 05:59:39 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B5xdVA018832; Sun, 11 Jan 2009 05:59:39 GMT (envelope-from chinsan@svn.freebsd.org) Received: (from chinsan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B5xdcG018831; Sun, 11 Jan 2009 05:59:39 GMT (envelope-from chinsan@svn.freebsd.org) Message-Id: <200901110559.n0B5xdcG018831@svn.freebsd.org> From: Chin-San Huang Date: Sun, 11 Jan 2009 05:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187044 - stable/7/usr.sbin/pkg_install/add X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 05:59:40 -0000 Author: chinsan (doc,ports committer) Date: Sun Jan 11 05:59:39 2009 New Revision: 187044 URL: http://svn.freebsd.org/changeset/base/187044 Log: Synchronize pkg_install(1) with HEAD: fix typo Modified: stable/7/usr.sbin/pkg_install/add/pkg_add.1 Modified: stable/7/usr.sbin/pkg_install/add/pkg_add.1 ============================================================================== --- stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 05:59:27 2009 (r187043) +++ stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 05:59:39 2009 (r187044) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2008 +.Dd Jan 4, 2009 .Dt PKG_ADD 1 .Os .Sh NAME @@ -90,7 +90,7 @@ if it is defined or in current directory .It Fl i , -no-deps Install the package without fetching and installing dependencies. -.It Fl I , -no-scripts +.It Fl I , -no-script If any installation scripts (pre-install or post-install) exist for a given package, do not execute them. .It Fl n , -dry-run From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 11 08:31:02 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AAD91065670; Sun, 11 Jan 2009 08:31:02 +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 77A9C8FC0C; Sun, 11 Jan 2009 08:31:02 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B8V22F021647; Sun, 11 Jan 2009 08:31:02 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B8V2Fc021646; Sun, 11 Jan 2009 08:31:02 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901110831.n0B8V2Fc021646@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 11 Jan 2009 08:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187045 - stable/7/usr.sbin/nscd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 08:31:03 -0000 Author: maxim Date: Sun Jan 11 08:31:01 2009 New Revision: 187045 URL: http://svn.freebsd.org/changeset/base/187045 Log: MFC r186394: correct a database name. Modified: stable/7/usr.sbin/nscd/nscd.conf.5 Modified: stable/7/usr.sbin/nscd/nscd.conf.5 ============================================================================== --- stable/7/usr.sbin/nscd/nscd.conf.5 Sun Jan 11 05:59:39 2009 (r187044) +++ stable/7/usr.sbin/nscd/nscd.conf.5 Sun Jan 11 08:31:01 2009 (r187045) @@ -53,7 +53,7 @@ and a .Ar value . Usual cachenames are .Dq Li passwd , -.Dq Li groups , +.Dq Li group , .Dq Li hosts , .Dq Li services , .Dq Li protocols @@ -125,7 +125,7 @@ will act similarly to the NSCD. .Sy NOTE : this feature is currently experimental \[em] it supports only .Dq Li passwd , -.Dq Li groups +.Dq Li group and .Dq Li services cachenames. From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 11 08:34:52 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F00810656CA; Sun, 11 Jan 2009 08:34:52 +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 1B7988FC19; Sun, 11 Jan 2009 08:34:52 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B8YqA9021781; Sun, 11 Jan 2009 08:34:52 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B8Yp0Q021780; Sun, 11 Jan 2009 08:34:51 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901110834.n0B8Yp0Q021780@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 11 Jan 2009 08:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187046 - stable/7/usr.bin/netstat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 08:34:52 -0000 Author: maxim Date: Sun Jan 11 08:34:51 2009 New Revision: 187046 URL: http://svn.freebsd.org/changeset/base/187046 Log: MFC r186498: fix typo. Modified: stable/7/usr.bin/netstat/inet6.c Modified: stable/7/usr.bin/netstat/inet6.c ============================================================================== --- stable/7/usr.bin/netstat/inet6.c Sun Jan 11 08:31:01 2009 (r187045) +++ stable/7/usr.bin/netstat/inet6.c Sun Jan 11 08:34:51 2009 (r187046) @@ -1058,7 +1058,7 @@ rip6_stats(u_long off, const char *name, #define p(f, m) if (rip6stat.f || sflag <= 1) \ printf(m, (uintmax_t)rip6stat.f, plural(rip6stat.f)) p(rip6s_ipackets, "\t%ju message%s received\n"); - p(rip6s_isum, "\t%ju checksum calcuration%s on inbound\n"); + p(rip6s_isum, "\t%ju checksum calculation%s on inbound\n"); p(rip6s_badsum, "\t%ju message%s with bad checksum\n"); p(rip6s_nosock, "\t%ju message%s dropped due to no socket\n"); p(rip6s_nosockmcast, From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 11 08:40:26 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BEB41065674; Sun, 11 Jan 2009 08:40:26 +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 794978FC1D; Sun, 11 Jan 2009 08:40:26 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B8eQhl021929; Sun, 11 Jan 2009 08:40:26 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B8eQxD021928; Sun, 11 Jan 2009 08:40:26 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901110840.n0B8eQxD021928@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 11 Jan 2009 08:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187047 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 08:40:27 -0000 Author: maxim Date: Sun Jan 11 08:40:26 2009 New Revision: 187047 URL: http://svn.freebsd.org/changeset/base/187047 Log: MFC r186274: sync comment and example. Modified: stable/7/usr.sbin/sysinstall/config.c Modified: stable/7/usr.sbin/sysinstall/config.c ============================================================================== --- stable/7/usr.sbin/sysinstall/config.c Sun Jan 11 08:34:51 2009 (r187046) +++ stable/7/usr.sbin/sysinstall/config.c Sun Jan 11 08:40:26 2009 (r187047) @@ -845,7 +845,7 @@ configNFSServer(dialogMenuItem *self) "kinds of access to your local file systems.\n" "Press [ENTER] now to invoke an editor on /etc/exports\n"); vsystem("echo '#The following examples export /usr to 3 machines named after ducks,' > /etc/exports"); - vsystem("echo '#/usr/src and /usr/ports read-only to machines named after trouble makers' >> /etc/exports"); + vsystem("echo '#/usr/src and /usr/obj read-only to machines named after trouble makers,' >> /etc/exports"); vsystem("echo '#/home and all directories under it to machines named after dead rock stars' >> /etc/exports"); vsystem("echo '#and, /a to a network of privileged machines allowed to write on it as root.' >> /etc/exports"); vsystem("echo '#/usr huey louie dewie' >> /etc/exports"); From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 11 10:50:13 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C037106564A; Sun, 11 Jan 2009 10:50:13 +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 88DE28FC0A; Sun, 11 Jan 2009 10:50:13 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BAoDL9026212; Sun, 11 Jan 2009 10:50:13 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BAoDA2026211; Sun, 11 Jan 2009 10:50:13 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901111050.n0BAoDA2026211@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 11 Jan 2009 10:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187048 - stable/7/sbin/ipfw X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 10:50:14 -0000 Author: maxim Date: Sun Jan 11 10:50:13 2009 New Revision: 187048 URL: http://svn.freebsd.org/changeset/base/187048 Log: Manually merge r183889:183890: do nothing in show_nat() for a test mode (-n). Modified: stable/7/sbin/ipfw/ipfw2.c Modified: stable/7/sbin/ipfw/ipfw2.c ============================================================================== --- stable/7/sbin/ipfw/ipfw2.c Sun Jan 11 08:40:26 2009 (r187047) +++ stable/7/sbin/ipfw/ipfw2.c Sun Jan 11 10:50:13 2009 (r187048) @@ -5983,6 +5983,9 @@ show_nat(int ac, char **av) { lrule = IPFW_DEFAULT_RULE; /* max ipfw rule number */ ac--; av++; + if (test_only) + return; + /* Parse parameters. */ for (cmd = IP_FW_NAT_GET_LOG, do_cfg = 0; ac != 0; ac--, av++) { if (!strncmp(av[0], "config", strlen(av[0]))) { From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 11 11:00:56 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAC921065680; Sun, 11 Jan 2009 11:00:56 +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 8E4478FC17; Sun, 11 Jan 2009 11:00:56 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BB0uCe026539; Sun, 11 Jan 2009 11:00:56 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BB0uG3026538; Sun, 11 Jan 2009 11:00:56 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901111100.n0BB0uG3026538@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 11 Jan 2009 11:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187049 - stable/7/sbin/ipfw X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 11:00:57 -0000 Author: maxim Date: Sun Jan 11 11:00:56 2009 New Revision: 187049 URL: http://svn.freebsd.org/changeset/base/187049 Log: Record merge r183889:183890. Modified: stable/7/sbin/ipfw/ (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 11 11:51:18 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E67B210659CF; Sun, 11 Jan 2009 11:51:18 +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 D31DD8FC14; Sun, 11 Jan 2009 11:51:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BBpI5r027597; Sun, 11 Jan 2009 11:51:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BBpIcA027596; Sun, 11 Jan 2009 11:51:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901111151.n0BBpIcA027596@svn.freebsd.org> From: Alexander Motin Date: Sun, 11 Jan 2009 11:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187051 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netgraph X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 11:51:19 -0000 Author: mav Date: Sun Jan 11 11:51:18 2009 New Revision: 187051 URL: http://svn.freebsd.org/changeset/base/187051 Log: MFC rev. 186907: Mark ng_vjc node as FORCE_WRITER to protect slcompress state. I think it can be the reason of livelock in netgraph reported by some mpd users. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netgraph/ng_vjc.c Modified: stable/7/sys/netgraph/ng_vjc.c ============================================================================== --- stable/7/sys/netgraph/ng_vjc.c Sun Jan 11 11:36:00 2009 (r187050) +++ stable/7/sys/netgraph/ng_vjc.c Sun Jan 11 11:51:18 2009 (r187051) @@ -249,6 +249,9 @@ ng_vjc_constructor(node_p node) NG_NODE_SET_PRIVATE(node, priv); + /* slcompress is not thread-safe. Protect it's state here. */ + NG_NODE_FORCE_WRITER(node); + /* Done */ return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 11 13:56:08 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE1661065672; Sun, 11 Jan 2009 13:56:08 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB41E8FC22; Sun, 11 Jan 2009 13:56:08 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BDu8Se030048; Sun, 11 Jan 2009 13:56:08 GMT (envelope-from chinsan@svn.freebsd.org) Received: (from chinsan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BDu8ce030047; Sun, 11 Jan 2009 13:56:08 GMT (envelope-from chinsan@svn.freebsd.org) Message-Id: <200901111356.n0BDu8ce030047@svn.freebsd.org> From: Chin-San Huang Date: Sun, 11 Jan 2009 13:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187055 - stable/7/usr.sbin/pkg_install/add X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 13:56:10 -0000 Author: chinsan (doc,ports committer) Date: Sun Jan 11 13:56:08 2009 New Revision: 187055 URL: http://svn.freebsd.org/changeset/base/187055 Log: Use full name (noticed by: ru@ Modified: stable/7/usr.sbin/pkg_install/add/pkg_add.1 Modified: stable/7/usr.sbin/pkg_install/add/pkg_add.1 ============================================================================== --- stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 13:55:31 2009 (r187054) +++ stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 13:56:08 2009 (r187055) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 4, 2009 +.Dd January 4, 2009 .Dt PKG_ADD 1 .Os .Sh NAME From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 11 16:21:33 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E89ED106566C; Sun, 11 Jan 2009 16:21:33 +0000 (UTC) (envelope-from wilko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D63EA8FC20; Sun, 11 Jan 2009 16:21:33 +0000 (UTC) (envelope-from wilko@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BGLXqo032973; Sun, 11 Jan 2009 16:21:33 GMT (envelope-from wilko@svn.freebsd.org) Received: (from wilko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BGLXVt032972; Sun, 11 Jan 2009 16:21:33 GMT (envelope-from wilko@svn.freebsd.org) Message-Id: <200901111621.n0BGLXVt032972@svn.freebsd.org> From: Wilko Bulte Date: Sun, 11 Jan 2009 16:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187057 - stable/7/sys/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 16:21:34 -0000 Author: wilko Date: Sun Jan 11 16:21:33 2009 New Revision: 187057 URL: http://svn.freebsd.org/changeset/base/187057 Log: MFC: r186142 By default assume a 8139 chip if the EEPROM contents prove inconclusive. The same LOM hardware with goofed-up EEPROM programming also needed reading the Ethernet address from the chips registers as the EEPROM did not have a sensible address programmed. Patch developed by: pyun@ Funky hardware on loan: www.id-it.nl Modified: stable/7/sys/pci/if_rl.c Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Sun Jan 11 13:56:55 2009 (r187056) +++ stable/7/sys/pci/if_rl.c Sun Jan 11 16:21:33 2009 (r187057) @@ -857,9 +857,15 @@ rl_attach(device_t dev) } if (sc->rl_type == 0) { - device_printf(dev, "unknown device ID: %x\n", rl_did); - error = ENXIO; - goto fail; + device_printf(dev, "unknown device ID: %x assuming 8139\n", + rl_did); + sc->rl_type = RL_8139; + /* + * Read RL_IDR register to get ethernet address as accessing + * EEPROM may not extract correct address. + */ + for (i = 0; i < ETHER_ADDR_LEN; i++) + eaddr[i] = CSR_READ_1(sc, RL_IDR0 + i); } /* From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 11 21:45:24 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 896CA1065674; Sun, 11 Jan 2009 21:45:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 745458FC1B; Sun, 11 Jan 2009 21:45:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BLjOjK039220; Sun, 11 Jan 2009 21:45:24 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BLjNGb039206; Sun, 11 Jan 2009 21:45:23 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901112145.n0BLjNGb039206@svn.freebsd.org> From: Sam Leffler Date: Sun, 11 Jan 2009 21:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187065 - in stable/7/sys: . dev/acpi_support dev/cxgb dev/led geom geom/concat geom/part geom/stripe kern security/mac_portacl sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 21:45:25 -0000 Author: sam Date: Sun Jan 11 21:45:23 2009 New Revision: 187065 URL: http://svn.freebsd.org/changeset/base/187065 Log: MFC r181463: add sbuf_new_auto Modified: stable/7/sys/ (props changed) stable/7/sys/dev/acpi_support/acpi_asus.c stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/led/led.c stable/7/sys/geom/concat/g_concat.c stable/7/sys/geom/geom_ccd.c stable/7/sys/geom/geom_ctl.c stable/7/sys/geom/geom_disk.c stable/7/sys/geom/geom_kern.c stable/7/sys/geom/geom_slice.c stable/7/sys/geom/geom_subr.c stable/7/sys/geom/part/g_part.c stable/7/sys/geom/stripe/g_stripe.c stable/7/sys/kern/vfs_mount.c stable/7/sys/security/mac_portacl/mac_portacl.c stable/7/sys/sys/sbuf.h Modified: stable/7/sys/dev/acpi_support/acpi_asus.c ============================================================================== --- stable/7/sys/dev/acpi_support/acpi_asus.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/dev/acpi_support/acpi_asus.c Sun Jan 11 21:45:23 2009 (r187065) @@ -552,7 +552,7 @@ acpi_asus_probe(device_t dev) } } - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); if (sb == NULL) return (ENOMEM); Modified: stable/7/sys/dev/led/led.c ============================================================================== --- stable/7/sys/dev/led/led.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/dev/led/led.c Sun Jan 11 21:45:23 2009 (r187065) @@ -141,7 +141,7 @@ led_write(struct cdev *dev, struct uio * return(error); } - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); if (sb == NULL) { free(s2, M_DEVBUF); return (ENOMEM); Modified: stable/7/sys/geom/concat/g_concat.c ============================================================================== --- stable/7/sys/geom/concat/g_concat.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/concat/g_concat.c Sun Jan 11 21:45:23 2009 (r187065) @@ -748,7 +748,7 @@ g_concat_ctl_create(struct gctl_req *req } sc = gp->softc; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name); for (attached = 0, no = 1; no < *nargs; no++) { snprintf(param, sizeof(param), "arg%u", no); Modified: stable/7/sys/geom/geom_ccd.c ============================================================================== --- stable/7/sys/geom/geom_ccd.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_ccd.c Sun Jan 11 21:45:23 2009 (r187065) @@ -790,7 +790,7 @@ g_ccd_create(struct gctl_req *req, struc pp->sectorsize = sc->sc_secsize; g_error_provider(pp, 0); - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "ccd%d: %d components ", sc->sc_unit, *nprovider); for (i = 0; i < *nprovider; i++) { sbuf_printf(sb, "%s%s", @@ -840,7 +840,7 @@ g_ccd_list(struct gctl_req *req, struct up = gctl_get_paraml(req, "unit", sizeof (int)); unit = *up; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); LIST_FOREACH(gp, &mp->geom, geom) { cs = gp->softc; if (cs == NULL || (unit >= 0 && unit != cs->sc_unit)) Modified: stable/7/sys/geom/geom_ctl.c ============================================================================== --- stable/7/sys/geom/geom_ctl.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_ctl.c Sun Jan 11 21:45:23 2009 (r187065) @@ -464,7 +464,7 @@ g_ctl_ioctl_ctl(struct cdev *dev, u_long req = (void *)data; req->nerror = 0; - req->serror = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + req->serror = sbuf_new_auto(); /* It is an error if we cannot return an error text */ if (req->lerror < 2) return (EINVAL); Modified: stable/7/sys/geom/geom_disk.c ============================================================================== --- stable/7/sys/geom/geom_disk.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_disk.c Sun Jan 11 21:45:23 2009 (r187065) @@ -516,7 +516,7 @@ sysctl_disks(SYSCTL_HANDLER_ARGS) int error; struct sbuf *sb; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); g_waitfor_event(g_kern_disks, sb, M_WAITOK, NULL); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); Modified: stable/7/sys/geom/geom_kern.c ============================================================================== --- stable/7/sys/geom/geom_kern.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_kern.c Sun Jan 11 21:45:23 2009 (r187065) @@ -180,7 +180,7 @@ sysctl_kern_geom_conftxt(SYSCTL_HANDLER_ int error; struct sbuf *sb; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); g_waitfor_event(g_conftxt, sb, M_WAITOK, NULL); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); @@ -193,7 +193,7 @@ sysctl_kern_geom_confdot(SYSCTL_HANDLER_ int error; struct sbuf *sb; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); g_waitfor_event(g_confdot, sb, M_WAITOK, NULL); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); @@ -206,7 +206,7 @@ sysctl_kern_geom_confxml(SYSCTL_HANDLER_ int error; struct sbuf *sb; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); g_waitfor_event(g_confxml, sb, M_WAITOK, NULL); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); Modified: stable/7/sys/geom/geom_slice.c ============================================================================== --- stable/7/sys/geom/geom_slice.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_slice.c Sun Jan 11 21:45:23 2009 (r187065) @@ -385,7 +385,7 @@ g_slice_config(struct g_geom *gp, u_int pp->mediasize = gsl->length; return (0); } - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); va_start(ap, fmt); sbuf_vprintf(sb, fmt, ap); va_end(ap); Modified: stable/7/sys/geom/geom_subr.c ============================================================================== --- stable/7/sys/geom/geom_subr.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_subr.c Sun Jan 11 21:45:23 2009 (r187065) @@ -324,7 +324,7 @@ g_new_geomf(struct g_class *mp, const ch g_topology_assert(); G_VALID_CLASS(mp); - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); va_start(ap, fmt); sbuf_vprintf(sb, fmt, ap); va_end(ap); @@ -564,7 +564,7 @@ g_new_providerf(struct g_geom *gp, const KASSERT(!(gp->flags & G_GEOM_WITHER), ("new provider on WITHERing geom(%s) (class %s)", gp->name, gp->class->name)); - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); va_start(ap, fmt); sbuf_vprintf(sb, fmt, ap); va_end(ap); Modified: stable/7/sys/geom/part/g_part.c ============================================================================== --- stable/7/sys/geom/part/g_part.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/part/g_part.c Sun Jan 11 21:45:23 2009 (r187065) @@ -506,7 +506,7 @@ g_part_ctl_add(struct gctl_req *req, str /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s added\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf))); sbuf_finish(sb); @@ -545,7 +545,7 @@ g_part_ctl_bootcode(struct gctl_req *req /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s has bootcode\n", gp->name); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); @@ -749,7 +749,7 @@ g_part_ctl_create(struct gctl_req *req, /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s created\n", gp->name); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); @@ -821,7 +821,7 @@ g_part_ctl_delete(struct gctl_req *req, /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s deleted\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf))); sbuf_finish(sb); @@ -877,7 +877,7 @@ g_part_ctl_destroy(struct gctl_req *req, /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s destroyed\n", gp->name); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); @@ -924,7 +924,7 @@ g_part_ctl_modify(struct gctl_req *req, /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s modified\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf))); sbuf_finish(sb); @@ -991,7 +991,7 @@ g_part_ctl_setunset(struct gctl_req *req /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s has %s %sset\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf)), gpp->gpp_attrib, (set) ? "" : "un"); Modified: stable/7/sys/geom/stripe/g_stripe.c ============================================================================== --- stable/7/sys/geom/stripe/g_stripe.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/stripe/g_stripe.c Sun Jan 11 21:45:23 2009 (r187065) @@ -1069,7 +1069,7 @@ g_stripe_ctl_create(struct gctl_req *req } sc = gp->softc; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name); for (attached = 0, no = 1; no < *nargs; no++) { snprintf(param, sizeof(param), "arg%u", no); Modified: stable/7/sys/kern/vfs_mount.c ============================================================================== --- stable/7/sys/kern/vfs_mount.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/kern/vfs_mount.c Sun Jan 11 21:45:23 2009 (r187065) @@ -2177,7 +2177,7 @@ mount_argf(struct mntarg *ma, const char ma->v[ma->len].iov_len = strlen(name) + 1; ma->len++; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); va_start(ap, fmt); sbuf_vprintf(sb, fmt, ap); va_end(ap); Modified: stable/7/sys/security/mac_portacl/mac_portacl.c ============================================================================== --- stable/7/sys/security/mac_portacl/mac_portacl.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/security/mac_portacl/mac_portacl.c Sun Jan 11 21:45:23 2009 (r187065) @@ -306,7 +306,7 @@ rules_to_string(void) int needcomma; char *temp; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); needcomma = 0; mtx_lock(&rule_mtx); for (rule = TAILQ_FIRST(&rule_head); rule != NULL; Modified: stable/7/sys/sys/sbuf.h ============================================================================== --- stable/7/sys/sys/sbuf.h Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/sys/sbuf.h Sun Jan 11 21:45:23 2009 (r187065) @@ -56,6 +56,8 @@ __BEGIN_DECLS * API functions */ struct sbuf *sbuf_new(struct sbuf *, char *, int, int); +#define sbuf_new_auto() \ + sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND) void sbuf_clear(struct sbuf *); int sbuf_setpos(struct sbuf *, int); int sbuf_bcat(struct sbuf *, const void *, size_t); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 00:39:22 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF256106566B; Mon, 12 Jan 2009 00:39:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91B418FC21; Mon, 12 Jan 2009 00:39:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C0dMO8043219; Mon, 12 Jan 2009 00:39:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C0dMKX043214; Mon, 12 Jan 2009 00:39:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901120039.n0C0dMKX043214@svn.freebsd.org> From: Xin LI Date: Mon, 12 Jan 2009 00:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187069 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 00:39:23 -0000 Author: delphij Date: Mon Jan 12 00:39:22 2009 New Revision: 187069 URL: http://svn.freebsd.org/changeset/base/187069 Log: MFC revisions 178088 and 179656: Catastrophic recovery mode. Modified: stable/7/sbin/fsck_ffs/ (props changed) stable/7/sbin/fsck_ffs/fsck.h stable/7/sbin/fsck_ffs/fsck_ffs.8 stable/7/sbin/fsck_ffs/fsutil.c stable/7/sbin/fsck_ffs/inode.c stable/7/sbin/fsck_ffs/main.c Modified: stable/7/sbin/fsck_ffs/fsck.h ============================================================================== --- stable/7/sbin/fsck_ffs/fsck.h Sun Jan 11 23:19:17 2009 (r187068) +++ stable/7/sbin/fsck_ffs/fsck.h Mon Jan 12 00:39:22 2009 (r187069) @@ -270,6 +270,7 @@ char yflag; /* assume a yes response * int bkgrdflag; /* use a snapshot to run on an active system */ int bflag; /* location of alternate super block */ int debug; /* output debugging info */ +char catastrophicflag; /* run in catastrophic mode */ int cvtlevel; /* convert to newer file system format */ int bkgrdcheck; /* determine if background check is possible */ int bkgrdsumadj; /* whether the kernel have ability to adjust superblock summary */ @@ -335,6 +336,7 @@ void cacheino(union dinode *dp, ino_t i void catch(int); void catchquit(int); int changeino(ino_t dir, const char *name, ino_t newnum); +void check_cgmagic(int cg, struct cg *cgp); int chkrange(ufs2_daddr_t blk, int cnt); void ckfini(int markclean); int ckinode(union dinode *dp, struct inodesc *); Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/7/sbin/fsck_ffs/fsck_ffs.8 Sun Jan 11 23:19:17 2009 (r187068) +++ stable/7/sbin/fsck_ffs/fsck_ffs.8 Mon Jan 12 00:39:22 2009 (r187069) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd April 24, 2001 +.Dd April 10, 2008 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BFpfny +.Op Fl BCFpfny .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -175,6 +175,26 @@ Use the block specified immediately afte the super block for the file system. An alternate super block is usually located at block 32 for UFS1, and block 160 for UFS2. +.It Fl C +Run +.Nm +in 'catastrophic recovery' mode, which will enable certain aggressive +operations that can make +.Nm +to survive with file systems that has very serious data damage, which +is an useful last resort when on disk data damage is very serious +and causes +.Nm +to crash otherwise. Be +.Em very careful +using this flag, is dangerous if there are data transmission hazards +because a false positive cylinder group magic number mismatch could +cause +.Em irrevertible data loss! +.Pp +This option implies the +.Fl f +flag. .It Fl c Convert the file system to the specified level. Note that the level of a file system can only be raised. Modified: stable/7/sbin/fsck_ffs/fsutil.c ============================================================================== --- stable/7/sbin/fsck_ffs/fsutil.c Sun Jan 11 23:19:17 2009 (r187068) +++ stable/7/sbin/fsck_ffs/fsutil.c Mon Jan 12 00:39:22 2009 (r187069) @@ -418,6 +418,35 @@ blwrite(int fd, char *buf, ufs2_daddr_t } /* + * Check cg's magic number. If catastrophic mode is enabled and the cg's + * magic number is bad, offer an option to clear the whole cg. + */ +void +check_cgmagic(int cg, struct cg *cgp) +{ + + if (!cg_chkmagic(cgp)) { + pwarn("CG %d: BAD MAGIC NUMBER\n", cg); + if (catastrophicflag) { + if (reply("CLEAR CG")) { + memset(cgp, 0, (size_t)sblock.fs_cgsize); + cgp->cg_initediblk = sblock.fs_ipg; + cgp->cg_old_niblk = sblock.fs_ipg; + cgp->cg_old_ncyl = sblock.fs_old_cpg; + cgp->cg_cgx = cg; + cgp->cg_niblk = sblock.fs_ipg; + cgp->cg_ndblk = sblock.fs_size - cgbase(&sblock, cg); + cgp->cg_magic = CG_MAGIC; + cgdirty(); + printf("PLEASE RERUN FSCK.\n"); + rerun = 1; + } + } else + printf("YOU MAY NEED TO RERUN FSCK WITH -C IF IT CRASHED.\n"); + } +} + +/* * allocate a data block with the specified number of fragments */ ufs2_daddr_t @@ -441,8 +470,7 @@ allocblk(long frags) } cg = dtog(&sblock, i + j); getblk(&cgblk, cgtod(&sblock, cg), sblock.fs_cgsize); - if (!cg_chkmagic(cgp)) - pfatal("CG %d: BAD MAGIC NUMBER\n", cg); + check_cgmagic(cg, cgp); baseblk = dtogd(&sblock, i + j); for (k = 0; k < frags; k++) { setbmap(i + j + k); Modified: stable/7/sbin/fsck_ffs/inode.c ============================================================================== --- stable/7/sbin/fsck_ffs/inode.c Sun Jan 11 23:19:17 2009 (r187068) +++ stable/7/sbin/fsck_ffs/inode.c Mon Jan 12 00:39:22 2009 (r187069) @@ -617,8 +617,7 @@ allocino(ino_t request, int type) return (0); cg = ino_to_cg(&sblock, ino); getblk(&cgblk, cgtod(&sblock, cg), sblock.fs_cgsize); - if (!cg_chkmagic(cgp)) - pfatal("CG %d: BAD MAGIC NUMBER\n", cg); + check_cgmagic(cg, cgp); setbit(cg_inosused(cgp), ino % sblock.fs_ipg); cgp->cg_cs.cs_nifree--; switch (type & IFMT) { Modified: stable/7/sbin/fsck_ffs/main.c ============================================================================== --- stable/7/sbin/fsck_ffs/main.c Sun Jan 11 23:19:17 2009 (r187068) +++ stable/7/sbin/fsck_ffs/main.c Mon Jan 12 00:39:22 2009 (r187069) @@ -81,7 +81,8 @@ main(int argc, char *argv[]) sync(); skipclean = 1; - while ((ch = getopt(argc, argv, "b:Bc:dfFm:npy")) != -1) { + catastrophicflag = 0; + while ((ch = getopt(argc, argv, "b:Bc:CdfFm:npy")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -105,6 +106,10 @@ main(int argc, char *argv[]) debug++; break; + case 'C': + catastrophicflag = 1; + /* FALLTHROUGH */ + case 'f': skipclean = 0; break; @@ -610,7 +615,7 @@ static void usage(void) { (void) fprintf(stderr, - "usage: %s [-BFpfny] [-b block] [-c level] [-m mode] " + "usage: %s [-BCFpfny] [-b block] [-c level] [-m mode] " "filesystem ...\n", getprogname()); exit(1); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 02:07:58 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 012E1106572A; Mon, 12 Jan 2009 02:07:57 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9F378FC1F; Mon, 12 Jan 2009 02:07:57 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C27vIq045058; Mon, 12 Jan 2009 02:07:57 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C27v8t045057; Mon, 12 Jan 2009 02:07:57 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120207.n0C27v8t045057@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 02:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187072 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:08:00 -0000 Author: yongari Date: Mon Jan 12 02:07:57 2009 New Revision: 187072 URL: http://svn.freebsd.org/changeset/base/187072 Log: MFC r183488-r183491: r183488: Announce link loss right after it happens. r183489: Use mii_anegticks instead of hardcoded MII_ANEGTICKS. r183490: Report current link state while auto-negotiation is in progress. r183491: Explicitly mark IFM_HDX for half-duplex media. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ciphy.c Modified: stable/7/sys/dev/mii/ciphy.c ============================================================================== --- stable/7/sys/dev/mii/ciphy.c Mon Jan 12 01:36:01 2009 (r187071) +++ stable/7/sys/dev/mii/ciphy.c Mon Jan 12 02:07:57 2009 (r187072) @@ -262,15 +262,18 @@ setit: if (reg & BMSR_LINK) break; + /* Announce link loss right after it happens. */ + if (++sc->mii_ticks == 0) + break; /* - * Only retry autonegotiation every 5 seconds. + * Only retry autonegotiation every mii_anegticks seconds. */ - if (++sc->mii_ticks <= MII_ANEGTICKS) + if (sc->mii_ticks <= sc->mii_anegticks) break; sc->mii_ticks = 0; mii_phy_auto(sc); - return (0); + break; } /* Update the media status. */ @@ -335,6 +338,8 @@ ciphy_status(struct mii_softc *sc) if (bmsr & CIPHY_AUXCSR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } static void From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 02:14:17 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA6C51065673 for ; Mon, 12 Jan 2009 02:14:17 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.173]) by mx1.freebsd.org (Postfix) with ESMTP id 6F4EB8FC16 for ; Mon, 12 Jan 2009 02:14:17 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: by wf-out-1314.google.com with SMTP id 24so13565119wfg.7 for ; Sun, 11 Jan 2009 18:14:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=+4+4TpcSSKtCU70fhHVWXaOhGU0I5/ZifVDtvK7i+O8=; b=EDh2SKmn0NODGMofgA9ZzEQgWG+q3v5dFb1Gfp6lYcVLtTV3fJ3B8WFuAvmA5cqCSV L+Sc0NWLt2jnmwfq63msobFZZ0LWUX3rcqYRMXk9IuD++tD1GYqPZIHjokp/I6NVoKV/ qRhQUwdbv/FgL0XRR+AhV+MaS8dOH3OSuxiz0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=a0aMp8QzxATAho0VU8/a13pbLDQ7AWBVUK1E30DUWGf9uv6fm9AT0h8sJhzZpBaaOM LlIjY5LIAlyX2IAqOGrefvY32fAKzKxRlkVqyJM75nmIjdA0Rxu0508laFnbRYGPevxv gqb/gmGnRHfuFUcPEgbspSTxbMjiYKtuh8R20= Received: by 10.142.154.14 with SMTP id b14mr11872864wfe.69.1231725226721; Sun, 11 Jan 2009 17:53:46 -0800 (PST) Received: by 10.143.109.9 with HTTP; Sun, 11 Jan 2009 17:53:46 -0800 (PST) Message-ID: <47d0403c0901111753r48b9ebc0x43dfb4389194cf2c@mail.gmail.com> Date: Sun, 11 Jan 2009 20:53:46 -0500 From: "Ben Kaduk" To: "Xin LI" In-Reply-To: <200901120039.n0C0dMKX043214@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200901120039.n0C0dMKX043214@svn.freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, freebsd-doc@freebsd.org Subject: Re: svn commit: r187069 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:14:18 -0000 On Sun, Jan 11, 2009 at 7:39 PM, Xin LI wrote: > Author: delphij > Date: Mon Jan 12 00:39:22 2009 > New Revision: 187069 > URL: http://svn.freebsd.org/changeset/base/187069 > > Log: > MFC revisions 178088 and 179656: Catastrophic recovery mode. > > Modified: > stable/7/sbin/fsck_ffs/ (props changed) > stable/7/sbin/fsck_ffs/fsck.h > stable/7/sbin/fsck_ffs/fsck_ffs.8 > stable/7/sbin/fsck_ffs/fsutil.c > stable/7/sbin/fsck_ffs/inode.c > stable/7/sbin/fsck_ffs/main.c > > Modified: stable/7/sbin/fsck_ffs/fsck.h > ============================================================================== > Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8 > ============================================================================== > --- stable/7/sbin/fsck_ffs/fsck_ffs.8 Sun Jan 11 23:19:17 2009 (r187068) > +++ stable/7/sbin/fsck_ffs/fsck_ffs.8 Mon Jan 12 00:39:22 2009 (r187069) > @@ -29,7 +29,7 @@ > .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 > .\" $FreeBSD$ > .\" > -.Dd April 24, 2001 > +.Dd April 10, 2008 > .Dt FSCK_FFS 8 > .Os > .Sh NAME > @@ -38,7 +38,7 @@ > .Nd file system consistency check and interactive repair > .Sh SYNOPSIS > .Nm > -.Op Fl BFpfny > +.Op Fl BCFpfny > .Op Fl b Ar block > .Op Fl c Ar level > .Op Fl m Ar mode > @@ -175,6 +175,26 @@ Use the block specified immediately afte > the super block for the file system. > An alternate super block is usually located at block 32 for UFS1, > and block 160 for UFS2. > +.It Fl C > +Run > +.Nm > +in 'catastrophic recovery' mode, which will enable certain aggressive > +operations that can make > +.Nm > +to survive with file systems that has very serious data damage, which > +is an useful last resort when on disk data damage is very serious > +and causes > +.Nm > +to crash otherwise. Be > +.Em very careful > +using this flag, is dangerous if there are data transmission hazards I guess I missed this in HEAD, but there seems to be a missing 'it' before 'is dangerous'. -Ben Kaduk From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 02:31:23 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F949106566C; Mon, 12 Jan 2009 02:31:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 027338FC14; Mon, 12 Jan 2009 02:31:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C2VM0T045508; Mon, 12 Jan 2009 02:31:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C2VM98045506; Mon, 12 Jan 2009 02:31:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120231.n0C2VM98045506@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 02:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187073 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:31:23 -0000 Author: yongari Date: Mon Jan 12 02:31:22 2009 New Revision: 187073 URL: http://svn.freebsd.org/changeset/base/187073 Log: MFC r183492,r184192 r183492: Add Vitesse VSC8211 PHY which is found on Planex GU-1000T. HW donated by: nork r184192: Correct PHY description and OUI of VSC8211. Previously VSC8211 was not recognized by ciphy(4) due to the incorrect OUI. Reported by: nork Tested by: nork Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ciphy.c stable/7/sys/dev/mii/miidevs Modified: stable/7/sys/dev/mii/ciphy.c ============================================================================== --- stable/7/sys/dev/mii/ciphy.c Mon Jan 12 02:07:57 2009 (r187072) +++ stable/7/sys/dev/mii/ciphy.c Mon Jan 12 02:31:22 2009 (r187073) @@ -91,6 +91,7 @@ static const struct mii_phydesc ciphys[] MII_PHY_DESC(CICADA, CS8201), MII_PHY_DESC(CICADA, CS8201A), MII_PHY_DESC(CICADA, CS8201B), + MII_PHY_DESC(CICADA, VSC8211), MII_PHY_DESC(VITESSE, VSC8601), MII_PHY_END }; @@ -419,6 +420,7 @@ ciphy_fixup(struct mii_softc *sc) } break; + case MII_MODEL_CICADA_VSC8211: case MII_MODEL_VITESSE_VSC8601: break; default: Modified: stable/7/sys/dev/mii/miidevs ============================================================================== --- stable/7/sys/dev/mii/miidevs Mon Jan 12 02:07:57 2009 (r187072) +++ stable/7/sys/dev/mii/miidevs Mon Jan 12 02:31:22 2009 (r187073) @@ -151,6 +151,7 @@ model BROADCOM2 BCM5906 0x0004 BCM5906 /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ model CICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY +model CICADA VSC8211 0x000b Cicada VSC8211 10/100/1000TX PHY model CICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY model CICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY model VITESSE VSC8601 0x0002 Vitesse VSC8601 10/100/1000TX PHY From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 02:44:25 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55AE6106566C; Mon, 12 Jan 2009 02:44:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42A438FC0A; Mon, 12 Jan 2009 02:44:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C2iNN4045913; Mon, 12 Jan 2009 02:44:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C2iNOS045912; Mon, 12 Jan 2009 02:44:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120244.n0C2iNOS045912@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 02:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187074 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:44:26 -0000 Author: yongari Date: Mon Jan 12 02:44:23 2009 New Revision: 187074 URL: http://svn.freebsd.org/changeset/base/187074 Log: MFC r183493: Save extended address register prior to switching to 1000BASE-X only mode and restore original value of extended address register instead of overwriting it with page 1. There are still instance information passing issue(e.g configured media type: fiber or copper) from driver to PHY layer but this change make the selected PHY work with 88E1112 PHY. Reported by: Krzysztof Jedruczyk < beaker hot dot pl > Tested by: Krzysztof Jedruczyk < beaker hot dot pl > Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/e1000phy.c Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Mon Jan 12 02:31:22 2009 (r187073) +++ stable/7/sys/dev/mii/e1000phy.c Mon Jan 12 02:44:23 2009 (r187074) @@ -223,7 +223,7 @@ static void e1000phy_reset(struct mii_softc *sc) { struct e1000phy_softc *esc; - uint16_t reg; + uint16_t reg, page; esc = (struct e1000phy_softc *)sc; reg = PHY_READ(sc, E1000_SCR); @@ -232,12 +232,13 @@ e1000phy_reset(struct mii_softc *sc) PHY_WRITE(sc, E1000_SCR, reg); if (esc->mii_model == MII_MODEL_MARVELL_E1112) { /* Select 1000BASE-X only mode. */ + page = PHY_READ(sc, E1000_EADR); PHY_WRITE(sc, E1000_EADR, 2); reg = PHY_READ(sc, E1000_SCR); reg &= ~E1000_SCR_MODE_MASK; reg |= E1000_SCR_MODE_1000BX; PHY_WRITE(sc, E1000_SCR, reg); - PHY_WRITE(sc, E1000_EADR, 1); + PHY_WRITE(sc, E1000_EADR, page); } } else { switch (esc->mii_model) { From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 02:45:01 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E4351065674; Mon, 12 Jan 2009 02:45:01 +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 006F18FC20; Mon, 12 Jan 2009 02:45:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C2j0L8045964; Mon, 12 Jan 2009 02:45:00 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C2j0ev045957; Mon, 12 Jan 2009 02:45:00 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901120245.n0C2j0ev045957@svn.freebsd.org> From: Andrew Thompson Date: Mon, 12 Jan 2009 02:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187075 - stable/7/usr.sbin/config X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:45:02 -0000 Author: thompsa Date: Mon Jan 12 02:45:00 2009 New Revision: 187075 URL: http://svn.freebsd.org/changeset/base/187075 Log: MFC r185186 Allow multiple makeoption lines to be used with the += operator, this permits the following syntax in the kernel config. makeoptions MODULES_OVERRIDE=foo makeoptions MODULES_OVERRIDE+=bar makeoptions MODULES_OVERRIDE+=baz Bump config minor version to 600007. Modified: stable/7/usr.sbin/config/ (props changed) stable/7/usr.sbin/config/config.5 stable/7/usr.sbin/config/config.h stable/7/usr.sbin/config/config.y stable/7/usr.sbin/config/configvers.h stable/7/usr.sbin/config/lang.l stable/7/usr.sbin/config/mkmakefile.c Modified: stable/7/usr.sbin/config/config.5 ============================================================================== --- stable/7/usr.sbin/config/config.5 Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/config.5 Mon Jan 12 02:45:00 2009 (r187075) @@ -231,6 +231,7 @@ specifications. Each option specification has the form .Pp .D1 Ar MakeVariableName Ns Op = Ns Ar Value +.D1 Ar MakeVariableName Ns += Ns Ar Value .Pp and results in the appropriate .Xr make 1 @@ -243,7 +244,8 @@ is assumed to be the empty string. .Pp Example: .Bd -literal -offset indent -compact -makeoptions MYMAKEOPTION="foobar" +makeoptions MYMAKEOPTION="foo" +makeoptions MYMAKEOPTION+="bar" makeoptions MYNULLMAKEOPTION .Ed .\" -------- MAXUSERS -------- Modified: stable/7/usr.sbin/config/config.h ============================================================================== --- stable/7/usr.sbin/config/config.h Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/config.h Mon Jan 12 02:45:00 2009 (r187075) @@ -121,6 +121,7 @@ struct opt { char *op_value; int op_ownfile; /* true = own file, false = makefile */ SLIST_ENTRY(opt) op_next; + SLIST_ENTRY(opt) op_append; }; SLIST_HEAD(opt_head, opt) opt, mkopt, rmopts; Modified: stable/7/usr.sbin/config/config.y ============================================================================== --- stable/7/usr.sbin/config/config.y Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/config.y Mon Jan 12 02:45:00 2009 (r187075) @@ -13,6 +13,7 @@ %token NODEVICE %token ENV %token EQUALS +%token PLUSEQUALS %token HINTS %token IDENT %token MAXUSERS @@ -219,7 +220,7 @@ System_spec: System_id: Save_id - = { newopt(&mkopt, ns("KERNEL"), $1); }; + = { newopt(&mkopt, ns("KERNEL"), $1, 0); }; System_parameter_list: System_parameter_list ID @@ -235,14 +236,14 @@ Opt_list: Option: Save_id = { - newopt(&opt, $1, NULL); + newopt(&opt, $1, NULL, 0); if (strchr($1, '=') != NULL) errx(1, "%s:%d: The `=' in options should not be " "quoted", yyfile, yyline); } | Save_id EQUALS Opt_value = { - newopt(&opt, $1, $3); + newopt(&opt, $1, $3, 0); } ; Opt_value: @@ -269,9 +270,11 @@ Mkopt_list: Mkoption: Save_id - = { newopt(&mkopt, $1, ns("")); } | + = { newopt(&mkopt, $1, ns(""), 0); } | Save_id EQUALS Opt_value - = { newopt(&mkopt, $1, $3); } ; + = { newopt(&mkopt, $1, $3, 0); } | + Save_id PLUSEQUALS Opt_value + = { newopt(&mkopt, $1, $3, 1); } ; Dev: ID @@ -299,7 +302,7 @@ NoDev_list: Device: Dev = { - newopt(&opt, devopt($1), ns("1")); + newopt(&opt, devopt($1), ns("1"), 0); /* and the device part */ newdev($1); } @@ -419,9 +422,9 @@ findopt(struct opt_head *list, char *nam * Add an option to the list of options. */ static void -newopt(struct opt_head *list, char *name, char *value) +newopt(struct opt_head *list, char *name, char *value, int append) { - struct opt *op; + struct opt *op, *op2; /* * Ignore inclusions listed explicitly for configuration files. @@ -431,7 +434,8 @@ newopt(struct opt_head *list, char *name return; } - if (findopt(list, name)) { + op2 = findopt(list, name); + if (op2 != NULL && !append) { printf("WARNING: duplicate option `%s' encountered.\n", name); return; } @@ -440,7 +444,12 @@ newopt(struct opt_head *list, char *name op->op_name = name; op->op_ownfile = 0; op->op_value = value; - SLIST_INSERT_HEAD(list, op, op_next); + if (op2 != NULL) { + while (SLIST_NEXT(op2, op_append) != NULL) + op2 = SLIST_NEXT(op2, op_append); + SLIST_NEXT(op2, op_append) = op; + } else + SLIST_INSERT_HEAD(list, op, op_next); } /* Modified: stable/7/usr.sbin/config/configvers.h ============================================================================== --- stable/7/usr.sbin/config/configvers.h Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/configvers.h Mon Jan 12 02:45:00 2009 (r187075) @@ -49,5 +49,5 @@ * * $FreeBSD$ */ -#define CONFIGVERS 600006 +#define CONFIGVERS 600007 #define MAJOR_VERS(x) ((x) / 100000) Modified: stable/7/usr.sbin/config/lang.l ============================================================================== --- stable/7/usr.sbin/config/lang.l Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/lang.l Mon Jan 12 02:45:00 2009 (r187075) @@ -156,6 +156,7 @@ PATH [./][-/.%^A-Za-z_0-9]+ ";" { return SEMICOLON; } "," { return COMMA; } "=" { BEGIN TOEOL; return EQUALS; } +"+=" { BEGIN TOEOL; return PLUSEQUALS; } <> { int tok; Modified: stable/7/usr.sbin/config/mkmakefile.c ============================================================================== --- stable/7/usr.sbin/config/mkmakefile.c Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/mkmakefile.c Mon Jan 12 02:45:00 2009 (r187075) @@ -110,7 +110,7 @@ makefile(void) { FILE *ifp, *ofp; char line[BUFSIZ]; - struct opt *op; + struct opt *op, *t; int versreq; read_files(); @@ -127,8 +127,12 @@ makefile(void) if (ofp == 0) err(1, "%s", path("Makefile.new")); fprintf(ofp, "KERN_IDENT=%s\n", ident); - SLIST_FOREACH(op, &mkopt, op_next) - fprintf(ofp, "%s=%s\n", op->op_name, op->op_value); + SLIST_FOREACH_SAFE(op, &mkopt, op_next, t) { + fprintf(ofp, "%s=%s", op->op_name, op->op_value); + while ((op = SLIST_NEXT(op, op_append)) != NULL) + fprintf(ofp, " %s", op->op_value); + fprintf(ofp, "\n"); + } if (debugging) fprintf(ofp, "DEBUG=-g\n"); if (profiling) From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 02:51:29 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D203F1065674; Mon, 12 Jan 2009 02:51:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE8FE8FC16; Mon, 12 Jan 2009 02:51:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C2pTAc046122; Mon, 12 Jan 2009 02:51:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C2pTuF046119; Mon, 12 Jan 2009 02:51:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120251.n0C2pTuF046119@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 02:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187076 - in stable/7/sys: . contrib/pf dev/cxgb dev/jme X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:51:30 -0000 Author: yongari Date: Mon Jan 12 02:51:29 2009 New Revision: 187076 URL: http://svn.freebsd.org/changeset/base/187076 Log: MFC r185596: Add support for newer JMC250/JMC260 revisions. o Chip full mask revision 2 or later controllers have to set correct Tx MAC and Tx offload clock depending on negotiated link speed. o JMC260 chip full mask revision 2 has a silicon bug that can't handle 64bit DMA addressing. Add workaround to the bug by limiting DMA address space to be within 32bit. o Valid FIFO space of receive control and status register was changed on chip full mask revision 2 or later controllers. For these controllers, use default 16QW as it's supposed to be the safest value for maximum PCIe compatibility. JMicron confirmed performance will not be reduced even if the FIFO space is set to 16QW. o When interface is put into suspend/shutdown state, remove Tx MAC and Tx offload clock to save more power. We don't need Tx clock at all in this state. o Added new register definition for chip full mask revision 2 or later controllers. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/jme/if_jme.c stable/7/sys/dev/jme/if_jmereg.h stable/7/sys/dev/jme/if_jmevar.h Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Mon Jan 12 02:45:00 2009 (r187075) +++ stable/7/sys/dev/jme/if_jme.c Mon Jan 12 02:51:29 2009 (r187076) @@ -651,6 +651,13 @@ jme_attach(device_t dev) goto fail; } + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2) { + if ((sc->jme_rev & DEVICEID_JMC2XX_MASK) == DEVICEID_JMC260 && + CHIPMODE_REVFM(sc->jme_chip_rev) == 2) + sc->jme_flags |= JME_FLAG_DMA32BIT; + sc->jme_flags |= JME_FLAG_TXCLK; + } + /* Reset the ethernet controller. */ jme_reset(sc); @@ -1007,6 +1014,8 @@ jme_dma_alloc(struct jme_softc *sc) int error, i; lowaddr = BUS_SPACE_MAXADDR; + if ((sc->jme_flags & JME_FLAG_DMA32BIT) != 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; again: /* Create parent ring tag. */ @@ -1106,25 +1115,32 @@ again: } sc->jme_rdata.jme_rx_ring_paddr = ctx.jme_busaddr; - /* Tx/Rx descriptor queue should reside within 4GB boundary. */ - tx_ring_end = sc->jme_rdata.jme_tx_ring_paddr + JME_TX_RING_SIZE; - rx_ring_end = sc->jme_rdata.jme_rx_ring_paddr + JME_RX_RING_SIZE; - if ((JME_ADDR_HI(tx_ring_end) != - JME_ADDR_HI(sc->jme_rdata.jme_tx_ring_paddr)) || - (JME_ADDR_HI(rx_ring_end) != - JME_ADDR_HI(sc->jme_rdata.jme_rx_ring_paddr))) { - device_printf(sc->jme_dev, "4GB boundary crossed, " - "switching to 32bit DMA address mode.\n"); - jme_dma_free(sc); - /* Limit DMA address space to 32bit and try again. */ - lowaddr = BUS_SPACE_MAXADDR_32BIT; - goto again; + if (lowaddr != BUS_SPACE_MAXADDR_32BIT) { + /* Tx/Rx descriptor queue should reside within 4GB boundary. */ + tx_ring_end = sc->jme_rdata.jme_tx_ring_paddr + + JME_TX_RING_SIZE; + rx_ring_end = sc->jme_rdata.jme_rx_ring_paddr + + JME_RX_RING_SIZE; + if ((JME_ADDR_HI(tx_ring_end) != + JME_ADDR_HI(sc->jme_rdata.jme_tx_ring_paddr)) || + (JME_ADDR_HI(rx_ring_end) != + JME_ADDR_HI(sc->jme_rdata.jme_rx_ring_paddr))) { + device_printf(sc->jme_dev, "4GB boundary crossed, " + "switching to 32bit DMA address mode.\n"); + jme_dma_free(sc); + /* Limit DMA address space to 32bit and try again. */ + lowaddr = BUS_SPACE_MAXADDR_32BIT; + goto again; + } } + lowaddr = BUS_SPACE_MAXADDR; + if ((sc->jme_flags & JME_FLAG_DMA32BIT) != 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; /* Create parent buffer tag. */ error = bus_dma_tag_create(bus_get_dma_tag(sc->jme_dev),/* parent */ 1, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ + lowaddr, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ @@ -1445,6 +1461,11 @@ jme_setwol(struct jme_softc *sc) JME_LOCK_ASSERT(sc); if (pci_find_extcap(sc->jme_dev, PCIY_PMG, &pmc) != 0) { + /* Remove Tx MAC/offload clock to save more power. */ + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) & + ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 | + GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000)); /* No PME capability, PHY power down. */ jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR, BMCR_PDOWN); @@ -1466,7 +1487,11 @@ jme_setwol(struct jme_softc *sc) CSR_WRITE_4(sc, JME_PMCS, pmcs); CSR_WRITE_4(sc, JME_GPREG0, gpr); - + /* Remove Tx MAC/offload clock to save more power. */ + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) & + ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 | + GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000)); /* Request PME. */ pmstat = pci_read_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, 2); pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); @@ -1941,6 +1966,7 @@ jme_mac_config(struct jme_softc *sc) { struct mii_data *mii; uint32_t ghc, gpreg, rxmac, txmac, txpause; + uint32_t txclk; JME_LOCK_ASSERT(sc); @@ -1950,6 +1976,7 @@ jme_mac_config(struct jme_softc *sc) DELAY(10); CSR_WRITE_4(sc, JME_GHC, 0); ghc = 0; + txclk = 0; rxmac = CSR_READ_4(sc, JME_RXMAC); rxmac &= ~RXMAC_FC_ENB; txmac = CSR_READ_4(sc, JME_TXMAC); @@ -1982,14 +2009,17 @@ jme_mac_config(struct jme_softc *sc) switch (IFM_SUBTYPE(mii->mii_media_active)) { case IFM_10_T: ghc |= GHC_SPEED_10; + txclk |= GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100; break; case IFM_100_TX: ghc |= GHC_SPEED_100; + txclk |= GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100; break; case IFM_1000_T: if ((sc->jme_flags & JME_FLAG_FASTETH) != 0) break; ghc |= GHC_SPEED_1000; + txclk |= GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) == 0) txmac |= TXMAC_CARRIER_EXT | TXMAC_FRAME_BURST; break; @@ -2019,6 +2049,8 @@ jme_mac_config(struct jme_softc *sc) 0x1B, 0x0004); } } + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + ghc |= txclk; CSR_WRITE_4(sc, JME_GHC, ghc); CSR_WRITE_4(sc, JME_RXMAC, rxmac); CSR_WRITE_4(sc, JME_TXMAC, txmac); @@ -2637,13 +2669,19 @@ jme_init_locked(struct jme_softc *sc) * decrease FIFO threshold to reduce the FIFO overruns for * frames larger than 4000 bytes. * For best performance of standard MTU sized frames use - * maximum allowable FIFO threshold, 128QW. + * maximum allowable FIFO threshold, 128QW. Note these do + * not hold on chip full mask verion >=2. For these + * controllers 64QW and 128QW are not valid value. */ - if ((ifp->if_mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + - ETHER_CRC_LEN) > JME_RX_FIFO_SIZE) + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2) sc->jme_rxcsr |= RXCSR_FIFO_THRESH_16QW; - else - sc->jme_rxcsr |= RXCSR_FIFO_THRESH_128QW; + else { + if ((ifp->if_mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + + ETHER_CRC_LEN) > JME_RX_FIFO_SIZE) + sc->jme_rxcsr |= RXCSR_FIFO_THRESH_16QW; + else + sc->jme_rxcsr |= RXCSR_FIFO_THRESH_128QW; + } sc->jme_rxcsr |= sc->jme_rx_dma_size | RXCSR_RXQ_N_SEL(RXCSR_RXQ0); sc->jme_rxcsr |= RXCSR_DESC_RT_CNT(RXCSR_DESC_RT_CNT_DEFAULT); sc->jme_rxcsr |= RXCSR_DESC_RT_GAP_256 & RXCSR_DESC_RT_GAP_MASK; Modified: stable/7/sys/dev/jme/if_jmereg.h ============================================================================== --- stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 02:45:00 2009 (r187075) +++ stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 02:51:29 2009 (r187076) @@ -239,8 +239,8 @@ #define RXCSR_FIFO_FTHRESH_MASK 0x30000000 #define RXCSR_FIFO_THRESH_16QW 0x00000000 #define RXCSR_FIFO_THRESH_32QW 0x04000000 -#define RXCSR_FIFO_THRESH_64QW 0x08000000 -#define RXCSR_FIFO_THRESH_128QW 0x0C000000 +#define RXCSR_FIFO_THRESH_64QW 0x08000000 /* JMC250/JMC260 REVFM < 2 */ +#define RXCSR_FIFO_THRESH_128QW 0x0C000000 /* JMC250/JMC260 REVFM < 2 */ #define RXCSR_FIFO_THRESH_MASK 0x0C000000 #define RXCSR_DMA_SIZE_16 0x00000000 #define RXCSR_DMA_SIZE_32 0x01000000 @@ -357,6 +357,16 @@ #define JME_GHC 0x0054 #define GHC_LOOPBACK 0x80000000 #define GHC_RESET 0x40000000 +#define GHC_RX_DMA_PWR_DIS 0x04000000 /* JMC250 REVFM >= 2 */ +#define GHC_FIFO_RD_PWR_DIS 0x02000000 /* JMC250 REVFM >= 2 */ +#define GHC_FIFO_WR_PWR_DIS 0x01000000 /* JMC250 REVFM >= 2 */ +#define GHC_TX_OFFLD_CLK_100 0x00800000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_OFFLD_CLK_1000 0x00400000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_OFFLD_CLK_DIS 0x00000000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_MAC_CLK_100 0x00200000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_MAC_CLK_1000 0x00100000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_MAC_CLK_DIS 0x00000000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_AUTO_PHY_STAT_DIS 0x00000080 /* JMC250/JMC260 REVFM >= 2 */ #define GHC_FULL_DUPLEX 0x00000040 #define GHC_SPEED_UNKNOWN 0x00000000 #define GHC_SPEED_10 0x00000010 @@ -755,6 +765,10 @@ #define CHIPMODE_MODE_128P_MAC 0x00000003 #define CHIPMODE_MODE_128P_DBG 0x00000002 #define CHIPMODE_MODE_128P_PHY 0x00000000 +/* Chip full mask revision. */ +#define CHIPMODE_REVFM(x) ((x) & 0x0F) +/* Chip ECO revision. */ +#define CHIPMODE_REVECO(x) (((x) >> 4) & 0x0F) /* Shadow status base address high/low. */ #define JME_SHBASE_ADDR_HI 0x0848 Modified: stable/7/sys/dev/jme/if_jmevar.h ============================================================================== --- stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 02:45:00 2009 (r187075) +++ stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 02:51:29 2009 (r187076) @@ -181,6 +181,8 @@ struct jme_softc { #define JME_FLAG_PMCAP 0x0020 #define JME_FLAG_FASTETH 0x0040 #define JME_FLAG_NOJUMBO 0x0080 +#define JME_FLAG_TXCLK 0x0100 +#define JME_FLAG_DMA32BIT 0x0200 #define JME_FLAG_DETACH 0x4000 #define JME_FLAG_LINK 0x8000 From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 03:26:53 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 722A9106566B; Mon, 12 Jan 2009 03:26:53 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2B68FC12; Mon, 12 Jan 2009 03:26:53 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C3QrVl047093; Mon, 12 Jan 2009 03:26:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C3QrWV047090; Mon, 12 Jan 2009 03:26:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120326.n0C3QrWV047090@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 03:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187077 - in stable/7/sys: . contrib/pf dev/cxgb dev/jme X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 03:26:54 -0000 Author: yongari Date: Mon Jan 12 03:26:52 2009 New Revision: 187077 URL: http://svn.freebsd.org/changeset/base/187077 Log: MFC r185597: Add HW MAC counter support for newer JMC250/JMC260 revisions. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/jme/if_jme.c stable/7/sys/dev/jme/if_jmereg.h stable/7/sys/dev/jme/if_jmevar.h Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Mon Jan 12 02:51:29 2009 (r187076) +++ stable/7/sys/dev/jme/if_jme.c Mon Jan 12 03:26:52 2009 (r187077) @@ -150,6 +150,9 @@ static void jme_init_ssb(struct jme_soft static int jme_newbuf(struct jme_softc *, struct jme_rxdesc *); static void jme_set_vlan(struct jme_softc *); static void jme_set_filter(struct jme_softc *); +static void jme_stats_clear(struct jme_softc *); +static void jme_stats_save(struct jme_softc *); +static void jme_stats_update(struct jme_softc *); static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_jme_tx_coal_to(SYSCTL_HANDLER_ARGS); static int sysctl_hw_jme_tx_coal_pkt(SYSCTL_HANDLER_ARGS); @@ -656,6 +659,7 @@ jme_attach(device_t dev) CHIPMODE_REVFM(sc->jme_chip_rev) == 2) sc->jme_flags |= JME_FLAG_DMA32BIT; sc->jme_flags |= JME_FLAG_TXCLK; + sc->jme_flags |= JME_FLAG_HWMIB; } /* Reset the ethernet controller. */ @@ -887,35 +891,41 @@ jme_detach(device_t dev) return (0); } +#define JME_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) + static void jme_sysctl_node(struct jme_softc *sc) { + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct jme_hw_stats *stats; int error; - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "tx_coal_to", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_to, - 0, sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "tx_coal_pkt", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_pkt, - 0, sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "rx_coal_to", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_to, - 0, sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "rx_coal_pkt", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_pkt, - 0, sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "process_limit", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_process_limit, - 0, sysctl_hw_jme_proc_limit, "I", + stats = &sc->jme_stats; + ctx = device_get_sysctl_ctx(sc->jme_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_to", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_to, 0, + sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_pkt", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_pkt, 0, + sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_to", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_to, 0, + sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_pkt", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_pkt, 0, + sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_process_limit, 0, + sysctl_hw_jme_proc_limit, "I", "max number of Rx events to process"); /* Pull in device tunables. */ @@ -984,8 +994,43 @@ jme_sysctl_node(struct jme_softc *sc) sc->jme_rx_coal_pkt = PCCRX_COAL_PKT_DEFAULT; } } + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "JME statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_good_frames, "Good frames"); + JME_SYSCTL_STAT_ADD32(ctx, child, "crc_errs", + &stats->rx_crc_errs, "CRC errors"); + JME_SYSCTL_STAT_ADD32(ctx, child, "mii_errs", + &stats->rx_mii_errs, "MII errors"); + JME_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows", + &stats->rx_fifo_oflows, "FIFO overflows"); + JME_SYSCTL_STAT_ADD32(ctx, child, "desc_empty", + &stats->rx_desc_empty, "Descriptor empty"); + JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames", + &stats->rx_bad_frames, "Bad frames"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_good_frames, "Good frames"); + JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames", + &stats->tx_bad_frames, "Bad frames"); } +#undef JME_SYSCTL_STAT_ADD32 + struct jme_dmamap_arg { bus_addr_t jme_busaddr; }; @@ -2164,6 +2209,7 @@ jme_link_task(void *arg, int pending) /* Program MAC with resolved speed/duplex/flow-control. */ if ((sc->jme_flags & JME_FLAG_LINK) != 0) { jme_mac_config(sc); + jme_stats_clear(sc); CSR_WRITE_4(sc, JME_RXCSR, sc->jme_rxcsr); CSR_WRITE_4(sc, JME_TXCSR, sc->jme_txcsr); @@ -2553,6 +2599,7 @@ jme_tick(void *arg) * faster and limit the maximum delay to a hz. */ jme_txeof(sc); + jme_stats_update(sc); jme_watchdog(sc); callout_reset(&sc->jme_tick_ch, hz, jme_tick, sc); } @@ -2862,6 +2909,8 @@ jme_stop(struct jme_softc *sc) txd->tx_ndesc = 0; } } + jme_stats_update(sc); + jme_stats_save(sc); } static void @@ -3093,6 +3142,76 @@ jme_set_filter(struct jme_softc *sc) CSR_WRITE_4(sc, JME_RXMAC, rxcfg); } +static void +jme_stats_clear(struct jme_softc *sc) +{ + + JME_LOCK_ASSERT(sc); + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + + /* Disable and clear counters. */ + CSR_WRITE_4(sc, JME_STATCSR, 0xFFFFFFFF); + /* Activate hw counters. */ + CSR_WRITE_4(sc, JME_STATCSR, 0); + CSR_READ_4(sc, JME_STATCSR); + bzero(&sc->jme_stats, sizeof(struct jme_hw_stats)); +} + +static void +jme_stats_save(struct jme_softc *sc) +{ + + JME_LOCK_ASSERT(sc); + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + /* Save current counters. */ + bcopy(&sc->jme_stats, &sc->jme_ostats, sizeof(struct jme_hw_stats)); + /* Disable and clear counters. */ + CSR_WRITE_4(sc, JME_STATCSR, 0xFFFFFFFF); +} + +static void +jme_stats_update(struct jme_softc *sc) +{ + struct jme_hw_stats *stat, *ostat; + uint32_t reg; + + JME_LOCK_ASSERT(sc); + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + stat = &sc->jme_stats; + ostat = &sc->jme_ostats; + stat->tx_good_frames = CSR_READ_4(sc, JME_STAT_TXGOOD); + stat->rx_good_frames = CSR_READ_4(sc, JME_STAT_RXGOOD); + reg = CSR_READ_4(sc, JME_STAT_CRCMII); + stat->rx_crc_errs = (reg & STAT_RX_CRC_ERR_MASK) >> + STAT_RX_CRC_ERR_SHIFT; + stat->rx_mii_errs = (reg & STAT_RX_MII_ERR_MASK) >> + STAT_RX_MII_ERR_SHIFT; + reg = CSR_READ_4(sc, JME_STAT_RXERR); + stat->rx_fifo_oflows = (reg & STAT_RXERR_OFLOW_MASK) >> + STAT_RXERR_OFLOW_SHIFT; + stat->rx_desc_empty = (reg & STAT_RXERR_MPTY_MASK) >> + STAT_RXERR_MPTY_SHIFT; + reg = CSR_READ_4(sc, JME_STAT_FAIL); + stat->rx_bad_frames = (reg & STAT_FAIL_RX_MASK) >> STAT_FAIL_RX_SHIFT; + stat->tx_bad_frames = (reg & STAT_FAIL_TX_MASK) >> STAT_FAIL_TX_SHIFT; + + /* Account for previous counters. */ + stat->rx_good_frames += ostat->rx_good_frames; + stat->rx_crc_errs += ostat->rx_crc_errs; + stat->rx_mii_errs += ostat->rx_mii_errs; + stat->rx_fifo_oflows += ostat->rx_fifo_oflows; + stat->rx_desc_empty += ostat->rx_desc_empty; + stat->rx_bad_frames += ostat->rx_bad_frames; + stat->tx_good_frames += ostat->tx_good_frames; + stat->tx_bad_frames += ostat->tx_bad_frames; +} + static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) { Modified: stable/7/sys/dev/jme/if_jmereg.h ============================================================================== --- stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 02:51:29 2009 (r187076) +++ stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 03:26:52 2009 (r187077) @@ -199,6 +199,7 @@ #define TXMAC_IFG2_DEFAULT 0x40000000 #define TXMAC_IFG1_MASK 0x30000000 #define TXMAC_IFG1_DEFAULT 0x20000000 +#define TXMAC_PAUSE_CNT_MASK 0x00FF0000 #define TXMAC_THRESH_1_PKT 0x00000300 #define TXMAC_THRESH_1_2_PKT 0x00000200 #define TXMAC_THRESH_1_4_PKT 0x00000100 @@ -403,6 +404,44 @@ #define PMCS_MAGIC_FRAME_ENB 0x00000001 #define PMCS_WOL_ENB_MASK 0x0000FFFF +/* + * Statistic registers control and status. + * These statistics registers are valid only for JMC250/JMC260 REVFM >= 2. + */ +#define JME_STATCSR 0x0064 +#define STATCSR_RXMPT_DIS 0x00000080 +#define STATCSR_OFLOW_DIS 0x00000040 +#define STATCSR_MIIRXER_DIS 0x00000020 +#define STATCSR_CRCERR_DIS 0x00000010 +#define STATCSR_RXBAD_DIS 0x00000008 +#define STATCSR_RXGOOD_DIS 0x00000004 +#define STATCSR_TXBAD_DIS 0x00000002 +#define STATCSR_TXGOOD_DIS 0x00000001 + +#define JME_STAT_TXGOOD 0x0068 + +#define JME_STAT_RXGOOD 0x006C + +#define JME_STAT_CRCMII 0x0070 +#define STAT_RX_CRC_ERR_MASK 0xFFFF0000 +#define STAT_RX_MII_ERR_MASK 0x0000FFFF +#define STAT_RX_CRC_ERR_SHIFT 16 +#define STAT_RX_MII_ERR_SHIFT 0 + +#define JME_STAT_RXERR 0x0074 +#define STAT_RXERR_OFLOW_MASK 0xFFFF0000 +#define STAT_RXERR_MPTY_MASK 0x0000FFFF +#define STAT_RXERR_OFLOW_SHIFT 16 +#define STAT_RXERR_MPTY_SHIFT 0 + +#define JME_STAT_RESERVED1 0x0078 + +#define JME_STAT_FAIL 0x007C +#define STAT_FAIL_RX_MASK 0xFFFF0000 +#define STAT_FAIL_TX_MASK 0x0000FFFF +#define STAT_FAIL_RX_SHIFT 16 +#define STAT_FAIL_TX_SHIFT 0 + /* Giga PHY & EEPROM registers. */ #define JME_PHY_EEPROM_BASE_ADDR 0x0400 Modified: stable/7/sys/dev/jme/if_jmevar.h ============================================================================== --- stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 02:51:29 2009 (r187076) +++ stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 03:26:52 2009 (r187077) @@ -154,6 +154,18 @@ struct jme_ring_data { (sizeof(struct jme_desc) * JME_RX_RING_CNT) #define JME_SSB_SIZE sizeof(struct jme_ssb) +/* Statistics counters. */ +struct jme_hw_stats { + uint32_t rx_good_frames; + uint32_t rx_crc_errs; + uint32_t rx_mii_errs; + uint32_t rx_fifo_oflows; + uint32_t rx_desc_empty; + uint32_t rx_bad_frames; + uint32_t tx_good_frames; + uint32_t tx_bad_frames; +}; + /* * Software state per device. */ @@ -183,9 +195,12 @@ struct jme_softc { #define JME_FLAG_NOJUMBO 0x0080 #define JME_FLAG_TXCLK 0x0100 #define JME_FLAG_DMA32BIT 0x0200 +#define JME_FLAG_HWMIB 0x0400 #define JME_FLAG_DETACH 0x4000 #define JME_FLAG_LINK 0x8000 + struct jme_hw_stats jme_ostats; + struct jme_hw_stats jme_stats; struct callout jme_tick_ch; struct jme_chain_data jme_cdata; struct jme_ring_data jme_rdata; From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 03:32:55 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C4B0106564A; Mon, 12 Jan 2009 03:32:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 592F88FC1A; Mon, 12 Jan 2009 03:32:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C3Wt5O047253; Mon, 12 Jan 2009 03:32:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C3Wt9V047252; Mon, 12 Jan 2009 03:32:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120332.n0C3Wt9V047252@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 03:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187078 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/vge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 03:32:56 -0000 Author: yongari Date: Mon Jan 12 03:32:54 2009 New Revision: 187078 URL: http://svn.freebsd.org/changeset/base/187078 Log: MFC r184908: Fix Rx/Tx checksum offload ioctl handling. Now checksum offload can be controlled by ifconfig(8). Note, VLAN hardware tagging controls still lacks required handler but it requires more driver cleanups so I didn't touch that part. PR: kern/128766 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/vge/if_vge.c Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Mon Jan 12 03:26:52 2009 (r187077) +++ stable/7/sys/dev/vge/if_vge.c Mon Jan 12 03:32:54 2009 (r187078) @@ -2226,15 +2226,17 @@ vge_ioctl(ifp, command, data) } } #endif /* DEVICE_POLLING */ - if (mask & IFCAP_HWCSUM) { - ifp->if_capenable |= ifr->ifr_reqcap & (IFCAP_HWCSUM); - if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist = VGE_CSUM_FEATURES; + if ((mask & IFCAP_TXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= VGE_CSUM_FEATURES; else - ifp->if_hwassist = 0; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_init(sc); + ifp->if_hwassist &= ~VGE_CSUM_FEATURES; } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; } break; default: From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 03:48:25 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF22A106566B; Mon, 12 Jan 2009 03:48:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F1DA8FC1C; Mon, 12 Jan 2009 03:48:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C3mPNW047670; Mon, 12 Jan 2009 03:48:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C3mPCg047667; Mon, 12 Jan 2009 03:48:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120348.n0C3mPCg047667@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 03:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187080 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 03:48:26 -0000 Author: yongari Date: Mon Jan 12 03:48:25 2009 New Revision: 187080 URL: http://svn.freebsd.org/changeset/base/187080 Log: MFC r184240: Various bus_dma(9) fixes. - The hardware does not support DAC so limit DMA address space to 4GB. - Removed BUS_DMA_ALLOC_NOW flag. - Created separated Tx buffer and Rx buffer DMA tags. Previously it used to single DMA tag and it was not possible to specify different DMA restrictions. - Apply 4 bytes alignment limitation of Tx buffer. - Apply 8 bytes alignment limitation of Rx buffer. - Tx side bus_dmamap_load_mbuf_sg(9) support. - Preallocate Tx DMA maps as creating DMA maps take very long time on architectures that require real DMA maps. - Adjust guard buffer size to 1522 + 8 as it should include VLAN and additional reserved bytes in Rx buffer. - Plug memory leak in device detach. Previously wrong buffer address was used to free allocated memory. - Added rl_list_rx_init() to clear Rx buffer and cleared the buffer. - Don't destroy DMA maps in rl_txeof() as the DMA map should be reused. There is no reason to destroy/recreate the DMA maps in this driver. - Removed rl_dma_map_rxbuf()/rl_dma_map_txbuf() callbacks. - The hardware does not support descriptor based DMA on Tx side and the Tx buffer address should be aligned on 4 bytes boundary as well as manual padding for short frames. Because of this hardware limitation rl(4) always used to invoke m_defrag(9) to get a 4 bytes aligned single buffer. However m_defrag(9) takes a lot of CPU cycles on slow machines and not all packets need the help of m_defrag(9). Armed with the information, don't invoke m_defrag(9) if the following conditions are true. 1. Buffer is not fragmented. 2. Buffer is aligned on 4 bytes boundary. 3. Manual padding is not necessary. 4. Or padding is necessary but upper stack passed a writable buffer and the space needed for padding is satisfied. This change combined with preallocated DMA maps greatly increased Tx performance of driver on sparc64. - Moved bus_dmamap_sync(9) in rl_start_locked() to rl_encap() and corrected memory synchronization operation specifier of bus_dmamap_sync(9). - Removed bus_dmamap_unload(9) in rl_stop(). There is no need to reload/unload Rx buffer as rl(4) always have to copy from the buffer. It just needs proper bus_dmamap_sync(9) calls before copying the received frame. With this change rl(4) should work on systems with more than 4GB memory. PR: kern/128143 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/pci/if_rl.c stable/7/sys/pci/if_rlreg.h Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Mon Jan 12 03:33:48 2009 (r187079) +++ stable/7/sys/pci/if_rl.c Mon Jan 12 03:48:25 2009 (r187080) @@ -182,12 +182,14 @@ static struct rl_type rl_devs[] = { static int rl_attach(device_t); static int rl_detach(device_t); -static void rl_dma_map_rxbuf(void *, bus_dma_segment_t *, int, int); -static void rl_dma_map_txbuf(void *, bus_dma_segment_t *, int, int); +static void rl_dmamap_cb(void *, bus_dma_segment_t *, int, int); +static int rl_dma_alloc(struct rl_softc *); +static void rl_dma_free(struct rl_softc *); static void rl_eeprom_putbyte(struct rl_softc *, int); static void rl_eeprom_getword(struct rl_softc *, int, uint16_t *); -static int rl_encap(struct rl_softc *, struct mbuf * ); +static int rl_encap(struct rl_softc *, struct mbuf **); static int rl_list_tx_init(struct rl_softc *); +static int rl_list_rx_init(struct rl_softc *); static int rl_ifmedia_upd(struct ifnet *); static void rl_ifmedia_sts(struct ifnet *, struct ifmediareq *); static int rl_ioctl(struct ifnet *, u_long, caddr_t); @@ -269,22 +271,6 @@ DRIVER_MODULE(miibus, rl, miibus_driver, CSR_WRITE_1(sc, RL_EECMD, \ CSR_READ_1(sc, RL_EECMD) & ~x) -static void -rl_dma_map_rxbuf(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct rl_softc *sc = arg; - - CSR_WRITE_4(sc, RL_RXADDR, segs->ds_addr & 0xFFFFFFFF); -} - -static void -rl_dma_map_txbuf(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct rl_softc *sc = arg; - - CSR_WRITE_4(sc, RL_CUR_TXADDR(sc), segs->ds_addr & 0xFFFFFFFF); -} - /* * Send a read command and address to the EEPROM, check for ACK. */ @@ -756,6 +742,24 @@ rl_probe(device_t dev) return (ENXIO); } +struct rl_dmamap_arg { + bus_addr_t rl_busaddr; +}; + +static void +rl_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct rl_dmamap_arg *ctx; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + ctx = (struct rl_dmamap_arg *)arg; + ctx->rl_busaddr = segs[0].ds_addr; +} + /* * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. @@ -868,59 +872,9 @@ rl_attach(device_t dev) eaddr[i] = CSR_READ_1(sc, RL_IDR0 + i); } - /* - * Allocate the parent bus DMA tag appropriate for PCI. - */ -#define RL_NSEG_NEW 32 - error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MAXBSIZE, RL_NSEG_NEW, /* maxsize, nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->rl_parent_tag); - if (error) + if ((error = rl_dma_alloc(sc)) != 0) goto fail; - /* - * Now allocate a tag for the DMA descriptor lists. - * All of our lists are allocated as a contiguous block - * of memory. - */ - error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - RL_RXBUFLEN + 1518, 1, /* maxsize,nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->rl_tag); - if (error) - goto fail; - - /* - * Now allocate a chunk of DMA-able memory based on the - * tag we just created. - */ - error = bus_dmamem_alloc(sc->rl_tag, - (void **)&sc->rl_cdata.rl_rx_buf, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->rl_cdata.rl_rx_dmamap); - if (error) { - device_printf(dev, "no memory for list buffers!\n"); - bus_dma_tag_destroy(sc->rl_tag); - sc->rl_tag = NULL; - goto fail; - } - - /* Leave a few bytes before the start of the RX ring buffer. */ - sc->rl_cdata.rl_rx_buf_ptr = sc->rl_cdata.rl_rx_buf; - sc->rl_cdata.rl_rx_buf += sizeof(uint64_t); - ifp = sc->rl_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "can not if_alloc()\n"); @@ -1019,20 +973,155 @@ rl_detach(device_t dev) if (ifp) if_free(ifp); - if (sc->rl_tag) { - bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap); - bus_dmamem_free(sc->rl_tag, sc->rl_cdata.rl_rx_buf, - sc->rl_cdata.rl_rx_dmamap); - bus_dma_tag_destroy(sc->rl_tag); - } - if (sc->rl_parent_tag) - bus_dma_tag_destroy(sc->rl_parent_tag); + rl_dma_free(sc); mtx_destroy(&sc->rl_mtx); return (0); } +static int +rl_dma_alloc(struct rl_softc *sc) +{ + struct rl_dmamap_arg ctx; + int error, i; + + /* + * Allocate the parent bus DMA tag appropriate for PCI. + */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->rl_dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, 0, /* maxsize, nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rl_parent_tag); + if (error) { + device_printf(sc->rl_dev, + "failed to create parent DMA tag.\n"); + goto fail; + } + /* Create DMA tag for Rx memory block. */ + error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */ + RL_RX_8139_BUF_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, 1, /* maxsize,nsegments */ + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rl_cdata.rl_rx_tag); + if (error) { + device_printf(sc->rl_dev, + "failed to create Rx memory block DMA tag.\n"); + goto fail; + } + /* Create DMA tag for Tx buffer. */ + error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */ + RL_TX_8139_BUF_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, 1, /* maxsize, nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rl_cdata.rl_tx_tag); + if (error) { + device_printf(sc->rl_dev, "failed to create Tx DMA tag.\n"); + goto fail; + } + + /* + * Allocate DMA'able memory and load DMA map for Rx memory block. + */ + error = bus_dmamem_alloc(sc->rl_cdata.rl_rx_tag, + (void **)&sc->rl_cdata.rl_rx_buf, BUS_DMA_WAITOK | + BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->rl_cdata.rl_rx_dmamap); + if (error != 0) { + device_printf(sc->rl_dev, + "failed to allocate Rx DMA memory block.\n"); + goto fail; + } + ctx.rl_busaddr = 0; + error = bus_dmamap_load(sc->rl_cdata.rl_rx_tag, + sc->rl_cdata.rl_rx_dmamap, sc->rl_cdata.rl_rx_buf, + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, rl_dmamap_cb, &ctx, + BUS_DMA_NOWAIT); + if (error != 0 || ctx.rl_busaddr == 0) { + device_printf(sc->rl_dev, + "could not load Rx DMA memory block.\n"); + goto fail; + } + sc->rl_cdata.rl_rx_buf_paddr = ctx.rl_busaddr; + + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < RL_TX_LIST_CNT; i++) { + sc->rl_cdata.rl_tx_chain[i] = NULL; + sc->rl_cdata.rl_tx_dmamap[i] = NULL; + error = bus_dmamap_create(sc->rl_cdata.rl_tx_tag, 0, + &sc->rl_cdata.rl_tx_dmamap[i]); + if (error != 0) { + device_printf(sc->rl_dev, + "could not create Tx dmamap.\n"); + goto fail; + } + } + + /* Leave a few bytes before the start of the RX ring buffer. */ + sc->rl_cdata.rl_rx_buf_ptr = sc->rl_cdata.rl_rx_buf; + sc->rl_cdata.rl_rx_buf += RL_RX_8139_BUF_RESERVE; + +fail: + return (error); +} + +static void +rl_dma_free(struct rl_softc *sc) +{ + int i; + + /* Rx memory block. */ + if (sc->rl_cdata.rl_rx_tag != NULL) { + if (sc->rl_cdata.rl_rx_dmamap != NULL) + bus_dmamap_unload(sc->rl_cdata.rl_rx_tag, + sc->rl_cdata.rl_rx_dmamap); + if (sc->rl_cdata.rl_rx_dmamap != NULL && + sc->rl_cdata.rl_rx_buf_ptr != NULL) + bus_dmamem_free(sc->rl_cdata.rl_rx_tag, + sc->rl_cdata.rl_rx_buf_ptr, + sc->rl_cdata.rl_rx_dmamap); + sc->rl_cdata.rl_rx_buf_ptr = NULL; + sc->rl_cdata.rl_rx_buf = NULL; + sc->rl_cdata.rl_rx_dmamap = NULL; + bus_dma_tag_destroy(sc->rl_cdata.rl_rx_tag); + sc->rl_cdata.rl_tx_tag = NULL; + } + + /* Tx buffers. */ + if (sc->rl_cdata.rl_tx_tag != NULL) { + for (i = 0; i < RL_TX_LIST_CNT; i++) { + if (sc->rl_cdata.rl_tx_dmamap[i] != NULL) { + bus_dmamap_destroy( + sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i]); + sc->rl_cdata.rl_tx_dmamap[i] = NULL; + } + bus_dma_tag_destroy(sc->rl_cdata.rl_tx_tag); + sc->rl_cdata.rl_tx_tag = NULL; + } + } + + if (sc->rl_parent_tag != NULL) { + bus_dma_tag_destroy(sc->rl_parent_tag); + sc->rl_parent_tag = NULL; + } +} + /* * Initialize the transmit descriptors. */ @@ -1057,6 +1146,20 @@ rl_list_tx_init(struct rl_softc *sc) return (0); } +static int +rl_list_rx_init(struct rl_softc *sc) +{ + + RL_LOCK_ASSERT(sc); + + bzero(sc->rl_cdata.rl_rx_buf_ptr, + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ); + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, sc->rl_cdata.rl_rx_dmamap, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + return (0); +} + /* * A frame has been uploaded: pass the resulting mbuf chain up to * the higher level protocols. @@ -1093,8 +1196,8 @@ rl_rxeof(struct rl_softc *sc) RL_LOCK_ASSERT(sc); - bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, - BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(sc->rl_cdata.rl_rx_tag, sc->rl_cdata.rl_rx_dmamap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); cur_rx = (CSR_READ_2(sc, RL_CURRXADDR) + 16) % RL_RXBUFLEN; @@ -1192,6 +1295,8 @@ rl_rxeof(struct rl_softc *sc) (*ifp->if_input)(ifp, m); RL_LOCK(sc); } + + /* No need to sync Rx memory block as we didn't mofify it. */ } /* @@ -1220,8 +1325,9 @@ rl_txeof(struct rl_softc *sc) ifp->if_collisions += (txstat & RL_TXSTAT_COLLCNT) >> 24; - bus_dmamap_unload(sc->rl_tag, RL_LAST_DMAMAP(sc)); - bus_dmamap_destroy(sc->rl_tag, RL_LAST_DMAMAP(sc)); + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, RL_LAST_DMAMAP(sc), + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->rl_cdata.rl_tx_tag, RL_LAST_DMAMAP(sc)); m_freem(RL_LAST_TXMBUF(sc)); RL_LAST_TXMBUF(sc) = NULL; /* @@ -1369,41 +1475,64 @@ done_locked: * pointers to the fragment pointers. */ static int -rl_encap(struct rl_softc *sc, struct mbuf *m_head) +rl_encap(struct rl_softc *sc, struct mbuf **m_head) { - struct mbuf *m_new = NULL; + struct mbuf *m; + bus_dma_segment_t txsegs[1]; + int error, nsegs, padlen; RL_LOCK_ASSERT(sc); + m = *m_head; + padlen = 0; + /* + * Hardware doesn't auto-pad, so we have to make sure + * pad short frames out to the minimum frame length. + */ + if (m->m_pkthdr.len < RL_MIN_FRAMELEN) + padlen = RL_MIN_FRAMELEN - m->m_pkthdr.len; /* * The RealTek is brain damaged and wants longword-aligned * TX buffers, plus we can only have one fragment buffer * per packet. We have to copy pretty much all the time. */ - m_new = m_defrag(m_head, M_DONTWAIT); - - if (m_new == NULL) { - m_freem(m_head); - return (1); + if (m->m_next != NULL || (mtod(m, uintptr_t) & 3) != 0 || + (padlen > 0 && M_TRAILINGSPACE(m) < padlen)) { + m = m_defrag(*m_head, M_DONTWAIT); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOMEM); + } } - m_head = m_new; + *m_head = m; - /* Pad frames to at least 60 bytes. */ - if (m_head->m_pkthdr.len < RL_MIN_FRAMELEN) { + if (padlen > 0) { /* * Make security concious people happy: zero out the * bytes in the pad area, since we don't know what * this mbuf cluster buffer's previous user might * have left in it. */ - bzero(mtod(m_head, char *) + m_head->m_pkthdr.len, - RL_MIN_FRAMELEN - m_head->m_pkthdr.len); - m_head->m_pkthdr.len += - (RL_MIN_FRAMELEN - m_head->m_pkthdr.len); - m_head->m_len = m_head->m_pkthdr.len; + bzero(mtod(m, char *) + m->m_pkthdr.len, padlen); + m->m_pkthdr.len += padlen; + m->m_len = m->m_pkthdr.len; + } + + error = bus_dmamap_load_mbuf_sg(sc->rl_cdata.rl_tx_tag, + RL_CUR_DMAMAP(sc), m, txsegs, &nsegs, 0); + if (error != 0) + return (error); + if (nsegs == 0) { + m_freem(*m_head); + *m_head = NULL; + return (EIO); } - RL_CUR_TXMBUF(sc) = m_head; + RL_CUR_TXMBUF(sc) = m; + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, RL_CUR_DMAMAP(sc), + BUS_DMASYNC_PREWRITE); + CSR_WRITE_4(sc, RL_CUR_TXADDR(sc), RL_ADDR_LO(txsegs[0].ds_addr)); return (0); } @@ -1436,19 +1565,18 @@ rl_start_locked(struct ifnet *ifp) if (m_head == NULL) break; - if (rl_encap(sc, m_head)) + if (rl_encap(sc, &m_head)) { + if (m_head == NULL) + break; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; + } /* Pass a copy of this mbuf chain to the bpf subsystem. */ BPF_MTAP(ifp, RL_CUR_TXMBUF(sc)); /* Transmit the frame. */ - bus_dmamap_create(sc->rl_tag, 0, &RL_CUR_DMAMAP(sc)); - bus_dmamap_load(sc->rl_tag, RL_CUR_DMAMAP(sc), - mtod(RL_CUR_TXMBUF(sc), void *), - RL_CUR_TXMBUF(sc)->m_pkthdr.len, rl_dma_map_txbuf, sc, 0); - bus_dmamap_sync(sc->rl_tag, RL_CUR_DMAMAP(sc), - BUS_DMASYNC_PREREAD); CSR_WRITE_4(sc, RL_CUR_TXSTAT(sc), RL_TXTHRESH(sc->rl_txthresh) | RL_CUR_TXMBUF(sc)->m_pkthdr.len); @@ -1507,14 +1635,13 @@ rl_init_locked(struct rl_softc *sc) CSR_WRITE_STREAM_4(sc, RL_IDR4, eaddr[1]); CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); - /* Init the RX buffer pointer register. */ - bus_dmamap_load(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, - sc->rl_cdata.rl_rx_buf, RL_RXBUFLEN, rl_dma_map_rxbuf, sc, 0); - bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, - BUS_DMASYNC_PREWRITE); - + /* Init the RX memory block pointer register. */ + CSR_WRITE_4(sc, RL_RXADDR, sc->rl_cdata.rl_rx_buf_paddr + + RL_RX_8139_BUF_RESERVE); /* Init TX descriptors. */ rl_list_tx_init(sc); + /* Init Rx memory block. */ + rl_list_rx_init(sc); /* * Enable transmit and receive. @@ -1718,19 +1845,21 @@ rl_stop(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, 0x00); CSR_WRITE_2(sc, RL_IMR, 0x0000); - bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap); /* * Free the TX list buffers. */ for (i = 0; i < RL_TX_LIST_CNT; i++) { if (sc->rl_cdata.rl_tx_chain[i] != NULL) { - bus_dmamap_unload(sc->rl_tag, - sc->rl_cdata.rl_tx_dmamap[i]); - bus_dmamap_destroy(sc->rl_tag, - sc->rl_cdata.rl_tx_dmamap[i]); - m_freem(sc->rl_cdata.rl_tx_chain[i]); - sc->rl_cdata.rl_tx_chain[i] = NULL; + if (sc->rl_cdata.rl_tx_chain[i] != NULL) { + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i]); + m_freem(sc->rl_cdata.rl_tx_chain[i]); + sc->rl_cdata.rl_tx_chain[i] = NULL; + } CSR_WRITE_4(sc, RL_TXADDR0 + (i * sizeof(uint32_t)), 0x0000000); } Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Mon Jan 12 03:33:48 2009 (r187079) +++ stable/7/sys/pci/if_rlreg.h Mon Jan 12 03:48:25 2009 (r187080) @@ -502,6 +502,11 @@ #define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13)) #define RL_TX_LIST_CNT 4 #define RL_MIN_FRAMELEN 60 +#define RL_TX_8139_BUF_ALIGN 4 +#define RL_RX_8139_BUF_ALIGN 8 +#define RL_RX_8139_BUF_RESERVE sizeof(int64_t) +#define RL_RX_8139_BUF_GUARD_SZ \ + (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + RL_RX_8139_BUF_RESERVE) #define RL_TXTHRESH(x) ((x) << 11) #define RL_TX_THRESH_INIT 96 #define RL_RX_FIFOTHRESH RL_RXFIFO_NOTHRESH @@ -523,10 +528,13 @@ struct rl_chain_data { uint16_t cur_rx; uint8_t *rl_rx_buf; uint8_t *rl_rx_buf_ptr; - bus_dmamap_t rl_rx_dmamap; struct mbuf *rl_tx_chain[RL_TX_LIST_CNT]; bus_dmamap_t rl_tx_dmamap[RL_TX_LIST_CNT]; + bus_dma_tag_t rl_tx_tag; + bus_dma_tag_t rl_rx_tag; + bus_dmamap_t rl_rx_dmamap; + bus_addr_t rl_rx_buf_paddr; uint8_t last_tx; uint8_t cur_tx; }; @@ -814,7 +822,6 @@ struct rl_softc { void *rl_intrhand[RL_MSI_MESSAGES]; device_t rl_miibus; bus_dma_tag_t rl_parent_tag; - bus_dma_tag_t rl_tag; uint8_t rl_type; int rl_eecmd_read; int rl_eewidth; From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 03:54:34 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F2E210656D1; Mon, 12 Jan 2009 03:54:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2163B8FC08; Mon, 12 Jan 2009 03:54:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C3sYNw048252; Mon, 12 Jan 2009 03:54:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C3sYUS048251; Mon, 12 Jan 2009 03:54:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120354.n0C3sYUS048251@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 03:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187081 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 03:54:35 -0000 Author: yongari Date: Mon Jan 12 03:54:33 2009 New Revision: 187081 URL: http://svn.freebsd.org/changeset/base/187081 Log: MFC r184241-184243: r184241: Don't rearm watchdog timer in rl_txeof(). The watchdog timer was already set in rl_start_locked(). Touching the watchdog timer in other places will hide the root cause of watchdog timeouts. r184282: Make rl_init_locked() call rl_reset. This will put hardware into sane state after resume/watchdog timeouts. r184283: After sending stop command to MAC, give hardware chance to drain active DMA operation. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/pci/if_rl.c Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Mon Jan 12 03:48:25 2009 (r187080) +++ stable/7/sys/pci/if_rl.c Mon Jan 12 03:54:33 2009 (r187081) @@ -1348,7 +1348,6 @@ rl_txeof(struct rl_softc *sc) CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG); oldthresh = sc->rl_txthresh; /* error recovery */ - rl_reset(sc); rl_init_locked(sc); /* restore original threshold */ sc->rl_txthresh = oldthresh; @@ -1360,8 +1359,6 @@ rl_txeof(struct rl_softc *sc) if (RL_LAST_TXMBUF(sc) == NULL) sc->rl_watchdog_timer = 0; - else if (sc->rl_watchdog_timer == 0) - sc->rl_watchdog_timer = 5; } static void @@ -1417,10 +1414,8 @@ rl_poll_locked(struct ifnet *ifp, enum p /* XXX We should check behaviour on receiver stalls. */ - if (status & RL_ISR_SYSTEM_ERR) { - rl_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) rl_init_locked(sc); - } } } #endif /* DEVICE_POLLING */ @@ -1457,10 +1452,8 @@ rl_intr(void *arg) rl_rxeof(sc); if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR)) rl_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) { - rl_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) rl_init_locked(sc); - } } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1623,6 +1616,8 @@ rl_init_locked(struct rl_softc *sc) */ rl_stop(sc); + rl_reset(sc); + /* * Init our MAC address. Even though the chipset * documentation doesn't mention it, we need to enter "Config @@ -1845,6 +1840,14 @@ rl_stop(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, 0x00); CSR_WRITE_2(sc, RL_IMR, 0x0000); + for (i = 0; i < RL_TIMEOUT; i++) { + DELAY(10); + if ((CSR_READ_1(sc, RL_COMMAND) & + (RL_CMD_RX_ENB | RL_CMD_TX_ENB)) == 0) + break; + } + if (i == RL_TIMEOUT) + device_printf(sc->rl_dev, "Unable to stop Tx/Rx MAC\n"); /* * Free the TX list buffers. From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 04:03:26 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 095FB106566B; Mon, 12 Jan 2009 04:03:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA0D58FC0A; Mon, 12 Jan 2009 04:03:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C43Prt049135; Mon, 12 Jan 2009 04:03:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C43PHG049134; Mon, 12 Jan 2009 04:03:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120403.n0C43PHG049134@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187082 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:03:26 -0000 Author: yongari Date: Mon Jan 12 04:03:25 2009 New Revision: 187082 URL: http://svn.freebsd.org/changeset/base/187082 Log: MFC r184245,185575: r184245: Implement miibus_statchg handler. It detects whether rl(4) established a valid link or not. In rl_start_locked, don't try to send packets unless we have valid link. While I'm here add a check that verifies whether driver can accept Tx requests by inspecting IFF_DRV_OACTIVE/IFF_DRV_RUNNING flag. r185575: Update if_iqdrops instead of if_ierrors when m_devget(9) fails. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/pci/if_rl.c Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Mon Jan 12 03:54:33 2009 (r187081) +++ stable/7/sys/pci/if_rl.c Mon Jan 12 04:03:25 2009 (r187082) @@ -636,6 +636,34 @@ rl_miibus_writereg(device_t dev, int phy static void rl_miibus_statchg(device_t dev) { + struct rl_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; + + sc = device_get_softc(dev); + mii = device_get_softc(sc->rl_miibus); + ifp = sc->rl_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + sc->rl_flags &= ~RL_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + sc->rl_flags |= RL_FLAG_LINK; + break; + default: + break; + } + } + /* + * RealTek controllers do not provide any interface to + * Tx/Rx MACs for resolved speed, duplex and flow-control + * parameters. + */ } /* @@ -1268,18 +1296,13 @@ rl_rxeof(struct rl_softc *sc) if (total_len > wrap) { m = m_devget(rxbufpos, total_len, RL_ETHER_ALIGN, ifp, NULL); - if (m == NULL) { - ifp->if_ierrors++; - } else { + if (m != NULL) m_copyback(m, wrap, total_len - wrap, sc->rl_cdata.rl_rx_buf); - } cur_rx = (total_len - wrap + ETHER_CRC_LEN); } else { m = m_devget(rxbufpos, total_len, RL_ETHER_ALIGN, ifp, NULL); - if (m == NULL) - ifp->if_ierrors++; cur_rx += total_len + 4 + ETHER_CRC_LEN; } @@ -1287,8 +1310,10 @@ rl_rxeof(struct rl_softc *sc) cur_rx = (cur_rx + 3) & ~3; CSR_WRITE_2(sc, RL_CURRXADDR, cur_rx - 16); - if (m == NULL) + if (m == NULL) { + ifp->if_iqdrops++; continue; + } ifp->if_ipackets++; RL_UNLOCK(sc); @@ -1551,6 +1576,10 @@ rl_start_locked(struct ifnet *ifp) RL_LOCK_ASSERT(sc); + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) + return; + while (RL_CUR_TXMBUF(sc) == NULL) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); @@ -1692,6 +1721,7 @@ rl_init_locked(struct rl_softc *sc) /* Enable receiver and transmitter. */ CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); + sc->rl_flags &= ~RL_FLAG_LINK; mii_mediachg(mii); CSR_WRITE_1(sc, RL_CFG1, RL_CFG1_DRVLOAD|RL_CFG1_FULLDUPLEX); @@ -1837,6 +1867,7 @@ rl_stop(struct rl_softc *sc) sc->rl_watchdog_timer = 0; callout_stop(&sc->rl_stat_callout); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->rl_flags &= ~RL_FLAG_LINK; CSR_WRITE_1(sc, RL_COMMAND, 0x00); CSR_WRITE_2(sc, RL_IMR, 0x0000); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 04:10:40 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0007106564A; Mon, 12 Jan 2009 04:10:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD5038FC24; Mon, 12 Jan 2009 04:10:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4AeIO049745; Mon, 12 Jan 2009 04:10:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4Aecm049744; Mon, 12 Jan 2009 04:10:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120410.n0C4Aecm049744@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187083 - in stable/7/sys: . contrib/pf dev/cxgb pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:10:42 -0000 Author: yongari Date: Mon Jan 12 04:10:40 2009 New Revision: 187083 URL: http://svn.freebsd.org/changeset/base/187083 Log: MFC r186390: Since we don't request reset for rlphy(4), the link state 'UP' event from mii(4) may not be delivered if valid link was already established. To address the issue, check current link state after driving MII_TICK. This should fix a regression introduced in r184245. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/pci/if_rl.c Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Mon Jan 12 04:03:25 2009 (r187082) +++ stable/7/sys/pci/if_rl.c Mon Jan 12 04:10:40 2009 (r187083) @@ -1395,6 +1395,8 @@ rl_tick(void *xsc) RL_LOCK_ASSERT(sc); mii = device_get_softc(sc->rl_miibus); mii_tick(mii); + if ((sc->rl_flags & RL_FLAG_LINK) == 0) + rl_miibus_statchg(sc->rl_dev); rl_watchdog(sc); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 04:15:05 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0422106566C; Mon, 12 Jan 2009 04:15:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD9418FC18; Mon, 12 Jan 2009 04:15:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4F59M050180; Mon, 12 Jan 2009 04:15:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4F5RZ050179; Mon, 12 Jan 2009 04:15:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120415.n0C4F5RZ050179@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187085 - in stable/7/sys: . contrib/pf dev/age dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:15:06 -0000 Author: yongari Date: Mon Jan 12 04:15:05 2009 New Revision: 187085 URL: http://svn.freebsd.org/changeset/base/187085 Log: MFC r181717: Fix a typo: jme -> age Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/age/if_age.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Mon Jan 12 04:12:46 2009 (r187084) +++ stable/7/sys/dev/age/if_age.c Mon Jan 12 04:15:05 2009 (r187085) @@ -1427,7 +1427,7 @@ age_setwol(struct age_softc *sc) MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); DELAY(1000); if (aneg != 0) { - /* Poll link state until jme(4) get a 10/100 link. */ + /* Poll link state until age(4) get a 10/100 link. */ for (i = 0; i < MII_ANEGTICKS_GIGE; i++) { mii_pollstat(mii); if ((mii->mii_media_status & IFM_AVALID) != 0) { From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 04:18:22 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63A7F106564A; Mon, 12 Jan 2009 04:18:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 512788FC26; Mon, 12 Jan 2009 04:18:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4IMv6050479; Mon, 12 Jan 2009 04:18:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4IMgE050478; Mon, 12 Jan 2009 04:18:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120418.n0C4IMgE050478@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187086 - in stable/7/sys: . contrib/pf dev/age dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:18:23 -0000 Author: yongari Date: Mon Jan 12 04:18:22 2009 New Revision: 187086 URL: http://svn.freebsd.org/changeset/base/187086 Log: MFC r184106: No need to sync descriptors twice in age_rxintr() Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/age/if_age.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Mon Jan 12 04:15:05 2009 (r187085) +++ stable/7/sys/dev/age/if_age.c Mon Jan 12 04:18:22 2009 (r187086) @@ -2478,9 +2478,6 @@ age_rxintr(struct age_softc *sc, int rr_ bus_dmamap_sync(sc->age_cdata.age_rr_ring_tag, sc->age_cdata.age_rr_ring_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_sync(sc->age_cdata.age_rx_ring_tag, - sc->age_cdata.age_rx_ring_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); for (prog = 0; rr_cons != rr_prod; prog++) { if (count <= 0) @@ -2513,9 +2510,6 @@ age_rxintr(struct age_softc *sc, int rr_ sc->age_cdata.age_rr_cons = rr_cons; /* Sync descriptors. */ - bus_dmamap_sync(sc->age_cdata.age_rx_ring_tag, - sc->age_cdata.age_rx_ring_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); bus_dmamap_sync(sc->age_cdata.age_rr_ring_tag, sc->age_cdata.age_rr_ring_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 04:20:46 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3C3B1065673; Mon, 12 Jan 2009 04:20:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D125C8FC17; Mon, 12 Jan 2009 04:20:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4Kkmd050721; Mon, 12 Jan 2009 04:20:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4KkPT050720; Mon, 12 Jan 2009 04:20:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120420.n0C4KkPT050720@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187087 - in stable/7/sys: . contrib/pf dev/age dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:20:47 -0000 Author: yongari Date: Mon Jan 12 04:20:46 2009 New Revision: 187087 URL: http://svn.freebsd.org/changeset/base/187087 Log: MFC r184107: Remove unused age_txdq Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/age/if_agevar.h stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/age/if_agevar.h ============================================================================== --- stable/7/sys/dev/age/if_agevar.h Mon Jan 12 04:18:22 2009 (r187086) +++ stable/7/sys/dev/age/if_agevar.h Mon Jan 12 04:20:46 2009 (r187087) @@ -68,8 +68,6 @@ struct age_txdesc { struct tx_desc *tx_desc; }; -STAILQ_HEAD(age_txdq, age_txdesc); - struct age_rxdesc { struct mbuf *rx_m; bus_dmamap_t rx_dmamap; From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 04:23:48 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1099A1065672; Mon, 12 Jan 2009 04:23:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D72BA8FC18; Mon, 12 Jan 2009 04:23:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4NlGp051045; Mon, 12 Jan 2009 04:23:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4NldE051044; Mon, 12 Jan 2009 04:23:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120423.n0C4NldE051044@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187088 - in stable/7/sys: . contrib/pf dev/age dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:23:48 -0000 Author: yongari Date: Mon Jan 12 04:23:47 2009 New Revision: 187088 URL: http://svn.freebsd.org/changeset/base/187088 Log: MFC r184743: Remove informational messages left. These messages were intended to show up in verbose boot mode. Reported by: pluknet ( pluknet<> gmail DOT com ) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/age/if_age.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Mon Jan 12 04:20:46 2009 (r187087) +++ stable/7/sys/dev/age/if_age.c Mon Jan 12 04:23:47 2009 (r187088) @@ -429,17 +429,17 @@ age_get_macaddr(struct age_softc *sc) ea[1] &= 0xFFFF; if ((ea[0] == 0 && ea[1] == 0) || (ea[0] == 0xFFFFFFFF && ea[1] == 0xFFFF)) { - if (1 || bootverbose) + if (bootverbose) device_printf(sc->age_dev, "invalid ethernet address " "returned from VPD.\n"); vpd_error = EINVAL; } } - if (vpd_error != 0 && (1 || bootverbose)) + if (vpd_error != 0 && (bootverbose)) device_printf(sc->age_dev, "VPD access failure!\n"); } else { - if (1 || bootverbose) + if (bootverbose) device_printf(sc->age_dev, "PCI VPD capability not found!\n"); } @@ -538,7 +538,7 @@ age_attach(device_t dev) sc->age_rev = pci_get_revid(dev); sc->age_chip_rev = CSR_READ_4(sc, AGE_MASTER_CFG) >> MASTER_CHIP_REV_SHIFT; - if (1 || bootverbose) { + if (bootverbose) { device_printf(dev, "PCI device revision : 0x%04x\n", sc->age_rev); device_printf(dev, "Chip id/revision : 0x%04x\n", sc->age_chip_rev); @@ -565,7 +565,7 @@ age_attach(device_t dev) /* Allocate IRQ resources. */ msixc = pci_msix_count(dev); msic = pci_msi_count(dev); - if (1 || bootverbose) { + if (bootverbose) { device_printf(dev, "MSIX count : %d\n", msixc); device_printf(dev, "MSI count : %d\n", msic); } @@ -612,7 +612,7 @@ age_attach(device_t dev) /* Max payload size. */ sc->age_dma_wr_burst = ((burst >> 5) & 0x07) << DMA_CFG_WR_BURST_SHIFT; - if (1 || bootverbose) { + if (bootverbose) { device_printf(dev, "Read request size : %d bytes.\n", 128 << ((burst >> 12) & 0x07)); device_printf(dev, "TLP payload size : %d bytes.\n", @@ -2685,7 +2685,7 @@ age_init_locked(struct age_softc *sc) else reg |= MASTER_ITIMER_ENB; CSR_WRITE_4(sc, AGE_MASTER_CFG, reg); - if (1 || bootverbose) + if (bootverbose) device_printf(sc->age_dev, "interrupt moderation is %d us.\n", sc->age_int_mod); CSR_WRITE_2(sc, AGE_INTR_CLR_TIMER, AGE_USECS(1000)); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 04:30:28 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41AE5106566B; Mon, 12 Jan 2009 04:30:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F0AD8FC17; Mon, 12 Jan 2009 04:30:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4USQD051697; Mon, 12 Jan 2009 04:30:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4USin051696; Mon, 12 Jan 2009 04:30:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120430.n0C4USin051696@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187089 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:30:28 -0000 Author: yongari Date: Mon Jan 12 04:30:27 2009 New Revision: 187089 URL: http://svn.freebsd.org/changeset/base/187089 Log: MFC r183137: Add ASUS P5KPL-C to the list of supported motherboard. Reported by: < nikola.lecic anthesphoria dot net > Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/age.4 stable/7/share/man/man4/igb.4 (props changed) Modified: stable/7/share/man/man4/age.4 ============================================================================== --- stable/7/share/man/man4/age.4 Mon Jan 12 04:23:47 2009 (r187088) +++ stable/7/share/man/man4/age.4 Mon Jan 12 04:30:27 2009 (r187089) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 19, 2008 +.Dd September 18, 2008 .Dt AGE 4 .Os .Sh NAME @@ -119,6 +119,8 @@ ASUS P5K .It ASUS P5KC .It +ASUS P5KPL-C +.It ASUS P5KPL-VM .It ASUS P5K-SE From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 08:53:42 2009 Return-Path: Delivered-To: svn-src-stable-7@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3857106566B; Mon, 12 Jan 2009 08:53:41 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id D5C598FC12; Mon, 12 Jan 2009 08:53:41 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id n0C8ViUb069542; Mon, 12 Jan 2009 00:31:44 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id n0C8Vi4t069541; Mon, 12 Jan 2009 00:31:44 -0800 (PST) (envelope-from obrien) Date: Mon, 12 Jan 2009 00:31:44 -0800 From: "David O'Brien" To: Xin LI Message-ID: <20090112083144.GA69408@dragon.NUXI.org> References: <200901120039.n0C0dMKX043214@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200901120039.n0C0dMKX043214@svn.freebsd.org> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r187069 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 08:53:42 -0000 On Mon, Jan 12, 2009 at 12:39:22AM +0000, Xin LI wrote: > Author: delphij > Date: Mon Jan 12 00:39:22 2009 > New Revision: 187069 > URL: http://svn.freebsd.org/changeset/base/187069 > > Log: > MFC revisions 178088 and 179656: Catastrophic recovery mode. Hi Xin, I guess you missed my email to you about this. I was hoping to get an answer to this before it was MFC'ed. The use of 'C' conflicts with a Juniper Networks change Juniper wants to push back to FreeBSD. For Juniper the -C flag is the "clean" flag. Meaning don't do anything if the FS is clean, other wise do as full a fsck as possible (vs. just a "preen" fsck). It is useful as 'fsck -C -y /var' (for instance). Do you think your functionality could live under the "-D" (damaged) option? fsck_ffs already had a "-c" option, or Juniper would have used that letter. -- -- David (obrien@FreeBSD.org) Q: Because it reverses the logical flow of conversation. A: Why is top-posting (putting a reply at the top of the message) frowned upon? Let's not play "Jeopardy-style quoting" From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 15:48:24 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10E18106566B; Mon, 12 Jan 2009 15:48:24 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE6B48FC14; Mon, 12 Jan 2009 15:48:23 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CFmN2x069731; Mon, 12 Jan 2009 15:48:23 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CFmNRj069712; Mon, 12 Jan 2009 15:48:23 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200901121548.n0CFmNRj069712@svn.freebsd.org> From: Stanislav Sedov Date: Mon, 12 Jan 2009 15:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187099 - in stable/7: share/man/man4 sys sys/amd64/amd64 sys/amd64/conf sys/amd64/include sys/conf sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cpuctl sys/dev/cxgb sys/i386/conf sys/i386... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 15:48:24 -0000 Author: stas Date: Mon Jan 12 15:48:22 2009 New Revision: 187099 URL: http://svn.freebsd.org/changeset/base/187099 Log: - MFC cpuctl and related commits into RELENG_7. First revision of usr.sbin/cpucontrol was merged directly into usr.sbin since there're no such directory in stable/7 yet. Subsequient changes went into usr.sbin/cpucontrol. Approved by: kib (mentor) Added: stable/7/share/man/man4/cpuctl.4 - copied, changed from r181430, head/share/man/man4/cpuctl.4 stable/7/sys/dev/cpuctl/ - copied from r181430, head/sys/dev/cpuctl/ stable/7/sys/modules/cpuctl/ - copied from r181430, head/sys/modules/cpuctl/ stable/7/sys/sys/cpuctl.h - copied unchanged from r181430, head/sys/sys/cpuctl.h stable/7/usr.sbin/cpucontrol/ (props changed) - copied from r181430, head/usr.sbin/cpucontrol/ Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/Makefile stable/7/share/man/man4/igb.4 (props changed) stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/support.S stable/7/sys/amd64/conf/NOTES stable/7/sys/amd64/include/cpufunc.h stable/7/sys/amd64/include/specialreg.h stable/7/sys/conf/files.amd64 stable/7/sys/conf/files.i386 stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cpuctl/cpuctl.c stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/conf/NOTES stable/7/sys/i386/i386/support.s stable/7/sys/i386/include/cpufunc.h stable/7/sys/i386/include/specialreg.h stable/7/sys/modules/Makefile stable/7/sys/sys/priv.h stable/7/usr.sbin/ (props changed) stable/7/usr.sbin/Makefile stable/7/usr.sbin/adduser/ (props changed) stable/7/usr.sbin/bsnmpd/modules/snmp_pf/ (props changed) stable/7/usr.sbin/cdcontrol/ (props changed) stable/7/usr.sbin/config/ (props changed) stable/7/usr.sbin/cpucontrol/cpucontrol.8 stable/7/usr.sbin/cpucontrol/cpucontrol.c stable/7/usr.sbin/cron/ (props changed) stable/7/usr.sbin/cron/cron/ (props changed) stable/7/usr.sbin/extattr/ (props changed) stable/7/usr.sbin/freebsd-update/ (props changed) stable/7/usr.sbin/fwcontrol/ (props changed) stable/7/usr.sbin/iostat/ (props changed) stable/7/usr.sbin/mergemaster/ (props changed) stable/7/usr.sbin/mountd/ (props changed) stable/7/usr.sbin/mtree/ (props changed) stable/7/usr.sbin/ndiscvt/ (props changed) stable/7/usr.sbin/newsyslog/newsyslog.conf.5 (props changed) stable/7/usr.sbin/nscd/ (props changed) stable/7/usr.sbin/ntp/ (props changed) stable/7/usr.sbin/pciconf/ (props changed) stable/7/usr.sbin/pkg_install/ (props changed) stable/7/usr.sbin/pmcstat/ (props changed) stable/7/usr.sbin/portsnap/ (props changed) stable/7/usr.sbin/pw/ (props changed) stable/7/usr.sbin/rpc.lockd/ (props changed) stable/7/usr.sbin/rpc.statd/ (props changed) stable/7/usr.sbin/rpc.yppasswdd/ (props changed) stable/7/usr.sbin/setfib/ (props changed) stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/syslogd/ (props changed) stable/7/usr.sbin/traceroute/ (props changed) stable/7/usr.sbin/tzsetup/ (props changed) stable/7/usr.sbin/wpa/wpa_supplicant/ (props changed) Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/share/man/man4/Makefile Mon Jan 12 15:48:22 2009 (r187099) @@ -55,6 +55,7 @@ MAN= aac.4 \ cnw.4 \ coda.4 \ ${_coretemp.4} \ + ${_cpuctl.4} \ cpufreq.4 \ crypto.4 \ cue.4 \ @@ -554,6 +555,7 @@ MLINKS+=xl.4 if_xl.4 _acpi_dock.4= acpi_dock.4 _amdsmb.4= amdsmb.4 _coretemp.4= coretemp.4 +_cpuctl.4= cpuctl.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 _hptrr.4= hptrr.4 Copied and modified: stable/7/share/man/man4/cpuctl.4 (from r181430, head/share/man/man4/cpuctl.4) ============================================================================== --- head/share/man/man4/cpuctl.4 Fri Aug 8 16:26:53 2008 (r181430, copy source) +++ stable/7/share/man/man4/cpuctl.4 Mon Jan 12 15:48:22 2009 (r187099) @@ -45,30 +45,33 @@ at boot time, place the following in cpuctl_load="YES" .Ed .Sh DESCRIPTION -The special file +The special device .Pa /dev/cpuctl -presents interace to the system CPU. It provides functionality to retrieve +presents interface to the system CPU. +It provides functionality to retrieve CPUID information, read/write machine specific registers (MSR) and perform -cpu firmware updates. +CPU firmware updates. .Pp -For each cpu present in the system, special file +For each CPU present in the system, the special device .Pa /dev/cpuctl%d -with the appropriate index will be created. For multicore cpus the -special file will be created for each core. +with the appropriate index will be created. +For multicore CPUs such a +special device will be created for each core. .Pp Currently, only i386 and amd64 processors are supported. .Sh IOCTL INTERFACE All of the supported operations are invoked using the -.Fr ioctl 2 -system call. Refer to that manpage for further information about -this interface. Currently, the following ioctls are defined: +.Xr ioctl 2 +system call. +Currently, the following ioctls are defined: .Bl -tag -width CPUCTL_UPDATE .It Dv CPUCTL_RDMSR Fa cpuctl_msr_args_t *args .It Dv CPUCTL_WRMSR Fa cpuctl_msr_args_t *args -Read/write cpu machine specific register. The +Read/write CPU machine specific register. +The .Vt cpuctl_msr_args_t -structure defined in +structure is defined in .In sys/cpuctl.h as: .Pp @@ -79,7 +82,8 @@ typedef struct { } cpuctl_msr_args_t; .Ed .It Dv CPUCTL_CPUID Fa cpuctl_cpuid_args_t *args -Retrieve CPUID information. Arguments are supplied in +Retrieve CPUID information. +Arguments are supplied in the following struct: .Pp .Bd -literal @@ -93,9 +97,10 @@ The .Va level field indicates the CPUID level to retrieve information for, while the .Va data -used to store CPUID data received. +field is used to store the received CPUID data. .It Dv CPUCTL_UPDATE cpuctl_update_args_t *args -Update cpu firmware (microcode). The structure defined in +Update CPU firmware (microcode). +The structure is defined in .In sys/cpuctl.h as: .Pp @@ -117,30 +122,31 @@ For additional information refer to .Sh RETURN VALUES .Bl -tag -width Er .It Bq Er ENXIO -The operation requested is not supported by device (e.g. unsupported -architecture or cpu was disabled) +The operation requested is not supported by the device (e.g. unsupported +architecture or the CPU is disabled) .It Bq Er EINVAL Incorrect request was supplied, or microcode image is not correct. .It Bq Er ENOMEM No physical memory was available to complete the request. .It Bq Er EFAULT -The firmware image address points outside process address space. +The firmware image address points outside the process address space. .El .Sh FILES .Bl -tag -width /dev/cpuctl -compact .It Pa /dev/cpuctl .El .Sh SEE ALSO -.Xr hwpmc 4 +.Xr hwpmc 4 , +.Xr cpucontrol 8 .Sh HISTORY The .Nm driver first appeared in -.Fx 8.0 +.Fx 8.0 . .Sh BUGS Yes, probably, report if any. .Sh AUTHORS The .Nm -module and this manual page was written by +module and this manual page were written by .An Stanislav Sedov Aq stas@FreeBSD.org . Modified: stable/7/sys/amd64/amd64/support.S ============================================================================== --- stable/7/sys/amd64/amd64/support.S Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/amd64/amd64/support.S Mon Jan 12 15:48:22 2009 (r187099) @@ -716,3 +716,47 @@ NON_GPROF_ENTRY(__bb_init_func) movq %rax,32(%rdi) movq %rdi,bbhead NON_GPROF_RET + +/* + * Support for reading MSRs in the safe manner. + */ +ENTRY(rdmsr_safe) +/* int rdmsr_safe(u_int msr, uint64_t *data) */ + movq PCPU(CURPCB),%r8 + movq $msr_onfault,PCB_ONFAULT(%r8) + movl %edi,%ecx + rdmsr /* Read MSR pointed by %ecx. Returns + hi byte in edx, lo in %eax */ + salq $32,%rdx /* sign-shift %rdx left */ + cltq /* sign-extend %eax -> %rax */ + orq %rdx,%rax + movq %rax,(%rsi) + xorq %rax,%rax + movq %rax,PCB_ONFAULT(%r8) + ret + +/* + * Support for writing MSRs in the safe manner. + */ +ENTRY(wrmsr_safe) +/* int wrmsr_safe(u_int msr, uint64_t data) */ + movq PCPU(CURPCB),%r8 + movq $msr_onfault,PCB_ONFAULT(%r8) + movl %edi,%ecx + movl %esi,%eax + sarq $32,%rsi + movl %esi,%edx + wrmsr /* Write MSR pointed by %ecx. Accepts + hi byte in edx, lo in %eax. */ + xorq %rax,%rax + movq %rax,PCB_ONFAULT(%r8) + ret + +/* + * MSR operations fault handler + */ + ALIGN_TEXT +msr_onfault: + movq $0,PCB_ONFAULT(%r8) + movl $EFAULT,%eax + ret Modified: stable/7/sys/amd64/conf/NOTES ============================================================================== --- stable/7/sys/amd64/conf/NOTES Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/amd64/conf/NOTES Mon Jan 12 15:48:22 2009 (r187099) @@ -575,6 +575,12 @@ options ELSA_QS1PCI #--------------------------------------------------------------------------- # +# CPU control pseudo-device. Provides access to MSRs, CPUID info and +# microcode update feature. +# +device cpuctl + +# # System Management Bus (SMB) # options ENABLE_ALART # Control alarm on Intel intpm driver Modified: stable/7/sys/amd64/include/cpufunc.h ============================================================================== --- stable/7/sys/amd64/include/cpufunc.h Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/amd64/include/cpufunc.h Mon Jan 12 15:48:22 2009 (r187099) @@ -777,4 +777,9 @@ void wrmsr(u_int msr, u_int64_t newval); void reset_dbregs(void); +#ifdef _KERNEL +int rdmsr_safe(u_int msr, uint64_t *val); +int wrmsr_safe(u_int msr, uint64_t newval); +#endif + #endif /* !_MACHINE_CPUFUNC_H_ */ Modified: stable/7/sys/amd64/include/specialreg.h ============================================================================== --- stable/7/sys/amd64/include/specialreg.h Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/amd64/include/specialreg.h Mon Jan 12 15:48:22 2009 (r187099) @@ -161,6 +161,12 @@ #define AMDID_CMP_CORES 0x000000ff /* + * CPUID manufacturers identifiers + */ +#define INTEL_VENDOR_ID "GenuineIntel" +#define AMD_VENDOR_ID "AuthenticAMD" + +/* * Model-specific registers for the i386 family */ #define MSR_P5_MC_ADDR 0x000 @@ -409,5 +415,6 @@ #define MSR_IORRMASK1 0xc0010019 #define MSR_TOP_MEM 0xc001001a /* boundary for ram below 4G */ #define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */ +#define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ #endif /* !_MACHINE_SPECIALREG_H_ */ Modified: stable/7/sys/conf/files.amd64 ============================================================================== --- stable/7/sys/conf/files.amd64 Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/conf/files.amd64 Mon Jan 12 15:48:22 2009 (r187099) @@ -149,6 +149,7 @@ dev/atkbdc/atkbdc_isa.c optional atkbdc dev/atkbdc/atkbdc_subr.c optional atkbdc dev/atkbdc/psm.c optional psm atkbdc dev/coretemp/coretemp.c optional coretemp +dev/cpuctl/cpuctl.c optional cpuctl # There are no systems with isa slots, so all ed isa entries should go.. dev/ed/if_ed_3c503.c optional ed isa ed_3c503 dev/ed/if_ed_isa.c optional ed isa Modified: stable/7/sys/conf/files.i386 ============================================================================== --- stable/7/sys/conf/files.i386 Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/conf/files.i386 Mon Jan 12 15:48:22 2009 (r187099) @@ -161,6 +161,7 @@ dev/cm/if_cm_isa.c optional cm isa dev/coretemp/coretemp.c optional coretemp dev/cp/cpddk.c optional cp dev/cp/if_cp.c optional cp +dev/cpuctl/cpuctl.c optional cpuctl dev/ctau/ctau.c optional ctau dev/ctau/ctddk.c optional ctau dev/ctau/if_ct.c optional ctau Modified: stable/7/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Fri Aug 8 16:26:53 2008 (r181430) +++ stable/7/sys/dev/cpuctl/cpuctl.c Mon Jan 12 15:48:22 2009 (r187099) @@ -80,7 +80,7 @@ static MALLOC_DEFINE(M_CPUCTL, "cpuctl", static struct cdevsw cpuctl_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDMINOR, + .d_flags = 0, .d_open = cpuctl_open, .d_ioctl = cpuctl_ioctl, .d_name = "cpuctl", Modified: stable/7/sys/i386/conf/NOTES ============================================================================== --- stable/7/sys/i386/conf/NOTES Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/i386/conf/NOTES Mon Jan 12 15:48:22 2009 (r187099) @@ -1102,6 +1102,12 @@ device i4bcapi #--------------------------------------------------------------------------- # +# CPU control pseudo-device. Provides access to MSRs, CPUID info and +# microcode update feature. +# +device cpuctl + +# # System Management Bus (SMB) # options ENABLE_ALART # Control alarm on Intel intpm driver Modified: stable/7/sys/i386/i386/support.s ============================================================================== --- stable/7/sys/i386/i386/support.s Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/i386/i386/support.s Mon Jan 12 15:48:22 2009 (r187099) @@ -1568,3 +1568,52 @@ NON_GPROF_ENTRY(__bb_init_func) movl %edx,16(%eax) movl %eax,bbhead NON_GPROF_RET + +/* + * Support for reading MSRs in the safe manner. + */ +ENTRY(rdmsr_safe) +/* int rdmsr_safe(u_int msr, uint64_t *data) */ + movl PCPU(CURPCB),%ecx + movl $msr_onfault,PCB_ONFAULT(%ecx) + + movl 4(%esp),%ecx + rdmsr + movl 8(%esp),%ecx + movl %eax,(%ecx) + movl %edx,4(%ecx) + xorl %eax,%eax + + movl PCPU(CURPCB),%ecx + movl %eax,PCB_ONFAULT(%ecx) + + ret + +/* + * Support for writing MSRs in the safe manner. + */ +ENTRY(wrmsr_safe) +/* int wrmsr_safe(u_int msr, uint64_t data) */ + movl PCPU(CURPCB),%ecx + movl $msr_onfault,PCB_ONFAULT(%ecx) + + movl 4(%esp),%ecx + movl 8(%esp),%eax + movl 12(%esp),%edx + wrmsr + xorl %eax,%eax + + movl PCPU(CURPCB),%ecx + movl %eax,PCB_ONFAULT(%ecx) + + ret + +/* + * MSR operations fault handler + */ + ALIGN_TEXT +msr_onfault: + movl PCPU(CURPCB),%ecx + movl $0,PCB_ONFAULT(%ecx) + movl $EFAULT,%eax + ret Modified: stable/7/sys/i386/include/cpufunc.h ============================================================================== --- stable/7/sys/i386/include/cpufunc.h Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/i386/include/cpufunc.h Mon Jan 12 15:48:22 2009 (r187099) @@ -735,4 +735,9 @@ void wrmsr(u_int msr, uint64_t newval); void reset_dbregs(void); +#ifdef _KERNEL +int rdmsr_safe(u_int msr, uint64_t *val); +int wrmsr_safe(u_int msr, uint64_t newval); +#endif + #endif /* !_MACHINE_CPUFUNC_H_ */ Modified: stable/7/sys/i386/include/specialreg.h ============================================================================== --- stable/7/sys/i386/include/specialreg.h Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/i386/include/specialreg.h Mon Jan 12 15:48:22 2009 (r187099) @@ -163,6 +163,12 @@ #define AMDID_CMP_CORES 0x000000ff /* + * CPUID manufacturers identifiers + */ +#define INTEL_VENDOR_ID "GenuineIntel" +#define AMD_VENDOR_ID "AuthenticAMD" + +/* * Model-specific registers for the i386 family */ #define MSR_P5_MC_ADDR 0x000 @@ -450,6 +456,7 @@ /* AMD64 MSR's */ #define MSR_EFER 0xc0000080 /* extended features */ +#define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ /* VIA ACE crypto featureset: for via_feature_rng */ #define VIA_HAS_RNG 1 /* cpu has RNG */ Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/modules/Makefile Mon Jan 12 15:48:22 2009 (r187099) @@ -61,6 +61,7 @@ SUBDIR= ${_3dfx} \ ${_coff} \ ${_coretemp} \ ${_cp} \ + ${_cpuctl} \ ${_cpufreq} \ ${_crypto} \ ${_cryptodev} \ @@ -390,6 +391,7 @@ _cbb= cbb _ce= ce _coff= coff _cp= cp +_cpuctl= cpuctl _cpufreq= cpufreq _cs= cs .if ${MK_CDDL} != "no" || defined(ALL_MODULES) @@ -525,6 +527,7 @@ _cbb= cbb _cmx= cmx _ciss= ciss _coretemp= coretemp +_cpuctl= cpuctl _cpufreq= cpufreq .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _cyclic= cyclic Copied: stable/7/sys/sys/cpuctl.h (from r181430, head/sys/sys/cpuctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sys/cpuctl.h Mon Jan 12 15:48:22 2009 (r187099, copy of r181430, head/sys/sys/cpuctl.h) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2006-2008 Stanislav Sedov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _CPUCTL_H_ +#define _CPUCTL_H_ + +typedef struct { + int msr; /* MSR to read */ + uint64_t data; +} cpuctl_msr_args_t; + +typedef struct { + int level; /* CPUID level */ + uint32_t data[4]; +} cpuctl_cpuid_args_t; + +typedef struct { + void *data; + size_t size; +} cpuctl_update_args_t; + +#define CPUCTL_RDMSR _IOWR('c', 1, cpuctl_msr_args_t) +#define CPUCTL_WRMSR _IOWR('c', 2, cpuctl_msr_args_t) +#define CPUCTL_CPUID _IOWR('c', 3, cpuctl_cpuid_args_t) +#define CPUCTL_UPDATE _IOWR('c', 4, cpuctl_update_args_t) + +#endif /* _CPUCTL_H_ */ Modified: stable/7/sys/sys/priv.h ============================================================================== --- stable/7/sys/sys/priv.h Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/sys/priv.h Mon Jan 12 15:48:22 2009 (r187099) @@ -455,9 +455,15 @@ #define PRIV_NNPFS_DEBUG 630 /* Perforn ARLA_VIOC_NNPFSDEBUG. */ /* + * cpuctl(4) privileges. + */ +#define PRIV_CPUCTL_WRMSR 640 /* Write model-specific register. */ +#define PRIV_CPUCTL_UPDATE 641 /* Update cpu microcode. */ + +/* * Track end of privilege list. */ -#define _PRIV_HIGHEST 631 +#define _PRIV_HIGHEST 642 /* * Validate that a named privilege is known by the privilege system. Invalid Modified: stable/7/usr.sbin/Makefile ============================================================================== --- stable/7/usr.sbin/Makefile Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/usr.sbin/Makefile Mon Jan 12 15:48:22 2009 (r187099) @@ -34,6 +34,7 @@ SUBDIR= ac \ ckdist \ clear_locks \ config \ + ${_cpucontrol} \ crashinfo \ cron \ crunch \ @@ -302,6 +303,7 @@ _apm= apm _apmd= apmd _asf= asf _btxld= btxld +_cpucontrol= cpucontrol .if ${MK_I4B} != "no" _i4b= i4b .endif @@ -340,6 +342,7 @@ _acpi= acpi _asf= asf _boot0cfg= boot0cfg _btxld= btxld +_cpucontrol= cpucontrol _kgmon= kgmon _lptcontrol= lptcontrol .if ${MK_NCP} != "no" Modified: stable/7/usr.sbin/cpucontrol/cpucontrol.8 ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.8 Fri Aug 8 16:26:53 2008 (r181430) +++ stable/7/usr.sbin/cpucontrol/cpucontrol.8 Mon Jan 12 15:48:22 2009 (r187099) @@ -55,33 +55,36 @@ device. .Sh DESCRIPTION The .Nm -utility can be used to read and write an arbitrary machine-specific -CPU registers via +utility can be used to read and write arbitrary machine-specific +CPU registers via the .Xr cpuctl 4 -controlled special device and apply the CPU firmware updates. +special device. +It can also be used to apply CPU firmware updates. .Pp The following options are available: .Bl -tag -width indent .It Fl d Ar datadir -Where to look for microcode images. The option can be specified multiple times. +Where to look for microcode images. +The option can be specified multiple times. .It Fl m Ar msr Ns Op = Ns Ar value -Read/write the specified MSR. Both the MSR and the value should be given as a hex number. +Read/write the specified MSR. +Both the MSR and the value should be given as a hex number. .It Fl i Ar level -Retrieve CPUID info. Level should be given as a hex number. +Retrieve CPUID info. +Level should be given as a hex number. .It Fl u -Apply CPU firmware updates. The +Apply CPU firmware updates. +The .Nm utility will walk through the configured data directories -and will apply all firmware patches available for this CPU. +and apply all firmware updates available for this CPU. .It Fl v Increase the verbosity level. .It Fl h Show help message. .El .Sh EXIT STATUS -The -.Nm -utility exits 0 on success, and >0 if an error occurs. +.Ex -std .Sh EXAMPLES The command .Pp @@ -93,20 +96,24 @@ To set the CPU 0 TSC MSR register value .Pp .Dq Li "cpucontrol -m 0x10=0x1 /dev/cpuctl0" .Pp -.Pp The command .Pp .Dq Li "cpucontrol -i 0x1 /dev/cpuctl1" .Pp will retrieve the CPUID level 0x1 from CPU 1. .Pp -To perform firmware updated on CPU 0 from images located at +To perform firmware updates on CPU 0 from images located at .Pa /usr/local/share/cpuctl/ use the following command: .Pp .Dq Li "cpucontrol -d /usr/local/share/cpuctl/ -u /dev/cpuctl0" .Sh SEE ALSO .Xr cpuctl 4 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 8.0 . .Sh BUGS Yes, probably, report if any. .Sh AUTHORS Modified: stable/7/usr.sbin/cpucontrol/cpucontrol.c ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.c Fri Aug 8 16:26:53 2008 (r181430) +++ stable/7/usr.sbin/cpucontrol/cpucontrol.c Mon Jan 12 15:48:22 2009 (r187099) @@ -146,12 +146,12 @@ do_cpuid(const char *cmdarg, const char args.level = level; fd = open(dev, O_RDONLY); if (fd < 0) { - WARNX(0, "error opening %s for reading", dev); + WARN(0, "error opening %s for reading", dev); return (1); } error = ioctl(fd, CPUCTL_CPUID, &args); if (error < 0) { - WARNX(0, "ioctl(%s, CPUCTL_CPUID)", dev); + WARN(0, "ioctl(%s, CPUCTL_CPUID)", dev); close(fd); return (error); } @@ -198,13 +198,13 @@ do_msr(const char *cmdarg, const char *d args.msr = msr; fd = open(dev, wr == 0 ? O_RDONLY : O_WRONLY); if (fd < 0) { - WARNX(0, "error opening %s for %s", dev, + WARN(0, "error opening %s for %s", dev, wr == 0 ? "reading" : "writing"); return (1); } error = ioctl(fd, wr == 0 ? CPUCTL_RDMSR : CPUCTL_WRMSR, &args); if (error < 0) { - WARNX(0, "ioctl(%s, %s)", dev, + WARN(0, "ioctl(%s, %s)", dev, wr == 0 ? "CPUCTL_RDMSR" : "CPUCTL_WRMSR"); close(fd); return (1); @@ -230,7 +230,7 @@ do_update(const char *dev) fd = open(dev, O_RDONLY); if (fd < 0) { - WARNX(0, "error opening %s for reading", dev); + WARN(0, "error opening %s for reading", dev); return (1); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 17:19:19 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CDD11065676; Mon, 12 Jan 2009 17:19:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 274C98FC22; Mon, 12 Jan 2009 17:19:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CHJJb2071746; Mon, 12 Jan 2009 17:19:19 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CHJIW0071709; Mon, 12 Jan 2009 17:19:18 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901121719.n0CHJIW0071709@svn.freebsd.org> From: Sam Leffler Date: Mon, 12 Jan 2009 17:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187106 - in stable/7: etc etc/periodic/daily etc/periodic/monthly etc/periodic/security etc/periodic/weekly gnu gnu/usr.bin lib libexec sbin share share/mk tools/build tools/build/opti... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 17:19:20 -0000 Author: sam Date: Mon Jan 12 17:19:17 2009 New Revision: 187106 URL: http://svn.freebsd.org/changeset/base/187106 Log: sync build infrastructure changes with HEAD Reviewed by: imp Added: stable/7/tools/build/options/WITHOUT_ACCT - copied unchanged from r183242, head/tools/build/options/WITHOUT_ACCT stable/7/tools/build/options/WITHOUT_AMD - copied unchanged from r183242, head/tools/build/options/WITHOUT_AMD stable/7/tools/build/options/WITHOUT_APM - copied unchanged from r183242, head/tools/build/options/WITHOUT_APM stable/7/tools/build/options/WITHOUT_AT - copied unchanged from r183242, head/tools/build/options/WITHOUT_AT stable/7/tools/build/options/WITHOUT_CTM - copied unchanged from r183242, head/tools/build/options/WITHOUT_CTM stable/7/tools/build/options/WITHOUT_FREEBSD_UPDATE - copied unchanged from r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE stable/7/tools/build/options/WITHOUT_IPFW - copied unchanged from r183242, head/tools/build/options/WITHOUT_IPFW stable/7/tools/build/options/WITHOUT_JAIL - copied unchanged from r183242, head/tools/build/options/WITHOUT_JAIL stable/7/tools/build/options/WITHOUT_LEGACY_CONSOLE - copied unchanged from r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE stable/7/tools/build/options/WITHOUT_LOCATE - copied unchanged from r183242, head/tools/build/options/WITHOUT_LOCATE stable/7/tools/build/options/WITHOUT_MAIL - copied unchanged from r183242, head/tools/build/options/WITHOUT_MAIL stable/7/tools/build/options/WITHOUT_MAKE - copied unchanged from r183242, head/tools/build/options/WITHOUT_MAKE stable/7/tools/build/options/WITHOUT_NDIS - copied unchanged from r183242, head/tools/build/options/WITHOUT_NDIS stable/7/tools/build/options/WITHOUT_NETGRAPH - copied unchanged from r183242, head/tools/build/options/WITHOUT_NETGRAPH stable/7/tools/build/options/WITHOUT_NTP - copied unchanged from r183242, head/tools/build/options/WITHOUT_NTP stable/7/tools/build/options/WITHOUT_PKGTOOLS - copied unchanged from r183242, head/tools/build/options/WITHOUT_PKGTOOLS stable/7/tools/build/options/WITHOUT_PMC - copied unchanged from r183242, head/tools/build/options/WITHOUT_PMC stable/7/tools/build/options/WITHOUT_PORTSNAP - copied unchanged from r183242, head/tools/build/options/WITHOUT_PORTSNAP stable/7/tools/build/options/WITHOUT_PPP - copied unchanged from r183242, head/tools/build/options/WITHOUT_PPP stable/7/tools/build/options/WITHOUT_QUOTAS - copied unchanged from r183242, head/tools/build/options/WITHOUT_QUOTAS stable/7/tools/build/options/WITHOUT_ROUTED - copied unchanged from r183242, head/tools/build/options/WITHOUT_ROUTED stable/7/tools/build/options/WITHOUT_SLIP - copied unchanged from r183242, head/tools/build/options/WITHOUT_SLIP stable/7/tools/build/options/WITHOUT_SYSINSTALL - copied unchanged from r183242, head/tools/build/options/WITHOUT_SYSINSTALL stable/7/tools/build/options/WITHOUT_TELNET - copied unchanged from r183242, head/tools/build/options/WITHOUT_TELNET stable/7/tools/build/options/WITHOUT_TEXTPROC - copied unchanged from r183242, head/tools/build/options/WITHOUT_TEXTPROC stable/7/tools/build/options/WITHOUT_WIRELESS - copied unchanged from r183242, head/tools/build/options/WITHOUT_WIRELESS Modified: stable/7/etc/ (props changed) stable/7/etc/Makefile stable/7/etc/periodic/daily/Makefile stable/7/etc/periodic/monthly/Makefile stable/7/etc/periodic/security/Makefile stable/7/etc/periodic/weekly/Makefile stable/7/gnu/ (props changed) stable/7/gnu/usr.bin/Makefile stable/7/lib/ (props changed) stable/7/lib/Makefile stable/7/libexec/ (props changed) stable/7/libexec/Makefile stable/7/sbin/ (props changed) stable/7/sbin/Makefile stable/7/share/ (props changed) stable/7/share/Makefile stable/7/share/mk/ (props changed) stable/7/share/mk/bsd.own.mk stable/7/tools/build/ (props changed) stable/7/usr.bin/ (props changed) stable/7/usr.bin/Makefile stable/7/usr.sbin/ (props changed) stable/7/usr.sbin/Makefile Modified: stable/7/etc/Makefile ============================================================================== --- stable/7/etc/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/etc/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -7,22 +7,19 @@ SUBDIR= sendmail .endif -BIN1= amd.map apmd.conf auth.conf \ - crontab csh.cshrc csh.login csh.logout devd.conf devfs.conf \ - ddb.conf dhclient.conf disktab fbtab freebsd-update.conf \ +BIN1= auth.conf \ + crontab devd.conf devfs.conf \ + ddb.conf dhclient.conf disktab fbtab \ ftpusers gettytab group \ - hosts hosts.allow hosts.equiv hosts.lpd \ + hosts hosts.allow hosts.equiv \ inetd.conf libalias.conf login.access login.conf mac.conf motd \ netconfig network.subr networks newsyslog.conf nsswitch.conf \ - portsnap.conf pf.os phones profile protocols \ + phones profile protocols \ rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \ rc.sendmail rc.shutdown \ rc.subr remote rpc services shells \ - snmpd.config sysctl.conf syslog.conf \ - etc.${MACHINE_ARCH}/ttys \ - ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \ - ${.CURDIR}/../usr.bin/mail/misc/mail.rc \ - ${.CURDIR}/../usr.bin/locate/locate/locate.rc + sysctl.conf syslog.conf \ + etc.${MACHINE_ARCH}/ttys OPENBSMDIR= ${.CURDIR}/../contrib/openbsm BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \ @@ -32,12 +29,38 @@ BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/ BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn BSM_ETC_DIR= ${DESTDIR}/etc/security +# NB: keep these sorted by MK_* knobs + +.if ${MK_AMD} != "no" +BIN1+= amd.map +.endif + +.if ${MK_APM} != "no" +BIN1+= apmd.conf +.endif + +.if ${MK_BSNMP} != "no" +BIN1+= snmpd.config +.endif + +.if ${MK_FREEBSD_UPDATE} != "no" +BIN1+= freebsd-update.conf +.endif + +.if ${MK_LOCATE} != "no" +BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc +.endif + .if ${MK_LPR} != "no" -BIN1+= printcap +BIN1+= hosts.lpd printcap .endif -.if ${MK_NS_CACHING} != "no" -BIN1+= nscd.conf +.if ${MK_MAIL} != "no" +BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc +.endif + +.if ${MK_MAN} != "no" +BIN1+= ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config .endif .if ${MK_OPENSSH} != "no" @@ -49,6 +72,22 @@ SSH= ${.CURDIR}/../crypto/openssh/ssh_co SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf .endif +.if ${MK_NS_CACHING} != "no" +BIN1+= nscd.conf +.endif + +.if ${MK_PORTSNAP} != "no" +BIN1+= portsnap.conf +.endif + +.if ${MK_PF} != "no" +BIN1+= pf.os +.endif + +.if ${MK_TCSH} != "no" +BIN1+= csh.cshrc csh.login csh.logout +.endif + # -rwxr-xr-x root:wheel, for the new cron root:wheel BIN2= netstart pccard_ether rc.suspend rc.resume @@ -109,10 +148,15 @@ distribution: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \ ${BIN2} ${DESTDIR}/etc; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ - master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \ - pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \ - ${DESTDIR}/etc/master.passwd + master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; +.if ${MK_TCSH} == "no" + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd +.endif + pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \ + ${DESTDIR}/etc/master.passwd +.if ${MK_BLUETOOTH} != "no" ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install +.endif ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install @@ -157,18 +201,25 @@ distribution: .endif cd ${.CURDIR}/root; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ + dot.profile ${DESTDIR}/root/.profile; \ + rm -f ${DESTDIR}/.profile; \ + ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile +.if ${MK_TCSH} != "no" + cd ${.CURDIR}/root; \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ dot.cshrc ${DESTDIR}/root/.cshrc; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ dot.login ${DESTDIR}/root/.login; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - dot.profile ${DESTDIR}/root/.profile; \ - rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \ - ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \ - ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile + rm -f ${DESTDIR}/.cshrc; \ + ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc +.endif cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${MTREE} ${DESTDIR}/etc/mtree +.if ${MK_PPP} != "no" cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ ${PPPCNF} ${DESTDIR}/etc/ppp +.endif +.if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${ETCMAIL} ${DESTDIR}/etc/mail @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ @@ -176,6 +227,7 @@ distribution: set -x; \ ln -s mail/aliases ${DESTDIR}/etc/aliases; \ fi +.endif ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \ ${DESTDIR}/etc/dumpdates ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \ Modified: stable/7/etc/periodic/daily/Makefile ============================================================================== --- stable/7/etc/periodic/daily/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/etc/periodic/daily/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -1,15 +1,11 @@ # $FreeBSD$ +.include + FILES= 100.clean-disks \ 110.clean-tmps \ 120.clean-preserve \ - 130.clean-msgs \ - 140.clean-rwho \ - 150.clean-hoststat \ 200.backup-passwd \ - 210.backup-aliases \ - 300.calendar \ - 310.accounting \ 330.news \ 400.status-disks \ 404.status-zfs \ @@ -19,13 +15,42 @@ FILES= 100.clean-disks \ 408.status-gstripe \ 409.status-gconcat \ 420.status-network \ - 430.status-rwho \ - 440.status-mailq \ 450.status-security \ - 460.status-mail-rejects \ - 470.status-named \ - 480.status-ntpd \ - 500.queuerun \ 999.local +# NB: keep these sorted by MK_* knobs + +.if ${MK_ACCT} != "no" +FILES+= 310.accounting +.endif + +.if ${MK_BIND_NAMED} != "no" +FILES+= 470.status-named +.endif + +.if ${MK_CALENDAR} != "no" +FILES+= 300.calendar +.endif + +.if ${MK_MAIL} != "no" +FILES+= 130.clean-msgs +.endif + +.if ${MK_NTP} != "no" +FILES+= 480.status-ntpd +.endif + +.if ${MK_RCMDS} != "no" +FILES+= 140.clean-rwho \ + 430.status-rwho +.endif + +.if ${MK_SENDMAIL} != "no" +FILES+= 150.clean-hoststat \ + 210.backup-aliases \ + 440.status-mailq \ + 460.status-mail-rejects \ + 500.queuerun +.endif + .include Modified: stable/7/etc/periodic/monthly/Makefile ============================================================================== --- stable/7/etc/periodic/monthly/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/etc/periodic/monthly/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -1,6 +1,13 @@ # $FreeBSD$ -FILES= 200.accounting \ - 999.local +.include + +FILES= 999.local + +# NB: keep these sorted by MK_* knobs + +.if ${MK_ACCT} != "no" +FILES+= 200.accounting +.endif .include Modified: stable/7/etc/periodic/security/Makefile ============================================================================== --- stable/7/etc/periodic/security/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/etc/periodic/security/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -1,17 +1,30 @@ # $FreeBSD$ +.include + FILES= 100.chksetuid \ 200.chkmounts \ 300.chkuid0 \ 400.passwdless \ 410.logincheck \ - 500.ipfwdenied \ - 510.ipfdenied \ - 520.pfdenied \ - 550.ipfwlimit \ 700.kernelmsg \ 800.loginfail \ 900.tcpwrap \ security.functions +# NB: keep these sorted by MK_* knobs + +.if ${MK_IPFILTER} != "no" +FILES+= 510.ipfdenied +.endif + +.if ${MK_IPFW} != "no" +FILES+= 500.ipfwdenied \ + 550.ipfwlimit +.endif + +.if ${MK_PF} != "no" +FILES+= 520.pfdenied +.endif + .include Modified: stable/7/etc/periodic/weekly/Makefile ============================================================================== --- stable/7/etc/periodic/weekly/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/etc/periodic/weekly/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -1,10 +1,22 @@ # $FreeBSD$ -FILES= 310.locate \ - 320.whatis \ - 330.catman \ - 340.noid \ - 400.status-pkg \ +.include + +FILES= 340.noid \ 999.local +# NB: keep these sorted by MK_* knobs + +.if ${MK_LOCATE} != "no" +FILES+= 310.locate +.endif + +.if ${MK_MAN} != "no" +FILES+= 320.whatis 330.catman +.endif + +.if ${MK_PKGTOOLS} != "no" +FLES+= 400.status-pkg +.endif + .include Modified: stable/7/gnu/usr.bin/Makefile ============================================================================== --- stable/7/gnu/usr.bin/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/gnu/usr.bin/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -34,12 +34,16 @@ _groff= groff _cvs= cvs .endif +.if ${MK_INFO} != "no" +_texinfo= texinfo +.endif + .if ${MK_MAN} != "no" _man= man .endif -.if ${MK_INFO} != "no" -_texinfo= texinfo +.if ${MK_RCS} != "no" +_rcs= rcs .endif .if ${MK_TOOLCHAIN} != "no" @@ -49,8 +53,5 @@ _cc= cc _gdb= gdb .endif .endif -.if ${MK_RCS} != "no" -_rcs= rcs -.endif .include Modified: stable/7/lib/Makefile ============================================================================== --- stable/7/lib/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/lib/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -26,17 +26,17 @@ # Otherwise, the SUBDIR list should be in alphabetical order. SUBDIR= ${_csu} libc libbsm libcom_err libcrypt libelf libkvm msun libmd \ - ncurses libnetgraph libradius librpcsvc libsbuf libtacplus libutil \ - ${_libypclnt} libalias libarchive ${_libatm} \ - libbegemot ${_libbluetooth} libbsnmp libbz2 \ + ncurses ${_libnetgraph} libradius librpcsvc libsbuf \ + libtacplus libutil ${_libypclnt} libalias libarchive ${_libatm} \ + libbegemot ${_libbluetooth} ${_libbsnmp} libbz2 \ libcalendar libcam libcompat libdevinfo libdevstat libdisk \ libdwarf libedit libexpat libfetch libftpio libgeom ${_libgpib} \ ${_libgssapi} libipsec \ ${_libipx} libkiconv libmagic libmemstat ${_libmilter} ${_libmp} \ ${_libncp} ${_libngatm} libopie libpam libpcap \ - libpmc libproc ${_libkse} librt ${_libsdp} ${_libsm} ${_libsmb} \ + ${_libpmc} libproc ${_libkse} librt ${_libsdp} ${_libsm} ${_libsmb} \ ${_libsmdb} \ - ${_libsmutil} libstand libtelnet ${_libthr} libthread_db libufs \ + ${_libsmutil} libstand ${_libtelnet} ${_libthr} libthread_db libufs \ libugidfw ${_libusbhid} ${_libvgl} libwrap liby libz ${_bind} .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) @@ -47,6 +47,8 @@ _csu=csu/${MACHINE_ARCH} _csu=csu .endif +# NB: keep these sorted by MK_* knobs + .if ${MK_ATM} != "no" _libngatm= libngatm .endif @@ -60,6 +62,14 @@ _libbluetooth= libbluetooth _libsdp= libsdp .endif +.if ${MK_BSNMP} != "no" +_libbsnmp= libbsnmp +.endif + +.if ${MK_GPIB} != "no" +_libgpib= libgpib +.endif + .if ${MK_GSSAPI} != "no" _libgssapi= libgssapi .endif @@ -68,6 +78,22 @@ _libgssapi= libgssapi _libipx= libipx .endif +.if ${MK_LIBKSE} != "no" +_libkse= libkse +.endif + +.if ${MK_LIBTHR} != "no" +_libthr= libthr +.endif + +.if ${MK_NETGRAPH} != "no" +_libnetgraph= libnetgraph +.endif + +.if ${MK_NIS} != "no" +_libypclnt= libypclnt +.endif + .if ${MACHINE_ARCH} == "i386" .if ${MK_NCP} != "no" _libncp= libncp @@ -80,17 +106,6 @@ _libvgl= libvgl _libsmb= libsmb .endif -.if ${MK_SENDMAIL} != "no" -_libmilter= libmilter -_libsm= libsm -_libsmdb= libsmdb -_libsmutil= libsmutil -.endif - -.if ${MK_OPENSSL} != "no" -_libmp= libmp -.endif - .if ${MACHINE_ARCH} == "amd64" .if ${MK_NCP} != "no" _libncp= libncp @@ -102,24 +117,27 @@ _libsmb= libsmb _libsmb= libsmb .endif -.if ${MK_LIBKSE} != "no" -_libkse= libkse +.if ${MK_OPENSSL} != "no" +_libmp= libmp .endif -.if ${MK_LIBTHR} != "no" -_libthr= libthr +.if ${MK_PMC} != "no" +_libpmc= libpmc .endif -.if ${MK_USB} != "no" -_libusbhid= libusbhid +.if ${MK_SENDMAIL} != "no" +_libmilter= libmilter +_libsm= libsm +_libsmdb= libsmdb +_libsmutil= libsmutil .endif -.if ${MK_NIS} != "no" -_libypclnt= libypclnt +.if ${MK_TELNET} != "no" +_libtelnet= libtelnet .endif -.if ${MK_GPIB} != "no" -_libgpib= libgpib +.if ${MK_USB} != "no" +_libusbhid= libusbhid .endif .include Modified: stable/7/libexec/Makefile ============================================================================== --- stable/7/libexec/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/libexec/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -3,9 +3,9 @@ .include -SUBDIR= atrun \ +SUBDIR= ${_atrun} \ bootpd \ - comsat \ + ${_comsat} \ fingerd \ ftpd \ getty \ @@ -13,7 +13,7 @@ SUBDIR= atrun \ ${_mail.local} \ makekey \ ${_mknetid} \ - pppoed \ + ${_pppoed} \ pt_chown \ rbootd \ revnetgroup \ @@ -29,16 +29,28 @@ SUBDIR= atrun \ ${_smrsh} \ talkd \ tcpd \ - telnetd \ + ${_telnetd} \ tftpd \ ${_tftp-proxy} \ ${_ypxfr} +.if ${MK_AT} != "no" +_atrun= atrun +.endif + +.if ${MK_MAIL} != "no" +_comsat= comsat +.endif + .if ${MK_NIS} != "no" _mknetid= mknetid _ypxfr= ypxfr .endif +.if ${MK_NETGRAPH} != "no" +_pppoed= pppoed +.endif + .if ${MK_PF} != "no" _tftp-proxy= tftp-proxy .endif @@ -54,7 +66,11 @@ _rshd= rshd .if ${MK_SENDMAIL} != "no" _mail.local= mail.local -_smrsh= smrsh +_smrsh= smrsh +.endif + +.if ${MK_TELNET} != "no" +_telnetd= telnetd .endif .include Modified: stable/7/sbin/Makefile ============================================================================== --- stable/7/sbin/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/sbin/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -41,7 +41,7 @@ SUBDIR= adjkerntz \ ifconfig \ init \ ${_ipf} \ - ipfw \ + ${_ipfw} \ iscontrol \ kldconfig \ kldload \ @@ -62,7 +62,7 @@ SUBDIR= adjkerntz \ mount_nullfs \ mount_udf \ mount_unionfs \ - natd \ + ${_natd} \ newfs \ newfs_msdos \ nfsiod \ @@ -71,13 +71,13 @@ SUBDIR= adjkerntz \ ${_pflogd} \ ping \ ${_ping6} \ - quotacheck \ + ${_quotacheck} \ rcorder \ reboot \ recoverdisk \ restore \ route \ - routed \ + ${_routed} \ ${_rtsol} \ savecore \ ${_sconfig} \ @@ -85,7 +85,7 @@ SUBDIR= adjkerntz \ shutdown \ slattach \ spppcontrol \ - startslip \ + ${_startslip} \ sunlabel \ swapon \ sysctl \ @@ -104,6 +104,11 @@ _devd= devd _ipf= ipf .endif +.if ${MK_IPFW} != "no" +_ipfw= ipfw +_natd= natd +.endif + .if ${MK_PF} != "no" _pfctl= pfctl _pflogd= pflogd @@ -114,6 +119,18 @@ _ping6= ping6 _rtsol= rtsol .endif +.if ${MK_QUOTAS} != "no" +_quotacheck= quotacheck +.endif + +.if ${MK_ROUTED} != "no" +_routed= routed +.endif + +.if ${MK_SLIP} != "no" +_startslip= startslip +.endif + .if ${MACHINE_ARCH} == "i386" .if ${MACHINE} == "i386" _fdisk= fdisk Modified: stable/7/share/Makefile ============================================================================== --- stable/7/share/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/share/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -13,51 +13,57 @@ SUBDIR= ${_colldef} \ ${_man} \ ${_me} \ misc \ - mk \ + ${_mk} \ ${_mklocale} \ ${_monetdef} \ ${_msgdef} \ ${_numericdef} \ ${_sendmail} \ skel \ - snmp \ + ${_snmp} \ ${_syscons} \ tabset \ termcap \ ${_timedef} \ ${_zoneinfo} -.if ${MK_LOCALES} != "no" -_colldef = colldef -_mklocale = mklocale -_monetdef = monetdef -_msgdef = msgdef -_numericdef = numericdef -_timedef = timedef +# NB: keep these sorted by MK_* knobs + +.if ${MK_BSNMP} != "no" +_snmp= snmp .endif -.if ${MK_SYSCONS} != "no" -_syscons= syscons +.if ${MK_DICT} != "no" +_dict= dict .endif -.if ${MK_MAN} != "no" -_man= man +.if ${MK_EXAMPLES} != "no" +_examples= examples .endif .if ${MK_GROFF} != "no" _me= me .endif -.if ${MK_EXAMPLES} != "no" -_examples= examples -.endif - .if ${MK_I4B} != "no" _isdn= isdn .endif -.if ${MK_DICT} != "no" -_dict= dict +.if ${MK_LOCALES} != "no" +_colldef = colldef +_mklocale = mklocale +_monetdef = monetdef +_msgdef = msgdef +_numericdef = numericdef +_timedef = timedef +.endif + +.if ${MK_MAKE} != "no" +_mk= mk +.endif + +.if ${MK_MAN} != "no" +_man= man .endif .if ${MK_SENDMAIL} != "no" @@ -68,6 +74,10 @@ _sendmail= sendmail _doc= doc .endif +.if ${MK_SYSCONS} != "no" +_syscons= syscons +.endif + .if ${MK_ZONEINFO} != "no" _zoneinfo= zoneinfo .endif Modified: stable/7/share/mk/bsd.own.mk ============================================================================== --- stable/7/share/mk/bsd.own.mk Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/share/mk/bsd.own.mk Mon Jan 12 17:19:17 2009 (r187106) @@ -285,8 +285,12 @@ WITH_IDEA= # MK_* options which default to "yes". # .for var in \ + ACCT \ ACPI \ + AMD \ + APM \ ASSERT_DEBUG \ + AT \ ATM \ AUDIT \ AUTHPF \ @@ -299,18 +303,22 @@ WITH_IDEA= BIND_UTILS \ BLUETOOTH \ BOOT \ + BSNMP \ BZIP2 \ CALENDAR \ CDDL \ CPP \ CRYPT \ + CTM \ CVS \ CXX \ DICT \ DYNAMICROOT \ EXAMPLES \ + FLOPPY \ FORTH \ FP_LIBC \ + FREEBSD_UPDATE \ GAMES \ GCOV \ GDB \ @@ -323,41 +331,61 @@ WITH_IDEA= INFO \ INSTALLLIB \ IPFILTER \ + IPFW \ IPX \ + JAIL \ KERBEROS \ KVM \ + LEGACY_CONSOLE \ LIB32 \ LIBPTHREAD \ LIBKSE \ LIBTHR \ LOCALES \ + LOCATE \ LPR \ + MAIL \ MAILWRAPPER \ + MAKE \ MAN \ NCP \ + NDIS \ NETCAT \ + NETGRAPH \ NIS \ NLS \ NLS_CATALOGS \ NS_CACHING \ + NTP \ OBJC \ OPENSSH \ OPENSSL \ PAM \ PF \ + PKGTOOLS \ + PMC \ + PORTSNAP \ + PPP \ PROFILE \ + QUOTAS \ RCMDS \ RCS \ RESCUE \ + ROUTED \ SENDMAIL \ SETUID_LOGIN \ SHAREDOCS \ + SLIP \ SSP \ + SYSINSTALL \ SYMVER \ SYSCONS \ TCSH \ + TELNET \ + TEXTPROC \ TOOLCHAIN \ USB \ + WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZONEINFO \ ZFS @@ -435,6 +463,11 @@ MK_KERBEROS:= no MK_NCP:= no .endif +.if ${MK_MAIL} == "no" +MK_MAILWRAPPER:= no +MK_SENDMAIL:= no +.endif + .if ${MK_OPENSSL} == "no" MK_OPENSSH:= no MK_KERBEROS:= no @@ -444,6 +477,10 @@ MK_KERBEROS:= no MK_AUTHPF:= no .endif +.if ${MK_TEXTPROC} == "no" +MK_GROFF:= no +.endif + .if ${MK_TOOLCHAIN} == "no" MK_GDB:= no .endif @@ -463,7 +500,9 @@ MK_GDB:= no IPX \ KERBEROS \ KVM \ - PAM + NETGRAPH \ + PAM \ + WIRELESS .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. .endif Copied: stable/7/tools/build/options/WITHOUT_ACCT (from r183242, head/tools/build/options/WITHOUT_ACCT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_ACCT Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_ACCT) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build process accounting tools such as +.Xr ac 8 +and +.Xr accton 8 . Copied: stable/7/tools/build/options/WITHOUT_AMD (from r183242, head/tools/build/options/WITHOUT_AMD) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_AMD Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_AMD) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr amd 8 , +and related programs. Copied: stable/7/tools/build/options/WITHOUT_APM (from r183242, head/tools/build/options/WITHOUT_APM) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_APM Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_APM) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build +.Xr apm 8 , +.Xr apmd 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_AT (from r183242, head/tools/build/options/WITHOUT_AT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_AT Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_AT) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr at 1 +and related utilities. Copied: stable/7/tools/build/options/WITHOUT_CTM (from r183242, head/tools/build/options/WITHOUT_CTM) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_CTM Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_CTM) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr ctm 1 +and related utilities. Copied: stable/7/tools/build/options/WITHOUT_FREEBSD_UPDATE (from r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_FREEBSD_UPDATE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build +.Xr freebsd-update 8 . Copied: stable/7/tools/build/options/WITHOUT_IPFW (from r183242, head/tools/build/options/WITHOUT_IPFW) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_IPFW Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_IPFW) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build IPFW tools. Copied: stable/7/tools/build/options/WITHOUT_JAIL (from r183242, head/tools/build/options/WITHOUT_JAIL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_JAIL Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_JAIL) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build tools for the support of jails; e.g. +.Xr jail 8 . Copied: stable/7/tools/build/options/WITHOUT_LEGACY_CONSOLE (from r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_LEGACY_CONSOLE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build programs that support a legacy PC console; e.g. +.Xr kbdcontrol 8 +and +.Xr vidcontrol 8 . Copied: stable/7/tools/build/options/WITHOUT_LOCATE (from r183242, head/tools/build/options/WITHOUT_LOCATE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_LOCATE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_LOCATE) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr locate 1 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_MAIL (from r183242, head/tools/build/options/WITHOUT_MAIL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_MAIL Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_MAIL) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build any mail support (MUA or MTA). Copied: stable/7/tools/build/options/WITHOUT_MAKE (from r183242, head/tools/build/options/WITHOUT_MAKE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_MAKE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_MAKE) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not install +.Xr make 1 +and related support files. Copied: stable/7/tools/build/options/WITHOUT_NDIS (from r183242, head/tools/build/options/WITHOUT_NDIS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_NDIS Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_NDIS) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build programs and libraries +related to NDIS emulation support. Copied: stable/7/tools/build/options/WITHOUT_NETGRAPH (from r183242, head/tools/build/options/WITHOUT_NETGRAPH) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_NETGRAPH Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_NETGRAPH) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build applications to support +.Xr netgraph 4 . Copied: stable/7/tools/build/options/WITHOUT_NTP (from r183242, head/tools/build/options/WITHOUT_NTP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_NTP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_NTP) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr ntpd 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_PKGTOOLS (from r183242, head/tools/build/options/WITHOUT_PKGTOOLS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_PKGTOOLS Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PKGTOOLS) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr pkg_add 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_PMC (from r183242, head/tools/build/options/WITHOUT_PMC) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_PMC Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PMC) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr pmccontrol 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_PORTSNAP (from r183242, head/tools/build/options/WITHOUT_PORTSNAP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_PORTSNAP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PORTSNAP) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr portsnap 8 +and related files. Copied: stable/7/tools/build/options/WITHOUT_PPP (from r183242, head/tools/build/options/WITHOUT_PPP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_PPP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PPP) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr ppp 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_QUOTAS (from r183242, head/tools/build/options/WITHOUT_QUOTAS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_QUOTAS Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_QUOTAS) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr quota 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_ROUTED (from r183242, head/tools/build/options/WITHOUT_ROUTED) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_ROUTED Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_ROUTED) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr routed 8 +utility. Copied: stable/7/tools/build/options/WITHOUT_SLIP (from r183242, head/tools/build/options/WITHOUT_SLIP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_SLIP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_SLIP) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr sliplogin 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_SYSINSTALL (from r183242, head/tools/build/options/WITHOUT_SYSINSTALL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_SYSINSTALL Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_SYSINSTALL) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr sysinstall 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_TELNET (from r183242, head/tools/build/options/WITHOUT_TELNET) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_TELNET Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_TELNET) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr telnet 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_TEXTPROC (from r183242, head/tools/build/options/WITHOUT_TEXTPROC) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_TEXTPROC Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_TEXTPROC) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 17:25:11 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A622106571C; Mon, 12 Jan 2009 17:25:11 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 31C268FC14; Mon, 12 Jan 2009 17:25:10 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 66C1D6D43F; Mon, 12 Jan 2009 17:09:50 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 48EC9844EF; Mon, 12 Jan 2009 18:09:50 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Doug Barton References: <200901092210.n09MA7Xb070527@svn.freebsd.org> <4967DE41.20109@FreeBSD.org> <4967E849.8070100@FreeBSD.org> Date: Mon, 12 Jan 2009 18:09:50 +0100 In-Reply-To: <4967E849.8070100@FreeBSD.org> (Doug Barton's message of "Fri, 09 Jan 2009 16:14:01 -0800") Message-ID: <86k5905u3l.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable-7@freebsd.org, svn-src-stable@freebsd.org, Alexander Motin , src-committers@freebsd.org, Robert Watson , svn-src-all@freebsd.org Subject: Re: svn commit: r186982 - stable/7/usr.sbin/powerd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 17:25:17 -0000 Doug Barton writes: > For something like this it's quite simple, just do the merge in > usr.sbin/powerd. Let's say you want to merge all the changes starting > with r185050: > > Set REPO to something useful like svn+ssh://svn.freebsd.org/base/ > > svn merge -r 185050:186476 $REPO/head/usr.sbin/powerd . This merges everything from *185051* to 186476. Think about it in terms of diff: 'svn diff -r185050:186476' clearly means "compare the tree as it was after r185050 was committed with the tree as it was after r186476 was committed" If you want to merge the change that was committed in r185050, you need to start at r185049. If there aren't many revisions to merge, you can also merge them individually with -cN, which is a shortcut for -r(N-1):N. Perhaps I should document this better on the wiki - my examples all merge individual revisions, not ranges. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 19:16:01 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C048106564A; Mon, 12 Jan 2009 19:16:01 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6134A8FC0C; Mon, 12 Jan 2009 19:16:01 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CJG1A3073981; Mon, 12 Jan 2009 19:16:01 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CJG0MZ073971; Mon, 12 Jan 2009 19:16:00 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901121916.n0CJG0MZ073971@svn.freebsd.org> From: Sam Leffler Date: Mon, 12 Jan 2009 19:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187108 - in stable/7/sys: . arm/conf conf contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 19:16:02 -0000 Author: sam Date: Mon Jan 12 19:16:00 2009 New Revision: 187108 URL: http://svn.freebsd.org/changeset/base/187108 Log: MFC r185478: enable use of modules but disable them by adding MODULES_OVERRIDE="" Modified: stable/7/sys/ (props changed) stable/7/sys/arm/conf/AVILA stable/7/sys/arm/conf/BWCT stable/7/sys/arm/conf/CRB stable/7/sys/arm/conf/EP80219 stable/7/sys/arm/conf/HL200 stable/7/sys/arm/conf/IQ31244 stable/7/sys/arm/conf/KB920X stable/7/sys/arm/conf/SIMICS stable/7/sys/arm/conf/SKYEYE stable/7/sys/conf/Makefile.arm stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/arm/conf/AVILA ============================================================================== --- stable/7/sys/arm/conf/AVILA Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/AVILA Mon Jan 12 19:16:00 2009 (r187108) @@ -31,6 +31,7 @@ options STARTUP_PAGETABLE_ADDR=0x1000000 include "../xscale/ixp425/std.avila" #To statically compile in device wiring instead of /boot/device.hints hints "AVILA.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale Modified: stable/7/sys/arm/conf/BWCT ============================================================================== --- stable/7/sys/arm/conf/BWCT Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/BWCT Mon Jan 12 19:16:00 2009 (r187108) @@ -28,6 +28,7 @@ include "../at91/std.kb920x" #To statically compile in device wiring instead of /boot/device.hints #hints "hints.at91rm9200" hints "BWCT.hints" +makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options DDB Modified: stable/7/sys/arm/conf/CRB ============================================================================== --- stable/7/sys/arm/conf/CRB Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/CRB Mon Jan 12 19:16:00 2009 (r187108) @@ -29,6 +29,7 @@ options STARTUP_PAGETABLE_ADDR=0x0000000 include "../xscale/i8134x/std.crb" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale Modified: stable/7/sys/arm/conf/EP80219 ============================================================================== --- stable/7/sys/arm/conf/EP80219 Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/EP80219 Mon Jan 12 19:16:00 2009 (r187108) @@ -29,6 +29,7 @@ options STARTUP_PAGETABLE_ADDR=0xa00000 include "../xscale/i80321/std.ep80219" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale Modified: stable/7/sys/arm/conf/HL200 ============================================================================== --- stable/7/sys/arm/conf/HL200 Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/HL200 Mon Jan 12 19:16:00 2009 (r187108) @@ -33,6 +33,7 @@ options KERNVIRTADDR=0xc0100000 #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. hints "KB920X.hints" +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options DDB Modified: stable/7/sys/arm/conf/IQ31244 ============================================================================== --- stable/7/sys/arm/conf/IQ31244 Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/IQ31244 Mon Jan 12 19:16:00 2009 (r187108) @@ -30,6 +30,7 @@ options STARTUP_PAGETABLE_ADDR=0xa000000 include "../xscale/i80321/std.iq31244" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale Modified: stable/7/sys/arm/conf/KB920X ============================================================================== --- stable/7/sys/arm/conf/KB920X Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/KB920X Mon Jan 12 19:16:00 2009 (r187108) @@ -25,6 +25,7 @@ include "../at91/std.kb920x" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. hints "KB920X.hints" +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options DDB Modified: stable/7/sys/arm/conf/SIMICS ============================================================================== --- stable/7/sys/arm/conf/SIMICS Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/SIMICS Mon Jan 12 19:16:00 2009 (r187108) @@ -26,6 +26,7 @@ options PHYSADDR=0xc0000000 include "../sa11x0/std.sa11x0" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=strongarm Modified: stable/7/sys/arm/conf/SKYEYE ============================================================================== --- stable/7/sys/arm/conf/SKYEYE Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/SKYEYE Mon Jan 12 19:16:00 2009 (r187108) @@ -27,6 +27,7 @@ options PHYSADDR=0xc0000000 include "../at91/std.kb920x" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=arm9 Modified: stable/7/sys/conf/Makefile.arm ============================================================================== --- stable/7/sys/conf/Makefile.arm Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/conf/Makefile.arm Mon Jan 12 19:16:00 2009 (r187108) @@ -19,9 +19,6 @@ # Which version of config(8) is required. %VERSREQ= 600004 -# Temporary stuff while we're still embryonic -NO_MODULES= - STD8X16FONT?= iso .if !defined(S) @@ -109,6 +106,8 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$ rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \ inflate-tramp.o tmphack.S +MKMODULESENV+= MACHINE=${MACHINE} + %BEFORE_DEPEND %OBJS From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 12 22:37:05 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D34611065674; Mon, 12 Jan 2009 22:37:05 +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 9D8D48FC1D; Mon, 12 Jan 2009 22:37:05 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CMb5NS078342; Mon, 12 Jan 2009 22:37:05 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CMb5o8078340; Mon, 12 Jan 2009 22:37:05 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200901122237.n0CMb5o8078340@svn.freebsd.org> From: Rui Paulo Date: Mon, 12 Jan 2009 22:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187119 - in stable/7/sys: . dev/ata X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 22:37:08 -0000 Author: rpaulo Date: Mon Jan 12 22:37:05 2009 New Revision: 187119 URL: http://svn.freebsd.org/changeset/base/187119 Log: MFC r185268: Add support for Marvell PATA M88SX6121. PR: 129154 Submitted by: João Barros Modified: stable/7/sys/ (props changed) stable/7/sys/dev/ata/ata-chipset.c stable/7/sys/dev/ata/ata-pci.h Modified: stable/7/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/7/sys/dev/ata/ata-chipset.c Mon Jan 12 22:01:49 2009 (r187118) +++ stable/7/sys/dev/ata/ata-chipset.c Mon Jan 12 22:37:05 2009 (r187119) @@ -2555,6 +2555,7 @@ ata_marvell_ident(device_t dev) { ATA_M88SX6041, 0, 4, MV60XX, ATA_SA300, "88SX6041" }, { ATA_M88SX6081, 0, 8, MV60XX, ATA_SA300, "88SX6081" }, { ATA_M88SX6101, 0, 1, MV61XX, ATA_UDMA6, "88SX6101" }, + { ATA_M88SX6121, 0, 1, MV_61XX, ATA_UDMA6, "88SX6121" }, { ATA_M88SX6145, 0, 2, MV61XX, ATA_UDMA6, "88SX6145" }, { 0, 0, 0, 0, 0, 0}}; Modified: stable/7/sys/dev/ata/ata-pci.h ============================================================================== --- stable/7/sys/dev/ata/ata-pci.h Mon Jan 12 22:01:49 2009 (r187118) +++ stable/7/sys/dev/ata/ata-pci.h Mon Jan 12 22:37:05 2009 (r187119) @@ -211,6 +211,7 @@ struct ata_connect_task { #define ATA_M88SX6041 0x604111ab #define ATA_M88SX6081 0x608111ab #define ATA_M88SX6101 0x610111ab +#define ATA_M88SX6121 0x612111ab #define ATA_M88SX6145 0x614511ab #define ATA_MICRON_ID 0x1042 From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 13 01:39:18 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82B961065672; Tue, 13 Jan 2009 01:39:18 +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 707128FC27; Tue, 13 Jan 2009 01:39:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D1dIeH081862; Tue, 13 Jan 2009 01:39:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D1dIVE081861; Tue, 13 Jan 2009 01:39:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901130139.n0D1dIVE081861@svn.freebsd.org> From: Xin LI Date: Tue, 13 Jan 2009 01:39:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187124 - stable/7/sys/dev/ata X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 01:39:19 -0000 Author: delphij Date: Tue Jan 13 01:39:17 2009 New Revision: 187124 URL: http://svn.freebsd.org/changeset/base/187124 Log: Fix build: MV_61XX is spelled as MV61XX in 7-STABLE. Modified: stable/7/sys/dev/ata/ata-chipset.c Modified: stable/7/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/7/sys/dev/ata/ata-chipset.c Tue Jan 13 00:10:50 2009 (r187123) +++ stable/7/sys/dev/ata/ata-chipset.c Tue Jan 13 01:39:17 2009 (r187124) @@ -2555,7 +2555,7 @@ ata_marvell_ident(device_t dev) { ATA_M88SX6041, 0, 4, MV60XX, ATA_SA300, "88SX6041" }, { ATA_M88SX6081, 0, 8, MV60XX, ATA_SA300, "88SX6081" }, { ATA_M88SX6101, 0, 1, MV61XX, ATA_UDMA6, "88SX6101" }, - { ATA_M88SX6121, 0, 1, MV_61XX, ATA_UDMA6, "88SX6121" }, + { ATA_M88SX6121, 0, 1, MV61XX, ATA_UDMA6, "88SX6121" }, { ATA_M88SX6145, 0, 2, MV61XX, ATA_UDMA6, "88SX6145" }, { 0, 0, 0, 0, 0, 0}}; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 13 09:24:55 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C7991065672; Tue, 13 Jan 2009 09:24:55 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B41D8FC18; Tue, 13 Jan 2009 09:24:55 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D9Ot8K095626; Tue, 13 Jan 2009 09:24:55 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D9OtDc095625; Tue, 13 Jan 2009 09:24:55 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200901130924.n0D9OtDc095625@svn.freebsd.org> From: Christian Brueffer Date: Tue, 13 Jan 2009 09:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187136 - stable/7/share/man/man9 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 09:24:57 -0000 Author: brueffer Date: Tue Jan 13 09:24:55 2009 New Revision: 187136 URL: http://svn.freebsd.org/changeset/base/187136 Log: MFC: r186953 DEBUG_REDZONE needs DDB which needs KDB. Modified: stable/7/share/man/man9/ (props changed) stable/7/share/man/man9/redzone.9 Modified: stable/7/share/man/man9/redzone.9 ============================================================================== --- stable/7/share/man/man9/redzone.9 Tue Jan 13 09:21:11 2009 (r187135) +++ stable/7/share/man/man9/redzone.9 Tue Jan 13 09:24:55 2009 (r187136) @@ -24,13 +24,15 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2006 +.Dd January 9, 2009 .Dt REDZONE 9 .Os .Sh NAME .Nm RedZone .Nd "buffer corruptions detector" .Sh SYNOPSIS +.Cd "options KDB" +.Cd "options DDB" .Cd "options DEBUG_REDZONE" .Sh DESCRIPTION .Nm From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 13 16:17:23 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5876B1065672; Tue, 13 Jan 2009 16:17:23 +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 429BB8FC21; Tue, 13 Jan 2009 16:17:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DGHNsa008247; Tue, 13 Jan 2009 16:17:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DGHNGi008246; Tue, 13 Jan 2009 16:17:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901131617.n0DGHNGi008246@svn.freebsd.org> From: Alexander Motin Date: Tue, 13 Jan 2009 16:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187152 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sound/pci/hda X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 16:17:24 -0000 Author: mav Date: Tue Jan 13 16:17:22 2009 New Revision: 187152 URL: http://svn.freebsd.org/changeset/base/187152 Log: MRC rev. 186912, 187020, 187052: Add external connector jack color into widget names. It should help users to identify them while reading verbose messages. Add one more bunch of controller and codec IDs. Fix unwanted crosschannel mixing, possible on some codecs like VIA VT1708B and Realtek ALC268. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sound/pci/hda/hdac.c Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 16:15:49 2009 (r187151) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 16:17:22 2009 (r187152) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20081226_0122" +#define HDA_DRV_TEST_REV "20090110_0123" SND_DECLARE_FILE("$FreeBSD$"); @@ -149,6 +149,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HDA_INTEL_82801H HDA_MODEL_CONSTRUCT(INTEL, 0x284b) #define HDA_INTEL_82801I HDA_MODEL_CONSTRUCT(INTEL, 0x293e) #define HDA_INTEL_82801J HDA_MODEL_CONSTRUCT(INTEL, 0x3a3e) +#define HDA_INTEL_PCH HDA_MODEL_CONSTRUCT(INTEL, 0x3b56) #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) @@ -178,6 +179,19 @@ SND_DECLARE_FILE("$FreeBSD$"); #define ATI_VENDORID 0x1002 #define HDA_ATI_SB450 HDA_MODEL_CONSTRUCT(ATI, 0x437b) #define HDA_ATI_SB600 HDA_MODEL_CONSTRUCT(ATI, 0x4383) +#define HDA_ATI_RS600 HDA_MODEL_CONSTRUCT(ATI, 0x793b) +#define HDA_ATI_RS690 HDA_MODEL_CONSTRUCT(ATI, 0x7919) +#define HDA_ATI_RS780 HDA_MODEL_CONSTRUCT(ATI, 0x960f) +#define HDA_ATI_R600 HDA_MODEL_CONSTRUCT(ATI, 0xaa00) +#define HDA_ATI_RV630 HDA_MODEL_CONSTRUCT(ATI, 0xaa08) +#define HDA_ATI_RV610 HDA_MODEL_CONSTRUCT(ATI, 0xaa10) +#define HDA_ATI_RV670 HDA_MODEL_CONSTRUCT(ATI, 0xaa18) +#define HDA_ATI_RV635 HDA_MODEL_CONSTRUCT(ATI, 0xaa20) +#define HDA_ATI_RV620 HDA_MODEL_CONSTRUCT(ATI, 0xaa28) +#define HDA_ATI_RV770 HDA_MODEL_CONSTRUCT(ATI, 0xaa30) +#define HDA_ATI_RV730 HDA_MODEL_CONSTRUCT(ATI, 0xaa38) +#define HDA_ATI_RV710 HDA_MODEL_CONSTRUCT(ATI, 0xaa40) +#define HDA_ATI_RV740 HDA_MODEL_CONSTRUCT(ATI, 0xaa48) #define HDA_ATI_ALL HDA_MODEL_CONSTRUCT(ATI, 0xffff) /* VIA */ @@ -469,6 +483,7 @@ static const struct { { HDA_INTEL_82801H, "Intel 82801H" }, { HDA_INTEL_82801I, "Intel 82801I" }, { HDA_INTEL_82801J, "Intel 82801J" }, + { HDA_INTEL_PCH, "Intel PCH" }, { HDA_INTEL_SCH, "Intel SCH" }, { HDA_NVIDIA_MCP51, "NVidia MCP51" }, { HDA_NVIDIA_MCP55, "NVidia MCP55" }, @@ -488,8 +503,20 @@ static const struct { { HDA_NVIDIA_MCP79_2, "NVidia MCP79" }, { HDA_NVIDIA_MCP79_3, "NVidia MCP79" }, { HDA_NVIDIA_MCP79_4, "NVidia MCP79" }, - { HDA_ATI_SB450, "ATI SB450" }, - { HDA_ATI_SB600, "ATI SB600" }, + { HDA_ATI_SB450, "ATI SB450" }, + { HDA_ATI_SB600, "ATI SB600" }, + { HDA_ATI_RS600, "ATI RS600" }, + { HDA_ATI_RS690, "ATI RS690" }, + { HDA_ATI_RS780, "ATI RS780" }, + { HDA_ATI_R600, "ATI R600" }, + { HDA_ATI_RV610, "ATI RV610" }, + { HDA_ATI_RV620, "ATI RV620" }, + { HDA_ATI_RV630, "ATI RV630" }, + { HDA_ATI_RV635, "ATI RV635" }, + { HDA_ATI_RV710, "ATI RV710" }, + { HDA_ATI_RV730, "ATI RV730" }, + { HDA_ATI_RV740, "ATI RV740" }, + { HDA_ATI_RV770, "ATI RV770" }, { HDA_VIA_VT82XX, "VIA VT8251/8237A" }, { HDA_SIS_966, "SiS 966" }, { HDA_ULI_M5461, "ULI M5461" }, @@ -671,6 +698,7 @@ static const struct { /* Silicon Image */ #define SII_VENDORID 0x1095 +#define HDA_CODEC_SII1390 HDA_CODEC_CONSTRUCT(SII, 0x1390) #define HDA_CODEC_SII1392 HDA_CODEC_CONSTRUCT(SII, 0x1392) #define HDA_CODEC_SIIXXXX HDA_CODEC_CONSTRUCT(SII, 0xffff) @@ -706,6 +734,22 @@ static const struct { #define HDA_CODEC_VT1708B_5 HDA_CODEC_CONSTRUCT(VIA, 0xe725) #define HDA_CODEC_VT1708B_6 HDA_CODEC_CONSTRUCT(VIA, 0xe726) #define HDA_CODEC_VT1708B_7 HDA_CODEC_CONSTRUCT(VIA, 0xe727) +#define HDA_CODEC_VT1708S_0 HDA_CODEC_CONSTRUCT(VIA, 0x0397) +#define HDA_CODEC_VT1708S_1 HDA_CODEC_CONSTRUCT(VIA, 0x1397) +#define HDA_CODEC_VT1708S_2 HDA_CODEC_CONSTRUCT(VIA, 0x2397) +#define HDA_CODEC_VT1708S_3 HDA_CODEC_CONSTRUCT(VIA, 0x3397) +#define HDA_CODEC_VT1708S_4 HDA_CODEC_CONSTRUCT(VIA, 0x4397) +#define HDA_CODEC_VT1708S_5 HDA_CODEC_CONSTRUCT(VIA, 0x5397) +#define HDA_CODEC_VT1708S_6 HDA_CODEC_CONSTRUCT(VIA, 0x6397) +#define HDA_CODEC_VT1708S_7 HDA_CODEC_CONSTRUCT(VIA, 0x7397) +#define HDA_CODEC_VT1702_0 HDA_CODEC_CONSTRUCT(VIA, 0x0398) +#define HDA_CODEC_VT1702_1 HDA_CODEC_CONSTRUCT(VIA, 0x1398) +#define HDA_CODEC_VT1702_2 HDA_CODEC_CONSTRUCT(VIA, 0x2398) +#define HDA_CODEC_VT1702_3 HDA_CODEC_CONSTRUCT(VIA, 0x3398) +#define HDA_CODEC_VT1702_4 HDA_CODEC_CONSTRUCT(VIA, 0x4398) +#define HDA_CODEC_VT1702_5 HDA_CODEC_CONSTRUCT(VIA, 0x5398) +#define HDA_CODEC_VT1702_6 HDA_CODEC_CONSTRUCT(VIA, 0x6398) +#define HDA_CODEC_VT1702_7 HDA_CODEC_CONSTRUCT(VIA, 0x7398) #define HDA_CODEC_VTXXXX HDA_CODEC_CONSTRUCT(VIA, 0xffff) /* ATI */ @@ -716,9 +760,16 @@ static const struct { #define HDA_CODEC_ATIXXXX HDA_CODEC_CONSTRUCT(ATI, 0xffff) /* NVIDIA */ +#define HDA_CODEC_NVIDIAMCP78 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0002) +#define HDA_CODEC_NVIDIAMCP7A HDA_CODEC_CONSTRUCT(NVIDIA, 0x0007) +#define HDA_CODEC_NVIDIAMCP67 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0067) #define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff) /* INTEL */ +#define HDA_CODEC_INTELG45_1 HDA_CODEC_CONSTRUCT(INTEL, 0x2801) +#define HDA_CODEC_INTELG45_2 HDA_CODEC_CONSTRUCT(INTEL, 0x2802) +#define HDA_CODEC_INTELG45_3 HDA_CODEC_CONSTRUCT(INTEL, 0x2803) +#define HDA_CODEC_INTELG45_4 HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) /* Codecs */ @@ -833,10 +884,34 @@ static const struct { { HDA_CODEC_VT1708B_5, "VIA VT1708B_5" }, { HDA_CODEC_VT1708B_6, "VIA VT1708B_6" }, { HDA_CODEC_VT1708B_7, "VIA VT1708B_7" }, + { HDA_CODEC_VT1708S_0, "VIA VT1708S_0" }, + { HDA_CODEC_VT1708S_1, "VIA VT1708S_1" }, + { HDA_CODEC_VT1708S_2, "VIA VT1708S_2" }, + { HDA_CODEC_VT1708S_3, "VIA VT1708S_3" }, + { HDA_CODEC_VT1708S_4, "VIA VT1708S_4" }, + { HDA_CODEC_VT1708S_5, "VIA VT1708S_5" }, + { HDA_CODEC_VT1708S_6, "VIA VT1708S_6" }, + { HDA_CODEC_VT1708S_7, "VIA VT1708S_7" }, + { HDA_CODEC_VT1702_0, "VIA VT1702_0" }, + { HDA_CODEC_VT1702_1, "VIA VT1702_1" }, + { HDA_CODEC_VT1702_2, "VIA VT1702_2" }, + { HDA_CODEC_VT1702_3, "VIA VT1702_3" }, + { HDA_CODEC_VT1702_4, "VIA VT1702_4" }, + { HDA_CODEC_VT1702_5, "VIA VT1702_5" }, + { HDA_CODEC_VT1702_6, "VIA VT1702_6" }, + { HDA_CODEC_VT1702_7, "VIA VT1702_7" }, { HDA_CODEC_ATIRS600_1,"ATI RS600 HDMI" }, { HDA_CODEC_ATIRS600_2,"ATI RS600 HDMI" }, { HDA_CODEC_ATIRS690, "ATI RS690/780 HDMI" }, { HDA_CODEC_ATIR6XX, "ATI R6xx HDMI" }, + { HDA_CODEC_NVIDIAMCP67, "NVidia MCP67 HDMI" }, + { HDA_CODEC_NVIDIAMCP78, "NVidia MCP78 HDMI" }, + { HDA_CODEC_NVIDIAMCP7A, "NVidia MCP7A HDMI" }, + { HDA_CODEC_INTELG45_1, "Intel G45 HDMI" }, + { HDA_CODEC_INTELG45_2, "Intel G45 HDMI" }, + { HDA_CODEC_INTELG45_3, "Intel G45 HDMI" }, + { HDA_CODEC_INTELG45_4, "Intel G45 HDMI" }, + { HDA_CODEC_SII1390, "Silicon Image SiI1390 HDMI" }, { HDA_CODEC_SII1392, "Silicon Image SiI1392 HDMI" }, /* Unknown codec */ { HDA_CODEC_ALCXXXX, "Realtek (Unknown)" }, @@ -2443,9 +2518,10 @@ hdac_widget_pin_parse(struct hdac_widget { struct hdac_softc *sc = w->devinfo->codec->sc; uint32_t config, pincap; - const char *devstr, *connstr; + const char *devstr; nid_t cad = w->devinfo->codec->cad; nid_t nid = w->nid; + int conn, color; config = hdac_widget_pin_getconfig(w); w->wclass.pin.config = config; @@ -2467,13 +2543,19 @@ hdac_widget_pin_parse(struct hdac_widget devstr = HDA_DEVS[(config & HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) >> HDA_CONFIG_DEFAULTCONF_DEVICE_SHIFT]; - connstr = HDA_CONNS[(config & HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK) >> - HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_SHIFT]; + conn = (config & HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK) >> + HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_SHIFT; + color = (config & HDA_CONFIG_DEFAULTCONF_COLOR_MASK) >> + HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT; strlcat(w->name, ": ", sizeof(w->name)); strlcat(w->name, devstr, sizeof(w->name)); strlcat(w->name, " (", sizeof(w->name)); - strlcat(w->name, connstr, sizeof(w->name)); + if (conn == 0 && color != 0 && color != 15) { + strlcat(w->name, HDA_COLORS[color], sizeof(w->name)); + strlcat(w->name, " ", sizeof(w->name)); + } + strlcat(w->name, HDA_CONNS[conn], sizeof(w->name)); strlcat(w->name, ")", sizeof(w->name)); } @@ -5472,7 +5554,7 @@ hdac_audio_disable_crossas(struct hdac_d struct hdac_audio_ctl *ctl; int i, j; - /* Disable crossassociatement connections. */ + /* Disable crossassociatement and unwanted crosschannel connections. */ /* ... using selectors */ for (i = devinfo->startnode; i < devinfo->endnode; i++) { w = hdac_widget_get(devinfo, i); @@ -5490,7 +5572,10 @@ hdac_audio_disable_crossas(struct hdac_d cw = hdac_widget_get(devinfo, w->conns[j]); if (cw == NULL || w->enable == 0) continue; - if (w->bindas == cw->bindas || cw->bindas == -2) + if (cw->bindas == -2) + continue; + if (w->bindas == cw->bindas && + (w->bindseqmask & cw->bindseqmask) != 0) continue; w->connsenable[j] = 0; HDA_BOOTHVERBOSE( @@ -5509,7 +5594,8 @@ hdac_audio_disable_crossas(struct hdac_d if (ctl->widget->bindas == -2 || ctl->childwidget->bindas == -2) continue; - if (ctl->widget->bindas != ctl->childwidget->bindas) { + if (ctl->widget->bindas != ctl->childwidget->bindas || + (ctl->widget->bindseqmask & ctl->childwidget->bindseqmask) == 0) { ctl->forcemute = 1; ctl->muted = HDA_AMP_MUTE_ALL; ctl->left = 0; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 13 21:13:35 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6C561065687; Tue, 13 Jan 2009 21:13:35 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3B7D8FC2D; Tue, 13 Jan 2009 21:13:35 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DLDZwl016180; Tue, 13 Jan 2009 21:13:35 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DLDZad016179; Tue, 13 Jan 2009 21:13:35 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <200901132113.n0DLDZad016179@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 13 Jan 2009 21:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187191 - in stable/7/sys: . conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:13:37 -0000 Author: gnn Date: Tue Jan 13 21:13:35 2009 New Revision: 187191 URL: http://svn.freebsd.org/changeset/base/187191 Log: MFC of code to fix debug builds with CTF/DTrace Fix CTF based builds to that if the debug build is being used we get debug symbols. Modified: stable/7/sys/ (props changed) stable/7/sys/conf/kern.pre.mk Modified: stable/7/sys/conf/kern.pre.mk ============================================================================== --- stable/7/sys/conf/kern.pre.mk Tue Jan 13 21:08:43 2009 (r187190) +++ stable/7/sys/conf/kern.pre.mk Tue Jan 13 21:13:35 2009 (r187191) @@ -26,6 +26,7 @@ COPTFLAGS?= -O .else . if defined(DEBUG) _MINUS_O= -O +CTFFLAGS+= -g . else _MINUS_O= -O2 . endif From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 13 21:19:02 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B57E51065675; Tue, 13 Jan 2009 21:19:02 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A12BF8FC18; Tue, 13 Jan 2009 21:19:02 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DLJ2rg016394; Tue, 13 Jan 2009 21:19:02 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DLJ2Bj016393; Tue, 13 Jan 2009 21:19:02 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <200901132119.n0DLJ2Bj016393@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 13 Jan 2009 21:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187193 - in stable/7/sys: . dev/e1000 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:19:04 -0000 Author: gnn Date: Tue Jan 13 21:19:02 2009 New Revision: 187193 URL: http://svn.freebsd.org/changeset/base/187193 Log: MFC of average latency bug fix Fix a cut/paste bug which prevents us from setting the average latency tunable. Modified: stable/7/sys/ (props changed) stable/7/sys/dev/e1000/if_igb.c Modified: stable/7/sys/dev/e1000/if_igb.c ============================================================================== --- stable/7/sys/dev/e1000/if_igb.c Tue Jan 13 21:18:14 2009 (r187192) +++ stable/7/sys/dev/e1000/if_igb.c Tue Jan 13 21:19:02 2009 (r187193) @@ -281,7 +281,7 @@ TUNABLE_INT("hw.igb.enable_aim", &igb_en static int igb_low_latency = IGB_LOW_LATENCY; TUNABLE_INT("hw.igb.low_latency", &igb_low_latency); static int igb_ave_latency = IGB_AVE_LATENCY; -TUNABLE_INT("hw.igb.ave_latency", &igb_low_latency); +TUNABLE_INT("hw.igb.ave_latency", &igb_ave_latency); static int igb_bulk_latency = IGB_BULK_LATENCY; TUNABLE_INT("hw.igb.bulk_latency", &igb_bulk_latency); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 13 21:19:28 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5169D1065680; Tue, 13 Jan 2009 21:19:28 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 216D48FC1C; Tue, 13 Jan 2009 21:19:28 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DLJSMx016436; Tue, 13 Jan 2009 21:19:28 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DLJSN6016435; Tue, 13 Jan 2009 21:19:28 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200901132119.n0DLJSN6016435@svn.freebsd.org> From: "Simon L. Nielsen" Date: Tue, 13 Jan 2009 21:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187194 - head/contrib/ntp/ntpd releng/6.3 releng/6.3/contrib/bind9/lib/dns releng/6.3/contrib/ntp/ntpd releng/6.3/sys/conf releng/6.4 releng/6.4/contrib/bind9/lib/dns releng/6.4/contri... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:19:29 -0000 Author: simon Date: Tue Jan 13 21:19:27 2009 New Revision: 187194 URL: http://svn.freebsd.org/changeset/base/187194 Log: Correct ntpd(8) cryptographic signature bypass [SA-09:04]. Correct BIND DNSSEC incorrect checks for malformed signatures [SA-09:04]. Security: FreeBSD-SA-09:03.ntpd Security: FreeBSD-SA-09:04.bind Obtained from: ISC [SA-09:04] Approved by: so (simon) Modified: stable/7/contrib/ntp/ntpd/ntp_crypto.c Changes in other areas also in this revision: Modified: head/contrib/ntp/ntpd/ntp_crypto.c releng/6.3/UPDATING releng/6.3/contrib/bind9/lib/dns/openssldsa_link.c releng/6.3/contrib/bind9/lib/dns/opensslrsa_link.c releng/6.3/contrib/ntp/ntpd/ntp_crypto.c releng/6.3/sys/conf/newvers.sh releng/6.4/UPDATING releng/6.4/contrib/bind9/lib/dns/openssldsa_link.c releng/6.4/contrib/bind9/lib/dns/opensslrsa_link.c releng/6.4/contrib/ntp/ntpd/ntp_crypto.c releng/6.4/sys/conf/newvers.sh releng/7.0/UPDATING releng/7.0/contrib/bind9/lib/dns/openssldsa_link.c releng/7.0/contrib/bind9/lib/dns/opensslrsa_link.c releng/7.0/contrib/ntp/ntpd/ntp_crypto.c releng/7.0/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/bind9/lib/dns/openssldsa_link.c releng/7.1/contrib/bind9/lib/dns/opensslrsa_link.c releng/7.1/contrib/ntp/ntpd/ntp_crypto.c releng/7.1/sys/conf/newvers.sh stable/6/contrib/ntp/ntpd/ntp_crypto.c Modified: stable/7/contrib/ntp/ntpd/ntp_crypto.c ============================================================================== --- stable/7/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:02 2009 (r187193) +++ stable/7/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:27 2009 (r187194) @@ -1612,7 +1612,7 @@ crypto_verify( */ EVP_VerifyInit(&ctx, peer->digest); EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12); - if (!EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey)) + if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey) <= 0) return (XEVNT_SIG); if (peer->crypto & CRYPTO_FLAG_VRFY) { From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 13 22:28:49 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 378E01065714; Tue, 13 Jan 2009 22:28: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 1F1508FC1E; Tue, 13 Jan 2009 22:28:49 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DMSnIL018187; Tue, 13 Jan 2009 22:28:49 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DMSnai018184; Tue, 13 Jan 2009 22:28:49 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901132228.n0DMSnai018184@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 22:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187198 - in stable/7: sys/boot/i386/boot0 usr.sbin/boot0cfg X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 22:28:51 -0000 Author: luigi Date: Tue Jan 13 22:28:48 2009 New Revision: 187198 URL: http://svn.freebsd.org/changeset/base/187198 Log: MFC: a number of small fixes and enhancements to the boot0 code, and matching modifications to boot0cfg. The most noticeable features are preserving the 4-byte volume ID that certain Windows versions put in the MBR, and an option (F6) to boot through INT18 that on some modern BIOSes invokes PXE. Modified: stable/7/sys/boot/i386/boot0/boot0.S stable/7/usr.sbin/boot0cfg/boot0cfg.8 stable/7/usr.sbin/boot0cfg/boot0cfg.c Modified: stable/7/sys/boot/i386/boot0/boot0.S ============================================================================== --- stable/7/sys/boot/i386/boot0/boot0.S Tue Jan 13 22:15:47 2009 (r187197) +++ stable/7/sys/boot/i386/boot0/boot0.S Tue Jan 13 22:28:48 2009 (r187198) @@ -1,4 +1,5 @@ /* + * Copyright (c) 2008 Luigi Rizzo (mostly documentation) * Copyright (c) 2002 Bruce M. Simpson * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -16,50 +17,166 @@ * $FreeBSD$ */ -/* A 512-byte boot manager. */ -#ifdef SIO -/* ... using a serial console on COM1. */ +/* build options: */ +#ifdef SIO /* use serial console on COM1. */ #endif +#ifdef PXE /* enable PXE/INT18 booting with F6 */ +#define SAVE_MORE_MEMORY +#endif + +#ifdef CHECK_DRIVE /* make sure we boot from a HD. */ +#endif + +#ifdef ONLY_F_KEYS /* Only F1..F6, no digits on console */ +#endif + +#ifdef VOLUME_SERIAL /* support Volume serial number */ +#define B0_BASE 0x1ae /* move the internal data area */ +#define SAVE_MEMORY +#else +#define B0_BASE 0x1b2 +#endif + +#ifdef TEST /* enable some test code */ +#define SAVE_MEMORY +#define SAVE_MORE_MEMORY +#endif + +/* + * Note - this code uses many tricks to save space and fit in one sector. + * This includes using side effects of certain instructions, reusing + * register values from previous operations, etc. + * Be extremely careful when changing the code, even for simple things. + */ + +/* + * BOOT BLOCK STRUCTURE + * + * This code implements a Master Boot Record (MBR) for an Intel/PC disk. + * It is 512 bytes long and it is normally loaded by the BIOS (or another + * bootloader) at 0:0x7c00. This code depends on %cs:%ip being 0:0x7c00 + * + * The initial chunk of instructions is used as a signature by external + * tools (e.g. boot0cfg) which can manipulate the block itself. + * + * The area at offset 0x1b2 contains a magic string ('Drive '), also + * used as a signature to detect the block, and some variables that can + * be updated by boot0cfg (and optionally written back to the disk). + * These variables control the operation of the bootloader itself, + * e.g. which partitions to enable, the timeout, the use of LBA + * (called 'packet') or CHS mode, whether to force a drive number, + * and whether to write back the user's selection back to disk. + * + * As in every Master Boot Record, the partition table is at 0x1be, + * made of four 16-byte entries each containing: + * + * OFF SIZE DESCRIPTION + * 0 1 status (0x80: bootable, 0: non bootable) + * 1 3 start sector CHS + * 8:head, 6:sector, 2:cyl bit 9..8, 8:cyl bit 7..0 + * 4 1 partition type + * 5 3 end sector CHS + * 8 4 LBA of first sector + * 12 4 partition size in sectors + * + * and followed by the two bytes 0x55, 0xAA (MBR signature). + */ + + +/* + * BOOT BLOCK OPERATION + * + * On entry, the registers contain the following values: + * + * %cs:%ip 0:0x7c00 + * %dl drive number (0x80, 0x81, ... ) + * %si pointer to the partition table from which we were loaded. + * Some boot code (e.g. syslinux) use this info to relocate + * themselves, so we want to pass a valid one to the next stage. + * NOTE: the use of %si is not a standard. + * + * This boot block first relocates itself at a different address (0:0x600), + * to free the space at 0:0x7c00 for the next stage boot block. + * + * It then initializes some memory at 0:0x800 and above (pointed by %bp) + * to store the original drive number (%dl) passed to us, and to construct a + * fake partition entry. The latter is used by the disk I/O routine and, + * in some cases, passed in %si to the next stage boot code. + * + * The variables at 0x1b2 are accessed as negative offsets from %bp. + * + * After the relocation, the code scans the partition table printing + * out enabled partition or disks, and waits for user input. + * + * When a partition is selected, or a timeout expires, the currently + * selected partition is used to load the next stage boot code, + * %dl and %si are set appropriately as when we were called, and + * control is transferred to the newly loaded code at 0:0x7c00. + */ + +/* + * CONSTANTS + * + * NHRDRV is the address in segment 0 where the BIOS writes the + * total number of hard disks in the system. + * LOAD is the original load address and cannot be changed. + * ORIGIN is the relocation address. If you change it, you also need + * to change the value passed to the linker in the Makefile + * PRT_OFF is the location of the partition table (from the MBR standard). + * B0_OFF is the location of the data area, known to boot0cfg so + * it cannot be changed. Computed as a negative offset from 0x200 + * MAGIC is the signature of a boot block. + */ + .set NHRDRV,0x475 # Number of hard drives .set ORIGIN,0x600 # Execution address - .set FAKE,0x800 # Partition entry .set LOAD,0x7c00 # Load address .set PRT_OFF,0x1be # Partition table - - .set TBL0SZ,0x3 # Table 0 size - .set TBL1SZ,0xa # Table 1 size + .set B0_OFF,(B0_BASE-0x200) # Offset of boot0 data .set MAGIC,0xaa55 # Magic: bootable - .set B0MAGIC,0xbb66 # Identification .set KEY_ENTER,0x1c # Enter key scan code .set KEY_F1,0x3b # F1 key scan code .set KEY_1,0x02 # #1 key scan code - .set ASCII_BEL,0x07 # ASCII code for + .set ASCII_BEL,'#' # ASCII code for .set ASCII_CR,0x0D # ASCII code for /* - * Addresses in the sector of embedded data values. - * Accessed with negative offsets from the end of the relocated sector (%ebp). - */ - .set _NXTDRV,-0x48 # Next drive - .set _OPT,-0x47 # Default option - .set _SETDRV,-0x46 # Drive to force - .set _FLAGS,-0x45 # Flags - .set _TICKS,-0x44 # Timeout ticks - .set _FAKE,0x0 # Fake partition entry - .set _MNUOPT,0xc # Menu options + * Offsets of variables in the block at B0_OFF, and in the volatile + * data area, computed as displacement from %bp. + * We need to define them as constant as the assembler cannot + * compute them in its single pass. + */ + .set _NXTDRV, B0_OFF+6 # Next drive + .set _OPT, B0_OFF+7 # Default option + .set _SETDRV, B0_OFF+8 # Drive to force + .set _FLAGS, B0_OFF+9 # Flags + .set SETDRV, 0x20 # the 'setdrv' flag + .set NOUPDATE, 0x40 # the 'noupdate' flag + .set USEPACKET, 0x80 # the 'packet' flag + + /* ticks is at a fixed position */ + .set _TICKS, (PRT_OFF - 0x200 - 2) # Timeout ticks + .set _MNUOPT, 0x10 # Saved menu entries + .set TLEN, (desc_ofs - bootable_ids) # size of bootable ids .globl start # Entry point .code16 # This runs in real mode /* + * MAIN ENTRY POINT * Initialise segments and registers to known values. * segments start at 0. * The stack is immediately below the address we were loaded to. + * NOTE: the initial section of the code (up to movw $LOAD,%sp) + * is used by boot0cfg, together with the 'Drive ' string and + * the 0x55, 0xaa at the end, as an identifier for version 1.0 + * of the boot code. Do not change it. + * In version 1.0 the parameter table (_NEXTDRV etc) is at 0x1b9 */ start: cld # String ops inc xorw %ax,%ax # Zero @@ -69,7 +186,7 @@ start: cld # String ops inc movw $LOAD,%sp # stack /* - * Copy this code to the address it was linked for + * Copy this code to the address it was linked for, 0x600 by default. */ movw %sp,%si # Source movw $start,%di # Destination @@ -77,248 +194,301 @@ start: cld # String ops inc rep # Relocate movsw # code /* - * Set address for variable space beyond code, and clear it. - * Notice that this is also used to point to the values embedded in the block, - * by using negative offsets. + * After the code, (i.e. at %di+0, 0x800) create a partition entry, + * initialized to LBA 0 / CHS 0:0:1. + * Set %bp to point to the partition and also, with negative offsets, + * to the variables embedded in the bootblock (nextdrv and so on). */ movw %di,%bp # Address variables movb $0x8,%cl # Words to clear rep # Zero stosw # them -/* - * Relocate to the new copy of the code. - */ - incb -0xe(%di) # Sector number - jmp main-LOAD+ORIGIN # To relocated code + incb -0xe(%di) # Set the S field to 1 + + jmp main-LOAD+ORIGIN # Jump to relocated code main: #if defined(SIO) && COMSPEED != 0 /* - * Initialize the serial port. bioscom preserves the driver number in DX. + * Init the serial port. bioscom preserves the driver number in DX. */ movw $COMSPEED,%ax # defined by Makefile callw bioscom #endif + /* - * Check what flags were loaded with us, specifically if a predefined drive - * number should be used. If what the bios gives us is bad, use the '0' in - * the block instead. - */ - testb $0x20,_FLAGS(%bp) # Set drive number? - jnz main.1 # Yes + * If the 'setdrv' flag is set in the boot sector, use the drive + * number from the boot sector at 'setdrv_num'. + * Optionally, do the same if the BIOS gives us an invalid number + * (note though that the override prevents booting from a floppy + * or a ZIP/flash drive in floppy emulation). + * The test costs 4 bytes of code so it is disabled by default. + */ + testb $SETDRV,_FLAGS(%bp) # Set drive number? +#ifndef CHECK_DRIVE /* disable drive checks */ + jz save_curdrive # no, use the default +#else + jnz disable_update # Yes testb %dl,%dl # Drive number valid? - js main.2 # Possibly (0x80 set) + js save_curdrive # Possibly (0x80 set) +#endif /* - * Only update the boot-sector when there is a valid drive number or - * the drive number is set manually. + * Disable updates if the drive number is forced. */ - orb $0x40,_FLAGS(%bp) # Disable updates -main.1: movb _SETDRV(%bp),%dl # Drive number to use +disable_update: orb $NOUPDATE,_FLAGS(%bp) # Disable updates + movb _SETDRV(%bp),%dl # Use stored drive number + /* - * Whatever we decided to use, now store it into the fake - * partition entry that lives in the data space above us. - */ -main.2: movb %dl,_FAKE(%bp) # Save drive number - callw putn # To new line - pushw %dx # Save drive number + * Whatever drive we decided to use, store it at (%bp). The byte + * is normally used for the state of the partition (0x80 or 0x00), + * but we abuse it as it is very convenient to access at offset 0. + * The value is read back after 'check_selection' + */ +save_curdrive: movb %dl, (%bp) # Save drive number + pushw %dx # Also in the stack +#ifdef TEST /* test code, print internal bios drive */ + rolb $1, %dl + movw $drive, %si + call putkey +#endif + callw putn # Print a newline /* * Start out with a pointer to the 4th byte of the first table entry * so that after 4 iterations it's beyond the end of the sector - * and beyond a 256 byte boundary and has overflowed 8 bits (see next comment). - * Remember that the table starts 2 bytes earlier than you would expect - * as the bootable flag is after it in the block. + * and beyond a 256 byte boundary. We use the latter trick to check for + * end of the loop without using an extra register (see start.5). */ movw $(partbl+0x4),%bx # Partition table (+4) xorw %dx,%dx # Item number + /* * Loop around on the partition table, printing values until we - * pass a 256 byte boundary. The end of loop test is at main.5. + * pass a 256 byte boundary. */ -main.3: movb %ch,-0x4(%bx) # Zero active flag (ch == 0) +read_entry: movb %ch,-0x4(%bx) # Zero active flag (ch == 0) btw %dx,_FLAGS(%bp) # Entry enabled? - jnc main.5 # No -/* - * If any of the entries in the table are the same as the 'type' in the slice - * table entry, then this is an empty or non bootable partition. Skip it. - */ + jnc next_entry # No movb (%bx),%al # Load type - movw $tables,%di # Lookup tables - movb $TBL0SZ,%cl # Number of entries - repne # Exclude - scasb # partition? - je main.5 # Yes + test %al, %al # skip empty partition + jz next_entry /* - * Now scan the table of known types + * Scan the table of bootable ids, which starts at %di and has + * length TLEN. On a match, %di points to the element following the + * match; the corresponding offset to the description is $(TLEN-1) + * bytes ahead. We use a count of TLEN+1 so if we don't find a match + * within the first TLEN entries, we hit the 'unknown' entry. */ - movb $TBL1SZ+1,%cl # Number of entries + movw $bootable_ids,%di # Lookup tables + movb $(TLEN+1),%cl # Number of entries repne # Locate scasb # type /* * Get the matching element in the next array. + * The byte at $(TLEN-1)(%di) contains the offset of the description + * string from %di, so we add the number and print the string. */ - addw $TBL1SZ-1, %di # Adjust + addw $(TLEN-1), %di # Adjust movb (%di),%cl # Partition addw %cx,%di # description callw putx # Display it -main.5: incw %dx # Next item + +next_entry: incw %dx # Next item addb $0x10,%bl # Next entry - jnc main.3 # Till done + jnc read_entry # Till done /* - * Passed a 256 byte boundary; the table is finished. + * We are past a 256 byte boundary: the partition table is finished. * Add one to the drive number and check it is valid. + * Note that if we started from a floppy, %dl was 0 so we still + * get an entry for the next drive, which is the first Hard Disk. */ popw %ax # Drive number subb $0x80-0x1,%al # Does next cmpb NHRDRV,%al # drive exist? (from BIOS?) - jb main.6 # Yes + jb print_drive # Yes /* * If this is the only drive, don't display it as an option. */ decw %ax # Already drive 0? - jz main.7 # Yes + jz print_prompt # Yes /* * If it was illegal or we cycled through them, go back to drive 0. */ xorb %al,%al # Drive 0 /* - * Whatever drive we selected, make it an ascii digit and save it back to the - * "next drive" location in the loaded block in case we want to save it later - * for next time. This also is part of the printed drive string so add 0x80 + * Whatever drive we selected, make it an ascii digit and save it + * back to the "nxtdrv" location in case we want to save it to disk. + * This digit is also part of the printed drive string, so add 0x80 * to indicate end of string. */ -main.6: addb $'0'|0x80,%al # Save next +print_drive: addb $'0'|0x80,%al # Save next movb %al,_NXTDRV(%bp) # drive number movw $drive,%di # Display callw putx # item /* - * Now that we've printed the drive (if we needed to), display a prompt. + * Menu is complete, display a prompt followed by current selection. + * 'decw %si' makes the register point to the space after 'Boot: ' + * so we do not see an extra CRLF on the screen. */ -main.7: movw $prompt,%si # Display +print_prompt: movw $prompt,%si # Display callw putstr # prompt movb _OPT(%bp),%dl # Display decw %si # default callw putkey # key - jmp main.7_1 # Skip beep + jmp start_input # Skip beep + /* - * Users's last try was bad, beep in displeasure. + * Here we have the code waiting for user input or a timeout. */ -main.10: movb $ASCII_BEL,%al # Signal - callw putchr # beep! +beep: movb $ASCII_BEL,%al # Input error, print or beep + callw putchr + +start_input: /* - * Start of input loop. Take note of time + * Actual Start of input loop. Take note of time */ -main.7_1: xorb %ah,%ah # BIOS: Get + xorb %ah,%ah # BIOS: Get int $0x1a # system time movw %dx,%di # Ticks when addw _TICKS(%bp),%di # timeout +read_key: /* * Busy loop, looking for keystrokes but keeping one eye on the time. */ -main.8: #ifndef SIO movb $0x1,%ah # BIOS: Check int $0x16 # for keypress - jnz main.11 # Have one #else /* SIO */ movb $0x03,%ah # BIOS: Read COM call bioscom testb $0x01,%ah # Check line status - jnz main.11 # (bit 1 indicates input) + # (bit 1 indicates input) #endif /* SIO */ - xorb %ah,%ah # BIOS: Get - int $0x1a # system time + jnz got_key # Have input + xorb %ah,%ah # BIOS: int 0x1a, 00 + int $0x1a # get system time cmpw %di,%dx # Timeout? - jb main.8 # No + jb read_key # No + /* - * If timed out or defaulting, come here. + * Timed out or default selection */ -main.9: movb _OPT(%bp),%al # Load default - jmp main.12 # Join common code +use_default: movb _OPT(%bp),%al # Load default + orb $NOUPDATE,_FLAGS(%bp) # Disable updates + jmp check_selection # Join common code + /* * Get the keystroke. + * ENTER or CR confirm the current selection (same as a timeout). + * Otherwise convert F1..F6 (or '1'..'6') to 0..5 and check if the + * selection is valid. + * The SIO code uses ascii chars, the console code uses scancodes. */ -main.11: +got_key: #ifndef SIO - xorb %ah,%ah # BIOS: Get - int $0x16 # keypress - movb %ah,%al # Scan code + xorb %ah,%ah # BIOS: int 0x16, 00 + int $0x16 # get keypress + movb %ah,%al # move scan code to %al + cmpb $KEY_ENTER,%al #else movb $0x02,%ah # BIOS: Receive call bioscom + cmpb $ASCII_CR,%al #endif + je use_default # enter -> default /* - * If it's CR act as if timed out. - */ -#ifndef SIO - cmpb $KEY_ENTER,%al # Enter pressed? -#else - cmpb $ASCII_CR,%al # Enter pressed? -#endif - je main.9 # Yes -/* - * Otherwise check if legal. If not ask again. - */ -#ifndef SIO - subb $KEY_F1,%al # Less F1 scan code - cmpb $0x4,%al # F1..F5? - jna main.12 # Yes + * Check if the key is acceptable, and loop back if not. + * The console (non-SIO) code looks at scancodes and accepts + * both F1..F6 and 1..6 (the latter costs 6 bytes of code), + * relying on the fact that F1..F6 have higher scancodes than 1..6 + * The SIO code only takes 1..6 + */ +#ifdef SIO /* SIO mode, use ascii values */ + subb $'1',%al # Subtract '1' ascii code +#else /* console mode -- use scancodes */ + subb $KEY_F1,%al /* Subtract F1 scan code */ +#if !defined(ONLY_F_KEYS) + cmpb $0x5,%al # F1..F6 + jna 3f # Yes subb $(KEY_1 - KEY_F1),%al # Less #1 scan code -#else - subb $'1',%al # Less '1' ascii character -#endif - cmpb $0x4,%al # #1..#5? - ja main.10 # No + 3: +#endif /* ONLY_F_KEYS */ +#endif /* SIO */ + cmpb $0x5,%al # F1..F6 or 1..6 ? +#ifdef PXE /* enable PXE/INT18 using F6 */ + jne 1f; + int $0x18 # found F6, try INT18 + 1: +#endif /* PXE */ + jae beep # Not in F1..F5, beep + +check_selection: /* * We have a selection. If it's a bad selection go back to complain. * The bits in MNUOPT were set when the options were printed. * Anything not printed is not an option. */ -main.12: cbtw # Option - btw %ax,_MNUOPT(%bp) # enabled? - jnc main.10 # No + cbtw # Extend (%ah=0 used later) + btw %ax,_MNUOPT(%bp) # Option enabled? + jnc beep # No /* * Save the info in the original tables * for rewriting to the disk. */ movb %al,_OPT(%bp) # Save option - movw $FAKE,%si # Partition for write - movb (%si),%dl # Drive number + + /* + * Make %si and %bx point to the fake partition at LBA 0 (CHS 0:0:1). + * Because the correct address is already in %bp, just use it. + * Set %dl with the drive number saved in byte 0. + * If we have pressed F5 or 5, then this is a good, fake value + * to present to the next stage boot code. + */ + movw %bp,%si # Partition for write + movb (%si),%dl # Drive number, saved above movw %si,%bx # Partition for read cmpb $0x4,%al # F5/#5 pressed? - pushf # Save - je main.13 # Yes + pushf # Save results for later + je 1f # Yes, F5 + + /* + * F1..F4 was pressed, so make %bx point to the currently + * selected partition, and leave the drive number unchanged. + */ shlb $0x4,%al # Point to addw $partbl,%ax # selected xchgw %bx,%ax # partition movb $0x80,(%bx) # Flag active /* * If not asked to do a write-back (flags 0x40) don't do one. + * Around the call, save the partition pointer to %bx and + * restore to %si which is where the next stage expects it. */ -main.13: pushw %bx # Save - testb $0x40,_FLAGS(%bp) # No updates? - jnz main.14 # Yes + 1: pushw %bx # Save + testb $NOUPDATE,_FLAGS(%bp) # No updates? + jnz 2f # skip update movw $start,%bx # Data to write movb $0x3,%ah # Write sector callw intx13 # to disk -main.14: popw %si # Restore - popf # Restore + 2: popw %si # Restore + /* * If going to next drive, replace drive with selected one. * Remember to un-ascii it. Hey 0x80 is already set, cool! */ - jne main.15 # If not F5/#5 + popf # Restore %al test results + jne 3f # If not F5/#5 movb _NXTDRV(%bp),%dl # Next drive subb $'0',%dl # number /* - * Load selected bootsector to the LOAD location in RAM. - * If it fails to read or isn't marked bootable, treat it as a bad selection. + * Load selected bootsector to the LOAD location in RAM. If read + * fails or there is no 0x55aa marker, treat it as a bad selection. */ -main.15: movw $LOAD,%bx # Address for read + 3: movw $LOAD,%bx # Address for read movb $0x2,%ah # Read sector callw intx13 # from disk - jc main.10 # If error + jc beep # If error cmpw $MAGIC,0x1fe(%bx) # Bootable? - jne main.10 # No + jne beep # No pushw %si # Save ptr to selected part. callw putn # Leave some space popw %si # Restore, next stage uses it @@ -326,64 +496,80 @@ main.15: movw $LOAD,%bx # Address for /* * Display routines + * putkey prints the option selected in %dl (F1..F5 or 1..5) followed by + * the string at %si + * putx: print the option in %dl followed by the string at %di + * also record the drive as valid. + * putn: print a crlf + * putstr: print the string at %si + * putchr: print the char in al */ -putkey: -#ifndef SIO - movb $'F',%al # Display - callw putchr # 'F' -#endif - movb $'1',%al # Prepare - addb %dl,%al # digit - jmp putstr.1 # Display the rest /* - * Display the option and note that it is a valid option. - * That last point is a bit tricky.. + * Display the option and record the drive as valid in the options. + * That last point is done using the btsw instruction which does + * a test and set. We don't care for the test part. */ putx: btsw %dx,_MNUOPT(%bp) # Enable menu option movw $item,%si # Display callw putkey # key movw %di,%si # Display the rest - -puts: callw putstr # Display string + callw putstr # Display string putn: movw $crlf,%si # To next line + jmp putstr + +putkey: +#ifndef SIO + movb $'F',%al # Display + callw putchr # 'F' +#endif + movb $'1',%al # Prepare + addb %dl,%al # digit +putstr.1: callw putchr # Display char putstr: lodsb # Get byte testb $0x80,%al # End of string? - jnz putstr.2 # Yes -putstr.1: callw putchr # Display char - jmp putstr # Continue -putstr.2: andb $~0x80,%al # Clear MSB + jz putstr.1 # No + andb $~0x80,%al # Clear MSB then print last -#ifndef SIO putchr: +#ifndef SIO pushw %bx # Save movw $0x7,%bx # Page:attribute movb $0xe,%ah # BIOS: Display int $0x10 # character popw %bx # Restore - retw # To caller #else /* SIO */ -putchr: movb $0x01,%ah # BIOS: Send bioscom: pushw %dx # Save xorw %dx,%dx # Use COM1 int $0x14 # Character popw %dx # Restore - retw # To caller #endif /* SIO */ + retw # To caller /* One-sector disk I/O routine */ -intx13: movb 0x1(%si),%dh # Load head +/* + * %dl: drive, %si partition entry, %es:%bx transfer buffer. + * Load the CHS values and possibly the LBA address from the block + * at %si, and use the appropriate method to load the sector. + * Don't use packet mode for a floppy. + */ +intx13: # Prepare CHS parameters + movb 0x1(%si),%dh # Load head movw 0x2(%si),%cx # Load cylinder:sector movb $0x1,%al # Sector count pushw %si # Save movw %sp,%di # Save - testb $0x80,_FLAGS(%bp) # Use packet interface? - jz intx13.1 # No +#ifndef CHECK_DRIVE /* floppy support */ + testb %dl, %dl # is this a floppy ? + jz 1f # Yes, use CHS mode +#endif + testb $USEPACKET,_FLAGS(%bp) # Use packet interface? + jz 1f # No pushl $0x0 # Set the pushl 0x8(%si) # LBA address pushw %es # Set the transfer @@ -393,73 +579,104 @@ intx13: movb 0x1(%si),%dh # Load head movw %sp,%si # Packet pointer decw %ax # Verify off orb $0x40,%ah # Use disk packet -intx13.1: int $0x13 # BIOS: Disk I/O + 1: int $0x13 # BIOS: Disk I/O movw %di,%sp # Restore popw %si # Restore retw # To caller -/* Menu strings */ - +/* + * Various menu strings. 'item' goes after 'prompt' to save space. + * Also use shorter versions to make room for the PXE/INT18 code. + */ +prompt: +#ifdef PXE + .ascii "\nF6 PXE\r" +#endif + .ascii "\nBoot:" item: .ascii " "; .byte ' '|0x80 -prompt: .ascii "\nDefault:"; .byte ' '|0x80 crlf: .ascii "\r"; .byte '\n'|0x80 /* Partition type tables */ -tables: +bootable_ids: /* - * These entries identify invalid or NON BOOT types and partitions. - */ - .byte 0x0, 0x5, 0xf + * These values indicate bootable types we know about. + * Corresponding descriptions are at desc_ofs: + * Entries don't need to be sorted. + */ + .byte 0x83, 0xa5, 0xa6, 0xa9, 0x06, 0x07, 0x0b +#ifndef SAVE_MORE_MEMORY + .byte 0x05 # extended partition +#endif +#ifndef SAVE_MEMORY /* other DOS partitions */ + .byte 0x01 # FAT12 + .byte 0x04 # FAT16 < 32M +#endif + +desc_ofs: /* - * These values indicate bootable types we know the names of. - */ - .byte 0x1, 0x6, 0x7, 0xb, 0xc, 0xe, 0x83 - .byte 0xa5, 0xa6, 0xa9 -/* - * These are offsets that match the known names above and point to the strings - * that will be printed. os_misc will be used if the search of the above table - * runs over. - */ - .byte os_dos-. # DOS - .byte os_dos-. # DOS - .byte os_dos-. # Windows - .byte os_dos-. # Windows - .byte os_dos-. # Windows - .byte os_dos-. # Windows - .byte os_linux-. # Linux - .byte os_freebsd-. # FreeBSD - .byte os_bsd-. # OpenBSD - .byte os_bsd-. # NetBSD + * Offsets that match the known types above, used to point to the + * actual partition name. The last entry must point to os_misc, + * which is used for non-matching names. + */ + .byte os_linux-. # 131, Linux + .byte os_freebsd-. # 165, FreeBSD + .byte os_bsd-. # 166, OpenBSD + .byte os_bsd-. # 169, NetBSD + .byte os_dos-. # 6, FAT16 >= 32M + .byte os_win-. # 7, NTFS + .byte os_win-. # 11, FAT32 + +#ifndef SAVE_MORE_MEMORY + .byte os_ext-. # 5, DOS Ext +#endif +#ifndef SAVE_MEMORY + .byte os_dos-. # 1, FAT12 DOS + .byte os_dos-. # 4, FAT16 <32M +#endif .byte os_misc-. # Unknown + /* - * And here are the strings themselves. 0x80 or'd into a byte indicates - * the end of the string. (not so great for Russians but...) + * And here are the strings themselves. The last byte of + * the string has bit 7 set. */ -os_misc: .ascii "?"; .byte '?'|0x80 -os_dos: .ascii "DO"; .byte 'S'|0x80 +os_misc: .byte '?'|0x80 +os_dos: +#ifndef SAVE_MORE_MEMORY /* 'DOS' remapped to 'WIN' if no room */ + .ascii "DO"; .byte 'S'|0x80 +#endif +os_win: .ascii "Wi"; .byte 'n'|0x80 os_linux: .ascii "Linu"; .byte 'x'|0x80 os_freebsd: .ascii "Free" os_bsd: .ascii "BS"; .byte 'D'|0x80 +#ifndef SAVE_MORE_MEMORY +os_ext: .ascii "EX"; .byte 'T'|0x80 +#endif - .org PRT_OFF-0xe,0x90 - - .word B0MAGIC # Magic number - + .org (0x200 + B0_OFF),0x90 /* - * These values are sometimes changed before writing back to the drive + * The boot0 version 1.0 parameter table. + * Do not move it nor change the "Drive " string, boot0cfg + * uses its offset and content to identify the boot sector. + * The other fields are sometimes changed before writing back to the drive * Be especially careful that nxtdrv: must come after drive:, as it * is part of the same string. */ drive: .ascii "Drive " nxtdrv: .byte 0x0 # Next drive number opt: .byte 0x0 # Option -setdrv: .byte 0x80 # Drive to force +setdrv_num: .byte 0x80 # Drive to force flags: .byte FLAGS # Flags +#ifdef VOLUME_SERIAL + .byte 0xa8,0xa8,0xa8,0xa8 # Volume Serial Number +#endif ticks: .word TICKS # Delay + .org PRT_OFF /* * Here is the 64 byte partition table that fdisk would fiddle with. */ partbl: .fill 0x40,0x1,0x0 # Partition table .word MAGIC # Magic number + .org 0x200 # again, safety check +endblock: Modified: stable/7/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- stable/7/usr.sbin/boot0cfg/boot0cfg.8 Tue Jan 13 22:15:47 2009 (r187197) +++ stable/7/usr.sbin/boot0cfg/boot0cfg.8 Tue Jan 13 22:28:48 2009 (r187198) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 7, 2007 +.Dd January 13, 2009 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -35,7 +35,9 @@ .Op Fl Bv .Op Fl b Ar boot0 .Op Fl d Ar drive +.Op Fl e Ar bell character .Op Fl f Ar file +.Op Fl i Ar volume-id .Op Fl m Ar mask .Op Fl o Ar options .Op Fl s Ar slice @@ -96,10 +98,17 @@ which contains the specified Typically this will be 0x80 for the first hard drive, 0x81 for the second hard drive, and so on; however any integer between 0 and 0xff is acceptable here. +.It Fl e Ar bell character +Set the character to be printed in case of input error. .It Fl f Ar file Specify that a backup copy of the preexisting MBR should be written to .Ar file . This file is created if it does not exist, and replaced if it does. +.It Fl i Ar volume-id +Specifies a volume-id (in the form XXXX-XXXX) to be saved at location +0x1b8 in the MBR. This information is sometimes used by NT, XP and Vista +to identify the disk drive. The option is only compatible with version 2.00 +of the 512-byte boot block. .It Fl m Ar mask Specify slices to be enabled/disabled, where .Ar mask @@ -144,6 +153,21 @@ Set the timeout value to .It Fl v Verbose: display information about the slices defined, etc. .El +.Sh NOTE +Protection mechanisms in the +.Xr geom 4 +subsystem might prevent +.Nm +from being able to update the MBR on a mounted disk. +Instructions for temporarily disabling these protection mechanisms +can be found in the +.Xr geom 4 +manpage. Specifically, do a +.Pp +.Dl sysctl kern.geom.debugflags=0x10 +.Pp +to allow writing to the MBR, and restore it to 0 afterwards. +.Pp .Sh FILES .Bl -tag -width /boot/boot0sio -compact .It Pa /boot/boot0 @@ -177,16 +201,6 @@ to install the default MBR: .Sh AUTHORS .An Robert Nordier Aq rnordier@FreeBSD.org . .Sh BUGS -Protection mechanisms in the -.Xr geom 4 -subsystem might prevent -.Nm -from being able to update the MBR on a mounted disk. -Instructions for temporarily disabling these protection mechanisms -can be found in the -.Xr geom 4 -manpage. -.Pp Use of the .Sq packet option may cause @@ -195,6 +209,6 @@ to fail, depending on the nature of BIOS .Pp Use of the .Sq setdrv -option with an incorrect -d operand may cause the MBR to be written -to the wrong disk. -Be careful! +option with an incorrect -d operand may cause the boot0 code +to write the MBR to the wrong disk, thus trashing its previous +content. Be careful. Modified: stable/7/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- stable/7/usr.sbin/boot0cfg/boot0cfg.c Tue Jan 13 22:15:47 2009 (r187197) +++ stable/7/usr.sbin/boot0cfg/boot0cfg.c Tue Jan 13 22:28:48 2009 (r187198) @@ -1,4 +1,5 @@ /* + * Copyright (c) 2008 Luigi Rizzo * Copyright (c) 1999 Robert Nordier * All rights reserved. * @@ -44,13 +45,34 @@ __FBSDID("$FreeBSD$"); #define MBRSIZE 512 /* master boot record size */ -#define OFF_VERSION 0x1b0 /* offset: version number */ -#define OFF_OPT 0x1b9 /* offset: default boot option */ -#define OFF_DRIVE 0x1ba /* offset: setdrv drive */ -#define OFF_FLAGS 0x1bb /* offset: option flags */ -#define OFF_TICKS 0x1bc /* offset: clock ticks */ +#define OFF_VERSION 0x1b0 /* offset: version number, only boot0version */ +#define OFF_SERIAL 0x1b8 /* offset: volume serial number */ #define OFF_PTBL 0x1be /* offset: partition table */ #define OFF_MAGIC 0x1fe /* offset: magic number */ +/* + * Offsets to the parameters of the 512-byte boot block. + * For historical reasons they are set as macros + */ +struct opt_offsets { + int opt; + int drive; + int flags; + int ticks; +}; + +struct opt_offsets b0_ofs[] = { + { 0x0, 0x0, 0x0, 0x0 }, /* no boot block */ + { 0x1b9, 0x1ba, 0x1bb, 0x1bc }, /* original block */ + { 0x1b5, 0x1b6, 0x1b7, 0x1bc }, /* NT_SERIAL block */ +}; + +int b0_ver; /* boot block version set by boot0bs */ + +#define OFF_OPT (b0_ofs[b0_ver].opt) /* default boot option */ +#define OFF_DRIVE (b0_ofs[b0_ver].drive) /* setdrv drive */ +#define OFF_FLAGS (b0_ofs[b0_ver].flags) /* option flags */ +#define OFF_TICKS (b0_ofs[b0_ver].ticks) /* clock ticks */ + #define cv2(p) ((p)[0] | (p)[1] << 010) @@ -82,8 +104,12 @@ static int boot0bs(const u_int8_t *); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 13 22:46:24 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6DF510659AB; Tue, 13 Jan 2009 22:46:24 +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 D1C218FC29; Tue, 13 Jan 2009 22:46:24 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DMkORU018606; Tue, 13 Jan 2009 22:46:24 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DMkOUw018605; Tue, 13 Jan 2009 22:46:24 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901132246.n0DMkOUw018605@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 22:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187200 - stable/7/lib/libstand X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 22:46:26 -0000 Author: luigi Date: Tue Jan 13 22:46:24 2009 New Revision: 187200 URL: http://svn.freebsd.org/changeset/base/187200 Log: MFC from rev.185643 and 186799 Some libstand/bootp.c extension (written by Danny Braniss, slightly revised/modified by me) to store dhcp options into kenv variables, so the information is available to the boot loader and can be used to customize the boot process. Modified: stable/7/lib/libstand/bootp.c Modified: stable/7/lib/libstand/bootp.c ============================================================================== --- stable/7/lib/libstand/bootp.c Tue Jan 13 22:35:26 2009 (r187199) +++ stable/7/lib/libstand/bootp.c Tue Jan 13 22:46:24 2009 (r187200) @@ -47,6 +47,12 @@ __FBSDID("$FreeBSD$"); #define BOOTP_DEBUGxx #define SUPPORT_DHCP +#define DHCP_ENV_NOVENDOR 1 /* do not parse vendor options */ +#define DHCP_ENV_PXE 10 /* assume pxe vendor options */ +#define DHCP_ENV_FREEBSD 11 /* assume freebsd vendor options +/* set DHCP_ENV to one of the values above to export dhcp options to kenv */ +#define DHCP_ENV DHCP_ENV_NO_VENDOR + #include "stand.h" #include "net.h" #include "netif.h" @@ -72,6 +78,13 @@ static int vend_rfc1048(u_char *, u_int) static void vend_cmu(u_char *); #endif +#ifdef DHCP_ENV /* export the dhcp response to kenv */ +struct dhcp_opt; +static void setenv_(u_char *cp, u_char *ep, struct dhcp_opt *opts); +#else +#define setenv_(a, b, c) +#endif + #ifdef SUPPORT_DHCP static char expected_dhcpmsgtype = -1, dhcp_ok; struct in_addr dhcp_serverip; @@ -351,6 +364,8 @@ vend_rfc1048(cp, len) /* Step over magic cookie */ cp += sizeof(int); + setenv_(cp, ep, NULL); + while (cp < ep) { tag = *cp++; size = *cp++; @@ -412,3 +427,316 @@ vend_cmu(cp) } } #endif + +#ifdef DHCP_ENV +/* + * Parse DHCP options and store them into kenv variables. + * Original code from Danny Braniss, modifications by Luigi Rizzo. + * + * The parser is driven by tables which specify the type and name of + * each dhcp option and how it appears in kenv. + * The first entry in the list contains the prefix used to set the kenv + * name (including the . if needed), the last entry must have a 0 tag. + * Entries do not need to be sorted though it helps for readability. + * + * Certain vendor-specific tables can be enabled according to DHCP_ENV. + * Set it to 0 if you don't want any. + */ +enum opt_fmt { __NONE = 0, + __8 = 1, __16 = 2, __32 = 4, /* Unsigned fields, value=size */ + __IP, /* IPv4 address */ + __TXT, /* C string */ + __BYTES, /* byte sequence, printed %02x */ + __INDIR, /* name=value */ + __ILIST, /* name=value;name=value ... */ + __VE, /* vendor specific, recurse */ +}; + +struct dhcp_opt { + uint8_t tag; + uint8_t fmt; + const char *desc; +}; + +static struct dhcp_opt vndr_opt[] = { /* Vendor Specific Options */ +#if DHCP_ENV == DHCP_ENV_FREEBSD /* FreeBSD table in the original code */ + {0, 0, "FreeBSD"}, /* prefix */ + {1, __TXT, "kernel"}, + {2, __TXT, "kernelname"}, + {3, __TXT, "kernel_options"}, + {4, __IP, "usr-ip"}, + {5, __TXT, "conf-path"}, + {6, __TXT, "rc.conf0"}, + {7, __TXT, "rc.conf1"}, + {8, __TXT, "rc.conf2"}, + {9, __TXT, "rc.conf3"}, + {10, __TXT, "rc.conf4"}, + {11, __TXT, "rc.conf5"}, + {12, __TXT, "rc.conf6"}, + {13, __TXT, "rc.conf7"}, + {14, __TXT, "rc.conf8"}, + {15, __TXT, "rc.conf9"}, + + {20, __TXT, "boot.nfsroot.options"}, + + {245, __INDIR, ""}, + {246, __INDIR, ""}, + {247, __INDIR, ""}, + {248, __INDIR, ""}, + {249, __INDIR, ""}, + {250, __INDIR, ""}, + {251, __INDIR, ""}, + {252, __INDIR, ""}, + {253, __INDIR, ""}, + {254, __INDIR, ""}, + +#elif DHCP_ENV == DHCP_ENV_PXE /* some pxe options, RFC4578 */ + {0, 0, "pxe"}, /* prefix */ + {93, __16, "system-architecture"}, + {94, __BYTES, "network-interface"}, + {97, __BYTES, "machine-identifier"}, +#else /* default (empty) table */ + {0, 0, "dhcp.vendor."}, /* prefix */ +#endif + {0, __TXT, "%soption-%d"} +}; + +static struct dhcp_opt dhcp_opt[] = { + /* DHCP Option names, formats and codes, from RFC2132. */ + {0, 0, "dhcp."}, // prefix + {1, __IP, "subnet-mask"}, + {2, __32, "time-offset"}, /* this is signed */ + {3, __IP, "routers"}, + {4, __IP, "time-servers"}, + {5, __IP, "ien116-name-servers"}, + {6, __IP, "domain-name-servers"}, + {7, __IP, "log-servers"}, + {8, __IP, "cookie-servers"}, + {9, __IP, "lpr-servers"}, + {10, __IP, "impress-servers"}, + {11, __IP, "resource-location-servers"}, + {12, __TXT, "host-name"}, + {13, __16, "boot-size"}, + {14, __TXT, "merit-dump"}, + {15, __TXT, "domain-name"}, + {16, __IP, "swap-server"}, + {17, __TXT, "root-path"}, + {18, __TXT, "extensions-path"}, + {19, __8, "ip-forwarding"}, + {20, __8, "non-local-source-routing"}, + {21, __IP, "policy-filter"}, + {22, __16, "max-dgram-reassembly"}, + {23, __8, "default-ip-ttl"}, + {24, __32, "path-mtu-aging-timeout"}, + {25, __16, "path-mtu-plateau-table"}, + {26, __16, "interface-mtu"}, + {27, __8, "all-subnets-local"}, + {28, __IP, "broadcast-address"}, + {29, __8, "perform-mask-discovery"}, + {30, __8, "mask-supplier"}, + {31, __8, "perform-router-discovery"}, + {32, __IP, "router-solicitation-address"}, + {33, __IP, "static-routes"}, + {34, __8, "trailer-encapsulation"}, + {35, __32, "arp-cache-timeout"}, + {36, __8, "ieee802-3-encapsulation"}, + {37, __8, "default-tcp-ttl"}, + {38, __32, "tcp-keepalive-interval"}, + {39, __8, "tcp-keepalive-garbage"}, + {40, __TXT, "nis-domain"}, + {41, __IP, "nis-servers"}, + {42, __IP, "ntp-servers"}, + {43, __VE, "vendor-encapsulated-options"}, + {44, __IP, "netbios-name-servers"}, + {45, __IP, "netbios-dd-server"}, + {46, __8, "netbios-node-type"}, + {47, __TXT, "netbios-scope"}, + {48, __IP, "x-font-servers"}, + {49, __IP, "x-display-managers"}, + {50, __IP, "dhcp-requested-address"}, + {51, __32, "dhcp-lease-time"}, + {52, __8, "dhcp-option-overload"}, + {53, __8, "dhcp-message-type"}, + {54, __IP, "dhcp-server-identifier"}, + {55, __8, "dhcp-parameter-request-list"}, + {56, __TXT, "dhcp-message"}, + {57, __16, "dhcp-max-message-size"}, + {58, __32, "dhcp-renewal-time"}, + {59, __32, "dhcp-rebinding-time"}, + {60, __TXT, "vendor-class-identifier"}, + {61, __TXT, "dhcp-client-identifier"}, + {64, __TXT, "nisplus-domain"}, + {65, __IP, "nisplus-servers"}, + {66, __TXT, "tftp-server-name"}, + {67, __TXT, "bootfile-name"}, + {68, __IP, "mobile-ip-home-agent"}, + {69, __IP, "smtp-server"}, + {70, __IP, "pop-server"}, + {71, __IP, "nntp-server"}, + {72, __IP, "www-server"}, + {73, __IP, "finger-server"}, + {74, __IP, "irc-server"}, + {75, __IP, "streettalk-server"}, + {76, __IP, "streettalk-directory-assistance-server"}, + {77, __TXT, "user-class"}, + {85, __IP, "nds-servers"}, + {86, __TXT, "nds-tree-name"}, + {87, __TXT, "nds-context"}, + {210, __TXT, "authenticate"}, + + /* use the following entries for arbitrary variables */ + {246, __ILIST, ""}, + {247, __ILIST, ""}, + {248, __ILIST, ""}, + {249, __ILIST, ""}, + {250, __INDIR, ""}, + {251, __INDIR, ""}, + {252, __INDIR, ""}, + {253, __INDIR, ""}, + {254, __INDIR, ""}, + {0, __TXT, "%soption-%d"} +}; + +/* + * parse a dhcp response, set environment variables translating options + * names and values according to the tables above. Also set dhcp.tags + * to the list of selected tags. + */ +static void +setenv_(u_char *cp, u_char *ep, struct dhcp_opt *opts) +{ + u_char *ncp; + u_char tag; + char tags[512], *tp; /* the list of tags */ + +#define FLD_SEP ',' /* separator in list of elements */ + ncp = cp; + tp = tags; + if (opts == NULL) + opts = dhcp_opt; + + while (ncp < ep) { + unsigned int size; /* option size */ + char *vp, *endv, buf[256]; /* the value buffer */ + struct dhcp_opt *op; + + tag = *ncp++; /* extract tag and size */ + size = *ncp++; + cp = ncp; /* current payload */ + ncp += size; /* point to the next option */ + + if (tag == TAG_END) + break; + if (tag == 0) + continue; + + for (op = opts+1; op->tag && op->tag != tag; op++) + ; + /* if not found we end up on the default entry */ + + /* + * Copy data into the buffer. libstand does not have snprintf so we + * need to be careful with sprintf(). With strings, the source is + * always <256 char so shorter than the buffer so we are safe; with + * other arguments, the longest string is inet_ntoa which is 16 bytes + * so we make sure to have always enough room in the string before + * trying an sprint. + */ + vp = buf; + *vp = '\0'; + endv = buf + sizeof(buf) - 1 - 16; /* last valid write position */ + + switch(op->fmt) { + case __NONE: + break; /* should not happen */ + + case __VE: /* recurse, vendor specific */ + setenv_(cp, cp+size, vndr_opt); + break; + + case __IP: /* ip address */ + for (; size > 0 && vp < endv; size -= 4, cp += 4) { + struct in_addr in_ip; /* ip addresses */ + if (vp != buf) + *vp++ = FLD_SEP; + bcopy(cp, &in_ip.s_addr, sizeof(in_ip.s_addr)); + sprintf(vp, "%s", inet_ntoa(in_ip)); + vp += strlen(vp); + } + break; + + case __BYTES: /* opaque byte string */ + for (; size > 0 && vp < endv; size -= 1, cp += 1) { + sprintf(vp, "%02x", *cp); + vp += strlen(vp); + } + break; + + case __TXT: + bcopy(cp, buf, size); /* cannot overflow */ + buf[size] = 0; + break; + + case __32: + case __16: + case __8: /* op->fmt is also the length of each field */ + for (; size > 0 && vp < endv; size -= op->fmt, cp += op->fmt) { + uint32_t v; + if (op->fmt == __32) + v = (cp[0]<<24) + (cp[1]<<16) + (cp[2]<<8) + cp[3]; + else if (op->fmt == __16) + v = (cp[0]<<8) + cp[1]; + else + v = cp[0]; + if (vp != buf) + *vp++ = FLD_SEP; + sprintf(vp, "%u", v); + vp += strlen(vp); + } + break; + + case __INDIR: /* name=value */ + case __ILIST: /* name=value;name=value... */ + bcopy(cp, buf, size); /* cannot overflow */ + buf[size] = '\0'; + for (endv = buf; endv; endv = vp) { + u_char *s = NULL; /* semicolon ? */ + + /* skip leading whitespace */ + while (*endv && index(" \t\n\r", *endv)) + endv++; + vp = index(endv, '='); /* find name=value separator */ + if (!vp) + break; + *vp++ = 0; + if (op->fmt == __ILIST && (s = index(vp, ';'))) + *s++ = '\0'; + setenv(endv, vp, 1); + vp = s; /* prepare for next round */ + } + buf[0] = '\0'; /* option already done */ + } + + if (tp - tags < sizeof(tags) - 5) { /* add tag to the list */ + if (tp != tags) + *tp++ = FLD_SEP; + sprintf(tp, "%d", tag); + tp += strlen(tp); + } + if (buf[0]) { + char env[128]; /* the string name */ + + if (op->tag == 0) + sprintf(env, op->desc, opts[0].desc, tag); + else + sprintf(env, "%s%s", opts[0].desc, op->desc); + setenv(env, buf, 1); + } + } + if (tp != tags) { + char env[128]; /* the string name */ + sprintf(env, "%stags", opts[0].desc); + setenv(env, tags, 1); + } +} +#endif /* additional dhcp */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 13 23:02:55 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B99F10657D2; Tue, 13 Jan 2009 23:02:55 +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 012488FC16; Tue, 13 Jan 2009 23:02:55 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DN2sEZ019019; Tue, 13 Jan 2009 23:02:54 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DN2sUX019014; Tue, 13 Jan 2009 23:02:54 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901132302.n0DN2sUX019014@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 23:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187201 - stable/7/usr.sbin/kldxref X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 23:02:59 -0000 Author: luigi Date: Tue Jan 13 23:02:54 2009 New Revision: 187201 URL: http://svn.freebsd.org/changeset/base/187201 Log: MFC: rev. 185475, 186824, 186826, 186827 various cleanups including: + check a possible buffer overflow when creating a temp file, submitted by Christoph Mallon + remove stale struct definitions + clarify the use of dflag and remove useless checks + Make the linker.hints file have mode 644 instead of 600. + fix a couple of innocuous compiler warnings + correct description of how a string is stored, fix a few typos and reference the kernel file which processes this info. Modified: stable/7/usr.sbin/kldxref/Makefile stable/7/usr.sbin/kldxref/ef_i386.c stable/7/usr.sbin/kldxref/ef_obj.c stable/7/usr.sbin/kldxref/fileformat stable/7/usr.sbin/kldxref/kldxref.c Modified: stable/7/usr.sbin/kldxref/Makefile ============================================================================== --- stable/7/usr.sbin/kldxref/Makefile Tue Jan 13 22:46:24 2009 (r187200) +++ stable/7/usr.sbin/kldxref/Makefile Tue Jan 13 23:02:54 2009 (r187201) @@ -5,6 +5,7 @@ MAN= kldxref.8 SRCS= kldxref.c ef.c ef_obj.c WARNS?= 2 +CFLAGS+=-fno-strict-aliasing .if exists(ef_${MACHINE_ARCH}.c) SRCS+= ef_${MACHINE_ARCH}.c Modified: stable/7/usr.sbin/kldxref/ef_i386.c ============================================================================== --- stable/7/usr.sbin/kldxref/ef_i386.c Tue Jan 13 22:46:24 2009 (r187200) +++ stable/7/usr.sbin/kldxref/ef_i386.c Tue Jan 13 23:02:54 2009 (r187201) @@ -43,12 +43,13 @@ */ int ef_reloc(struct elf_file *ef, const void *reldata, int reltype, Elf_Off relbase, - Elf_Off dataoff, size_t len, void *dest) + Elf_Off dataoff, size_t len, void *_dest) { Elf_Addr *where, addr, addend; Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; + char *dest = _dest; switch (reltype) { case EF_RELOC_REL: Modified: stable/7/usr.sbin/kldxref/ef_obj.c ============================================================================== --- stable/7/usr.sbin/kldxref/ef_obj.c Tue Jan 13 22:46:24 2009 (r187200) +++ stable/7/usr.sbin/kldxref/ef_obj.c Tue Jan 13 23:02:54 2009 (r187201) @@ -133,7 +133,7 @@ static struct elf_file_ops ef_obj_file_o }; static int -ef_obj_get_type(elf_file_t ef) +ef_obj_get_type(elf_file_t __unused ef) { return (EFT_KLD); @@ -180,7 +180,7 @@ ef_obj_symaddr(elf_file_t ef, Elf_Size s { const Elf_Sym *sym; - if (symidx >= ef->ddbsymcnt) + if (symidx >= (size_t) ef->ddbsymcnt) return (0); sym = ef->ddbsymtab + symidx; Modified: stable/7/usr.sbin/kldxref/fileformat ============================================================================== --- stable/7/usr.sbin/kldxref/fileformat Tue Jan 13 22:46:24 2009 (r187200) +++ stable/7/usr.sbin/kldxref/fileformat Tue Jan 13 23:02:54 2009 (r187201) @@ -1,7 +1,9 @@ $FreeBSD$ - linker.hints file consists from the one or more records. First record of -file is special and determines its version: +linker.hints file consists from the one or more records, +and is processed by sys/kern/kern_linker.c::linker_hints_lookup() + +First record of file is special and determines its version: int version; @@ -16,25 +18,28 @@ struct record { 'data' determines its type: struct data { - int type; /* type of data. currently MTD_* values */ + int type; /* type of data. currently MDT_* values */ }; The rest of record depends on the type. struct string { - int length; /* length of string */ + uint8_t length; /* length of string */ char val[]; /* string itself (no terminating zero) */ }; struct data_mdt_version { int type = MDT_VERSION; struct string modname; + /* padding */ int version; struct string kldname; + /* padding */ }; struct data_mdt_module { - int type = MDT_VERSION; + int type = MDT_MODULE; struct string modname; struct string kldname; + /* padding */ }; Modified: stable/7/usr.sbin/kldxref/kldxref.c ============================================================================== --- stable/7/usr.sbin/kldxref/kldxref.c Tue Jan 13 22:46:24 2009 (r187200) +++ stable/7/usr.sbin/kldxref/kldxref.c Tue Jan 13 23:02:54 2009 (r187201) @@ -57,37 +57,19 @@ #define MAXRECSIZE 1024 #define check(val) if ((error = (val)) != 0) break -#ifndef min -#define min(a,b) (((a)<(b)) ? (a) : (b)) -#endif - -struct mod_info { - char* mi_name; - int mi_ver; - SLIST_ENTRY(mod_info) mi_next; -}; - -#ifdef notnow -struct kld_info { - char* k_filename; - SLIST_HEAD(mod_list_head, mod_info) k_modules; - SLIST_ENTRY(kld_info) k_next; -}; +static int dflag; /* do not create a hint file, only write on stdout */ +static int verbose; -SLIST_HEAD(kld_list_head, kld_info) kldlist; -#endif - -static int dflag, verbose; - -FILE *fxref; +static FILE *fxref; /* current hints file */ static const char *xref_file = "linker.hints"; +/* + * A record is stored in the static buffer recbuf before going to disk. + */ static char recbuf[MAXRECSIZE]; -static int recpos, reccnt; - -FILE *maketempfile(char *, const char *); -static void usage(void); +static int recpos; /* current write position */ +static int reccnt; /* total record written to this file so far */ static void intalign(void) @@ -105,7 +87,7 @@ record_start(void) static int record_end(void) { - if (dflag || recpos == 0) + if (recpos == 0) return 0; reccnt++; intalign(); @@ -123,6 +105,9 @@ record_buf(const void *buf, int size) return 0; } +/* + * An int is stored in host order and aligned + */ static int record_int(int val) { @@ -130,21 +115,21 @@ record_int(int val) return record_buf(&val, sizeof(val)); } -static int -record_byte(u_char val) -{ - return record_buf(&val, sizeof(val)); -} - +/* + * A string is stored as 1-byte length plus data, no padding + */ static int record_string(const char *str) { - int len = strlen(str); - int error; - + int len, error; + u_char val; + if (dflag) return 0; - error = record_byte(len); + val = len = strlen(str); + if (len > 255) + errx(1, "string %s too long", str); + error = record_buf(&val, sizeof(val)); if (error) return error; return record_buf(str, len); @@ -170,21 +155,23 @@ parse_entry(struct mod_metadata *md, con break; case MDT_VERSION: check(EF_SEG_READ(ef, data, sizeof(mdv), &mdv)); - record_int(MDT_VERSION); - record_string(cval); - record_int(mdv.mv_version); - record_string(kldname); - if (!dflag) - break; - printf(" interface %s.%d\n", cval, mdv.mv_version); + if (dflag) { + printf(" interface %s.%d\n", cval, mdv.mv_version); + } else { + record_int(MDT_VERSION); + record_string(cval); + record_int(mdv.mv_version); + record_string(kldname); + } break; case MDT_MODULE: - record_int(MDT_MODULE); - record_string(cval); - record_string(kldname); - if (!dflag) - break; - printf(" module %s\n", cval); + if (dflag) { + printf(" module %s\n", cval); + } else { + record_int(MDT_MODULE); + record_string(cval); + record_string(kldname); + } break; default: warnx("unknown metadata record %d in file %s", md->md_type, kldname); @@ -199,8 +186,6 @@ read_kld(char *filename, char *kldname) { struct mod_metadata md; struct elf_file ef; -/* struct kld_info *kip; - struct mod_info *mip;*/ void **p, **orgp; int error, eftype, nmlen; long start, finish, entries; @@ -224,8 +209,9 @@ read_kld(char *filename, char *kldname) } if (!dflag) { cp = strrchr(kldname, '.'); - nmlen = cp ? min(MAXMODNAME, cp - kldname) : - min(MAXMODNAME, strlen(kldname)); + nmlen = (cp != NULL) ? cp - kldname : (int)strlen(kldname); + if (nmlen > MAXMODNAME) + nmlen = MAXMODNAME; strlcpy(kldmodname, kldname, nmlen); /* fprintf(fxref, "%s:%s:%d\n", kldmodname, kldname, 0);*/ } @@ -252,25 +238,43 @@ read_kld(char *filename, char *kldname) return error; } -FILE * +/* + * Create a temp file in directory root, make sure we don't + * overflow the buffer for the destination name + */ +static FILE * maketempfile(char *dest, const char *root) { char *p; - int fd; + int n, fd; - strlcpy(dest, root, MAXPATHLEN); + p = strrchr(root, '/'); + n = p != NULL ? p - root + 1 : 0; + if (snprintf(dest, MAXPATHLEN, "%.*slhint.XXXXXX", n, root) >= + MAXPATHLEN) { + errno = ENAMETOOLONG; + return NULL; + } - if ((p = strrchr(dest, '/')) != 0) - p++; - else - p = dest; - strcpy(p, "lhint.XXXXXX"); fd = mkstemp(dest); - return ((fd == -1) ? NULL : fdopen(fd, "w+")); + if (fd < 0) + return NULL; + fchmod(fd, 0644); /* nothing secret in the file */ + return fdopen(fd, "w+"); } static char xrefname[MAXPATHLEN], tempname[MAXPATHLEN]; +static void +usage(void) +{ + + fprintf(stderr, "%s\n", + "usage: kldxref [-Rdv] [-f hintsfile] path ..." + ); + exit(1); +} + int main(int argc, char *argv[]) { @@ -280,20 +284,19 @@ main(int argc, char *argv[]) struct stat sb; fts_options = FTS_PHYSICAL; -/* SLIST_INIT(&kldlist);*/ while ((opt = getopt(argc, argv, "Rdf:v")) != -1) { switch (opt) { - case 'd': + case 'd': /* no hint file, only print on stdout */ dflag = 1; break; - case 'f': + case 'f': /* use this name instead of linker.hints */ xref_file = optarg; break; case 'v': verbose++; break; - case 'R': + case 'R': /* recurse on directories */ fts_options |= FTS_COMFOLLOW; break; default: @@ -319,19 +322,22 @@ main(int argc, char *argv[]) for (;;) { p = fts_read(ftsp); - if ((p == NULL || p->fts_info == FTS_D) && !dflag && fxref) { + if ((p == NULL || p->fts_info == FTS_D) && fxref) { + /* close and rename the current hint file */ fclose(fxref); fxref = NULL; if (reccnt) { rename(tempname, xrefname); } else { + /* didn't find any entry, ignore this file */ unlink(tempname); unlink(xrefname); } } if (p == NULL) break; - if (p && p->fts_info == FTS_D && !dflag) { + if (p->fts_info == FTS_D && !dflag) { + /* visiting a new directory, create a new hint file */ snprintf(xrefname, sizeof(xrefname), "%s/%s", ftsp->fts_path, xref_file); fxref = maketempfile(tempname, ftsp->fts_path); @@ -341,6 +347,7 @@ main(int argc, char *argv[]) fwrite(&ival, sizeof(ival), 1, fxref); reccnt = 0; } + /* skip non-files or .symbols entries */ if (p->fts_info != FTS_F) continue; if (p->fts_namelen >= 8 && @@ -351,13 +358,3 @@ main(int argc, char *argv[]) fts_close(ftsp); return 0; } - -static void -usage(void) -{ - - fprintf(stderr, "%s\n", - "usage: kldxref [-Rdv] [-f hintsfile] path ..." - ); - exit(1); -} From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 14 06:50:29 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 176AD10656C7; Wed, 14 Jan 2009 06:50:29 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFCEF8FC12; Wed, 14 Jan 2009 06:50:28 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0E6oS5I028191; Wed, 14 Jan 2009 06:50:28 GMT (envelope-from rafan@svn.freebsd.org) Received: (from rafan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0E6oSuV028189; Wed, 14 Jan 2009 06:50:28 GMT (envelope-from rafan@svn.freebsd.org) Message-Id: <200901140650.n0E6oSuV028189@svn.freebsd.org> From: Rong-En Fan Date: Wed, 14 Jan 2009 06:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187209 - in stable/7/sys: . conf contrib/pf dev/cxgb dev/sound/pci modules/sound/driver/au88x0 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 06:50:30 -0000 Author: rafan Date: Wed Jan 14 06:50:28 2009 New Revision: 187209 URL: http://svn.freebsd.org/changeset/base/187209 Log: MFC r186851 - Remove snd_au88x0 which seems never got compiled into kernel nor as a kernel module. These files cause manual interaction when building ports/audio/aureal-kmod which provides a usable i386-only driver (it requires linking against some linux object files distributed by vendor which bankrupted back in 2000). MFC after: 1 week PR: 124343 Deleted: stable/7/sys/dev/sound/pci/au88x0.c stable/7/sys/dev/sound/pci/au88x0.h stable/7/sys/modules/sound/driver/au88x0/ Modified: stable/7/sys/ (props changed) stable/7/sys/conf/NOTES stable/7/sys/conf/files stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/conf/NOTES ============================================================================== --- stable/7/sys/conf/NOTES Wed Jan 14 05:08:52 2009 (r187208) +++ stable/7/sys/conf/NOTES Wed Jan 14 06:50:28 2009 (r187209) @@ -1990,8 +1990,6 @@ device sound # snd_ad1816: Analog Devices AD1816 ISA PnP/non-PnP. # snd_als4000: Avance Logic ALS4000 PCI. # snd_atiixp: ATI IXP 200/300/400 PCI. -# snd_au88x0 Aureal Vortex 1/2/Advantage PCI. This driver -# lacks support for playback and recording. # snd_audiocs: Crystal Semiconductor CS4231 SBus/EBus. Only # for sparc64. # snd_cmi: CMedia CMI8338/CMI8738 PCI. @@ -2035,7 +2033,6 @@ device sound device snd_ad1816 device snd_als4000 device snd_atiixp -#device snd_au88x0 #device snd_audiocs device snd_cmi device snd_cs4281 Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Wed Jan 14 05:08:52 2009 (r187208) +++ stable/7/sys/conf/files Wed Jan 14 06:50:28 2009 (r187209) @@ -965,7 +965,6 @@ dev/sound/isa/sbc.c optional snd_sbc is dev/sound/isa/sndbuf_dma.c optional sound isa dev/sound/pci/als4000.c optional snd_als4000 pci dev/sound/pci/atiixp.c optional snd_atiixp pci -#dev/sound/pci/au88x0.c optional snd_au88x0 pci dev/sound/pci/cmi.c optional snd_cmi pci dev/sound/pci/cs4281.c optional snd_cs4281 pci dev/sound/pci/csa.c optional snd_csa pci \ From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 14 09:11:13 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83EC61065679; Wed, 14 Jan 2009 09:11:13 +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 734668FC08; Wed, 14 Jan 2009 09:11:13 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0E9BDsE030984; Wed, 14 Jan 2009 09:11:13 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0E9BDX1030983; Wed, 14 Jan 2009 09:11:13 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200901140911.n0E9BDX1030983@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 14 Jan 2009 09:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187211 - stable/7/etc/periodic/weekly X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 09:11:14 -0000 Author: ume Date: Wed Jan 14 09:11:13 2009 New Revision: 187211 URL: http://svn.freebsd.org/changeset/base/187211 Log: MFC r187210: Fix typo to install 400.status-pkg, again. Modified: stable/7/etc/periodic/weekly/ (props changed) stable/7/etc/periodic/weekly/Makefile Modified: stable/7/etc/periodic/weekly/Makefile ============================================================================== --- stable/7/etc/periodic/weekly/Makefile Wed Jan 14 09:00:30 2009 (r187210) +++ stable/7/etc/periodic/weekly/Makefile Wed Jan 14 09:11:13 2009 (r187211) @@ -16,7 +16,7 @@ FILES+= 320.whatis 330.catman .endif .if ${MK_PKGTOOLS} != "no" -FLES+= 400.status-pkg +FILES+= 400.status-pkg .endif .include From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 14 10:02:47 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B9E71065675; Wed, 14 Jan 2009 10:02:47 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DCDA8FC21; Wed, 14 Jan 2009 10:02:47 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EA2lYO032115; Wed, 14 Jan 2009 10:02:47 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EA2lmJ032114; Wed, 14 Jan 2009 10:02:47 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <200901141002.n0EA2lmJ032114@svn.freebsd.org> From: Daniel Gerzo Date: Wed, 14 Jan 2009 10:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187212 - in stable/7/sbin: . atacontrol ddb devfs dhclient fdisk fsck_ffs geom geom/class/part geom/misc ifconfig init ipfw md5 mdconfig mksnap_ffs mount natd ping ping6 sconfig X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 10:02:48 -0000 Author: danger (doc committer) Date: Wed Jan 14 10:02:47 2009 New Revision: 187212 URL: http://svn.freebsd.org/changeset/base/187212 Log: MFC r187067: Reviewed by: trhodes, keramida Modified: stable/7/sbin/ (props changed) stable/7/sbin/atacontrol/ (props changed) stable/7/sbin/ddb/ (props changed) stable/7/sbin/devfs/ (props changed) stable/7/sbin/dhclient/ (props changed) stable/7/sbin/fdisk/ (props changed) stable/7/sbin/fsck_ffs/ (props changed) stable/7/sbin/geom/ (props changed) stable/7/sbin/geom/class/part/ (props changed) stable/7/sbin/geom/misc/ (props changed) stable/7/sbin/ifconfig/ (props changed) stable/7/sbin/init/ (props changed) stable/7/sbin/ipfw/ (props changed) stable/7/sbin/md5/ (props changed) stable/7/sbin/mdconfig/ (props changed) stable/7/sbin/mksnap_ffs/ (props changed) stable/7/sbin/mount/ (props changed) stable/7/sbin/natd/ (props changed) stable/7/sbin/ping/ping.8 stable/7/sbin/ping6/ (props changed) stable/7/sbin/sconfig/ (props changed) Modified: stable/7/sbin/ping/ping.8 ============================================================================== --- stable/7/sbin/ping/ping.8 Wed Jan 14 09:11:13 2009 (r187211) +++ stable/7/sbin/ping/ping.8 Wed Jan 14 10:02:47 2009 (r187212) @@ -506,14 +506,18 @@ Others may use completely wild values. .Sh EXIT STATUS The .Nm -utility returns an exit status of zero if at least one response was -heard from the specified -.Ar host ; -a status of two if the transmission was successful but no responses -were received; or another value -(from -.In sysexits.h ) -if an error occurred. +utility exits with one of the following values: +.Bl -tag -width indent +.It 0 +At least one response was heard from the specified +.Ar host . +.It 2 +The transmission was successful but no responses were received. +.It any other value +An error occurred. +These values are defined in +.In sysexits.h . +.El .Sh SEE ALSO .Xr netstat 1 , .Xr ifconfig 8 , From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 14 10:23:44 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68BA1106564A; Wed, 14 Jan 2009 10:23:44 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from services.rulez.sk (services.rulez.sk [92.240.234.125]) by mx1.freebsd.org (Postfix) with ESMTP id 1EABD8FC0C; Wed, 14 Jan 2009 10:23:43 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from localhost (services.rulez.sk [92.240.234.125]) by services.rulez.sk (Postfix) with ESMTP id BC519133450E; Wed, 14 Jan 2009 11:06:21 +0100 (CET) X-Virus-Scanned: amavisd-new at rulez.sk Received: from services.rulez.sk ([92.240.234.125]) by localhost (services.rulez.sk [92.240.234.125]) (amavisd-new, port 10024) with ESMTP id 93wdYVa8sevU; Wed, 14 Jan 2009 11:06:21 +0100 (CET) Received: from DANGER-PC (danger.mcrn.sk [84.16.37.254]) (Authenticated sender: danger@rulez.sk) by services.rulez.sk (Postfix) with ESMTPA id 170D71334439; Wed, 14 Jan 2009 11:06:21 +0100 (CET) Date: Wed, 14 Jan 2009 11:06:14 +0100 From: Daniel Gerzo Organization: The FreeBSD Project X-Priority: 3 (Normal) Message-ID: <08225540.20090114110614@rulez.sk> To: Daniel Gerzo In-Reply-To: <200901141002.n0EA2lmJ032114@svn.freebsd.org> References: <200901141002.n0EA2lmJ032114@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r187212 - in stable/7/sbin: . atacontrol ddb devfs dhclient fdisk fsck_ffs geom geom/class/part geom/misc ifconfig init ipfw md5 mdconfig mksnap_ffs mount natd ping ping6 sconfig X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 10:23:45 -0000 Hello, Wednesday, January 14, 2009, 11:02:47 AM, you wrote: > Author: danger (doc committer) > Date: Wed Jan 14 10:02:47 2009 > New Revision: 187212 > URL: http://svn.freebsd.org/changeset/base/187212 > Log: > MFC r187067: This should also include: - improve readability Sorry for omitting it :( --=20 Best regards, Daniel mailto:danger@FreeBSD.org From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 14 14:55:11 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02969106567B; Wed, 14 Jan 2009 14:55: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 E28288FC27; Wed, 14 Jan 2009 14:55:10 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EEtABS046151; Wed, 14 Jan 2009 14:55:10 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EEtAjf046147; Wed, 14 Jan 2009 14:55:10 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901141455.n0EEtAjf046147@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 14:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187222 - in stable/7/sys/boot: common forth X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 14:55:12 -0000 Author: luigi Date: Wed Jan 14 14:55:10 2009 New Revision: 187222 URL: http://svn.freebsd.org/changeset/base/187222 Log: MFC: 185746 186789 187143 misc fixes and cleanup of the Forth scripts used by the loader, see the original commits for details. The only visible change is that now setting loader_conf_files="foo bar ${some.var}" works as expected, and expands variables correctly. Also, ${variables} can be used consistently in all assignments in *.conf files managed by the loader. NOTE: this commit has nothing to do with the pxeboot and /boot/loader problems that people are seeing on 6.4 and 7.2 -- those are related to issues with the loader code, not with the scripts that the loader processes. Modified: stable/7/sys/boot/common/interp.c stable/7/sys/boot/forth/loader.4th stable/7/sys/boot/forth/pnp.4th stable/7/sys/boot/forth/support.4th Modified: stable/7/sys/boot/common/interp.c ============================================================================== --- stable/7/sys/boot/common/interp.c Wed Jan 14 14:20:08 2009 (r187221) +++ stable/7/sys/boot/common/interp.c Wed Jan 14 14:55:10 2009 (r187222) @@ -92,7 +92,7 @@ perform(int argc, char *argv[]) void interact(void) { - char input[256]; /* big enough? */ + static char input[256]; /* big enough? */ #ifndef BOOT_FORTH int argc; char **argv; @@ -178,14 +178,21 @@ command_include(int argc, char *argv[]) return(res); } +/* + * Header prepended to each line. The text immediately follows the header. + * We try to make this short in order to save memory -- the loader has + * limited memory available, and some of the forth files are very long. + */ struct includeline { - char *text; + struct includeline *next; +#ifndef BOOT_FORTH int flags; int line; #define SL_QUIET (1<<0) #define SL_IGNOREERR (1<<1) - struct includeline *next; +#endif + char text[0]; }; int @@ -236,13 +243,14 @@ include(const char *filename) } #endif /* Allocate script line structure and copy line, flags */ + if (*cp == '\0') + continue; /* ignore empty line, save memory */ sp = malloc(sizeof(struct includeline) + strlen(cp) + 1); - sp->text = (char *)sp + sizeof(struct includeline); strcpy(sp->text, cp); #ifndef BOOT_FORTH sp->flags = flags; -#endif sp->line = line; +#endif sp->next = NULL; if (script == NULL) { Modified: stable/7/sys/boot/forth/loader.4th ============================================================================== --- stable/7/sys/boot/forth/loader.4th Wed Jan 14 14:20:08 2009 (r187221) +++ stable/7/sys/boot/forth/loader.4th Wed Jan 14 14:55:10 2009 (r187222) @@ -93,6 +93,7 @@ only forth definitions also support-func \ \ If a password was defined, execute autoboot and ask for \ password if autoboot returns. +\ Do not exit unless the right password is given. : check-password password .addr @ if @@ -150,8 +151,7 @@ only forth definitions also support-func \ line, if interpreted, or given on the stack, if compiled in. : (read-conf) ( addr len -- ) - conf_files .addr @ ?dup if free abort" Fatal error freeing memory" then - strdup conf_files .len ! conf_files .addr ! + conf_files string= include_conf_files \ Will recurse on new loader_conf_files definitions ; @@ -165,110 +165,26 @@ only forth definitions also support-func then ; immediate -\ ***** enable-module -\ -\ Turn a module loading on. +\ show, enable, disable, toggle module loading. They all take module from +\ the next word -: enable-module ( -- ) - bl parse module_options @ >r - begin - r@ - while - 2dup - r@ module.name dup .addr @ swap .len @ - compare 0= if - 2drop - r@ module.name dup .addr @ swap .len @ type - true r> module.flag ! - ." will be loaded." cr - exit - then - r> module.next @ >r - repeat - r> drop - type ." wasn't found." cr +: set-module-flag ( module_addr val -- ) \ set and print flag + over module.flag ! + dup module.name strtype + module.flag @ if ." will be loaded" else ." will not be loaded" then cr ; -\ ***** disable-module -\ -\ Turn a module loading off. - -: disable-module ( -- ) - bl parse module_options @ >r - begin - r@ - while - 2dup - r@ module.name dup .addr @ swap .len @ - compare 0= if - 2drop - r@ module.name dup .addr @ swap .len @ type - false r> module.flag ! - ." will not be loaded." cr - exit - then - r> module.next @ >r - repeat - r> drop - type ." wasn't found." cr -; +: enable-module find-module ?dup if true set-module-flag then ; -\ ***** toggle-module -\ -\ Turn a module loading on/off. +: disable-module find-module ?dup if false set-module-flag then ; -: toggle-module ( -- ) - bl parse module_options @ >r - begin - r@ - while - 2dup - r@ module.name dup .addr @ swap .len @ - compare 0= if - 2drop - r@ module.name dup .addr @ swap .len @ type - r@ module.flag @ 0= dup r> module.flag ! - if - ." will be loaded." cr - else - ." will not be loaded." cr - then - exit - then - r> module.next @ >r - repeat - r> drop - type ." wasn't found." cr -; +: toggle-module find-module ?dup if dup module.flag @ 0= set-module-flag then ; \ ***** show-module \ \ Show loading information about a module. -: show-module ( -- ) - bl parse module_options @ >r - begin - r@ - while - 2dup - r@ module.name dup .addr @ swap .len @ - compare 0= if - 2drop - ." Name: " r@ module.name dup .addr @ swap .len @ type cr - ." Path: " r@ module.loadname dup .addr @ swap .len @ type cr - ." Type: " r@ module.type dup .addr @ swap .len @ type cr - ." Flags: " r@ module.args dup .addr @ swap .len @ type cr - ." Before load: " r@ module.beforeload dup .addr @ swap .len @ type cr - ." After load: " r@ module.afterload dup .addr @ swap .len @ type cr - ." Error: " r@ module.loaderror dup .addr @ swap .len @ type cr - ." Status: " r> module.flag @ if ." Load" else ." Don't load" then cr - exit - then - r> module.next @ >r - repeat - r> drop - type ." wasn't found." cr -; +: show-module ( -- ) find-module ?dup if show-one-module then ; \ Words to be used inside configuration files Modified: stable/7/sys/boot/forth/pnp.4th ============================================================================== --- stable/7/sys/boot/forth/pnp.4th Wed Jan 14 14:20:08 2009 (r187221) +++ stable/7/sys/boot/forth/pnp.4th Wed Jan 14 14:55:10 2009 (r187222) @@ -24,6 +24,39 @@ \ \ $FreeBSD$ + +\ The following pnp code is used in pnp.4th and pnp.c +structure: STAILQ_HEAD + ptr stqh_first \ type* + ptr stqh_last \ type** +;structure + +structure: STAILQ_ENTRY + ptr stqe_next \ type* +;structure + +structure: pnphandler + ptr pnph.name + ptr pnph.enumerate +;structure + +structure: pnpident + ptr pnpid.ident \ char* + sizeof STAILQ_ENTRY cells member: pnpid.link \ pnpident +;structure + +structure: pnpinfo \ sync with sys/boot/config/bootstrap.h + ptr pnpi.desc + int pnpi.revision + ptr pnpi.module \ (char*) module args + int pnpi.argc + ptr pnpi.argv + ptr pnpi.handler \ pnphandler + sizeof STAILQ_HEAD member: pnpi.ident \ pnpident + sizeof STAILQ_ENTRY member: pnpi.link \ pnpinfo +;structure +\ end of pnp support + pnpdevices drop : enumerate Modified: stable/7/sys/boot/forth/support.4th ============================================================================== --- stable/7/sys/boot/forth/support.4th Wed Jan 14 14:20:08 2009 (r187221) +++ stable/7/sys/boot/forth/support.4th Wed Jan 14 14:55:10 2009 (r187222) @@ -26,7 +26,6 @@ \ Loader.rc support functions: \ -\ initialize_support ( -- ) initialize global variables \ initialize ( addr len -- ) as above, plus load_conf_files \ load_conf ( addr len -- ) load conf file given \ include_conf_files ( -- ) load all conf files in load_conf_files @@ -61,24 +60,23 @@ \ value any_conf_read? indicates if a conf file was succesfully read \ \ Other exported words: -\ +\ note, strlen is internal \ strdup ( addr len -- addr' len) similar to strdup(3) \ strcat ( addr len addr' len' -- addr len+len' ) similar to strcat(3) -\ strlen ( addr -- len ) similar to strlen(3) \ s' ( | string' -- addr len | ) similar to s" \ rudimentary structure support \ Exception values -1 constant syntax_error -2 constant out_of_memory -3 constant free_error -4 constant set_error -5 constant read_error -6 constant open_error -7 constant exec_error -8 constant before_load_error -9 constant after_load_error +1 constant ESYNTAX +2 constant ENOMEM +3 constant EFREE +4 constant ESETERROR \ error setting environment variable +5 constant EREAD \ error reading +6 constant EOPEN +7 constant EEXEC \ XXX never catched +8 constant EBEFORELOAD +9 constant EAFTERLOAD \ I/O constants @@ -132,7 +130,8 @@ structure: module ptr module.next ;structure -\ Internal loader structures +\ Internal loader structures (preloaded_file, kernel_module, file_metadata) +\ must be in sync with the C struct in sys/boot/common/bootstrap.h structure: preloaded_file ptr pf.name ptr pf.type @@ -159,51 +158,7 @@ structure: file_metadata 0 member: md.data \ variable size ;structure -structure: config_resource - ptr cf.name - int cf.type -0 constant RES_INT -1 constant RES_STRING -2 constant RES_LONG - 2 cells member: u -;structure - -structure: config_device - ptr cd.name - int cd.unit - int cd.resource_count - ptr cd.resources \ config_resource -;structure - -structure: STAILQ_HEAD - ptr stqh_first \ type* - ptr stqh_last \ type** -;structure - -structure: STAILQ_ENTRY - ptr stqe_next \ type* -;structure - -structure: pnphandler - ptr pnph.name - ptr pnph.enumerate -;structure - -structure: pnpident - ptr pnpid.ident \ char* - sizeof STAILQ_ENTRY cells member: pnpid.link \ pnpident -;structure - -structure: pnpinfo - ptr pnpi.desc - int pnpi.revision - ptr pnpi.module \ (char*) module args - int pnpi.argc - ptr pnpi.argv - ptr pnpi.handler \ pnphandler - sizeof STAILQ_HEAD member: pnpi.ident \ pnpident - sizeof STAILQ_ENTRY member: pnpi.link \ pnpinfo -;structure +\ end of structures \ Global variables @@ -216,11 +171,9 @@ create last_module_option sizeof module. 0 value nextboot? \ Support string functions - -: strdup ( addr len -- addr' len ) - >r r@ allocate if out_of_memory throw then - tuck r@ move - r> +: strdup { addr len -- addr' len' } + len allocate if ENOMEM throw then + addr over len move len ; : strcat { addr len addr' len' -- addr len+len' } @@ -228,29 +181,27 @@ create last_module_option sizeof module. addr len len' + ; -: strlen ( addr -- len ) - 0 >r +: strchr { addr len c -- addr' len' } begin - dup c@ while - 1+ r> 1+ >r repeat - drop r> + len + while + addr c@ c = if addr len exit then + addr 1 + to addr + len 1 - to len + repeat + 0 0 ; -: s' +: s' \ same as s", allows " in the string [char] ' parse - state @ if - postpone sliteral - then + state @ if postpone sliteral then ; immediate : 2>r postpone >r postpone >r ; immediate : 2r> postpone r> postpone r> ; immediate : 2r@ postpone 2r> postpone 2dup postpone 2>r ; immediate -: getenv? - getenv - -1 = if false else drop true then -; +: getenv? getenv -1 = if false else drop true then ; \ Private definitions @@ -271,22 +222,45 @@ only forth also support-functions defini \ Standard suffixes -: load_module_suffix s" _load" ; -: module_loadname_suffix s" _name" ; -: module_type_suffix s" _type" ; -: module_args_suffix s" _flags" ; -: module_beforeload_suffix s" _before" ; -: module_afterload_suffix s" _after" ; -: module_loaderror_suffix s" _error" ; +: load_module_suffix s" _load" ; +: module_loadname_suffix s" _name" ; +: module_type_suffix s" _type" ; +: module_args_suffix s" _flags" ; +: module_beforeload_suffix s" _before" ; +: module_afterload_suffix s" _after" ; +: module_loaderror_suffix s" _error" ; \ Support operators : >= < 0= ; : <= > 0= ; -\ Assorted support funcitons +\ Assorted support functions + +: free-memory free if EFREE throw then ; + +: strget { var -- addr len } var .addr @ var .len @ ; + +\ assign addr len to variable. +: strset { addr len var -- } addr var .addr ! len var .len ! ; -: free-memory free if free_error throw then ; +\ free memory and reset fields +: strfree { var -- } var .addr @ ?dup if free-memory 0 0 var strset then ; + +\ free old content, make a copy of the string and assign to variable +: string= { addr len var -- } var strfree addr len strdup var strset ; + +: strtype ( str -- ) strget type ; + +\ assign a reference to what is on the stack +: strref { addr len var -- addr len } + addr var .addr ! len var .len ! addr len +; + +\ unquote a string +: unquote ( addr len -- addr len ) + over c@ [char] " = if 2 chars - swap char+ swap then +; \ Assignment data temporary storage @@ -355,16 +329,16 @@ line-reading definitions line_buffer .len @ if line_buffer .addr @ line_buffer .len @ r@ + - resize if out_of_memory throw then + resize if ENOMEM throw then else - r@ allocate if out_of_memory throw then + r@ allocate if ENOMEM throw then then line_buffer .addr ! r> ; : append_to_line_buffer ( addr len -- ) - line_buffer .addr @ line_buffer .len @ + line_buffer strget 2swap strcat line_buffer .len ! drop @@ -384,23 +358,15 @@ line-reading definitions : refill_buffer 0 to read_buffer_ptr read_buffer .addr @ 0= if - read_buffer_size allocate if out_of_memory throw then + read_buffer_size allocate if ENOMEM throw then read_buffer .addr ! then fd @ read_buffer .addr @ read_buffer_size fread - dup -1 = if read_error throw then + dup -1 = if EREAD throw then dup 0= if true to end_of_file? then read_buffer .len ! ; -: reset_line_buffer - line_buffer .addr @ ?dup if - free-memory - then - 0 line_buffer .addr ! - 0 line_buffer .len ! -; - support-functions definitions : reset_line_reading @@ -408,7 +374,7 @@ support-functions definitions ; : read_line - reset_line_buffer + line_buffer strfree skip_newlines begin read_from_buffer @@ -448,9 +414,9 @@ also parser definitions also 0 value parsing_function 0 value end_of_line -: end_of_line? - line_pointer end_of_line = -; +: end_of_line? line_pointer end_of_line = ; + +\ classifiers for various character classes in the input line : letter? line_pointer c@ >r @@ -469,70 +435,46 @@ also parser definitions also or ; -: quote? - line_pointer c@ [char] " = -; +: quote? line_pointer c@ [char] " = ; -: assignment_sign? - line_pointer c@ [char] = = -; +: assignment_sign? line_pointer c@ [char] = = ; -: comment? - line_pointer c@ [char] # = -; +: comment? line_pointer c@ [char] # = ; -: space? - line_pointer c@ bl = - line_pointer c@ tab = or -; +: space? line_pointer c@ bl = line_pointer c@ tab = or ; -: backslash? - line_pointer c@ [char] \ = -; +: backslash? line_pointer c@ [char] \ = ; -: underscore? - line_pointer c@ [char] _ = -; +: underscore? line_pointer c@ [char] _ = ; -: dot? - line_pointer c@ [char] . = -; +: dot? line_pointer c@ [char] . = ; -: skip_character - line_pointer char+ to line_pointer -; +\ manipulation of input line +: skip_character line_pointer char+ to line_pointer ; -: skip_to_end_of_line - end_of_line to line_pointer -; +: skip_to_end_of_line end_of_line to line_pointer ; : eat_space begin - space? + end_of_line? if 0 else space? then while skip_character - end_of_line? if exit then repeat ; : parse_name ( -- addr len ) line_pointer begin - letter? digit? underscore? dot? or or or + end_of_line? if 0 else letter? digit? underscore? dot? or or or then while skip_character - end_of_line? if - line_pointer over - - strdup - exit - then repeat line_pointer over - strdup ; : remove_backslashes { addr len | addr' len' -- addr' len' } - len allocate if out_of_memory throw then + len allocate if ENOMEM throw then to addr' addr >r begin @@ -550,16 +492,16 @@ also parser definitions also : parse_quote ( -- addr len ) line_pointer skip_character - end_of_line? if syntax_error throw then + end_of_line? if ESYNTAX throw then begin quote? 0= while backslash? if skip_character - end_of_line? if syntax_error throw then + end_of_line? if ESYNTAX throw then then skip_character - end_of_line? if syntax_error throw then + end_of_line? if ESYNTAX throw then repeat skip_character line_pointer over - @@ -568,8 +510,7 @@ also parser definitions also : read_name parse_name ( -- addr len ) - name_buffer .len ! - name_buffer .addr ! + name_buffer strset ; : read_value @@ -578,8 +519,7 @@ also parser definitions also else parse_name ( -- addr len ) then - value_buffer .len ! - value_buffer .addr ! + value_buffer strset ; : comment @@ -589,7 +529,7 @@ also parser definitions also : white_space_4 eat_space comment? if ['] comment to parsing_function exit then - end_of_line? 0= if syntax_error throw then + end_of_line? 0= if ESYNTAX throw then ; : variable_value @@ -602,7 +542,7 @@ also parser definitions also letter? digit? quote? or or if ['] variable_value to parsing_function exit then - syntax_error throw + ESYNTAX throw ; : assignment_sign @@ -613,7 +553,7 @@ also parser definitions also : white_space_2 eat_space assignment_sign? if ['] assignment_sign to parsing_function exit then - syntax_error throw + ESYNTAX throw ; : variable_name @@ -625,13 +565,13 @@ also parser definitions also eat_space letter? if ['] variable_name to parsing_function exit then comment? if ['] comment to parsing_function exit then - end_of_line? 0= if syntax_error throw then + end_of_line? 0= if ESYNTAX throw then ; file-processing definitions : get_assignment - line_buffer .addr @ line_buffer .len @ + to end_of_line + line_buffer strget + to end_of_line line_buffer .addr @ to line_pointer ['] white_space_1 to parsing_function begin @@ -642,7 +582,7 @@ file-processing definitions parsing_function ['] comment = parsing_function ['] white_space_1 = parsing_function ['] white_space_4 = - or or 0= if syntax_error throw then + or or 0= if ESYNTAX throw then ; only forth also support-functions also file-processing definitions also @@ -650,7 +590,7 @@ only forth also support-functions also f \ Process line : assignment_type? ( addr len -- flag ) - name_buffer .addr @ name_buffer .len @ + name_buffer strget compare 0= ; @@ -660,82 +600,56 @@ only forth also support-functions also f over compare 0= ; -: loader_conf_files? - s" loader_conf_files" assignment_type? -; +: loader_conf_files? s" loader_conf_files" assignment_type? ; -: nextboot_flag? - s" nextboot_enable" assignment_type? -; +: nextboot_flag? s" nextboot_enable" assignment_type? ; -: nextboot_conf? - s" nextboot_conf" assignment_type? -; +: nextboot_conf? s" nextboot_conf" assignment_type? ; -: verbose_flag? - s" verbose_loading" assignment_type? -; +: verbose_flag? s" verbose_loading" assignment_type? ; -: execute? - s" exec" assignment_type? -; +: execute? s" exec" assignment_type? ; -: password? - s" password" assignment_type? -; +: password? s" password" assignment_type? ; -: module_load? - load_module_suffix suffix_type? -; +: module_load? load_module_suffix suffix_type? ; -: module_loadname? - module_loadname_suffix suffix_type? -; +: module_loadname? module_loadname_suffix suffix_type? ; -: module_type? - module_type_suffix suffix_type? -; +: module_type? module_type_suffix suffix_type? ; -: module_args? - module_args_suffix suffix_type? -; +: module_args? module_args_suffix suffix_type? ; -: module_beforeload? - module_beforeload_suffix suffix_type? -; +: module_beforeload? module_beforeload_suffix suffix_type? ; -: module_afterload? - module_afterload_suffix suffix_type? -; +: module_afterload? module_afterload_suffix suffix_type? ; -: module_loaderror? - module_loaderror_suffix suffix_type? -; +: module_loaderror? module_loaderror_suffix suffix_type? ; -: set_conf_files - conf_files .addr @ ?dup if - free-memory - then - value_buffer .addr @ c@ [char] " = if - value_buffer .addr @ char+ value_buffer .len @ 2 chars - +\ build a 'set' statement and execute it +: set_environment_variable + name_buffer .len @ value_buffer .len @ + 5 chars + \ size of result string + allocate if ENOMEM throw then + dup 0 \ start with an empty string and append the pieces + s" set " strcat + name_buffer strget strcat + s" =" strcat + value_buffer strget strcat + ['] evaluate catch if + 2drop free drop + ESETERROR throw else - value_buffer .addr @ value_buffer .len @ + free-memory then - strdup - conf_files .len ! conf_files .addr ! ; -: set_nextboot_conf - nextboot_conf_file .addr @ ?dup if - free-memory - then - value_buffer .addr @ c@ [char] " = if - value_buffer .addr @ char+ value_buffer .len @ 2 chars - - else - value_buffer .addr @ value_buffer .len @ - then - strdup - nextboot_conf_file .len ! nextboot_conf_file .addr ! +: set_conf_files + set_environment_variable + s" loader_conf_files" getenv conf_files string= +; + +: set_nextboot_conf \ XXX maybe do as set_conf_files ? + value_buffer strget unquote nextboot_conf_file string= ; : append_to_module_options_list ( addr -- ) @@ -748,35 +662,32 @@ only forth also support-functions also f then ; -: set_module_name ( addr -- ) - name_buffer .addr @ name_buffer .len @ - strdup - >r over module.name .addr ! - r> swap module.name .len ! +: set_module_name { addr -- } \ check leaks + name_buffer strget addr module.name string= ; : yes_value? - value_buffer .addr @ value_buffer .len @ + value_buffer strget \ XXX could use unquote 2dup s' "YES"' compare >r 2dup s' "yes"' compare >r 2dup s" YES" compare >r s" yes" compare r> r> r> and and and 0= ; -: find_module_option ( -- addr | 0 ) +: find_module_option ( -- addr | 0 ) \ return ptr to entry matching name_buffer module_options @ begin dup while - dup module.name dup .addr @ swap .len @ - name_buffer .addr @ name_buffer .len @ + dup module.name strget + name_buffer strget compare 0= if exit then module.next @ repeat ; : new_module_option ( -- addr ) - sizeof module allocate if out_of_memory throw then + sizeof module allocate if ENOMEM throw then dup sizeof module erase dup append_to_module_options_list dup set_module_name @@ -794,98 +705,38 @@ only forth also support-functions also f : set_module_args name_buffer .len @ module_args_suffix nip - name_buffer .len ! - get_module_option module.args - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! + value_buffer strget unquote + get_module_option module.args string= ; : set_module_loadname name_buffer .len @ module_loadname_suffix nip - name_buffer .len ! - get_module_option module.loadname - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! + value_buffer strget unquote + get_module_option module.loadname string= ; : set_module_type name_buffer .len @ module_type_suffix nip - name_buffer .len ! - get_module_option module.type - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! + value_buffer strget unquote + get_module_option module.type string= ; : set_module_beforeload name_buffer .len @ module_beforeload_suffix nip - name_buffer .len ! - get_module_option module.beforeload - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! + value_buffer strget unquote + get_module_option module.beforeload string= ; : set_module_afterload name_buffer .len @ module_afterload_suffix nip - name_buffer .len ! - get_module_option module.afterload - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! + value_buffer strget unquote + get_module_option module.afterload string= ; : set_module_loaderror name_buffer .len @ module_loaderror_suffix nip - name_buffer .len ! - get_module_option module.loaderror - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! -; - -: set_environment_variable - name_buffer .len @ - value_buffer .len @ + - 5 chars + - allocate if out_of_memory throw then - dup 0 ( addr -- addr addr len ) - s" set " strcat - name_buffer .addr @ name_buffer .len @ strcat - s" =" strcat - value_buffer .addr @ value_buffer .len @ strcat - ['] evaluate catch if - 2drop free drop - set_error throw - else - free-memory - then + value_buffer strget unquote + get_module_option module.loaderror string= ; : set_nextboot_flag @@ -897,23 +748,12 @@ only forth also support-functions also f ; : execute_command - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 - swap char+ swap - then - ['] evaluate catch if exec_error throw then + value_buffer strget unquote + ['] evaluate catch if EEXEC throw then ; : set_password - password .addr @ ?dup if free if free_error throw then then - value_buffer .addr @ c@ [char] " = if - value_buffer .addr @ char+ value_buffer .len @ 2 - strdup - value_buffer .addr @ free if free_error throw then - else - value_buffer .addr @ value_buffer .len @ - then - password .len ! password .addr ! - 0 value_buffer .addr ! *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 14 16:13:52 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1BC810656CA; Wed, 14 Jan 2009 16:13:51 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9B58FC08; Wed, 14 Jan 2009 16:13:51 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EGDpFS047743; Wed, 14 Jan 2009 16:13:51 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EGDp6o047742; Wed, 14 Jan 2009 16:13:51 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901141613.n0EGDp6o047742@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 16:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187225 - stable/7/sys/boot/common X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 16:13:54 -0000 Author: luigi Date: Wed Jan 14 16:13:51 2009 New Revision: 187225 URL: http://svn.freebsd.org/changeset/base/187225 Log: forced commit to remind that the previous commit also merged the change in rev.185132 to reduce the amount of memory used when loading a script. Modified: stable/7/sys/boot/common/interp.c Modified: stable/7/sys/boot/common/interp.c ============================================================================== --- stable/7/sys/boot/common/interp.c Wed Jan 14 16:03:10 2009 (r187224) +++ stable/7/sys/boot/common/interp.c Wed Jan 14 16:13:51 2009 (r187225) @@ -46,7 +46,7 @@ extern FICL_VM *bf_vm; #define RETURN(x) return(x) #endif -#define MAXARGS 20 /* maximum number of arguments allowed */ +#define MAXARGS 20 /* maximum number of arguments allowed */ static void prompt(void); From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 14 16:27:04 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64854106567D; Wed, 14 Jan 2009 16:27:04 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5294C8FC16; Wed, 14 Jan 2009 16:27:04 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EGR4ju048041; Wed, 14 Jan 2009 16:27:04 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EGR4Jj048040; Wed, 14 Jan 2009 16:27:04 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200901141627.n0EGR4Jj048040@svn.freebsd.org> From: Ken Smith Date: Wed, 14 Jan 2009 16:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187226 - stable/7 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 16:27:05 -0000 Author: kensmith Date: Wed Jan 14 16:27:04 2009 New Revision: 187226 URL: http://svn.freebsd.org/changeset/base/187226 Log: Oops, forgot to mention 7.1-RELEASE in stable/7... Submitted by: Florian Smeets Modified: stable/7/UPDATING Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Wed Jan 14 16:13:51 2009 (r187225) +++ stable/7/UPDATING Wed Jan 14 16:27:04 2009 (r187226) @@ -23,6 +23,9 @@ portupgrade. hw.snd.default_unit sysctl according to sound(4) and snd_hda(4) man pages. +20090106: + FreeBSD 7.1-RELEASE + 20080903: ntpd has been upgraded to 4.2.4p5. From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 14 18:23:13 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA35710656CE; Wed, 14 Jan 2009 18:23:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A89888FC0A; Wed, 14 Jan 2009 18:23:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EIND0V050412; Wed, 14 Jan 2009 18:23:13 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EINDgS050409; Wed, 14 Jan 2009 18:23:13 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901141823.n0EINDgS050409@svn.freebsd.org> From: Sam Leffler Date: Wed, 14 Jan 2009 18:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187229 - in stable/7/usr.bin: calendar cksum comm cpuset fetch file gzip ipcrm ipcs kdump ktrace ldd lockf logger make netstat nsupdate procstat sed shar su tar top truncate truss unit... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 18:23:17 -0000 Author: sam Date: Wed Jan 14 18:23:13 2009 New Revision: 187229 URL: http://svn.freebsd.org/changeset/base/187229 Log: bring in bits missed in r187106: sync build infrastructure changes with HEAD Noticed by: attilio Modified: stable/7/usr.bin/calendar/ (props changed) stable/7/usr.bin/cksum/ (props changed) stable/7/usr.bin/comm/ (props changed) stable/7/usr.bin/cpuset/ (props changed) stable/7/usr.bin/fetch/ (props changed) stable/7/usr.bin/file/ (props changed) stable/7/usr.bin/gzip/ (props changed) stable/7/usr.bin/ipcrm/ (props changed) stable/7/usr.bin/ipcs/ (props changed) stable/7/usr.bin/kdump/ (props changed) stable/7/usr.bin/ktrace/ (props changed) stable/7/usr.bin/ldd/ (props changed) stable/7/usr.bin/lockf/ (props changed) stable/7/usr.bin/logger/ (props changed) stable/7/usr.bin/make/ (props changed) stable/7/usr.bin/netstat/ (props changed) stable/7/usr.bin/netstat/Makefile stable/7/usr.bin/netstat/main.c stable/7/usr.bin/netstat/netstat.h stable/7/usr.bin/nsupdate/ (props changed) stable/7/usr.bin/procstat/ (props changed) stable/7/usr.bin/sed/ (props changed) stable/7/usr.bin/shar/ (props changed) stable/7/usr.bin/su/ (props changed) stable/7/usr.bin/tar/ (props changed) stable/7/usr.bin/top/ (props changed) stable/7/usr.bin/truncate/ (props changed) stable/7/usr.bin/truss/ (props changed) stable/7/usr.bin/units/ (props changed) stable/7/usr.bin/vmstat/ (props changed) stable/7/usr.bin/whereis/ (props changed) stable/7/usr.bin/window/ (props changed) stable/7/usr.bin/xargs/ (props changed) Modified: stable/7/usr.bin/netstat/Makefile ============================================================================== --- stable/7/usr.bin/netstat/Makefile Wed Jan 14 18:19:06 2009 (r187228) +++ stable/7/usr.bin/netstat/Makefile Wed Jan 14 18:23:13 2009 (r187229) @@ -5,7 +5,7 @@ PROG= netstat SRCS= if.c inet.c main.c mbuf.c mcast.c mroute.c route.c \ - unix.c atalk.c netgraph.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c + unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c WARNS?= 3 CFLAGS+=-fno-strict-aliasing @@ -20,8 +20,15 @@ CFLAGS+=-DINET6 BINGRP= kmem BINMODE=2555 -DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBNETGRAPH} ${LIBUTIL} -LDADD= -lkvm -lmemstat -lnetgraph -lutil +DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBUTIL} +LDADD= -lkvm -lmemstat -lutil + +.if ${MK_NETGRAPH_SUPPORT} != "no" +SRCS+= netgraph.c +DPADD+= ${LIBNETGRAPH} +LDADD+= -lnetgraph +CFLAGS+=-DNETGRAPH +.endif .if ${MK_IPX_SUPPORT} != "no" SRCS+= ipx.c Modified: stable/7/usr.bin/netstat/main.c ============================================================================== --- stable/7/usr.bin/netstat/main.c Wed Jan 14 18:19:06 2009 (r187228) +++ stable/7/usr.bin/netstat/main.c Wed Jan 14 18:23:13 2009 (r187229) @@ -54,7 +54,9 @@ __FBSDID("$FreeBSD$"); #include +#ifdef NETGRAPH #include +#endif #include #include @@ -272,7 +274,7 @@ struct protox atalkprotox[] = { { -1, -1, 0, NULL, NULL, NULL, NULL, 0, 0 } }; - +#ifdef NETGRAPH struct protox netgraphprotox[] = { { N_NGSOCKS, -1, 1, netgraphprotopr, NULL, NULL, "ctrl", 0, 0 }, @@ -281,7 +283,7 @@ struct protox netgraphprotox[] = { { -1, -1, 0, NULL, NULL, NULL, NULL, 0, 0 } }; - +#endif #ifdef IPX struct protox ipxprotox[] = { { N_IPX, N_IPXSTAT, 1, ipxprotopr, @@ -383,9 +385,11 @@ main(int argc, char *argv[]) af = AF_UNIX; else if (strcmp(optarg, "atalk") == 0) af = AF_APPLETALK; +#ifdef NETGRAPH else if (strcmp(optarg, "ng") == 0 || strcmp(optarg, "netgraph") == 0) af = AF_NETGRAPH; +#endif else if (strcmp(optarg, "link") == 0) af = AF_LINK; else { @@ -580,9 +584,11 @@ main(int argc, char *argv[]) if (af == AF_APPLETALK || af == AF_UNSPEC) for (tp = atalkprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); +#ifdef NETGRAPH if (af == AF_NETGRAPH || af == AF_UNSPEC) for (tp = netgraphprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); +#endif /* NETGRAPH */ if ((af == AF_UNIX || af == AF_UNSPEC) && !Lflag && !sflag) unixpr(nl[N_UNP_COUNT].n_value, nl[N_UNP_GENCNT].n_value, nl[N_UNP_DHEAD].n_value, nl[N_UNP_SHEAD].n_value); Modified: stable/7/usr.bin/netstat/netstat.h ============================================================================== --- stable/7/usr.bin/netstat/netstat.h Wed Jan 14 18:19:06 2009 (r187228) +++ stable/7/usr.bin/netstat/netstat.h Wed Jan 14 18:23:13 2009 (r187229) @@ -144,7 +144,9 @@ void nserr_stats(u_long, const char *, i void atalkprotopr(u_long, const char *, int, int); void ddp_stats(u_long, const char *, int, int); +#ifdef NETGRAPH void netgraphprotopr(u_long, const char *, int, int); +#endif void unixpr(u_long, u_long, u_long, u_long); From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 14 19:39:23 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE834106566B; Wed, 14 Jan 2009 19:39:23 +0000 (UTC) (envelope-from bra@fsn.hu) Received: from people.fsn.hu (people.fsn.hu [195.228.252.137]) by mx1.freebsd.org (Postfix) with ESMTP id 3E5BE8FC24; Wed, 14 Jan 2009 19:39:22 +0000 (UTC) (envelope-from bra@fsn.hu) Received: from [172.27.51.4] (fw.axelero.hu [195.228.243.120]) by people.fsn.hu (Postfix) with ESMTP id 0F8EFAAB2A; Wed, 14 Jan 2009 20:20:56 +0100 (CET) Message-ID: <496E3B17.1030403@fsn.hu> Date: Wed, 14 Jan 2009 20:20:55 +0100 From: Attila Nagy User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Sam Leffler References: <200901141823.n0EINDgS050409@svn.freebsd.org> In-Reply-To: <200901141823.n0EINDgS050409@svn.freebsd.org> X-Stationery: 0.4.8.12 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (people.fsn.hu [0.0.0.0]); Wed, 14 Jan 2009 20:20:56 +0100 (CET) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r187229 - in stable/7/usr.bin: calendar cksum comm cpuset fetch file gzip ipcrm ipcs kdump ktrace ldd lockf logger make netstat nsupdate procstat sed shar su tar top truncate truss unit... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 19:39:24 -0000 Hello, Sam Leffler wrote: > Author: sam > Date: Wed Jan 14 18:23:13 2009 > New Revision: 187229 > URL: http://svn.freebsd.org/changeset/base/187229 > > Log: > bring in bits missed in r187106: sync build infrastructure changes with HEAD > > Noticed by: attilio > Cool nick, thanks, but I think it's already taken. ;) From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 14 21:04:23 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF3681065680; Wed, 14 Jan 2009 21:04:23 +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 9D2848FC1E; Wed, 14 Jan 2009 21:04:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EL4N1r053848; Wed, 14 Jan 2009 21:04:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EL4NFm053847; Wed, 14 Jan 2009 21:04:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901142104.n0EL4NFm053847@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 Jan 2009 21:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187240 - in stable/7/sys: . contrib/pf dev/cxgb dev/dcons X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 21:04:24 -0000 Author: marius Date: Wed Jan 14 21:04:23 2009 New Revision: 187240 URL: http://svn.freebsd.org/changeset/base/187240 Log: MFC: r185108 Given that the buffer dcons_crom(4) exposes is used for both input and output, set BUS_DMA_COHERENT when creating the DMA map used for loading the buffer. As a side-effect this solves locking issues on sparc64 when dcons(4) calls bus_dmamap_sync(9) while in an interrupt filter, which are executed in a critical section, and iommu(4) has to use a sleep lock when taking advantage of the streaming buffer. Reported and tested by: kensmith Approved by: simokawa Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/dcons/dcons_crom.c Modified: stable/7/sys/dev/dcons/dcons_crom.c ============================================================================== --- stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 20:53:46 2009 (r187239) +++ stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 21:04:23 2009 (r187240) @@ -229,7 +229,7 @@ dcons_crom_attach(device_t dev) /*lockarg*/&Giant, #endif &sc->dma_tag); - bus_dmamap_create(sc->dma_tag, 0, &sc->dma_map); + bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map); bus_dmamap_load(sc->dma_tag, sc->dma_map, (void *)dcons_conf->buf, dcons_conf->size, dmamap_cb, sc, 0); From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 14 22:10:51 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B66F3106567A; Wed, 14 Jan 2009 22:10:51 +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 A39A58FC16; Wed, 14 Jan 2009 22:10:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EMApeJ055450; Wed, 14 Jan 2009 22:10:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EMAptA055448; Wed, 14 Jan 2009 22:10:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901142210.n0EMAptA055448@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 Jan 2009 22:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187249 - in stable/7/sys: . contrib/pf dev/cxgb dev/dcons X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 22:10:53 -0000 Author: marius Date: Wed Jan 14 22:10:51 2009 New Revision: 187249 URL: http://svn.freebsd.org/changeset/base/187249 Log: MFC: r186876 Check the return values of contigmalloc(9) as well as bus_dma(9) functions and stop attaching of dcons(4) and dcons_crom(4) if they indicate failure. This fixes a panic seen on sparc64 machines with no free physical memory in the requested 32-bit region but still doesn't make dcons(4)/dcons_crom(4) these work. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/dcons/dcons_crom.c stable/7/sys/dev/dcons/dcons_os.c Modified: stable/7/sys/dev/dcons/dcons_crom.c ============================================================================== --- stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 22:05:51 2009 (r187248) +++ stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 22:10:51 2009 (r187249) @@ -205,7 +205,10 @@ dcons_crom_attach(device_t dev) return (-1); #else struct dcons_crom_softc *sc; + int error; + if (dcons_conf->buf == NULL) + return (ENXIO); sc = (struct dcons_crom_softc *) device_get_softc(dev); sc->fd.fc = device_get_ivars(dev); sc->fd.dev = dev; @@ -213,7 +216,7 @@ dcons_crom_attach(device_t dev) sc->fd.post_busreset = (void *) dcons_crom_post_busreset; /* map dcons buffer */ - bus_dma_tag_create( + error = bus_dma_tag_create( /*parent*/ sc->fd.fc->dmat, /*alignment*/ sizeof(u_int32_t), /*boundary*/ 0, @@ -229,10 +232,16 @@ dcons_crom_attach(device_t dev) /*lockarg*/&Giant, #endif &sc->dma_tag); - bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map); - bus_dmamap_load(sc->dma_tag, sc->dma_map, + if (error != 0) + return (error); + error = bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map); + if (error != 0) + return (error); + error = bus_dmamap_load(sc->dma_tag, sc->dma_map, (void *)dcons_conf->buf, dcons_conf->size, dmamap_cb, sc, 0); + if (error != 0) + return (error); sc->ehand = EVENTHANDLER_REGISTER(dcons_poll, dcons_crom_poll, (void *)sc, 0); return (0); Modified: stable/7/sys/dev/dcons/dcons_os.c ============================================================================== --- stable/7/sys/dev/dcons/dcons_os.c Wed Jan 14 22:05:51 2009 (r187248) +++ stable/7/sys/dev/dcons/dcons_os.c Wed Jan 14 22:10:51 2009 (r187249) @@ -557,6 +557,8 @@ dcons_drv_init(int stage) */ dg.buf = (struct dcons_buf *) contigmalloc(dg.size, M_DEVBUF, 0, 0x10000, 0xffffffff, PAGE_SIZE, 0ul); + if (dg.buf == NULL) + return (-1); dcons_init(dg.buf, dg.size, sc); } @@ -680,9 +682,9 @@ dcons_modevent(module_t mode, int type, switch (type) { case MOD_LOAD: ret = dcons_drv_init(1); - dcons_attach(); #if __FreeBSD_version >= 500000 if (ret == 0) { + dcons_attach(); dcons_cnprobe(&dcons_consdev); dcons_cninit(&dcons_consdev); cnadd(&dcons_consdev); @@ -691,24 +693,26 @@ dcons_modevent(module_t mode, int type, break; case MOD_UNLOAD: printf("dcons: unload\n"); - callout_stop(&dcons_callout); + if (drv_init == 1) { + callout_stop(&dcons_callout); #if __FreeBSD_version < 502122 #if defined(DDB) && DCONS_FORCE_GDB #if CONS_NODEV - gdb_arg = NULL; + gdb_arg = NULL; #else - gdbdev = NULL; + gdbdev = NULL; #endif #endif #endif #if __FreeBSD_version >= 500000 - cnremove(&dcons_consdev); + cnremove(&dcons_consdev); #endif - dcons_detach(DCONS_CON); - dcons_detach(DCONS_GDB); - dg.buf->magic = 0; + dcons_detach(DCONS_CON); + dcons_detach(DCONS_GDB); + dg.buf->magic = 0; - contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF); + contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF); + } break; case MOD_SHUTDOWN: From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 00:33:18 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F73A1065675; Thu, 15 Jan 2009 00:33:18 +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 1D4FC8FC1D; Thu, 15 Jan 2009 00:33:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F0XIRm058292; Thu, 15 Jan 2009 00:33:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F0XIt3058291; Thu, 15 Jan 2009 00:33:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901150033.n0F0XIt3058291@svn.freebsd.org> From: Xin LI Date: Thu, 15 Jan 2009 00:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187256 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 00:33:19 -0000 Author: delphij Date: Thu Jan 15 00:33:17 2009 New Revision: 187256 URL: http://svn.freebsd.org/changeset/base/187256 Log: MFC r187079: Fix typo. Submitted by: Ben Kaduk Modified: stable/7/sbin/fsck_ffs/ (props changed) stable/7/sbin/fsck_ffs/fsck_ffs.8 Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/7/sbin/fsck_ffs/fsck_ffs.8 Wed Jan 14 23:53:06 2009 (r187255) +++ stable/7/sbin/fsck_ffs/fsck_ffs.8 Thu Jan 15 00:33:17 2009 (r187256) @@ -187,7 +187,7 @@ and causes .Nm to crash otherwise. Be .Em very careful -using this flag, is dangerous if there are data transmission hazards +using this flag, it is dangerous if there are data transmission hazards because a false positive cylinder group magic number mismatch could cause .Em irrevertible data loss! From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 02:54:40 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92D9E1065670; Thu, 15 Jan 2009 02:54:40 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F69A8FC08; Thu, 15 Jan 2009 02:54:40 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F2se9U061283; Thu, 15 Jan 2009 02:54:40 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F2seon061282; Thu, 15 Jan 2009 02:54:40 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150254.n0F2seon061282@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 02:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187263 - stable/7/sbin/mdconfig X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 02:54:41 -0000 Author: keramida (doc committer) Date: Thu Jan 15 02:54:40 2009 New Revision: 187263 URL: http://svn.freebsd.org/changeset/base/187263 Log: MFC 173507 from /head. Instead of hardcoding md10 as the device node in the cd9660 example, use a trick submitted by Ruslan. Modified: stable/7/sbin/mdconfig/ (props changed) stable/7/sbin/mdconfig/mdconfig.8 Modified: stable/7/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:52:31 2009 (r187262) +++ stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:54:40 2009 (r187263) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 5, 2008 +.Dd November 9, 2007 .Dt MDCONFIG 8 .Os .Sh NAME @@ -230,8 +230,7 @@ mount /dev/md0c /mnt .Pp To mount an ISO 9660 CD image file: .Bd -literal -offset indent -mdconfig -a -t vnode -u 10 -f cdimage.iso -mount_cd9660 /dev/md10 /mnt +mount -t cd9660 /dev/`mdconfig -a -t vnode -f cdimage.iso` /mnt .Ed .Sh SEE ALSO .Xr md 4 , From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 02:57:08 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 092B2106564A; Thu, 15 Jan 2009 02:57:08 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D041F8FC14; Thu, 15 Jan 2009 02:57:07 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F2v7TY061384; Thu, 15 Jan 2009 02:57:07 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F2v77w061383; Thu, 15 Jan 2009 02:57:07 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150257.n0F2v77w061383@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 02:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187264 - stable/7/sbin/mdconfig X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 02:57:08 -0000 Author: keramida (doc committer) Date: Thu Jan 15 02:57:07 2009 New Revision: 187264 URL: http://svn.freebsd.org/changeset/base/187264 Log: MFC 173539 from /head * Expand the example descriptions, fix mdoc-bugs in "(-a and -t vnode are implied)" and reuse it near the cd9660 example. * Spell 'backing store' as two words. Modified: stable/7/sbin/mdconfig/ (props changed) stable/7/sbin/mdconfig/mdconfig.8 Modified: stable/7/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:54:40 2009 (r187263) +++ stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:57:07 2009 (r187264) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 9, 2007 +.Dd November 11, 2007 .Dt MDCONFIG 8 .Os .Sh NAME @@ -97,7 +97,7 @@ panic a system. .It Cm vnode A file specified with .Fl f Ar file -becomes the backingstore for this memory disk. +becomes the backing store for this memory disk. .It Cm swap Storage for this type of memory disk is allocated from buffer memory. @@ -197,7 +197,7 @@ To create a disk named .Pa /dev/md4 with .Pa /tmp/boot.flp -as backing: +as backing storage: .Pp .Dl mdconfig -a -t vnode -f /tmp/boot.flp -u 4 .Pp @@ -206,7 +206,9 @@ To detach and free all resources used by .Pp .Dl mdconfig -d -u 4 .Pp -To create and mount a 128MByte swap backed file system on +To create a 128MByte swap backed disk, initialize an +.Xr ffs 7 +file system on it, and mount it on .Pa /tmp : .Bd -literal -offset indent mdconfig -a -t swap -s 128M -u 10 @@ -215,10 +217,10 @@ mount /dev/md10 /tmp chmod 1777 /tmp .Ed .Pp -To create a 5MB file-backed disk ( -.Fl -a +To create a 5MB file-backed disk +.Ns ( Fl a and -.Fl -t Ar vnode +.Fl t Ar vnode are implied): .Bd -literal -offset indent dd if=/dev/zero of=somebackingfile bs=1k count=5k @@ -228,12 +230,21 @@ newfs md0c mount /dev/md0c /mnt .Ed .Pp -To mount an ISO 9660 CD image file: +To create an +.Xr md 4 +device out of an ISO 9660 CD image file +.Ns ( Fl a +and +.Fl t Ar vnode +are implied), using the first available +.Xr md 4 +device, and then mount the new memory disk: .Bd -literal -offset indent -mount -t cd9660 /dev/`mdconfig -a -t vnode -f cdimage.iso` /mnt +mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt .Ed .Sh SEE ALSO .Xr md 4 , +.Xr ffs 7 , .Xr bsdlabel 8 , .Xr fdisk 8 , .Xr mdmfs 8 , From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 03:12:46 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10D2E1065674; Thu, 15 Jan 2009 03:12:46 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F14AB8FC18; Thu, 15 Jan 2009 03:12:45 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F3CjST062007; Thu, 15 Jan 2009 03:12:45 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F3Cj9F062006; Thu, 15 Jan 2009 03:12:45 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150312.n0F3Cj9F062006@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 03:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187265 - stable/7/usr.sbin/iostat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 03:12:47 -0000 Author: keramida (doc committer) Date: Thu Jan 15 03:12:45 2009 New Revision: 187265 URL: http://svn.freebsd.org/changeset/base/187265 Log: MFC 175562 from /head Repeat iostat header after rows-3 instead of a hardcoded 20. Use ioctl() to get the window size in iostat(8), and force a new header to be prepended to the output every time the current window size changes. Change the number of lines before each header to `rows - 3' when the terminal is resized, so that the full terminal length can be used for output lines. Modified: stable/7/usr.sbin/iostat/ (props changed) stable/7/usr.sbin/iostat/iostat.c Modified: stable/7/usr.sbin/iostat/iostat.c ============================================================================== --- stable/7/usr.sbin/iostat/iostat.c Thu Jan 15 02:57:07 2009 (r187264) +++ stable/7/usr.sbin/iostat/iostat.c Thu Jan 15 03:12:45 2009 (r187265) @@ -113,6 +113,7 @@ #include #include #include +#include #include #include #include @@ -129,17 +130,23 @@ struct nlist namelist[] = { { NULL }, }; +#define IOSTAT_DEFAULT_ROWS 20 /* Traditional default `wrows' */ + struct statinfo cur, last; int num_devices; struct device_selection *dev_select; int maxshowdevs; volatile sig_atomic_t headercount; +volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +unsigned short wrows; /* Current number of tty rows. */ int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; int xflag = 0, zflag = 0; /* local function declarations */ static void usage(void); static void needhdr(int signo); +static void needresize(int signo); +static void doresize(void); static void phdr(void); static void devstats(int perf_select, long double etime, int havelast); static void cpustats(void); @@ -424,6 +431,20 @@ main(int argc, char **argv) */ (void)signal(SIGCONT, needhdr); + /* + * If our standard output is a tty, then install a SIGWINCH handler + * and set wresized so that our first iteration through the main + * iostat loop will peek at the terminal's current rows to find out + * how many lines can fit in a screenful of output. + */ + if (isatty(fileno(stdout)) != 0) { + wresized = 1; + (void)signal(SIGWINCH, needresize); + } else { + wresized = 0; + wrows = IOSTAT_DEFAULT_ROWS; + } + for (headercount = 1;;) { struct devinfo *tmp_dinfo; long tmp; @@ -457,7 +478,9 @@ main(int argc, char **argv) if (!--headercount) { phdr(); - headercount = 20; + if (wresized != 0) + doresize(); + headercount = wrows; } tmp_dinfo = last.dinfo; @@ -499,7 +522,9 @@ main(int argc, char **argv) break; case 1: phdr(); - headercount = 20; + if (wresized != 0) + doresize(); + headercount = wrows; break; default: break; @@ -534,7 +559,9 @@ main(int argc, char **argv) break; case 1: phdr(); - headercount = 20; + if (wresized != 0) + doresize(); + headercount = wrows; break; default: break; @@ -595,6 +622,47 @@ needhdr(int signo) headercount = 1; } +/* + * When the terminal is resized, force an update of the maximum number of rows + * printed between each header repetition. Then force a new header to be + * prepended to the next output. + */ +void +needresize(int signo) +{ + + wresized = 1; + headercount = 1; +} + +/* + * Update the global `wrows' count of terminal rows. + */ +void +doresize(void) +{ + int status; + struct winsize w; + + for (;;) { + status = ioctl(fileno(stdout), TIOCGWINSZ, &w); + if (status == -1 && errno == EINTR) + continue; + else if (status == -1) + err(1, "ioctl"); + if (w.ws_row > 3) + wrows = w.ws_row - 3; + else + wrows = IOSTAT_DEFAULT_ROWS; + break; + } + + /* + * Inhibit doresize() calls until we are rescheduled by SIGWINCH. + */ + wresized = 0; +} + static void phdr(void) { From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 03:48:49 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C510106564A; Thu, 15 Jan 2009 03:48:49 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 893F78FC08; Thu, 15 Jan 2009 03:48:49 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F3mn9x063033; Thu, 15 Jan 2009 03:48:49 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F3mnsH063031; Thu, 15 Jan 2009 03:48:49 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150348.n0F3mnsH063031@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 03:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187272 - stable/7/usr.bin/du X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 03:48:50 -0000 Author: keramida (doc committer) Date: Thu Jan 15 03:48:49 2009 New Revision: 187272 URL: http://svn.freebsd.org/changeset/base/187272 Log: 176561 | keramida | 2008-02-25 21:06:43 +0200 (Mon, 25 Feb 2008) | 11 lines Implement from scratch a -l option for du(1), to match the same option of the GNU utility. The default behavior of our original `du' is to count hardlinked files only once for each invocation of the utility. With the new -l option they count towards the final size every time they are found. Modified: stable/7/usr.bin/du/ (props changed) stable/7/usr.bin/du/du.1 stable/7/usr.bin/du/du.c Modified: stable/7/usr.bin/du/du.1 ============================================================================== --- stable/7/usr.bin/du/du.1 Thu Jan 15 03:46:14 2009 (r187271) +++ stable/7/usr.bin/du/du.1 Thu Jan 15 03:48:49 2009 (r187272) @@ -32,7 +32,7 @@ .\" @(#)du.1 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd May 6, 2006 +.Dd February 25, 2008 .Dt DU 1 .Os .Sh NAME @@ -43,6 +43,7 @@ .Op Fl H | L | P .Op Fl a | s | d Ar depth .Op Fl c +.Op Fl l .Op Fl h | k | m .Op Fl n .Op Fl x @@ -94,6 +95,15 @@ directories deep. Display a grand total. .It Fl k Display block counts in 1024-byte (1-Kbyte) blocks. +.It Fl l +If a file has multiple hard links, count its size many times. +The default behavior of +.Nm +is to count files with multiple hard links only once. +When the +.Fl l +option is specified, the hard link checks are disabled, and these files +are counted (and displayed) as many times as they are found. .It Fl m Display block counts in 1048576-byte (1-Mbyte) blocks. .It Fl n @@ -120,11 +130,6 @@ or .Fl L options are specified, storage used by any symbolic links which are followed is not counted or displayed. -.Pp -Files having multiple hard links are counted (and displayed) a single -time per -.Nm -execution. .Sh ENVIRONMENT .Bl -tag -width BLOCKSIZE .It Ev BLOCKSIZE Modified: stable/7/usr.bin/du/du.c ============================================================================== --- stable/7/usr.bin/du/du.c Thu Jan 15 03:46:14 2009 (r187271) +++ stable/7/usr.bin/du/du.c Thu Jan 15 03:48:49 2009 (r187272) @@ -90,20 +90,22 @@ main(int argc, char *argv[]) int ftsoptions; int listall; int depth; - int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag, hflag, ch, notused, rval; + int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag; + int hflag, lflag, ch, notused, rval; char **save; static char dot[] = "."; setlocale(LC_ALL, ""); - Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = 0; + Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = + lflag = 0; save = argv; ftsoptions = 0; depth = INT_MAX; SLIST_INIT(&ignores); - while ((ch = getopt(argc, argv, "HI:LPasd:chkmnrx")) != -1) + while ((ch = getopt(argc, argv, "HI:LPasd:chklmnrx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -147,6 +149,9 @@ main(int argc, char *argv[]) hflag = 0; setenv("BLOCKSIZE", "1024", 1); break; + case 'l': + lflag = 1; + break; case 'm': hflag = 0; setenv("BLOCKSIZE", "1048576", 1); @@ -257,7 +262,8 @@ main(int argc, char *argv[]) if (ignorep(p)) break; - if (p->fts_statp->st_nlink > 1 && linkchk(p)) + if (lflag == 0 && + p->fts_statp->st_nlink > 1 && linkchk(p)) break; if (listall || p->fts_level == 0) { @@ -443,7 +449,8 @@ static void usage(void) { (void)fprintf(stderr, - "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m] [-n] [-x] [-I mask] [file ...]\n"); + "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] " + "[-l] [-h | -k | -m] [-n] [-x] [-I mask] [file ...]\n"); exit(EX_USAGE); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 04:31:55 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69086106566B; Thu, 15 Jan 2009 04:31:55 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5661B8FC12; Thu, 15 Jan 2009 04:31:55 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4VtT4064273; Thu, 15 Jan 2009 04:31:55 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4Vtvq064272; Thu, 15 Jan 2009 04:31:55 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150431.n0F4Vtvq064272@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187278 - in stable/7/lib/libc: . regex string X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:31:56 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:31:55 2009 New Revision: 187278 URL: http://svn.freebsd.org/changeset/base/187278 Log: MFC 182795 from /head Add two example regexps: (1) one for matching all the characters that belong in a character class, and (2) one for matching all the characters *not* in a character class. Submitted by: Mark B, mkbucc at gmail.com Modified: stable/7/lib/libc/ (props changed) stable/7/lib/libc/regex/re_format.7 stable/7/lib/libc/string/ffsll.c (props changed) stable/7/lib/libc/string/flsll.c (props changed) Modified: stable/7/lib/libc/regex/re_format.7 ============================================================================== --- stable/7/lib/libc/regex/re_format.7 Thu Jan 15 04:29:02 2009 (r187277) +++ stable/7/lib/libc/regex/re_format.7 Thu Jan 15 04:31:55 2009 (r187278) @@ -288,6 +288,14 @@ These stand for the character classes de A locale may provide others. A character class may not be used as an endpoint of a range. .Pp +A bracketed expression like +.Ql [[:class:]] +can be used to match a single character that belongs to a character +class. +The reverse, matching any character that does not belong to a specific +class, the negation operator of bracket expressions may be used: +.Ql [^[:class:]] . +.Pp There are two special cases\(dd of bracket expressions: the bracket expressions .Ql [[:<:]] From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 04:39:44 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BC97106564A; Thu, 15 Jan 2009 04:39:44 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7957D8FC20; Thu, 15 Jan 2009 04:39:44 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4dio6064507; Thu, 15 Jan 2009 04:39:44 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4diG7064506; Thu, 15 Jan 2009 04:39:44 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150439.n0F4diG7064506@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187280 - stable/7/sbin/ifconfig X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:39:45 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:39:44 2009 New Revision: 187280 URL: http://svn.freebsd.org/changeset/base/187280 Log: MFC 184057 from /head Modified: stable/7/sbin/ifconfig/ifconfig.8 Modified: stable/7/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.8 Thu Jan 15 04:32:53 2009 (r187279) +++ stable/7/sbin/ifconfig/ifconfig.8 Thu Jan 15 04:39:44 2009 (r187280) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd June 20, 2008 +.Dd October 19, 2008 .Dt IFCONFIG 8 .Os .Sh NAME @@ -106,7 +106,7 @@ slash notation) to include the netmask. That is, one can specify an address like .Li 192.168.0.1/16 . .Pp -For +For the .Dq inet6 family, it is also possible to specify the prefix length using the slash notation, like @@ -906,8 +906,9 @@ This information may be updated automati and/or with a .Cm scan request or through background scanning. +The .Cm list ap -is another way of requesting this information. +command is another way of requesting this information. .It Cm list sta When operating as an access point display the stations that are currently associated. From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 04:48:06 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B142810656C3; Thu, 15 Jan 2009 04:48:06 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 787888FC3A; Thu, 15 Jan 2009 04:48:06 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4m6Wf064733; Thu, 15 Jan 2009 04:48:06 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4m6xl064732; Thu, 15 Jan 2009 04:48:06 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150448.n0F4m6xl064732@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187282 - stable/7/usr.bin/vmstat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:48:14 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:48:06 2009 New Revision: 187282 URL: http://svn.freebsd.org/changeset/base/187282 Log: MFC 184645 from /head Repeat vmstat header after window.rows instead of a hardcoded 20. Use ioctl() to get the window size in vmstat(8), and force a new header to be prepended to the output every time the current window size changes. Change the number of lines before each header to the current lines of the terminal when the terminal is resized, so that the full terminal length can be used for output lines. Modified: stable/7/usr.bin/vmstat/vmstat.c Modified: stable/7/usr.bin/vmstat/vmstat.c ============================================================================== --- stable/7/usr.bin/vmstat/vmstat.c Thu Jan 15 04:43:09 2009 (r187281) +++ stable/7/usr.bin/vmstat/vmstat.c Thu Jan 15 04:48:06 2009 (r187282) @@ -133,7 +133,10 @@ static devstat_select_mode select_mode; static struct vmmeter sum, osum; -static int winlines = 20; +#define VMSTAT_DEFAULT_LINES 20 /* Default number of `winlines'. */ +volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +static int winlines = VMSTAT_DEFAULT_LINES; /* Current number of tty rows. */ + static int aflag; static int nflag; static int Pflag; @@ -162,6 +165,8 @@ static void kread(int, void *, size_t); static void kreado(int, void *, size_t, size_t); static char *kgetstr(const char *); static void needhdr(int); +static void needresize(int); +static void doresize(void); static void printhdr(int, u_long); static void usage(void); @@ -277,8 +282,6 @@ main(int argc, char *argv[]) errx(1, "Cannot use -P with crash dumps"); if (todo & VMSTAT) { - struct winsize winsize; - /* * Make sure that the userland devstat version matches the * kernel devstat version. If not, exit and print a @@ -289,11 +292,6 @@ main(int argc, char *argv[]) argv = getdrivedata(argv); - winsize.ws_row = 0; - (void) ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&winsize); - if (winsize.ws_row > 0) - winlines = winsize.ws_row; - } #define BACKWARD_COMPATIBILITY @@ -578,8 +576,27 @@ dovmstat(unsigned int interval, int reps uptime = getuptime(); halfuptime = uptime / 2; + + /* + * If the user stops the program (control-Z) and then resumes it, + * print out the header again. + */ (void)signal(SIGCONT, needhdr); + /* + * If our standard output is a tty, then install a SIGWINCH handler + * and set wresized so that our first iteration through the main + * iostat loop will peek at the terminal's current rows to find out + * how many lines can fit in a screenful of output. + */ + if (isatty(fileno(stdout)) != 0) { + wresized = 1; + (void)signal(SIGWINCH, needresize); + } else { + wresized = 0; + winlines = VMSTAT_DEFAULT_LINES; + } + if (kd != NULL) { if (namelist[X_STATHZ].n_type != 0 && namelist[X_STATHZ].n_value != 0) @@ -758,7 +775,9 @@ printhdr(int ncpus, u_long cpumask) printf("\n"); } else printf(" us sy id\n"); - hdrcnt = winlines - 2; + if (wresized != 0) + doresize(); + hdrcnt = winlines; } /* @@ -771,6 +790,47 @@ needhdr(int dummy __unused) hdrcnt = 1; } +/* + * When the terminal is resized, force an update of the maximum number of rows + * printed between each header repetition. Then force a new header to be + * prepended to the next output. + */ +void +needresize(int signo) +{ + + wresized = 1; + hdrcnt = 1; +} + +/* + * Update the global `winlines' count of terminal rows. + */ +void +doresize(void) +{ + int status; + struct winsize w; + + for (;;) { + status = ioctl(fileno(stdout), TIOCGWINSZ, &w); + if (status == -1 && errno == EINTR) + continue; + else if (status == -1) + err(1, "ioctl"); + if (w.ws_row > 3) + winlines = w.ws_row - 3; + else + winlines = VMSTAT_DEFAULT_LINES; + break; + } + + /* + * Inhibit doresize() calls until we are rescheduled by SIGWINCH. + */ + wresized = 0; +} + #ifdef notyet static void dotimes(void) From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 04:54:43 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4F9E1065672; Thu, 15 Jan 2009 04:54:43 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A24F98FC08; Thu, 15 Jan 2009 04:54:43 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4sh0T064978; Thu, 15 Jan 2009 04:54:43 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4shcA064976; Thu, 15 Jan 2009 04:54:43 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150454.n0F4shcA064976@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187285 - stable/7/usr.bin/wc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:54:44 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:54:43 2009 New Revision: 187285 URL: http://svn.freebsd.org/changeset/base/187285 Log: MFC 185714 from /head Add a -L option to wc(1), for finger compatibility with the GNU wc utility. The -L option can be used to report the length of the longest line wc has seen in one or more files. It is disabled by default, and wc uses the standard `-lwc'. Submitted by: Sheldon Givens, sheldon at sigsegv.ca Modified: stable/7/usr.bin/wc/ (props changed) stable/7/usr.bin/wc/wc.1 stable/7/usr.bin/wc/wc.c Modified: stable/7/usr.bin/wc/wc.1 ============================================================================== --- stable/7/usr.bin/wc/wc.1 Thu Jan 15 04:49:43 2009 (r187284) +++ stable/7/usr.bin/wc/wc.1 Thu Jan 15 04:54:43 2009 (r187285) @@ -35,7 +35,7 @@ .\" @(#)wc.1 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 23, 2005 +.Dd December 6, 2008 .Dt WC 1 .Os .Sh NAME @@ -43,7 +43,7 @@ .Nd word, line, character, and byte count .Sh SYNOPSIS .Nm -.Op Fl clmw +.Op Fl Lclmw .Op Ar .Sh DESCRIPTION The @@ -71,6 +71,15 @@ the last file. .Pp The following options are available: .Bl -tag -width indent +.It Fl L +The number of characters in the longest input line +is written to the standard output. +When more then one +.Ar file +argument is specified, the longest input line of +.Em all +files is reported as the value of the final +.Dq total . .It Fl c The number of bytes in each input file is written to the standard output. @@ -129,6 +138,10 @@ and as well as the totals for both: .Pp .Dl "wc -mlw report1 report2" +.Pp +Find the longest line in a list of files: +.Pp +.Dl "wc -L file1 file2 file3 | fgrep total" .Sh COMPATIBILITY Historically, the .Nm @@ -154,6 +167,16 @@ in terms of the .Xr iswspace 3 function, as required by .St -p1003.2 . +.Pp +The +.Fl L +option is a non-standard +.Fx +extension, compatible with the +.Fl L +option of the GNU +.Nm +utility. .Sh SEE ALSO .Xr iswspace 3 .Sh STANDARDS Modified: stable/7/usr.bin/wc/wc.c ============================================================================== --- stable/7/usr.bin/wc/wc.c Thu Jan 15 04:49:43 2009 (r187284) +++ stable/7/usr.bin/wc/wc.c Thu Jan 15 04:54:43 2009 (r187285) @@ -62,8 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include -uintmax_t tlinect, twordct, tcharct; -int doline, doword, dochar, domulti; +uintmax_t tlinect, twordct, tcharct, tlongline; +int doline, doword, dochar, domulti, dolongline; static int cnt(const char *); static void usage(void); @@ -75,7 +75,7 @@ main(int argc, char *argv[]) (void) setlocale(LC_CTYPE, ""); - while ((ch = getopt(argc, argv, "clmw")) != -1) + while ((ch = getopt(argc, argv, "clmwL")) != -1) switch((char)ch) { case 'l': doline = 1; @@ -87,6 +87,9 @@ main(int argc, char *argv[]) dochar = 1; domulti = 0; break; + case 'L': + dolongline = 1; + break; case 'm': domulti = 1; dochar = 0; @@ -99,7 +102,7 @@ main(int argc, char *argv[]) argc -= optind; /* Wc's flags are on by default. */ - if (doline + doword + dochar + domulti == 0) + if (doline + doword + dochar + domulti + dolongline == 0) doline = doword = dochar = 1; errors = 0; @@ -125,6 +128,8 @@ main(int argc, char *argv[]) (void)printf(" %7ju", twordct); if (dochar || domulti) (void)printf(" %7ju", tcharct); + if (dolongline) + (void)printf(" %7ju", tlongline); (void)printf(" total\n"); } exit(errors == 0 ? 0 : 1); @@ -134,7 +139,7 @@ static int cnt(const char *file) { struct stat sb; - uintmax_t linect, wordct, charct; + uintmax_t linect, wordct, charct, llct, tmpll; int fd, len, warned; size_t clen; short gotsp; @@ -143,7 +148,7 @@ cnt(const char *file) wchar_t wch; mbstate_t mbs; - linect = wordct = charct = 0; + linect = wordct = charct = llct = tmpll = 0; if (file == NULL) { file = "stdin"; fd = STDIN_FILENO; @@ -168,8 +173,13 @@ cnt(const char *file) } charct += len; for (p = buf; len--; ++p) - if (*p == '\n') + if (*p == '\n') { + if (tmpll > llct) + llct = tmpll; + tmpll = 0; ++linect; + } else + tmpll++; } tlinect += linect; (void)printf(" %7ju", linect); @@ -177,6 +187,11 @@ cnt(const char *file) tcharct += charct; (void)printf(" %7ju", charct); } + if (dolongline) { + if (llct > tlongline) + tlongline = llct; + (void)printf(" %7ju", tlongline); + } (void)close(fd); return (0); } @@ -229,10 +244,16 @@ word: gotsp = 1; else if (clen == 0) clen = 1; charct++; + if (wch != L'\n') + tmpll++; len -= clen; p += clen; - if (wch == L'\n') + if (wch == L'\n') { + if (tmpll > llct) + llct = tmpll; + tmpll = 0; ++linect; + } if (iswspace(wch)) gotsp = 1; else if (gotsp) { @@ -256,6 +277,11 @@ word: gotsp = 1; tcharct += charct; (void)printf(" %7ju", charct); } + if (dolongline) { + if (llct > tlongline) + tlongline = llct; + (void)printf(" %7ju", llct); + } (void)close(fd); return (0); } @@ -263,6 +289,6 @@ word: gotsp = 1; static void usage() { - (void)fprintf(stderr, "usage: wc [-clmw] [file ...]\n"); + (void)fprintf(stderr, "usage: wc [-Lclmw] [file ...]\n"); exit(1); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 05:01:29 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EB4F106566B; Thu, 15 Jan 2009 05:01:29 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6738FC0A; Thu, 15 Jan 2009 05:01:29 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F51TPO065236; Thu, 15 Jan 2009 05:01:29 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F51To4065235; Thu, 15 Jan 2009 05:01:29 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150501.n0F51To4065235@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 05:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187287 - in stable/7/etc: . defaults periodic/weekly X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 05:01:30 -0000 Author: keramida (doc committer) Date: Thu Jan 15 05:01:29 2009 New Revision: 187287 URL: http://svn.freebsd.org/changeset/base/187287 Log: MFC 186916 from /head/etc The description of the various securelevels has moved to the security.7 manpage a while ago. Modified: stable/7/etc/ (props changed) stable/7/etc/defaults/rc.conf stable/7/etc/periodic/weekly/ (props changed) Modified: stable/7/etc/defaults/rc.conf ============================================================================== --- stable/7/etc/defaults/rc.conf Thu Jan 15 04:57:21 2009 (r187286) +++ stable/7/etc/defaults/rc.conf Thu Jan 15 05:01:29 2009 (r187287) @@ -568,7 +568,7 @@ ldconfig_local_dirs="/usr/local/libdata/ ldconfig_local32_dirs="/usr/local/libdata/ldconfig32" # Local directories with 32-bit compatibility ldconfig # configuration files. -kern_securelevel_enable="NO" # kernel security level (see init(8)), +kern_securelevel_enable="NO" # kernel security level (see security(7)) kern_securelevel="-1" # range: -1..3 ; `-1' is the most insecure # Note that setting securelevel to 0 will result # in the system booting with securelevel set to 1, as From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 05:04:32 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CAA41065675; Thu, 15 Jan 2009 05:04:32 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A5AF8FC23; Thu, 15 Jan 2009 05:04:32 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F54Wv9065334; Thu, 15 Jan 2009 05:04:32 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F54WiN065333; Thu, 15 Jan 2009 05:04:32 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150504.n0F54WiN065333@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 05:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187288 - stable/7/share/man/man5 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 05:04:33 -0000 Author: keramida (doc committer) Date: Thu Jan 15 05:04:31 2009 New Revision: 187288 URL: http://svn.freebsd.org/changeset/base/187288 Log: The description of the various securelevels has moved to the security.7 manpage a while ago. Noticed by: simon Modified: stable/7/share/man/man5/ (props changed) stable/7/share/man/man5/rc.conf.5 Modified: stable/7/share/man/man5/rc.conf.5 ============================================================================== --- stable/7/share/man/man5/rc.conf.5 Thu Jan 15 05:01:29 2009 (r187287) +++ stable/7/share/man/man5/rc.conf.5 Thu Jan 15 05:04:31 2009 (r187288) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 16, 2008 +.Dd January 9, 2009 .Dt RC.CONF 5 .Os .Sh NAME @@ -3160,7 +3160,7 @@ The allowed range of ranges from \-1 (the compile time default) to 3 (the most secure). See -.Xr init 8 +.Xr security 7 for the list of possible security levels and their effect on system operation. .It Va sshd_program @@ -4021,6 +4021,7 @@ Default .Xr motd 5 , .Xr newsyslog.conf 5 , .Xr pf.conf 5 , +.Xr security 7 , .Xr accton 8 , .Xr amd 8 , .Xr apm 8 , From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 17:15:03 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD321106564A; Thu, 15 Jan 2009 17:15:03 +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 CB02A8FC1D; Thu, 15 Jan 2009 17:15:03 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FHF3uo082403; Thu, 15 Jan 2009 17:15:03 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FHF3go082402; Thu, 15 Jan 2009 17:15:03 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200901151715.n0FHF3go082402@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 15 Jan 2009 17:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187300 - stable/7/usr.sbin/fifolog/fifolog_create X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 17:15:04 -0000 Author: obrien Date: Thu Jan 15 17:15:03 2009 New Revision: 187300 URL: http://svn.freebsd.org/changeset/base/187300 Log: Don't claim to be FreeBSD 8.0 when installed on FreeBSD 7.1. Modified: stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Modified: stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 ============================================================================== --- stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Thu Jan 15 16:04:11 2009 (r187299) +++ stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Thu Jan 15 17:15:03 2009 (r187300) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd Feb 9, 2008 -.Os FreeBSD 8.0 +.Os .Dt FIFOLOG 1 .Sh NAME .Nm fifolog_create From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 20:13:22 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDCCF1065678; Thu, 15 Jan 2009 20:13:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA62E8FC18; Thu, 15 Jan 2009 20:13:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKDMeC086113; Thu, 15 Jan 2009 20:13:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKDMiC086112; Thu, 15 Jan 2009 20:13:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152013.n0FKDMiC086112@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187306 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bge dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:13:23 -0000 Author: marius Date: Thu Jan 15 20:13:22 2009 New Revision: 187306 URL: http://svn.freebsd.org/changeset/base/187306 Log: MFC: r183281 - Don't read the identifier string from the VPD if there's no chip containing an Ethernet address fitted as this is yet another thing that fails in that case in order to avoid the one second delay until pci_read_vpd_reg() times out. - Const'ify the bge_devs array. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jan 15 19:57:45 2009 (r187305) +++ stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:13:22 2009 (r187306) @@ -134,7 +134,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1); * ID burned into it, though it will always be overriden by the vendor * ID in the EEPROM. Just to be safe, we cover all possibilities. */ -static struct bge_type { +static const struct bge_type { uint16_t bge_vid; uint16_t bge_did; } bge_devs[] = { @@ -1861,7 +1861,7 @@ bge_lookup_vendor(uint16_t vid) static int bge_probe(device_t dev) { - struct bge_type *t = bge_devs; + const struct bge_type *t = bge_devs; struct bge_softc *sc = device_get_softc(dev); uint16_t vid, did; @@ -1883,7 +1883,8 @@ bge_probe(device_t dev) #if __FreeBSD_version > 700024 const char *pname; - if (pci_get_vpd_ident(dev, &pname) == 0) + if (bge_has_eaddr(sc) && + pci_get_vpd_ident(dev, &pname) == 0) snprintf(model, 64, "%s", pname); else #endif From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 20:19:53 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF883106564A; Thu, 15 Jan 2009 20:19:53 +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 C24D58FC12; Thu, 15 Jan 2009 20:19:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKJrLg086329; Thu, 15 Jan 2009 20:19:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKJrae086327; Thu, 15 Jan 2009 20:19:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152019.n0FKJrae086327@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187308 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bge dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:19:54 -0000 Author: marius Date: Thu Jan 15 20:19:53 2009 New Revision: 187308 URL: http://svn.freebsd.org/changeset/base/187308 Log: MFC: r183896 Use bus_{read,write}_4(9) instead of bus_space_{read,write}_4(9) in order to get rid of the bus space handle and tag in the softc. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:13:50 2009 (r187307) +++ stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:19:53 2009 (r187308) @@ -2387,11 +2387,7 @@ bge_attach(device_t dev) goto fail; } - sc->bge_btag = rman_get_bustag(sc->bge_res); - sc->bge_bhandle = rman_get_bushandle(sc->bge_res); - /* Save ASIC rev. */ - sc->bge_chipid = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) & BGE_PCIMISCCTL_ASICREV; Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Thu Jan 15 20:13:50 2009 (r187307) +++ stable/7/sys/dev/bge/if_bgereg.h Thu Jan 15 20:19:53 2009 (r187308) @@ -1896,8 +1896,7 @@ struct bge_rcb { }; #define RCB_WRITE_4(sc, rcb, offset, val) \ - bus_space_write_4(sc->bge_btag, sc->bge_bhandle, \ - rcb + offsetof(struct bge_rcb, offset), val) + bus_write_4(sc->bge_res, rcb + offsetof(struct bge_rcb, offset), val) #define BGE_RCB_MAXLEN_FLAGS(maxlen, flags) ((maxlen) << 16 | (flags)) #define BGE_RCB_FLAG_USE_EXT_RX_BD 0x0001 @@ -2394,10 +2393,10 @@ struct bge_gib { */ #define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->bge_btag, sc->bge_bhandle, reg, val) + bus_write_4(sc->bge_res, reg, val) #define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->bge_btag, sc->bge_bhandle, reg) + bus_read_4(sc->bge_res, reg) #define BGE_SETBIT(sc, reg, x) \ CSR_WRITE_4(sc, reg, (CSR_READ_4(sc, reg) | (x))) @@ -2522,8 +2521,6 @@ struct bge_softc { device_t bge_dev; struct mtx bge_mtx; device_t bge_miibus; - bus_space_handle_t bge_bhandle; - bus_space_tag_t bge_btag; void *bge_intrhand; struct resource *bge_irq; struct resource *bge_res; From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 20:23:38 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2FE71065677; Thu, 15 Jan 2009 20:23: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 C03778FC08; Thu, 15 Jan 2009 20:23:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKNc0X086453; Thu, 15 Jan 2009 20:23:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKNcG7086452; Thu, 15 Jan 2009 20:23:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152023.n0FKNcG7086452@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187309 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bge dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:23:39 -0000 Author: marius Date: Thu Jan 15 20:23:38 2009 New Revision: 187309 URL: http://svn.freebsd.org/changeset/base/187309 Log: MFC: r184380 Do as the Linux tg3 driver does and enable MSI support also for the BCM5714 revision A0 when in a multi-port configuration and unconditionally for the remainder of the class of BCM575X and beyond chips. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:19:53 2009 (r187308) +++ stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:23:38 2009 (r187309) @@ -2338,10 +2338,11 @@ bge_can_use_msi(struct bge_softc *sc) int can_use_msi = 0; switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5714_A0: case BGE_ASICREV_BCM5714: /* - * Apparently, MSI doesn't work when this chip is configured - * in single-port mode. + * Apparently, MSI doesn't work when these chips are + * configured in single-port mode. */ if (bge_has_multiple_ports(sc)) can_use_msi = 1; @@ -2351,10 +2352,9 @@ bge_can_use_msi(struct bge_softc *sc) sc->bge_chiprev != BGE_CHIPREV_5750_BX) can_use_msi = 1; break; - case BGE_ASICREV_BCM5752: - case BGE_ASICREV_BCM5780: - can_use_msi = 1; - break; + default: + if (BGE_IS_575X_PLUS(sc)) + can_use_msi = 1; } return (can_use_msi); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 20:30:38 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2DE21065686; Thu, 15 Jan 2009 20:30: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 9F4738FC18; Thu, 15 Jan 2009 20:30:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKUcBS086657; Thu, 15 Jan 2009 20:30:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKUcYZ086656; Thu, 15 Jan 2009 20:30:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152030.n0FKUcYZ086656@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187311 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sym X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:30:40 -0000 Author: marius Date: Thu Jan 15 20:30:38 2009 New Revision: 187311 URL: http://svn.freebsd.org/changeset/base/187311 Log: MFC: r183895 Use xpt_register_async() in order to remove code duplication. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sym/sym_hipd.c Modified: stable/7/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/7/sys/dev/sym/sym_hipd.c Thu Jan 15 20:23:44 2009 (r187310) +++ stable/7/sys/dev/sym/sym_hipd.c Thu Jan 15 20:30:38 2009 (r187311) @@ -8974,7 +8974,6 @@ static int sym_cam_attach(hcb_p np) struct cam_devq *devq = NULL; struct cam_sim *sim = NULL; struct cam_path *path = NULL; - struct ccb_setasync csa; int err; /* @@ -9021,12 +9020,9 @@ static int sym_cam_attach(hcb_p np) /* * Establish our async notification handler. */ - xpt_setup_ccb(&csa.ccb_h, np->path, 5); - csa.ccb_h.func_code = XPT_SASYNC_CB; - csa.event_enable = AC_LOST_DEVICE; - csa.callback = sym_async; - csa.callback_arg = np->sim; - xpt_action((union ccb *)&csa); + if (xpt_register_async(AC_LOST_DEVICE, sym_async, sim, path) != + CAM_REQ_CMP) + goto fail; /* * Start the chip now, without resetting the BUS, since From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 15 20:49:17 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B70D71065672; Thu, 15 Jan 2009 20:49:17 +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 A226F8FC14; Thu, 15 Jan 2009 20:49:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKnHjl087077; Thu, 15 Jan 2009 20:49:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKnHpA087072; Thu, 15 Jan 2009 20:49:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152049.n0FKnHpA087072@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187313 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/le X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:49:18 -0000 Author: marius Date: Thu Jan 15 20:49:17 2009 New Revision: 187313 URL: http://svn.freebsd.org/changeset/base/187313 Log: MFC: r183337 - Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9) etc and take advantage of rman_get_rid(9) in order to save some softc members. - Provide and consume module dependency information for lebuffer(4). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/le/if_le_cbus.c stable/7/sys/dev/le/if_le_isa.c stable/7/sys/dev/le/if_le_lebuffer.c stable/7/sys/dev/le/if_le_pci.c stable/7/sys/dev/le/lebuffer_sbus.c Modified: stable/7/sys/dev/le/if_le_cbus.c ============================================================================== --- stable/7/sys/dev/le/if_le_cbus.c Thu Jan 15 20:45:59 2009 (r187312) +++ stable/7/sys/dev/le/if_le_cbus.c Thu Jan 15 20:49:17 2009 (r187313) @@ -70,12 +70,8 @@ __FBSDID("$FreeBSD$"); struct le_cbus_softc { struct am7990_softc sc_am7990; /* glue to MI code */ - int sc_rrid; struct resource *sc_rres; - bus_space_tag_t sc_regt; - bus_space_handle_t sc_regh; - int sc_irid; struct resource *sc_ires; void *sc_ih; @@ -128,10 +124,9 @@ le_cbus_wrbcr(struct lance_softc *sc, ui { struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_BDP, val); + bus_write_2(lesc->sc_rres, CNET98S_RAP, port); + bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, CNET98S_BDP, val); } #ifdef LEDEBUG @@ -140,10 +135,9 @@ le_cbus_rdbcr(struct lance_softc *sc, ui { struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_BDP)); + bus_write_2(lesc->sc_rres, CNET98S_RAP, port); + bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, CNET98S_BDP)); } #endif @@ -152,10 +146,9 @@ le_cbus_wrcsr(struct lance_softc *sc, ui { struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RDP, val); + bus_write_2(lesc->sc_rres, CNET98S_RAP, port); + bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, CNET98S_RDP, val); } static uint16_t @@ -163,10 +156,9 @@ le_cbus_rdcsr(struct lance_softc *sc, ui { struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RDP)); + bus_write_2(lesc->sc_rres, CNET98S_RAP, port); + bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, CNET98S_RDP)); } static void @@ -179,16 +171,16 @@ le_cbus_hwreset(struct lance_softc *sc) */ /* Reset the chip. */ - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET, - bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET)); + bus_write_2(lesc->sc_rres, CNET98S_RESET, + bus_read_2(lesc->sc_rres, CNET98S_RESET)); DELAY(500); /* ISA bus configuration */ /* ISACSR0 - set Master Mode Read Active time to 300ns. */ - le_cbus_wrbcr(sc, LE_BCR0, 0x0006); + le_cbus_wrbcr(sc, LE_BCR0, 0x0006); /* ISACSR1 - set Master Mode Write Active time to 300ns. */ - le_cbus_wrbcr(sc, LE_BCR1, 0x0006); -#ifdef LEDEBUG + le_cbus_wrbcr(sc, LE_BCR1, 0x0006); +#ifdef LEDEBUG device_printf(dev, "ISACSR2=0x%x\n", le_cbus_rdbcr(sc, LE_BCR2)); #endif /* ISACSR5 - LED1 */ @@ -215,7 +207,7 @@ le_cbus_probe(device_t dev) { struct le_cbus_softc *lesc; struct lance_softc *sc; - int error; + int error, i; /* * Skip PnP devices as some wedge when trying to probe them as @@ -227,18 +219,16 @@ le_cbus_probe(device_t dev) lesc = device_get_softc(dev); sc = &lesc->sc_am7990.lsc; - lesc->sc_rrid = 0; - lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &lesc->sc_rrid, + i = 0; + lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &i, le_ioaddr_cnet98s, CNET98S_IOSIZE, RF_ACTIVE); if (lesc->sc_rres == NULL) return (ENXIO); isa_load_resourcev(lesc->sc_rres, le_ioaddr_cnet98s, CNET98S_IOSIZE); - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); /* Reset the chip. */ - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET, - bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET)); + bus_write_2(lesc->sc_rres, CNET98S_RESET, + bus_read_2(lesc->sc_rres, CNET98S_RESET)); DELAY(500); /* Stop the chip and put it in a known state. */ @@ -253,7 +243,8 @@ le_cbus_probe(device_t dev) error = BUS_PROBE_DEFAULT; fail: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); return (error); } @@ -269,8 +260,8 @@ le_cbus_attach(device_t dev) LE_LOCK_INIT(sc, device_get_nameunit(dev)); - lesc->sc_rrid = 0; - lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &lesc->sc_rrid, + i = 0; + lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &i, le_ioaddr_cnet98s, CNET98S_IOSIZE, RF_ACTIVE); if (lesc->sc_rres == NULL) { device_printf(dev, "cannot allocate registers\n"); @@ -278,12 +269,10 @@ le_cbus_attach(device_t dev) goto fail_mtx; } isa_load_resourcev(lesc->sc_rres, le_ioaddr_cnet98s, CNET98S_IOSIZE); - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); - lesc->sc_irid = 0; + i = 0; if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate interrupt\n"); error = ENXIO; goto fail_rres; @@ -339,7 +328,7 @@ le_cbus_attach(device_t dev) error = bus_dmamap_load(lesc->sc_dmat, lesc->sc_dmam, sc->sc_mem, sc->sc_memsize, le_cbus_dma_callback, sc, 0); if (error != 0 || sc->sc_addr == 0) { - device_printf(dev, "cannot load DMA buffer map\n"); + device_printf(dev, "cannot load DMA buffer map\n"); goto fail_dmem; } @@ -350,8 +339,7 @@ le_cbus_attach(device_t dev) * Extract the physical MAC address from the ROM. */ for (i = 0; i < sizeof(sc->sc_enaddr); i++) - sc->sc_enaddr[i] = bus_space_read_1(lesc->sc_regt, - lesc->sc_regh, i * 2); + sc->sc_enaddr[i] = bus_read_1(lesc->sc_rres, i * 2); sc->sc_copytodesc = lance_copytobuf_contig; sc->sc_copyfromdesc = lance_copyfrombuf_contig; @@ -396,9 +384,11 @@ le_cbus_attach(device_t dev) fail_pdtag: bus_dma_tag_destroy(lesc->sc_pdmat); fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); fail_rres: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); fail_mtx: LE_LOCK_DESTROY(sc); return (error); @@ -419,8 +409,10 @@ le_cbus_detach(device_t dev) bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam); bus_dma_tag_destroy(lesc->sc_dmat); bus_dma_tag_destroy(lesc->sc_pdmat); - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); LE_LOCK_DESTROY(sc); return (0); Modified: stable/7/sys/dev/le/if_le_isa.c ============================================================================== --- stable/7/sys/dev/le/if_le_isa.c Thu Jan 15 20:45:59 2009 (r187312) +++ stable/7/sys/dev/le/if_le_isa.c Thu Jan 15 20:49:17 2009 (r187313) @@ -109,15 +109,10 @@ struct le_isa_softc { bus_size_t sc_rap; /* offsets to LANCE... */ bus_size_t sc_rdp; /* ...registers */ - int sc_rrid; struct resource *sc_rres; - bus_space_tag_t sc_regt; - bus_space_handle_t sc_regh; - int sc_drid; struct resource *sc_dres; - int sc_irid; struct resource *sc_ires; void *sc_ih; @@ -184,10 +179,9 @@ le_isa_wrcsr(struct lance_softc *sc, uin { struct le_isa_softc *lesc = (struct le_isa_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rdp, val); + bus_write_2(lesc->sc_rres, lesc->sc_rap, port); + bus_barrier(lesc->sc_rres, lesc->sc_rap, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, lesc->sc_rdp, val); } static uint16_t @@ -195,10 +189,9 @@ le_isa_rdcsr(struct lance_softc *sc, uin { struct le_isa_softc *lesc = (struct le_isa_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rdp)); + bus_write_2(lesc->sc_rres, lesc->sc_rap, port); + bus_barrier(lesc->sc_rres, lesc->sc_rap, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, lesc->sc_rdp)); } static void @@ -217,18 +210,16 @@ le_isa_probe_legacy(device_t dev, const { struct le_isa_softc *lesc; struct lance_softc *sc; - int error; + int error, i; lesc = device_get_softc(dev); sc = &lesc->sc_am7990.lsc; - lesc->sc_rrid = 0; - lesc->sc_rres = bus_alloc_resource(dev, SYS_RES_IOPORT, &lesc->sc_rrid, - 0, ~0, leip->iosize, RF_ACTIVE); + i = 0; + lesc->sc_rres = bus_alloc_resource(dev, SYS_RES_IOPORT, &i, 0, ~0, + leip->iosize, RF_ACTIVE); if (lesc->sc_rres == NULL) return (ENXIO); - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); lesc->sc_rap = leip->rap; lesc->sc_rdp = leip->rdp; @@ -243,7 +234,8 @@ le_isa_probe_legacy(device_t dev, const error = 0; fail: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); return (error); } @@ -276,18 +268,18 @@ le_isa_attach(device_t dev) struct le_isa_softc *lesc; struct lance_softc *sc; bus_size_t macstart, rap, rdp; - int error, i, macstride; + int error, i, j, macstride; lesc = device_get_softc(dev); sc = &lesc->sc_am7990.lsc; LE_LOCK_INIT(sc, device_get_nameunit(dev)); - lesc->sc_rrid = 0; + j = 0; switch (ISA_PNP_PROBE(device_get_parent(dev), dev, le_isa_ids)) { case 0: lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_IOPORT, - &lesc->sc_rrid, RF_ACTIVE); + &j, RF_ACTIVE); rap = PCNET_RAP; rdp = PCNET_RDP; macstart = 0; @@ -298,7 +290,7 @@ le_isa_attach(device_t dev) sizeof(le_isa_params[0]); i++) { if (le_isa_probe_legacy(dev, &le_isa_params[i]) == 0) { lesc->sc_rres = bus_alloc_resource(dev, - SYS_RES_IOPORT, &lesc->sc_rrid, 0, ~0, + SYS_RES_IOPORT, &j, 0, ~0, le_isa_params[i].iosize, RF_ACTIVE); rap = le_isa_params[i].rap; rdp = le_isa_params[i].rdp; @@ -321,22 +313,20 @@ le_isa_attach(device_t dev) error = ENXIO; goto fail_mtx; } - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); lesc->sc_rap = rap; lesc->sc_rdp = rdp; - lesc->sc_drid = 0; + i = 0; if ((lesc->sc_dres = bus_alloc_resource_any(dev, SYS_RES_DRQ, - &lesc->sc_drid, RF_ACTIVE)) == NULL) { + &i, RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate DMA channel\n"); error = ENXIO; goto fail_rres; } - lesc->sc_irid = 0; + i = 0; if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate interrupt\n"); error = ENXIO; goto fail_dres; @@ -392,7 +382,7 @@ le_isa_attach(device_t dev) error = bus_dmamap_load(lesc->sc_dmat, lesc->sc_dmam, sc->sc_mem, sc->sc_memsize, le_isa_dma_callback, sc, 0); if (error != 0 || sc->sc_addr == 0) { - device_printf(dev, "cannot load DMA buffer map\n"); + device_printf(dev, "cannot load DMA buffer map\n"); goto fail_dmem; } @@ -405,8 +395,8 @@ le_isa_attach(device_t dev) * Extract the physical MAC address from the ROM. */ for (i = 0; i < sizeof(sc->sc_enaddr); i++) - sc->sc_enaddr[i] = bus_space_read_1(lesc->sc_regt, - lesc->sc_regh, macstart + i * macstride); + sc->sc_enaddr[i] = bus_read_1(lesc->sc_rres, + macstart + i * macstride); sc->sc_copytodesc = lance_copytobuf_contig; sc->sc_copyfromdesc = lance_copyfrombuf_contig; @@ -451,11 +441,14 @@ le_isa_attach(device_t dev) fail_pdtag: bus_dma_tag_destroy(lesc->sc_pdmat); fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); fail_dres: - bus_release_resource(dev, SYS_RES_DRQ, lesc->sc_drid, lesc->sc_dres); + bus_release_resource(dev, SYS_RES_DRQ, + rman_get_rid(lesc->sc_dres), lesc->sc_dres); fail_rres: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); fail_mtx: LE_LOCK_DESTROY(sc); return (error); @@ -476,9 +469,12 @@ le_isa_detach(device_t dev) bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam); bus_dma_tag_destroy(lesc->sc_dmat); bus_dma_tag_destroy(lesc->sc_pdmat); - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); - bus_release_resource(dev, SYS_RES_DRQ, lesc->sc_drid, lesc->sc_dres); - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); + bus_release_resource(dev, SYS_RES_DRQ, + rman_get_rid(lesc->sc_dres), lesc->sc_dres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); LE_LOCK_DESTROY(sc); return (0); Modified: stable/7/sys/dev/le/if_le_lebuffer.c ============================================================================== --- stable/7/sys/dev/le/if_le_lebuffer.c Thu Jan 15 20:45:59 2009 (r187312) +++ stable/7/sys/dev/le/if_le_lebuffer.c Thu Jan 15 20:49:17 2009 (r187313) @@ -63,17 +63,10 @@ __FBSDID("$FreeBSD$"); struct le_lebuffer_softc { struct am7990_softc sc_am7990; /* glue to MI code */ - int sc_brid; struct resource *sc_bres; - bus_space_tag_t sc_buft; - bus_space_handle_t sc_bufh; - int sc_rrid; struct resource *sc_rres; - bus_space_tag_t sc_regt; - bus_space_handle_t sc_regh; - int sc_irid; struct resource *sc_ires; void *sc_ih; }; @@ -103,6 +96,7 @@ DEFINE_CLASS_0(le, le_lebuffer_driver, l sizeof(struct le_lebuffer_softc)); DRIVER_MODULE(le, lebuffer, le_lebuffer_driver, le_lebuffer_devclass, 0, 0); MODULE_DEPEND(le, ether, 1, 1, 1); +MODULE_DEPEND(le, lebuffer, 1, 1, 1); /* * Media types supported @@ -126,10 +120,9 @@ le_lebuffer_wrcsr(struct lance_softc *sc { struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RDP, val); + bus_write_2(lesc->sc_rres, LEREG1_RAP, port); + bus_barrier(lesc->sc_rres, LEREG1_RAP, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, LEREG1_RDP, val); } static uint16_t @@ -137,10 +130,9 @@ le_lebuffer_rdcsr(struct lance_softc *sc { struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RDP)); + bus_write_2(lesc->sc_rres, LEREG1_RAP, port); + bus_barrier(lesc->sc_rres, LEREG1_RAP, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, LEREG1_RDP)); } /* @@ -163,17 +155,13 @@ le_lebuffer_copytodesc(struct lance_soft caddr_t from = fromv; for (; len >= 8; len -= 8, off += 8, from += 8) - bus_space_write_8(lesc->sc_buft, lesc->sc_bufh, off, - be64dec(from)); + bus_write_8(lesc->sc_bres, off, be64dec(from)); for (; len >= 4; len -= 4, off += 4, from += 4) - bus_space_write_4(lesc->sc_buft, lesc->sc_bufh, off, - be32dec(from)); + bus_write_4(lesc->sc_bres, off, be32dec(from)); for (; len >= 2; len -= 2, off += 2, from += 2) - bus_space_write_2(lesc->sc_buft, lesc->sc_bufh, off, - be16dec(from)); + bus_write_2(lesc->sc_bres, off, be16dec(from)); if (len == 1) - bus_space_write_1(lesc->sc_buft, lesc->sc_bufh, off, - *from); + bus_write_1(lesc->sc_bres, off, *from); } static void @@ -184,16 +172,15 @@ le_lebuffer_copyfromdesc(struct lance_so for (; len >= 8; len -= 8, off += 8, to += 8) be64enc(to, - bus_space_read_8(lesc->sc_buft, lesc->sc_bufh, off)); + bus_read_8(lesc->sc_bres, off)); for (; len >= 4; len -= 4, off += 4, to += 4) be32enc(to, - bus_space_read_4(lesc->sc_buft, lesc->sc_bufh, off)); + bus_read_4(lesc->sc_bres, off)); for (; len >= 2; len -= 2, off += 2, to += 2) be16enc(to, - bus_space_read_2(lesc->sc_buft, lesc->sc_bufh, off)); + bus_read_2(lesc->sc_bres, off)); if (len == 1) - *to = - bus_space_read_1(lesc->sc_buft, lesc->sc_bufh, off); + *to = bus_read_1(lesc->sc_bres, off); } static void @@ -203,11 +190,9 @@ le_lebuffer_copytobuf(struct lance_softc caddr_t from = fromv; for (; len >= 2; len -= 2, off += 2, from += 2) - bus_space_write_2(lesc->sc_buft, lesc->sc_bufh, off, - le16dec(from)); + bus_write_2(lesc->sc_bres, off, le16dec(from)); if (len == 1) - bus_space_write_1(lesc->sc_buft, lesc->sc_bufh, off + 1, - *from); + bus_write_1(lesc->sc_bres, off + 1, *from); } static void @@ -218,10 +203,9 @@ le_lebuffer_copyfrombuf(struct lance_sof for (; len >= 2; len -= 2, off += 2, to += 2) le16enc(to, - bus_space_read_2(lesc->sc_buft, lesc->sc_bufh, off)); + bus_read_2(lesc->sc_bres, off)); if (len == 1) - *to = - bus_space_read_1(lesc->sc_buft, lesc->sc_bufh, off + 1); + *to = bus_read_1(lesc->sc_bres, off + 1); } static void @@ -230,9 +214,9 @@ le_lebuffer_zerobuf(struct lance_softc * struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; for (; len >= 2; len -= 2, off += 2) - bus_space_write_2(lesc->sc_buft, lesc->sc_bufh, off, 0); + bus_write_2(lesc->sc_bres, off, 0); if (len == 1) - bus_space_write_1(lesc->sc_buft, lesc->sc_bufh, off + 1, 0); + bus_write_1(lesc->sc_bres, off + 1, 0); } static int @@ -251,7 +235,7 @@ le_lebuffer_attach(device_t dev) { struct le_lebuffer_softc *lesc; struct lance_softc *sc; - int error; + int error, i; lesc = device_get_softc(dev); sc = &lesc->sc_am7990.lsc; @@ -262,33 +246,29 @@ le_lebuffer_attach(device_t dev) * The "register space" of the parent is just a buffer where the * the LANCE descriptor rings and the RX/TX buffers can be stored. */ - lesc->sc_brid = 0; + i = 0; lesc->sc_bres = bus_alloc_resource_any(device_get_parent(dev), - SYS_RES_MEMORY, &lesc->sc_brid, RF_ACTIVE); + SYS_RES_MEMORY, &i, RF_ACTIVE); if (lesc->sc_bres == NULL) { device_printf(dev, "cannot allocate LANCE buffer\n"); error = ENXIO; goto fail_mtx; } - lesc->sc_buft = rman_get_bustag(lesc->sc_bres); - lesc->sc_bufh = rman_get_bushandle(lesc->sc_bres); /* Allocate LANCE registers. */ - lesc->sc_rrid = 0; + i = 0; lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &lesc->sc_rrid, RF_ACTIVE); + &i, RF_ACTIVE); if (lesc->sc_rres == NULL) { device_printf(dev, "cannot allocate LANCE registers\n"); error = ENXIO; goto fail_bres; } - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); /* Allocate LANCE interrupt. */ - lesc->sc_irid = 0; + i = 0; if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate interrupt\n"); error = ENXIO; goto fail_rres; @@ -352,12 +332,14 @@ le_lebuffer_attach(device_t dev) fail_am7990: am7990_detach(&lesc->sc_am7990); fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); fail_rres: - bus_release_resource(dev, SYS_RES_MEMORY, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); fail_bres: bus_release_resource(device_get_parent(dev), SYS_RES_MEMORY, - lesc->sc_brid, lesc->sc_bres); + rman_get_rid(lesc->sc_bres), lesc->sc_bres); fail_mtx: LE_LOCK_DESTROY(sc); return (error); @@ -374,10 +356,12 @@ le_lebuffer_detach(device_t dev) bus_teardown_intr(dev, lesc->sc_ires, lesc->sc_ih); am7990_detach(&lesc->sc_am7990); - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); - bus_release_resource(dev, SYS_RES_MEMORY, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); bus_release_resource(device_get_parent(dev), SYS_RES_MEMORY, - lesc->sc_brid, lesc->sc_bres); + rman_get_rid(lesc->sc_bres), lesc->sc_bres); LE_LOCK_DESTROY(sc); return (0); Modified: stable/7/sys/dev/le/if_le_pci.c ============================================================================== --- stable/7/sys/dev/le/if_le_pci.c Thu Jan 15 20:45:59 2009 (r187312) +++ stable/7/sys/dev/le/if_le_pci.c Thu Jan 15 20:49:17 2009 (r187313) @@ -111,12 +111,8 @@ __FBSDID("$FreeBSD$"); struct le_pci_softc { struct am79900_softc sc_am79900; /* glue to MI code */ - int sc_rrid; struct resource *sc_rres; - bus_space_tag_t sc_regt; - bus_space_handle_t sc_regh; - int sc_irid; struct resource *sc_ires; void *sc_ih; @@ -174,10 +170,9 @@ le_pci_wrbcr(struct lance_softc *sc, uin { struct le_pci_softc *lesc = (struct le_pci_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_BDP, val); + bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port); + bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, PCNET_PCI_BDP, val); } static uint16_t @@ -185,10 +180,9 @@ le_pci_rdbcr(struct lance_softc *sc, uin { struct le_pci_softc *lesc = (struct le_pci_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_BDP)); + bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port); + bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, PCNET_PCI_BDP)); } static void @@ -196,10 +190,9 @@ le_pci_wrcsr(struct lance_softc *sc, uin { struct le_pci_softc *lesc = (struct le_pci_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RDP, val); + bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port); + bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, PCNET_PCI_RDP, val); } static uint16_t @@ -207,10 +200,9 @@ le_pci_rdcsr(struct lance_softc *sc, uin { struct le_pci_softc *lesc = (struct le_pci_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RDP)); + bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port); + bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, PCNET_PCI_RDP)); } static int @@ -322,20 +314,18 @@ le_pci_attach(device_t dev) pci_enable_busmaster(dev); pci_enable_io(dev, PCIM_CMD_PORTEN); - lesc->sc_rrid = PCIR_BAR(0); + i = PCIR_BAR(0); lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_IOPORT, - &lesc->sc_rrid, RF_ACTIVE); + &i, RF_ACTIVE); if (lesc->sc_rres == NULL) { device_printf(dev, "cannot allocate registers\n"); error = ENXIO; goto fail_mtx; } - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); - lesc->sc_irid = 0; + i = 0; if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate interrupt\n"); error = ENXIO; goto fail_rres; @@ -392,7 +382,7 @@ le_pci_attach(device_t dev) error = bus_dmamap_load(lesc->sc_dmat, lesc->sc_dmam, sc->sc_mem, sc->sc_memsize, le_pci_dma_callback, sc, 0); if (error != 0 || sc->sc_addr == 0) { - device_printf(dev, "cannot load DMA buffer map\n"); + device_printf(dev, "cannot load DMA buffer map\n"); goto fail_dmem; } @@ -417,9 +407,8 @@ le_pci_attach(device_t dev) /* * Extract the physical MAC address from the ROM. */ - for (i = 0; i < sizeof(sc->sc_enaddr); i++) - sc->sc_enaddr[i] = - bus_space_read_1(lesc->sc_regt, lesc->sc_regh, i); + bus_read_region_1(lesc->sc_rres, 0, sc->sc_enaddr, + sizeof(sc->sc_enaddr)); sc->sc_copytodesc = lance_copytobuf_contig; sc->sc_copyfromdesc = lance_copyfrombuf_contig; @@ -461,9 +450,11 @@ le_pci_attach(device_t dev) fail_pdtag: bus_dma_tag_destroy(lesc->sc_pdmat); fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); fail_rres: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); fail_mtx: LE_LOCK_DESTROY(sc); return (error); @@ -484,8 +475,10 @@ le_pci_detach(device_t dev) bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam); bus_dma_tag_destroy(lesc->sc_dmat); bus_dma_tag_destroy(lesc->sc_pdmat); - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); LE_LOCK_DESTROY(sc); return (0); Modified: stable/7/sys/dev/le/lebuffer_sbus.c ============================================================================== --- stable/7/sys/dev/le/lebuffer_sbus.c Thu Jan 15 20:45:59 2009 (r187312) +++ stable/7/sys/dev/le/lebuffer_sbus.c Thu Jan 15 20:49:17 2009 (r187313) @@ -100,6 +100,8 @@ static device_method_t lebuffer_methods[ DEFINE_CLASS_0(lebuffer, lebuffer_driver, lebuffer_methods, 1); DRIVER_MODULE(lebuffer, sbus, lebuffer_driver, lebuffer_devclass, 0, 0); +MODULE_DEPEND(lebuffer, sbus, 1, 1, 1); +MODULE_VERSION(lebuffer, 1); static int lebuffer_probe(device_t dev) From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 16 11:14:29 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A80A91065670; Fri, 16 Jan 2009 11:14:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95D358FC29; Fri, 16 Jan 2009 11:14:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GBETqC006817; Fri, 16 Jan 2009 11:14:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GBETin006816; Fri, 16 Jan 2009 11:14:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901161114.n0GBETin006816@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 16 Jan 2009 11:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187329 - in stable/7/lib/libc: . string X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 11:14:30 -0000 Author: kib Date: Fri Jan 16 11:14:29 2009 New Revision: 187329 URL: http://svn.freebsd.org/changeset/base/187329 Log: MFC r187147: Document that ffsll(3) and flsll(3) functions first appeared in FreeBSD 7.1. Modified: stable/7/lib/libc/ (props changed) stable/7/lib/libc/string/ffs.3 stable/7/lib/libc/string/ffsll.c (props changed) stable/7/lib/libc/string/flsll.c (props changed) Modified: stable/7/lib/libc/string/ffs.3 ============================================================================== --- stable/7/lib/libc/string/ffs.3 Fri Jan 16 09:01:45 2009 (r187328) +++ stable/7/lib/libc/string/ffs.3 Fri Jan 16 11:14:29 2009 (r187329) @@ -108,4 +108,4 @@ The and .Fn flsll functions appeared in -.Fx 8.0 . +.Fx 7.1 . From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 16 18:00:25 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8935106564A; Fri, 16 Jan 2009 18:00:25 +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 D50498FC1B; Fri, 16 Jan 2009 18:00:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GI0PvH014547; Fri, 16 Jan 2009 18:00:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GI0Pvm014546; Fri, 16 Jan 2009 18:00:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901161800.n0GI0Pvm014546@svn.freebsd.org> From: Alexander Motin Date: Fri, 16 Jan 2009 18:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187333 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sound/pci/hda X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 18:00:26 -0000 Author: mav Date: Fri Jan 16 18:00:25 2009 New Revision: 187333 URL: http://svn.freebsd.org/changeset/base/187333 Log: MFC rev. 187154, 187196, 187202 Change configuration order to enable output only after codec is configured. Mute all mixer controllable amplifiers initially to let mixer to unmute only some of them later. This should reduce clicks and noises during boot. Improve AD1983 codec support: - force playback via mixer to get PCM volume control, - make cleanup on recoring source selection. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sound/pci/hda/hdac.c Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Fri Jan 16 15:47:35 2009 (r187332) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Fri Jan 16 18:00:25 2009 (r187333) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090110_0123" +#define HDA_DRV_TEST_REV "20090113_0125" SND_DECLARE_FILE("$FreeBSD$"); @@ -4649,6 +4649,33 @@ hdac_vendor_patch_parse(struct hdac_devi * nid: 26 = Line-in, leave it alone. */ break; + case HDA_CODEC_AD1983: + /* + * This codec has several possible usages, but none + * fit the parser best. Help parser to choose better. + */ + /* Disable direct unmixed playback to get pcm volume. */ + w = hdac_widget_get(devinfo, 5); + if (w != NULL) + w->connsenable[0] = 0; + w = hdac_widget_get(devinfo, 6); + if (w != NULL) + w->connsenable[0] = 0; + w = hdac_widget_get(devinfo, 11); + if (w != NULL) + w->connsenable[0] = 0; + /* Disable mic and line selectors. */ + w = hdac_widget_get(devinfo, 12); + if (w != NULL) + w->connsenable[1] = 0; + w = hdac_widget_get(devinfo, 13); + if (w != NULL) + w->connsenable[1] = 0; + /* Disable recording from mono playback mix. */ + w = hdac_widget_get(devinfo, 20); + if (w != NULL) + w->connsenable[3] = 0; + break; case HDA_CODEC_AD1986A: /* * This codec has overcomplicated input mixing. @@ -6111,6 +6138,29 @@ hdac_audio_prepare_pin_ctrl(struct hdac_ } static void +hdac_audio_ctl_commit(struct hdac_devinfo *devinfo) +{ + struct hdac_audio_ctl *ctl; + int i, z; + + i = 0; + while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) { + if (ctl->enable == 0 || ctl->ossmask != 0) { + /* Mute disabled and mixer controllable controls. + * Last will be initialized by mixer_init(). + * This expected to reduce click on startup. */ + hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0); + continue; + } + /* Init fixed controls to 0dB amplification. */ + z = ctl->offset; + if (z > ctl->step) + z = ctl->step; + hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z); + } +} + +static void hdac_audio_commit(struct hdac_devinfo *devinfo) { struct hdac_softc *sc = devinfo->codec->sc; @@ -6126,11 +6176,41 @@ hdac_audio_commit(struct hdac_devinfo *d hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid, 0x7e7, 0), cad); + /* Commit controls. */ + hdac_audio_ctl_commit(devinfo); + + /* Commit selectors, pins and EAPD. */ + for (i = 0; i < devinfo->nodecnt; i++) { + w = &devinfo->widget[i]; + if (w == NULL) + continue; + if (w->selconn == -1) + w->selconn = 0; + if (w->nconns > 0) + hdac_widget_connection_select(w, w->selconn); + if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { + hdac_command(sc, + HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid, + w->wclass.pin.ctrl), cad); + } + if (w->param.eapdbtl != HDAC_INVALID) { + uint32_t val; + + val = w->param.eapdbtl; + if (devinfo->function.audio.quirks & + HDA_QUIRK_EAPDINV) + val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD; + hdac_command(sc, + HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid, + val), cad); + } + } + + /* Commit GPIOs. */ gdata = 0; gmask = 0; gdir = 0; commitgpio = 0; - numgpio = HDA_PARAM_GPIO_COUNT_NUM_GPIO( devinfo->function.audio.gpio); @@ -6185,54 +6265,6 @@ hdac_audio_commit(struct hdac_devinfo *d HDA_CMD_SET_GPIO_DATA(cad, devinfo->nid, gdata), cad); } - - for (i = 0; i < devinfo->nodecnt; i++) { - w = &devinfo->widget[i]; - if (w == NULL) - continue; - if (w->selconn == -1) - w->selconn = 0; - if (w->nconns > 0) - hdac_widget_connection_select(w, w->selconn); - if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { - hdac_command(sc, - HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid, - w->wclass.pin.ctrl), cad); - } - if (w->param.eapdbtl != HDAC_INVALID) { - uint32_t val; - - val = w->param.eapdbtl; - if (devinfo->function.audio.quirks & - HDA_QUIRK_EAPDINV) - val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD; - hdac_command(sc, - HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid, - val), cad); - - } - } -} - -static void -hdac_audio_ctl_commit(struct hdac_devinfo *devinfo) -{ - struct hdac_audio_ctl *ctl; - int i, z; - - i = 0; - while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) { - if (ctl->enable == 0) { - /* Mute disabled controls. */ - hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0); - continue; - } - /* Init controls to 0dB amplification. */ - z = ctl->offset; - if (z > ctl->step) - z = ctl->step; - hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z); - } } static void @@ -7477,10 +7509,6 @@ hdac_attach2(void *arg) ); hdac_audio_commit(devinfo); HDA_BOOTHVERBOSE( - device_printf(sc->dev, "Ctls commit...\n"); - ); - hdac_audio_ctl_commit(devinfo); - HDA_BOOTHVERBOSE( device_printf(sc->dev, "HP switch init...\n"); ); hdac_hp_switch_init(devinfo); @@ -7730,10 +7758,6 @@ hdac_resume(device_t dev) ); hdac_audio_commit(devinfo); HDA_BOOTHVERBOSE( - device_printf(dev, "Ctls commit...\n"); - ); - hdac_audio_ctl_commit(devinfo); - HDA_BOOTHVERBOSE( device_printf(dev, "HP switch init...\n"); ); hdac_hp_switch_init(devinfo); From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 17 06:53:58 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 599E7106564A; Sat, 17 Jan 2009 06:53:58 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BD1D8FC1C; Sat, 17 Jan 2009 06:53:58 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0H6rw7I029971; Sat, 17 Jan 2009 06:53:58 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0H6rw6k029970; Sat, 17 Jan 2009 06:53:58 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <200901170653.n0H6rw6k029970@svn.freebsd.org> From: Mike Silbersack Date: Sat, 17 Jan 2009 06:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187355 - in stable/7/sys: . contrib/pf dev/acpica dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 06:53:59 -0000 Author: silby Date: Sat Jan 17 06:53:57 2009 New Revision: 187355 URL: http://svn.freebsd.org/changeset/base/187355 Log: Merge r186026 - add the debug.batt.batt_sleep_ms sysctl. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/acpica/acpi_smbat.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/acpica/acpi_smbat.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 05:38:14 2009 (r187354) +++ stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 06:53:57 2009 (r187355) @@ -61,6 +61,23 @@ static int acpi_smbat_get_bst(device_t d ACPI_SERIAL_DECL(smbat, "ACPI Smart Battery"); +SYSCTL_DECL(_debug_acpi); +SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, "Battery debugging"); + +/* On some laptops with smart batteries, enabling battery monitoring + * software causes keystrokes from atkbd to be lost. This has also been + * reported on Linux, and is apparently due to the keyboard and I2C line + * for the battery being routed through the same chip. Whether that's + * accurate or not, adding extra sleeps to the status checking code + * causes the problem to go away. + * + * If you experience that problem, try a value of 10ms and move up + * from there. + */ +static int batt_sleep_ms; +SYSCTL_INT(_debug_acpi_batt, OID_AUTO, batt_sleep_ms, CTLFLAG_RW, &batt_sleep_ms, 0, + "Sleep during battery status updates to prevent keystroke loss."); + static device_method_t acpi_smbat_methods[] = { /* device interface */ DEVMETHOD(device_probe, acpi_smbat_probe), @@ -176,6 +193,9 @@ acpi_smbus_read_2(struct acpi_smbat_soft ACPI_SERIAL_ASSERT(smbat); + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + val = addr; error = ACPI_EC_WRITE(sc->ec_dev, sc->sb_base_addr + SMBUS_ADDR, val, 1); @@ -194,6 +214,9 @@ acpi_smbus_read_2(struct acpi_smbat_soft if (error) goto out; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + for (to = SMBUS_TIMEOUT; to != 0; to--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_PRTCL, &val, 1); @@ -239,6 +262,9 @@ acpi_smbus_read_multi_1(struct acpi_smba ACPI_SERIAL_ASSERT(smbat); + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + val = addr; error = ACPI_EC_WRITE(sc->ec_dev, sc->sb_base_addr + SMBUS_ADDR, val, 1); @@ -257,6 +283,9 @@ acpi_smbus_read_multi_1(struct acpi_smba if (error) goto out; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + for (to = SMBUS_TIMEOUT; to != 0; to--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_PRTCL, &val, 1); @@ -292,6 +321,9 @@ acpi_smbus_read_multi_1(struct acpi_smba if (len > val) len = val; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + while (len--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_DATA + len, &val, 1); @@ -299,6 +331,8 @@ acpi_smbus_read_multi_1(struct acpi_smba goto out; ptr[len] = val; + if (batt_sleep_ms) + AcpiOsSleep(1); } out: From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 17 06:55:28 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6954C106566B; Sat, 17 Jan 2009 06:55:28 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5664E8FC16; Sat, 17 Jan 2009 06:55:28 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0H6tSHi030079; Sat, 17 Jan 2009 06:55:28 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0H6tSAt030078; Sat, 17 Jan 2009 06:55:28 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <200901170655.n0H6tSAt030078@svn.freebsd.org> From: Mike Silbersack Date: Sat, 17 Jan 2009 06:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187356 - in stable/7/sys: . contrib/pf dev/acpica dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 06:55:29 -0000 Author: silby Date: Sat Jan 17 06:55:28 2009 New Revision: 187356 URL: http://svn.freebsd.org/changeset/base/187356 Log: Merge r186031 - quick change to r186026 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/acpica/acpi_smbat.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/acpica/acpi_smbat.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 06:53:57 2009 (r187355) +++ stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 06:55:28 2009 (r187356) @@ -332,7 +332,7 @@ acpi_smbus_read_multi_1(struct acpi_smba ptr[len] = val; if (batt_sleep_ms) - AcpiOsSleep(1); + AcpiOsSleep(batt_sleep_ms); } out: From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 17 10:08:57 2009 Return-Path: Delivered-To: svn-src-stable-7@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 333161065672; Sat, 17 Jan 2009 10:08:57 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id CA2318FC17; Sat, 17 Jan 2009 10:08:56 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 9F05C28449; Sat, 17 Jan 2009 18:08:55 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 702B7EC42A3; Sat, 17 Jan 2009 18:08:54 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id 5lgfoS3mPeoq; Sat, 17 Jan 2009 18:08:46 +0800 (CST) Received: from charlie.delphij.net (c-67-188-86-134.hsd1.ca.comcast.net [67.188.86.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id AB0A8EC418A; Sat, 17 Jan 2009 18:08:43 +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: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=FlGXYuOSEqxbT20/gvuqsSF0AB8M46pT4dQPXQC/Eq6rSVAnp1ytZzMJKEE2m1NXO UIGjmfz8r/N1h58m6USZA== Message-ID: <4971AE26.70406@delphij.net> Date: Sat, 17 Jan 2009 02:08:38 -0800 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.19 (X11/20090112) MIME-Version: 1.0 To: obrien@FreeBSD.ORG References: <200901120039.n0C0dMKX043214@svn.freebsd.org> <20090112083144.GA69408@dragon.NUXI.org> In-Reply-To: <20090112083144.GA69408@dragon.NUXI.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-stable-7@FreeBSD.ORG, svn-src-stable@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r187069 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 10:08:58 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, David, David O'Brien wrote: > On Mon, Jan 12, 2009 at 12:39:22AM +0000, Xin LI wrote: >> Author: delphij >> Date: Mon Jan 12 00:39:22 2009 >> New Revision: 187069 >> URL: http://svn.freebsd.org/changeset/base/187069 >> >> Log: >> MFC revisions 178088 and 179656: Catastrophic recovery mode. > > Hi Xin, > I guess you missed my email to you about this. I was hoping to get an > answer to this before it was MFC'ed. Oops, sorry about that, I think I must have missed the e-mail... > The use of 'C' conflicts with a Juniper Networks change Juniper wants to > push back to FreeBSD. > > For Juniper the -C flag is the "clean" flag. Meaning don't do anything > if the FS is clean, other wise do as full a fsck as possible (vs. just > a "preen" fsck). It is useful as 'fsck -C -y /var' (for instance). > > Do you think your functionality could live under the "-D" (damaged) > option? fsck_ffs already had a "-c" option, or Juniper would have > used that letter. I'm fine with a rename of the option, 'D' sounds a reasonable for my functionality. I have used uppercase to imply that the option is potentially dangerous. One bikeshed candidate: For non-native English speakers, flag 'p' sounds somewhat vague, and 'C' is not quite straightforward either, at the first glance, 'preen' seems to be stronger than 'clean'. Perhaps, 'P' would be a better candidate (a stronger 'preen') for the proposed functionality, just my $0.02 :) Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAklxriYACgkQi+vbBBjt66DwqACfWbN4XfBUcuMalw5MtuxtoeI5 V0gAoLOT/nOy6t5Vy9cP7qqv3VmZtDx9 =0lpr -----END PGP SIGNATURE----- From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 17 14:31:42 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D40A1065670; Sat, 17 Jan 2009 14:31:42 +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 3A6538FC0A; Sat, 17 Jan 2009 14:31:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HEVflM044972; Sat, 17 Jan 2009 14:31:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HEVfcI044971; Sat, 17 Jan 2009 14:31:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901171431.n0HEVfcI044971@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Jan 2009 14:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187362 - in stable/7/sys: . contrib/pf dev/cxgb kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 14:31:43 -0000 Author: kib Date: Sat Jan 17 14:31:41 2009 New Revision: 187362 URL: http://svn.freebsd.org/changeset/base/187362 Log: MFC r186276: Do not return success and doomed vnode from lookup. LK_UPGRADE allows the vnode to be reclaimed. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/vfs_lookup.c Modified: stable/7/sys/kern/vfs_lookup.c ============================================================================== --- stable/7/sys/kern/vfs_lookup.c Sat Jan 17 13:34:56 2009 (r187361) +++ stable/7/sys/kern/vfs_lookup.c Sat Jan 17 14:31:41 2009 (r187362) @@ -779,6 +779,10 @@ success: if ((cnp->cn_flags & (ISLASTCN | LOCKSHARED | LOCKLEAF)) == (ISLASTCN | LOCKLEAF) && VOP_ISLOCKED(dp, td) != LK_EXCLUSIVE) { vn_lock(dp, LK_UPGRADE | LK_RETRY, td); + if (dp->v_iflag & VI_DOOMED) { + error = ENOENT; + goto bad2; + } } if (vfslocked && dvfslocked) VFS_UNLOCK_GIANT(dvfslocked); /* Only need one */ From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 17 14:37:55 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E2AB106566B; Sat, 17 Jan 2009 14:37:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B38F8FC0C; Sat, 17 Jan 2009 14:37:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HEbtxw045192; Sat, 17 Jan 2009 14:37:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HEbtXM045191; Sat, 17 Jan 2009 14:37:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901171437.n0HEbtXM045191@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Jan 2009 14:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187363 - in stable/7/sys: . contrib/pf dev/cxgb ufs/ufs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 14:37:55 -0000 Author: kib Date: Sat Jan 17 14:37:54 2009 New Revision: 187363 URL: http://svn.freebsd.org/changeset/base/187363 Log: MFC r186278: Do not busy twice the mount point where a quota operation is performed. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/ufs/ufs/ufs_vfsops.c Modified: stable/7/sys/ufs/ufs/ufs_vfsops.c ============================================================================== --- stable/7/sys/ufs/ufs/ufs_vfsops.c Sat Jan 17 14:31:41 2009 (r187362) +++ stable/7/sys/ufs/ufs/ufs_vfsops.c Sat Jan 17 14:37:54 2009 (r187363) @@ -118,9 +118,6 @@ ufs_quotactl(mp, cmds, id, arg, td) if ((u_int)type >= MAXQUOTAS) return (EINVAL); - if (vfs_busy(mp, LK_NOWAIT, 0, td)) - return (0); - switch (cmd) { case Q_QUOTAON: error = quotaon(td, mp, type, arg); @@ -150,7 +147,6 @@ ufs_quotactl(mp, cmds, id, arg, td) error = EINVAL; break; } - vfs_unbusy(mp, td); return (error); #endif } From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 17 14:45:07 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF1B81065676; Sat, 17 Jan 2009 14:45:07 +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 C20E68FC1C; Sat, 17 Jan 2009 14:45:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HEj7Xx045373; Sat, 17 Jan 2009 14:45:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HEj7pa045370; Sat, 17 Jan 2009 14:45:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901171445.n0HEj7pa045370@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Jan 2009 14:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187364 - in stable/7/sys: . contrib/pf dev/cxgb kern vm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 14:45:08 -0000 Author: kib Date: Sat Jan 17 14:45:07 2009 New Revision: 187364 URL: http://svn.freebsd.org/changeset/base/187364 Log: MFC r186719: Extend the struct vm_page wire_count to u_int to avoid the overflow of the counter, that may happen when too many sendfile(2) calls are being executed with this vnode. To keep the size of the struct vm_page and offsets of the fields accessed by out-of-tree modules, swap the types and locations of the wire_count and cow fields. Add safety checks to detect cow overflow and force fallback to the normal copy code for zero-copy sockets. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/uipc_cow.c stable/7/sys/vm/vm_page.c stable/7/sys/vm/vm_page.h Modified: stable/7/sys/kern/uipc_cow.c ============================================================================== --- stable/7/sys/kern/uipc_cow.c Sat Jan 17 14:37:54 2009 (r187363) +++ stable/7/sys/kern/uipc_cow.c Sat Jan 17 14:45:07 2009 (r187364) @@ -129,7 +129,11 @@ socow_setup(struct mbuf *m0, struct uio * set up COW */ vm_page_lock_queues(); - vm_page_cowsetup(pp); + if (vm_page_cowsetup(pp) != 0) { + vm_page_unhold(pp); + vm_page_unlock_queues(); + return (0); + } /* * wire the page for I/O Modified: stable/7/sys/vm/vm_page.c ============================================================================== --- stable/7/sys/vm/vm_page.c Sat Jan 17 14:37:54 2009 (r187363) +++ stable/7/sys/vm/vm_page.c Sat Jan 17 14:45:07 2009 (r187364) @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2003,13 +2004,16 @@ vm_page_cowclear(vm_page_t m) */ } -void +int vm_page_cowsetup(vm_page_t m) { mtx_assert(&vm_page_queue_mtx, MA_OWNED); + if (m->cow == USHRT_MAX - 1) + return (EBUSY); m->cow++; pmap_remove_write(m); + return (0); } #include "opt_ddb.h" Modified: stable/7/sys/vm/vm_page.h ============================================================================== --- stable/7/sys/vm/vm_page.h Sat Jan 17 14:37:54 2009 (r187363) +++ stable/7/sys/vm/vm_page.h Sat Jan 17 14:45:07 2009 (r187364) @@ -111,12 +111,12 @@ struct vm_page { vm_paddr_t phys_addr; /* physical address of page */ struct md_page md; /* machine dependant stuff */ uint8_t queue; /* page queue index */ - int8_t segind; + int8_t segind; u_short flags; /* see below */ uint8_t order; /* index of the buddy queue */ uint8_t pool; - u_short wire_count; /* wired down maps refs (P) */ - u_int cow; /* page cow mapping count */ + u_short cow; /* page cow mapping count */ + u_int wire_count; /* wired down maps refs (P) */ short hold_count; /* page hold count */ u_short oflags; /* page flags (O) */ u_char act_count; /* page usage count */ @@ -346,7 +346,7 @@ void vm_page_zero_invalid(vm_page_t m, b void vm_page_free_toq(vm_page_t m); void vm_page_zero_idle_wakeup(void); void vm_page_cowfault (vm_page_t); -void vm_page_cowsetup (vm_page_t); +int vm_page_cowsetup(vm_page_t); void vm_page_cowclear (vm_page_t); /* From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 17 19:52:10 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12E45106564A; Sat, 17 Jan 2009 19:52:10 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00E398FC08; Sat, 17 Jan 2009 19:52:10 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HJq934051083; Sat, 17 Jan 2009 19:52:09 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HJq9Pk051082; Sat, 17 Jan 2009 19:52:09 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200901171952.n0HJq9Pk051082@svn.freebsd.org> From: Stanislav Sedov Date: Sat, 17 Jan 2009 19:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187370 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 19:52:11 -0000 Author: stas Date: Sat Jan 17 19:52:09 2009 New Revision: 187370 URL: http://svn.freebsd.org/changeset/base/187370 Log: - Bump __FreeBSD_version after cpuctl MFC. Modified: stable/7/sys/sys/param.h Modified: stable/7/sys/sys/param.h ============================================================================== --- stable/7/sys/sys/param.h Sat Jan 17 18:57:12 2009 (r187369) +++ stable/7/sys/sys/param.h Sat Jan 17 19:52:09 2009 (r187370) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 701101 /* Master, propagated to newvers */ +#define __FreeBSD_version 701102 /* Master, propagated to newvers */ #ifndef LOCORE #include