From owner-svn-src-stable@FreeBSD.ORG Sun Mar 11 00:33:55 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6504B1065670; Sun, 11 Mar 2012 00:33: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 4E85F8FC14; Sun, 11 Mar 2012 00:33:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2B0XtRP085444; Sun, 11 Mar 2012 00:33:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2B0XtCC085442; Sun, 11 Mar 2012 00:33:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203110033.q2B0XtCC085442@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 11 Mar 2012 00:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232802 - stable/9/bin/ps X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2012 00:33:55 -0000 Author: kib Date: Sun Mar 11 00:33:54 2012 New Revision: 232802 URL: http://svn.freebsd.org/changeset/base/232802 Log: MFC r232694: Document P_ORPHAN. Modified: stable/9/bin/ps/ps.1 Directory Properties: stable/9/bin/ps/ (props changed) Modified: stable/9/bin/ps/ps.1 ============================================================================== --- stable/9/bin/ps/ps.1 Sat Mar 10 23:27:03 2012 (r232801) +++ stable/9/bin/ps/ps.1 Sun Mar 11 00:33:54 2012 (r232802) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd November 22, 2011 +.Dd March 8, 2012 .Dt PS 1 .Os .Sh NAME @@ -317,6 +317,7 @@ the include file .It Dv "P_SINGLE_BOUNDARY" Ta No "0x400000 Threads should suspend at user boundary" .It Dv "P_HWPMC" Ta No "0x800000 Process is using HWPMCs" .It Dv "P_JAILED" Ta No "0x1000000 Process is in jail" +.It Dv "P_ORPHAN" Ta No "0x2000000 Orphaned by original parent, reparented to debugger" .It Dv "P_INEXEC" Ta No "0x4000000 Process is in execve()" .It Dv "P_STATCHILD" Ta No "0x8000000 Child process stopped or exited" .It Dv "P_INMEM" Ta No "0x10000000 Loaded into memory" From owner-svn-src-stable@FreeBSD.ORG Sun Mar 11 00:43:02 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9933F1065672; Sun, 11 Mar 2012 00:43:02 +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 6A4118FC16; Sun, 11 Mar 2012 00:43:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2B0h2E7085858; Sun, 11 Mar 2012 00:43:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2B0h2dA085856; Sun, 11 Mar 2012 00:43:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203110043.q2B0h2dA085856@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 11 Mar 2012 00:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232804 - stable/9/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2012 00:43:02 -0000 Author: kib Date: Sun Mar 11 00:43:01 2012 New Revision: 232804 URL: http://svn.freebsd.org/changeset/base/232804 Log: MFC r232178: Remove apparently redundand checks for socket so_proto being non-NULL from sosetopt() and sogetopt(). Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Sun Mar 11 00:34:14 2012 (r232803) +++ stable/9/sys/kern/uipc_socket.c Sun Mar 11 00:43:01 2012 (r232804) @@ -2442,7 +2442,7 @@ sosetopt(struct socket *so, struct socko CURVNET_SET(so->so_vnet); error = 0; if (sopt->sopt_level != SOL_SOCKET) { - if (so->so_proto && so->so_proto->pr_ctloutput) { + if (so->so_proto->pr_ctloutput != NULL) { error = (*so->so_proto->pr_ctloutput)(so, sopt); CURVNET_RESTORE(); return (error); @@ -2503,8 +2503,7 @@ sosetopt(struct socket *so, struct socko error = EINVAL; goto bad; } - if (so->so_proto != NULL && - ((so->so_proto->pr_domain->dom_family == PF_INET) || + if (((so->so_proto->pr_domain->dom_family == PF_INET) || (so->so_proto->pr_domain->dom_family == PF_INET6) || (so->so_proto->pr_domain->dom_family == PF_ROUTE))) { so->so_fibnum = optval; @@ -2636,11 +2635,8 @@ sosetopt(struct socket *so, struct socko error = ENOPROTOOPT; break; } - if (error == 0 && so->so_proto != NULL && - so->so_proto->pr_ctloutput != NULL) { - (void) ((*so->so_proto->pr_ctloutput) - (so, sopt)); - } + if (error == 0 && so->so_proto->pr_ctloutput != NULL) + (void)(*so->so_proto->pr_ctloutput)(so, sopt); } bad: CURVNET_RESTORE(); @@ -2690,7 +2686,7 @@ sogetopt(struct socket *so, struct socko CURVNET_SET(so->so_vnet); error = 0; if (sopt->sopt_level != SOL_SOCKET) { - if (so->so_proto && so->so_proto->pr_ctloutput) + if (so->so_proto->pr_ctloutput != NULL) error = (*so->so_proto->pr_ctloutput)(so, sopt); else error = ENOPROTOOPT; From owner-svn-src-stable@FreeBSD.ORG Sun Mar 11 00:48:54 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9434106566B; Sun, 11 Mar 2012 00:48:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D39C18FC0A; Sun, 11 Mar 2012 00:48:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2B0msvO086108; Sun, 11 Mar 2012 00:48:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2B0ms5c086105; Sun, 11 Mar 2012 00:48:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203110048.q2B0ms5c086105@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 11 Mar 2012 00:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232805 - in stable/9/sys: kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2012 00:48:55 -0000 Author: kib Date: Sun Mar 11 00:48:54 2012 New Revision: 232805 URL: http://svn.freebsd.org/changeset/base/232805 Log: MFC r232179: Add SO_PROTOCOL/SO_PROTOTYPE socket SOL_SOCKET-level option to get the socket protocol number. PR: kern/162352 Modified: stable/9/sys/kern/uipc_socket.c stable/9/sys/sys/socket.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Sun Mar 11 00:43:01 2012 (r232804) +++ stable/9/sys/kern/uipc_socket.c Sun Mar 11 00:48:54 2012 (r232805) @@ -2728,6 +2728,10 @@ integer: optval = so->so_type; goto integer; + case SO_PROTOCOL: + optval = so->so_proto->pr_protocol; + goto integer; + case SO_ERROR: SOCK_LOCK(so); optval = so->so_error; Modified: stable/9/sys/sys/socket.h ============================================================================== --- stable/9/sys/sys/socket.h Sun Mar 11 00:43:01 2012 (r232804) +++ stable/9/sys/sys/socket.h Sun Mar 11 00:48:54 2012 (r232805) @@ -138,6 +138,8 @@ typedef __uid_t uid_t; #define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */ #define SO_SETFIB 0x1014 /* use this FIB to route */ #define SO_USER_COOKIE 0x1015 /* user cookie (dummynet etc.) */ +#define SO_PROTOCOL 0x1016 /* get socket protocol (Linux name) */ +#define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */ #endif /* From owner-svn-src-stable@FreeBSD.ORG Sun Mar 11 00:51:16 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A2371106566B; Sun, 11 Mar 2012 00:51:16 +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 8B8908FC17; Sun, 11 Mar 2012 00:51:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2B0pGXr086235; Sun, 11 Mar 2012 00:51:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2B0pGgW086233; Sun, 11 Mar 2012 00:51:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203110051.q2B0pGgW086233@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 11 Mar 2012 00:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232806 - stable/9/lib/libc/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2012 00:51:16 -0000 Author: kib Date: Sun Mar 11 00:51:16 2012 New Revision: 232806 URL: http://svn.freebsd.org/changeset/base/232806 Log: MFC r232180: Document SO_PROTOCOL socket option. Modified: stable/9/lib/libc/sys/getsockopt.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/getsockopt.2 ============================================================================== --- stable/9/lib/libc/sys/getsockopt.2 Sun Mar 11 00:48:54 2012 (r232805) +++ stable/9/lib/libc/sys/getsockopt.2 Sun Mar 11 00:51:16 2012 (r232806) @@ -28,7 +28,7 @@ .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd November 21, 2011 +.Dd February 26, 2012 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -172,6 +172,8 @@ for the socket .It Dv SO_BINTIME Ta "enables reception of a timestamp with datagrams" .It Dv SO_ACCEPTCONN Ta "get listening status of the socket (get only)" .It Dv SO_TYPE Ta "get the type of the socket (get only)" +.It Dv SO_PROTOCOL Ta "get the protocol number for the socket (get only)" +.It Dv SO_PROTOTYPE Ta "SunOS alias for the Linux SO_PROTOCOL (get only)" .It Dv SO_ERROR Ta "get and clear error on the socket (get only)" .It Dv SO_SETFIB Ta "set the associated FIB (routing table) for the socket (set only)" .El @@ -449,7 +451,10 @@ and for .Ed .Pp .Dv SO_ACCEPTCONN , -.Dv SO_TYPE +.Dv SO_TYPE , +.Dv SO_PROTOCOL +(and its alias +.Dv SO_PROTOTYPE ) and .Dv SO_ERROR are options used only with @@ -463,6 +468,12 @@ system call was invoked on the socket. returns the type of the socket, such as .Dv SOCK_STREAM ; it is useful for servers that inherit sockets on startup. +.Dv SO_PROTOCOL +returns the protocol number for the socket, for +.Dv AF_INET +and +.Dv AF_INET6 +address families. .Dv SO_ERROR returns any pending error on the socket and clears the error status. From owner-svn-src-stable@FreeBSD.ORG Sun Mar 11 09:22:06 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 258C71065676; Sun, 11 Mar 2012 09:22:06 +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 EF6CB8FC15; Sun, 11 Mar 2012 09:22:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2B9M5AY002993; Sun, 11 Mar 2012 09:22:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2B9M57e002991; Sun, 11 Mar 2012 09:22:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203110922.q2B9M57e002991@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 11 Mar 2012 09:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232818 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2012 09:22:06 -0000 Author: kib Date: Sun Mar 11 09:22:05 2012 New Revision: 232818 URL: http://svn.freebsd.org/changeset/base/232818 Log: MFC r232178: Remove apparently redundand checks for socket so_proto being non-NULL from sosetopt() and sogetopt(). Modified: stable/8/sys/kern/uipc_socket.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/uipc_socket.c ============================================================================== --- stable/8/sys/kern/uipc_socket.c Sun Mar 11 08:12:30 2012 (r232817) +++ stable/8/sys/kern/uipc_socket.c Sun Mar 11 09:22:05 2012 (r232818) @@ -2436,7 +2436,7 @@ sosetopt(struct socket *so, struct socko CURVNET_SET(so->so_vnet); error = 0; if (sopt->sopt_level != SOL_SOCKET) { - if (so->so_proto && so->so_proto->pr_ctloutput) { + if (so->so_proto->pr_ctloutput != NULL) { error = (*so->so_proto->pr_ctloutput)(so, sopt); CURVNET_RESTORE(); return (error); @@ -2497,8 +2497,7 @@ sosetopt(struct socket *so, struct socko error = EINVAL; goto bad; } - if (so->so_proto != NULL && - ((so->so_proto->pr_domain->dom_family == PF_INET) || + if (((so->so_proto->pr_domain->dom_family == PF_INET) || (so->so_proto->pr_domain->dom_family == PF_INET6) || (so->so_proto->pr_domain->dom_family == PF_ROUTE))) { so->so_fibnum = optval; @@ -2621,11 +2620,8 @@ sosetopt(struct socket *so, struct socko error = ENOPROTOOPT; break; } - if (error == 0 && so->so_proto != NULL && - so->so_proto->pr_ctloutput != NULL) { - (void) ((*so->so_proto->pr_ctloutput) - (so, sopt)); - } + if (error == 0 && so->so_proto->pr_ctloutput != NULL) + (void)(*so->so_proto->pr_ctloutput)(so, sopt); } bad: CURVNET_RESTORE(); @@ -2675,7 +2671,7 @@ sogetopt(struct socket *so, struct socko CURVNET_SET(so->so_vnet); error = 0; if (sopt->sopt_level != SOL_SOCKET) { - if (so->so_proto && so->so_proto->pr_ctloutput) + if (so->so_proto->pr_ctloutput != NULL) error = (*so->so_proto->pr_ctloutput)(so, sopt); else error = ENOPROTOOPT; From owner-svn-src-stable@FreeBSD.ORG Sun Mar 11 09:27:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77867106564A; Sun, 11 Mar 2012 09:27:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 662AA8FC14; Sun, 11 Mar 2012 09:27:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2B9R9OB003192; Sun, 11 Mar 2012 09:27:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2B9R9t7003189; Sun, 11 Mar 2012 09:27:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203110927.q2B9R9t7003189@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 11 Mar 2012 09:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232819 - in stable/8/sys: kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2012 09:27:09 -0000 Author: kib Date: Sun Mar 11 09:27:09 2012 New Revision: 232819 URL: http://svn.freebsd.org/changeset/base/232819 Log: MFC r232179: Add SO_PROTOCOL/SO_PROTOTYPE socket SOL_SOCKET-level option to get the socket protocol number. PR: kern/162352 Modified: stable/8/sys/kern/uipc_socket.c stable/8/sys/sys/socket.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/uipc_socket.c ============================================================================== --- stable/8/sys/kern/uipc_socket.c Sun Mar 11 09:22:05 2012 (r232818) +++ stable/8/sys/kern/uipc_socket.c Sun Mar 11 09:27:09 2012 (r232819) @@ -2713,6 +2713,10 @@ integer: optval = so->so_type; goto integer; + case SO_PROTOCOL: + optval = so->so_proto->pr_protocol; + goto integer; + case SO_ERROR: SOCK_LOCK(so); optval = so->so_error; Modified: stable/8/sys/sys/socket.h ============================================================================== --- stable/8/sys/sys/socket.h Sun Mar 11 09:22:05 2012 (r232818) +++ stable/8/sys/sys/socket.h Sun Mar 11 09:27:09 2012 (r232819) @@ -139,6 +139,8 @@ typedef __uid_t uid_t; #define SO_LISTENQLEN 0x1012 /* socket's complete queue length */ #define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */ #define SO_SETFIB 0x1014 /* use this FIB to route */ +#define SO_PROTOCOL 0x1016 /* get socket protocol (Linux name) */ +#define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */ #endif /* From owner-svn-src-stable@FreeBSD.ORG Sun Mar 11 09:29:03 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FCEC1065670; Sun, 11 Mar 2012 09:29:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F266F8FC17; Sun, 11 Mar 2012 09:29:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2B9T22Z003297; Sun, 11 Mar 2012 09:29:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2B9T2GF003295; Sun, 11 Mar 2012 09:29:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203110929.q2B9T2GF003295@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 11 Mar 2012 09:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232820 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2012 09:29:03 -0000 Author: kib Date: Sun Mar 11 09:29:02 2012 New Revision: 232820 URL: http://svn.freebsd.org/changeset/base/232820 Log: MFC r232180: Document SO_PROTOCOL socket option. Modified: stable/8/lib/libc/sys/getsockopt.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/getsockopt.2 ============================================================================== --- stable/8/lib/libc/sys/getsockopt.2 Sun Mar 11 09:27:09 2012 (r232819) +++ stable/8/lib/libc/sys/getsockopt.2 Sun Mar 11 09:29:02 2012 (r232820) @@ -28,7 +28,7 @@ .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd November 21, 2011 +.Dd February 26, 2012 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -172,6 +172,8 @@ for the socket .It Dv SO_BINTIME Ta "enables reception of a timestamp with datagrams" .It Dv SO_ACCEPTCONN Ta "get listening status of the socket (get only)" .It Dv SO_TYPE Ta "get the type of the socket (get only)" +.It Dv SO_PROTOCOL Ta "get the protocol number for the socket (get only)" +.It Dv SO_PROTOTYPE Ta "SunOS alias for the Linux SO_PROTOCOL (get only)" .It Dv SO_ERROR Ta "get and clear error on the socket (get only)" .It Dv SO_SETFIB Ta "set the associated FIB (routing table) for the socket (set only)" .El @@ -431,7 +433,10 @@ and for .Ed .Pp .Dv SO_ACCEPTCONN , -.Dv SO_TYPE +.Dv SO_TYPE , +.Dv SO_PROTOCOL +(and its alias +.Dv SO_PROTOTYPE ) and .Dv SO_ERROR are options used only with @@ -445,6 +450,12 @@ system call was invoked on the socket. returns the type of the socket, such as .Dv SOCK_STREAM ; it is useful for servers that inherit sockets on startup. +.Dv SO_PROTOCOL +returns the protocol number for the socket, for +.Dv AF_INET +and +.Dv AF_INET6 +address families. .Dv SO_ERROR returns any pending error on the socket and clears the error status. From owner-svn-src-stable@FreeBSD.ORG Sun Mar 11 19:23:38 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F7131065678; Sun, 11 Mar 2012 19:23:38 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE9698FC1F; Sun, 11 Mar 2012 19:23:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2BJNbta023379; Sun, 11 Mar 2012 19:23:37 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2BJNbLs023377; Sun, 11 Mar 2012 19:23:37 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201203111923.q2BJNbLs023377@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 11 Mar 2012 19:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232826 - stable/9/etc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2012 19:23:38 -0000 Author: gavin Date: Sun Mar 11 19:23:37 2012 New Revision: 232826 URL: http://svn.freebsd.org/changeset/base/232826 Log: Merge r226862 from head: Remove example for linking /dev/vga to /dev/ttyv0, this hasn't been required since X version 4.3.0. PR: conf/161847 Submitted by: eadler Modified: stable/9/etc/devfs.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/devfs.conf ============================================================================== --- stable/9/etc/devfs.conf Sun Mar 11 19:08:56 2012 (r232825) +++ stable/9/etc/devfs.conf Sun Mar 11 19:23:37 2012 (r232826) @@ -31,9 +31,6 @@ # # Examples: -# Historically X depended on this, but version 4.3.0 doesn't seem to anymore -#link ttyv0 vga - # Commonly used by many ports #link cd0 cdrom #link cd0 dvd From owner-svn-src-stable@FreeBSD.ORG Sun Mar 11 19:23:43 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A38D1065677; Sun, 11 Mar 2012 19:23:43 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E79908FC20; Sun, 11 Mar 2012 19:23:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2BJNgRf023418; Sun, 11 Mar 2012 19:23:42 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2BJNg0Q023416; Sun, 11 Mar 2012 19:23:42 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201203111923.q2BJNg0Q023416@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 11 Mar 2012 19:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232827 - stable/8/etc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2012 19:23:43 -0000 Author: gavin Date: Sun Mar 11 19:23:42 2012 New Revision: 232827 URL: http://svn.freebsd.org/changeset/base/232827 Log: Merge r226862 from head: Remove example for linking /dev/vga to /dev/ttyv0, this hasn't been required since X version 4.3.0. PR: conf/161847 Submitted by: eadler Modified: stable/8/etc/devfs.conf Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/devfs.conf ============================================================================== --- stable/8/etc/devfs.conf Sun Mar 11 19:23:37 2012 (r232826) +++ stable/8/etc/devfs.conf Sun Mar 11 19:23:42 2012 (r232827) @@ -31,9 +31,6 @@ # # Examples: -# Historically X depended on this, but version 4.3.0 doesn't seem to anymore -#link ttyv0 vga - # Commonly used by many ports #link acd0 cdrom From owner-svn-src-stable@FreeBSD.ORG Sun Mar 11 22:07:42 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3ED61106566B; Sun, 11 Mar 2012 22:07:42 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2941E8FC0A; Sun, 11 Mar 2012 22:07:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2BM7g5G028914; Sun, 11 Mar 2012 22:07:42 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2BM7fHo028912; Sun, 11 Mar 2012 22:07:41 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201203112207.q2BM7fHo028912@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 11 Mar 2012 22:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232838 - stable/8/lib/libc/stdio X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2012 22:07:42 -0000 Author: gavin Date: Sun Mar 11 22:07:41 2012 New Revision: 232838 URL: http://svn.freebsd.org/changeset/base/232838 Log: Merge r216121 from head: Remove two unused variables, left over from the refactoring in r180104. PR: bin/152551 Submitted by: Henning Petersen Modified: stable/8/lib/libc/stdio/printf-pos.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/stdio/printf-pos.c ============================================================================== --- stable/8/lib/libc/stdio/printf-pos.c Sun Mar 11 21:25:42 2012 (r232837) +++ stable/8/lib/libc/stdio/printf-pos.c Sun Mar 11 22:07:41 2012 (r232838) @@ -248,7 +248,6 @@ __find_arguments (const char *fmt0, va_l int n; /* handy integer (short term usage) */ int error; int flags; /* flags as above */ - int width; /* width from format (%8d), or 0 */ struct typetable types; /* table of types */ fmt = (char *)fmt0; @@ -266,7 +265,6 @@ __find_arguments (const char *fmt0, va_l fmt++; /* skip over '%' */ flags = 0; - width = 0; rflag: ch = *fmt++; reswitch: switch (ch) { @@ -304,7 +302,6 @@ reswitch: switch (ch) { types.nextarg = n; goto rflag; } - width = n; goto reswitch; #ifndef NO_FLOATING_POINT case 'L': @@ -439,7 +436,6 @@ __find_warguments (const wchar_t *fmt0, int n; /* handy integer (short term usage) */ int error; int flags; /* flags as above */ - int width; /* width from format (%8d), or 0 */ struct typetable types; /* table of types */ fmt = (wchar_t *)fmt0; @@ -457,7 +453,6 @@ __find_warguments (const wchar_t *fmt0, fmt++; /* skip over '%' */ flags = 0; - width = 0; rflag: ch = *fmt++; reswitch: switch (ch) { @@ -495,7 +490,6 @@ reswitch: switch (ch) { types.nextarg = n; goto rflag; } - width = n; goto reswitch; #ifndef NO_FLOATING_POINT case 'L': From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 12:29:32 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4BC701065672; Mon, 12 Mar 2012 12:29:32 +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 316108FC12; Mon, 12 Mar 2012 12:29:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CCTWw0061815; Mon, 12 Mar 2012 12:29:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CCTVm1061813; Mon, 12 Mar 2012 12:29:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203121229.q2CCTVm1061813@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 12 Mar 2012 12:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232863 - stable/9/libexec/rtld-elf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 12:29:32 -0000 Author: kib Date: Mon Mar 12 12:29:31 2012 New Revision: 232863 URL: http://svn.freebsd.org/changeset/base/232863 Log: MFC r232572: Use hand-made isspace1() macro which is enough to detect spaces in libmap.conf. MFC r232590 (by pluknet): Rename isspace1() macro to the more appropriate rtld_isspace(). Modified: stable/9/libexec/rtld-elf/libmap.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/libmap.c ============================================================================== --- stable/9/libexec/rtld-elf/libmap.c Mon Mar 12 12:16:08 2012 (r232862) +++ stable/9/libexec/rtld-elf/libmap.c Mon Mar 12 12:29:31 2012 (r232863) @@ -3,7 +3,6 @@ */ #include -#include #include #include #include @@ -53,6 +52,12 @@ static int closestrfn (void * cookie); #define iseol(c) (((c) == '#') || ((c) == '\0') || \ ((c) == '\n') || ((c) == '\r')) +/* + * Do not use ctype.h macros, which rely on working TLS. It is + * too early to have thread-local variables functional. + */ +#define rtld_isspace(c) ((c) == ' ' || (c) == '\t') + int lm_init (char *libmap_override) { @@ -107,7 +112,7 @@ lmc_parse (FILE *fp) t = f = c = NULL; /* Skip over leading space */ - while (isspace(*cp)) cp++; + while (rtld_isspace(*cp)) cp++; /* Found a comment or EOL */ if (iseol(*cp)) continue; @@ -117,7 +122,7 @@ lmc_parse (FILE *fp) cp++; /* Skip leading space */ - while (isspace(*cp)) cp++; + while (rtld_isspace(*cp)) cp++; /* Found comment, EOL or end of selector */ if (iseol(*cp) || *cp == ']') @@ -125,11 +130,11 @@ lmc_parse (FILE *fp) c = cp++; /* Skip to end of word */ - while (!isspace(*cp) && !iseol(*cp) && *cp != ']') + while (!rtld_isspace(*cp) && !iseol(*cp) && *cp != ']') cp++; /* Skip and zero out trailing space */ - while (isspace(*cp)) *cp++ = '\0'; + while (rtld_isspace(*cp)) *cp++ = '\0'; /* Check if there is a closing brace */ if (*cp != ']') continue; @@ -141,7 +146,7 @@ lmc_parse (FILE *fp) * There should be nothing except whitespace or comment from this point to the end of the line. */ - while(isspace(*cp)) cp++; + while(rtld_isspace(*cp)) cp++; if (!iseol(*cp)) continue; strcpy(prog, c); @@ -151,20 +156,20 @@ lmc_parse (FILE *fp) /* Parse the 'from' candidate. */ f = cp++; - while (!isspace(*cp) && !iseol(*cp)) cp++; + while (!rtld_isspace(*cp) && !iseol(*cp)) cp++; /* Skip and zero out the trailing whitespace */ - while (isspace(*cp)) *cp++ = '\0'; + while (rtld_isspace(*cp)) *cp++ = '\0'; /* Found a comment or EOL */ if (iseol(*cp)) continue; /* Parse 'to' mapping */ t = cp++; - while (!isspace(*cp) && !iseol(*cp)) cp++; + while (!rtld_isspace(*cp) && !iseol(*cp)) cp++; /* Skip and zero out the trailing whitespace */ - while (isspace(*cp)) *cp++ = '\0'; + while (rtld_isspace(*cp)) *cp++ = '\0'; /* Should be no extra tokens at this point */ if (!iseol(*cp)) continue; From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 12:53:28 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86C58106566C; Mon, 12 Mar 2012 12:53:28 +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 751708FC0A; Mon, 12 Mar 2012 12:53:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CCrSpx062628; Mon, 12 Mar 2012 12:53:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CCrS8e062624; Mon, 12 Mar 2012 12:53:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203121253.q2CCrS8e062624@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 12 Mar 2012 12:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232864 - in stable/9/sys: kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 12:53:28 -0000 Author: kib Date: Mon Mar 12 12:53:27 2012 New Revision: 232864 URL: http://svn.freebsd.org/changeset/base/232864 Log: MFC r232240: Currently, the debugger attached to the process executing vfork() does not get syscall exit notification until the child performed exec of exit. Swap the order of doing ptracestop() and waiting for P_PPWAIT clearing, by postponing the wait into syscallret after ptracestop() notification is done. Modified: stable/9/sys/kern/kern_fork.c stable/9/sys/kern/subr_syscall.c stable/9/sys/sys/proc.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_fork.c ============================================================================== --- stable/9/sys/kern/kern_fork.c Mon Mar 12 12:29:31 2012 (r232863) +++ stable/9/sys/kern/kern_fork.c Mon Mar 12 12:53:27 2012 (r232864) @@ -708,6 +708,10 @@ do_fork(struct thread *td, int flags, st _PHOLD(p2); p2_held = 1; } + if (flags & RFPPWAIT) { + td->td_pflags |= TDP_RFPPWAIT; + td->td_rfppwait_p = p2; + } PROC_UNLOCK(p2); if ((flags & RFSTOPPED) == 0) { /* @@ -740,14 +744,6 @@ do_fork(struct thread *td, int flags, st cv_wait(&p2->p_dbgwait, &p2->p_mtx); if (p2_held) _PRELE(p2); - - /* - * Preserve synchronization semantics of vfork. If waiting for - * child to exec or exit, set P_PPWAIT on child, and sleep on our - * proc (in case of exit). - */ - while (p2->p_flag & P_PPWAIT) - cv_wait(&p2->p_pwait, &p2->p_mtx); PROC_UNLOCK(p2); } Modified: stable/9/sys/kern/subr_syscall.c ============================================================================== --- stable/9/sys/kern/subr_syscall.c Mon Mar 12 12:29:31 2012 (r232863) +++ stable/9/sys/kern/subr_syscall.c Mon Mar 12 12:53:27 2012 (r232864) @@ -165,7 +165,7 @@ syscallenter(struct thread *td, struct s static inline void syscallret(struct thread *td, int error, struct syscall_args *sa __unused) { - struct proc *p; + struct proc *p, *p2; int traced; p = td->td_proc; @@ -223,4 +223,23 @@ syscallret(struct thread *td, int error, td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); PROC_UNLOCK(p); } + + if (td->td_pflags & TDP_RFPPWAIT) { + /* + * Preserve synchronization semantics of vfork. If + * waiting for child to exec or exit, fork set + * P_PPWAIT on child, and there we sleep on our proc + * (in case of exit). + * + * Do it after the ptracestop() above is finished, to + * not block our debugger until child execs or exits + * to finish vfork wait. + */ + td->td_pflags &= ~TDP_RFPPWAIT; + p2 = td->td_rfppwait_p; + PROC_LOCK(p2); + while (p2->p_flag & P_PPWAIT) + cv_wait(&p2->p_pwait, &p2->p_mtx); + PROC_UNLOCK(p2); + } } Modified: stable/9/sys/sys/proc.h ============================================================================== --- stable/9/sys/sys/proc.h Mon Mar 12 12:29:31 2012 (r232863) +++ stable/9/sys/sys/proc.h Mon Mar 12 12:53:27 2012 (r232864) @@ -310,6 +310,7 @@ struct thread { struct vnet *td_vnet; /* (k) Effective vnet. */ const char *td_vnet_lpush; /* (k) Debugging vnet push / pop. */ struct trapframe *td_intr_frame;/* (k) Frame of the current irq */ + struct proc *td_rfppwait_p; /* (k) The vforked child */ }; struct mtx *thread_lock_block(struct thread *); @@ -414,6 +415,7 @@ do { \ #define TDP_CALLCHAIN 0x00400000 /* Capture thread's callchain */ #define TDP_IGNSUSP 0x00800000 /* Permission to ignore the MNTK_SUSPEND* */ #define TDP_AUDITREC 0x01000000 /* Audit record pending on thread */ +#define TDP_RFPPWAIT 0x02000000 /* Handle RFPPWAIT on syscall exit */ /* * Reasons that the current thread can not be run yet. From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 17:54:18 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8DEC9106566B; Mon, 12 Mar 2012 17:54:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62B178FC0A; Mon, 12 Mar 2012 17:54:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CHsITo077331; Mon, 12 Mar 2012 17:54:18 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CHsIgS077329; Mon, 12 Mar 2012 17:54:18 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203121754.q2CHsIgS077329@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 12 Mar 2012 17:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232870 - stable/9/sys/dev/usb/controller X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 17:54:18 -0000 Author: hselasky Date: Mon Mar 12 17:54:17 2012 New Revision: 232870 URL: http://svn.freebsd.org/changeset/base/232870 Log: MFC r232448: Make sure that the USB system suspend event is executed synchronously and not asynchronously. Modified: stable/9/sys/dev/usb/controller/usb_controller.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/9/sys/dev/usb/controller/usb_controller.c Mon Mar 12 17:25:35 2012 (r232869) +++ stable/9/sys/dev/usb/controller/usb_controller.c Mon Mar 12 17:54:17 2012 (r232870) @@ -89,10 +89,15 @@ TUNABLE_INT("hw.usb.no_boot_wait", &usb_ SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boot_wait, 0, "No USB device enumerate waiting at boot."); +static int usb_no_suspend_wait = 0; +TUNABLE_INT("hw.usb.no_suspend_wait", &usb_no_suspend_wait); +SYSCTL_INT(_hw_usb, OID_AUTO, no_suspend_wait, CTLFLAG_RW|CTLFLAG_TUN, + &usb_no_suspend_wait, 0, "No USB device waiting at system suspend."); + static int usb_no_shutdown_wait = 0; TUNABLE_INT("hw.usb.no_shutdown_wait", &usb_no_shutdown_wait); -SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RW|CTLFLAG_TUN, &usb_no_shutdown_wait, 0, - "No USB device waiting at system shutdown."); +SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RW|CTLFLAG_TUN, + &usb_no_shutdown_wait, 0, "No USB device waiting at system shutdown."); static devclass_t usb_devclass; @@ -239,6 +244,11 @@ usb_suspend(device_t dev) USB_BUS_LOCK(bus); usb_proc_msignal(&bus->explore_proc, &bus->suspend_msg[0], &bus->suspend_msg[1]); + if (usb_no_suspend_wait == 0) { + /* wait for suspend callback to be executed */ + usb_proc_mwait(&bus->explore_proc, + &bus->suspend_msg[0], &bus->suspend_msg[1]); + } USB_BUS_UNLOCK(bus); return (0); @@ -406,6 +416,15 @@ usb_bus_suspend(struct usb_proc_msg *pm) USB_BUS_UNLOCK(bus); + /* + * We use the shutdown event here because the suspend and + * resume events are reserved for the USB port suspend and + * resume. The USB system suspend is implemented like full + * shutdown and all connected USB devices will be disconnected + * subsequently. At resume all USB devices will be + * re-connected again. + */ + bus_generic_shutdown(bus->bdev); usbd_enum_lock(udev); From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 17:56:58 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 687DD1065672; Mon, 12 Mar 2012 17:56:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D6668FC14; Mon, 12 Mar 2012 17:56:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CHuwTj077494; Mon, 12 Mar 2012 17:56:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CHuwtq077491; Mon, 12 Mar 2012 17:56:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203121756.q2CHuwtq077491@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 12 Mar 2012 17:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232871 - stable/8/sys/dev/usb/controller X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 17:56:58 -0000 Author: hselasky Date: Mon Mar 12 17:56:57 2012 New Revision: 232871 URL: http://svn.freebsd.org/changeset/base/232871 Log: MFC r232448: Make sure that the USB system suspend event is executed synchronously and not asynchronously. Modified: stable/8/sys/dev/usb/controller/usb_controller.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/8/sys/dev/usb/controller/usb_controller.c Mon Mar 12 17:54:17 2012 (r232870) +++ stable/8/sys/dev/usb/controller/usb_controller.c Mon Mar 12 17:56:57 2012 (r232871) @@ -89,10 +89,15 @@ TUNABLE_INT("hw.usb.no_boot_wait", &usb_ SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boot_wait, 0, "No USB device enumerate waiting at boot."); +static int usb_no_suspend_wait = 0; +TUNABLE_INT("hw.usb.no_suspend_wait", &usb_no_suspend_wait); +SYSCTL_INT(_hw_usb, OID_AUTO, no_suspend_wait, CTLFLAG_RW|CTLFLAG_TUN, + &usb_no_suspend_wait, 0, "No USB device waiting at system suspend."); + static int usb_no_shutdown_wait = 0; TUNABLE_INT("hw.usb.no_shutdown_wait", &usb_no_shutdown_wait); -SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RW|CTLFLAG_TUN, &usb_no_shutdown_wait, 0, - "No USB device waiting at system shutdown."); +SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RW|CTLFLAG_TUN, + &usb_no_shutdown_wait, 0, "No USB device waiting at system shutdown."); static devclass_t usb_devclass; @@ -239,6 +244,11 @@ usb_suspend(device_t dev) USB_BUS_LOCK(bus); usb_proc_msignal(&bus->explore_proc, &bus->suspend_msg[0], &bus->suspend_msg[1]); + if (usb_no_suspend_wait == 0) { + /* wait for suspend callback to be executed */ + usb_proc_mwait(&bus->explore_proc, + &bus->suspend_msg[0], &bus->suspend_msg[1]); + } USB_BUS_UNLOCK(bus); return (0); @@ -406,6 +416,15 @@ usb_bus_suspend(struct usb_proc_msg *pm) USB_BUS_UNLOCK(bus); + /* + * We use the shutdown event here because the suspend and + * resume events are reserved for the USB port suspend and + * resume. The USB system suspend is implemented like full + * shutdown and all connected USB devices will be disconnected + * subsequently. At resume all USB devices will be + * re-connected again. + */ + bus_generic_shutdown(bus->bdev); usbd_enum_lock(udev); From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 18:14:00 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 983461065670; Mon, 12 Mar 2012 18:14:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85FCD8FC16; Mon, 12 Mar 2012 18:14:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CIE0hH078323; Mon, 12 Mar 2012 18:14:00 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CIE0NU078318; Mon, 12 Mar 2012 18:14:00 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203121814.q2CIE0NU078318@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 12 Mar 2012 18:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232873 - in stable/9/sys/dev/usb: . quirk serial X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 18:14:00 -0000 Author: hselasky Date: Mon Mar 12 18:13:59 2012 New Revision: 232873 URL: http://svn.freebsd.org/changeset/base/232873 Log: MFC r230238 and r232684: Add new USB device ID's. Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Mon Mar 12 18:10:01 2012 (r232872) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Mon Mar 12 18:13:59 2012 (r232873) @@ -134,6 +134,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(QUALCOMM2, CDMA_MSM, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(CURITEL, UM150, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(CURITEL, UM175, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(VERTEX, VW110L, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), /* USB Mass Storage Class Quirks */ USB_QUIRK_VP(USB_VENDOR_ASAHIOPTICAL, 0, UQ_MSC_NO_RS_CLEAR_UA, Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Mon Mar 12 18:10:01 2012 (r232872) +++ stable/9/sys/dev/usb/serial/u3g.c Mon Mar 12 18:13:59 2012 (r232873) @@ -354,6 +354,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QISDA, H21_2, 0), U3G_DEV(QUALCOMM2, AC8700, 0), U3G_DEV(QUALCOMM2, MF330, 0), + U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, AC2726, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), U3G_DEV(QUALCOMMINC, AC8710, 0), @@ -422,6 +423,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMMINC, SURFSTICK, 0), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), + U3G_DEV(QUALCOMMINC, K3772_Z, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, MF633R, 0), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Mon Mar 12 18:10:01 2012 (r232872) +++ stable/9/sys/dev/usb/usbdevs Mon Mar 12 18:13:59 2012 (r232873) @@ -679,6 +679,7 @@ vendor QISDA 0x1da5 Qisda vendor METAGEEK2 0x1dd5 MetaGeek vendor ALINK 0x1e0e Alink vendor AIRTIES 0x1eda AirTies +vendor VERTEX 0x1fe7 Vertex Wireless Co., Ltd. vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications vendor HAUPPAUGE2 0x2040 Hauppauge Computer Works @@ -2677,6 +2678,7 @@ product QUALCOMM2 MF330 0x6613 MF330 product QUALCOMM2 RWT_FCT 0x3100 RWT FCT-CDMA 2000 1xRTT modem product QUALCOMM2 CDMA_MSM 0x3196 CDMA Technologies MSM modem product QUALCOMM2 AC8700 0x6000 AC8700 +product QUALCOMM2 VW110L 0x1000 Vertex Wireless 110L modem product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem @@ -2744,6 +2746,7 @@ product QUALCOMMINC E0078 0x0078 3G mode product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick +product QUALCOMMINC K3772_Z 0x1179 3G modem product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem @@ -3373,6 +3376,9 @@ product VIA USB2IDEBRIDGE 0x6204 USB 2.0 /* Vaisala products */ product VAISALA CABLE 0x0200 USB Interface cable +/* Vertex products */ +product VERTEX VW110L 0x0100 Vertex VW110L modem + /* VidzMedia products */ product VIDZMEDIA MONSTERTV 0x4fb1 MonsterTV P2H From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 18:17:44 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62278106564A; Mon, 12 Mar 2012 18:17:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5010B8FC12; Mon, 12 Mar 2012 18:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CIHiQ3078646; Mon, 12 Mar 2012 18:17:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CIHiAZ078642; Mon, 12 Mar 2012 18:17:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203121817.q2CIHiAZ078642@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 12 Mar 2012 18:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232875 - in stable/8/sys/dev/usb: . quirk serial X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 18:17:44 -0000 Author: hselasky Date: Mon Mar 12 18:17:43 2012 New Revision: 232875 URL: http://svn.freebsd.org/changeset/base/232875 Log: MFC r230238 and r232684: Add new USB IDs. Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.c Mon Mar 12 18:15:08 2012 (r232874) +++ stable/8/sys/dev/usb/quirk/usb_quirk.c Mon Mar 12 18:17:43 2012 (r232875) @@ -134,6 +134,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(QUALCOMM2, CDMA_MSM, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(CURITEL, UM150, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(CURITEL, UM175, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(VERTEX, VW110L, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), /* USB Mass Storage Class Quirks */ USB_QUIRK_VP(USB_VENDOR_ASAHIOPTICAL, 0, UQ_MSC_NO_RS_CLEAR_UA, Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Mon Mar 12 18:15:08 2012 (r232874) +++ stable/8/sys/dev/usb/serial/u3g.c Mon Mar 12 18:17:43 2012 (r232875) @@ -354,6 +354,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QISDA, H21_2, 0), U3G_DEV(QUALCOMM2, AC8700, 0), U3G_DEV(QUALCOMM2, MF330, 0), + U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, AC2726, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), U3G_DEV(QUALCOMMINC, AC8710, 0), @@ -422,6 +423,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMMINC, SURFSTICK, 0), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), + U3G_DEV(QUALCOMMINC, K3772_Z, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, MF633R, 0), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Mon Mar 12 18:15:08 2012 (r232874) +++ stable/8/sys/dev/usb/usbdevs Mon Mar 12 18:17:43 2012 (r232875) @@ -678,6 +678,7 @@ vendor QISDA 0x1da5 Qisda vendor METAGEEK2 0x1dd5 MetaGeek vendor ALINK 0x1e0e Alink vendor AIRTIES 0x1eda AirTies +vendor VERTEX 0x1fe7 Vertex Wireless Co., Ltd. vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications vendor HAUPPAUGE2 0x2040 Hauppauge Computer Works @@ -2666,6 +2667,7 @@ product QUALCOMM2 MF330 0x6613 MF330 product QUALCOMM2 RWT_FCT 0x3100 RWT FCT-CDMA 2000 1xRTT modem product QUALCOMM2 CDMA_MSM 0x3196 CDMA Technologies MSM modem product QUALCOMM2 AC8700 0x6000 AC8700 +product QUALCOMM2 VW110L 0x1000 Vertex Wireless 110L modem product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem @@ -2733,6 +2735,7 @@ product QUALCOMMINC E0078 0x0078 3G mode product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick +product QUALCOMMINC K3772_Z 0x1179 3G modem product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem @@ -3361,6 +3364,9 @@ product VIA USB2IDEBRIDGE 0x6204 USB 2.0 /* Vaisala products */ product VAISALA CABLE 0x0200 USB Interface cable +/* Vertex products */ +product VERTEX VW110L 0x0100 Vertex VW110L modem + /* VidzMedia products */ product VIDZMEDIA MONSTERTV 0x4fb1 MonsterTV P2H From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 18:22:04 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0C921065676; Mon, 12 Mar 2012 18:22:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 903CA8FC27; Mon, 12 Mar 2012 18:22:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CIM4d3078972; Mon, 12 Mar 2012 18:22:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CIM4Yo078968; Mon, 12 Mar 2012 18:22:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203121822.q2CIM4Yo078968@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 12 Mar 2012 18:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232876 - in stable/9/sys/dev/usb: . net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 18:22:04 -0000 Author: hselasky Date: Mon Mar 12 18:22:04 2012 New Revision: 232876 URL: http://svn.freebsd.org/changeset/base/232876 Log: MFC r232257: Add support for the MCS7832. Modified: stable/9/sys/dev/usb/net/if_mos.c stable/9/sys/dev/usb/net/if_mosreg.h stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/net/if_mos.c ============================================================================== --- stable/9/sys/dev/usb/net/if_mos.c Mon Mar 12 18:17:43 2012 (r232875) +++ stable/9/sys/dev/usb/net/if_mos.c Mon Mar 12 18:22:04 2012 (r232876) @@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$"); /* - * Moschip MCS7730/MCS7830 USB to Ethernet controller + * Moschip MCS7730/MCS7830/MCS7832 USB to Ethernet controller * The datasheet is available at the following URL: * http://www.moschip.com/data/products/MCS7830/Data%20Sheet_7830.pdf */ @@ -149,6 +149,7 @@ SYSCTL_INT(_hw_usb_mos, OID_AUTO, debug, static const STRUCT_USB_HOST_ID mos_devs[] = { {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7730, MCS7730)}, {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7830, MCS7830)}, + {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7832, MCS7832)}, {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_LN030, MCS7830)}, }; @@ -715,6 +716,8 @@ mos_attach(device_t dev) MOS_DPRINTFN("model: MCS7730"); } else if (sc->mos_flags & MCS7830) { MOS_DPRINTFN("model: MCS7830"); + } else if (sc->mos_flags & MCS7832) { + MOS_DPRINTFN("model: MCS7832"); } error = uether_ifattach(ue); if (error) { Modified: stable/9/sys/dev/usb/net/if_mosreg.h ============================================================================== --- stable/9/sys/dev/usb/net/if_mosreg.h Mon Mar 12 18:17:43 2012 (r232875) +++ stable/9/sys/dev/usb/net/if_mosreg.h Mon Mar 12 18:22:04 2012 (r232876) @@ -152,6 +152,7 @@ #define MCS7730 0x0001 #define MCS7830 0x0002 +#define MCS7832 0x0004 #define MOS_INC(x, y) (x) = (x + 1) % y Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Mon Mar 12 18:17:43 2012 (r232875) +++ stable/9/sys/dev/usb/usbdevs Mon Mar 12 18:22:04 2012 (r232876) @@ -2303,6 +2303,7 @@ product MOSCHIP MCS7703 0x7703 MCS7703 product MOSCHIP MCS7730 0x7730 MCS7730 Ethernet product MOSCHIP MCS7820 0x7820 MCS7820 Serial Port Adapter product MOSCHIP MCS7830 0x7830 MCS7830 Ethernet +product MOSCHIP MCS7832 0x7832 MCS7832 Ethernet product MOSCHIP MCS7840 0x7840 MCS7840 Serial Port Adapter /* Motorola products */ From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 18:38:40 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCF38106564A; Mon, 12 Mar 2012 18:38:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB2E28FC20; Mon, 12 Mar 2012 18:38:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CIce7Q079685; Mon, 12 Mar 2012 18:38:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CIceHY079682; Mon, 12 Mar 2012 18:38:40 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203121838.q2CIceHY079682@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 12 Mar 2012 18:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232877 - stable/9/sys/dev/sound/usb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 18:38:40 -0000 Author: hselasky Date: Mon Mar 12 18:38:40 2012 New Revision: 232877 URL: http://svn.freebsd.org/changeset/base/232877 Log: MFC r228485 and r227843: Stop USB audio transfers early so that any audio applications will time out and close opened /dev/dspX.Y device(s), if any. Modified: stable/9/sys/dev/sound/usb/uaudio.c stable/9/sys/dev/sound/usb/uaudio.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Mon Mar 12 18:22:04 2012 (r232876) +++ stable/9/sys/dev/sound/usb/uaudio.c Mon Mar 12 18:38:40 2012 (r232877) @@ -773,7 +773,17 @@ uaudio_detach(device_t dev) { struct uaudio_softc *sc = device_get_softc(dev); - if (bus_generic_detach(dev)) { + /* + * Stop USB transfers early so that any audio applications + * will time out and close opened /dev/dspX.Y device(s), if + * any. + */ + if (sc->sc_play_chan.valid) + usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS); + if (sc->sc_rec_chan.valid) + usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS); + + if (bus_generic_detach(dev) != 0) { DPRINTF("detach failed!\n"); } sbuf_delete(&sc->sc_sndstat); Modified: stable/9/sys/dev/sound/usb/uaudio.h ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.h Mon Mar 12 18:22:04 2012 (r232876) +++ stable/9/sys/dev/sound/usb/uaudio.h Mon Mar 12 18:38:40 2012 (r232877) @@ -27,6 +27,9 @@ /* prototypes from "uaudio.c" used by "uaudio_pcm.c" */ +#ifndef _UAUDIO_H_ +#define _UAUDIO_H_ + struct uaudio_chan; struct uaudio_softc; struct snd_dbuf; @@ -63,3 +66,5 @@ extern uint32_t uaudio_mixer_setrecsrc(s int uaudio_get_vendor(device_t dev); int uaudio_get_product(device_t dev); int uaudio_get_release(device_t dev); + +#endif /* _UAUDIO_H_ */ From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 18:41:42 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3579E106566C; Mon, 12 Mar 2012 18:41:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2426F8FC19; Mon, 12 Mar 2012 18:41:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CIff51079891; Mon, 12 Mar 2012 18:41:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CIffF2079888; Mon, 12 Mar 2012 18:41:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203121841.q2CIffF2079888@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 12 Mar 2012 18:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232878 - stable/8/sys/dev/sound/usb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 18:41:42 -0000 Author: hselasky Date: Mon Mar 12 18:41:41 2012 New Revision: 232878 URL: http://svn.freebsd.org/changeset/base/232878 Log: MFC r228485 and r228484: Stop USB audio transfers early so that any audio applications will time out and close opened /dev/dspX.Y device(s), if any. Modified: stable/8/sys/dev/sound/usb/uaudio.c stable/8/sys/dev/sound/usb/uaudio.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Mon Mar 12 18:38:40 2012 (r232877) +++ stable/8/sys/dev/sound/usb/uaudio.c Mon Mar 12 18:41:41 2012 (r232878) @@ -765,7 +765,17 @@ uaudio_detach(device_t dev) { struct uaudio_softc *sc = device_get_softc(dev); - if (bus_generic_detach(dev)) { + /* + * Stop USB transfers early so that any audio applications + * will time out and close opened /dev/dspX.Y device(s), if + * any. + */ + if (sc->sc_play_chan.valid) + usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS); + if (sc->sc_rec_chan.valid) + usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS); + + if (bus_generic_detach(dev) != 0) { DPRINTF("detach failed!\n"); } sbuf_delete(&sc->sc_sndstat); Modified: stable/8/sys/dev/sound/usb/uaudio.h ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.h Mon Mar 12 18:38:40 2012 (r232877) +++ stable/8/sys/dev/sound/usb/uaudio.h Mon Mar 12 18:41:41 2012 (r232878) @@ -27,6 +27,9 @@ /* prototypes from "uaudio.c" used by "uaudio_pcm.c" */ +#ifndef _UAUDIO_H_ +#define _UAUDIO_H_ + struct uaudio_chan; struct uaudio_softc; struct snd_dbuf; @@ -63,3 +66,5 @@ extern uint32_t uaudio_mixer_setrecsrc(s int uaudio_get_vendor(device_t dev); int uaudio_get_product(device_t dev); int uaudio_get_release(device_t dev); + +#endif /* _UAUDIO_H_ */ From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 18:44:31 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4CB64106566B; Mon, 12 Mar 2012 18:44:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21A688FC16; Mon, 12 Mar 2012 18:44:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CIiUa4080114; Mon, 12 Mar 2012 18:44:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CIiUDm080112; Mon, 12 Mar 2012 18:44:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203121844.q2CIiUDm080112@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 12 Mar 2012 18:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232879 - stable/8/sys/dev/sound/usb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 18:44:31 -0000 Author: hselasky Date: Mon Mar 12 18:44:30 2012 New Revision: 232879 URL: http://svn.freebsd.org/changeset/base/232879 Log: MFC r232039: Avoid creating PCM devices for MIDI only adapters. Modified: stable/8/sys/dev/sound/usb/uaudio.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Mon Mar 12 18:41:41 2012 (r232878) +++ stable/8/sys/dev/sound/usb/uaudio.c Mon Mar 12 18:44:30 2012 (r232879) @@ -626,21 +626,21 @@ uaudio_attach(device_t dev) sc->sc_mixer_count); if (sc->sc_play_chan.valid) { - device_printf(dev, "Play: %d Hz, %d ch, %s format\n", + device_printf(dev, "Play: %d Hz, %d ch, %s format.\n", sc->sc_play_chan.sample_rate, sc->sc_play_chan.p_asf1d->bNrChannels, sc->sc_play_chan.p_fmt->description); } else { - device_printf(dev, "No playback!\n"); + device_printf(dev, "No playback.\n"); } if (sc->sc_rec_chan.valid) { - device_printf(dev, "Record: %d Hz, %d ch, %s format\n", + device_printf(dev, "Record: %d Hz, %d ch, %s format.\n", sc->sc_rec_chan.sample_rate, sc->sc_rec_chan.p_asf1d->bNrChannels, sc->sc_rec_chan.p_fmt->description); } else { - device_printf(dev, "No recording!\n"); + device_printf(dev, "No recording.\n"); } if (sc->sc_midi_chan.valid) { @@ -648,9 +648,9 @@ uaudio_attach(device_t dev) if (umidi_probe(dev)) { goto detach; } - device_printf(dev, "MIDI sequencer\n"); + device_printf(dev, "MIDI sequencer.\n"); } else { - device_printf(dev, "No midi sequencer\n"); + device_printf(dev, "No midi sequencer.\n"); } DPRINTF("doing child attach\n"); @@ -659,13 +659,21 @@ uaudio_attach(device_t dev) sc->sc_sndcard_func.func = SCF_PCM; - child = device_add_child(dev, "pcm", -1); + /* + * Only attach a PCM device if we have a playback, recording + * or mixer device present: + */ + if (sc->sc_play_chan.valid || + sc->sc_rec_chan.valid || + sc->sc_mix_info) { + child = device_add_child(dev, "pcm", -1); - if (child == NULL) { - DPRINTF("out of memory\n"); - goto detach; + if (child == NULL) { + DPRINTF("out of memory\n"); + goto detach; + } + device_set_ivars(child, &sc->sc_sndcard_func); } - device_set_ivars(child, &sc->sc_sndcard_func); if (bus_generic_attach(dev)) { DPRINTF("child attach failed\n"); From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 18:48:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03C281065670; Mon, 12 Mar 2012 18:48:09 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id F32028FC0C; Mon, 12 Mar 2012 18:48:07 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 250862280; Mon, 12 Mar 2012 19:48:05 +0100 From: Hans Petter Selasky To: "src-committers@freebsd.org" Date: Mon, 12 Mar 2012 19:46:24 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.3-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <201203121838.q2CIceHY079682@svn.freebsd.org> In-Reply-To: <201203121838.q2CIceHY079682@svn.freebsd.org> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201203121946.24254.hselasky@c2i.net> Cc: "svn-src-stable@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable-9@freebsd.org" Subject: Re: svn commit: r232877 - stable/9/sys/dev/sound/usb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 18:48:09 -0000 On Monday 12 March 2012 19:38:40 Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Mar 12 18:38:40 2012 > New Revision: 232877 > URL: http://svn.freebsd.org/changeset/base/232877 > > Log: Minor typo: > MFC r228485 and r227843: ^^^^228484 --HPS From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 21:34:10 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A30B2106564A; Mon, 12 Mar 2012 21:34:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB2D8FC14; Mon, 12 Mar 2012 21:34:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CLYA05088107; Mon, 12 Mar 2012 21:34:10 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CLYAUX088105; Mon, 12 Mar 2012 21:34:10 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203122134.q2CLYAUX088105@svn.freebsd.org> From: Michael Tuexen Date: Mon, 12 Mar 2012 21:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232900 - stable/9/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 21:34:10 -0000 Author: tuexen Date: Mon Mar 12 21:34:10 2012 New Revision: 232900 URL: http://svn.freebsd.org/changeset/base/232900 Log: MFC r232723,r232726: Fix a bug reported by Peter Holm which results in a crash: Verify in sctp_peeloff() that the socket is a one-to-many style SCTP socket. Modified: stable/9/sys/netinet/sctp_peeloff.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/9/sys/netinet/sctp_peeloff.c Mon Mar 12 21:32:43 2012 (r232899) +++ stable/9/sys/netinet/sctp_peeloff.c Mon Mar 12 21:34:10 2012 (r232900) @@ -55,9 +55,18 @@ sctp_can_peel_off(struct socket *head, s struct sctp_tcb *stcb; uint32_t state; + if (head == NULL) { + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EBADF); + return (EBADF); + } + if ((head->so_proto->pr_protocol != IPPROTO_SCTP) || + (head->so_type != SOCK_SEQPACKET)) { + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); + return (EOPNOTSUPP); + } inp = (struct sctp_inpcb *)head->so_pcb; if (inp == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); return (EFAULT); } stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 21:52:32 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 768B5106566C; Mon, 12 Mar 2012 21:52:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 604718FC15; Mon, 12 Mar 2012 21:52:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CLqWkq088722; Mon, 12 Mar 2012 21:52:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CLqWJ9088720; Mon, 12 Mar 2012 21:52:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203122152.q2CLqWJ9088720@svn.freebsd.org> From: Michael Tuexen Date: Mon, 12 Mar 2012 21:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232902 - in stable/8/sys: i386/conf netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 21:52:32 -0000 Author: tuexen Date: Mon Mar 12 21:52:31 2012 New Revision: 232902 URL: http://svn.freebsd.org/changeset/base/232902 Log: MFC r232723,r232726: Fix a bug reported by Peter Holm which results in a crash: Verify in sctp_peeloff() that the socket is a one-to-many style SCTP socket. Modified: stable/8/sys/netinet/sctp_peeloff.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.c Mon Mar 12 21:41:29 2012 (r232901) +++ stable/8/sys/netinet/sctp_peeloff.c Mon Mar 12 21:52:31 2012 (r232902) @@ -55,9 +55,18 @@ sctp_can_peel_off(struct socket *head, s struct sctp_tcb *stcb; uint32_t state; + if (head == NULL) { + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EBADF); + return (EBADF); + } + if ((head->so_proto->pr_protocol != IPPROTO_SCTP) || + (head->so_type != SOCK_SEQPACKET)) { + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); + return (EOPNOTSUPP); + } inp = (struct sctp_inpcb *)head->so_pcb; if (inp == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); return (EFAULT); } stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 22:05:51 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BED7106566C; Mon, 12 Mar 2012 22:05:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26BDB8FC1C; Mon, 12 Mar 2012 22:05:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CM5pnj089216; Mon, 12 Mar 2012 22:05:51 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CM5o9n089214; Mon, 12 Mar 2012 22:05:50 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201203122205.q2CM5o9n089214@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 12 Mar 2012 22:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232903 - stable/9/tools/test/netfibs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 22:05:51 -0000 Author: bz Date: Mon Mar 12 22:05:50 2012 New Revision: 232903 URL: http://svn.freebsd.org/changeset/base/232903 Log: MFC r232609: Use = rather than == for expressions to test(1) builtin(1) in sh(1) to comply with standards. On modern branches there is an undocumented alias (see r219084) but on stable/7 this is still an error. Sponsored by: Cisco Systems, Inc. Modified: stable/9/tools/test/netfibs/initiator.sh Directory Properties: stable/9/tools/test/ (props changed) Modified: stable/9/tools/test/netfibs/initiator.sh ============================================================================== --- stable/9/tools/test/netfibs/initiator.sh Mon Mar 12 21:52:31 2012 (r232902) +++ stable/9/tools/test/netfibs/initiator.sh Mon Mar 12 22:05:50 2012 (r232903) @@ -410,7 +410,7 @@ testtx_ulp6_connected() *) _f="SETFIB" ;; esac - if test "${_o}" == "-i" -a "${_f}" == "SO_SETFIB"; then + if test "${_o}" = "-i" -a "${_f}" = "SO_SETFIB"; then print_debug "Skipping icmp6 tests for SO_SETFIB." return 0 fi From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 22:08:04 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E8E7106564A; Mon, 12 Mar 2012 22:08:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FE748FC14; Mon, 12 Mar 2012 22:08:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CM83Ie089352; Mon, 12 Mar 2012 22:08:03 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CM8351089350; Mon, 12 Mar 2012 22:08:03 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201203122208.q2CM8351089350@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 12 Mar 2012 22:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232904 - stable/9/etc/rc.d X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 22:08:04 -0000 Author: bz Date: Mon Mar 12 22:08:03 2012 New Revision: 232904 URL: http://svn.freebsd.org/changeset/base/232904 Log: MFC r232515: Rather than printing the output from route add for all FIBs just print them for the default FIB followed by a statement with a list of FIB numbers for all the other FIBs we install the routes for. Request by: kib (to make it less noisy) Tested by: kib Modified: stable/9/etc/rc.d/routing Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/routing ============================================================================== --- stable/9/etc/rc.d/routing Mon Mar 12 22:05:50 2012 (r232903) +++ stable/9/etc/rc.d/routing Mon Mar 12 22:08:03 2012 (r232904) @@ -145,14 +145,21 @@ static_inet6() : ${fibs:=1} # disallow "internal" addresses to appear on the wire - i=0 - while test ${i} -lt ${fibs}; do - setfib -F ${i} route ${_action} \ - -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject - setfib -F ${i} route ${_action} \ - -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject - i=$((i + 1)) - done + route ${_action} -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject + route ${_action} -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + i=1 + if test ${i} -lt ${fibs}; then + printf "Also installing reject routes for FIBs" + while test ${i} -lt ${fibs}; do + setfib -F ${i} route -q ${_action} \ + -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject + setfib -F ${i} route -q ${_action} \ + -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + printf " %d" ${i} + i=$((i + 1)) + done + printf "\n" + fi case ${ipv6_defaultrouter} in [Nn][Oo] | '') @@ -224,14 +231,21 @@ static_inet6() # for the host case, you will allow to omit the identifiers. # Under this configuration, the packets will go to the default # interface. - i=0 - while test ${i} -lt ${fibs}; do - setfib -F ${i} route ${_action} \ - -inet6 fe80:: -prefixlen 10 ::1 -reject - setfib -F ${i} route ${_action} \ - -inet6 ff02:: -prefixlen 16 ::1 -reject - i=$((i + 1)) - done + route ${_action} -inet6 fe80:: -prefixlen 10 ::1 -reject + route ${_action} -inet6 ff02:: -prefixlen 16 ::1 -reject + i=1 + if test ${i} -lt ${fibs}; then + printf "Also installing reject routes for FIBs" + while test ${i} -lt ${fibs}; do + setfib -F ${i} route -q ${_action} \ + -inet6 fe80:: -prefixlen 10 ::1 -reject + setfib -F ${i} route -q ${_action} \ + -inet6 ff02:: -prefixlen 16 ::1 -reject + printf " %d" ${i} + i=$((i + 1)) + done + printf "\n" + fi case ${ipv6_default_interface} in '') From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 22:10:59 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BE111065670; Mon, 12 Mar 2012 22:10:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2D178FC1B; Mon, 12 Mar 2012 22:10:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CMAwNN089508; Mon, 12 Mar 2012 22:10:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CMAw44089506; Mon, 12 Mar 2012 22:10:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201203122210.q2CMAw44089506@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 12 Mar 2012 22:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232905 - stable/8/tools/test/netfibs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 22:10:59 -0000 Author: bz Date: Mon Mar 12 22:10:58 2012 New Revision: 232905 URL: http://svn.freebsd.org/changeset/base/232905 Log: MFC r232609: Use = rather than == for expressions to test(1) builtin(1) in sh(1) to comply with standards. On modern branches there is an undocumented alias (see r219084) but on stable/7 this is still an error. Sponsored by: Cisco Systems, Inc. Modified: stable/8/tools/test/netfibs/initiator.sh Directory Properties: stable/8/tools/test/ (props changed) Modified: stable/8/tools/test/netfibs/initiator.sh ============================================================================== --- stable/8/tools/test/netfibs/initiator.sh Mon Mar 12 22:08:03 2012 (r232904) +++ stable/8/tools/test/netfibs/initiator.sh Mon Mar 12 22:10:58 2012 (r232905) @@ -410,7 +410,7 @@ testtx_ulp6_connected() *) _f="SETFIB" ;; esac - if test "${_o}" == "-i" -a "${_f}" == "SO_SETFIB"; then + if test "${_o}" = "-i" -a "${_f}" = "SO_SETFIB"; then print_debug "Skipping icmp6 tests for SO_SETFIB." return 0 fi From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 22:13:18 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A2131065673; Mon, 12 Mar 2012 22:13:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B2F08FC17; Mon, 12 Mar 2012 22:13:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CMDIFm089645; Mon, 12 Mar 2012 22:13:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CMDImG089642; Mon, 12 Mar 2012 22:13:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201203122213.q2CMDImG089642@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 12 Mar 2012 22:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232906 - in stable/8/etc: . rc.d X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 22:13:18 -0000 Author: bz Date: Mon Mar 12 22:13:17 2012 New Revision: 232906 URL: http://svn.freebsd.org/changeset/base/232906 Log: MFC r232515: Rather than printing the output from route add for all FIBs just print them for the default FIB followed by a statement with a list of FIB numbers for all the other FIBs we install the routes for. Modified: stable/8/etc/network.subr stable/8/etc/rc.d/routing Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/network.subr ============================================================================== --- stable/8/etc/network.subr Mon Mar 12 22:10:58 2012 (r232905) +++ stable/8/etc/network.subr Mon Mar 12 22:13:17 2012 (r232906) @@ -1134,12 +1134,18 @@ network6_default_interface_setup() route add -inet6 fe80:: -prefixlen 10 ::1 -reject case ${ipv6_default_interface} in [Nn][Oo] | '') - i=0 - while test ${i} -lt ${fibs}; do - setfib -F ${i} \ - route add -inet6 ff02:: -prefixlen 16 ::1 -reject - i=$((i + 1)) - done + route add -inet6 ff02:: -prefixlen 16 ::1 -reject + i=1 + if test ${i} -lt ${fibs}; then + printf "Also installing reject routes for FIBs" + while test ${i} -lt ${fibs}; do + setfib -F ${i} route add -inet6 \ + ff02:: -prefixlen 16 ::1 -reject + printf " %d" ${i} + i=$((i + 1)) + done + printf "\n" + fi ;; *) laddr=`network6_getladdr ${ipv6_default_interface}` @@ -1147,11 +1153,16 @@ network6_default_interface_setup() # route to all others. route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface i=1 - while test ${i} -lt ${fibs}; do - setfib -F ${i} \ - route add -inet6 ff02:: -prefixlen 16 ::1 -reject - i=$((i + 1)) - done + if test ${i} -lt ${fibs}; then + printf "Also installing reject routes for FIBs" + while test ${i} -lt ${fibs}; do + setfib -F ${i} route add -inet6 \ + ff02:: -prefixlen 16 ::1 -reject + printf " %d" ${i} + i=$((i + 1)) + done + printf "\n" + fi # Disable installing the default interface with the # case net.inet6.ip6.forwarding=0 and Modified: stable/8/etc/rc.d/routing ============================================================================== --- stable/8/etc/rc.d/routing Mon Mar 12 22:10:58 2012 (r232905) +++ stable/8/etc/rc.d/routing Mon Mar 12 22:13:17 2012 (r232906) @@ -68,14 +68,21 @@ static_start() : ${fibs:=1} # disallow "internal" addresses to appear on the wire - i=0 - while test ${i} -lt ${fibs}; do - setfib -F ${i} route add -inet6 \ - ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject - setfib -F ${i} route add -inet6 \ - ::0.0.0.0 -prefixlen 96 ::1 -reject - i=$((i + 1)) - done + route add -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject + route add -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + i=1 + if test ${i} -lt ${fibs}; then + printf "Also installing reject routes for FIBs" + while test ${i} -lt ${fibs}; do + setfib -F ${i} route -q add -inet6 \ + ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject + setfib -F ${i} route -q add -inet6 \ + ::0.0.0.0 -prefixlen 96 ::1 -reject + printf " %d" ${i} + i=$((i + 1)) + done + printf "\n" + fi fi } From owner-svn-src-stable@FreeBSD.ORG Tue Mar 13 18:39:58 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 078241065676; Tue, 13 Mar 2012 18:39:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6FD58FC08; Tue, 13 Mar 2012 18:39:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2DIdvvs057182; Tue, 13 Mar 2012 18:39:57 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2DIdvLm057155; Tue, 13 Mar 2012 18:39:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203131839.q2DIdvLm057155@svn.freebsd.org> From: Dimitry Andric Date: Tue, 13 Mar 2012 18:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232930 - in stable/9: lib/libsm lib/libthread_db lib/libz libexec/mail.local libexec/smrsh sbin/fsdb share/mk sys/boot/i386/boot0 sys/boot/i386/boot2 sys/boot/i386/btx/btx sys/boot/i38... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2012 18:39:58 -0000 Author: dim Date: Tue Mar 13 18:39:57 2012 New Revision: 232930 URL: http://svn.freebsd.org/changeset/base/232930 Log: MFC r232263: Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to get rid of testing explicitly for clang (using ${CC:T:Mclang}) in individual Makefiles. Instead, use the following extra macros, for use with clang: - NO_WERROR.clang (disables -Werror) - NO_WCAST_ALIGN.clang (disables -Wcast-align) - NO_WFORMAT.clang (disables -Wformat and friends) - CLANG_NO_IAS (disables integrated assembler) - CLANG_OPT_SMALL (adds flags for extra small size optimizations) As a side effect, this enables setting CC/CXX/CPP in src.conf instead of make.conf! For clang, use the following: CC=clang CXX=clang++ CPP=clang-cpp Modified: stable/9/lib/libsm/Makefile stable/9/lib/libthread_db/Makefile stable/9/lib/libz/Makefile stable/9/libexec/mail.local/Makefile stable/9/libexec/smrsh/Makefile stable/9/sbin/fsdb/Makefile stable/9/share/mk/bsd.sys.mk stable/9/sys/boot/i386/boot0/Makefile stable/9/sys/boot/i386/boot2/Makefile stable/9/sys/boot/i386/btx/btx/Makefile stable/9/sys/boot/i386/btx/btxldr/Makefile stable/9/sys/boot/i386/gptboot/Makefile stable/9/sys/boot/i386/gptzfsboot/Makefile stable/9/sys/boot/i386/libi386/Makefile stable/9/sys/boot/i386/pxeldr/Makefile stable/9/sys/boot/i386/zfsboot/Makefile stable/9/sys/boot/pc98/btx/btx/Makefile stable/9/sys/boot/pc98/btx/btxldr/Makefile stable/9/sys/conf/Makefile.amd64 stable/9/sys/conf/Makefile.i386 stable/9/sys/conf/kern.pre.mk stable/9/sys/modules/bios/smapi/Makefile stable/9/sys/modules/linux/Makefile stable/9/usr.bin/netstat/Makefile stable/9/usr.bin/vacation/Makefile stable/9/usr.sbin/sendmail/Makefile Directory Properties: stable/9/lib/libsm/ (props changed) stable/9/lib/libthread_db/ (props changed) stable/9/lib/libz/ (props changed) stable/9/libexec/mail.local/ (props changed) stable/9/libexec/smrsh/ (props changed) stable/9/sbin/fsdb/ (props changed) stable/9/share/mk/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/conf/ (props changed) stable/9/usr.bin/netstat/ (props changed) stable/9/usr.bin/vacation/ (props changed) stable/9/usr.sbin/sendmail/ (props changed) Modified: stable/9/lib/libsm/Makefile ============================================================================== --- stable/9/lib/libsm/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/lib/libsm/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -18,12 +18,10 @@ CFLAGS+=${SENDMAIL_CFLAGS} WARNS?= 2 -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives warnings about sendmail code that cannot # be turned off yet. Since this is contrib code, and we don't really # care about the warnings, just make them non-fatal for now. -NO_WERROR= -.endif +NO_WERROR.clang= LIB= sm Modified: stable/9/lib/libthread_db/Makefile ============================================================================== --- stable/9/lib/libthread_db/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/lib/libthread_db/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -16,10 +16,8 @@ SYM_MAPS+=${.CURDIR}/Symbol.map SYMBOL_MAPS=${SYM_MAPS} VERSION_DEF=${.CURDIR}/../libc/Versions.def -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives an incorrect warning about alignment in # arch/i386/libpthread_md.c, so turn that off for now. -NO_WCAST_ALIGN= -.endif +NO_WCAST_ALIGN.clang= .include Modified: stable/9/lib/libz/Makefile ============================================================================== --- stable/9/lib/libz/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/lib/libz/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -47,10 +47,6 @@ ACFLAGS+= -Wa,--noexecstack #SRCS+= gvmat64.S #CFLAGS+= -DASMV -DNO_UNDERLINE #ACFLAGS+= -Wa,--noexecstack -#.if ${CC:T:Mclang} == "clang" -## XXX: clang integrated-as doesn't grok .intel_syntax directives yet -#ACFLAGS+= ${.IMPSRC:T:Mgvmat64.S:C/^.+$/-no-integrated-as/} -#.endif #.endif VERSION_DEF= ${.CURDIR}/Versions.def @@ -71,3 +67,7 @@ test: example minigzip echo hello world | ./minigzip | ./minigzip -d ) .include + +## XXX: clang integrated-as doesn't grok .intel_syntax directives yet +#ACFLAGS.gvmat64.S= ${CLANG_NO_IAS} +#ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} Modified: stable/9/libexec/mail.local/Makefile ============================================================================== --- stable/9/libexec/mail.local/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/libexec/mail.local/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -12,12 +12,10 @@ CFLAGS+=-I${SENDMAIL_DIR}/include -I. WARNS?= 2 WFORMAT=0 -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives warnings about sendmail code that cannot # be turned off yet. Since this is contrib code, and we don't really # care about the warnings, just make them non-fatal for now. -NO_WERROR= -.endif +NO_WERROR.clang= LIBSMDIR= ${.OBJDIR}/../../lib/libsm LIBSM= ${LIBSMDIR}/libsm.a Modified: stable/9/libexec/smrsh/Makefile ============================================================================== --- stable/9/libexec/smrsh/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/libexec/smrsh/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -17,12 +17,10 @@ LDADD= ${LIBSM} WARNS?= 2 -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives warnings about sendmail code that cannot # be turned off yet. Since this is contrib code, and we don't really # care about the warnings, just make them non-fatal for now. -NO_WERROR= -.endif +NO_WERROR.clang= SRCS+= sm_os.h CLEANFILES+=sm_os.h Modified: stable/9/sbin/fsdb/Makefile ============================================================================== --- stable/9/sbin/fsdb/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sbin/fsdb/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -9,10 +9,8 @@ SRCS= fsdb.c fsdbutil.c \ pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c CFLAGS+= -I${.CURDIR}/../fsck_ffs WARNS?= 2 -.if ${CC:T:Mclang} == "clang" # Work around a problem with format string warnings and ntohs macros. -NO_WFORMAT= -.endif +NO_WFORMAT.clang= LDADD= -ledit -ltermcap DPADD= ${LIBEDIT} ${LIBTERMCAP} .PATH: ${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs Modified: stable/9/share/mk/bsd.sys.mk ============================================================================== --- stable/9/share/mk/bsd.sys.mk Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/share/mk/bsd.sys.mk Tue Mar 13 18:39:57 2012 (r232930) @@ -28,7 +28,7 @@ CFLAGS += -std=${CSTD} . if defined(WARNS) . if ${WARNS} >= 1 CWARNFLAGS += -Wsystem-headers -. if !defined(NO_WERROR) +. if !defined(NO_WERROR) && (${CC:T:Mclang} != "clang" || !defined(NO_WERROR.clang)) CWARNFLAGS += -Werror . endif . endif @@ -42,7 +42,7 @@ CWARNFLAGS += -W -Wno-unused-parameter - . if ${WARNS} >= 4 CWARNFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch\ -Wshadow -Wunused-parameter -. if !defined(NO_WCAST_ALIGN) +. if !defined(NO_WCAST_ALIGN) && (${CC:T:Mclang} != "clang" || !defined(NO_WCAST_ALIGN.clang)) CWARNFLAGS += -Wcast-align . endif . endif @@ -84,12 +84,12 @@ WFORMAT = 1 . if ${WFORMAT} > 0 #CWARNFLAGS += -Wformat-nonliteral -Wformat-security -Wno-format-extra-args CWARNFLAGS += -Wformat=2 -Wno-format-extra-args -. if !defined(NO_WERROR) +. if !defined(NO_WERROR) && (${CC:T:Mclang} != "clang" || !defined(NO_WERROR.clang)) CWARNFLAGS += -Werror . endif . endif . endif -. if defined(NO_WFORMAT) +. if defined(NO_WFORMAT) || (${CC:T:Mclang} == "clang" && defined(NO_WFORMAT.clang)) CWARNFLAGS += -Wno-format . endif .endif @@ -98,6 +98,12 @@ CWARNFLAGS += -Wno-format CWARNFLAGS += -Wno-unknown-pragmas .endif +.if ${CC:T:Mclang} == "clang" +CLANG_NO_IAS = -no-integrated-as +CLANG_OPT_SMALL = -mllvm -stack-alignment=8 -mllvm -inline-threshold=3 \ + -mllvm -enable-load-pre=false +.endif + .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" # Don't use -Wstack-protector as it breaks world with -Werror. Modified: stable/9/sys/boot/i386/boot0/Makefile ============================================================================== --- stable/9/sys/boot/i386/boot0/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/boot/i386/boot0/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -19,12 +19,6 @@ SRCS= ${PROG}.S OPTS ?= -DVOLUME_SERIAL -DPXE CFLAGS += ${OPTS} -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mboot0.S:C/^.+$/-no-integrated-as/} -CFLAGS+= ${.IMPSRC:T:Mboot0ext.S:C/^.+$/-no-integrated-as/} -.endif - # Flags used in the boot0.S code: # 0x0f all valid partitions enabled. # 0x80 'packet', use BIOS EDD (LBA) extensions instead of CHS @@ -83,3 +77,8 @@ CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \ LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.boot0.S= ${CLANG_NO_IAS} +CFLAGS.boot0ext.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/boot/i386/boot2/Makefile ============================================================================== --- stable/9/sys/boot/i386/boot2/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/boot/i386/boot2/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -40,14 +40,8 @@ CFLAGS= -Os \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline --param max-inline-insns-single=100 - -.if ${CC:T:Mclang} == "clang" -CFLAGS+= -mllvm -stack-alignment=8 -mllvm -inline-threshold=3 \ - -mllvm -enable-load-pre=false -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mboot1.S:C/^.+$/-no-integrated-as/} -.endif + -Winline --param max-inline-insns-single=100 \ + ${CLANG_OPT_SMALL} LDFLAGS=-static -N --gc-sections @@ -89,9 +83,7 @@ boot2.out: ${BTXCRT} boot2.o sio.o ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} boot2.o: boot2.s -.if ${CC:T:Mclang} == "clang" ${CC} ${ACFLAGS} -c boot2.s -.endif SRCS= boot2.c boot2.h @@ -115,3 +107,7 @@ machine: .endif .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.boot1.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/boot/i386/btx/btx/Makefile ============================================================================== --- stable/9/sys/boot/i386/btx/btx/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/boot/i386/btx/btx/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -13,11 +13,6 @@ BOOT_BTX_FLAGS=0x0 CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS} -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+=${.IMPSRC:T:Mbtx.S:C/^.+$/-no-integrated-as/} -.endif - .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x3f8 BOOT_COMCONSOLE_SPEED?= 9600 @@ -32,3 +27,7 @@ ORG= 0x9000 LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.btx.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- stable/9/sys/boot/i386/btx/btxldr/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/boot/i386/btx/btxldr/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -11,11 +11,10 @@ CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRES CFLAGS+=-DBTXLDR_VERBOSE .endif -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+=${.IMPSRC:T:Mbtxldr.S:C/^.+$/-no-integrated-as/} -.endif - LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.btxldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/boot/i386/gptboot/Makefile ============================================================================== --- stable/9/sys/boot/i386/gptboot/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/boot/i386/gptboot/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -36,11 +36,6 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline --param max-inline-insns-single=100 -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mgptldr.S:C/^.+$/-no-integrated-as/} -.endif - LDFLAGS=-static -N --gc-sections # Pick up ../Makefile.inc early. @@ -79,3 +74,7 @@ machine: .endif .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.gptldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- stable/9/sys/boot/i386/gptzfsboot/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/boot/i386/gptzfsboot/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -34,11 +34,6 @@ CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline --param max-inline-insns-single=100 -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mgptldr.S:C/^.+$/-no-integrated-as/} -.endif - LDFLAGS=-static -N --gc-sections # Pick up ../Makefile.inc early. @@ -77,3 +72,7 @@ machine: .endif .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.gptldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/boot/i386/libi386/Makefile ============================================================================== --- stable/9/sys/boot/i386/libi386/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/boot/i386/libi386/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -54,11 +54,6 @@ CFLAGS+= -I${.CURDIR}/../../common -I${. # the location of libstand CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mamd64_tramp.S:C/^.+$/-no-integrated-as/} -.endif - .if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: @@ -67,6 +62,10 @@ machine: .include +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.amd64_tramp.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} + .if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine .endif Modified: stable/9/sys/boot/i386/pxeldr/Makefile ============================================================================== --- stable/9/sys/boot/i386/pxeldr/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/boot/i386/pxeldr/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -23,11 +23,6 @@ CFLAGS+=-DPROBE_KEYBOARD CFLAGS+=-DALWAYS_SERIAL .endif -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+=${.IMPSRC:T:Mpxeldr.S:C/^.+$/-no-integrated-as/} -.endif - LOADERBIN= ${.OBJDIR}/../loader/loader.bin CLEANFILES+= ${BOOT}.tmp @@ -46,3 +41,7 @@ ${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXK -b ${BTXKERN} ${LOADERBIN} .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.pxeldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/boot/i386/zfsboot/Makefile ============================================================================== --- stable/9/sys/boot/i386/zfsboot/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/boot/i386/zfsboot/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -31,11 +31,6 @@ CFLAGS= -DBOOTPROG=\"zfsboot\" \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline --param max-inline-insns-single=100 -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mzfsldr.S:C/^.+$/-no-integrated-as/} -.endif - LDFLAGS=-static -N --gc-sections # Pick up ../Makefile.inc early. @@ -90,3 +85,7 @@ machine: .endif .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.zfsldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/boot/pc98/btx/btx/Makefile ============================================================================== --- stable/9/sys/boot/pc98/btx/btx/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/boot/pc98/btx/btx/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -13,11 +13,6 @@ BOOT_BTX_FLAGS=0x0 CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS} -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+=${.IMPSRC:T:Mbtx.S:C/^.+$/-no-integrated-as/} -.endif - .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x238 BOOT_COMCONSOLE_SPEED?= 9600 @@ -32,3 +27,7 @@ ORG= 0x9000 LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.btx.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/boot/pc98/btx/btxldr/Makefile ============================================================================== --- stable/9/sys/boot/pc98/btx/btxldr/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/boot/pc98/btx/btxldr/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -11,11 +11,10 @@ CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRES CFLAGS+=-DBTXLDR_VERBOSE .endif -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+=${.IMPSRC:T:Mbtxldr.S:C/^.+$/-no-integrated-as/} -.endif - LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.btxldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/conf/Makefile.amd64 ============================================================================== --- stable/9/sys/conf/Makefile.amd64 Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/conf/Makefile.amd64 Tue Mar 13 18:39:57 2012 (r232930) @@ -40,13 +40,12 @@ CFLAGS+= -fno-omit-frame-pointer MKMODULESENV+= MACHINE=amd64 -.if ${CC:T:Mclang} == "clang" # XXX: clang integrated-as doesn't grok .codeNN directives yet -ASM_CFLAGS+= ${.IMPSRC:T:Macpi_wakecode.S:C/^.+$/-no-integrated-as/} -ASM_CFLAGS+= ${.IMPSRC:T:Mia32_sigtramp.S:C/^.+$/-no-integrated-as/} -ASM_CFLAGS+= ${.IMPSRC:T:Mlinux32_locore.s:C/^.+$/-no-integrated-as/} -ASM_CFLAGS+= ${.IMPSRC:T:Mmpboot.S:C/^.+$/-no-integrated-as/} -.endif +ASM_CFLAGS.acpi_wakecode.S= ${CLANG_NO_IAS} +ASM_CFLAGS.ia32_sigtramp.S= ${CLANG_NO_IAS} +ASM_CFLAGS.linux32_locore.s= ${CLANG_NO_IAS} +ASM_CFLAGS.mpboot.S= ${CLANG_NO_IAS} +ASM_CFLAGS+= ${ASM_CFLAGS.${.IMPSRC:T}} %BEFORE_DEPEND Modified: stable/9/sys/conf/Makefile.i386 ============================================================================== --- stable/9/sys/conf/Makefile.i386 Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/conf/Makefile.i386 Tue Mar 13 18:39:57 2012 (r232930) @@ -34,11 +34,10 @@ MACHINE=i386 MKMODULESENV+= MACHINE=${MACHINE} -.if ${CC:T:Mclang} == "clang" # XXX: clang integrated-as doesn't grok .codeNN directives yet -ASM_CFLAGS+= ${.IMPSRC:T:Macpi_wakecode.S:C/^.+$/-no-integrated-as/} -ASM_CFLAGS+= ${.IMPSRC:T:Mmpboot.s:C/^.+$/-no-integrated-as/} -.endif +ASM_CFLAGS.acpi_wakecode.S= ${CLANG_NO_IAS} +ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS} +ASM_CFLAGS+= ${ASM_CFLAGS.${.IMPSRC:T}} %BEFORE_DEPEND Modified: stable/9/sys/conf/kern.pre.mk ============================================================================== --- stable/9/sys/conf/kern.pre.mk Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/conf/kern.pre.mk Tue Mar 13 18:39:57 2012 (r232930) @@ -101,6 +101,10 @@ WERROR?= -Werror # XXX LOCORE means "don't declare C stuff" not "for locore.s". ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} +.if ${CC:T:Mclang} == "clang" +CLANG_NO_IAS= -no-integrated-as +.endif + .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 CFLAGS+= -DGPROF -falign-functions=16 .if ${PROFLEVEL} >= 2 Modified: stable/9/sys/modules/bios/smapi/Makefile ============================================================================== --- stable/9/sys/modules/bios/smapi/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/modules/bios/smapi/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -7,9 +7,9 @@ KMOD= smapi SRCS= smapi.c smapi_bios.S \ bus_if.h device_if.h WERROR= -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok 16-bit assembly yet -CFLAGS+= ${.IMPSRC:T:Msmapi_bios.S:C/^.+$/-no-integrated-as/} -.endif .include + +# XXX: clang integrated-as doesn't grok 16-bit assembly yet +CFLAGS.smapi_bios.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/modules/linux/Makefile ============================================================================== --- stable/9/sys/modules/linux/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/sys/modules/linux/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -5,11 +5,6 @@ SFX= 32 CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 .endif -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mlinux32_locore.s:C/^.+$/-no-integrated-as/} -.endif - .PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX} KMOD= linux @@ -69,3 +64,7 @@ CFLAGS+= -DKTR .endif .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.linux32_locore.s= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: stable/9/usr.bin/netstat/Makefile ============================================================================== --- stable/9/usr.bin/netstat/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/usr.bin/netstat/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -8,11 +8,9 @@ SRCS= if.c inet.c main.c mbuf.c mroute.c unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c WARNS?= 3 -.if ${CC:T:Mclang} == "clang" # XXX: Work around a clang false positive with format string warnings # and ntohs macros (see LLVM PR 11313). -NO_WFORMAT= -.endif +NO_WFORMAT.clang= CFLAGS+=-fno-strict-aliasing CFLAGS+=-DIPSEC Modified: stable/9/usr.bin/vacation/Makefile ============================================================================== --- stable/9/usr.bin/vacation/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/usr.bin/vacation/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -11,12 +11,10 @@ CFLAGS+=-D_FFR_LISTDB -D_FFR_DEBUG WARNS?= 2 -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives warnings about sendmail code that cannot # be turned off yet. Since this is contrib code, and we don't really # care about the warnings, just make them non-fatal for now. -NO_WERROR= -.endif +NO_WERROR.clang= LIBSMDIR= ${.OBJDIR}/../../lib/libsm LIBSM= ${LIBSMDIR}/libsm.a Modified: stable/9/usr.sbin/sendmail/Makefile ============================================================================== --- stable/9/usr.sbin/sendmail/Makefile Tue Mar 13 17:32:55 2012 (r232929) +++ stable/9/usr.sbin/sendmail/Makefile Tue Mar 13 18:39:57 2012 (r232930) @@ -45,12 +45,10 @@ CFLAGS+= -DNETINET6 WARNS?= 1 -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives warnings about sendmail code that cannot # be turned off yet. Since this is contrib code, and we don't really # care about the warnings, just make them non-fatal for now. -NO_WERROR= -.endif +NO_WERROR.clang= DPADD= ${LIBUTIL} ${LIBWRAP} LDADD= -lutil -lwrap From owner-svn-src-stable@FreeBSD.ORG Tue Mar 13 20:33:16 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 766231065674; Tue, 13 Mar 2012 20:33:16 +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 649A68FC12; Tue, 13 Mar 2012 20:33:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2DKXGBd061637; Tue, 13 Mar 2012 20:33:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2DKXGtm061634; Tue, 13 Mar 2012 20:33:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203132033.q2DKXGtm061634@svn.freebsd.org> From: Alexander Motin Date: Tue, 13 Mar 2012 20:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232941 - stable/9/sys/cam/scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2012 20:33:16 -0000 Author: mav Date: Tue Mar 13 20:33:15 2012 New Revision: 232941 URL: http://svn.freebsd.org/changeset/base/232941 Log: MFC r228846: Use READ CAPACITY(16) to get information about device physical sectors. As soon as not all devices support READ CAPACITY(16), automatically fall back to READ CAPACITY(10) if CAM_REQ_INVALID or SSD_KEY_ILLEGAL_REQUEST status returned. It also provides first bits of information about Logical Block Provisioning (aka UNMAP/TRIM) support by the device. Modified: stable/9/sys/cam/scsi/scsi_all.h stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.h Tue Mar 13 20:30:23 2012 (r232940) +++ stable/9/sys/cam/scsi/scsi_all.h Tue Mar 13 20:33:15 2012 (r232941) @@ -1397,6 +1397,17 @@ struct scsi_read_capacity_data_long { uint8_t addr[8]; uint8_t length[4]; +#define SRC16_PROT_EN 0x01 +#define SRC16_P_TYPE 0x0e + uint8_t prot; +#define SRC16_LBPPBE 0x0f +#define SRC16_PI_EXPONENT 0xf0 +#define SRC16_PI_EXPONENT_SHIFT 4 + uint8_t prot_lbppbe; +#define SRC16_LALBA 0x3fff +#define SRC16_LBPRZ 0x4000 +#define SRC16_LBPME 0x8000 + uint8_t lalba_lbp[2]; }; struct scsi_report_luns Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Tue Mar 13 20:30:23 2012 (r232940) +++ stable/9/sys/cam/scsi/scsi_da.c Tue Mar 13 20:33:15 2012 (r232941) @@ -82,7 +82,9 @@ typedef enum { DA_FLAG_WENT_IDLE = 0x040, DA_FLAG_RETRY_UA = 0x080, DA_FLAG_OPEN = 0x100, - DA_FLAG_SCTX_INIT = 0x200 + DA_FLAG_SCTX_INIT = 0x200, + DA_FLAG_CAN_RC16 = 0x400, + DA_FLAG_CAN_LBPME = 0x800 } da_flags; typedef enum { @@ -1544,6 +1546,14 @@ daregister(struct cam_periph *periph, vo else if (softc->minimum_cmd_size > 12) softc->minimum_cmd_size = 16; + /* Predict whether device may support READ CAPACITY(16). */ + if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 || + (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC && + (cgd->inq_data.spc3_flags & SPC3_SID_PROTECT))) { + softc->flags |= DA_FLAG_CAN_RC16; + softc->state = DA_STATE_PROBE2; + } + /* * Register this media as a disk. */ @@ -1940,10 +1950,14 @@ dadone(struct cam_periph *periph, union struct disk_params *dp; uint32_t block_size; uint64_t maxsector; + u_int lbppbe; /* LB per physical block exponent. */ + u_int lalba; /* Lowest aligned LBA. */ if (softc->state == DA_STATE_PROBE) { block_size = scsi_4btoul(rdcap->length); maxsector = scsi_4btoul(rdcap->addr); + lbppbe = 0; + lalba = 0; /* * According to SBC-2, if the standard 10 @@ -1963,6 +1977,8 @@ dadone(struct cam_periph *periph, union } else { block_size = scsi_4btoul(rcaplong->length); maxsector = scsi_8btou64(rcaplong->addr); + lbppbe = rcaplong->prot_lbppbe & SRC16_LBPPBE; + lalba = scsi_2btoul(rcaplong->lalba_lbp); } /* @@ -1980,7 +1996,12 @@ dadone(struct cam_periph *periph, union announce_buf[0] = '\0'; cam_periph_invalidate(periph); } else { - dasetgeom(periph, block_size, maxsector, 0, 0); + dasetgeom(periph, block_size, maxsector, + lbppbe, lalba & SRC16_LALBA); + if (lalba & SRC16_LBPME) + softc->flags |= DA_FLAG_CAN_LBPME; + else + softc->flags &= ~DA_FLAG_CAN_LBPME; dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " @@ -2047,6 +2068,24 @@ dadone(struct cam_periph *periph, union &ascq, /*show_errors*/ 1); } /* + * If we tried READ CAPACITY(16) and failed, + * fallback to READ CAPACITY(10). + */ + if ((softc->state == DA_STATE_PROBE2) && + (softc->flags & DA_FLAG_CAN_RC16) && + (((csio->ccb_h.status & CAM_STATUS_MASK) == + CAM_REQ_INVALID) || + ((have_sense) && + (error_code == SSD_CURRENT_ERROR) && + (sense_key == SSD_KEY_ILLEGAL_REQUEST)))) { + softc->flags &= ~DA_FLAG_CAN_RC16; + softc->state = DA_STATE_PROBE; + free(rdcap, M_SCSIDA); + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + } else + /* * Attach to anything that claims to be a * direct access or optical disk device, * as long as it doesn't return a "Logical @@ -2223,13 +2262,18 @@ dagetcapacity(struct cam_periph *periph) struct scsi_read_capacity_data_long *rcaplong; uint32_t block_len; uint64_t maxsector; - int error; + int error, rc16failed; u_int32_t sense_flags; + u_int lbppbe; /* Logical blocks per physical block exponent. */ + u_int lalba; /* Lowest aligned LBA. */ softc = (struct da_softc *)periph->softc; block_len = 0; maxsector = 0; + lbppbe = 0; + lalba = 0; error = 0; + rc16failed = 0; sense_flags = SF_RETRY_UA; if (softc->flags & DA_FLAG_PACK_REMOVABLE) sense_flags |= SF_NO_PRINT; @@ -2237,11 +2281,63 @@ dagetcapacity(struct cam_periph *periph) /* Do a read capacity */ rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcaplong), M_SCSIDA, - M_NOWAIT); + M_NOWAIT | M_ZERO); if (rcap == NULL) return (ENOMEM); - + rcaplong = (struct scsi_read_capacity_data_long *)rcap; + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); + + /* Try READ CAPACITY(16) first if we think it should work. */ + if (softc->flags & DA_FLAG_CAN_RC16) { + scsi_read_capacity_16(&ccb->csio, + /*retries*/ 4, + /*cbfcnp*/ dadone, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*lba*/ 0, + /*reladr*/ 0, + /*pmi*/ 0, + rcaplong, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ 60000); + ccb->ccb_h.ccb_bp = NULL; + + error = cam_periph_runccb(ccb, daerror, + /*cam_flags*/CAM_RETRY_SELTO, + sense_flags, + softc->disk->d_devstat); + + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + + if (error == 0) + goto rc16ok; + + /* If we got ILLEGAL REQUEST, do not prefer RC16 any more. */ + if ((ccb->ccb_h.status & CAM_STATUS_MASK) == + CAM_REQ_INVALID) { + softc->flags &= ~DA_FLAG_CAN_RC16; + } else if (((ccb->ccb_h.status & CAM_STATUS_MASK) == + CAM_SCSI_STATUS_ERROR) && + (ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND) && + (ccb->ccb_h.status & CAM_AUTOSNS_VALID) && + ((ccb->ccb_h.flags & CAM_SENSE_PHYS) == 0) && + ((ccb->ccb_h.flags & CAM_SENSE_PTR) == 0)) { + int sense_key, error_code, asc, ascq; + + scsi_extract_sense(&ccb->csio.sense_data, + &error_code, &sense_key, &asc, &ascq); + if (sense_key == SSD_KEY_ILLEGAL_REQUEST) + softc->flags &= ~DA_FLAG_CAN_RC16; + } + rc16failed = 1; + } + + /* Do READ CAPACITY(10). */ scsi_read_capacity(&ccb->csio, /*retries*/4, /*cbfncp*/dadone, @@ -2267,13 +2363,12 @@ dagetcapacity(struct cam_periph *periph) block_len = scsi_4btoul(rcap->length); maxsector = scsi_4btoul(rcap->addr); - if (maxsector != 0xffffffff) + if (maxsector != 0xffffffff || rc16failed) goto done; } else goto done; - rcaplong = (struct scsi_read_capacity_data_long *)rcap; - + /* If READ CAPACITY(10) returned overflow, use READ CAPACITY(16) */ scsi_read_capacity_16(&ccb->csio, /*retries*/ 4, /*cbfcnp*/ dadone, @@ -2299,8 +2394,11 @@ dagetcapacity(struct cam_periph *periph) /*getcount_only*/0); if (error == 0) { +rc16ok: block_len = scsi_4btoul(rcaplong->length); maxsector = scsi_8btou64(rcaplong->addr); + lbppbe = rcaplong->prot_lbppbe & SRC16_LBPPBE; + lalba = scsi_2btoul(rcaplong->lalba_lbp); } done: @@ -2311,8 +2409,14 @@ done: "unsupportable block size %ju\n", (uintmax_t) block_len); error = EINVAL; - } else - dasetgeom(periph, block_len, maxsector, 0, 0); + } else { + dasetgeom(periph, block_len, maxsector, + lbppbe, lalba & SRC16_LALBA); + if (lalba & SRC16_LBPME) + softc->flags |= DA_FLAG_CAN_LBPME; + else + softc->flags &= ~DA_FLAG_CAN_LBPME; + } } xpt_release_ccb(ccb); From owner-svn-src-stable@FreeBSD.ORG Tue Mar 13 20:34:34 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 963FA1065672; Tue, 13 Mar 2012 20:34:34 +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 847B78FC1C; Tue, 13 Mar 2012 20:34:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2DKYY6u061741; Tue, 13 Mar 2012 20:34:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2DKYYt3061738; Tue, 13 Mar 2012 20:34:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203132034.q2DKYYt3061738@svn.freebsd.org> From: Alexander Motin Date: Tue, 13 Mar 2012 20:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232942 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2012 20:34:34 -0000 Author: mav Date: Tue Mar 13 20:34:33 2012 New Revision: 232942 URL: http://svn.freebsd.org/changeset/base/232942 Log: MFc r228846: Use READ CAPACITY(16) to get information about device physical sectors. As soon as not all devices support READ CAPACITY(16), automatically fall back to READ CAPACITY(10) if CAM_REQ_INVALID or SSD_KEY_ILLEGAL_REQUEST status returned. It also provides first bits of information about Logical Block Provisioning (aka UNMAP/TRIM) support by the device. Modified: stable/8/sys/cam/scsi/scsi_all.h stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Tue Mar 13 20:33:15 2012 (r232941) +++ stable/8/sys/cam/scsi/scsi_all.h Tue Mar 13 20:34:33 2012 (r232942) @@ -847,6 +847,17 @@ struct scsi_read_capacity_data_long { uint8_t addr[8]; uint8_t length[4]; +#define SRC16_PROT_EN 0x01 +#define SRC16_P_TYPE 0x0e + uint8_t prot; +#define SRC16_LBPPBE 0x0f +#define SRC16_PI_EXPONENT 0xf0 +#define SRC16_PI_EXPONENT_SHIFT 4 + uint8_t prot_lbppbe; +#define SRC16_LALBA 0x3fff +#define SRC16_LBPRZ 0x4000 +#define SRC16_LBPME 0x8000 + uint8_t lalba_lbp[2]; }; struct scsi_report_luns Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Tue Mar 13 20:33:15 2012 (r232941) +++ stable/8/sys/cam/scsi/scsi_da.c Tue Mar 13 20:34:33 2012 (r232942) @@ -81,7 +81,9 @@ typedef enum { DA_FLAG_WENT_IDLE = 0x040, DA_FLAG_RETRY_UA = 0x080, DA_FLAG_OPEN = 0x100, - DA_FLAG_SCTX_INIT = 0x200 + DA_FLAG_SCTX_INIT = 0x200, + DA_FLAG_CAN_RC16 = 0x400, + DA_FLAG_CAN_LBPME = 0x800 } da_flags; typedef enum { @@ -1484,6 +1486,14 @@ daregister(struct cam_periph *periph, vo else if (softc->minimum_cmd_size > 12) softc->minimum_cmd_size = 16; + /* Predict whether device may support READ CAPACITY(16). */ + if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 || + (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC && + (cgd->inq_data.spc3_flags & SPC3_SID_PROTECT))) { + softc->flags |= DA_FLAG_CAN_RC16; + softc->state = DA_STATE_PROBE2; + } + /* * Register this media as a disk. */ @@ -1842,10 +1852,14 @@ dadone(struct cam_periph *periph, union struct disk_params *dp; uint32_t block_size; uint64_t maxsector; + u_int lbppbe; /* LB per physical block exponent. */ + u_int lalba; /* Lowest aligned LBA. */ if (softc->state == DA_STATE_PROBE) { block_size = scsi_4btoul(rdcap->length); maxsector = scsi_4btoul(rdcap->addr); + lbppbe = 0; + lalba = 0; /* * According to SBC-2, if the standard 10 @@ -1865,6 +1879,8 @@ dadone(struct cam_periph *periph, union } else { block_size = scsi_4btoul(rcaplong->length); maxsector = scsi_8btou64(rcaplong->addr); + lbppbe = rcaplong->prot_lbppbe & SRC16_LBPPBE; + lalba = scsi_2btoul(rcaplong->lalba_lbp); } /* @@ -1882,7 +1898,12 @@ dadone(struct cam_periph *periph, union announce_buf[0] = '\0'; cam_periph_invalidate(periph); } else { - dasetgeom(periph, block_size, maxsector, 0, 0); + dasetgeom(periph, block_size, maxsector, + lbppbe, lalba & SRC16_LALBA); + if (lalba & SRC16_LBPME) + softc->flags |= DA_FLAG_CAN_LBPME; + else + softc->flags &= ~DA_FLAG_CAN_LBPME; dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " @@ -1948,6 +1969,24 @@ dadone(struct cam_periph *periph, union &asc, &ascq); } /* + * If we tried READ CAPACITY(16) and failed, + * fallback to READ CAPACITY(10). + */ + if ((softc->state == DA_STATE_PROBE2) && + (softc->flags & DA_FLAG_CAN_RC16) && + (((csio->ccb_h.status & CAM_STATUS_MASK) == + CAM_REQ_INVALID) || + ((have_sense) && + (error_code == SSD_CURRENT_ERROR) && + (sense_key == SSD_KEY_ILLEGAL_REQUEST)))) { + softc->flags &= ~DA_FLAG_CAN_RC16; + softc->state = DA_STATE_PROBE; + free(rdcap, M_SCSIDA); + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + } else + /* * Attach to anything that claims to be a * direct access or optical disk device, * as long as it doesn't return a "Logical @@ -2124,13 +2163,18 @@ dagetcapacity(struct cam_periph *periph) struct scsi_read_capacity_data_long *rcaplong; uint32_t block_len; uint64_t maxsector; - int error; + int error, rc16failed; u_int32_t sense_flags; + u_int lbppbe; /* Logical blocks per physical block exponent. */ + u_int lalba; /* Lowest aligned LBA. */ softc = (struct da_softc *)periph->softc; block_len = 0; maxsector = 0; + lbppbe = 0; + lalba = 0; error = 0; + rc16failed = 0; sense_flags = SF_RETRY_UA; if (softc->flags & DA_FLAG_PACK_REMOVABLE) sense_flags |= SF_NO_PRINT; @@ -2138,11 +2182,63 @@ dagetcapacity(struct cam_periph *periph) /* Do a read capacity */ rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcaplong), M_SCSIDA, - M_NOWAIT); + M_NOWAIT | M_ZERO); if (rcap == NULL) return (ENOMEM); - + rcaplong = (struct scsi_read_capacity_data_long *)rcap; + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); + + /* Try READ CAPACITY(16) first if we think it should work. */ + if (softc->flags & DA_FLAG_CAN_RC16) { + scsi_read_capacity_16(&ccb->csio, + /*retries*/ 4, + /*cbfcnp*/ dadone, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*lba*/ 0, + /*reladr*/ 0, + /*pmi*/ 0, + rcaplong, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ 60000); + ccb->ccb_h.ccb_bp = NULL; + + error = cam_periph_runccb(ccb, daerror, + /*cam_flags*/CAM_RETRY_SELTO, + sense_flags, + softc->disk->d_devstat); + + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + + if (error == 0) + goto rc16ok; + + /* If we got ILLEGAL REQUEST, do not prefer RC16 any more. */ + if ((ccb->ccb_h.status & CAM_STATUS_MASK) == + CAM_REQ_INVALID) { + softc->flags &= ~DA_FLAG_CAN_RC16; + } else if (((ccb->ccb_h.status & CAM_STATUS_MASK) == + CAM_SCSI_STATUS_ERROR) && + (ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND) && + (ccb->ccb_h.status & CAM_AUTOSNS_VALID) && + ((ccb->ccb_h.flags & CAM_SENSE_PHYS) == 0) && + ((ccb->ccb_h.flags & CAM_SENSE_PTR) == 0)) { + int sense_key, error_code, asc, ascq; + + scsi_extract_sense(&ccb->csio.sense_data, + &error_code, &sense_key, &asc, &ascq); + if (sense_key == SSD_KEY_ILLEGAL_REQUEST) + softc->flags &= ~DA_FLAG_CAN_RC16; + } + rc16failed = 1; + } + + /* Do READ CAPACITY(10). */ scsi_read_capacity(&ccb->csio, /*retries*/4, /*cbfncp*/dadone, @@ -2168,13 +2264,12 @@ dagetcapacity(struct cam_periph *periph) block_len = scsi_4btoul(rcap->length); maxsector = scsi_4btoul(rcap->addr); - if (maxsector != 0xffffffff) + if (maxsector != 0xffffffff || rc16failed) goto done; } else goto done; - rcaplong = (struct scsi_read_capacity_data_long *)rcap; - + /* If READ CAPACITY(10) returned overflow, use READ CAPACITY(16) */ scsi_read_capacity_16(&ccb->csio, /*retries*/ 4, /*cbfcnp*/ dadone, @@ -2200,8 +2295,11 @@ dagetcapacity(struct cam_periph *periph) /*getcount_only*/0); if (error == 0) { +rc16ok: block_len = scsi_4btoul(rcaplong->length); maxsector = scsi_8btou64(rcaplong->addr); + lbppbe = rcaplong->prot_lbppbe & SRC16_LBPPBE; + lalba = scsi_2btoul(rcaplong->lalba_lbp); } done: @@ -2212,8 +2310,14 @@ done: "unsupportable block size %ju\n", (uintmax_t) block_len); error = EINVAL; - } else - dasetgeom(periph, block_len, maxsector, 0, 0); + } else { + dasetgeom(periph, block_len, maxsector, + lbppbe, lalba & SRC16_LALBA); + if (lalba & SRC16_LBPME) + softc->flags |= DA_FLAG_CAN_LBPME; + else + softc->flags &= ~DA_FLAG_CAN_LBPME; + } } xpt_release_ccb(ccb); From owner-svn-src-stable@FreeBSD.ORG Tue Mar 13 20:36:04 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A145106566B; Tue, 13 Mar 2012 20:36:04 +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 07B688FC15; Tue, 13 Mar 2012 20:36:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2DKa3Px061852; Tue, 13 Mar 2012 20:36:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2DKa3CH061846; Tue, 13 Mar 2012 20:36:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203132036.q2DKa3CH061846@svn.freebsd.org> From: Alexander Motin Date: Tue, 13 Mar 2012 20:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232943 - in stable/9/sys/cam: ata scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2012 20:36:04 -0000 Author: mav Date: Tue Mar 13 20:36:03 2012 New Revision: 232943 URL: http://svn.freebsd.org/changeset/base/232943 Log: MFc r229288: Remove unneeded checks for CAM_DEV_QFRZN after cam_periph_runccb() call. cam_periph_runccb() since the beginning checks it and releases device queue. After r203108 it even clears CAM_DEV_QFRZN flag after that to avoid double release, so removed code is unreachable now. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_sa.c stable/9/sys/cam/scsi/scsi_ses.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Tue Mar 13 20:34:33 2012 (r232942) +++ stable/9/sys/cam/ata/ata_da.c Tue Mar 13 20:36:03 2012 (r232943) @@ -493,13 +493,6 @@ adaclose(struct disk *dp) if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) xpt_print(periph->path, "Synchronize cache failed\n"); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); xpt_release_ccb(ccb); } Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Tue Mar 13 20:34:33 2012 (r232942) +++ stable/9/sys/cam/scsi/scsi_da.c Tue Mar 13 20:36:03 2012 (r232943) @@ -991,13 +991,6 @@ daclose(struct disk *dp) } } - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - xpt_release_ccb(ccb); } @@ -2306,14 +2299,6 @@ dagetcapacity(struct cam_periph *periph) /*cam_flags*/CAM_RETRY_SELTO, sense_flags, softc->disk->d_devstat); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - if (error == 0) goto rc16ok; @@ -2351,14 +2336,6 @@ dagetcapacity(struct cam_periph *periph) /*cam_flags*/CAM_RETRY_SELTO, sense_flags, softc->disk->d_devstat); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - if (error == 0) { block_len = scsi_4btoul(rcap->length); maxsector = scsi_4btoul(rcap->addr); @@ -2385,14 +2362,6 @@ dagetcapacity(struct cam_periph *periph) /*cam_flags*/CAM_RETRY_SELTO, sense_flags, softc->disk->d_devstat); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - if (error == 0) { rc16ok: block_len = scsi_4btoul(rcaplong->length); Modified: stable/9/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sa.c Tue Mar 13 20:34:33 2012 (r232942) +++ stable/9/sys/cam/scsi/scsi_sa.c Tue Mar 13 20:36:03 2012 (r232943) @@ -1853,14 +1853,12 @@ samount(struct cam_periph *periph, int o MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); if (error == ENXIO) { softc->flags &= ~SA_FLAG_TAPE_MOUNTED; scsi_test_unit_ready(&ccb->csio, 0, sadone, MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); } else if (error) { /* * We don't need to freeze the tape because we @@ -1882,7 +1880,6 @@ samount(struct cam_periph *periph, int o MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); } if ((softc->flags & SA_FLAG_TAPE_MOUNTED) == 0) { @@ -1905,7 +1902,6 @@ samount(struct cam_periph *periph, int o FALSE, FALSE, 1, SSD_FULL_SIZE, REWIND_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); /* * In case this doesn't work, do a REWIND instead @@ -1915,7 +1911,6 @@ samount(struct cam_periph *periph, int o FALSE, SSD_FULL_SIZE, REWIND_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); } if (error) { xpt_release_ccb(ccb); @@ -1945,13 +1940,11 @@ samount(struct cam_periph *periph, int o IO_TIMEOUT); (void) cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); scsi_rewind(&ccb->csio, 1, sadone, MSG_SIMPLE_Q_TAG, FALSE, SSD_FULL_SIZE, REWIND_TIMEOUT); error = cam_periph_runccb(ccb, saerror, CAM_RETRY_SELTO, SF_NO_PRINT | SF_RETRY_UA, softc->device_stats); - QFRLS(ccb); if (error) { xpt_print(periph->path, "unable to rewind after test read\n"); @@ -1969,7 +1962,6 @@ samount(struct cam_periph *periph, int o error = cam_periph_runccb(ccb, saerror, CAM_RETRY_SELTO, SF_NO_PRINT | SF_RETRY_UA, softc->device_stats); - QFRLS(ccb); xpt_release_ccb(ccb); if (error != 0) { @@ -2580,7 +2572,6 @@ retry: error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); status = ccb->ccb_h.status & CAM_STATUS_MASK; @@ -2644,7 +2635,6 @@ retry: error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); if (error != 0) goto sagetparamsexit; @@ -2956,7 +2946,6 @@ retry: error = cam_periph_runccb(ccb, saerror, 0, sense_flags, softc->device_stats); - QFRLS(ccb); if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO)) { int idx; @@ -3014,7 +3003,6 @@ retry: ccb->ccb_h.retry_count = 1; cam_periph_runccb(ccb, saerror, 0, sense_flags, softc->device_stats); - QFRLS(ccb); } xpt_release_ccb(ccb); @@ -3072,7 +3060,6 @@ saprevent(struct cam_periph *periph, int SSD_FULL_SIZE, SCSIOP_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, sf, softc->device_stats); - QFRLS(ccb); if (error == 0) { if (action == PR_ALLOW) softc->flags &= ~SA_FLAG_TAPE_LOCKED; @@ -3102,9 +3089,6 @@ sarewind(struct cam_periph *periph) error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); - xpt_release_ccb(ccb); if (error == 0) softc->fileno = softc->blkno = (daddr_t) 0; @@ -3138,9 +3122,6 @@ saspace(struct cam_periph *periph, int c error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); - xpt_release_ccb(ccb); /* @@ -3212,9 +3193,6 @@ sawritefilemarks(struct cam_periph *peri error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); - if (error == 0 && nmarks) { struct sa_softc *softc = (struct sa_softc *)periph->softc; nwm = nmarks - softc->last_ctl_resid; @@ -3265,8 +3243,6 @@ sardpos(struct cam_periph *periph, int h softc->dsreg = MTIO_DSREG_RBSY; error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0); if (error == 0) { if (loc.flags & SA_RPOS_UNCERTAIN) { @@ -3306,8 +3282,6 @@ sasetpos(struct cam_periph *periph, int softc->dsreg = MTIO_DSREG_POS; error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0); xpt_release_ccb(ccb); /* * Note relative file && block number position as now unknown. @@ -3335,8 +3309,6 @@ saretension(struct cam_periph *periph) error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); xpt_release_ccb(ccb); if (error == 0) softc->fileno = softc->blkno = (daddr_t) 0; @@ -3362,7 +3334,6 @@ sareservereleaseunit(struct cam_periph * error = cam_periph_runccb(ccb, saerror, 0, SF_RETRY_UA | SF_NO_PRINT, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - QFRLS(ccb); xpt_release_ccb(ccb); /* @@ -3394,7 +3365,6 @@ saloadunload(struct cam_periph *periph, softc->dsreg = (load)? MTIO_DSREG_LD : MTIO_DSREG_UNL; error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - QFRLS(ccb); xpt_release_ccb(ccb); if (error || load == 0) @@ -3425,8 +3395,6 @@ saerase(struct cam_periph *periph, int l error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); xpt_release_ccb(ccb); return (error); } Modified: stable/9/sys/cam/scsi/scsi_ses.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_ses.c Tue Mar 13 20:34:33 2012 (r232942) +++ stable/9/sys/cam/scsi/scsi_ses.c Tue Mar 13 20:36:03 2012 (r232943) @@ -679,8 +679,6 @@ ses_runcmd(struct ses_softc *ssc, char * bcopy(cdb, ccb->csio.cdb_io.cdb_bytes, cdbl); error = cam_periph_runccb(ccb, seserror, SES_CFLAGS, SES_FLAGS, NULL); - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); if (error) { if (dptr) { *dlenp = dlen; From owner-svn-src-stable@FreeBSD.ORG Tue Mar 13 20:37:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12AF6106566C; Tue, 13 Mar 2012 20:37:09 +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 004E68FC1A; Tue, 13 Mar 2012 20:37:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2DKb8fI061958; Tue, 13 Mar 2012 20:37:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2DKb8HR061953; Tue, 13 Mar 2012 20:37:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203132037.q2DKb8HR061953@svn.freebsd.org> From: Alexander Motin Date: Tue, 13 Mar 2012 20:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232944 - in stable/8/sys/cam: ata scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2012 20:37:09 -0000 Author: mav Date: Tue Mar 13 20:37:08 2012 New Revision: 232944 URL: http://svn.freebsd.org/changeset/base/232944 Log: MFC r229288: Remove unneeded checks for CAM_DEV_QFRZN after cam_periph_runccb() call. cam_periph_runccb() since the beginning checks it and releases device queue. After r203108 it even clears CAM_DEV_QFRZN flag after that to avoid double release, so removed code is unreachable now. Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/scsi/scsi_da.c stable/8/sys/cam/scsi/scsi_sa.c stable/8/sys/cam/scsi/scsi_ses.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Tue Mar 13 20:36:03 2012 (r232943) +++ stable/8/sys/cam/ata/ata_da.c Tue Mar 13 20:37:08 2012 (r232944) @@ -469,13 +469,6 @@ adaclose(struct disk *dp) if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) xpt_print(periph->path, "Synchronize cache failed\n"); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); xpt_release_ccb(ccb); } Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Tue Mar 13 20:36:03 2012 (r232943) +++ stable/8/sys/cam/scsi/scsi_da.c Tue Mar 13 20:37:08 2012 (r232944) @@ -988,13 +988,6 @@ daclose(struct disk *dp) } } - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - xpt_release_ccb(ccb); } @@ -2207,14 +2200,6 @@ dagetcapacity(struct cam_periph *periph) /*cam_flags*/CAM_RETRY_SELTO, sense_flags, softc->disk->d_devstat); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - if (error == 0) goto rc16ok; @@ -2252,14 +2237,6 @@ dagetcapacity(struct cam_periph *periph) /*cam_flags*/CAM_RETRY_SELTO, sense_flags, softc->disk->d_devstat); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - if (error == 0) { block_len = scsi_4btoul(rcap->length); maxsector = scsi_4btoul(rcap->addr); @@ -2286,14 +2263,6 @@ dagetcapacity(struct cam_periph *periph) /*cam_flags*/CAM_RETRY_SELTO, sense_flags, softc->disk->d_devstat); - - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, - /*relsim_flags*/0, - /*reduction*/0, - /*timeout*/0, - /*getcount_only*/0); - if (error == 0) { rc16ok: block_len = scsi_4btoul(rcaplong->length); Modified: stable/8/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_sa.c Tue Mar 13 20:36:03 2012 (r232943) +++ stable/8/sys/cam/scsi/scsi_sa.c Tue Mar 13 20:37:08 2012 (r232944) @@ -1848,14 +1848,12 @@ samount(struct cam_periph *periph, int o MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); if (error == ENXIO) { softc->flags &= ~SA_FLAG_TAPE_MOUNTED; scsi_test_unit_ready(&ccb->csio, 0, sadone, MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); } else if (error) { /* * We don't need to freeze the tape because we @@ -1877,7 +1875,6 @@ samount(struct cam_periph *periph, int o MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); } if ((softc->flags & SA_FLAG_TAPE_MOUNTED) == 0) { @@ -1900,7 +1897,6 @@ samount(struct cam_periph *periph, int o FALSE, FALSE, 1, SSD_FULL_SIZE, REWIND_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); /* * In case this doesn't work, do a REWIND instead @@ -1910,7 +1906,6 @@ samount(struct cam_periph *periph, int o FALSE, SSD_FULL_SIZE, REWIND_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); } if (error) { xpt_release_ccb(ccb); @@ -1940,13 +1935,11 @@ samount(struct cam_periph *periph, int o IO_TIMEOUT); (void) cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); scsi_rewind(&ccb->csio, 1, sadone, MSG_SIMPLE_Q_TAG, FALSE, SSD_FULL_SIZE, REWIND_TIMEOUT); error = cam_periph_runccb(ccb, saerror, CAM_RETRY_SELTO, SF_NO_PRINT | SF_RETRY_UA, softc->device_stats); - QFRLS(ccb); if (error) { xpt_print(periph->path, "unable to rewind after test read\n"); @@ -1964,7 +1957,6 @@ samount(struct cam_periph *periph, int o error = cam_periph_runccb(ccb, saerror, CAM_RETRY_SELTO, SF_NO_PRINT | SF_RETRY_UA, softc->device_stats); - QFRLS(ccb); xpt_release_ccb(ccb); if (error != 0) { @@ -2563,7 +2555,6 @@ retry: error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); status = ccb->ccb_h.status & CAM_STATUS_MASK; @@ -2627,7 +2618,6 @@ retry: error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT, softc->device_stats); - QFRLS(ccb); if (error != 0) goto sagetparamsexit; @@ -2939,7 +2929,6 @@ retry: error = cam_periph_runccb(ccb, saerror, 0, sense_flags, softc->device_stats); - QFRLS(ccb); if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO)) { int idx; @@ -2997,7 +2986,6 @@ retry: ccb->ccb_h.retry_count = 1; cam_periph_runccb(ccb, saerror, 0, sense_flags, softc->device_stats); - QFRLS(ccb); } xpt_release_ccb(ccb); @@ -3055,7 +3043,6 @@ saprevent(struct cam_periph *periph, int SSD_FULL_SIZE, SCSIOP_TIMEOUT); error = cam_periph_runccb(ccb, saerror, 0, sf, softc->device_stats); - QFRLS(ccb); if (error == 0) { if (action == PR_ALLOW) softc->flags &= ~SA_FLAG_TAPE_LOCKED; @@ -3085,9 +3072,6 @@ sarewind(struct cam_periph *periph) error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); - xpt_release_ccb(ccb); if (error == 0) softc->fileno = softc->blkno = (daddr_t) 0; @@ -3121,9 +3105,6 @@ saspace(struct cam_periph *periph, int c error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); - xpt_release_ccb(ccb); /* @@ -3195,9 +3176,6 @@ sawritefilemarks(struct cam_periph *peri error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); - if (error == 0 && nmarks) { struct sa_softc *softc = (struct sa_softc *)periph->softc; nwm = nmarks - softc->last_ctl_resid; @@ -3248,8 +3226,6 @@ sardpos(struct cam_periph *periph, int h softc->dsreg = MTIO_DSREG_RBSY; error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0); if (error == 0) { if (loc.flags & SA_RPOS_UNCERTAIN) { @@ -3289,8 +3265,6 @@ sasetpos(struct cam_periph *periph, int softc->dsreg = MTIO_DSREG_POS; error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0); xpt_release_ccb(ccb); /* * Note relative file && block number position as now unknown. @@ -3318,8 +3292,6 @@ saretension(struct cam_periph *periph) error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); xpt_release_ccb(ccb); if (error == 0) softc->fileno = softc->blkno = (daddr_t) 0; @@ -3345,7 +3317,6 @@ sareservereleaseunit(struct cam_periph * error = cam_periph_runccb(ccb, saerror, 0, SF_RETRY_UA | SF_NO_PRINT, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - QFRLS(ccb); xpt_release_ccb(ccb); /* @@ -3377,7 +3348,6 @@ saloadunload(struct cam_periph *periph, softc->dsreg = (load)? MTIO_DSREG_LD : MTIO_DSREG_UNL; error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - QFRLS(ccb); xpt_release_ccb(ccb); if (error || load == 0) @@ -3408,8 +3378,6 @@ saerase(struct cam_periph *periph, int l error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats); softc->dsreg = MTIO_DSREG_REST; - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); xpt_release_ccb(ccb); return (error); } Modified: stable/8/sys/cam/scsi/scsi_ses.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_ses.c Tue Mar 13 20:36:03 2012 (r232943) +++ stable/8/sys/cam/scsi/scsi_ses.c Tue Mar 13 20:37:08 2012 (r232944) @@ -679,8 +679,6 @@ ses_runcmd(struct ses_softc *ssc, char * bcopy(cdb, ccb->csio.cdb_io.cdb_bytes, cdbl); error = cam_periph_runccb(ccb, seserror, SES_CFLAGS, SES_FLAGS, NULL); - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE); if (error) { if (dptr) { *dlenp = dlen; From owner-svn-src-stable@FreeBSD.ORG Tue Mar 13 20:37:58 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA647106564A; Tue, 13 Mar 2012 20:37:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F2F28FC1A; Tue, 13 Mar 2012 20:37:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2DKbw4F062034; Tue, 13 Mar 2012 20:37:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2DKbwif062024; Tue, 13 Mar 2012 20:37:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203132037.q2DKbwif062024@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 13 Mar 2012 20:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232945 - in stable/9: share/man/man4 sys/i386/conf sys/netinet sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2012 20:37:58 -0000 Author: glebius Date: Tue Mar 13 20:37:57 2012 New Revision: 232945 URL: http://svn.freebsd.org/changeset/base/232945 Log: Merge 231025 from head: Add new socket options: TCP_KEEPINIT, TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT, that allow to control initial timeout, idle time, idle re-send interval and idle send count on a per-socket basis. Reviewed by: andre, bz, lstewart Modified: stable/9/share/man/man4/tcp.4 stable/9/sys/netinet/tcp.h stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_syncache.c stable/9/sys/netinet/tcp_timer.c stable/9/sys/netinet/tcp_timer.h stable/9/sys/netinet/tcp_usrreq.c stable/9/sys/netinet/tcp_var.h stable/9/sys/sys/param.h Directory Properties: stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/share/man/man5/ (props changed) stable/9/share/man/man7/ (props changed) stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/share/man/man4/tcp.4 ============================================================================== --- stable/9/share/man/man4/tcp.4 Tue Mar 13 20:37:08 2012 (r232944) +++ stable/9/share/man/man4/tcp.4 Tue Mar 13 20:37:57 2012 (r232945) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd February 5, 2012 .Dt TCP 4 .Os .Sh NAME @@ -146,6 +146,65 @@ connection. See .Xr mod_cc 4 for details. +.It Dv TCP_KEEPINIT +This write-only +.Xr setsockopt 2 +option accepts a per-socket timeout argument of +.Vt "u_int" +in seconds, for new, non-established +.Tn TCP +connections. +For the global default in milliseconds see +.Va keepinit +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPIDLE +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +for the amount of time, in seconds, that the connection must be idle +before keepalive probes (if enabled) are sent for the connection of this +socket. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default in milliseconds see +.Va keepidle +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPINTVL +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +to set the per-socket interval, in seconds, between keepalive probes sent +to a peer. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default in milliseconds see +.Va keepintvl +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPCNT +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +and allows a per-socket tuning of the number of probes sent, with no response, +before the connection will be dropped. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default see the +.Va keepcnt +in the +.Sx MIB Variables +section further down. .It Dv TCP_NODELAY Under most circumstances, .Tn TCP @@ -304,17 +363,21 @@ The Maximum Segment Lifetime, in millise Timeout, in milliseconds, for new, non-established .Tn TCP connections. +The default is 75000 msec. .It Va keepidle Amount of time, in milliseconds, that the connection must be idle before keepalive probes (if enabled) are sent. +The default is 7200000 msec (2 hours). .It Va keepintvl The interval, in milliseconds, between keepalive probes sent to remote machines, when no response is received on a .Va keepidle probe. -After -.Dv TCPTV_KEEPCNT -(default 8) probes are sent, with no response, the connection is dropped. +The default is 75000 msec. +.It Va keepcnt +Number of probes sent, with no response, before a connection +is dropped. +The default is 8 packets. .It Va always_keepalive Assume that .Dv SO_KEEPALIVE Modified: stable/9/sys/netinet/tcp.h ============================================================================== --- stable/9/sys/netinet/tcp.h Tue Mar 13 20:37:08 2012 (r232944) +++ stable/9/sys/netinet/tcp.h Tue Mar 13 20:37:57 2012 (r232945) @@ -159,6 +159,10 @@ struct tcphdr { #define TCP_MD5SIG 0x10 /* use MD5 digests (RFC2385) */ #define TCP_INFO 0x20 /* retrieve tcp_info structure */ #define TCP_CONGESTION 0x40 /* get/set congestion control algorithm */ +#define TCP_KEEPINIT 0x80 /* N, time to establish connection */ +#define TCP_KEEPIDLE 0x100 /* L,N,X start keeplives after this period */ +#define TCP_KEEPINTVL 0x200 /* L,N interval between keepalives */ +#define TCP_KEEPCNT 0x400 /* L,N number of keepalives before close */ #define TCP_CA_NAME_MAX 16 /* max congestion control name length */ Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Tue Mar 13 20:37:08 2012 (r232944) +++ stable/9/sys/netinet/tcp_input.c Tue Mar 13 20:37:57 2012 (r232945) @@ -1477,7 +1477,7 @@ tcp_do_segment(struct mbuf *m, struct tc */ tp->t_rcvtime = ticks; if (TCPS_HAVEESTABLISHED(tp->t_state)) - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); /* * Unscale the window into a 32-bit value. @@ -1920,7 +1920,8 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tp->t_state = TCPS_ESTABLISHED; cc_conn_init(tp); - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPIDLE(tp)); } } else { /* @@ -2324,7 +2325,7 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tp->t_state = TCPS_ESTABLISHED; cc_conn_init(tp); - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); } /* * If segment contains data or ACK, will call tcp_reass() @@ -2661,12 +2662,11 @@ process_ACK: * compressed state. */ if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { - int timeout; - soisdisconnected(so); - timeout = (tcp_fast_finwait2_recycle) ? - tcp_finwait2_timeout : tcp_maxidle; - tcp_timer_activate(tp, TT_2MSL, timeout); + tcp_timer_activate(tp, TT_2MSL, + (tcp_fast_finwait2_recycle ? + tcp_finwait2_timeout : + TP_MAXIDLE(tp))); } tp->t_state = TCPS_FIN_WAIT_2; } Modified: stable/9/sys/netinet/tcp_syncache.c ============================================================================== --- stable/9/sys/netinet/tcp_syncache.c Tue Mar 13 20:37:08 2012 (r232944) +++ stable/9/sys/netinet/tcp_syncache.c Tue Mar 13 20:37:57 2012 (r232945) @@ -844,7 +844,15 @@ syncache_socket(struct syncache *sc, str */ if (sc->sc_rxmits > 1) tp->snd_cwnd = tp->t_maxseg; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + + /* + * Copy and activate timers. + */ + tp->t_keepinit = sototcpcb(lso)->t_keepinit; + tp->t_keepidle = sototcpcb(lso)->t_keepidle; + tp->t_keepintvl = sototcpcb(lso)->t_keepintvl; + tp->t_keepcnt = sototcpcb(lso)->t_keepcnt; + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); INP_WUNLOCK(inp); Modified: stable/9/sys/netinet/tcp_timer.c ============================================================================== --- stable/9/sys/netinet/tcp_timer.c Tue Mar 13 20:37:08 2012 (r232944) +++ stable/9/sys/netinet/tcp_timer.c Tue Mar 13 20:37:57 2012 (r232945) @@ -111,12 +111,12 @@ int tcp_finwait2_timeout; SYSCTL_PROC(_net_inet_tcp, OID_AUTO, finwait2_timeout, CTLTYPE_INT|CTLFLAG_RW, &tcp_finwait2_timeout, 0, sysctl_msec_to_ticks, "I", "FIN-WAIT2 timeout"); +int tcp_keepcnt = TCPTV_KEEPCNT; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, keepcnt, CTLFLAG_RW, &tcp_keepcnt, 0, + "Number of keepalive probes to send"); -static int tcp_keepcnt = TCPTV_KEEPCNT; /* max idle probes */ int tcp_maxpersistidle; - /* max idle time in persist */ -int tcp_maxidle; static int per_cpu_timers = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, per_cpu_timers, CTLFLAG_RW, @@ -138,7 +138,6 @@ tcp_slowtimo(void) VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - tcp_maxidle = tcp_keepcnt * tcp_keepintvl; INP_INFO_WLOCK(&V_tcbinfo); (void) tcp_tw_2msl_scan(0); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -255,9 +254,9 @@ tcp_timer_2msl(void *xtp) tp = tcp_close(tp); } else { if (tp->t_state != TCPS_TIME_WAIT && - ticks - tp->t_rcvtime <= tcp_maxidle) - callout_reset_on(&tp->t_timers->tt_2msl, tcp_keepintvl, - tcp_timer_2msl, tp, INP_CPU(inp)); + ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) + callout_reset_on(&tp->t_timers->tt_2msl, + TP_KEEPINTVL(tp), tcp_timer_2msl, tp, INP_CPU(inp)); else tp = tcp_close(tp); } @@ -318,7 +317,7 @@ tcp_timer_keep(void *xtp) goto dropit; if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { - if (ticks - tp->t_rcvtime >= tcp_keepidle + tcp_maxidle) + if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) goto dropit; /* * Send a packet designed to force a response @@ -340,9 +339,11 @@ tcp_timer_keep(void *xtp) tp->rcv_nxt, tp->snd_una - 1, 0); free(t_template, M_TEMP); } - callout_reset_on(&tp->t_timers->tt_keep, tcp_keepintvl, tcp_timer_keep, tp, INP_CPU(inp)); + callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), + tcp_timer_keep, tp, INP_CPU(inp)); } else - callout_reset_on(&tp->t_timers->tt_keep, tcp_keepidle, tcp_timer_keep, tp, INP_CPU(inp)); + callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), + tcp_timer_keep, tp, INP_CPU(inp)); #ifdef TCPDEBUG if (inp->inp_socket->so_options & SO_DEBUG) Modified: stable/9/sys/netinet/tcp_timer.h ============================================================================== --- stable/9/sys/netinet/tcp_timer.h Tue Mar 13 20:37:08 2012 (r232944) +++ stable/9/sys/netinet/tcp_timer.h Tue Mar 13 20:37:57 2012 (r232945) @@ -153,10 +153,16 @@ struct tcp_timer { #define TT_KEEP 0x08 #define TT_2MSL 0x10 +#define TP_KEEPINIT(tp) ((tp)->t_keepinit ? (tp)->t_keepinit : tcp_keepinit) +#define TP_KEEPIDLE(tp) ((tp)->t_keepidle ? (tp)->t_keepidle : tcp_keepidle) +#define TP_KEEPINTVL(tp) ((tp)->t_keepintvl ? (tp)->t_keepintvl : tcp_keepintvl) +#define TP_KEEPCNT(tp) ((tp)->t_keepcnt ? (tp)->t_keepcnt : tcp_keepcnt) +#define TP_MAXIDLE(tp) (TP_KEEPCNT(tp) * TP_KEEPINTVL(tp)) + extern int tcp_keepinit; /* time to establish connection */ extern int tcp_keepidle; /* time before keepalive probes begin */ extern int tcp_keepintvl; /* time between keepalive probes */ -extern int tcp_maxidle; /* time to drop after starting probes */ +extern int tcp_keepcnt; /* number of keepalives */ extern int tcp_delacktime; /* time before sending a delayed ACK */ extern int tcp_maxpersistidle; extern int tcp_rexmit_min; Modified: stable/9/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/9/sys/netinet/tcp_usrreq.c Tue Mar 13 20:37:08 2012 (r232944) +++ stable/9/sys/netinet/tcp_usrreq.c Tue Mar 13 20:37:57 2012 (r232945) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1118,7 +1119,7 @@ tcp_connect(struct tcpcb *tp, struct soc soisconnecting(so); TCPSTAT_INC(tcps_connattempt); tp->t_state = TCPS_SYN_SENT; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); tp->iss = tcp_new_isn(tp); tcp_sendseqinit(tp); @@ -1191,7 +1192,7 @@ tcp6_connect(struct tcpcb *tp, struct so soisconnecting(so); TCPSTAT_INC(tcps_connattempt); tp->t_state = TCPS_SYN_SENT; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); tp->iss = tcp_new_isn(tp); tcp_sendseqinit(tp); @@ -1272,6 +1273,7 @@ int tcp_ctloutput(struct socket *so, struct sockopt *sopt) { int error, opt, optval; + u_int ui; struct inpcb *inp; struct tcpcb *tp; struct tcp_info ti; @@ -1439,6 +1441,59 @@ tcp_ctloutput(struct socket *so, struct INP_WUNLOCK(inp); break; + case TCP_KEEPIDLE: + case TCP_KEEPINTVL: + case TCP_KEEPCNT: + case TCP_KEEPINIT: + INP_WUNLOCK(inp); + error = sooptcopyin(sopt, &ui, sizeof(ui), sizeof(ui)); + if (error) + return (error); + + if (ui > (UINT_MAX / hz)) { + error = EINVAL; + break; + } + ui *= hz; + + INP_WLOCK_RECHECK(inp); + switch (sopt->sopt_name) { + case TCP_KEEPIDLE: + tp->t_keepidle = ui; + /* + * XXX: better check current remaining + * timeout and "merge" it with new value. + */ + if ((tp->t_state > TCPS_LISTEN) && + (tp->t_state <= TCPS_CLOSING)) + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPIDLE(tp)); + break; + case TCP_KEEPINTVL: + tp->t_keepintvl = ui; + if ((tp->t_state == TCPS_FIN_WAIT_2) && + (TP_MAXIDLE(tp) > 0)) + tcp_timer_activate(tp, TT_2MSL, + TP_MAXIDLE(tp)); + break; + case TCP_KEEPCNT: + tp->t_keepcnt = ui; + if ((tp->t_state == TCPS_FIN_WAIT_2) && + (TP_MAXIDLE(tp) > 0)) + tcp_timer_activate(tp, TT_2MSL, + TP_MAXIDLE(tp)); + break; + case TCP_KEEPINIT: + tp->t_keepinit = ui; + if (tp->t_state == TCPS_SYN_RECEIVED || + tp->t_state == TCPS_SYN_SENT) + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPINIT(tp)); + break; + } + INP_WUNLOCK(inp); + break; + default: INP_WUNLOCK(inp); error = ENOPROTOOPT; @@ -1648,7 +1703,7 @@ tcp_usrclosed(struct tcpcb *tp) int timeout; timeout = (tcp_fast_finwait2_recycle) ? - tcp_finwait2_timeout : tcp_maxidle; + tcp_finwait2_timeout : TP_MAXIDLE(tp); tcp_timer_activate(tp, TT_2MSL, timeout); } } Modified: stable/9/sys/netinet/tcp_var.h ============================================================================== --- stable/9/sys/netinet/tcp_var.h Tue Mar 13 20:37:08 2012 (r232944) +++ stable/9/sys/netinet/tcp_var.h Tue Mar 13 20:37:57 2012 (r232945) @@ -203,7 +203,12 @@ struct tcpcb { struct cc_var *ccv; /* congestion control specific vars */ struct osd *osd; /* storage for Khelp module data */ - uint32_t t_ispare[12]; /* 4 keep timers, 5 UTO, 3 TBD */ + u_int t_keepinit; /* time to establish connection */ + u_int t_keepidle; /* time before keepalive probes begin */ + u_int t_keepintvl; /* interval between keepalives */ + u_int t_keepcnt; /* number of keepalives before close */ + + uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ void *t_pspare2[4]; /* 4 TBD */ uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ }; Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Tue Mar 13 20:37:08 2012 (r232944) +++ stable/9/sys/sys/param.h Tue Mar 13 20:37:57 2012 (r232945) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900504 /* Master, propagated to newvers */ +#define __FreeBSD_version 900505 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 06:56:55 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3DC11065673; Wed, 14 Mar 2012 06:56: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 CCADE8FC1E; Wed, 14 Mar 2012 06:56:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2E6ut8L082119; Wed, 14 Mar 2012 06:56:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2E6utZi082117; Wed, 14 Mar 2012 06:56:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203140656.q2E6utZi082117@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 14 Mar 2012 06:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232955 - stable/9/contrib/top X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 06:56:56 -0000 Author: kib Date: Wed Mar 14 06:56:55 2012 New Revision: 232955 URL: http://svn.freebsd.org/changeset/base/232955 Log: MFC r232660: In batch mode, exit after receiving SIGINT, instead of immediate output of the next display. Modified: stable/9/contrib/top/top.c Directory Properties: stable/9/contrib/top/ (props changed) Modified: stable/9/contrib/top/top.c ============================================================================== --- stable/9/contrib/top/top.c Wed Mar 14 06:42:12 2012 (r232954) +++ stable/9/contrib/top/top.c Wed Mar 14 06:56:55 2012 (r232955) @@ -723,6 +723,10 @@ restart: if (!interactive) { sleep(delay); + if (leaveflag) { + end_screen(); + exit(0); + } } else while (no_command) { From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 07:08:16 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41638106566C; Wed, 14 Mar 2012 07:08:16 +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 2B11E8FC12; Wed, 14 Mar 2012 07:08:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2E78GdO082521; Wed, 14 Mar 2012 07:08:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2E78FGL082519; Wed, 14 Mar 2012 07:08:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203140708.q2E78FGL082519@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 14 Mar 2012 07:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232956 - stable/9/sys/ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 07:08:16 -0000 Author: kib Date: Wed Mar 14 07:08:15 2012 New Revision: 232956 URL: http://svn.freebsd.org/changeset/base/232956 Log: MFC r232833: Remove not needed ARGSUSED lint command. Modified: stable/9/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vnops.c Wed Mar 14 06:56:55 2012 (r232955) +++ stable/9/sys/ufs/ffs/ffs_vnops.c Wed Mar 14 07:08:15 2012 (r232956) @@ -402,7 +402,6 @@ ffs_lock(ap) /* * Vnode op for reading. */ -/* ARGSUSED */ static int ffs_read(ap) struct vop_read_args /* { From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 07:10:37 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A437106564A; Wed, 14 Mar 2012 07:10:37 +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 430398FC0A; Wed, 14 Mar 2012 07:10:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2E7AbBi082638; Wed, 14 Mar 2012 07:10:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2E7Abcc082636; Wed, 14 Mar 2012 07:10:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203140710.q2E7Abcc082636@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 14 Mar 2012 07:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232957 - stable/8/contrib/top X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 07:10:37 -0000 Author: kib Date: Wed Mar 14 07:10:36 2012 New Revision: 232957 URL: http://svn.freebsd.org/changeset/base/232957 Log: MFC r232660: In batch mode, exit after receiving SIGINT, instead of immediate output of the next display. Modified: stable/8/contrib/top/top.c Directory Properties: stable/8/contrib/top/ (props changed) Modified: stable/8/contrib/top/top.c ============================================================================== --- stable/8/contrib/top/top.c Wed Mar 14 07:08:15 2012 (r232956) +++ stable/8/contrib/top/top.c Wed Mar 14 07:10:36 2012 (r232957) @@ -723,6 +723,10 @@ restart: if (!interactive) { sleep(delay); + if (leaveflag) { + end_screen(); + exit(0); + } } else while (no_command) { From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 09:44:47 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65D951065672; Wed, 14 Mar 2012 09:44:47 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 510538FC1C; Wed, 14 Mar 2012 09:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2E9ilVU094388; Wed, 14 Mar 2012 09:44:47 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2E9ilvF094386; Wed, 14 Mar 2012 09:44:47 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203140944.q2E9ilvF094386@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 14 Mar 2012 09:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232961 - stable/9 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 09:44:47 -0000 Author: pluknet Date: Wed Mar 14 09:44:46 2012 New Revision: 232961 URL: http://svn.freebsd.org/changeset/base/232961 Log: MFC r232671: Add lib32 part for libutil after its version bump to 9. PR: misc/165523 Submitted by: Andrey Zonov Modified: stable/9/ObsoleteFiles.inc (contents, props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Wed Mar 14 09:15:50 2012 (r232960) +++ stable/9/ObsoleteFiles.inc Wed Mar 14 09:44:46 2012 (r232961) @@ -352,6 +352,9 @@ OLD_FILES+=usr/share/man/man5/lastlog.5. OLD_FILES+=usr/share/man/man5/utmp.5.gz OLD_FILES+=usr/share/man/man5/wtmp.5.gz OLD_LIBS+=lib/libutil.so.8 +.if ${TARGET_ARCH} == "amd64" +OLB_LIBS+=usr/lib32/libutil.so.8 +.endif # 20100105: new userland semaphore implementation OLD_FILES+=usr/include/sys/semaphore.h # 20100103: ntptrace(8) removed From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 10:02:36 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 937E8106564A; Wed, 14 Mar 2012 10:02:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63B418FC14; Wed, 14 Mar 2012 10:02:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2EA2aMi096567; Wed, 14 Mar 2012 10:02:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2EA2aYS096565; Wed, 14 Mar 2012 10:02:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203141002.q2EA2aYS096565@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 Mar 2012 10:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232962 - in stable/9/sys: boot/common i386/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 10:02:36 -0000 Author: marius Date: Wed Mar 14 10:02:35 2012 New Revision: 232962 URL: http://svn.freebsd.org/changeset/base/232962 Log: MFC: r232822 Fix a bug introduced in r223938; on big-endian machines coping a 32-bit quantum bytewise to the address of a 64-bit variable results in writing to the "wrong" 32-bit half so adjust the address accordingly. This fix is implemented in a hackish way for two reasons: o in order to be able to get it into 8.3 with zero impact on the little- endian architectures where this bug has no effect and o to avoid blowing the x86 boot2 out of the water again when compiling it with clang, which all sane versions of this fix tested do. This change fixes booting from UFS1 file systems on big-endian machines. Modified: stable/9/sys/boot/common/ufsread.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/boot/common/ufsread.c ============================================================================== --- stable/9/sys/boot/common/ufsread.c Wed Mar 14 09:44:46 2012 (r232961) +++ stable/9/sys/boot/common/ufsread.c Wed Mar 14 10:02:35 2012 (r232962) @@ -46,6 +46,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -262,15 +264,28 @@ fsread(ino_t inode, void *buf, size_t nb } n = (lbn - NDADDR) & (n - 1); #if defined(UFS1_ONLY) +#if BYTE_ORDER == BIG_ENDIAN + memcpy((char *)&addr + sizeof(addr) - + sizeof(ufs1_daddr_t), (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); +#else memcpy(&addr, (ufs1_daddr_t *)indbuf + n, sizeof(ufs1_daddr_t)); +#endif #elif defined(UFS2_ONLY) memcpy(&addr, (ufs2_daddr_t *)indbuf + n, sizeof(ufs2_daddr_t)); #else if (fs.fs_magic == FS_UFS1_MAGIC) +#if BYTE_ORDER == BIG_ENDIAN + memcpy((char *)&addr + sizeof(addr) - + sizeof(ufs1_daddr_t), + (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); +#else memcpy(&addr, (ufs1_daddr_t *)indbuf + n, sizeof(ufs1_daddr_t)); +#endif else memcpy(&addr, (ufs2_daddr_t *)indbuf + n, sizeof(ufs2_daddr_t)); From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 10:02:43 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4FFF1065781; Wed, 14 Mar 2012 10:02:43 +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 286078FC08; Wed, 14 Mar 2012 10:02:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2EA2h9v096608; Wed, 14 Mar 2012 10:02:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2EA2gop096606; Wed, 14 Mar 2012 10:02:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203141002.q2EA2gop096606@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 Mar 2012 10:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232963 - in stable/8/sys: boot/common i386/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 10:02:43 -0000 Author: marius Date: Wed Mar 14 10:02:42 2012 New Revision: 232963 URL: http://svn.freebsd.org/changeset/base/232963 Log: MFC: r232822 Fix a bug introduced in r223938 (MFC'ed to stable/8 in r224411); on big-endian machines coping a 32-bit quantum bytewise to the address of a 64-bit variable results in writing to the "wrong" 32-bit half so adjust the address accordingly. This fix is implemented in a hackish way for two reasons: o in order to be able to get it into 8.3 with zero impact on the little- endian architectures where this bug has no effect and o to avoid blowing the x86 boot2 out of the water again when compiling it with clang, which all sane versions of this fix tested do. This change fixes booting from UFS1 file systems on big-endian machines. Modified: stable/8/sys/boot/common/ufsread.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/boot/common/ufsread.c ============================================================================== --- stable/8/sys/boot/common/ufsread.c Wed Mar 14 10:02:35 2012 (r232962) +++ stable/8/sys/boot/common/ufsread.c Wed Mar 14 10:02:42 2012 (r232963) @@ -46,6 +46,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -262,15 +264,28 @@ fsread(ino_t inode, void *buf, size_t nb } n = (lbn - NDADDR) & (n - 1); #if defined(UFS1_ONLY) +#if BYTE_ORDER == BIG_ENDIAN + memcpy((char *)&addr + sizeof(addr) - + sizeof(ufs1_daddr_t), (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); +#else memcpy(&addr, (ufs1_daddr_t *)indbuf + n, sizeof(ufs1_daddr_t)); +#endif #elif defined(UFS2_ONLY) memcpy(&addr, (ufs2_daddr_t *)indbuf + n, sizeof(ufs2_daddr_t)); #else if (fs.fs_magic == FS_UFS1_MAGIC) +#if BYTE_ORDER == BIG_ENDIAN + memcpy((char *)&addr + sizeof(addr) - + sizeof(ufs1_daddr_t), + (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); +#else memcpy(&addr, (ufs1_daddr_t *)indbuf + n, sizeof(ufs1_daddr_t)); +#endif else memcpy(&addr, (ufs2_daddr_t *)indbuf + n, sizeof(ufs2_daddr_t)); From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 13:09:43 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DCBB1065673; Wed, 14 Mar 2012 13:09:43 +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 1D6F48FC0C; Wed, 14 Mar 2012 13:09:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ED9fUI014932; Wed, 14 Mar 2012 13:09:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ED9f1x014930; Wed, 14 Mar 2012 13:09:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201203141309.q2ED9f1x014930@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 Mar 2012 13:09: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: r232966 - stable/7/sys/boot/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 13:09:43 -0000 Author: marius Date: Wed Mar 14 13:09:41 2012 New Revision: 232966 URL: http://svn.freebsd.org/changeset/base/232966 Log: MFC: r232822 Fix a bug introduced in r223938 (MFC'ed to stable/7 in r224410); on big-endian machines coping a 32-bit quantum bytewise to the address of a 64-bit variable results in writing to the "wrong" 32-bit half so adjust the address accordingly. This fix is implemented in a hackish way for two reasons: o in order to be able to get it into 8.3 with zero impact on the little- endian architectures where this bug has no effect and o to avoid blowing the x86 boot2 out of the water again when compiling it with clang, which all sane versions of this fix tested do. This change fixes booting from UFS1 file systems on big-endian machines. Modified: stable/7/sys/boot/common/ufsread.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Wed Mar 14 13:08:16 2012 (r232965) +++ stable/7/sys/boot/common/ufsread.c Wed Mar 14 13:09:41 2012 (r232966) @@ -46,6 +46,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -262,15 +264,28 @@ fsread(ino_t inode, void *buf, size_t nb } n = (lbn - NDADDR) & (n - 1); #if defined(UFS1_ONLY) +#if BYTE_ORDER == BIG_ENDIAN + memcpy((char *)&addr + sizeof(addr) - + sizeof(ufs1_daddr_t), (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); +#else memcpy(&addr, (ufs1_daddr_t *)indbuf + n, sizeof(ufs1_daddr_t)); +#endif #elif defined(UFS2_ONLY) memcpy(&addr, (ufs2_daddr_t *)indbuf + n, sizeof(ufs2_daddr_t)); #else if (fs.fs_magic == FS_UFS1_MAGIC) +#if BYTE_ORDER == BIG_ENDIAN + memcpy((char *)&addr + sizeof(addr) - + sizeof(ufs1_daddr_t), + (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); +#else memcpy(&addr, (ufs1_daddr_t *)indbuf + n, sizeof(ufs1_daddr_t)); +#endif else memcpy(&addr, (ufs2_daddr_t *)indbuf + n, sizeof(ufs2_daddr_t)); From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 14:14:17 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0AEB81065743; Wed, 14 Mar 2012 14:14:17 +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 E8F728FC15; Wed, 14 Mar 2012 14:14:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2EEEGsL017025; Wed, 14 Mar 2012 14:14:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2EEEG21017023; Wed, 14 Mar 2012 14:14:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203141414.q2EEEG21017023@svn.freebsd.org> From: Alexander Motin Date: Wed, 14 Mar 2012 14:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232968 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 14:14:17 -0000 Author: mav Date: Wed Mar 14 14:14:16 2012 New Revision: 232968 URL: http://svn.freebsd.org/changeset/base/232968 Log: Dummy-initizlize variables to fix build breakage after r232942, because of gcc falsely reporting variables as uninitialized. Code committed at that revision don't even touch half of mentioned variables. This is direct commit to 8-STABLE, as HEAD and 9-STABLE have no problem. Modified: stable/8/sys/cam/scsi/scsi_da.c Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Wed Mar 14 14:01:51 2012 (r232967) +++ stable/8/sys/cam/scsi/scsi_da.c Wed Mar 14 14:14:16 2012 (r232968) @@ -1960,7 +1960,8 @@ dadone(struct cam_periph *periph, union scsi_extract_sense(sense, &error_code, &sense_key, &asc, &ascq); - } + } else + error_code = sense_key = asc = ascq = 0; /* * If we tried READ CAPACITY(16) and failed, * fallback to READ CAPACITY(10). From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 18:47:42 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83301106566B; Wed, 14 Mar 2012 18:47: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 723998FC17; Wed, 14 Mar 2012 18:47:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2EIlgLN026468; Wed, 14 Mar 2012 18:47:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2EIlg6j026466; Wed, 14 Mar 2012 18:47:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203141847.q2EIlg6j026466@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 14 Mar 2012 18:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232979 - stable/8/sys/ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 18:47:42 -0000 Author: kib Date: Wed Mar 14 18:47:41 2012 New Revision: 232979 URL: http://svn.freebsd.org/changeset/base/232979 Log: MFC r232833: Remove not needed ARGSUSED lint command. Modified: stable/8/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_vnops.c Wed Mar 14 16:43:22 2012 (r232978) +++ stable/8/sys/ufs/ffs/ffs_vnops.c Wed Mar 14 18:47:41 2012 (r232979) @@ -420,7 +420,6 @@ ffs_lock(ap) /* * Vnode op for reading. */ -/* ARGSUSED */ static int ffs_read(ap) struct vop_read_args /* { From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 21:45:45 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC973106566B; Wed, 14 Mar 2012 21:45:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA5D38FC0A; Wed, 14 Mar 2012 21:45:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2ELjjlR032965; Wed, 14 Mar 2012 21:45:45 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ELjjEs032962; Wed, 14 Mar 2012 21:45:45 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201203142145.q2ELjjEs032962@svn.freebsd.org> From: Sean Bruno Date: Wed, 14 Mar 2012 21:45: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: r232987 - stable/7/usr.sbin/syslogd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 21:45:45 -0000 Author: sbruno Date: Wed Mar 14 21:45:45 2012 New Revision: 232987 URL: http://svn.freebsd.org/changeset/base/232987 Log: MFC r183347 Add a flag, -T, that tells syslogd to always replace the timestamp on messages from the network. We already replace malformatted timestamps and this option lets us replace timestamps that are correctly formatted but wrong. PR: 120891 Submitted by: Thomas Vogt MFC after: 1 week MFC r186263 Fixing !INET6 builds after bumping WARNS to 3. MFC r186331 Constify 'name' field in struct funix. This commit makes syslogd(8) WARNS?=6 on amd64 but I have not tested under universe so keep WARNS?= level as-is for now. MFC r186234 Rather than hardcode the 'struct iovec iov' array size, use a #define. While I'm here bump WARNS to 3. Obtained from: Juniper Networks MFC r186236 Use passed parameter rather than the #define. (more accurate extraction of Juniper Networks change) MFC r224002 Add a new option, -N to disable the default and recommended syslogd(8) behavior, which binds to the well known UDP port. This option implies -s. Obtained from: delphij@ obrien@ avatar@ trhodes@ dwmalone@ Modified: stable/7/usr.sbin/syslogd/syslogd.8 stable/7/usr.sbin/syslogd/syslogd.c Directory Properties: stable/7/usr.sbin/syslogd/ (props changed) Modified: stable/7/usr.sbin/syslogd/syslogd.8 ============================================================================== --- stable/7/usr.sbin/syslogd/syslogd.8 Wed Mar 14 21:26:06 2012 (r232986) +++ stable/7/usr.sbin/syslogd/syslogd.8 Wed Mar 14 21:45:45 2012 (r232987) @@ -36,7 +36,7 @@ .Nd log systems messages .Sh SYNOPSIS .Nm -.Op Fl 468ACcdknosuv +.Op Fl 468ACcdkNnosuv .Op Fl a Ar allowed_peer .Op Fl b Ar bind_address .Op Fl f Ar config_file @@ -207,6 +207,13 @@ facility is reserved for messages read d Select the number of minutes between .Dq mark messages; the default is 20 minutes. +.It Fl N +Disable binding on UDP sockets. RFC 3164 recommends that outgoing +syslogd messages should originate from the privileged port, this +option +.Em disables +the recommended behavior. This option inherits +.Fl s . .It Fl n Disable dns query for every request. .It Fl o @@ -242,6 +249,11 @@ Do not log messages from remote machines If specified twice, no network socket will be opened at all, which also disables logging to remote machines. +.It Fl T +Always use the local time and date for messages received from the network, +instead of the timestamp field supplied in the message by the remote host. +This is useful if some of the originating hosts can't keep time properly +or are unable to generate a correct timestamp. .It Fl u Unique priority logging. Only log messages at the specified priority. @@ -308,6 +320,13 @@ will not append to log files that do not option is specified); therefore, they must be created manually before running .Nm . +.Pp +The date and time are taken from the received message. +If the format of the timestamp field is incorrect, +time obtained from the local host is used instead. +This can be overriden by the +.Fl T +flag. .Sh FILES .Bl -tag -width /var/run/syslog.pid -compact .It Pa /etc/syslog.conf Modified: stable/7/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/7/usr.sbin/syslogd/syslogd.c Wed Mar 14 21:26:06 2012 (r232986) +++ stable/7/usr.sbin/syslogd/syslogd.c Wed Mar 14 21:45:45 2012 (r232987) @@ -128,7 +128,7 @@ const char ctty[] = _PATH_CONSOLE; */ struct funix { int s; - char *name; + const char *name; mode_t mode; STAILQ_ENTRY(funix) next; }; @@ -277,6 +277,7 @@ static int fklog = -1; /* /dev/klog */ static int Initialized; /* set when we have initialized ourselves */ static int MarkInterval = 20 * 60; /* interval between marks in seconds */ static int MarkSeq; /* mark sequence number */ +static int NoBind; /* don't bind() as suggested by RFC 3164 */ static int SecureMode; /* when true, receive only unix domain socks */ #ifdef INET6 static int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */ @@ -293,6 +294,7 @@ static char bootfile[MAXLINE+1]; /* boot struct allowedpeer *AllowedPeers; /* List of allowed peers */ static int NumAllowed; /* Number of entries in AllowedPeers */ +static int RemoteAddDate; /* Always set the date on remote messages */ static int UniquePriority; /* Only log specified priority? */ static int LogFacPri; /* Put facility and priority in log message: */ @@ -322,7 +324,7 @@ static void logmsg(int, const char *, co static void log_deadchild(pid_t, int, const char *); static void markit(void); static int skip_message(const char *, const char *, int); -static void printline(const char *, char *); +static void printline(const char *, char *, int); static void printsys(char *); static int p_open(const char *, pid_t *); static void readklog(void); @@ -352,7 +354,8 @@ main(int argc, char *argv[]) socklen_t len; bindhostname = NULL; - while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nop:P:sS:uv")) != -1) + while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nNop:P:sS:Tuv")) + != -1) switch (ch) { case '4': family = PF_INET; @@ -430,6 +433,10 @@ main(int argc, char *argv[]) case 'm': /* mark interval */ MarkInterval = atoi(optarg) * 60; break; + case 'N': + NoBind = 1; + SecureMode = 1; + break; case 'n': resolve = 0; break; @@ -452,6 +459,9 @@ main(int argc, char *argv[]) errx(1, "%s path too long, exiting", optarg); funix_secure.name = optarg; break; + case 'T': + RemoteAddDate = 1; + break; case 'u': /* only log specified priority */ UniquePriority++; break; @@ -644,7 +654,7 @@ main(int argc, char *argv[]) hname = cvthname((struct sockaddr *)&frominet); unmapped((struct sockaddr *)&frominet); if (validate((struct sockaddr *)&frominet, hname)) - printline(hname, line); + printline(hname, line, RemoteAddDate ? ADDDATE : 0); } else if (l < 0 && errno != EINTR) logerror("recvfrom inet"); } @@ -657,7 +667,7 @@ main(int argc, char *argv[]) (struct sockaddr *)&fromunix, &len); if (l > 0) { line[l] = '\0'; - printline(LocalHostName, line); + printline(LocalHostName, line, 0); } else if (l < 0 && errno != EINTR) logerror("recvfrom unix"); } @@ -697,7 +707,7 @@ usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: syslogd [-468ACcdknosuv] [-a allowed_peer]", + "usage: syslogd [-468ACcdknosTuv] [-a allowed_peer]", " [-b bind_address] [-f config_file]", " [-l [mode:]path] [-m mark_interval]", " [-P pid_file] [-p log_socket]"); @@ -709,7 +719,7 @@ usage(void) * on the appropriate log files. */ static void -printline(const char *hname, char *msg) +printline(const char *hname, char *msg, int flags) { char *p, *q; long n; @@ -762,7 +772,7 @@ printline(const char *hname, char *msg) } *q = '\0'; - logmsg(pri, line, hname, 0); + logmsg(pri, line, hname, flags); } /* @@ -2180,10 +2190,13 @@ allowaddr(char *s) char *cp1, *cp2; struct allowedpeer ap; struct servent *se; - int masklen = -1, i; + int masklen = -1; struct addrinfo hints, *res; struct in_addr *addrp, *maskp; +#ifdef INET6 + int i; u_int32_t *addr6p, *mask6p; +#endif char ip[NI_MAXHOST]; #ifdef INET6 @@ -2339,12 +2352,15 @@ allowaddr(char *s) static int validate(struct sockaddr *sa, const char *hname) { - int i, j, reject; + int i; size_t l1, l2; char *cp, name[NI_MAXHOST], ip[NI_MAXHOST], port[NI_MAXSERV]; struct allowedpeer *ap; struct sockaddr_in *sin4, *a4p = NULL, *m4p = NULL; +#ifdef INET6 + int j, reject; struct sockaddr_in6 *sin6, *a6p = NULL, *m6p = NULL; +#endif struct addrinfo hints, *res; u_short sport; @@ -2647,13 +2663,24 @@ socksetup(int af, const char *bindhostna close(*s); continue; } - if (bind(*s, r->ai_addr, r->ai_addrlen) < 0) { - close(*s); - logerror("bind"); - continue; - } + /* + * RFC 3164 recommends that client side message + * should come from the privileged syslogd port. + * + * If the system administrator choose not to obey + * this, we can skip the bind() step so that the + * system will choose a port for us. + */ + if (!NoBind) { + if (bind(*s, r->ai_addr, r->ai_addrlen) < 0) { + close(*s); + logerror("bind"); + continue; + } - double_rbuf(*s); + if (!SecureMode) + double_rbuf(*s); + } (*socks)++; s++; From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 22:27:29 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B9081065670; Wed, 14 Mar 2012 22:27:29 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AAAD8FC14; Wed, 14 Mar 2012 22:27:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2EMRS54034502; Wed, 14 Mar 2012 22:27:28 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2EMRSTq034500; Wed, 14 Mar 2012 22:27:28 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201203142227.q2EMRSTq034500@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 14 Mar 2012 22:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232988 - stable/9/sys/dev/mps X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 22:27:29 -0000 Author: ken Date: Wed Mar 14 22:27:28 2012 New Revision: 232988 URL: http://svn.freebsd.org/changeset/base/232988 Log: MFC 232675 Make the mps(4) module depend on the cam module. Submitted by: Mykola Dzham Modified: stable/9/sys/dev/mps/mps_pci.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/mps/mps_pci.c ============================================================================== --- stable/9/sys/dev/mps/mps_pci.c Wed Mar 14 21:45:45 2012 (r232987) +++ stable/9/sys/dev/mps/mps_pci.c Wed Mar 14 22:27:28 2012 (r232988) @@ -87,6 +87,7 @@ static driver_t mps_pci_driver = { static devclass_t mps_devclass; DRIVER_MODULE(mps, pci, mps_pci_driver, mps_devclass, 0, 0); +MODULE_DEPEND(mps, cam, 1, 1, 1); struct mps_ident { uint16_t vendor; From owner-svn-src-stable@FreeBSD.ORG Wed Mar 14 22:30:15 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36459106566B; Wed, 14 Mar 2012 22:30:15 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 253CA8FC14; Wed, 14 Mar 2012 22:30:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2EMUFRk034671; Wed, 14 Mar 2012 22:30:15 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2EMUEZN034669; Wed, 14 Mar 2012 22:30:14 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201203142230.q2EMUEZN034669@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 14 Mar 2012 22:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232989 - stable/8/sys/dev/mps X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 22:30:15 -0000 Author: ken Date: Wed Mar 14 22:30:14 2012 New Revision: 232989 URL: http://svn.freebsd.org/changeset/base/232989 Log: MFC 232675 Make the mps(4) module depend on the cam module. Submitted by: Mykola Dzham Modified: stable/8/sys/dev/mps/mps_pci.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/mps/mps_pci.c ============================================================================== --- stable/8/sys/dev/mps/mps_pci.c Wed Mar 14 22:27:28 2012 (r232988) +++ stable/8/sys/dev/mps/mps_pci.c Wed Mar 14 22:30:14 2012 (r232989) @@ -87,6 +87,7 @@ static driver_t mps_pci_driver = { static devclass_t mps_devclass; DRIVER_MODULE(mps, pci, mps_pci_driver, mps_devclass, 0, 0); +MODULE_DEPEND(mps, cam, 1, 1, 1); struct mps_ident { uint16_t vendor; From owner-svn-src-stable@FreeBSD.ORG Thu Mar 15 02:37:15 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FACC106566B; Thu, 15 Mar 2012 02:37:15 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 153638FC12; Thu, 15 Mar 2012 02:37:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2F2bEpE042807; Thu, 15 Mar 2012 02:37:14 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2F2bER7042805; Thu, 15 Mar 2012 02:37:14 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201203150237.q2F2bER7042805@svn.freebsd.org> From: Kevin Lo Date: Thu, 15 Mar 2012 02:37:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232995 - stable/9/sys/fs/ntfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2012 02:37:15 -0000 Author: kevlo Date: Thu Mar 15 02:37:14 2012 New Revision: 232995 URL: http://svn.freebsd.org/changeset/base/232995 Log: MFC r232099: Check if the user has necessary permissions on the device Modified: stable/9/sys/fs/ntfs/ntfs_vfsops.c Directory Properties: stable/9/sys/fs/ntfs/ (props changed) Modified: stable/9/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- stable/9/sys/fs/ntfs/ntfs_vfsops.c Thu Mar 15 01:43:44 2012 (r232994) +++ stable/9/sys/fs/ntfs/ntfs_vfsops.c Thu Mar 15 02:37:14 2012 (r232995) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -150,13 +151,16 @@ static const char *ntfs_opts[] = { }; static int -ntfs_mount (struct mount *mp) +ntfs_mount(struct mount *mp) { - int err = 0, error; - struct vnode *devvp; + int err = 0, error; + accmode_t accmode; + struct vnode *devvp; struct nameidata ndp; + struct thread *td; char *from; + td = curthread; if (vfs_filteropt(mp->mnt_optnew, ntfs_opts)) return (EINVAL); @@ -183,7 +187,7 @@ ntfs_mount (struct mount *mp) * Not an update, or updating the name: look up the name * and verify that it refers to a sensible block device. */ - NDINIT(&ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, from, curthread); + NDINIT(&ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, from, td); err = namei(&ndp); if (err) { /* can't get devvp!*/ @@ -197,6 +201,21 @@ ntfs_mount (struct mount *mp) return (err); } + /* + * If mount by non-root, then verify that user has necessary + * permissions on the device. + */ + accmode = VREAD; + if ((mp->mnt_flag & MNT_RDONLY) == 0) + accmode |= VWRITE; + err = VOP_ACCESS(devvp, accmode, td->td_ucred, td); + if (err) + err = priv_check(td, PRIV_VFS_MOUNT_PERM); + if (err) { + vput(devvp); + return (err); + } + if (mp->mnt_flag & MNT_UPDATE) { #if 0 /* @@ -230,7 +249,7 @@ ntfs_mount (struct mount *mp) /* Save "mounted from" info for mount point (NULL pad)*/ vfs_mountedfrom(mp, from); - err = ntfs_mountfs(devvp, mp, curthread); + err = ntfs_mountfs(devvp, mp, td); } if (err) { vrele(devvp); @@ -243,7 +262,7 @@ error_1: /* no state to back out*/ /* XXX: missing NDFREE(&ndp, ...) */ success: - return(err); + return (err); } /* From owner-svn-src-stable@FreeBSD.ORG Thu Mar 15 02:46:13 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF84F106566B; Thu, 15 Mar 2012 02:46:13 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E6188FC14; Thu, 15 Mar 2012 02:46:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2F2kDsX043189; Thu, 15 Mar 2012 02:46:13 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2F2kDgK043186; Thu, 15 Mar 2012 02:46:13 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201203150246.q2F2kDgK043186@svn.freebsd.org> From: Kevin Lo Date: Thu, 15 Mar 2012 02:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232996 - stable/9/sys/fs/ntfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2012 02:46:13 -0000 Author: kevlo Date: Thu Mar 15 02:46:12 2012 New Revision: 232996 URL: http://svn.freebsd.org/changeset/base/232996 Log: MFC r232100: Remove an unused structure and unnecessary cast Modified: stable/9/sys/fs/ntfs/ntfs.h stable/9/sys/fs/ntfs/ntfs_vfsops.c Directory Properties: stable/9/sys/fs/ntfs/ (props changed) Modified: stable/9/sys/fs/ntfs/ntfs.h ============================================================================== --- stable/9/sys/fs/ntfs/ntfs.h Thu Mar 15 02:37:14 2012 (r232995) +++ stable/9/sys/fs/ntfs/ntfs.h Thu Mar 15 02:46:12 2012 (r232996) @@ -36,7 +36,7 @@ typedef u_int16_t wchar; #pragma pack(1) #define BBSIZE 1024 #define BBOFF ((off_t)(0)) -#define BBLOCK ((daddr_t)(0)) +#define BBLOCK 0 #define NTFS_MFTINO 0 #define NTFS_VOLUMEINO 3 #define NTFS_ATTRDEFINO 4 Modified: stable/9/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- stable/9/sys/fs/ntfs/ntfs_vfsops.c Thu Mar 15 02:37:14 2012 (r232995) +++ stable/9/sys/fs/ntfs/ntfs_vfsops.c Thu Mar 15 02:46:12 2012 (r232996) @@ -67,8 +67,6 @@ MALLOC_DEFINE(M_NTFSNTNODE,"ntfs_ntnode" MALLOC_DEFINE(M_NTFSFNODE,"ntfs_fnode", "NTFS fnode information"); MALLOC_DEFINE(M_NTFSDIR,"ntfs_dir", "NTFS dir buffer"); -struct sockaddr; - static int ntfs_mountfs(register struct vnode *, struct mount *, struct thread *); static int ntfs_calccfree(struct ntfsmount *ntmp, cn_t *cfreep); From owner-svn-src-stable@FreeBSD.ORG Thu Mar 15 11:06:37 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8B241065672; Thu, 15 Mar 2012 11:06:37 +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 917478FC0C; Thu, 15 Mar 2012 11:06:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2FB6bmJ062646; Thu, 15 Mar 2012 11:06:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2FB6bBu062639; Thu, 15 Mar 2012 11:06:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203151106.q2FB6bBu062639@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 15 Mar 2012 11:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233001 - stable/9/sys/vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2012 11:06:37 -0000 Author: kib Date: Thu Mar 15 11:06:37 2012 New Revision: 233001 URL: http://svn.freebsd.org/changeset/base/233001 Log: MFC r232071: Account the writeable shared mappings backed by file in the vnode v_writecount. MFC r232103: Place the if() at the right location. MFC note: the added struct vm_object un_pager.vnp.writemappings member is located after the fields of struct vm_object that could be accessed from the modules. Modified: stable/9/sys/vm/vm_map.c stable/9/sys/vm/vm_map.h stable/9/sys/vm/vm_mmap.c stable/9/sys/vm/vm_object.h stable/9/sys/vm/vnode_pager.c stable/9/sys/vm/vnode_pager.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Thu Mar 15 08:39:10 2012 (r233000) +++ stable/9/sys/vm/vm_map.c Thu Mar 15 11:06:37 2012 (r233001) @@ -91,6 +91,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -475,11 +476,23 @@ vm_map_process_deferred(void) { struct thread *td; vm_map_entry_t entry; + vm_object_t object; td = curthread; - while ((entry = td->td_map_def_user) != NULL) { td->td_map_def_user = entry->next; + if ((entry->eflags & MAP_ENTRY_VN_WRITECNT) != 0) { + /* + * Decrement the object's writemappings and + * possibly the vnode's v_writecount. + */ + KASSERT((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0, + ("Submap with writecount")); + object = entry->object.vm_object; + KASSERT(object != NULL, ("No object for writecount")); + vnode_pager_release_writecount(object, entry->start, + entry->end); + } vm_map_entry_deallocate(entry, FALSE); } } @@ -1174,6 +1187,8 @@ vm_map_insert(vm_map_t map, vm_object_t protoeflags |= MAP_ENTRY_NOSYNC; if (cow & MAP_DISABLE_COREDUMP) protoeflags |= MAP_ENTRY_NOCOREDUMP; + if (cow & MAP_VN_WRITECOUNT) + protoeflags |= MAP_ENTRY_VN_WRITECNT; if (cow & MAP_INHERIT_SHARE) inheritance = VM_INHERIT_SHARE; else @@ -1516,6 +1531,11 @@ vm_map_simplify_entry(vm_map_t map, vm_m * references. Thus, the map lock can be kept * without causing a lock-order reversal with * the vnode lock. + * + * Since we count the number of virtual page + * mappings in object->un_pager.vnp.writemappings, + * the writemappings value should not be adjusted + * when the entry is disposed of. */ if (prev->object.vm_object) vm_object_deallocate(prev->object.vm_object); @@ -1627,6 +1647,13 @@ _vm_map_clip_start(vm_map_t map, vm_map_ if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { vm_object_reference(new_entry->object.vm_object); + /* + * The object->un_pager.vnp.writemappings for the + * object of MAP_ENTRY_VN_WRITECNT type entry shall be + * kept as is here. The virtual pages are + * re-distributed among the clipped entries, so the sum is + * left the same. + */ } } @@ -2900,6 +2927,7 @@ vm_map_copy_entry( vm_ooffset_t *fork_charge) { vm_object_t src_object; + vm_map_entry_t fake_entry; vm_offset_t size; struct ucred *cred; int charged; @@ -2965,6 +2993,27 @@ vm_map_copy_entry( src_entry->eflags |= (MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY); dst_entry->eflags |= (MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY); dst_entry->offset = src_entry->offset; + if (src_entry->eflags & MAP_ENTRY_VN_WRITECNT) { + /* + * MAP_ENTRY_VN_WRITECNT cannot + * indicate write reference from + * src_entry, since the entry is + * marked as needs copy. Allocate a + * fake entry that is used to + * decrement object->un_pager.vnp.writecount + * at the appropriate time. Attach + * fake_entry to the deferred list. + */ + fake_entry = vm_map_entry_create(dst_map); + fake_entry->eflags = MAP_ENTRY_VN_WRITECNT; + src_entry->eflags &= ~MAP_ENTRY_VN_WRITECNT; + vm_object_reference(src_object); + fake_entry->object.vm_object = src_object; + fake_entry->start = src_entry->start; + fake_entry->end = src_entry->end; + fake_entry->next = curthread->td_map_def_user; + curthread->td_map_def_user = fake_entry; + } } else { dst_entry->object.vm_object = NULL; dst_entry->offset = 0; @@ -3043,6 +3092,7 @@ vmspace_fork(struct vmspace *vm1, vm_oof vm_map_lock(old_map); if (old_map->busy) vm_map_wait_busy(old_map); + new_map = NULL; /* silence gcc */ vm2 = vmspace_alloc(old_map->min_offset, old_map->max_offset); if (vm2 == NULL) goto unlock_and_return; @@ -3122,6 +3172,16 @@ vmspace_fork(struct vmspace *vm1, vm_oof new_entry->eflags &= ~(MAP_ENTRY_USER_WIRED | MAP_ENTRY_IN_TRANSITION); new_entry->wired_count = 0; + if (new_entry->eflags & MAP_ENTRY_VN_WRITECNT) { + object = new_entry->object.vm_object; + KASSERT(((struct vnode *)object->handle)-> + v_writecount > 0, + ("vmspace_fork: v_writecount")); + KASSERT(object->un_pager.vnp.writemappings > 0, + ("vmspace_fork: vnp.writecount")); + vnode_pager_update_writecount(object, + new_entry->start, new_entry->end); + } /* * Insert the entry into the new map -- we know we're @@ -3146,8 +3206,11 @@ vmspace_fork(struct vmspace *vm1, vm_oof */ new_entry = vm_map_entry_create(new_map); *new_entry = *old_entry; + /* + * Copied entry is COW over the old object. + */ new_entry->eflags &= ~(MAP_ENTRY_USER_WIRED | - MAP_ENTRY_IN_TRANSITION); + MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_VN_WRITECNT); new_entry->wired_count = 0; new_entry->object.vm_object = NULL; new_entry->cred = NULL; @@ -3161,9 +3224,15 @@ vmspace_fork(struct vmspace *vm1, vm_oof old_entry = old_entry->next; } unlock_and_return: - vm_map_unlock(old_map); + /* + * Use inlined vm_map_unlock() to postpone handling the deferred + * map entries, which cannot be done until both old_map and + * new_map locks are released. + */ + sx_xunlock(&old_map->lock); if (vm2 != NULL) - vm_map_unlock(new_map); + sx_xunlock(&new_map->lock); + vm_map_process_deferred(); return (vm2); } Modified: stable/9/sys/vm/vm_map.h ============================================================================== --- stable/9/sys/vm/vm_map.h Thu Mar 15 08:39:10 2012 (r233000) +++ stable/9/sys/vm/vm_map.h Thu Mar 15 11:06:37 2012 (r233001) @@ -139,6 +139,7 @@ struct vm_map_entry { #define MAP_ENTRY_GROWS_UP 0x2000 /* Bottom-up stacks */ #define MAP_ENTRY_WIRE_SKIPPED 0x4000 +#define MAP_ENTRY_VN_WRITECNT 0x8000 /* writeable vnode mapping */ #ifdef _KERNEL static __inline u_char @@ -315,6 +316,7 @@ long vmspace_wired_count(struct vmspace #define MAP_DISABLE_SYNCER 0x0020 #define MAP_DISABLE_COREDUMP 0x0100 #define MAP_PREFAULT_MADVISE 0x0200 /* from (user) madvise request */ +#define MAP_VN_WRITECOUNT 0x0400 #define MAP_STACK_GROWS_DOWN 0x1000 #define MAP_STACK_GROWS_UP 0x2000 #define MAP_ACC_CHARGED 0x4000 Modified: stable/9/sys/vm/vm_mmap.c ============================================================================== --- stable/9/sys/vm/vm_mmap.c Thu Mar 15 08:39:10 2012 (r233000) +++ stable/9/sys/vm/vm_mmap.c Thu Mar 15 11:06:37 2012 (r233001) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef HWPMC_HOOKS #include @@ -93,7 +94,7 @@ struct sbrk_args { #endif static int vm_mmap_vnode(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, - int *, struct vnode *, vm_ooffset_t *, vm_object_t *); + int *, struct vnode *, vm_ooffset_t *, vm_object_t *, boolean_t *); static int vm_mmap_cdev(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, int *, struct cdev *, vm_ooffset_t *, vm_object_t *); static int vm_mmap_shm(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, @@ -1218,28 +1219,33 @@ sys_munlock(td, uap) /* * vm_mmap_vnode() * - * MPSAFE - * * Helper function for vm_mmap. Perform sanity check specific for mmap * operations on vnodes. + * + * For VCHR vnodes, the vnode lock is held over the call to + * vm_mmap_cdev() to keep vp->v_rdev valid. */ int vm_mmap_vnode(struct thread *td, vm_size_t objsize, vm_prot_t prot, vm_prot_t *maxprotp, int *flagsp, - struct vnode *vp, vm_ooffset_t *foffp, vm_object_t *objp) + struct vnode *vp, vm_ooffset_t *foffp, vm_object_t *objp, + boolean_t *writecounted) { struct vattr va; vm_object_t obj; vm_offset_t foff; struct mount *mp; struct ucred *cred; - int error, flags; - int vfslocked; + int error, flags, locktype, vfslocked; mp = vp->v_mount; cred = td->td_ucred; + if ((*maxprotp & VM_PROT_WRITE) && (*flagsp & MAP_SHARED)) + locktype = LK_EXCLUSIVE; + else + locktype = LK_SHARED; vfslocked = VFS_LOCK_GIANT(mp); - if ((error = vget(vp, LK_SHARED, td)) != 0) { + if ((error = vget(vp, locktype, td)) != 0) { VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1256,8 +1262,20 @@ vm_mmap_vnode(struct thread *td, vm_size } if (obj->handle != vp) { vput(vp); - vp = (struct vnode*)obj->handle; - vget(vp, LK_SHARED, td); + vp = (struct vnode *)obj->handle; + /* + * Bypass filesystems obey the mpsafety of the + * underlying fs. + */ + error = vget(vp, locktype, td); + if (error != 0) { + VFS_UNLOCK_GIANT(vfslocked); + return (error); + } + } + if (locktype == LK_EXCLUSIVE) { + *writecounted = TRUE; + vnode_pager_update_writecount(obj, 0, objsize); } } else if (vp->v_type == VCHR) { error = vm_mmap_cdev(td, objsize, prot, maxprotp, flagsp, @@ -1293,7 +1311,7 @@ vm_mmap_vnode(struct thread *td, vm_size objsize = round_page(va.va_size); if (va.va_nlink == 0) flags |= MAP_NOSYNC; - obj = vm_pager_allocate(OBJT_VNODE, vp, objsize, prot, foff, td->td_ucred); + obj = vm_pager_allocate(OBJT_VNODE, vp, objsize, prot, foff, cred); if (obj == NULL) { error = ENOMEM; goto done; @@ -1432,6 +1450,7 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, int rv = KERN_SUCCESS; int docow, error; struct thread *td = curthread; + boolean_t writecounted; if (size == 0) return (0); @@ -1470,6 +1489,8 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, return (EINVAL); fitit = FALSE; } + writecounted = FALSE; + /* * Lookup/allocate object. */ @@ -1480,7 +1501,7 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, break; case OBJT_VNODE: error = vm_mmap_vnode(td, size, prot, &maxprot, &flags, - handle, &foff, &object); + handle, &foff, &object, &writecounted); break; case OBJT_SWAP: error = vm_mmap_shm(td, size, prot, &maxprot, &flags, @@ -1520,6 +1541,8 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, /* Shared memory is also shared with children. */ if (flags & MAP_SHARED) docow |= MAP_INHERIT_SHARE; + if (writecounted) + docow |= MAP_VN_WRITECOUNT; if (flags & MAP_STACK) rv = vm_map_stack(map, *addr, size, prot, maxprot, @@ -1537,7 +1560,12 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, * Lose the object reference. Will destroy the * object if it's an unnamed anonymous mapping * or named anonymous without other references. + * + * If this mapping was accounted for in the vnode's + * writecount, then undo that now. */ + if (writecounted) + vnode_pager_release_writecount(object, 0, size); vm_object_deallocate(object); } Modified: stable/9/sys/vm/vm_object.h ============================================================================== --- stable/9/sys/vm/vm_object.h Thu Mar 15 08:39:10 2012 (r233000) +++ stable/9/sys/vm/vm_object.h Thu Mar 15 11:06:37 2012 (r233001) @@ -112,6 +112,7 @@ struct vm_object { */ struct { off_t vnp_size; + vm_ooffset_t writemappings; } vnp; /* Modified: stable/9/sys/vm/vnode_pager.c ============================================================================== --- stable/9/sys/vm/vnode_pager.c Thu Mar 15 08:39:10 2012 (r233000) +++ stable/9/sys/vm/vnode_pager.c Thu Mar 15 11:06:37 2012 (r233001) @@ -222,6 +222,7 @@ retry: object = vm_object_allocate(OBJT_VNODE, OFF_TO_IDX(round_page(size))); object->un_pager.vnp.vnp_size = size; + object->un_pager.vnp.writemappings = 0; object->handle = handle; VI_LOCK(vp); @@ -268,10 +269,16 @@ vnode_pager_dealloc(object) wakeup(object); } ASSERT_VOP_ELOCKED(vp, "vnode_pager_dealloc"); + if (object->un_pager.vnp.writemappings > 0) { + object->un_pager.vnp.writemappings = 0; + vp->v_writecount--; + } vp->v_object = NULL; vp->v_vflag &= ~VV_TEXT; + VM_OBJECT_UNLOCK(object); while (refs-- > 0) vunref(vp); + VM_OBJECT_LOCK(object); } static boolean_t @@ -1215,3 +1222,81 @@ vnode_pager_undirty_pages(vm_page_t *ma, } VM_OBJECT_UNLOCK(obj); } + +void +vnode_pager_update_writecount(vm_object_t object, vm_offset_t start, + vm_offset_t end) +{ + struct vnode *vp; + vm_ooffset_t old_wm; + + VM_OBJECT_LOCK(object); + if (object->type != OBJT_VNODE) { + VM_OBJECT_UNLOCK(object); + return; + } + old_wm = object->un_pager.vnp.writemappings; + object->un_pager.vnp.writemappings += (vm_ooffset_t)end - start; + vp = object->handle; + if (old_wm == 0 && object->un_pager.vnp.writemappings != 0) { + ASSERT_VOP_ELOCKED(vp, "v_writecount inc"); + vp->v_writecount++; + } else if (old_wm != 0 && object->un_pager.vnp.writemappings == 0) { + ASSERT_VOP_ELOCKED(vp, "v_writecount dec"); + vp->v_writecount--; + } + VM_OBJECT_UNLOCK(object); +} + +void +vnode_pager_release_writecount(vm_object_t object, vm_offset_t start, + vm_offset_t end) +{ + struct vnode *vp; + struct mount *mp; + vm_offset_t inc; + int vfslocked; + + VM_OBJECT_LOCK(object); + + /* + * First, recheck the object type to account for the race when + * the vnode is reclaimed. + */ + if (object->type != OBJT_VNODE) { + VM_OBJECT_UNLOCK(object); + return; + } + + /* + * Optimize for the case when writemappings is not going to + * zero. + */ + inc = end - start; + if (object->un_pager.vnp.writemappings != inc) { + object->un_pager.vnp.writemappings -= inc; + VM_OBJECT_UNLOCK(object); + return; + } + + vp = object->handle; + vhold(vp); + VM_OBJECT_UNLOCK(object); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + mp = NULL; + vn_start_write(vp, &mp, V_WAIT); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + + /* + * Decrement the object's writemappings, by swapping the start + * and end arguments for vnode_pager_update_writecount(). If + * there was not a race with vnode reclaimation, then the + * vnode's v_writecount is decremented. + */ + vnode_pager_update_writecount(object, end, start); + VOP_UNLOCK(vp, 0); + vdrop(vp); + if (mp != NULL) + vn_finished_write(mp); + VFS_UNLOCK_GIANT(vfslocked); +} Modified: stable/9/sys/vm/vnode_pager.h ============================================================================== --- stable/9/sys/vm/vnode_pager.h Thu Mar 15 08:39:10 2012 (r233000) +++ stable/9/sys/vm/vnode_pager.h Thu Mar 15 11:06:37 2012 (r233001) @@ -46,7 +46,11 @@ int vnode_pager_generic_putpages(struct int count, boolean_t sync, int *rtvals); +void vnode_pager_release_writecount(vm_object_t object, vm_offset_t start, + vm_offset_t end); void vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written); +void vnode_pager_update_writecount(vm_object_t object, vm_offset_t start, + vm_offset_t end); #endif /* _KERNEL */ #endif /* _VNODE_PAGER_ */ From owner-svn-src-stable@FreeBSD.ORG Thu Mar 15 16:26:41 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 655661065672; Thu, 15 Mar 2012 16:26:41 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8368FC14; Thu, 15 Mar 2012 16:26:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2FGQfVc073997; Thu, 15 Mar 2012 16:26:41 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2FGQfuX073995; Thu, 15 Mar 2012 16:26:41 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201203151626.q2FGQfuX073995@svn.freebsd.org> From: Sean Bruno Date: Thu, 15 Mar 2012 16:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233007 - stable/9/usr.sbin/syslogd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2012 16:26:41 -0000 Author: sbruno Date: Thu Mar 15 16:26:40 2012 New Revision: 233007 URL: http://svn.freebsd.org/changeset/base/233007 Log: MFC r232986 Update man page to present -T argument in synopsis Modified: stable/9/usr.sbin/syslogd/syslogd.8 Directory Properties: stable/9/usr.sbin/syslogd/ (props changed) Modified: stable/9/usr.sbin/syslogd/syslogd.8 ============================================================================== --- stable/9/usr.sbin/syslogd/syslogd.8 Thu Mar 15 15:43:15 2012 (r233006) +++ stable/9/usr.sbin/syslogd/syslogd.8 Thu Mar 15 16:26:40 2012 (r233007) @@ -36,7 +36,7 @@ .Nd log systems messages .Sh SYNOPSIS .Nm -.Op Fl 468ACcdkNnosuv +.Op Fl 468ACcdkNnosTuv .Op Fl a Ar allowed_peer .Op Fl b Ar bind_address .Op Fl f Ar config_file From owner-svn-src-stable@FreeBSD.ORG Thu Mar 15 16:46:00 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 293BC10656D3; Thu, 15 Mar 2012 16:46:00 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 130D18FC1D; Thu, 15 Mar 2012 16:46:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2FGjxsD074738; Thu, 15 Mar 2012 16:45:59 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2FGjxBe074736; Thu, 15 Mar 2012 16:45:59 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201203151645.q2FGjxBe074736@svn.freebsd.org> From: Sean Bruno Date: Thu, 15 Mar 2012 16:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233008 - stable/8/usr.sbin/syslogd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2012 16:46:00 -0000 Author: sbruno Date: Thu Mar 15 16:45:59 2012 New Revision: 233008 URL: http://svn.freebsd.org/changeset/base/233008 Log: MFC r232986 Update man page to present -T argument in synopsis Modified: stable/8/usr.sbin/syslogd/syslogd.8 Directory Properties: stable/8/usr.sbin/syslogd/ (props changed) Modified: stable/8/usr.sbin/syslogd/syslogd.8 ============================================================================== --- stable/8/usr.sbin/syslogd/syslogd.8 Thu Mar 15 16:26:40 2012 (r233007) +++ stable/8/usr.sbin/syslogd/syslogd.8 Thu Mar 15 16:45:59 2012 (r233008) @@ -36,7 +36,7 @@ .Nd log systems messages .Sh SYNOPSIS .Nm -.Op Fl 468ACcdkNnosuv +.Op Fl 468ACcdkNnosTuv .Op Fl a Ar allowed_peer .Op Fl b Ar bind_address .Op Fl f Ar config_file From owner-svn-src-stable@FreeBSD.ORG Thu Mar 15 16:47:46 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EC8F1065673; Thu, 15 Mar 2012 16:47:46 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED7B18FC17; Thu, 15 Mar 2012 16:47:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2FGljvO074855; Thu, 15 Mar 2012 16:47:45 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2FGljnQ074853; Thu, 15 Mar 2012 16:47:45 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201203151647.q2FGljnQ074853@svn.freebsd.org> From: Sean Bruno Date: Thu, 15 Mar 2012 16:47: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: r233009 - stable/7/usr.sbin/syslogd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2012 16:47:46 -0000 Author: sbruno Date: Thu Mar 15 16:47:45 2012 New Revision: 233009 URL: http://svn.freebsd.org/changeset/base/233009 Log: MFC r232986 Update man page to present -T argument in synopsis Modified: stable/7/usr.sbin/syslogd/syslogd.8 Directory Properties: stable/7/usr.sbin/syslogd/ (props changed) Modified: stable/7/usr.sbin/syslogd/syslogd.8 ============================================================================== --- stable/7/usr.sbin/syslogd/syslogd.8 Thu Mar 15 16:45:59 2012 (r233008) +++ stable/7/usr.sbin/syslogd/syslogd.8 Thu Mar 15 16:47:45 2012 (r233009) @@ -36,7 +36,7 @@ .Nd log systems messages .Sh SYNOPSIS .Nm -.Op Fl 468ACcdkNnosuv +.Op Fl 468ACcdkNnosTuv .Op Fl a Ar allowed_peer .Op Fl b Ar bind_address .Op Fl f Ar config_file From owner-svn-src-stable@FreeBSD.ORG Thu Mar 15 22:08:26 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E4B2106566C; Thu, 15 Mar 2012 22:08:26 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CAF18FC0C; Thu, 15 Mar 2012 22:08:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2FM8QO0085415; Thu, 15 Mar 2012 22:08:26 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2FM8Q6s085413; Thu, 15 Mar 2012 22:08:26 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201203152208.q2FM8Q6s085413@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 15 Mar 2012 22:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233014 - in stable/9/sys: arm/mv i386/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2012 22:08:26 -0000 Author: raj Date: Thu Mar 15 22:08:25 2012 New Revision: 233014 URL: http://svn.freebsd.org/changeset/base/233014 Log: MFC r232512: Remove unused #defines. All this is now retrieved from the device tree. Modified: stable/9/sys/arm/mv/mvreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/arm/mv/mvreg.h ============================================================================== --- stable/9/sys/arm/mv/mvreg.h Thu Mar 15 21:48:27 2012 (r233013) +++ stable/9/sys/arm/mv/mvreg.h Thu Mar 15 22:08:25 2012 (r233014) @@ -34,132 +34,6 @@ #ifndef _MVREG_H_ #define _MVREG_H_ -/* - * Interrupt sources - */ -#if defined(SOC_MV_ORION) - -#define MV_INT_BRIDGE 0 /* AHB-MBus Bridge Interrupt */ -#define MV_INT_UART0 3 /* UART0 Interrupt */ -#define MV_INT_UART1 4 -#define MV_INT_GPIO7_0 6 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_8 7 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 8 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 9 /* GPIO[31:24] Interrupt */ -#define MV_INT_PEX0_ERR 10 /* PCI Express Error */ -#define MV_INT_PEX0 11 /* PCI Express INTA,B,C,D Message */ -#define MV_INT_PCI_ERR 15 /* PCI Error */ -#define MV_INT_USB_BERR 16 /* USB Bridge Error */ -#define MV_INT_USB_CI 17 /* USB Controller interrupt */ -#define MV_INT_GBERX 18 /* GbE receive interrupt */ -#define MV_INT_GBETX 19 /* GbE transmit interrupt */ -#define MV_INT_GBEMISC 20 /* GbE misc. interrupt */ -#define MV_INT_GBESUM 21 /* GbE summary interrupt */ -#define MV_INT_GBEERR 22 /* GbE error interrupt */ -#define MV_INT_IDMA_ERR 23 /* DMA error interrupt */ -#define MV_INT_IDMA0 24 /* IDMA chan. 0 completion interrupt */ -#define MV_INT_IDMA1 25 /* IDMA chan. 1 completion interrupt */ -#define MV_INT_IDMA2 26 /* IDMA chan. 2 completion interrupt */ -#define MV_INT_IDMA3 27 /* IDMA chan. 3 completion interrupt */ -#define MV_INT_SATA 29 /* Serial-ATA Interrupt */ - -#elif defined(SOC_MV_KIRKWOOD) - -#define MV_INT_BRIDGE 1 /* AHB-MBus Bridge Interrupt */ -#define MV_INT_XOR0_CHAN0 5 /* XOR engine 0 channel 0 Interrupt */ -#define MV_INT_XOR0_CHAN1 6 /* XOR engine 0 channel 1 Interrupt */ -#define MV_INT_XOR1_CHAN0 7 /* XOR engine 1 channel 0 Interrupt */ -#define MV_INT_XOR1_CHAN1 8 /* XOR engine 1 channel 1 Interrupt */ -#define MV_INT_PEX0 9 /* PCI Express INTA,B,C,D Message */ -#define MV_INT_GBESUM 11 /* GbE0 summary interrupt */ -#define MV_INT_GBERX 12 /* GbE0 receive interrupt */ -#define MV_INT_GBETX 13 /* GbE0 transmit interrupt */ -#define MV_INT_GBEMISC 14 /* GbE0 misc. interrupt */ -#define MV_INT_GBE1SUM 15 /* GbE1 summary interrupt */ -#define MV_INT_GBE1RX 16 /* GbE1 receive interrupt */ -#define MV_INT_GBE1TX 17 /* GbE1 transmit interrupt */ -#define MV_INT_GBE1MISC 18 /* GbE1 misc. interrupt */ -#define MV_INT_USB_CI 19 /* USB Controller interrupt */ -#define MV_INT_SATA 21 /* Serial-ATA Interrupt */ -#define MV_INT_CESA 22 /* Security engine completion int. */ -#define MV_INT_IDMA_ERR 23 /* DMA error interrupt */ -#define MV_INT_UART0 33 /* UART0 Interrupt */ -#define MV_INT_UART1 34 -#define MV_INT_GPIO7_0 35 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_8 36 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 37 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 38 /* GPIO[31:24] Interrupt */ -#define MV_INT_GPIOHI7_0 39 /* GPIOHI[7:0] Interrupt */ -#define MV_INT_GPIOHI15_8 40 /* GPIOHI[15:8] Interrupt */ -#define MV_INT_GPIOHI23_16 41 /* GPIOHI[23:16] Interrupt */ -#define MV_INT_XOR0_ERR 42 /* XOR engine 0 error Interrupt */ -#define MV_INT_XOR1_ERR 43 /* XOR engine 1 error Interrupt */ -#define MV_INT_PEX0_ERR 44 /* PCI Express Error */ -#define MV_INT_GBEERR 46 /* GbE0 error interrupt */ -#define MV_INT_GBE1ERR 47 /* GbE1 error interrupt */ -#define MV_INT_USB_BERR 48 /* USB Bridge Error */ - -#elif defined(SOC_MV_DISCOVERY) - -#define MV_INT_ERRSUM 0 /* Summary of error interrupts */ -#define MV_INT_SPI 1 /* SPI interrupt */ -#define MV_INT_TWSI0 2 /* TWSI0 interrupt */ -#define MV_INT_TWSI1 3 /* TWSI1 interrupt */ -#define MV_INT_IDMA0 4 /* IDMA Channel0 completion */ -#define MV_INT_IDMA1 5 /* IDMA Channel0 completion */ -#define MV_INT_IDMA2 6 /* IDMA Channel0 completion */ -#define MV_INT_IDMA3 7 /* IDMA Channel0 completion */ -#define MV_INT_TIMER0 8 /* Timer0 interrupt */ -#define MV_INT_TIMER1 9 /* Timer1 interrupt */ -#define MV_INT_TIMER2 10 /* Timer2 interrupt */ -#define MV_INT_TIMER3 11 /* Timer3 interrupt */ -#define MV_INT_UART0 12 /* UART0 interrupt */ -#define MV_INT_UART1 13 /* UART1 interrupt */ -#define MV_INT_UART2 14 /* UART2 interrupt */ -#define MV_INT_UART3 15 /* UART3 interrupt */ -#define MV_INT_USB0 16 /* USB0 interrupt */ -#define MV_INT_USB1 17 /* USB1 interrupt */ -#define MV_INT_USB2 18 /* USB2 interrupt */ -#define MV_INT_CESA 19 /* Crypto engine completion interrupt */ -#define MV_INT_XOR0 22 /* XOR engine 0 completion interrupt */ -#define MV_INT_XOR1 23 /* XOR engine 1 completion interrupt */ -#define MV_INT_SATA 26 /* SATA interrupt */ -#define MV_INT_PEX00 32 /* PCI Express port 0.0 INTA/B/C/D */ -#define MV_INT_PEX01 33 /* PCI Express port 0.1 INTA/B/C/D */ -#define MV_INT_PEX02 34 /* PCI Express port 0.2 INTA/B/C/D */ -#define MV_INT_PEX03 35 /* PCI Express port 0.3 INTA/B/C/D */ -#define MV_INT_PEX10 36 /* PCI Express port 1.0 INTA/B/C/D */ -#define MV_INT_PEX11 37 /* PCI Express port 1.1 INTA/B/C/D */ -#define MV_INT_PEX12 38 /* PCI Express port 1.2 INTA/B/C/D */ -#define MV_INT_PEX13 39 /* PCI Express port 1.3 INTA/B/C/D */ -#define MV_INT_GBESUM 40 /* Gigabit Ethernet Port 0 summary */ -#define MV_INT_GBERX 41 /* Gigabit Ethernet Port 0 Rx summary */ -#define MV_INT_GBETX 42 /* Gigabit Ethernet Port 0 Tx summary */ -#define MV_INT_GBEMISC 43 /* Gigabit Ethernet Port 0 Misc summ. */ -#define MV_INT_GBE1SUM 44 /* Gigabit Ethernet Port 1 summary */ -#define MV_INT_GBE1RX 45 /* Gigabit Ethernet Port 1 Rx summary */ -#define MV_INT_GBE1TX 46 /* Gigabit Ethernet Port 1 Tx summary */ -#define MV_INT_GBE1MISC 47 /* Gigabit Ethernet Port 1 Misc summ. */ -#define MV_INT_GPIO7_0 56 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_8 57 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 58 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 59 /* GPIO[31:24] Interrupt */ -#define MV_INT_DB_IN 60 /* Inbound Doorbell Cause reg Summary */ -#define MV_INT_DB_OUT 61 /* Outbound Doorbell Cause reg Summ. */ -#define MV_INT_CRYPT_ERR 64 /* Crypto engine error */ -#define MV_INT_DEV_ERR 65 /* Device bus error */ -#define MV_INT_IDMA_ERR 66 /* DMA error */ -#define MV_INT_CPU_ERR 67 /* CPU error */ -#define MV_INT_PEX0_ERR 68 /* PCI-Express port0 error */ -#define MV_INT_PEX1_ERR 69 /* PCI-Express port1 error */ -#define MV_INT_GBE_ERR 70 /* Gigabit Ethernet error */ -#define MV_INT_USB_ERR 72 /* USB error */ -#define MV_INT_DRAM_ERR 73 /* DRAM ECC error */ -#define MV_INT_XOR_ERR 74 /* XOR engine error */ -#define MV_INT_WD 79 /* WD Timer interrupt */ - -#endif /* SOC_MV_ORION */ - #define BRIDGE_IRQ_CAUSE 0x10 #define BRIGDE_IRQ_MASK 0x14 From owner-svn-src-stable@FreeBSD.ORG Thu Mar 15 22:15:07 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A5CEA106564A; Thu, 15 Mar 2012 22:15:07 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92B068FC12; Thu, 15 Mar 2012 22:15:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2FMF7KY085693; Thu, 15 Mar 2012 22:15:07 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2FMF72O085684; Thu, 15 Mar 2012 22:15:07 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201203152215.q2FMF72O085684@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 15 Mar 2012 22:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233015 - in stable/9/sys: boot/fdt/dts dev/fdt dev/mge dev/tsec i386/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2012 22:15:07 -0000 Author: raj Date: Thu Mar 15 22:15:06 2012 New Revision: 233015 URL: http://svn.freebsd.org/changeset/base/233015 Log: MFC r232518: Respect phy-handle property in Ethernet nodes of the device tree. This lets specify whereabouts of the parent PHY for a given MAC node (and get rid of ugly kludges in mge(4) and tsec(4)). Obtained from: Semihalf Modified: stable/9/sys/boot/fdt/dts/db78100.dts stable/9/sys/dev/fdt/fdt_common.c stable/9/sys/dev/fdt/fdt_common.h stable/9/sys/dev/mge/if_mge.c stable/9/sys/dev/mge/if_mgevar.h stable/9/sys/dev/tsec/if_tsec.c stable/9/sys/dev/tsec/if_tsec.h stable/9/sys/dev/tsec/if_tsec_fdt.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/boot/fdt/dts/db78100.dts ============================================================================== --- stable/9/sys/boot/fdt/dts/db78100.dts Thu Mar 15 22:08:25 2012 (r233014) +++ stable/9/sys/boot/fdt/dts/db78100.dts Thu Mar 15 22:15:06 2012 (r233015) @@ -221,6 +221,9 @@ phy0: ethernet-phy@0 { reg = <0x8>; }; + phy1: ethernet-phy@1 { + reg = <0x9>; + }; }; }; @@ -234,17 +237,7 @@ local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <45 46 47 44 70>; interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x9>; - }; - }; + phy-handle = <&phy1>; }; serial0: serial@12000 { Modified: stable/9/sys/dev/fdt/fdt_common.c ============================================================================== --- stable/9/sys/dev/fdt/fdt_common.c Thu Mar 15 22:08:25 2012 (r233014) +++ stable/9/sys/dev/fdt/fdt_common.c Thu Mar 15 22:15:06 2012 (r233015) @@ -542,11 +542,13 @@ out: } int -fdt_get_phyaddr(phandle_t node, int *phy_addr) +fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc) { phandle_t phy_node; ihandle_t phy_ihandle; pcell_t phy_handle, phy_reg; + uint32_t i; + device_t parent, child; if (OF_getprop(node, "phy-handle", (void *)&phy_handle, sizeof(phy_handle)) <= 0) @@ -561,6 +563,47 @@ fdt_get_phyaddr(phandle_t node, int *phy return (ENXIO); *phy_addr = fdt32_to_cpu(phy_reg); + + /* + * Search for softc used to communicate with phy. + */ + + /* + * Step 1: Search for ancestor of the phy-node with a "phy-handle" + * property set. + */ + phy_node = OF_parent(phy_node); + while (phy_node != 0) { + if (OF_getprop(phy_node, "phy-handle", (void *)&phy_handle, + sizeof(phy_handle)) > 0) + break; + phy_node = OF_parent(phy_node); + } + if (phy_node == 0) + return (ENXIO); + + /* + * Step 2: For each device with the same parent and name as ours + * compare its node with the one found in step 1, ancestor of phy + * node (stored in phy_node). + */ + parent = device_get_parent(dev); + i = 0; + child = device_find_child(parent, device_get_name(dev), i); + while (child != NULL) { + if (ofw_bus_get_node(child) == phy_node) + break; + i++; + child = device_find_child(parent, device_get_name(dev), i); + } + if (child == NULL) + return (ENXIO); + + /* + * Use softc of the device found. + */ + *phy_sc = (void *)device_get_softc(child); + return (0); } Modified: stable/9/sys/dev/fdt/fdt_common.h ============================================================================== --- stable/9/sys/dev/fdt/fdt_common.h Thu Mar 15 22:08:25 2012 (r233014) +++ stable/9/sys/dev/fdt/fdt_common.h Thu Mar 15 22:15:06 2012 (r233015) @@ -89,7 +89,7 @@ int fdt_data_to_res(pcell_t *, int, int, int fdt_data_verify(void *, int); phandle_t fdt_find_compatible(phandle_t, const char *, int); int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *); -int fdt_get_phyaddr(phandle_t node, int *); +int fdt_get_phyaddr(phandle_t, device_t, int *, void **); int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); int fdt_intr_decode(phandle_t, pcell_t *, int *, int *, int *); Modified: stable/9/sys/dev/mge/if_mge.c ============================================================================== --- stable/9/sys/dev/mge/if_mge.c Thu Mar 15 22:08:25 2012 (r233014) +++ stable/9/sys/dev/mge/if_mge.c Thu Mar 15 22:15:06 2012 (r233015) @@ -79,9 +79,6 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" -/* PHY registers are in the address space of the first mge unit */ -static struct mge_softc *sc_mge0 = NULL; - static int mge_probe(device_t dev); static int mge_attach(device_t dev); static int mge_detach(device_t dev); @@ -635,14 +632,11 @@ mge_attach(device_t dev) sc->dev = dev; sc->node = ofw_bus_get_node(dev); - if (device_get_unit(dev) == 0) - sc_mge0 = sc; - /* Set chip version-dependent parameters */ mge_ver_params(sc); - /* Get phy address from fdt */ - if (fdt_get_phyaddr(sc->node, &phy) != 0) + /* Get phy address and used softc from fdt */ + if (fdt_get_phyaddr(sc->node, sc->dev, &phy, (void **)&sc->phy_sc) != 0) return (ENXIO); /* Initialize mutexes */ @@ -1294,17 +1288,18 @@ mge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & + MGE_WRITE(sc->phy_sc, MGE_REG_SMI, 0x1fffffff & (MGE_SMI_READ | (reg << 21) | (phy << 16))); retries = MGE_SMI_READ_RETRIES; - while (--retries && !(MGE_READ(sc_mge0, MGE_REG_SMI) & MGE_SMI_READVALID)) + while (--retries && + !(MGE_READ(sc->phy_sc, MGE_REG_SMI) & MGE_SMI_READVALID)) DELAY(MGE_SMI_READ_DELAY); if (retries == 0) device_printf(dev, "Timeout while reading from PHY\n"); - return (MGE_READ(sc_mge0, MGE_REG_SMI) & 0xffff); + return (MGE_READ(sc->phy_sc, MGE_REG_SMI) & 0xffff); } static int @@ -1315,11 +1310,11 @@ mge_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & + MGE_WRITE(sc->phy_sc, MGE_REG_SMI, 0x1fffffff & (MGE_SMI_WRITE | (reg << 21) | (phy << 16) | (value & 0xffff))); retries = MGE_SMI_WRITE_RETRIES; - while (--retries && MGE_READ(sc_mge0, MGE_REG_SMI) & MGE_SMI_BUSY) + while (--retries && MGE_READ(sc->phy_sc, MGE_REG_SMI) & MGE_SMI_BUSY) DELAY(MGE_SMI_WRITE_DELAY); if (retries == 0) Modified: stable/9/sys/dev/mge/if_mgevar.h ============================================================================== --- stable/9/sys/dev/mge/if_mgevar.h Thu Mar 15 22:08:25 2012 (r233014) +++ stable/9/sys/dev/mge/if_mgevar.h Thu Mar 15 22:15:06 2012 (r233015) @@ -103,6 +103,8 @@ struct mge_softc { uint32_t mge_tx_tok_cnt; uint16_t mge_mtu; int mge_ver; + + struct mge_softc *phy_sc; }; Modified: stable/9/sys/dev/tsec/if_tsec.c ============================================================================== --- stable/9/sys/dev/tsec/if_tsec.c Thu Mar 15 22:08:25 2012 (r233014) +++ stable/9/sys/dev/tsec/if_tsec.c Thu Mar 15 22:15:06 2012 (r233015) @@ -106,8 +106,6 @@ static void tsec_offload_process_frame(s static void tsec_setup_multicast(struct tsec_softc *sc); static int tsec_set_mtu(struct tsec_softc *sc, unsigned int mtu); -struct tsec_softc *tsec0_sc = NULL; /* XXX ugly hack! */ - devclass_t tsec_devclass; DRIVER_MODULE(miibus, tsec, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(tsec, ether, 1, 1, 1); @@ -407,14 +405,14 @@ tsec_init_locked(struct tsec_softc *sc) TSEC_WRITE(sc, TSEC_REG_TBIPA, 5); /* Step 6: Reset the management interface */ - TSEC_WRITE(tsec0_sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_RESETMGMT); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_RESETMGMT); /* Step 7: Setup the MII Mgmt clock speed */ - TSEC_WRITE(tsec0_sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_CLKDIV28); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_CLKDIV28); /* Step 8: Read MII Mgmt indicator register and check for Busy = 0 */ timeout = TSEC_READ_RETRY; - while (--timeout && (TSEC_READ(tsec0_sc, TSEC_REG_MIIMIND) & + while (--timeout && (TSEC_READ(sc->phy_sc, TSEC_REG_MIIMIND) & TSEC_MIIMIND_BUSY)) DELAY(TSEC_READ_DELAY); if (timeout == 0) { @@ -1562,21 +1560,21 @@ tsec_miibus_readreg(device_t dev, int ph struct tsec_softc *sc; uint32_t timeout; - sc = tsec0_sc; + sc = device_get_softc(dev); - TSEC_WRITE(sc, TSEC_REG_MIIMADD, (phy << 8) | reg); - TSEC_WRITE(sc, TSEC_REG_MIIMCOM, 0); - TSEC_WRITE(sc, TSEC_REG_MIIMCOM, TSEC_MIIMCOM_READCYCLE); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMADD, (phy << 8) | reg); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCOM, 0); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCOM, TSEC_MIIMCOM_READCYCLE); timeout = TSEC_READ_RETRY; - while (--timeout && TSEC_READ(sc, TSEC_REG_MIIMIND) & + while (--timeout && TSEC_READ(sc->phy_sc, TSEC_REG_MIIMIND) & (TSEC_MIIMIND_NOTVALID | TSEC_MIIMIND_BUSY)) DELAY(TSEC_READ_DELAY); if (timeout == 0) device_printf(dev, "Timeout while reading from PHY!\n"); - return (TSEC_READ(sc, TSEC_REG_MIIMSTAT)); + return (TSEC_READ(sc->phy_sc, TSEC_REG_MIIMSTAT)); } int @@ -1585,13 +1583,13 @@ tsec_miibus_writereg(device_t dev, int p struct tsec_softc *sc; uint32_t timeout; - sc = tsec0_sc; + sc = device_get_softc(dev); - TSEC_WRITE(sc, TSEC_REG_MIIMADD, (phy << 8) | reg); - TSEC_WRITE(sc, TSEC_REG_MIIMCON, value); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMADD, (phy << 8) | reg); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCON, value); timeout = TSEC_READ_RETRY; - while (--timeout && (TSEC_READ(sc, TSEC_REG_MIIMIND) & + while (--timeout && (TSEC_READ(sc->phy_sc, TSEC_REG_MIIMIND) & TSEC_MIIMIND_BUSY)) DELAY(TSEC_READ_DELAY); Modified: stable/9/sys/dev/tsec/if_tsec.h ============================================================================== --- stable/9/sys/dev/tsec/if_tsec.h Thu Mar 15 22:08:25 2012 (r233014) +++ stable/9/sys/dev/tsec/if_tsec.h Thu Mar 15 22:15:06 2012 (r233015) @@ -133,6 +133,7 @@ struct tsec_softc { struct mbuf *frame; int phyaddr; + struct tsec_softc *phy_sc; }; /* interface to get/put generic objects */ Modified: stable/9/sys/dev/tsec/if_tsec_fdt.c ============================================================================== --- stable/9/sys/dev/tsec/if_tsec_fdt.c Thu Mar 15 22:08:25 2012 (r233014) +++ stable/9/sys/dev/tsec/if_tsec_fdt.c Thu Mar 15 22:15:06 2012 (r233015) @@ -68,8 +68,6 @@ __FBSDID("$FreeBSD$"); #define TSEC_RID_RXIRQ 1 #define TSEC_RID_ERRIRQ 2 -extern struct tsec_softc *tsec0_sc; - static int tsec_fdt_probe(device_t dev); static int tsec_fdt_attach(device_t dev); static int tsec_fdt_detach(device_t dev); @@ -156,12 +154,9 @@ tsec_fdt_attach(device_t dev) sc->dev = dev; sc->node = ofw_bus_get_node(dev); - /* XXX add comment on weird FSL's MII registers access design */ - if (device_get_unit(dev) == 0) - tsec0_sc = sc; - /* Get phy address from fdt */ - if (fdt_get_phyaddr(sc->node, &sc->phyaddr) != 0) + if (fdt_get_phyaddr(sc->node, sc->dev, &sc->phyaddr, + (void **)&sc->phy_sc) != 0) return (ENXIO); /* Init timer */ From owner-svn-src-stable@FreeBSD.ORG Fri Mar 16 03:16:11 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8D1D1065670; Fri, 16 Mar 2012 03:16:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DEA58FC0A; Fri, 16 Mar 2012 03:16:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2G3GBIK096792; Fri, 16 Mar 2012 03:16:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2G3GBZL096788; Fri, 16 Mar 2012 03:16:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203160316.q2G3GBZL096788@svn.freebsd.org> From: Eitan Adler Date: Fri, 16 Mar 2012 03:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233020 - stable/8/tools/regression/pipe X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 03:16:11 -0000 Author: eadler Date: Fri Mar 16 03:16:10 2012 New Revision: 233020 URL: http://svn.freebsd.org/changeset/base/233020 Log: MFC r228274: - Fix some uninitialized variables in pipe regression tests that result in failure. PR: misc/161175 Approved by: cperciva Modified: stable/8/tools/regression/pipe/pipe-fstatbug.c stable/8/tools/regression/pipe/pipe-reverse.c stable/8/tools/regression/pipe/pipe-wraparound.c Directory Properties: stable/8/tools/regression/pipe/ (props changed) Modified: stable/8/tools/regression/pipe/pipe-fstatbug.c ============================================================================== --- stable/8/tools/regression/pipe/pipe-fstatbug.c Thu Mar 15 23:53:24 2012 (r233019) +++ stable/8/tools/regression/pipe/pipe-fstatbug.c Fri Mar 16 03:16:10 2012 (r233020) @@ -41,7 +41,7 @@ int main (void) { char buffer[32768], buffer2[32768]; int desc[2]; -int error, successes; +int error, successes = 0; struct stat status; pid_t new_pid; Modified: stable/8/tools/regression/pipe/pipe-reverse.c ============================================================================== --- stable/8/tools/regression/pipe/pipe-reverse.c Thu Mar 15 23:53:24 2012 (r233019) +++ stable/8/tools/regression/pipe/pipe-reverse.c Fri Mar 16 03:16:10 2012 (r233020) @@ -44,6 +44,7 @@ struct stat status; pid_t new_pid; buggy = 0; +total = 0; error = pipe(desc); @@ -52,7 +53,7 @@ if (error) buffer[0] = 'A'; -for (i = 0; i < 65535; i++) { +for (i = 1; i < 65535; i++) { buffer[i] = buffer[i - 1] + 1; if (buffer[i] > 'Z') buffer[i] = 'A'; Modified: stable/8/tools/regression/pipe/pipe-wraparound.c ============================================================================== --- stable/8/tools/regression/pipe/pipe-wraparound.c Thu Mar 15 23:53:24 2012 (r233019) +++ stable/8/tools/regression/pipe/pipe-wraparound.c Fri Mar 16 03:16:10 2012 (r233020) @@ -44,6 +44,7 @@ struct stat status; pid_t new_pid; buggy = 0; +total = 0; error = pipe(desc); @@ -52,7 +53,7 @@ if (error) buffer[0] = 'A'; -for (i = 0; i < 32768; i++) { +for (i = 1; i < 32768; i++) { buffer[i] = buffer[i - 1] + 1; if (buffer[i] > 'Z') buffer[i] = 'A'; From owner-svn-src-stable@FreeBSD.ORG Fri Mar 16 03:22:38 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 139291065670; Fri, 16 Mar 2012 03:22:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 013118FC0A; Fri, 16 Mar 2012 03:22:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2G3Mb5E097040; Fri, 16 Mar 2012 03:22:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2G3MbVj097034; Fri, 16 Mar 2012 03:22:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203160322.q2G3MbVj097034@svn.freebsd.org> From: Eitan Adler Date: Fri, 16 Mar 2012 03:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233021 - in stable/8/usr.bin: brandelf bsdiff/bsdiff ncplist netstat split X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 03:22:38 -0000 Author: eadler Date: Fri Mar 16 03:22:37 2012 New Revision: 233021 URL: http://svn.freebsd.org/changeset/base/233021 Log: MFC r22990[45] and r229907-r229919: - fix a variety of warnings produced by gcc46 when compiling world Approved by (cperciva) Modified: stable/8/usr.bin/brandelf/brandelf.c stable/8/usr.bin/bsdiff/bsdiff/bsdiff.c stable/8/usr.bin/ncplist/ncplist.c stable/8/usr.bin/netstat/if.c stable/8/usr.bin/split/split.c Directory Properties: stable/8/sbin/tunefs/ (props changed) stable/8/usr.bin/brandelf/ (props changed) stable/8/usr.bin/bsdiff/ (props changed) stable/8/usr.bin/ncplist/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/split/ (props changed) Modified: stable/8/usr.bin/brandelf/brandelf.c ============================================================================== --- stable/8/usr.bin/brandelf/brandelf.c Fri Mar 16 03:16:10 2012 (r233020) +++ stable/8/usr.bin/brandelf/brandelf.c Fri Mar 16 03:22:37 2012 (r233021) @@ -64,7 +64,7 @@ main(int argc, char **argv) const char *strtype = "FreeBSD"; int type = ELFOSABI_FREEBSD; int retval = 0; - int ch, change = 0, verbose = 0, force = 0, listed = 0; + int ch, change = 0, force = 0, listed = 0; while ((ch = getopt(argc, argv, "f:lt:v")) != -1) switch (ch) { @@ -84,7 +84,7 @@ main(int argc, char **argv) listed = 1; break; case 'v': - verbose = 1; + /* does nothing */ break; case 't': if (force) Modified: stable/8/usr.bin/bsdiff/bsdiff/bsdiff.c ============================================================================== --- stable/8/usr.bin/bsdiff/bsdiff/bsdiff.c Fri Mar 16 03:16:10 2012 (r233020) +++ stable/8/usr.bin/bsdiff/bsdiff/bsdiff.c Fri Mar 16 03:22:37 2012 (r233021) @@ -272,7 +272,7 @@ int main(int argc,char *argv[]) /* Compute the differences, writing ctrl as we go */ if ((pfbz2 = BZ2_bzWriteOpen(&bz2err, pf, 9, 0, 0)) == NULL) errx(1, "BZ2_bzWriteOpen, bz2err = %d", bz2err); - scan=0;len=0; + scan=0;len=0;pos=0; lastscan=0;lastpos=0;lastoffset=0; while(scan Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 222551065670; Fri, 16 Mar 2012 08:47:00 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07E0C8FC08; Fri, 16 Mar 2012 08:47:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2G8kxTR008276; Fri, 16 Mar 2012 08:46:59 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2G8kw6a008223; Fri, 16 Mar 2012 08:46:58 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201203160846.q2G8kw6a008223@svn.freebsd.org> From: Scott Long Date: Fri, 16 Mar 2012 08:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233024 - in stable/9/sys/dev: advansys ahb aic7xxx amr an arcmsr asr buslogic bxe ciss cxgb de dpt en glxsb hatm hifn hptiop hptmv ida if_ndis iir ips ipw ixgb ixgbe lmc mfi mge mlx ml... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 08:47:00 -0000 Author: scottl Date: Fri Mar 16 08:46:58 2012 New Revision: 233024 URL: http://svn.freebsd.org/changeset/base/233024 Log: MFC 232854,232874,232882,232883,232886 for bus_get_dma_tag() Modified: stable/9/sys/dev/advansys/adv_eisa.c stable/9/sys/dev/advansys/adv_isa.c stable/9/sys/dev/advansys/adv_pci.c stable/9/sys/dev/advansys/adw_pci.c stable/9/sys/dev/ahb/ahb.c stable/9/sys/dev/aic7xxx/ahc_eisa.c stable/9/sys/dev/aic7xxx/ahc_isa.c stable/9/sys/dev/aic7xxx/ahc_pci.c stable/9/sys/dev/aic7xxx/ahd_pci.c stable/9/sys/dev/amr/amr_pci.c stable/9/sys/dev/an/if_an_pci.c stable/9/sys/dev/arcmsr/arcmsr.c stable/9/sys/dev/asr/asr.c stable/9/sys/dev/buslogic/bt_pci.c stable/9/sys/dev/bxe/if_bxe.c stable/9/sys/dev/ciss/ciss.c stable/9/sys/dev/cxgb/cxgb_sge.c stable/9/sys/dev/de/if_de.c stable/9/sys/dev/dpt/dpt_pci.c stable/9/sys/dev/en/midway.c stable/9/sys/dev/glxsb/glxsb.c stable/9/sys/dev/hatm/if_hatm.c stable/9/sys/dev/hifn/hifn7751.c stable/9/sys/dev/hptiop/hptiop.c stable/9/sys/dev/hptmv/entry.c stable/9/sys/dev/ida/ida_pci.c stable/9/sys/dev/if_ndis/if_ndis_pci.c stable/9/sys/dev/iir/iir_pci.c stable/9/sys/dev/ips/ips_pci.c stable/9/sys/dev/ipw/if_ipw.c stable/9/sys/dev/ipw/if_ipwvar.h stable/9/sys/dev/ixgb/if_ixgb.c stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/ixgbe/ixv.c stable/9/sys/dev/lmc/if_lmc.c stable/9/sys/dev/mfi/mfi_pci.c stable/9/sys/dev/mge/if_mge.c stable/9/sys/dev/mlx/mlx_pci.c stable/9/sys/dev/mly/mly.c stable/9/sys/dev/mxge/if_mxge.c stable/9/sys/dev/nve/if_nve.c stable/9/sys/dev/patm/if_patm_attach.c stable/9/sys/dev/safe/safe.c stable/9/sys/dev/trm/trm.c stable/9/sys/dev/twe/twe_freebsd.c stable/9/sys/dev/tws/tws.c stable/9/sys/dev/ubsec/ubsec.c stable/9/sys/dev/wds/wd7000.c stable/9/sys/dev/xen/blkfront/blkfront.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/advansys/adv_eisa.c ============================================================================== --- stable/9/sys/dev/advansys/adv_eisa.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/advansys/adv_eisa.c Fri Mar 16 08:46:58 2012 (r233024) @@ -171,9 +171,8 @@ adv_eisa_attach(device_t dev) * Allocate a parent dmatag for all tags created * by the MI portions of the advansys driver */ - /* XXX Should be a child of the PCI bus dma tag */ error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ ADV_EISA_MAX_DMA_ADDR, @@ -211,9 +210,8 @@ adv_eisa_attach(device_t dev) * Allocate a parent dmatag for all tags created * by the MI portions of the advansys driver */ - /* XXX Should be a child of the PCI bus dma tag */ error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ ADV_EISA_MAX_DMA_ADDR, Modified: stable/9/sys/dev/advansys/adv_isa.c ============================================================================== --- stable/9/sys/dev/advansys/adv_isa.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/advansys/adv_isa.c Fri Mar 16 08:46:58 2012 (r233024) @@ -226,9 +226,8 @@ adv_isa_probe(device_t dev) * Allocate a parent dmatag for all tags created * by the MI portions of the advansys driver */ - /* XXX Should be a child of the ISA bus dma tag */ error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, /* lowaddr */ lowaddr, Modified: stable/9/sys/dev/advansys/adv_pci.c ============================================================================== --- stable/9/sys/dev/advansys/adv_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/advansys/adv_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -187,9 +187,8 @@ adv_pci_attach(device_t dev) } /* Allocate a dmatag for our transfer DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ ADV_PCI_MAX_DMA_ADDR, Modified: stable/9/sys/dev/advansys/adw_pci.c ============================================================================== --- stable/9/sys/dev/advansys/adw_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/advansys/adw_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -258,9 +258,8 @@ adw_pci_attach(device_t dev) pci_write_config(dev, PCIR_COMMAND, command, /*bytes*/1); /* Allocate a dmatag for our transfer DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ ADW_PCI_MAX_DMA_ADDR, Modified: stable/9/sys/dev/ahb/ahb.c ============================================================================== --- stable/9/sys/dev/ahb/ahb.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/ahb/ahb.c Fri Mar 16 08:46:58 2012 (r233024) @@ -291,8 +291,7 @@ ahbattach(device_t dev) * need to perform during normal operation. */ /* DMA tag for mapping buffers into device visible space. */ - /* XXX Should be a child of the EISA bus dma tag */ - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, @@ -311,7 +310,7 @@ ahbattach(device_t dev) ahb->init_level++; /* DMA tag for our ccb structures and ha inquiry data */ - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, Modified: stable/9/sys/dev/aic7xxx/ahc_eisa.c ============================================================================== --- stable/9/sys/dev/aic7xxx/ahc_eisa.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/aic7xxx/ahc_eisa.c Fri Mar 16 08:46:58 2012 (r233024) @@ -130,7 +130,6 @@ aic7770_attach(device_t dev) ahc_set_unit(ahc, device_get_unit(dev)); /* Allocate a dmatag for our SCB DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ error = aic_dma_tag_create(ahc, /*parent*/bus_get_dma_tag(dev), /*alignment*/1, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, Modified: stable/9/sys/dev/aic7xxx/ahc_isa.c ============================================================================== --- stable/9/sys/dev/aic7xxx/ahc_isa.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/aic7xxx/ahc_isa.c Fri Mar 16 08:46:58 2012 (r233024) @@ -253,7 +253,6 @@ ahc_isa_attach(device_t dev) ahc_set_unit(ahc, device_get_unit(dev)); /* Allocate a dmatag for our SCB DMA maps */ - /* XXX Should be a child of the VLB/ISA bus dma tag */ error = aic_dma_tag_create(ahc, /*parent*/bus_get_dma_tag(dev), /*alignment*/1, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, Modified: stable/9/sys/dev/aic7xxx/ahc_pci.c ============================================================================== --- stable/9/sys/dev/aic7xxx/ahc_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/aic7xxx/ahc_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -105,7 +105,6 @@ ahc_pci_attach(device_t dev) ahc->flags |= AHC_39BIT_ADDRESSING; /* Allocate a dmatag for our SCB DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ error = aic_dma_tag_create(ahc, /*parent*/bus_get_dma_tag(dev), /*alignment*/1, /*boundary*/0, (ahc->flags & AHC_39BIT_ADDRESSING) Modified: stable/9/sys/dev/aic7xxx/ahd_pci.c ============================================================================== --- stable/9/sys/dev/aic7xxx/ahd_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/aic7xxx/ahd_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -107,7 +107,6 @@ ahd_pci_attach(device_t dev) ahd->flags |= AHD_39BIT_ADDRESSING; /* Allocate a dmatag for our SCB DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ error = aic_dma_tag_create(ahd, /*parent*/bus_get_dma_tag(dev), /*alignment*/1, /*boundary*/0, (ahd->flags & AHD_39BIT_ADDRESSING) Modified: stable/9/sys/dev/amr/amr_pci.c ============================================================================== --- stable/9/sys/dev/amr/amr_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/amr/amr_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -275,7 +275,7 @@ amr_pci_attach(device_t dev) /* * Allocate the parent bus DMA tag appropriate for PCI. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* alignment,boundary */ AMR_IS_SG64(sc) ? BUS_SPACE_MAXADDR : Modified: stable/9/sys/dev/an/if_an_pci.c ============================================================================== --- stable/9/sys/dev/an/if_an_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/an/if_an_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -195,7 +195,7 @@ an_attach_pci(dev) } /* Allocate DMA region */ - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(dev),/* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/arcmsr/arcmsr.c Fri Mar 16 08:46:58 2012 (r233024) @@ -3486,7 +3486,7 @@ static u_int32_t arcmsr_initialize(devic return ENOMEM; } } - if(bus_dma_tag_create( /*parent*/ NULL, + if(bus_dma_tag_create( /*PCI parent*/ bus_get_dma_tag(dev), /*alignemnt*/ 1, /*boundary*/ 0, /*lowaddr*/ BUS_SPACE_MAXADDR, Modified: stable/9/sys/dev/asr/asr.c ============================================================================== --- stable/9/sys/dev/asr/asr.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/asr/asr.c Fri Mar 16 08:46:58 2012 (r233024) @@ -2328,7 +2328,7 @@ asr_alloc_dma(Asr_softc_t *sc) dev = sc->ha_dev; - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/buslogic/bt_pci.c ============================================================================== --- stable/9/sys/dev/buslogic/bt_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/buslogic/bt_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -172,8 +172,7 @@ bt_pci_attach(device_t dev) } /* Allocate a dmatag for our CCB DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* PCI parent */ bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, Modified: stable/9/sys/dev/bxe/if_bxe.c ============================================================================== --- stable/9/sys/dev/bxe/if_bxe.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/bxe/if_bxe.c Fri Mar 16 08:46:58 2012 (r233024) @@ -13583,7 +13583,8 @@ bxe_host_structures_alloc(device_t dev) /* * Allocate the parent bus DMA tag appropriate for PCI. */ - rc = bus_dma_tag_create(NULL, /* parent tag */ + rc = bus_dma_tag_create( + bus_get_dma_tag(dev), /* PCI parent tag */ 1, /* alignment for segs */ BXE_DMA_BOUNDARY, /* cannot cross */ BUS_SPACE_MAXADDR, /* restricted low */ Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/ciss/ciss.c Fri Mar 16 08:46:58 2012 (r233024) @@ -795,7 +795,7 @@ setup: * Note that "simple" adapters can only address within a 32-bit * span. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(sc->ciss_dev),/* PCI parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_sge.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/cxgb/cxgb_sge.c Fri Mar 16 08:46:58 2012 (r233024) @@ -591,7 +591,7 @@ t3_sge_alloc(adapter_t *sc) { /* The parent tag. */ - if (bus_dma_tag_create( NULL, /* parent */ + if (bus_dma_tag_create( bus_get_dma_tag(sc->dev),/* PCI parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/de/if_de.c ============================================================================== --- stable/9/sys/dev/de/if_de.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/de/if_de.c Fri Mar 16 08:46:58 2012 (r233024) @@ -4492,7 +4492,8 @@ tulip_busdma_allocring(device_t dev, tul /* First, setup a tag. */ ri->ri_max = count; size = count * sizeof(tulip_desc_t); - error = bus_dma_tag_create(NULL, 32, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(bus_get_dma_tag(dev), + 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, 1, size, 0, NULL, NULL, &ri->ri_ring_tag); if (error) { @@ -4520,7 +4521,7 @@ tulip_busdma_allocring(device_t dev, tul } /* Allocate a tag for the data buffers. */ - error = bus_dma_tag_create(NULL, align, 0, + error = bus_dma_tag_create(bus_get_dma_tag(dev), align, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * nsegs, nsegs, MCLBYTES, 0, NULL, NULL, &ri->ri_data_tag); if (error) { @@ -4600,7 +4601,7 @@ tulip_busdma_init(device_t dev, tulip_so /* * Allocate a DMA tag, memory, and map for setup descriptor */ - error = bus_dma_tag_create(NULL, 32, 0, + error = bus_dma_tag_create(bus_get_dma_tag(dev), 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(sc->tulip_setupdata), 1, sizeof(sc->tulip_setupdata), 0, NULL, NULL, &sc->tulip_setup_tag); Modified: stable/9/sys/dev/dpt/dpt_pci.c ============================================================================== --- stable/9/sys/dev/dpt/dpt_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/dpt/dpt_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -132,8 +132,7 @@ dpt_pci_attach (device_t dev) dpt_alloc(dev); /* Allocate a dmatag representing the capabilities of this attachment */ - /* XXX Should be a child of the PCI bus dma tag */ - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* PCI parent */ bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, Modified: stable/9/sys/dev/en/midway.c ============================================================================== --- stable/9/sys/dev/en/midway.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/en/midway.c Fri Mar 16 08:46:58 2012 (r233024) @@ -2714,7 +2714,7 @@ en_dmaprobe(struct en_softc *sc) * Allocate some DMA-able memory. * We need 3 times the max burst size aligned to the max burst size. */ - err = bus_dma_tag_create(NULL, MIDDMA_MAXBURST, 0, + err = bus_dma_tag_create(bus_get_dma_tag(sc->dev), MIDDMA_MAXBURST, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, 3 * MIDDMA_MAXBURST, 1, 3 * MIDDMA_MAXBURST, 0, NULL, NULL, &tag); @@ -2927,7 +2927,7 @@ en_attach(struct en_softc *sc) MGET(sc->padbuf, M_WAIT, MT_DATA); bzero(sc->padbuf->m_data, MLEN); - if (bus_dma_tag_create(NULL, 1, 0, + if (bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, EN_TXSZ * 1024, EN_MAX_DMASEG, EN_TXSZ * 1024, 0, NULL, NULL, &sc->txtag)) Modified: stable/9/sys/dev/glxsb/glxsb.c ============================================================================== --- stable/9/sys/dev/glxsb/glxsb.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/glxsb/glxsb.c Fri Mar 16 08:46:58 2012 (r233024) @@ -397,7 +397,7 @@ glxsb_dma_alloc(struct glxsb_softc *sc) dma->dma_size = GLXSB_MAX_AES_LEN * 2; /* Setup DMA descriptor area */ - rc = bus_dma_tag_create(NULL, /* parent */ + rc = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), /* parent */ SB_AES_ALIGN, 0, /* alignments, bounds */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/hatm/if_hatm.c ============================================================================== --- stable/9/sys/dev/hatm/if_hatm.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/hatm/if_hatm.c Fri Mar 16 08:46:58 2012 (r233024) @@ -1722,7 +1722,7 @@ hatm_attach(device_t dev) /* * ALlocate a DMA tag for subsequent allocations */ - if (bus_dma_tag_create(NULL, 1, 0, + if (bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 1, @@ -1751,7 +1751,7 @@ hatm_attach(device_t dev) * but this would not work. So make the maximum number of TPDs * occupied by one packet a configuration parameter. */ - if (bus_dma_tag_create(NULL, 1, 0, + if (bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, HE_MAX_PDU, 3 * HE_CONFIG_MAX_TPD_PER_PACKET, HE_MAX_PDU, 0, NULL, NULL, &sc->tx_tag)) { Modified: stable/9/sys/dev/hifn/hifn7751.c ============================================================================== --- stable/9/sys/dev/hifn/hifn7751.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/hifn/hifn7751.c Fri Mar 16 08:46:58 2012 (r233024) @@ -430,7 +430,7 @@ hifn_attach(device_t dev) * Setup the area where the Hifn DMA's descriptors * and associated data structures. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* alignment,boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/9/sys/dev/hptiop/hptiop.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/hptiop/hptiop.c Fri Mar 16 08:46:58 2012 (r233024) @@ -1358,7 +1358,7 @@ static int hptiop_attach(device_t dev) mtx_init(&hba->lock, "hptioplock", NULL, MTX_DEF); #endif - if (bus_dma_tag_create(NULL,/* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev),/* PCI parent */ 1, /* alignment */ 0, /* boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ Modified: stable/9/sys/dev/hptmv/entry.c ============================================================================== --- stable/9/sys/dev/hptmv/entry.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/hptmv/entry.c Fri Mar 16 08:46:58 2012 (r233024) @@ -1326,7 +1326,7 @@ init_adapter(IAL_ADAPTER_T *pAdapter) _vbus_p->OsExt = (void *)pAdapter; pMvSataAdapter->IALData = pAdapter; - if (bus_dma_tag_create(NULL,/* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(pAdapter->hpt_dev),/* parent */ 4, /* alignment */ BUS_SPACE_MAXADDR_32BIT+1, /* boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ Modified: stable/9/sys/dev/ida/ida_pci.c ============================================================================== --- stable/9/sys/dev/ida/ida_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/ida/ida_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -267,7 +267,7 @@ ida_pci_attach(device_t dev) } error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, Modified: stable/9/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- stable/9/sys/dev/if_ndis/if_ndis_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/if_ndis/if_ndis_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -290,7 +290,7 @@ ndis_attach_pci(dev) * Allocate the parent bus DMA tag appropriate for PCI. */ #define NDIS_NSEG_NEW 32 - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(dev),/* PCI parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/iir/iir_pci.c ============================================================================== --- stable/9/sys/dev/iir/iir_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/iir/iir_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -317,8 +317,8 @@ iir_pci_attach(device_t dev) gdt->sc_test_busy = gdt_mpr_test_busy; /* Allocate a dmatag representing the capabilities of this attachment */ - /* XXX Should be a child of the PCI bus dma tag */ - if (bus_dma_tag_create(/*parent*/NULL, /*alignemnt*/1, /*boundary*/0, + if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev), + /*alignemnt*/1, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, Modified: stable/9/sys/dev/ips/ips_pci.c ============================================================================== --- stable/9/sys/dev/ips/ips_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/ips/ips_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -135,7 +135,7 @@ static int ips_pci_attach(device_t dev) device_printf(dev, "irq setup failed\n"); goto error; } - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* PCI parent */bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, Modified: stable/9/sys/dev/ipw/if_ipw.c ============================================================================== --- stable/9/sys/dev/ipw/if_ipw.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/ipw/if_ipw.c Fri Mar 16 08:46:58 2012 (r233024) @@ -528,9 +528,21 @@ ipw_dma_alloc(struct ipw_softc *sc) int error, i; /* + * Allocate parent DMA tag for subsequent allocations. + */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE_32BIT, BUS_SPACE_UNRESTRICTED, + BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->parent_dmat); + if (error != 0) { + device_printf(sc->sc_dev, "could not create parent DMA tag\n"); + goto fail; + } + + /* * Allocate and map tx ring. */ - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, IPW_TBD_SZ, 1, IPW_TBD_SZ, 0, NULL, NULL, &sc->tbd_dmat); if (error != 0) { @@ -556,7 +568,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Allocate and map rx ring. */ - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, IPW_RBD_SZ, 1, IPW_RBD_SZ, 0, NULL, NULL, &sc->rbd_dmat); if (error != 0) { @@ -582,7 +594,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Allocate and map status ring. */ - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, IPW_STATUS_SZ, 1, IPW_STATUS_SZ, 0, NULL, NULL, &sc->status_dmat); if (error != 0) { @@ -611,7 +623,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Allocate command DMA map. */ - error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof (struct ipw_cmd), 1, sizeof (struct ipw_cmd), 0, NULL, NULL, &sc->cmd_dmat); if (error != 0) { @@ -629,7 +641,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Allocate headers DMA maps. */ - error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof (struct ipw_hdr), 1, sizeof (struct ipw_hdr), 0, NULL, NULL, &sc->hdr_dmat); if (error != 0) { @@ -652,7 +664,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Allocate tx buffers DMA maps. */ - error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, IPW_MAX_NSEG, MCLBYTES, 0, NULL, NULL, &sc->txbuf_dmat); if (error != 0) { @@ -684,7 +696,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Pre-allocate rx buffers and DMA maps. */ - error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, 0, NULL, NULL, &sc->rxbuf_dmat); if (error != 0) { @@ -741,6 +753,10 @@ ipw_release(struct ipw_softc *sc) struct ipw_soft_buf *sbuf; int i; + if (sc->parent_dmat != NULL) { + bus_dma_tag_destroy(sc->parent_dmat); + } + if (sc->tbd_dmat != NULL) { if (sc->stbd_list != NULL) { bus_dmamap_unload(sc->tbd_dmat, sc->tbd_map); Modified: stable/9/sys/dev/ipw/if_ipwvar.h ============================================================================== --- stable/9/sys/dev/ipw/if_ipwvar.h Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/ipw/if_ipwvar.h Fri Mar 16 08:46:58 2012 (r233024) @@ -117,6 +117,7 @@ struct ipw_softc { int sc_tx_timer; int sc_scan_timer; + bus_dma_tag_t parent_dmat; bus_dma_tag_t tbd_dmat; bus_dma_tag_t rbd_dmat; bus_dma_tag_t status_dmat; Modified: stable/9/sys/dev/ixgb/if_ixgb.c ============================================================================== --- stable/9/sys/dev/ixgb/if_ixgb.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/ixgb/if_ixgb.c Fri Mar 16 08:46:58 2012 (r233024) @@ -1422,7 +1422,7 @@ ixgb_dma_malloc(struct adapter * adapter int r; dev = adapter->dev; - r = bus_dma_tag_create(NULL, /* parent */ + r = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ PAGE_SIZE, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1514,7 +1514,7 @@ ixgb_setup_transmit_structures(struct ad /* * Setup DMA descriptor areas. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(adapter->dev), /* parent */ PAGE_SIZE, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1852,7 +1852,7 @@ ixgb_allocate_receive_structures(struct bzero(adapter->rx_buffer_area, sizeof(struct ixgb_buffer) * adapter->num_rx_desc); - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(adapter->dev),/* parent */ PAGE_SIZE, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/ixgbe/ixgbe.c Fri Mar 16 08:46:58 2012 (r233024) @@ -2761,7 +2761,8 @@ ixgbe_allocate_transmit_buffers(struct t /* * Setup DMA descriptor areas. */ - if ((error = bus_dma_tag_create(NULL, /* parent */ + if ((error = bus_dma_tag_create( + bus_get_dma_tag(adapter->dev), /* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/ixgbe/ixv.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixv.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/ixgbe/ixv.c Fri Mar 16 08:46:58 2012 (r233024) @@ -2146,7 +2146,8 @@ ixv_allocate_transmit_buffers(struct tx_ /* * Setup DMA descriptor areas. */ - if ((error = bus_dma_tag_create(NULL, /* parent */ + if ((error = bus_dma_tag_create( + bus_get_dma_tag(adapter->dev), /* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/lmc/if_lmc.c ============================================================================== --- stable/9/sys/dev/lmc/if_lmc.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/lmc/if_lmc.c Fri Mar 16 08:46:58 2012 (r233024) @@ -2621,7 +2621,8 @@ create_ring(softc_t *sc, struct desc_rin #ifdef __FreeBSD__ /* Create a DMA tag for descriptors and buffers. */ - if ((error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), + 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, PAGE_SIZE, 2, PAGE_SIZE, BUS_DMA_ALLOCNOW, # if (__FreeBSD_version >= 502000) NULL, NULL, Modified: stable/9/sys/dev/mfi/mfi_pci.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/mfi/mfi_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -216,7 +216,7 @@ mfi_pci_attach(device_t dev) error = ENOMEM; /* Allocate parent DMA tag */ - if (bus_dma_tag_create( NULL, /* parent */ + if (bus_dma_tag_create( bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/mge/if_mge.c ============================================================================== --- stable/9/sys/dev/mge/if_mge.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/mge/if_mge.c Fri Mar 16 08:46:58 2012 (r233024) @@ -439,7 +439,7 @@ mge_alloc_desc_dma(struct mge_softc *sc, tab[size - 1].mge_desc->next_desc = desc_paddr; /* Allocate a busdma tag for mbufs. */ - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), /* parent */ 8, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -477,7 +477,7 @@ mge_allocate_dma(struct mge_softc *sc) int i; /* Allocate a busdma tag and DMA safe memory for TX/RX descriptors. */ - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), /* parent */ 16, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/mlx/mlx_pci.c ============================================================================== --- stable/9/sys/dev/mlx/mlx_pci.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/mlx/mlx_pci.c Fri Mar 16 08:46:58 2012 (r233024) @@ -189,7 +189,7 @@ mlx_pci_attach(device_t dev) /* * Allocate the parent bus DMA tag appropriate for PCI. */ - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/mly/mly.c ============================================================================== --- stable/9/sys/dev/mly/mly.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/mly/mly.c Fri Mar 16 08:46:58 2012 (r233024) @@ -392,7 +392,7 @@ mly_pci_attach(struct mly_softc *sc) * * Note that all of these controllers are 64-bit capable. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(sc->mly_dev),/* PCI parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/9/sys/dev/mxge/if_mxge.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/mxge/if_mxge.c Fri Mar 16 08:46:58 2012 (r233024) @@ -4662,7 +4662,7 @@ mxge_attach(device_t dev) goto abort_with_nothing; } - err = bus_dma_tag_create(NULL, /* parent */ + err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, /* alignment */ 0, /* boundary */ BUS_SPACE_MAXADDR, /* low */ Modified: stable/9/sys/dev/nve/if_nve.c ============================================================================== --- stable/9/sys/dev/nve/if_nve.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/nve/if_nve.c Fri Mar 16 08:46:58 2012 (r233024) @@ -371,7 +371,8 @@ nve_attach(device_t dev) goto fail; } /* Allocate DMA tags */ - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(bus_get_dma_tag(dev), + 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * NV_MAX_FRAGS, NV_MAX_FRAGS, MCLBYTES, 0, busdma_lock_mutex, &Giant, @@ -380,7 +381,8 @@ nve_attach(device_t dev) device_printf(dev, "couldn't allocate dma tag\n"); goto fail; } - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(bus_get_dma_tag(dev), + 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(struct nve_rx_desc) * RX_RING_SIZE, 1, sizeof(struct nve_rx_desc) * RX_RING_SIZE, 0, @@ -390,7 +392,8 @@ nve_attach(device_t dev) device_printf(dev, "couldn't allocate dma tag\n"); goto fail; } - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(bus_get_dma_tag(dev), + 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(struct nve_tx_desc) * TX_RING_SIZE, 1, sizeof(struct nve_tx_desc) * TX_RING_SIZE, 0, Modified: stable/9/sys/dev/patm/if_patm_attach.c ============================================================================== --- stable/9/sys/dev/patm/if_patm_attach.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/patm/if_patm_attach.c Fri Mar 16 08:46:58 2012 (r233024) @@ -404,7 +404,7 @@ patm_attach(device_t dev) * Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with * bus_dmamem_alloc() */ - error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, + error = bus_dma_tag_create(bus_get_dma_tag(dev), PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(struct patm_scd), 1, sizeof(struct patm_scd), 0, NULL, NULL, &sc->scd_tag); @@ -774,7 +774,8 @@ patm_sq_init(struct patm_softc *sc) * Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with * bus_dmamem_alloc() */ - error = bus_dma_tag_create(NULL, PATM_SQ_ALIGNMENT, 0, + error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), + PATM_SQ_ALIGNMENT, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sc->sq_size, 1, sc->sq_size, 0, NULL, NULL, &sc->sq_tag); @@ -827,7 +828,7 @@ patm_rbuf_init(struct patm_softc *sc) * Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with * bus_dmamem_alloc() */ - if ((error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, + if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, SMBUF_PAGE_SIZE, 1, SMBUF_PAGE_SIZE, 0, NULL, NULL, &sc->sbuf_tag)) != 0) { @@ -855,7 +856,7 @@ patm_rbuf_init(struct patm_softc *sc) * maps using one tag. Rather use BUS_DMA_NOWAIT when loading the map * to prevent EINPROGRESS. */ - if ((error = bus_dma_tag_create(NULL, 4, 0, + if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, 0, NULL, NULL, &sc->lbuf_tag)) != 0) { @@ -900,7 +901,7 @@ patm_txmap_init(struct patm_softc *sc) struct patm_txmap *map; /* get transmission tag */ - error = bus_dma_tag_create(NULL, 1, 0, + error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, 65536, IDT_SCQ_SIZE - 1, 65536, 0, NULL, NULL, &sc->tx_tag); Modified: stable/9/sys/dev/safe/safe.c ============================================================================== --- stable/9/sys/dev/safe/safe.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/safe/safe.c Fri Mar 16 08:46:58 2012 (r233024) @@ -287,7 +287,7 @@ safe_attach(device_t dev) /* * Setup DMA descriptor area. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, /* alignment */ SAFE_DMA_BOUNDARY, /* boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ @@ -302,7 +302,7 @@ safe_attach(device_t dev) device_printf(dev, "cannot allocate DMA tag\n"); goto bad4; } - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, /* alignment */ SAFE_MAX_DSIZE, /* boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ @@ -1802,7 +1802,7 @@ safe_dma_malloc( { int r; - r = bus_dma_tag_create(NULL, /* parent */ + r = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), /* parent */ sizeof(u_int32_t), 0, /* alignment, bounds */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/trm/trm.c ============================================================================== --- stable/9/sys/dev/trm/trm.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/trm/trm.c Fri Mar 16 08:46:58 2012 (r233024) @@ -3415,6 +3415,22 @@ trm_init(u_int16_t unit, device_t dev) pACB->tag = rman_get_bustag(pACB->iores); pACB->bsh = rman_get_bushandle(pACB->iores); if (bus_dma_tag_create( + /*parent_dmat*/ bus_get_dma_tag(dev), + /*alignment*/ 1, + /*boundary*/ 0, + /*lowaddr*/ BUS_SPACE_MAXADDR, + /*highaddr*/ BUS_SPACE_MAXADDR, + /*filter*/ NULL, + /*filterarg*/ NULL, + /*maxsize*/ BUS_SPACE_MAXSIZE_32BIT, + /*nsegments*/ BUS_SPACE_UNRESTRICTED, + /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, + /*flags*/ 0, + /*lockfunc*/ NULL, + /*lockarg*/ NULL, + /* dmat */ &pACB->parent_dmat) != 0) + goto bad; + if (bus_dma_tag_create( /*parent_dmat*/ pACB->parent_dmat, /*alignment*/ 1, /*boundary*/ 0, @@ -3458,7 +3474,9 @@ trm_init(u_int16_t unit, device_t dev) TRM_MAX_SRB_CNT * sizeof(TRM_SRB), trm_mapSRB, pACB, /* flags */0); /* Create, allocate, and map DMA buffers for autosense data */ - if (bus_dma_tag_create(/*parent_dmat*/NULL, /*alignment*/1, + if (bus_dma_tag_create( + /*parent_dmat*/pACB->parent_dmat, + /*alignment*/1, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, /*highaddr*/BUS_SPACE_MAXADDR, @@ -3495,7 +3513,7 @@ trm_init(u_int16_t unit, device_t dev) } bzero(pACB->pFreeSRB, TRM_MAX_SRB_CNT * sizeof(TRM_SRB)); if (bus_dma_tag_create( - /*parent_dmat*/NULL, + /*parent_dmat*/pACB->parent_dmat, /*alignment*/ 1, /*boundary*/ 0, /*lowaddr*/ BUS_SPACE_MAXADDR, @@ -3546,6 +3564,8 @@ bad: bus_dma_tag_destroy(pACB->srb_dmat); if (pACB->buffer_dmat) bus_dma_tag_destroy(pACB->buffer_dmat); + if (pACB->parent_dmat) + bus_dma_tag_destroy(pACB->parent_dmat); return (NULL); } Modified: stable/9/sys/dev/twe/twe_freebsd.c ============================================================================== --- stable/9/sys/dev/twe/twe_freebsd.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/twe/twe_freebsd.c Fri Mar 16 08:46:58 2012 (r233024) @@ -225,7 +225,7 @@ twe_attach(device_t dev) /* * Allocate the parent bus DMA tag appropriate for PCI. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/tws/tws.c ============================================================================== --- stable/9/sys/dev/tws/tws.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/tws/tws.c Fri Mar 16 08:46:58 2012 (r233024) @@ -521,7 +521,7 @@ tws_init(struct tws_softc *sc) TWS_MAX_32BIT_SG_ELEMENTS; dma_mem_size = (sizeof(struct tws_command_packet) * tws_queue_depth) + (TWS_SECTOR_SIZE) ; - if ( bus_dma_tag_create(NULL, /* parent */ + if ( bus_dma_tag_create(bus_get_dma_tag(sc->tws_dev), /* PCI parent */ TWS_ALIGNMENT, /* alignment */ 0, /* boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ Modified: stable/9/sys/dev/ubsec/ubsec.c ============================================================================== --- stable/9/sys/dev/ubsec/ubsec.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/ubsec/ubsec.c Fri Mar 16 08:46:58 2012 (r233024) @@ -368,7 +368,7 @@ ubsec_attach(device_t dev) /* * Setup DMA descriptor area. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1854,7 +1854,7 @@ ubsec_dma_malloc( int r; /* XXX could specify sc_dmat as parent but that just adds overhead */ - r = bus_dma_tag_create(NULL, /* parent */ + r = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), /* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/9/sys/dev/wds/wd7000.c ============================================================================== --- stable/9/sys/dev/wds/wd7000.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/wds/wd7000.c Fri Mar 16 08:46:58 2012 (r233024) @@ -549,7 +549,7 @@ wds_attach(device_t dev) goto bad; /* now create the memory buffer */ - error = bus_dma_tag_create(NULL, /*alignment*/4, + error = bus_dma_tag_create(bus_get_dma_tag(dev), /*alignment*/4, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_24BIT, /*highaddr*/ BUS_SPACE_MAXADDR, Modified: stable/9/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/9/sys/dev/xen/blkfront/blkfront.c Fri Mar 16 05:05:37 2012 (r233023) +++ stable/9/sys/dev/xen/blkfront/blkfront.c Fri Mar 16 08:46:58 2012 (r233024) @@ -650,7 +650,7 @@ blkfront_initialize(struct xb_softc *sc) sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments); /* Allocate datastructures based on negotiated values. */ - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->xb_dev), /* parent */ 512, PAGE_SIZE, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ From owner-svn-src-stable@FreeBSD.ORG Fri Mar 16 09:23:00 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6DCB1065670; Fri, 16 Mar 2012 09:23:00 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD7508FC16; Fri, 16 Mar 2012 09:23:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2G9N0iY009531; Fri, 16 Mar 2012 09:23:00 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2G9Mxkm009482; Fri, 16 Mar 2012 09:22:59 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201203160922.q2G9Mxkm009482@svn.freebsd.org> From: Scott Long Date: Fri, 16 Mar 2012 09:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233025 - in stable/8/sys/dev: advansys ahb aic7xxx amr an arcmsr asr buslogic ciss cxgb de dpt en glxsb hatm hifn hptiop hptmv ida if_ndis iir ips ipw ixgb ixgbe lmc mfi mge mlx mly mx... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 09:23:01 -0000 Author: scottl Date: Fri Mar 16 09:22:59 2012 New Revision: 233025 URL: http://svn.freebsd.org/changeset/base/233025 Log: MFC 232854,232874,232882,232883,232886 for bus_get_dma_tag() Modified: stable/8/sys/dev/advansys/adv_eisa.c stable/8/sys/dev/advansys/adv_isa.c stable/8/sys/dev/advansys/adv_pci.c stable/8/sys/dev/advansys/adw_pci.c stable/8/sys/dev/ahb/ahb.c stable/8/sys/dev/aic7xxx/ahc_eisa.c stable/8/sys/dev/aic7xxx/ahc_isa.c stable/8/sys/dev/aic7xxx/ahc_pci.c stable/8/sys/dev/aic7xxx/ahd_pci.c stable/8/sys/dev/amr/amr_pci.c stable/8/sys/dev/an/if_an_pci.c stable/8/sys/dev/arcmsr/arcmsr.c stable/8/sys/dev/asr/asr.c stable/8/sys/dev/buslogic/bt_pci.c stable/8/sys/dev/ciss/ciss.c stable/8/sys/dev/cxgb/cxgb_sge.c stable/8/sys/dev/de/if_de.c stable/8/sys/dev/dpt/dpt_pci.c stable/8/sys/dev/en/midway.c stable/8/sys/dev/glxsb/glxsb.c stable/8/sys/dev/hatm/if_hatm.c stable/8/sys/dev/hifn/hifn7751.c stable/8/sys/dev/hptiop/hptiop.c stable/8/sys/dev/hptmv/entry.c stable/8/sys/dev/ida/ida_pci.c stable/8/sys/dev/if_ndis/if_ndis_pci.c stable/8/sys/dev/iir/iir_pci.c stable/8/sys/dev/ips/ips_pci.c stable/8/sys/dev/ipw/if_ipw.c stable/8/sys/dev/ipw/if_ipwvar.h stable/8/sys/dev/ixgb/if_ixgb.c stable/8/sys/dev/ixgbe/ixgbe.c stable/8/sys/dev/ixgbe/ixv.c stable/8/sys/dev/lmc/if_lmc.c stable/8/sys/dev/mfi/mfi_pci.c stable/8/sys/dev/mge/if_mge.c stable/8/sys/dev/mlx/mlx_pci.c stable/8/sys/dev/mly/mly.c stable/8/sys/dev/mxge/if_mxge.c stable/8/sys/dev/nve/if_nve.c stable/8/sys/dev/patm/if_patm_attach.c stable/8/sys/dev/safe/safe.c stable/8/sys/dev/trm/trm.c stable/8/sys/dev/twe/twe_freebsd.c stable/8/sys/dev/tws/tws.c stable/8/sys/dev/ubsec/ubsec.c stable/8/sys/dev/wds/wd7000.c stable/8/sys/dev/xen/blkfront/blkfront.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/advansys/adv_eisa.c ============================================================================== --- stable/8/sys/dev/advansys/adv_eisa.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/advansys/adv_eisa.c Fri Mar 16 09:22:59 2012 (r233025) @@ -171,9 +171,8 @@ adv_eisa_attach(device_t dev) * Allocate a parent dmatag for all tags created * by the MI portions of the advansys driver */ - /* XXX Should be a child of the PCI bus dma tag */ error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ ADV_EISA_MAX_DMA_ADDR, @@ -211,9 +210,8 @@ adv_eisa_attach(device_t dev) * Allocate a parent dmatag for all tags created * by the MI portions of the advansys driver */ - /* XXX Should be a child of the PCI bus dma tag */ error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ ADV_EISA_MAX_DMA_ADDR, Modified: stable/8/sys/dev/advansys/adv_isa.c ============================================================================== --- stable/8/sys/dev/advansys/adv_isa.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/advansys/adv_isa.c Fri Mar 16 09:22:59 2012 (r233025) @@ -226,9 +226,8 @@ adv_isa_probe(device_t dev) * Allocate a parent dmatag for all tags created * by the MI portions of the advansys driver */ - /* XXX Should be a child of the ISA bus dma tag */ error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, /* lowaddr */ lowaddr, Modified: stable/8/sys/dev/advansys/adv_pci.c ============================================================================== --- stable/8/sys/dev/advansys/adv_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/advansys/adv_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -187,9 +187,8 @@ adv_pci_attach(device_t dev) } /* Allocate a dmatag for our transfer DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ ADV_PCI_MAX_DMA_ADDR, Modified: stable/8/sys/dev/advansys/adw_pci.c ============================================================================== --- stable/8/sys/dev/advansys/adw_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/advansys/adw_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -258,9 +258,8 @@ adw_pci_attach(device_t dev) pci_write_config(dev, PCIR_COMMAND, command, /*bytes*/1); /* Allocate a dmatag for our transfer DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ ADW_PCI_MAX_DMA_ADDR, Modified: stable/8/sys/dev/ahb/ahb.c ============================================================================== --- stable/8/sys/dev/ahb/ahb.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/ahb/ahb.c Fri Mar 16 09:22:59 2012 (r233025) @@ -291,8 +291,7 @@ ahbattach(device_t dev) * need to perform during normal operation. */ /* DMA tag for mapping buffers into device visible space. */ - /* XXX Should be a child of the EISA bus dma tag */ - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, @@ -311,7 +310,7 @@ ahbattach(device_t dev) ahb->init_level++; /* DMA tag for our ccb structures and ha inquiry data */ - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, Modified: stable/8/sys/dev/aic7xxx/ahc_eisa.c ============================================================================== --- stable/8/sys/dev/aic7xxx/ahc_eisa.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/aic7xxx/ahc_eisa.c Fri Mar 16 09:22:59 2012 (r233025) @@ -130,7 +130,6 @@ aic7770_attach(device_t dev) ahc_set_unit(ahc, device_get_unit(dev)); /* Allocate a dmatag for our SCB DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ error = aic_dma_tag_create(ahc, /*parent*/bus_get_dma_tag(dev), /*alignment*/1, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, Modified: stable/8/sys/dev/aic7xxx/ahc_isa.c ============================================================================== --- stable/8/sys/dev/aic7xxx/ahc_isa.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/aic7xxx/ahc_isa.c Fri Mar 16 09:22:59 2012 (r233025) @@ -253,7 +253,6 @@ ahc_isa_attach(device_t dev) ahc_set_unit(ahc, device_get_unit(dev)); /* Allocate a dmatag for our SCB DMA maps */ - /* XXX Should be a child of the VLB/ISA bus dma tag */ error = aic_dma_tag_create(ahc, /*parent*/bus_get_dma_tag(dev), /*alignment*/1, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, Modified: stable/8/sys/dev/aic7xxx/ahc_pci.c ============================================================================== --- stable/8/sys/dev/aic7xxx/ahc_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/aic7xxx/ahc_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -105,7 +105,6 @@ ahc_pci_attach(device_t dev) ahc->flags |= AHC_39BIT_ADDRESSING; /* Allocate a dmatag for our SCB DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ error = aic_dma_tag_create(ahc, /*parent*/bus_get_dma_tag(dev), /*alignment*/1, /*boundary*/0, (ahc->flags & AHC_39BIT_ADDRESSING) Modified: stable/8/sys/dev/aic7xxx/ahd_pci.c ============================================================================== --- stable/8/sys/dev/aic7xxx/ahd_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/aic7xxx/ahd_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -107,7 +107,6 @@ ahd_pci_attach(device_t dev) ahd->flags |= AHD_39BIT_ADDRESSING; /* Allocate a dmatag for our SCB DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ error = aic_dma_tag_create(ahd, /*parent*/bus_get_dma_tag(dev), /*alignment*/1, /*boundary*/0, (ahd->flags & AHD_39BIT_ADDRESSING) Modified: stable/8/sys/dev/amr/amr_pci.c ============================================================================== --- stable/8/sys/dev/amr/amr_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/amr/amr_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -275,7 +275,7 @@ amr_pci_attach(device_t dev) /* * Allocate the parent bus DMA tag appropriate for PCI. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* alignment,boundary */ AMR_IS_SG64(sc) ? BUS_SPACE_MAXADDR : Modified: stable/8/sys/dev/an/if_an_pci.c ============================================================================== --- stable/8/sys/dev/an/if_an_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/an/if_an_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -209,7 +209,7 @@ an_attach_pci(dev) sc->an_mem_aux_bhandle = rman_get_bushandle(sc->mem_aux_res); /* Allocate DMA region */ - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(dev),/* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/arcmsr/arcmsr.c Fri Mar 16 09:22:59 2012 (r233025) @@ -3486,7 +3486,7 @@ static u_int32_t arcmsr_initialize(devic return ENOMEM; } } - if(bus_dma_tag_create( /*parent*/ NULL, + if(bus_dma_tag_create( /*PCI parent*/ bus_get_dma_tag(dev), /*alignemnt*/ 1, /*boundary*/ 0, /*lowaddr*/ BUS_SPACE_MAXADDR, Modified: stable/8/sys/dev/asr/asr.c ============================================================================== --- stable/8/sys/dev/asr/asr.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/asr/asr.c Fri Mar 16 09:22:59 2012 (r233025) @@ -2328,7 +2328,7 @@ asr_alloc_dma(Asr_softc_t *sc) dev = sc->ha_dev; - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/buslogic/bt_pci.c ============================================================================== --- stable/8/sys/dev/buslogic/bt_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/buslogic/bt_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -172,8 +172,7 @@ bt_pci_attach(device_t dev) } /* Allocate a dmatag for our CCB DMA maps */ - /* XXX Should be a child of the PCI bus dma tag */ - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* PCI parent */ bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/ciss/ciss.c Fri Mar 16 09:22:59 2012 (r233025) @@ -795,7 +795,7 @@ setup: * Note that "simple" adapters can only address within a 32-bit * span. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(sc->ciss_dev),/* PCI parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_sge.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/cxgb/cxgb_sge.c Fri Mar 16 09:22:59 2012 (r233025) @@ -591,7 +591,7 @@ t3_sge_alloc(adapter_t *sc) { /* The parent tag. */ - if (bus_dma_tag_create( NULL, /* parent */ + if (bus_dma_tag_create( bus_get_dma_tag(sc->dev),/* PCI parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/de/if_de.c ============================================================================== --- stable/8/sys/dev/de/if_de.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/de/if_de.c Fri Mar 16 09:22:59 2012 (r233025) @@ -4499,7 +4499,8 @@ tulip_busdma_allocring(device_t dev, tul /* First, setup a tag. */ ri->ri_max = count; size = count * sizeof(tulip_desc_t); - error = bus_dma_tag_create(NULL, 32, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(bus_get_dma_tag(dev), + 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, 1, size, 0, NULL, NULL, &ri->ri_ring_tag); if (error) { @@ -4527,7 +4528,7 @@ tulip_busdma_allocring(device_t dev, tul } /* Allocate a tag for the data buffers. */ - error = bus_dma_tag_create(NULL, align, 0, + error = bus_dma_tag_create(bus_get_dma_tag(dev), align, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * nsegs, nsegs, MCLBYTES, 0, NULL, NULL, &ri->ri_data_tag); if (error) { @@ -4607,7 +4608,7 @@ tulip_busdma_init(device_t dev, tulip_so /* * Allocate a DMA tag, memory, and map for setup descriptor */ - error = bus_dma_tag_create(NULL, 32, 0, + error = bus_dma_tag_create(bus_get_dma_tag(dev), 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(sc->tulip_setupdata), 1, sizeof(sc->tulip_setupdata), 0, NULL, NULL, &sc->tulip_setup_tag); Modified: stable/8/sys/dev/dpt/dpt_pci.c ============================================================================== --- stable/8/sys/dev/dpt/dpt_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/dpt/dpt_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -132,8 +132,7 @@ dpt_pci_attach (device_t dev) dpt_alloc(dev); /* Allocate a dmatag representing the capabilities of this attachment */ - /* XXX Should be a child of the PCI bus dma tag */ - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* PCI parent */ bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, Modified: stable/8/sys/dev/en/midway.c ============================================================================== --- stable/8/sys/dev/en/midway.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/en/midway.c Fri Mar 16 09:22:59 2012 (r233025) @@ -2714,7 +2714,7 @@ en_dmaprobe(struct en_softc *sc) * Allocate some DMA-able memory. * We need 3 times the max burst size aligned to the max burst size. */ - err = bus_dma_tag_create(NULL, MIDDMA_MAXBURST, 0, + err = bus_dma_tag_create(bus_get_dma_tag(sc->dev), MIDDMA_MAXBURST, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, 3 * MIDDMA_MAXBURST, 1, 3 * MIDDMA_MAXBURST, 0, NULL, NULL, &tag); @@ -2927,7 +2927,7 @@ en_attach(struct en_softc *sc) MGET(sc->padbuf, M_WAIT, MT_DATA); bzero(sc->padbuf->m_data, MLEN); - if (bus_dma_tag_create(NULL, 1, 0, + if (bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, EN_TXSZ * 1024, EN_MAX_DMASEG, EN_TXSZ * 1024, 0, NULL, NULL, &sc->txtag)) Modified: stable/8/sys/dev/glxsb/glxsb.c ============================================================================== --- stable/8/sys/dev/glxsb/glxsb.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/glxsb/glxsb.c Fri Mar 16 09:22:59 2012 (r233025) @@ -397,7 +397,7 @@ glxsb_dma_alloc(struct glxsb_softc *sc) dma->dma_size = GLXSB_MAX_AES_LEN * 2; /* Setup DMA descriptor area */ - rc = bus_dma_tag_create(NULL, /* parent */ + rc = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), /* parent */ SB_AES_ALIGN, 0, /* alignments, bounds */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/hatm/if_hatm.c ============================================================================== --- stable/8/sys/dev/hatm/if_hatm.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/hatm/if_hatm.c Fri Mar 16 09:22:59 2012 (r233025) @@ -1721,7 +1721,7 @@ hatm_attach(device_t dev) /* * ALlocate a DMA tag for subsequent allocations */ - if (bus_dma_tag_create(NULL, 1, 0, + if (bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 1, @@ -1750,7 +1750,7 @@ hatm_attach(device_t dev) * but this would not work. So make the maximum number of TPDs * occupied by one packet a configuration parameter. */ - if (bus_dma_tag_create(NULL, 1, 0, + if (bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, HE_MAX_PDU, 3 * HE_CONFIG_MAX_TPD_PER_PACKET, HE_MAX_PDU, 0, NULL, NULL, &sc->tx_tag)) { Modified: stable/8/sys/dev/hifn/hifn7751.c ============================================================================== --- stable/8/sys/dev/hifn/hifn7751.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/hifn/hifn7751.c Fri Mar 16 09:22:59 2012 (r233025) @@ -450,7 +450,7 @@ hifn_attach(device_t dev) * Setup the area where the Hifn DMA's descriptors * and associated data structures. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* alignment,boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/8/sys/dev/hptiop/hptiop.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/hptiop/hptiop.c Fri Mar 16 09:22:59 2012 (r233025) @@ -1358,7 +1358,7 @@ static int hptiop_attach(device_t dev) mtx_init(&hba->lock, "hptioplock", NULL, MTX_DEF); #endif - if (bus_dma_tag_create(NULL,/* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev),/* PCI parent */ 1, /* alignment */ 0, /* boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ Modified: stable/8/sys/dev/hptmv/entry.c ============================================================================== --- stable/8/sys/dev/hptmv/entry.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/hptmv/entry.c Fri Mar 16 09:22:59 2012 (r233025) @@ -1326,7 +1326,7 @@ init_adapter(IAL_ADAPTER_T *pAdapter) _vbus_p->OsExt = (void *)pAdapter; pMvSataAdapter->IALData = pAdapter; - if (bus_dma_tag_create(NULL,/* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(pAdapter->hpt_dev),/* parent */ 4, /* alignment */ BUS_SPACE_MAXADDR_32BIT+1, /* boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ Modified: stable/8/sys/dev/ida/ida_pci.c ============================================================================== --- stable/8/sys/dev/ida/ida_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/ida/ida_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -267,7 +267,7 @@ ida_pci_attach(device_t dev) } error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, Modified: stable/8/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/if_ndis/if_ndis_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -284,7 +284,7 @@ ndis_attach_pci(dev) * Allocate the parent bus DMA tag appropriate for PCI. */ #define NDIS_NSEG_NEW 32 - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(dev),/* PCI parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/iir/iir_pci.c ============================================================================== --- stable/8/sys/dev/iir/iir_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/iir/iir_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -318,8 +318,8 @@ iir_pci_attach(device_t dev) gdt->sc_test_busy = gdt_mpr_test_busy; /* Allocate a dmatag representing the capabilities of this attachment */ - /* XXX Should be a child of the PCI bus dma tag */ - if (bus_dma_tag_create(/*parent*/NULL, /*alignemnt*/1, /*boundary*/0, + if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev), + /*alignemnt*/1, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, Modified: stable/8/sys/dev/ips/ips_pci.c ============================================================================== --- stable/8/sys/dev/ips/ips_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/ips/ips_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -135,7 +135,7 @@ static int ips_pci_attach(device_t dev) device_printf(dev, "irq setup failed\n"); goto error; } - if (bus_dma_tag_create( /* parent */ NULL, + if (bus_dma_tag_create( /* PCI parent */bus_get_dma_tag(dev), /* alignemnt */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, Modified: stable/8/sys/dev/ipw/if_ipw.c ============================================================================== --- stable/8/sys/dev/ipw/if_ipw.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/ipw/if_ipw.c Fri Mar 16 09:22:59 2012 (r233025) @@ -526,9 +526,21 @@ ipw_dma_alloc(struct ipw_softc *sc) int error, i; /* + * Allocate parent DMA tag for subsequent allocations. + */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE_32BIT, BUS_SPACE_UNRESTRICTED, + BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->parent_dmat); + if (error != 0) { + device_printf(sc->sc_dev, "could not create parent DMA tag\n"); + goto fail; + } + + /* * Allocate and map tx ring. */ - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, IPW_TBD_SZ, 1, IPW_TBD_SZ, 0, NULL, NULL, &sc->tbd_dmat); if (error != 0) { @@ -554,7 +566,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Allocate and map rx ring. */ - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, IPW_RBD_SZ, 1, IPW_RBD_SZ, 0, NULL, NULL, &sc->rbd_dmat); if (error != 0) { @@ -580,7 +592,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Allocate and map status ring. */ - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, IPW_STATUS_SZ, 1, IPW_STATUS_SZ, 0, NULL, NULL, &sc->status_dmat); if (error != 0) { @@ -609,7 +621,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Allocate command DMA map. */ - error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof (struct ipw_cmd), 1, sizeof (struct ipw_cmd), 0, NULL, NULL, &sc->cmd_dmat); if (error != 0) { @@ -627,7 +639,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Allocate headers DMA maps. */ - error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof (struct ipw_hdr), 1, sizeof (struct ipw_hdr), 0, NULL, NULL, &sc->hdr_dmat); if (error != 0) { @@ -650,7 +662,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Allocate tx buffers DMA maps. */ - error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, IPW_MAX_NSEG, MCLBYTES, 0, NULL, NULL, &sc->txbuf_dmat); if (error != 0) { @@ -682,7 +694,7 @@ ipw_dma_alloc(struct ipw_softc *sc) /* * Pre-allocate rx buffers and DMA maps. */ - error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, 0, NULL, NULL, &sc->rxbuf_dmat); if (error != 0) { @@ -739,6 +751,10 @@ ipw_release(struct ipw_softc *sc) struct ipw_soft_buf *sbuf; int i; + if (sc->parent_dmat != NULL) { + bus_dma_tag_destroy(sc->parent_dmat); + } + if (sc->tbd_dmat != NULL) { if (sc->stbd_list != NULL) { bus_dmamap_unload(sc->tbd_dmat, sc->tbd_map); Modified: stable/8/sys/dev/ipw/if_ipwvar.h ============================================================================== --- stable/8/sys/dev/ipw/if_ipwvar.h Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/ipw/if_ipwvar.h Fri Mar 16 09:22:59 2012 (r233025) @@ -117,6 +117,7 @@ struct ipw_softc { int sc_tx_timer; int sc_scan_timer; + bus_dma_tag_t parent_dmat; bus_dma_tag_t tbd_dmat; bus_dma_tag_t rbd_dmat; bus_dma_tag_t status_dmat; Modified: stable/8/sys/dev/ixgb/if_ixgb.c ============================================================================== --- stable/8/sys/dev/ixgb/if_ixgb.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/ixgb/if_ixgb.c Fri Mar 16 09:22:59 2012 (r233025) @@ -1442,7 +1442,7 @@ ixgb_dma_malloc(struct adapter * adapter { int r; - r = bus_dma_tag_create(NULL, /* parent */ + r = bus_dma_tag_create(bus_get_dma_tag(adapter->dev), /* parent */ PAGE_SIZE, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1534,7 +1534,7 @@ ixgb_setup_transmit_structures(struct ad /* * Setup DMA descriptor areas. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(adapter->dev), /* parent */ PAGE_SIZE, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1872,7 +1872,7 @@ ixgb_allocate_receive_structures(struct bzero(adapter->rx_buffer_area, sizeof(struct ixgb_buffer) * adapter->num_rx_desc); - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(adapter->dev),/* parent */ PAGE_SIZE, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/ixgbe/ixgbe.c Fri Mar 16 09:22:59 2012 (r233025) @@ -2846,7 +2846,8 @@ ixgbe_allocate_transmit_buffers(struct t /* * Setup DMA descriptor areas. */ - if ((error = bus_dma_tag_create(NULL, /* parent */ + if ((error = bus_dma_tag_create( + bus_get_dma_tag(adapter->dev), /* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/ixgbe/ixv.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixv.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/ixgbe/ixv.c Fri Mar 16 09:22:59 2012 (r233025) @@ -2158,7 +2158,8 @@ ixv_allocate_transmit_buffers(struct tx_ /* * Setup DMA descriptor areas. */ - if ((error = bus_dma_tag_create(NULL, /* parent */ + if ((error = bus_dma_tag_create( + bus_get_dma_tag(adapter->dev), /* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/lmc/if_lmc.c ============================================================================== --- stable/8/sys/dev/lmc/if_lmc.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/lmc/if_lmc.c Fri Mar 16 09:22:59 2012 (r233025) @@ -2621,7 +2621,8 @@ create_ring(softc_t *sc, struct desc_rin #ifdef __FreeBSD__ /* Create a DMA tag for descriptors and buffers. */ - if ((error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), + 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, PAGE_SIZE, 2, PAGE_SIZE, BUS_DMA_ALLOCNOW, # if (__FreeBSD_version >= 502000) NULL, NULL, Modified: stable/8/sys/dev/mfi/mfi_pci.c ============================================================================== --- stable/8/sys/dev/mfi/mfi_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/mfi/mfi_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -216,7 +216,7 @@ mfi_pci_attach(device_t dev) error = ENOMEM; /* Allocate parent DMA tag */ - if (bus_dma_tag_create( NULL, /* parent */ + if (bus_dma_tag_create( bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/mge/if_mge.c ============================================================================== --- stable/8/sys/dev/mge/if_mge.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/mge/if_mge.c Fri Mar 16 09:22:59 2012 (r233025) @@ -422,7 +422,7 @@ mge_alloc_desc_dma(struct mge_softc *sc, tab[size - 1].mge_desc->next_desc = desc_paddr; /* Allocate a busdma tag for mbufs. */ - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), /* parent */ 8, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -460,7 +460,7 @@ mge_allocate_dma(struct mge_softc *sc) int i; /* Allocate a busdma tag and DMA safe memory for TX/RX descriptors. */ - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), /* parent */ 16, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/mlx/mlx_pci.c ============================================================================== --- stable/8/sys/dev/mlx/mlx_pci.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/mlx/mlx_pci.c Fri Mar 16 09:22:59 2012 (r233025) @@ -189,7 +189,7 @@ mlx_pci_attach(device_t dev) /* * Allocate the parent bus DMA tag appropriate for PCI. */ - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/mly/mly.c ============================================================================== --- stable/8/sys/dev/mly/mly.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/mly/mly.c Fri Mar 16 09:22:59 2012 (r233025) @@ -392,7 +392,7 @@ mly_pci_attach(struct mly_softc *sc) * * Note that all of these controllers are 64-bit capable. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(sc->mly_dev),/* PCI parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/8/sys/dev/mxge/if_mxge.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/mxge/if_mxge.c Fri Mar 16 09:22:59 2012 (r233025) @@ -4664,7 +4664,7 @@ mxge_attach(device_t dev) goto abort_with_nothing; } - err = bus_dma_tag_create(NULL, /* parent */ + err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, /* alignment */ 0, /* boundary */ BUS_SPACE_MAXADDR, /* low */ Modified: stable/8/sys/dev/nve/if_nve.c ============================================================================== --- stable/8/sys/dev/nve/if_nve.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/nve/if_nve.c Fri Mar 16 09:22:59 2012 (r233025) @@ -371,7 +371,8 @@ nve_attach(device_t dev) goto fail; } /* Allocate DMA tags */ - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(bus_get_dma_tag(dev), + 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * NV_MAX_FRAGS, NV_MAX_FRAGS, MCLBYTES, 0, busdma_lock_mutex, &Giant, @@ -380,7 +381,8 @@ nve_attach(device_t dev) device_printf(dev, "couldn't allocate dma tag\n"); goto fail; } - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(bus_get_dma_tag(dev), + 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(struct nve_rx_desc) * RX_RING_SIZE, 1, sizeof(struct nve_rx_desc) * RX_RING_SIZE, 0, @@ -390,7 +392,8 @@ nve_attach(device_t dev) device_printf(dev, "couldn't allocate dma tag\n"); goto fail; } - error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(bus_get_dma_tag(dev), + 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(struct nve_tx_desc) * TX_RING_SIZE, 1, sizeof(struct nve_tx_desc) * TX_RING_SIZE, 0, Modified: stable/8/sys/dev/patm/if_patm_attach.c ============================================================================== --- stable/8/sys/dev/patm/if_patm_attach.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/patm/if_patm_attach.c Fri Mar 16 09:22:59 2012 (r233025) @@ -404,7 +404,7 @@ patm_attach(device_t dev) * Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with * bus_dmamem_alloc() */ - error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, + error = bus_dma_tag_create(bus_get_dma_tag(dev), PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(struct patm_scd), 1, sizeof(struct patm_scd), 0, NULL, NULL, &sc->scd_tag); @@ -774,7 +774,8 @@ patm_sq_init(struct patm_softc *sc) * Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with * bus_dmamem_alloc() */ - error = bus_dma_tag_create(NULL, PATM_SQ_ALIGNMENT, 0, + error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), + PATM_SQ_ALIGNMENT, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sc->sq_size, 1, sc->sq_size, 0, NULL, NULL, &sc->sq_tag); @@ -827,7 +828,7 @@ patm_rbuf_init(struct patm_softc *sc) * Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with * bus_dmamem_alloc() */ - if ((error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, + if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, SMBUF_PAGE_SIZE, 1, SMBUF_PAGE_SIZE, 0, NULL, NULL, &sc->sbuf_tag)) != 0) { @@ -855,7 +856,7 @@ patm_rbuf_init(struct patm_softc *sc) * maps using one tag. Rather use BUS_DMA_NOWAIT when loading the map * to prevent EINPROGRESS. */ - if ((error = bus_dma_tag_create(NULL, 4, 0, + if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, 0, NULL, NULL, &sc->lbuf_tag)) != 0) { @@ -900,7 +901,7 @@ patm_txmap_init(struct patm_softc *sc) struct patm_txmap *map; /* get transmission tag */ - error = bus_dma_tag_create(NULL, 1, 0, + error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, 65536, IDT_SCQ_SIZE - 1, 65536, 0, NULL, NULL, &sc->tx_tag); Modified: stable/8/sys/dev/safe/safe.c ============================================================================== --- stable/8/sys/dev/safe/safe.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/safe/safe.c Fri Mar 16 09:22:59 2012 (r233025) @@ -287,7 +287,7 @@ safe_attach(device_t dev) /* * Setup DMA descriptor area. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, /* alignment */ SAFE_DMA_BOUNDARY, /* boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ @@ -302,7 +302,7 @@ safe_attach(device_t dev) device_printf(dev, "cannot allocate DMA tag\n"); goto bad4; } - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, /* alignment */ SAFE_MAX_DSIZE, /* boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ @@ -1802,7 +1802,7 @@ safe_dma_malloc( { int r; - r = bus_dma_tag_create(NULL, /* parent */ + r = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), /* parent */ sizeof(u_int32_t), 0, /* alignment, bounds */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/trm/trm.c ============================================================================== --- stable/8/sys/dev/trm/trm.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/trm/trm.c Fri Mar 16 09:22:59 2012 (r233025) @@ -3415,6 +3415,22 @@ trm_init(u_int16_t unit, device_t dev) pACB->tag = rman_get_bustag(pACB->iores); pACB->bsh = rman_get_bushandle(pACB->iores); if (bus_dma_tag_create( + /*parent_dmat*/ bus_get_dma_tag(dev), + /*alignment*/ 1, + /*boundary*/ 0, + /*lowaddr*/ BUS_SPACE_MAXADDR, + /*highaddr*/ BUS_SPACE_MAXADDR, + /*filter*/ NULL, + /*filterarg*/ NULL, + /*maxsize*/ BUS_SPACE_MAXSIZE_32BIT, + /*nsegments*/ BUS_SPACE_UNRESTRICTED, + /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, + /*flags*/ 0, + /*lockfunc*/ NULL, + /*lockarg*/ NULL, + /* dmat */ &pACB->parent_dmat) != 0) + goto bad; + if (bus_dma_tag_create( /*parent_dmat*/ pACB->parent_dmat, /*alignment*/ 1, /*boundary*/ 0, @@ -3458,7 +3474,9 @@ trm_init(u_int16_t unit, device_t dev) TRM_MAX_SRB_CNT * sizeof(TRM_SRB), trm_mapSRB, pACB, /* flags */0); /* Create, allocate, and map DMA buffers for autosense data */ - if (bus_dma_tag_create(/*parent_dmat*/NULL, /*alignment*/1, + if (bus_dma_tag_create( + /*parent_dmat*/pACB->parent_dmat, + /*alignment*/1, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, /*highaddr*/BUS_SPACE_MAXADDR, @@ -3495,7 +3513,7 @@ trm_init(u_int16_t unit, device_t dev) } bzero(pACB->pFreeSRB, TRM_MAX_SRB_CNT * sizeof(TRM_SRB)); if (bus_dma_tag_create( - /*parent_dmat*/NULL, + /*parent_dmat*/pACB->parent_dmat, /*alignment*/ 1, /*boundary*/ 0, /*lowaddr*/ BUS_SPACE_MAXADDR, @@ -3546,6 +3564,8 @@ bad: bus_dma_tag_destroy(pACB->srb_dmat); if (pACB->buffer_dmat) bus_dma_tag_destroy(pACB->buffer_dmat); + if (pACB->parent_dmat) + bus_dma_tag_destroy(pACB->parent_dmat); return (NULL); } Modified: stable/8/sys/dev/twe/twe_freebsd.c ============================================================================== --- stable/8/sys/dev/twe/twe_freebsd.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/twe/twe_freebsd.c Fri Mar 16 09:22:59 2012 (r233025) @@ -225,7 +225,7 @@ twe_attach(device_t dev) /* * Allocate the parent bus DMA tag appropriate for PCI. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* PCI parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/tws/tws.c ============================================================================== --- stable/8/sys/dev/tws/tws.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/tws/tws.c Fri Mar 16 09:22:59 2012 (r233025) @@ -521,7 +521,7 @@ tws_init(struct tws_softc *sc) TWS_MAX_32BIT_SG_ELEMENTS; dma_mem_size = (sizeof(struct tws_command_packet) * tws_queue_depth) + (TWS_SECTOR_SIZE) ; - if ( bus_dma_tag_create(NULL, /* parent */ + if ( bus_dma_tag_create(bus_get_dma_tag(sc->tws_dev), /* PCI parent */ TWS_ALIGNMENT, /* alignment */ 0, /* boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ Modified: stable/8/sys/dev/ubsec/ubsec.c ============================================================================== --- stable/8/sys/dev/ubsec/ubsec.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/ubsec/ubsec.c Fri Mar 16 09:22:59 2012 (r233025) @@ -368,7 +368,7 @@ ubsec_attach(device_t dev) /* * Setup DMA descriptor area. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1854,7 +1854,7 @@ ubsec_dma_malloc( int r; /* XXX could specify sc_dmat as parent but that just adds overhead */ - r = bus_dma_tag_create(NULL, /* parent */ + r = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), /* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ Modified: stable/8/sys/dev/wds/wd7000.c ============================================================================== --- stable/8/sys/dev/wds/wd7000.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/wds/wd7000.c Fri Mar 16 09:22:59 2012 (r233025) @@ -549,7 +549,7 @@ wds_attach(device_t dev) goto bad; /* now create the memory buffer */ - error = bus_dma_tag_create(NULL, /*alignment*/4, + error = bus_dma_tag_create(bus_get_dma_tag(dev), /*alignment*/4, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_24BIT, /*highaddr*/ BUS_SPACE_MAXADDR, Modified: stable/8/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/8/sys/dev/xen/blkfront/blkfront.c Fri Mar 16 08:46:58 2012 (r233024) +++ stable/8/sys/dev/xen/blkfront/blkfront.c Fri Mar 16 09:22:59 2012 (r233025) @@ -650,7 +650,7 @@ blkfront_initialize(struct xb_softc *sc) sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments); /* Allocate datastructures based on negotiated values. */ - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->xb_dev), /* parent */ 512, PAGE_SIZE, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ From owner-svn-src-stable@FreeBSD.ORG Fri Mar 16 10:51:43 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 796361065676; Fri, 16 Mar 2012 10:51:43 +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 599148FC14; Fri, 16 Mar 2012 10:51:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2GAphde014549; Fri, 16 Mar 2012 10:51:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2GAphAJ014544; Fri, 16 Mar 2012 10:51:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203161051.q2GAphAJ014544@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 16 Mar 2012 10:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233027 - in stable/9/sys: kern sys ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 10:51:43 -0000 Author: kib Date: Fri Mar 16 10:51:42 2012 New Revision: 233027 URL: http://svn.freebsd.org/changeset/base/233027 Log: MFC r232709: Decomission mnt_noasync. Introduce MNTK_NOASYNC mnt_kern_flag which allows a filesystem to request VFS to not allow MNTK_ASYNC. MFC note: the mnt_noasync member of struct mount is left as padding to preserve the structure layout. Modified: stable/9/sys/kern/vfs_mount.c stable/9/sys/kern/vfs_subr.c stable/9/sys/sys/mount.h stable/9/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_mount.c ============================================================================== --- stable/9/sys/kern/vfs_mount.c Fri Mar 16 10:10:17 2012 (r233026) +++ stable/9/sys/kern/vfs_mount.c Fri Mar 16 10:51:42 2012 (r233027) @@ -836,7 +836,8 @@ vfs_domount_first( mp->mnt_optnew = NULL; MNT_ILOCK(mp); - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) + if ((mp->mnt_flag & MNT_ASYNC) != 0 && + (mp->mnt_kern_flag & MNTK_NOASYNC) == 0) mp->mnt_kern_flag |= MNTK_ASYNC; else mp->mnt_kern_flag &= ~MNTK_ASYNC; @@ -976,7 +977,8 @@ vfs_domount_update( */ mp->mnt_flag = (mp->mnt_flag & MNT_QUOTA) | (flag & ~MNT_QUOTA); } - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) + if ((mp->mnt_flag & MNT_ASYNC) != 0 && + (mp->mnt_kern_flag & MNTK_NOASYNC) == 0) mp->mnt_kern_flag |= MNTK_ASYNC; else mp->mnt_kern_flag &= ~MNTK_ASYNC; @@ -1336,7 +1338,8 @@ dounmount(mp, flags, td) } mp->mnt_kern_flag &= ~(MNTK_UNMOUNT | MNTK_UNMOUNTF); mp->mnt_flag |= async_flag; - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) + if ((mp->mnt_flag & MNT_ASYNC) != 0 && + (mp->mnt_kern_flag & MNTK_NOASYNC) == 0) mp->mnt_kern_flag |= MNTK_ASYNC; if (mp->mnt_kern_flag & MNTK_MWAIT) { mp->mnt_kern_flag &= ~MNTK_MWAIT; Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Fri Mar 16 10:10:17 2012 (r233026) +++ stable/9/sys/kern/vfs_subr.c Fri Mar 16 10:51:42 2012 (r233027) @@ -2940,6 +2940,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_REFEXPIRE); MNT_KERN_FLAG(MNTK_EXTENDED_SHARED); MNT_KERN_FLAG(MNTK_SHARED_WRITES); + MNT_KERN_FLAG(MNTK_NOASYNC); MNT_KERN_FLAG(MNTK_UNMOUNT); MNT_KERN_FLAG(MNTK_MWAIT); MNT_KERN_FLAG(MNTK_SUSPEND); @@ -2992,7 +2993,6 @@ DB_SHOW_COMMAND(mount, db_show_mount) db_printf(" mnt_gen = %d\n", mp->mnt_gen); db_printf(" mnt_nvnodelistsize = %d\n", mp->mnt_nvnodelistsize); db_printf(" mnt_writeopcount = %d\n", mp->mnt_writeopcount); - db_printf(" mnt_noasync = %u\n", mp->mnt_noasync); db_printf(" mnt_maxsymlinklen = %d\n", mp->mnt_maxsymlinklen); db_printf(" mnt_iosize_max = %d\n", mp->mnt_iosize_max); db_printf(" mnt_hashseed = %u\n", mp->mnt_hashseed); Modified: stable/9/sys/sys/mount.h ============================================================================== --- stable/9/sys/sys/mount.h Fri Mar 16 10:10:17 2012 (r233026) +++ stable/9/sys/sys/mount.h Fri Mar 16 10:51:42 2012 (r233027) @@ -167,7 +167,7 @@ struct mount { int mnt_writeopcount; /* (i) write syscalls pending */ int mnt_kern_flag; /* (i) kernel only flags */ uint64_t mnt_flag; /* (i) flags shared with user */ - u_int mnt_noasync; /* (i) # noasync overrides */ + u_int mnt_pad_noasync; struct vfsoptlist *mnt_opt; /* current mount options */ struct vfsoptlist *mnt_optnew; /* new options passed to fs */ int mnt_maxsymlinklen; /* max size of short symlink */ @@ -325,6 +325,7 @@ void __mnt_vnode_markerfree(str #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ #define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */ #define MNTK_SHARED_WRITES 0x00000080 /* Allow shared locking for writes */ +#define MNTK_NOASYNC 0x00800000 /* disable async */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ #define MNTK_SUSPEND 0x08000000 /* request write suspension */ Modified: stable/9/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_softdep.c Fri Mar 16 10:10:17 2012 (r233026) +++ stable/9/sys/ufs/ffs/ffs_softdep.c Fri Mar 16 10:51:42 2012 (r233027) @@ -2367,8 +2367,7 @@ softdep_mount(devvp, mp, fs, cred) mp->mnt_flag = (mp->mnt_flag & ~MNT_ASYNC) | MNT_SOFTDEP; if ((mp->mnt_kern_flag & MNTK_SOFTDEP) == 0) { mp->mnt_kern_flag = (mp->mnt_kern_flag & ~MNTK_ASYNC) | - MNTK_SOFTDEP; - mp->mnt_noasync++; + MNTK_SOFTDEP | MNTK_NOASYNC; } MNT_IUNLOCK(mp); ump = VFSTOUFS(mp); From owner-svn-src-stable@FreeBSD.ORG Fri Mar 16 10:59:05 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4ADA6106566C; Fri, 16 Mar 2012 10:59:05 +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 34FDE8FC0A; Fri, 16 Mar 2012 10:59:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2GAx5P7014827; Fri, 16 Mar 2012 10:59:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2GAx4Ae014825; Fri, 16 Mar 2012 10:59:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203161059.q2GAx4Ae014825@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 16 Mar 2012 10:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233028 - stable/9/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 10:59:05 -0000 Author: kib Date: Fri Mar 16 10:59:04 2012 New Revision: 233028 URL: http://svn.freebsd.org/changeset/base/233028 Log: MFC r232947: Lock the process around manipulations with p_flag. Modified: stable/9/sys/kern/kern_exit.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_exit.c ============================================================================== --- stable/9/sys/kern/kern_exit.c Fri Mar 16 10:51:42 2012 (r233027) +++ stable/9/sys/kern/kern_exit.c Fri Mar 16 10:59:04 2012 (r233028) @@ -738,10 +738,12 @@ proc_reap(struct thread *td, struct proc LIST_REMOVE(p, p_list); /* off zombproc */ sx_xunlock(&allproc_lock); LIST_REMOVE(p, p_sibling); + PROC_LOCK(p); if (p->p_flag & P_ORPHAN) { LIST_REMOVE(p, p_orphan); p->p_flag &= ~P_ORPHAN; } + PROC_UNLOCK(p); leavepgrp(p); #ifdef PROCDESC if (p->p_procdesc != NULL) From owner-svn-src-stable@FreeBSD.ORG Fri Mar 16 11:00:55 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A95EC1065670; Fri, 16 Mar 2012 11:00: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 93AAF8FC16; Fri, 16 Mar 2012 11:00:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2GB0t7l014954; Fri, 16 Mar 2012 11:00:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2GB0tD6014952; Fri, 16 Mar 2012 11:00:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203161100.q2GB0tD6014952@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 16 Mar 2012 11:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233029 - stable/9/libexec/rtld-elf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 11:00:55 -0000 Author: kib Date: Fri Mar 16 11:00:55 2012 New Revision: 233029 URL: http://svn.freebsd.org/changeset/base/233029 Log: MFC r232729: Remove the use of toupper() from rtld_printf.c. Modified: stable/9/libexec/rtld-elf/rtld_printf.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld_printf.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld_printf.c Fri Mar 16 10:59:04 2012 (r233028) +++ stable/9/libexec/rtld-elf/rtld_printf.c Fri Mar 16 11:00:55 2012 (r233029) @@ -36,7 +36,6 @@ */ #include -#include #include #include #include @@ -90,8 +89,10 @@ snprintf_func(int ch, struct snprintf_ar } } -static char const hex2ascii_data[] = "0123456789abcdefghijklmnopqrstuvwxyz"; -#define hex2ascii(hex) (hex2ascii_data[hex]) +static char const hex2ascii_lower[] = "0123456789abcdefghijklmnopqrstuvwxyz"; +static char const hex2ascii_upper[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +#define hex2ascii(hex) (hex2ascii_lower[hex]) +#define hex2ascii_upper(hex) (hex2ascii_upper[hex]) static __inline int imax(int a, int b) @@ -108,8 +109,9 @@ ksprintn(char *nbuf, uintmax_t num, int p = nbuf; *p = '\0'; do { - c = hex2ascii(num % base); - *++p = upper ? toupper(c) : c; + c = upper ? hex2ascii_upper(num % base) : + hex2ascii(num % base); + *++p = c; } while (num /= base); if (lenp) *lenp = p - nbuf; From owner-svn-src-stable@FreeBSD.ORG Fri Mar 16 13:44:41 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D6B6106566B; Fri, 16 Mar 2012 13:44:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17DA68FC08; Fri, 16 Mar 2012 13:44:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2GDieI2020240; Fri, 16 Mar 2012 13:44:40 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2GDieSh020238; Fri, 16 Mar 2012 13:44:40 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201203161344.q2GDieSh020238@svn.freebsd.org> From: Ed Maste Date: Fri, 16 Mar 2012 13:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233032 - stable/9/sys/dev/aac X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 13:44:41 -0000 Author: emaste Date: Fri Mar 16 13:44:40 2012 New Revision: 233032 URL: http://svn.freebsd.org/changeset/base/233032 Log: MFC r232668: Use bus_get_dma_tag() to inherit the PCI bus' 4G boundary constraint. Modified: stable/9/sys/dev/aac/aac_pci.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/aac/aac_pci.c ============================================================================== --- stable/9/sys/dev/aac/aac_pci.c Fri Mar 16 12:13:44 2012 (r233031) +++ stable/9/sys/dev/aac/aac_pci.c Fri Mar 16 13:44:40 2012 (r233032) @@ -402,7 +402,7 @@ aac_pci_attach(device_t dev) * * Note that some of these controllers are 64-bit capable. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(sc->aac_dev), /* parent */ PAGE_SIZE, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ From owner-svn-src-stable@FreeBSD.ORG Fri Mar 16 13:46:55 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A7BB106566B; Fri, 16 Mar 2012 13:46:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E97F88FC12; Fri, 16 Mar 2012 13:46:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2GDksbm020367; Fri, 16 Mar 2012 13:46:54 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2GDksi5020365; Fri, 16 Mar 2012 13:46:54 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201203161346.q2GDksi5020365@svn.freebsd.org> From: Ed Maste Date: Fri, 16 Mar 2012 13:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233033 - stable/8/sys/dev/aac X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 13:46:55 -0000 Author: emaste Date: Fri Mar 16 13:46:54 2012 New Revision: 233033 URL: http://svn.freebsd.org/changeset/base/233033 Log: MFC r232668: Use bus_get_dma_tag() to inherit the PCI bus' 4G boundary constraint. Modified: stable/8/sys/dev/aac/aac_pci.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/aac/aac_pci.c ============================================================================== --- stable/8/sys/dev/aac/aac_pci.c Fri Mar 16 13:44:40 2012 (r233032) +++ stable/8/sys/dev/aac/aac_pci.c Fri Mar 16 13:46:54 2012 (r233033) @@ -402,7 +402,7 @@ aac_pci_attach(device_t dev) * * Note that some of these controllers are 64-bit capable. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(sc->aac_dev), /* parent */ PAGE_SIZE, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ From owner-svn-src-stable@FreeBSD.ORG Fri Mar 16 21:28:06 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FF5A1065676; Fri, 16 Mar 2012 21:28:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 487E88FC08; Fri, 16 Mar 2012 21:28:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2GLS6jB035574; Fri, 16 Mar 2012 21:28:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2GLS6fC035565; Fri, 16 Mar 2012 21:28:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203162128.q2GLS6fC035565@svn.freebsd.org> From: John Baldwin Date: Fri, 16 Mar 2012 21:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233046 - in stable/9/sys: i386/conf netinet netinet6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 21:28:06 -0000 Author: jhb Date: Fri Mar 16 21:28:05 2012 New Revision: 233046 URL: http://svn.freebsd.org/changeset/base/233046 Log: MFC 226340,226340: Use queue(3) macros instead of home-rolled versions in several places in the INET6 code. This includes retiring the 'ndpr_next' and 'pfr_next' macros. Modified: stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet6/icmp6.c stable/9/sys/netinet6/in6.c stable/9/sys/netinet6/in6_ifattach.c stable/9/sys/netinet6/nd6.c stable/9/sys/netinet6/nd6.h stable/9/sys/netinet6/nd6_nbr.c stable/9/sys/netinet6/nd6_rtr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Fri Mar 16 20:32:11 2012 (r233045) +++ stable/9/sys/netinet/sctp_output.c Fri Mar 16 21:28:05 2012 (r233046) @@ -13834,8 +13834,7 @@ sctp_v6src_match_nexthop(struct sockaddr SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, (struct sockaddr *)src6); /* search installed gateway from prefix entry */ - for (pfxrtr = pfx->ndpr_advrtrs.lh_first; pfxrtr; pfxrtr = - pfxrtr->pfr_next) { + LIST_FOREACH(pfxrtr, &pfx->ndpr_advrtrs, pfr_entry) { memset(&gw6, 0, sizeof(struct sockaddr_in6)); gw6.sin6_family = AF_INET6; gw6.sin6_len = sizeof(struct sockaddr_in6); Modified: stable/9/sys/netinet6/icmp6.c ============================================================================== --- stable/9/sys/netinet6/icmp6.c Fri Mar 16 20:32:11 2012 (r233045) +++ stable/9/sys/netinet6/icmp6.c Fri Mar 16 21:28:05 2012 (r233046) @@ -1780,7 +1780,7 @@ ni6_addrs(struct icmp6_nodeinfo *ni6, st } IFNET_RLOCK_NOSLEEP(); - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) { + TAILQ_FOREACH(ifp, &V_ifnet, if_list) { addrsofif = 0; IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Fri Mar 16 20:32:11 2012 (r233045) +++ stable/9/sys/netinet6/in6.c Fri Mar 16 21:28:05 2012 (r233046) @@ -1309,7 +1309,7 @@ in6_purgeaddr_mc(struct ifnet *ifp, stru /* * Leave from multicast groups we have joined for the interface. */ - while ((imm = ia->ia6_memberships.lh_first) != NULL) { + while ((imm = LIST_FIRST(&ia->ia6_memberships)) != NULL) { LIST_REMOVE(imm, i6mm_chain); in6_leavegroup(imm); } @@ -2330,8 +2330,7 @@ in6_setmaxmtu(void) struct ifnet *ifp; IFNET_RLOCK_NOSLEEP(); - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; - ifp = TAILQ_NEXT(ifp, if_list)) { + TAILQ_FOREACH(ifp, &V_ifnet, if_list) { /* this function can be called during ifnet initialization */ if (!ifp->if_afdata[AF_INET6]) continue; Modified: stable/9/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/9/sys/netinet6/in6_ifattach.c Fri Mar 16 20:32:11 2012 (r233045) +++ stable/9/sys/netinet6/in6_ifattach.c Fri Mar 16 21:28:05 2012 (r233046) @@ -405,7 +405,7 @@ get_ifid(struct ifnet *ifp0, struct ifne /* next, try to get it from some other hardware interface */ IFNET_RLOCK_NOSLEEP(); - for (ifp = V_ifnet.tqh_first; ifp; ifp = ifp->if_list.tqe_next) { + TAILQ_FOREACH(ifp, &V_ifnet, if_list) { if (ifp == ifp0) continue; if (in6_get_hw_ifid(ifp, in6) != 0) @@ -816,7 +816,7 @@ in6_ifdetach(struct ifnet *ifp) /* * leave from multicast groups we have joined for the interface */ - while ((imm = ia->ia6_memberships.lh_first) != NULL) { + while ((imm = LIST_FIRST(&ia->ia6_memberships)) != NULL) { LIST_REMOVE(imm, i6mm_chain); in6_leavegroup(imm); } @@ -916,8 +916,7 @@ in6_tmpaddrtimer(void *arg) V_ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, curvnet); bzero(nullbuf, sizeof(nullbuf)); - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; - ifp = TAILQ_NEXT(ifp, if_list)) { + TAILQ_FOREACH(ifp, &V_ifnet, if_list) { ndi = ND_IFINFO(ifp); if (bcmp(ndi->randomid, nullbuf, sizeof(nullbuf)) != 0) { /* Modified: stable/9/sys/netinet6/nd6.c ============================================================================== --- stable/9/sys/netinet6/nd6.c Fri Mar 16 20:32:11 2012 (r233045) +++ stable/9/sys/netinet6/nd6.c Fri Mar 16 21:28:05 2012 (r233046) @@ -572,8 +572,8 @@ nd6_timer(void *arg) { CURVNET_SET((struct vnet *) arg); int s; - struct nd_defrouter *dr; - struct nd_prefix *pr; + struct nd_defrouter *dr, *ndr; + struct nd_prefix *pr, *npr; struct in6_ifaddr *ia6, *nia6; callout_reset(&V_nd6_timer_ch, V_nd6_prune * hz, @@ -581,16 +581,9 @@ nd6_timer(void *arg) /* expire default router list */ s = splnet(); - dr = TAILQ_FIRST(&V_nd_defrouter); - while (dr) { - if (dr->expire && dr->expire < time_second) { - struct nd_defrouter *t; - t = TAILQ_NEXT(dr, dr_entry); + TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { + if (dr->expire && dr->expire < time_second) defrtrlist_del(dr); - dr = t; - } else { - dr = TAILQ_NEXT(dr, dr_entry); - } } /* @@ -666,8 +659,7 @@ nd6_timer(void *arg) } /* expire prefix list */ - pr = V_nd_prefix.lh_first; - while (pr) { + LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, npr) { /* * check prefix lifetime. * since pltime is just for autoconf, pltime processing for @@ -675,18 +667,13 @@ nd6_timer(void *arg) */ if (pr->ndpr_vltime != ND6_INFINITE_LIFETIME && time_second - pr->ndpr_lastupdate > pr->ndpr_vltime) { - struct nd_prefix *t; - t = pr->ndpr_next; /* * address expiration and prefix expiration are * separate. NEVER perform in6_purgeaddr here. */ - prelist_remove(pr); - pr = t; - } else - pr = pr->ndpr_next; + } } splx(s); CURVNET_RESTORE(); @@ -779,8 +766,7 @@ nd6_purge(struct ifnet *ifp) * in the routing table, in order to keep additional side effects as * small as possible. */ - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; dr = ndr) { - ndr = TAILQ_NEXT(dr, dr_entry); + TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { if (dr->installed) continue; @@ -788,8 +774,7 @@ nd6_purge(struct ifnet *ifp) defrtrlist_del(dr); } - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; dr = ndr) { - ndr = TAILQ_NEXT(dr, dr_entry); + TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { if (!dr->installed) continue; @@ -798,8 +783,7 @@ nd6_purge(struct ifnet *ifp) } /* Nuke prefix list entries toward ifp */ - for (pr = V_nd_prefix.lh_first; pr; pr = npr) { - npr = pr->ndpr_next; + LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, npr) { if (pr->ndpr_ifp == ifp) { /* * Because if_detach() does *not* release prefixes @@ -910,7 +894,7 @@ nd6_is_new_addr_neighbor(struct sockaddr * If the address matches one of our on-link prefixes, it should be a * neighbor. */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { if (pr->ndpr_ifp != ifp) continue; @@ -963,7 +947,7 @@ nd6_is_new_addr_neighbor(struct sockaddr * as on-link, and thus, as a neighbor. */ if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && - TAILQ_FIRST(&V_nd_defrouter) == NULL && + TAILQ_EMPTY(&V_nd_defrouter) && V_nd6_defifindex == ifp->if_index) { return (1); } @@ -1235,8 +1219,9 @@ nd6_ioctl(u_long cmd, caddr_t data, stru */ bzero(drl, sizeof(*drl)); s = splnet(); - dr = TAILQ_FIRST(&V_nd_defrouter); - while (dr && i < DRLSTSIZ) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { + if (i >= DRLSTSIZ) + break; drl->defrouter[i].rtaddr = dr->rtaddr; in6_clearscope(&drl->defrouter[i].rtaddr); @@ -1245,7 +1230,6 @@ nd6_ioctl(u_long cmd, caddr_t data, stru drl->defrouter[i].expire = dr->expire; drl->defrouter[i].if_index = dr->ifp->if_index; i++; - dr = TAILQ_NEXT(dr, dr_entry); } splx(s); break; @@ -1264,11 +1248,12 @@ nd6_ioctl(u_long cmd, caddr_t data, stru */ bzero(oprl, sizeof(*oprl)); s = splnet(); - pr = V_nd_prefix.lh_first; - while (pr && i < PRLSTSIZ) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { struct nd_pfxrouter *pfr; int j; + if (i >= PRLSTSIZ) + break; oprl->prefix[i].prefix = pr->ndpr_prefix.sin6_addr; oprl->prefix[i].raflags = pr->ndpr_raf; oprl->prefix[i].prefixlen = pr->ndpr_plen; @@ -1293,9 +1278,8 @@ nd6_ioctl(u_long cmd, caddr_t data, stru oprl->prefix[i].expire = maxexpire; } - pfr = pr->ndpr_advrtrs.lh_first; j = 0; - while (pfr) { + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { if (j < DRLSTSIZ) { #define RTRADDR oprl->prefix[i].advrtr[j] RTRADDR = pfr->router->rtaddr; @@ -1303,13 +1287,11 @@ nd6_ioctl(u_long cmd, caddr_t data, stru #undef RTRADDR } j++; - pfr = pfr->pfr_next; } oprl->prefix[i].advrtrs = j; oprl->prefix[i].origin = PR_ORIG_RA; i++; - pr = pr->ndpr_next; } splx(s); @@ -1471,11 +1453,9 @@ nd6_ioctl(u_long cmd, caddr_t data, stru struct nd_prefix *pr, *next; s = splnet(); - for (pr = V_nd_prefix.lh_first; pr; pr = next) { + LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, next) { struct in6_ifaddr *ia, *ia_next; - next = pr->ndpr_next; - if (IN6_IS_ADDR_LINKLOCAL(&pr->ndpr_prefix.sin6_addr)) continue; /* XXX */ @@ -1501,8 +1481,7 @@ nd6_ioctl(u_long cmd, caddr_t data, stru s = splnet(); defrouter_reset(); - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; dr = next) { - next = TAILQ_NEXT(dr, dr_entry); + TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, next) { defrtrlist_del(dr); } defrouter_select(); @@ -1825,8 +1804,7 @@ nd6_slowtimo(void *arg) callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, nd6_slowtimo, curvnet); IFNET_RLOCK_NOSLEEP(); - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; - ifp = TAILQ_NEXT(ifp, if_list)) { + TAILQ_FOREACH(ifp, &V_ifnet, if_list) { nd6if = ND_IFINFO(ifp); if (nd6if->basereachable && /* already initialized */ (nd6if->recalctm -= ND6_SLOWTIMER_INTERVAL) <= 0) { @@ -2298,8 +2276,7 @@ nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) return EPERM; error = 0; - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { d = (struct in6_defrouter *)buf; de = (struct in6_defrouter *)(buf + sizeof(buf)); @@ -2339,7 +2316,7 @@ nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) return EPERM; error = 0; - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { u_short advrtrs; size_t advance; struct sockaddr_in6 *sin6, *s6; @@ -2384,8 +2361,7 @@ nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) p->flags = pr->ndpr_stateflags; p->origin = PR_ORIG_RA; advrtrs = 0; - for (pfr = pr->ndpr_advrtrs.lh_first; pfr; - pfr = pfr->pfr_next) { + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { if ((void *)&sin6[advrtrs + 1] > (void *)pe) { advrtrs++; continue; Modified: stable/9/sys/netinet6/nd6.h ============================================================================== --- stable/9/sys/netinet6/nd6.h Fri Mar 16 20:32:11 2012 (r233045) +++ stable/9/sys/netinet6/nd6.h Fri Mar 16 21:28:05 2012 (r233046) @@ -278,8 +278,6 @@ struct nd_prefix { int ndpr_refcnt; /* reference couter from addresses */ }; -#define ndpr_next ndpr_entry.le_next - #define ndpr_raf ndpr_flags #define ndpr_raf_onlink ndpr_flags.onlink #define ndpr_raf_auto ndpr_flags.autonomous @@ -313,7 +311,6 @@ struct inet6_ndpr_msghdr { struct nd_pfxrouter { LIST_ENTRY(nd_pfxrouter) pfr_entry; -#define pfr_next pfr_entry.le_next struct nd_defrouter *router; }; Modified: stable/9/sys/netinet6/nd6_nbr.c ============================================================================== --- stable/9/sys/netinet6/nd6_nbr.c Fri Mar 16 20:32:11 2012 (r233045) +++ stable/9/sys/netinet6/nd6_nbr.c Fri Mar 16 21:28:05 2012 (r233046) @@ -1190,11 +1190,11 @@ nd6_dad_find(struct ifaddr *ifa) { struct dadq *dp; - for (dp = V_dadq.tqh_first; dp; dp = dp->dad_list.tqe_next) { + TAILQ_FOREACH(dp, &V_dadq, dad_list) if (dp->dad_ifa == ifa) - return dp; - } - return NULL; + return (dp); + + return (NULL); } static void Modified: stable/9/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/9/sys/netinet6/nd6_rtr.c Fri Mar 16 20:32:11 2012 (r233045) +++ stable/9/sys/netinet6/nd6_rtr.c Fri Mar 16 21:28:05 2012 (r233046) @@ -504,8 +504,7 @@ defrouter_lookup(struct in6_addr *addr, { struct nd_defrouter *dr; - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { if (dr->ifp == ifp && IN6_ARE_ADDR_EQUAL(addr, &dr->rtaddr)) return (dr); } @@ -552,8 +551,7 @@ defrouter_reset(void) { struct nd_defrouter *dr; - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) defrouter_delreq(dr); /* @@ -584,7 +582,7 @@ defrtrlist_del(struct nd_defrouter *dr) /* * Also delete all the pointers to the router in each prefix lists. */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { struct nd_pfxrouter *pfxrtr; if ((pfxrtr = pfxrtr_lookup(pr, dr)) != NULL) pfxrtr_del(pfxrtr); @@ -634,7 +632,7 @@ defrouter_select(void) * Let's handle easy case (3) first: * If default router list is empty, there's nothing to be done. */ - if (!TAILQ_FIRST(&V_nd_defrouter)) { + if (TAILQ_EMPTY(&V_nd_defrouter)) { splx(s); return; } @@ -644,8 +642,7 @@ defrouter_select(void) * We just pick up the first reachable one (if any), assuming that * the ordering rule of the list described in defrtrlist_update(). */ - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { IF_AFDATA_LOCK(dr->ifp); if (selected_dr == NULL && (ln = nd6_lookup(&dr->rtaddr, 0, dr->ifp)) && @@ -802,8 +799,7 @@ insert: */ /* insert at the end of the group */ - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { if (rtpref(n) > rtpref(dr)) break; } @@ -824,7 +820,7 @@ pfxrtr_lookup(struct nd_prefix *pr, stru { struct nd_pfxrouter *search; - for (search = pr->ndpr_advrtrs.lh_first; search; search = search->pfr_next) { + LIST_FOREACH(search, &pr->ndpr_advrtrs, pfr_entry) { if (search->router == dr) break; } @@ -860,8 +856,7 @@ nd6_prefix_lookup(struct nd_prefixctl *k { struct nd_prefix *search; - for (search = V_nd_prefix.lh_first; - search; search = search->ndpr_next) { + LIST_FOREACH(search, &V_nd_prefix, ndpr_entry) { if (key->ndpr_ifp == search->ndpr_ifp && key->ndpr_plen == search->ndpr_plen && in6_are_prefix_equal(&key->ndpr_prefix.sin6_addr, @@ -967,9 +962,7 @@ prelist_remove(struct nd_prefix *pr) LIST_REMOVE(pr, ndpr_entry); /* free list of routers that adversed the prefix */ - for (pfr = pr->ndpr_advrtrs.lh_first; pfr; pfr = next) { - next = pfr->pfr_next; - + LIST_FOREACH_SAFE(pfr, &pr->ndpr_advrtrs, pfr_entry, next) { free(pfr, M_IP6NDP); } splx(s); @@ -1332,8 +1325,7 @@ find_pfxlist_reachable_router(struct nd_ struct llentry *ln; int canreach; - for (pfxrtr = LIST_FIRST(&pr->ndpr_advrtrs); pfxrtr != NULL; - pfxrtr = LIST_NEXT(pfxrtr, pfr_entry)) { + LIST_FOREACH(pfxrtr, &pr->ndpr_advrtrs, pfr_entry) { IF_AFDATA_LOCK(pfxrtr->router->ifp); ln = nd6_lookup(&pfxrtr->router->rtaddr, 0, pfxrtr->router->ifp); IF_AFDATA_UNLOCK(pfxrtr->router->ifp); @@ -1372,7 +1364,7 @@ pfxlist_onlink_check() * Check if there is a prefix that has a reachable advertising * router. */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { if (pr->ndpr_raf_onlink && find_pfxlist_reachable_router(pr)) break; } @@ -1382,12 +1374,10 @@ pfxlist_onlink_check() * that does not advertise any prefixes. */ if (pr == NULL) { - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { struct nd_prefix *pr0; - for (pr0 = V_nd_prefix.lh_first; pr0; - pr0 = pr0->ndpr_next) { + LIST_FOREACH(pr0, &V_nd_prefix, ndpr_entry) { if ((pfxrtr = pfxrtr_lookup(pr0, dr)) != NULL) break; } @@ -1395,7 +1385,7 @@ pfxlist_onlink_check() break; } } - if (pr != NULL || (TAILQ_FIRST(&V_nd_defrouter) && pfxrtr == NULL)) { + if (pr != NULL || (!TAILQ_EMPTY(&V_nd_defrouter) && pfxrtr == NULL)) { /* * There is at least one prefix that has a reachable router, * or at least a router which probably does not advertise @@ -1405,7 +1395,7 @@ pfxlist_onlink_check() * Detach prefixes which have no reachable advertising * router, and attach other prefixes. */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { /* XXX: a link-local prefix should never be detached */ if (IN6_IS_ADDR_LINKLOCAL(&pr->ndpr_prefix.sin6_addr)) continue; @@ -1429,7 +1419,7 @@ pfxlist_onlink_check() } } else { /* there is no prefix that has a reachable router */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { if (IN6_IS_ADDR_LINKLOCAL(&pr->ndpr_prefix.sin6_addr)) continue; @@ -1452,7 +1442,7 @@ pfxlist_onlink_check() * interfaces. Such cases will be handled in nd6_prefix_onlink, * so we don't have to care about them. */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { int e; char ip6buf[INET6_ADDRSTRLEN]; @@ -1653,7 +1643,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) * Although such a configuration is expected to be rare, we explicitly * allow it. */ - for (opr = V_nd_prefix.lh_first; opr; opr = opr->ndpr_next) { + LIST_FOREACH(opr, &V_nd_prefix, ndpr_entry) { if (opr == pr) continue; @@ -1765,7 +1755,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) * If there's one, try to make the prefix on-link on the * interface. */ - for (opr = V_nd_prefix.lh_first; opr; opr = opr->ndpr_next) { + LIST_FOREACH(opr, &V_nd_prefix, ndpr_entry) { if (opr == pr) continue; From owner-svn-src-stable@FreeBSD.ORG Fri Mar 16 21:28:30 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 247A71065670; Fri, 16 Mar 2012 21:28:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6B058FC16; Fri, 16 Mar 2012 21:28:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2GLSTFV035628; Fri, 16 Mar 2012 21:28:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2GLSTiZ035619; Fri, 16 Mar 2012 21:28:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203162128.q2GLSTiZ035619@svn.freebsd.org> From: John Baldwin Date: Fri, 16 Mar 2012 21:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233047 - in stable/8/sys: i386/conf netinet netinet6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 21:28:30 -0000 Author: jhb Date: Fri Mar 16 21:28:29 2012 New Revision: 233047 URL: http://svn.freebsd.org/changeset/base/233047 Log: MFC 226340,226340: Use queue(3) macros instead of home-rolled versions in several places in the INET6 code. This includes retiring the 'ndpr_next' and 'pfr_next' macros. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet6/icmp6.c stable/8/sys/netinet6/in6.c stable/8/sys/netinet6/in6_ifattach.c stable/8/sys/netinet6/nd6.c stable/8/sys/netinet6/nd6.h stable/8/sys/netinet6/nd6_nbr.c stable/8/sys/netinet6/nd6_rtr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 16 21:28:05 2012 (r233046) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 16 21:28:29 2012 (r233047) @@ -13834,8 +13834,7 @@ sctp_v6src_match_nexthop(struct sockaddr SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, (struct sockaddr *)src6); /* search installed gateway from prefix entry */ - for (pfxrtr = pfx->ndpr_advrtrs.lh_first; pfxrtr; pfxrtr = - pfxrtr->pfr_next) { + LIST_FOREACH(pfxrtr, &pfx->ndpr_advrtrs, pfr_entry) { memset(&gw6, 0, sizeof(struct sockaddr_in6)); gw6.sin6_family = AF_INET6; gw6.sin6_len = sizeof(struct sockaddr_in6); Modified: stable/8/sys/netinet6/icmp6.c ============================================================================== --- stable/8/sys/netinet6/icmp6.c Fri Mar 16 21:28:05 2012 (r233046) +++ stable/8/sys/netinet6/icmp6.c Fri Mar 16 21:28:29 2012 (r233047) @@ -1697,7 +1697,7 @@ ni6_addrs(struct icmp6_nodeinfo *ni6, st } IFNET_RLOCK_NOSLEEP(); - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) { + TAILQ_FOREACH(ifp, &V_ifnet, if_list) { addrsofif = 0; IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Fri Mar 16 21:28:05 2012 (r233046) +++ stable/8/sys/netinet6/in6.c Fri Mar 16 21:28:29 2012 (r233047) @@ -1203,7 +1203,7 @@ in6_purgeaddr_mc(struct ifnet *ifp, stru /* * Leave from multicast groups we have joined for the interface. */ - while ((imm = ia->ia6_memberships.lh_first) != NULL) { + while ((imm = LIST_FIRST(&ia->ia6_memberships)) != NULL) { LIST_REMOVE(imm, i6mm_chain); in6_leavegroup(imm); } @@ -2242,8 +2242,7 @@ in6_setmaxmtu(void) struct ifnet *ifp; IFNET_RLOCK_NOSLEEP(); - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; - ifp = TAILQ_NEXT(ifp, if_list)) { + TAILQ_FOREACH(ifp, &V_ifnet, if_list) { /* this function can be called during ifnet initialization */ if (!ifp->if_afdata[AF_INET6]) continue; Modified: stable/8/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/8/sys/netinet6/in6_ifattach.c Fri Mar 16 21:28:05 2012 (r233046) +++ stable/8/sys/netinet6/in6_ifattach.c Fri Mar 16 21:28:29 2012 (r233047) @@ -404,7 +404,7 @@ get_ifid(struct ifnet *ifp0, struct ifne /* next, try to get it from some other hardware interface */ IFNET_RLOCK_NOSLEEP(); - for (ifp = V_ifnet.tqh_first; ifp; ifp = ifp->if_list.tqe_next) { + TAILQ_FOREACH(ifp, &V_ifnet, if_list) { if (ifp == ifp0) continue; if (in6_get_hw_ifid(ifp, in6) != 0) @@ -809,7 +809,7 @@ in6_ifdetach(struct ifnet *ifp) /* * leave from multicast groups we have joined for the interface */ - while ((imm = ia->ia6_memberships.lh_first) != NULL) { + while ((imm = LIST_FIRST(&ia->ia6_memberships)) != NULL) { LIST_REMOVE(imm, i6mm_chain); in6_leavegroup(imm); } @@ -909,8 +909,7 @@ in6_tmpaddrtimer(void *arg) V_ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, curvnet); bzero(nullbuf, sizeof(nullbuf)); - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; - ifp = TAILQ_NEXT(ifp, if_list)) { + TAILQ_FOREACH(ifp, &V_ifnet, if_list) { ndi = ND_IFINFO(ifp); if (bcmp(ndi->randomid, nullbuf, sizeof(nullbuf)) != 0) { /* Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Fri Mar 16 21:28:05 2012 (r233046) +++ stable/8/sys/netinet6/nd6.c Fri Mar 16 21:28:29 2012 (r233047) @@ -562,8 +562,8 @@ nd6_timer(void *arg) { CURVNET_SET((struct vnet *) arg); int s; - struct nd_defrouter *dr; - struct nd_prefix *pr; + struct nd_defrouter *dr, *ndr; + struct nd_prefix *pr, *npr; struct in6_ifaddr *ia6, *nia6; callout_reset(&V_nd6_timer_ch, V_nd6_prune * hz, @@ -571,16 +571,9 @@ nd6_timer(void *arg) /* expire default router list */ s = splnet(); - dr = TAILQ_FIRST(&V_nd_defrouter); - while (dr) { - if (dr->expire && dr->expire < time_second) { - struct nd_defrouter *t; - t = TAILQ_NEXT(dr, dr_entry); + TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { + if (dr->expire && dr->expire < time_second) defrtrlist_del(dr); - dr = t; - } else { - dr = TAILQ_NEXT(dr, dr_entry); - } } /* @@ -656,8 +649,7 @@ nd6_timer(void *arg) } /* expire prefix list */ - pr = V_nd_prefix.lh_first; - while (pr) { + LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, npr) { /* * check prefix lifetime. * since pltime is just for autoconf, pltime processing for @@ -665,18 +657,13 @@ nd6_timer(void *arg) */ if (pr->ndpr_vltime != ND6_INFINITE_LIFETIME && time_second - pr->ndpr_lastupdate > pr->ndpr_vltime) { - struct nd_prefix *t; - t = pr->ndpr_next; /* * address expiration and prefix expiration are * separate. NEVER perform in6_purgeaddr here. */ - prelist_remove(pr); - pr = t; - } else - pr = pr->ndpr_next; + } } splx(s); CURVNET_RESTORE(); @@ -769,8 +756,7 @@ nd6_purge(struct ifnet *ifp) * in the routing table, in order to keep additional side effects as * small as possible. */ - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; dr = ndr) { - ndr = TAILQ_NEXT(dr, dr_entry); + TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { if (dr->installed) continue; @@ -778,8 +764,7 @@ nd6_purge(struct ifnet *ifp) defrtrlist_del(dr); } - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; dr = ndr) { - ndr = TAILQ_NEXT(dr, dr_entry); + TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { if (!dr->installed) continue; @@ -788,8 +773,7 @@ nd6_purge(struct ifnet *ifp) } /* Nuke prefix list entries toward ifp */ - for (pr = V_nd_prefix.lh_first; pr; pr = npr) { - npr = pr->ndpr_next; + LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, npr) { if (pr->ndpr_ifp == ifp) { /* * Because if_detach() does *not* release prefixes @@ -904,7 +888,7 @@ nd6_is_new_addr_neighbor(struct sockaddr * If the address matches one of our on-link prefixes, it should be a * neighbor. */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { if (pr->ndpr_ifp != ifp) continue; @@ -958,7 +942,7 @@ nd6_is_new_addr_neighbor(struct sockaddr * XXX: we restrict the condition to hosts, because routers usually do * not have the "default router list". */ - if (!V_ip6_forwarding && TAILQ_FIRST(&V_nd_defrouter) == NULL && + if (!V_ip6_forwarding && TAILQ_EMPTY(&V_nd_defrouter) && V_nd6_defifindex == ifp->if_index) { return (1); } @@ -1231,8 +1215,9 @@ nd6_ioctl(u_long cmd, caddr_t data, stru */ bzero(drl, sizeof(*drl)); s = splnet(); - dr = TAILQ_FIRST(&V_nd_defrouter); - while (dr && i < DRLSTSIZ) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { + if (i >= DRLSTSIZ) + break; drl->defrouter[i].rtaddr = dr->rtaddr; in6_clearscope(&drl->defrouter[i].rtaddr); @@ -1241,7 +1226,6 @@ nd6_ioctl(u_long cmd, caddr_t data, stru drl->defrouter[i].expire = dr->expire; drl->defrouter[i].if_index = dr->ifp->if_index; i++; - dr = TAILQ_NEXT(dr, dr_entry); } splx(s); break; @@ -1260,11 +1244,12 @@ nd6_ioctl(u_long cmd, caddr_t data, stru */ bzero(oprl, sizeof(*oprl)); s = splnet(); - pr = V_nd_prefix.lh_first; - while (pr && i < PRLSTSIZ) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { struct nd_pfxrouter *pfr; int j; + if (i >= PRLSTSIZ) + break; oprl->prefix[i].prefix = pr->ndpr_prefix.sin6_addr; oprl->prefix[i].raflags = pr->ndpr_raf; oprl->prefix[i].prefixlen = pr->ndpr_plen; @@ -1289,9 +1274,8 @@ nd6_ioctl(u_long cmd, caddr_t data, stru oprl->prefix[i].expire = maxexpire; } - pfr = pr->ndpr_advrtrs.lh_first; j = 0; - while (pfr) { + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { if (j < DRLSTSIZ) { #define RTRADDR oprl->prefix[i].advrtr[j] RTRADDR = pfr->router->rtaddr; @@ -1299,13 +1283,11 @@ nd6_ioctl(u_long cmd, caddr_t data, stru #undef RTRADDR } j++; - pfr = pfr->pfr_next; } oprl->prefix[i].advrtrs = j; oprl->prefix[i].origin = PR_ORIG_RA; i++; - pr = pr->ndpr_next; } splx(s); @@ -1369,11 +1351,9 @@ nd6_ioctl(u_long cmd, caddr_t data, stru struct nd_prefix *pr, *next; s = splnet(); - for (pr = V_nd_prefix.lh_first; pr; pr = next) { + LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, next) { struct in6_ifaddr *ia, *ia_next; - next = pr->ndpr_next; - if (IN6_IS_ADDR_LINKLOCAL(&pr->ndpr_prefix.sin6_addr)) continue; /* XXX */ @@ -1399,8 +1379,7 @@ nd6_ioctl(u_long cmd, caddr_t data, stru s = splnet(); defrouter_reset(); - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; dr = next) { - next = TAILQ_NEXT(dr, dr_entry); + TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, next) { defrtrlist_del(dr); } defrouter_select(); @@ -1722,8 +1701,7 @@ nd6_slowtimo(void *arg) callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, nd6_slowtimo, curvnet); IFNET_RLOCK_NOSLEEP(); - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; - ifp = TAILQ_NEXT(ifp, if_list)) { + TAILQ_FOREACH(ifp, &V_ifnet, if_list) { nd6if = ND_IFINFO(ifp); if (nd6if->basereachable && /* already initialized */ (nd6if->recalctm -= ND6_SLOWTIMER_INTERVAL) <= 0) { @@ -2169,8 +2147,7 @@ nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) return EPERM; error = 0; - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { d = (struct in6_defrouter *)buf; de = (struct in6_defrouter *)(buf + sizeof(buf)); @@ -2210,7 +2187,7 @@ nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) return EPERM; error = 0; - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { u_short advrtrs; size_t advance; struct sockaddr_in6 *sin6, *s6; @@ -2255,8 +2232,7 @@ nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) p->flags = pr->ndpr_stateflags; p->origin = PR_ORIG_RA; advrtrs = 0; - for (pfr = pr->ndpr_advrtrs.lh_first; pfr; - pfr = pfr->pfr_next) { + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { if ((void *)&sin6[advrtrs + 1] > (void *)pe) { advrtrs++; continue; Modified: stable/8/sys/netinet6/nd6.h ============================================================================== --- stable/8/sys/netinet6/nd6.h Fri Mar 16 21:28:05 2012 (r233046) +++ stable/8/sys/netinet6/nd6.h Fri Mar 16 21:28:29 2012 (r233047) @@ -276,8 +276,6 @@ struct nd_prefix { int ndpr_refcnt; /* reference couter from addresses */ }; -#define ndpr_next ndpr_entry.le_next - #define ndpr_raf ndpr_flags #define ndpr_raf_onlink ndpr_flags.onlink #define ndpr_raf_auto ndpr_flags.autonomous @@ -311,7 +309,6 @@ struct inet6_ndpr_msghdr { struct nd_pfxrouter { LIST_ENTRY(nd_pfxrouter) pfr_entry; -#define pfr_next pfr_entry.le_next struct nd_defrouter *router; }; Modified: stable/8/sys/netinet6/nd6_nbr.c ============================================================================== --- stable/8/sys/netinet6/nd6_nbr.c Fri Mar 16 21:28:05 2012 (r233046) +++ stable/8/sys/netinet6/nd6_nbr.c Fri Mar 16 21:28:29 2012 (r233047) @@ -1154,11 +1154,11 @@ nd6_dad_find(struct ifaddr *ifa) { struct dadq *dp; - for (dp = V_dadq.tqh_first; dp; dp = dp->dad_list.tqe_next) { + TAILQ_FOREACH(dp, &V_dadq, dad_list) if (dp->dad_ifa == ifa) - return dp; - } - return NULL; + return (dp); + + return (NULL); } static void Modified: stable/8/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/8/sys/netinet6/nd6_rtr.c Fri Mar 16 21:28:05 2012 (r233046) +++ stable/8/sys/netinet6/nd6_rtr.c Fri Mar 16 21:28:29 2012 (r233047) @@ -494,8 +494,7 @@ defrouter_lookup(struct in6_addr *addr, { struct nd_defrouter *dr; - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { if (dr->ifp == ifp && IN6_ARE_ADDR_EQUAL(addr, &dr->rtaddr)) return (dr); } @@ -542,8 +541,7 @@ defrouter_reset(void) { struct nd_defrouter *dr; - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) defrouter_delreq(dr); /* @@ -574,7 +572,7 @@ defrtrlist_del(struct nd_defrouter *dr) /* * Also delete all the pointers to the router in each prefix lists. */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { struct nd_pfxrouter *pfxrtr; if ((pfxrtr = pfxrtr_lookup(pr, dr)) != NULL) pfxrtr_del(pfxrtr); @@ -638,7 +636,7 @@ defrouter_select(void) * Let's handle easy case (3) first: * If default router list is empty, there's nothing to be done. */ - if (!TAILQ_FIRST(&V_nd_defrouter)) { + if (TAILQ_EMPTY(&V_nd_defrouter)) { splx(s); return; } @@ -648,8 +646,7 @@ defrouter_select(void) * We just pick up the first reachable one (if any), assuming that * the ordering rule of the list described in defrtrlist_update(). */ - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { IF_AFDATA_LOCK(dr->ifp); if (selected_dr == NULL && (ln = nd6_lookup(&dr->rtaddr, 0, dr->ifp)) && @@ -806,8 +803,7 @@ insert: */ /* insert at the end of the group */ - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { if (rtpref(n) > rtpref(dr)) break; } @@ -828,7 +824,7 @@ pfxrtr_lookup(struct nd_prefix *pr, stru { struct nd_pfxrouter *search; - for (search = pr->ndpr_advrtrs.lh_first; search; search = search->pfr_next) { + LIST_FOREACH(search, &pr->ndpr_advrtrs, pfr_entry) { if (search->router == dr) break; } @@ -864,8 +860,7 @@ nd6_prefix_lookup(struct nd_prefixctl *k { struct nd_prefix *search; - for (search = V_nd_prefix.lh_first; - search; search = search->ndpr_next) { + LIST_FOREACH(search, &V_nd_prefix, ndpr_entry) { if (key->ndpr_ifp == search->ndpr_ifp && key->ndpr_plen == search->ndpr_plen && in6_are_prefix_equal(&key->ndpr_prefix.sin6_addr, @@ -971,9 +966,7 @@ prelist_remove(struct nd_prefix *pr) LIST_REMOVE(pr, ndpr_entry); /* free list of routers that adversed the prefix */ - for (pfr = pr->ndpr_advrtrs.lh_first; pfr; pfr = next) { - next = pfr->pfr_next; - + LIST_FOREACH_SAFE(pfr, &pr->ndpr_advrtrs, pfr_entry, next) { free(pfr, M_IP6NDP); } splx(s); @@ -1336,8 +1329,7 @@ find_pfxlist_reachable_router(struct nd_ struct llentry *ln; int canreach; - for (pfxrtr = LIST_FIRST(&pr->ndpr_advrtrs); pfxrtr != NULL; - pfxrtr = LIST_NEXT(pfxrtr, pfr_entry)) { + LIST_FOREACH(pfxrtr, &pr->ndpr_advrtrs, pfr_entry) { IF_AFDATA_LOCK(pfxrtr->router->ifp); ln = nd6_lookup(&pfxrtr->router->rtaddr, 0, pfxrtr->router->ifp); IF_AFDATA_UNLOCK(pfxrtr->router->ifp); @@ -1376,7 +1368,7 @@ pfxlist_onlink_check() * Check if there is a prefix that has a reachable advertising * router. */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { if (pr->ndpr_raf_onlink && find_pfxlist_reachable_router(pr)) break; } @@ -1386,12 +1378,10 @@ pfxlist_onlink_check() * that does not advertise any prefixes. */ if (pr == NULL) { - for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; - dr = TAILQ_NEXT(dr, dr_entry)) { + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { struct nd_prefix *pr0; - for (pr0 = V_nd_prefix.lh_first; pr0; - pr0 = pr0->ndpr_next) { + LIST_FOREACH(pr0, &V_nd_prefix, ndpr_entry) { if ((pfxrtr = pfxrtr_lookup(pr0, dr)) != NULL) break; } @@ -1399,7 +1389,7 @@ pfxlist_onlink_check() break; } } - if (pr != NULL || (TAILQ_FIRST(&V_nd_defrouter) && pfxrtr == NULL)) { + if (pr != NULL || (!TAILQ_EMPTY(&V_nd_defrouter) && pfxrtr == NULL)) { /* * There is at least one prefix that has a reachable router, * or at least a router which probably does not advertise @@ -1409,7 +1399,7 @@ pfxlist_onlink_check() * Detach prefixes which have no reachable advertising * router, and attach other prefixes. */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { /* XXX: a link-local prefix should never be detached */ if (IN6_IS_ADDR_LINKLOCAL(&pr->ndpr_prefix.sin6_addr)) continue; @@ -1433,7 +1423,7 @@ pfxlist_onlink_check() } } else { /* there is no prefix that has a reachable router */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { if (IN6_IS_ADDR_LINKLOCAL(&pr->ndpr_prefix.sin6_addr)) continue; @@ -1456,7 +1446,7 @@ pfxlist_onlink_check() * interfaces. Such cases will be handled in nd6_prefix_onlink, * so we don't have to care about them. */ - for (pr = V_nd_prefix.lh_first; pr; pr = pr->ndpr_next) { + LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { int e; char ip6buf[INET6_ADDRSTRLEN]; @@ -1657,7 +1647,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) * Although such a configuration is expected to be rare, we explicitly * allow it. */ - for (opr = V_nd_prefix.lh_first; opr; opr = opr->ndpr_next) { + LIST_FOREACH(opr, &V_nd_prefix, ndpr_entry) { if (opr == pr) continue; @@ -1769,7 +1759,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) * If there's one, try to make the prefix on-link on the * interface. */ - for (opr = V_nd_prefix.lh_first; opr; opr = opr->ndpr_next) { + LIST_FOREACH(opr, &V_nd_prefix, ndpr_entry) { if (opr == pr) continue; From owner-svn-src-stable@FreeBSD.ORG Fri Mar 16 23:58:35 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD26C106566B; Fri, 16 Mar 2012 23:58:35 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBF648FC08; Fri, 16 Mar 2012 23:58:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2GNwZCO040746; Fri, 16 Mar 2012 23:58:35 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2GNwZ9e040743; Fri, 16 Mar 2012 23:58:35 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201203162358.q2GNwZ9e040743@svn.freebsd.org> From: Sean Bruno Date: Fri, 16 Mar 2012 23:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233055 - stable/8/contrib/gcc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 23:58:35 -0000 Author: sbruno Date: Fri Mar 16 23:58:35 2012 New Revision: 233055 URL: http://svn.freebsd.org/changeset/base/233055 Log: MFC r226702 Author: obrien Date: Mon Oct 24 20:52:41 2011 UTC (4 months, 3 weeks ago) Changed paths: 3 Log Message: * Don't give the impression that this compiler is GPLv3. (It is "well known" that GCC 4.2.2 is GPLv3.) * Don't give the impression that this compiler isn't "trustable". * Fix dependency nit. Modified: stable/8/contrib/gcc/BASE-VER stable/8/contrib/gcc/DEV-PHASE Directory Properties: stable/8/contrib/gcc/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/contrib/gcc/BASE-VER ============================================================================== --- stable/8/contrib/gcc/BASE-VER Fri Mar 16 23:54:23 2012 (r233054) +++ stable/8/contrib/gcc/BASE-VER Fri Mar 16 23:58:35 2012 (r233055) @@ -1 +1 @@ -4.2.2 +4.2.1 Modified: stable/8/contrib/gcc/DEV-PHASE ============================================================================== --- stable/8/contrib/gcc/DEV-PHASE Fri Mar 16 23:54:23 2012 (r233054) +++ stable/8/contrib/gcc/DEV-PHASE Fri Mar 16 23:58:35 2012 (r233055) @@ -1 +1 @@ -prerelease +patched From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 00:10:21 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBBB01065670; Sat, 17 Mar 2012 00:10:21 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA8B08FC08; Sat, 17 Mar 2012 00:10:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H0ALIo041193; Sat, 17 Mar 2012 00:10:21 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H0ALbi041190; Sat, 17 Mar 2012 00:10:21 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201203170010.q2H0ALbi041190@svn.freebsd.org> From: Sean Bruno Date: Sat, 17 Mar 2012 00:10:21 +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: r233057 - stable/7/contrib/gcc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 00:10:21 -0000 Author: sbruno Date: Sat Mar 17 00:10:21 2012 New Revision: 233057 URL: http://svn.freebsd.org/changeset/base/233057 Log: MFC r226702 Author: obrien Date: Mon Oct 24 20:52:41 2011 UTC (4 months, 3 weeks ago) Changed paths: 3 Log Message: * Don't give the impression that this compiler is GPLv3. (It is "well known" that GCC 4.2.2 is GPLv3.) * Don't give the impression that this compiler isn't "trustable". * Fix dependency nit. Modified: stable/7/contrib/gcc/BASE-VER stable/7/contrib/gcc/DEV-PHASE Directory Properties: stable/7/contrib/gcc/ (props changed) Modified: stable/7/contrib/gcc/BASE-VER ============================================================================== --- stable/7/contrib/gcc/BASE-VER Sat Mar 17 00:00:33 2012 (r233056) +++ stable/7/contrib/gcc/BASE-VER Sat Mar 17 00:10:21 2012 (r233057) @@ -1 +1 @@ -4.2.2 +4.2.1 Modified: stable/7/contrib/gcc/DEV-PHASE ============================================================================== --- stable/7/contrib/gcc/DEV-PHASE Sat Mar 17 00:00:33 2012 (r233056) +++ stable/7/contrib/gcc/DEV-PHASE Sat Mar 17 00:10:21 2012 (r233057) @@ -1 +1 @@ -prerelease +patched From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 01:04:08 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F563106566C; Sat, 17 Mar 2012 01:04:08 +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 0E4E98FC15; Sat, 17 Mar 2012 01:04:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H147pL042942; Sat, 17 Mar 2012 01:04:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H147pa042940; Sat, 17 Mar 2012 01:04:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201203170104.q2H147pa042940@svn.freebsd.org> From: Xin LI Date: Sat, 17 Mar 2012 01:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233059 - stable/9/sys/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 01:04:08 -0000 Author: delphij Date: Sat Mar 17 01:04:07 2012 New Revision: 233059 URL: http://svn.freebsd.org/changeset/base/233059 Log: MFC r232990: Add the missing IPOIB option. Sponsored by: iXsystems, Inc. Modified: stable/9/sys/conf/options Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Sat Mar 17 00:39:40 2012 (r233058) +++ stable/9/sys/conf/options Sat Mar 17 01:04:07 2012 (r233059) @@ -883,6 +883,7 @@ OFED opt_ofed.h OFED_DEBUG_INIT opt_ofed.h SDP opt_ofed.h SDP_DEBUG opt_ofed.h +IPOIB opt_ofed.h IPOIB_DEBUG opt_ofed.h IPOIB_CM opt_ofed.h From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 01:19:37 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C4A0106566B; Sat, 17 Mar 2012 01:19:37 +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 1B4A88FC08; Sat, 17 Mar 2012 01:19:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H1JaCU043436; Sat, 17 Mar 2012 01:19:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H1JaPb043434; Sat, 17 Mar 2012 01:19:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203170119.q2H1JaPb043434@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Mar 2012 01:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233060 - stable/9/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 01:19:37 -0000 Author: kib Date: Sat Mar 17 01:19:36 2012 New Revision: 233060 URL: http://svn.freebsd.org/changeset/base/233060 Log: MFC r232776: Add brackets around bare '-1' used as the macro body. Modified: stable/9/sys/sys/unistd.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/unistd.h ============================================================================== --- stable/9/sys/sys/unistd.h Sat Mar 17 01:04:07 2012 (r233059) +++ stable/9/sys/sys/unistd.h Sat Mar 17 01:19:36 2012 (r233060) @@ -52,34 +52,34 @@ #define _POSIX_ADVISORY_INFO 200112L #define _POSIX_ASYNCHRONOUS_IO 0 #define _POSIX_CHOWN_RESTRICTED 1 -#define _POSIX_CLOCK_SELECTION -1 -#define _POSIX_CPUTIME -1 +#define _POSIX_CLOCK_SELECTION (-1) +#define _POSIX_CPUTIME (-1) #define _POSIX_FSYNC 200112L #define _POSIX_IPV6 0 #define _POSIX_JOB_CONTROL 1 #define _POSIX_MAPPED_FILES 200112L -#define _POSIX_MEMLOCK -1 +#define _POSIX_MEMLOCK (-1) #define _POSIX_MEMLOCK_RANGE 200112L #define _POSIX_MEMORY_PROTECTION 200112L #define _POSIX_MESSAGE_PASSING 200112L #define _POSIX_MONOTONIC_CLOCK 200112L #define _POSIX_NO_TRUNC 1 -#define _POSIX_PRIORITIZED_IO -1 +#define _POSIX_PRIORITIZED_IO (-1) #define _POSIX_PRIORITY_SCHEDULING 200112L #define _POSIX_RAW_SOCKETS 200112L #define _POSIX_REALTIME_SIGNALS 200112L #define _POSIX_SEMAPHORES 200112L #define _POSIX_SHARED_MEMORY_OBJECTS 200112L -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_SYNCHRONIZED_IO -1 +#define _POSIX_SPORADIC_SERVER (-1) +#define _POSIX_SYNCHRONIZED_IO (-1) #define _POSIX_TIMEOUTS 200112L #define _POSIX_TIMERS 200112L -#define _POSIX_TYPED_MEMORY_OBJECTS -1 +#define _POSIX_TYPED_MEMORY_OBJECTS (-1) #define _POSIX_VDISABLE 0xff #if __XSI_VISIBLE #define _XOPEN_SHM 1 -#define _XOPEN_STREAMS -1 +#define _XOPEN_STREAMS (-1) #endif /* From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 01:23:50 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F958106566C; Sat, 17 Mar 2012 01:23:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E66D8FC0A; Sat, 17 Mar 2012 01:23:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H1NoFQ043621; Sat, 17 Mar 2012 01:23:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H1NorC043619; Sat, 17 Mar 2012 01:23:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203170123.q2H1NorC043619@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Mar 2012 01:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233061 - stable/9/sys/dev/uart X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 01:23:50 -0000 Author: kib Date: Sat Mar 17 01:23:49 2012 New Revision: 233061 URL: http://svn.freebsd.org/changeset/base/233061 Log: MFC r232967: Add PCI Id for the AMT SOL UART on G4x series Intel chipsets. Modified: stable/9/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/9/sys/dev/uart/uart_bus_pci.c Sat Mar 17 01:19:36 2012 (r233060) +++ stable/9/sys/dev/uart/uart_bus_pci.c Sat Mar 17 01:23:49 2012 (r233061) @@ -113,6 +113,7 @@ static struct pci_id pci_ns8250_ids[] = { 0x14e4, 0x4344, 0xffff, 0, "Sony Ericsson GC89 PC Card", 0x10}, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, +{ 0x8086, 0x2e17, 0xffff, 0, "4 Series Chipset Serial KT Controller", 0x10 }, { 0x8086, 0x3b67, 0xffff, 0, "5 Series/3400 Series Chipset KT Controller", 0x10 }, { 0x8086, 0x8811, 0xffff, 0, "Intel EG20T Serial Port 0", 0x10 }, From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 01:27:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCB19106566B; Sat, 17 Mar 2012 01:27:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBB4C8FC16; Sat, 17 Mar 2012 01:27:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H1R9U9043770; Sat, 17 Mar 2012 01:27:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H1R9IC043768; Sat, 17 Mar 2012 01:27:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203170127.q2H1R9IC043768@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Mar 2012 01:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233062 - stable/9/lib/libc/string X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 01:27:09 -0000 Author: kib Date: Sat Mar 17 01:27:09 2012 New Revision: 233062 URL: http://svn.freebsd.org/changeset/base/233062 Log: MFC r232973: Fix indentation. Modified: stable/9/lib/libc/string/strerror.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/string/strerror.c ============================================================================== --- stable/9/lib/libc/string/strerror.c Sat Mar 17 01:23:49 2012 (r233061) +++ stable/9/lib/libc/string/strerror.c Sat Mar 17 01:27:09 2012 (r233062) @@ -121,6 +121,6 @@ strerror(int num) static char ebuf[NL_TEXTMAX]; if (strerror_r(num, ebuf, sizeof(ebuf)) != 0) - errno = EINVAL; + errno = EINVAL; return (ebuf); } From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 01:37:41 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FA0F1065670; Sat, 17 Mar 2012 01:37:41 +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 74D848FC12; Sat, 17 Mar 2012 01:37:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H1bfUW044122; Sat, 17 Mar 2012 01:37:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H1bfoM044120; Sat, 17 Mar 2012 01:37:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203170137.q2H1bfoM044120@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Mar 2012 01:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233063 - stable/9/libexec/rtld-elf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 01:37:41 -0000 Author: kib Date: Sat Mar 17 01:37:40 2012 New Revision: 233063 URL: http://svn.freebsd.org/changeset/base/233063 Log: MFC r232777: Optimize tls_get_addr_common(). Modified: stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Sat Mar 17 01:27:09 2012 (r233062) +++ stable/9/libexec/rtld-elf/rtld.c Sat Mar 17 01:37:40 2012 (r233063) @@ -3507,17 +3507,17 @@ unref_dag(Obj_Entry *root) /* * Common code for MD __tls_get_addr(). */ -void * -tls_get_addr_common(Elf_Addr** dtvp, int index, size_t offset) +static void *tls_get_addr_slow(Elf_Addr **, int, size_t) __noinline; +static void * +tls_get_addr_slow(Elf_Addr **dtvp, int index, size_t offset) { - Elf_Addr* dtv = *dtvp; + Elf_Addr *newdtv, *dtv; RtldLockState lockstate; + int to_copy; + dtv = *dtvp; /* Check dtv generation in case new modules have arrived */ if (dtv[0] != tls_dtv_generation) { - Elf_Addr* newdtv; - int to_copy; - wlock_acquire(rtld_bind_lock, &lockstate); newdtv = calloc(1, (tls_max_index + 2) * sizeof(Elf_Addr)); to_copy = dtv[1]; @@ -3532,14 +3532,27 @@ tls_get_addr_common(Elf_Addr** dtvp, int } /* Dynamically allocate module TLS if necessary */ - if (!dtv[index + 1]) { + if (dtv[index + 1] == 0) { /* Signal safe, wlock will block out signals. */ - wlock_acquire(rtld_bind_lock, &lockstate); + wlock_acquire(rtld_bind_lock, &lockstate); if (!dtv[index + 1]) dtv[index + 1] = (Elf_Addr)allocate_module_tls(index); lock_release(rtld_bind_lock, &lockstate); } - return (void*) (dtv[index + 1] + offset); + return ((void *)(dtv[index + 1] + offset)); +} + +void * +tls_get_addr_common(Elf_Addr **dtvp, int index, size_t offset) +{ + Elf_Addr *dtv; + + dtv = *dtvp; + /* Check dtv generation in case new modules have arrived */ + if (__predict_true(dtv[0] == tls_dtv_generation && + dtv[index + 1] != 0)) + return ((void *)(dtv[index + 1] + offset)); + return (tls_get_addr_slow(dtvp, index, offset)); } /* XXX not sure what variants to use for arm. */ From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 01:47:32 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 709F5106564A; Sat, 17 Mar 2012 01:47:32 +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 5FA3D8FC12; Sat, 17 Mar 2012 01:47:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H1lWd6044463; Sat, 17 Mar 2012 01:47:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H1lWnU044461; Sat, 17 Mar 2012 01:47:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203170147.q2H1lWnU044461@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Mar 2012 01:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233064 - stable/8/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 01:47:32 -0000 Author: kib Date: Sat Mar 17 01:47:31 2012 New Revision: 233064 URL: http://svn.freebsd.org/changeset/base/233064 Log: MFC r232776: Add brackets around bare '-1' used as the macro body. Modified: stable/8/sys/sys/unistd.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/sys/unistd.h ============================================================================== --- stable/8/sys/sys/unistd.h Sat Mar 17 01:37:40 2012 (r233063) +++ stable/8/sys/sys/unistd.h Sat Mar 17 01:47:31 2012 (r233064) @@ -52,34 +52,34 @@ #define _POSIX_ADVISORY_INFO 200112L #define _POSIX_ASYNCHRONOUS_IO 0 #define _POSIX_CHOWN_RESTRICTED 1 -#define _POSIX_CLOCK_SELECTION -1 -#define _POSIX_CPUTIME -1 +#define _POSIX_CLOCK_SELECTION (-1) +#define _POSIX_CPUTIME (-1) #define _POSIX_FSYNC 200112L #define _POSIX_IPV6 0 #define _POSIX_JOB_CONTROL 1 #define _POSIX_MAPPED_FILES 200112L -#define _POSIX_MEMLOCK -1 +#define _POSIX_MEMLOCK (-1) #define _POSIX_MEMLOCK_RANGE 200112L #define _POSIX_MEMORY_PROTECTION 200112L #define _POSIX_MESSAGE_PASSING 200112L #define _POSIX_MONOTONIC_CLOCK 200112L #define _POSIX_NO_TRUNC 1 -#define _POSIX_PRIORITIZED_IO -1 +#define _POSIX_PRIORITIZED_IO (-1) #define _POSIX_PRIORITY_SCHEDULING 200112L #define _POSIX_RAW_SOCKETS 200112L #define _POSIX_REALTIME_SIGNALS 200112L #define _POSIX_SEMAPHORES -1 #define _POSIX_SHARED_MEMORY_OBJECTS 200112L -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_SYNCHRONIZED_IO -1 +#define _POSIX_SPORADIC_SERVER (-1) +#define _POSIX_SYNCHRONIZED_IO (-1) #define _POSIX_TIMEOUTS 200112L #define _POSIX_TIMERS 200112L -#define _POSIX_TYPED_MEMORY_OBJECTS -1 +#define _POSIX_TYPED_MEMORY_OBJECTS (-1) #define _POSIX_VDISABLE 0xff #if __XSI_VISIBLE #define _XOPEN_SHM 1 -#define _XOPEN_STREAMS -1 +#define _XOPEN_STREAMS (-1) #endif /* From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 01:51:31 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 388F1106566B; Sat, 17 Mar 2012 01:51:31 +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 274168FC16; Sat, 17 Mar 2012 01:51:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H1pVNh044627; Sat, 17 Mar 2012 01:51:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H1pUl7044625; Sat, 17 Mar 2012 01:51:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203170151.q2H1pUl7044625@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Mar 2012 01:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233065 - stable/8/sys/dev/uart X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 01:51:31 -0000 Author: kib Date: Sat Mar 17 01:51:30 2012 New Revision: 233065 URL: http://svn.freebsd.org/changeset/base/233065 Log: MFC r232967: Add PCI Id for the AMT SOL UART on G4x series Intel chipsets. Modified: stable/8/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_pci.c Sat Mar 17 01:47:31 2012 (r233064) +++ stable/8/sys/dev/uart/uart_bus_pci.c Sat Mar 17 01:51:30 2012 (r233065) @@ -113,6 +113,7 @@ static struct pci_id pci_ns8250_ids[] = { 0x14e4, 0x4344, 0xffff, 0, "Sony Ericsson GC89 PC Card", 0x10}, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, +{ 0x8086, 0x2e17, 0xffff, 0, "4 Series Chipset Serial KT Controller", 0x10 }, { 0x8086, 0x3b67, 0xffff, 0, "5 Series/3400 Series Chipset KT Controller", 0x10 }, { 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 }, From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 01:59:15 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95D69106564A; Sat, 17 Mar 2012 01:59:15 +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 84C3F8FC1F; Sat, 17 Mar 2012 01:59:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H1xFKD044900; Sat, 17 Mar 2012 01:59:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H1xFuQ044898; Sat, 17 Mar 2012 01:59:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203170159.q2H1xFuQ044898@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Mar 2012 01:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233066 - stable/8/lib/libc/string X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 01:59:15 -0000 Author: kib Date: Sat Mar 17 01:59:15 2012 New Revision: 233066 URL: http://svn.freebsd.org/changeset/base/233066 Log: MFC r232973: Fix indentation. Modified: stable/8/lib/libc/string/strerror.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/string/strerror.c ============================================================================== --- stable/8/lib/libc/string/strerror.c Sat Mar 17 01:51:30 2012 (r233065) +++ stable/8/lib/libc/string/strerror.c Sat Mar 17 01:59:15 2012 (r233066) @@ -121,6 +121,6 @@ strerror(int num) static char ebuf[NL_TEXTMAX]; if (strerror_r(num, ebuf, sizeof(ebuf)) != 0) - errno = EINVAL; + errno = EINVAL; return (ebuf); } From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 02:05:34 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31B4E1065673; Sat, 17 Mar 2012 02:05:34 +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 073608FC08; Sat, 17 Mar 2012 02:05:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H25XB7045167; Sat, 17 Mar 2012 02:05:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H25XQo045165; Sat, 17 Mar 2012 02:05:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203170205.q2H25XQo045165@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Mar 2012 02:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233067 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 02:05:34 -0000 Author: kib Date: Sat Mar 17 02:05:33 2012 New Revision: 233067 URL: http://svn.freebsd.org/changeset/base/233067 Log: MFC r232777: Optimize tls_get_addr_common(). Modified: stable/8/libexec/rtld-elf/rtld.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Sat Mar 17 01:59:15 2012 (r233066) +++ stable/8/libexec/rtld-elf/rtld.c Sat Mar 17 02:05:33 2012 (r233067) @@ -3116,17 +3116,17 @@ unref_dag(Obj_Entry *root) /* * Common code for MD __tls_get_addr(). */ -void * -tls_get_addr_common(Elf_Addr** dtvp, int index, size_t offset) +static void *tls_get_addr_slow(Elf_Addr **, int, size_t) __noinline; +static void * +tls_get_addr_slow(Elf_Addr **dtvp, int index, size_t offset) { - Elf_Addr* dtv = *dtvp; + Elf_Addr *newdtv, *dtv; int lockstate; + int to_copy; + dtv = *dtvp; /* Check dtv generation in case new modules have arrived */ if (dtv[0] != tls_dtv_generation) { - Elf_Addr* newdtv; - int to_copy; - lockstate = wlock_acquire(rtld_bind_lock); newdtv = calloc(1, (tls_max_index + 2) * sizeof(Elf_Addr)); to_copy = dtv[1]; @@ -3141,14 +3141,27 @@ tls_get_addr_common(Elf_Addr** dtvp, int } /* Dynamically allocate module TLS if necessary */ - if (!dtv[index + 1]) { + if (dtv[index + 1] == 0) { /* Signal safe, wlock will block out signals. */ lockstate = wlock_acquire(rtld_bind_lock); if (!dtv[index + 1]) dtv[index + 1] = (Elf_Addr)allocate_module_tls(index); wlock_release(rtld_bind_lock, lockstate); } - return (void*) (dtv[index + 1] + offset); + return ((void *)(dtv[index + 1] + offset)); +} + +void * +tls_get_addr_common(Elf_Addr **dtvp, int index, size_t offset) +{ + Elf_Addr *dtv; + + dtv = *dtvp; + /* Check dtv generation in case new modules have arrived */ + if (__predict_true(dtv[0] == tls_dtv_generation && + dtv[index + 1] != 0)) + return ((void *)(dtv[index + 1] + offset)); + return (tls_get_addr_slow(dtvp, index, offset)); } /* XXX not sure what variants to use for arm. */ From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 05:45:22 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85C19106566C; Sat, 17 Mar 2012 05:45:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 738988FC0C; Sat, 17 Mar 2012 05:45:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H5jMdC052697; Sat, 17 Mar 2012 05:45:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H5jM1N052695; Sat, 17 Mar 2012 05:45:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201203170545.q2H5jM1N052695@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 17 Mar 2012 05:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233076 - in stable/9/sys: cddl/dev/dtrace/i386 i386/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 05:45:22 -0000 Author: marcel Date: Sat Mar 17 05:45:21 2012 New Revision: 233076 URL: http://svn.freebsd.org/changeset/base/233076 Log: MFC r227430: On i386, fbt probes are implemented by writing an invalid opcode over certain instructions in a function prologue or epilogue. DTrace has a hook into the invalid opcode fault handler that checks whether the fault was due to an probe and if so, runs the DTrace magic. Upon returning from an invalid opcode fault caused by a probe, DTrace must emulate the instruction that was replaced with the invalid opcode and then return control to the instruction following the invalid opcode. There were a pair of related bugs in the emulation for the leave instruction. The leave instruction is used to pop off a stack frame prior to returning from a function. The emulation for this instruction must move the trap frame for the invalid opcode fault down the stack to the bottom of the stack frame that is being removed, and then execute an iret. At two points in this process, the emulation code was storing values above the current value of the stack pointer. This opened up a window in which if we were two take an interrupt, the trap frame for the interrupt would overwrite the values stored on the stack, causing the system to panic later. The first bug was that at one point the emulation code saves the new value for $esp above the current stack pointer value. The fix is to save this value instead inside of the original trap frame. At this point we do not need the original trap frame so this is safe. The second bug is that when the emulate code loads $esp from the stack, it points part-way through the new trap frame instead of at its beginning. The emulation code adjusts the stack pointer to the correct value immediately afterwards, but this still leaves a one instruction window in which an interrupt would corrupt this trap frame. Fix this by adjusting the stack frame value before loading it into $esp. This fixes panics in invop_leave on i386 when using fbt return probes. Ok'd by: rstone Modified: stable/9/sys/cddl/dev/dtrace/i386/dtrace_asm.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/cddl/dev/dtrace/i386/dtrace_asm.S ============================================================================== --- stable/9/sys/cddl/dev/dtrace/i386/dtrace_asm.S Sat Mar 17 03:31:11 2012 (r233075) +++ stable/9/sys/cddl/dev/dtrace/i386/dtrace_asm.S Sat Mar 17 05:45:21 2012 (r233076) @@ -125,11 +125,11 @@ invop_leave: movl 8(%esp), %eax /* load calling EIP */ incl %eax /* increment over LOCK prefix */ movl %eax, -8(%ebx) /* store calling EIP */ - movl %ebx, -4(%esp) /* temporarily store new %esp */ + subl $8, %ebx /* adjust for three pushes, one pop */ + movl %ebx, 8(%esp) /* temporarily store new %esp */ popl %ebx /* pop off temp */ popl %eax /* pop off temp */ - movl -12(%esp), %esp /* set stack pointer */ - subl $8, %esp /* adjust for three pushes, one pop */ + movl (%esp), %esp /* set stack pointer */ iret /* return from interrupt */ invop_nop: /* From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 06:48:14 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95B841065670; Sat, 17 Mar 2012 06:48:14 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8455B8FC0A; Sat, 17 Mar 2012 06:48:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H6mElg054791; Sat, 17 Mar 2012 06:48:14 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H6mE9V054789; Sat, 17 Mar 2012 06:48:14 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201203170648.q2H6mE9V054789@svn.freebsd.org> From: Mitsuru IWASAKI Date: Sat, 17 Mar 2012 06:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233077 - stable/9/sys/dev/iwi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 06:48:14 -0000 Author: iwasaki Date: Sat Mar 17 06:48:13 2012 New Revision: 233077 URL: http://svn.freebsd.org/changeset/base/233077 Log: MFC r232785 Fix wrong asresp frame parsing in iwi_checkforqos(). Modified: stable/9/sys/dev/iwi/if_iwi.c Modified: stable/9/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/9/sys/dev/iwi/if_iwi.c Sat Mar 17 05:45:21 2012 (r233076) +++ stable/9/sys/dev/iwi/if_iwi.c Sat Mar 17 06:48:13 2012 (r233077) @@ -1357,8 +1357,8 @@ iwi_checkforqos(struct ieee80211vap *vap frm += 2; wme = NULL; - while (frm < efrm) { - IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1], return); + while (efrm - frm > 1) { + IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); switch (*frm) { case IEEE80211_ELEMID_VENDOR: if (iswmeoui(frm)) From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 06:49:54 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41771106566C; Sat, 17 Mar 2012 06:49:54 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 300F38FC15; Sat, 17 Mar 2012 06:49:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H6nsYk054881; Sat, 17 Mar 2012 06:49:54 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H6nr6S054879; Sat, 17 Mar 2012 06:49:53 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201203170649.q2H6nr6S054879@svn.freebsd.org> From: Mitsuru IWASAKI Date: Sat, 17 Mar 2012 06:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233078 - stable/8/sys/dev/iwi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 06:49:54 -0000 Author: iwasaki Date: Sat Mar 17 06:49:53 2012 New Revision: 233078 URL: http://svn.freebsd.org/changeset/base/233078 Log: MFC r232785 Fix wrong asresp frame parsing in iwi_checkforqos(). Modified: stable/8/sys/dev/iwi/if_iwi.c Modified: stable/8/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/8/sys/dev/iwi/if_iwi.c Sat Mar 17 06:48:13 2012 (r233077) +++ stable/8/sys/dev/iwi/if_iwi.c Sat Mar 17 06:49:53 2012 (r233078) @@ -1355,8 +1355,8 @@ iwi_checkforqos(struct ieee80211vap *vap frm += 2; wme = NULL; - while (frm < efrm) { - IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1], return); + while (efrm - frm > 1) { + IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); switch (*frm) { case IEEE80211_ELEMID_VENDOR: if (iswmeoui(frm)) From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 09:10:44 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4998C106566B; Sat, 17 Mar 2012 09:10:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E9898FC0A; Sat, 17 Mar 2012 09:10:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2H9Aig4059437; Sat, 17 Mar 2012 09:10:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2H9Ahc4059435; Sat, 17 Mar 2012 09:10:43 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201203170910.q2H9Ahc4059435@svn.freebsd.org> From: Ed Schouten Date: Sat, 17 Mar 2012 09:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233083 - stable/9/usr.sbin/watch X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 09:10:44 -0000 Author: ed Date: Sat Mar 17 09:10:43 2012 New Revision: 233083 URL: http://svn.freebsd.org/changeset/base/233083 Log: MFC r232780 and r232781: Fix whitespace. Modified: stable/9/usr.sbin/watch/watch.c Directory Properties: stable/9/usr.sbin/watch/ (props changed) Modified: stable/9/usr.sbin/watch/watch.c ============================================================================== --- stable/9/usr.sbin/watch/watch.c Sat Mar 17 07:29:11 2012 (r233082) +++ stable/9/usr.sbin/watch/watch.c Sat Mar 17 09:10:43 2012 (r233083) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #define MSG_CHANGE "Snoop device change by user request." #define MSG_NOWRITE "Snoop device change due to write failure." - #define DEV_NAME_LEN 1024 /* for /dev/ttyXX++ */ #define MIN_SIZE 256 @@ -65,27 +64,26 @@ static void detach_snp(void); static void set_dev(const char *); static void ask_dev(char *, const char *); -int opt_reconn_close = 0; -int opt_reconn_oflow = 0; -int opt_interactive = 1; -int opt_timestamp = 0; +int opt_reconn_close = 0; +int opt_reconn_oflow = 0; +int opt_interactive = 1; +int opt_timestamp = 0; int opt_write = 0; int opt_no_switch = 0; const char *opt_snpdev; -char dev_name[DEV_NAME_LEN]; -int snp_io; -int std_in = 0, std_out = 1; - - -int clear_ok = 0; -struct termios otty; -char tbuf[1024], gbuf[1024]; - +char dev_name[DEV_NAME_LEN]; +int snp_io; +int std_in = 0, std_out = 1; + +int clear_ok = 0; +struct termios otty; +char tbuf[1024], gbuf[1024]; static void clear(void) { + if (clear_ok) tputs(gbuf, 1, putchar); fflush(stdout); @@ -94,8 +92,9 @@ clear(void) static void timestamp(const char *buf) { - time_t t; - char btmp[1024]; + time_t t; + char btmp[1024]; + clear(); printf("\n---------------------------------------------\n"); t = time(NULL); @@ -109,11 +108,11 @@ timestamp(const char *buf) static void set_tty(void) { - struct termios ntty; + struct termios ntty; - tcgetattr (std_in, &otty); + tcgetattr(std_in, &otty); ntty = otty; - ntty.c_lflag &= ~ICANON; /* disable canonical operation */ + ntty.c_lflag &= ~ICANON; /* disable canonical operation */ ntty.c_lflag &= ~ECHO; #ifdef FLUSHO ntty.c_lflag &= ~FLUSHO; @@ -124,24 +123,25 @@ set_tty(void) #ifdef IEXTEN ntty.c_lflag &= ~IEXTEN; #endif - ntty.c_cc[VMIN] = 1; /* minimum of one character */ - ntty.c_cc[VTIME] = 0; /* timeout value */ + ntty.c_cc[VMIN] = 1; /* minimum of one character */ + ntty.c_cc[VTIME] = 0; /* timeout value */ - ntty.c_cc[VINTR] = 07; /* ^G */ - ntty.c_cc[VQUIT] = 07; /* ^G */ - tcsetattr (std_in, TCSANOW, &ntty); + ntty.c_cc[VINTR] = 07; /* ^G */ + ntty.c_cc[VQUIT] = 07; /* ^G */ + tcsetattr(std_in, TCSANOW, &ntty); } static void unset_tty(void) { - tcsetattr (std_in, TCSANOW, &otty); -} + tcsetattr(std_in, TCSANOW, &otty); +} static void fatal(int error, const char *buf) { + unset_tty(); if (buf) errx(error, "fatal: %s", buf); @@ -169,10 +169,10 @@ open_snp(void) return (f); } - static void cleanup(int signo __unused) { + if (opt_timestamp) timestamp("Logging Exited."); close(snp_io); @@ -180,10 +180,10 @@ cleanup(int signo __unused) exit(EX_OK); } - static void usage(void) { + fprintf(stderr, "usage: watch [-ciotnW] [tty name]\n"); exit(EX_USAGE); } @@ -191,7 +191,8 @@ usage(void) static void setup_scr(void) { - char *cbuf = gbuf, *term; + char *cbuf = gbuf, *term; + if (!opt_interactive) return; if ((term = getenv("TERM"))) @@ -226,11 +227,10 @@ attach_snp(void) timestamp("Logging Started."); } - static void set_dev(const char *name) { - char buf[DEV_NAME_LEN]; + char buf[DEV_NAME_LEN]; struct stat sb; if (strlen(name) > 5 && !strncmp(name, _PATH_DEV, sizeof _PATH_DEV - 1)) { @@ -256,8 +256,8 @@ set_dev(const char *name) void ask_dev(char *dbuf, const char *msg) { - char buf[DEV_NAME_LEN]; - int len; + char buf[DEV_NAME_LEN]; + int len; clear(); unset_tty(); @@ -284,10 +284,10 @@ ask_dev(char *dbuf, const char *msg) int main(int ac, char *av[]) { - int ch, res, rv, nread; + int ch, res, rv, nread; size_t b_size = MIN_SIZE; - char *buf, chb[READB_LEN]; - fd_set fd_s; + char *buf, chb[READB_LEN]; + fd_set fd_s; (void) setlocale(LC_TIME, ""); @@ -296,7 +296,6 @@ main(int ac, char *av[]) else opt_interactive = 0; - while ((ch = getopt(ac, av, "Wciotnf:")) != -1) switch (ch) { case 'W': @@ -349,7 +348,7 @@ main(int ac, char *av[]) FD_ZERO(&fd_s); - while (1) { + for (;;) { if (opt_interactive) FD_SET(std_in, &fd_s); FD_SET(snp_io, &fd_s); @@ -382,7 +381,7 @@ main(int ac, char *av[]) detach_snp(); if (opt_no_switch) fatal(EX_IOERR, - "write failed"); + "write failed"); ask_dev(dev_name, MSG_NOWRITE); set_dev(dev_name); } @@ -439,4 +438,3 @@ main(int ac, char *av[]) } /* While */ return(0); } - From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 12:11:54 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12BD4106566B; Sat, 17 Mar 2012 12:11:54 +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 013F98FC0A; Sat, 17 Mar 2012 12:11:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2HCBrx4069222; Sat, 17 Mar 2012 12:11:53 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2HCBrr4069220; Sat, 17 Mar 2012 12:11:53 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201203171211.q2HCBrr4069220@svn.freebsd.org> From: Christian Brueffer Date: Sat, 17 Mar 2012 12:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233084 - in stable/9/sys: i386/conf net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 12:11:54 -0000 Author: brueffer Date: Sat Mar 17 12:11:53 2012 New Revision: 233084 URL: http://svn.freebsd.org/changeset/base/233084 Log: MFC: r232315 Use a more appropriate default for the maximum number of addresses in the bridge forwarding table. Modified: stable/9/sys/net/if_bridge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/net/if_bridge.c ============================================================================== --- stable/9/sys/net/if_bridge.c Sat Mar 17 09:10:43 2012 (r233083) +++ stable/9/sys/net/if_bridge.c Sat Mar 17 12:11:53 2012 (r233084) @@ -144,10 +144,10 @@ __FBSDID("$FreeBSD$"); #define BRIDGE_RTHASH_MASK (BRIDGE_RTHASH_SIZE - 1) /* - * Maximum number of addresses to cache. + * Default maximum number of addresses to cache. */ #ifndef BRIDGE_RTABLE_MAX -#define BRIDGE_RTABLE_MAX 100 +#define BRIDGE_RTABLE_MAX 2000 #endif /* From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 12:15:36 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 913121065676; Sat, 17 Mar 2012 12:15:36 +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 7F87A8FC08; Sat, 17 Mar 2012 12:15:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2HCFaK0069397; Sat, 17 Mar 2012 12:15:36 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2HCFahb069394; Sat, 17 Mar 2012 12:15:36 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201203171215.q2HCFahb069394@svn.freebsd.org> From: Christian Brueffer Date: Sat, 17 Mar 2012 12:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233085 - in stable/8/sys: i386/conf net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 12:15:36 -0000 Author: brueffer Date: Sat Mar 17 12:15:35 2012 New Revision: 233085 URL: http://svn.freebsd.org/changeset/base/233085 Log: MFC: r232315 Use a more appropriate default for the maximum number of addresses in the bridge forwarding table. Modified: stable/8/sys/net/if_bridge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/i386/conf/XENHVM (props changed) Modified: stable/8/sys/net/if_bridge.c ============================================================================== --- stable/8/sys/net/if_bridge.c Sat Mar 17 12:11:53 2012 (r233084) +++ stable/8/sys/net/if_bridge.c Sat Mar 17 12:15:35 2012 (r233085) @@ -144,10 +144,10 @@ __FBSDID("$FreeBSD$"); #define BRIDGE_RTHASH_MASK (BRIDGE_RTHASH_SIZE - 1) /* - * Maximum number of addresses to cache. + * Default maximum number of addresses to cache. */ #ifndef BRIDGE_RTABLE_MAX -#define BRIDGE_RTABLE_MAX 100 +#define BRIDGE_RTABLE_MAX 2000 #endif /* From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 12:24:17 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BDCC4106566C; Sat, 17 Mar 2012 12:24:17 +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 A8C868FC14; Sat, 17 Mar 2012 12:24:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2HCOH6N069742; Sat, 17 Mar 2012 12:24:17 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2HCOH1n069740; Sat, 17 Mar 2012 12:24:17 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201203171224.q2HCOH1n069740@svn.freebsd.org> From: Christian Brueffer Date: Sat, 17 Mar 2012 12:24: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: r233086 - stable/7/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 12:24:17 -0000 Author: brueffer Date: Sat Mar 17 12:24:17 2012 New Revision: 233086 URL: http://svn.freebsd.org/changeset/base/233086 Log: MFC: r232315 Use a more appropriate default for the maximum number of addresses in the bridge forwarding table. Modified: stable/7/sys/net/if_bridge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_bridge.c ============================================================================== --- stable/7/sys/net/if_bridge.c Sat Mar 17 12:15:35 2012 (r233085) +++ stable/7/sys/net/if_bridge.c Sat Mar 17 12:24:17 2012 (r233086) @@ -142,10 +142,10 @@ __FBSDID("$FreeBSD$"); #define BRIDGE_RTHASH_MASK (BRIDGE_RTHASH_SIZE - 1) /* - * Maximum number of addresses to cache. + * Default maximum number of addresses to cache. */ #ifndef BRIDGE_RTABLE_MAX -#define BRIDGE_RTABLE_MAX 100 +#define BRIDGE_RTABLE_MAX 2000 #endif /* From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 12:33:13 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C48711065670; Sat, 17 Mar 2012 12:33:13 +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 ADC8F8FC08; Sat, 17 Mar 2012 12:33:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2HCXDBY070113; Sat, 17 Mar 2012 12:33:13 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2HCXDEL070111; Sat, 17 Mar 2012 12:33:13 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201203171233.q2HCXDEL070111@svn.freebsd.org> From: Christian Brueffer Date: Sat, 17 Mar 2012 12:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233087 - stable/9/sbin/ifconfig X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 12:33:13 -0000 Author: brueffer Date: Sat Mar 17 12:33:12 2012 New Revision: 233087 URL: http://svn.freebsd.org/changeset/base/233087 Log: MFC: r232316 Update bridge(4) default values. Modified: stable/9/sbin/ifconfig/ifconfig.8 Directory Properties: stable/9/sbin/ifconfig/ (props changed) Modified: stable/9/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/9/sbin/ifconfig/ifconfig.8 Sat Mar 17 12:24:17 2012 (r233086) +++ stable/9/sbin/ifconfig/ifconfig.8 Sat Mar 17 12:33:12 2012 (r233087) @@ -2074,7 +2074,7 @@ it is removed from the bridge. .It Cm maxaddr Ar size Set the size of the bridge address cache to .Ar size . -The default is 100 entries. +The default is 2000 entries. .It Cm timeout Ar seconds Set the timeout of address cache entries to .Ar seconds @@ -2082,7 +2082,7 @@ seconds. If .Ar seconds is zero, then address cache entries will not be expired. -The default is 240 seconds. +The default is 1200 seconds. .It Cm addr Display the addresses that have been learned by the bridge. .It Cm static Ar interface-name Ar address From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 12:35:49 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6B63106566C; Sat, 17 Mar 2012 12:35:49 +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 A24028FC12; Sat, 17 Mar 2012 12:35:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2HCZnZQ070308; Sat, 17 Mar 2012 12:35:49 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2HCZnw8070306; Sat, 17 Mar 2012 12:35:49 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201203171235.q2HCZnw8070306@svn.freebsd.org> From: Christian Brueffer Date: Sat, 17 Mar 2012 12:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233088 - stable/8/sbin/ifconfig X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 12:35:49 -0000 Author: brueffer Date: Sat Mar 17 12:35:49 2012 New Revision: 233088 URL: http://svn.freebsd.org/changeset/base/233088 Log: MFC: r232316 Update bridge(4) default values. Modified: stable/8/sbin/ifconfig/ifconfig.8 Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.8 Sat Mar 17 12:33:12 2012 (r233087) +++ stable/8/sbin/ifconfig/ifconfig.8 Sat Mar 17 12:35:49 2012 (r233088) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd December 17, 2011 +.Dd February 29, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2031,7 +2031,7 @@ it is removed from the bridge. .It Cm maxaddr Ar size Set the size of the bridge address cache to .Ar size . -The default is 100 entries. +The default is 2000 entries. .It Cm timeout Ar seconds Set the timeout of address cache entries to .Ar seconds @@ -2039,7 +2039,7 @@ seconds. If .Ar seconds is zero, then address cache entries will not be expired. -The default is 240 seconds. +The default is 1200 seconds. .It Cm addr Display the addresses that have been learned by the bridge. .It Cm static Ar interface-name Ar address From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 12:36:46 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CA7D106566C; Sat, 17 Mar 2012 12:36:46 +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 65E7A8FC12; Sat, 17 Mar 2012 12:36:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2HCakaX070393; Sat, 17 Mar 2012 12:36:46 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2HCajhl070391; Sat, 17 Mar 2012 12:36:45 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201203171236.q2HCajhl070391@svn.freebsd.org> From: Christian Brueffer Date: Sat, 17 Mar 2012 12:36: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: r233089 - stable/7/sbin/ifconfig X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 12:36:46 -0000 Author: brueffer Date: Sat Mar 17 12:36:45 2012 New Revision: 233089 URL: http://svn.freebsd.org/changeset/base/233089 Log: MFC: r232316 Update bridge(4) default values. Modified: stable/7/sbin/ifconfig/ifconfig.8 Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.8 Sat Mar 17 12:35:49 2012 (r233088) +++ stable/7/sbin/ifconfig/ifconfig.8 Sat Mar 17 12:36:45 2012 (r233089) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd December 17, 2011 +.Dd February 29, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -1481,7 +1481,7 @@ it is removed from the bridge. .It Cm maxaddr Ar size Set the size of the bridge address cache to .Ar size . -The default is 100 entries. +The default is 2000 entries. .It Cm timeout Ar seconds Set the timeout of address cache entries to .Ar seconds @@ -1489,7 +1489,7 @@ seconds. If .Ar seconds is zero, then address cache entries will not be expired. -The default is 240 seconds. +The default is 1200 seconds. .It Cm addr Display the addresses that have been learned by the bridge. .It Cm static Ar interface-name Ar address From owner-svn-src-stable@FreeBSD.ORG Sat Mar 17 22:29:05 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBB3C106566C; Sat, 17 Mar 2012 22:29:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D134F8FC19; Sat, 17 Mar 2012 22:29:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2HMT50i089826; Sat, 17 Mar 2012 22:29:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2HMT5Fp089819; Sat, 17 Mar 2012 22:29:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203172229.q2HMT5Fp089819@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Mar 2012 22:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233099 - in stable/9: . gnu/usr.bin/cc/c++ gnu/usr.bin/cc/cc gnu/usr.bin/cc/cpp share/man/man5 share/mk sys/conf tools/build/options usr.bin/clang/clang X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 22:29:06 -0000 Author: dim Date: Sat Mar 17 22:29:05 2012 New Revision: 233099 URL: http://svn.freebsd.org/changeset/base/233099 Log: MFC 232322: Add a WITH_CLANG_IS_CC option for src.conf(5), disabled by default, that installs clang as /usr/bin/cc, /usr/bin/c++ and /usr/bin/cpp. Note this does *not* disable building and installing gcc, which will still be available as /usr/bin/gcc, /usr/bin/g++ and /usr/bin/gcpp. If you want to disable gcc completely, you must use WITHOUT_GCC. MFC 232323: Regenerate src.conf(5) after r232322. MFC 232477: In r232322, I forgot one case where a check for MK_CLANG_IS_CC was needed, in sys/conf/kern.pre.mk. Add it now. MFC 232522: Fix a thinko in r232322, where gcc (and its tools) are not built during the cross-tools stage, if CC=clang and WITH_CLANG_IS_CC is not set. This causes no 'cc' to be installed in the temporary cross-tools tree, making lint fall over later in the build, because it ignores ${CC} and attempts to run 'cc' anyway. To fix this, only skip building gcc during cross-tools, if WITHOUT_GCC is set, or if WITH_CLANG_IS_CC is set. Pointy hat to: dim Added: stable/9/gnu/usr.bin/cc/cpp/gcpp.1 - copied unchanged from r232322, head/gnu/usr.bin/cc/cpp/gcpp.1 stable/9/tools/build/options/WITH_CLANG_IS_CC - copied unchanged from r232322, head/tools/build/options/WITH_CLANG_IS_CC Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/gnu/usr.bin/cc/c++/Makefile stable/9/gnu/usr.bin/cc/cc/Makefile stable/9/gnu/usr.bin/cc/cpp/Makefile stable/9/share/man/man5/src.conf.5 stable/9/share/mk/bsd.own.mk stable/9/share/mk/bsd.sys.mk stable/9/sys/conf/kern.mk stable/9/sys/conf/kern.pre.mk stable/9/sys/conf/kmod.mk stable/9/usr.bin/clang/clang/Makefile Directory Properties: stable/9/share/man/ (props changed) stable/9/share/man/man5/ (props changed) stable/9/share/mk/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/tools/ (props changed) stable/9/tools/build/options/ (props changed) stable/9/usr.bin/ (props changed) stable/9/usr.bin/clang/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Sat Mar 17 22:12:09 2012 (r233098) +++ stable/9/Makefile.inc1 Sat Mar 17 22:29:05 2012 (r233099) @@ -1103,6 +1103,10 @@ _aicasm= sys/modules/aic7xxx/aicasm _share= share/syscons/scrnmaps .endif +.if ${MK_GCC} != "no" && ${MK_CLANG_IS_CC} == "no" +_gcc_tools= gnu/usr.bin/cc/cc_tools +.endif + .if ${MK_KERBEROS} != "no" _kerberos5_tools= kerberos5/tools .endif @@ -1131,7 +1135,7 @@ build-tools: ${MAKE} DIRPRFX=${_tool}/ build-tools .endfor .for _tool in \ - gnu/usr.bin/cc/cc_tools \ + ${_gcc_tools} \ ${_kerberos5_tools} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool}; \ @@ -1161,14 +1165,12 @@ _kgzip= usr.sbin/kgzip _binutils= gnu/usr.bin/binutils .endif -.if ${MK_CLANG} != "no" -.if ${CC:T:Mclang} == "clang" +.if ${MK_CLANG} != "no" && (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") _clang= usr.bin/clang _clang_libs= lib/clang .endif -.endif -.if ${MK_GCC} != "no" +.if ${MK_GCC} != "no" && ${MK_CLANG_IS_CC} == "no" _cc= gnu/usr.bin/cc .endif Modified: stable/9/gnu/usr.bin/cc/c++/Makefile ============================================================================== --- stable/9/gnu/usr.bin/cc/c++/Makefile Sat Mar 17 22:12:09 2012 (r233098) +++ stable/9/gnu/usr.bin/cc/c++/Makefile Sat Mar 17 22:29:05 2012 (r233099) @@ -1,14 +1,18 @@ # $FreeBSD$ +.include + .include "../Makefile.inc" .include "../Makefile.fe" .PATH: ${GCCDIR}/cp -PROG= c++ +PROG= g++ SRCS+= g++spec.c -LINKS= ${BINDIR}/c++ ${BINDIR}/g++ -LINKS+= ${BINDIR}/c++ ${BINDIR}/CC +.if ${MK_CLANG_IS_CC} == "no" +LINKS= ${BINDIR}/g++ ${BINDIR}/c++ +LINKS+= ${BINDIR}/g++ ${BINDIR}/CC +.endif NO_MAN= DPADD= ${LIBCPP} ${LIBIBERTY} Modified: stable/9/gnu/usr.bin/cc/cc/Makefile ============================================================================== --- stable/9/gnu/usr.bin/cc/cc/Makefile Sat Mar 17 22:12:09 2012 (r233098) +++ stable/9/gnu/usr.bin/cc/cc/Makefile Sat Mar 17 22:29:05 2012 (r233099) @@ -1,15 +1,20 @@ # $FreeBSD$ +.include + .include "../Makefile.inc" .include "../Makefile.fe" -PROG= cc +PROG= gcc MAN= gcc.1 SRCS+= gccspec.c NO_SHARED?=yes -LINKS= ${BINDIR}/cc ${BINDIR}/gcc -MLINKS= gcc.1 cc.1 gcc.1 c++.1 gcc.1 g++.1 gcc.1 CC.1 +MLINKS= gcc.1 g++.1 +.if ${MK_CLANG_IS_CC} == "no" +LINKS= ${BINDIR}/gcc ${BINDIR}/cc +MLINKS+= gcc.1 cc.1 gcc.1 c++.1 gcc.1 CC.1 +.endif .include Modified: stable/9/gnu/usr.bin/cc/cpp/Makefile ============================================================================== --- stable/9/gnu/usr.bin/cc/cpp/Makefile Sat Mar 17 22:12:09 2012 (r233098) +++ stable/9/gnu/usr.bin/cc/cpp/Makefile Sat Mar 17 22:29:05 2012 (r233099) @@ -1,10 +1,16 @@ # $FreeBSD$ +.include .include "../Makefile.inc" .include "../Makefile.fe" -PROG= cpp +PROG= gcpp SRCS+= cppspec.c +.if ${MK_CLANG_IS_CC} == "no" +LINKS= ${BINDIR}/gcpp ${BINDIR}/cpp +MLINKS= gcpp.1 cpp.1 +.endif + .include Copied: stable/9/gnu/usr.bin/cc/cpp/gcpp.1 (from r232322, head/gnu/usr.bin/cc/cpp/gcpp.1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/gnu/usr.bin/cc/cpp/gcpp.1 Sat Mar 17 22:29:05 2012 (r233099, copy of r232322, head/gnu/usr.bin/cc/cpp/gcpp.1) @@ -0,0 +1,929 @@ +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to +.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' +.\" expand to `' in nroff, nothing in troff, for use with C<>. +.tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "CPP 1" +.TH CPP 1 "2007-07-19" "gcc-4.2.1" "GNU" +.SH "NAME" +cpp \- The C Preprocessor +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +cpp [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR] + [\fB\-I\fR\fIdir\fR...] [\fB\-iquote\fR\fIdir\fR...] + [\fB\-W\fR\fIwarn\fR...] + [\fB\-M\fR|\fB\-MM\fR] [\fB\-MG\fR] [\fB\-MF\fR \fIfilename\fR] + [\fB\-MP\fR] [\fB\-MQ\fR \fItarget\fR...] + [\fB\-MT\fR \fItarget\fR...] + [\fB\-P\fR] [\fB\-fno\-working\-directory\fR] + [\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR] + \fIinfile\fR \fIoutfile\fR +.PP +Only the most useful options are listed here; see below for the remainder. +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The C preprocessor, often known as \fIcpp\fR, is a \fImacro processor\fR +that is used automatically by the C compiler to transform your program +before compilation. It is called a macro processor because it allows +you to define \fImacros\fR, which are brief abbreviations for longer +constructs. +.PP +The C preprocessor is intended to be used only with C and \*(C+ source +code. In the past, it has been abused as a general text processor. It +will choke on input which does not obey C's lexical rules. For +example, apostrophes will be interpreted as the beginning of character +constants, and cause errors. Also, you cannot rely on it preserving +characteristics of the input which are not significant to C\-family +languages. If a Makefile is preprocessed, all the hard tabs will be +removed, and the Makefile will not work. +.PP +Having said that, you can often get away with using cpp on things which +are not C. Other Algol-ish programming languages are often safe +(Pascal, Ada, etc.) So is assembly, with caution. \fB\-traditional\-cpp\fR +mode preserves more white space, and is otherwise more permissive. Many +of the problems can be avoided by writing C or \*(C+ style comments +instead of native language comments, and keeping macros simple. +.PP +Wherever possible, you should use a preprocessor geared to the language +you are writing in. Modern versions of the \s-1GNU\s0 assembler have macro +facilities. Most high level programming languages have their own +conditional compilation and inclusion mechanism. If all else fails, +try a true general text processor, such as \s-1GNU\s0 M4. +.PP +C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C +preprocessor, which provides a small superset of the features of \s-1ISO\s0 +Standard C. In its default mode, the \s-1GNU\s0 C preprocessor does not do a +few things required by the standard. These are features which are +rarely, if ever, used, and may cause surprising changes to the meaning +of a program which does not expect them. To get strict \s-1ISO\s0 Standard C, +you should use the \fB\-std=c89\fR or \fB\-std=c99\fR options, depending +on which version of the standard you want. To get all the mandatory +diagnostics, you must also use \fB\-pedantic\fR. +.PP +This manual describes the behavior of the \s-1ISO\s0 preprocessor. To +minimize gratuitous differences, where the \s-1ISO\s0 preprocessor's +behavior does not conflict with traditional semantics, the +traditional preprocessor should behave the same way. The various +differences that do exist are detailed in the section \fBTraditional +Mode\fR. +.PP +For clarity, unless noted otherwise, references to \fB\s-1CPP\s0\fR in this +manual refer to \s-1GNU\s0 \s-1CPP\s0. +.SH "OPTIONS" +.IX Header "OPTIONS" +The C preprocessor expects two file names as arguments, \fIinfile\fR and +\&\fIoutfile\fR. The preprocessor reads \fIinfile\fR together with any +other files it specifies with \fB#include\fR. All the output generated +by the combined input files is written in \fIoutfile\fR. +.PP +Either \fIinfile\fR or \fIoutfile\fR may be \fB\-\fR, which as +\&\fIinfile\fR means to read from standard input and as \fIoutfile\fR +means to write to standard output. Also, if either file is omitted, it +means the same as if \fB\-\fR had been specified for that file. +.PP +Unless otherwise noted, or the option ends in \fB=\fR, all options +which take an argument may have that argument appear either immediately +after the option, or with a space between option and argument: +\&\fB\-Ifoo\fR and \fB\-I foo\fR have the same effect. +.PP +Many options have multi-letter names; therefore multiple single-letter +options may \fInot\fR be grouped: \fB\-dM\fR is very different from +\&\fB\-d\ \-M\fR. +.IP "\fB\-D\fR \fIname\fR" 4 +.IX Item "-D name" +Predefine \fIname\fR as a macro, with definition \f(CW1\fR. +.IP "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4 +.IX Item "-D name=definition" +The contents of \fIdefinition\fR are tokenized and processed as if +they appeared during translation phase three in a \fB#define\fR +directive. In particular, the definition will be truncated by +embedded newline characters. +.Sp +If you are invoking the preprocessor from a shell or shell-like +program you may need to use the shell's quoting syntax to protect +characters such as spaces that have a meaning in the shell syntax. +.Sp +If you wish to define a function-like macro on the command line, write +its argument list with surrounding parentheses before the equals sign +(if any). Parentheses are meaningful to most shells, so you will need +to quote the option. With \fBsh\fR and \fBcsh\fR, +\&\fB\-D'\fR\fIname\fR\fB(\fR\fIargs...\fR\fB)=\fR\fIdefinition\fR\fB'\fR works. +.Sp +\&\fB\-D\fR and \fB\-U\fR options are processed in the order they +are given on the command line. All \fB\-imacros\fR \fIfile\fR and +\&\fB\-include\fR \fIfile\fR options are processed after all +\&\fB\-D\fR and \fB\-U\fR options. +.IP "\fB\-U\fR \fIname\fR" 4 +.IX Item "-U name" +Cancel any previous definition of \fIname\fR, either built in or +provided with a \fB\-D\fR option. +.IP "\fB\-undef\fR" 4 +.IX Item "-undef" +Do not predefine any system-specific or GCC-specific macros. The +standard predefined macros remain defined. +.IP "\fB\-I\fR \fIdir\fR" 4 +.IX Item "-I dir" +Add the directory \fIdir\fR to the list of directories to be searched +for header files. +.Sp +Directories named by \fB\-I\fR are searched before the standard +system include directories. If the directory \fIdir\fR is a standard +system include directory, the option is ignored to ensure that the +default search order for system directories and the special treatment +of system headers are not defeated +\&. +.IP "\fB\-o\fR \fIfile\fR" 4 +.IX Item "-o file" +Write output to \fIfile\fR. This is the same as specifying \fIfile\fR +as the second non-option argument to \fBcpp\fR. \fBgcc\fR has a +different interpretation of a second non-option argument, so you must +use \fB\-o\fR to specify the output file. +.IP "\fB\-Wall\fR" 4 +.IX Item "-Wall" +Turns on all optional warnings which are desirable for normal code. +At present this is \fB\-Wcomment\fR, \fB\-Wtrigraphs\fR, +\&\fB\-Wmultichar\fR and a warning about integer promotion causing a +change of sign in \f(CW\*(C`#if\*(C'\fR expressions. Note that many of the +preprocessor's warnings are on by default and have no options to +control them. +.IP "\fB\-Wcomment\fR" 4 +.IX Item "-Wcomment" +.PD 0 +.IP "\fB\-Wcomments\fR" 4 +.IX Item "-Wcomments" +.PD +Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR +comment, or whenever a backslash-newline appears in a \fB//\fR comment. +(Both forms have the same effect.) +.IP "\fB\-Wtrigraphs\fR" 4 +.IX Item "-Wtrigraphs" +Most trigraphs in comments cannot affect the meaning of the program. +However, a trigraph that would form an escaped newline (\fB??/\fR at +the end of a line) can, by changing where the comment begins or ends. +Therefore, only trigraphs that would form escaped newlines produce +warnings inside a comment. +.Sp +This option is implied by \fB\-Wall\fR. If \fB\-Wall\fR is not +given, this option is still enabled unless trigraphs are enabled. To +get trigraph conversion without warnings, but get the other +\&\fB\-Wall\fR warnings, use \fB\-trigraphs \-Wall \-Wno\-trigraphs\fR. +.IP "\fB\-Wtraditional\fR" 4 +.IX Item "-Wtraditional" +Warn about certain constructs that behave differently in traditional and +\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C +equivalent, and problematic constructs which should be avoided. +.IP "\fB\-Wimport\fR" 4 +.IX Item "-Wimport" +Warn the first time \fB#import\fR is used. +.IP "\fB\-Wundef\fR" 4 +.IX Item "-Wundef" +Warn whenever an identifier which is not a macro is encountered in an +\&\fB#if\fR directive, outside of \fBdefined\fR. Such identifiers are +replaced with zero. +.IP "\fB\-Wunused\-macros\fR" 4 +.IX Item "-Wunused-macros" +Warn about macros defined in the main file that are unused. A macro +is \fIused\fR if it is expanded or tested for existence at least once. +The preprocessor will also warn if the macro has not been used at the +time it is redefined or undefined. +.Sp +Built-in macros, macros defined on the command line, and macros +defined in include files are not warned about. +.Sp +\&\fINote:\fR If a macro is actually used, but only used in skipped +conditional blocks, then \s-1CPP\s0 will report it as unused. To avoid the +warning in such a case, you might improve the scope of the macro's +definition by, for example, moving it into the first skipped block. +Alternatively, you could provide a dummy use with something like: +.Sp +.Vb 2 +\& #if defined the_macro_causing_the_warning +\& #endif +.Ve +.IP "\fB\-Wendif\-labels\fR" 4 +.IX Item "-Wendif-labels" +Warn whenever an \fB#else\fR or an \fB#endif\fR are followed by text. +This usually happens in code of the form +.Sp +.Vb 5 +\& #if FOO +\& ... +\& #else FOO +\& ... +\& #endif FOO +.Ve +.Sp +The second and third \f(CW\*(C`FOO\*(C'\fR should be in comments, but often are not +in older programs. This warning is on by default. +.IP "\fB\-Werror\fR" 4 +.IX Item "-Werror" +Make all warnings into hard errors. Source code which triggers warnings +will be rejected. +.IP "\fB\-Wsystem\-headers\fR" 4 +.IX Item "-Wsystem-headers" +Issue warnings for code in system headers. These are normally unhelpful +in finding bugs in your own code, therefore suppressed. If you are +responsible for the system library, you may want to see them. +.IP "\fB\-w\fR" 4 +.IX Item "-w" +Suppress all warnings, including those which \s-1GNU\s0 \s-1CPP\s0 issues by default. +.IP "\fB\-pedantic\fR" 4 +.IX Item "-pedantic" +Issue all the mandatory diagnostics listed in the C standard. Some of +them are left out by default, since they trigger frequently on harmless +code. +.IP "\fB\-pedantic\-errors\fR" 4 +.IX Item "-pedantic-errors" +Issue all the mandatory diagnostics, and make all mandatory diagnostics +into errors. This includes mandatory diagnostics that \s-1GCC\s0 issues +without \fB\-pedantic\fR but treats as warnings. +.IP "\fB\-M\fR" 4 +.IX Item "-M" +Instead of outputting the result of preprocessing, output a rule +suitable for \fBmake\fR describing the dependencies of the main +source file. The preprocessor outputs one \fBmake\fR rule containing +the object file name for that source file, a colon, and the names of all +the included files, including those coming from \fB\-include\fR or +\&\fB\-imacros\fR command line options. +.Sp +Unless specified explicitly (with \fB\-MT\fR or \fB\-MQ\fR), the +object file name consists of the basename of the source file with any +suffix replaced with object file suffix. If there are many included +files then the rule is split into several lines using \fB\e\fR\-newline. +The rule has no commands. +.Sp +This option does not suppress the preprocessor's debug output, such as +\&\fB\-dM\fR. To avoid mixing such debug output with the dependency +rules you should explicitly specify the dependency output file with +\&\fB\-MF\fR, or use an environment variable like +\&\fB\s-1DEPENDENCIES_OUTPUT\s0\fR. Debug output +will still be sent to the regular output stream as normal. +.Sp +Passing \fB\-M\fR to the driver implies \fB\-E\fR, and suppresses +warnings with an implicit \fB\-w\fR. +.IP "\fB\-MM\fR" 4 +.IX Item "-MM" +Like \fB\-M\fR but do not mention header files that are found in +system header directories, nor header files that are included, +directly or indirectly, from such a header. +.Sp +This implies that the choice of angle brackets or double quotes in an +\&\fB#include\fR directive does not in itself determine whether that +header will appear in \fB\-MM\fR dependency output. This is a +slight change in semantics from \s-1GCC\s0 versions 3.0 and earlier. +.IP "\fB\-MF\fR \fIfile\fR" 4 +.IX Item "-MF file" +When used with \fB\-M\fR or \fB\-MM\fR, specifies a +file to write the dependencies to. If no \fB\-MF\fR switch is given +the preprocessor sends the rules to the same place it would have sent +preprocessed output. +.Sp +When used with the driver options \fB\-MD\fR or \fB\-MMD\fR, +\&\fB\-MF\fR overrides the default dependency output file. +.IP "\fB\-MG\fR" 4 +.IX Item "-MG" +In conjunction with an option such as \fB\-M\fR requesting +dependency generation, \fB\-MG\fR assumes missing header files are +generated files and adds them to the dependency list without raising +an error. The dependency filename is taken directly from the +\&\f(CW\*(C`#include\*(C'\fR directive without prepending any path. \fB\-MG\fR +also suppresses preprocessed output, as a missing header file renders +this useless. +.Sp +This feature is used in automatic updating of makefiles. +.IP "\fB\-MP\fR" 4 +.IX Item "-MP" +This option instructs \s-1CPP\s0 to add a phony target for each dependency +other than the main file, causing each to depend on nothing. These +dummy rules work around errors \fBmake\fR gives if you remove header +files without updating the \fIMakefile\fR to match. +.Sp +This is typical output: +.Sp +.Vb 1 +\& test.o: test.c test.h +.Ve +.Sp +.Vb 1 +\& test.h: +.Ve +.IP "\fB\-MT\fR \fItarget\fR" 4 +.IX Item "-MT target" +Change the target of the rule emitted by dependency generation. By +default \s-1CPP\s0 takes the name of the main input file, including any path, +deletes any file suffix such as \fB.c\fR, and appends the platform's +usual object suffix. The result is the target. +.Sp +An \fB\-MT\fR option will set the target to be exactly the string you +specify. If you want multiple targets, you can specify them as a single +argument to \fB\-MT\fR, or use multiple \fB\-MT\fR options. +.Sp +For example, \fB\-MT\ '$(objpfx)foo.o'\fR might give +.Sp +.Vb 1 +\& $(objpfx)foo.o: foo.c +.Ve +.IP "\fB\-MQ\fR \fItarget\fR" 4 +.IX Item "-MQ target" +Same as \fB\-MT\fR, but it quotes any characters which are special to +Make. \fB\-MQ\ '$(objpfx)foo.o'\fR gives +.Sp +.Vb 1 +\& $$(objpfx)foo.o: foo.c +.Ve +.Sp +The default target is automatically quoted, as if it were given with +\&\fB\-MQ\fR. +.IP "\fB\-MD\fR" 4 +.IX Item "-MD" +\&\fB\-MD\fR is equivalent to \fB\-M \-MF\fR \fIfile\fR, except that +\&\fB\-E\fR is not implied. The driver determines \fIfile\fR based on +whether an \fB\-o\fR option is given. If it is, the driver uses its +argument but with a suffix of \fI.d\fR, otherwise it take the +basename of the input file and applies a \fI.d\fR suffix. +.Sp +If \fB\-MD\fR is used in conjunction with \fB\-E\fR, any +\&\fB\-o\fR switch is understood to specify the dependency output file, but if used without \fB\-E\fR, each \fB\-o\fR +is understood to specify a target object file. +.Sp +Since \fB\-E\fR is not implied, \fB\-MD\fR can be used to generate +a dependency output file as a side-effect of the compilation process. +.IP "\fB\-MMD\fR" 4 +.IX Item "-MMD" +Like \fB\-MD\fR except mention only user header files, not system +header files. +.IP "\fB\-x c\fR" 4 +.IX Item "-x c" +.PD 0 +.IP "\fB\-x c++\fR" 4 +.IX Item "-x c++" +.IP "\fB\-x assembler-with-cpp\fR" 4 +.IX Item "-x assembler-with-cpp" +.PD +Specify the source language: C, \*(C+, or assembly. This has nothing +to do with standards conformance or extensions; it merely selects which +base syntax to expect. If you give none of these options, cpp will +deduce the language from the extension of the source file: \&\fB.c\fR, +\fB.cc\fR, or \fB.S\fR. Some other common extensions for \*(C+ and +assembly are also recognized. If cpp does not recognize the extension, +it will treat the file as C; this is the most generic mode. +.Sp +\&\fINote:\fR Previous versions of cpp accepted a \fB\-lang\fR option +which selected both the language and the standards conformance level. +This option has been removed, because it conflicts with the \fB\-l\fR +option. +.IP "\fB\-std=\fR\fIstandard\fR" 4 +.IX Item "-std=standard" +.PD 0 +.IP "\fB\-ansi\fR" 4 +.IX Item "-ansi" +.PD +Specify the standard to which the code should conform. Currently \s-1CPP\s0 +knows about C and \*(C+ standards; others may be added in the future. +.Sp +\&\fIstandard\fR +may be one of: +.RS 4 +.ie n .IP """iso9899:1990""" 4 +.el .IP "\f(CWiso9899:1990\fR" 4 +.IX Item "iso9899:1990" +.PD 0 +.ie n .IP """c89""" 4 +.el .IP "\f(CWc89\fR" 4 +.IX Item "c89" +.PD +The \s-1ISO\s0 C standard from 1990. \fBc89\fR is the customary shorthand for +this version of the standard. +.Sp +The \fB\-ansi\fR option is equivalent to \fB\-std=c89\fR. +.ie n .IP """iso9899:199409""" 4 +.el .IP "\f(CWiso9899:199409\fR" 4 +.IX Item "iso9899:199409" +The 1990 C standard, as amended in 1994. +.ie n .IP """iso9899:1999""" 4 +.el .IP "\f(CWiso9899:1999\fR" 4 +.IX Item "iso9899:1999" +.PD 0 +.ie n .IP """c99""" 4 +.el .IP "\f(CWc99\fR" 4 +.IX Item "c99" +.ie n .IP """iso9899:199x""" 4 +.el .IP "\f(CWiso9899:199x\fR" 4 +.IX Item "iso9899:199x" +.ie n .IP """c9x""" 4 +.el .IP "\f(CWc9x\fR" 4 +.IX Item "c9x" +.PD +The revised \s-1ISO\s0 C standard, published in December 1999. Before +publication, this was known as C9X. +.ie n .IP """gnu89""" 4 +.el .IP "\f(CWgnu89\fR" 4 +.IX Item "gnu89" +The 1990 C standard plus \s-1GNU\s0 extensions. This is the default. +.ie n .IP """gnu99""" 4 +.el .IP "\f(CWgnu99\fR" 4 +.IX Item "gnu99" +.PD 0 +.ie n .IP """gnu9x""" 4 +.el .IP "\f(CWgnu9x\fR" 4 +.IX Item "gnu9x" +.PD +The 1999 C standard plus \s-1GNU\s0 extensions. +.ie n .IP """c++98""" 4 +.el .IP "\f(CWc++98\fR" 4 +.IX Item "c++98" +The 1998 \s-1ISO\s0 \*(C+ standard plus amendments. +.ie n .IP """gnu++98""" 4 +.el .IP "\f(CWgnu++98\fR" 4 +.IX Item "gnu++98" +The same as \fB\-std=c++98\fR plus \s-1GNU\s0 extensions. This is the +default for \*(C+ code. +.RE +.RS 4 +.RE +.IP "\fB\-I\-\fR" 4 +.IX Item "-I-" +Split the include path. Any directories specified with \fB\-I\fR +options before \fB\-I\-\fR are searched only for headers requested with +\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for +\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR. If additional directories are +specified with \fB\-I\fR options after the \fB\-I\-\fR, those +directories are searched for all \fB#include\fR directives. +.Sp +In addition, \fB\-I\-\fR inhibits the use of the directory of the current +file directory as the first search directory for \f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR. +.Sp +This option has been deprecated. +.IP "\fB\-nostdinc\fR" 4 +.IX Item "-nostdinc" +Do not search the standard system directories for header files. +Only the directories you have specified with \fB\-I\fR options +(and the directory of the current file, if appropriate) are searched. +.IP "\fB\-nostdinc++\fR" 4 +.IX Item "-nostdinc++" +Do not search for header files in the \*(C+\-specific standard directories, +but do still search the other standard directories. (This option is +used when building the \*(C+ library.) +.IP "\fB\-include\fR \fIfile\fR" 4 +.IX Item "-include file" +Process \fIfile\fR as if \f(CW\*(C`#include "file"\*(C'\fR appeared as the first +line of the primary source file. However, the first directory searched +for \fIfile\fR is the preprocessor's working directory \fIinstead of\fR +the directory containing the main source file. If not found there, it +is searched for in the remainder of the \f(CW\*(C`#include "..."\*(C'\fR search +chain as normal. +.Sp +If multiple \fB\-include\fR options are given, the files are included +in the order they appear on the command line. +.IP "\fB\-imacros\fR \fIfile\fR" 4 +.IX Item "-imacros file" +Exactly like \fB\-include\fR, except that any output produced by +scanning \fIfile\fR is thrown away. Macros it defines remain defined. +This allows you to acquire all the macros from a header without also +processing its declarations. +.Sp +All files specified by \fB\-imacros\fR are processed before all files +specified by \fB\-include\fR. +.IP "\fB\-idirafter\fR \fIdir\fR" 4 +.IX Item "-idirafter dir" +Search \fIdir\fR for header files, but do it \fIafter\fR all +directories specified with \fB\-I\fR and the standard system directories +have been exhausted. \fIdir\fR is treated as a system include directory. +.IP "\fB\-iprefix\fR \fIprefix\fR" 4 +.IX Item "-iprefix prefix" +Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR +options. If the prefix represents a directory, you should include the +final \fB/\fR. +.IP "\fB\-iwithprefix\fR \fIdir\fR" 4 +.IX Item "-iwithprefix dir" +.PD 0 +.IP "\fB\-iwithprefixbefore\fR \fIdir\fR" 4 +.IX Item "-iwithprefixbefore dir" +.PD +Append \fIdir\fR to the prefix specified previously with +\&\fB\-iprefix\fR, and add the resulting directory to the include search +path. \fB\-iwithprefixbefore\fR puts it in the same place \fB\-I\fR +would; \fB\-iwithprefix\fR puts it where \fB\-idirafter\fR would. +.IP "\fB\-isysroot\fR \fIdir\fR" 4 +.IX Item "-isysroot dir" +This option is like the \fB\-\-sysroot\fR option, but applies only to +header files. See the \fB\-\-sysroot\fR option for more information. +.IP "\fB\-imultilib\fR \fIdir\fR" 4 +.IX Item "-imultilib dir" +Use \fIdir\fR as a subdirectory of the directory containing +target-specific \*(C+ headers. +.IP "\fB\-isystem\fR \fIdir\fR" 4 +.IX Item "-isystem dir" +Search \fIdir\fR for header files, after all directories specified by +\&\fB\-I\fR but before the standard system directories. Mark it +as a system directory, so that it gets the same special treatment as +is applied to the standard system directories. +.IP "\fB\-iquote\fR \fIdir\fR" 4 +.IX Item "-iquote dir" +Search \fIdir\fR only for header files requested with +\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for +\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR, before all directories specified by +\&\fB\-I\fR and before the standard system directories. +.IP "\fB\-fdollars\-in\-identifiers\fR" 4 +.IX Item "-fdollars-in-identifiers" +Accept \fB$\fR in identifiers. +.IP "\fB\-fextended\-identifiers\fR" 4 +.IX Item "-fextended-identifiers" +Accept universal character names in identifiers. This option is +experimental; in a future version of \s-1GCC\s0, it will be enabled by +default for C99 and \*(C+. +.IP "\fB\-fpreprocessed\fR" 4 +.IX Item "-fpreprocessed" +Indicate to the preprocessor that the input file has already been +preprocessed. This suppresses things like macro expansion, trigraph +conversion, escaped newline splicing, and processing of most directives. +The preprocessor still recognizes and removes comments, so that you can +pass a file preprocessed with \fB\-C\fR to the compiler without +problems. In this mode the integrated preprocessor is little more than +a tokenizer for the front ends. +.Sp +\&\fB\-fpreprocessed\fR is implicit if the input file has one of the +extensions \fB.i\fR, \fB.ii\fR or \fB.mi\fR. These are the +extensions that \s-1GCC\s0 uses for preprocessed files created by +\&\fB\-save\-temps\fR. +.IP "\fB\-ftabstop=\fR\fIwidth\fR" 4 +.IX Item "-ftabstop=width" +Set the distance between tab stops. This helps the preprocessor report +correct column numbers in warnings or errors, even if tabs appear on the +line. If the value is less than 1 or greater than 100, the option is +ignored. The default is 8. +.IP "\fB\-fexec\-charset=\fR\fIcharset\fR" 4 +.IX Item "-fexec-charset=charset" +Set the execution character set, used for string and character +constants. The default is \s-1UTF\-8\s0. \fIcharset\fR can be any encoding +supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine. +.IP "\fB\-fwide\-exec\-charset=\fR\fIcharset\fR" 4 +.IX Item "-fwide-exec-charset=charset" +Set the wide execution character set, used for wide string and +character constants. The default is \s-1UTF\-32\s0 or \s-1UTF\-16\s0, whichever +corresponds to the width of \f(CW\*(C`wchar_t\*(C'\fR. As with +\&\fB\-fexec\-charset\fR, \fIcharset\fR can be any encoding supported +by the system's \f(CW\*(C`iconv\*(C'\fR library routine; however, you will have +problems with encodings that do not fit exactly in \f(CW\*(C`wchar_t\*(C'\fR. +.IP "\fB\-finput\-charset=\fR\fIcharset\fR" 4 +.IX Item "-finput-charset=charset" +Set the input character set, used for translation from the character +set of the input file to the source character set used by \s-1GCC\s0. If the +locale does not specify, or \s-1GCC\s0 cannot get this information from the +locale, the default is \s-1UTF\-8\s0. This can be overridden by either the locale +or this command line option. Currently the command line option takes +precedence if there's a conflict. \fIcharset\fR can be any encoding +supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine. +.IP "\fB\-fworking\-directory\fR" 4 +.IX Item "-fworking-directory" +Enable generation of linemarkers in the preprocessor output that will +let the compiler know the current working directory at the time of +preprocessing. When this option is enabled, the preprocessor will +emit, after the initial linemarker, a second linemarker with the +current working directory followed by two slashes. \s-1GCC\s0 will use this +directory, when it's present in the preprocessed input, as the +directory emitted as the current working directory in some debugging +information formats. This option is implicitly enabled if debugging +information is enabled, but this can be inhibited with the negated +form \fB\-fno\-working\-directory\fR. If the \fB\-P\fR flag is +present in the command line, this option has no effect, since no +\&\f(CW\*(C`#line\*(C'\fR directives are emitted whatsoever. +.IP "\fB\-fno\-show\-column\fR" 4 +.IX Item "-fno-show-column" +Do not print column numbers in diagnostics. This may be necessary if +diagnostics are being scanned by a program that does not understand the +column numbers, such as \fBdejagnu\fR. +.IP "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4 +.IX Item "-A predicate=answer" +Make an assertion with the predicate \fIpredicate\fR and answer +\&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR +\&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because +it does not use shell special characters. +.IP "\fB\-A \-\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4 +.IX Item "-A -predicate=answer" +Cancel an assertion with the predicate \fIpredicate\fR and answer +\&\fIanswer\fR. +.IP "\fB\-dCHARS\fR" 4 +.IX Item "-dCHARS" +\&\fI\s-1CHARS\s0\fR is a sequence of one or more of the following characters, +and must not be preceded by a space. Other characters are interpreted +by the compiler proper, or reserved for future versions of \s-1GCC\s0, and so +are silently ignored. If you specify characters whose behavior +conflicts, the result is undefined. +.RS 4 +.IP "\fBM\fR" 4 +.IX Item "M" +Instead of the normal output, generate a list of \fB#define\fR +directives for all the macros defined during the execution of the +preprocessor, including predefined macros. This gives you a way of +finding out what is predefined in your version of the preprocessor. +Assuming you have no file \fIfoo.h\fR, the command +.Sp +.Vb 1 +\& touch foo.h; cpp -dM foo.h +.Ve +.Sp +will show all the predefined macros. +.IP "\fBD\fR" 4 +.IX Item "D" +Like \fBM\fR except in two respects: it does \fInot\fR include the +predefined macros, and it outputs \fIboth\fR the \fB#define\fR +directives and the result of preprocessing. Both kinds of output go to +the standard output file. +.IP "\fBN\fR" 4 +.IX Item "N" +Like \fBD\fR, but emit only the macro names, not their expansions. +.IP "\fBI\fR" 4 +.IX Item "I" +Output \fB#include\fR directives in addition to the result of +preprocessing. +.RE +.RS 4 +.RE +.IP "\fB\-P\fR" 4 +.IX Item "-P" +Inhibit generation of linemarkers in the output from the preprocessor. +This might be useful when running the preprocessor on something that is +not C code, and will be sent to a program which might be confused by the +linemarkers. +.IP "\fB\-C\fR" 4 +.IX Item "-C" +Do not discard comments. All comments are passed through to the output +file, except for comments in processed directives, which are deleted +along with the directive. +.Sp +You should be prepared for side effects when using \fB\-C\fR; it +causes the preprocessor to treat comments as tokens in their own right. +For example, comments appearing at the start of what would be a +directive line have the effect of turning that line into an ordinary +source line, since the first token on the line is no longer a \fB#\fR. +.IP "\fB\-CC\fR" 4 +.IX Item "-CC" +Do not discard comments, including during macro expansion. This is +like \fB\-C\fR, except that comments contained within macros are +also passed through to the output file where the macro is expanded. +.Sp +In addition to the side-effects of the \fB\-C\fR option, the +\&\fB\-CC\fR option causes all \*(C+\-style comments inside a macro +to be converted to C\-style comments. This is to prevent later use +of that macro from inadvertently commenting out the remainder of +the source line. +.Sp +The \fB\-CC\fR option is generally used to support lint comments. +.IP "\fB\-traditional\-cpp\fR" 4 +.IX Item "-traditional-cpp" +Try to imitate the behavior of old-fashioned C preprocessors, as +opposed to \s-1ISO\s0 C preprocessors. +.IP "\fB\-trigraphs\fR" 4 +.IX Item "-trigraphs" +Process trigraph sequences. +.IP "\fB\-remap\fR" 4 +.IX Item "-remap" +Enable special code to work around file systems which only permit very +short file names, such as \s-1MS\-DOS\s0. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +.PD 0 +.IP "\fB\-\-target\-help\fR" 4 +.IX Item "--target-help" +.PD +Print text describing all the command line options instead of +preprocessing anything. +.IP "\fB\-v\fR" 4 +.IX Item "-v" +Verbose mode. Print out \s-1GNU\s0 \s-1CPP\s0's version number at the beginning of +execution, and report the final form of the include path. +.IP "\fB\-H\fR" 4 +.IX Item "-H" +Print the name of each header file used, in addition to other normal +activities. Each name is indented to show how deep in the +\&\fB#include\fR stack it is. Precompiled header files are also +printed, even if they are found to be invalid; an invalid precompiled +header file is printed with \fB...x\fR and a valid one with \fB...!\fR . +.IP "\fB\-version\fR" 4 +.IX Item "-version" +.PD 0 +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +.PD +Print out \s-1GNU\s0 \s-1CPP\s0's version number. With one dash, proceed to +preprocess as normal. With two dashes, exit immediately. +.SH "ENVIRONMENT" +.IX Header "ENVIRONMENT" +This section describes the environment variables that affect how \s-1CPP\s0 +operates. You can use them to specify directories or prefixes to use +when searching for include files, or to control dependency output. +.PP +Note that you can also specify places to search using options such as +\&\fB\-I\fR, and control dependency output with options like +\&\fB\-M\fR. These take precedence over +environment variables, which in turn take precedence over the +configuration of \s-1GCC\s0. +.IP "\fB\s-1CPATH\s0\fR" 4 +.IX Item "CPATH" +.PD 0 +.IP "\fBC_INCLUDE_PATH\fR" 4 +.IX Item "C_INCLUDE_PATH" +.IP "\fB\s-1CPLUS_INCLUDE_PATH\s0\fR" 4 +.IX Item "CPLUS_INCLUDE_PATH" +.PD +Each variable's value is a list of directories separated by a special +character, much like \fB\s-1PATH\s0\fR, in which to look for header files. +The special character, \f(CW\*(C`PATH_SEPARATOR\*(C'\fR, is target-dependent and +determined at \s-1GCC\s0 build time. For Microsoft Windows-based targets it is a +semicolon, and for almost all other targets it is a colon. +.Sp +\&\fB\s-1CPATH\s0\fR specifies a list of directories to be searched as if +specified with \fB\-I\fR, but after any paths given with \fB\-I\fR +options on the command line. This environment variable is used +regardless of which language is being preprocessed. +.Sp +The remaining environment variables apply only when preprocessing the +particular language indicated. Each specifies a list of directories +to be searched as if specified with \fB\-isystem\fR, but after any +paths given with \fB\-isystem\fR options on the command line. +.Sp +In all these variables, an empty element instructs the compiler to +search its current working directory. Empty elements can appear at the +beginning or end of a path. For instance, if the value of +\&\fB\s-1CPATH\s0\fR is \f(CW\*(C`:/special/include\*(C'\fR, that has the same +effect as \fB\-I.\ \-I/special/include\fR. +.IP "\fB\s-1DEPENDENCIES_OUTPUT\s0\fR" 4 +.IX Item "DEPENDENCIES_OUTPUT" +If this variable is set, its value specifies how to output +dependencies for Make based on the non-system header files processed +by the compiler. System header files are ignored in the dependency +output. +.Sp +The value of \fB\s-1DEPENDENCIES_OUTPUT\s0\fR can be just a file name, in +which case the Make rules are written to that file, guessing the target +name from the source file name. Or the value can have the form +\&\fIfile\fR\fB \fR\fItarget\fR, in which case the rules are written to +file \fIfile\fR using \fItarget\fR as the target name. +.Sp *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***