From owner-svn-src-all@FreeBSD.ORG Sun May 20 01:40:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DCF61065672; Sun, 20 May 2012 01:40:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66DF68FC0A; Sun, 20 May 2012 01:40: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 q4K1eDWN058476; Sun, 20 May 2012 01:40:13 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K1eDwN058474; Sun, 20 May 2012 01:40:13 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205200140.q4K1eDwN058474@svn.freebsd.org> From: Glen Barber Date: Sun, 20 May 2012 01:40: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: r235673 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 01:40:13 -0000 Author: gjb (doc committer) Date: Sun May 20 01:40:12 2012 New Revision: 235673 URL: http://svn.freebsd.org/changeset/base/235673 Log: MFC r235567: mdoc(7) style/formatting fixes. While here, fix a few nits igor(1) does not like. Modified: stable/9/share/man/man4/siftr.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/siftr.4 ============================================================================== --- stable/9/share/man/man4/siftr.4 Sat May 19 23:51:48 2012 (r235672) +++ stable/9/share/man/man4/siftr.4 Sun May 20 01:40:12 2012 (r235673) @@ -91,7 +91,7 @@ utilises the .Xr sysctl 8 interface to export its configuration variables to user-space. The following variables are available: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.enabled controls whether the module performs its measurements or not. @@ -104,7 +104,7 @@ packet filtering hooks are only inserted .Va net.inet.siftr.enabled is set to 1. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.ppl controls how many inbound/outbound packets for a given TCP connection will cause a log message to be generated for the connection. @@ -113,13 +113,13 @@ every packet of every TCP connection. The value can be set to any integer in the range [1,2^32], and can be changed at any time, even while the module is enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.logfile controls the path to the file that the module writes its log messages to. By default, the file /var/log/siftr.log is used. The path can be changed at any time, even while the module is enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.genhashes controls whether a hash is generated for each TCP packet seen by .Nm . @@ -150,36 +150,36 @@ sysname=FreeBSD sysver=604000 ipmo .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va enable_time_secs time at which the module was enabled, in seconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va enable_time_usecs time at which the module was enabled, in microseconds since enable_time_secs. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va siftrver version of .Nm . .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va hz tick rate of the kernel in ticks per second. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va tcp_rtt_scale smoothed RTT estimate scaling factor. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va sysname operating system name. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va sysver operating system version. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va ipmode IP mode as defined at compile time. An ipmode of "4" means IPv6 is not supported and IP addresses are logged in @@ -202,7 +202,7 @@ o,0xbec491a5,1238556193.463551,172.16.7. .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 1 Direction of packet that triggered the log message. Either @@ -211,77 +211,77 @@ for in, or .Qq o for out. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 2 Hash of the packet that triggered the log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 3 Time at which the packet that triggered the log message was processed by the .Xr pfil 9 hook function, in seconds and microseconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 4 The IPv4 or IPv6 address of the local host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 5 The TCP port that the local host is communicating via. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 6 The IPv4 or IPv6 address of the foreign host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 7 The TCP port that the foreign host is communicating via. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 8 The slow start threshold for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 9 The current congestion window for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 10 The current bandwidth-controlled window for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 11 The current sending window for the flow, in bytes. The post scaled value is reported, except during the initial handshake (first few packets), during which time the unscaled value is reported. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 12 The current receive window for the flow, in bytes. The post scaled value is always reported. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 13 The current window scaling factor for the sending window. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 14 The current window scaling factor for the receiving window. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 15 The current state of the TCP finite state machine, as defined in .Aq Pa netinet/tcp_fsm.h . .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 16 The maximum segment size for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 17 The current smoothed RTT estimate for the flow, in units of TCP_RTT_SCALE * HZ, where TCP_RTT_SCALE is a define found in tcp_var.h, and HZ is the kernel's tick @@ -289,46 +289,46 @@ timer. Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. TCP_RTT_SCALE and HZ are reported in the enable log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 18 SACK enabled indicator. 1 if SACK enabled, 0 otherwise. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 19 The current state of the TCP flags for the flow. See .Aq Pa netinet/tcp_var.h for information about the various flags. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 20 The current retransmission timeout length for the flow, in units of HZ, where HZ is the kernel's tick timer. Divide by HZ to get the timeout length in seconds. HZ is reported in the enable log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 21 The current size of the socket send buffer in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 22 The current number of bytes in the socket send buffer. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 23 The current size of the socket receive buffer in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 24 The current number of bytes in the socket receive buffer. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 25 The current number of unacknowledged bytes in-flight. Bytes acknowledged via SACK are not excluded from this count. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 26 The current number of segments in the reassembly queue. .El @@ -350,82 +350,82 @@ flow_list=172.16.7.28;22-172.16.2.5;5593 .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va disable_time_secs Time at which the module was disabled, in seconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va disable_time_usecs Time at which the module was disabled, in microseconds since disable_time_secs. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_tcp_pkts Number of TCP packets that traversed up the network stack. This only includes inbound TCP packets during the periods when .Nm was enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_tcp_pkts Number of TCP packets that traversed down the network stack. This only includes outbound TCP packets during the periods when .Nm was enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va total_tcp_pkts The summation of num_inbound_tcp_pkts and num_outbound_tcp_pkts. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_malloc Number of inbound packets that were not processed because of failed malloc() calls. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_malloc Number of outbound packets that were not processed because of failed malloc() calls. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_mtx Number of inbound packets that were not processed because of failure to add the packet to the packet processing queue. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_mtx Number of outbound packets that were not processed because of failure to add the packet to the packet processing queue. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_tcb Number of inbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_tcb Number of outbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_icb Number of inbound packets that were not processed because of failure to find the IP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_icb Number of outbound packets that were not processed because of failure to find the IP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va total_skipped_tcp_pkts The summation of all skipped packet counters. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va flow_list A CSV list of TCP flows that triggered data log messages to be generated since the module was loaded. Each flow entry in the CSV list is formatted as .Qq local_ip;local_port-foreign_ip;foreign_port . -If there are no entries in the list (i.e. no data log messages were generated), +If there are no entries in the list (i.e., no data log messages were generated), the value will be blank. If there is at least one entry in the list, a trailing comma will always be present. @@ -498,10 +498,10 @@ the system to trigger a dump of the stat flow. With the PPL set to 1, we are in effect sampling each TCP flow's control block state as frequently as flow packets enter/leave the system. -For example, setting PPL to 2 halves the sampling rate i.e. every second flow +For example, setting PPL to 2 halves the sampling rate i.e., every second flow packet (inbound OR outbound) causes a dump of the control block state. .Pp -The distinction between interrogating individual packets vs interrogating the +The distinction between interrogating individual packets versus interrogating the control block is important, because .Nm does not remove the need for packet capturing tools like @@ -543,7 +543,7 @@ If one thread holds the lock, the other This does introduce some additional bounded delay into the kernel's packet processing code path. .Pp -In some cases (e.g. low memory, connection termination), TCP packets that enter +In some cases (e.g., low memory, connection termination), TCP packets that enter the .Nm .Xr pfil 9 From owner-svn-src-all@FreeBSD.ORG Sun May 20 01:40:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B466106564A; Sun, 20 May 2012 01:40:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDFE38FC12; Sun, 20 May 2012 01:40:25 +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 q4K1eO6S058517; Sun, 20 May 2012 01:40:24 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K1eO2o058515; Sun, 20 May 2012 01:40:24 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205200140.q4K1eO2o058515@svn.freebsd.org> From: Glen Barber Date: Sun, 20 May 2012 01:40:24 +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: r235674 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 01:40:26 -0000 Author: gjb (doc committer) Date: Sun May 20 01:40:24 2012 New Revision: 235674 URL: http://svn.freebsd.org/changeset/base/235674 Log: MFC r235567: mdoc(7) style/formatting fixes. While here, fix a few nits igor(1) does not like. Modified: stable/8/share/man/man4/siftr.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/siftr.4 ============================================================================== --- stable/8/share/man/man4/siftr.4 Sun May 20 01:40:12 2012 (r235673) +++ stable/8/share/man/man4/siftr.4 Sun May 20 01:40:24 2012 (r235674) @@ -91,7 +91,7 @@ utilises the .Xr sysctl 8 interface to export its configuration variables to user-space. The following variables are available: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.enabled controls whether the module performs its measurements or not. @@ -104,7 +104,7 @@ packet filtering hooks are only inserted .Va net.inet.siftr.enabled is set to 1. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.ppl controls how many inbound/outbound packets for a given TCP connection will cause a log message to be generated for the connection. @@ -113,13 +113,13 @@ every packet of every TCP connection. The value can be set to any integer in the range [1,2^32], and can be changed at any time, even while the module is enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.logfile controls the path to the file that the module writes its log messages to. By default, the file /var/log/siftr.log is used. The path can be changed at any time, even while the module is enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.genhashes controls whether a hash is generated for each TCP packet seen by .Nm . @@ -150,36 +150,36 @@ sysname=FreeBSD sysver=604000 ipmo .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va enable_time_secs time at which the module was enabled, in seconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va enable_time_usecs time at which the module was enabled, in microseconds since enable_time_secs. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va siftrver version of .Nm . .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va hz tick rate of the kernel in ticks per second. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va tcp_rtt_scale smoothed RTT estimate scaling factor. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va sysname operating system name. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va sysver operating system version. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va ipmode IP mode as defined at compile time. An ipmode of "4" means IPv6 is not supported and IP addresses are logged in @@ -202,7 +202,7 @@ o,0xbec491a5,1238556193.463551,172.16.7. .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 1 Direction of packet that triggered the log message. Either @@ -211,77 +211,77 @@ for in, or .Qq o for out. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 2 Hash of the packet that triggered the log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 3 Time at which the packet that triggered the log message was processed by the .Xr pfil 9 hook function, in seconds and microseconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 4 The IPv4 or IPv6 address of the local host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 5 The TCP port that the local host is communicating via. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 6 The IPv4 or IPv6 address of the foreign host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 7 The TCP port that the foreign host is communicating via. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 8 The slow start threshold for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 9 The current congestion window for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 10 The current bandwidth-controlled window for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 11 The current sending window for the flow, in bytes. The post scaled value is reported, except during the initial handshake (first few packets), during which time the unscaled value is reported. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 12 The current receive window for the flow, in bytes. The post scaled value is always reported. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 13 The current window scaling factor for the sending window. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 14 The current window scaling factor for the receiving window. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 15 The current state of the TCP finite state machine, as defined in .Aq Pa netinet/tcp_fsm.h . .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 16 The maximum segment size for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 17 The current smoothed RTT estimate for the flow, in units of TCP_RTT_SCALE * HZ, where TCP_RTT_SCALE is a define found in tcp_var.h, and HZ is the kernel's tick @@ -289,46 +289,46 @@ timer. Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. TCP_RTT_SCALE and HZ are reported in the enable log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 18 SACK enabled indicator. 1 if SACK enabled, 0 otherwise. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 19 The current state of the TCP flags for the flow. See .Aq Pa netinet/tcp_var.h for information about the various flags. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 20 The current retransmission timeout length for the flow, in units of HZ, where HZ is the kernel's tick timer. Divide by HZ to get the timeout length in seconds. HZ is reported in the enable log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 21 The current size of the socket send buffer in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 22 The current number of bytes in the socket send buffer. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 23 The current size of the socket receive buffer in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 24 The current number of bytes in the socket receive buffer. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 25 The current number of unacknowledged bytes in-flight. Bytes acknowledged via SACK are not excluded from this count. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 26 The current number of segments in the reassembly queue. .El @@ -350,82 +350,82 @@ flow_list=172.16.7.28;22-172.16.2.5;5593 .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va disable_time_secs Time at which the module was disabled, in seconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va disable_time_usecs Time at which the module was disabled, in microseconds since disable_time_secs. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_tcp_pkts Number of TCP packets that traversed up the network stack. This only includes inbound TCP packets during the periods when .Nm was enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_tcp_pkts Number of TCP packets that traversed down the network stack. This only includes outbound TCP packets during the periods when .Nm was enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va total_tcp_pkts The summation of num_inbound_tcp_pkts and num_outbound_tcp_pkts. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_malloc Number of inbound packets that were not processed because of failed malloc() calls. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_malloc Number of outbound packets that were not processed because of failed malloc() calls. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_mtx Number of inbound packets that were not processed because of failure to add the packet to the packet processing queue. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_mtx Number of outbound packets that were not processed because of failure to add the packet to the packet processing queue. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_tcb Number of inbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_tcb Number of outbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_icb Number of inbound packets that were not processed because of failure to find the IP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_icb Number of outbound packets that were not processed because of failure to find the IP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va total_skipped_tcp_pkts The summation of all skipped packet counters. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va flow_list A CSV list of TCP flows that triggered data log messages to be generated since the module was loaded. Each flow entry in the CSV list is formatted as .Qq local_ip;local_port-foreign_ip;foreign_port . -If there are no entries in the list (i.e. no data log messages were generated), +If there are no entries in the list (i.e., no data log messages were generated), the value will be blank. If there is at least one entry in the list, a trailing comma will always be present. @@ -498,10 +498,10 @@ the system to trigger a dump of the stat flow. With the PPL set to 1, we are in effect sampling each TCP flow's control block state as frequently as flow packets enter/leave the system. -For example, setting PPL to 2 halves the sampling rate i.e. every second flow +For example, setting PPL to 2 halves the sampling rate i.e., every second flow packet (inbound OR outbound) causes a dump of the control block state. .Pp -The distinction between interrogating individual packets vs interrogating the +The distinction between interrogating individual packets versus interrogating the control block is important, because .Nm does not remove the need for packet capturing tools like @@ -543,7 +543,7 @@ If one thread holds the lock, the other This does introduce some additional bounded delay into the kernel's packet processing code path. .Pp -In some cases (e.g. low memory, connection termination), TCP packets that enter +In some cases (e.g., low memory, connection termination), TCP packets that enter the .Nm .Xr pfil 9 From owner-svn-src-all@FreeBSD.ORG Sun May 20 01:40:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EFEE5106566B; Sun, 20 May 2012 01:40:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8EF08FC14; Sun, 20 May 2012 01:40: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 q4K1eZUm058560; Sun, 20 May 2012 01:40:35 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K1eZTd058558; Sun, 20 May 2012 01:40:35 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205200140.q4K1eZTd058558@svn.freebsd.org> From: Glen Barber Date: Sun, 20 May 2012 01:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235675 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 01:40:36 -0000 Author: gjb (doc committer) Date: Sun May 20 01:40:35 2012 New Revision: 235675 URL: http://svn.freebsd.org/changeset/base/235675 Log: MFC r235567: mdoc(7) style/formatting fixes. While here, fix a few nits igor(1) does not like. Modified: stable/7/share/man/man4/siftr.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/siftr.4 ============================================================================== --- stable/7/share/man/man4/siftr.4 Sun May 20 01:40:24 2012 (r235674) +++ stable/7/share/man/man4/siftr.4 Sun May 20 01:40:35 2012 (r235675) @@ -91,7 +91,7 @@ utilises the .Xr sysctl 8 interface to export its configuration variables to user-space. The following variables are available: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.enabled controls whether the module performs its measurements or not. @@ -104,7 +104,7 @@ packet filtering hooks are only inserted .Va net.inet.siftr.enabled is set to 1. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.ppl controls how many inbound/outbound packets for a given TCP connection will cause a log message to be generated for the connection. @@ -113,13 +113,13 @@ every packet of every TCP connection. The value can be set to any integer in the range [1,2^32], and can be changed at any time, even while the module is enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.logfile controls the path to the file that the module writes its log messages to. By default, the file /var/log/siftr.log is used. The path can be changed at any time, even while the module is enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.genhashes controls whether a hash is generated for each TCP packet seen by .Nm . @@ -150,36 +150,36 @@ sysname=FreeBSD sysver=604000 ipmo .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va enable_time_secs time at which the module was enabled, in seconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va enable_time_usecs time at which the module was enabled, in microseconds since enable_time_secs. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va siftrver version of .Nm . .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va hz tick rate of the kernel in ticks per second. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va tcp_rtt_scale smoothed RTT estimate scaling factor .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va sysname operating system name .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va sysver operating system version .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va ipmode IP mode as defined at compile time. An ipmode of "4" means IPv6 is not supported and IP addresses are logged in @@ -202,7 +202,7 @@ o,0xbec491a5,1238556193.463551,172.16.7. .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 1 Direction of packet that triggered the log message. Either @@ -211,77 +211,77 @@ for in, or .Qq o for out. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 2 Hash of the packet that triggered the log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 3 Time at which the packet that triggered the log message was processed by the .Xr pfil 9 hook function, in seconds and microseconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 4 The IPv4 or IPv6 address of the local host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 5 The TCP port that the local host is communicating via. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 6 The IPv4 or IPv6 address of the foreign host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 7 The TCP port that the foreign host is communicating via. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 8 The slow start threshold for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 9 The current congestion window for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 10 The current bandwidth-controlled window for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 11 The current sending window for the flow, in bytes. The post scaled value is reported, except during the initial handshake (first few packets), during which time the unscaled value is reported. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 12 The current receive window for the flow, in bytes. The post scaled value is always reported. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 13 The current window scaling factor for the sending window. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 14 The current window scaling factor for the receiving window. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 15 The current state of the TCP finite state machine, as defined in .Aq Pa netinet/tcp_fsm.h . .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 16 The maximum segment size for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 17 The current smoothed RTT estimate for the flow, in units of TCP_RTT_SCALE * HZ, where TCP_RTT_SCALE is a define found in tcp_var.h, and HZ is the kernel's tick @@ -289,46 +289,46 @@ timer. Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. TCP_RTT_SCALE and HZ are reported in the enable log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 18 SACK enabled indicator. 1 if SACK enabled, 0 otherwise. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 19 The current state of the TCP flags for the flow. See .Aq Pa netinet/tcp_var.h for information about the various flags. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 20 The current retransmission timeout length for the flow, in units of HZ, where HZ is the kernel's tick timer. Divide by HZ to get the timeout length in seconds. HZ is reported in the enable log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 21 The current size of the socket send buffer in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 22 The current number of bytes in the socket send buffer. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 23 The current size of the socket receive buffer in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 24 The current number of bytes in the socket receive buffer. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 25 The current number of unacknowledged bytes in-flight. Bytes acknowledged via SACK are not excluded from this count. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 26 The current number of segments in the reassembly queue. .El @@ -350,82 +350,82 @@ flow_list=172.16.7.28;22-172.16.2.5;5593 .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va disable_time_secs Time at which the module was disabled, in seconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va disable_time_usecs Time at which the module was disabled, in microseconds since disable_time_secs. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_tcp_pkts Number of TCP packets that traversed up the network stack. This only includes inbound TCP packets during the periods when .Nm was enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_tcp_pkts Number of TCP packets that traversed down the network stack. This only includes outbound TCP packets during the periods when .Nm was enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va total_tcp_pkts The summation of num_inbound_tcp_pkts and num_outbound_tcp_pkts. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_malloc Number of inbound packets that were not processed because of failed malloc() calls. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_malloc Number of outbound packets that were not processed because of failed malloc() calls. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_mtx Number of inbound packets that were not processed because of failure to add the packet to the packet processing queue. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_mtx Number of outbound packets that were not processed because of failure to add the packet to the packet processing queue. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_tcb Number of inbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_tcb Number of outbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_icb Number of inbound packets that were not processed because of failure to find the IP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_icb Number of outbound packets that were not processed because of failure to find the IP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va total_skipped_tcp_pkts The summation of all skipped packet counters. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va flow_list A CSV list of TCP flows that triggered data log messages to be generated since the module was loaded. Each flow entry in the CSV list is formatted as .Qq local_ip;local_port-foreign_ip;foreign_port . -If there are no entries in the list (i.e. no data log messages were generated), +If there are no entries in the list (i.e., no data log messages were generated), the value will be blank. If there is at least one entry in the list, a trailing comma will always be present. @@ -498,10 +498,10 @@ the system to trigger a dump of the stat flow. With the PPL set to 1, we are in effect sampling each TCP flow's control block state as frequently as flow packets enter/leave the system. -For example, setting PPL to 2 halves the sampling rate i.e. every second flow +For example, setting PPL to 2 halves the sampling rate i.e., every second flow packet (inbound OR outbound) causes a dump of the control block state. .Pp -The distinction between interrogating individual packets vs interrogating the +The distinction between interrogating individual packets versus interrogating the control block is important, because .Nm does not remove the need for packet capturing tools like @@ -543,7 +543,7 @@ If one thread holds the lock, the other This does introduce some additional bounded delay into the kernel's packet processing code path. .Pp -In some cases (e.g. low memory, connection termination), TCP packets that enter +In some cases (e.g., low memory, connection termination), TCP packets that enter the .Nm .Xr pfil 9 From owner-svn-src-all@FreeBSD.ORG Sun May 20 02:05:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 721FD106566C; Sun, 20 May 2012 02:05:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B1A88FC0A; Sun, 20 May 2012 02:05: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 q4K25B9N059689; Sun, 20 May 2012 02:05:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K25Bhr059685; Sun, 20 May 2012 02:05:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205200205.q4K25Bhr059685@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 May 2012 02:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235676 - in head/sys: conf dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 02:05:11 -0000 Author: adrian Date: Sun May 20 02:05:10 2012 New Revision: 235676 URL: http://svn.freebsd.org/changeset/base/235676 Log: Migrate the bulk of the RX routines out from if_ath.c to if_ath_rx.[ch]. * migrate the rx processing out into if_ath_rx.c * migrate the TSF functions into if_ath_tsf.h, as inlines This is in prepration for supporting the EDMA RX routines, required to support the AR93xx series NICs. TODO: * ath_start() shouldn't be private, but it's called as part of the RX path. I should likely migrate ath_rx_tasklet() back into if_ath.c and then return this to be 'static'. The RX code really shouldn't need to see TX routines (and vice versa.) * ath_beacon_* should be in if_ath_beacon.[ch]. * ath_tdma_* should be in if_ath_tdma.[ch] ... Added: head/sys/dev/ath/if_ath_rx.c (contents, props changed) head/sys/dev/ath/if_ath_rx.h (contents, props changed) head/sys/dev/ath/if_ath_tsf.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_tx.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 20 01:40:35 2012 (r235675) +++ head/sys/conf/files Sun May 20 02:05:10 2012 (r235676) @@ -722,6 +722,8 @@ dev/ath/if_ath_tx_ht.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_sysctl.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_rx.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ah_osdep.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" # Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun May 20 01:40:35 2012 (r235675) +++ head/sys/dev/ath/if_ath.c Sun May 20 02:05:10 2012 (r235676) @@ -102,10 +102,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include +#include #include #ifdef ATH_TX99_DIAG @@ -139,7 +141,6 @@ static void ath_vap_delete(struct ieee80 static void ath_init(void *); static void ath_stop_locked(struct ifnet *); static void ath_stop(struct ifnet *); -static void ath_start(struct ifnet *); static int ath_reset_vap(struct ieee80211vap *, u_long); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); @@ -151,7 +152,6 @@ static void ath_key_update_begin(struct static void ath_key_update_end(struct ieee80211vap *); static void ath_update_mcast(struct ifnet *); static void ath_update_promisc(struct ifnet *); -static void ath_mode_init(struct ath_softc *); static void ath_setslottime(struct ath_softc *); static void ath_updateslot(struct ifnet *); static int ath_beaconq_setup(struct ath_hal *); @@ -165,7 +165,6 @@ static void ath_bstuck_proc(void *, int) static void ath_reset_proc(void *, int); static void ath_beacon_return(struct ath_softc *, struct ath_buf *); static void ath_beacon_free(struct ath_softc *); -static void ath_beacon_config(struct ath_softc *, struct ieee80211vap *); static void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *, ath_bufhead *); static int ath_desc_alloc(struct ath_softc *); @@ -176,12 +175,6 @@ static void ath_node_cleanup(struct ieee static void ath_node_free(struct ieee80211_node *); static void ath_node_getsignal(const struct ieee80211_node *, int8_t *, int8_t *); -static int ath_rxbuf_init(struct ath_softc *, struct ath_buf *); -static void ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, - int subtype, int rssi, int nf); -static void ath_setdefantenna(struct ath_softc *, u_int); -static void ath_rx_proc(struct ath_softc *sc, int); -static void ath_rx_tasklet(void *, int); static void ath_txq_init(struct ath_softc *sc, struct ath_txq *, int); static struct ath_txq *ath_txq_setup(struct ath_softc*, int qtype, int subtype); static int ath_tx_setup(struct ath_softc *, int, int); @@ -194,8 +187,6 @@ static void ath_tx_proc(void *, int); static void ath_txq_sched_tasklet(void *, int); static int ath_chan_set(struct ath_softc *, struct ieee80211_channel *); static void ath_draintxq(struct ath_softc *, ATH_RESET_TYPE reset_type); -static void ath_stoprecv(struct ath_softc *, int); -static int ath_startrecv(struct ath_softc *); static void ath_chan_change(struct ath_softc *, struct ieee80211_channel *); static void ath_scan_start(struct ieee80211com *); static void ath_scan_end(struct ieee80211com *); @@ -2334,7 +2325,7 @@ ath_getbuf(struct ath_softc *sc) return bf; } -static void +void ath_start(struct ifnet *ifp) { struct ath_softc *sc = ifp->if_softc; @@ -2485,102 +2476,6 @@ ath_key_update_end(struct ieee80211vap * taskqueue_unblock(sc->sc_tq); } -/* - * Calculate the receive filter according to the - * operating mode and state: - * - * o always accept unicast, broadcast, and multicast traffic - * o accept PHY error frames when hardware doesn't have MIB support - * to count and we need them for ANI (sta mode only until recently) - * and we are not scanning (ANI is disabled) - * NB: older hal's add rx filter bits out of sight and we need to - * blindly preserve them - * o probe request frames are accepted only when operating in - * hostap, adhoc, mesh, or monitor modes - * o enable promiscuous mode - * - when in monitor mode - * - if interface marked PROMISC (assumes bridge setting is filtered) - * o accept beacons: - * - when operating in station mode for collecting rssi data when - * the station is otherwise quiet, or - * - when operating in adhoc mode so the 802.11 layer creates - * node table entries for peers, - * - when scanning - * - when doing s/w beacon miss (e.g. for ap+sta) - * - when operating in ap mode in 11g to detect overlapping bss that - * require protection - * - when operating in mesh mode to detect neighbors - * o accept control frames: - * - when in monitor mode - * XXX HT protection for 11n - */ -static u_int32_t -ath_calcrxfilter(struct ath_softc *sc) -{ - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - u_int32_t rfilt; - - rfilt = HAL_RX_FILTER_UCAST | HAL_RX_FILTER_BCAST | HAL_RX_FILTER_MCAST; - if (!sc->sc_needmib && !sc->sc_scanning) - rfilt |= HAL_RX_FILTER_PHYERR; - if (ic->ic_opmode != IEEE80211_M_STA) - rfilt |= HAL_RX_FILTER_PROBEREQ; - /* XXX ic->ic_monvaps != 0? */ - if (ic->ic_opmode == IEEE80211_M_MONITOR || (ifp->if_flags & IFF_PROMISC)) - rfilt |= HAL_RX_FILTER_PROM; - if (ic->ic_opmode == IEEE80211_M_STA || - ic->ic_opmode == IEEE80211_M_IBSS || - sc->sc_swbmiss || sc->sc_scanning) - rfilt |= HAL_RX_FILTER_BEACON; - /* - * NB: We don't recalculate the rx filter when - * ic_protmode changes; otherwise we could do - * this only when ic_protmode != NONE. - */ - if (ic->ic_opmode == IEEE80211_M_HOSTAP && - IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) - rfilt |= HAL_RX_FILTER_BEACON; - - /* - * Enable hardware PS-POLL RX only for hostap mode; - * STA mode sends PS-POLL frames but never - * receives them. - */ - if (ath_hal_getcapability(sc->sc_ah, HAL_CAP_PSPOLL, - 0, NULL) == HAL_OK && - ic->ic_opmode == IEEE80211_M_HOSTAP) - rfilt |= HAL_RX_FILTER_PSPOLL; - - if (sc->sc_nmeshvaps) { - rfilt |= HAL_RX_FILTER_BEACON; - if (sc->sc_hasbmatch) - rfilt |= HAL_RX_FILTER_BSSID; - else - rfilt |= HAL_RX_FILTER_PROM; - } - if (ic->ic_opmode == IEEE80211_M_MONITOR) - rfilt |= HAL_RX_FILTER_CONTROL; - - /* - * Enable RX of compressed BAR frames only when doing - * 802.11n. Required for A-MPDU. - */ - if (IEEE80211_IS_CHAN_HT(ic->ic_curchan)) - rfilt |= HAL_RX_FILTER_COMPBAR; - - /* - * Enable radar PHY errors if requested by the - * DFS module. - */ - if (sc->sc_dodfs) - rfilt |= HAL_RX_FILTER_PHYRADAR; - - DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x, %s if_flags 0x%x\n", - __func__, rfilt, ieee80211_opmode_name[ic->ic_opmode], ifp->if_flags); - return rfilt; -} - static void ath_update_promisc(struct ifnet *ifp) { @@ -2630,7 +2525,7 @@ ath_update_mcast(struct ifnet *ifp) __func__, mfilt[0], mfilt[1]); } -static void +void ath_mode_init(struct ath_softc *sc) { struct ifnet *ifp = sc->sc_ifp; @@ -3313,7 +3208,7 @@ ath_beacon_free(struct ath_softc *sc) * interrupt when we stop seeing beacons from the AP * we've associated with. */ -static void +void ath_beacon_config(struct ath_softc *sc, struct ieee80211vap *vap) { #define TSF_TO_TU(_h,_l) \ @@ -3788,197 +3683,10 @@ ath_node_getsignal(const struct ieee8021 *noise = -95; /* nominally correct */ } -static int -ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) -{ - struct ath_hal *ah = sc->sc_ah; - int error; - struct mbuf *m; - struct ath_desc *ds; - - m = bf->bf_m; - if (m == NULL) { - /* - * NB: by assigning a page to the rx dma buffer we - * implicitly satisfy the Atheros requirement that - * this buffer be cache-line-aligned and sized to be - * multiple of the cache line size. Not doing this - * causes weird stuff to happen (for the 5210 at least). - */ - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (m == NULL) { - DPRINTF(sc, ATH_DEBUG_ANY, - "%s: no mbuf/cluster\n", __func__); - sc->sc_stats.ast_rx_nombuf++; - return ENOMEM; - } - m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; - - error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, - bf->bf_dmamap, m, - bf->bf_segs, &bf->bf_nseg, - BUS_DMA_NOWAIT); - if (error != 0) { - DPRINTF(sc, ATH_DEBUG_ANY, - "%s: bus_dmamap_load_mbuf_sg failed; error %d\n", - __func__, error); - sc->sc_stats.ast_rx_busdma++; - m_freem(m); - return error; - } - KASSERT(bf->bf_nseg == 1, - ("multi-segment packet; nseg %u", bf->bf_nseg)); - bf->bf_m = m; - } - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREREAD); - - /* - * Setup descriptors. For receive we always terminate - * the descriptor list with a self-linked entry so we'll - * not get overrun under high load (as can happen with a - * 5212 when ANI processing enables PHY error frames). - * - * To insure the last descriptor is self-linked we create - * each descriptor as self-linked and add it to the end. As - * each additional descriptor is added the previous self-linked - * entry is ``fixed'' naturally. This should be safe even - * if DMA is happening. When processing RX interrupts we - * never remove/process the last, self-linked, entry on the - * descriptor list. This insures the hardware always has - * someplace to write a new frame. - */ - /* - * 11N: we can no longer afford to self link the last descriptor. - * MAC acknowledges BA status as long as it copies frames to host - * buffer (or rx fifo). This can incorrectly acknowledge packets - * to a sender if last desc is self-linked. - */ - ds = bf->bf_desc; - if (sc->sc_rxslink) - ds->ds_link = bf->bf_daddr; /* link to self */ - else - ds->ds_link = 0; /* terminate the list */ - ds->ds_data = bf->bf_segs[0].ds_addr; - ath_hal_setuprxdesc(ah, ds - , m->m_len /* buffer size */ - , 0 - ); - - if (sc->sc_rxlink != NULL) - *sc->sc_rxlink = bf->bf_daddr; - sc->sc_rxlink = &ds->ds_link; - return 0; -} - -/* - * Extend 15-bit time stamp from rx descriptor to - * a full 64-bit TSF using the specified TSF. - */ -static __inline u_int64_t -ath_extend_tsf15(u_int32_t rstamp, u_int64_t tsf) -{ - if ((tsf & 0x7fff) < rstamp) - tsf -= 0x8000; - - return ((tsf &~ 0x7fff) | rstamp); -} - -/* - * Extend 32-bit time stamp from rx descriptor to - * a full 64-bit TSF using the specified TSF. - */ -static __inline u_int64_t -ath_extend_tsf32(u_int32_t rstamp, u_int64_t tsf) -{ - u_int32_t tsf_low = tsf & 0xffffffff; - u_int64_t tsf64 = (tsf & ~0xffffffffULL) | rstamp; - - if (rstamp > tsf_low && (rstamp - tsf_low > 0x10000000)) - tsf64 -= 0x100000000ULL; - - if (rstamp < tsf_low && (tsf_low - rstamp > 0x10000000)) - tsf64 += 0x100000000ULL; - - return tsf64; -} - -/* - * Extend the TSF from the RX descriptor to a full 64 bit TSF. - * Earlier hardware versions only wrote the low 15 bits of the - * TSF into the RX descriptor; later versions (AR5416 and up) - * include the 32 bit TSF value. - */ -static __inline u_int64_t -ath_extend_tsf(struct ath_softc *sc, u_int32_t rstamp, u_int64_t tsf) -{ - if (sc->sc_rxtsf32) - return ath_extend_tsf32(rstamp, tsf); - else - return ath_extend_tsf15(rstamp, tsf); -} - -/* - * Intercept management frames to collect beacon rssi data - * and to do ibss merges. - */ -static void -ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, - int subtype, int rssi, int nf) -{ - struct ieee80211vap *vap = ni->ni_vap; - struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; - - /* - * Call up first so subsequent work can use information - * potentially stored in the node (e.g. for ibss merge). - */ - ATH_VAP(vap)->av_recv_mgmt(ni, m, subtype, rssi, nf); - switch (subtype) { - case IEEE80211_FC0_SUBTYPE_BEACON: - /* update rssi statistics for use by the hal */ - /* XXX unlocked check against vap->iv_bss? */ - ATH_RSSI_LPF(sc->sc_halstats.ns_avgbrssi, rssi); - if (sc->sc_syncbeacon && - ni == vap->iv_bss && vap->iv_state == IEEE80211_S_RUN) { - /* - * Resync beacon timers using the tsf of the beacon - * frame we just received. - */ - ath_beacon_config(sc, vap); - } - /* fall thru... */ - case IEEE80211_FC0_SUBTYPE_PROBE_RESP: - if (vap->iv_opmode == IEEE80211_M_IBSS && - vap->iv_state == IEEE80211_S_RUN) { - uint32_t rstamp = sc->sc_lastrs->rs_tstamp; - uint64_t tsf = ath_extend_tsf(sc, rstamp, - ath_hal_gettsf64(sc->sc_ah)); - /* - * Handle ibss merge as needed; check the tsf on the - * frame before attempting the merge. The 802.11 spec - * says the station should change it's bssid to match - * the oldest station with the same ssid, where oldest - * is determined by the tsf. Note that hardware - * reconfiguration happens through callback to - * ath_newstate as the state machine will go from - * RUN -> RUN when this happens. - */ - if (le64toh(ni->ni_tstamp.tsf) >= tsf) { - DPRINTF(sc, ATH_DEBUG_STATE, - "ibss merge, rstamp %u tsf %ju " - "tstamp %ju\n", rstamp, (uintmax_t)tsf, - (uintmax_t)ni->ni_tstamp.tsf); - (void) ieee80211_ibss_merge(ni); - } - } - break; - } -} - /* * Set the default antenna. */ -static void +void ath_setdefantenna(struct ath_softc *sc, u_int antenna) { struct ath_hal *ah = sc->sc_ah; @@ -3992,538 +3700,6 @@ ath_setdefantenna(struct ath_softc *sc, } static void -ath_rx_tap(struct ifnet *ifp, struct mbuf *m, - const struct ath_rx_status *rs, u_int64_t tsf, int16_t nf) -{ -#define CHAN_HT20 htole32(IEEE80211_CHAN_HT20) -#define CHAN_HT40U htole32(IEEE80211_CHAN_HT40U) -#define CHAN_HT40D htole32(IEEE80211_CHAN_HT40D) -#define CHAN_HT (CHAN_HT20|CHAN_HT40U|CHAN_HT40D) - struct ath_softc *sc = ifp->if_softc; - const HAL_RATE_TABLE *rt; - uint8_t rix; - - rt = sc->sc_currates; - KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); - rix = rt->rateCodeToIndex[rs->rs_rate]; - sc->sc_rx_th.wr_rate = sc->sc_hwmap[rix].ieeerate; - sc->sc_rx_th.wr_flags = sc->sc_hwmap[rix].rxflags; -#ifdef AH_SUPPORT_AR5416 - sc->sc_rx_th.wr_chan_flags &= ~CHAN_HT; - if (sc->sc_rx_th.wr_rate & IEEE80211_RATE_MCS) { /* HT rate */ - struct ieee80211com *ic = ifp->if_l2com; - - if ((rs->rs_flags & HAL_RX_2040) == 0) - sc->sc_rx_th.wr_chan_flags |= CHAN_HT20; - else if (IEEE80211_IS_CHAN_HT40U(ic->ic_curchan)) - sc->sc_rx_th.wr_chan_flags |= CHAN_HT40U; - else - sc->sc_rx_th.wr_chan_flags |= CHAN_HT40D; - if ((rs->rs_flags & HAL_RX_GI) == 0) - sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_SHORTGI; - } -#endif - sc->sc_rx_th.wr_tsf = htole64(ath_extend_tsf(sc, rs->rs_tstamp, tsf)); - if (rs->rs_status & HAL_RXERR_CRC) - sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_BADFCS; - /* XXX propagate other error flags from descriptor */ - sc->sc_rx_th.wr_antnoise = nf; - sc->sc_rx_th.wr_antsignal = nf + rs->rs_rssi; - sc->sc_rx_th.wr_antenna = rs->rs_antenna; -#undef CHAN_HT -#undef CHAN_HT20 -#undef CHAN_HT40U -#undef CHAN_HT40D -} - -static void -ath_handle_micerror(struct ieee80211com *ic, - struct ieee80211_frame *wh, int keyix) -{ - struct ieee80211_node *ni; - - /* XXX recheck MIC to deal w/ chips that lie */ - /* XXX discard MIC errors on !data frames */ - ni = ieee80211_find_rxnode(ic, (const struct ieee80211_frame_min *) wh); - if (ni != NULL) { - ieee80211_notify_michael_failure(ni->ni_vap, wh, keyix); - ieee80211_free_node(ni); - } -} - -/* - * Only run the RX proc if it's not already running. - * Since this may get run as part of the reset/flush path, - * the task can't clash with an existing, running tasklet. - */ -static void -ath_rx_tasklet(void *arg, int npending) -{ - struct ath_softc *sc = arg; - - CTR1(ATH_KTR_INTR, "ath_rx_proc: pending=%d", npending); - DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending); - ATH_PCU_LOCK(sc); - if (sc->sc_inreset_cnt > 0) { - device_printf(sc->sc_dev, - "%s: sc_inreset_cnt > 0; skipping\n", __func__); - ATH_PCU_UNLOCK(sc); - return; - } - ATH_PCU_UNLOCK(sc); - ath_rx_proc(sc, 1); -} - -static void -ath_rx_proc(struct ath_softc *sc, int resched) -{ -#define PA2DESC(_sc, _pa) \ - ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ - ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) - struct ath_buf *bf; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ath_hal *ah = sc->sc_ah; - struct ath_desc *ds; - struct ath_rx_status *rs; - struct mbuf *m; - struct ieee80211_node *ni; - int len, type, ngood; - HAL_STATUS status; - int16_t nf; - u_int64_t tsf, rstamp; - int npkts = 0; - - /* XXX we must not hold the ATH_LOCK here */ - ATH_UNLOCK_ASSERT(sc); - ATH_PCU_UNLOCK_ASSERT(sc); - - ATH_PCU_LOCK(sc); - sc->sc_rxproc_cnt++; - ATH_PCU_UNLOCK(sc); - - DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: called\n", __func__); - ngood = 0; - nf = ath_hal_getchannoise(ah, sc->sc_curchan); - sc->sc_stats.ast_rx_noise = nf; - tsf = ath_hal_gettsf64(ah); - do { - bf = TAILQ_FIRST(&sc->sc_rxbuf); - if (sc->sc_rxslink && bf == NULL) { /* NB: shouldn't happen */ - if_printf(ifp, "%s: no buffer!\n", __func__); - break; - } else if (bf == NULL) { - /* - * End of List: - * this can happen for non-self-linked RX chains - */ - sc->sc_stats.ast_rx_hitqueueend++; - break; - } - m = bf->bf_m; - if (m == NULL) { /* NB: shouldn't happen */ - /* - * If mbuf allocation failed previously there - * will be no mbuf; try again to re-populate it. - */ - /* XXX make debug msg */ - if_printf(ifp, "%s: no mbuf!\n", __func__); - TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); - goto rx_next; - } - ds = bf->bf_desc; - if (ds->ds_link == bf->bf_daddr) { - /* NB: never process the self-linked entry at the end */ - sc->sc_stats.ast_rx_hitqueueend++; - break; - } - /* XXX sync descriptor memory */ - /* - * Must provide the virtual address of the current - * descriptor, the physical address, and the virtual - * address of the next descriptor in the h/w chain. - * This allows the HAL to look ahead to see if the - * hardware is done with a descriptor by checking the - * done bit in the following descriptor and the address - * of the current descriptor the DMA engine is working - * on. All this is necessary because of our use of - * a self-linked list to avoid rx overruns. - */ - rs = &bf->bf_status.ds_rxstat; - status = ath_hal_rxprocdesc(ah, ds, - bf->bf_daddr, PA2DESC(sc, ds->ds_link), rs); -#ifdef ATH_DEBUG - if (sc->sc_debug & ATH_DEBUG_RECV_DESC) - ath_printrxbuf(sc, bf, 0, status == HAL_OK); -#endif - if (status == HAL_EINPROGRESS) - break; - - TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); - npkts++; - - /* - * Calculate the correct 64 bit TSF given - * the TSF64 register value and rs_tstamp. - */ - rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf); - - /* These aren't specifically errors */ -#ifdef AH_SUPPORT_AR5416 - if (rs->rs_flags & HAL_RX_GI) - sc->sc_stats.ast_rx_halfgi++; - if (rs->rs_flags & HAL_RX_2040) - sc->sc_stats.ast_rx_2040++; - if (rs->rs_flags & HAL_RX_DELIM_CRC_PRE) - sc->sc_stats.ast_rx_pre_crc_err++; - if (rs->rs_flags & HAL_RX_DELIM_CRC_POST) - sc->sc_stats.ast_rx_post_crc_err++; - if (rs->rs_flags & HAL_RX_DECRYPT_BUSY) - sc->sc_stats.ast_rx_decrypt_busy_err++; - if (rs->rs_flags & HAL_RX_HI_RX_CHAIN) - sc->sc_stats.ast_rx_hi_rx_chain++; -#endif /* AH_SUPPORT_AR5416 */ - - if (rs->rs_status != 0) { - if (rs->rs_status & HAL_RXERR_CRC) - sc->sc_stats.ast_rx_crcerr++; - if (rs->rs_status & HAL_RXERR_FIFO) - sc->sc_stats.ast_rx_fifoerr++; - if (rs->rs_status & HAL_RXERR_PHY) { - sc->sc_stats.ast_rx_phyerr++; - /* Process DFS radar events */ - if ((rs->rs_phyerr == HAL_PHYERR_RADAR) || - (rs->rs_phyerr == HAL_PHYERR_FALSE_RADAR_EXT)) { - /* Since we're touching the frame data, sync it */ - bus_dmamap_sync(sc->sc_dmat, - bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - /* Now pass it to the radar processing code */ - ath_dfs_process_phy_err(sc, mtod(m, char *), rstamp, rs); - } - - /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ - if (rs->rs_phyerr < 64) - sc->sc_stats.ast_rx_phy[rs->rs_phyerr]++; - goto rx_error; /* NB: don't count in ierrors */ - } - if (rs->rs_status & HAL_RXERR_DECRYPT) { - /* - * Decrypt error. If the error occurred - * because there was no hardware key, then - * let the frame through so the upper layers - * can process it. This is necessary for 5210 - * parts which have no way to setup a ``clear'' - * key cache entry. - * - * XXX do key cache faulting - */ - if (rs->rs_keyix == HAL_RXKEYIX_INVALID) - goto rx_accept; - sc->sc_stats.ast_rx_badcrypt++; - } - if (rs->rs_status & HAL_RXERR_MIC) { - sc->sc_stats.ast_rx_badmic++; - /* - * Do minimal work required to hand off - * the 802.11 header for notification. - */ - /* XXX frag's and qos frames */ - len = rs->rs_datalen; - if (len >= sizeof (struct ieee80211_frame)) { - bus_dmamap_sync(sc->sc_dmat, - bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - ath_handle_micerror(ic, - mtod(m, struct ieee80211_frame *), - sc->sc_splitmic ? - rs->rs_keyix-32 : rs->rs_keyix); - } - } - ifp->if_ierrors++; -rx_error: - /* - * Cleanup any pending partial frame. - */ - if (sc->sc_rxpending != NULL) { - m_freem(sc->sc_rxpending); - sc->sc_rxpending = NULL; - } - /* - * When a tap is present pass error frames - * that have been requested. By default we - * pass decrypt+mic errors but others may be - * interesting (e.g. crc). - */ - if (ieee80211_radiotap_active(ic) && - (rs->rs_status & sc->sc_monpass)) { - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - /* NB: bpf needs the mbuf length setup */ - len = rs->rs_datalen; - m->m_pkthdr.len = m->m_len = len; - bf->bf_m = NULL; - ath_rx_tap(ifp, m, rs, rstamp, nf); - ieee80211_radiotap_rx_all(ic, m); - m_freem(m); - } - /* XXX pass MIC errors up for s/w reclaculation */ - goto rx_next; - } -rx_accept: - /* - * Sync and unmap the frame. At this point we're - * committed to passing the mbuf somewhere so clear - * bf_m; this means a new mbuf must be allocated - * when the rx descriptor is setup again to receive - * another frame. - */ - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - bf->bf_m = NULL; - - len = rs->rs_datalen; - m->m_len = len; - - if (rs->rs_more) { - /* - * Frame spans multiple descriptors; save - * it for the next completed descriptor, it - * will be used to construct a jumbogram. - */ - if (sc->sc_rxpending != NULL) { - /* NB: max frame size is currently 2 clusters */ - sc->sc_stats.ast_rx_toobig++; - m_freem(sc->sc_rxpending); - } - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - sc->sc_rxpending = m; - goto rx_next; - } else if (sc->sc_rxpending != NULL) { - /* - * This is the second part of a jumbogram, - * chain it to the first mbuf, adjust the - * frame length, and clear the rxpending state. - */ - sc->sc_rxpending->m_next = m; - sc->sc_rxpending->m_pkthdr.len += len; - m = sc->sc_rxpending; - sc->sc_rxpending = NULL; - } else { - /* - * Normal single-descriptor receive; setup - * the rcvif and packet length. - */ - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - } - - /* - * Validate rs->rs_antenna. - * - * Some users w/ AR9285 NICs have reported crashes - * here because rs_antenna field is bogusly large. - * Let's enforce the maximum antenna limit of 8 - * (and it shouldn't be hard coded, but that's a - * separate problem) and if there's an issue, print - * out an error and adjust rs_antenna to something - * sensible. - * - * This code should be removed once the actual - * root cause of the issue has been identified. - * For example, it may be that the rs_antenna - * field is only valid for the lsat frame of - * an aggregate and it just happens that it is - * "mostly" right. (This is a general statement - - * the majority of the statistics are only valid - * for the last frame in an aggregate. - */ - if (rs->rs_antenna > 7) { - device_printf(sc->sc_dev, "%s: rs_antenna > 7 (%d)\n", - __func__, rs->rs_antenna); -#ifdef ATH_DEBUG - ath_printrxbuf(sc, bf, 0, status == HAL_OK); -#endif /* ATH_DEBUG */ - rs->rs_antenna = 0; /* XXX better than nothing */ - } - - ifp->if_ipackets++; - sc->sc_stats.ast_ant_rx[rs->rs_antenna]++; - - /* - * Populate the rx status block. When there are bpf - * listeners we do the additional work to provide - * complete status. Otherwise we fill in only the - * material required by ieee80211_input. Note that - * noise setting is filled in above. - */ - if (ieee80211_radiotap_active(ic)) - ath_rx_tap(ifp, m, rs, rstamp, nf); - - /* - * From this point on we assume the frame is at least - * as large as ieee80211_frame_min; verify that. - */ - if (len < IEEE80211_MIN_LEN) { - if (!ieee80211_radiotap_active(ic)) { - DPRINTF(sc, ATH_DEBUG_RECV, - "%s: short packet %d\n", __func__, len); - sc->sc_stats.ast_rx_tooshort++; - } else { - /* NB: in particular this captures ack's */ - ieee80211_radiotap_rx_all(ic, m); - } - m_freem(m); - goto rx_next; - } - - if (IFF_DUMPPKTS(sc, ATH_DEBUG_RECV)) { - const HAL_RATE_TABLE *rt = sc->sc_currates; - uint8_t rix = rt->rateCodeToIndex[rs->rs_rate]; - - ieee80211_dump_pkt(ic, mtod(m, caddr_t), len, - sc->sc_hwmap[rix].ieeerate, rs->rs_rssi); - } - - m_adj(m, -IEEE80211_CRC_LEN); - - /* - * Locate the node for sender, track state, and then - * pass the (referenced) node up to the 802.11 layer - * for its use. - */ - ni = ieee80211_find_rxnode_withkey(ic, - mtod(m, const struct ieee80211_frame_min *), - rs->rs_keyix == HAL_RXKEYIX_INVALID ? - IEEE80211_KEYIX_NONE : rs->rs_keyix); - sc->sc_lastrs = rs; - -#ifdef AH_SUPPORT_AR5416 - if (rs->rs_isaggr) - sc->sc_stats.ast_rx_agg++; -#endif /* AH_SUPPORT_AR5416 */ - - if (ni != NULL) { - /* - * Only punt packets for ampdu reorder processing for - * 11n nodes; net80211 enforces that M_AMPDU is only - * set for 11n nodes. - */ - if (ni->ni_flags & IEEE80211_NODE_HT) - m->m_flags |= M_AMPDU; - - /* - * Sending station is known, dispatch directly. - */ - type = ieee80211_input(ni, m, rs->rs_rssi, nf); - ieee80211_free_node(ni); - /* - * Arrange to update the last rx timestamp only for - * frames from our ap when operating in station mode. - * This assumes the rx key is always setup when - * associated. - */ - if (ic->ic_opmode == IEEE80211_M_STA && - rs->rs_keyix != HAL_RXKEYIX_INVALID) - ngood++; - } else { - type = ieee80211_input_all(ic, m, rs->rs_rssi, nf); - } - /* - * Track rx rssi and do any rx antenna management. - */ - ATH_RSSI_LPF(sc->sc_halstats.ns_avgrssi, rs->rs_rssi); - if (sc->sc_diversity) { - /* - * When using fast diversity, change the default rx - * antenna if diversity chooses the other antenna 3 - * times in a row. - */ - if (sc->sc_defant != rs->rs_antenna) { - if (++sc->sc_rxotherant >= 3) - ath_setdefantenna(sc, rs->rs_antenna); - } else - sc->sc_rxotherant = 0; - } - - /* Newer school diversity - kite specific for now */ - /* XXX perhaps migrate the normal diversity code to this? */ - if ((ah)->ah_rxAntCombDiversity) - (*(ah)->ah_rxAntCombDiversity)(ah, rs, ticks, hz); - - if (sc->sc_softled) { - /* - * Blink for any data frame. Otherwise do a - * heartbeat-style blink when idle. The latter - * is mainly for station mode where we depend on - * periodic beacon frames to trigger the poll event. - */ - if (type == IEEE80211_FC0_TYPE_DATA) { - const HAL_RATE_TABLE *rt = sc->sc_currates; - ath_led_event(sc, - rt->rateCodeToIndex[rs->rs_rate]); - } else if (ticks - sc->sc_ledevent >= sc->sc_ledidle) - ath_led_event(sc, 0); - } -rx_next: - TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); - } while (ath_rxbuf_init(sc, bf) == 0); - - /* rx signal state monitoring */ - ath_hal_rxmonitor(ah, &sc->sc_halstats, sc->sc_curchan); - if (ngood) - sc->sc_lastrx = tsf; - - CTR2(ATH_KTR_INTR, "ath_rx_proc: npkts=%d, ngood=%d", npkts, ngood); - /* Queue DFS tasklet if needed */ - if (resched && ath_dfs_tasklet_needed(sc, sc->sc_curchan)) - taskqueue_enqueue(sc->sc_tq, &sc->sc_dfstask); - - /* - * Now that all the RX frames were handled that - * need to be handled, kick the PCU if there's - * been an RXEOL condition. - */ - ATH_PCU_LOCK(sc); - if (resched && sc->sc_kickpcu) { - CTR0(ATH_KTR_ERR, "ath_rx_proc: kickpcu"); - device_printf(sc->sc_dev, "%s: kickpcu; handled %d packets\n", - __func__, npkts); - - /* XXX rxslink? */ - /* - * XXX can we hold the PCU lock here? - * Are there any net80211 buffer calls involved? - */ - bf = TAILQ_FIRST(&sc->sc_rxbuf); - ath_hal_putrxbuf(ah, bf->bf_daddr); - ath_hal_rxena(ah); /* enable recv descriptors */ - ath_mode_init(sc); /* set filters, etc. */ - ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ - - ath_hal_intrset(ah, sc->sc_imask); - sc->sc_kickpcu = 0; - } - ATH_PCU_UNLOCK(sc); - - /* XXX check this inside of IF_LOCK? */ - if (resched && (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { -#ifdef IEEE80211_SUPPORT_SUPERG - ieee80211_ff_age_all(ic, 100); -#endif - if (!IFQ_IS_EMPTY(&ifp->if_snd)) - ath_start(ifp); - } -#undef PA2DESC - - ATH_PCU_LOCK(sc); - sc->sc_rxproc_cnt--; - ATH_PCU_UNLOCK(sc); -} - -static void ath_txq_init(struct ath_softc *sc, struct ath_txq *txq, int qnum) { txq->axq_qnum = qnum; @@ -5404,87 +4580,6 @@ ath_draintxq(struct ath_softc *sc, ATH_R } /* - * Disable the receive h/w in preparation for a reset. - */ -static void -ath_stoprecv(struct ath_softc *sc, int dodelay) -{ -#define PA2DESC(_sc, _pa) \ - ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ - ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) - struct ath_hal *ah = sc->sc_ah; - - ath_hal_stoppcurecv(ah); /* disable PCU */ - ath_hal_setrxfilter(ah, 0); /* clear recv filter */ - ath_hal_stopdmarecv(ah); /* disable DMA engine */ - /* - * TODO: see if this particular DELAY() is required; it may be - * masking some missing FIFO flush or DMA sync. - */ -#if 0 - if (dodelay) -#endif - DELAY(3000); /* 3ms is long enough for 1 frame */ -#ifdef ATH_DEBUG - if (sc->sc_debug & (ATH_DEBUG_RESET | ATH_DEBUG_FATAL)) { - struct ath_buf *bf; - u_int ix; - - device_printf(sc->sc_dev, - "%s: rx queue %p, link %p\n", - __func__, - (caddr_t)(uintptr_t) ath_hal_getrxbuf(ah), - sc->sc_rxlink); - ix = 0; - TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { - struct ath_desc *ds = bf->bf_desc; - struct ath_rx_status *rs = &bf->bf_status.ds_rxstat; - HAL_STATUS status = ath_hal_rxprocdesc(ah, ds, - bf->bf_daddr, PA2DESC(sc, ds->ds_link), rs); - if (status == HAL_OK || (sc->sc_debug & ATH_DEBUG_FATAL)) - ath_printrxbuf(sc, bf, ix, status == HAL_OK); - ix++; - } - } -#endif - if (sc->sc_rxpending != NULL) { - m_freem(sc->sc_rxpending); - sc->sc_rxpending = NULL; - } - sc->sc_rxlink = NULL; /* just in case */ -#undef PA2DESC -} - -/* - * Enable the receive h/w following a reset. - */ -static int -ath_startrecv(struct ath_softc *sc) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun May 20 02:05:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1B0010657FF; Sun, 20 May 2012 02:05:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD0988FC0A; Sun, 20 May 2012 02:05: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 q4K25QAr059735; Sun, 20 May 2012 02:05:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K25Q6E059733; Sun, 20 May 2012 02:05:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205200205.q4K25Q6E059733@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 May 2012 02:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235677 - head/sys/modules/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 02:05:27 -0000 Author: adrian Date: Sun May 20 02:05:25 2012 New Revision: 235677 URL: http://svn.freebsd.org/changeset/base/235677 Log: .. and update this. Modified: head/sys/modules/ath/Makefile Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Sun May 20 02:05:10 2012 (r235676) +++ head/sys/modules/ath/Makefile Sun May 20 02:05:25 2012 (r235677) @@ -36,7 +36,7 @@ ATH_RATE?= sample # tx rate control alg KMOD= if_ath SRCS= if_ath.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c -SRCS+= if_ath_tx.c if_ath_tx_ht.c if_ath_led.c +SRCS+= if_ath_tx.c if_ath_tx_ht.c if_ath_led.c if_ath_rx.c # NB: v3 eeprom support used by both AR5211 and AR5212; just include it SRCS+= ah_osdep.c ah.c ah_regdomain.c ah_eeprom_v3.c SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h From owner-svn-src-all@FreeBSD.ORG Sun May 20 02:43:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00012106566B; Sun, 20 May 2012 02:43:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A39368FC08; Sun, 20 May 2012 02:43: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 q4K2htoC061453; Sun, 20 May 2012 02:43:55 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K2hsXA061451; Sun, 20 May 2012 02:43:54 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201205200243.q4K2hsXA061451@svn.freebsd.org> From: Justin Hibbits Date: Sun, 20 May 2012 02:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235678 - head/sys/dev/powermac_nvram X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 02:43:56 -0000 Author: jhibbits Date: Sun May 20 02:43:54 2012 New Revision: 235678 URL: http://svn.freebsd.org/changeset/base/235678 Log: "nvram,flash" may not be the first in the compatible list property of the nvram ofw node, so check all strings in the list. Approved by: nwhitehorn (mentor) MFC after: 3 days Modified: head/sys/dev/powermac_nvram/powermac_nvram.c Modified: head/sys/dev/powermac_nvram/powermac_nvram.c ============================================================================== --- head/sys/dev/powermac_nvram/powermac_nvram.c Sun May 20 02:05:25 2012 (r235677) +++ head/sys/dev/powermac_nvram/powermac_nvram.c Sun May 20 02:43:54 2012 (r235678) @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -118,7 +119,7 @@ powermac_nvram_probe(device_t dev) if (strcmp(type, "nvram") != 0) return ENXIO; if (strcmp(compatible, "amd-0137") != 0 && - strcmp(compatible, "nvram,flash") != 0) + !ofw_bus_is_compatible(dev, "nvram,flash")) return ENXIO; device_set_desc(dev, "Apple NVRAM"); From owner-svn-src-all@FreeBSD.ORG Sun May 20 02:49:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51120106566C; Sun, 20 May 2012 02:49:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39B878FC08; Sun, 20 May 2012 02:49: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 q4K2ngED061747; Sun, 20 May 2012 02:49:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K2ngrP061738; Sun, 20 May 2012 02:49:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205200249.q4K2ngrP061738@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 May 2012 02:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235679 - in head/sys: conf dev/ath modules/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 02:49:43 -0000 Author: adrian Date: Sun May 20 02:49:42 2012 New Revision: 235679 URL: http://svn.freebsd.org/changeset/base/235679 Log: Migrate the TDMA management functions out of if_ath.c into if_ath_tdma.c. There's some TX path TDMA code in if_ath_tx.c which should be migrated out, but first I should likely try and verify/fix/repair the TDMA support in 9.x and -HEAD. Added: head/sys/dev/ath/if_ath_beacon.h (contents, props changed) head/sys/dev/ath/if_ath_tdma.c (contents, props changed) head/sys/dev/ath/if_ath_tdma.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 20 02:43:54 2012 (r235678) +++ head/sys/conf/files Sun May 20 02:49:42 2012 (r235679) @@ -720,6 +720,8 @@ dev/ath/if_ath_tx.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_tx_ht.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_tdma.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_sysctl.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_rx.c optional ath \ Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun May 20 02:43:54 2012 (r235678) +++ head/sys/dev/ath/if_ath.c Sun May 20 02:49:42 2012 (r235679) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef ATH_TX99_DIAG @@ -159,8 +160,6 @@ static int ath_beacon_alloc(struct ath_s static void ath_beacon_update(struct ieee80211vap *, int item); static void ath_beacon_setup(struct ath_softc *, struct ath_buf *); static void ath_beacon_proc(void *, int); -static struct ath_buf *ath_beacon_generate(struct ath_softc *, - struct ieee80211vap *); static void ath_bstuck_proc(void *, int); static void ath_reset_proc(void *, int); static void ath_beacon_return(struct ath_softc *, struct ath_buf *); @@ -178,7 +177,6 @@ static void ath_node_getsignal(const str static void ath_txq_init(struct ath_softc *sc, struct ath_txq *, int); static struct ath_txq *ath_txq_setup(struct ath_softc*, int qtype, int subtype); static int ath_tx_setup(struct ath_softc *, int, int); -static int ath_wme_update(struct ieee80211com *); static void ath_tx_cleanupq(struct ath_softc *, struct ath_txq *); static void ath_tx_cleanup(struct ath_softc *); static void ath_tx_proc_q0(void *, int); @@ -213,16 +211,10 @@ static void ath_announce(struct ath_soft static void ath_dfs_tasklet(void *, int); #ifdef IEEE80211_SUPPORT_TDMA -static void ath_tdma_settimers(struct ath_softc *sc, u_int32_t nexttbtt, - u_int32_t bintval); -static void ath_tdma_bintvalsetup(struct ath_softc *sc, - const struct ieee80211_tdma_state *tdma); -static void ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap); -static void ath_tdma_update(struct ieee80211_node *ni, - const struct ieee80211_tdma_param *tdma, int); -static void ath_tdma_beacon_send(struct ath_softc *sc, - struct ieee80211vap *vap); +#include +#endif +#if 0 #define TDMA_EP_MULTIPLIER (1<<10) /* pow2 to optimize out * and / */ #define TDMA_LPF_LEN 6 #define TDMA_DUMMY_MARKER 0x127 @@ -263,7 +255,7 @@ SYSCTL_INT(_hw_ath, OID_AUTO, txbuf, CTL 0, "tx buffers allocated"); TUNABLE_INT("hw.ath.txbuf", &ath_txbuf); -static int ath_bstuck_threshold = 4; /* max missed beacons */ +int ath_bstuck_threshold = 4; /* max missed beacons */ SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CTLFLAG_RW, &ath_bstuck_threshold, 0, "max missed beacon xmits before chip reset"); @@ -2621,7 +2613,7 @@ ath_beaconq_setup(struct ath_hal *ah) /* * Setup the transmit queue parameters for the beacon queue. */ -static int +int ath_beaconq_config(struct ath_softc *sc) { #define ATH_EXPONENT_TO_VALUE(v) ((1<<(v))-1) @@ -2976,7 +2968,7 @@ ath_beacon_proc(void *arg, int pending) } } -static struct ath_buf * +struct ath_buf * ath_beacon_generate(struct ath_softc *sc, struct ieee80211vap *vap) { struct ath_vap *avp = ATH_VAP(vap); @@ -3876,7 +3868,7 @@ ath_txq_update(struct ath_softc *sc, int /* * Callback from the 802.11 layer to update WME parameters. */ -static int +int ath_wme_update(struct ieee80211com *ic) { struct ath_softc *sc = ic->ic_ifp->if_softc; @@ -5650,357 +5642,6 @@ ath_announce(struct ath_softc *sc) if_printf(ifp, "using multicast key search\n"); } -#ifdef IEEE80211_SUPPORT_TDMA -static void -ath_tdma_settimers(struct ath_softc *sc, u_int32_t nexttbtt, u_int32_t bintval) -{ - struct ath_hal *ah = sc->sc_ah; - HAL_BEACON_TIMERS bt; - - bt.bt_intval = bintval | HAL_BEACON_ENA; - bt.bt_nexttbtt = nexttbtt; - bt.bt_nextdba = (nexttbtt<<3) - sc->sc_tdmadbaprep; - bt.bt_nextswba = (nexttbtt<<3) - sc->sc_tdmaswbaprep; - bt.bt_nextatim = nexttbtt+1; - /* Enables TBTT, DBA, SWBA timers by default */ - bt.bt_flags = 0; - ath_hal_beaconsettimers(ah, &bt); -} - -/* - * Calculate the beacon interval. This is periodic in the - * superframe for the bss. We assume each station is configured - * identically wrt transmit rate so the guard time we calculate - * above will be the same on all stations. Note we need to - * factor in the xmit time because the hardware will schedule - * a frame for transmit if the start of the frame is within - * the burst time. When we get hardware that properly kills - * frames in the PCU we can reduce/eliminate the guard time. - * - * Roundup to 1024 is so we have 1 TU buffer in the guard time - * to deal with the granularity of the nexttbtt timer. 11n MAC's - * with 1us timer granularity should allow us to reduce/eliminate - * this. - */ -static void -ath_tdma_bintvalsetup(struct ath_softc *sc, - const struct ieee80211_tdma_state *tdma) -{ - /* copy from vap state (XXX check all vaps have same value?) */ - sc->sc_tdmaslotlen = tdma->tdma_slotlen; - - sc->sc_tdmabintval = roundup((sc->sc_tdmaslotlen+sc->sc_tdmaguard) * - tdma->tdma_slotcnt, 1024); - sc->sc_tdmabintval >>= 10; /* TSF -> TU */ - if (sc->sc_tdmabintval & 1) - sc->sc_tdmabintval++; - - if (tdma->tdma_slot == 0) { - /* - * Only slot 0 beacons; other slots respond. - */ - sc->sc_imask |= HAL_INT_SWBA; - sc->sc_tdmaswba = 0; /* beacon immediately */ - } else { - /* XXX all vaps must be slot 0 or slot !0 */ - sc->sc_imask &= ~HAL_INT_SWBA; - } -} - -/* - * Max 802.11 overhead. This assumes no 4-address frames and - * the encapsulation done by ieee80211_encap (llc). We also - * include potential crypto overhead. - */ -#define IEEE80211_MAXOVERHEAD \ - (sizeof(struct ieee80211_qosframe) \ - + sizeof(struct llc) \ - + IEEE80211_ADDR_LEN \ - + IEEE80211_WEP_IVLEN \ - + IEEE80211_WEP_KIDLEN \ - + IEEE80211_WEP_CRCLEN \ - + IEEE80211_WEP_MICLEN \ - + IEEE80211_CRC_LEN) - -/* - * Setup initially for tdma operation. Start the beacon - * timers and enable SWBA if we are slot 0. Otherwise - * we wait for slot 0 to arrive so we can sync up before - * starting to transmit. - */ -static void -ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap) -{ - struct ath_hal *ah = sc->sc_ah; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - const struct ieee80211_txparam *tp; - const struct ieee80211_tdma_state *tdma = NULL; - int rix; - - if (vap == NULL) { - vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */ - if (vap == NULL) { - if_printf(ifp, "%s: no vaps?\n", __func__); - return; - } - } - /* XXX should take a locked ref to iv_bss */ - tp = vap->iv_bss->ni_txparms; - /* - * Calculate the guard time for each slot. This is the - * time to send a maximal-size frame according to the - * fixed/lowest transmit rate. Note that the interface - * mtu does not include the 802.11 overhead so we must - * tack that on (ath_hal_computetxtime includes the - * preamble and plcp in it's calculation). - */ - tdma = vap->iv_tdma; - if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) - rix = ath_tx_findrix(sc, tp->ucastrate); - else - rix = ath_tx_findrix(sc, tp->mcastrate); - /* XXX short preamble assumed */ - sc->sc_tdmaguard = ath_hal_computetxtime(ah, sc->sc_currates, - ifp->if_mtu + IEEE80211_MAXOVERHEAD, rix, AH_TRUE); - - ath_hal_intrset(ah, 0); - - ath_beaconq_config(sc); /* setup h/w beacon q */ - if (sc->sc_setcca) - ath_hal_setcca(ah, AH_FALSE); /* disable CCA */ - ath_tdma_bintvalsetup(sc, tdma); /* calculate beacon interval */ - ath_tdma_settimers(sc, sc->sc_tdmabintval, - sc->sc_tdmabintval | HAL_BEACON_RESET_TSF); - sc->sc_syncbeacon = 0; - - sc->sc_avgtsfdeltap = TDMA_DUMMY_MARKER; - sc->sc_avgtsfdeltam = TDMA_DUMMY_MARKER; - - ath_hal_intrset(ah, sc->sc_imask); - - DPRINTF(sc, ATH_DEBUG_TDMA, "%s: slot %u len %uus cnt %u " - "bsched %u guard %uus bintval %u TU dba prep %u\n", __func__, - tdma->tdma_slot, tdma->tdma_slotlen, tdma->tdma_slotcnt, - tdma->tdma_bintval, sc->sc_tdmaguard, sc->sc_tdmabintval, - sc->sc_tdmadbaprep); -} - -/* - * Update tdma operation. Called from the 802.11 layer - * when a beacon is received from the TDMA station operating - * in the slot immediately preceding us in the bss. Use - * the rx timestamp for the beacon frame to update our - * beacon timers so we follow their schedule. Note that - * by using the rx timestamp we implicitly include the - * propagation delay in our schedule. - */ -static void -ath_tdma_update(struct ieee80211_node *ni, - const struct ieee80211_tdma_param *tdma, int changed) -{ -#define TSF_TO_TU(_h,_l) \ - ((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) -#define TU_TO_TSF(_tu) (((u_int64_t)(_tu)) << 10) - struct ieee80211vap *vap = ni->ni_vap; - struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; - struct ath_hal *ah = sc->sc_ah; - const HAL_RATE_TABLE *rt = sc->sc_currates; - u_int64_t tsf, rstamp, nextslot, nexttbtt; - u_int32_t txtime, nextslottu; - int32_t tudelta, tsfdelta; - const struct ath_rx_status *rs; - int rix; - - sc->sc_stats.ast_tdma_update++; - - /* - * Check for and adopt configuration changes. - */ - if (changed != 0) { - const struct ieee80211_tdma_state *ts = vap->iv_tdma; - - ath_tdma_bintvalsetup(sc, ts); - if (changed & TDMA_UPDATE_SLOTLEN) - ath_wme_update(ic); - - DPRINTF(sc, ATH_DEBUG_TDMA, - "%s: adopt slot %u slotcnt %u slotlen %u us " - "bintval %u TU\n", __func__, - ts->tdma_slot, ts->tdma_slotcnt, ts->tdma_slotlen, - sc->sc_tdmabintval); - - /* XXX right? */ - ath_hal_intrset(ah, sc->sc_imask); - /* NB: beacon timers programmed below */ - } - - /* extend rx timestamp to 64 bits */ - rs = sc->sc_lastrs; - tsf = ath_hal_gettsf64(ah); - rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf); - /* - * The rx timestamp is set by the hardware on completing - * reception (at the point where the rx descriptor is DMA'd - * to the host). To find the start of our next slot we - * must adjust this time by the time required to send - * the packet just received. - */ - rix = rt->rateCodeToIndex[rs->rs_rate]; - txtime = ath_hal_computetxtime(ah, rt, rs->rs_datalen, rix, - rt->info[rix].shortPreamble); - /* NB: << 9 is to cvt to TU and /2 */ - nextslot = (rstamp - txtime) + (sc->sc_tdmabintval << 9); - nextslottu = TSF_TO_TU(nextslot>>32, nextslot) & HAL_BEACON_PERIOD; - - /* - * Retrieve the hardware NextTBTT in usecs - * and calculate the difference between what the - * other station thinks and what we have programmed. This - * lets us figure how to adjust our timers to match. The - * adjustments are done by pulling the TSF forward and possibly - * rewriting the beacon timers. - */ - nexttbtt = ath_hal_getnexttbtt(ah); - tsfdelta = (int32_t)((nextslot % TU_TO_TSF(HAL_BEACON_PERIOD + 1)) - nexttbtt); - - DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, - "tsfdelta %d avg +%d/-%d\n", tsfdelta, - TDMA_AVG(sc->sc_avgtsfdeltap), TDMA_AVG(sc->sc_avgtsfdeltam)); - - if (tsfdelta < 0) { - TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); - TDMA_SAMPLE(sc->sc_avgtsfdeltam, -tsfdelta); - tsfdelta = -tsfdelta % 1024; - nextslottu++; - } else if (tsfdelta > 0) { - TDMA_SAMPLE(sc->sc_avgtsfdeltap, tsfdelta); - TDMA_SAMPLE(sc->sc_avgtsfdeltam, 0); - tsfdelta = 1024 - (tsfdelta % 1024); - nextslottu++; - } else { - TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); - TDMA_SAMPLE(sc->sc_avgtsfdeltam, 0); - } - tudelta = nextslottu - TSF_TO_TU(nexttbtt >> 32, nexttbtt); - - /* - * Copy sender's timetstamp into tdma ie so they can - * calculate roundtrip time. We submit a beacon frame - * below after any timer adjustment. The frame goes out - * at the next TBTT so the sender can calculate the - * roundtrip by inspecting the tdma ie in our beacon frame. - * - * NB: This tstamp is subtlely preserved when - * IEEE80211_BEACON_TDMA is marked (e.g. when the - * slot position changes) because ieee80211_add_tdma - * skips over the data. - */ - memcpy(ATH_VAP(vap)->av_boff.bo_tdma + - __offsetof(struct ieee80211_tdma_param, tdma_tstamp), - &ni->ni_tstamp.data, 8); -#if 0 - DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, - "tsf %llu nextslot %llu (%d, %d) nextslottu %u nexttbtt %llu (%d)\n", - (unsigned long long) tsf, (unsigned long long) nextslot, - (int)(nextslot - tsf), tsfdelta, nextslottu, nexttbtt, tudelta); -#endif - /* - * Adjust the beacon timers only when pulling them forward - * or when going back by less than the beacon interval. - * Negative jumps larger than the beacon interval seem to - * cause the timers to stop and generally cause instability. - * This basically filters out jumps due to missed beacons. - */ - if (tudelta != 0 && (tudelta > 0 || -tudelta < sc->sc_tdmabintval)) { - ath_tdma_settimers(sc, nextslottu, sc->sc_tdmabintval); - sc->sc_stats.ast_tdma_timers++; - } - if (tsfdelta > 0) { - ath_hal_adjusttsf(ah, tsfdelta); - sc->sc_stats.ast_tdma_tsf++; - } - ath_tdma_beacon_send(sc, vap); /* prepare response */ -#undef TU_TO_TSF -#undef TSF_TO_TU -} - -/* - * Transmit a beacon frame at SWBA. Dynamic updates - * to the frame contents are done as needed. - */ -static void -ath_tdma_beacon_send(struct ath_softc *sc, struct ieee80211vap *vap) -{ - struct ath_hal *ah = sc->sc_ah; - struct ath_buf *bf; - int otherant; - - /* - * Check if the previous beacon has gone out. If - * not don't try to post another, skip this period - * and wait for the next. Missed beacons indicate - * a problem and should not occur. If we miss too - * many consecutive beacons reset the device. - */ - if (ath_hal_numtxpending(ah, sc->sc_bhalq) != 0) { - sc->sc_bmisscount++; - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: missed %u consecutive beacons\n", - __func__, sc->sc_bmisscount); - if (sc->sc_bmisscount >= ath_bstuck_threshold) - taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); - return; - } - if (sc->sc_bmisscount != 0) { - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: resume beacon xmit after %u misses\n", - __func__, sc->sc_bmisscount); - sc->sc_bmisscount = 0; - } - - /* - * Check recent per-antenna transmit statistics and flip - * the default antenna if noticeably more frames went out - * on the non-default antenna. - * XXX assumes 2 anntenae - */ - if (!sc->sc_diversity) { - otherant = sc->sc_defant & 1 ? 2 : 1; - if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] + 2) - ath_setdefantenna(sc, otherant); - sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0; - } - - bf = ath_beacon_generate(sc, vap); - if (bf != NULL) { - /* - * Stop any current dma and put the new frame on the queue. - * This should never fail since we check above that no frames - * are still pending on the queue. - */ - if (!ath_hal_stoptxdma(ah, sc->sc_bhalq)) { - DPRINTF(sc, ATH_DEBUG_ANY, - "%s: beacon queue %u did not stop?\n", - __func__, sc->sc_bhalq); - /* NB: the HAL still stops DMA, so proceed */ - } - ath_hal_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); - ath_hal_txstart(ah, sc->sc_bhalq); - - sc->sc_stats.ast_be_xmit++; /* XXX per-vap? */ - - /* - * Record local TSF for our last send for use - * in arbitrating slot collisions. - */ - /* XXX should take a locked ref to iv_bss */ - vap->iv_bss->ni_tstamp.tsf = ath_hal_gettsf64(ah); - } -} -#endif /* IEEE80211_SUPPORT_TDMA */ - static void ath_dfs_tasklet(void *p, int npending) { Added: head/sys/dev/ath/if_ath_beacon.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_beacon.h Sun May 20 02:49:42 2012 (r235679) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __IF_ATH_BEACON_H__ +#define __IF_ATH_BEACON_H__ + +extern int ath_bstuck_threshold; + +extern int ath_beaconq_config(struct ath_softc *sc); +extern void ath_beacon_config(struct ath_softc *sc, + struct ieee80211vap *vap); +extern struct ath_buf * ath_beacon_generate(struct ath_softc *sc, + struct ieee80211vap *vap); +extern int ath_wme_update(struct ieee80211com *ic); + +#endif Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Sun May 20 02:43:54 2012 (r235678) +++ head/sys/dev/ath/if_ath_misc.h Sun May 20 02:49:42 2012 (r235679) @@ -80,6 +80,4 @@ extern void ath_setdefantenna(struct ath */ extern void ath_start(struct ifnet *ifp); -extern void ath_beacon_config(struct ath_softc *sc, struct ieee80211vap *vap); - #endif Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun May 20 02:43:54 2012 (r235678) +++ head/sys/dev/ath/if_ath_rx.c Sun May 20 02:49:42 2012 (r235679) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef ATH_TX99_DIAG Added: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_tdma.c Sun May 20 02:49:42 2012 (r235679) @@ -0,0 +1,476 @@ +/*- + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for the Atheros Wireless LAN controller. + * + * This software is derived from work of Atsushi Onoe; his contribution + * is greatly appreciated. + */ + +#include "opt_inet.h" +#include "opt_ath.h" +/* + * This is needed for register operations which are performed + * by the driver - eg, calls to ath_hal_gettsf32(). + * + * It's also required for any AH_DEBUG checks in here, eg the + * module dependencies. + */ +#include "opt_ah.h" +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* for mp_ncpus */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#ifdef IEEE80211_SUPPORT_SUPERG +#include +#endif +#ifdef IEEE80211_SUPPORT_TDMA +#include +#endif + +#include + +#ifdef INET +#include +#include +#endif + +#include +#include /* XXX for softled */ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef ATH_TX99_DIAG +#include +#endif + +#ifdef IEEE80211_SUPPORT_TDMA +#include + +static void ath_tdma_settimers(struct ath_softc *sc, u_int32_t nexttbtt, + u_int32_t bintval); +static void ath_tdma_bintvalsetup(struct ath_softc *sc, + const struct ieee80211_tdma_state *tdma); +#endif /* IEEE80211_SUPPORT_TDMA */ + +#ifdef IEEE80211_SUPPORT_TDMA +static void +ath_tdma_settimers(struct ath_softc *sc, u_int32_t nexttbtt, u_int32_t bintval) +{ + struct ath_hal *ah = sc->sc_ah; + HAL_BEACON_TIMERS bt; + + bt.bt_intval = bintval | HAL_BEACON_ENA; + bt.bt_nexttbtt = nexttbtt; + bt.bt_nextdba = (nexttbtt<<3) - sc->sc_tdmadbaprep; + bt.bt_nextswba = (nexttbtt<<3) - sc->sc_tdmaswbaprep; + bt.bt_nextatim = nexttbtt+1; + /* Enables TBTT, DBA, SWBA timers by default */ + bt.bt_flags = 0; + ath_hal_beaconsettimers(ah, &bt); +} + +/* + * Calculate the beacon interval. This is periodic in the + * superframe for the bss. We assume each station is configured + * identically wrt transmit rate so the guard time we calculate + * above will be the same on all stations. Note we need to + * factor in the xmit time because the hardware will schedule + * a frame for transmit if the start of the frame is within + * the burst time. When we get hardware that properly kills + * frames in the PCU we can reduce/eliminate the guard time. + * + * Roundup to 1024 is so we have 1 TU buffer in the guard time + * to deal with the granularity of the nexttbtt timer. 11n MAC's + * with 1us timer granularity should allow us to reduce/eliminate + * this. + */ +static void +ath_tdma_bintvalsetup(struct ath_softc *sc, + const struct ieee80211_tdma_state *tdma) +{ + /* copy from vap state (XXX check all vaps have same value?) */ + sc->sc_tdmaslotlen = tdma->tdma_slotlen; + + sc->sc_tdmabintval = roundup((sc->sc_tdmaslotlen+sc->sc_tdmaguard) * + tdma->tdma_slotcnt, 1024); + sc->sc_tdmabintval >>= 10; /* TSF -> TU */ + if (sc->sc_tdmabintval & 1) + sc->sc_tdmabintval++; + + if (tdma->tdma_slot == 0) { + /* + * Only slot 0 beacons; other slots respond. + */ + sc->sc_imask |= HAL_INT_SWBA; + sc->sc_tdmaswba = 0; /* beacon immediately */ + } else { + /* XXX all vaps must be slot 0 or slot !0 */ + sc->sc_imask &= ~HAL_INT_SWBA; + } +} + +/* + * Max 802.11 overhead. This assumes no 4-address frames and + * the encapsulation done by ieee80211_encap (llc). We also + * include potential crypto overhead. + */ +#define IEEE80211_MAXOVERHEAD \ + (sizeof(struct ieee80211_qosframe) \ + + sizeof(struct llc) \ + + IEEE80211_ADDR_LEN \ + + IEEE80211_WEP_IVLEN \ + + IEEE80211_WEP_KIDLEN \ + + IEEE80211_WEP_CRCLEN \ + + IEEE80211_WEP_MICLEN \ + + IEEE80211_CRC_LEN) + +/* + * Setup initially for tdma operation. Start the beacon + * timers and enable SWBA if we are slot 0. Otherwise + * we wait for slot 0 to arrive so we can sync up before + * starting to transmit. + */ +void +ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap) +{ + struct ath_hal *ah = sc->sc_ah; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + const struct ieee80211_txparam *tp; + const struct ieee80211_tdma_state *tdma = NULL; + int rix; + + if (vap == NULL) { + vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */ + if (vap == NULL) { + if_printf(ifp, "%s: no vaps?\n", __func__); + return; + } + } + /* XXX should take a locked ref to iv_bss */ + tp = vap->iv_bss->ni_txparms; + /* + * Calculate the guard time for each slot. This is the + * time to send a maximal-size frame according to the + * fixed/lowest transmit rate. Note that the interface + * mtu does not include the 802.11 overhead so we must + * tack that on (ath_hal_computetxtime includes the + * preamble and plcp in it's calculation). + */ + tdma = vap->iv_tdma; + if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) + rix = ath_tx_findrix(sc, tp->ucastrate); + else + rix = ath_tx_findrix(sc, tp->mcastrate); + /* XXX short preamble assumed */ + sc->sc_tdmaguard = ath_hal_computetxtime(ah, sc->sc_currates, + ifp->if_mtu + IEEE80211_MAXOVERHEAD, rix, AH_TRUE); + + ath_hal_intrset(ah, 0); + + ath_beaconq_config(sc); /* setup h/w beacon q */ + if (sc->sc_setcca) + ath_hal_setcca(ah, AH_FALSE); /* disable CCA */ + ath_tdma_bintvalsetup(sc, tdma); /* calculate beacon interval */ + ath_tdma_settimers(sc, sc->sc_tdmabintval, + sc->sc_tdmabintval | HAL_BEACON_RESET_TSF); + sc->sc_syncbeacon = 0; + + sc->sc_avgtsfdeltap = TDMA_DUMMY_MARKER; + sc->sc_avgtsfdeltam = TDMA_DUMMY_MARKER; + + ath_hal_intrset(ah, sc->sc_imask); + + DPRINTF(sc, ATH_DEBUG_TDMA, "%s: slot %u len %uus cnt %u " + "bsched %u guard %uus bintval %u TU dba prep %u\n", __func__, + tdma->tdma_slot, tdma->tdma_slotlen, tdma->tdma_slotcnt, + tdma->tdma_bintval, sc->sc_tdmaguard, sc->sc_tdmabintval, + sc->sc_tdmadbaprep); +} + +/* + * Update tdma operation. Called from the 802.11 layer + * when a beacon is received from the TDMA station operating + * in the slot immediately preceding us in the bss. Use + * the rx timestamp for the beacon frame to update our + * beacon timers so we follow their schedule. Note that + * by using the rx timestamp we implicitly include the + * propagation delay in our schedule. + */ +void +ath_tdma_update(struct ieee80211_node *ni, + const struct ieee80211_tdma_param *tdma, int changed) +{ +#define TSF_TO_TU(_h,_l) \ + ((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) +#define TU_TO_TSF(_tu) (((u_int64_t)(_tu)) << 10) + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = ni->ni_ic; + struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_hal *ah = sc->sc_ah; + const HAL_RATE_TABLE *rt = sc->sc_currates; + u_int64_t tsf, rstamp, nextslot, nexttbtt; + u_int32_t txtime, nextslottu; + int32_t tudelta, tsfdelta; + const struct ath_rx_status *rs; + int rix; + + sc->sc_stats.ast_tdma_update++; + + /* + * Check for and adopt configuration changes. + */ + if (changed != 0) { + const struct ieee80211_tdma_state *ts = vap->iv_tdma; + + ath_tdma_bintvalsetup(sc, ts); + if (changed & TDMA_UPDATE_SLOTLEN) + ath_wme_update(ic); + + DPRINTF(sc, ATH_DEBUG_TDMA, + "%s: adopt slot %u slotcnt %u slotlen %u us " + "bintval %u TU\n", __func__, + ts->tdma_slot, ts->tdma_slotcnt, ts->tdma_slotlen, + sc->sc_tdmabintval); + + /* XXX right? */ + ath_hal_intrset(ah, sc->sc_imask); + /* NB: beacon timers programmed below */ + } + + /* extend rx timestamp to 64 bits */ + rs = sc->sc_lastrs; + tsf = ath_hal_gettsf64(ah); + rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf); + /* + * The rx timestamp is set by the hardware on completing + * reception (at the point where the rx descriptor is DMA'd + * to the host). To find the start of our next slot we + * must adjust this time by the time required to send + * the packet just received. + */ + rix = rt->rateCodeToIndex[rs->rs_rate]; + txtime = ath_hal_computetxtime(ah, rt, rs->rs_datalen, rix, + rt->info[rix].shortPreamble); + /* NB: << 9 is to cvt to TU and /2 */ + nextslot = (rstamp - txtime) + (sc->sc_tdmabintval << 9); + nextslottu = TSF_TO_TU(nextslot>>32, nextslot) & HAL_BEACON_PERIOD; + + /* + * Retrieve the hardware NextTBTT in usecs + * and calculate the difference between what the + * other station thinks and what we have programmed. This + * lets us figure how to adjust our timers to match. The + * adjustments are done by pulling the TSF forward and possibly + * rewriting the beacon timers. + */ + nexttbtt = ath_hal_getnexttbtt(ah); + tsfdelta = (int32_t)((nextslot % TU_TO_TSF(HAL_BEACON_PERIOD + 1)) - nexttbtt); + + DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, + "tsfdelta %d avg +%d/-%d\n", tsfdelta, + TDMA_AVG(sc->sc_avgtsfdeltap), TDMA_AVG(sc->sc_avgtsfdeltam)); + + if (tsfdelta < 0) { + TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); + TDMA_SAMPLE(sc->sc_avgtsfdeltam, -tsfdelta); + tsfdelta = -tsfdelta % 1024; + nextslottu++; + } else if (tsfdelta > 0) { + TDMA_SAMPLE(sc->sc_avgtsfdeltap, tsfdelta); + TDMA_SAMPLE(sc->sc_avgtsfdeltam, 0); + tsfdelta = 1024 - (tsfdelta % 1024); + nextslottu++; + } else { + TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); + TDMA_SAMPLE(sc->sc_avgtsfdeltam, 0); + } + tudelta = nextslottu - TSF_TO_TU(nexttbtt >> 32, nexttbtt); + + /* + * Copy sender's timetstamp into tdma ie so they can + * calculate roundtrip time. We submit a beacon frame + * below after any timer adjustment. The frame goes out + * at the next TBTT so the sender can calculate the + * roundtrip by inspecting the tdma ie in our beacon frame. + * + * NB: This tstamp is subtlely preserved when + * IEEE80211_BEACON_TDMA is marked (e.g. when the + * slot position changes) because ieee80211_add_tdma + * skips over the data. + */ + memcpy(ATH_VAP(vap)->av_boff.bo_tdma + + __offsetof(struct ieee80211_tdma_param, tdma_tstamp), + &ni->ni_tstamp.data, 8); +#if 0 + DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, + "tsf %llu nextslot %llu (%d, %d) nextslottu %u nexttbtt %llu (%d)\n", + (unsigned long long) tsf, (unsigned long long) nextslot, + (int)(nextslot - tsf), tsfdelta, nextslottu, nexttbtt, tudelta); +#endif + /* + * Adjust the beacon timers only when pulling them forward + * or when going back by less than the beacon interval. + * Negative jumps larger than the beacon interval seem to + * cause the timers to stop and generally cause instability. + * This basically filters out jumps due to missed beacons. + */ + if (tudelta != 0 && (tudelta > 0 || -tudelta < sc->sc_tdmabintval)) { + ath_tdma_settimers(sc, nextslottu, sc->sc_tdmabintval); + sc->sc_stats.ast_tdma_timers++; + } + if (tsfdelta > 0) { + ath_hal_adjusttsf(ah, tsfdelta); + sc->sc_stats.ast_tdma_tsf++; + } + ath_tdma_beacon_send(sc, vap); /* prepare response */ +#undef TU_TO_TSF +#undef TSF_TO_TU +} + +/* + * Transmit a beacon frame at SWBA. Dynamic updates + * to the frame contents are done as needed. + */ +void +ath_tdma_beacon_send(struct ath_softc *sc, struct ieee80211vap *vap) +{ + struct ath_hal *ah = sc->sc_ah; + struct ath_buf *bf; + int otherant; + + /* + * Check if the previous beacon has gone out. If + * not don't try to post another, skip this period + * and wait for the next. Missed beacons indicate + * a problem and should not occur. If we miss too + * many consecutive beacons reset the device. + */ + if (ath_hal_numtxpending(ah, sc->sc_bhalq) != 0) { + sc->sc_bmisscount++; + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: missed %u consecutive beacons\n", + __func__, sc->sc_bmisscount); + if (sc->sc_bmisscount >= ath_bstuck_threshold) + taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); + return; + } + if (sc->sc_bmisscount != 0) { + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: resume beacon xmit after %u misses\n", + __func__, sc->sc_bmisscount); + sc->sc_bmisscount = 0; + } + + /* + * Check recent per-antenna transmit statistics and flip + * the default antenna if noticeably more frames went out + * on the non-default antenna. + * XXX assumes 2 anntenae + */ + if (!sc->sc_diversity) { + otherant = sc->sc_defant & 1 ? 2 : 1; + if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] + 2) + ath_setdefantenna(sc, otherant); + sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0; + } + + bf = ath_beacon_generate(sc, vap); + if (bf != NULL) { + /* + * Stop any current dma and put the new frame on the queue. + * This should never fail since we check above that no frames + * are still pending on the queue. + */ + if (!ath_hal_stoptxdma(ah, sc->sc_bhalq)) { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: beacon queue %u did not stop?\n", + __func__, sc->sc_bhalq); + /* NB: the HAL still stops DMA, so proceed */ + } + ath_hal_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); + ath_hal_txstart(ah, sc->sc_bhalq); + + sc->sc_stats.ast_be_xmit++; /* XXX per-vap? */ + + /* + * Record local TSF for our last send for use + * in arbitrating slot collisions. + */ + /* XXX should take a locked ref to iv_bss */ + vap->iv_bss->ni_tstamp.tsf = ath_hal_gettsf64(ah); + } +} +#endif /* IEEE80211_SUPPORT_TDMA */ Added: head/sys/dev/ath/if_ath_tdma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_tdma.h Sun May 20 02:49:42 2012 (r235679) @@ -0,0 +1,55 @@ +/*- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun May 20 04:14:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A24401065673; Sun, 20 May 2012 04:14:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B2B68FC18; Sun, 20 May 2012 04:14:30 +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 q4K4EUD9065951; Sun, 20 May 2012 04:14:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K4EUHd065946; Sun, 20 May 2012 04:14:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205200414.q4K4EUHd065946@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 May 2012 04:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235680 - in head/sys: conf dev/ath modules/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 04:14:30 -0000 Author: adrian Date: Sun May 20 04:14:29 2012 New Revision: 235680 URL: http://svn.freebsd.org/changeset/base/235680 Log: Migrate most of the beacon handling functions out to if_ath_beacon.c. This is also in preparation for supporting AR9300 and later NICs. Added: head/sys/dev/ath/if_ath_beacon.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_beacon.h head/sys/dev/ath/if_ath_misc.h head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 20 02:49:42 2012 (r235679) +++ head/sys/conf/files Sun May 20 04:14:29 2012 (r235680) @@ -710,6 +710,8 @@ dev/ath/if_ath_ahb.c optional ath_ahb \ # dev/ath/if_ath.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_beacon.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_debug.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_keycache.c optional ath \ Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun May 20 02:49:42 2012 (r235679) +++ head/sys/dev/ath/if_ath.c Sun May 20 04:14:29 2012 (r235680) @@ -153,17 +153,9 @@ static void ath_key_update_begin(struct static void ath_key_update_end(struct ieee80211vap *); static void ath_update_mcast(struct ifnet *); static void ath_update_promisc(struct ifnet *); -static void ath_setslottime(struct ath_softc *); static void ath_updateslot(struct ifnet *); -static int ath_beaconq_setup(struct ath_hal *); -static int ath_beacon_alloc(struct ath_softc *, struct ieee80211_node *); -static void ath_beacon_update(struct ieee80211vap *, int item); -static void ath_beacon_setup(struct ath_softc *, struct ath_buf *); -static void ath_beacon_proc(void *, int); static void ath_bstuck_proc(void *, int); static void ath_reset_proc(void *, int); -static void ath_beacon_return(struct ath_softc *, struct ath_buf *); -static void ath_beacon_free(struct ath_softc *); static void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *, ath_bufhead *); static int ath_desc_alloc(struct ath_softc *); @@ -2541,7 +2533,7 @@ ath_mode_init(struct ath_softc *sc) /* * Set the slot time based on the current setting. */ -static void +void ath_setslottime(struct ath_softc *sc) { struct ieee80211com *ic = sc->sc_ifp->if_l2com; @@ -2594,248 +2586,10 @@ ath_updateslot(struct ifnet *ifp) } /* - * Setup a h/w transmit queue for beacons. - */ -static int -ath_beaconq_setup(struct ath_hal *ah) -{ - HAL_TXQ_INFO qi; - - memset(&qi, 0, sizeof(qi)); - qi.tqi_aifs = HAL_TXQ_USEDEFAULT; - qi.tqi_cwmin = HAL_TXQ_USEDEFAULT; - qi.tqi_cwmax = HAL_TXQ_USEDEFAULT; - /* NB: for dynamic turbo, don't enable any other interrupts */ - qi.tqi_qflags = HAL_TXQ_TXDESCINT_ENABLE; - return ath_hal_setuptxqueue(ah, HAL_TX_QUEUE_BEACON, &qi); -} - -/* - * Setup the transmit queue parameters for the beacon queue. - */ -int -ath_beaconq_config(struct ath_softc *sc) -{ -#define ATH_EXPONENT_TO_VALUE(v) ((1<<(v))-1) - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - struct ath_hal *ah = sc->sc_ah; - HAL_TXQ_INFO qi; - - ath_hal_gettxqueueprops(ah, sc->sc_bhalq, &qi); - if (ic->ic_opmode == IEEE80211_M_HOSTAP || - ic->ic_opmode == IEEE80211_M_MBSS) { - /* - * Always burst out beacon and CAB traffic. - */ - qi.tqi_aifs = ATH_BEACON_AIFS_DEFAULT; - qi.tqi_cwmin = ATH_BEACON_CWMIN_DEFAULT; - qi.tqi_cwmax = ATH_BEACON_CWMAX_DEFAULT; - } else { - struct wmeParams *wmep = - &ic->ic_wme.wme_chanParams.cap_wmeParams[WME_AC_BE]; - /* - * Adhoc mode; important thing is to use 2x cwmin. - */ - qi.tqi_aifs = wmep->wmep_aifsn; - qi.tqi_cwmin = 2*ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmin); - qi.tqi_cwmax = ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmax); - } - - if (!ath_hal_settxqueueprops(ah, sc->sc_bhalq, &qi)) { - device_printf(sc->sc_dev, "unable to update parameters for " - "beacon hardware queue!\n"); - return 0; - } else { - ath_hal_resettxqueue(ah, sc->sc_bhalq); /* push to h/w */ - return 1; - } -#undef ATH_EXPONENT_TO_VALUE -} - -/* - * Allocate and setup an initial beacon frame. - */ -static int -ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni) -{ - struct ieee80211vap *vap = ni->ni_vap; - struct ath_vap *avp = ATH_VAP(vap); - struct ath_buf *bf; - struct mbuf *m; - int error; - - bf = avp->av_bcbuf; - DPRINTF(sc, ATH_DEBUG_NODE, "%s: bf_m=%p, bf_node=%p\n", - __func__, bf->bf_m, bf->bf_node); - if (bf->bf_m != NULL) { - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - m_freem(bf->bf_m); - bf->bf_m = NULL; - } - if (bf->bf_node != NULL) { - ieee80211_free_node(bf->bf_node); - bf->bf_node = NULL; - } - - /* - * NB: the beacon data buffer must be 32-bit aligned; - * we assume the mbuf routines will return us something - * with this alignment (perhaps should assert). - */ - m = ieee80211_beacon_alloc(ni, &avp->av_boff); - if (m == NULL) { - device_printf(sc->sc_dev, "%s: cannot get mbuf\n", __func__); - sc->sc_stats.ast_be_nombuf++; - return ENOMEM; - } - error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m, - bf->bf_segs, &bf->bf_nseg, - BUS_DMA_NOWAIT); - if (error != 0) { - device_printf(sc->sc_dev, - "%s: cannot map mbuf, bus_dmamap_load_mbuf_sg returns %d\n", - __func__, error); - m_freem(m); - return error; - } - - /* - * Calculate a TSF adjustment factor required for staggered - * beacons. Note that we assume the format of the beacon - * frame leaves the tstamp field immediately following the - * header. - */ - if (sc->sc_stagbeacons && avp->av_bslot > 0) { - uint64_t tsfadjust; - struct ieee80211_frame *wh; - - /* - * The beacon interval is in TU's; the TSF is in usecs. - * We figure out how many TU's to add to align the timestamp - * then convert to TSF units and handle byte swapping before - * inserting it in the frame. The hardware will then add this - * each time a beacon frame is sent. Note that we align vap's - * 1..N and leave vap 0 untouched. This means vap 0 has a - * timestamp in one beacon interval while the others get a - * timstamp aligned to the next interval. - */ - tsfadjust = ni->ni_intval * - (ATH_BCBUF - avp->av_bslot) / ATH_BCBUF; - tsfadjust = htole64(tsfadjust << 10); /* TU -> TSF */ - - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: %s beacons bslot %d intval %u tsfadjust %llu\n", - __func__, sc->sc_stagbeacons ? "stagger" : "burst", - avp->av_bslot, ni->ni_intval, - (long long unsigned) le64toh(tsfadjust)); - - wh = mtod(m, struct ieee80211_frame *); - memcpy(&wh[1], &tsfadjust, sizeof(tsfadjust)); - } - bf->bf_m = m; - bf->bf_node = ieee80211_ref_node(ni); - - return 0; -} - -/* - * Setup the beacon frame for transmit. - */ -static void -ath_beacon_setup(struct ath_softc *sc, struct ath_buf *bf) -{ -#define USE_SHPREAMBLE(_ic) \ - (((_ic)->ic_flags & (IEEE80211_F_SHPREAMBLE | IEEE80211_F_USEBARKER))\ - == IEEE80211_F_SHPREAMBLE) - struct ieee80211_node *ni = bf->bf_node; - struct ieee80211com *ic = ni->ni_ic; - struct mbuf *m = bf->bf_m; - struct ath_hal *ah = sc->sc_ah; - struct ath_desc *ds; - int flags, antenna; - const HAL_RATE_TABLE *rt; - u_int8_t rix, rate; - - DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "%s: m %p len %u\n", - __func__, m, m->m_len); - - /* setup descriptors */ - ds = bf->bf_desc; - bf->bf_last = bf; - bf->bf_lastds = ds; - - flags = HAL_TXDESC_NOACK; - if (ic->ic_opmode == IEEE80211_M_IBSS && sc->sc_hasveol) { - ds->ds_link = bf->bf_daddr; /* self-linked */ - flags |= HAL_TXDESC_VEOL; - /* - * Let hardware handle antenna switching. - */ - antenna = sc->sc_txantenna; - } else { - ds->ds_link = 0; - /* - * Switch antenna every 4 beacons. - * XXX assumes two antenna - */ - if (sc->sc_txantenna != 0) - antenna = sc->sc_txantenna; - else if (sc->sc_stagbeacons && sc->sc_nbcnvaps != 0) - antenna = ((sc->sc_stats.ast_be_xmit / sc->sc_nbcnvaps) & 4 ? 2 : 1); - else - antenna = (sc->sc_stats.ast_be_xmit & 4 ? 2 : 1); - } - - KASSERT(bf->bf_nseg == 1, - ("multi-segment beacon frame; nseg %u", bf->bf_nseg)); - ds->ds_data = bf->bf_segs[0].ds_addr; - /* - * Calculate rate code. - * XXX everything at min xmit rate - */ - rix = 0; - rt = sc->sc_currates; - rate = rt->info[rix].rateCode; - if (USE_SHPREAMBLE(ic)) - rate |= rt->info[rix].shortPreamble; - ath_hal_setuptxdesc(ah, ds - , m->m_len + IEEE80211_CRC_LEN /* frame length */ - , sizeof(struct ieee80211_frame)/* header length */ - , HAL_PKT_TYPE_BEACON /* Atheros packet type */ - , ni->ni_txpower /* txpower XXX */ - , rate, 1 /* series 0 rate/tries */ - , HAL_TXKEYIX_INVALID /* no encryption */ - , antenna /* antenna mode */ - , flags /* no ack, veol for beacons */ - , 0 /* rts/cts rate */ - , 0 /* rts/cts duration */ - ); - /* NB: beacon's BufLen must be a multiple of 4 bytes */ - ath_hal_filltxdesc(ah, ds - , roundup(m->m_len, 4) /* buffer length */ - , AH_TRUE /* first segment */ - , AH_TRUE /* last segment */ - , ds /* first descriptor */ - ); -#if 0 - ath_desc_swap(ds); -#endif -#undef USE_SHPREAMBLE -} - -static void -ath_beacon_update(struct ieee80211vap *vap, int item) -{ - struct ieee80211_beacon_offsets *bo = &ATH_VAP(vap)->av_boff; - - setbit(bo->bo_flags, item); -} - -/* * Append the contents of src to dst; both queues * are assumed to be locked. */ -static void +void ath_txqmove(struct ath_txq *dst, struct ath_txq *src) { @@ -2852,255 +2606,6 @@ ath_txqmove(struct ath_txq *dst, struct } /* - * Transmit a beacon frame at SWBA. Dynamic updates to the - * frame contents are done as needed and the slot time is - * also adjusted based on current state. - */ -static void -ath_beacon_proc(void *arg, int pending) -{ - struct ath_softc *sc = arg; - struct ath_hal *ah = sc->sc_ah; - struct ieee80211vap *vap; - struct ath_buf *bf; - int slot, otherant; - uint32_t bfaddr; - - DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "%s: pending %u\n", - __func__, pending); - /* - * Check if the previous beacon has gone out. If - * not don't try to post another, skip this period - * and wait for the next. Missed beacons indicate - * a problem and should not occur. If we miss too - * many consecutive beacons reset the device. - */ - if (ath_hal_numtxpending(ah, sc->sc_bhalq) != 0) { - sc->sc_bmisscount++; - sc->sc_stats.ast_be_missed++; - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: missed %u consecutive beacons\n", - __func__, sc->sc_bmisscount); - if (sc->sc_bmisscount >= ath_bstuck_threshold) - taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); - return; - } - if (sc->sc_bmisscount != 0) { - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: resume beacon xmit after %u misses\n", - __func__, sc->sc_bmisscount); - sc->sc_bmisscount = 0; - } - - if (sc->sc_stagbeacons) { /* staggered beacons */ - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - uint32_t tsftu; - - tsftu = ath_hal_gettsf32(ah) >> 10; - /* XXX lintval */ - slot = ((tsftu % ic->ic_lintval) * ATH_BCBUF) / ic->ic_lintval; - vap = sc->sc_bslot[(slot+1) % ATH_BCBUF]; - bfaddr = 0; - if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) { - bf = ath_beacon_generate(sc, vap); - if (bf != NULL) - bfaddr = bf->bf_daddr; - } - } else { /* burst'd beacons */ - uint32_t *bflink = &bfaddr; - - for (slot = 0; slot < ATH_BCBUF; slot++) { - vap = sc->sc_bslot[slot]; - if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) { - bf = ath_beacon_generate(sc, vap); - if (bf != NULL) { - *bflink = bf->bf_daddr; - bflink = &bf->bf_desc->ds_link; - } - } - } - *bflink = 0; /* terminate list */ - } - - /* - * Handle slot time change when a non-ERP station joins/leaves - * an 11g network. The 802.11 layer notifies us via callback, - * we mark updateslot, then wait one beacon before effecting - * the change. This gives associated stations at least one - * beacon interval to note the state change. - */ - /* XXX locking */ - if (sc->sc_updateslot == UPDATE) { - sc->sc_updateslot = COMMIT; /* commit next beacon */ - sc->sc_slotupdate = slot; - } else if (sc->sc_updateslot == COMMIT && sc->sc_slotupdate == slot) - ath_setslottime(sc); /* commit change to h/w */ - - /* - * Check recent per-antenna transmit statistics and flip - * the default antenna if noticeably more frames went out - * on the non-default antenna. - * XXX assumes 2 anntenae - */ - if (!sc->sc_diversity && (!sc->sc_stagbeacons || slot == 0)) { - otherant = sc->sc_defant & 1 ? 2 : 1; - if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] + 2) - ath_setdefantenna(sc, otherant); - sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0; - } - - if (bfaddr != 0) { - /* - * Stop any current dma and put the new frame on the queue. - * This should never fail since we check above that no frames - * are still pending on the queue. - */ - if (!ath_hal_stoptxdma(ah, sc->sc_bhalq)) { - DPRINTF(sc, ATH_DEBUG_ANY, - "%s: beacon queue %u did not stop?\n", - __func__, sc->sc_bhalq); - } - /* NB: cabq traffic should already be queued and primed */ - ath_hal_puttxbuf(ah, sc->sc_bhalq, bfaddr); - ath_hal_txstart(ah, sc->sc_bhalq); - - sc->sc_stats.ast_be_xmit++; - } -} - -struct ath_buf * -ath_beacon_generate(struct ath_softc *sc, struct ieee80211vap *vap) -{ - struct ath_vap *avp = ATH_VAP(vap); - struct ath_txq *cabq = sc->sc_cabq; - struct ath_buf *bf; - struct mbuf *m; - int nmcastq, error; - - KASSERT(vap->iv_state >= IEEE80211_S_RUN, - ("not running, state %d", vap->iv_state)); - KASSERT(avp->av_bcbuf != NULL, ("no beacon buffer")); - - /* - * Update dynamic beacon contents. If this returns - * non-zero then we need to remap the memory because - * the beacon frame changed size (probably because - * of the TIM bitmap). - */ - bf = avp->av_bcbuf; - m = bf->bf_m; - /* XXX lock mcastq? */ - nmcastq = avp->av_mcastq.axq_depth; - - if (ieee80211_beacon_update(bf->bf_node, &avp->av_boff, m, nmcastq)) { - /* XXX too conservative? */ - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m, - bf->bf_segs, &bf->bf_nseg, - BUS_DMA_NOWAIT); - if (error != 0) { - if_printf(vap->iv_ifp, - "%s: bus_dmamap_load_mbuf_sg failed, error %u\n", - __func__, error); - return NULL; - } - } - if ((avp->av_boff.bo_tim[4] & 1) && cabq->axq_depth) { - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: cabq did not drain, mcastq %u cabq %u\n", - __func__, nmcastq, cabq->axq_depth); - sc->sc_stats.ast_cabq_busy++; - if (sc->sc_nvaps > 1 && sc->sc_stagbeacons) { - /* - * CABQ traffic from a previous vap is still pending. - * We must drain the q before this beacon frame goes - * out as otherwise this vap's stations will get cab - * frames from a different vap. - * XXX could be slow causing us to miss DBA - */ - ath_tx_draintxq(sc, cabq); - } - } - ath_beacon_setup(sc, bf); - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREWRITE); - - /* - * Enable the CAB queue before the beacon queue to - * insure cab frames are triggered by this beacon. - */ - if (avp->av_boff.bo_tim[4] & 1) { - struct ath_hal *ah = sc->sc_ah; - - /* NB: only at DTIM */ - ATH_TXQ_LOCK(cabq); - ATH_TXQ_LOCK(&avp->av_mcastq); - if (nmcastq) { - struct ath_buf *bfm; - - /* - * Move frames from the s/w mcast q to the h/w cab q. - * XXX MORE_DATA bit - */ - bfm = TAILQ_FIRST(&avp->av_mcastq.axq_q); - if (cabq->axq_link != NULL) { - *cabq->axq_link = bfm->bf_daddr; - } else - ath_hal_puttxbuf(ah, cabq->axq_qnum, - bfm->bf_daddr); - ath_txqmove(cabq, &avp->av_mcastq); - - sc->sc_stats.ast_cabq_xmit += nmcastq; - } - /* NB: gated by beacon so safe to start here */ - if (! TAILQ_EMPTY(&(cabq->axq_q))) - ath_hal_txstart(ah, cabq->axq_qnum); - ATH_TXQ_UNLOCK(&avp->av_mcastq); - ATH_TXQ_UNLOCK(cabq); - } - return bf; -} - -static void -ath_beacon_start_adhoc(struct ath_softc *sc, struct ieee80211vap *vap) -{ - struct ath_vap *avp = ATH_VAP(vap); - struct ath_hal *ah = sc->sc_ah; - struct ath_buf *bf; - struct mbuf *m; - int error; - - KASSERT(avp->av_bcbuf != NULL, ("no beacon buffer")); - - /* - * Update dynamic beacon contents. If this returns - * non-zero then we need to remap the memory because - * the beacon frame changed size (probably because - * of the TIM bitmap). - */ - bf = avp->av_bcbuf; - m = bf->bf_m; - if (ieee80211_beacon_update(bf->bf_node, &avp->av_boff, m, 0)) { - /* XXX too conservative? */ - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m, - bf->bf_segs, &bf->bf_nseg, - BUS_DMA_NOWAIT); - if (error != 0) { - if_printf(vap->iv_ifp, - "%s: bus_dmamap_load_mbuf_sg failed, error %u\n", - __func__, error); - return; - } - } - ath_beacon_setup(sc, bf); - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREWRITE); - - /* NB: caller is known to have already stopped tx dma */ - ath_hal_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); - ath_hal_txstart(ah, sc->sc_bhalq); -} - -/* * Reset the hardware, with no loss. * * This can't be used for a general case reset. @@ -3140,255 +2645,6 @@ ath_bstuck_proc(void *arg, int pending) ath_reset(ifp, ATH_RESET_NOLOSS); } -/* - * Reclaim beacon resources and return buffer to the pool. - */ -static void -ath_beacon_return(struct ath_softc *sc, struct ath_buf *bf) -{ - - DPRINTF(sc, ATH_DEBUG_NODE, "%s: free bf=%p, bf_m=%p, bf_node=%p\n", - __func__, bf, bf->bf_m, bf->bf_node); - if (bf->bf_m != NULL) { - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - m_freem(bf->bf_m); - bf->bf_m = NULL; - } - if (bf->bf_node != NULL) { - ieee80211_free_node(bf->bf_node); - bf->bf_node = NULL; - } - TAILQ_INSERT_TAIL(&sc->sc_bbuf, bf, bf_list); -} - -/* - * Reclaim beacon resources. - */ -static void -ath_beacon_free(struct ath_softc *sc) -{ - struct ath_buf *bf; - - TAILQ_FOREACH(bf, &sc->sc_bbuf, bf_list) { - DPRINTF(sc, ATH_DEBUG_NODE, - "%s: free bf=%p, bf_m=%p, bf_node=%p\n", - __func__, bf, bf->bf_m, bf->bf_node); - if (bf->bf_m != NULL) { - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - m_freem(bf->bf_m); - bf->bf_m = NULL; - } - if (bf->bf_node != NULL) { - ieee80211_free_node(bf->bf_node); - bf->bf_node = NULL; - } - } -} - -/* - * Configure the beacon and sleep timers. - * - * When operating as an AP this resets the TSF and sets - * up the hardware to notify us when we need to issue beacons. - * - * When operating in station mode this sets up the beacon - * timers according to the timestamp of the last received - * beacon and the current TSF, configures PCF and DTIM - * handling, programs the sleep registers so the hardware - * will wakeup in time to receive beacons, and configures - * the beacon miss handling so we'll receive a BMISS - * interrupt when we stop seeing beacons from the AP - * we've associated with. - */ -void -ath_beacon_config(struct ath_softc *sc, struct ieee80211vap *vap) -{ -#define TSF_TO_TU(_h,_l) \ - ((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) -#define FUDGE 2 - struct ath_hal *ah = sc->sc_ah; - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - struct ieee80211_node *ni; - u_int32_t nexttbtt, intval, tsftu; - u_int64_t tsf; - - if (vap == NULL) - vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */ - ni = ieee80211_ref_node(vap->iv_bss); - - /* extract tstamp from last beacon and convert to TU */ - nexttbtt = TSF_TO_TU(LE_READ_4(ni->ni_tstamp.data + 4), - LE_READ_4(ni->ni_tstamp.data)); - if (ic->ic_opmode == IEEE80211_M_HOSTAP || - ic->ic_opmode == IEEE80211_M_MBSS) { - /* - * For multi-bss ap/mesh support beacons are either staggered - * evenly over N slots or burst together. For the former - * arrange for the SWBA to be delivered for each slot. - * Slots that are not occupied will generate nothing. - */ - /* NB: the beacon interval is kept internally in TU's */ - intval = ni->ni_intval & HAL_BEACON_PERIOD; - if (sc->sc_stagbeacons) - intval /= ATH_BCBUF; - } else { - /* NB: the beacon interval is kept internally in TU's */ - intval = ni->ni_intval & HAL_BEACON_PERIOD; - } - if (nexttbtt == 0) /* e.g. for ap mode */ - nexttbtt = intval; - else if (intval) /* NB: can be 0 for monitor mode */ - nexttbtt = roundup(nexttbtt, intval); - DPRINTF(sc, ATH_DEBUG_BEACON, "%s: nexttbtt %u intval %u (%u)\n", - __func__, nexttbtt, intval, ni->ni_intval); - if (ic->ic_opmode == IEEE80211_M_STA && !sc->sc_swbmiss) { - HAL_BEACON_STATE bs; - int dtimperiod, dtimcount; - int cfpperiod, cfpcount; - - /* - * Setup dtim and cfp parameters according to - * last beacon we received (which may be none). - */ - dtimperiod = ni->ni_dtim_period; - if (dtimperiod <= 0) /* NB: 0 if not known */ - dtimperiod = 1; - dtimcount = ni->ni_dtim_count; - if (dtimcount >= dtimperiod) /* NB: sanity check */ - dtimcount = 0; /* XXX? */ - cfpperiod = 1; /* NB: no PCF support yet */ - cfpcount = 0; - /* - * Pull nexttbtt forward to reflect the current - * TSF and calculate dtim+cfp state for the result. - */ - tsf = ath_hal_gettsf64(ah); - tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE; - do { - nexttbtt += intval; - if (--dtimcount < 0) { - dtimcount = dtimperiod - 1; - if (--cfpcount < 0) - cfpcount = cfpperiod - 1; - } - } while (nexttbtt < tsftu); - memset(&bs, 0, sizeof(bs)); - bs.bs_intval = intval; - bs.bs_nexttbtt = nexttbtt; - bs.bs_dtimperiod = dtimperiod*intval; - bs.bs_nextdtim = bs.bs_nexttbtt + dtimcount*intval; - bs.bs_cfpperiod = cfpperiod*bs.bs_dtimperiod; - bs.bs_cfpnext = bs.bs_nextdtim + cfpcount*bs.bs_dtimperiod; - bs.bs_cfpmaxduration = 0; -#if 0 - /* - * The 802.11 layer records the offset to the DTIM - * bitmap while receiving beacons; use it here to - * enable h/w detection of our AID being marked in - * the bitmap vector (to indicate frames for us are - * pending at the AP). - * XXX do DTIM handling in s/w to WAR old h/w bugs - * XXX enable based on h/w rev for newer chips - */ - bs.bs_timoffset = ni->ni_timoff; -#endif - /* - * Calculate the number of consecutive beacons to miss - * before taking a BMISS interrupt. - * Note that we clamp the result to at most 10 beacons. - */ - bs.bs_bmissthreshold = vap->iv_bmissthreshold; - if (bs.bs_bmissthreshold > 10) - bs.bs_bmissthreshold = 10; - else if (bs.bs_bmissthreshold <= 0) - bs.bs_bmissthreshold = 1; - - /* - * Calculate sleep duration. The configuration is - * given in ms. We insure a multiple of the beacon - * period is used. Also, if the sleep duration is - * greater than the DTIM period then it makes senses - * to make it a multiple of that. - * - * XXX fixed at 100ms - */ - bs.bs_sleepduration = - roundup(IEEE80211_MS_TO_TU(100), bs.bs_intval); - if (bs.bs_sleepduration > bs.bs_dtimperiod) - bs.bs_sleepduration = roundup(bs.bs_sleepduration, bs.bs_dtimperiod); - - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: tsf %ju tsf:tu %u intval %u nexttbtt %u dtim %u nextdtim %u bmiss %u sleep %u cfp:period %u maxdur %u next %u timoffset %u\n" - , __func__ - , tsf, tsftu - , bs.bs_intval - , bs.bs_nexttbtt - , bs.bs_dtimperiod - , bs.bs_nextdtim - , bs.bs_bmissthreshold - , bs.bs_sleepduration - , bs.bs_cfpperiod - , bs.bs_cfpmaxduration - , bs.bs_cfpnext - , bs.bs_timoffset - ); - ath_hal_intrset(ah, 0); - ath_hal_beacontimers(ah, &bs); - sc->sc_imask |= HAL_INT_BMISS; - ath_hal_intrset(ah, sc->sc_imask); - } else { - ath_hal_intrset(ah, 0); - if (nexttbtt == intval) - intval |= HAL_BEACON_RESET_TSF; - if (ic->ic_opmode == IEEE80211_M_IBSS) { - /* - * In IBSS mode enable the beacon timers but only - * enable SWBA interrupts if we need to manually - * prepare beacon frames. Otherwise we use a - * self-linked tx descriptor and let the hardware - * deal with things. - */ - intval |= HAL_BEACON_ENA; - if (!sc->sc_hasveol) - sc->sc_imask |= HAL_INT_SWBA; - if ((intval & HAL_BEACON_RESET_TSF) == 0) { - /* - * Pull nexttbtt forward to reflect - * the current TSF. - */ - tsf = ath_hal_gettsf64(ah); - tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE; - do { - nexttbtt += intval; - } while (nexttbtt < tsftu); - } - ath_beaconq_config(sc); - } else if (ic->ic_opmode == IEEE80211_M_HOSTAP || - ic->ic_opmode == IEEE80211_M_MBSS) { - /* - * In AP/mesh mode we enable the beacon timers - * and SWBA interrupts to prepare beacon frames. - */ - intval |= HAL_BEACON_ENA; - sc->sc_imask |= HAL_INT_SWBA; /* beacon prepare */ - ath_beaconq_config(sc); - } - ath_hal_beaconinit(ah, nexttbtt, intval); - sc->sc_bmisscount = 0; - ath_hal_intrset(ah, sc->sc_imask); - /* - * When using a self-linked beacon descriptor in - * ibss mode load it once here. - */ - if (ic->ic_opmode == IEEE80211_M_IBSS && sc->sc_hasveol) - ath_beacon_start_adhoc(sc, vap); - } - sc->sc_syncbeacon = 0; - ieee80211_free_node(ni); -#undef FUDGE -#undef TSF_TO_TU -} - static void ath_load_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { Added: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_beacon.c Sun May 20 04:14:29 2012 (r235680) @@ -0,0 +1,841 @@ +/*- + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for the Atheros Wireless LAN controller. + * + * This software is derived from work of Atsushi Onoe; his contribution + * is greatly appreciated. + */ + +#include "opt_inet.h" +#include "opt_ath.h" +/* + * This is needed for register operations which are performed + * by the driver - eg, calls to ath_hal_gettsf32(). + * + * It's also required for any AH_DEBUG checks in here, eg the + * module dependencies. + */ +#include "opt_ah.h" +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* for mp_ncpus */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#ifdef IEEE80211_SUPPORT_SUPERG +#include +#endif + +#include + +#ifdef INET +#include +#include +#endif + +#include + +#include +#include +#include +#include + +#ifdef ATH_TX99_DIAG +#include +#endif + +/* + * Setup a h/w transmit queue for beacons. + */ +int +ath_beaconq_setup(struct ath_hal *ah) +{ + HAL_TXQ_INFO qi; + + memset(&qi, 0, sizeof(qi)); + qi.tqi_aifs = HAL_TXQ_USEDEFAULT; + qi.tqi_cwmin = HAL_TXQ_USEDEFAULT; + qi.tqi_cwmax = HAL_TXQ_USEDEFAULT; + /* NB: for dynamic turbo, don't enable any other interrupts */ + qi.tqi_qflags = HAL_TXQ_TXDESCINT_ENABLE; + return ath_hal_setuptxqueue(ah, HAL_TX_QUEUE_BEACON, &qi); +} + +/* + * Setup the transmit queue parameters for the beacon queue. + */ +int +ath_beaconq_config(struct ath_softc *sc) +{ +#define ATH_EXPONENT_TO_VALUE(v) ((1<<(v))-1) + struct ieee80211com *ic = sc->sc_ifp->if_l2com; + struct ath_hal *ah = sc->sc_ah; + HAL_TXQ_INFO qi; + + ath_hal_gettxqueueprops(ah, sc->sc_bhalq, &qi); + if (ic->ic_opmode == IEEE80211_M_HOSTAP || + ic->ic_opmode == IEEE80211_M_MBSS) { + /* + * Always burst out beacon and CAB traffic. + */ + qi.tqi_aifs = ATH_BEACON_AIFS_DEFAULT; + qi.tqi_cwmin = ATH_BEACON_CWMIN_DEFAULT; + qi.tqi_cwmax = ATH_BEACON_CWMAX_DEFAULT; + } else { + struct wmeParams *wmep = + &ic->ic_wme.wme_chanParams.cap_wmeParams[WME_AC_BE]; + /* + * Adhoc mode; important thing is to use 2x cwmin. + */ + qi.tqi_aifs = wmep->wmep_aifsn; + qi.tqi_cwmin = 2*ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmin); + qi.tqi_cwmax = ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmax); + } + + if (!ath_hal_settxqueueprops(ah, sc->sc_bhalq, &qi)) { + device_printf(sc->sc_dev, "unable to update parameters for " + "beacon hardware queue!\n"); + return 0; + } else { + ath_hal_resettxqueue(ah, sc->sc_bhalq); /* push to h/w */ + return 1; + } +#undef ATH_EXPONENT_TO_VALUE +} + +/* + * Allocate and setup an initial beacon frame. + */ +int +ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct ath_vap *avp = ATH_VAP(vap); + struct ath_buf *bf; + struct mbuf *m; + int error; + + bf = avp->av_bcbuf; + DPRINTF(sc, ATH_DEBUG_NODE, "%s: bf_m=%p, bf_node=%p\n", + __func__, bf->bf_m, bf->bf_node); + if (bf->bf_m != NULL) { + bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); + m_freem(bf->bf_m); + bf->bf_m = NULL; + } + if (bf->bf_node != NULL) { + ieee80211_free_node(bf->bf_node); + bf->bf_node = NULL; + } + + /* + * NB: the beacon data buffer must be 32-bit aligned; + * we assume the mbuf routines will return us something + * with this alignment (perhaps should assert). + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun May 20 05:12:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE25A106564A; Sun, 20 May 2012 05:12:33 +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 49D528FC16; Sun, 20 May 2012 05:12: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 q4K5CVrt068499; Sun, 20 May 2012 05:12:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K5CV2h068497; Sun, 20 May 2012 05:12:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205200512.q4K5CV2h068497@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 May 2012 05:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235681 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 05:12:34 -0000 Author: marius Date: Sun May 20 05:12:31 2012 New Revision: 235681 URL: http://svn.freebsd.org/changeset/base/235681 Log: Rewrite nd6_sysctl_{d,p}rlist() to avoid misaligned accesses to char arrays casted to structs by getting rid of these buffers entirely. In r169832, it was tried to paper over this issue by 32-bit aligning the buffers. Depending on compiler optimizations that still was insufficient for 64-bit architectures with strong alignment requirements though. While at it, add comments regarding the total lack of locking in this area. Tested by: bz Reviewed by: bz (slightly earlier version), yongari (earlier version) MFC after: 1 week Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun May 20 04:14:29 2012 (r235680) +++ head/sys/netinet6/nd6.c Sun May 20 05:12:31 2012 (r235681) @@ -2262,128 +2262,101 @@ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6 static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) { - int error; - char buf[1024] __aligned(4); - struct in6_defrouter *d, *de; + struct in6_defrouter d; struct nd_defrouter *dr; + int error; if (req->newptr) - return EPERM; - error = 0; + return (EPERM); + bzero(&d, sizeof(d)); + d.rtaddr.sin6_family = AF_INET6; + d.rtaddr.sin6_len = sizeof(d.rtaddr); + + /* + * XXX locking + */ TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { - d = (struct in6_defrouter *)buf; - de = (struct in6_defrouter *)(buf + sizeof(buf)); - - if (d + 1 <= de) { - bzero(d, sizeof(*d)); - d->rtaddr.sin6_family = AF_INET6; - d->rtaddr.sin6_len = sizeof(d->rtaddr); - d->rtaddr.sin6_addr = dr->rtaddr; - error = sa6_recoverscope(&d->rtaddr); - if (error != 0) - return (error); - d->flags = dr->flags; - d->rtlifetime = dr->rtlifetime; - d->expire = dr->expire; - d->if_index = dr->ifp->if_index; - } else - panic("buffer too short"); - - error = SYSCTL_OUT(req, buf, sizeof(*d)); - if (error) - break; + d.rtaddr.sin6_addr = dr->rtaddr; + error = sa6_recoverscope(&d.rtaddr); + if (error != 0) + return (error); + d.flags = dr->flags; + d.rtlifetime = dr->rtlifetime; + d.expire = dr->expire; + d.if_index = dr->ifp->if_index; + error = SYSCTL_OUT(req, &d, sizeof(d)); + if (error != 0) + return (error); } - - return (error); + return (0); } static int nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) { - int error; - char buf[1024] __aligned(4); - struct in6_prefix *p, *pe; + struct in6_prefix p; + struct sockaddr_in6 s6; struct nd_prefix *pr; + struct nd_pfxrouter *pfr; + time_t maxexpire; + int error; char ip6buf[INET6_ADDRSTRLEN]; if (req->newptr) - return EPERM; - error = 0; + return (EPERM); + bzero(&p, sizeof(p)); + p.origin = PR_ORIG_RA; + bzero(&s6, sizeof(s6)); + s6.sin6_family = AF_INET6; + s6.sin6_len = sizeof(s6); + + /* + * XXX locking + */ LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { - u_short advrtrs; - size_t advance; - struct sockaddr_in6 *sin6, *s6; - struct nd_pfxrouter *pfr; - - p = (struct in6_prefix *)buf; - pe = (struct in6_prefix *)(buf + sizeof(buf)); - - if (p + 1 <= pe) { - bzero(p, sizeof(*p)); - sin6 = (struct sockaddr_in6 *)(p + 1); - - p->prefix = pr->ndpr_prefix; - if (sa6_recoverscope(&p->prefix)) { + p.prefix = pr->ndpr_prefix; + if (sa6_recoverscope(&p.prefix)) { + log(LOG_ERR, "scope error in prefix list (%s)\n", + ip6_sprintf(ip6buf, &p.prefix.sin6_addr)); + /* XXX: press on... */ + } + p.raflags = pr->ndpr_raf; + p.prefixlen = pr->ndpr_plen; + p.vltime = pr->ndpr_vltime; + p.pltime = pr->ndpr_pltime; + p.if_index = pr->ndpr_ifp->if_index; + if (pr->ndpr_vltime == ND6_INFINITE_LIFETIME) + p.expire = 0; + else { + /* XXX: we assume time_t is signed. */ + maxexpire = (-1) & + ~((time_t)1 << ((sizeof(maxexpire) * 8) - 1)); + if (pr->ndpr_vltime < maxexpire - pr->ndpr_lastupdate) + p.expire = pr->ndpr_lastupdate + + pr->ndpr_vltime; + else + p.expire = maxexpire; + } + p.refcnt = pr->ndpr_refcnt; + p.flags = pr->ndpr_stateflags; + p.advrtrs = 0; + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) + p.advrtrs++; + error = SYSCTL_OUT(req, &p, sizeof(p)); + if (error != 0) + return (error); + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { + s6.sin6_addr = pfr->router->rtaddr; + if (sa6_recoverscope(&s6)) log(LOG_ERR, "scope error in prefix list (%s)\n", - ip6_sprintf(ip6buf, &p->prefix.sin6_addr)); - /* XXX: press on... */ - } - p->raflags = pr->ndpr_raf; - p->prefixlen = pr->ndpr_plen; - p->vltime = pr->ndpr_vltime; - p->pltime = pr->ndpr_pltime; - p->if_index = pr->ndpr_ifp->if_index; - if (pr->ndpr_vltime == ND6_INFINITE_LIFETIME) - p->expire = 0; - else { - time_t maxexpire; - - /* XXX: we assume time_t is signed. */ - maxexpire = (-1) & - ~((time_t)1 << - ((sizeof(maxexpire) * 8) - 1)); - if (pr->ndpr_vltime < - maxexpire - pr->ndpr_lastupdate) { - p->expire = pr->ndpr_lastupdate + - pr->ndpr_vltime; - } else - p->expire = maxexpire; - } - p->refcnt = pr->ndpr_refcnt; - p->flags = pr->ndpr_stateflags; - p->origin = PR_ORIG_RA; - advrtrs = 0; - LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { - if ((void *)&sin6[advrtrs + 1] > (void *)pe) { - advrtrs++; - continue; - } - s6 = &sin6[advrtrs]; - bzero(s6, sizeof(*s6)); - s6->sin6_family = AF_INET6; - s6->sin6_len = sizeof(*sin6); - s6->sin6_addr = pfr->router->rtaddr; - if (sa6_recoverscope(s6)) { - log(LOG_ERR, - "scope error in " - "prefix list (%s)\n", - ip6_sprintf(ip6buf, - &pfr->router->rtaddr)); - } - advrtrs++; - } - p->advrtrs = advrtrs; - } else - panic("buffer too short"); - - advance = sizeof(*p) + sizeof(*sin6) * advrtrs; - error = SYSCTL_OUT(req, buf, advance); - if (error) - break; + ip6_sprintf(ip6buf, &pfr->router->rtaddr)); + error = SYSCTL_OUT(req, &s6, sizeof(s6)); + if (error != 0) + return (error); + } } - - return (error); + return (0); } From owner-svn-src-all@FreeBSD.ORG Sun May 20 06:35:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E6A5106566B; Sun, 20 May 2012 06:35:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7755F8FC14; Sun, 20 May 2012 06:35:23 +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 q4K6ZNet071930; Sun, 20 May 2012 06:35:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K6ZNIZ071928; Sun, 20 May 2012 06:35:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205200635.q4K6ZNIZ071928@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 May 2012 06:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235682 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 06:35:23 -0000 Author: adrian Date: Sun May 20 06:35:22 2012 New Revision: 235682 URL: http://svn.freebsd.org/changeset/base/235682 Log: Migrate the per-frame code out from ath_rx_proc() to ath_rx_pkt(). This will (eventually) be used by the EDMA RX path used by the AR93xx and later NICs. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun May 20 05:12:31 2012 (r235681) +++ head/sys/dev/ath/if_ath_rx.c Sun May 20 06:35:22 2012 (r235682) @@ -437,6 +437,327 @@ ath_rx_tasklet(void *arg, int npending) ath_rx_proc(sc, 1); } +static int +ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs, HAL_STATUS status, + uint64_t tsf, int nf, struct ath_buf *bf) +{ + struct ath_hal *ah = sc->sc_ah; + struct mbuf *m = bf->bf_m; + uint64_t rstamp; + int len, type; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211_node *ni; + int is_good = 0; + + /* + * Calculate the correct 64 bit TSF given + * the TSF64 register value and rs_tstamp. + */ + rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf); + + /* These aren't specifically errors */ +#ifdef AH_SUPPORT_AR5416 + if (rs->rs_flags & HAL_RX_GI) + sc->sc_stats.ast_rx_halfgi++; + if (rs->rs_flags & HAL_RX_2040) + sc->sc_stats.ast_rx_2040++; + if (rs->rs_flags & HAL_RX_DELIM_CRC_PRE) + sc->sc_stats.ast_rx_pre_crc_err++; + if (rs->rs_flags & HAL_RX_DELIM_CRC_POST) + sc->sc_stats.ast_rx_post_crc_err++; + if (rs->rs_flags & HAL_RX_DECRYPT_BUSY) + sc->sc_stats.ast_rx_decrypt_busy_err++; + if (rs->rs_flags & HAL_RX_HI_RX_CHAIN) + sc->sc_stats.ast_rx_hi_rx_chain++; +#endif /* AH_SUPPORT_AR5416 */ + + if (rs->rs_status != 0) { + if (rs->rs_status & HAL_RXERR_CRC) + sc->sc_stats.ast_rx_crcerr++; + if (rs->rs_status & HAL_RXERR_FIFO) + sc->sc_stats.ast_rx_fifoerr++; + if (rs->rs_status & HAL_RXERR_PHY) { + sc->sc_stats.ast_rx_phyerr++; + /* Process DFS radar events */ + if ((rs->rs_phyerr == HAL_PHYERR_RADAR) || + (rs->rs_phyerr == HAL_PHYERR_FALSE_RADAR_EXT)) { + /* Since we're touching the frame data, sync it */ + bus_dmamap_sync(sc->sc_dmat, + bf->bf_dmamap, + BUS_DMASYNC_POSTREAD); + /* Now pass it to the radar processing code */ + ath_dfs_process_phy_err(sc, mtod(m, char *), rstamp, rs); + } + + /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ + if (rs->rs_phyerr < 64) + sc->sc_stats.ast_rx_phy[rs->rs_phyerr]++; + goto rx_error; /* NB: don't count in ierrors */ + } + if (rs->rs_status & HAL_RXERR_DECRYPT) { + /* + * Decrypt error. If the error occurred + * because there was no hardware key, then + * let the frame through so the upper layers + * can process it. This is necessary for 5210 + * parts which have no way to setup a ``clear'' + * key cache entry. + * + * XXX do key cache faulting + */ + if (rs->rs_keyix == HAL_RXKEYIX_INVALID) + goto rx_accept; + sc->sc_stats.ast_rx_badcrypt++; + } + if (rs->rs_status & HAL_RXERR_MIC) { + sc->sc_stats.ast_rx_badmic++; + /* + * Do minimal work required to hand off + * the 802.11 header for notification. + */ + /* XXX frag's and qos frames */ + len = rs->rs_datalen; + if (len >= sizeof (struct ieee80211_frame)) { + bus_dmamap_sync(sc->sc_dmat, + bf->bf_dmamap, + BUS_DMASYNC_POSTREAD); + ath_handle_micerror(ic, + mtod(m, struct ieee80211_frame *), + sc->sc_splitmic ? + rs->rs_keyix-32 : rs->rs_keyix); + } + } + ifp->if_ierrors++; +rx_error: + /* + * Cleanup any pending partial frame. + */ + if (sc->sc_rxpending != NULL) { + m_freem(sc->sc_rxpending); + sc->sc_rxpending = NULL; + } + /* + * When a tap is present pass error frames + * that have been requested. By default we + * pass decrypt+mic errors but others may be + * interesting (e.g. crc). + */ + if (ieee80211_radiotap_active(ic) && + (rs->rs_status & sc->sc_monpass)) { + bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, + BUS_DMASYNC_POSTREAD); + /* NB: bpf needs the mbuf length setup */ + len = rs->rs_datalen; + m->m_pkthdr.len = m->m_len = len; + bf->bf_m = NULL; + ath_rx_tap(ifp, m, rs, rstamp, nf); + ieee80211_radiotap_rx_all(ic, m); + m_freem(m); + } + /* XXX pass MIC errors up for s/w reclaculation */ + goto rx_next; + } +rx_accept: + /* + * Sync and unmap the frame. At this point we're + * committed to passing the mbuf somewhere so clear + * bf_m; this means a new mbuf must be allocated + * when the rx descriptor is setup again to receive + * another frame. + */ + bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); + bf->bf_m = NULL; + + len = rs->rs_datalen; + m->m_len = len; + + if (rs->rs_more) { + /* + * Frame spans multiple descriptors; save + * it for the next completed descriptor, it + * will be used to construct a jumbogram. + */ + if (sc->sc_rxpending != NULL) { + /* NB: max frame size is currently 2 clusters */ + sc->sc_stats.ast_rx_toobig++; + m_freem(sc->sc_rxpending); + } + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.len = len; + sc->sc_rxpending = m; + goto rx_next; + } else if (sc->sc_rxpending != NULL) { + /* + * This is the second part of a jumbogram, + * chain it to the first mbuf, adjust the + * frame length, and clear the rxpending state. + */ + sc->sc_rxpending->m_next = m; + sc->sc_rxpending->m_pkthdr.len += len; + m = sc->sc_rxpending; + sc->sc_rxpending = NULL; + } else { + /* + * Normal single-descriptor receive; setup + * the rcvif and packet length. + */ + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.len = len; + } + + /* + * Validate rs->rs_antenna. + * + * Some users w/ AR9285 NICs have reported crashes + * here because rs_antenna field is bogusly large. + * Let's enforce the maximum antenna limit of 8 + * (and it shouldn't be hard coded, but that's a + * separate problem) and if there's an issue, print + * out an error and adjust rs_antenna to something + * sensible. + * + * This code should be removed once the actual + * root cause of the issue has been identified. + * For example, it may be that the rs_antenna + * field is only valid for the lsat frame of + * an aggregate and it just happens that it is + * "mostly" right. (This is a general statement - + * the majority of the statistics are only valid + * for the last frame in an aggregate. + */ + if (rs->rs_antenna > 7) { + device_printf(sc->sc_dev, "%s: rs_antenna > 7 (%d)\n", + __func__, rs->rs_antenna); +#ifdef ATH_DEBUG + ath_printrxbuf(sc, bf, 0, status == HAL_OK); +#endif /* ATH_DEBUG */ + rs->rs_antenna = 0; /* XXX better than nothing */ + } + + ifp->if_ipackets++; + sc->sc_stats.ast_ant_rx[rs->rs_antenna]++; + + /* + * Populate the rx status block. When there are bpf + * listeners we do the additional work to provide + * complete status. Otherwise we fill in only the + * material required by ieee80211_input. Note that + * noise setting is filled in above. + */ + if (ieee80211_radiotap_active(ic)) + ath_rx_tap(ifp, m, rs, rstamp, nf); + + /* + * From this point on we assume the frame is at least + * as large as ieee80211_frame_min; verify that. + */ + if (len < IEEE80211_MIN_LEN) { + if (!ieee80211_radiotap_active(ic)) { + DPRINTF(sc, ATH_DEBUG_RECV, + "%s: short packet %d\n", __func__, len); + sc->sc_stats.ast_rx_tooshort++; + } else { + /* NB: in particular this captures ack's */ + ieee80211_radiotap_rx_all(ic, m); + } + m_freem(m); + goto rx_next; + } + + if (IFF_DUMPPKTS(sc, ATH_DEBUG_RECV)) { + const HAL_RATE_TABLE *rt = sc->sc_currates; + uint8_t rix = rt->rateCodeToIndex[rs->rs_rate]; + + ieee80211_dump_pkt(ic, mtod(m, caddr_t), len, + sc->sc_hwmap[rix].ieeerate, rs->rs_rssi); + } + + m_adj(m, -IEEE80211_CRC_LEN); + + /* + * Locate the node for sender, track state, and then + * pass the (referenced) node up to the 802.11 layer + * for its use. + */ + ni = ieee80211_find_rxnode_withkey(ic, + mtod(m, const struct ieee80211_frame_min *), + rs->rs_keyix == HAL_RXKEYIX_INVALID ? + IEEE80211_KEYIX_NONE : rs->rs_keyix); + sc->sc_lastrs = rs; + +#ifdef AH_SUPPORT_AR5416 + if (rs->rs_isaggr) + sc->sc_stats.ast_rx_agg++; +#endif /* AH_SUPPORT_AR5416 */ + + if (ni != NULL) { + /* + * Only punt packets for ampdu reorder processing for + * 11n nodes; net80211 enforces that M_AMPDU is only + * set for 11n nodes. + */ + if (ni->ni_flags & IEEE80211_NODE_HT) + m->m_flags |= M_AMPDU; + + /* + * Sending station is known, dispatch directly. + */ + type = ieee80211_input(ni, m, rs->rs_rssi, nf); + ieee80211_free_node(ni); + /* + * Arrange to update the last rx timestamp only for + * frames from our ap when operating in station mode. + * This assumes the rx key is always setup when + * associated. + */ + if (ic->ic_opmode == IEEE80211_M_STA && + rs->rs_keyix != HAL_RXKEYIX_INVALID) + is_good = 1; + } else { + type = ieee80211_input_all(ic, m, rs->rs_rssi, nf); + } + /* + * Track rx rssi and do any rx antenna management. + */ + ATH_RSSI_LPF(sc->sc_halstats.ns_avgrssi, rs->rs_rssi); + if (sc->sc_diversity) { + /* + * When using fast diversity, change the default rx + * antenna if diversity chooses the other antenna 3 + * times in a row. + */ + if (sc->sc_defant != rs->rs_antenna) { + if (++sc->sc_rxotherant >= 3) + ath_setdefantenna(sc, rs->rs_antenna); + } else + sc->sc_rxotherant = 0; + } + + /* Newer school diversity - kite specific for now */ + /* XXX perhaps migrate the normal diversity code to this? */ + if ((ah)->ah_rxAntCombDiversity) + (*(ah)->ah_rxAntCombDiversity)(ah, rs, ticks, hz); + + if (sc->sc_softled) { + /* + * Blink for any data frame. Otherwise do a + * heartbeat-style blink when idle. The latter + * is mainly for station mode where we depend on + * periodic beacon frames to trigger the poll event. + */ + if (type == IEEE80211_FC0_TYPE_DATA) { + const HAL_RATE_TABLE *rt = sc->sc_currates; + ath_led_event(sc, + rt->rateCodeToIndex[rs->rs_rate]); + } else if (ticks - sc->sc_ledevent >= sc->sc_ledidle) + ath_led_event(sc, 0); + } +rx_next: + return (is_good); +} + void ath_rx_proc(struct ath_softc *sc, int resched) { @@ -450,11 +771,10 @@ ath_rx_proc(struct ath_softc *sc, int re struct ath_desc *ds; struct ath_rx_status *rs; struct mbuf *m; - struct ieee80211_node *ni; - int len, type, ngood; + int ngood; HAL_STATUS status; int16_t nf; - u_int64_t tsf, rstamp; + u_int64_t tsf; int npkts = 0; /* XXX we must not hold the ATH_LOCK here */ @@ -492,7 +812,7 @@ ath_rx_proc(struct ath_softc *sc, int re /* XXX make debug msg */ if_printf(ifp, "%s: no mbuf!\n", __func__); TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); - goto rx_next; + goto rx_proc_next; } ds = bf->bf_desc; if (ds->ds_link == bf->bf_daddr) { @@ -526,311 +846,11 @@ ath_rx_proc(struct ath_softc *sc, int re npkts++; /* - * Calculate the correct 64 bit TSF given - * the TSF64 register value and rs_tstamp. + * Process a single frame. */ - rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf); - - /* These aren't specifically errors */ -#ifdef AH_SUPPORT_AR5416 - if (rs->rs_flags & HAL_RX_GI) - sc->sc_stats.ast_rx_halfgi++; - if (rs->rs_flags & HAL_RX_2040) - sc->sc_stats.ast_rx_2040++; - if (rs->rs_flags & HAL_RX_DELIM_CRC_PRE) - sc->sc_stats.ast_rx_pre_crc_err++; - if (rs->rs_flags & HAL_RX_DELIM_CRC_POST) - sc->sc_stats.ast_rx_post_crc_err++; - if (rs->rs_flags & HAL_RX_DECRYPT_BUSY) - sc->sc_stats.ast_rx_decrypt_busy_err++; - if (rs->rs_flags & HAL_RX_HI_RX_CHAIN) - sc->sc_stats.ast_rx_hi_rx_chain++; -#endif /* AH_SUPPORT_AR5416 */ - - if (rs->rs_status != 0) { - if (rs->rs_status & HAL_RXERR_CRC) - sc->sc_stats.ast_rx_crcerr++; - if (rs->rs_status & HAL_RXERR_FIFO) - sc->sc_stats.ast_rx_fifoerr++; - if (rs->rs_status & HAL_RXERR_PHY) { - sc->sc_stats.ast_rx_phyerr++; - /* Process DFS radar events */ - if ((rs->rs_phyerr == HAL_PHYERR_RADAR) || - (rs->rs_phyerr == HAL_PHYERR_FALSE_RADAR_EXT)) { - /* Since we're touching the frame data, sync it */ - bus_dmamap_sync(sc->sc_dmat, - bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - /* Now pass it to the radar processing code */ - ath_dfs_process_phy_err(sc, mtod(m, char *), rstamp, rs); - } - - /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ - if (rs->rs_phyerr < 64) - sc->sc_stats.ast_rx_phy[rs->rs_phyerr]++; - goto rx_error; /* NB: don't count in ierrors */ - } - if (rs->rs_status & HAL_RXERR_DECRYPT) { - /* - * Decrypt error. If the error occurred - * because there was no hardware key, then - * let the frame through so the upper layers - * can process it. This is necessary for 5210 - * parts which have no way to setup a ``clear'' - * key cache entry. - * - * XXX do key cache faulting - */ - if (rs->rs_keyix == HAL_RXKEYIX_INVALID) - goto rx_accept; - sc->sc_stats.ast_rx_badcrypt++; - } - if (rs->rs_status & HAL_RXERR_MIC) { - sc->sc_stats.ast_rx_badmic++; - /* - * Do minimal work required to hand off - * the 802.11 header for notification. - */ - /* XXX frag's and qos frames */ - len = rs->rs_datalen; - if (len >= sizeof (struct ieee80211_frame)) { - bus_dmamap_sync(sc->sc_dmat, - bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - ath_handle_micerror(ic, - mtod(m, struct ieee80211_frame *), - sc->sc_splitmic ? - rs->rs_keyix-32 : rs->rs_keyix); - } - } - ifp->if_ierrors++; -rx_error: - /* - * Cleanup any pending partial frame. - */ - if (sc->sc_rxpending != NULL) { - m_freem(sc->sc_rxpending); - sc->sc_rxpending = NULL; - } - /* - * When a tap is present pass error frames - * that have been requested. By default we - * pass decrypt+mic errors but others may be - * interesting (e.g. crc). - */ - if (ieee80211_radiotap_active(ic) && - (rs->rs_status & sc->sc_monpass)) { - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - /* NB: bpf needs the mbuf length setup */ - len = rs->rs_datalen; - m->m_pkthdr.len = m->m_len = len; - bf->bf_m = NULL; - ath_rx_tap(ifp, m, rs, rstamp, nf); - ieee80211_radiotap_rx_all(ic, m); - m_freem(m); - } - /* XXX pass MIC errors up for s/w reclaculation */ - goto rx_next; - } -rx_accept: - /* - * Sync and unmap the frame. At this point we're - * committed to passing the mbuf somewhere so clear - * bf_m; this means a new mbuf must be allocated - * when the rx descriptor is setup again to receive - * another frame. - */ - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - bf->bf_m = NULL; - - len = rs->rs_datalen; - m->m_len = len; - - if (rs->rs_more) { - /* - * Frame spans multiple descriptors; save - * it for the next completed descriptor, it - * will be used to construct a jumbogram. - */ - if (sc->sc_rxpending != NULL) { - /* NB: max frame size is currently 2 clusters */ - sc->sc_stats.ast_rx_toobig++; - m_freem(sc->sc_rxpending); - } - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - sc->sc_rxpending = m; - goto rx_next; - } else if (sc->sc_rxpending != NULL) { - /* - * This is the second part of a jumbogram, - * chain it to the first mbuf, adjust the - * frame length, and clear the rxpending state. - */ - sc->sc_rxpending->m_next = m; - sc->sc_rxpending->m_pkthdr.len += len; - m = sc->sc_rxpending; - sc->sc_rxpending = NULL; - } else { - /* - * Normal single-descriptor receive; setup - * the rcvif and packet length. - */ - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - } - - /* - * Validate rs->rs_antenna. - * - * Some users w/ AR9285 NICs have reported crashes - * here because rs_antenna field is bogusly large. - * Let's enforce the maximum antenna limit of 8 - * (and it shouldn't be hard coded, but that's a - * separate problem) and if there's an issue, print - * out an error and adjust rs_antenna to something - * sensible. - * - * This code should be removed once the actual - * root cause of the issue has been identified. - * For example, it may be that the rs_antenna - * field is only valid for the lsat frame of - * an aggregate and it just happens that it is - * "mostly" right. (This is a general statement - - * the majority of the statistics are only valid - * for the last frame in an aggregate. - */ - if (rs->rs_antenna > 7) { - device_printf(sc->sc_dev, "%s: rs_antenna > 7 (%d)\n", - __func__, rs->rs_antenna); -#ifdef ATH_DEBUG - ath_printrxbuf(sc, bf, 0, status == HAL_OK); -#endif /* ATH_DEBUG */ - rs->rs_antenna = 0; /* XXX better than nothing */ - } - - ifp->if_ipackets++; - sc->sc_stats.ast_ant_rx[rs->rs_antenna]++; - - /* - * Populate the rx status block. When there are bpf - * listeners we do the additional work to provide - * complete status. Otherwise we fill in only the - * material required by ieee80211_input. Note that - * noise setting is filled in above. - */ - if (ieee80211_radiotap_active(ic)) - ath_rx_tap(ifp, m, rs, rstamp, nf); - - /* - * From this point on we assume the frame is at least - * as large as ieee80211_frame_min; verify that. - */ - if (len < IEEE80211_MIN_LEN) { - if (!ieee80211_radiotap_active(ic)) { - DPRINTF(sc, ATH_DEBUG_RECV, - "%s: short packet %d\n", __func__, len); - sc->sc_stats.ast_rx_tooshort++; - } else { - /* NB: in particular this captures ack's */ - ieee80211_radiotap_rx_all(ic, m); - } - m_freem(m); - goto rx_next; - } - - if (IFF_DUMPPKTS(sc, ATH_DEBUG_RECV)) { - const HAL_RATE_TABLE *rt = sc->sc_currates; - uint8_t rix = rt->rateCodeToIndex[rs->rs_rate]; - - ieee80211_dump_pkt(ic, mtod(m, caddr_t), len, - sc->sc_hwmap[rix].ieeerate, rs->rs_rssi); - } - - m_adj(m, -IEEE80211_CRC_LEN); - - /* - * Locate the node for sender, track state, and then - * pass the (referenced) node up to the 802.11 layer - * for its use. - */ - ni = ieee80211_find_rxnode_withkey(ic, - mtod(m, const struct ieee80211_frame_min *), - rs->rs_keyix == HAL_RXKEYIX_INVALID ? - IEEE80211_KEYIX_NONE : rs->rs_keyix); - sc->sc_lastrs = rs; - -#ifdef AH_SUPPORT_AR5416 - if (rs->rs_isaggr) - sc->sc_stats.ast_rx_agg++; -#endif /* AH_SUPPORT_AR5416 */ - - if (ni != NULL) { - /* - * Only punt packets for ampdu reorder processing for - * 11n nodes; net80211 enforces that M_AMPDU is only - * set for 11n nodes. - */ - if (ni->ni_flags & IEEE80211_NODE_HT) - m->m_flags |= M_AMPDU; - - /* - * Sending station is known, dispatch directly. - */ - type = ieee80211_input(ni, m, rs->rs_rssi, nf); - ieee80211_free_node(ni); - /* - * Arrange to update the last rx timestamp only for - * frames from our ap when operating in station mode. - * This assumes the rx key is always setup when - * associated. - */ - if (ic->ic_opmode == IEEE80211_M_STA && - rs->rs_keyix != HAL_RXKEYIX_INVALID) - ngood++; - } else { - type = ieee80211_input_all(ic, m, rs->rs_rssi, nf); - } - /* - * Track rx rssi and do any rx antenna management. - */ - ATH_RSSI_LPF(sc->sc_halstats.ns_avgrssi, rs->rs_rssi); - if (sc->sc_diversity) { - /* - * When using fast diversity, change the default rx - * antenna if diversity chooses the other antenna 3 - * times in a row. - */ - if (sc->sc_defant != rs->rs_antenna) { - if (++sc->sc_rxotherant >= 3) - ath_setdefantenna(sc, rs->rs_antenna); - } else - sc->sc_rxotherant = 0; - } - - /* Newer school diversity - kite specific for now */ - /* XXX perhaps migrate the normal diversity code to this? */ - if ((ah)->ah_rxAntCombDiversity) - (*(ah)->ah_rxAntCombDiversity)(ah, rs, ticks, hz); - - if (sc->sc_softled) { - /* - * Blink for any data frame. Otherwise do a - * heartbeat-style blink when idle. The latter - * is mainly for station mode where we depend on - * periodic beacon frames to trigger the poll event. - */ - if (type == IEEE80211_FC0_TYPE_DATA) { - const HAL_RATE_TABLE *rt = sc->sc_currates; - ath_led_event(sc, - rt->rateCodeToIndex[rs->rs_rate]); - } else if (ticks - sc->sc_ledevent >= sc->sc_ledidle) - ath_led_event(sc, 0); - } -rx_next: + if (ath_rx_pkt(sc, rs, status, tsf, nf, bf)) + ngood++; +rx_proc_next: TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); } while (ath_rxbuf_init(sc, bf) == 0); From owner-svn-src-all@FreeBSD.ORG Sun May 20 08:17:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A1956106567B; Sun, 20 May 2012 08:17:21 +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 8B80F8FC17; Sun, 20 May 2012 08:17: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 q4K8HLOp076392; Sun, 20 May 2012 08:17:21 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K8HLAu076389; Sun, 20 May 2012 08:17:21 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201205200817.q4K8HLAu076389@svn.freebsd.org> From: Mitsuru IWASAKI Date: Sun, 20 May 2012 08:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235683 - in head/sys/i386: i386 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 08:17:21 -0000 Author: iwasaki Date: Sun May 20 08:17:20 2012 New Revision: 235683 URL: http://svn.freebsd.org/changeset/base/235683 Log: Remove cpususpend IDT vector for XEN. This broke XEN kernel building. Modified: head/sys/i386/i386/apic_vector.s head/sys/i386/include/smp.h Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Sun May 20 06:35:22 2012 (r235682) +++ head/sys/i386/i386/apic_vector.s Sun May 20 08:17:20 2012 (r235683) @@ -336,6 +336,7 @@ IDTVEC(cpustop) /* * Executed by a CPU when it receives an IPI_SUSPEND from another CPU. */ +#ifndef XEN .text SUPERALIGN_TEXT IDTVEC(cpususpend) @@ -350,6 +351,7 @@ IDTVEC(cpususpend) POP_FRAME jmp doreti_iret +#endif /* * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Sun May 20 06:35:22 2012 (r235682) +++ head/sys/i386/include/smp.h Sun May 20 08:17:20 2012 (r235683) @@ -60,7 +60,9 @@ inthand_t /* functions in mp_machdep.c */ void cpu_add(u_int apic_id, char boot_cpu); void cpustop_handler(void); +#ifndef XEN void cpususpend_handler(void); +#endif void init_secondary(void); void ipi_all_but_self(u_int ipi); #ifndef XEN From owner-svn-src-all@FreeBSD.ORG Sun May 20 09:29:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76CA81065672; Sun, 20 May 2012 09:29:15 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 617D08FC12; Sun, 20 May 2012 09:29: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 q4K9TFUn079630; Sun, 20 May 2012 09:29:15 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K9TEss079628; Sun, 20 May 2012 09:29:14 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205200929.q4K9TEss079628@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 20 May 2012 09:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235684 - head/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 09:29:15 -0000 Author: bschmidt Date: Sun May 20 09:29:14 2012 New Revision: 235684 URL: http://svn.freebsd.org/changeset/base/235684 Log: Add some more 100/130 series device IDs. MFC after: 3 days Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 20 08:17:20 2012 (r235683) +++ head/sys/dev/iwn/if_iwn.c Sun May 20 09:29:14 2012 (r235684) @@ -92,6 +92,9 @@ static const struct iwn_ident iwn_ident_ { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" }, + { 0x8086, 0x0887, "Intel Centrino Wireless-N 130" }, + { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" }, + { 0x8086, 0x08af, "Intel Centrino Wireless-N 100" }, { 0x8086, 0x4229, "Intel Wireless WiFi Link 4965" }, { 0x8086, 0x422b, "Intel Centrino Ultimate-N 6300" }, { 0x8086, 0x422c, "Intel Centrino Advanced-N 6200" }, From owner-svn-src-all@FreeBSD.ORG Sun May 20 09:46:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D49E106566C; Sun, 20 May 2012 09:46:50 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76DAE8FC08; Sun, 20 May 2012 09:46: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 q4K9knxE080442; Sun, 20 May 2012 09:46:49 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K9kmxS080440; Sun, 20 May 2012 09:46:49 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205200946.q4K9kmxS080440@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 20 May 2012 09:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235685 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 09:46:50 -0000 Author: bschmidt Date: Sun May 20 09:46:48 2012 New Revision: 235685 URL: http://svn.freebsd.org/changeset/base/235685 Log: Remove unused variable. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun May 20 09:29:14 2012 (r235684) +++ head/sys/dev/ath/if_ath_rx.c Sun May 20 09:46:48 2012 (r235685) @@ -766,7 +766,6 @@ ath_rx_proc(struct ath_softc *sc, int re ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) struct ath_buf *bf; struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; struct ath_desc *ds; struct ath_rx_status *rs; From owner-svn-src-all@FreeBSD.ORG Sun May 20 10:00:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07F281065672; Sun, 20 May 2012 10:00:37 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E73508FC15; Sun, 20 May 2012 10:00: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 q4KA0a1m081123; Sun, 20 May 2012 10:00:36 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KA0aCg081121; Sun, 20 May 2012 10:00:36 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205201000.q4KA0aCg081121@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 20 May 2012 10:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235686 - head/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 10:00:37 -0000 Author: bschmidt Date: Sun May 20 10:00:36 2012 New Revision: 235686 URL: http://svn.freebsd.org/changeset/base/235686 Log: Discard frames after a DELBA which where queued during an active BA session. MFC after: 1 week Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 20 09:46:48 2012 (r235685) +++ head/sys/dev/iwn/if_iwn.c Sun May 20 10:00:36 2012 (r235686) @@ -3314,6 +3314,11 @@ iwn_tx_data(struct iwn_softc *sc, struct if (m->m_flags & M_AMPDU_MPDU) { struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac]; + if (!IEEE80211_AMPDU_RUNNING(tap)) { + m_freem(m); + return EINVAL; + } + ac = *(int *)tap->txa_private; *(uint16_t *)wh->i_seq = htole16(ni->ni_txseqs[tid] << IEEE80211_SEQ_SEQ_SHIFT); From owner-svn-src-all@FreeBSD.ORG Sun May 20 10:02:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DABB6106566B; Sun, 20 May 2012 10:02:24 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C45BC8FC23; Sun, 20 May 2012 10:02:24 +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 q4KA2Oe9081241; Sun, 20 May 2012 10:02:24 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KA2OgE081239; Sun, 20 May 2012 10:02:24 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205201002.q4KA2OgE081239@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 20 May 2012 10:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235687 - head/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 10:02:25 -0000 Author: bschmidt Date: Sun May 20 10:02:24 2012 New Revision: 235687 URL: http://svn.freebsd.org/changeset/base/235687 Log: remove unused vap variable MFC after: 1 week Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 20 10:00:36 2012 (r235686) +++ head/sys/dev/iwn/if_iwn.c Sun May 20 10:02:24 2012 (r235687) @@ -2767,7 +2767,6 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, struct mbuf *m; struct iwn_node *wn; struct ieee80211_node *ni; - struct ieee80211vap *vap; struct ieee80211_tx_ampdu *tap; uint64_t bitmap; uint32_t *status = stat; @@ -2826,7 +2825,6 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, bus_dmamap_unload(ring->data_dmat, data->map); m = data->m, data->m = NULL; ni = data->ni, data->ni = NULL; - vap = ni->ni_vap; if (m->m_flags & M_TXCB) ieee80211_process_callback(ni, m, 1); From owner-svn-src-all@FreeBSD.ORG Sun May 20 11:10:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D2401065674; Sun, 20 May 2012 11:10:11 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E3A318FC0A; Sun, 20 May 2012 11:10:05 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 1C3FE436; Sun, 20 May 2012 13:09:58 +0200 (CEST) Date: Sun, 20 May 2012 13:08:15 +0200 From: Pawel Jakub Dawidek To: Andriy Gapon Message-ID: <20120520110815.GB1442@garage.freebsd.pl> References: <201205151707.q4FH7UDU096834@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H1spWtNR+x+ondvy" Content-Disposition: inline In-Reply-To: <201205151707.q4FH7UDU096834@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235478 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 11:10:11 -0000 --H1spWtNR+x+ondvy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 15, 2012 at 05:07:30PM +0000, Andriy Gapon wrote: > Author: avg > Date: Tue May 15 17:07:29 2012 > New Revision: 235478 > URL: http://svn.freebsd.org/changeset/base/235478 >=20 > Log: > zpool_do_import: use /dev instead of /dev/dsk as a default > =20 > This affects behavior of zpool import without -d option. How does it affect 'zpool import' behaviour? On FreeBSD when -d is not given we should not scan entire /dev/, but take all available GEOM providers from the GEOM. > Reported by: Bruce Cran > Submitted by: Fabian Keil > MFC after: 2 weeks >=20 > Modified: > head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c >=20 > Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue May 15 16:17= :30 2012 (r235477) > +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue May 15 17:07= :29 2012 (r235478) > @@ -1909,7 +1909,7 @@ zpool_do_import(int argc, char **argv) > =20 > if (searchdirs =3D=3D NULL) { > searchdirs =3D safe_malloc(sizeof (char *)); > - searchdirs[0] =3D "/dev/dsk"; > + searchdirs[0] =3D "/dev"; > nsearch =3D 1; > } > =20 --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --H1spWtNR+x+ondvy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+40J8ACgkQForvXbEpPzSXTACcC0daM1NfstkhhgBZ/vgysnCR msIAnRvbehJca4LAwyzQ7b3Zh+K1xdZZ =4l9w -----END PGP SIGNATURE----- --H1spWtNR+x+ondvy-- From owner-svn-src-all@FreeBSD.ORG Sun May 20 12:00:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9352910656D1; Sun, 20 May 2012 12:00:31 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.18.13]) by mx1.freebsd.org (Postfix) with ESMTP id 2CE508FC08; Sun, 20 May 2012 12:00:18 +0000 (UTC) Received: from [78.35.187.152] (helo=fabiankeil.de) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1SW4ny-0007Lf-Vl; Sun, 20 May 2012 14:00:11 +0200 Date: Sun, 20 May 2012 13:59:16 +0200 From: Fabian Keil To: Pawel Jakub Dawidek Message-ID: <20120520135916.4e27fa39@fabiankeil.de> In-Reply-To: <20120520110815.GB1442@garage.freebsd.pl> References: <201205151707.q4FH7UDU096834@svn.freebsd.org> <20120520110815.GB1442@garage.freebsd.pl> Followup-To: freebsd-current@freebsd.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/7U6OFtAH/bDq6.I2I1Qo0XS"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 Cc: svn-src-all@freebsd.org, freebsd-current@freebsd.org, Andriy Gapon Subject: Re: svn commit: r235478 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 12:00:31 -0000 --Sig_/7U6OFtAH/bDq6.I2I1Qo0XS Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Pawel Jakub Dawidek wrote: > On Tue, May 15, 2012 at 05:07:30PM +0000, Andriy Gapon wrote: > > Author: avg > > Date: Tue May 15 17:07:29 2012 > > New Revision: 235478 > > URL: http://svn.freebsd.org/changeset/base/235478 > >=20 > > Log: > > zpool_do_import: use /dev instead of /dev/dsk as a default > > =20 > > This affects behavior of zpool import without -d option. >=20 > How does it affect 'zpool import' behaviour? On FreeBSD when -d is not > given we should not scan entire /dev/, but take all available GEOM > providers from the GEOM. The problem was discussed in this thread: http://lists.freebsd.org/pipermail/freebsd-current/2012-May/033805.html (so I set Followup-To: freebsd-current@) Under some condition zpool import seems to do an lstat() on the searchdirs[0] default and bail out if it's unsuccessful. Here's a truss excerpt from such a failure: open("/dev/zfs",O_RDWR,030730440) =3D 3 (0x3) open("/dev/zero",O_RDONLY,0666) =3D 4 (0x4) open("/etc/zfs/exports",O_RDONLY,0666) =3D 5 (0x5) geteuid() =3D 0 (0x0) lstat("/dev",{ mode=3Ddr-xr-xr-x ,inode=3D2,size=3D512,blksize=3D4096 }) = =3D 0 (0x0) lstat("/dev/dsk",0x7fffffff83c0) ERR#2 'No such file or dir= ectory' cannot open '/dev/dsk': must be an absolute path write(2,"cannot open '/dev/dsk': must be "...,49) =3D 49 (0x31) close(3) =3D 0 (0x0) Currently (different kernel and world) I get: open("/dev/zfs",O_RDWR,030730440) =3D 3 (0x3) open("/dev/zero",O_RDONLY,0666) =3D 4 (0x4) open("/etc/zfs/exports",O_RDONLY,0666) =3D 5 (0x5) __sysctl(0x7fffffff7d60,0x2,0x7fffffff7da0,0x7fffffff7e08,0x801495259,0x13)= =3D 0 (0x0) __sysctl(0x7fffffff7da0,0x4,0x8016a3f80,0x7fffffff7e50,0x0,0x0) =3D 0 (0x0) ioctl(3,0xd5985a04 { IORW 0x5a('Z'), 4, 5528 },0xffff7e70) =3D 0 (0x0) ioctl(3,0xd5985a05 { IORW 0x5a('Z'), 5, 5528 },0xffff7e30) =3D 0 (0x0) ioctl(3,0xd5985a05 { IORW 0x5a('Z'), 5, 5528 },0xffff7e30) =3D 0 (0x0) lstat("/dev",{ mode=3Ddr-xr-xr-x ,inode=3D2,size=3D512,blksize=3D4096 }) = =3D 0 (0x0) open("/dev/",O_RDONLY,037777710000) =3D 6 (0x6) which seems to imply that zpool didn't use the searchdirs[0] default at all, so a version before r235478 probably would have worked as well. Fabian --Sig_/7U6OFtAH/bDq6.I2I1Qo0XS Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+43JgACgkQBYqIVf93VJ2/tgCgnm7bPi1vSiwsKcHoxjqbEZ3M 9gcAmgIdawoYOdbkGISWGJRYF4mXcVRA =8Vqz -----END PGP SIGNATURE----- --Sig_/7U6OFtAH/bDq6.I2I1Qo0XS-- From owner-svn-src-all@FreeBSD.ORG Sun May 20 14:15:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7B4A106566C; Sun, 20 May 2012 14:15:13 +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 918798FC08; Sun, 20 May 2012 14:15: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 q4KEFDYc096364; Sun, 20 May 2012 14:15:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KEFDp8096362; Sun, 20 May 2012 14:15:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205201415.q4KEFDp8096362@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 20 May 2012 14:15: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: r235688 - stable/9/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 14:15:13 -0000 Author: kib Date: Sun May 20 14:15:13 2012 New Revision: 235688 URL: http://svn.freebsd.org/changeset/base/235688 Log: MFC r235538: Fix typo. MFC r235555: Use singular form for a modifier. Modified: stable/9/sys/amd64/amd64/fpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Sun May 20 10:02:24 2012 (r235687) +++ stable/9/sys/amd64/amd64/fpu.c Sun May 20 14:15:13 2012 (r235688) @@ -141,7 +141,7 @@ CTASSERT(sizeof(struct savefpu_ymm) == 8 /* * This requirement is to make it easier for asm code to calculate * offset of the fpu save area from the pcb address. FPU save area - * must by 64-bytes aligned. + * must be 64-byte aligned. */ CTASSERT(sizeof(struct pcb) % XSAVE_AREA_ALIGN == 0); From owner-svn-src-all@FreeBSD.ORG Sun May 20 14:33:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2D3C106564A; Sun, 20 May 2012 14:33:29 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82C018FC15; Sun, 20 May 2012 14:33: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 q4KEXTK6097301; Sun, 20 May 2012 14:33:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KEXTsi097295; Sun, 20 May 2012 14:33:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201205201433.q4KEXTsi097295@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 May 2012 14:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235689 - in head/sys: powerpc/aim powerpc/include powerpc/powerpc vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 14:33:29 -0000 Author: nwhitehorn Date: Sun May 20 14:33:28 2012 New Revision: 235689 URL: http://svn.freebsd.org/changeset/base/235689 Log: Replace the list of PVOs owned by each PMAP with an RB tree. This simplifies range operations like pmap_remove() and pmap_protect() as well as allowing simple operations like pmap_extract() not to involve any global state. This substantially reduces lock coverages for the global table lock and improves concurrency. Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/vm/vm_page.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sun May 20 14:15:13 2012 (r235688) +++ head/sys/powerpc/aim/mmu_oea.c Sun May 20 14:33:28 2012 (r235689) @@ -857,7 +857,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k for (i = 0; i < 16; i++) kernel_pmap->pm_sr[i] = EMPTY_SEGMENT + i; CPU_FILL(&kernel_pmap->pm_active); - LIST_INIT(&kernel_pmap->pmap_pvo); + RB_INIT(&kernel_pmap->pmap_pvo); /* * Set up the Open Firmware mappings @@ -1587,7 +1587,7 @@ moea_pinit(mmu_t mmu, pmap_t pmap) KASSERT((int)pmap < VM_MIN_KERNEL_ADDRESS, ("moea_pinit: virt pmap")); PMAP_LOCK_INIT(pmap); - LIST_INIT(&pmap->pmap_pvo); + RB_INIT(&pmap->pmap_pvo); entropy = 0; __asm __volatile("mftb %0" : "=r"(entropy)); @@ -1661,9 +1661,8 @@ void moea_protect(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { - struct pvo_entry *pvo; + struct pvo_entry *pvo, *tpvo, key; struct pte *pt; - int pteidx; KASSERT(pm == &curproc->p_vmspace->vm_pmap || pm == kernel_pmap, ("moea_protect: non current pmap")); @@ -1675,11 +1674,10 @@ moea_protect(mmu_t mmu, pmap_t pm, vm_of vm_page_lock_queues(); PMAP_LOCK(pm); - for (; sva < eva; sva += PAGE_SIZE) { - pvo = moea_pvo_find_va(pm, sva, &pteidx); - if (pvo == NULL) - continue; - + key.pvo_vaddr = sva; + for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); + pvo != NULL && PVO_VADDR(pvo) < eva; pvo = tpvo) { + tpvo = RB_NEXT(pvo_tree, &pm->pmap_pvo, pvo); if ((prot & VM_PROT_EXECUTE) == 0) pvo->pvo_vaddr &= ~PVO_EXECUTABLE; @@ -1687,7 +1685,7 @@ moea_protect(mmu_t mmu, pmap_t pm, vm_of * Grab the PTE pointer before we diddle with the cached PTE * copy. */ - pt = moea_pvo_to_pte(pvo, pteidx); + pt = moea_pvo_to_pte(pvo, -1); /* * Change the protection of the page. */ @@ -1766,23 +1764,15 @@ moea_release(mmu_t mmu, pmap_t pmap) void moea_remove(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva) { - struct pvo_entry *pvo, *tpvo; - int pteidx; + struct pvo_entry *pvo, *tpvo, key; vm_page_lock_queues(); PMAP_LOCK(pm); - if ((eva - sva)/PAGE_SIZE < 10) { - for (; sva < eva; sva += PAGE_SIZE) { - pvo = moea_pvo_find_va(pm, sva, &pteidx); - if (pvo != NULL) - moea_pvo_remove(pvo, pteidx); - } - } else { - LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) { - if (PVO_VADDR(pvo) < sva || PVO_VADDR(pvo) >= eva) - continue; - moea_pvo_remove(pvo, -1); - } + key.pvo_vaddr = sva; + for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); + pvo != NULL && PVO_VADDR(pvo) < eva; pvo = tpvo) { + tpvo = RB_NEXT(pvo_tree, &pm->pmap_pvo, pvo); + moea_pvo_remove(pvo, -1); } PMAP_UNLOCK(pm); vm_page_unlock_queues(); @@ -1946,7 +1936,7 @@ moea_pvo_enter(pmap_t pm, uma_zone_t zon /* * Add to pmap list */ - LIST_INSERT_HEAD(&pm->pmap_pvo, pvo, pvo_plink); + RB_INSERT(pvo_tree, &pm->pmap_pvo, pvo); /* * Remember if the list was empty and therefore will be the first @@ -2017,7 +2007,7 @@ moea_pvo_remove(struct pvo_entry *pvo, i * Remove this PVO from the PV and pmap lists. */ LIST_REMOVE(pvo, pvo_vlink); - LIST_REMOVE(pvo, pvo_plink); + RB_REMOVE(pvo_tree, &pvo->pvo_pmap->pmap_pvo, pvo); /* * Remove this from the overflow list and return it to the pool Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sun May 20 14:15:13 2012 (r235688) +++ head/sys/powerpc/aim/mmu_oea64.c Sun May 20 14:33:28 2012 (r235689) @@ -223,8 +223,6 @@ u_int moea64_pteg_mask; * PVO data. */ struct pvo_head *moea64_pvo_table; /* pvo entries by pteg index */ -struct pvo_head moea64_pvo_kunmanaged = /* list of unmanaged pages */ - LIST_HEAD_INITIALIZER(moea64_pvo_kunmanaged); uma_zone_t moea64_upvo_zone; /* zone for pvo entries for unmanaged pages */ uma_zone_t moea64_mpvo_zone; /* zone for pvo entries for managed pages */ @@ -622,8 +620,8 @@ moea64_setup_direct_map(mmu_t mmup, vm_o pte_lo |= LPTE_G; moea64_pvo_enter(mmup, kernel_pmap, moea64_upvo_zone, - &moea64_pvo_kunmanaged, pa, pa, - pte_lo, PVO_WIRED | PVO_LARGE); + NULL, pa, pa, pte_lo, + PVO_WIRED | PVO_LARGE); } } PMAP_UNLOCK(kernel_pmap); @@ -820,7 +818,7 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offs kernel_pmap->pmap_phys = kernel_pmap; CPU_FILL(&kernel_pmap->pm_active); - LIST_INIT(&kernel_pmap->pmap_pvo); + RB_INIT(&kernel_pmap->pmap_pvo); PMAP_LOCK_INIT(kernel_pmap); @@ -1179,7 +1177,7 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_ int error; if (!moea64_initialized) { - pvo_head = &moea64_pvo_kunmanaged; + pvo_head = NULL; pg = NULL; zone = moea64_upvo_zone; pvo_flags = 0; @@ -1197,7 +1195,7 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_ /* XXX change the pvo head for fake pages */ if ((m->oflags & VPO_UNMANAGED) != 0) { pvo_flags &= ~PVO_MANAGED; - pvo_head = &moea64_pvo_kunmanaged; + pvo_head = NULL; zone = moea64_upvo_zone; } @@ -1315,7 +1313,6 @@ moea64_extract(mmu_t mmu, pmap_t pm, vm_ struct pvo_entry *pvo; vm_paddr_t pa; - LOCK_TABLE_RD(); PMAP_LOCK(pm); pvo = moea64_pvo_find_va(pm, va); if (pvo == NULL) @@ -1323,7 +1320,6 @@ moea64_extract(mmu_t mmu, pmap_t pm, vm_ else pa = (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) | (va - PVO_VADDR(pvo)); - UNLOCK_TABLE_RD(); PMAP_UNLOCK(pm); return (pa); } @@ -1333,37 +1329,6 @@ moea64_extract(mmu_t mmu, pmap_t pm, vm_ * pmap and virtual address pair if that mapping permits the given * protection. */ - -extern int pa_tryrelock_restart; - -static int -vm_page_pa_tryrelock_moea64(pmap_t pmap, vm_paddr_t pa, vm_paddr_t *locked) -{ - /* - * This is a duplicate of vm_page_pa_tryrelock(), but with proper - * handling of the table lock - */ - vm_paddr_t lockpa; - - lockpa = *locked; - *locked = pa; - if (lockpa) { - PA_LOCK_ASSERT(lockpa, MA_OWNED); - if (PA_LOCKPTR(pa) == PA_LOCKPTR(lockpa)) - return (0); - PA_UNLOCK(lockpa); - } - if (PA_TRYLOCK(pa)) - return (0); - UNLOCK_TABLE_RD(); - PMAP_UNLOCK(pmap); - atomic_add_int(&pa_tryrelock_restart, 1); - PA_LOCK(pa); - LOCK_TABLE_RD(); - PMAP_LOCK(pmap); - return (EAGAIN); -} - vm_page_t moea64_extract_and_hold(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_prot_t prot) { @@ -1373,21 +1338,19 @@ moea64_extract_and_hold(mmu_t mmu, pmap_ m = NULL; pa = 0; - LOCK_TABLE_RD(); PMAP_LOCK(pmap); retry: pvo = moea64_pvo_find_va(pmap, va & ~ADDR_POFF); if (pvo != NULL && (pvo->pvo_pte.lpte.pte_hi & LPTE_VALID) && ((pvo->pvo_pte.lpte.pte_lo & LPTE_PP) == LPTE_RW || (prot & VM_PROT_WRITE) == 0)) { - if (vm_page_pa_tryrelock_moea64(pmap, + if (vm_page_pa_tryrelock(pmap, pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN, &pa)) goto retry; m = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); vm_page_hold(m); } PA_UNLOCK_COND(pa); - UNLOCK_TABLE_RD(); PMAP_UNLOCK(pmap); return (m); } @@ -1435,8 +1398,7 @@ moea64_uma_page_alloc(uma_zone_t zone, i PMAP_LOCK(kernel_pmap); moea64_pvo_enter(installed_mmu, kernel_pmap, moea64_upvo_zone, - &moea64_pvo_kunmanaged, va, VM_PAGE_TO_PHYS(m), LPTE_M, - PVO_WIRED | PVO_BOOTSTRAP); + NULL, va, VM_PAGE_TO_PHYS(m), LPTE_M, PVO_WIRED | PVO_BOOTSTRAP); if (needed_lock) PMAP_UNLOCK(kernel_pmap); @@ -1510,12 +1472,10 @@ moea64_is_prefaultable(mmu_t mmu, pmap_t struct pvo_entry *pvo; boolean_t rv; - LOCK_TABLE_RD(); PMAP_LOCK(pmap); pvo = moea64_pvo_find_va(pmap, va & ~ADDR_POFF); rv = pvo == NULL || (pvo->pvo_pte.lpte.pte_hi & LPTE_VALID) == 0; PMAP_UNLOCK(pmap); - UNLOCK_TABLE_RD(); return (rv); } @@ -1671,7 +1631,7 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_ LOCK_TABLE_WR(); PMAP_LOCK(kernel_pmap); error = moea64_pvo_enter(mmu, kernel_pmap, moea64_upvo_zone, - &moea64_pvo_kunmanaged, va, pa, pte_lo, PVO_WIRED); + NULL, va, pa, pte_lo, PVO_WIRED); PMAP_UNLOCK(kernel_pmap); UNLOCK_TABLE_WR(); @@ -1704,13 +1664,11 @@ moea64_kextract(mmu_t mmu, vm_offset_t v if (va < VM_MIN_KERNEL_ADDRESS) return (va); - LOCK_TABLE_RD(); PMAP_LOCK(kernel_pmap); pvo = moea64_pvo_find_va(kernel_pmap, va); KASSERT(pvo != NULL, ("moea64_kextract: no addr found for %#" PRIxPTR, va)); pa = (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) | (va - PVO_VADDR(pvo)); - UNLOCK_TABLE_RD(); PMAP_UNLOCK(kernel_pmap); return (pa); } @@ -1857,7 +1815,7 @@ void moea64_pinit(mmu_t mmu, pmap_t pmap) { PMAP_LOCK_INIT(pmap); - LIST_INIT(&pmap->pmap_pvo); + RB_INIT(&pmap->pmap_pvo); pmap->pm_slb_tree_root = slb_alloc_tree(); pmap->pm_slb = slb_alloc_user_cache(); @@ -1871,7 +1829,7 @@ moea64_pinit(mmu_t mmu, pmap_t pmap) uint32_t hash; PMAP_LOCK_INIT(pmap); - LIST_INIT(&pmap->pmap_pvo); + RB_INIT(&pmap->pmap_pvo); if (pmap_bootstrapped) pmap->pmap_phys = (pmap_t)moea64_kextract(mmu, @@ -1967,7 +1925,7 @@ void moea64_protect(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { - struct pvo_entry *pvo, *tpvo; + struct pvo_entry *pvo, *tpvo, key; CTR4(KTR_PMAP, "moea64_protect: pm=%p sva=%#x eva=%#x prot=%#x", pm, sva, eva, prot); @@ -1982,26 +1940,11 @@ moea64_protect(mmu_t mmu, pmap_t pm, vm_ LOCK_TABLE_RD(); PMAP_LOCK(pm); - if ((eva - sva)/PAGE_SIZE < pm->pm_stats.resident_count) { - while (sva < eva) { - #ifdef __powerpc64__ - if (pm != kernel_pmap && - user_va_to_slb_entry(pm, sva) == NULL) { - sva = roundup2(sva + 1, SEGMENT_LENGTH); - continue; - } - #endif - pvo = moea64_pvo_find_va(pm, sva); - if (pvo != NULL) - moea64_pvo_protect(mmu, pm, pvo, prot); - sva += PAGE_SIZE; - } - } else { - LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) { - if (PVO_VADDR(pvo) < sva || PVO_VADDR(pvo) >= eva) - continue; - moea64_pvo_protect(mmu, pm, pvo, prot); - } + key.pvo_vaddr = sva; + for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); + pvo != NULL && PVO_VADDR(pvo) < eva; pvo = tpvo) { + tpvo = RB_NEXT(pvo_tree, &pm->pmap_pvo, pvo); + moea64_pvo_protect(mmu, pm, pvo, prot); } UNLOCK_TABLE_RD(); PMAP_UNLOCK(pm); @@ -2080,7 +2023,7 @@ moea64_remove_pages(mmu_t mmu, pmap_t pm LOCK_TABLE_WR(); PMAP_LOCK(pm); - LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) { + RB_FOREACH_SAFE(pvo, pvo_tree, &pm->pmap_pvo, tpvo) { if (!(pvo->pvo_vaddr & PVO_WIRED)) moea64_pvo_remove(mmu, pvo); } @@ -2094,7 +2037,7 @@ moea64_remove_pages(mmu_t mmu, pmap_t pm void moea64_remove(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva) { - struct pvo_entry *pvo, *tpvo; + struct pvo_entry *pvo, *tpvo, key; /* * Perform an unsynchronized read. This is, however, safe. @@ -2104,26 +2047,11 @@ moea64_remove(mmu_t mmu, pmap_t pm, vm_o LOCK_TABLE_WR(); PMAP_LOCK(pm); - if ((eva - sva)/PAGE_SIZE < pm->pm_stats.resident_count) { - while (sva < eva) { - #ifdef __powerpc64__ - if (pm != kernel_pmap && - user_va_to_slb_entry(pm, sva) == NULL) { - sva = roundup2(sva + 1, SEGMENT_LENGTH); - continue; - } - #endif - pvo = moea64_pvo_find_va(pm, sva); - if (pvo != NULL) - moea64_pvo_remove(mmu, pvo); - sva += PAGE_SIZE; - } - } else { - LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) { - if (PVO_VADDR(pvo) < sva || PVO_VADDR(pvo) >= eva) - continue; - moea64_pvo_remove(mmu, pvo); - } + key.pvo_vaddr = sva; + for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); + pvo != NULL && PVO_VADDR(pvo) < eva; pvo = tpvo) { + tpvo = RB_NEXT(pvo_tree, &pm->pmap_pvo, pvo); + moea64_pvo_remove(mmu, pvo); } UNLOCK_TABLE_WR(); PMAP_UNLOCK(pm); @@ -2275,12 +2203,6 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm, u moea64_bpvo_pool_index++; bootstrap = 1; } else { - /* - * Note: drop the table lock around the UMA allocation in - * case the UMA allocator needs to manipulate the page - * table. The mapping we are working with is already - * protected by the PMAP lock. - */ pvo = uma_zalloc(zone, M_NOWAIT); } @@ -2297,7 +2219,7 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm, u if (flags & PVO_WIRED) pvo->pvo_vaddr |= PVO_WIRED; - if (pvo_head != &moea64_pvo_kunmanaged) + if (pvo_head != NULL) pvo->pvo_vaddr |= PVO_MANAGED; if (bootstrap) pvo->pvo_vaddr |= PVO_BOOTSTRAP; @@ -2310,15 +2232,17 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm, u /* * Add to pmap list */ - LIST_INSERT_HEAD(&pm->pmap_pvo, pvo, pvo_plink); + RB_INSERT(pvo_tree, &pm->pmap_pvo, pvo); /* * Remember if the list was empty and therefore will be the first * item. */ - if (LIST_FIRST(pvo_head) == NULL) - first = 1; - LIST_INSERT_HEAD(pvo_head, pvo, pvo_vlink); + if (pvo_head != NULL) { + if (LIST_FIRST(pvo_head) == NULL) + first = 1; + LIST_INSERT_HEAD(pvo_head, pvo, pvo_vlink); + } if (pvo->pvo_vaddr & PVO_WIRED) { pvo->pvo_pte.lpte.pte_hi |= LPTE_WIRED; @@ -2381,10 +2305,9 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ pvo->pvo_pmap->pm_stats.wired_count--; /* - * Remove this PVO from the PV and pmap lists. + * Remove this PVO from the pmap list. */ - LIST_REMOVE(pvo, pvo_vlink); - LIST_REMOVE(pvo, pvo_plink); + RB_REMOVE(pvo_tree, &pvo->pvo_pmap->pmap_pvo, pvo); /* * Remove this from the overflow list and return it to the pool @@ -2398,6 +2321,7 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED && pg != NULL) { + LIST_REMOVE(pvo, pvo_vlink); if ((pvo->pvo_pte.lpte.pte_lo & LPTE_PP) != LPTE_BR) { if (pvo->pvo_pte.lpte.pte_lo & LPTE_CHG) vm_page_dirty(pg); @@ -2421,41 +2345,10 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ static struct pvo_entry * moea64_pvo_find_va(pmap_t pm, vm_offset_t va) { - struct pvo_entry *pvo; - int ptegidx; - uint64_t vsid; - #ifdef __powerpc64__ - uint64_t slbv; - - if (pm == kernel_pmap) { - slbv = kernel_va_to_slbv(va); - } else { - struct slb *slb; - slb = user_va_to_slb_entry(pm, va); - /* The page is not mapped if the segment isn't */ - if (slb == NULL) - return NULL; - slbv = slb->slbv; - } + struct pvo_entry key; - vsid = (slbv & SLBV_VSID_MASK) >> SLBV_VSID_SHIFT; - if (slbv & SLBV_L) - va &= ~moea64_large_page_mask; - else - va &= ~ADDR_POFF; - ptegidx = va_to_pteg(vsid, va, slbv & SLBV_L); - #else - va &= ~ADDR_POFF; - vsid = va_to_vsid(pm, va); - ptegidx = va_to_pteg(vsid, va, 0); - #endif - - LIST_FOREACH(pvo, &moea64_pvo_table[ptegidx], pvo_olink) { - if (pvo->pvo_pmap == pm && PVO_VADDR(pvo) == va) - break; - } - - return (pvo); + key.pvo_vaddr = va & ~ADDR_POFF; + return (RB_FIND(pvo_tree, &pm->pmap_pvo, &key)); } static boolean_t @@ -2549,21 +2442,21 @@ moea64_clear_bit(mmu_t mmu, vm_page_t m, boolean_t moea64_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) { - struct pvo_entry *pvo; + struct pvo_entry *pvo, key; vm_offset_t ppa; int error = 0; - LOCK_TABLE_RD(); PMAP_LOCK(kernel_pmap); - for (ppa = pa & ~ADDR_POFF; ppa < pa + size; ppa += PAGE_SIZE) { - pvo = moea64_pvo_find_va(kernel_pmap, ppa); + key.pvo_vaddr = ppa = pa & ~ADDR_POFF; + for (pvo = RB_FIND(pvo_tree, &kernel_pmap->pmap_pvo, &key); + ppa < pa + size; ppa += PAGE_SIZE, + pvo = RB_NEXT(pvo_tree, &kernel_pmap->pmap_pvo, pvo)) { if (pvo == NULL || (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) != ppa) { error = EFAULT; break; } } - UNLOCK_TABLE_RD(); PMAP_UNLOCK(kernel_pmap); return (error); @@ -2626,7 +2519,6 @@ moea64_sync_icache(mmu_t mmu, pmap_t pm, vm_paddr_t pa; vm_size_t len; - LOCK_TABLE_RD(); PMAP_LOCK(pm); while (sz > 0) { lim = round_page(va); @@ -2640,6 +2532,5 @@ moea64_sync_icache(mmu_t mmu, pmap_t pm, va += len; sz -= len; } - UNLOCK_TABLE_RD(); PMAP_UNLOCK(pm); } Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Sun May 20 14:15:13 2012 (r235688) +++ head/sys/powerpc/include/pmap.h Sun May 20 14:33:28 2012 (r235689) @@ -94,7 +94,7 @@ typedef struct pmap *pmap_t; struct pvo_entry { LIST_ENTRY(pvo_entry) pvo_vlink; /* Link to common virt page */ LIST_ENTRY(pvo_entry) pvo_olink; /* Link to overflow entry */ - LIST_ENTRY(pvo_entry) pvo_plink; /* Link to pmap entries */ + RB_ENTRY(pvo_entry) pvo_plink; /* Link to pmap entries */ union { struct pte pte; /* 32 bit PTE */ struct lpte lpte; /* 64 bit PTE */ @@ -104,6 +104,9 @@ struct pvo_entry { uint64_t pvo_vpn; /* Virtual page number */ }; LIST_HEAD(pvo_head, pvo_entry); +RB_HEAD(pvo_tree, pvo_entry); +int pvo_vaddr_compare(struct pvo_entry *, struct pvo_entry *); +RB_PROTOTYPE(pvo_tree, pvo_entry, pvo_plink, pvo_vaddr_compare); #define PVO_PTEGIDX_MASK 0x007UL /* which PTEG slot */ #define PVO_PTEGIDX_VALID 0x008UL /* slot is valid */ @@ -136,7 +139,7 @@ struct pmap { struct pmap *pmap_phys; struct pmap_statistics pm_stats; - struct pvo_head pmap_pvo; + struct pvo_tree pmap_pvo; }; struct md_page { Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Sun May 20 14:15:13 2012 (r235688) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Sun May 20 14:33:28 2012 (r235689) @@ -76,6 +76,20 @@ vm_offset_t virtual_end; int pmap_bootstrapped; +#ifdef AIM +int +pvo_vaddr_compare(struct pvo_entry *a, struct pvo_entry *b) +{ + if (PVO_VADDR(a) < PVO_VADDR(b)) + return (-1); + else if (PVO_VADDR(a) > PVO_VADDR(b)) + return (1); + return (0); +} +RB_GENERATE(pvo_tree, pvo_entry, pvo_plink, pvo_vaddr_compare); +#endif + + void pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) { Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun May 20 14:15:13 2012 (r235688) +++ head/sys/vm/vm_page.c Sun May 20 14:33:28 2012 (r235689) @@ -131,7 +131,7 @@ TUNABLE_INT("vm.boot_pages", &boot_pages SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RD, &boot_pages, 0, "number of pages allocated for bootstrapping the VM system"); -int pa_tryrelock_restart; +static int pa_tryrelock_restart; SYSCTL_INT(_vm, OID_AUTO, tryrelock_restart, CTLFLAG_RD, &pa_tryrelock_restart, 0, "Number of tryrelock restarts"); From owner-svn-src-all@FreeBSD.ORG Sun May 20 15:10:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E62761065673; Sun, 20 May 2012 15:10:13 +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 D0E958FC14; Sun, 20 May 2012 15:10: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 q4KFAD0V098956; Sun, 20 May 2012 15:10:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KFAD99098954; Sun, 20 May 2012 15:10:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205201510.q4KFAD99098954@svn.freebsd.org> From: Dimitry Andric Date: Sun, 20 May 2012 15:10: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: r235690 - stable/9/usr.sbin/bluetooth/hccontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 15:10:14 -0000 Author: dim Date: Sun May 20 15:10:13 2012 New Revision: 235690 URL: http://svn.freebsd.org/changeset/base/235690 Log: MFC r228976: Reencode files to UTF-8. Drop CP1252 em-dash. Modified: stable/9/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Directory Properties: stable/9/usr.sbin/bluetooth/hccontrol/ (props changed) Modified: stable/9/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c ============================================================================== --- stable/9/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Sun May 20 14:33:28 2012 (r235689) +++ stable/9/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Sun May 20 15:10:13 2012 (r235690) @@ -1632,8 +1632,8 @@ struct hci_command host_controller_baseb "begins the next page scan. The Page_Scan_Window configuration parameter\n" \ "defines the amount of time for the duration of the page scan. \n" \ "The Page_Scan_Window can only be less than or equal to the Page_Scan_Interval.\n\n" \ -"\t - Range: 0x0012 -– 0x100, Time = N * 0.625 msec\n" \ -"\t - Range: 0x0012 -– 0x100, Time = N * 0.625 msen", +"\t - Range: 0x0012 -- 0x100, Time = N * 0.625 msec\n" \ +"\t - Range: 0x0012 -- 0x100, Time = N * 0.625 msen", &hci_write_page_scan_activity }, { @@ -1654,8 +1654,8 @@ struct hci_command host_controller_baseb "until it begins the next inquiry scan. The Inquiry_Scan_Window configuration\n" \ "parameter defines the amount of time for the duration of the inquiry scan.\n" \ "The Inquiry_Scan_Window can only be less than or equal to the Inquiry_Scan_Interval.\n\n" \ -"\t - Range: 0x0012 -– 0x100, Time = N * 0.625 msec\n" \ -"\t - Range: 0x0012 -– 0x100, Time = N * 0.625 msen", +"\t - Range: 0x0012 -- 0x100, Time = N * 0.625 msec\n" \ +"\t - Range: 0x0012 -- 0x100, Time = N * 0.625 msen", &hci_write_inquiry_scan_activity }, { From owner-svn-src-all@FreeBSD.ORG Sun May 20 16:09:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CF2A1065675; Sun, 20 May 2012 16:09:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 682018FC1B; Sun, 20 May 2012 16:09: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 q4KG9fQF002421; Sun, 20 May 2012 16:09:41 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KG9eDk002418; Sun, 20 May 2012 16:09:40 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205201609.q4KG9eDk002418@svn.freebsd.org> From: Glen Barber Date: Sun, 20 May 2012 16:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235691 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 16:09:41 -0000 Author: gjb (doc committer) Date: Sun May 20 16:09:40 2012 New Revision: 235691 URL: http://svn.freebsd.org/changeset/base/235691 Log: Typo and mdoc(7) style fixes. PR: 167890 Submitted by: Nobuyuki Koganemaru (kogane&jp!freebsd!org) MFC after: 3 days Modified: head/share/man/man7/c99.7 head/share/man/man7/release.7 Modified: head/share/man/man7/c99.7 ============================================================================== --- head/share/man/man7/c99.7 Sun May 20 15:10:13 2012 (r235690) +++ head/share/man/man7/c99.7 Sun May 20 16:09:40 2012 (r235691) @@ -103,7 +103,7 @@ The ISO C standard was later extended wi ISO/IEC 9899 AM1 in 1995. This contained, for example, the wide-character support in wchar.h and wctype.h. -Two corregenda were also published: Technical Corrigendum 1 as +Two corrigenda were also published: Technical Corrigendum 1 as ISO/IEC 9899 TCOR1 in 1995 and Technical Corrigendum 2 as ISO/IEC 9899 TCOR1 in 1996. The continuous development and growth made it necessary to work out a new Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Sun May 20 15:10:13 2012 (r235690) +++ head/share/man/man7/release.7 Sun May 20 16:09:40 2012 (r235691) @@ -221,7 +221,7 @@ hardware guide, and installation instruc the Handbook) is built during the .Cm base.txz target invoked by -.Cm packagesystem. +.Cm packagesystem . .El .Sh ENVIRONMENT Optional variables: From owner-svn-src-all@FreeBSD.ORG Sun May 20 16:22:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DF90106580F; Sun, 20 May 2012 16:22:34 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5BE158FC15; Sun, 20 May 2012 16:22:34 +0000 (UTC) Received: by dadv36 with SMTP id v36so6255231dad.13 for ; Sun, 20 May 2012 09:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=cobaFMzIi1zUzNgSU5eT6Fn6VyyT7v3PZvsYjW3+SbE=; b=atCxmP7JTE+mGVcv256cffryKnFr35osXNk6XLujCvWiIe9Iu+eaYy+z7PqxwmIbdh POxuRPlrgOkWpcCvrsVpgINdeqL4A1T5aBLdQm4I0zta/HazvVtdTXYSj6hF0h0948fy VhRlZRm5u+bgdCve/83djHzm4S5Jh1/D2/+2JbaikUkMbsAMcWAto4C628zVOffAoAiT dKD4TwM45OVuYVy17D2V2tjm3Jc2M6yZK+J1ZRzLRPLBITdHI2j/D+SCgPwWv0gTHN8h ERIgEIodcR2BMeNtpbEZnp3pQjZ/I0RhqcDMBlzJEqqNn8pVtr1/cMGyziqqyLDPvxiy DKiQ== MIME-Version: 1.0 Received: by 10.68.232.129 with SMTP id to1mr39082052pbc.27.1337530953638; Sun, 20 May 2012 09:22:33 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.142.203.2 with HTTP; Sun, 20 May 2012 09:22:33 -0700 (PDT) In-Reply-To: <201205200946.q4K9kmxS080440@svn.freebsd.org> References: <201205200946.q4K9kmxS080440@svn.freebsd.org> Date: Sun, 20 May 2012 09:22:33 -0700 X-Google-Sender-Auth: sfII2nND41VKEDVOYxmMmvKJQZU Message-ID: From: Adrian Chadd To: Bernhard Schmidt Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235685 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 16:22:34 -0000 .. retry with ATH_DEBUG and see if it still fails? Adrian On 20 May 2012 02:46, Bernhard Schmidt wrote: > Author: bschmidt > Date: Sun May 20 09:46:48 2012 > New Revision: 235685 > URL: http://svn.freebsd.org/changeset/base/235685 > > Log: > =A0Remove unused variable. > > Modified: > =A0head/sys/dev/ath/if_ath_rx.c > > Modified: head/sys/dev/ath/if_ath_rx.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ath/if_ath_rx.c =A0 =A0 =A0 =A0Sun May 20 09:29:14 2012 = =A0 =A0 =A0 =A0(r235684) > +++ head/sys/dev/ath/if_ath_rx.c =A0 =A0 =A0 =A0Sun May 20 09:46:48 2012 = =A0 =A0 =A0 =A0(r235685) > @@ -766,7 +766,6 @@ ath_rx_proc(struct ath_softc *sc, int re > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) > =A0 =A0 =A0 =A0struct ath_buf *bf; > =A0 =A0 =A0 =A0struct ifnet *ifp =3D sc->sc_ifp; > - =A0 =A0 =A0 struct ieee80211com *ic =3D ifp->if_l2com; > =A0 =A0 =A0 =A0struct ath_hal *ah =3D sc->sc_ah; > =A0 =A0 =A0 =A0struct ath_desc *ds; > =A0 =A0 =A0 =A0struct ath_rx_status *rs; From owner-svn-src-all@FreeBSD.ORG Sun May 20 16:36:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD1CE1065672; Sun, 20 May 2012 16:36: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 A89AD8FC08; Sun, 20 May 2012 16:36: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 q4KGasQY003684; Sun, 20 May 2012 16:36:54 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KGas5v003682; Sun, 20 May 2012 16:36:54 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201205201636.q4KGas5v003682@svn.freebsd.org> From: Mitsuru IWASAKI Date: Sun, 20 May 2012 16:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235692 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 16:36:54 -0000 Author: iwasaki Date: Sun May 20 16:36:54 2012 New Revision: 235692 URL: http://svn.freebsd.org/changeset/base/235692 Log: Don't start the sleep state transition procedure while sleep is disabled or the system is in shutdown procedure. This should fix the problem which kernel never response to the sleep button press events after the message `suspend request ignored (not ready yet)'. MFC after: 3 days Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sun May 20 16:09:40 2012 (r235691) +++ head/sys/dev/acpica/acpi.c Sun May 20 16:36:54 2012 (r235692) @@ -2515,6 +2515,11 @@ acpi_ReqSleepState(struct acpi_softc *sc if (!acpi_sleep_states[state]) return (EOPNOTSUPP); + /* Wait until sleep is enabled. */ + while (sc->acpi_sleep_disabled) { + AcpiOsSleep(1000); + } + ACPI_LOCK(acpi); /* If a suspend request is already in progress, just return. */ @@ -2522,6 +2527,7 @@ acpi_ReqSleepState(struct acpi_softc *sc ACPI_UNLOCK(acpi); return (0); } + sc->acpi_next_sstate = state; /* S5 (soft-off) should be entered directly with no waiting. */ if (state == ACPI_STATE_S5) { @@ -2531,7 +2537,6 @@ acpi_ReqSleepState(struct acpi_softc *sc } /* Record the pending state and notify all apm devices. */ - sc->acpi_next_sstate = state; STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { clone->notify_status = APM_EV_NONE; if ((clone->flags & ACPI_EVF_DEVD) == 0) { From owner-svn-src-all@FreeBSD.ORG Sun May 20 16:43:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 443791065670; Sun, 20 May 2012 16:43:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 105608FC1C; Sun, 20 May 2012 16:43: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 q4KGhnVJ004046; Sun, 20 May 2012 16:43:49 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KGhmif004016; Sun, 20 May 2012 16:43:48 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205201643.q4KGhmif004016@svn.freebsd.org> From: Glen Barber Date: Sun, 20 May 2012 16:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235693 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 16:43:49 -0000 Author: gjb (doc committer) Date: Sun May 20 16:43:47 2012 New Revision: 235693 URL: http://svn.freebsd.org/changeset/base/235693 Log: Typo and mdoc(7) style fixes. PR: 168117 Submitted by: Nobuyuki Koganemaru (kogane&jp!freebsd!org) MFC after: 3 days Modified: head/share/man/man9/BUF_ISLOCKED.9 head/share/man/man9/DB_COMMAND.9 head/share/man/man9/VOP_GETEXTATTR.9 head/share/man/man9/VOP_GETPAGES.9 head/share/man/man9/VOP_GETVOBJECT.9 head/share/man/man9/VOP_SETEXTATTR.9 head/share/man/man9/acl.9 head/share/man/man9/bus_generic_print_child.9 head/share/man/man9/bus_release_resource.9 head/share/man/man9/bus_space.9 head/share/man/man9/byteorder.9 head/share/man/man9/devclass_get_maxunit.9 head/share/man/man9/device_find_child.9 head/share/man/man9/firmware.9 head/share/man/man9/hashinit.9 head/share/man/man9/ieee80211_proto.9 head/share/man/man9/ifnet.9 head/share/man/man9/kqueue.9 head/share/man/man9/lock.9 head/share/man/man9/locking.9 head/share/man/man9/mbuf.9 head/share/man/man9/mod_cc.9 head/share/man/man9/netisr.9 head/share/man/man9/pci.9 head/share/man/man9/spl.9 head/share/man/man9/sysctl.9 head/share/man/man9/taskqueue.9 head/share/man/man9/usbdi.9 head/share/man/man9/vm_page_aflag.9 Modified: head/share/man/man9/BUF_ISLOCKED.9 ============================================================================== --- head/share/man/man9/BUF_ISLOCKED.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/BUF_ISLOCKED.9 Sun May 20 16:43:47 2012 (r235693) @@ -52,7 +52,7 @@ It can return: .It Dv LK_EXCLUSIVE An exclusive lock is held by curthread. .It Dv LK_EXCLOTHER -An exclusive lock is held by someone other than curthread +An exclusive lock is held by someone other than curthread. .It Dv LK_SHARED A shared lock is held. .It Li 0 Modified: head/share/man/man9/DB_COMMAND.9 ============================================================================== --- head/share/man/man9/DB_COMMAND.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/DB_COMMAND.9 Sun May 20 16:43:47 2012 (r235693) @@ -32,7 +32,7 @@ .Nm DB_COMMAND , .Nm DB_SHOW_COMMAND , .Nm DB_SHOW_ALL_COMMAND -.Nd Extends the ddb command set. +.Nd Extends the ddb command set .Sh SYNOPSIS .In ddb/ddb.h .Fo DB_COMMAND Modified: head/share/man/man9/VOP_GETEXTATTR.9 ============================================================================== --- head/share/man/man9/VOP_GETEXTATTR.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/VOP_GETEXTATTR.9 Sun May 20 16:43:47 2012 (r235693) @@ -71,7 +71,7 @@ will be .Dv NULL when .Fa size -is not, and vise versa. +is not, and vice versa. .It Fa cred The user credentials to use in authorizing the request. .It Fa td @@ -113,7 +113,7 @@ The uio structure refers to an invalid u .It Bq Er EINVAL The .Fa name , -.Fa namespace, +.Fa namespace , or .Fa uio argument is invalid. Modified: head/share/man/man9/VOP_GETPAGES.9 ============================================================================== --- head/share/man/man9/VOP_GETPAGES.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/VOP_GETPAGES.9 Sun May 20 16:43:47 2012 (r235693) @@ -115,7 +115,7 @@ The page could not be written because of medium or protocol. .It Dv VM_PAGER_FAIL Treated identically to -.Dv VM_PAGER_ERROR +.Dv VM_PAGER_ERROR . .It Dv VM_PAGER_AGAIN The page was not handled by this request. .El Modified: head/share/man/man9/VOP_GETVOBJECT.9 ============================================================================== --- head/share/man/man9/VOP_GETVOBJECT.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/VOP_GETVOBJECT.9 Sun May 20 16:43:47 2012 (r235693) @@ -53,7 +53,7 @@ The vnode of the file. The VM object being returned, or .Dv NULL if the caller wants to test for the existence -of the VM object). +of the VM object. .El .Pp .Xr VFS 9 Modified: head/share/man/man9/VOP_SETEXTATTR.9 ============================================================================== --- head/share/man/man9/VOP_SETEXTATTR.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/VOP_SETEXTATTR.9 Sun May 20 16:43:47 2012 (r235693) @@ -96,7 +96,7 @@ The caller does not have the appropriate The request was not valid in this file system for the specified vnode and attribute name. .It Bq Er ENOMEM -Insufficient memory available to fulfill request +Insufficient memory available to fulfill the request. .It Bq Er EFAULT The uio structure refers to an invalid userspace address. .It Bq Er EINVAL Modified: head/share/man/man9/acl.9 ============================================================================== --- head/share/man/man9/acl.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/acl.9 Sun May 20 16:43:47 2012 (r235693) @@ -210,7 +210,7 @@ The following values are valid: .Xr vaccess_acl_nfs4 9 , .Xr vaccess_acl_posix1e 9 , .Xr VFS 9 , -.Xr vnaccess 9 , +.Xr vaccess 9 , .Xr VOP_ACLCHECK 9 , .Xr VOP_GETACL 9 , .Xr VOP_SETACL 9 Modified: head/share/man/man9/bus_generic_print_child.9 ============================================================================== --- head/share/man/man9/bus_generic_print_child.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/bus_generic_print_child.9 Sun May 20 16:43:47 2012 (r235693) @@ -51,7 +51,7 @@ foo0: on bar0 bus_generic_print_child itself calls two functions .Fn bus_print_child_header and -.Fn bus_print_child_footer +.Fn bus_print_child_footer . The former prints "foo0: " and the latter "on bar0". These routines should be used if possible in your own code if .Fn bus_generic_print_child Modified: head/share/man/man9/bus_release_resource.9 ============================================================================== --- head/share/man/man9/bus_release_resource.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/bus_release_resource.9 Sun May 20 16:43:47 2012 (r235693) @@ -71,7 +71,7 @@ value must be the same as the one return .It .Fa r is the pointer to -.Va struct res , +.Va struct resource , i.e., the resource itself, returned by .Xr bus_alloc_resource 9 . Modified: head/share/man/man9/bus_space.9 ============================================================================== --- head/share/man/man9/bus_space.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/bus_space.9 Sun May 20 16:43:47 2012 (r235693) @@ -1380,7 +1380,8 @@ functions may be executed in any order. They may also be executed out of order with respect to other pending read and write operations unless order is enforced by use of the -.Fn bus_space_barrier function . +.Fn bus_space_barrier +function. There is no way to insert barriers between reads or writes of individual bus space locations executed by the .Fn bus_space_copy_region_N Modified: head/share/man/man9/byteorder.9 ============================================================================== --- head/share/man/man9/byteorder.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/byteorder.9 Sun May 20 16:43:47 2012 (r235693) @@ -158,7 +158,7 @@ in big/little endian format. The .Fn hto* and -.Fn toh* +.Fn *toh functions first appeared in .Fx 5.0 , and were originally developed by the Modified: head/share/man/man9/devclass_get_maxunit.9 ============================================================================== --- head/share/man/man9/devclass_get_maxunit.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/devclass_get_maxunit.9 Sun May 20 16:43:47 2012 (r235693) @@ -49,7 +49,7 @@ The function returns -1 if .Fa dc is -.Dv NULL; +.Dv NULL , otherwise it returns the next unit number in .Fa dc's Modified: head/share/man/man9/device_find_child.9 ============================================================================== --- head/share/man/man9/device_find_child.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/device_find_child.9 Sun May 20 16:43:47 2012 (r235693) @@ -41,7 +41,7 @@ .Fn device_find_child "device_t dev" "const char *classname" "int unit" .Sh DESCRIPTION This function looks for a specific child of -.Dv dev . +.Dv dev with the given .Fa classname and Modified: head/share/man/man9/firmware.9 ============================================================================== --- head/share/man/man9/firmware.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/firmware.9 Sun May 20 16:43:47 2012 (r235693) @@ -101,11 +101,13 @@ they want as an argument. If a matching the firmware subsystem will try to load it using the mechanisms specified below (typically, a kernel module with -.Nm the same name +.Nm +the same name as the image). .Sh API DESCRIPTION The kernel -.Nm firmware API +.Nm +firmware API is made of the following functions: .Pp .Fn firmware_register @@ -225,7 +227,7 @@ in the module, the imagename and version If you need to embed firmware images into a system, you should write appropriate entries in the file, e.g. this example is from -.Nm sys/arm/xscale/ixp425/files.ixp425: +.Nm sys/arm/xscale/ixp425/files.ixp425 : .Bd -literal ixp425_npe_fw.c optional npe_fw \\ compile-with "${AWK} -f $S/tools/fw_stub.awk \\ Modified: head/share/man/man9/hashinit.9 ============================================================================== --- head/share/man/man9/hashinit.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/hashinit.9 Sun May 20 16:43:47 2012 (r235693) @@ -29,7 +29,7 @@ .Dt HASHINIT 9 .Os .Sh NAME -.Nm hashinit , hashinit_flags, hashdestroy , phashinit +.Nm hashinit , hashinit_flags , hashdestroy , phashinit .Nd manage kernel hash tables .Sh SYNOPSIS .In sys/malloc.h Modified: head/share/man/man9/ieee80211_proto.9 ============================================================================== --- head/share/man/man9/ieee80211_proto.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/ieee80211_proto.9 Sun May 20 16:43:47 2012 (r235693) @@ -238,4 +238,4 @@ work will be initiated outside the drive The state machine concept was part of the original .Nm ieee80211 code base that first appeared in -.Nx 1.5 , +.Nx 1.5 . Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/ifnet.9 Sun May 20 16:43:47 2012 (r235693) @@ -637,7 +637,7 @@ interfaces registered at the interface l .Aq D This interface blocks transmission of packets and discards incoming packets after BPF processing. -Used to monitor network trafic but not interact +Used to monitor network traffic but not interact with the network in question. .It Dv IFF_STATICARP .Aq D Modified: head/share/man/man9/kqueue.9 ============================================================================== --- head/share/man/man9/kqueue.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/kqueue.9 Sun May 20 16:43:47 2012 (r235693) @@ -260,8 +260,7 @@ is not required, but is commonly used. If used, the .Vt knlist must be initialized with either -.Fn knlist_init -, +.Fn knlist_init , .Fn knlist_init_mtx or .Fn knlist_init_rw_reader . Modified: head/share/man/man9/lock.9 ============================================================================== --- head/share/man/man9/lock.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/lock.9 Sun May 20 16:43:47 2012 (r235693) @@ -230,7 +230,7 @@ and The .Fn lockmgr_disown function switches the owner from the current thread to be -.Dv LK_KERNPROC, +.Dv LK_KERNPROC , if the lock is already held. .Pp The Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/locking.9 Sun May 20 16:43:47 2012 (r235693) @@ -315,8 +315,7 @@ and reacquire it on wakeup (e.g. .Fn mtx_sleep , .Fn rw_sleep and -.Fn msleep_spin -). +.Fn msleep_spin ) . .Pp .Em *4 Though one can sleep holding an sx lock, one can also use @@ -358,6 +357,6 @@ These functions appeared in .Bsx 4.1 through -.Fx 7.0 +.Fx 7.0 . .Sh BUGS There are too many locking primitives to choose from. Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/mbuf.9 Sun May 20 16:43:47 2012 (r235693) @@ -403,7 +403,8 @@ for details. Associate externally managed data with .Fa mbuf . Any internal data contained in the mbuf will be discarded, and the -.Dv M_EXT flag will be set. +.Dv M_EXT +flag will be set. The .Fa buf and @@ -722,7 +723,8 @@ are contiguous and lay in the data area .Fa mbuf , so they are accessible with .Fn mtod mbuf type . -.Fa len must be smaller than, or equal to, the size of an +.Fa len +must be smaller than, or equal to, the size of an .Vt mbuf cluster . Return a pointer to an intermediate .Vt mbuf Modified: head/share/man/man9/mod_cc.9 ============================================================================== --- head/share/man/man9/mod_cc.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/mod_cc.9 Sun May 20 16:43:47 2012 (r235693) @@ -287,7 +287,7 @@ The CCF_CWND_LIMITED flag is relevant in .Va ack_received and is set when the connection's ability to send data is currently constrained by the value of the congestion window. -Algorithms should use the abscence of this flag being set to avoid accumulating +Algorithms should use the absence of this flag being set to avoid accumulating a large difference between the congestion window and send window. .Sh SEE ALSO .Xr cc_chd 4 , Modified: head/share/man/man9/netisr.9 ============================================================================== --- head/share/man/man9/netisr.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/netisr.9 Sun May 20 16:43:47 2012 (r235693) @@ -78,7 +78,7 @@ and may also manage queue limits and sta .Fn netisr_getqdrops , .Fn netisr_getqlimit , and -.Fn netisr_setqlimit. +.Fn netisr_setqlimit . .Pp .Nm supports multi-processor execution of handlers, and relies on a combination Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/pci.9 Sun May 20 16:43:47 2012 (r235693) @@ -488,7 +488,7 @@ The .Fn pci_count_msi function returns the maximum number of MSI messages supported by the device -.Fa dev. +.Fa dev . If the device does not support MSI, then .Fn pci_count_msi @@ -567,7 +567,8 @@ is set to the number of messages allocat returns zero. For MSI-X messages, the resource ID for each -.Dv SYS_RES_IRQ resource identifies the index in the MSI-X table of the +.Dv SYS_RES_IRQ +resource identifies the index in the MSI-X table of the corresponding message. A resource ID of one maps to the first index of the MSI-X table; a resource ID two identifies the second index in the table, etc. @@ -608,7 +609,7 @@ A driver may use a different distributio table entries via the .Fn pci_remap_msix function. -Note that this function must be called after a succesful call to +Note that this function must be called after a successful call to .Fn pci_alloc_msix but before any of the .Dv SYS_RES_IRQ @@ -649,7 +650,8 @@ above for .Fn pci_alloc_msix . MSI-X table entries that with a vector of zero will not have an associated -.Dv SYS_RES_IRQ resource. +.Dv SYS_RES_IRQ +resource. Additionally, if any of the original messages allocated by .Fn pci_alloc_msix Modified: head/share/man/man9/spl.9 ============================================================================== --- head/share/man/man9/spl.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/spl.9 Sun May 20 16:43:47 2012 (r235693) @@ -220,7 +220,8 @@ the system. The historical number scheme can be considered as a simple linearly ordered set of interrupt priority groups. .Pp -.Fx 5.0 eliminated spl entirely in favor of locking primitives which scale +.Fx 5.0 +eliminated spl entirely in favor of locking primitives which scale to more than one processor. .Sh AUTHORS This manual page was written by Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/sysctl.9 Sun May 20 16:43:47 2012 (r235693) @@ -107,7 +107,7 @@ This is a 64-bit signed integer. This is an opaque data structure. .It Dv CTLTYPE_STRUCT Alias for -.Dv CTLTYPE_OPAQUE. +.Dv CTLTYPE_OPAQUE . .It Dv CTLTYPE_UINT This is an unsigned integer. .It Dv CTLTYPE_LONG Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/taskqueue.9 Sun May 20 16:43:47 2012 (r235693) @@ -189,8 +189,8 @@ The count is cleared, and the old value returned in the reference parameter .Fa pendp , -if it is non- -.Dv NULL . +if it is +.Pf non- Dv NULL . If the task is currently running, .Dv EBUSY is returned, otherwise 0. Modified: head/share/man/man9/usbdi.9 ============================================================================== --- head/share/man/man9/usbdi.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/usbdi.9 Sun May 20 16:43:47 2012 (r235693) @@ -524,7 +524,7 @@ executed on the USB control endpoint. . This flag can be changed during operation. .Pp -"BOF" is short for "Block On Failure" +"BOF" is short for "Block On Failure". .Pp NOTE: This flag should be set on all BULK and INTERRUPT USB transfers which use an endpoint that can be shared between userland and kernel. Modified: head/share/man/man9/vm_page_aflag.9 ============================================================================== --- head/share/man/man9/vm_page_aflag.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/vm_page_aflag.9 Sun May 20 16:43:47 2012 (r235693) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .Dd August 31, 2011 -.Dt VM_PAGE_FLAG 9 +.Dt VM_PAGE_AFLAG 9 .Os .Sh NAME .Nm vm_page_aflag_clear , vm_page_aflag_set , vm_page_reference From owner-svn-src-all@FreeBSD.ORG Sun May 20 18:07:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 202B4106564A; Sun, 20 May 2012 18:07:36 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A8F68FC0A; Sun, 20 May 2012 18:07: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 q4KI7ZZd007867; Sun, 20 May 2012 18:07:35 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KI7ZaK007863; Sun, 20 May 2012 18:07:35 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201205201807.q4KI7ZaK007863@svn.freebsd.org> From: Tim Kientzle Date: Sun, 20 May 2012 18:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235694 - head/sys/boot/uboot/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 18:07:36 -0000 Author: kientzle Date: Sun May 20 18:07:35 2012 New Revision: 235694 URL: http://svn.freebsd.org/changeset/base/235694 Log: Determine kernel load address dynamically from u-boot memory map. The generic ELF loading code maps the kernel into low memory by subtracting KERN_BASE. So the copyin/copyout/readin functions are always called with low addresses. This code finds the largest DRAM block from the U-Boot memory map and adds that base to the addresses. In particular, this fixes ubldr on AM3358, which has DRAM mapped to 0x80000000 at power-on. Modified: head/sys/boot/uboot/lib/copy.c head/sys/boot/uboot/lib/elf_freebsd.c head/sys/boot/uboot/lib/libuboot.h Modified: head/sys/boot/uboot/lib/copy.c ============================================================================== --- head/sys/boot/uboot/lib/copy.c Sun May 20 16:43:47 2012 (r235693) +++ head/sys/boot/uboot/lib/copy.c Sun May 20 18:07:35 2012 (r235694) @@ -29,32 +29,64 @@ __FBSDID("$FreeBSD$"); #include +#include + +#include "api_public.h" +#include "glue.h" /* * MD primitives supporting placement of module data - * - * XXX should check load address/size against memory top. */ +void * +uboot_vm_translate(vm_offset_t o) { + struct sys_info *si; + static uintptr_t start = 0; + static size_t size = 0; + int i; + + if (size == 0) { + if ((si = ub_get_sys_info()) == NULL) + panic("could not retrieve system info"); + + /* Find start/size of largest DRAM block. */ + for (i = 0; i < si->mr_no; i++) { + if (si->mr[i].flags == MR_ATTR_DRAM + && si->mr[i].size > size) { + start = si->mr[i].start; + size = si->mr[i].size; + } + } + + if (size <= 0) + panic("No suitable DRAM?\n"); + /* + printf("Loading into memory region 0x%08X-0x%08X (%d MiB)\n", + start, start + size, size / 1024 / 1024); + */ + } + if (o > size) + panic("Address 0x%08jX bigger than size 0x%08X\n", + (intmax_t)o, size); + return (void *)(start + o); +} + ssize_t uboot_copyin(const void *src, vm_offset_t dest, const size_t len) { - - bcopy(src, (void *)dest, len); + bcopy(src, uboot_vm_translate(dest), len); return (len); } ssize_t uboot_copyout(const vm_offset_t src, void *dest, const size_t len) { - - bcopy((void *)src, dest, len); + bcopy(uboot_vm_translate(src), dest, len); return (len); } ssize_t uboot_readin(const int fd, vm_offset_t dest, const size_t len) { - - return (read(fd, (void *) dest, len)); + return (read(fd, uboot_vm_translate(dest), len)); } Modified: head/sys/boot/uboot/lib/elf_freebsd.c ============================================================================== --- head/sys/boot/uboot/lib/elf_freebsd.c Sun May 20 16:43:47 2012 (r235693) +++ head/sys/boot/uboot/lib/elf_freebsd.c Sun May 20 18:07:35 2012 (r235694) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" +#include "libuboot.h" extern vm_offset_t md_load(char *, vm_offset_t *); @@ -69,6 +70,7 @@ __elfN(uboot_exec)(struct preloaded_file vm_offset_t mdp; Elf_Ehdr *e; int error; + void (*entry)(void *); if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) return (EFTYPE); @@ -78,11 +80,12 @@ __elfN(uboot_exec)(struct preloaded_file if ((error = md_load(fp->f_args, &mdp)) != 0) return (error); - printf("Kernel entry at 0x%x ...\n", e->e_entry); + entry = uboot_vm_translate(e->e_entry); + printf("Kernel entry at 0x%x...\n", (unsigned)entry); dev_cleanup(); - (*(void (*)())e->e_entry)((void *)mdp); + (*entry)((void *)mdp); panic("exec returned"); } Modified: head/sys/boot/uboot/lib/libuboot.h ============================================================================== --- head/sys/boot/uboot/lib/libuboot.h Sun May 20 16:43:47 2012 (r235693) +++ head/sys/boot/uboot/lib/libuboot.h Sun May 20 18:07:35 2012 (r235694) @@ -60,6 +60,7 @@ extern int devs_no; extern struct netif_driver uboot_net; extern struct devsw uboot_storage; +void *uboot_vm_translate(vm_offset_t); ssize_t uboot_copyin(const void *src, vm_offset_t dest, const size_t len); ssize_t uboot_copyout(const vm_offset_t src, void *dest, const size_t len); ssize_t uboot_readin(const int fd, vm_offset_t dest, const size_t len); From owner-svn-src-all@FreeBSD.ORG Sun May 20 18:21:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 604B0106566C; Sun, 20 May 2012 18:21:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id EA7E58FC1B; Sun, 20 May 2012 18:21:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [192.168.1.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id A7B41A70D2; Sun, 20 May 2012 20:20:44 +0200 (CEST) Message-ID: <4FB9360F.9020606@FreeBSD.org> Date: Sun, 20 May 2012 20:21:03 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120425 Thunderbird/13.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org References: <201205201510.q4KFAD99098954@svn.freebsd.org> In-Reply-To: <201205201510.q4KFAD99098954@svn.freebsd.org> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r235690 - stable/9/usr.sbin/bluetooth/hccontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 18:21:07 -0000 On 2012-05-20 17:10, Dimitry Andric wrote:> Author: dim > Date: Sun May 20 15:10:13 2012 > New Revision: 235690 > URL: http://svn.freebsd.org/changeset/base/235690 > > Log: > MFC r228976: > > Reencode files to UTF-8. Drop CP1252 em-dash. Note: as of this MFC, stable/9 world + GENERIC should compile cleanly with clang 3.1 (the newly merged version). From owner-svn-src-all@FreeBSD.ORG Sun May 20 18:25:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77AF4106564A; Sun, 20 May 2012 18:25:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60A078FC15; Sun, 20 May 2012 18:25: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 q4KIPk7O008721; Sun, 20 May 2012 18:25:46 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KIPkeB008719; Sun, 20 May 2012 18:25:46 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205201825.q4KIPkeB008719@svn.freebsd.org> From: Alan Cox Date: Sun, 20 May 2012 18:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235695 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 18:25:46 -0000 Author: alc Date: Sun May 20 18:25:45 2012 New Revision: 235695 URL: http://svn.freebsd.org/changeset/base/235695 Log: Replace all uses of the vm page queues lock by a r/w lock that is private to this pmap.c. This new r/w lock is used primarily to synchronize access to the PV lists. However, it will be used in a somewhat unconventional way. As finer-grained PV list locking is added to each of the pmap functions that acquire this r/w lock, its acquisition will be changed from write to read, enabling concurrent execution of the pmap functions with finer-grained locking. Reviewed by: kib X-MFC after: r235598 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun May 20 18:07:35 2012 (r235694) +++ head/sys/amd64/amd64/pmap.c Sun May 20 18:25:45 2012 (r235695) @@ -117,6 +117,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -204,6 +205,7 @@ static u_int64_t DMPDPphys; /* phys addr static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); static long pv_entry_count; static struct md_page *pv_table; +static struct rwlock pvh_global_lock; /* * All those kernel PT submaps that BSD is so fond of @@ -581,6 +583,11 @@ pmap_bootstrap(vm_paddr_t *firstaddr) CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */ TAILQ_INIT(&kernel_pmap->pm_pvchunk); + /* + * Initialize the global pv list lock. + */ + rw_init(&pvh_global_lock, "pvh global"); + /* * Reserve some special page table entries/VA space for temporary * mapping of pages. @@ -1651,9 +1658,9 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { if (flags & M_WAITOK) { PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); VM_WAIT; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); } @@ -2055,7 +2062,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) uint64_t inuse, freemask; int bit, field, freed; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); pmap = NULL; free = m = NULL; @@ -2171,7 +2178,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv struct pv_chunk *pc; int idx, field, bit; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); PV_STAT(pv_entry_frees++); PV_STAT(pv_entry_spare++); @@ -2214,8 +2221,8 @@ get_pv_entry(pmap_t pmap, boolean_t try) struct pv_chunk *pc; vm_page_t m; + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); PV_STAT(pv_entry_allocs++); retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); @@ -2284,7 +2291,7 @@ pmap_pvh_remove(struct md_page *pvh, pma { pv_entry_t pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); @@ -2307,7 +2314,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse vm_offset_t va_last; vm_page_t m; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_demote_pde: pa is not 2mpage aligned")); @@ -2345,7 +2352,7 @@ pmap_pv_promote_pde(pmap_t pmap, vm_offs vm_offset_t va_last; vm_page_t m; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_promote_pde: pa is not 2mpage aligned")); @@ -2391,7 +2398,7 @@ pmap_remove_entry(pmap_t pmap, vm_page_t { struct md_page *pvh; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); pmap_pvh_free(&m->md, pmap, va); if (TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -2409,8 +2416,8 @@ pmap_insert_entry(pmap_t pmap, vm_offset { pv_entry_t pv; + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); @@ -2424,8 +2431,8 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm { pv_entry_t pv; + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); if ((pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); @@ -2443,7 +2450,7 @@ pmap_pv_insert_pde(pmap_t pmap, vm_offse struct md_page *pvh; pv_entry_t pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); if ((pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; pvh = pa_to_pvh(pa); @@ -2711,7 +2718,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva anyvalid = 0; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); /* @@ -2821,7 +2828,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva out: if (anyvalid) pmap_invalidate_all(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(free); } @@ -2853,7 +2860,7 @@ pmap_remove_all(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); free = NULL; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -2892,7 +2899,7 @@ small_mappings: PMAP_UNLOCK(pmap); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); pmap_free_zero_pages(free); } @@ -3013,12 +3020,12 @@ resume: } else { if (!pv_lists_locked) { pv_lists_locked = TRUE; - if (!mtx_trylock(&vm_page_queue_mtx)) { + if (!rw_try_wlock(&pvh_global_lock)) { if (anychanged) pmap_invalidate_all( pmap); PMAP_UNLOCK(pmap); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); goto resume; } } @@ -3069,7 +3076,7 @@ retry: if (anychanged) pmap_invalidate_all(pmap); if (pv_lists_locked) - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3224,7 +3231,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, mpte = NULL; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); /* @@ -3380,7 +3387,7 @@ validate: vm_reserv_level_iffullpop(m) == 0) pmap_promote_pde(pmap, pde, va); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3396,7 +3403,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t pd_entry_t *pde, newpde; vm_page_t free, mpde; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); if ((mpde = pmap_allocpde(pmap, va, M_NOWAIT)) == NULL) { CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" @@ -3477,7 +3484,7 @@ pmap_enter_object(pmap_t pmap, vm_offset psize = atop(end - start); mpte = NULL; m = m_start; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { va = start + ptoa(diff); @@ -3491,7 +3498,7 @@ pmap_enter_object(pmap_t pmap, vm_offset mpte); m = TAILQ_NEXT(m, listq); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3508,10 +3515,10 @@ void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); (void)pmap_enter_quick_locked(pmap, va, m, prot, NULL); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3526,7 +3533,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || (m->oflags & VPO_UNMANAGED) != 0, ("pmap_enter_quick_locked: managed mapping within the clean submap")); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* @@ -3745,9 +3752,9 @@ retry: if (!wired != ((*pde & PG_W) == 0)) { if (!are_queues_locked) { are_queues_locked = TRUE; - if (!mtx_trylock(&vm_page_queue_mtx)) { + if (!rw_try_wlock(&pvh_global_lock)) { PMAP_UNLOCK(pmap); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); goto retry; } } @@ -3766,7 +3773,7 @@ retry: } out: if (are_queues_locked) - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3790,7 +3797,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm if (dst_addr != src_addr) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if (dst_pmap < src_pmap) { PMAP_LOCK(dst_pmap); PMAP_LOCK(src_pmap); @@ -3906,7 +3913,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm } } out: - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(src_pmap); PMAP_UNLOCK(dst_pmap); } @@ -3987,7 +3994,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (PV_PMAP(pv) == pmap) { rv = TRUE; @@ -4009,7 +4016,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p break; } } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -4027,13 +4034,13 @@ pmap_page_wired_mappings(vm_page_t m) count = 0; if ((m->oflags & VPO_UNMANAGED) != 0) return (count); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); count = pmap_pvh_wired_mappings(&m->md, count); if ((m->flags & PG_FICTITIOUS) == 0) { count = pmap_pvh_wired_mappings(pa_to_pvh(VM_PAGE_TO_PHYS(m)), count); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } @@ -4049,7 +4056,7 @@ pmap_pvh_wired_mappings(struct md_page * pt_entry_t *pte; pv_entry_t pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -4072,11 +4079,11 @@ pmap_page_is_mapped(vm_page_t m) if ((m->oflags & VPO_UNMANAGED) != 0) return (FALSE); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); rv = !TAILQ_EMPTY(&m->md.pv_list) || ((m->flags & PG_FICTITIOUS) == 0 && !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -4107,7 +4114,7 @@ pmap_remove_pages(pmap_t pmap) printf("warning: pmap_remove_pages called with non-current pmap\n"); return; } - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { allfree = 1; @@ -4216,7 +4223,7 @@ pmap_remove_pages(pmap_t pmap) } } pmap_invalidate_all(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(free); } @@ -4244,11 +4251,11 @@ pmap_is_modified(vm_page_t m) if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); rv = pmap_is_modified_pvh(&m->md) || ((m->flags & PG_FICTITIOUS) == 0 && pmap_is_modified_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -4265,7 +4272,7 @@ pmap_is_modified_pvh(struct md_page *pvh pmap_t pmap; boolean_t rv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); rv = FALSE; TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { pmap = PV_PMAP(pv); @@ -4316,11 +4323,11 @@ pmap_is_referenced(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); rv = pmap_is_referenced_pvh(&m->md) || ((m->flags & PG_FICTITIOUS) == 0 && pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -4336,7 +4343,7 @@ pmap_is_referenced_pvh(struct md_page *p pmap_t pmap; boolean_t rv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); rv = FALSE; TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { pmap = PV_PMAP(pv); @@ -4375,7 +4382,7 @@ pmap_remove_write(vm_page_t m) if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -4409,7 +4416,7 @@ retry: PMAP_UNLOCK(pmap); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -4437,7 +4444,7 @@ pmap_ts_referenced(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -4495,7 +4502,7 @@ small_mappings: } while ((pv = pvn) != NULL && pv != pvf); } out: - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rtval); } @@ -4525,7 +4532,7 @@ pmap_clear_modify(vm_page_t m) */ if ((m->aflags & PGA_WRITEABLE) == 0) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -4574,7 +4581,7 @@ small_mappings: } PMAP_UNLOCK(pmap); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -4594,7 +4601,7 @@ pmap_clear_reference(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_reference: page %p is not managed", m)); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -4634,7 +4641,7 @@ small_mappings: } PMAP_UNLOCK(pmap); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* From owner-svn-src-all@FreeBSD.ORG Sun May 20 19:04:51 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9B86E106566B; Sun, 20 May 2012 19:04:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1C9A38FC0A; Sun, 20 May 2012 19:04:49 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA13338; Sun, 20 May 2012 22:04:41 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1SWBQm-000G3h-SB; Sun, 20 May 2012 22:04:40 +0300 Message-ID: <4FB94046.7090108@FreeBSD.org> Date: Sun, 20 May 2012 22:04:38 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120503 Thunderbird/12.0.1 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201205151707.q4FH7UDU096834@svn.freebsd.org> <20120520110815.GB1442@garage.freebsd.pl> In-Reply-To: <20120520110815.GB1442@garage.freebsd.pl> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235478 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 19:04:51 -0000 on 20/05/2012 14:08 Pawel Jakub Dawidek said the following: > On Tue, May 15, 2012 at 05:07:30PM +0000, Andriy Gapon wrote: >> Author: avg Date: Tue May 15 17:07:29 2012 New Revision: 235478 URL: >> http://svn.freebsd.org/changeset/base/235478 >> >> Log: zpool_do_import: use /dev instead of /dev/dsk as a default >> >> This affects behavior of zpool import without -d option. > > How does it affect 'zpool import' behaviour? On FreeBSD when -d is not > given we should not scan entire /dev/, but take all available GEOM Here is a discussion thread that lead to this commit: http://thread.gmane.org/gmane.os.freebsd.current/141813 > providers from the GEOM. > >> Reported by: Bruce Cran Submitted by: Fabian Keil >> MFC after: 2 weeks >> >> Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c >> >> Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c >> ============================================================================== >> >> --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue May 15 16:17:30 2012 (r235477) >> +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue May 15 >> 17:07:29 2012 (r235478) @@ -1909,7 +1909,7 @@ zpool_do_import(int argc, >> char **argv) >> >> if (searchdirs == NULL) { searchdirs = safe_malloc(sizeof (char *)); - >> searchdirs[0] = "/dev/dsk"; + searchdirs[0] = "/dev"; nsearch = 1; } >> > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun May 20 20:25:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71518106566C; Sun, 20 May 2012 20:25:23 +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 5B7958FC14; Sun, 20 May 2012 20:25:23 +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 q4KKPNPB014172; Sun, 20 May 2012 20:25:23 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KKPNAx014170; Sun, 20 May 2012 20:25:23 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205202025.q4KKPNAx014170@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 20 May 2012 20:25:23 +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: r235696 - stable/9/lib/libipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 20:25:23 -0000 Author: bz Date: Sun May 20 20:25:22 2012 New Revision: 235696 URL: http://svn.freebsd.org/changeset/base/235696 Log: MFC r231532: MFp4 204292: Ignore the NAT_T extension types so we can at least dump the SADB from the in-base libipsec/setkey without error when NAT_T support is present in the kernel, though not printing the additional information yet. However in case there is no NAT_T support in kernel still consider them to be an error. Modified: stable/9/lib/libipsec/pfkey.c Directory Properties: stable/9/lib/libipsec/ (props changed) Modified: stable/9/lib/libipsec/pfkey.c ============================================================================== --- stable/9/lib/libipsec/pfkey.c Sun May 20 18:25:45 2012 (r235695) +++ stable/9/lib/libipsec/pfkey.c Sun May 20 20:25:22 2012 (r235696) @@ -1778,6 +1778,18 @@ pfkey_align(msg, mhp) case SADB_X_EXT_SA2: mhp[ext->sadb_ext_type] = (caddr_t)ext; break; + case SADB_X_EXT_NAT_T_TYPE: + case SADB_X_EXT_NAT_T_SPORT: + case SADB_X_EXT_NAT_T_DPORT: + /* case SADB_X_EXT_NAT_T_OA: is OAI */ + case SADB_X_EXT_NAT_T_OAI: + case SADB_X_EXT_NAT_T_OAR: + case SADB_X_EXT_NAT_T_FRAG: + if (feature_present("ipsec_natt")) { + mhp[ext->sadb_ext_type] = (caddr_t)ext; + break; + } + /* FALLTHROUGH */ default: __ipsec_errcode = EIPSEC_INVAL_EXTTYPE; return -1; From owner-svn-src-all@FreeBSD.ORG Sun May 20 20:25:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 310351065674; Sun, 20 May 2012 20:25:58 +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 1BAC08FC1A; Sun, 20 May 2012 20:25: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 q4KKPvx4014227; Sun, 20 May 2012 20:25:57 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KKPv7a014225; Sun, 20 May 2012 20:25:57 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205202025.q4KKPv7a014225@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 20 May 2012 20:25:57 +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: r235697 - stable/8/lib/libipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 20:25:58 -0000 Author: bz Date: Sun May 20 20:25:57 2012 New Revision: 235697 URL: http://svn.freebsd.org/changeset/base/235697 Log: MFC r231532: MFp4 204292: Ignore the NAT_T extension types so we can at least dump the SADB from the in-base libipsec/setkey without error when NAT_T support is present in the kernel, though not printing the additional information yet. However in case there is no NAT_T support in kernel still consider them to be an error. Modified: stable/8/lib/libipsec/pfkey.c Directory Properties: stable/8/lib/libipsec/ (props changed) Modified: stable/8/lib/libipsec/pfkey.c ============================================================================== --- stable/8/lib/libipsec/pfkey.c Sun May 20 20:25:22 2012 (r235696) +++ stable/8/lib/libipsec/pfkey.c Sun May 20 20:25:57 2012 (r235697) @@ -1778,6 +1778,18 @@ pfkey_align(msg, mhp) case SADB_X_EXT_SA2: mhp[ext->sadb_ext_type] = (caddr_t)ext; break; + case SADB_X_EXT_NAT_T_TYPE: + case SADB_X_EXT_NAT_T_SPORT: + case SADB_X_EXT_NAT_T_DPORT: + /* case SADB_X_EXT_NAT_T_OA: is OAI */ + case SADB_X_EXT_NAT_T_OAI: + case SADB_X_EXT_NAT_T_OAR: + case SADB_X_EXT_NAT_T_FRAG: + if (feature_present("ipsec_natt")) { + mhp[ext->sadb_ext_type] = (caddr_t)ext; + break; + } + /* FALLTHROUGH */ default: __ipsec_errcode = EIPSEC_INVAL_EXTTYPE; return -1; From owner-svn-src-all@FreeBSD.ORG Sun May 20 20:50:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 167671065670; Sun, 20 May 2012 20:50:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F25F8FC08; Sun, 20 May 2012 20:50: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 q4KKofNp015407; Sun, 20 May 2012 20:50:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KKoe9S015405; Sun, 20 May 2012 20:50:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201205202050.q4KKoe9S015405@svn.freebsd.org> From: Warner Losh Date: Sun, 20 May 2012 20:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235698 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 20:50:42 -0000 Author: imp Date: Sun May 20 20:50:40 2012 New Revision: 235698 URL: http://svn.freebsd.org/changeset/base/235698 Log: Minor cleanup before some more major changes: o main_clock_hz isn't used, eliminate it o move main clock calculation code and table so we have only one ifdef. Modified: head/sys/arm/at91/at91_pmc.c Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Sun May 20 20:25:57 2012 (r235697) +++ head/sys/arm/at91/at91_pmc.c Sun May 20 20:50:40 2012 (r235698) @@ -55,7 +55,6 @@ static struct at91_pmc_softc { bus_space_handle_t sc_sh; struct resource *mem_res; /* Memory resource */ device_t dev; - unsigned int main_clock_hz; uint32_t pllb_init; } *pmc_softc; @@ -147,18 +146,6 @@ static struct at91_pmc_clock *clock_list &cpu }; -#if !defined(AT91C_MAIN_CLOCK) -static const unsigned int at91_mainf_tbl[] = { - 3000000, 3276800, 3686400, 3840000, 4000000, - 4433619, 4915200, 5000000, 5242880, 6000000, - 6144000, 6400000, 6553600, 7159090, 7372800, - 7864320, 8000000, 9830400, 10000000, 11059200, - 12000000, 12288000, 13560000, 14318180, 14745600, - 16000000, 17344700, 18432000, 20000000 -}; -#define MAINF_TBL_LEN (sizeof(at91_mainf_tbl) / sizeof(*at91_mainf_tbl)) -#endif - static inline uint32_t RD4(struct at91_pmc_softc *sc, bus_size_t off) { @@ -412,7 +399,6 @@ at91_pmc_init_clock(struct at91_pmc_soft udpck.pmc_mask = PMC_SCER_UDP_SAM9; } mckr = RD4(sc, PMC_MCKR); - sc->main_clock_hz = main_clock; main_ck.hz = main_clock; at91_pmc_pll_rate(&plla, RD4(sc, CKGR_PLLAR)); @@ -465,7 +451,7 @@ at91_pmc_init_clock(struct at91_pmc_soft device_printf(sc->dev, "Primary: %d Hz PLLA: %d MHz CPU: %d MHz MCK: %d MHz\n", - sc->main_clock_hz, + main_clock, plla.hz / 1000000, cpu.hz / 1000000, mck.hz / 1000000); @@ -520,6 +506,16 @@ at91_pmc_probe(device_t dev) } #if !defined(AT91C_MAIN_CLOCK) +static const unsigned int at91_mainf_tbl[] = { + 3000000, 3276800, 3686400, 3840000, 4000000, + 4433619, 4915200, 5000000, 5242880, 6000000, + 6144000, 6400000, 6553600, 7159090, 7372800, + 7864320, 8000000, 9830400, 10000000, 11059200, + 12000000, 12288000, 13560000, 14318180, 14745600, + 16000000, 17344700, 18432000, 20000000 +}; +#define MAINF_TBL_LEN (sizeof(at91_mainf_tbl) / sizeof(*at91_mainf_tbl)) + static unsigned int at91_pmc_sense_mainf(struct at91_pmc_softc *sc) { From owner-svn-src-all@FreeBSD.ORG Sun May 20 22:06:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D49A0106566B; Sun, 20 May 2012 22:06:32 +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 BF2398FC14; Sun, 20 May 2012 22:06: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 q4KM6Wpv019546; Sun, 20 May 2012 22:06:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KM6W9E019544; Sun, 20 May 2012 22:06:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205202206.q4KM6W9E019544@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 20 May 2012 22:06:32 +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: r235700 - stable/9/usr.sbin/jls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 22:06:33 -0000 Author: bz Date: Sun May 20 22:06:32 2012 New Revision: 235700 URL: http://svn.freebsd.org/changeset/base/235700 Log: MFC r232613: Fix building with WITHOUT_INET_SUPPORT set. Reviewed by: jamie (actually provided the real fix) Modified: stable/9/usr.sbin/jls/jls.c Directory Properties: stable/9/usr.sbin/jls/ (props changed) Modified: stable/9/usr.sbin/jls/jls.c ============================================================================== --- stable/9/usr.sbin/jls/jls.c Sun May 20 21:05:51 2012 (r235699) +++ stable/9/usr.sbin/jls/jls.c Sun May 20 22:06:32 2012 (r235700) @@ -403,11 +403,13 @@ print_jail(int pflags, int jflags) #ifdef INET (!ip4_ok || params[1].jp_valuelen == 0) ? "-" : inet_ntoa(*(struct in_addr *)params[1].jp_value), + (char *)params[2-!ip4_ok].jp_value, + (char *)params[3-!ip4_ok].jp_value); #else "-", + (char *)params[1].jp_value, + (char *)params[2].jp_value); #endif - (char *)params[2-!ip4_ok].jp_value, - (char *)params[3-!ip4_ok].jp_value); else { param_values = alloca(nparams * sizeof(*param_values)); for (i = 0; i < nparams; i++) { From owner-svn-src-all@FreeBSD.ORG Sun May 20 22:22:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34E4D106564A; Sun, 20 May 2012 22:22:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76B218FC08; Sun, 20 May 2012 22:22: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 q4KMLxcb020452; Sun, 20 May 2012 22:21:59 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KMLxFk020445; Sun, 20 May 2012 22:21:59 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201205202221.q4KMLxFk020445@svn.freebsd.org> From: Martin Matuska Date: Sun, 20 May 2012 22:21:59 +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: r235701 - in stable/9/cddl/contrib/opensolaris: cmd/zdb cmd/zfs lib/libzfs/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 22:22:08 -0000 Author: mm Date: Sun May 20 22:21:59 2012 New Revision: 235701 URL: http://svn.freebsd.org/changeset/base/235701 Log: MFC r235212, r235216, r235217: MFC r325212 [1]: Import illumos changeset 13618:c6ae14a341e8 2088 zdb could use a reasonable manual page Rewrite new zdb manpage to mdoc(7) MFC r235216 [2]: Add support for force unmounting ZFS filesystems during "zfs rename" with the -f flag. Reimplementation of the illumos changeset 13677:a0cbef703c12 2635 'zfs rename -f' to perform force unmount MFC r235217 [3]: Remove unreachable break in zfs_main.c Partial import of illumos changeset 13622:e5889df1eaac 2077 lots of unreachable breaks in illumos gate References: https://www.illumos.org/issues/2088 [1] https://www.illumos.org/issues/2635 [2] https://www.illumos.org/issues/2077 [3] PR: 164447 [1], 164447 [2], 167370 [3] Suggested by: Marcelo Araujo Obtained from: illumos (issue #2088 [1], #2635 [2], #2077 [3]) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun May 20 22:06:32 2012 (r235700) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun May 20 22:21:59 2012 (r235701) @@ -1,61 +1,286 @@ '\" te -.\" Copyright (c) 2011, Martin Matuska . +.\" Copyright (c) 2012, Martin Matuska . .\" All Rights Reserved. .\" -.\" The contents of this file are subject to the terms of the -.\" Common Development and Distribution License (the "License"). -.\" You may not use this file except in compliance with the License. -.\" -.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -.\" or http://www.opensolaris.org/os/licensing. -.\" See the License for the specific language governing permissions -.\" and limitations under the License. -.\" -.\" When distributing Covered Code, include this CDDL HEADER in each -.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. -.\" If applicable, add the following below this CDDL HEADER, with the -.\" fields enclosed by brackets "[]" replaced with your own identifying -.\" information: Portions Copyright [yyyy] [name of copyright owner] +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. .\" -.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved. +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright 2012, Richard Lowe. +.\" Copyright (c) 2012, Marcelo Araujo . +.\" All Rights Reserved. .\" .\" $FreeBSD$ .\" -.Dd November 26, 2011 +.Dd May 10, 2012 .Dt ZDB 8 .Os .Sh NAME .Nm zdb -.Nd ZFS debugger +.Nd Display zpool debugging and consistency information .Sh SYNOPSIS .Nm -.Ar pool +.Op Fl CumdibcsDvhLXFPA +.Op Fl e Op Fl p Ar path... +.Op Fl t Ar txg +.Ar poolname +.Op Ar object ... +.Nm +.Op Fl divPA +.Op Fl e Op Fl p Ar path... +.Ar dataset +.Op Ar object ... +.Nm +.Fl m Op Fl LXFPA +.Op Fl t Ar txg +.Op Fl e Op Fl p Ar path... +.Ar poolname +.Nm +.Fl R Op Fl A +.Op Fl e Op Fl p Ar path... +.Ar poolname +.Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags +.Nm +.Fl S +.Op Fl AP +.Op Fl e Op Fl p Ar path... +.Ar poolname +.Nm +.Fl l +.Op Fl uA +.Ar device +.Nm +.Fl C +.Op Fl A +.Op Fl U Ar cache .Sh DESCRIPTION The .Nm -command is used by support engineers to diagnose failures and -gather statistics. Since the -.Tn ZFS -file system is always consistent on disk and is self-repairing, -.Nm -should only be run under the direction by a support engineer. -.Pp -If no arguments are specified, -.Nm -performs basic consistency checks on the pool and associated datasets, and -report any problems detected. -.Nm -Any options supported by this command are internal to Sun and subject to change -at any time. -.Sh EXIT STATUS -The following exit values are returned: -.Bl -tag -offset 2n -width 2n -.It 0 -The pool is consistent. -.It 1 -An error was detected. -.It 2 -Invalid command line options were specified. +utility displays information about a ZFS pool useful for debugging and +performs some amount of consistency checking. +It is a not a general purpose tool and options (and facilities) may change. +This is neither a +.Xr fsck 8 +nor a +.Xr fsdb 8 +utility. +.Pp +The output of this command in general reflects the on-disk structure of a ZFS +pool, and is inherently unstable. +The precise output of most invocations is not documented, a knowledge of ZFS +internals is assumed. +.Pp +When operating on an imported and active pool it is possible, though unlikely, +that zdb may interpret inconsistent pool data and behave erratically. +.Sh OPTIONS +Display options: +.Bl -tag -width indent +.It Fl b +Display statistics regarding the number, size (logical, physical and +allocated) and deduplication of blocks. +.It Fl c +Verify the checksum of all metadata blocks while printing block statistics +(see +.Fl b Ns ). +.Pp +If specified multiple times, verify the checksums of all blocks. +.It Fl C +Display information about the configuration. If specified with no other +options, instead display information about the cache file +.Ns ( Pa /etc/zfs/zpool.cache Ns ). +To specify the cache file to display, see +.Fl U +.Pp +If specified multiple times, and a pool name is also specified display both +the cached configuration and the on-disk configuration. +If specified multiple times with +.FL e +also display the configuration that would be used were the pool to be +imported. +.It Fl d +Display information about datasets. Specified once, displays basic dataset +information: ID, create transaction, size, and object count. +.Pp +If specified multiple times provides greater and greater verbosity. +.Pp +If object IDs are specified, display information about those specific objects only. +.It Fl D +Display deduplication statistics, including the deduplication ratio (dedup), +compression ratio (compress), inflation due to the zfs copies property +(copies), and an overall effective ratio (dedup * compress / copies). +.Pp +If specified twice, display a histogram of deduplication statistics, showing +the allocated (physically present on disk) and referenced (logically +referenced in the pool) block counts and sizes by reference count. +.It Fl h +Display pool history similar to +.Cm zpool history , +but include internal changes, transaction, and dataset information. +.It Fl i +Display information about intent log (ZIL) entries relating to each +dataset. +If specified multiple times, display counts of each intent log transaction +type. +.It Fl l Ar device +Display the vdev labels from the specified device. +If the +.Fl u +option is also specified, also display the uberblocks on this device. +.It Fl L +Disable leak tracing and the loading of space maps. +By default, +.Nm +verifies that all non-free blocks are referenced, which can be very expensive. +.It Fl m +Display the offset, spacemap, and free space of each metaslab. +When specified twice, also display information about the maximum contiguous +free space and the percentage of free space in each space map. +When specified three times display every spacemap record. +.It Xo +.Fl R Ar poolname +.Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags +.Xc +Read and display a block from the specified device. By default the block is +displayed as a hex dump, but see the description of the +.Fl r +flag, below. +.Pp +The block is specified in terms of a colon-separated tuple +.Ar vdev +(an integer vdev identifier) +.Ar offset +(the offset within the vdev) +.Ar size +(the size of the block to read) and, optionally, +.Ar flags +(a set of flags, described below). +.Bl -tag -width indent +.It Sy b offset +Print block pointer +.It Sy d +Decompress the block +.It Sy e +Byte swap the block +.It Sy g +Dump gang block header +.It Sy i +Dump indirect block +.It Sy r +Dump raw uninterpreted block data +.El +.It Fl s +Report statistics on +.Nm Ns 's +I/O. +Display operation counts, bandwidth, and error counts of I/O to the pool from +.Nm . +.It Fl S +Simulate the effects of deduplication, constructing a DDT and then display +that DDT as with \fB-DD\fR. +.It Fl u +Display the current uberblock. +.El +.Pp +Other options: +.Bl -tag -width indent +.It Fl A +Do not abort should any assertion fail. +.It Fl AA +Enable panic recovery, certain errors which would otherwise be fatal are +demoted to warnings. +.It Fl AAA +Do not abort if asserts fail and also enable panic recovery. +.It Fl e Op Fl p Ar path... +Operate on an exported pool, not present in +.Pa /etc/zfs/zpool.cache . +The +.Fl p +flag specifies the path under which devices are to be searched. +.It Fl F +Attempt to make an unreadable pool readable by trying progressively older +transactions. +.It Fl P +Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather +than 1M. +.It Fl t Ar transaction +Specify the highest transaction to use when searching for uberblocks. +See also the +.Fl u +and +.Fl l +options for a means to see the available uberblocks and their associated +transaction numbers. +.It Fl U Ar cachefile +Use a cache file other than +.Pa /etc/zfs/zpool.cache . +This option is only valid with +.Fl C +.It Fl v +Enable verbosity. +Specify multiple times for increased verbosity. +.It Fl X +Attempt +.Ql extreme +transaction rewind, that is attempt the same recovery as +.Fl F +but read transactions otherwise deemed too old. +.El +.Pp +Specifying a display option more than once enables verbosity for only that +option, with more occurrences enabling more verbosity. +.Pp +If no options are specified, all information about the named pool will be +displayed at default verbosity. +.Sh EXAMPLES +.Bl -tag -width 0n +.It Sy Example 1 Display the configuration of imported pool 'rpool' +.Bd -literal -offset 2n +.Li # Ic zdb -C rpool + +MOS Configuration: + version: 28 + name: 'rpool' + ... +.Ed +.It Sy Example 2 Display basic dataset information about 'rpool' +.Bd -literal -offset 2n +.Li # Ic zdb -d rpool +Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects +Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects +... +.Ed +.It Xo Sy Example 3 Display basic information about object 0 in +.Sy 'rpool/export/home' +.Xc +.Bd -literal -offset 2n +.Li # Ic zdb -d rpool/export/home 0 +Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects + + Object lvl iblk dblk dsize lsize %full type + 0 7 16K 16K 15.0K 16K 25.00 DMU dnode +.Ed +.It Xo Sy Example 4 Display the predicted effect of enabling deduplication on +.Sy 'rpool' +.Xc +.Bd -literal -offset 2n +.Li # Ic zdb -S rpool +Simulated DDT histogram: + +bucket allocated referenced +______ ______________________________ ______________________________ +refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE +------ ------ ----- ----- ----- ------ ----- ----- ----- + 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G + 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G + ... +dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00 +.Ed .El .Sh SEE ALSO .Xr zfs 8 , @@ -64,16 +289,18 @@ Invalid command line options were specif This manual page is a .Xr mdoc 7 reimplementation of the -.Tn OpenSolaris +.Tn illumos manual page .Em zdb(1M) , modified and customized for .Fx and licensed under the -.Tn Common Development and Distribution License +Common Development and Distribution License .Pq Tn CDDL . .Pp The .Xr mdoc 7 implementation of this manual page was initially written by -.An Martin Matuska Aq mm@FreeBSD.org . +.An Martin Matuska Aq mm@FreeBSD.org +and +.An Marcelo Araujo Aq araujo@FreeBSD.org . Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun May 20 22:06:32 2012 (r235700) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun May 20 22:21:59 2012 (r235701) @@ -102,13 +102,16 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumdibcsDvhL] poolname [object...]\n" - " %s [-div] dataset [object...]\n" - " %s -m [-L] poolname [vdev [metaslab...]]\n" - " %s -R poolname vdev:offset:size[:flags]\n" - " %s -S poolname\n" - " %s -l [-u] device\n" - " %s -C\n\n", + "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]]" + "poolname [object...]\n" + " %s [-divPA] [-e -p path...] dataset [object...]\n" + " %s -m [-LXFPA] [-t txg] [-e [-p path...]]" + "poolname [vdev [metaslab...]]\n" + " %s -R [-A] [-e [-p path...]] poolname " + "vdev:offset:size[:flags]\n" + " %s -S [-PA] [-e [-p path...]] poolname\n" + " %s -l [-uA] device\n" + " %s -C [-A] [-U config]\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); (void) fprintf(stderr, " Dataset name must include at least one " @@ -150,7 +153,7 @@ usage(void) "has altroot/not in a cachefile\n"); (void) fprintf(stderr, " -p -- use one or more with " "-e to specify path to vdev dir\n"); - (void) fprintf(stderr, " -P print numbers parsable\n"); + (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -t -- highest txg to use when " "searching for uberblocks\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun May 20 22:06:32 2012 (r235700) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun May 20 22:21:59 2012 (r235701) @@ -18,7 +18,7 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright (c) 2011 by Delphix. All rights reserved. +.\" Copyright (c) 2012 by Delphix. All rights reserved. .\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" @@ -77,10 +77,12 @@ .Ar clone-filesystem .Nm .Cm rename +.Op Fl f .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm rename +.Op Fl f .Fl p .Ar filesystem Ns | Ns Ar volume .Ar filesystem Ns | Ns Ar volume @@ -1638,12 +1640,14 @@ subcommand can be used to rename any con .It Xo .Nm .Cm rename +.Op Fl f .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc .It Xo .Nm .Cm rename +.Op Fl f .Fl p .Ar filesystem Ns | Ns Ar volume .Ar filesystem Ns | Ns Ar volume @@ -1677,6 +1681,11 @@ property is set to or .Cm none , file system is not unmounted even if this option is not given. +.It Fl f +Force unmount any filesystems that need to be unmounted in the process. +This flag has no effect if used together with the +.Fl u +flag. .El .It Xo .Nm Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun May 20 22:06:32 2012 (r235700) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun May 20 22:21:59 2012 (r235701) @@ -22,10 +22,11 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2012 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. - * Copyright (c) 2011 Martin Matuska . All rights reserved. + * Copyright (c) 2012 Martin Matuska . All rights reserved. */ #include @@ -256,9 +257,10 @@ get_usage(zfs_help_t idx) "snapshot>\n" "\treceive [-vnFu] [-d | -e] \n")); case HELP_RENAME: - return (gettext("\trename " + return (gettext("\trename [-f] " "\n" - "\trename -p \n" + "\trename [-f] -p " + "\n" "\trename -r \n" "\trename -u [-p] ")); case HELP_ROLLBACK: @@ -758,7 +760,6 @@ zfs_do_create(int argc, char **argv) (void) fprintf(stderr, gettext("missing size " "argument\n")); goto badusage; - break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -3080,8 +3081,8 @@ zfs_do_list(int argc, char **argv) } /* - * zfs rename - * zfs rename -p + * zfs rename [-f] + * zfs rename [-f] -p * zfs rename -r * zfs rename -u [-p] * @@ -3101,7 +3102,7 @@ zfs_do_rename(int argc, char **argv) boolean_t parents = B_FALSE; /* check options */ - while ((c = getopt(argc, argv, "pru")) != -1) { + while ((c = getopt(argc, argv, "fpru")) != -1) { switch (c) { case 'p': parents = B_TRUE; @@ -3112,6 +3113,9 @@ zfs_do_rename(int argc, char **argv) case 'u': flags.nounmount = B_TRUE; break; + case 'f': + flags.forceunmount = B_TRUE; + break; case '?': default: (void) fprintf(stderr, gettext("invalid option '%c'\n"), Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sun May 20 22:06:32 2012 (r235700) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sun May 20 22:21:59 2012 (r235701) @@ -26,6 +26,7 @@ * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * All rights reserved. + * Copyright (c) 2012 Martin Matuska . All rights reserved. */ #ifndef _LIBZFS_H @@ -541,6 +542,9 @@ typedef struct renameflags { /* don't unmount file systems */ int nounmount : 1; + + /* force unmount file systems */ + int forceunmount : 1; } renameflags_t; extern int zfs_rename(zfs_handle_t *, const char *, renameflags_t flags); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun May 20 22:06:32 2012 (r235700) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun May 20 22:21:59 2012 (r235701) @@ -25,6 +25,7 @@ * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. + * Copyright (c) 2012 Martin Matuska . All rights reserved. */ #include @@ -3721,7 +3722,8 @@ zfs_rename(zfs_handle_t *zhp, const char } else { if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, - flags.nounmount ? CL_GATHER_DONT_UNMOUNT : 0, 0)) == NULL) { + flags.nounmount ? CL_GATHER_DONT_UNMOUNT : 0, + flags.forceunmount ? MS_FORCE : 0)) == NULL) { return (-1); } From owner-svn-src-all@FreeBSD.ORG Sun May 20 22:23:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0286C106566C; Sun, 20 May 2012 22:23:59 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE67D8FC15; Sun, 20 May 2012 22:23: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 q4KMNwTX020590; Sun, 20 May 2012 22:23:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KMNwcd020583; Sun, 20 May 2012 22:23:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201205202223.q4KMNwcd020583@svn.freebsd.org> From: Martin Matuska Date: Sun, 20 May 2012 22:23: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: r235702 - in stable/8/cddl/contrib/opensolaris: cmd/zdb cmd/zfs lib/libzfs/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 22:23:59 -0000 Author: mm Date: Sun May 20 22:23:58 2012 New Revision: 235702 URL: http://svn.freebsd.org/changeset/base/235702 Log: MFC r235212, r235216, r235217: MFC r325212 [1]: Import illumos changeset 13618:c6ae14a341e8 2088 zdb could use a reasonable manual page Rewrite new zdb manpage to mdoc(7) MFC r235216 [2]: Add support for force unmounting ZFS filesystems during "zfs rename" with the -f flag. Reimplementation of the illumos changeset 13677:a0cbef703c12 2635 'zfs rename -f' to perform force unmount MFC r235217 [3]: Remove unreachable break in zfs_main.c Partial import of illumos changeset 13622:e5889df1eaac 2077 lots of unreachable breaks in illumos gate References: https://www.illumos.org/issues/2088 [1] https://www.illumos.org/issues/2635 [2] https://www.illumos.org/issues/2077 [3] PR: 164447 [1], 164447 [2], 167370 [3] Suggested by: Marcelo Araujo Obtained from: illumos (issue #2088 [1], #2635 [2], #2077 [3]) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun May 20 22:23:58 2012 (r235702) @@ -1,61 +1,286 @@ '\" te -.\" Copyright (c) 2011, Martin Matuska . +.\" Copyright (c) 2012, Martin Matuska . .\" All Rights Reserved. .\" -.\" The contents of this file are subject to the terms of the -.\" Common Development and Distribution License (the "License"). -.\" You may not use this file except in compliance with the License. -.\" -.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -.\" or http://www.opensolaris.org/os/licensing. -.\" See the License for the specific language governing permissions -.\" and limitations under the License. -.\" -.\" When distributing Covered Code, include this CDDL HEADER in each -.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. -.\" If applicable, add the following below this CDDL HEADER, with the -.\" fields enclosed by brackets "[]" replaced with your own identifying -.\" information: Portions Copyright [yyyy] [name of copyright owner] +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. .\" -.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved. +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright 2012, Richard Lowe. +.\" Copyright (c) 2012, Marcelo Araujo . +.\" All Rights Reserved. .\" .\" $FreeBSD$ .\" -.Dd November 26, 2011 +.Dd May 10, 2012 .Dt ZDB 8 .Os .Sh NAME .Nm zdb -.Nd ZFS debugger +.Nd Display zpool debugging and consistency information .Sh SYNOPSIS .Nm -.Ar pool +.Op Fl CumdibcsDvhLXFPA +.Op Fl e Op Fl p Ar path... +.Op Fl t Ar txg +.Ar poolname +.Op Ar object ... +.Nm +.Op Fl divPA +.Op Fl e Op Fl p Ar path... +.Ar dataset +.Op Ar object ... +.Nm +.Fl m Op Fl LXFPA +.Op Fl t Ar txg +.Op Fl e Op Fl p Ar path... +.Ar poolname +.Nm +.Fl R Op Fl A +.Op Fl e Op Fl p Ar path... +.Ar poolname +.Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags +.Nm +.Fl S +.Op Fl AP +.Op Fl e Op Fl p Ar path... +.Ar poolname +.Nm +.Fl l +.Op Fl uA +.Ar device +.Nm +.Fl C +.Op Fl A +.Op Fl U Ar cache .Sh DESCRIPTION The .Nm -command is used by support engineers to diagnose failures and -gather statistics. Since the -.Tn ZFS -file system is always consistent on disk and is self-repairing, -.Nm -should only be run under the direction by a support engineer. -.Pp -If no arguments are specified, -.Nm -performs basic consistency checks on the pool and associated datasets, and -report any problems detected. -.Nm -Any options supported by this command are internal to Sun and subject to change -at any time. -.Sh EXIT STATUS -The following exit values are returned: -.Bl -tag -offset 2n -width 2n -.It 0 -The pool is consistent. -.It 1 -An error was detected. -.It 2 -Invalid command line options were specified. +utility displays information about a ZFS pool useful for debugging and +performs some amount of consistency checking. +It is a not a general purpose tool and options (and facilities) may change. +This is neither a +.Xr fsck 8 +nor a +.Xr fsdb 8 +utility. +.Pp +The output of this command in general reflects the on-disk structure of a ZFS +pool, and is inherently unstable. +The precise output of most invocations is not documented, a knowledge of ZFS +internals is assumed. +.Pp +When operating on an imported and active pool it is possible, though unlikely, +that zdb may interpret inconsistent pool data and behave erratically. +.Sh OPTIONS +Display options: +.Bl -tag -width indent +.It Fl b +Display statistics regarding the number, size (logical, physical and +allocated) and deduplication of blocks. +.It Fl c +Verify the checksum of all metadata blocks while printing block statistics +(see +.Fl b Ns ). +.Pp +If specified multiple times, verify the checksums of all blocks. +.It Fl C +Display information about the configuration. If specified with no other +options, instead display information about the cache file +.Ns ( Pa /etc/zfs/zpool.cache Ns ). +To specify the cache file to display, see +.Fl U +.Pp +If specified multiple times, and a pool name is also specified display both +the cached configuration and the on-disk configuration. +If specified multiple times with +.FL e +also display the configuration that would be used were the pool to be +imported. +.It Fl d +Display information about datasets. Specified once, displays basic dataset +information: ID, create transaction, size, and object count. +.Pp +If specified multiple times provides greater and greater verbosity. +.Pp +If object IDs are specified, display information about those specific objects only. +.It Fl D +Display deduplication statistics, including the deduplication ratio (dedup), +compression ratio (compress), inflation due to the zfs copies property +(copies), and an overall effective ratio (dedup * compress / copies). +.Pp +If specified twice, display a histogram of deduplication statistics, showing +the allocated (physically present on disk) and referenced (logically +referenced in the pool) block counts and sizes by reference count. +.It Fl h +Display pool history similar to +.Cm zpool history , +but include internal changes, transaction, and dataset information. +.It Fl i +Display information about intent log (ZIL) entries relating to each +dataset. +If specified multiple times, display counts of each intent log transaction +type. +.It Fl l Ar device +Display the vdev labels from the specified device. +If the +.Fl u +option is also specified, also display the uberblocks on this device. +.It Fl L +Disable leak tracing and the loading of space maps. +By default, +.Nm +verifies that all non-free blocks are referenced, which can be very expensive. +.It Fl m +Display the offset, spacemap, and free space of each metaslab. +When specified twice, also display information about the maximum contiguous +free space and the percentage of free space in each space map. +When specified three times display every spacemap record. +.It Xo +.Fl R Ar poolname +.Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags +.Xc +Read and display a block from the specified device. By default the block is +displayed as a hex dump, but see the description of the +.Fl r +flag, below. +.Pp +The block is specified in terms of a colon-separated tuple +.Ar vdev +(an integer vdev identifier) +.Ar offset +(the offset within the vdev) +.Ar size +(the size of the block to read) and, optionally, +.Ar flags +(a set of flags, described below). +.Bl -tag -width indent +.It Sy b offset +Print block pointer +.It Sy d +Decompress the block +.It Sy e +Byte swap the block +.It Sy g +Dump gang block header +.It Sy i +Dump indirect block +.It Sy r +Dump raw uninterpreted block data +.El +.It Fl s +Report statistics on +.Nm Ns 's +I/O. +Display operation counts, bandwidth, and error counts of I/O to the pool from +.Nm . +.It Fl S +Simulate the effects of deduplication, constructing a DDT and then display +that DDT as with \fB-DD\fR. +.It Fl u +Display the current uberblock. +.El +.Pp +Other options: +.Bl -tag -width indent +.It Fl A +Do not abort should any assertion fail. +.It Fl AA +Enable panic recovery, certain errors which would otherwise be fatal are +demoted to warnings. +.It Fl AAA +Do not abort if asserts fail and also enable panic recovery. +.It Fl e Op Fl p Ar path... +Operate on an exported pool, not present in +.Pa /etc/zfs/zpool.cache . +The +.Fl p +flag specifies the path under which devices are to be searched. +.It Fl F +Attempt to make an unreadable pool readable by trying progressively older +transactions. +.It Fl P +Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather +than 1M. +.It Fl t Ar transaction +Specify the highest transaction to use when searching for uberblocks. +See also the +.Fl u +and +.Fl l +options for a means to see the available uberblocks and their associated +transaction numbers. +.It Fl U Ar cachefile +Use a cache file other than +.Pa /etc/zfs/zpool.cache . +This option is only valid with +.Fl C +.It Fl v +Enable verbosity. +Specify multiple times for increased verbosity. +.It Fl X +Attempt +.Ql extreme +transaction rewind, that is attempt the same recovery as +.Fl F +but read transactions otherwise deemed too old. +.El +.Pp +Specifying a display option more than once enables verbosity for only that +option, with more occurrences enabling more verbosity. +.Pp +If no options are specified, all information about the named pool will be +displayed at default verbosity. +.Sh EXAMPLES +.Bl -tag -width 0n +.It Sy Example 1 Display the configuration of imported pool 'rpool' +.Bd -literal -offset 2n +.Li # Ic zdb -C rpool + +MOS Configuration: + version: 28 + name: 'rpool' + ... +.Ed +.It Sy Example 2 Display basic dataset information about 'rpool' +.Bd -literal -offset 2n +.Li # Ic zdb -d rpool +Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects +Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects +... +.Ed +.It Xo Sy Example 3 Display basic information about object 0 in +.Sy 'rpool/export/home' +.Xc +.Bd -literal -offset 2n +.Li # Ic zdb -d rpool/export/home 0 +Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects + + Object lvl iblk dblk dsize lsize %full type + 0 7 16K 16K 15.0K 16K 25.00 DMU dnode +.Ed +.It Xo Sy Example 4 Display the predicted effect of enabling deduplication on +.Sy 'rpool' +.Xc +.Bd -literal -offset 2n +.Li # Ic zdb -S rpool +Simulated DDT histogram: + +bucket allocated referenced +______ ______________________________ ______________________________ +refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE +------ ------ ----- ----- ----- ------ ----- ----- ----- + 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G + 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G + ... +dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00 +.Ed .El .Sh SEE ALSO .Xr zfs 8 , @@ -64,16 +289,18 @@ Invalid command line options were specif This manual page is a .Xr mdoc 7 reimplementation of the -.Tn OpenSolaris +.Tn illumos manual page .Em zdb(1M) , modified and customized for .Fx and licensed under the -.Tn Common Development and Distribution License +Common Development and Distribution License .Pq Tn CDDL . .Pp The .Xr mdoc 7 implementation of this manual page was initially written by -.An Martin Matuska Aq mm@FreeBSD.org . +.An Martin Matuska Aq mm@FreeBSD.org +and +.An Marcelo Araujo Aq araujo@FreeBSD.org . Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun May 20 22:23:58 2012 (r235702) @@ -102,13 +102,16 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumdibcsDvhL] poolname [object...]\n" - " %s [-div] dataset [object...]\n" - " %s -m [-L] poolname [vdev [metaslab...]]\n" - " %s -R poolname vdev:offset:size[:flags]\n" - " %s -S poolname\n" - " %s -l [-u] device\n" - " %s -C\n\n", + "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]]" + "poolname [object...]\n" + " %s [-divPA] [-e -p path...] dataset [object...]\n" + " %s -m [-LXFPA] [-t txg] [-e [-p path...]]" + "poolname [vdev [metaslab...]]\n" + " %s -R [-A] [-e [-p path...]] poolname " + "vdev:offset:size[:flags]\n" + " %s -S [-PA] [-e [-p path...]] poolname\n" + " %s -l [-uA] device\n" + " %s -C [-A] [-U config]\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); (void) fprintf(stderr, " Dataset name must include at least one " @@ -150,7 +153,7 @@ usage(void) "has altroot/not in a cachefile\n"); (void) fprintf(stderr, " -p -- use one or more with " "-e to specify path to vdev dir\n"); - (void) fprintf(stderr, " -P print numbers parsable\n"); + (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -t -- highest txg to use when " "searching for uberblocks\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun May 20 22:23:58 2012 (r235702) @@ -18,7 +18,7 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright (c) 2011 by Delphix. All rights reserved. +.\" Copyright (c) 2012 by Delphix. All rights reserved. .\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" @@ -77,10 +77,12 @@ .Ar clone-filesystem .Nm .Cm rename +.Op Fl f .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm rename +.Op Fl f .Fl p .Ar filesystem Ns | Ns Ar volume .Ar filesystem Ns | Ns Ar volume @@ -1638,12 +1640,14 @@ subcommand can be used to rename any con .It Xo .Nm .Cm rename +.Op Fl f .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc .It Xo .Nm .Cm rename +.Op Fl f .Fl p .Ar filesystem Ns | Ns Ar volume .Ar filesystem Ns | Ns Ar volume @@ -1677,6 +1681,11 @@ property is set to or .Cm none , file system is not unmounted even if this option is not given. +.It Fl f +Force unmount any filesystems that need to be unmounted in the process. +This flag has no effect if used together with the +.Fl u +flag. .El .It Xo .Nm Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun May 20 22:23:58 2012 (r235702) @@ -22,10 +22,11 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2012 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. - * Copyright (c) 2011 Martin Matuska . All rights reserved. + * Copyright (c) 2012 Martin Matuska . All rights reserved. */ #include @@ -256,9 +257,10 @@ get_usage(zfs_help_t idx) "snapshot>\n" "\treceive [-vnFu] [-d | -e] \n")); case HELP_RENAME: - return (gettext("\trename " + return (gettext("\trename [-f] " "\n" - "\trename -p \n" + "\trename [-f] -p " + "\n" "\trename -r \n" "\trename -u [-p] ")); case HELP_ROLLBACK: @@ -758,7 +760,6 @@ zfs_do_create(int argc, char **argv) (void) fprintf(stderr, gettext("missing size " "argument\n")); goto badusage; - break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -3080,8 +3081,8 @@ zfs_do_list(int argc, char **argv) } /* - * zfs rename - * zfs rename -p + * zfs rename [-f] + * zfs rename [-f] -p * zfs rename -r * zfs rename -u [-p] * @@ -3101,7 +3102,7 @@ zfs_do_rename(int argc, char **argv) boolean_t parents = B_FALSE; /* check options */ - while ((c = getopt(argc, argv, "pru")) != -1) { + while ((c = getopt(argc, argv, "fpru")) != -1) { switch (c) { case 'p': parents = B_TRUE; @@ -3112,6 +3113,9 @@ zfs_do_rename(int argc, char **argv) case 'u': flags.nounmount = B_TRUE; break; + case 'f': + flags.forceunmount = B_TRUE; + break; case '?': default: (void) fprintf(stderr, gettext("invalid option '%c'\n"), Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sun May 20 22:23:58 2012 (r235702) @@ -26,6 +26,7 @@ * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * All rights reserved. + * Copyright (c) 2012 Martin Matuska . All rights reserved. */ #ifndef _LIBZFS_H @@ -541,6 +542,9 @@ typedef struct renameflags { /* don't unmount file systems */ int nounmount : 1; + + /* force unmount file systems */ + int forceunmount : 1; } renameflags_t; extern int zfs_rename(zfs_handle_t *, const char *, renameflags_t flags); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun May 20 22:21:59 2012 (r235701) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun May 20 22:23:58 2012 (r235702) @@ -25,6 +25,7 @@ * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. + * Copyright (c) 2012 Martin Matuska . All rights reserved. */ #include @@ -3721,7 +3722,8 @@ zfs_rename(zfs_handle_t *zhp, const char } else { if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, - flags.nounmount ? CL_GATHER_DONT_UNMOUNT : 0, 0)) == NULL) { + flags.nounmount ? CL_GATHER_DONT_UNMOUNT : 0, + flags.forceunmount ? MS_FORCE : 0)) == NULL) { return (-1); } From owner-svn-src-all@FreeBSD.ORG Sun May 20 22:55:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AACAB106566B; Sun, 20 May 2012 22:55:24 +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 9521D8FC08; Sun, 20 May 2012 22:55:24 +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 q4KMtOVi021954; Sun, 20 May 2012 22:55:24 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KMtOEp021952; Sun, 20 May 2012 22:55:24 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205202255.q4KMtOEp021952@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 20 May 2012 22:55:24 +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: r235703 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 22:55:24 -0000 Author: bz Date: Sun May 20 22:55:24 2012 New Revision: 235703 URL: http://svn.freebsd.org/changeset/base/235703 Log: MFC r232514: In nd6_options() ignore the RFC 6106 options completely rather than printing them if nd6_debug is enabled as unknown. Leave a comment about the RFC4191 option as I am undecided so far. Modified: stable/9/sys/netinet6/nd6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/nd6.c ============================================================================== --- stable/9/sys/netinet6/nd6.c Sun May 20 22:23:58 2012 (r235702) +++ stable/9/sys/netinet6/nd6.c Sun May 20 22:55:24 2012 (r235703) @@ -380,6 +380,14 @@ nd6_options(union nd_opts *ndopts) ndopts->nd_opts_pi_end = (struct nd_opt_prefix_info *)nd_opt; break; + /* What about ND_OPT_ROUTE_INFO? RFC 4191 */ + case ND_OPT_RDNSS: /* RFC 6106 */ + case ND_OPT_DNSSL: /* RFC 6106 */ + /* + * Silently ignore options we know and do not care about + * in the kernel. + */ + break; default: /* * Unknown options must be silently ignored, From owner-svn-src-all@FreeBSD.ORG Sun May 20 22:58:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DB0A106566B; Sun, 20 May 2012 22:58:38 +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 E0FD18FC0A; Sun, 20 May 2012 22:58: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 q4KMwbJW022129; Sun, 20 May 2012 22:58:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KMwbd7022127; Sun, 20 May 2012 22:58:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205202258.q4KMwbd7022127@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 20 May 2012 22:58: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: r235704 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 22:58:38 -0000 Author: bz Date: Sun May 20 22:58:37 2012 New Revision: 235704 URL: http://svn.freebsd.org/changeset/base/235704 Log: MFC r232514: In nd6_options() ignore the RFC 6106 options completely rather than printing them if nd6_debug is enabled as unknown. Leave a comment about the RFC4191 option as I am undecided so far. Modified: stable/8/sys/netinet6/nd6.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Sun May 20 22:55:24 2012 (r235703) +++ stable/8/sys/netinet6/nd6.c Sun May 20 22:58:37 2012 (r235704) @@ -370,6 +370,14 @@ nd6_options(union nd_opts *ndopts) ndopts->nd_opts_pi_end = (struct nd_opt_prefix_info *)nd_opt; break; + /* What about ND_OPT_ROUTE_INFO? RFC 4191 */ + case ND_OPT_RDNSS: /* RFC 6106 */ + case ND_OPT_DNSSL: /* RFC 6106 */ + /* + * Silently ignore options we know and do not care about + * in the kernel. + */ + break; default: /* * Unknown options must be silently ignored, From owner-svn-src-all@FreeBSD.ORG Sun May 20 23:33:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A53B1065670; Sun, 20 May 2012 23:33:11 +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 E96FC8FC08; Sun, 20 May 2012 23:33: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 q4KNXAeG023700; Sun, 20 May 2012 23:33:10 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KNXAxq023698; Sun, 20 May 2012 23:33:10 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205202333.q4KNXAxq023698@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 20 May 2012 23:33: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: r235705 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 23:33:11 -0000 Author: bz Date: Sun May 20 23:33:10 2012 New Revision: 235705 URL: http://svn.freebsd.org/changeset/base/235705 Log: MFC r232513: Correct typo in the RFC number for the constants based on IANA assignments for IPv6 Neighbor Discovery Option types for "IPv6 Router Advertisement Options for DNS Configuration". It is RFC 6106. Modified: stable/9/sys/netinet/icmp6.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/icmp6.h ============================================================================== --- stable/9/sys/netinet/icmp6.h Sun May 20 22:58:37 2012 (r235704) +++ stable/9/sys/netinet/icmp6.h Sun May 20 23:33:10 2012 (r235705) @@ -298,8 +298,8 @@ struct nd_opt_hdr { /* Neighbor discove #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5 #define ND_OPT_ROUTE_INFO 24 /* RFC 4191 */ -#define ND_OPT_RDNSS 25 /* RFC 6016 */ -#define ND_OPT_DNSSL 31 /* RFC 6016 */ +#define ND_OPT_RDNSS 25 /* RFC 6106 */ +#define ND_OPT_DNSSL 31 /* RFC 6106 */ struct nd_opt_prefix_info { /* prefix information */ u_int8_t nd_opt_pi_type; From owner-svn-src-all@FreeBSD.ORG Mon May 21 00:03:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B91E1106564A; Mon, 21 May 2012 00:03:13 +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 A35218FC17; Mon, 21 May 2012 00:03: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 q4L03DIk025087; Mon, 21 May 2012 00:03:13 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L03DQ0025085; Mon, 21 May 2012 00:03:13 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205210003.q4L03DQ0025085@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 21 May 2012 00:03:13 +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: r235706 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 00:03:13 -0000 Author: bz Date: Mon May 21 00:03:13 2012 New Revision: 235706 URL: http://svn.freebsd.org/changeset/base/235706 Log: MFC r232513: Correct typo in the RFC number for the constants based on IANA assignments for IPv6 Neighbor Discovery Option types for "IPv6 Router Advertisement Options for DNS Configuration". It is RFC 6106. Modified: stable/8/sys/netinet/icmp6.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/icmp6.h ============================================================================== --- stable/8/sys/netinet/icmp6.h Sun May 20 23:33:10 2012 (r235705) +++ stable/8/sys/netinet/icmp6.h Mon May 21 00:03:13 2012 (r235706) @@ -298,8 +298,8 @@ struct nd_opt_hdr { /* Neighbor discove #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5 #define ND_OPT_ROUTE_INFO 24 /* RFC 4191 */ -#define ND_OPT_RDNSS 25 /* RFC 6016 */ -#define ND_OPT_DNSSL 31 /* RFC 6016 */ +#define ND_OPT_RDNSS 25 /* RFC 6106 */ +#define ND_OPT_DNSSL 31 /* RFC 6106 */ struct nd_opt_prefix_info { /* prefix information */ u_int8_t nd_opt_pi_type; From owner-svn-src-all@FreeBSD.ORG Mon May 21 00:15:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90C541065672; Mon, 21 May 2012 00:15:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D8B28FC08; Mon, 21 May 2012 00:15: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 q4L0FYg4025692; Mon, 21 May 2012 00:15:34 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L0FYRc025690; Mon, 21 May 2012 00:15:34 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205210015.q4L0FYRc025690@svn.freebsd.org> From: Glen Barber Date: Mon, 21 May 2012 00:15:34 +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: r235707 - stable/9/usr.bin/join X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 00:15:35 -0000 Author: gjb (doc committer) Date: Mon May 21 00:15:34 2012 New Revision: 235707 URL: http://svn.freebsd.org/changeset/base/235707 Log: MFC r235597: Fix a typo that crept in. Modified: stable/9/usr.bin/join/join.1 Directory Properties: stable/9/usr.bin/join/ (props changed) Modified: stable/9/usr.bin/join/join.1 ============================================================================== --- stable/9/usr.bin/join/join.1 Mon May 21 00:03:13 2012 (r235706) +++ stable/9/usr.bin/join/join.1 Mon May 21 00:15:34 2012 (r235707) @@ -107,7 +107,7 @@ representing the join field. The elements of list must be either comma .Pq Ql \&, or whitespace separated. -(The letter requires quoting to protect it from the shell, or, a simpler +(The latter requires quoting to protect it from the shell, or, a simpler approach is to use multiple .Fl o options.) From owner-svn-src-all@FreeBSD.ORG Mon May 21 00:15:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 343B1106567E; Mon, 21 May 2012 00:15:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EE028FC08; Mon, 21 May 2012 00:15:48 +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 q4L0FlSZ025735; Mon, 21 May 2012 00:15:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L0FlPQ025733; Mon, 21 May 2012 00:15:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205210015.q4L0FlPQ025733@svn.freebsd.org> From: Glen Barber Date: Mon, 21 May 2012 00:15:47 +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: r235708 - stable/8/usr.bin/join X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 00:15:48 -0000 Author: gjb (doc committer) Date: Mon May 21 00:15:47 2012 New Revision: 235708 URL: http://svn.freebsd.org/changeset/base/235708 Log: MFC r235597: Fix a typo that crept in. Modified: stable/8/usr.bin/join/join.1 Directory Properties: stable/8/usr.bin/join/ (props changed) Modified: stable/8/usr.bin/join/join.1 ============================================================================== --- stable/8/usr.bin/join/join.1 Mon May 21 00:15:34 2012 (r235707) +++ stable/8/usr.bin/join/join.1 Mon May 21 00:15:47 2012 (r235708) @@ -113,7 +113,7 @@ representing the join field. The elements of list must be either comma .Pq Ql \&, or whitespace separated. -(The letter requires quoting to protect it from the shell, or, a simpler +(The latter requires quoting to protect it from the shell, or, a simpler approach is to use multiple .Fl o options.) From owner-svn-src-all@FreeBSD.ORG Mon May 21 00:15:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8EDE410656D1; Mon, 21 May 2012 00:15:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3122E8FC12; Mon, 21 May 2012 00:15:59 +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 q4L0Fxx9025780; Mon, 21 May 2012 00:15:59 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L0FwKq025778; Mon, 21 May 2012 00:15:58 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205210015.q4L0FwKq025778@svn.freebsd.org> From: Glen Barber Date: Mon, 21 May 2012 00:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235709 - stable/7/usr.bin/join X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 00:15:59 -0000 Author: gjb (doc committer) Date: Mon May 21 00:15:58 2012 New Revision: 235709 URL: http://svn.freebsd.org/changeset/base/235709 Log: MFC r235597: Fix a typo that crept in. Modified: stable/7/usr.bin/join/join.1 Directory Properties: stable/7/usr.bin/join/ (props changed) Modified: stable/7/usr.bin/join/join.1 ============================================================================== --- stable/7/usr.bin/join/join.1 Mon May 21 00:15:47 2012 (r235708) +++ stable/7/usr.bin/join/join.1 Mon May 21 00:15:58 2012 (r235709) @@ -113,7 +113,7 @@ representing the join field. The elements of list must be either comma .Pq Ql \&, or whitespace separated. -(The letter requires quoting to protect it from the shell, or, a simpler +(The latter requires quoting to protect it from the shell, or, a simpler approach is to use multiple .Fl o options.) From owner-svn-src-all@FreeBSD.ORG Mon May 21 02:23:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1972106566B; Mon, 21 May 2012 02:23:21 +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 81D338FC0A; Mon, 21 May 2012 02:23: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 q4L2NKFU031490; Mon, 21 May 2012 02:23:20 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L2NKYO031488; Mon, 21 May 2012 02:23:20 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205210223.q4L2NKYO031488@svn.freebsd.org> From: Kevin Lo Date: Mon, 21 May 2012 02:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235710 - head/sys/libkern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 02:23:21 -0000 Author: kevlo Date: Mon May 21 02:23:20 2012 New Revision: 235710 URL: http://svn.freebsd.org/changeset/base/235710 Log: Remove dead code Modified: head/sys/libkern/iconv_ucs.c Modified: head/sys/libkern/iconv_ucs.c ============================================================================== --- head/sys/libkern/iconv_ucs.c Mon May 21 00:15:58 2012 (r235709) +++ head/sys/libkern/iconv_ucs.c Mon May 21 02:23:20 2012 (r235710) @@ -102,12 +102,12 @@ iconv_ucs_open(struct iconv_converter_cl if (cspf) dp->convtype |= KICONV_UCS_COMBINE; for (i = 0; unicode_family[i].name; i++) { - if (strcmp(from, unicode_family[i].name) == 0) + if (strcasecmp(from, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].from_flag; - if (strcmp(to, unicode_family[i].name) == 0) + if (strcasecmp(to, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].to_flag; } - if (strcmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) + if (strcasecmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) dp->convtype |= KICONV_UCS_UCS4; else dp->convtype &= ~KICONV_UCS_UCS4; @@ -457,8 +457,6 @@ utf8_to_ucs4(const char *src, size_t *ut /* out of utf-16 range or having illegal bits */ return (0); } - if (w == 0) - return (0); if (srclen < w) return (0); From owner-svn-src-all@FreeBSD.ORG Mon May 21 02:30:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58A74106564A; Mon, 21 May 2012 02:30:23 +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 4354E8FC12; Mon, 21 May 2012 02:30:23 +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 q4L2UNna031813; Mon, 21 May 2012 02:30:23 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L2UN5b031810; Mon, 21 May 2012 02:30:23 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205210230.q4L2UN5b031810@svn.freebsd.org> From: Kevin Lo Date: Mon, 21 May 2012 02:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235711 - in head/sys: libkern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 02:30:23 -0000 Author: kevlo Date: Mon May 21 02:30:22 2012 New Revision: 235711 URL: http://svn.freebsd.org/changeset/base/235711 Log: Fix improper handling of variadic args with ICDEBUG PR: kern/168095 Submitted by: gcooper Modified: head/sys/libkern/iconv.c head/sys/sys/iconv.h Modified: head/sys/libkern/iconv.c ============================================================================== --- head/sys/libkern/iconv.c Mon May 21 02:23:20 2012 (r235710) +++ head/sys/libkern/iconv.c Mon May 21 02:30:22 2012 (r235711) @@ -549,9 +549,7 @@ int iconv_lookupcp(char **cpp, const char *s) { if (cpp == NULL) { - ICDEBUG("warning a NULL list passed\n", ""); /* XXX ISO variadic macros cannot - leave out the - variadic args */ + ICDEBUG("warning a NULL list passed\n", ""); return ENOENT; } for (; *cpp; cpp++) Modified: head/sys/sys/iconv.h ============================================================================== --- head/sys/sys/iconv.h Mon May 21 02:23:20 2012 (r235710) +++ head/sys/sys/iconv.h Mon May 21 02:30:22 2012 (r235711) @@ -240,7 +240,7 @@ int iconv_converter_tolowerstub(int c, v int iconv_converter_handler(module_t mod, int type, void *data); #ifdef ICONV_DEBUG -#define ICDEBUG(format, ...) printf("%s: "format, __func__ , __VA_ARGS__) +#define ICDEBUG(format, ...) printf("%s: "format, __func__ , ## __VA_ARGS__) #else #define ICDEBUG(format, ...) #endif From owner-svn-src-all@FreeBSD.ORG Mon May 21 02:41:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DEC41065670; Mon, 21 May 2012 02:41: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 89B2D8FC0A; Mon, 21 May 2012 02:41: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 q4L2fFg4032341; Mon, 21 May 2012 02:41:15 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L2fFIH032339; Mon, 21 May 2012 02:41:15 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205210241.q4L2fFIH032339@svn.freebsd.org> From: Kevin Lo Date: Mon, 21 May 2012 02:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235712 - head/sys/libkern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 02:41:15 -0000 Author: kevlo Date: Mon May 21 02:41:15 2012 New Revision: 235712 URL: http://svn.freebsd.org/changeset/base/235712 Log: Fix broken ref count Submitted by: gcooper Modified: head/sys/libkern/iconv.c Modified: head/sys/libkern/iconv.c ============================================================================== --- head/sys/libkern/iconv.c Mon May 21 02:30:22 2012 (r235711) +++ head/sys/libkern/iconv.c Mon May 21 02:41:15 2012 (r235712) @@ -133,6 +133,7 @@ iconv_register_converter(struct iconv_co static int iconv_unregister_converter(struct iconv_converter_class *dcp) { + dcp->refs--; if (dcp->refs > 1) { ICDEBUG("converter have %d referenses left\n", dcp->refs); return EBUSY; From owner-svn-src-all@FreeBSD.ORG Mon May 21 02:45:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A783D106566B; Mon, 21 May 2012 02:45:48 +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 57AF58FC0A; Mon, 21 May 2012 02:45:48 +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 q4L2jl6m032583; Mon, 21 May 2012 02:45:47 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L2jlE4032581; Mon, 21 May 2012 02:45:47 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205210245.q4L2jlE4032581@svn.freebsd.org> From: Kevin Lo Date: Mon, 21 May 2012 02:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235713 - head/sys/libkern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 02:45:48 -0000 Author: kevlo Date: Mon May 21 02:45:47 2012 New Revision: 235713 URL: http://svn.freebsd.org/changeset/base/235713 Log: Use strcmp that I replaced by accident. Modified: head/sys/libkern/iconv_ucs.c Modified: head/sys/libkern/iconv_ucs.c ============================================================================== --- head/sys/libkern/iconv_ucs.c Mon May 21 02:41:15 2012 (r235712) +++ head/sys/libkern/iconv_ucs.c Mon May 21 02:45:47 2012 (r235713) @@ -102,12 +102,12 @@ iconv_ucs_open(struct iconv_converter_cl if (cspf) dp->convtype |= KICONV_UCS_COMBINE; for (i = 0; unicode_family[i].name; i++) { - if (strcasecmp(from, unicode_family[i].name) == 0) + if (strcmp(from, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].from_flag; - if (strcasecmp(to, unicode_family[i].name) == 0) + if (strcmp(to, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].to_flag; } - if (strcasecmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) + if (strcmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) dp->convtype |= KICONV_UCS_UCS4; else dp->convtype &= ~KICONV_UCS_UCS4; From owner-svn-src-all@FreeBSD.ORG Mon May 21 03:06:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D7446106566B; Mon, 21 May 2012 03:06:31 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C33A58FC12; Mon, 21 May 2012 03:06: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 q4L36Vel033624; Mon, 21 May 2012 03:06:31 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L36VZ5033622; Mon, 21 May 2012 03:06:31 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201205210306.q4L36VZ5033622@svn.freebsd.org> From: David Xu Date: Mon, 21 May 2012 03:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235714 - head/gnu/usr.bin/gdb/libgdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 03:06:31 -0000 Author: davidxu Date: Mon May 21 03:06:31 2012 New Revision: 235714 URL: http://svn.freebsd.org/changeset/base/235714 Log: Print key value, an index, otherwise we don't know which key is allocated. Modified: head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Modified: head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c ============================================================================== --- head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Mon May 21 02:45:47 2012 (r235713) +++ head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Mon May 21 03:06:31 2012 (r235714) @@ -1311,7 +1311,7 @@ tsd_cb (thread_key_t key, void (*destruc else name = DEPRECATED_SYMBOL_NAME (ms); - printf_filtered ("Destructor %p <%s>\n", destructor, name); + printf_filtered ("Key %d, destructor %p <%s>\n", key, destructor, name); return 0; } From owner-svn-src-all@FreeBSD.ORG Mon May 21 04:24:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DFF41065670; Mon, 21 May 2012 04:24:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E0C18FC0A; Mon, 21 May 2012 04:24:59 +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 q4L4OxGV037061; Mon, 21 May 2012 04:24:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L4Oxib037059; Mon, 21 May 2012 04:24:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201205210424.q4L4Oxib037059@svn.freebsd.org> From: Warner Losh Date: Mon, 21 May 2012 04:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235715 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 04:24:59 -0000 Author: imp Date: Mon May 21 04:24:58 2012 New Revision: 235715 URL: http://svn.freebsd.org/changeset/base/235715 Log: Another minor re-arrangement of the code: calcualte the master clock frequency in the at91_pmc_clock_init rather than passing it in. Allow for frequencies >= 21MHz by rounding to the nearest 500Hz (Idea from Ian Lapore whose company uses a similar arrangement in their product). at91_pmc_clock_init() is now nearly independent of the rest of the pmc driver (which means we may be able to call it much earlier in boot soon to eliminate the master clock config file requirement for printf to work during early boot and also eliminate some interdependencies with the device ordering which requires pmc to be the first device added). Modified: head/sys/arm/at91/at91_pmc.c Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Mon May 21 03:06:31 2012 (r235714) +++ head/sys/arm/at91/at91_pmc.c Mon May 21 04:24:58 2012 (r235715) @@ -388,12 +388,66 @@ fail: return (0); } +#if !defined(AT91C_MAIN_CLOCK) +static const unsigned int at91_main_clock_tbl[] = { + 3000000, 3276800, 3686400, 3840000, 4000000, + 4433619, 4915200, 5000000, 5242880, 6000000, + 6144000, 6400000, 6553600, 7159090, 7372800, + 7864320, 8000000, 9830400, 10000000, 11059200, + 12000000, 12288000, 13560000, 14318180, 14745600, + 16000000, 17344700, 18432000, 20000000 +}; +#define MAIN_CLOCK_TBL_LEN (sizeof(at91_main_clock_tbl) / sizeof(*at91_main_clock_tbl)) + +static unsigned int +at91_pmc_sense_main_clock(struct at91_pmc_softc *sc) +{ + unsigned int ckgr_val; + unsigned int diff, matchdiff, freq; + int i; + + ckgr_val = (RD4(sc, CKGR_MCFR) & CKGR_MCFR_MAINF_MASK) << 11; + + /* + * Clocks up to 50MHz can be connected to some models. If + * the frequency is >= 21MHz, assume that the slow clock can + * measure it correctly, and that any error can be adequately + * compensated for by roudning to the nearest 500Hz. Users + * with fast, or odd-ball clocks will need to set + * AT91C_MASTER_CLOCK in the kernel config file. + */ + if (ckgr_val >= 21000000) + return ((ckgr_val + 250) / 500 * 500); + + /* + * Try to find the standard frequency that match best. + */ + freq = at91_main_clock_tbl[0]; + matchdiff = abs(ckgr_val - at91_main_clock_tbl[0]); + for (i = 1; i < MAIN_CLOCK_TBL_LEN; i++) { + diff = abs(ckgr_val - at91_main_clock_tbl[i]); + if (diff < matchdiff) { + freq = at91_main_clock_tbl[i]; + matchdiff = diff; + } + } + return (freq); +} +#endif + static void -at91_pmc_init_clock(struct at91_pmc_softc *sc, unsigned int main_clock) +at91_pmc_init_clock(struct at91_pmc_softc *sc) { + unsigned int main_clock; uint32_t mckr; uint32_t mdiv; +#if !defined(AT91C_MAIN_CLOCK) + main_clock = at91_pmc_sense_main_clock(pmc_softc); +#else + main_clock = AT91C_MAIN_CLOCK; +#endif + if (at91_is_sam9() || at91_is_sam9xe()) { uhpck.pmc_mask = PMC_SCER_UHP_SAM9; udpck.pmc_mask = PMC_SCER_UDP_SAM9; @@ -449,11 +503,9 @@ at91_pmc_init_clock(struct at91_pmc_soft at91_master_clock = mck.hz; - device_printf(sc->dev, - "Primary: %d Hz PLLA: %d MHz CPU: %d MHz MCK: %d MHz\n", - main_clock, - plla.hz / 1000000, - cpu.hz / 1000000, mck.hz / 1000000); + /* These clocks refrenced by "special" names */ + at91_pmc_clock_alias("ohci0", "ohci_clk"); + at91_pmc_clock_alias("udp0", "udp_clk"); /* Turn off "Progamable" clocks */ WR4(sc, PMC_SCDR, PMC_SCER_PCK0 | PMC_SCER_PCK1 | PMC_SCER_PCK2 | @@ -505,46 +557,9 @@ at91_pmc_probe(device_t dev) return (0); } -#if !defined(AT91C_MAIN_CLOCK) -static const unsigned int at91_mainf_tbl[] = { - 3000000, 3276800, 3686400, 3840000, 4000000, - 4433619, 4915200, 5000000, 5242880, 6000000, - 6144000, 6400000, 6553600, 7159090, 7372800, - 7864320, 8000000, 9830400, 10000000, 11059200, - 12000000, 12288000, 13560000, 14318180, 14745600, - 16000000, 17344700, 18432000, 20000000 -}; -#define MAINF_TBL_LEN (sizeof(at91_mainf_tbl) / sizeof(*at91_mainf_tbl)) - -static unsigned int -at91_pmc_sense_mainf(struct at91_pmc_softc *sc) -{ - unsigned int ckgr_val; - unsigned int diff, matchdiff; - int i, match; - - ckgr_val = (RD4(sc, CKGR_MCFR) & CKGR_MCFR_MAINF_MASK) << 11; - - /* - * Try to find the standard frequency that match best. - */ - match = 0; - matchdiff = abs(ckgr_val - at91_mainf_tbl[0]); - for (i = 1; i < MAINF_TBL_LEN; i++) { - diff = abs(ckgr_val - at91_mainf_tbl[i]); - if (diff < matchdiff) { - match = i; - matchdiff = diff; - } - } - return (at91_mainf_tbl[match]); -} -#endif - static int at91_pmc_attach(device_t dev) { - unsigned int mainf; int err; pmc_softc = device_get_softc(dev); @@ -555,16 +570,13 @@ at91_pmc_attach(device_t dev) /* * Configure main clock frequency. */ -#if !defined(AT91C_MAIN_CLOCK) - mainf = at91_pmc_sense_mainf(pmc_softc); -#else - mainf = AT91C_MAIN_CLOCK; -#endif - at91_pmc_init_clock(pmc_softc, mainf); + at91_pmc_init_clock(pmc_softc); - /* These clocks refrenced by "special" names */ - at91_pmc_clock_alias("ohci0", "ohci_clk"); - at91_pmc_clock_alias("udp0", "udp_clk"); + device_printf(dev, + "Primary: %d Hz PLLA: %d MHz CPU: %d MHz MCK: %d MHz\n", + main_ck.hz, + plla.hz / 1000000, + cpu.hz / 1000000, mck.hz / 1000000); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon May 21 04:29:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F7811065670; Mon, 21 May 2012 04:29:12 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A3578FC15; Mon, 21 May 2012 04:29:12 +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 q4L4TBxV037264; Mon, 21 May 2012 04:29:11 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L4TBEw037262; Mon, 21 May 2012 04:29:11 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201205210429.q4L4TBEw037262@svn.freebsd.org> From: Stanislav Sedov Date: Mon, 21 May 2012 04:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235716 - head/contrib/com_err X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 04:29:12 -0000 Author: stas Date: Mon May 21 04:29:11 2012 New Revision: 235716 URL: http://svn.freebsd.org/changeset/base/235716 Log: - On FreeBSD, com_err.h is installed into /usr/include, not /usr/include/krb5. Reflect that in the manpage. PR: bin/167986 Reported by: truckman@ Modified: head/contrib/com_err/com_err.3 Modified: head/contrib/com_err/com_err.3 ============================================================================== --- head/contrib/com_err/com_err.3 Mon May 21 04:24:58 2012 (r235715) +++ head/contrib/com_err/com_err.3 Mon May 21 04:29:11 2012 (r235716) @@ -54,7 +54,7 @@ Common Error Library (libcom_err, -lcom_ .Sh SYNOPSIS .Fd #include .Fd #include -.Fd #include +.Fd #include .Fd #include \&"XXX_err.h\&" .Pp typedef void (*errf)(const char *, long, const char *, ...); From owner-svn-src-all@FreeBSD.ORG Mon May 21 06:56:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D95161065670; Mon, 21 May 2012 06:56:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAFD88FC08; Mon, 21 May 2012 06:56:27 +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 q4L6uRPF043844; Mon, 21 May 2012 06:56:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L6uR8L043842; Mon, 21 May 2012 06:56:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201205210656.q4L6uR8L043842@svn.freebsd.org> From: Warner Losh Date: Mon, 21 May 2012 06:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235717 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 06:56:27 -0000 Author: imp Date: Mon May 21 06:56:26 2012 New Revision: 235717 URL: http://svn.freebsd.org/changeset/base/235717 Log: Implement pmap_mincore for arm. Now programs using it don't cause a flood of console messages. Reviewed by: alc@ Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Mon May 21 04:29:11 2012 (r235716) +++ head/sys/arm/arm/pmap.c Mon May 21 06:56:26 2012 (r235717) @@ -4557,9 +4557,59 @@ pmap_remove_write(vm_page_t m) int pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { - printf("pmap_mincore()\n"); - - return (0); + struct l2_bucket *l2b; + pt_entry_t *ptep, pte; + vm_paddr_t pa; + vm_page_t m; + int val; + boolean_t managed; + + PMAP_LOCK(pmap); +retry: + l2b = pmap_get_l2_bucket(pmap, addr); + if (l2b == NULL) { + val = 0; + goto out; + } + ptep = &l2b->l2b_kva[l2pte_index(addr)]; + pte = *ptep; + if (!l2pte_valid(pte)) { + val = 0; + goto out; + } + val = MINCORE_INCORE; + if (pte & L2_S_PROT_W) + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + managed = false; + pa = l2pte_pa(pte); + m = PHYS_TO_VM_PAGE(pa); + if (m != NULL && !(m->oflags & VPO_UNMANAGED)) + managed = true; + if (managed) { + /* + * the ARM pmap tries to maintain a per-mapping + * reference bit. The trouble is that it's kept in + * the PV entry, not the PTE, so it's costly to access + * here. You would need to acquire the page queues + * lock, call pmap_find_pv(), and introduce a custom + * version of vm_page_pa_tryrelock() that releases and + * reacquires the page queues lock. In the end, I + * doubt it's worthwhile. This may falsely report + * the given address as referenced. + */ + if ((m->md.pvh_attrs & PVF_REF) != 0) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && managed) { + /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ + if (vm_page_pa_tryrelock(pmap, pa, locked_pa)) + goto retry; + } else +out: + PA_UNLOCK_COND(*locked_pa); + PMAP_UNLOCK(pmap); + return (val); } From owner-svn-src-all@FreeBSD.ORG Mon May 21 07:47:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A1ED1065674; Mon, 21 May 2012 07:47:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA28B8FC0A; Mon, 21 May 2012 07:47: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 q4L7lvFa046207; Mon, 21 May 2012 07:47:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L7lvFu046204; Mon, 21 May 2012 07:47:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201205210747.q4L7lvFu046204@svn.freebsd.org> From: Warner Losh Date: Mon, 21 May 2012 07:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235718 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 07:47:58 -0000 Author: imp Date: Mon May 21 07:47:57 2012 New Revision: 235718 URL: http://svn.freebsd.org/changeset/base/235718 Log: Be a little less magical, not that these values are likely to change... Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91reg.h Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Mon May 21 06:56:26 2012 (r235717) +++ head/sys/arm/at91/at91.c Mon May 21 07:47:57 2012 (r235718) @@ -69,11 +69,11 @@ at91_bs_map(void *t, bus_addr_t bpa, bus vm_paddr_t pa, endpa; pa = trunc_page(bpa); - if (pa >= 0xfff00000) { - *bshp = pa - 0xf0000000 + 0xd0000000; + if (pa >= AT91_PA_BASE + 0xff00000) { + *bshp = pa - AT91_PA_BASE + AT91_BASE; return (0); } - if (pa >= 0xdff00000) + if (pa >= AT91_BASE + 0xff00000) return (0); endpa = round_page(bpa + size); @@ -269,7 +269,7 @@ at91_attach(device_t dev) sc->sc_mem_rman.rm_descr = "AT91 Memory"; if (rman_init(&sc->sc_mem_rman) != 0) panic("at91_attach: failed to set up memory rman"); - for ( pdevmap = at91_devmap; pdevmap->pd_va != 0; pdevmap++) { + for (pdevmap = at91_devmap; pdevmap->pd_va != 0; pdevmap++) { if (rman_manage_region(&sc->sc_mem_rman, pdevmap->pd_va, pdevmap->pd_va + pdevmap->pd_size - 1) != 0) panic("at91_attach: failed to set up memory rman"); Modified: head/sys/arm/at91/at91reg.h ============================================================================== --- head/sys/arm/at91/at91reg.h Mon May 21 06:56:26 2012 (r235717) +++ head/sys/arm/at91/at91reg.h Mon May 21 07:47:57 2012 (r235718) @@ -35,6 +35,9 @@ /* Where builtin peripherals start in KVM */ #define AT91_BASE 0xd0000000 +/* Where builtin peripherals start PA */ +#define AT91_PA_BASE 0xf0000000 + /* A few things that we count on being the same * throught the whole family of SOCs */ From owner-svn-src-all@FreeBSD.ORG Mon May 21 07:52:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FA3F1065670; Mon, 21 May 2012 07:52:47 +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 6A7878FC1A; Mon, 21 May 2012 07:52: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 q4L7qlmQ046458; Mon, 21 May 2012 07:52:47 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L7qlQY046454; Mon, 21 May 2012 07:52:47 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205210752.q4L7qlQY046454@svn.freebsd.org> From: Kevin Lo Date: Mon, 21 May 2012 07:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235719 - in head/tools/regression: sysvmsg sysvsem sysvshm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 07:52:47 -0000 Author: kevlo Date: Mon May 21 07:52:46 2012 New Revision: 235719 URL: http://svn.freebsd.org/changeset/base/235719 Log: According to shared memory man pages, advice including instead of Modified: head/tools/regression/sysvmsg/msgtest.c head/tools/regression/sysvsem/semtest.c head/tools/regression/sysvshm/shmtest.c Modified: head/tools/regression/sysvmsg/msgtest.c ============================================================================== --- head/tools/regression/sysvmsg/msgtest.c Mon May 21 07:47:57 2012 (r235718) +++ head/tools/regression/sysvmsg/msgtest.c Mon May 21 07:52:46 2012 (r235719) @@ -35,7 +35,7 @@ * Test the SVID-compatible Message Queue facility. */ -#include +#include #include #include #include Modified: head/tools/regression/sysvsem/semtest.c ============================================================================== --- head/tools/regression/sysvsem/semtest.c Mon May 21 07:47:57 2012 (r235718) +++ head/tools/regression/sysvsem/semtest.c Mon May 21 07:52:46 2012 (r235719) @@ -35,7 +35,7 @@ * Test the SVID-compatible Semaphore facility. */ -#include +#include #include #include #include Modified: head/tools/regression/sysvshm/shmtest.c ============================================================================== --- head/tools/regression/sysvshm/shmtest.c Mon May 21 07:47:57 2012 (r235718) +++ head/tools/regression/sysvshm/shmtest.c Mon May 21 07:52:46 2012 (r235719) @@ -35,7 +35,7 @@ * Test the SVID-compatible Shared Memory facility. */ -#include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Mon May 21 08:10:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE8901065670; Mon, 21 May 2012 08:10:43 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AAED8FC17; Mon, 21 May 2012 08:10: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 q4L8AhYx047298; Mon, 21 May 2012 08:10:43 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L8AhmF047296; Mon, 21 May 2012 08:10:43 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205210810.q4L8AhmF047296@svn.freebsd.org> From: Gleb Kurtsou Date: Mon, 21 May 2012 08:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235720 - head/lib/libc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 08:10:43 -0000 Author: gleb Date: Mon May 21 08:10:42 2012 New Revision: 235720 URL: http://svn.freebsd.org/changeset/base/235720 Log: Disable NLS catalog use in libc if built with WITHOUT_NLS option. Functions affected: strerror, strsignal, gai_strerror. Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Mon May 21 07:52:46 2012 (r235719) +++ head/lib/libc/Makefile Mon May 21 08:10:42 2012 (r235720) @@ -26,7 +26,9 @@ SHLIB_MAJOR= 7 WARNS?= 2 CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include CFLAGS+=-I${.CURDIR}/${LIBC_ARCH} +.if ${MK_NLS} != "no" CFLAGS+=-DNLS +.endif CLEANFILES+=tags INSTALL_PIC_ARCHIVE= PRECIOUSLIB= From owner-svn-src-all@FreeBSD.ORG Mon May 21 13:05:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B66DA106566B; Mon, 21 May 2012 13:05:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CEF48FC12; Mon, 21 May 2012 13:05: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 q4LD5g1R059222; Mon, 21 May 2012 13:05:42 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LD5g3M059208; Mon, 21 May 2012 13:05:42 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205211305.q4LD5g3M059208@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 21 May 2012 13:05: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: r235721 - in stable/8/usr.sbin/pkg_install: add delete lib updating version X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 13:05:42 -0000 Author: bapt Date: Mon May 21 13:05:41 2012 New Revision: 235721 URL: http://svn.freebsd.org/changeset/base/235721 Log: MFC: r201226, r202844, r206043, r206132, r206133, r212029, r225610, r226708, r228670 - Add support for UPDATING remote fetching. - Reorganize EXAMPLES section in pkg_updating(1). - Style fixes. - Replace hardcoded INDEX version. [1] - Fix a buffer overlap. [2] - Remove empty package when fetching fails and -K is used. [3] - Remove useless chmod2() after mkdtemp(3). [4] - Replace mkdir(1) call with mkdir(2). [5] - Get rid of some vsystem() calls. - Switch from lstat(2) to open(2) in fexists(). - Try rename(2) in move_file() first. - Fix pkg_delete, check if the file we're trying to delete is a symlink before complaining that it doesn't exist. Typical case would be a leftover library symlink that's left over after the actual library has been removed. - Print the package name on deletion errors. - Staticify elide_root() - In usr.sbin/pkg_install/updating/main.c, use the size of the destination buffer as size argument to strlcpy(), not the length of the source PR: bin/145101 [1], bin/139492 [2], bin/144919 [3] bin/144920 [4], bin/144921 [5] Submitted by: gcooper [1,2,3,4,5] Approved by: des (mentor) Modified: stable/8/usr.sbin/pkg_install/add/futil.c stable/8/usr.sbin/pkg_install/add/main.c stable/8/usr.sbin/pkg_install/add/perform.c stable/8/usr.sbin/pkg_install/delete/perform.c stable/8/usr.sbin/pkg_install/lib/file.c stable/8/usr.sbin/pkg_install/lib/lib.h stable/8/usr.sbin/pkg_install/lib/match.c stable/8/usr.sbin/pkg_install/lib/pen.c stable/8/usr.sbin/pkg_install/lib/plist.c stable/8/usr.sbin/pkg_install/lib/url.c stable/8/usr.sbin/pkg_install/updating/main.c stable/8/usr.sbin/pkg_install/updating/pkg_updating.1 stable/8/usr.sbin/pkg_install/version/perform.c Directory Properties: stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/add/ (props changed) stable/8/usr.sbin/pkg_install/info/ (props changed) Modified: stable/8/usr.sbin/pkg_install/add/futil.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/futil.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/add/futil.c Mon May 21 13:05:41 2012 (r235721) @@ -50,7 +50,7 @@ make_hierarchy(char *dir) } } else { - if (vsystem("/bin/mkdir %s", dir)) { + if (mkdir(dir, 0777) < 0) { if (cp2) *cp2 = '/'; return FAIL; Modified: stable/8/usr.sbin/pkg_install/add/main.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/main.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/add/main.c Mon May 21 13:05:41 2012 (r235721) @@ -22,7 +22,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include @@ -306,7 +306,9 @@ getpackagesite(void) { int reldate, i; static char sitepath[MAXPATHLEN]; - struct utsname u; + int archmib[] = { CTL_HW, HW_MACHINE_ARCH }; + char arch[64]; + size_t archlen = sizeof(arch); if (getenv("PACKAGESITE")) { if (strlcpy(sitepath, getenv("PACKAGESITE"), sizeof(sitepath)) @@ -329,8 +331,10 @@ getpackagesite(void) >= sizeof(sitepath)) return NULL; - uname(&u); - if (strlcat(sitepath, u.machine, sizeof(sitepath)) >= sizeof(sitepath)) + if (sysctl(archmib, 2, arch, &archlen, NULL, 0) == -1) + return NULL; + arch[archlen-1] = 0; + if (strlcat(sitepath, arch, sizeof(sitepath)) >= sizeof(sitepath)) return NULL; reldate = getosreldate(); Modified: stable/8/usr.sbin/pkg_install/add/perform.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/perform.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/add/perform.c Mon May 21 13:05:41 2012 (r235721) @@ -78,6 +78,7 @@ pkg_do(char *pkg) char pre_arg[FILENAME_MAX], post_arg[FILENAME_MAX]; char *conflict[2]; char **matched; + int fd; conflictsfound = 0; code = 0; @@ -408,8 +409,10 @@ pkg_do(char *pkg) goto bomb; /* Look for the requirements file */ - if (fexists(REQUIRE_FNAME)) { - vsystem("/bin/chmod +x %s", REQUIRE_FNAME); /* be sure */ + if ((fd = open(REQUIRE_FNAME, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Running requirements file first for %s..\n", Plist.name); if (!Fake && vsystem("./%s %s INSTALL", REQUIRE_FNAME, Plist.name)) { @@ -441,8 +444,10 @@ pkg_do(char *pkg) } /* If we're really installing, and have an installation file, run it */ - if (!NoInstall && fexists(pre_script)) { - vsystem("/bin/chmod +x %s", pre_script); /* make sure */ + if (!NoInstall && (fd = open(pre_script, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Running pre-install for %s..\n", Plist.name); if (!Fake && vsystem("./%s %s %s", pre_script, Plist.name, pre_arg)) { @@ -470,8 +475,10 @@ pkg_do(char *pkg) } /* Run the installation script one last time? */ - if (!NoInstall && fexists(post_script)) { - vsystem("/bin/chmod +x %s", post_script); /* make sure */ + if (!NoInstall && (fd = open(post_script, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Running post-install for %s..\n", Plist.name); if (!Fake && vsystem("./%s %s %s", post_script, Plist.name, post_arg)) { @@ -503,7 +510,10 @@ pkg_do(char *pkg) goto success; /* close enough for government work */ } /* Make sure pkg_info can read the entry */ - vsystem("/bin/chmod a+rx %s", LogDir); + fd = open(LogDir, O_RDWR); + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IRALL | S_IXALL); /* be sure, chmod a+rx */ + close(fd); move_file(".", DESC_FNAME, LogDir); move_file(".", COMMENT_FNAME, LogDir); if (fexists(INSTALL_FNAME)) Modified: stable/8/usr.sbin/pkg_install/delete/perform.c ============================================================================== --- stable/8/usr.sbin/pkg_install/delete/perform.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/delete/perform.c Mon May 21 13:05:41 2012 (r235721) @@ -132,6 +132,8 @@ pkg_do(char *pkg) const char *post_script, *pre_arg, *post_arg; struct reqr_by_entry *rb_entry; struct reqr_by_head *rb_list; + int fd; + struct stat sb; if (!pkg || !(len = strlen(pkg))) return 1; @@ -221,10 +223,12 @@ pkg_do(char *pkg) setenv(PKG_PREFIX_VNAME, p->name, 1); - if (fexists(REQUIRE_FNAME)) { + if ((fd = open(REQUIRE_FNAME, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Executing 'require' script.\n"); - vsystem("/bin/chmod +x %s", REQUIRE_FNAME); /* be sure */ if (vsystem("./%s %s DEINSTALL", REQUIRE_FNAME, pkg)) { warnx("package %s fails requirements %s", pkg, Force ? "" : "- not deleted"); @@ -250,11 +254,13 @@ pkg_do(char *pkg) post_script = pre_arg = post_arg = NULL; } - if (!NoDeInstall && pre_script != NULL && fexists(pre_script)) { + if (!NoDeInstall && pre_script != NULL && (fd = open(pre_script, O_RDWR)) != -1) { if (Fake) printf("Would execute de-install script at this point.\n"); else { - vsystem("/bin/chmod +x %s", pre_script); /* make sure */ + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (vsystem("./%s %s %s", pre_script, pkg, pre_arg)) { warnx("deinstall script returned error status"); if (!Force) @@ -326,11 +332,13 @@ pkg_do(char *pkg) return 1; } - if (!NoDeInstall && post_script != NULL && fexists(post_script)) { + if (!NoDeInstall && post_script != NULL && (fd = open(post_script, O_RDWR)) != -1) { if (Fake) printf("Would execute post-deinstall script at this point.\n"); else { - vsystem("/bin/chmod +x %s", post_script); /* make sure */ + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (vsystem("./%s %s %s", post_script, pkg, post_arg)) { warnx("post-deinstall script returned error status"); if (!Force) Modified: stable/8/usr.sbin/pkg_install/lib/file.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/file.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/file.c Mon May 21 13:05:41 2012 (r235721) @@ -31,10 +31,13 @@ __FBSDID("$FreeBSD$"); Boolean fexists(const char *fname) { - struct stat dummy; - if (!lstat(fname, &dummy)) - return TRUE; - return FALSE; + int fd; + + if ((fd = open(fname, O_RDONLY)) == -1) + return FALSE; + + close(fd); + return TRUE; } /* Quick check to see if something is a directory or symlink to a directory */ @@ -279,17 +282,23 @@ copy_file(const char *dir, const char *f } void -move_file(const char *dir, const char *fname, const char *to) +move_file(const char *dir, const char *fname, const char *tdir) { - char cmd[FILENAME_MAX]; + char from[FILENAME_MAX]; + char to[FILENAME_MAX]; if (fname[0] == '/') - snprintf(cmd, FILENAME_MAX, "/bin/mv %s %s", fname, to); + strncpy(from, fname, FILENAME_MAX); else - snprintf(cmd, FILENAME_MAX, "/bin/mv %s/%s %s", dir, fname, to); - if (vsystem(cmd)) { - cleanup(0); - errx(2, "%s: could not perform '%s'", __func__, cmd); + snprintf(from, FILENAME_MAX, "%s/%s", dir, fname); + + snprintf(to, FILENAME_MAX, "%s/%s", tdir, fname); + + if (rename(from, to) == -1) { + if (vsystem("/bin/mv %s %s", from, to)) { + cleanup(0); + errx(2, "%s: could not move '%s' to '%s'", __func__, from, to); + } } } Modified: stable/8/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/lib.h Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/lib.h Mon May 21 13:05:41 2012 (r235721) @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,11 @@ #define YES 2 #define NO 1 +/* Some more stat macros. */ +#define S_IRALL 0000444 +#define S_IWALL 0000222 +#define S_IXALL 0000111 + /* Usually "rm", but often "echo" during debugging! */ #define REMOVE_CMD "/bin/rm" @@ -84,18 +90,6 @@ #define DISPLAY_FNAME "+DISPLAY" #define MTREE_FNAME "+MTREE_DIRS" -#if defined(__FreeBSD_version) && __FreeBSD_version >= 900000 -#define INDEX_FNAME "INDEX-9" -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 800000 -#define INDEX_FNAME "INDEX-8" -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 700000 -#define INDEX_FNAME "INDEX-7" -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 600000 -#define INDEX_FNAME "INDEX-6" -#else -#define INDEX_FNAME "INDEX" -#endif - #define CMD_CHAR '@' /* prefix for extended PLIST cmd */ /* The name of the "prefix" environment variable given to scripts */ @@ -105,7 +99,7 @@ * Version of the package tools - increase whenever you make a change * in the code that is not cosmetic only. */ -#define PKG_INSTALL_VERSION 20101002 +#define PKG_INSTALL_VERSION 20100403 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) Modified: stable/8/usr.sbin/pkg_install/lib/match.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/match.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/match.c Mon May 21 13:05:41 2012 (r235721) @@ -267,7 +267,7 @@ matchallbyorigin(const char **origins, i */ if (isemptydir(tmp)) continue; - snprintf(tmp, PATH_MAX, "%s/%s", tmp, CONTENTS_FNAME); + strncat(tmp, "/" CONTENTS_FNAME, PATH_MAX); fp = fopen(tmp, "r"); if (fp == NULL) { warnx("the package info for package '%s' is corrupt", installed[i]); Modified: stable/8/usr.sbin/pkg_install/lib/pen.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/pen.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/pen.c Mon May 21 13:05:41 2012 (r235721) @@ -113,10 +113,6 @@ make_playpen(char *pen, off_t sz) cleanup(0); errx(2, "%s: can't mktemp '%s'", __func__, pen); } - if (chmod(pen, 0700) == FAIL) { - cleanup(0); - errx(2, "%s: can't mkdir '%s'", __func__, pen); - } if (Verbose) { if (sz) { Modified: stable/8/usr.sbin/pkg_install/lib/plist.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/plist.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/plist.c Mon May 21 13:05:41 2012 (r235721) @@ -551,7 +551,7 @@ delete_hierarchy(const char *dir, Boolea char *cp1, *cp2; cp1 = cp2 = strdup(dir); - if (!fexists(dir)) { + if (!fexists(dir) && !issymlink(dir)) { if (!ign_err) warnx("%s '%s' doesn't exist", isdir(dir) ? "directory" : "file", dir); Modified: stable/8/usr.sbin/pkg_install/lib/url.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/url.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/lib/url.c Mon May 21 13:05:41 2012 (r235721) @@ -108,6 +108,10 @@ fileGetURL(const char *base, const char if ((ftp = fetchGetURL(fname, Verbose ? "v" : NULL)) == NULL) { printf("Error: Unable to get %s: %s\n", fname, fetchLastErrString); + /* If the fetch fails, yank the package. */ + if (keep_package && unlink(pkg) < 0 && Verbose) { + warnx("failed to remove partially fetched package: %s", pkg); + } return NULL; } Modified: stable/8/usr.sbin/pkg_install/updating/main.c ============================================================================== --- stable/8/usr.sbin/pkg_install/updating/main.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/updating/main.c Mon May 21 13:05:41 2012 (r235721) @@ -10,7 +10,11 @@ #include __FBSDID("$FreeBSD$"); + +#include +#include #include +#include #include #include #include @@ -115,10 +119,10 @@ main(int argc, char *argv[]) if (argc != 0) { pflag = 1; while (*argv) { - if((curr = (INSTALLEDPORT *) + if ((curr = (INSTALLEDPORT *) malloc(sizeof(INSTALLEDPORT))) == NULL) (void)exit(EXIT_FAILURE); - strlcpy (curr->name, *argv, strlen(*argv) + 1); + strlcpy(curr->name, *argv, strlen(*argv) + 1); curr->next = head; head = curr; (void)*argv++; @@ -131,22 +135,22 @@ main(int argc, char *argv[]) */ if (pflag == 0) { /* Open /var/db/pkg and search for all installed ports. */ - if((dir = opendir(pkgdbpath)) != NULL) { + if ((dir = opendir(pkgdbpath)) != NULL) { while ((pkgdbdir = readdir(dir)) != NULL) { if (strcmp(pkgdbdir->d_name, ".") != 0 && - strcmp(pkgdbdir->d_name, "..") !=0) { + strcmp(pkgdbdir->d_name, "..") != 0) { /* Create path to +CONTENTS file for each installed port */ - n = strlcpy(tmp_file, pkgdbpath, strlen(pkgdbpath)+1); + n = strlcpy(tmp_file, pkgdbpath, sizeof(tmp_file)); n = strlcpy(tmp_file + n, "/", sizeof(tmp_file) - n); n = strlcat(tmp_file + n, pkgdbdir->d_name, sizeof(tmp_file) - n); - if(stat(tmp_file, &attribute) == -1) { + if (stat(tmp_file, &attribute) == -1) { fprintf(stderr, "can't open %s: %s\n", tmp_file, strerror(errno)); return EXIT_FAILURE; } - if(attribute.st_mode & S_IFREG) + if (attribute.st_mode & S_IFREG) continue; (void)strlcat(tmp_file + n, "/", sizeof(tmp_file) - n); @@ -155,7 +159,7 @@ main(int argc, char *argv[]) /* Open +CONTENT file */ fd = fopen(tmp_file, "r"); - if(fd == NULL) { + if (fd == NULL) { fprintf(stderr, "warning: can't open %s: %s\n", tmp_file, strerror(errno)); continue; @@ -165,25 +169,25 @@ main(int argc, char *argv[]) * Parses +CONTENT for ORIGIN line and * put element into linked list. */ - while(fgets(originline, maxcharperline, fd) != NULL) { + while (fgets(originline, maxcharperline, fd) != NULL) { tmpline1 = strstr(originline, origin); - if( tmpline1 != NULL ) { + if (tmpline1 != NULL) { /* Tmp variable to store port name. */ char *pname; pname = strrchr(originline, (int)':'); pname++; - if((curr = (INSTALLEDPORT *) + if ((curr = (INSTALLEDPORT *) malloc(sizeof(INSTALLEDPORT))) == NULL) (void)exit(EXIT_FAILURE); if (pname[strlen(pname) - 1] == '\n') pname[strlen(pname) - 1] = '\0'; - strlcpy (curr->name, pname, strlen(pname)+1); + strlcpy (curr->name, pname, sizeof(curr->name)); curr->next = head; head = curr; } } - if(ferror(fd)) { + if (ferror(fd)) { fprintf(stderr, "error reading input\n"); exit(EX_IOERR); } @@ -195,32 +199,41 @@ main(int argc, char *argv[]) } } - /* Open UPDATING file */ - fd = fopen(updatingfile, "r"); - if(fd == NULL) { + /* Fetch UPDATING file if needed and open file */ + if (isURL(updatingfile)) { + if ((fd = fetchGetURL(updatingfile, "")) == NULL) { + fprintf(stderr, "Error: Unable to get %s: %s\n", + updatingfile, fetchLastErrString); + exit(EX_UNAVAILABLE); + } + } + else { + fd = fopen(updatingfile, "r"); + } + if (fd == NULL) { fprintf(stderr, "can't open %s: %s\n", - updatingfile, strerror(errno)); + updatingfile, strerror(errno)); exit(EX_UNAVAILABLE); } /* Parse opened UPDATING file. */ - while(fgets(updatingline, maxcharperline, fd) != NULL) { + while (fgets(updatingline, maxcharperline, fd) != NULL) { /* No entry is found so far */ if (found == 0) { /* Search for AFFECTS line to parse the portname. */ tmpline1 = strstr(updatingline, affects); - if( tmpline1 != NULL ) { + if (tmpline1 != NULL) { curr = head; - while(curr != NULL) { + while (curr != NULL) { tmpline2 = strstr(updatingline, curr->name); - if( tmpline2 != NULL ) + if (tmpline2 != NULL) break; curr = curr->next; } - if( tmpline2 != NULL ) { + if (tmpline2 != NULL) { /* If -d is set, check if entry is newer than the date. */ - if ( (dflag == 1) && (strncmp(dateline, date, 8) < 0)) + if ((dflag == 1) && (strncmp(dateline, date, 8) < 0)) continue; printf("%s", dateline); printf("%s", updatingline); @@ -231,7 +244,7 @@ main(int argc, char *argv[]) /* Search for the end of an entry, if not found print the line. */ else { tmpline1 = strstr(updatingline, end); - if( tmpline1 == NULL ) + if (tmpline1 == NULL) printf("%s", updatingline); else { linelength = strlen(updatingline); @@ -245,7 +258,7 @@ main(int argc, char *argv[]) dateline = strdup(updatingline); } - if(ferror(fd)) { + if (ferror(fd)) { fprintf(stderr, "error reading input\n"); exit(EX_IOERR); } Modified: stable/8/usr.sbin/pkg_install/updating/pkg_updating.1 ============================================================================== --- stable/8/usr.sbin/pkg_install/updating/pkg_updating.1 Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/updating/pkg_updating.1 Mon May 21 13:05:41 2012 (r235721) @@ -45,26 +45,31 @@ Print help message. .El .Sh EXAMPLES .Bl -tag -width indent -.Dl pkg_updating +Shows all entries of all installed ports: .Pp -Shows all entries of all installed ports. +.Dl % pkg_updating .Pp -.Dl pkg_updating -d 20070101 +Shows all entries of all installed ports since 2007-01-01: .Pp -Shows all entries of all installed ports since 2007-01-01. +.Dl % pkg_updating -d 20070101 .Pp -.Dl pkg_updating apache mysql +Shows all entries for all apache and mysql ports: .Pp -Shows all entries for all apache and mysql ports. +.Dl % pkg_updating apache mysql .Pp -.Dl pkg_updating -d 20060101 apache +Shows all apache entries since 2006-01-01: .Pp -Shows all apache entries since 2006-01-01. -.Pp -.Dl pkg_updating -f /tmp/UPDATING +.Dl % pkg_updating -d 20060101 apache .Pp Defines that the UPDATING file is in /tmp and shows all entries of all -installed ports +installed ports: +.Pp +.Dl % pkg_updating -f /tmp/UPDATING +.Pp +Fetch UPDATING file from ftp mirror and show all entries of all +installed ports: +.Pp +.Dl % pkg_updating -f ftp://ftp.freebsd.org/pub/FreeBSD/ports/packages/UPDATING .Pp .El .Sh ENVIRONMENT Modified: stable/8/usr.sbin/pkg_install/version/perform.c ============================================================================== --- stable/8/usr.sbin/pkg_install/version/perform.c Mon May 21 08:10:42 2012 (r235720) +++ stable/8/usr.sbin/pkg_install/version/perform.c Mon May 21 13:05:41 2012 (r235721) @@ -35,28 +35,41 @@ static int pkg_do(char *); static void show_version(Package, const char *, const char *); /* - * This is the traditional pkg_perform, except that the argument is _not_ - * a list of packages. It is the index file from the command line. + * This is the traditional pkg_perform, except that the argument is _not_ a + * list of packages. It is the index file from the command line. * - * We loop over the installed packages, matching them with the -s flag - * if needed and calling pkg_do(). Before hand we set up a few things, - * and after we tear them down... + * We loop over the installed packages, matching them with the -s flag if + * needed and calling pkg_do(). Beforehand we set up a few things, and after + * we tear them down... + * + * Returns 0 on success, non-zero on failure, corresponding to the number of + * failed attempts to access the INDEX. */ int pkg_perform(char **indexarg) { char **pkgs, *pat[2], **patterns; struct index_entry *ie; - int i, err_cnt = 0; + int i, err_cnt = 0, rel_major_ver; int MatchType; + struct utsname u; + + if (uname(&u) == -1) { + warn("%s(): failed to determine uname information", __func__); + return 1; + } else if ((rel_major_ver = (int) strtol(u.release, NULL, 10)) <= 0) { + + } + /* * Try to find and open the INDEX. We only check IndexFile != NULL * later, if we actually need the INDEX. */ - if (*indexarg == NULL) - snprintf(IndexPath, sizeof(IndexPath), "%s/%s", PORTS_DIR, INDEX_FNAME); - else + if (*indexarg == NULL) { + snprintf(IndexPath, sizeof(IndexPath), "%s/INDEX-%d", PORTS_DIR, + rel_major_ver); + } else strlcpy(IndexPath, *indexarg, sizeof(IndexPath)); if (isURL(IndexPath)) IndexFile = fetchGetURL(IndexPath, ""); From owner-svn-src-all@FreeBSD.ORG Mon May 21 13:07:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA745106566B; Mon, 21 May 2012 13:07:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B26018FC0C; Mon, 21 May 2012 13:07: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 q4LD7DWD059314; Mon, 21 May 2012 13:07:13 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LD7Dnh059298; Mon, 21 May 2012 13:07:13 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205211307.q4LD7Dnh059298@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 21 May 2012 13:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235722 - in stable/7/usr.sbin/pkg_install: add delete info lib updating version X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 13:07:13 -0000 Author: bapt Date: Mon May 21 13:07:12 2012 New Revision: 235722 URL: http://svn.freebsd.org/changeset/base/235722 Log: MFC: r201226, r202844, r206043, r206132, r206133, r212029, r225610, r226708, r228670 - Add support for UPDATING remote fetching. - Reorganize EXAMPLES section in pkg_updating(1). - Style fixes. - Replace hardcoded INDEX version. [1] - Fix a buffer overlap. [2] - Remove empty package when fetching fails and -K is used. [3] - Remove useless chmod2() after mkdtemp(3). [4] - Replace mkdir(1) call with mkdir(2). [5] - Get rid of some vsystem() calls. - Switch from lstat(2) to open(2) in fexists(). - Try rename(2) in move_file() first. - Fix pkg_delete, check if the file we're trying to delete is a symlink before complaining that it doesn't exist. Typical case would be a leftover library symlink that's left over after the actual library has been removed. - Print the package name on deletion errors. - Staticify elide_root() - In usr.sbin/pkg_install/updating/main.c, use the size of the destination buffer as size argument to strlcpy(), not the length of the source PR: bin/145101 [1], bin/139492 [2], bin/144919 [3] bin/144920 [4], bin/144921 [5] Submitted by: gcooper [1,2,3,4,5] Approved by: des (mentor) Modified: stable/7/usr.sbin/pkg_install/add/futil.c stable/7/usr.sbin/pkg_install/add/main.c stable/7/usr.sbin/pkg_install/add/perform.c stable/7/usr.sbin/pkg_install/delete/perform.c stable/7/usr.sbin/pkg_install/info/show.c stable/7/usr.sbin/pkg_install/lib/file.c stable/7/usr.sbin/pkg_install/lib/lib.h stable/7/usr.sbin/pkg_install/lib/match.c stable/7/usr.sbin/pkg_install/lib/pen.c stable/7/usr.sbin/pkg_install/lib/plist.c stable/7/usr.sbin/pkg_install/lib/url.c stable/7/usr.sbin/pkg_install/updating/main.c stable/7/usr.sbin/pkg_install/updating/pkg_updating.1 stable/7/usr.sbin/pkg_install/version/perform.c Directory Properties: stable/7/usr.sbin/ (props changed) stable/7/usr.sbin/pkg_install/ (props changed) Modified: stable/7/usr.sbin/pkg_install/add/futil.c ============================================================================== --- stable/7/usr.sbin/pkg_install/add/futil.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/add/futil.c Mon May 21 13:07:12 2012 (r235722) @@ -50,7 +50,7 @@ make_hierarchy(char *dir) } } else { - if (vsystem("/bin/mkdir %s", dir)) { + if (mkdir(dir, 0777) < 0) { if (cp2) *cp2 = '/'; return FAIL; Modified: stable/7/usr.sbin/pkg_install/add/main.c ============================================================================== --- stable/7/usr.sbin/pkg_install/add/main.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/add/main.c Mon May 21 13:07:12 2012 (r235722) @@ -22,7 +22,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include @@ -303,7 +303,9 @@ getpackagesite(void) { int reldate, i; static char sitepath[MAXPATHLEN]; - struct utsname u; + int archmib[] = { CTL_HW, HW_MACHINE_ARCH }; + char arch[64]; + size_t archlen = sizeof(arch); if (getenv("PACKAGESITE")) { if (strlcpy(sitepath, getenv("PACKAGESITE"), sizeof(sitepath)) @@ -326,8 +328,10 @@ getpackagesite(void) >= sizeof(sitepath)) return NULL; - uname(&u); - if (strlcat(sitepath, u.machine, sizeof(sitepath)) >= sizeof(sitepath)) + if (sysctl(archmib, 2, arch, &archlen, NULL, 0) == -1) + return NULL; + arch[archlen-1] = 0; + if (strlcat(sitepath, arch, sizeof(sitepath)) >= sizeof(sitepath)) return NULL; reldate = getosreldate(); Modified: stable/7/usr.sbin/pkg_install/add/perform.c ============================================================================== --- stable/7/usr.sbin/pkg_install/add/perform.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/add/perform.c Mon May 21 13:07:12 2012 (r235722) @@ -78,6 +78,7 @@ pkg_do(char *pkg) char pre_arg[FILENAME_MAX], post_arg[FILENAME_MAX]; char *conflict[2]; char **matched; + int fd; conflictsfound = 0; code = 0; @@ -408,8 +409,10 @@ pkg_do(char *pkg) goto bomb; /* Look for the requirements file */ - if (fexists(REQUIRE_FNAME)) { - vsystem("/bin/chmod +x %s", REQUIRE_FNAME); /* be sure */ + if ((fd = open(REQUIRE_FNAME, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Running requirements file first for %s..\n", Plist.name); if (!Fake && vsystem("./%s %s INSTALL", REQUIRE_FNAME, Plist.name)) { @@ -441,8 +444,10 @@ pkg_do(char *pkg) } /* If we're really installing, and have an installation file, run it */ - if (!NoInstall && fexists(pre_script)) { - vsystem("/bin/chmod +x %s", pre_script); /* make sure */ + if (!NoInstall && (fd = open(pre_script, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Running pre-install for %s..\n", Plist.name); if (!Fake && vsystem("./%s %s %s", pre_script, Plist.name, pre_arg)) { @@ -470,8 +475,10 @@ pkg_do(char *pkg) } /* Run the installation script one last time? */ - if (!NoInstall && fexists(post_script)) { - vsystem("/bin/chmod +x %s", post_script); /* make sure */ + if (!NoInstall && (fd = open(post_script, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Running post-install for %s..\n", Plist.name); if (!Fake && vsystem("./%s %s %s", post_script, Plist.name, post_arg)) { @@ -503,7 +510,10 @@ pkg_do(char *pkg) goto success; /* close enough for government work */ } /* Make sure pkg_info can read the entry */ - vsystem("/bin/chmod a+rx %s", LogDir); + fd = open(LogDir, O_RDWR); + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IRALL | S_IXALL); /* be sure, chmod a+rx */ + close(fd); move_file(".", DESC_FNAME, LogDir); move_file(".", COMMENT_FNAME, LogDir); if (fexists(INSTALL_FNAME)) Modified: stable/7/usr.sbin/pkg_install/delete/perform.c ============================================================================== --- stable/7/usr.sbin/pkg_install/delete/perform.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/delete/perform.c Mon May 21 13:07:12 2012 (r235722) @@ -132,6 +132,8 @@ pkg_do(char *pkg) const char *post_script, *pre_arg, *post_arg; struct reqr_by_entry *rb_entry; struct reqr_by_head *rb_list; + int fd; + struct stat sb; if (!pkg || !(len = strlen(pkg))) return 1; @@ -221,10 +223,12 @@ pkg_do(char *pkg) setenv(PKG_PREFIX_VNAME, p->name, 1); - if (fexists(REQUIRE_FNAME)) { + if ((fd = open(REQUIRE_FNAME, O_RDWR)) != -1) { + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (Verbose) printf("Executing 'require' script.\n"); - vsystem("/bin/chmod +x %s", REQUIRE_FNAME); /* be sure */ if (vsystem("./%s %s DEINSTALL", REQUIRE_FNAME, pkg)) { warnx("package %s fails requirements %s", pkg, Force ? "" : "- not deleted"); @@ -250,11 +254,13 @@ pkg_do(char *pkg) post_script = pre_arg = post_arg = NULL; } - if (!NoDeInstall && pre_script != NULL && fexists(pre_script)) { + if (!NoDeInstall && pre_script != NULL && (fd = open(pre_script, O_RDWR)) != -1) { if (Fake) printf("Would execute de-install script at this point.\n"); else { - vsystem("/bin/chmod +x %s", pre_script); /* make sure */ + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (vsystem("./%s %s %s", pre_script, pkg, pre_arg)) { warnx("deinstall script returned error status"); if (!Force) @@ -318,19 +324,21 @@ pkg_do(char *pkg) */ if (delete_package(FALSE, CleanDirs, &Plist) == FAIL) warnx( - "couldn't entirely delete package (perhaps the packing list is\n" - "incorrectly specified?)"); + "couldn't entirely delete package `%s'\n" + "(perhaps the packing list is incorrectly specified?)", pkg); if (chdir(LogDir) == FAIL) { warnx("unable to change directory to %s! deinstall failed", LogDir); return 1; } - if (!NoDeInstall && post_script != NULL && fexists(post_script)) { + if (!NoDeInstall && post_script != NULL && (fd = open(post_script, O_RDWR)) != -1) { if (Fake) printf("Would execute post-deinstall script at this point.\n"); else { - vsystem("/bin/chmod +x %s", post_script); /* make sure */ + fstat(fd, &sb); + fchmod(fd, sb.st_mode | S_IXALL); /* be sure, chmod a+x */ + close(fd); if (vsystem("./%s %s %s", post_script, pkg, post_arg)) { warnx("post-deinstall script returned error status"); if (!Force) Modified: stable/7/usr.sbin/pkg_install/info/show.c ============================================================================== --- stable/7/usr.sbin/pkg_install/info/show.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/info/show.c Mon May 21 13:07:12 2012 (r235722) @@ -207,6 +207,14 @@ show_plist(const char *title, Package *p } } +static const char * +elide_root(const char *dir) +{ + if (strcmp(dir, "/") == 0) + return ""; + return dir; +} + /* Show all files in the packing list (except ignored ones) */ void show_files(const char *title, Package *plist) @@ -223,7 +231,7 @@ show_files(const char *title, Package *p switch(p->type) { case PLIST_FILE: if (!ign) - printf("%s/%s\n", dir, p->name); + printf("%s/%s\n", elide_root(dir), p->name); ign = FALSE; break; @@ -270,7 +278,7 @@ show_size(const char *title, Package *pl switch (p->type) { case PLIST_FILE: if (!ign) { - snprintf(tmp, FILENAME_MAX, "%s/%s", dir, p->name); + snprintf(tmp, FILENAME_MAX, "%s/%s", elide_root(dir), p->name); if (!lstat(tmp, &sb)) { size += sb.st_size; if (Verbose) @@ -328,7 +336,7 @@ show_cksum(const char *title, Package *p else dir = p->name; } else if (p->type == PLIST_FILE) { - snprintf(tmp, FILENAME_MAX, "%s/%s", dir, p->name); + snprintf(tmp, FILENAME_MAX, "%s/%s", elide_root(dir), p->name); if (!fexists(tmp)) warnx("%s doesn't exist", tmp); else if (p->next && p->next->type == PLIST_COMMENT && Modified: stable/7/usr.sbin/pkg_install/lib/file.c ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/file.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/lib/file.c Mon May 21 13:07:12 2012 (r235722) @@ -31,10 +31,13 @@ __FBSDID("$FreeBSD$"); Boolean fexists(const char *fname) { - struct stat dummy; - if (!lstat(fname, &dummy)) - return TRUE; - return FALSE; + int fd; + + if ((fd = open(fname, O_RDONLY)) == -1) + return FALSE; + + close(fd); + return TRUE; } /* Quick check to see if something is a directory or symlink to a directory */ @@ -279,17 +282,23 @@ copy_file(const char *dir, const char *f } void -move_file(const char *dir, const char *fname, const char *to) +move_file(const char *dir, const char *fname, const char *tdir) { - char cmd[FILENAME_MAX]; + char from[FILENAME_MAX]; + char to[FILENAME_MAX]; if (fname[0] == '/') - snprintf(cmd, FILENAME_MAX, "/bin/mv %s %s", fname, to); + strncpy(from, fname, FILENAME_MAX); else - snprintf(cmd, FILENAME_MAX, "/bin/mv %s/%s %s", dir, fname, to); - if (vsystem(cmd)) { - cleanup(0); - errx(2, "%s: could not perform '%s'", __func__, cmd); + snprintf(from, FILENAME_MAX, "%s/%s", dir, fname); + + snprintf(to, FILENAME_MAX, "%s/%s", tdir, fname); + + if (rename(from, to) == -1) { + if (vsystem("/bin/mv %s %s", from, to)) { + cleanup(0); + errx(2, "%s: could not move '%s' to '%s'", __func__, from, to); + } } } Modified: stable/7/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/lib.h Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/lib/lib.h Mon May 21 13:07:12 2012 (r235722) @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,11 @@ #define YES 2 #define NO 1 +/* Some more stat macros. */ +#define S_IRALL 0000444 +#define S_IWALL 0000222 +#define S_IXALL 0000111 + /* Usually "rm", but often "echo" during debugging! */ #define REMOVE_CMD "/bin/rm" @@ -84,18 +90,6 @@ #define DISPLAY_FNAME "+DISPLAY" #define MTREE_FNAME "+MTREE_DIRS" -#if defined(__FreeBSD_version) && __FreeBSD_version >= 900000 -#define INDEX_FNAME "INDEX-9" -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 800000 -#define INDEX_FNAME "INDEX-8" -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 700000 -#define INDEX_FNAME "INDEX-7" -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 600000 -#define INDEX_FNAME "INDEX-6" -#else -#define INDEX_FNAME "INDEX" -#endif - #define CMD_CHAR '@' /* prefix for extended PLIST cmd */ /* The name of the "prefix" environment variable given to scripts */ @@ -105,7 +99,7 @@ * Version of the package tools - increase whenever you make a change * in the code that is not cosmetic only. */ -#define PKG_INSTALL_VERSION 20090902 +#define PKG_INSTALL_VERSION 20100403 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) Modified: stable/7/usr.sbin/pkg_install/lib/match.c ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/match.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/lib/match.c Mon May 21 13:07:12 2012 (r235722) @@ -267,7 +267,7 @@ matchallbyorigin(const char **origins, i */ if (isemptydir(tmp)) continue; - snprintf(tmp, PATH_MAX, "%s/%s", tmp, CONTENTS_FNAME); + strncat(tmp, "/" CONTENTS_FNAME, PATH_MAX); fp = fopen(tmp, "r"); if (fp == NULL) { warnx("the package info for package '%s' is corrupt", installed[i]); Modified: stable/7/usr.sbin/pkg_install/lib/pen.c ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/pen.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/lib/pen.c Mon May 21 13:07:12 2012 (r235722) @@ -113,10 +113,6 @@ make_playpen(char *pen, off_t sz) cleanup(0); errx(2, "%s: can't mktemp '%s'", __func__, pen); } - if (chmod(pen, 0700) == FAIL) { - cleanup(0); - errx(2, "%s: can't mkdir '%s'", __func__, pen); - } if (Verbose) { if (sz) { Modified: stable/7/usr.sbin/pkg_install/lib/plist.c ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/plist.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/lib/plist.c Mon May 21 13:07:12 2012 (r235722) @@ -551,7 +551,7 @@ delete_hierarchy(const char *dir, Boolea char *cp1, *cp2; cp1 = cp2 = strdup(dir); - if (!fexists(dir)) { + if (!fexists(dir) && !issymlink(dir)) { if (!ign_err) warnx("%s '%s' doesn't exist", isdir(dir) ? "directory" : "file", dir); Modified: stable/7/usr.sbin/pkg_install/lib/url.c ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/url.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/lib/url.c Mon May 21 13:07:12 2012 (r235722) @@ -108,6 +108,10 @@ fileGetURL(const char *base, const char if ((ftp = fetchGetURL(fname, Verbose ? "v" : NULL)) == NULL) { printf("Error: Unable to get %s: %s\n", fname, fetchLastErrString); + /* If the fetch fails, yank the package. */ + if (keep_package && unlink(pkg) < 0 && Verbose) { + warnx("failed to remove partially fetched package: %s", pkg); + } return NULL; } Modified: stable/7/usr.sbin/pkg_install/updating/main.c ============================================================================== --- stable/7/usr.sbin/pkg_install/updating/main.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/updating/main.c Mon May 21 13:07:12 2012 (r235722) @@ -10,7 +10,11 @@ #include __FBSDID("$FreeBSD$"); + +#include +#include #include +#include #include #include #include @@ -115,10 +119,10 @@ main(int argc, char *argv[]) if (argc != 0) { pflag = 1; while (*argv) { - if((curr = (INSTALLEDPORT *) + if ((curr = (INSTALLEDPORT *) malloc(sizeof(INSTALLEDPORT))) == NULL) (void)exit(EXIT_FAILURE); - strlcpy (curr->name, *argv, strlen(*argv) + 1); + strlcpy(curr->name, *argv, strlen(*argv) + 1); curr->next = head; head = curr; (void)*argv++; @@ -131,22 +135,22 @@ main(int argc, char *argv[]) */ if (pflag == 0) { /* Open /var/db/pkg and search for all installed ports. */ - if((dir = opendir(pkgdbpath)) != NULL) { + if ((dir = opendir(pkgdbpath)) != NULL) { while ((pkgdbdir = readdir(dir)) != NULL) { if (strcmp(pkgdbdir->d_name, ".") != 0 && - strcmp(pkgdbdir->d_name, "..") !=0) { + strcmp(pkgdbdir->d_name, "..") != 0) { /* Create path to +CONTENTS file for each installed port */ - n = strlcpy(tmp_file, pkgdbpath, strlen(pkgdbpath)+1); + n = strlcpy(tmp_file, pkgdbpath, sizeof(tmp_file)); n = strlcpy(tmp_file + n, "/", sizeof(tmp_file) - n); n = strlcat(tmp_file + n, pkgdbdir->d_name, sizeof(tmp_file) - n); - if(stat(tmp_file, &attribute) == -1) { + if (stat(tmp_file, &attribute) == -1) { fprintf(stderr, "can't open %s: %s\n", tmp_file, strerror(errno)); return EXIT_FAILURE; } - if(attribute.st_mode & S_IFREG) + if (attribute.st_mode & S_IFREG) continue; (void)strlcat(tmp_file + n, "/", sizeof(tmp_file) - n); @@ -155,7 +159,7 @@ main(int argc, char *argv[]) /* Open +CONTENT file */ fd = fopen(tmp_file, "r"); - if(fd == NULL) { + if (fd == NULL) { fprintf(stderr, "warning: can't open %s: %s\n", tmp_file, strerror(errno)); continue; @@ -165,25 +169,25 @@ main(int argc, char *argv[]) * Parses +CONTENT for ORIGIN line and * put element into linked list. */ - while(fgets(originline, maxcharperline, fd) != NULL) { + while (fgets(originline, maxcharperline, fd) != NULL) { tmpline1 = strstr(originline, origin); - if( tmpline1 != NULL ) { + if (tmpline1 != NULL) { /* Tmp variable to store port name. */ char *pname; pname = strrchr(originline, (int)':'); pname++; - if((curr = (INSTALLEDPORT *) + if ((curr = (INSTALLEDPORT *) malloc(sizeof(INSTALLEDPORT))) == NULL) (void)exit(EXIT_FAILURE); if (pname[strlen(pname) - 1] == '\n') pname[strlen(pname) - 1] = '\0'; - strlcpy (curr->name, pname, strlen(pname)+1); + strlcpy (curr->name, pname, sizeof(curr->name)); curr->next = head; head = curr; } } - if(ferror(fd)) { + if (ferror(fd)) { fprintf(stderr, "error reading input\n"); exit(EX_IOERR); } @@ -195,32 +199,41 @@ main(int argc, char *argv[]) } } - /* Open UPDATING file */ - fd = fopen(updatingfile, "r"); - if(fd == NULL) { + /* Fetch UPDATING file if needed and open file */ + if (isURL(updatingfile)) { + if ((fd = fetchGetURL(updatingfile, "")) == NULL) { + fprintf(stderr, "Error: Unable to get %s: %s\n", + updatingfile, fetchLastErrString); + exit(EX_UNAVAILABLE); + } + } + else { + fd = fopen(updatingfile, "r"); + } + if (fd == NULL) { fprintf(stderr, "can't open %s: %s\n", - updatingfile, strerror(errno)); + updatingfile, strerror(errno)); exit(EX_UNAVAILABLE); } /* Parse opened UPDATING file. */ - while(fgets(updatingline, maxcharperline, fd) != NULL) { + while (fgets(updatingline, maxcharperline, fd) != NULL) { /* No entry is found so far */ if (found == 0) { /* Search for AFFECTS line to parse the portname. */ tmpline1 = strstr(updatingline, affects); - if( tmpline1 != NULL ) { + if (tmpline1 != NULL) { curr = head; - while(curr != NULL) { + while (curr != NULL) { tmpline2 = strstr(updatingline, curr->name); - if( tmpline2 != NULL ) + if (tmpline2 != NULL) break; curr = curr->next; } - if( tmpline2 != NULL ) { + if (tmpline2 != NULL) { /* If -d is set, check if entry is newer than the date. */ - if ( (dflag == 1) && (strncmp(dateline, date, 8) < 0)) + if ((dflag == 1) && (strncmp(dateline, date, 8) < 0)) continue; printf("%s", dateline); printf("%s", updatingline); @@ -231,7 +244,7 @@ main(int argc, char *argv[]) /* Search for the end of an entry, if not found print the line. */ else { tmpline1 = strstr(updatingline, end); - if( tmpline1 == NULL ) + if (tmpline1 == NULL) printf("%s", updatingline); else { linelength = strlen(updatingline); @@ -245,7 +258,7 @@ main(int argc, char *argv[]) dateline = strdup(updatingline); } - if(ferror(fd)) { + if (ferror(fd)) { fprintf(stderr, "error reading input\n"); exit(EX_IOERR); } Modified: stable/7/usr.sbin/pkg_install/updating/pkg_updating.1 ============================================================================== --- stable/7/usr.sbin/pkg_install/updating/pkg_updating.1 Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/updating/pkg_updating.1 Mon May 21 13:07:12 2012 (r235722) @@ -45,26 +45,31 @@ Print help message. .El .Sh EXAMPLES .Bl -tag -width indent -.Dl pkg_updating +Shows all entries of all installed ports: .Pp -Shows all entries of all installed ports. +.Dl % pkg_updating .Pp -.Dl pkg_updating -d 20070101 +Shows all entries of all installed ports since 2007-01-01: .Pp -Shows all entries of all installed ports since 2007-01-01. +.Dl % pkg_updating -d 20070101 .Pp -.Dl pkg_updating apache mysql +Shows all entries for all apache and mysql ports: .Pp -Shows all entries for all apache and mysql ports. +.Dl % pkg_updating apache mysql .Pp -.Dl pkg_updating -d 20060101 apache +Shows all apache entries since 2006-01-01: .Pp -Shows all apache entries since 2006-01-01. -.Pp -.Dl pkg_updating -f /tmp/UPDATING +.Dl % pkg_updating -d 20060101 apache .Pp Defines that the UPDATING file is in /tmp and shows all entries of all -installed ports +installed ports: +.Pp +.Dl % pkg_updating -f /tmp/UPDATING +.Pp +Fetch UPDATING file from ftp mirror and show all entries of all +installed ports: +.Pp +.Dl % pkg_updating -f ftp://ftp.freebsd.org/pub/FreeBSD/ports/packages/UPDATING .Pp .El .Sh ENVIRONMENT Modified: stable/7/usr.sbin/pkg_install/version/perform.c ============================================================================== --- stable/7/usr.sbin/pkg_install/version/perform.c Mon May 21 13:05:41 2012 (r235721) +++ stable/7/usr.sbin/pkg_install/version/perform.c Mon May 21 13:07:12 2012 (r235722) @@ -35,28 +35,41 @@ static int pkg_do(char *); static void show_version(Package, const char *, const char *); /* - * This is the traditional pkg_perform, except that the argument is _not_ - * a list of packages. It is the index file from the command line. + * This is the traditional pkg_perform, except that the argument is _not_ a + * list of packages. It is the index file from the command line. * - * We loop over the installed packages, matching them with the -s flag - * if needed and calling pkg_do(). Before hand we set up a few things, - * and after we tear them down... + * We loop over the installed packages, matching them with the -s flag if + * needed and calling pkg_do(). Beforehand we set up a few things, and after + * we tear them down... + * + * Returns 0 on success, non-zero on failure, corresponding to the number of + * failed attempts to access the INDEX. */ int pkg_perform(char **indexarg) { char **pkgs, *pat[2], **patterns; struct index_entry *ie; - int i, err_cnt = 0; + int i, err_cnt = 0, rel_major_ver; int MatchType; + struct utsname u; + + if (uname(&u) == -1) { + warn("%s(): failed to determine uname information", __func__); + return 1; + } else if ((rel_major_ver = (int) strtol(u.release, NULL, 10)) <= 0) { + + } + /* * Try to find and open the INDEX. We only check IndexFile != NULL * later, if we actually need the INDEX. */ - if (*indexarg == NULL) - snprintf(IndexPath, sizeof(IndexPath), "%s/%s", PORTS_DIR, INDEX_FNAME); - else + if (*indexarg == NULL) { + snprintf(IndexPath, sizeof(IndexPath), "%s/INDEX-%d", PORTS_DIR, + rel_major_ver); + } else strlcpy(IndexPath, *indexarg, sizeof(IndexPath)); if (isURL(IndexPath)) IndexFile = fetchGetURL(IndexPath, ""); From owner-svn-src-all@FreeBSD.ORG Mon May 21 13:31:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12A6A1065673; Mon, 21 May 2012 13:31:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE0E28FC0C; Mon, 21 May 2012 13:31:27 +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 q4LDVRnn060092; Mon, 21 May 2012 13:31:27 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LDVRvB060077; Mon, 21 May 2012 13:31:27 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205211331.q4LDVRvB060077@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 21 May 2012 13:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 13:31:28 -0000 Author: bapt Date: Mon May 21 13:31:26 2012 New Revision: 235723 URL: http://svn.freebsd.org/changeset/base/235723 Log: Import byacc from invisible island, it brings us lots of compatibilities with bison, keeping full compatibility with our previous yacc implementation. Also bring the ability to create reentrant parser This fix bin/140309 [1] PR: bin/140309 [1] Submitted by: Philippe Pepiot [1] Approved by: des (mentor) MFC after: 1 month Added: head/contrib/byacc/ - copied from r235040, vendor/byacc/dist/ head/tools/regression/usr.bin/yacc/ head/tools/regression/usr.bin/yacc/Makefile (contents, props changed) head/tools/regression/usr.bin/yacc/calc.y (contents, props changed) head/tools/regression/usr.bin/yacc/calc1.y (contents, props changed) head/tools/regression/usr.bin/yacc/calc2.y (contents, props changed) head/tools/regression/usr.bin/yacc/calc3.y (contents, props changed) head/tools/regression/usr.bin/yacc/code_calc.y (contents, props changed) head/tools/regression/usr.bin/yacc/code_error.y (contents, props changed) head/tools/regression/usr.bin/yacc/error.y (contents, props changed) head/tools/regression/usr.bin/yacc/ftp.y (contents, props changed) head/tools/regression/usr.bin/yacc/grammar.y (contents, props changed) head/tools/regression/usr.bin/yacc/pure_calc.y (contents, props changed) head/tools/regression/usr.bin/yacc/pure_error.y (contents, props changed) head/tools/regression/usr.bin/yacc/quote_calc.y (contents, props changed) head/tools/regression/usr.bin/yacc/quote_calc2.y (contents, props changed) head/tools/regression/usr.bin/yacc/quote_calc3.y (contents, props changed) head/tools/regression/usr.bin/yacc/quote_calc4.y (contents, props changed) head/tools/regression/usr.bin/yacc/regress.00.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.01.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.02.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.03.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.04.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.05.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.06.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.07.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.08.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.09.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.10.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.11.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.12.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.13.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.14.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.sh (contents, props changed) head/tools/regression/usr.bin/yacc/regress.t (contents, props changed) head/tools/regression/usr.bin/yacc/undefined.y (contents, props changed) Deleted: head/usr.bin/yacc/ACKNOWLEDGEMENTS head/usr.bin/yacc/NEW_FEATURES head/usr.bin/yacc/NOTES head/usr.bin/yacc/README head/usr.bin/yacc/closure.c head/usr.bin/yacc/defs.h head/usr.bin/yacc/error.c head/usr.bin/yacc/lalr.c head/usr.bin/yacc/lr0.c head/usr.bin/yacc/main.c head/usr.bin/yacc/mkpar.c head/usr.bin/yacc/output.c head/usr.bin/yacc/reader.c head/usr.bin/yacc/skeleton.c head/usr.bin/yacc/symtab.c head/usr.bin/yacc/test/ head/usr.bin/yacc/verbose.c head/usr.bin/yacc/warshall.c head/usr.bin/yacc/yacc.1 head/usr.bin/yacc/yyfix.1 head/usr.bin/yacc/yyfix.sh Modified: head/contrib/byacc/defs.h head/contrib/byacc/main.c head/contrib/byacc/reader.c head/usr.bin/yacc/Makefile Modified: head/contrib/byacc/defs.h ============================================================================== --- vendor/byacc/dist/defs.h Fri May 4 22:54:54 2012 (r235040) +++ head/contrib/byacc/defs.h Mon May 21 13:31:26 2012 (r235723) @@ -241,7 +241,6 @@ extern char *line; extern int lineno; extern int outline; extern int exit_code; -extern int pure_parser; extern const char *const banner[]; extern const char *const xdecls[]; Modified: head/contrib/byacc/main.c ============================================================================== --- vendor/byacc/dist/main.c Fri May 4 22:54:54 2012 (r235040) +++ head/contrib/byacc/main.c Mon May 21 13:31:26 2012 (r235723) @@ -163,7 +163,7 @@ done(int k) } static void -onintr(int sig GCC_UNUSED) +onintr(__unused int sig) { got_intr = 1; done(EXIT_FAILURE); Modified: head/contrib/byacc/reader.c ============================================================================== --- vendor/byacc/dist/reader.c Fri May 4 22:54:54 2012 (r235040) +++ head/contrib/byacc/reader.c Mon May 21 13:31:26 2012 (r235723) @@ -338,6 +338,7 @@ keyword(void) } syntax_error(lineno, line, t_cptr); /*NOTREACHED */ + return (-1); } static void @@ -1781,6 +1782,8 @@ mark_symbol(void) int c; bucket *bp; + bp = NULL; + c = cptr[1]; if (c == '%' || c == '\\') { Added: head/tools/regression/usr.bin/yacc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/Makefile Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +all: + @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} Added: head/tools/regression/usr.bin/yacc/calc.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/calc.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,106 @@ +%{ +# include +# include + +int regs[26]; +int base; + +extern int yylex(void); +static void yyerror(const char *s); + +%} + +%start list + +%token DIGIT LETTER + +%left '|' +%left '&' +%left '+' '-' +%left '*' '/' '%' +%left UMINUS /* supplies precedence for unary minus */ + +%% /* beginning of rules section */ + +list : /* empty */ + | list stat '\n' + | list error '\n' + { yyerrok ; } + ; + +stat : expr + { printf("%d\n",$1);} + | LETTER '=' expr + { regs[$1] = $3; } + ; + +expr : '(' expr ')' + { $$ = $2; } + | expr '+' expr + { $$ = $1 + $3; } + | expr '-' expr + { $$ = $1 - $3; } + | expr '*' expr + { $$ = $1 * $3; } + | expr '/' expr + { $$ = $1 / $3; } + | expr '%' expr + { $$ = $1 % $3; } + | expr '&' expr + { $$ = $1 & $3; } + | expr '|' expr + { $$ = $1 | $3; } + | '-' expr %prec UMINUS + { $$ = - $2; } + | LETTER + { $$ = regs[$1]; } + | number + ; + +number: DIGIT + { $$ = $1; base = ($1==0) ? 8 : 10; } + | number DIGIT + { $$ = base * $1 + $2; } + ; + +%% /* start of programs */ + +int +main (void) +{ + while(!feof(stdin)) { + yyparse(); + } + return 0; +} + +static void +yyerror(const char *s) +{ + fprintf(stderr, "%s\n", s); +} + +int +yylex(void) +{ + /* lexical analysis routine */ + /* returns LETTER for a lower case letter, yylval = 0 through 25 */ + /* return DIGIT for a digit, yylval = 0 through 9 */ + /* all other characters are returned immediately */ + + int c; + + while( (c=getchar()) == ' ' ) { /* skip blanks */ } + + /* c is now nonblank */ + + if( islower( c )) { + yylval = c - 'a'; + return ( LETTER ); + } + if( isdigit( c )) { + yylval = c - '0'; + return ( DIGIT ); + } + return( c ); +} Added: head/tools/regression/usr.bin/yacc/calc1.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/calc1.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,305 @@ +%{ + +/* http://dinosaur.compilertools.net/yacc/index.html */ + +#include +#include +#include +#include + +typedef struct interval +{ + double lo, hi; +} +INTERVAL; + +INTERVAL vmul(double, double, INTERVAL); +INTERVAL vdiv(double, double, INTERVAL); + +extern int yylex(void); +static void yyerror(const char *s); + +int dcheck(INTERVAL); + +double dreg[26]; +INTERVAL vreg[26]; + +%} +%expect 18 + +%start line +%union +{ + int ival; + double dval; + INTERVAL vval; +} + +%token DREG VREG /* indices into dreg, vreg arrays */ +%token CONST /* floating point constant */ + +%type dexp /* expression */ +%type vexp /* interval expression */ + + /* precedence information about the operators */ + +%left '+' '-' +%left '*' '/' +%left UMINUS /* precedence for unary minus */ + +%% /* beginning of rules section */ + +lines : /* empty */ + | lines line + ; + +line : dexp '\n' + { + (void) printf("%15.8f\n", $1); + } + | vexp '\n' + { + (void) printf("(%15.8f, %15.8f)\n", $1.lo, $1.hi); + } + | DREG '=' dexp '\n' + { + dreg[$1] = $3; + } + | VREG '=' vexp '\n' + { + vreg[$1] = $3; + } + | error '\n' + { + yyerrok; + } + ; + +dexp : CONST + | DREG + { + $$ = dreg[$1]; + } + | dexp '+' dexp + { + $$ = $1 + $3; + } + | dexp '-' dexp + { + $$ = $1 - $3; + } + | dexp '*' dexp + { + $$ = $1 * $3; + } + | dexp '/' dexp + { + $$ = $1 / $3; + } + | '-' dexp %prec UMINUS + { + $$ = -$2; + } + | '(' dexp ')' + { + $$ = $2; + } + ; + +vexp : dexp + { + $$.hi = $$.lo = $1; + } + | '(' dexp ',' dexp ')' + { + $$.lo = $2; + $$.hi = $4; + if ( $$.lo > $$.hi ) + { + (void) printf("interval out of order\n"); + YYERROR; + } + } + | VREG + { + $$ = vreg[$1]; + } + | vexp '+' vexp + { + $$.hi = $1.hi + $3.hi; + $$.lo = $1.lo + $3.lo; + } + | dexp '+' vexp + { + $$.hi = $1 + $3.hi; + $$.lo = $1 + $3.lo; + } + | vexp '-' vexp + { + $$.hi = $1.hi - $3.lo; + $$.lo = $1.lo - $3.hi; + } + | dexp '-' vexp + { + $$.hi = $1 - $3.lo; + $$.lo = $1 - $3.hi; + } + | vexp '*' vexp + { + $$ = vmul( $1.lo, $1.hi, $3 ); + } + | dexp '*' vexp + { + $$ = vmul ($1, $1, $3 ); + } + | vexp '/' vexp + { + if (dcheck($3)) YYERROR; + $$ = vdiv ( $1.lo, $1.hi, $3 ); + } + | dexp '/' vexp + { + if (dcheck ( $3 )) YYERROR; + $$ = vdiv ($1, $1, $3 ); + } + | '-' vexp %prec UMINUS + { + $$.hi = -$2.lo; + $$.lo = -$2.hi; + } + | '(' vexp ')' + { + $$ = $2; + } + ; + +%% /* beginning of subroutines section */ + +#define BSZ 50 /* buffer size for floating point numbers */ + + /* lexical analysis */ + +static void +yyerror(const char *s) +{ + fprintf(stderr, "%s\n", s); +} + +int +yylex(void) +{ + int c; + + while ((c = getchar()) == ' ') + { /* skip over blanks */ + } + + if (isupper(c)) + { + yylval.ival = c - 'A'; + return (VREG); + } + if (islower(c)) + { + yylval.ival = c - 'a'; + return (DREG); + } + + if (isdigit(c) || c == '.') + { + /* gobble up digits, points, exponents */ + char buf[BSZ + 1], *cp = buf; + int dot = 0, expr = 0; + + for (; (cp - buf) < BSZ; ++cp, c = getchar()) + { + + *cp = c; + if (isdigit(c)) + continue; + if (c == '.') + { + if (dot++ || expr) + return ('.'); /* will cause syntax error */ + continue; + } + + if (c == 'e') + { + if (expr++) + return ('e'); /* will cause syntax error */ + continue; + } + + /* end of number */ + break; + } + *cp = '\0'; + + if ((cp - buf) >= BSZ) + printf("constant too long: truncated\n"); + else + ungetc(c, stdin); /* push back last char read */ + yylval.dval = atof(buf); + return (CONST); + } + return (c); +} + +static INTERVAL +hilo(double a, double b, double c, double d) +{ + /* returns the smallest interval containing a, b, c, and d */ + /* used by *, / routines */ + INTERVAL v; + + if (a > b) + { + v.hi = a; + v.lo = b; + } + else + { + v.hi = b; + v.lo = a; + } + + if (c > d) + { + if (c > v.hi) + v.hi = c; + if (d < v.lo) + v.lo = d; + } + else + { + if (d > v.hi) + v.hi = d; + if (c < v.lo) + v.lo = c; + } + return (v); +} + +INTERVAL +vmul(double a, double b, INTERVAL v) +{ + return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo)); +} + +int +dcheck(INTERVAL v) +{ + if (v.hi >= 0. && v.lo <= 0.) + { + printf("divisor interval contains 0.\n"); + return (1); + } + return (0); +} + +INTERVAL +vdiv(double a, double b, INTERVAL v) +{ + return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); +} Added: head/tools/regression/usr.bin/yacc/calc2.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/calc2.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,120 @@ +%parse-param { int regs[26] } +%parse-param { int *base } + +%lex-param { int *base } + +%{ +# include +# include + +#ifdef YYBISON +#define YYLEX_PARAM base +#define YYLEX_DECL() yylex(int *YYLEX_PARAM) +#define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s) +int YYLEX_DECL(); +static void YYERROR_DECL(); +#endif + +%} + +%start list + +%token DIGIT LETTER + +%left '|' +%left '&' +%left '+' '-' +%left '*' '/' '%' +%left UMINUS /* supplies precedence for unary minus */ + +%% /* beginning of rules section */ + +list : /* empty */ + | list stat '\n' + | list error '\n' + { yyerrok ; } + ; + +stat : expr + { printf("%d\n",$1);} + | LETTER '=' expr + { regs[$1] = $3; } + ; + +expr : '(' expr ')' + { $$ = $2; } + | expr '+' expr + { $$ = $1 + $3; } + | expr '-' expr + { $$ = $1 - $3; } + | expr '*' expr + { $$ = $1 * $3; } + | expr '/' expr + { $$ = $1 / $3; } + | expr '%' expr + { $$ = $1 % $3; } + | expr '&' expr + { $$ = $1 & $3; } + | expr '|' expr + { $$ = $1 | $3; } + | '-' expr %prec UMINUS + { $$ = - $2; } + | LETTER + { $$ = regs[$1]; } + | number + ; + +number: DIGIT + { $$ = $1; (*base) = ($1==0) ? 8 : 10; } + | number DIGIT + { $$ = (*base) * $1 + $2; } + ; + +%% /* start of programs */ + +#ifdef YYBYACC +extern int YYLEX_DECL(); +#endif + +int +main (void) +{ + int regs[26]; + int base = 10; + + while(!feof(stdin)) { + yyparse(regs, &base); + } + return 0; +} + +static void +YYERROR_DECL() +{ + fprintf(stderr, "%s\n", s); +} + +int +YYLEX_DECL() +{ + /* lexical analysis routine */ + /* returns LETTER for a lower case letter, yylval = 0 through 25 */ + /* return DIGIT for a digit, yylval = 0 through 9 */ + /* all other characters are returned immediately */ + + int c; + + while( (c=getchar()) == ' ' ) { /* skip blanks */ } + + /* c is now nonblank */ + + if( islower( c )) { + yylval = c - 'a'; + return ( LETTER ); + } + if( isdigit( c )) { + yylval = (c - '0') % (*base); + return ( DIGIT ); + } + return( c ); +} Added: head/tools/regression/usr.bin/yacc/calc3.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/calc3.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,123 @@ +%pure-parser + +%parse-param { int regs[26] } +%parse-param { int *base } + +%lex-param { int *base } + +%{ +# include +# include + +#ifdef YYBISON +#define YYSTYPE int +#define YYLEX_PARAM base +#define YYLEX_DECL() yylex(YYSTYPE *yylval, int *YYLEX_PARAM) +#define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s) +int YYLEX_DECL(); +static void YYERROR_DECL(); +#endif + +%} + +%start list + +%token DIGIT LETTER + +%left '|' +%left '&' +%left '+' '-' +%left '*' '/' '%' +%left UMINUS /* supplies precedence for unary minus */ + +%% /* beginning of rules section */ + +list : /* empty */ + | list stat '\n' + | list error '\n' + { yyerrok ; } + ; + +stat : expr + { printf("%d\n",$1);} + | LETTER '=' expr + { regs[$1] = $3; } + ; + +expr : '(' expr ')' + { $$ = $2; } + | expr '+' expr + { $$ = $1 + $3; } + | expr '-' expr + { $$ = $1 - $3; } + | expr '*' expr + { $$ = $1 * $3; } + | expr '/' expr + { $$ = $1 / $3; } + | expr '%' expr + { $$ = $1 % $3; } + | expr '&' expr + { $$ = $1 & $3; } + | expr '|' expr + { $$ = $1 | $3; } + | '-' expr %prec UMINUS + { $$ = - $2; } + | LETTER + { $$ = regs[$1]; } + | number + ; + +number: DIGIT + { $$ = $1; (*base) = ($1==0) ? 8 : 10; } + | number DIGIT + { $$ = (*base) * $1 + $2; } + ; + +%% /* start of programs */ + +#ifdef YYBYACC +extern int YYLEX_DECL(); +#endif + +int +main (void) +{ + int regs[26]; + int base = 10; + + while(!feof(stdin)) { + yyparse(regs, &base); + } + return 0; +} + +static void +YYERROR_DECL() +{ + fprintf(stderr, "%s\n", s); +} + +int +YYLEX_DECL() +{ + /* lexical analysis routine */ + /* returns LETTER for a lower case letter, yylval = 0 through 25 */ + /* return DIGIT for a digit, yylval = 0 through 9 */ + /* all other characters are returned immediately */ + + int c; + + while( (c=getchar()) == ' ' ) { /* skip blanks */ } + + /* c is now nonblank */ + + if( islower( c )) { + *yylval = (c - 'a'); + return ( LETTER ); + } + if( isdigit( c )) { + *yylval = (c - '0') % (*base); + return ( DIGIT ); + } + return( c ); +} Added: head/tools/regression/usr.bin/yacc/code_calc.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/code_calc.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,112 @@ +%{ +# include +# include + +int regs[26]; +int base; + +#ifdef YYBISON +int yylex(void); +static void yyerror(const char *s); +#endif + +%} + +%start list + +%token DIGIT LETTER + +%left '|' +%left '&' +%left '+' '-' +%left '*' '/' '%' +%left UMINUS /* supplies precedence for unary minus */ + +%% /* beginning of rules section */ + +list : /* empty */ + | list stat '\n' + | list error '\n' + { yyerrok ; } + ; + +stat : expr + { printf("%d\n",$1);} + | LETTER '=' expr + { regs[$1] = $3; } + ; + +expr : '(' expr ')' + { $$ = $2; } + | expr '+' expr + { $$ = $1 + $3; } + | expr '-' expr + { $$ = $1 - $3; } + | expr '*' expr + { $$ = $1 * $3; } + | expr '/' expr + { $$ = $1 / $3; } + | expr '%' expr + { $$ = $1 % $3; } + | expr '&' expr + { $$ = $1 & $3; } + | expr '|' expr + { $$ = $1 | $3; } + | '-' expr %prec UMINUS + { $$ = - $2; } + | LETTER + { $$ = regs[$1]; } + | number + ; + +number: DIGIT + { $$ = $1; base = ($1==0) ? 8 : 10; } + | number DIGIT + { $$ = base * $1 + $2; } + ; + +%% /* start of programs */ + +#ifdef YYBYACC +extern int YYLEX_DECL(); +#endif + +int +main (void) +{ + while(!feof(stdin)) { + yyparse(); + } + return 0; +} + +static void +yyerror(const char *s) +{ + fprintf(stderr, "%s\n", s); +} + +int +yylex(void) +{ + /* lexical analysis routine */ + /* returns LETTER for a lower case letter, yylval = 0 through 25 */ + /* return DIGIT for a digit, yylval = 0 through 9 */ + /* all other characters are returned immediately */ + + int c; + + while( (c=getchar()) == ' ' ) { /* skip blanks */ } + + /* c is now nonblank */ + + if( islower( c )) { + yylval = c - 'a'; + return ( LETTER ); + } + if( isdigit( c )) { + yylval = c - '0'; + return ( DIGIT ); + } + return( c ); +} Added: head/tools/regression/usr.bin/yacc/code_error.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/code_error.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,36 @@ +%{ + +#ifdef YYBISON +int yylex(void); +static void yyerror(const char *); +#endif + +%} +%% +S: error +%% + +#include + +#ifdef YYBYACC +extern int YYLEX_DECL(); +#endif + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} Added: head/tools/regression/usr.bin/yacc/error.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/error.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,28 @@ +%{ +int yylex(void); +static void yyerror(const char *); +%} +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} Added: head/tools/regression/usr.bin/yacc/ftp.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/ftp.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,1228 @@ +/* + * Copyright (c) 1985, 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#)ftpcmd.y 5.20.1.1 (Berkeley) 3/2/89 + */ + +/* + * Grammar for FTP commands. + * See RFC 959. + */ + +%{ + +/* sccsid[] = "@(#)ftpcmd.y 5.20.1.1 (Berkeley) 3/2/89"; */ + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef YYBISON +int yylex(void); +static void yyerror(const char *); +#endif + +extern struct sockaddr_in data_dest; +extern int logged_in; +extern struct passwd *pw; +extern int guest; +extern int logging; +extern int type; +extern int form; +extern int debug; +extern int timeout; +extern int maxtimeout; +extern int pdata; +extern char hostname[], remotehost[]; +extern char proctitle[]; +extern char *globerr; +extern int usedefault; +extern int transflag; +extern char tmpline[]; + +extern char **glob(char *); +extern char *renamefrom(char *); +extern void cwd(const char *); + +extern void dologout(int); +extern void fatal(const char *); +extern void makedir(const char *); +extern void nack(const char *); +extern void pass(const char *); +extern void passive(void); +extern void pwd(void); +extern void removedir(char *); +extern void renamecmd(char *, char *); +extern void retrieve(const char *, const char *); +extern void send_file_list(const char *); +extern void statcmd(void); +extern void statfilecmd(const char *); +extern void store(char *, const char *, int); +extern void user(const char *); + +extern void perror_reply(int, const char *, ...); +extern void reply(int, const char *, ...); +extern void lreply(int, const char *, ...); + +static int cmd_type; +static int cmd_form; +static int cmd_bytesz; +char cbuf[512]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon May 21 14:47:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C46EE106566C; Mon, 21 May 2012 14:47:35 +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 AE87B8FC16; Mon, 21 May 2012 14:47: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 q4LElZdE062157; Mon, 21 May 2012 14:47:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LElZNm062155; Mon, 21 May 2012 14:47:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201205211447.q4LElZNm062155@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 21 May 2012 14:47:35 +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: r235724 - stable/9/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 14:47:36 -0000 Author: hselasky Date: Mon May 21 14:47:34 2012 New Revision: 235724 URL: http://svn.freebsd.org/changeset/base/235724 Log: MFC r235451: Move reset of USB mouse parameters from the USB mouse attach to the USB mouse device open. Protect against multi character device open. Some other nits. Modified: stable/9/sys/dev/usb/input/ums.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/input/ums.c ============================================================================== --- stable/9/sys/dev/usb/input/ums.c Mon May 21 13:31:26 2012 (r235723) +++ stable/9/sys/dev/usb/input/ums.c Mon May 21 14:47:34 2012 (r235724) @@ -134,6 +134,7 @@ struct ums_softc { struct usb_xfer *sc_xfer[UMS_N_TRANSFER]; int sc_pollrate; + int sc_fflags; uint8_t sc_buttons; uint8_t sc_iid; @@ -677,32 +678,13 @@ ums_attach(device_t dev) DPRINTF("size=%d, id=%d\n", isize, sc->sc_iid); #endif - if (sc->sc_buttons > MOUSE_MSC_MAXBUTTON) - sc->sc_hw.buttons = MOUSE_MSC_MAXBUTTON; - else - sc->sc_hw.buttons = sc->sc_buttons; - - sc->sc_hw.iftype = MOUSE_IF_USB; - sc->sc_hw.type = MOUSE_MOUSE; - sc->sc_hw.model = MOUSE_MODEL_GENERIC; - sc->sc_hw.hwid = 0; - - sc->sc_mode.protocol = MOUSE_PROTO_MSC; - sc->sc_mode.rate = -1; - sc->sc_mode.resolution = MOUSE_RES_UNKNOWN; - sc->sc_mode.accelfactor = 0; - sc->sc_mode.level = 0; - sc->sc_mode.packetsize = MOUSE_MSC_PACKETSIZE; - sc->sc_mode.syncmask[0] = MOUSE_MSC_SYNCMASK; - sc->sc_mode.syncmask[1] = MOUSE_MSC_SYNC; - err = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, &ums_fifo_methods, &sc->sc_fifo, device_get_unit(dev), -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); - if (err) { + if (err) goto detach; - } + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "parseinfo", CTLTYPE_STRING|CTLFLAG_RD, @@ -825,7 +807,7 @@ ums_put_queue(struct ums_softc *sc, int3 static void ums_reset_buf(struct ums_softc *sc) { - /* reset read queue */ + /* reset read queue, must be called locked */ usb_fifo_reset(sc->sc_fifo.fp[USB_FIFO_RX]); } @@ -836,7 +818,33 @@ ums_open(struct usb_fifo *fifo, int ffla DPRINTFN(2, "\n"); - if (fflags & FREAD) { + /* check for duplicate open, should not happen */ + if (sc->sc_fflags & fflags) + return (EBUSY); + + /* check for first open */ + if (sc->sc_fflags == 0) { + + /* reset all USB mouse parameters */ + + if (sc->sc_buttons > MOUSE_MSC_MAXBUTTON) + sc->sc_hw.buttons = MOUSE_MSC_MAXBUTTON; + else + sc->sc_hw.buttons = sc->sc_buttons; + + sc->sc_hw.iftype = MOUSE_IF_USB; + sc->sc_hw.type = MOUSE_MOUSE; + sc->sc_hw.model = MOUSE_MODEL_GENERIC; + sc->sc_hw.hwid = 0; + + sc->sc_mode.protocol = MOUSE_PROTO_MSC; + sc->sc_mode.rate = -1; + sc->sc_mode.resolution = MOUSE_RES_UNKNOWN; + sc->sc_mode.accelfactor = 0; + sc->sc_mode.level = 0; + sc->sc_mode.packetsize = MOUSE_MSC_PACKETSIZE; + sc->sc_mode.syncmask[0] = MOUSE_MSC_SYNCMASK; + sc->sc_mode.syncmask[1] = MOUSE_MSC_SYNC; /* reset status */ @@ -847,21 +855,31 @@ ums_open(struct usb_fifo *fifo, int ffla sc->sc_status.dy = 0; sc->sc_status.dz = 0; /* sc->sc_status.dt = 0; */ + } + if (fflags & FREAD) { + /* allocate RX buffer */ if (usb_fifo_alloc_buffer(fifo, UMS_BUF_SIZE, UMS_IFQ_MAXLEN)) { return (ENOMEM); } } + + sc->sc_fflags |= fflags & (FREAD | FWRITE); return (0); } static void ums_close(struct usb_fifo *fifo, int fflags) { - if (fflags & FREAD) { + struct ums_softc *sc = usb_fifo_softc(fifo); + + DPRINTFN(2, "\n"); + + if (fflags & FREAD) usb_fifo_free_buffer(fifo); - } + + sc->sc_fflags &= ~(fflags & (FREAD | FWRITE)); } static int @@ -891,7 +909,7 @@ ums_ioctl(struct usb_fifo *fifo, u_long /* don't change the current setting */ } else if ((mode.level < 0) || (mode.level > 1)) { error = EINVAL; - goto done; + break; } else { sc->sc_mode.level = mode.level; } @@ -928,7 +946,7 @@ ums_ioctl(struct usb_fifo *fifo, u_long case MOUSE_SETLEVEL: if (*(int *)addr < 0 || *(int *)addr > 1) { error = EINVAL; - goto done; + break; } sc->sc_mode.level = *(int *)addr; @@ -975,9 +993,9 @@ ums_ioctl(struct usb_fifo *fifo, u_long } default: error = ENOTTY; + break; } -done: mtx_unlock(&sc->sc_mtx); return (error); } From owner-svn-src-all@FreeBSD.ORG Mon May 21 15:01:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64E1C1065676; Mon, 21 May 2012 15:01:36 +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 453868FC0A; Mon, 21 May 2012 15:01: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 q4LF1Zpn062595; Mon, 21 May 2012 15:01:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LF1Zep062593; Mon, 21 May 2012 15:01:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201205211501.q4LF1Zep062593@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 21 May 2012 15:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235725 - head/etc/devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 15:01:36 -0000 Author: hselasky Date: Mon May 21 15:01:35 2012 New Revision: 235725 URL: http://svn.freebsd.org/changeset/base/235725 Log: Regenerate usb.conf MFC after: 3 days Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Mon May 21 14:47:34 2012 (r235724) +++ head/etc/devd/usb.conf Mon May 21 15:01:35 2012 (r235725) @@ -157,7 +157,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0403"; - match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xa6d0|0xa6d0|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; + match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; action "kldload -n uftdi"; }; @@ -1021,7 +1021,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05c6"; - match "product" "(0x1000|0x6000|0x6613)"; + match "product" "(0x1000|0x6000|0x6613|0x9000)"; action "kldload -n u3g"; }; @@ -2852,6 +2852,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1199"; + match "product" "0x68aa"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x11ad"; match "product" "0x0701"; action "kldload -n uplcom"; @@ -3661,7 +3669,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x19d2"; - match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x2000|0x2002|0x2003|0xfff1|0xfff5|0xfffe)"; + match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x1179|0x2000|0x2002|0x2003|0xfff1|0xfff5|0xfffe)"; action "kldload -n u3g"; }; @@ -4165,7 +4173,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x9710"; - match "product" "0x7830"; + match "product" "(0x7830|0x7832)"; action "kldload -n if_mos"; }; @@ -4336,5 +4344,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 1652 USB entries processed +# 1654 USB entries processed From owner-svn-src-all@FreeBSD.ORG Mon May 21 15:38:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D899C1065675; Mon, 21 May 2012 15:38:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id ADE1C8FC1E; Mon, 21 May 2012 15:38:46 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2F554B949; Mon, 21 May 2012 11:38:46 -0400 (EDT) From: John Baldwin To: Gleb Kurtsou Date: Mon, 21 May 2012 11:27:34 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <201205181001.q4IA1VED044374@svn.freebsd.org> <201205180941.48076.jhb@freebsd.org> <20120518152436.GA9116@reks> In-Reply-To: <20120518152436.GA9116@reks> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201205211127.34052.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 21 May 2012 11:38:46 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235601 - head/include/protocols X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 15:38:46 -0000 On Friday, May 18, 2012 11:24:36 am Gleb Kurtsou wrote: > On (18/05/2012 09:41), John Baldwin wrote: > > On Friday, May 18, 2012 6:01:31 am Gleb Kurtsou wrote: > > > Author: gleb > > > Date: Fri May 18 10:01:31 2012 > > > New Revision: 235601 > > > URL: http://svn.freebsd.org/changeset/base/235601 > > > > > > Log: > > > Don't use ino_t in dumprestore protocol definition. > > > > > > Since ino_t size is about to change to 64-bits, replace ino_t used in > > > dump protocol definition with 32-bit dump_ino_t to preserve backward > > > compatibility. At some point, it may be necessary to use spare fields > > > in struct in order to fully support 64-bit inode numbers. > > > > > > Sponsored by: Google Summer of Code 2011 > > > > A question about your stat changes: did you expand dev_t to 32 bits for the > > AFS folks, or did you leave it as 16 bits? > > dev_t is already 32-bit. Changing it to 64-bit was discussed at some > point and from what I recall no decision was made: > > http://marc.info/?t=129119478700005&r=1&w=2 > > I'm going to commit preparatory changes only for now. Then publish diff > for testing. We can still change dev_t to 64-bit if needed. Although I > didn't work on it. Ah, it was 64-bit they asked for. If it is easy to do so, I'd favor changing it since you've already done all the hard work of rolling a new stat structure. I'd rather err on wasting 32-bits for dev_t than having to do all this over again. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon May 21 15:45:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2647E1065670; Mon, 21 May 2012 15:45:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11EA18FC17; Mon, 21 May 2012 15:45:19 +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 q4LFjIYc063694; Mon, 21 May 2012 15:45:18 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LFjISZ063692; Mon, 21 May 2012 15:45:18 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205211545.q4LFjISZ063692@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 21 May 2012 15:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235726 - head/usr.sbin/pkg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 15:45:19 -0000 Author: bapt Date: Mon May 21 15:45:18 2012 New Revision: 235726 URL: http://svn.freebsd.org/changeset/base/235726 Log: Add missing \n when generating pkg.conf Reported by: beat Approved by: des (mentor) MFC after: 1 day Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Mon May 21 15:01:35 2012 (r235725) +++ head/usr.sbin/pkg/pkg.c Mon May 21 15:45:18 2012 (r235726) @@ -371,7 +371,7 @@ bootstrap_pkg(void) config = fopen(conf, "w+"); if (config == NULL) goto cleanup; - fprintf(config, "packagesite: %s", url); + fprintf(config, "packagesite: %s\n", url); fclose(config); } From owner-svn-src-all@FreeBSD.ORG Mon May 21 16:03:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EB56106566C; Mon, 21 May 2012 16:03:45 +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 EEC298FC23; Mon, 21 May 2012 16:03: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 q4LG3ifl064166; Mon, 21 May 2012 16:03:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LG3igN064164; Mon, 21 May 2012 16:03:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205211603.q4LG3igN064164@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 21 May 2012 16:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235727 - head/gnu/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 16:03:45 -0000 Author: marcel Date: Mon May 21 16:03:44 2012 New Revision: 235727 URL: http://svn.freebsd.org/changeset/base/235727 Log: Don't recurse into libssp when MK_SSP is set to no. Modified: head/gnu/lib/Makefile Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Mon May 21 15:45:18 2012 (r235726) +++ head/gnu/lib/Makefile Mon May 21 16:03:44 2012 (r235727) @@ -2,7 +2,11 @@ .include -SUBDIR= csu libgcc libgcov libdialog libgomp libregex libreadline libssp +SUBDIR= csu libgcc libgcov libdialog libgomp libregex libreadline + +.if ${MK_SSP} != "no" +SUBDIR+= libssp +.endif # libsupc++ uses libstdc++ headers, although 'make includes' should # have taken care of that already. From owner-svn-src-all@FreeBSD.ORG Mon May 21 17:51:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 494B310658F3; Mon, 21 May 2012 17:51:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34C0D8FC17; Mon, 21 May 2012 17:51:27 +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 q4LHpQio067132; Mon, 21 May 2012 17:51:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LHpQc5067130; Mon, 21 May 2012 17:51:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205211751.q4LHpQc5067130@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 May 2012 17:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235728 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 17:51:27 -0000 Author: adrian Date: Mon May 21 17:51:26 2012 New Revision: 235728 URL: http://svn.freebsd.org/changeset/base/235728 Log: Re-add 'ic' and properly wrap it in the SUPERG macro. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Mon May 21 16:03:44 2012 (r235727) +++ head/sys/dev/ath/if_ath_rx.c Mon May 21 17:51:26 2012 (r235728) @@ -767,6 +767,9 @@ ath_rx_proc(struct ath_softc *sc, int re struct ath_buf *bf; struct ifnet *ifp = sc->sc_ifp; struct ath_hal *ah = sc->sc_ah; +#ifdef IEEE80211_SUPPORT_SUPERG + struct ieee80211com *ic = ifp->if_l2com; +#endif struct ath_desc *ds; struct ath_rx_status *rs; struct mbuf *m; From owner-svn-src-all@FreeBSD.ORG Mon May 21 18:28:24 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC6D21065676; Mon, 21 May 2012 18:28:24 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from smtp5.server.rpi.edu (smtp5.server.rpi.edu [128.113.2.225]) by mx1.freebsd.org (Postfix) with ESMTP id 30D668FC0A; Mon, 21 May 2012 18:28:23 +0000 (UTC) Received: from gilead.netel.rpi.edu (gilead.netel.rpi.edu [128.113.124.121]) by smtp5.server.rpi.edu (8.13.1/8.13.1) with ESMTP id q4LHK6rE007508; Mon, 21 May 2012 13:20:06 -0400 Message-ID: <4FBA7946.7040702@FreeBSD.org> Date: Mon, 21 May 2012 13:20:06 -0400 From: Garance A Drosehn User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100722 Eudora/3.0.4 MIME-Version: 1.0 To: John Baldwin References: <201205181001.q4IA1VED044374@svn.freebsd.org> <201205180941.48076.jhb@freebsd.org> <20120518152436.GA9116@reks> <201205211127.34052.jhb@freebsd.org> In-Reply-To: <201205211127.34052.jhb@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Bayes-Prob: 0.0001 (Score 0) X-RPI-SA-Score: 2.30 (**) [Hold at 8.00] COMBINED_FROM, INFO_TLD, RATWARE_GECKO_BUILD X-CanItPRO-Stream: outgoing X-Canit-Stats-ID: 49638602 - cb1303eee5ea X-Scanned-By: CanIt (www . roaringpenguin . com) on 128.113.2.225 Cc: svn-src-head@FreeBSD.org, Gleb Kurtsou , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r235601 - head/include/protocols X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 18:28:24 -0000 On 5/21/12 11:27 AM, John Baldwin wrote: > On Friday, May 18, 2012 11:24:36 am Gleb Kurtsou wrote: > >> On (18/05/2012 09:41), John Baldwin wrote: >> >>> A question about your stat changes: did you expand dev_t to 32 bits >>> for the AFS folks, or did you leave it as 16 bits? >> dev_t is already 32-bit. Changing it to 64-bit was discussed at some >> point and from what I recall no decision was made: >> >> http://marc.info/?t=129119478700005&r=1&w=2 >> >> I'm going to commit preparatory changes only for now. Then publish >> diff for testing. We can still change dev_t to 64-bit if needed. >> Although I didn't work on it. >> > Ah, it was 64-bit they asked for. If it is easy to do so, I'd favor > changing it since you've already done all the hard work of rolling a > new stat structure. I'd rather err on wasting 32-bits for dev_t than > having to do all this over again. > I would also like to see dev_t changed to 64-bits as part of these 'stat' changes, if that won't cause too much work. It should be less work to do it as part of these changes than to do it later! If changing dev_t to 64-bits turns out to be too much work right now, then maybe we could at least reserve a 64-bit space and have the current dev_t be the low-order 32-bits of that space. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-svn-src-all@FreeBSD.ORG Mon May 21 19:58:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 665871065673; Mon, 21 May 2012 19:58: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 479C88FC14; Mon, 21 May 2012 19:58: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 q4LJwe8q070840; Mon, 21 May 2012 19:58:40 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LJweXG070838; Mon, 21 May 2012 19:58:40 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201205211958.q4LJweXG070838@svn.freebsd.org> From: Sean Bruno Date: Mon, 21 May 2012 19:58: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: r235738 - in stable/9/sys: . dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 19:58:41 -0000 Author: sbruno Date: Mon May 21 19:58:40 2012 New Revision: 235738 URL: http://svn.freebsd.org/changeset/base/235738 Log: MFC r235634 Fix and update battery status bits according to linux driver Modified: stable/9/sys/dev/mfi/mfireg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/Makefile (props changed) stable/9/sys/amd64/ (props changed) stable/9/sys/arm/ (props changed) stable/9/sys/bsm/ (props changed) stable/9/sys/cam/ (props changed) stable/9/sys/cddl/ (props changed) stable/9/sys/compat/ (props changed) stable/9/sys/contrib/ (props changed) stable/9/sys/crypto/ (props changed) stable/9/sys/ddb/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/aac/ (props changed) stable/9/sys/dev/acpi_support/ (props changed) stable/9/sys/dev/acpica/ (props changed) stable/9/sys/dev/adb/ (props changed) stable/9/sys/dev/adlink/ (props changed) stable/9/sys/dev/advansys/ (props changed) stable/9/sys/dev/ae/ (props changed) stable/9/sys/dev/age/ (props changed) stable/9/sys/dev/agp/ (props changed) stable/9/sys/dev/aha/ (props changed) stable/9/sys/dev/ahb/ (props changed) stable/9/sys/dev/ahci/ (props changed) stable/9/sys/dev/aic/ (props changed) stable/9/sys/dev/aic7xxx/ (props changed) stable/9/sys/dev/alc/ (props changed) stable/9/sys/dev/ale/ (props changed) stable/9/sys/dev/amd/ (props changed) stable/9/sys/dev/amdsbwd/ (props changed) stable/9/sys/dev/amdtemp/ (props changed) stable/9/sys/dev/amr/ (props changed) stable/9/sys/dev/an/ (props changed) stable/9/sys/dev/arcmsr/ (props changed) stable/9/sys/dev/asmc/ (props changed) stable/9/sys/dev/asr/ (props changed) stable/9/sys/dev/ata/ (props changed) stable/9/sys/dev/ath/ (props changed) stable/9/sys/dev/atkbdc/ (props changed) stable/9/sys/dev/auxio/ (props changed) stable/9/sys/dev/bce/ (props changed) stable/9/sys/dev/bfe/ (props changed) stable/9/sys/dev/bge/ (props changed) stable/9/sys/dev/bktr/ (props changed) stable/9/sys/dev/bm/ (props changed) stable/9/sys/dev/buslogic/ (props changed) stable/9/sys/dev/bwi/ (props changed) stable/9/sys/dev/bwn/ (props changed) stable/9/sys/dev/bxe/ (props changed) stable/9/sys/dev/cardbus/ (props changed) stable/9/sys/dev/cas/ (props changed) stable/9/sys/dev/ce/ (props changed) stable/9/sys/dev/cesa/ (props changed) stable/9/sys/dev/cfe/ (props changed) stable/9/sys/dev/cfi/ (props changed) stable/9/sys/dev/ciss/ (props changed) stable/9/sys/dev/cm/ (props changed) stable/9/sys/dev/cmx/ (props changed) stable/9/sys/dev/coretemp/ (props changed) stable/9/sys/dev/cp/ (props changed) stable/9/sys/dev/cpuctl/ (props changed) stable/9/sys/dev/cpufreq/ (props changed) stable/9/sys/dev/cs/ (props changed) stable/9/sys/dev/ct/ (props changed) stable/9/sys/dev/ctau/ (props changed) stable/9/sys/dev/cx/ (props changed) stable/9/sys/dev/cxgb/ (props changed) stable/9/sys/dev/cxgbe/ (props changed) stable/9/sys/dev/cy/ (props changed) stable/9/sys/dev/dc/ (props changed) stable/9/sys/dev/dcons/ (props changed) stable/9/sys/dev/de/ (props changed) stable/9/sys/dev/digi/ (props changed) stable/9/sys/dev/dpms/ (props changed) stable/9/sys/dev/dpt/ (props changed) stable/9/sys/dev/drm/ (props changed) stable/9/sys/dev/ed/ (props changed) stable/9/sys/dev/eisa/ (props changed) stable/9/sys/dev/en/ (props changed) stable/9/sys/dev/ep/ (props changed) stable/9/sys/dev/esp/ (props changed) stable/9/sys/dev/et/ (props changed) stable/9/sys/dev/ex/ (props changed) stable/9/sys/dev/exca/ (props changed) stable/9/sys/dev/fatm/ (props changed) stable/9/sys/dev/fb/ (props changed) stable/9/sys/dev/fdc/ (props changed) stable/9/sys/dev/fdt/ (props changed) stable/9/sys/dev/fe/ (props changed) stable/9/sys/dev/firewire/ (props changed) stable/9/sys/dev/flash/ (props changed) stable/9/sys/dev/fxp/ (props changed) stable/9/sys/dev/gem/ (props changed) stable/9/sys/dev/glxiic/ (props changed) stable/9/sys/dev/glxsb/ (props changed) stable/9/sys/dev/gpio/ (props changed) stable/9/sys/dev/hatm/ (props changed) stable/9/sys/dev/hifn/ (props changed) stable/9/sys/dev/hme/ (props changed) stable/9/sys/dev/hpt27xx/ (props changed) stable/9/sys/dev/hptiop/ (props changed) stable/9/sys/dev/hptmv/ (props changed) stable/9/sys/dev/hptrr/ (props changed) stable/9/sys/dev/hwpmc/ (props changed) stable/9/sys/dev/ic/ (props changed) stable/9/sys/dev/ichsmb/ (props changed) stable/9/sys/dev/ichwd/ (props changed) stable/9/sys/dev/ida/ (props changed) stable/9/sys/dev/ie/ (props changed) stable/9/sys/dev/ieee488/ (props changed) stable/9/sys/dev/if_ndis/ (props changed) stable/9/sys/dev/iicbus/ (props changed) stable/9/sys/dev/iir/ (props changed) stable/9/sys/dev/io/ (props changed) stable/9/sys/dev/ipmi/ (props changed) stable/9/sys/dev/ips/ (props changed) stable/9/sys/dev/ipw/ (props changed) stable/9/sys/dev/isci/ (props changed) stable/9/sys/dev/iscsi/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ispfw/ (props changed) stable/9/sys/dev/iwi/ (props changed) stable/9/sys/dev/iwn/ (props changed) stable/9/sys/dev/ixgb/ (props changed) stable/9/sys/dev/jme/ (props changed) stable/9/sys/dev/joy/ (props changed) stable/9/sys/dev/kbd/ (props changed) stable/9/sys/dev/kbdmux/ (props changed) stable/9/sys/dev/ksyms/ (props changed) stable/9/sys/dev/le/ (props changed) stable/9/sys/dev/led/ (props changed) stable/9/sys/dev/lge/ (props changed) stable/9/sys/dev/lindev/ (props changed) stable/9/sys/dev/lmc/ (props changed) stable/9/sys/dev/malo/ (props changed) stable/9/sys/dev/mc146818/ (props changed) stable/9/sys/dev/mca/ (props changed) stable/9/sys/dev/mcd/ (props changed) stable/9/sys/dev/md/ (props changed) stable/9/sys/dev/mem/ (props changed) stable/9/sys/dev/mge/ (props changed) stable/9/sys/dev/mii/ (props changed) stable/9/sys/dev/mk48txx/ (props changed) stable/9/sys/dev/mlx/ (props changed) stable/9/sys/dev/mly/ (props changed) stable/9/sys/dev/mmc/ (props changed) stable/9/sys/dev/mn/ (props changed) stable/9/sys/dev/mps/ (props changed) stable/9/sys/dev/mpt/ (props changed) stable/9/sys/dev/mse/ (props changed) stable/9/sys/dev/msk/ (props changed) stable/9/sys/dev/mvs/ (props changed) stable/9/sys/dev/mwl/ (props changed) stable/9/sys/dev/mxge/ (props changed) stable/9/sys/dev/my/ (props changed) stable/9/sys/dev/ncv/ (props changed) stable/9/sys/dev/netmap/ (props changed) stable/9/sys/dev/nfe/ (props changed) stable/9/sys/dev/nge/ (props changed) stable/9/sys/dev/nmdm/ (props changed) stable/9/sys/dev/nsp/ (props changed) stable/9/sys/dev/null/ (props changed) stable/9/sys/dev/nve/ (props changed) stable/9/sys/dev/nvram/ (props changed) stable/9/sys/dev/nvram2env/ (props changed) stable/9/sys/dev/nxge/ (props changed) stable/9/sys/dev/oce/ (props changed) stable/9/sys/dev/ofw/ (props changed) stable/9/sys/dev/patm/ (props changed) stable/9/sys/dev/pbio/ (props changed) stable/9/sys/dev/pccard/ (props changed) stable/9/sys/dev/pccbb/ (props changed) stable/9/sys/dev/pcf/ (props changed) stable/9/sys/dev/pci/ (props changed) stable/9/sys/dev/pcn/ (props changed) stable/9/sys/dev/pdq/ (props changed) stable/9/sys/dev/powermac_nvram/ (props changed) stable/9/sys/dev/ppbus/ (props changed) stable/9/sys/dev/ppc/ (props changed) stable/9/sys/dev/pst/ (props changed) stable/9/sys/dev/pty/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/dev/qlxgb/ (props changed) stable/9/sys/dev/quicc/ (props changed) stable/9/sys/dev/ral/ (props changed) stable/9/sys/dev/random/ (props changed) stable/9/sys/dev/rc/ (props changed) stable/9/sys/dev/re/ (props changed) stable/9/sys/dev/rndtest/ (props changed) stable/9/sys/dev/rp/ (props changed) stable/9/sys/dev/rt/ (props changed) stable/9/sys/dev/safe/ (props changed) stable/9/sys/dev/sbni/ (props changed) stable/9/sys/dev/scc/ (props changed) stable/9/sys/dev/scd/ (props changed) stable/9/sys/dev/sdhci/ (props changed) stable/9/sys/dev/sec/ (props changed) stable/9/sys/dev/sf/ (props changed) stable/9/sys/dev/sfxge/ (props changed) stable/9/sys/dev/sge/ (props changed) stable/9/sys/dev/si/ (props changed) stable/9/sys/dev/siba/ (props changed) stable/9/sys/dev/siis/ (props changed) stable/9/sys/dev/sio/ (props changed) stable/9/sys/dev/sis/ (props changed) stable/9/sys/dev/sk/ (props changed) stable/9/sys/dev/smbus/ (props changed) stable/9/sys/dev/smc/ (props changed) stable/9/sys/dev/sn/ (props changed) stable/9/sys/dev/snc/ (props changed) stable/9/sys/dev/snp/ (props changed) stable/9/sys/dev/sound/ (props changed) stable/9/sys/dev/speaker/ (props changed) stable/9/sys/dev/spibus/ (props changed) stable/9/sys/dev/ste/ (props changed) stable/9/sys/dev/stg/ (props changed) stable/9/sys/dev/stge/ (props changed) stable/9/sys/dev/streams/ (props changed) stable/9/sys/dev/sym/ (props changed) stable/9/sys/dev/syscons/ (props changed) stable/9/sys/dev/tdfx/ (props changed) stable/9/sys/dev/ti/ (props changed) stable/9/sys/dev/tl/ (props changed) stable/9/sys/dev/tpm/ (props changed) stable/9/sys/dev/trm/ (props changed) stable/9/sys/dev/tsec/ (props changed) stable/9/sys/dev/twa/ (props changed) stable/9/sys/dev/twe/ (props changed) stable/9/sys/dev/tws/ (props changed) stable/9/sys/dev/tx/ (props changed) stable/9/sys/dev/txp/ (props changed) stable/9/sys/dev/uart/ (props changed) stable/9/sys/dev/ubsec/ (props changed) stable/9/sys/dev/usb/ (props changed) stable/9/sys/dev/utopia/ (props changed) stable/9/sys/dev/vge/ (props changed) stable/9/sys/dev/viawd/ (props changed) stable/9/sys/dev/vkbd/ (props changed) stable/9/sys/dev/vr/ (props changed) stable/9/sys/dev/vte/ (props changed) stable/9/sys/dev/vx/ (props changed) stable/9/sys/dev/vxge/ (props changed) stable/9/sys/dev/watchdog/ (props changed) stable/9/sys/dev/wb/ (props changed) stable/9/sys/dev/wds/ (props changed) stable/9/sys/dev/wi/ (props changed) stable/9/sys/dev/wl/ (props changed) stable/9/sys/dev/wpi/ (props changed) stable/9/sys/dev/xe/ (props changed) stable/9/sys/dev/xen/ (props changed) stable/9/sys/dev/xl/ (props changed) stable/9/sys/gdb/ (props changed) stable/9/sys/geom/ (props changed) stable/9/sys/gnu/ (props changed) stable/9/sys/i386/ (props changed) stable/9/sys/ia64/ (props changed) stable/9/sys/isa/ (props changed) stable/9/sys/kern/ (props changed) stable/9/sys/kgssapi/ (props changed) stable/9/sys/libkern/ (props changed) stable/9/sys/mips/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/net80211/ (props changed) stable/9/sys/netatalk/ (props changed) stable/9/sys/netgraph/ (props changed) stable/9/sys/netinet/ (props changed) stable/9/sys/netinet6/ (props changed) stable/9/sys/netipsec/ (props changed) stable/9/sys/netipx/ (props changed) stable/9/sys/netnatm/ (props changed) stable/9/sys/netncp/ (props changed) stable/9/sys/netsmb/ (props changed) stable/9/sys/nfs/ (props changed) stable/9/sys/nfsclient/ (props changed) stable/9/sys/nfsserver/ (props changed) stable/9/sys/nlm/ (props changed) stable/9/sys/ofed/ (props changed) stable/9/sys/opencrypto/ (props changed) stable/9/sys/pc98/ (props changed) stable/9/sys/pci/ (props changed) stable/9/sys/powerpc/ (props changed) stable/9/sys/rpc/ (props changed) stable/9/sys/security/ (props changed) stable/9/sys/sparc64/ (props changed) stable/9/sys/sys/ (props changed) stable/9/sys/teken/ (props changed) stable/9/sys/tools/ (props changed) stable/9/sys/ufs/ (props changed) stable/9/sys/vm/ (props changed) stable/9/sys/x86/ (props changed) stable/9/sys/xdr/ (props changed) stable/9/sys/xen/ (props changed) Modified: stable/9/sys/dev/mfi/mfireg.h ============================================================================== --- stable/9/sys/dev/mfi/mfireg.h Mon May 21 19:53:22 2012 (r235737) +++ stable/9/sys/dev/mfi/mfireg.h Mon May 21 19:58:40 2012 (r235738) @@ -1377,8 +1377,13 @@ struct mfi_bbu_status { #define MFI_BBU_STATE_PACK_MISSING (1 << 0) #define MFI_BBU_STATE_VOLTAGE_LOW (1 << 1) #define MFI_BBU_STATE_TEMPERATURE_HIGH (1 << 2) -#define MFI_BBU_STATE_CHARGE_ACTIVE (1 << 0) -#define MFI_BBU_STATE_DISCHARGE_ACTIVE (1 << 0) +#define MFI_BBU_STATE_CHARGE_ACTIVE (1 << 3) +#define MFI_BBU_STATE_DISCHARGE_ACTIVE (1 << 4) +#define MFI_BBU_STATE_LEARN_CYC_REQ (1 << 5) +#define MFI_BBU_STATE_LEARN_CYC_ACTIVE (1 << 6) +#define MFI_BBU_STATE_LEARN_CYC_FAIL (1 << 7) +#define MFI_BBU_STATE_LEARN_CYC_TIMEOUT (1 << 8) +#define MFI_BBU_STATE_I2C_ERR_DETECT (1 << 9) uint8_t pad[20]; union mfi_bbu_status_detail detail; } __packed; From owner-svn-src-all@FreeBSD.ORG Mon May 21 21:04:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5DAA106564A; Mon, 21 May 2012 21:04:30 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8705D8FC0C; Mon, 21 May 2012 21:04:30 +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 q4LL4UnN072619; Mon, 21 May 2012 21:04:30 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LL4UDN072617; Mon, 21 May 2012 21:04:30 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201205212104.q4LL4UDN072617@svn.freebsd.org> From: Guy Helmer Date: Mon, 21 May 2012 21:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235739 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 21:04:30 -0000 Author: ghelmer Date: Mon May 21 21:04:29 2012 New Revision: 235739 URL: http://svn.freebsd.org/changeset/base/235739 Log: Apply style(9) to return and switch/case statements. Reviewed by: delphij (prior version of the patch) Modified: head/lib/libc/gen/getnetgrent.c Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Mon May 21 19:58:40 2012 (r235738) +++ head/lib/libc/gen/getnetgrent.c Mon May 21 21:04:29 2012 (r235739) @@ -292,12 +292,12 @@ _listmatch(const char *list, const char while(*ptr != ',' && *ptr != '\0' && !isspace((unsigned char)*ptr)) ptr++; if (strncmp(cptr, group, glen) == 0 && glen == (ptr - cptr)) - return(1); + return (1); while(*ptr == ',' || isspace((unsigned char)*ptr)) ptr++; } - return(0); + return (0); } static int @@ -311,32 +311,35 @@ _revnetgr_lookup(char* lookupdom, char* for (rot = 0; ; rot++) { switch (rot) { - case(0): snprintf(key, MAXHOSTNAMELEN, "%s.%s", - str, dom?dom:lookupdom); - break; - case(1): snprintf(key, MAXHOSTNAMELEN, "%s.*", - str); - break; - case(2): snprintf(key, MAXHOSTNAMELEN, "*.%s", - dom?dom:lookupdom); - break; - case(3): snprintf(key, MAXHOSTNAMELEN, "*.*"); - break; - default: return(0); + case(0): + snprintf(key, MAXHOSTNAMELEN, "%s.%s", str, + dom ? dom : lookupdom); + break; + case(1): + snprintf(key, MAXHOSTNAMELEN, "%s.*", str); + break; + case(2): + snprintf(key, MAXHOSTNAMELEN, "*.%s", + dom ? dom : lookupdom); + break; + case(3): + snprintf(key, MAXHOSTNAMELEN, "*.*"); + break; + default: return (0); } y = yp_match(lookupdom, map, key, strlen(key), &result, &resultlen); if (y == 0) { rv = _listmatch(result, group, resultlen); free(result); - if (rv) return(1); + if (rv) return (1); } else if (y != YPERR_KEY) { /* * If we get an error other than 'no * such key in map' then something is * wrong and we should stop the search. */ - return(-1); + return (-1); } } } @@ -386,14 +389,14 @@ innetgr(const char *group, const char *h if (_use_only_yp && (host == NULL) != (user == NULL)) { int ret; if(yp_get_default_domain(&_netgr_yp_domain)) - return(0); + return (0); ret = _revnetgr_lookup(_netgr_yp_domain, host?"netgroup.byhost":"netgroup.byuser", host?host:user, dom, group); if (ret == 1) - return(1); + return (1); else if (ret == 0 && dom != NULL) - return(0); + return (0); } setnetgrent(group); From owner-svn-src-all@FreeBSD.ORG Mon May 21 21:10:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0FF11065675; Mon, 21 May 2012 21:10:10 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC5B78FC1F; Mon, 21 May 2012 21:10: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 q4LLA1mk072798; Mon, 21 May 2012 21:10:01 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LLA1nR072795; Mon, 21 May 2012 21:10:01 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201205212110.q4LLA1nR072795@svn.freebsd.org> From: Guy Helmer Date: Mon, 21 May 2012 21:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235740 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 21:10:11 -0000 Author: ghelmer Date: Mon May 21 21:10:00 2012 New Revision: 235740 URL: http://svn.freebsd.org/changeset/base/235740 Log: Add checks for memory allocation failures in appropriate places, and avoid creating bad entries in the grp list as a result of memory allocation failures while building new entries. PR: bin/83340 Reviewed by: delphij (prior version of patch) Modified: head/lib/libc/gen/getnetgrent.c Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Mon May 21 21:04:29 2012 (r235739) +++ head/lib/libc/gen/getnetgrent.c Mon May 21 21:10:00 2012 (r235740) @@ -203,9 +203,7 @@ setnetgrent(const char *group) if (parse_netgrp(group)) endnetgrent(); else { - grouphead.grname = (char *) - malloc(strlen(group) + 1); - strcpy(grouphead.grname, group); + grouphead.grname = strdup(group); } if (netf) fclose(netf); @@ -457,9 +455,9 @@ parse_netgrp(const char *group) while (pos != NULL && *pos != '\0') { if (*pos == '(') { grp = (struct netgrp *)malloc(sizeof (struct netgrp)); + if (grp == NULL) + return (1); bzero((char *)grp, sizeof (struct netgrp)); - grp->ng_next = grouphead.gr; - grouphead.gr = grp; pos++; gpos = strsep(&pos, ")"); #ifdef DEBUG @@ -480,6 +478,13 @@ parse_netgrp(const char *group) if (len > 0) { grp->ng_str[strpos] = (char *) malloc(len + 1); + if (grp->ng_str[strpos] == NULL) { + int freepos; + for (freepos = 0; freepos < strpos; freepos++) + free(grp->ng_str[freepos]); + free(grp); + return (1); + } bcopy(spos, grp->ng_str[strpos], len + 1); } @@ -493,6 +498,8 @@ parse_netgrp(const char *group) grp->ng_str[strpos] = NULL; } } + grp->ng_next = grouphead.gr; + grouphead.gr = grp; #ifdef DEBUG /* * Note: on other platforms, malformed netgroup @@ -529,7 +536,7 @@ parse_netgrp(const char *group) static struct linelist * read_for_group(const char *group) { - char *pos, *spos, *linep, *olinep; + char *pos, *spos, *linep; int len, olen; int cont; struct linelist *lp; @@ -537,6 +544,7 @@ read_for_group(const char *group) #ifdef YP char *result; int resultlen; + linep = NULL; while (_netgr_yp_enabled || fgets(line, LINSIZ, netf) != NULL) { if (_netgr_yp_enabled) { @@ -557,6 +565,7 @@ read_for_group(const char *group) free(result); } #else + linep = NULL; while (fgets(line, LINSIZ, netf) != NULL) { #endif pos = (char *)&line; @@ -579,8 +588,14 @@ read_for_group(const char *group) pos++; if (*pos != '\n' && *pos != '\0') { lp = (struct linelist *)malloc(sizeof (*lp)); + if (lp == NULL) + return (NULL); lp->l_parsed = 0; lp->l_groupname = (char *)malloc(len + 1); + if (lp->l_groupname == NULL) { + free(lp); + return (NULL); + } bcopy(spos, lp->l_groupname, len); *(lp->l_groupname + len) = '\0'; len = strlen(pos); @@ -598,15 +613,15 @@ read_for_group(const char *group) } else cont = 0; if (len > 0) { - linep = (char *)malloc(olen + len + 1); - if (olen > 0) { - bcopy(olinep, linep, olen); - free(olinep); + linep = (char *)reallocf(linep, olen + len + 1); + if (linep == NULL) { + free(lp->l_groupname); + free(lp); + return (NULL); } bcopy(pos, linep + olen, len); olen += len; *(linep + olen) = '\0'; - olinep = linep; } if (cont) { if (fgets(line, LINSIZ, netf)) { @@ -637,5 +652,5 @@ read_for_group(const char *group) */ rewind(netf); #endif - return ((struct linelist *)0); + return (NULL); } From owner-svn-src-all@FreeBSD.ORG Mon May 21 21:14:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97B351065670; Mon, 21 May 2012 21:14:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 816838FC1B; Mon, 21 May 2012 21:14: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 q4LLEAvJ072960; Mon, 21 May 2012 21:14:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LLEAmR072954; Mon, 21 May 2012 21:14:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205212114.q4LLEAmR072954@svn.freebsd.org> From: John Baldwin Date: Mon, 21 May 2012 21:14: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: r235741 - in stable/9/sys: ddb gdb kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 21:14:10 -0000 Author: jhb Date: Mon May 21 21:14:09 2012 New Revision: 235741 URL: http://svn.freebsd.org/changeset/base/235741 Log: MFC 234190,234196,234280: - Extend the KDB interface to add a per-debugger callback to print a backtrace for an arbitrary thread (rather than the calling thread). A kdb_backtrace_thread() wrapper function uses the configured debugger if possible, otherwise it falls back to using stack(9) if that is available. - Replace a direct call to db_trace_thread() in propagate_priority() with a call to kdb_backtrace_thread() instead. Modified: stable/9/sys/ddb/db_main.c stable/9/sys/gdb/gdb_main.c stable/9/sys/kern/subr_kdb.c stable/9/sys/kern/subr_turnstile.c stable/9/sys/sys/kdb.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/ddb/db_main.c ============================================================================== --- stable/9/sys/ddb/db_main.c Mon May 21 21:10:00 2012 (r235740) +++ stable/9/sys/ddb/db_main.c Mon May 21 21:14:09 2012 (r235741) @@ -51,8 +51,10 @@ SYSCTL_NODE(_debug, OID_AUTO, ddb, CTLFL static dbbe_init_f db_init; static dbbe_trap_f db_trap; static dbbe_trace_f db_trace_self_wrapper; +static dbbe_trace_thread_f db_trace_thread_wrapper; -KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trap); +KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trace_thread_wrapper, + db_trap); vm_offset_t ksym_start, ksym_end; @@ -246,3 +248,15 @@ db_trace_self_wrapper(void) db_trace_self(); (void)kdb_jmpbuf(prev_jb); } + +static void +db_trace_thread_wrapper(struct thread *td) +{ + jmp_buf jb; + void *prev_jb; + + prev_jb = kdb_jmpbuf(jb); + if (setjmp(jb) == 0) + db_trace_thread(td, -1); + (void)kdb_jmpbuf(prev_jb); +} Modified: stable/9/sys/gdb/gdb_main.c ============================================================================== --- stable/9/sys/gdb/gdb_main.c Mon May 21 21:10:00 2012 (r235740) +++ stable/9/sys/gdb/gdb_main.c Mon May 21 21:14:09 2012 (r235741) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); static dbbe_init_f gdb_init; static dbbe_trap_f gdb_trap; -KDB_BACKEND(gdb, gdb_init, NULL, gdb_trap); +KDB_BACKEND(gdb, gdb_init, NULL, NULL, gdb_trap); static struct gdb_dbgport null_gdb_dbgport; DATA_SET(gdb_dbgport_set, null_gdb_dbgport); Modified: stable/9/sys/kern/subr_kdb.c ============================================================================== --- stable/9/sys/kern/subr_kdb.c Mon May 21 21:10:00 2012 (r235740) +++ stable/9/sys/kern/subr_kdb.c Mon May 21 21:14:09 2012 (r235741) @@ -73,7 +73,7 @@ struct trapframe *kdb_frame = NULL; static int kdb_break_to_debugger = KDB_BREAK_TO_DEBUGGER; static int kdb_alt_break_to_debugger = KDB_ALT_BREAK_TO_DEBUGGER; -KDB_BACKEND(null, NULL, NULL, NULL); +KDB_BACKEND(null, NULL, NULL, NULL, NULL); SET_DECLARE(kdb_dbbe_set, struct kdb_dbbe); static int kdb_sysctl_available(SYSCTL_HANDLER_ARGS); @@ -371,6 +371,7 @@ kdb_backtrace(void) struct stack st; printf("KDB: stack backtrace:\n"); + stack_zero(&st); stack_save(&st); stack_print_ddb(&st); } @@ -378,6 +379,30 @@ kdb_backtrace(void) } /* + * Similar to kdb_backtrace() except that it prints a backtrace of an + * arbitrary thread rather than the calling thread. + */ +void +kdb_backtrace_thread(struct thread *td) +{ + + if (kdb_dbbe != NULL && kdb_dbbe->dbbe_trace_thread != NULL) { + printf("KDB: stack backtrace of thread %d:\n", td->td_tid); + kdb_dbbe->dbbe_trace_thread(td); + } +#ifdef STACK + else { + struct stack st; + + printf("KDB: stack backtrace of thread %d:\n", td->td_tid); + stack_zero(&st); + stack_save_td(&st, td); + stack_print_ddb(&st); + } +#endif +} + +/* * Set/change the current backend. */ Modified: stable/9/sys/kern/subr_turnstile.c ============================================================================== --- stable/9/sys/kern/subr_turnstile.c Mon May 21 21:10:00 2012 (r235740) +++ stable/9/sys/kern/subr_turnstile.c Mon May 21 21:14:09 2012 (r235741) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -78,7 +79,6 @@ __FBSDID("$FreeBSD$"); #include #ifdef DDB -#include #include #include #include @@ -216,9 +216,7 @@ propagate_priority(struct thread *td) printf( "Sleeping thread (tid %d, pid %d) owns a non-sleepable lock\n", td->td_tid, td->td_proc->p_pid); -#ifdef DDB - db_trace_thread(td, -1); -#endif + kdb_backtrace_thread(td); panic("sleeping thread"); } Modified: stable/9/sys/sys/kdb.h ============================================================================== --- stable/9/sys/sys/kdb.h Mon May 21 21:10:00 2012 (r235740) +++ stable/9/sys/sys/kdb.h Mon May 21 21:14:09 2012 (r235741) @@ -31,31 +31,34 @@ #include +struct pcb; +struct thread; +struct trapframe; + typedef int dbbe_init_f(void); typedef void dbbe_trace_f(void); +typedef void dbbe_trace_thread_f(struct thread *); typedef int dbbe_trap_f(int, int); struct kdb_dbbe { const char *dbbe_name; dbbe_init_f *dbbe_init; dbbe_trace_f *dbbe_trace; + dbbe_trace_thread_f *dbbe_trace_thread; dbbe_trap_f *dbbe_trap; int dbbe_active; }; -#define KDB_BACKEND(name, init, trace, trap) \ +#define KDB_BACKEND(name, init, trace, trace_thread, trap) \ static struct kdb_dbbe name##_dbbe = { \ .dbbe_name = #name, \ .dbbe_init = init, \ .dbbe_trace = trace, \ + .dbbe_trace_thread = trace_thread, \ .dbbe_trap = trap \ }; \ DATA_SET(kdb_dbbe_set, name##_dbbe) -struct pcb; -struct thread; -struct trapframe; - extern int kdb_active; /* Non-zero while in debugger. */ extern int debugger_on_panic; /* enter the debugger on panic. */ extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */ @@ -67,6 +70,7 @@ int kdb_alt_break(int, int *); int kdb_alt_break_gdb(int, int *); int kdb_break(void); void kdb_backtrace(void); +void kdb_backtrace_thread(struct thread *); int kdb_dbbe_select(const char *); void kdb_enter(const char *, const char *); void kdb_init(void); From owner-svn-src-all@FreeBSD.ORG Mon May 21 21:16:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5D7D1065670; Mon, 21 May 2012 21:16:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF2FD8FC1B; Mon, 21 May 2012 21:16: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 q4LLG8OM073051; Mon, 21 May 2012 21:16:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LLG8V0073045; Mon, 21 May 2012 21:16:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205212116.q4LLG8V0073045@svn.freebsd.org> From: John Baldwin Date: Mon, 21 May 2012 21:16: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: r235742 - in stable/8/sys: ddb gdb kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 21:16:08 -0000 Author: jhb Date: Mon May 21 21:16:08 2012 New Revision: 235742 URL: http://svn.freebsd.org/changeset/base/235742 Log: MFC 234190,234196,234280: - Extend the KDB interface to add a per-debugger callback to print a backtrace for an arbitrary thread (rather than the calling thread). A kdb_backtrace_thread() wrapper function uses the configured debugger if possible, otherwise it falls back to using stack(9) if that is available. - Replace a direct call to db_trace_thread() in propagate_priority() with a call to kdb_backtrace_thread() instead. Modified: stable/8/sys/ddb/db_main.c stable/8/sys/gdb/gdb_main.c stable/8/sys/kern/subr_kdb.c stable/8/sys/kern/subr_turnstile.c stable/8/sys/sys/kdb.h 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) Modified: stable/8/sys/ddb/db_main.c ============================================================================== --- stable/8/sys/ddb/db_main.c Mon May 21 21:14:09 2012 (r235741) +++ stable/8/sys/ddb/db_main.c Mon May 21 21:16:08 2012 (r235742) @@ -51,8 +51,10 @@ SYSCTL_NODE(_debug, OID_AUTO, ddb, CTLFL static dbbe_init_f db_init; static dbbe_trap_f db_trap; static dbbe_trace_f db_trace_self_wrapper; +static dbbe_trace_thread_f db_trace_thread_wrapper; -KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trap); +KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trace_thread_wrapper, + db_trap); vm_offset_t ksym_start, ksym_end; @@ -246,3 +248,15 @@ db_trace_self_wrapper(void) db_trace_self(); (void)kdb_jmpbuf(prev_jb); } + +static void +db_trace_thread_wrapper(struct thread *td) +{ + jmp_buf jb; + void *prev_jb; + + prev_jb = kdb_jmpbuf(jb); + if (setjmp(jb) == 0) + db_trace_thread(td, -1); + (void)kdb_jmpbuf(prev_jb); +} Modified: stable/8/sys/gdb/gdb_main.c ============================================================================== --- stable/8/sys/gdb/gdb_main.c Mon May 21 21:14:09 2012 (r235741) +++ stable/8/sys/gdb/gdb_main.c Mon May 21 21:16:08 2012 (r235742) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); static dbbe_init_f gdb_init; static dbbe_trap_f gdb_trap; -KDB_BACKEND(gdb, gdb_init, NULL, gdb_trap); +KDB_BACKEND(gdb, gdb_init, NULL, NULL, gdb_trap); static struct gdb_dbgport null_gdb_dbgport; DATA_SET(gdb_dbgport_set, null_gdb_dbgport); Modified: stable/8/sys/kern/subr_kdb.c ============================================================================== --- stable/8/sys/kern/subr_kdb.c Mon May 21 21:14:09 2012 (r235741) +++ stable/8/sys/kern/subr_kdb.c Mon May 21 21:16:08 2012 (r235742) @@ -71,7 +71,7 @@ struct trapframe *kdb_frame = NULL; static int kdb_break_to_debugger = KDB_BREAK_TO_DEBUGGER; static int kdb_alt_break_to_debugger = KDB_ALT_BREAK_TO_DEBUGGER; -KDB_BACKEND(null, NULL, NULL, NULL); +KDB_BACKEND(null, NULL, NULL, NULL, NULL); SET_DECLARE(kdb_dbbe_set, struct kdb_dbbe); static int kdb_sysctl_available(SYSCTL_HANDLER_ARGS); @@ -384,6 +384,7 @@ kdb_backtrace(void) struct stack st; printf("KDB: stack backtrace:\n"); + stack_zero(&st); stack_save(&st); stack_print_ddb(&st); } @@ -391,6 +392,30 @@ kdb_backtrace(void) } /* + * Similar to kdb_backtrace() except that it prints a backtrace of an + * arbitrary thread rather than the calling thread. + */ +void +kdb_backtrace_thread(struct thread *td) +{ + + if (kdb_dbbe != NULL && kdb_dbbe->dbbe_trace_thread != NULL) { + printf("KDB: stack backtrace of thread %d:\n", td->td_tid); + kdb_dbbe->dbbe_trace_thread(td); + } +#ifdef STACK + else { + struct stack st; + + printf("KDB: stack backtrace of thread %d:\n", td->td_tid); + stack_zero(&st); + stack_save_td(&st, td); + stack_print_ddb(&st); + } +#endif +} + +/* * Set/change the current backend. */ Modified: stable/8/sys/kern/subr_turnstile.c ============================================================================== --- stable/8/sys/kern/subr_turnstile.c Mon May 21 21:14:09 2012 (r235741) +++ stable/8/sys/kern/subr_turnstile.c Mon May 21 21:16:08 2012 (r235742) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -78,7 +79,6 @@ __FBSDID("$FreeBSD$"); #include #ifdef DDB -#include #include #include #include @@ -216,9 +216,7 @@ propagate_priority(struct thread *td) printf( "Sleeping thread (tid %d, pid %d) owns a non-sleepable lock\n", td->td_tid, td->td_proc->p_pid); -#ifdef DDB - db_trace_thread(td, -1); -#endif + kdb_backtrace_thread(td); panic("sleeping thread"); } Modified: stable/8/sys/sys/kdb.h ============================================================================== --- stable/8/sys/sys/kdb.h Mon May 21 21:14:09 2012 (r235741) +++ stable/8/sys/sys/kdb.h Mon May 21 21:16:08 2012 (r235742) @@ -31,31 +31,34 @@ #include +struct pcb; +struct thread; +struct trapframe; + typedef int dbbe_init_f(void); typedef void dbbe_trace_f(void); +typedef void dbbe_trace_thread_f(struct thread *); typedef int dbbe_trap_f(int, int); struct kdb_dbbe { const char *dbbe_name; dbbe_init_f *dbbe_init; dbbe_trace_f *dbbe_trace; + dbbe_trace_thread_f *dbbe_trace_thread; dbbe_trap_f *dbbe_trap; int dbbe_active; }; -#define KDB_BACKEND(name, init, trace, trap) \ +#define KDB_BACKEND(name, init, trace, trace_thread, trap) \ static struct kdb_dbbe name##_dbbe = { \ .dbbe_name = #name, \ .dbbe_init = init, \ .dbbe_trace = trace, \ + .dbbe_trace_thread = trace_thread, \ .dbbe_trap = trap \ }; \ DATA_SET(kdb_dbbe_set, name##_dbbe) -struct pcb; -struct thread; -struct trapframe; - extern int kdb_active; /* Non-zero while in debugger. */ extern int debugger_on_panic; /* enter the debugger on panic. */ extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */ @@ -67,6 +70,7 @@ int kdb_alt_break(int, int *); int kdb_alt_break_gdb(int, int *); int kdb_break(void); void kdb_backtrace(void); +void kdb_backtrace_thread(struct thread *); int kdb_dbbe_select(const char *); void kdb_enter(const char *, const char *); void kdb_init(void); From owner-svn-src-all@FreeBSD.ORG Mon May 21 21:18:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96E4B106566B; Mon, 21 May 2012 21:18:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6ADCC8FC0A; Mon, 21 May 2012 21:18:38 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D5D29B922; Mon, 21 May 2012 17:18:37 -0400 (EDT) From: John Baldwin To: Sean Bruno Date: Mon, 21 May 2012 17:18:34 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <201205211958.q4LJweXG070838@svn.freebsd.org> In-Reply-To: <201205211958.q4LJweXG070838@svn.freebsd.org> MIME-Version: 1.0 Message-Id: <201205211718.34896.jhb@freebsd.org> Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 21 May 2012 17:18:37 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r235738 - in stable/9/sys: . dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 21:18:38 -0000 On Monday, May 21, 2012 3:58:40 pm Sean Bruno wrote: > Author: sbruno > Date: Mon May 21 19:58:40 2012 > New Revision: 235738 > URL: http://svn.freebsd.org/changeset/base/235738 > > Log: > MFC r235634 > > Fix and update battery status bits according to linux driver Hmm, svn seems to have crapped itself. We should probably at least remove the unnecessary mergeinfo from files. Ah, it looks like the MFC of the last round of ixgbe changes was merged into a sparse checkout, and that is causing the pain. I will try to fix this, but can other folks hold off on merging to stable/9/sys while I do so? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon May 21 21:30:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DACD106564A; Mon, 21 May 2012 21:30:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B233A8FC0A; Mon, 21 May 2012 21:30: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 q4LLU0T2073422; Mon, 21 May 2012 21:30:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LLU0Zq073421; Mon, 21 May 2012 21:30:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205212130.q4LLU0Zq073421@svn.freebsd.org> From: John Baldwin Date: Mon, 21 May 2012 21:30: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: r235743 - stable/9/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 21:30:10 -0000 Author: jhb Date: Mon May 21 21:29:59 2012 New Revision: 235743 URL: http://svn.freebsd.org/changeset/base/235743 Log: Toss bogus mergeinfo. Modified: Directory Properties: stable/9/sys/Makefile (props changed) stable/9/sys/amd64/ (props changed) stable/9/sys/arm/ (props changed) stable/9/sys/bsm/ (props changed) stable/9/sys/cam/ (props changed) stable/9/sys/cddl/ (props changed) stable/9/sys/compat/ (props changed) stable/9/sys/contrib/ (props changed) stable/9/sys/crypto/ (props changed) stable/9/sys/ddb/ (props changed) stable/9/sys/dev/aac/ (props changed) stable/9/sys/dev/acpi_support/ (props changed) stable/9/sys/dev/acpica/ (props changed) stable/9/sys/dev/adb/ (props changed) stable/9/sys/dev/adlink/ (props changed) stable/9/sys/dev/advansys/ (props changed) stable/9/sys/dev/ae/ (props changed) stable/9/sys/dev/age/ (props changed) stable/9/sys/dev/agp/ (props changed) stable/9/sys/dev/aha/ (props changed) stable/9/sys/dev/ahb/ (props changed) stable/9/sys/dev/ahci/ (props changed) stable/9/sys/dev/aic/ (props changed) stable/9/sys/dev/aic7xxx/ (props changed) stable/9/sys/dev/alc/ (props changed) stable/9/sys/dev/ale/ (props changed) stable/9/sys/dev/amd/ (props changed) stable/9/sys/dev/amdsbwd/ (props changed) stable/9/sys/dev/amdtemp/ (props changed) stable/9/sys/dev/amr/ (props changed) stable/9/sys/dev/an/ (props changed) stable/9/sys/dev/arcmsr/ (props changed) stable/9/sys/dev/asmc/ (props changed) stable/9/sys/dev/asr/ (props changed) stable/9/sys/dev/ata/ (props changed) stable/9/sys/dev/ath/ (props changed) stable/9/sys/dev/atkbdc/ (props changed) stable/9/sys/dev/auxio/ (props changed) stable/9/sys/dev/bce/ (props changed) stable/9/sys/dev/bfe/ (props changed) stable/9/sys/dev/bge/ (props changed) stable/9/sys/dev/bktr/ (props changed) stable/9/sys/dev/bm/ (props changed) stable/9/sys/dev/buslogic/ (props changed) stable/9/sys/dev/bwi/ (props changed) stable/9/sys/dev/bwn/ (props changed) stable/9/sys/dev/bxe/ (props changed) stable/9/sys/dev/cardbus/ (props changed) stable/9/sys/dev/cas/ (props changed) stable/9/sys/dev/ce/ (props changed) stable/9/sys/dev/cesa/ (props changed) stable/9/sys/dev/cfe/ (props changed) stable/9/sys/dev/cfi/ (props changed) stable/9/sys/dev/ciss/ (props changed) stable/9/sys/dev/cm/ (props changed) stable/9/sys/dev/cmx/ (props changed) stable/9/sys/dev/coretemp/ (props changed) stable/9/sys/dev/cp/ (props changed) stable/9/sys/dev/cpuctl/ (props changed) stable/9/sys/dev/cpufreq/ (props changed) stable/9/sys/dev/cs/ (props changed) stable/9/sys/dev/ct/ (props changed) stable/9/sys/dev/ctau/ (props changed) stable/9/sys/dev/cx/ (props changed) stable/9/sys/dev/cxgb/ (props changed) stable/9/sys/dev/cxgbe/ (props changed) stable/9/sys/dev/cy/ (props changed) stable/9/sys/dev/dc/ (props changed) stable/9/sys/dev/dcons/ (props changed) stable/9/sys/dev/de/ (props changed) stable/9/sys/dev/digi/ (props changed) stable/9/sys/dev/dpms/ (props changed) stable/9/sys/dev/dpt/ (props changed) stable/9/sys/dev/drm/ (props changed) stable/9/sys/dev/ed/ (props changed) stable/9/sys/dev/eisa/ (props changed) stable/9/sys/dev/en/ (props changed) stable/9/sys/dev/ep/ (props changed) stable/9/sys/dev/esp/ (props changed) stable/9/sys/dev/et/ (props changed) stable/9/sys/dev/ex/ (props changed) stable/9/sys/dev/exca/ (props changed) stable/9/sys/dev/fatm/ (props changed) stable/9/sys/dev/fb/ (props changed) stable/9/sys/dev/fdc/ (props changed) stable/9/sys/dev/fdt/ (props changed) stable/9/sys/dev/fe/ (props changed) stable/9/sys/dev/firewire/ (props changed) stable/9/sys/dev/flash/ (props changed) stable/9/sys/dev/fxp/ (props changed) stable/9/sys/dev/gem/ (props changed) stable/9/sys/dev/glxiic/ (props changed) stable/9/sys/dev/glxsb/ (props changed) stable/9/sys/dev/gpio/ (props changed) stable/9/sys/dev/hatm/ (props changed) stable/9/sys/dev/hifn/ (props changed) stable/9/sys/dev/hme/ (props changed) stable/9/sys/dev/hpt27xx/ (props changed) stable/9/sys/dev/hptiop/ (props changed) stable/9/sys/dev/hptmv/ (props changed) stable/9/sys/dev/hptrr/ (props changed) stable/9/sys/dev/hwpmc/ (props changed) stable/9/sys/dev/ic/ (props changed) stable/9/sys/dev/ichsmb/ (props changed) stable/9/sys/dev/ichwd/ (props changed) stable/9/sys/dev/ida/ (props changed) stable/9/sys/dev/ie/ (props changed) stable/9/sys/dev/ieee488/ (props changed) stable/9/sys/dev/if_ndis/ (props changed) stable/9/sys/dev/iicbus/ (props changed) stable/9/sys/dev/iir/ (props changed) stable/9/sys/dev/io/ (props changed) stable/9/sys/dev/ipmi/ (props changed) stable/9/sys/dev/ips/ (props changed) stable/9/sys/dev/ipw/ (props changed) stable/9/sys/dev/isci/ (props changed) stable/9/sys/dev/iscsi/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ispfw/ (props changed) stable/9/sys/dev/iwi/ (props changed) stable/9/sys/dev/iwn/ (props changed) stable/9/sys/dev/ixgb/ (props changed) stable/9/sys/dev/jme/ (props changed) stable/9/sys/dev/joy/ (props changed) stable/9/sys/dev/kbd/ (props changed) stable/9/sys/dev/kbdmux/ (props changed) stable/9/sys/dev/ksyms/ (props changed) stable/9/sys/dev/le/ (props changed) stable/9/sys/dev/led/ (props changed) stable/9/sys/dev/lge/ (props changed) stable/9/sys/dev/lindev/ (props changed) stable/9/sys/dev/lmc/ (props changed) stable/9/sys/dev/malo/ (props changed) stable/9/sys/dev/mc146818/ (props changed) stable/9/sys/dev/mca/ (props changed) stable/9/sys/dev/mcd/ (props changed) stable/9/sys/dev/md/ (props changed) stable/9/sys/dev/mem/ (props changed) stable/9/sys/dev/mge/ (props changed) stable/9/sys/dev/mii/ (props changed) stable/9/sys/dev/mk48txx/ (props changed) stable/9/sys/dev/mlx/ (props changed) stable/9/sys/dev/mly/ (props changed) stable/9/sys/dev/mmc/ (props changed) stable/9/sys/dev/mn/ (props changed) stable/9/sys/dev/mps/ (props changed) stable/9/sys/dev/mpt/ (props changed) stable/9/sys/dev/mse/ (props changed) stable/9/sys/dev/msk/ (props changed) stable/9/sys/dev/mvs/ (props changed) stable/9/sys/dev/mwl/ (props changed) stable/9/sys/dev/mxge/ (props changed) stable/9/sys/dev/my/ (props changed) stable/9/sys/dev/ncv/ (props changed) stable/9/sys/dev/netmap/ (props changed) stable/9/sys/dev/nfe/ (props changed) stable/9/sys/dev/nge/ (props changed) stable/9/sys/dev/nmdm/ (props changed) stable/9/sys/dev/nsp/ (props changed) stable/9/sys/dev/null/ (props changed) stable/9/sys/dev/nve/ (props changed) stable/9/sys/dev/nvram/ (props changed) stable/9/sys/dev/nvram2env/ (props changed) stable/9/sys/dev/nxge/ (props changed) stable/9/sys/dev/oce/ (props changed) stable/9/sys/dev/ofw/ (props changed) stable/9/sys/dev/patm/ (props changed) stable/9/sys/dev/pbio/ (props changed) stable/9/sys/dev/pccard/ (props changed) stable/9/sys/dev/pccbb/ (props changed) stable/9/sys/dev/pcf/ (props changed) stable/9/sys/dev/pci/ (props changed) stable/9/sys/dev/pcn/ (props changed) stable/9/sys/dev/pdq/ (props changed) stable/9/sys/dev/powermac_nvram/ (props changed) stable/9/sys/dev/ppbus/ (props changed) stable/9/sys/dev/ppc/ (props changed) stable/9/sys/dev/pst/ (props changed) stable/9/sys/dev/pty/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/dev/qlxgb/ (props changed) stable/9/sys/dev/quicc/ (props changed) stable/9/sys/dev/ral/ (props changed) stable/9/sys/dev/random/ (props changed) stable/9/sys/dev/rc/ (props changed) stable/9/sys/dev/re/ (props changed) stable/9/sys/dev/rndtest/ (props changed) stable/9/sys/dev/rp/ (props changed) stable/9/sys/dev/rt/ (props changed) stable/9/sys/dev/safe/ (props changed) stable/9/sys/dev/sbni/ (props changed) stable/9/sys/dev/scc/ (props changed) stable/9/sys/dev/scd/ (props changed) stable/9/sys/dev/sdhci/ (props changed) stable/9/sys/dev/sec/ (props changed) stable/9/sys/dev/sf/ (props changed) stable/9/sys/dev/sfxge/ (props changed) stable/9/sys/dev/sge/ (props changed) stable/9/sys/dev/si/ (props changed) stable/9/sys/dev/siba/ (props changed) stable/9/sys/dev/siis/ (props changed) stable/9/sys/dev/sio/ (props changed) stable/9/sys/dev/sis/ (props changed) stable/9/sys/dev/sk/ (props changed) stable/9/sys/dev/smbus/ (props changed) stable/9/sys/dev/smc/ (props changed) stable/9/sys/dev/sn/ (props changed) stable/9/sys/dev/snc/ (props changed) stable/9/sys/dev/snp/ (props changed) stable/9/sys/dev/sound/ (props changed) stable/9/sys/dev/speaker/ (props changed) stable/9/sys/dev/spibus/ (props changed) stable/9/sys/dev/ste/ (props changed) stable/9/sys/dev/stg/ (props changed) stable/9/sys/dev/stge/ (props changed) stable/9/sys/dev/streams/ (props changed) stable/9/sys/dev/sym/ (props changed) stable/9/sys/dev/syscons/ (props changed) stable/9/sys/dev/tdfx/ (props changed) stable/9/sys/dev/ti/ (props changed) stable/9/sys/dev/tl/ (props changed) stable/9/sys/dev/tpm/ (props changed) stable/9/sys/dev/trm/ (props changed) stable/9/sys/dev/tsec/ (props changed) stable/9/sys/dev/twa/ (props changed) stable/9/sys/dev/twe/ (props changed) stable/9/sys/dev/tws/ (props changed) stable/9/sys/dev/tx/ (props changed) stable/9/sys/dev/txp/ (props changed) stable/9/sys/dev/uart/ (props changed) stable/9/sys/dev/ubsec/ (props changed) stable/9/sys/dev/usb/ (props changed) stable/9/sys/dev/utopia/ (props changed) stable/9/sys/dev/vge/ (props changed) stable/9/sys/dev/viawd/ (props changed) stable/9/sys/dev/vkbd/ (props changed) stable/9/sys/dev/vr/ (props changed) stable/9/sys/dev/vte/ (props changed) stable/9/sys/dev/vx/ (props changed) stable/9/sys/dev/vxge/ (props changed) stable/9/sys/dev/watchdog/ (props changed) stable/9/sys/dev/wb/ (props changed) stable/9/sys/dev/wds/ (props changed) stable/9/sys/dev/wi/ (props changed) stable/9/sys/dev/wl/ (props changed) stable/9/sys/dev/wpi/ (props changed) stable/9/sys/dev/xe/ (props changed) stable/9/sys/dev/xen/ (props changed) stable/9/sys/dev/xl/ (props changed) stable/9/sys/gdb/ (props changed) stable/9/sys/geom/ (props changed) stable/9/sys/gnu/ (props changed) stable/9/sys/i386/ (props changed) stable/9/sys/ia64/ (props changed) stable/9/sys/isa/ (props changed) stable/9/sys/kern/ (props changed) stable/9/sys/kgssapi/ (props changed) stable/9/sys/libkern/ (props changed) stable/9/sys/mips/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/net80211/ (props changed) stable/9/sys/netatalk/ (props changed) stable/9/sys/netgraph/ (props changed) stable/9/sys/netinet/ (props changed) stable/9/sys/netinet6/ (props changed) stable/9/sys/netipsec/ (props changed) stable/9/sys/netipx/ (props changed) stable/9/sys/netnatm/ (props changed) stable/9/sys/netncp/ (props changed) stable/9/sys/netsmb/ (props changed) stable/9/sys/nfs/ (props changed) stable/9/sys/nfsclient/ (props changed) stable/9/sys/nfsserver/ (props changed) stable/9/sys/nlm/ (props changed) stable/9/sys/ofed/ (props changed) stable/9/sys/opencrypto/ (props changed) stable/9/sys/pc98/ (props changed) stable/9/sys/pci/ (props changed) stable/9/sys/powerpc/ (props changed) stable/9/sys/rpc/ (props changed) stable/9/sys/security/ (props changed) stable/9/sys/sparc64/ (props changed) stable/9/sys/sys/ (props changed) stable/9/sys/teken/ (props changed) stable/9/sys/tools/ (props changed) stable/9/sys/ufs/ (props changed) stable/9/sys/vm/ (props changed) stable/9/sys/x86/ (props changed) stable/9/sys/xdr/ (props changed) stable/9/sys/xen/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon May 21 22:13:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16672106564A; Mon, 21 May 2012 22:13:49 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA90B8FC14; Mon, 21 May 2012 22:13:48 +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 q4LMDmlB075746; Mon, 21 May 2012 22:13:48 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMDmnG075742; Mon, 21 May 2012 22:13:48 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201205212213.q4LMDmnG075742@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 21 May 2012 22:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235744 - in head: share/man/man9 sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:13:49 -0000 Author: melifaro Date: Mon May 21 22:13:48 2012 New Revision: 235744 URL: http://svn.freebsd.org/changeset/base/235744 Log: Fix panic on attaching to non-existent interface (introduced by r233937, pointed by hrs@) Fix panic on tcpdump being attached to interface being removed (introduced by r233937, pointed by hrs@ and adrian@) Protect most of bpf_setf() by BPF global lock Add several forgotten assertions (thanks to adrian@) Document current locking model inside bpf.c Document EVENTHANDLER(9) usage inside BPF. Approved by: kib(mentor) Tested by: gnn MFC in: 4 weeks Modified: head/share/man/man9/EVENTHANDLER.9 head/share/man/man9/bpf.9 head/sys/net/bpf.c Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Mon May 21 21:29:59 2012 (r235743) +++ head/share/man/man9/EVENTHANDLER.9 Mon May 21 22:13:48 2012 (r235744) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd May 11, 2012 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -197,6 +197,8 @@ Callbacks invoked when an interface is c Callbacks invoked when a new network interface appears. .It Vt ifnet_departure_event Callbacks invoked when a network interface is taken down. +.It Vt bpf_track +Callbacks invoked when a BPF listener attaches to/detaches from network interface. .It Vt power_profile_change Callbacks invoked when the power profile of the system changes. .It Vt process_exec Modified: head/share/man/man9/bpf.9 ============================================================================== --- head/share/man/man9/bpf.9 Mon May 21 21:29:59 2012 (r235743) +++ head/share/man/man9/bpf.9 Mon May 21 22:13:48 2012 (r235744) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2006 +.Dd May 11, 2012 .Dt BPF 9 .Os .\" @@ -246,9 +246,31 @@ The function returns 0 when the program is not a valid filter program. .\" +.Sh EVENT HANDLERS +.Nm +invokes +.Fa bpf_track +.Xr EVENTHANDLER 9 +event each time listener attaches to or detaches from an interface. +Pointer to +.Pq Vt "struct ifnet *" +is passed as the first argument, interface +.Fa dlt +follows. Last argument indicates listener is attached (1) or +detached (0). +Note that handler is invoked with +.Nm +global lock held, which implies restriction on sleeping and calling +.Nm +subsystem inside +.Xr EVENTHANDLER 9 +dispatcher. +Note that handler is not called for write-only listeners. +.\" .Sh SEE ALSO .Xr tcpdump 1 , -.Xr bpf 4 +.Xr bpf 4 , +.Xr EVENTHANDLER 9 .\" .Sh HISTORY The Enet packet filter was created in 1980 by Mike Accetta and Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 21 21:29:59 2012 (r235743) +++ head/sys/net/bpf.c Mon May 21 22:13:48 2012 (r235744) @@ -147,6 +147,7 @@ static int bpf_bpfd_cnt; static void bpf_attachd(struct bpf_d *, struct bpf_if *); static void bpf_detachd(struct bpf_d *); +static void bpf_detachd_locked(struct bpf_d *); static void bpf_freed(struct bpf_d *); static int bpf_movein(struct uio *, int, struct ifnet *, struct mbuf **, struct sockaddr *, int *, struct bpf_insn *); @@ -207,6 +208,35 @@ static struct filterops bpfread_filtops }; /* + * LOCKING MODEL USED BY BPF: + * Locks: + * 1) global lock (BPF_LOCK). Mutex, used to protect interface addition/removal, + * some global counters and every bpf_if reference. + * 2) Interface lock. Rwlock, used to protect list of BPF descriptors and their filters. + * 3) Descriptor lock. Rwlock, used to protect BPF buffers and various structure fields + * used by bpf_mtap code. + * + * Lock order: + * + * Global lock, interface lock, descriptor lock + * + * We have to acquire interface lock before descriptor main lock due to BPF_MTAP[2] + * working model. In many places (like bpf_detachd) we start with BPF descriptor + * (and we need to at least rlock it to get reliable interface pointer). This + * gives us potential LOR. As a result, we use global lock to protect from bpf_if + * change in every such place. + * + * Changing d->bd_bif is protected by 1) global lock, 2) interface lock and + * 3) descriptor main wlock. + * Reading bd_bif can be protected by any of these locks, typically global lock. + * + * Changing read/write BPF filter is protected by the same three locks, + * the same applies for reading. + * + * Sleeping in global lock is not allowed due to bpfdetach() using it. + */ + +/* * Wrapper functions for various buffering methods. If the set of buffer * modes expands, we will probably want to introduce a switch data structure * similar to protosw, et. @@ -577,6 +607,18 @@ bad: static void bpf_attachd(struct bpf_d *d, struct bpf_if *bp) { + int op_w; + + BPF_LOCK_ASSERT(); + + /* + * Save sysctl value to protect from sysctl change + * between reads + */ + op_w = V_bpf_optimize_writers; + + if (d->bd_bif != NULL) + bpf_detachd_locked(d); /* * Point d at bp, and add d to the interface's list. * Since there are many applicaiotns using BPF for @@ -584,11 +626,13 @@ bpf_attachd(struct bpf_d *d, struct bpf_ * we can delay adding d to the list of active listeners until * some filter is configured. */ - d->bd_bif = bp; BPFIF_WLOCK(bp); + BPFD_WLOCK(d); - if (V_bpf_optimize_writers != 0) { + d->bd_bif = bp; + + if (op_w != 0) { /* Add to writers-only list */ LIST_INSERT_HEAD(&bp->bif_wlist, d, bd_next); /* @@ -600,16 +644,15 @@ bpf_attachd(struct bpf_d *d, struct bpf_ } else LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next); + BPFD_WUNLOCK(d); BPFIF_WUNLOCK(bp); - BPF_LOCK(); bpf_bpfd_cnt++; - BPF_UNLOCK(); CTR3(KTR_NET, "%s: bpf_attach called by pid %d, adding to %s list", __func__, d->bd_pid, d->bd_writer ? "writer" : "active"); - if (V_bpf_optimize_writers == 0) + if (op_w == 0) EVENTHANDLER_INVOKE(bpf_track, bp->bif_ifp, bp->bif_dlt, 1); } @@ -622,8 +665,21 @@ bpf_upgraded(struct bpf_d *d) { struct bpf_if *bp; + BPF_LOCK_ASSERT(); + bp = d->bd_bif; + /* + * Filter can be set several times without specifying interface. + * Mark d as reader and exit. + */ + if (bp == NULL) { + BPFD_WLOCK(d); + d->bd_writer = 0; + BPFD_WUNLOCK(d); + return; + } + BPFIF_WLOCK(bp); BPFD_WLOCK(d); @@ -647,6 +703,14 @@ bpf_upgraded(struct bpf_d *d) static void bpf_detachd(struct bpf_d *d) { + BPF_LOCK(); + bpf_detachd_locked(d); + BPF_UNLOCK(); +} + +static void +bpf_detachd_locked(struct bpf_d *d) +{ int error; struct bpf_if *bp; struct ifnet *ifp; @@ -655,7 +719,10 @@ bpf_detachd(struct bpf_d *d) BPF_LOCK_ASSERT(); - bp = d->bd_bif; + /* Check if descriptor is attached */ + if ((bp = d->bd_bif) == NULL) + return; + BPFIF_WLOCK(bp); BPFD_WLOCK(d); @@ -672,7 +739,6 @@ bpf_detachd(struct bpf_d *d) BPFD_WUNLOCK(d); BPFIF_WUNLOCK(bp); - /* We're already protected by global lock. */ bpf_bpfd_cnt--; /* Call event handler iff d is attached */ @@ -716,10 +782,7 @@ bpf_dtor(void *data) d->bd_state = BPF_IDLE; BPFD_WUNLOCK(d); funsetown(&d->bd_sigio); - BPF_LOCK(); - if (d->bd_bif) - bpf_detachd(d); - BPF_UNLOCK(); + bpf_detachd(d); #ifdef MAC mac_bpfdesc_destroy(d); #endif /* MAC */ @@ -959,6 +1022,7 @@ bpfwrite(struct cdev *dev, struct uio *u BPF_PID_REFRESH_CUR(d); d->bd_wcount++; + /* XXX: locking required */ if (d->bd_bif == NULL) { d->bd_wdcount++; return (ENXIO); @@ -979,6 +1043,7 @@ bpfwrite(struct cdev *dev, struct uio *u bzero(&dst, sizeof(dst)); m = NULL; hlen = 0; + /* XXX: bpf_movein() can sleep */ error = bpf_movein(uio, (int)d->bd_bif->bif_dlt, ifp, &m, &dst, &hlen, d->bd_wfilter); if (error) { @@ -1298,10 +1363,12 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Set data link type. */ case BIOCSDLT: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else error = bpf_setdlt(d, *(u_int *)addr); + BPF_UNLOCK(); break; /* @@ -1323,7 +1390,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Set interface. */ case BIOCSETIF: + BPF_LOCK(); error = bpf_setif(d, (struct ifreq *)addr); + BPF_UNLOCK(); break; /* @@ -1609,6 +1678,23 @@ bpf_setf(struct bpf_d *d, struct bpf_pro cmd = BIOCSETWF; } #endif + /* + * Check new filter validness before acquiring any locks. + * Allocate memory for new filter, if needed. + */ + flen = fp->bf_len; + if ((flen > bpf_maxinsns) || ((fp->bf_insns == NULL) && (flen != 0))) + return (EINVAL); + + need_upgrade = 0; + size = flen * sizeof(*fp->bf_insns); + if (size > 0) + fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK); + else + fcode = NULL; /* Make compiler happy */ + + BPF_LOCK(); + if (cmd == BIOCSETWF) { old = d->bd_wfilter; wfilter = 1; @@ -1623,13 +1709,12 @@ bpf_setf(struct bpf_d *d, struct bpf_pro #endif } if (fp->bf_insns == NULL) { - if (fp->bf_len != 0) - return (EINVAL); /* - * Protect filter change by interface lock, too. - * The same lock order is used by bpf_detachd(). + * Protect filter removal by interface lock. + * Additionally, we are protected by global lock here. */ - BPFIF_WLOCK(d->bd_bif); + if (d->bd_bif != NULL) + BPFIF_WLOCK(d->bd_bif); BPFD_WLOCK(d); if (wfilter) d->bd_wfilter = NULL; @@ -1642,29 +1727,26 @@ bpf_setf(struct bpf_d *d, struct bpf_pro reset_d(d); } BPFD_WUNLOCK(d); - BPFIF_WUNLOCK(d->bd_bif); + if (d->bd_bif != NULL) + BPFIF_WUNLOCK(d->bd_bif); if (old != NULL) free((caddr_t)old, M_BPF); #ifdef BPF_JITTER if (ofunc != NULL) bpf_destroy_jit_filter(ofunc); #endif + BPF_UNLOCK(); return (0); } - flen = fp->bf_len; - if (flen > bpf_maxinsns) - return (EINVAL); - need_upgrade = 0; - size = flen * sizeof(*fp->bf_insns); - fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK); if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) == 0 && bpf_validate(fcode, (int)flen)) { /* - * Protect filter change by interface lock, too - * The same lock order is used by bpf_detachd(). + * Protect filter change by interface lock + * Additionally, we are protected by global lock here. */ - BPFIF_WLOCK(d->bd_bif); + if (d->bd_bif != NULL) + BPFIF_WLOCK(d->bd_bif); BPFD_WLOCK(d); if (wfilter) d->bd_wfilter = fcode; @@ -1687,7 +1769,8 @@ bpf_setf(struct bpf_d *d, struct bpf_pro __func__, d->bd_pid, d->bd_writer, need_upgrade); } BPFD_WUNLOCK(d); - BPFIF_WUNLOCK(d->bd_bif); + if (d->bd_bif != NULL) + BPFIF_WUNLOCK(d->bd_bif); if (old != NULL) free((caddr_t)old, M_BPF); #ifdef BPF_JITTER @@ -1699,9 +1782,11 @@ bpf_setf(struct bpf_d *d, struct bpf_pro if (need_upgrade != 0) bpf_upgraded(d); + BPF_UNLOCK(); return (0); } free((caddr_t)fcode, M_BPF); + BPF_UNLOCK(); return (EINVAL); } @@ -1716,6 +1801,8 @@ bpf_setif(struct bpf_d *d, struct ifreq struct bpf_if *bp; struct ifnet *theywant; + BPF_LOCK_ASSERT(); + theywant = ifunit(ifr->ifr_name); if (theywant == NULL || theywant->if_bpf == NULL) return (ENXIO); @@ -1746,15 +1833,8 @@ bpf_setif(struct bpf_d *d, struct ifreq default: panic("bpf_setif: bufmode %d", d->bd_bufmode); } - if (bp != d->bd_bif) { - if (d->bd_bif) - /* - * Detach if attached to something else. - */ - bpf_detachd(d); - + if (bp != d->bd_bif) bpf_attachd(d, bp); - } BPFD_WLOCK(d); reset_d(d); BPFD_WUNLOCK(d); @@ -2361,10 +2441,9 @@ bpfattach2(struct ifnet *ifp, u_int dlt, } /* - * Detach bpf from an interface. This involves detaching each descriptor - * associated with the interface, and leaving bd_bif NULL. Notify each - * descriptor as it's detached so that any sleepers wake up and get - * ENXIO. + * Detach bpf from an interface. This involves detaching each descriptor + * associated with the interface. Notify each descriptor as it's detached + * so that any sleepers wake up and get ENXIO. */ void bpfdetach(struct ifnet *ifp) @@ -2398,6 +2477,13 @@ bpfdetach(struct ifnet *ifp) bpf_wakeup(d); BPFD_WUNLOCK(d); } + /* Free writer-only descriptors */ + while ((d = LIST_FIRST(&bp->bif_wlist)) != NULL) { + bpf_detachd(d); + BPFD_WLOCK(d); + bpf_wakeup(d); + BPFD_WUNLOCK(d); + } rw_destroy(&bp->bif_lock); free(bp, M_BPF); } @@ -2451,18 +2537,19 @@ bpf_setdlt(struct bpf_d *d, u_int dlt) struct ifnet *ifp; struct bpf_if *bp; + BPF_LOCK_ASSERT(); + if (d->bd_bif->bif_dlt == dlt) return (0); ifp = d->bd_bif->bif_ifp; - BPF_LOCK(); + LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp == ifp && bp->bif_dlt == dlt) break; } - BPF_UNLOCK(); + if (bp != NULL) { opromisc = d->bd_promisc; - bpf_detachd(d); bpf_attachd(d, bp); BPFD_WLOCK(d); reset_d(d); @@ -2522,6 +2609,9 @@ bpf_zero_counters(void) BPF_UNLOCK(); } +/* + * Fill filter statistics + */ static void bpfstats_fill_xbpf(struct xbpf_d *d, struct bpf_d *bd) { @@ -2529,6 +2619,7 @@ bpfstats_fill_xbpf(struct xbpf_d *d, str bzero(d, sizeof(*d)); BPFD_LOCK_ASSERT(bd); d->bd_structsize = sizeof(*d); + /* XXX: reading should be protected by global lock */ d->bd_immediate = bd->bd_immediate; d->bd_promisc = bd->bd_promisc; d->bd_hdrcmplt = bd->bd_hdrcmplt; @@ -2553,6 +2644,9 @@ bpfstats_fill_xbpf(struct xbpf_d *d, str d->bd_bufmode = bd->bd_bufmode; } +/* + * Handle `netstat -B' stats request + */ static int bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) { From owner-svn-src-all@FreeBSD.ORG Mon May 21 22:17:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB41C106564A; Mon, 21 May 2012 22:17:30 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69EB38FC08; Mon, 21 May 2012 22:17:30 +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 q4LMHTPo075934; Mon, 21 May 2012 22:17:29 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMHTFm075927; Mon, 21 May 2012 22:17:29 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201205212217.q4LMHTFm075927@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 21 May 2012 22:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235745 - in head/sys: kern net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:17:30 -0000 Author: melifaro Date: Mon May 21 22:17:29 2012 New Revision: 235745 URL: http://svn.freebsd.org/changeset/base/235745 Log: Fix old panic when BPF consumer attaches to destroying interface. 'flags' field is added to the end of bpf_if structure. Currently the only flag is BPFIF_FLAG_DYING which is set on bpf detach and checked by bpf_attachd() Problem can be easily triggered on SMP stable/[89] by the following command (sort of): 'while true; do ifconfig vlan222 create vlan 222 vlandev em0 up ; tcpdump -pi vlan222 & ; ifconfig vlan222 destroy ; done' Fix possible use-after-free when BPF detaches itself from interface, freeing bpf_bif memory, while interface is still UP and there can be routes via this interface. Freeing is now delayed till ifnet_departure_event is received via eventhandler(9) api. Convert bpfd rwlock back to mutex due lack of performance gain (currently checking if packet matches filter is done without holding bpfd lock and we have to acquire write lock if packet matches) Approved by: kib(mentor) MFC in: 4 weeks Modified: head/sys/kern/subr_witness.c head/sys/net/bpf.c head/sys/net/bpf.h head/sys/net/bpf_buffer.c head/sys/net/bpf_zerocopy.c head/sys/net/bpfdesc.h Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Mon May 21 22:13:48 2012 (r235744) +++ head/sys/kern/subr_witness.c Mon May 21 22:17:29 2012 (r235745) @@ -564,7 +564,7 @@ static struct witness_order_list_entry o */ { "bpf global lock", &lock_class_mtx_sleep }, { "bpf interface lock", &lock_class_rw }, - { "bpf cdev lock", &lock_class_rw }, + { "bpf cdev lock", &lock_class_mtx_sleep }, { NULL, NULL }, /* * NFS server Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 21 22:13:48 2012 (r235744) +++ head/sys/net/bpf.c Mon May 21 22:17:29 2012 (r235745) @@ -207,13 +207,15 @@ static struct filterops bpfread_filtops .f_event = filt_bpfread, }; +eventhandler_tag bpf_ifdetach_cookie = NULL; + /* * LOCKING MODEL USED BY BPF: * Locks: * 1) global lock (BPF_LOCK). Mutex, used to protect interface addition/removal, * some global counters and every bpf_if reference. * 2) Interface lock. Rwlock, used to protect list of BPF descriptors and their filters. - * 3) Descriptor lock. Rwlock, used to protect BPF buffers and various structure fields + * 3) Descriptor lock. Mutex, used to protect BPF buffers and various structure fields * used by bpf_mtap code. * * Lock order: @@ -246,7 +248,7 @@ bpf_append_bytes(struct bpf_d *d, caddr_ u_int len) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); switch (d->bd_bufmode) { case BPF_BUFMODE_BUFFER: @@ -266,7 +268,7 @@ bpf_append_mbuf(struct bpf_d *d, caddr_t u_int len) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); switch (d->bd_bufmode) { case BPF_BUFMODE_BUFFER: @@ -288,7 +290,7 @@ static void bpf_buf_reclaimed(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); switch (d->bd_bufmode) { case BPF_BUFMODE_BUFFER: @@ -347,7 +349,7 @@ static void bpf_buffull(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); switch (d->bd_bufmode) { case BPF_BUFMODE_ZBUF: @@ -363,7 +365,7 @@ void bpf_bufheld(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); switch (d->bd_bufmode) { case BPF_BUFMODE_ZBUF: @@ -628,7 +630,7 @@ bpf_attachd(struct bpf_d *d, struct bpf_ */ BPFIF_WLOCK(bp); - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_bif = bp; @@ -644,7 +646,7 @@ bpf_attachd(struct bpf_d *d, struct bpf_ } else LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); BPFIF_WUNLOCK(bp); bpf_bpfd_cnt++; @@ -674,14 +676,14 @@ bpf_upgraded(struct bpf_d *d) * Mark d as reader and exit. */ if (bp == NULL) { - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_writer = 0; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return; } BPFIF_WLOCK(bp); - BPFD_WLOCK(d); + BPFD_LOCK(d); /* Remove from writers-only list */ LIST_REMOVE(d, bd_next); @@ -689,7 +691,7 @@ bpf_upgraded(struct bpf_d *d) /* Mark d as reader */ d->bd_writer = 0; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); BPFIF_WUNLOCK(bp); CTR2(KTR_NET, "%s: upgrade required by pid %d", __func__, d->bd_pid); @@ -724,7 +726,7 @@ bpf_detachd_locked(struct bpf_d *d) return; BPFIF_WLOCK(bp); - BPFD_WLOCK(d); + BPFD_LOCK(d); /* Save bd_writer value */ error = d->bd_writer; @@ -736,7 +738,7 @@ bpf_detachd_locked(struct bpf_d *d) ifp = bp->bif_ifp; d->bd_bif = NULL; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); BPFIF_WUNLOCK(bp); bpf_bpfd_cnt--; @@ -776,11 +778,11 @@ bpf_dtor(void *data) { struct bpf_d *d = data; - BPFD_WLOCK(d); + BPFD_LOCK(d); if (d->bd_state == BPF_WAITING) callout_stop(&d->bd_callout); d->bd_state = BPF_IDLE; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); funsetown(&d->bd_sigio); bpf_detachd(d); #ifdef MAC @@ -825,9 +827,9 @@ bpfopen(struct cdev *dev, int flags, int mac_bpfdesc_init(d); mac_bpfdesc_create(td->td_ucred, d); #endif - rw_init(&d->bd_lock, "bpf cdev lock"); - callout_init_rw(&d->bd_callout, &d->bd_lock, 0); - knlist_init_rw_reader(&d->bd_sel.si_note, &d->bd_lock); + mtx_init(&d->bd_lock, devtoname(dev), "bpf cdev lock", MTX_DEF); + callout_init_mtx(&d->bd_callout, &d->bd_lock, 0); + knlist_init_mtx(&d->bd_sel.si_note, &d->bd_lock); return (0); } @@ -856,10 +858,10 @@ bpfread(struct cdev *dev, struct uio *ui non_block = ((ioflag & O_NONBLOCK) != 0); - BPFD_WLOCK(d); + BPFD_LOCK(d); BPF_PID_REFRESH_CUR(d); if (d->bd_bufmode != BPF_BUFMODE_BUFFER) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (EOPNOTSUPP); } if (d->bd_state == BPF_WAITING) @@ -895,18 +897,18 @@ bpfread(struct cdev *dev, struct uio *ui * it before using it again. */ if (d->bd_bif == NULL) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (ENXIO); } if (non_block) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (EWOULDBLOCK); } - error = rw_sleep(d, &d->bd_lock, PRINET|PCATCH, + error = msleep(d, &d->bd_lock, PRINET|PCATCH, "bpf", d->bd_rtout); if (error == EINTR || error == ERESTART) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (error); } if (error == EWOULDBLOCK) { @@ -924,7 +926,7 @@ bpfread(struct cdev *dev, struct uio *ui break; if (d->bd_slen == 0) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } ROTATE_BUFFERS(d); @@ -934,7 +936,7 @@ bpfread(struct cdev *dev, struct uio *ui /* * At this point, we know we have something in the hold slot. */ - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); /* * Move data from hold buffer into user space. @@ -947,12 +949,12 @@ bpfread(struct cdev *dev, struct uio *ui */ error = bpf_uiomove(d, d->bd_hbuf, d->bd_hlen, uio); - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_fbuf = d->bd_hbuf; d->bd_hbuf = NULL; d->bd_hlen = 0; bpf_buf_reclaimed(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (error); } @@ -964,7 +966,7 @@ static __inline void bpf_wakeup(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); if (d->bd_state == BPF_WAITING) { callout_stop(&d->bd_callout); d->bd_state = BPF_IDLE; @@ -982,7 +984,7 @@ bpf_timed_out(void *arg) { struct bpf_d *d = (struct bpf_d *)arg; - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); if (callout_pending(&d->bd_callout) || !callout_active(&d->bd_callout)) return; @@ -997,7 +999,7 @@ static int bpf_ready(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); if (!bpf_canfreebuf(d) && d->bd_hlen != 0) return (1); @@ -1070,11 +1072,11 @@ bpfwrite(struct cdev *dev, struct uio *u CURVNET_SET(ifp->if_vnet); #ifdef MAC - BPFD_WLOCK(d); + BPFD_LOCK(d); mac_bpfdesc_create_mbuf(d, m); if (mc != NULL) mac_bpfdesc_create_mbuf(d, mc); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); #endif error = (*ifp->if_output)(ifp, m, &dst, NULL); @@ -1103,7 +1105,7 @@ static void reset_d(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); if ((d->bd_hbuf != NULL) && (d->bd_bufmode != BPF_BUFMODE_ZBUF || bpf_canfreebuf(d))) { @@ -1170,12 +1172,12 @@ bpfioctl(struct cdev *dev, u_long cmd, c /* * Refresh PID associated with this descriptor. */ - BPFD_WLOCK(d); + BPFD_LOCK(d); BPF_PID_REFRESH(d, td); if (d->bd_state == BPF_WAITING) callout_stop(&d->bd_callout); d->bd_state = BPF_IDLE; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); if (d->bd_locked == 1) { switch (cmd) { @@ -1241,11 +1243,11 @@ bpfioctl(struct cdev *dev, u_long cmd, c { int n; - BPFD_WLOCK(d); + BPFD_LOCK(d); n = d->bd_slen; if (d->bd_hbuf) n += d->bd_hlen; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); *(int *)addr = n; break; @@ -1296,9 +1298,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Flush read packet buffer. */ case BIOCFLUSH: - BPFD_WLOCK(d); + BPFD_LOCK(d); reset_d(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); break; /* @@ -1625,15 +1627,15 @@ bpfioctl(struct cdev *dev, u_long cmd, c return (EINVAL); } - BPFD_WLOCK(d); + BPFD_LOCK(d); if (d->bd_sbuf != NULL || d->bd_hbuf != NULL || d->bd_fbuf != NULL || d->bd_bif != NULL) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); CURVNET_RESTORE(); return (EBUSY); } d->bd_bufmode = *(u_int *)addr; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); break; case BIOCGETZMAX: @@ -1715,7 +1717,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro */ if (d->bd_bif != NULL) BPFIF_WLOCK(d->bd_bif); - BPFD_WLOCK(d); + BPFD_LOCK(d); if (wfilter) d->bd_wfilter = NULL; else { @@ -1726,7 +1728,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro if (cmd == BIOCSETF) reset_d(d); } - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); if (d->bd_bif != NULL) BPFIF_WUNLOCK(d->bd_bif); if (old != NULL) @@ -1747,7 +1749,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro */ if (d->bd_bif != NULL) BPFIF_WLOCK(d->bd_bif); - BPFD_WLOCK(d); + BPFD_LOCK(d); if (wfilter) d->bd_wfilter = fcode; else { @@ -1768,7 +1770,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro "bd_writer counter %d, need_upgrade %d", __func__, d->bd_pid, d->bd_writer, need_upgrade); } - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); if (d->bd_bif != NULL) BPFIF_WUNLOCK(d->bd_bif); if (old != NULL) @@ -1809,14 +1811,19 @@ bpf_setif(struct bpf_d *d, struct ifreq bp = theywant->if_bpf; + /* Check if interface is not being detached from BPF */ + BPFIF_RLOCK(bp); + if (bp->flags & BPFIF_FLAG_DYING) { + BPFIF_RUNLOCK(bp); + return (ENXIO); + } + BPFIF_RUNLOCK(bp); + /* * Behavior here depends on the buffering model. If we're using * kernel memory buffers, then we can allocate them here. If we're * using zero-copy, then the user process must have registered * buffers by the time we get here. If not, return an error. - * - * XXXRW: There are locking issues here with multi-threaded use: what - * if two threads try to set the interface at once? */ switch (d->bd_bufmode) { case BPF_BUFMODE_BUFFER: @@ -1835,9 +1842,9 @@ bpf_setif(struct bpf_d *d, struct ifreq } if (bp != d->bd_bif) bpf_attachd(d, bp); - BPFD_WLOCK(d); + BPFD_LOCK(d); reset_d(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } @@ -1861,7 +1868,7 @@ bpfpoll(struct cdev *dev, int events, st * Refresh PID associated with this descriptor. */ revents = events & (POLLOUT | POLLWRNORM); - BPFD_WLOCK(d); + BPFD_LOCK(d); BPF_PID_REFRESH(d, td); if (events & (POLLIN | POLLRDNORM)) { if (bpf_ready(d)) @@ -1876,7 +1883,7 @@ bpfpoll(struct cdev *dev, int events, st } } } - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (revents); } @@ -1896,12 +1903,12 @@ bpfkqfilter(struct cdev *dev, struct kno /* * Refresh PID associated with this descriptor. */ - BPFD_WLOCK(d); + BPFD_LOCK(d); BPF_PID_REFRESH_CUR(d); kn->kn_fop = &bpfread_filtops; kn->kn_hook = d; knlist_add(&d->bd_sel.si_note, kn, 1); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } @@ -1920,7 +1927,7 @@ filt_bpfread(struct knote *kn, long hint struct bpf_d *d = (struct bpf_d *)kn->kn_hook; int ready; - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); ready = bpf_ready(d); if (ready) { kn->kn_data = d->bd_slen; @@ -2026,7 +2033,7 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, /* * Filter matches. Let's to acquire write lock. */ - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_fcount++; if (gottime < bpf_ts_quality(d->bd_tstamp)) @@ -2036,7 +2043,7 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, #endif catchpacket(d, pkt, pktlen, slen, bpf_append_bytes, &bt); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); } } BPFIF_RUNLOCK(bp); @@ -2085,7 +2092,7 @@ bpf_mtap(struct bpf_if *bp, struct mbuf #endif slen = bpf_filter(d->bd_rfilter, (u_char *)m, pktlen, 0); if (slen != 0) { - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_fcount++; if (gottime < bpf_ts_quality(d->bd_tstamp)) @@ -2095,7 +2102,7 @@ bpf_mtap(struct bpf_if *bp, struct mbuf #endif catchpacket(d, (u_char *)m, pktlen, slen, bpf_append_mbuf, &bt); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); } } BPFIF_RUNLOCK(bp); @@ -2141,7 +2148,7 @@ bpf_mtap2(struct bpf_if *bp, void *data, ++d->bd_rcount; slen = bpf_filter(d->bd_rfilter, (u_char *)&mb, pktlen, 0); if (slen != 0) { - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_fcount++; if (gottime < bpf_ts_quality(d->bd_tstamp)) @@ -2151,7 +2158,7 @@ bpf_mtap2(struct bpf_if *bp, void *data, #endif catchpacket(d, (u_char *)&mb, pktlen, slen, bpf_append_mbuf, &bt); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); } } BPFIF_RUNLOCK(bp); @@ -2246,7 +2253,7 @@ catchpacket(struct bpf_d *d, u_char *pkt int do_timestamp; int tstype; - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); /* * Detect whether user space has released a buffer back to us, and if @@ -2393,7 +2400,7 @@ bpf_freed(struct bpf_d *d) } if (d->bd_wfilter != NULL) free((caddr_t)d->bd_wfilter, M_BPF); - rw_destroy(&d->bd_lock); + mtx_destroy(&d->bd_lock); } /* @@ -2456,38 +2463,45 @@ bpfdetach(struct ifnet *ifp) ndetached = 0; #endif + BPF_LOCK(); /* Find all bpf_if struct's which reference ifp and detach them. */ do { - BPF_LOCK(); LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (ifp == bp->bif_ifp) break; } if (bp != NULL) LIST_REMOVE(bp, bif_next); - BPF_UNLOCK(); if (bp != NULL) { #ifdef INVARIANTS ndetached++; #endif while ((d = LIST_FIRST(&bp->bif_dlist)) != NULL) { - bpf_detachd(d); - BPFD_WLOCK(d); + bpf_detachd_locked(d); + BPFD_LOCK(d); bpf_wakeup(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); } /* Free writer-only descriptors */ while ((d = LIST_FIRST(&bp->bif_wlist)) != NULL) { - bpf_detachd(d); - BPFD_WLOCK(d); + bpf_detachd_locked(d); + BPFD_LOCK(d); bpf_wakeup(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); } - rw_destroy(&bp->bif_lock); - free(bp, M_BPF); + + /* + * Delay freing bp till interface is detached + * and all routes through this interface are removed. + * Mark bp as detached to restrict new consumers. + */ + BPFIF_WLOCK(bp); + bp->flags |= BPFIF_FLAG_DYING; + BPFIF_WUNLOCK(bp); } } while (bp != NULL); + BPF_UNLOCK(); #ifdef INVARIANTS if (ndetached == 0) @@ -2496,6 +2510,25 @@ bpfdetach(struct ifnet *ifp) } /* + * Interface departure handler + */ +static void +bpf_ifdetach(void *arg __unused, struct ifnet *ifp) +{ + struct bpf_if *bp; + + if ((bp = ifp->if_bpf) == NULL) + return; + + CTR3(KTR_NET, "%s: freing BPF instance %p for interface %p", + __func__, bp, ifp); + + ifp->if_bpf = NULL; + rw_destroy(&bp->bif_lock); + free(bp, M_BPF); +} + +/* * Get a list of available data link type of the interface. */ static int @@ -2551,9 +2584,9 @@ bpf_setdlt(struct bpf_d *d, u_int dlt) if (bp != NULL) { opromisc = d->bd_promisc; bpf_attachd(d, bp); - BPFD_WLOCK(d); + BPFD_LOCK(d); reset_d(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); if (opromisc) { error = ifpromisc(bp->bif_ifp, 1); if (error) @@ -2578,6 +2611,11 @@ bpf_drvinit(void *unused) dev = make_dev(&bpf_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "bpf"); /* For compatibility */ make_dev_alias(dev, "bpf0"); + + /* Register interface departure handler */ + bpf_ifdetach_cookie = EVENTHANDLER_REGISTER( + ifnet_departure_event, bpf_ifdetach, NULL, + EVENTHANDLER_PRI_ANY); } /* @@ -2595,14 +2633,14 @@ bpf_zero_counters(void) LIST_FOREACH(bp, &bpf_iflist, bif_next) { BPFIF_RLOCK(bp); LIST_FOREACH(bd, &bp->bif_dlist, bd_next) { - BPFD_WLOCK(bd); + BPFD_LOCK(bd); bd->bd_rcount = 0; bd->bd_dcount = 0; bd->bd_fcount = 0; bd->bd_wcount = 0; bd->bd_wfcount = 0; bd->bd_zcopy = 0; - BPFD_WUNLOCK(bd); + BPFD_UNLOCK(bd); } BPFIF_RUNLOCK(bp); } @@ -2696,15 +2734,15 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) /* Send writers-only first */ LIST_FOREACH(bd, &bp->bif_wlist, bd_next) { xbd = &xbdbuf[index++]; - BPFD_RLOCK(bd); + BPFD_LOCK(bd); bpfstats_fill_xbpf(xbd, bd); - BPFD_RUNLOCK(bd); + BPFD_UNLOCK(bd); } LIST_FOREACH(bd, &bp->bif_dlist, bd_next) { xbd = &xbdbuf[index++]; - BPFD_RLOCK(bd); + BPFD_LOCK(bd); bpfstats_fill_xbpf(xbd, bd); - BPFD_RUNLOCK(bd); + BPFD_UNLOCK(bd); } BPFIF_RUNLOCK(bp); } Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Mon May 21 22:13:48 2012 (r235744) +++ head/sys/net/bpf.h Mon May 21 22:17:29 2012 (r235745) @@ -1225,6 +1225,7 @@ struct bpf_if { struct ifnet *bif_ifp; /* corresponding interface */ struct rwlock bif_lock; /* interface lock */ LIST_HEAD(, bpf_d) bif_wlist; /* writer-only list */ + int flags; /* Interface flags */ #endif }; Modified: head/sys/net/bpf_buffer.c ============================================================================== --- head/sys/net/bpf_buffer.c Mon May 21 22:13:48 2012 (r235744) +++ head/sys/net/bpf_buffer.c Mon May 21 22:17:29 2012 (r235745) @@ -184,9 +184,9 @@ bpf_buffer_ioctl_sblen(struct bpf_d *d, { u_int size; - BPFD_WLOCK(d); + BPFD_LOCK(d); if (d->bd_bif != NULL) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (EINVAL); } size = *i; @@ -195,7 +195,7 @@ bpf_buffer_ioctl_sblen(struct bpf_d *d, else if (size < BPF_MINBUFSIZE) *i = size = BPF_MINBUFSIZE; d->bd_bufsize = size; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } Modified: head/sys/net/bpf_zerocopy.c ============================================================================== --- head/sys/net/bpf_zerocopy.c Mon May 21 22:13:48 2012 (r235744) +++ head/sys/net/bpf_zerocopy.c Mon May 21 22:17:29 2012 (r235745) @@ -515,14 +515,14 @@ bpf_zerocopy_ioctl_rotzbuf(struct thread struct zbuf *bzh; bzero(bz, sizeof(*bz)); - BPFD_WLOCK(d); + BPFD_LOCK(d); if (d->bd_hbuf == NULL && d->bd_slen != 0) { ROTATE_BUFFERS(d); bzh = (struct zbuf *)d->bd_hbuf; bz->bz_bufa = (void *)bzh->zb_uaddr; bz->bz_buflen = d->bd_hlen; } - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } @@ -570,10 +570,10 @@ bpf_zerocopy_ioctl_setzbuf(struct thread * We only allow buffers to be installed once, so atomically check * that no buffers are currently installed and install new buffers. */ - BPFD_WLOCK(d); + BPFD_LOCK(d); if (d->bd_hbuf != NULL || d->bd_sbuf != NULL || d->bd_fbuf != NULL || d->bd_bif != NULL) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); zbuf_free(zba); zbuf_free(zbb); return (EINVAL); @@ -593,6 +593,6 @@ bpf_zerocopy_ioctl_setzbuf(struct thread * shared management region. */ d->bd_bufsize = bz->bz_buflen - sizeof(struct bpf_zbuf_header); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } Modified: head/sys/net/bpfdesc.h ============================================================================== --- head/sys/net/bpfdesc.h Mon May 21 22:13:48 2012 (r235744) +++ head/sys/net/bpfdesc.h Mon May 21 22:17:29 2012 (r235745) @@ -88,7 +88,7 @@ struct bpf_d { int bd_sig; /* signal to send upon packet reception */ struct sigio * bd_sigio; /* information for async I/O */ struct selinfo bd_sel; /* bsd select info */ - struct rwlock bd_lock; /* per-descriptor lock */ + struct mtx bd_lock; /* per-descriptor lock */ struct callout bd_callout; /* for BPF timeouts with select */ struct label *bd_label; /* MAC label for descriptor */ u_int64_t bd_fcount; /* number of packets which matched filter */ @@ -107,12 +107,9 @@ struct bpf_d { #define BPF_WAITING 1 /* waiting for read timeout in select */ #define BPF_TIMED_OUT 2 /* read timeout has expired in select */ -#define BPFD_RLOCK(bd) rw_rlock(&(bd)->bd_lock) -#define BPFD_RUNLOCK(bd) rw_runlock(&(bd)->bd_lock) -#define BPFD_WLOCK(bd) rw_wlock(&(bd)->bd_lock) -#define BPFD_WUNLOCK(bd) rw_wunlock(&(bd)->bd_lock) -#define BPFD_WLOCK_ASSERT(bd) rw_assert(&(bd)->bd_lock, RA_WLOCKED) -#define BPFD_LOCK_ASSERT(bd) rw_assert(&(bd)->bd_lock, RA_LOCKED) +#define BPFD_LOCK(bd) mtx_lock(&(bd)->bd_lock) +#define BPFD_UNLOCK(bd) mtx_unlock(&(bd)->bd_lock) +#define BPFD_LOCK_ASSERT(bd) mtx_assert(&(bd)->bd_lock, MA_OWNED) #define BPF_PID_REFRESH(bd, td) (bd)->bd_pid = (td)->td_proc->p_pid #define BPF_PID_REFRESH_CUR(bd) (bd)->bd_pid = curthread->td_proc->p_pid @@ -159,4 +156,6 @@ struct xbpf_d { #define BPFIF_WLOCK(bif) rw_wlock(&(bif)->bif_lock) #define BPFIF_WUNLOCK(bif) rw_wunlock(&(bif)->bif_lock) +#define BPFIF_FLAG_DYING 1 /* Reject new bpf consumers */ + #endif From owner-svn-src-all@FreeBSD.ORG Mon May 21 22:19:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDAF01065680; Mon, 21 May 2012 22:19:20 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE46A8FC0A; Mon, 21 May 2012 22:19:20 +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 q4LMJKl7076039; Mon, 21 May 2012 22:19:20 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMJKR9076035; Mon, 21 May 2012 22:19:20 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201205212219.q4LMJKR9076035@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 21 May 2012 22:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235746 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:19:20 -0000 Author: melifaro Date: Mon May 21 22:19:19 2012 New Revision: 235746 URL: http://svn.freebsd.org/changeset/base/235746 Log: Call bpf_jitter() before acquiring BPF global lock due to malloc() being used inside bpf_jitter. Eliminate bpf_buffer_alloc() and allocate BPF buffers on descriptor creation and BIOCSBLEN ioctl. This permits us not to allocate buffers inside bpf_attachd() which is protected by global lock. Approved by: kib(mentor) MFC in: 4 weeks Modified: head/sys/net/bpf.c head/sys/net/bpf_buffer.c head/sys/net/bpf_buffer.h Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 21 22:17:29 2012 (r235745) +++ head/sys/net/bpf.c Mon May 21 22:19:19 2012 (r235746) @@ -804,7 +804,7 @@ static int bpfopen(struct cdev *dev, int flags, int fmt, struct thread *td) { struct bpf_d *d; - int error; + int error, size; d = malloc(sizeof(*d), M_BPF, M_WAITOK | M_ZERO); error = devfs_set_cdevpriv(d, bpf_dtor); @@ -831,6 +831,10 @@ bpfopen(struct cdev *dev, int flags, int callout_init_mtx(&d->bd_callout, &d->bd_lock, 0); knlist_init_mtx(&d->bd_sel.si_note, &d->bd_lock); + /* Allocate default buffers */ + size = d->bd_bufsize; + bpf_buffer_ioctl_sblen(d, &size); + return (0); } @@ -1664,7 +1668,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro struct bpf_insn *fcode, *old; u_int wfilter, flen, size; #ifdef BPF_JITTER - bpf_jit_filter *ofunc; + bpf_jit_filter *ofunc, *jfunc; #endif int need_upgrade; #ifdef COMPAT_FREEBSD32 @@ -1695,6 +1699,13 @@ bpf_setf(struct bpf_d *d, struct bpf_pro else fcode = NULL; /* Make compiler happy */ +#ifdef BPF_JITTER + if (fp->bf_insns != NULL) + jfunc = bpf_jitter(fcode, flen); + else + jfunc = NULL; /* Make compiler happy */ +#endif + BPF_LOCK(); if (cmd == BIOCSETWF) { @@ -1755,7 +1766,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro else { d->bd_rfilter = fcode; #ifdef BPF_JITTER - d->bd_bfilter = bpf_jitter(fcode, flen); + d->bd_bfilter = jfunc; #endif if (cmd == BIOCSETF) reset_d(d); @@ -1827,11 +1838,6 @@ bpf_setif(struct bpf_d *d, struct ifreq */ switch (d->bd_bufmode) { case BPF_BUFMODE_BUFFER: - if (d->bd_sbuf == NULL) - bpf_buffer_alloc(d); - KASSERT(d->bd_sbuf != NULL, ("bpf_setif: bd_sbuf NULL")); - break; - case BPF_BUFMODE_ZBUF: if (d->bd_sbuf == NULL) return (EINVAL); Modified: head/sys/net/bpf_buffer.c ============================================================================== --- head/sys/net/bpf_buffer.c Mon May 21 22:17:29 2012 (r235745) +++ head/sys/net/bpf_buffer.c Mon May 21 22:19:19 2012 (r235746) @@ -93,21 +93,6 @@ static int bpf_maxbufsize = BPF_MAXBUFSI SYSCTL_INT(_net_bpf, OID_AUTO, maxbufsize, CTLFLAG_RW, &bpf_maxbufsize, 0, "Maximum capture buffer in bytes"); -void -bpf_buffer_alloc(struct bpf_d *d) -{ - - KASSERT(d->bd_fbuf == NULL, ("bpf_buffer_alloc: bd_fbuf != NULL")); - KASSERT(d->bd_sbuf == NULL, ("bpf_buffer_alloc: bd_sbuf != NULL")); - KASSERT(d->bd_hbuf == NULL, ("bpf_buffer_alloc: bd_hbuf != NULL")); - - d->bd_fbuf = (caddr_t)malloc(d->bd_bufsize, M_BPF, M_WAITOK); - d->bd_sbuf = (caddr_t)malloc(d->bd_bufsize, M_BPF, M_WAITOK); - d->bd_hbuf = NULL; - d->bd_slen = 0; - d->bd_hlen = 0; -} - /* * Simple data copy to the current kernel buffer. */ @@ -183,18 +168,42 @@ int bpf_buffer_ioctl_sblen(struct bpf_d *d, u_int *i) { u_int size; + caddr_t fbuf, sbuf; - BPFD_LOCK(d); - if (d->bd_bif != NULL) { - BPFD_UNLOCK(d); - return (EINVAL); - } size = *i; if (size > bpf_maxbufsize) *i = size = bpf_maxbufsize; else if (size < BPF_MINBUFSIZE) *i = size = BPF_MINBUFSIZE; + + /* Allocate buffers immediately */ + fbuf = (caddr_t)malloc(size, M_BPF, M_WAITOK); + sbuf = (caddr_t)malloc(size, M_BPF, M_WAITOK); + + BPFD_LOCK(d); + if (d->bd_bif != NULL) { + /* Interface already attached, unable to change buffers */ + BPFD_UNLOCK(d); + free(fbuf, M_BPF); + free(sbuf, M_BPF); + return (EINVAL); + } + + /* Free old buffers if set */ + if (d->bd_fbuf != NULL) + free(d->bd_fbuf, M_BPF); + if (d->bd_sbuf != NULL) + free(d->bd_sbuf, M_BPF); + + /* Fill in new data */ d->bd_bufsize = size; + d->bd_fbuf = fbuf; + d->bd_sbuf = sbuf; + + d->bd_hbuf = NULL; + d->bd_slen = 0; + d->bd_hlen = 0; + BPFD_UNLOCK(d); return (0); } Modified: head/sys/net/bpf_buffer.h ============================================================================== --- head/sys/net/bpf_buffer.h Mon May 21 22:17:29 2012 (r235745) +++ head/sys/net/bpf_buffer.h Mon May 21 22:19:19 2012 (r235746) @@ -36,7 +36,6 @@ #error "no user-serviceable parts inside" #endif -void bpf_buffer_alloc(struct bpf_d *d); void bpf_buffer_append_bytes(struct bpf_d *d, caddr_t buf, u_int offset, void *src, u_int len); void bpf_buffer_append_mbuf(struct bpf_d *d, caddr_t buf, u_int offset, From owner-svn-src-all@FreeBSD.ORG Mon May 21 22:21:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35AB7106578B; Mon, 21 May 2012 22:21:01 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15D778FC0C; Mon, 21 May 2012 22:21:01 +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 q4LML0Ff076131; Mon, 21 May 2012 22:21:00 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LML09n076128; Mon, 21 May 2012 22:21:00 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201205212221.q4LML09n076128@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 21 May 2012 22:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235747 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:21:01 -0000 Author: melifaro Date: Mon May 21 22:21:00 2012 New Revision: 235747 URL: http://svn.freebsd.org/changeset/base/235747 Log: Make most BPF ioctls() SMP-safe. Approved by: kib(mentor) MFC in: 4 weeks Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 21 22:19:19 2012 (r235746) +++ head/sys/net/bpf.c Mon May 21 22:21:00 2012 (r235747) @@ -1229,7 +1229,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c case BIOCGDLTLIST32: case BIOCGRTIMEOUT32: case BIOCSRTIMEOUT32: + BPFD_LOCK(d); d->bd_compat32 = 1; + BPFD_UNLOCK(d); } #endif @@ -1274,7 +1276,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get buffer len [for read()]. */ case BIOCGBLEN: + BPFD_LOCK(d); *(u_int *)addr = d->bd_bufsize; + BPFD_UNLOCK(d); break; /* @@ -1329,10 +1333,12 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get current data link type. */ case BIOCGDLT: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else *(u_int *)addr = d->bd_bif->bif_dlt; + BPF_UNLOCK(); break; /* @@ -1347,6 +1353,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c list32 = (struct bpf_dltlist32 *)addr; dltlist.bfl_len = list32->bfl_len; dltlist.bfl_list = PTRIN(list32->bfl_list); + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else { @@ -1354,15 +1361,18 @@ bpfioctl(struct cdev *dev, u_long cmd, c if (error == 0) list32->bfl_len = dltlist.bfl_len; } + BPF_UNLOCK(); break; } #endif case BIOCGDLTLIST: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else error = bpf_getdltlist(d, (struct bpf_dltlist *)addr); + BPF_UNLOCK(); break; /* @@ -1381,6 +1391,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get interface name. */ case BIOCGETIF: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else { @@ -1390,6 +1401,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c strlcpy(ifr->ifr_name, ifp->if_xname, sizeof(ifr->ifr_name)); } + BPF_UNLOCK(); break; /* @@ -1481,7 +1493,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Set immediate mode. */ case BIOCIMMEDIATE: + BPFD_LOCK(d); d->bd_immediate = *(u_int *)addr; + BPFD_UNLOCK(d); break; case BIOCVERSION: @@ -1497,21 +1511,27 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get "header already complete" flag */ case BIOCGHDRCMPLT: + BPFD_LOCK(d); *(u_int *)addr = d->bd_hdrcmplt; + BPFD_UNLOCK(d); break; /* * Set "header already complete" flag */ case BIOCSHDRCMPLT: + BPFD_LOCK(d); d->bd_hdrcmplt = *(u_int *)addr ? 1 : 0; + BPFD_UNLOCK(d); break; /* * Get packet direction flag */ case BIOCGDIRECTION: + BPFD_LOCK(d); *(u_int *)addr = d->bd_direction; + BPFD_UNLOCK(d); break; /* @@ -1526,7 +1546,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c case BPF_D_IN: case BPF_D_INOUT: case BPF_D_OUT: + BPFD_LOCK(d); d->bd_direction = direction; + BPFD_UNLOCK(d); break; default: error = EINVAL; @@ -1538,7 +1560,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get packet timestamp format and resolution. */ case BIOCGTSTAMP: + BPFD_LOCK(d); *(u_int *)addr = d->bd_tstamp; + BPFD_UNLOCK(d); break; /* @@ -1557,26 +1581,38 @@ bpfioctl(struct cdev *dev, u_long cmd, c break; case BIOCFEEDBACK: + BPFD_LOCK(d); d->bd_feedback = *(u_int *)addr; + BPFD_UNLOCK(d); break; case BIOCLOCK: + BPFD_LOCK(d); d->bd_locked = 1; + BPFD_UNLOCK(d); break; case FIONBIO: /* Non-blocking I/O */ break; case FIOASYNC: /* Send signal on receive packets */ + BPFD_LOCK(d); d->bd_async = *(int *)addr; + BPFD_UNLOCK(d); break; case FIOSETOWN: + /* + * XXX: Add some sort of locking here? + * fsetown() can sleep. + */ error = fsetown(*(int *)addr, &d->bd_sigio); break; case FIOGETOWN: + BPFD_LOCK(d); *(int *)addr = fgetown(&d->bd_sigio); + BPFD_UNLOCK(d); break; /* This is deprecated, FIOSETOWN should be used instead. */ @@ -1597,16 +1633,23 @@ bpfioctl(struct cdev *dev, u_long cmd, c if (sig >= NSIG) error = EINVAL; - else + else { + BPFD_LOCK(d); d->bd_sig = sig; + BPFD_UNLOCK(d); + } break; } case BIOCGRSIG: + BPFD_LOCK(d); *(u_int *)addr = d->bd_sig; + BPFD_UNLOCK(d); break; case BIOCGETBUFMODE: + BPFD_LOCK(d); *(u_int *)addr = d->bd_bufmode; + BPFD_UNLOCK(d); break; case BIOCSETBUFMODE: @@ -2544,24 +2587,22 @@ bpf_getdltlist(struct bpf_d *d, struct b struct ifnet *ifp; struct bpf_if *bp; + BPF_LOCK_ASSERT(); + ifp = d->bd_bif->bif_ifp; n = 0; error = 0; - BPF_LOCK(); LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp != ifp) continue; if (bfl->bfl_list != NULL) { - if (n >= bfl->bfl_len) { - BPF_UNLOCK(); + if (n >= bfl->bfl_len) return (ENOMEM); - } error = copyout(&bp->bif_dlt, bfl->bfl_list + n, sizeof(u_int)); } n++; } - BPF_UNLOCK(); bfl->bfl_len = n; return (error); } From owner-svn-src-all@FreeBSD.ORG Mon May 21 22:23:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 148AE106566B; Mon, 21 May 2012 22:23:22 +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 F13928FC1D; Mon, 21 May 2012 22:23: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 q4LMNLgh076235; Mon, 21 May 2012 22:23:21 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMNLDJ076233; Mon, 21 May 2012 22:23:21 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201205212223.q4LMNLDJ076233@svn.freebsd.org> From: Sean Bruno Date: Mon, 21 May 2012 22:23:21 +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: r235748 - stable/8/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:23:22 -0000 Author: sbruno Date: Mon May 21 22:23:21 2012 New Revision: 235748 URL: http://svn.freebsd.org/changeset/base/235748 Log: MFC r235634 Fix and update battery status bits according to linux driver Modified: stable/8/sys/dev/mfi/mfireg.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/mfi/mfireg.h ============================================================================== --- stable/8/sys/dev/mfi/mfireg.h Mon May 21 22:21:00 2012 (r235747) +++ stable/8/sys/dev/mfi/mfireg.h Mon May 21 22:23:21 2012 (r235748) @@ -1377,8 +1377,13 @@ struct mfi_bbu_status { #define MFI_BBU_STATE_PACK_MISSING (1 << 0) #define MFI_BBU_STATE_VOLTAGE_LOW (1 << 1) #define MFI_BBU_STATE_TEMPERATURE_HIGH (1 << 2) -#define MFI_BBU_STATE_CHARGE_ACTIVE (1 << 0) -#define MFI_BBU_STATE_DISCHARGE_ACTIVE (1 << 0) +#define MFI_BBU_STATE_CHARGE_ACTIVE (1 << 3) +#define MFI_BBU_STATE_DISCHARGE_ACTIVE (1 << 4) +#define MFI_BBU_STATE_LEARN_CYC_REQ (1 << 5) +#define MFI_BBU_STATE_LEARN_CYC_ACTIVE (1 << 6) +#define MFI_BBU_STATE_LEARN_CYC_FAIL (1 << 7) +#define MFI_BBU_STATE_LEARN_CYC_TIMEOUT (1 << 8) +#define MFI_BBU_STATE_I2C_ERR_DETECT (1 << 9) uint8_t pad[20]; union mfi_bbu_status_detail detail; } __packed; From owner-svn-src-all@FreeBSD.ORG Mon May 21 22:39:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6797106567E; Mon, 21 May 2012 22:39:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A241E8FC16; Mon, 21 May 2012 22:39: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 q4LMdEau076733; Mon, 21 May 2012 22:39:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMdEPa076731; Mon, 21 May 2012 22:39:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205212239.q4LMdEPa076731@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 May 2012 22:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235749 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:39:14 -0000 Author: adrian Date: Mon May 21 22:39:13 2012 New Revision: 235749 URL: http://svn.freebsd.org/changeset/base/235749 Log: Rename ath_tx_cleanup() -> ath_tx_tid_cleanup() in order to not clash with a symbol in if_ath.c Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon May 21 22:23:21 2012 (r235748) +++ head/sys/dev/ath/if_ath_tx.c Mon May 21 22:39:13 2012 (r235749) @@ -3094,7 +3094,7 @@ ath_tx_comp_cleanup_unaggr(struct ath_so * The caller is responsible for pausing the TID. */ static void -ath_tx_cleanup(struct ath_softc *sc, struct ath_node *an, int tid) +ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_node *an, int tid) { struct ath_tid *atid = &an->an_tid[tid]; struct ieee80211_tx_ampdu *tap; @@ -4419,11 +4419,11 @@ ath_addba_stop(struct ieee80211_node *ni sc->sc_addba_stop(ni, tap); /* - * ath_tx_cleanup will resume the TID if possible, otherwise + * ath_tx_tid_cleanup will resume the TID if possible, otherwise * it'll set the cleanup flag, and it'll be unpaused once * things have been cleaned up. */ - ath_tx_cleanup(sc, an, tid); + ath_tx_tid_cleanup(sc, an, tid); } /* From owner-svn-src-all@FreeBSD.ORG Mon May 21 22:43:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33C0E1065679; Mon, 21 May 2012 22:43:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F2128FC24; Mon, 21 May 2012 22:43:39 +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 q4LMhc3h076892; Mon, 21 May 2012 22:43:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMhc9D076890; Mon, 21 May 2012 22:43:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205212243.q4LMhc9D076890@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 May 2012 22:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235750 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:43:39 -0000 Author: adrian Date: Mon May 21 22:43:38 2012 New Revision: 235750 URL: http://svn.freebsd.org/changeset/base/235750 Log: For now, add a quick debugging patch to log when the hw TXQ != the TID/AC. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon May 21 22:39:13 2012 (r235749) +++ head/sys/dev/ath/if_ath_tx.c Mon May 21 22:43:38 2012 (r235750) @@ -1298,6 +1298,18 @@ ath_tx_normal_setup(struct ath_softc *sc return EIO; } + /* Check if the TXQ wouldn't match what the hardware TXQ is! */ + if (txq != sc->sc_ac2q[pri]) { + device_printf(sc->sc_dev, + "%s: txq=%p (%d), pri=%d, pri txq=%p (%d)\n", + __func__, + txq, + txq->axq_qnum, + pri, + sc->sc_ac2q[pri], + sc->sc_ac2q[pri]->axq_qnum); + } + /* * Calculate miscellaneous flags. */ From owner-svn-src-all@FreeBSD.ORG Mon May 21 22:54:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D4CA1065670; Mon, 21 May 2012 22:54:34 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 873928FC19; Mon, 21 May 2012 22:54: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 q4LMsYdq077180; Mon, 21 May 2012 22:54:34 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMsYhg077174; Mon, 21 May 2012 22:54:34 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201205212254.q4LMsYhg077174@svn.freebsd.org> From: Jim Harris Date: Mon, 21 May 2012 22:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235751 - head/sys/dev/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:54:34 -0000 Author: jimharris Date: Mon May 21 22:54:33 2012 New Revision: 235751 URL: http://svn.freebsd.org/changeset/base/235751 Log: Wait until completion context unwinds before retrying CCBs that have been queued internally. This works around issue in the isci HAL where it cannot accept new I/O to a device after a resetting->ready state transition until the completion context has unwound. This issue was found by submitting non-tagged CCBs through pass(4) interface to a SATA disk with an extremely small timeout value (5ms). This would trigger internal resets with I/O in the isci(4) internal queues. The small timeout value had not been intentional (and original reporter has since changed his test to use 5sec instead), but it did uncover this corner case that would result in a hung disk. Sponsored by: Intel Reported and tested by: Ravi Pokala Reviewed by: scottl (earlier version) MFC after: 1 week Modified: head/sys/dev/isci/isci.h head/sys/dev/isci/isci_controller.c head/sys/dev/isci/isci_interrupt.c head/sys/dev/isci/isci_io_request.c head/sys/dev/isci/isci_remote_device.c Modified: head/sys/dev/isci/isci.h ============================================================================== --- head/sys/dev/isci/isci.h Mon May 21 22:43:38 2012 (r235750) +++ head/sys/dev/isci/isci.h Mon May 21 22:54:33 2012 (r235751) @@ -30,6 +30,9 @@ * $FreeBSD$ */ +#ifndef _ISCI_H +#define _ISCI_H + #include #include #include @@ -86,7 +89,31 @@ struct ISCI_REMOTE_DEVICE { BOOL is_resetting; uint32_t frozen_lun_mask; SCI_FAST_LIST_ELEMENT_T pending_device_reset_element; + + /* + * This queue maintains CCBs that have been returned with + * SCI_IO_FAILURE_INVALID_STATE from the SCI layer. These CCBs + * need to be retried, but we cannot return CAM_REQUEUE_REQ because + * this status gets passed all the way back up to users of the pass(4) + * interface and breaks things like smartctl. So instead, we queue + * these CCBs internally. + */ TAILQ_HEAD(,ccb_hdr) queued_ccbs; + + /* + * Marker denoting this remote device needs its first queued ccb to + * be retried. + */ + BOOL release_queued_ccb; + + /* + * Points to a CCB in the queue that is currently being processed by + * SCIL. This allows us to keep in flight CCBs in the queue so as to + * maintain ordering (i.e. in case we retry an I/O and then find out + * it needs to be retried again - it just keeps its same place in the + * queue. + */ + union ccb * queued_ccb_in_progress; }; struct ISCI_DOMAIN { @@ -126,6 +153,7 @@ struct ISCI_CONTROLLER BOOL has_been_scanned; uint32_t initial_discovery_mask; BOOL is_frozen; + BOOL release_queued_ccbs; uint8_t *remote_device_memory; struct ISCI_MEMORY cached_controller_memory; struct ISCI_MEMORY uncached_controller_memory; @@ -291,6 +319,8 @@ int isci_controller_attach_to_cam(struct void isci_controller_start(void *controller); +void isci_controller_release_queued_ccbs(struct ISCI_CONTROLLER *controller); + void isci_domain_construct(struct ISCI_DOMAIN *domain, uint32_t domain_index, struct ISCI_CONTROLLER *controller); @@ -301,3 +331,5 @@ void isci_log_message(uint32_t verbosity char *log_message, ...); extern uint32_t g_isci_debug_level; + +#endif /* #ifndef _ISCI_H */ Modified: head/sys/dev/isci/isci_controller.c ============================================================================== --- head/sys/dev/isci/isci_controller.c Mon May 21 22:43:38 2012 (r235750) +++ head/sys/dev/isci/isci_controller.c Mon May 21 22:54:33 2012 (r235751) @@ -201,6 +201,7 @@ void isci_controller_construct(struct IS controller->is_started = FALSE; controller->is_frozen = FALSE; + controller->release_queued_ccbs = FALSE; controller->sim = NULL; controller->initial_discovery_mask = 0; @@ -431,6 +432,8 @@ int isci_controller_allocate_memory(stru sci_fast_list_element_init(remote_device, &remote_device->pending_device_reset_element); TAILQ_INIT(&remote_device->queued_ccbs); + remote_device->release_queued_ccb = FALSE; + remote_device->queued_ccb_in_progress = NULL; /* * For the first SCI_MAX_DOMAINS device objects, do not put @@ -694,3 +697,47 @@ void isci_action(struct cam_sim *sim, un } } +/* + * Unfortunately, SCIL doesn't cleanly handle retry conditions. + * CAM_REQUEUE_REQ works only when no one is using the pass(4) interface. So + * when SCIL denotes an I/O needs to be retried (typically because of mixing + * tagged/non-tagged ATA commands, or running out of NCQ slots), we queue + * these I/O internally. Once SCIL completes an I/O to this device, or we get + * a ready notification, we will retry the first I/O on the queue. + * Unfortunately, SCIL also doesn't cleanly handle starting the new I/O within + * the context of the completion handler, so we need to retry these I/O after + * the completion handler is done executing. + */ +void +isci_controller_release_queued_ccbs(struct ISCI_CONTROLLER *controller) +{ + struct ISCI_REMOTE_DEVICE *dev; + struct ccb_hdr *ccb_h; + int dev_idx; + + KASSERT(mtx_owned(&controller->lock), ("controller lock not owned")); + + controller->release_queued_ccbs = FALSE; + for (dev_idx = 0; + dev_idx < SCI_MAX_REMOTE_DEVICES; + dev_idx++) { + + dev = controller->remote_device[dev_idx]; + if (dev != NULL && + dev->release_queued_ccb == TRUE && + dev->queued_ccb_in_progress == NULL) { + dev->release_queued_ccb = FALSE; + ccb_h = TAILQ_FIRST(&dev->queued_ccbs); + + if (ccb_h == NULL) + continue; + + isci_log_message(1, "ISCI", "release %p %x\n", ccb_h, + ((union ccb *)ccb_h)->csio.cdb_io.cdb_bytes[0]); + + dev->queued_ccb_in_progress = (union ccb *)ccb_h; + isci_io_request_execute_scsi_io( + (union ccb *)ccb_h, controller); + } + } +} Modified: head/sys/dev/isci/isci_interrupt.c ============================================================================== --- head/sys/dev/isci/isci_interrupt.c Mon May 21 22:43:38 2012 (r235750) +++ head/sys/dev/isci/isci_interrupt.c Mon May 21 22:54:33 2012 (r235751) @@ -177,6 +177,9 @@ isci_interrupt_legacy_handler(void *arg) if (interrupt_handler(scic_controller_handle)) { mtx_lock(&controller->lock); completion_handler(scic_controller_handle); + if (controller->release_queued_ccbs == TRUE) + isci_controller_release_queued_ccbs( + controller); mtx_unlock(&controller->lock); } } @@ -204,6 +207,13 @@ isci_interrupt_msix_handler(void *arg) if (interrupt_handler(scic_controller_handle)) { mtx_lock(&controller->lock); completion_handler(scic_controller_handle); + /* + * isci_controller_release_queued_ccb() is a relatively + * expensive routine, so we don't call it until the controller + * level flag is set to TRUE. + */ + if (controller->release_queued_ccbs == TRUE) + isci_controller_release_queued_ccbs(controller); mtx_unlock(&controller->lock); } } Modified: head/sys/dev/isci/isci_io_request.c ============================================================================== --- head/sys/dev/isci/isci_io_request.c Mon May 21 22:43:38 2012 (r235750) +++ head/sys/dev/isci/isci_io_request.c Mon May 21 22:54:33 2012 (r235751) @@ -223,7 +223,7 @@ isci_io_request_complete(SCI_CONTROLLER_ (struct ISCI_REQUEST *)isci_request); if (complete_ccb) { - if (ccb->ccb_h.status != CAM_REQ_CMP) { + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { /* ccb will be completed with some type of non-success * status. So temporarily freeze the queue until the * upper layers can act on the status. The @@ -234,6 +234,26 @@ isci_io_request_complete(SCI_CONTROLLER_ xpt_freeze_devq(ccb->ccb_h.path, 1); } + if (ccb->ccb_h.status & CAM_SIM_QUEUED) { + + KASSERT(ccb == isci_remote_device->queued_ccb_in_progress, + ("multiple internally queued ccbs in flight")); + + TAILQ_REMOVE(&isci_remote_device->queued_ccbs, + &ccb->ccb_h, sim_links.tqe); + ccb->ccb_h.status &= ~CAM_SIM_QUEUED; + + /* + * This CCB that was in the queue was completed, so + * set the in_progress pointer to NULL denoting that + * we can retry another CCB from the queue. We only + * allow one CCB at a time from the queue to be + * in progress so that we can effectively maintain + * ordering. + */ + isci_remote_device->queued_ccb_in_progress = NULL; + } + if (isci_remote_device->frozen_lun_mask != 0) { isci_remote_device_release_device_queue(isci_remote_device); } @@ -248,11 +268,30 @@ isci_io_request_complete(SCI_CONTROLLER_ isci_remote_device_freeze_lun_queue(isci_remote_device, ccb->ccb_h.target_lun); - isci_log_message(1, "ISCI", "queue %p %x\n", ccb, - ccb->csio.cdb_io.cdb_bytes[0]); - ccb->ccb_h.status |= CAM_SIM_QUEUED; - TAILQ_INSERT_TAIL(&isci_remote_device->queued_ccbs, - &ccb->ccb_h, sim_links.tqe); + if (ccb->ccb_h.status & CAM_SIM_QUEUED) { + + KASSERT(ccb == isci_remote_device->queued_ccb_in_progress, + ("multiple internally queued ccbs in flight")); + + /* + * Do nothing, CCB is already on the device's queue. + * We leave it on the queue, to be retried again + * next time a CCB on this device completes, or we + * get a ready notification for this device. + */ + isci_log_message(1, "ISCI", "already queued %p %x\n", + ccb, ccb->csio.cdb_io.cdb_bytes[0]); + + isci_remote_device->queued_ccb_in_progress = NULL; + + } else { + isci_log_message(1, "ISCI", "queue %p %x\n", ccb, + ccb->csio.cdb_io.cdb_bytes[0]); + ccb->ccb_h.status |= CAM_SIM_QUEUED; + + TAILQ_INSERT_TAIL(&isci_remote_device->queued_ccbs, + &ccb->ccb_h, sim_links.tqe); + } } } Modified: head/sys/dev/isci/isci_remote_device.c ============================================================================== --- head/sys/dev/isci/isci_remote_device.c Mon May 21 22:43:38 2012 (r235750) +++ head/sys/dev/isci/isci_remote_device.c Mon May 21 22:54:33 2012 (r235751) @@ -297,14 +297,18 @@ isci_remote_device_release_device_queue( for (lun = 0; lun < ISCI_MAX_LUN; lun++) isci_remote_device_release_lun_queue(device, lun); } else { - struct ccb_hdr *ccb_h; + /* + * We cannot unfreeze the devq, because there are still + * CCBs in our internal queue that need to be processed + * first. Mark this device, and the controller, so that + * the first CCB in this device's internal queue will be + * resubmitted after the current completion context + * unwinds. + */ + device->release_queued_ccb = TRUE; + device->domain->controller->release_queued_ccbs = TRUE; - ccb_h = TAILQ_FIRST(&device->queued_ccbs); - TAILQ_REMOVE(&device->queued_ccbs, ccb_h, sim_links.tqe); - ccb_h->status &= ~CAM_SIM_QUEUED; - isci_log_message(1, "ISCI", "release %p %x\n", ccb_h, - ((union ccb*)ccb_h)->csio.cdb_io.cdb_bytes[0]); - isci_io_request_execute_scsi_io((union ccb *)ccb_h, - device->domain->controller); + isci_log_message(1, "ISCI", "schedule %p for release\n", + device); } } From owner-svn-src-all@FreeBSD.ORG Mon May 21 23:54:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D0A0106566C; Mon, 21 May 2012 23:54:22 +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 74F4C8FC17; Mon, 21 May 2012 23:54: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 q4LNsMJZ079092; Mon, 21 May 2012 23:54:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LNsMAB079091; Mon, 21 May 2012 23:54:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205212354.q4LNsMAB079091@svn.freebsd.org> From: John Baldwin Date: Mon, 21 May 2012 23:54: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: r235763 - in stable/9/sys: . amd64/include/xen boot boot/i386/efi boot/ia64/efi boot/ia64/ski boot/powerpc/boot1.chrp boot/powerpc/ofw cddl/contrib/opensolaris conf contrib/dev/acpica c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 23:54:22 -0000 Author: jhb Date: Mon May 21 23:54:21 2012 New Revision: 235763 URL: http://svn.freebsd.org/changeset/base/235763 Log: Repair mergeinfo from merges done into a sparse checkout. Modified: 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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue May 22 00:00:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B9921065679; Tue, 22 May 2012 00:00: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 04D1C8FC16; Tue, 22 May 2012 00:00: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 q4M00H2j079324; Tue, 22 May 2012 00:00:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M00HiU079322; Tue, 22 May 2012 00:00:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205220000.q4M00HiU079322@svn.freebsd.org> From: John Baldwin Date: Tue, 22 May 2012 00:00:17 +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: r235764 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 00:00:30 -0000 Author: jhb Date: Tue May 22 00:00:17 2012 New Revision: 235764 URL: http://svn.freebsd.org/changeset/base/235764 Log: MFC 234098: Add media types for 40G media that might be used with FreeBSD. Modified: stable/9/sys/net/if_media.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/net/if_media.h ============================================================================== --- stable/9/sys/net/if_media.h Mon May 21 23:54:21 2012 (r235763) +++ stable/9/sys/net/if_media.h Tue May 22 00:00:17 2012 (r235764) @@ -150,6 +150,9 @@ uint64_t ifmedia_baudrate(int); #define IFM_10G_LRM 24 /* 10GBase-LRM 850nm Multi-mode */ #define IFM_UNKNOWN 25 /* media types not defined yet */ #define IFM_10G_T 26 /* 10GBase-T - RJ45 */ +#define IFM_40G_CR4 27 /* 40GBase-CR4 */ +#define IFM_40G_SR4 28 /* 40GBase-SR4 */ +#define IFM_40G_LR4 29 /* 40GBase-LR4 */ /* note 31 is the max! */ @@ -366,6 +369,9 @@ struct ifmedia_description { { IFM_10G_TWINAX_LONG, "10Gbase-Twinax-Long" }, \ { IFM_UNKNOWN, "Unknown" }, \ { IFM_10G_T, "10Gbase-T" }, \ + { IFM_40G_CR4, "40Gbase-CR4" }, \ + { IFM_40G_SR4, "40Gbase-SR4" }, \ + { IFM_40G_LR4, "40Gbase-LR4" }, \ { 0, NULL }, \ } @@ -664,6 +670,9 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_10G_TWINAX_LONG, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_LRM, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_T, IF_Gbps(10ULL) }, \ + { IFM_ETHER | IFM_40G_CR4, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_40G_SR4, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_40G_LR4, IF_Gbps(40ULL) }, \ \ { IFM_TOKEN | IFM_TOK_STP4, IF_Mbps(4) }, \ { IFM_TOKEN | IFM_TOK_STP16, IF_Mbps(16) }, \ From owner-svn-src-all@FreeBSD.ORG Tue May 22 00:08:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B1F51065678; Tue, 22 May 2012 00:08:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id E06C48FC25; Tue, 22 May 2012 00:08:49 +0000 (UTC) Received: from John-Baldwins-MacBook-Air.local (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DD610B922; Mon, 21 May 2012 20:08:48 -0400 (EDT) Message-ID: <4FBAD919.2010706@FreeBSD.org> Date: Mon, 21 May 2012 20:08:57 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: John Baldwin References: <201205211958.q4LJweXG070838@svn.freebsd.org> <201205211718.34896.jhb@freebsd.org> In-Reply-To: <201205211718.34896.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 21 May 2012 20:08:49 -0400 (EDT) Cc: svn-src-stable@freebsd.org, Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r235738 - in stable/9/sys: . dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 00:08:50 -0000 On 5/21/12 5:18 PM, John Baldwin wrote: > On Monday, May 21, 2012 3:58:40 pm Sean Bruno wrote: >> Author: sbruno >> Date: Mon May 21 19:58:40 2012 >> New Revision: 235738 >> URL: http://svn.freebsd.org/changeset/base/235738 >> >> Log: >> MFC r235634 >> >> Fix and update battery status bits according to linux driver > > Hmm, svn seems to have crapped itself. > > We should probably at least remove the unnecessary mergeinfo from files. > > Ah, it looks like the MFC of the last round of ixgbe changes was merged into a > sparse checkout, and that is causing the pain. I will try to fix this, but > can other folks hold off on merging to stable/9/sys while I do so? I think I have this cleaned up. However, I have only tried using a 1.6 client so far (and it was merging things fine before). Sean, I think you are using a 1.7 client, yes? If anyone does a merge and notices that it adds a ton of new mergeinfo, can you please wait to commit until after someone else has looked at it? Hopefully the mergeinfo stuff I adjusted will fix this. (And I'm done with my current guesses at fixing.) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue May 22 01:28:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58979106564A; Tue, 22 May 2012 01:28:33 +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 4416D8FC08; Tue, 22 May 2012 01:28:33 +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 q4M1SXQr081578; Tue, 22 May 2012 01:28:33 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M1SXPv081576; Tue, 22 May 2012 01:28:33 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205220128.q4M1SXPv081576@svn.freebsd.org> From: Kevin Lo Date: Tue, 22 May 2012 01:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235767 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 01:28:33 -0000 Author: kevlo Date: Tue May 22 01:28:32 2012 New Revision: 235767 URL: http://svn.freebsd.org/changeset/base/235767 Log: Add missing header needed by free() Reported by: tinderbox Modified: head/lib/libc/net/nsparser.y Modified: head/lib/libc/net/nsparser.y ============================================================================== --- head/lib/libc/net/nsparser.y Tue May 22 00:32:30 2012 (r235766) +++ head/lib/libc/net/nsparser.y Tue May 22 01:28:32 2012 (r235767) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #define _NS_PRIVATE #include #include +#include #include #include #include "un-namespace.h" From owner-svn-src-all@FreeBSD.ORG Tue May 22 02:11:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 567DD106564A; Tue, 22 May 2012 02:11:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F30D8FC08; Tue, 22 May 2012 02:11: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 q4M2B9wh082554; Tue, 22 May 2012 02:11:09 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M2B9sW082552; Tue, 22 May 2012 02:11:09 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201205220211.q4M2B9sW082552@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 May 2012 02:11: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: r235768 - stable/9/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 02:11:09 -0000 Author: pfg Date: Tue May 22 02:11:08 2012 New Revision: 235768 URL: http://svn.freebsd.org/changeset/base/235768 Log: MFC: r233362 Don't cast a bus address to a uint8_t pointer just to add an offset to it. Instead, add the offset directly to the bus address. Approved by: jhb (mentor) Modified: stable/9/sys/dev/sound/pci/emu10kx.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pci/emu10kx.c ============================================================================== --- stable/9/sys/dev/sound/pci/emu10kx.c Tue May 22 01:28:32 2012 (r235767) +++ stable/9/sys/dev/sound/pci/emu10kx.c Tue May 22 02:11:08 2012 (r235768) @@ -1137,7 +1137,7 @@ emu_memalloc(struct emu_mem *mem, uint32 ofs = 0; for (idx = start; idx < start + blksz; idx++) { mem->bmap[idx >> 3] |= 1 << (idx & 7); - tmp = (uint32_t) (u_long) ((uint8_t *) blk->buf_addr + ofs); + tmp = (uint32_t) (blk->buf_addr + ofs); mem->ptb_pages[idx] = (tmp << 1) | idx; ofs += EMUPAGESIZE; } From owner-svn-src-all@FreeBSD.ORG Tue May 22 02:24:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8689B106566C; Tue, 22 May 2012 02:24:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57FF58FC22; Tue, 22 May 2012 02:24:53 +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 q4M2Orpv082861; Tue, 22 May 2012 02:24:53 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M2Or4Q082858; Tue, 22 May 2012 02:24:53 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201205220224.q4M2Or4Q082858@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 May 2012 02:24: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: r235769 - in stable/9/sys: amd64/conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 02:24:53 -0000 Author: pfg Date: Tue May 22 02:24:52 2012 New Revision: 235769 URL: http://svn.freebsd.org/changeset/base/235769 Log: MFC: r233310 Add snd_cmi, snd_csa and snd_emu10kx to GENERIC on i386 and amd64. The GPL infected parts which were blocking the inclusion of snd_csa and snd_emu10kx in GENERIC have recently been removed from the tree. Requested by: joel Discussed with: jhb, joel, Yuriy Tsibizov Approved by: jhb (mentor) Modified: stable/9/sys/amd64/conf/GENERIC stable/9/sys/i386/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Tue May 22 02:11:08 2012 (r235768) +++ stable/9/sys/amd64/conf/GENERIC Tue May 22 02:24:52 2012 (r235769) @@ -337,6 +337,9 @@ device dcons_crom # Configuration ROM f # Sound support device sound # Generic sound driver (required) +device snd_cmi # CMedia CMI8338/CMI8738 +device snd_csa # Crystal Semiconductor CS461x/428x +device snd_emu10kx # Creative SoundBlaster Live! and Audigy device snd_es137x # Ensoniq AudioPCI ES137x device snd_hda # Intel High Definition Audio device snd_ich # Intel, NVidia and other ICH AC'97 Audio Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Tue May 22 02:11:08 2012 (r235768) +++ stable/9/sys/i386/conf/GENERIC Tue May 22 02:24:52 2012 (r235769) @@ -350,6 +350,9 @@ device dcons_crom # Configuration ROM f # Sound support device sound # Generic sound driver (required) +device snd_cmi # CMedia CMI8338/CMI8738 +device snd_csa # Crystal Semiconductor CS461x/428x +device snd_emu10kx # Creative SoundBlaster Live! and Audigy device snd_es137x # Ensoniq AudioPCI ES137x device snd_hda # Intel High Definition Audio device snd_ich # Intel, NVidia and other ICH AC'97 Audio From owner-svn-src-all@FreeBSD.ORG Tue May 22 02:27:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81B91065670; Tue, 22 May 2012 02:27:48 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 536AD8FC1B; Tue, 22 May 2012 02:27:48 +0000 (UTC) Received: by obcni5 with SMTP id ni5so12099726obc.13 for ; Mon, 21 May 2012 19:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=BPPeajXJBtulDNQ6uUDrHIeeVxuNNpByFictIhlHJ8A=; b=cnnCsb6iW3yjy1OElysx3bmHvhRuOOFArJwIDZ8EVEyLjC2CDakSmvPusXzX40CYio bBFju3By8nv8V4U3JfgANzRX3w+rz37AuhiRCwEfPCP4tbRm7YQfJN5KFUwpQY8x5Rcn JZJ19AD/tdYrzAf+Y3lhBvswK9NMEU7BZSipcdhffB/40kYTkd9oeXuYsarI78sQS4D/ PGhp28a+gjwhxLJ/p4+ebpgZ5WgHQuF4p1A/WN1Al0lbVfRHHTTy8xZbu1yOIoTAk5+m J9Ji5AXk9Hv6c+MK1mgARHZqjvIwE33pFkfjLuTH2J4a73IGM/K06WgX6s/LFgjyAj0k nhuA== MIME-Version: 1.0 Received: by 10.182.31.102 with SMTP id z6mr21468770obh.78.1337653667689; Mon, 21 May 2012 19:27:47 -0700 (PDT) Received: by 10.76.153.72 with HTTP; Mon, 21 May 2012 19:27:47 -0700 (PDT) In-Reply-To: <201205220128.q4M1SXPv081576@svn.freebsd.org> References: <201205220128.q4M1SXPv081576@svn.freebsd.org> Date: Mon, 21 May 2012 19:27:47 -0700 Message-ID: From: Garrett Cooper To: Kevin Lo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235767 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 02:27:48 -0000 On Mon, May 21, 2012 at 6:28 PM, Kevin Lo wrote: > Author: kevlo > Date: Tue May 22 01:28:32 2012 > New Revision: 235767 > URL: http://svn.freebsd.org/changeset/base/235767 > > Log: > =A0Add missing header needed by free() > > =A0Reported by: =A0tinderbox Thank you for saving my mailbox :)!!! FWIW, it's weird because my STABLE-9 box didn't reproduce this. Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Tue May 22 03:01:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A92971065679; Tue, 22 May 2012 03:01:55 +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 7B7F48FC0A; Tue, 22 May 2012 03:01: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 q4M31tXL084099; Tue, 22 May 2012 03:01:55 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M31tJn084097; Tue, 22 May 2012 03:01:55 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205220301.q4M31tJn084097@svn.freebsd.org> From: Kevin Lo Date: Tue, 22 May 2012 03:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235771 - head/bin/expr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 03:01:55 -0000 Author: kevlo Date: Tue May 22 03:01:54 2012 New Revision: 235771 URL: http://svn.freebsd.org/changeset/base/235771 Log: Remove redundant declaration of yyparse Reported by: tinderbox Modified: head/bin/expr/expr.y Modified: head/bin/expr/expr.y ============================================================================== --- head/bin/expr/expr.y Tue May 22 02:37:04 2012 (r235770) +++ head/bin/expr/expr.y Tue May 22 03:01:54 2012 (r235771) @@ -74,7 +74,6 @@ int to_integer(struct val *); void to_string(struct val *); int yyerror(const char *); int yylex(void); -int yyparse(void); %} From owner-svn-src-all@FreeBSD.ORG Tue May 22 04:21:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4485106566C; Tue, 22 May 2012 04:21:00 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8CC978FC0A; Tue, 22 May 2012 04:21:00 +0000 (UTC) Received: by obcni5 with SMTP id ni5so12246720obc.13 for ; Mon, 21 May 2012 21:21:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=EAKC7rlJQgjjp+7gbxjkfaYhjZLmQsPayKfrp/cwlKI=; b=q1L6mLc3RRzk5JJGqKpCbZjQDj4G12lJvp7XhShgrleRuUfMeHa2bpcujolfdmaWYh lnQLPNjGQuGv3Se/2GYuHhPmEwJaL34mrvF8DppyOGJRZ+CA7HATSUKjk75/g7mpZ8tI S21Bhb8sRUwRLKz0jIkVpX0G5W/4AJPqC0MmSkp/Ca9LAEGP6ZWeBRL13JrzQMnH9jRb N8sVLg6dXRpVriBM0n2CNMF5Wbu5piNPh6ziREH8c920JuKogmmsAPQ50B253kRnOKr6 zgj8xzM+cWiQvEMcCBYSuSo3Tk+i4y49lZZwB3eB1859z9MopIUygDLHtZrknEFGM4xm ZNVg== MIME-Version: 1.0 Received: by 10.182.164.69 with SMTP id yo5mr21461850obb.17.1337660459855; Mon, 21 May 2012 21:20:59 -0700 (PDT) Received: by 10.76.153.72 with HTTP; Mon, 21 May 2012 21:20:59 -0700 (PDT) In-Reply-To: <201205220301.q4M31tJn084097@svn.freebsd.org> References: <201205220301.q4M31tJn084097@svn.freebsd.org> Date: Mon, 21 May 2012 21:20:59 -0700 Message-ID: From: Garrett Cooper To: Kevin Lo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, Baptiste Daroussin Subject: Re: svn commit: r235771 - head/bin/expr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 04:21:01 -0000 On Mon, May 21, 2012 at 8:01 PM, Kevin Lo wrote: > Author: kevlo > Date: Tue May 22 03:01:54 2012 > New Revision: 235771 > URL: http://svn.freebsd.org/changeset/base/235771 > > Log: > =A0Remove redundant declaration of yyparse > > =A0Reported by: =A0tinderbox > > Modified: > =A0head/bin/expr/expr.y > > Modified: head/bin/expr/expr.y > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/bin/expr/expr.y =A0 =A0 =A0 =A0Tue May 22 02:37:04 2012 =A0 =A0 = =A0 =A0(r235770) > +++ head/bin/expr/expr.y =A0 =A0 =A0 =A0Tue May 22 03:01:54 2012 =A0 =A0 = =A0 =A0(r235771) > @@ -74,7 +74,6 @@ int =A0 =A0 =A0 =A0 =A0 to_integer(struct val *); > =A0void =A0 =A0 =A0 =A0 =A0 to_string(struct val *); > =A0int =A0 =A0 =A0 =A0 =A0 =A0yyerror(const char *); > =A0int =A0 =A0 =A0 =A0 =A0 =A0yylex(void); > -int =A0 =A0 =A0 =A0 =A0 =A0yyparse(void); > > =A0%} There are a lot more than just this unfortunately (I'm working on a complete patchset). This breakage really makes me think that yacc isn't being built at the right time or pathed properly in the build system. Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Tue May 22 05:18:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5FA34106566B; Tue, 22 May 2012 05:18:31 +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 4A6668FC08; Tue, 22 May 2012 05:18: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 q4M5IV2N088527; Tue, 22 May 2012 05:18:31 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M5IVHB088525; Tue, 22 May 2012 05:18:31 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201205220518.q4M5IVHB088525@svn.freebsd.org> From: Mitsuru IWASAKI Date: Tue, 22 May 2012 05:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235772 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 05:18:31 -0000 Author: iwasaki Date: Tue May 22 05:18:30 2012 New Revision: 235772 URL: http://svn.freebsd.org/changeset/base/235772 Log: Ignore the power button press event for resuming rather than starting shutdown. MFC after: 2 days Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue May 22 03:01:54 2012 (r235771) +++ head/sys/dev/acpica/acpi.c Tue May 22 05:18:30 2012 (r235772) @@ -2515,6 +2515,11 @@ acpi_ReqSleepState(struct acpi_softc *sc if (!acpi_sleep_states[state]) return (EOPNOTSUPP); + /* If a suspend request is already in progress, just return. */ + if (sc->acpi_next_sstate != 0) { + return (0); + } + /* Wait until sleep is enabled. */ while (sc->acpi_sleep_disabled) { AcpiOsSleep(1000); @@ -2522,11 +2527,6 @@ acpi_ReqSleepState(struct acpi_softc *sc ACPI_LOCK(acpi); - /* If a suspend request is already in progress, just return. */ - if (sc->acpi_next_sstate != 0) { - ACPI_UNLOCK(acpi); - return (0); - } sc->acpi_next_sstate = state; /* S5 (soft-off) should be entered directly with no waiting. */ From owner-svn-src-all@FreeBSD.ORG Tue May 22 05:41:17 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AA7B106566C; Tue, 22 May 2012 05:41:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 502718FC0C; Tue, 22 May 2012 05:41:17 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4M5fHo7015793; Tue, 22 May 2012 05:41:17 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4M5fH2p015774; Tue, 22 May 2012 05:41:17 GMT (envelope-from bapt@FreeBSD.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f Date: Tue, 22 May 2012 07:41:13 +0200 From: Baptiste Daroussin To: Garrett Cooper Message-ID: <20120522054113.GL63744@ithaqua.etoilebsd.net> References: <201205220301.q4M31tJn084097@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jtcAeju3WzRmRF+o" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Kevin Lo , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Baptiste Daroussin Subject: Re: svn commit: r235771 - head/bin/expr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 05:41:17 -0000 --jtcAeju3WzRmRF+o Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 21, 2012 at 09:20:59PM -0700, Garrett Cooper wrote: > On Mon, May 21, 2012 at 8:01 PM, Kevin Lo wrote: > > Author: kevlo > > Date: Tue May 22 03:01:54 2012 > > New Revision: 235771 > > URL: http://svn.freebsd.org/changeset/base/235771 > > > > Log: > > =A0Remove redundant declaration of yyparse > > > > =A0Reported by: =A0tinderbox > > > > Modified: > > =A0head/bin/expr/expr.y > > > > Modified: head/bin/expr/expr.y > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/bin/expr/expr.y =A0 =A0 =A0 =A0Tue May 22 02:37:04 2012 =A0 = =A0 =A0 =A0(r235770) > > +++ head/bin/expr/expr.y =A0 =A0 =A0 =A0Tue May 22 03:01:54 2012 =A0 = =A0 =A0 =A0(r235771) > > @@ -74,7 +74,6 @@ int =A0 =A0 =A0 =A0 =A0 to_integer(struct val *); > > =A0void =A0 =A0 =A0 =A0 =A0 to_string(struct val *); > > =A0int =A0 =A0 =A0 =A0 =A0 =A0yyerror(const char *); > > =A0int =A0 =A0 =A0 =A0 =A0 =A0yylex(void); > > -int =A0 =A0 =A0 =A0 =A0 =A0yyparse(void); > > > > =A0%} >=20 > There are a lot more than just this unfortunately (I'm working on > a complete patchset). > This breakage really makes me think that yacc isn't being built at > the right time or pathed properly in the build system. > Thanks, > -Garrett > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" The complete patch set is there: http://people.freebsd.org/~bapt/fix-after-yacc.diff (clang seems to not detect those redudant warning, while gcc complains) I'm waiting for review before committing) Thanks for this fix I'll remove it from my patchset regards, Bapt --jtcAeju3WzRmRF+o Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+7JvkACgkQ8kTtMUmk6EwpoQCeJL4vVemxrnkPQBWhYc2QEWRS F7kAnjADiwzOot/aj41BuamAe1WRtd6R =eA8L -----END PGP SIGNATURE----- --jtcAeju3WzRmRF+o-- From owner-svn-src-all@FreeBSD.ORG Tue May 22 05:46:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17F9A106567B; Tue, 22 May 2012 05:46:53 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id BEC258FC17; Tue, 22 May 2012 05:46:52 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so8512314pbb.13 for ; Mon, 21 May 2012 22:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; bh=vRsnF2p1Brd0wY5hp7E02TYITj1r+90rT9bSmOsVbJQ=; b=Mvc60MWui0qEI8I/5sC+Wlhgq+ihcwwGbQITtAFN0zT2Y1fjC0U4Ot18ZQR/6msUBN dB8lOXao/hctxfyfBb0sNmdmYuHVQzD+cFBkZsRqoR/Ny91mHDL6ItfOPSzsbiZYV6KH 3bGPpk9g/6nGBSZaABvWQy8QzGC+MFgh3LFvSz7NnMtuAE2WZfMMzhN6a+10Irs5Mh5R htKSGmxMZFAVopmx7k2RBTRe1Tf0AxUP8eG2YWKFIRKf6aKc6lBTLewE4nvyyce1WJpl RqLMWPUG0KXCdaHiyRqO82R/+O5V9jp7AUf6vbnZ+1Bx7n9CI5Hi3la81darVBhinIhK WIcw== Received: by 10.68.222.197 with SMTP id qo5mr7859140pbc.72.1337665612301; Mon, 21 May 2012 22:46:52 -0700 (PDT) Received: from [192.168.20.11] (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id ob8sm12070644pbb.17.2012.05.21.22.46.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 May 2012 22:46:51 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1257) From: Garrett Cooper In-Reply-To: <20120522054113.GL63744@ithaqua.etoilebsd.net> Date: Mon, 21 May 2012 22:46:50 -0700 Message-Id: References: <201205220301.q4M31tJn084097@svn.freebsd.org> <20120522054113.GL63744@ithaqua.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1257) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Kevin Lo , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Baptiste Daroussin Subject: Re: svn commit: r235771 - head/bin/expr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 05:46:53 -0000 On May 21, 2012, at 10:41 PM, Baptiste Daroussin wrote: > On Mon, May 21, 2012 at 09:20:59PM -0700, Garrett Cooper wrote: >> On Mon, May 21, 2012 at 8:01 PM, Kevin Lo wrote: >>> Author: kevlo >>> Date: Tue May 22 03:01:54 2012 >>> New Revision: 235771 >>> URL: http://svn.freebsd.org/changeset/base/235771 >>>=20 >>> Log: >>> Remove redundant declaration of yyparse >>>=20 >>> Reported by: tinderbox >>>=20 >>> Modified: >>> head/bin/expr/expr.y >>>=20 >>> Modified: head/bin/expr/expr.y >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/bin/expr/expr.y Tue May 22 02:37:04 2012 = (r235770) >>> +++ head/bin/expr/expr.y Tue May 22 03:01:54 2012 = (r235771) >>> @@ -74,7 +74,6 @@ int to_integer(struct val *); >>> void to_string(struct val *); >>> int yyerror(const char *); >>> int yylex(void); >>> -int yyparse(void); >>>=20 >>> %} >>=20 >> There are a lot more than just this unfortunately (I'm working on >> a complete patchset). >> This breakage really makes me think that yacc isn't being built at >> the right time or pathed properly in the build system. >=20 > The complete patch set is there: > http://people.freebsd.org/~bapt/fix-after-yacc.diff > (clang seems to not detect those redudant warning, while gcc = complains) >=20 > I'm waiting for review before committing) >=20 > Thanks for this fix I'll remove it from my patchset Yeah, that looks about right (I was about 4/5 of the way there, = but you beat me to the punch :)..). Cheers! -Garrett= From owner-svn-src-all@FreeBSD.ORG Tue May 22 06:06:18 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EDC4106564A; Tue, 22 May 2012 06:06:18 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 26AD28FC14; Tue, 22 May 2012 06:06:17 +0000 (UTC) Received: from [127.0.0.1] (git.kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.5/8.14.5) with ESMTP id q4M667tS011911; Tue, 22 May 2012 14:06:07 +0800 (CST) (envelope-from kevlo@FreeBSD.org) Message-ID: <1337666770.2289.7.camel@nsl> From: Kevin Lo To: Baptiste Daroussin Date: Tue, 22 May 2012 14:06:10 +0800 In-Reply-To: <20120522054113.GL63744@ithaqua.etoilebsd.net> References: <201205220301.q4M31tJn084097@svn.freebsd.org> <20120522054113.GL63744@ithaqua.etoilebsd.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Cc: Garrett Cooper , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Baptiste Daroussin Subject: Re: svn commit: r235771 - head/bin/expr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 06:06:18 -0000 Baptiste Daroussin wrote: > On Mon, May 21, 2012 at 09:20:59PM -0700, Garrett Cooper wrote: > > On Mon, May 21, 2012 at 8:01 PM, Kevin Lo wrote: > > > Author: kevlo > > > Date: Tue May 22 03:01:54 2012 > > > New Revision: 235771 > > > URL: http://svn.freebsd.org/changeset/base/235771 > > > > > > Log: > > > Remove redundant declaration of yyparse > > > > > > Reported by: tinderbox > > > > > > Modified: > > > head/bin/expr/expr.y > > > > > > Modified: head/bin/expr/expr.y > > > ============================================================================== > > > --- head/bin/expr/expr.y Tue May 22 02:37:04 2012 (r235770) > > > +++ head/bin/expr/expr.y Tue May 22 03:01:54 2012 (r235771) > > > @@ -74,7 +74,6 @@ int to_integer(struct val *); > > > void to_string(struct val *); > > > int yyerror(const char *); > > > int yylex(void); > > > -int yyparse(void); > > > > > > %} > > > > There are a lot more than just this unfortunately (I'm working on > > a complete patchset). > > This breakage really makes me think that yacc isn't being built at > > the right time or pathed properly in the build system. > > Thanks, > > -Garrett > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > The complete patch set is there: > http://people.freebsd.org/~bapt/fix-after-yacc.diff > (clang seems to not detect those redudant warning, while gcc complains) > > I'm waiting for review before committing) > > Thanks for this fix I'll remove it from my patchset Looks good to me. Thanks for cooking up the patchset. > regards, > Bapt Kevin From owner-svn-src-all@FreeBSD.ORG Tue May 22 06:28:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B4D21065673; Tue, 22 May 2012 06:28:54 +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 161D58FC0C; Tue, 22 May 2012 06:28: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 q4M6SrMJ090227; Tue, 22 May 2012 06:28:53 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M6SrV2090225; Tue, 22 May 2012 06:28:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205220628.q4M6SrV2090225@svn.freebsd.org> From: Dimitry Andric Date: Tue, 22 May 2012 06:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235773 - head/contrib/ncurses/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 06:28:54 -0000 Author: dim Date: Tue May 22 06:28:53 2012 New Revision: 235773 URL: http://svn.freebsd.org/changeset/base/235773 Log: Correct use_screen() and use_window() prototypes in curs_threads(3x). Submitted by: Yanhui Shen MFC after: 3 days Modified: head/contrib/ncurses/man/curs_threads.3x Modified: head/contrib/ncurses/man/curs_threads.3x ============================================================================== --- head/contrib/ncurses/man/curs_threads.3x Tue May 22 05:18:30 2012 (r235772) +++ head/contrib/ncurses/man/curs_threads.3x Tue May 22 06:28:53 2012 (r235773) @@ -45,9 +45,9 @@ .br \fBint set_tabsize(int size);\fR .br -\fBint use_screen(SCREEN *scr, NCURSES_WINDOW_CB func, void *data);\fR +\fBint use_screen(SCREEN *scr, NCURSES_SCREEN_CB func, void *data);\fR .br -\fBint use_window(WINDOW *win, NCURSES_SCREEN_CB func, void *data);\fR +\fBint use_window(WINDOW *win, NCURSES_WINDOW_CB func, void *data);\fR .br .SH DESCRIPTION This implementation can be configured to provide rudimentary support From owner-svn-src-all@FreeBSD.ORG Tue May 22 06:31:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CBDE1065766; Tue, 22 May 2012 06:31:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB70D8FC18; Tue, 22 May 2012 06:31:03 +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 q4M6V3qL090384; Tue, 22 May 2012 06:31:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M6V3UR090381; Tue, 22 May 2012 06:31:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205220631.q4M6V3UR090381@svn.freebsd.org> From: Adrian Chadd Date: Tue, 22 May 2012 06:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235774 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 06:31:04 -0000 Author: adrian Date: Tue May 22 06:31:03 2012 New Revision: 235774 URL: http://svn.freebsd.org/changeset/base/235774 Log: Fix up some corner cases with aggregation handling. I've come across a weird scenario in net80211 where two TX streams will happily attempt to setup an aggregation session together. If we're very lucky, it happens concurrently on separate CPUs and the total lack of locking in the net80211 aggregation code causes this stuff to race. Badly. So >1 call would occur to the ath(4) addba start, but only one call would complete to addba complete or timeout. The TID would thus stay paused. The real fix is to implement some proper per-node (or maybe per-TID) locking in net80211, which then could be leveraged by the ath(4) TX aggregation code. Whilst I'm at it, shuffle around the debugging messages a bit. I like to keep people on their toes. Modified: head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue May 22 06:28:53 2012 (r235773) +++ head/sys/dev/ath/if_ath_tx.c Tue May 22 06:31:03 2012 (r235774) @@ -1580,21 +1580,21 @@ ath_tx_start(struct ath_softc *sc, struc * reached.) */ if (txq == &avp->av_mcastq) { - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: mcastq: TX'ing\n", __func__, bf); ATH_TXQ_LOCK(txq); ath_tx_xmit_normal(sc, txq, bf); ATH_TXQ_UNLOCK(txq); } else if (type == IEEE80211_FC0_TYPE_CTL && subtype == IEEE80211_FC0_SUBTYPE_BAR) { - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: BAR: TX'ing direct\n", __func__); ATH_TXQ_LOCK(txq); ath_tx_xmit_normal(sc, txq, bf); ATH_TXQ_UNLOCK(txq); } else { /* add to software queue */ - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: swq: TX'ing\n", __func__, bf); ath_tx_swq(sc, ni, txq, bf); } @@ -3113,7 +3113,7 @@ ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_buf *bf, *bf_next; ath_bufhead bf_cq; - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: TID %d: called\n", __func__, tid); TAILQ_INIT(&bf_cq); @@ -4336,7 +4336,15 @@ ath_addba_request(struct ieee80211_node * fall within it. */ ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); - ath_tx_tid_pause(sc, atid); + /* + * This is a bit annoying. Until net80211 HT code inherits some + * (any) locking, we may have this called in parallel BUT only + * one response/timeout will be called. Grr. + */ + if (atid->addba_tx_pending == 0) { + ath_tx_tid_pause(sc, atid); + atid->addba_tx_pending = 1; + } ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, @@ -4397,6 +4405,7 @@ ath_addba_response(struct ieee80211_node r = sc->sc_addba_response(ni, tap, status, code, batimeout); ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); + atid->addba_tx_pending = 0; /* * XXX dirty! * Slide the BAW left edge to wherever net80211 left it for us. @@ -4500,6 +4509,10 @@ ath_addba_response_timeout(struct ieee80 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: called; resuming\n", __func__); + ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); + atid->addba_tx_pending = 0; + ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); + /* Note: This updates the aggregate state to (again) pending */ sc->sc_addba_response_timeout(ni, tap); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue May 22 06:28:53 2012 (r235773) +++ head/sys/dev/ath/if_athvar.h Tue May 22 06:31:03 2012 (r235774) @@ -106,6 +106,7 @@ struct ath_tid { TAILQ_ENTRY(ath_tid) axq_qelem; int sched; int paused; /* >0 if the TID has been paused */ + int addba_tx_pending; /* TX ADDBA pending */ int bar_wait; /* waiting for BAR */ int bar_tx; /* BAR TXed */ From owner-svn-src-all@FreeBSD.ORG Tue May 22 06:33:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8633A1065676; Tue, 22 May 2012 06:33:09 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 719258FC12; Tue, 22 May 2012 06:33: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 q4M6X9nU090478; Tue, 22 May 2012 06:33:09 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M6X9Ct090476; Tue, 22 May 2012 06:33:09 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201205220633.q4M6X9Ct090476@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 22 May 2012 06:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235775 - head/sys/modules/bwi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 06:33:09 -0000 Author: uqs Date: Tue May 22 06:33:08 2012 New Revision: 235775 URL: http://svn.freebsd.org/changeset/base/235775 Log: Fix make depend. Modified: head/sys/modules/bwi/Makefile Modified: head/sys/modules/bwi/Makefile ============================================================================== --- head/sys/modules/bwi/Makefile Tue May 22 06:31:03 2012 (r235774) +++ head/sys/modules/bwi/Makefile Tue May 22 06:33:08 2012 (r235775) @@ -5,7 +5,7 @@ KMOD = if_bwi SRCS = if_bwi.c if_bwi_pci.c bwimac.c bwiphy.c bwirf.c -SRCS += device_if.h bus_if.h pci_if.h opt_inet.h opt_bwi.h +SRCS += device_if.h bus_if.h pci_if.h opt_inet.h opt_bwi.h opt_wlan.h opt_bwi.h: echo '#define BWI_DEBUG 1' > opt_bwi.h From owner-svn-src-all@FreeBSD.ORG Tue May 22 06:48:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A578106566C; Tue, 22 May 2012 06:48:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by mx1.freebsd.org (Postfix) with ESMTP id C7CC98FC12; Tue, 22 May 2012 06:48:18 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4M6m81e004473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 May 2012 16:48:10 +1000 Date: Tue, 22 May 2012 16:48:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Guy Helmer In-Reply-To: <201205212104.q4LL4UDN072617@svn.freebsd.org> Message-ID: <20120522163814.T1056@besplex.bde.org> References: <201205212104.q4LL4UDN072617@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235739 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 06:48:19 -0000 On Mon, 21 May 2012, Guy Helmer wrote: > Log: > Apply style(9) to return and switch/case statements. > > Reviewed by: delphij (prior version of the patch) > > Modified: > head/lib/libc/gen/getnetgrent.c > > Modified: head/lib/libc/gen/getnetgrent.c > ============================================================================== > --- head/lib/libc/gen/getnetgrent.c Mon May 21 19:58:40 2012 (r235738) > +++ head/lib/libc/gen/getnetgrent.c Mon May 21 21:04:29 2012 (r235739) > ... > @@ -311,32 +311,35 @@ _revnetgr_lookup(char* lookupdom, char* > > for (rot = 0; ; rot++) { > switch (rot) { > - case(0): snprintf(key, MAXHOSTNAMELEN, "%s.%s", > - str, dom?dom:lookupdom); > - break; > - case(1): snprintf(key, MAXHOSTNAMELEN, "%s.*", > - str); > - break; > - case(2): snprintf(key, MAXHOSTNAMELEN, "*.%s", > - dom?dom:lookupdom); > - break; > - case(3): snprintf(key, MAXHOSTNAMELEN, "*.*"); > - break; > - default: return(0); > + case(0): > + snprintf(key, MAXHOSTNAMELEN, "%s.%s", str, > + dom ? dom : lookupdom); > + break; > + case(1): > + snprintf(key, MAXHOSTNAMELEN, "%s.*", str); > + break; > + case(2): > + snprintf(key, MAXHOSTNAMELEN, "*.%s", > + dom ? dom : lookupdom); > + break; > + case(3): > + snprintf(key, MAXHOSTNAMELEN, "*.*"); > + break; Thanks, but a fuller application would have removed the obfuscatory parentheses that make case() look like a function call... > + default: return (0); ... and split the case statements after ":" in all cases. > } > y = yp_match(lookupdom, map, key, strlen(key), &result, > &resultlen); You fixed the continuation indentation in the case statement but not here. > if (y == 0) { > rv = _listmatch(result, group, resultlen); > free(result); > - if (rv) return(1); > + if (rv) return (1); Another statement not started on a new line. > } else if (y != YPERR_KEY) { > /* > * If we get an error other than 'no > * such key in map' then something is > * wrong and we should stop the search. > */ > - return(-1); > + return (-1); > } > } > } These style bugs weren't in the CSRG version of course. The YP code added many. The most obvious ones are the case(n) and gnu-style continuation indentation. Bruce From owner-svn-src-all@FreeBSD.ORG Tue May 22 07:04:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA112106564A; Tue, 22 May 2012 07:04:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B507D8FC0A; Tue, 22 May 2012 07:04:23 +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 q4M74Nc0091185; Tue, 22 May 2012 07:04:23 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M74NM6091183; Tue, 22 May 2012 07:04:23 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201205220704.q4M74NM6091183@svn.freebsd.org> From: Andrew Turner Date: Tue, 22 May 2012 07:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235776 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 07:04:23 -0000 Author: andrew Date: Tue May 22 07:04:23 2012 New Revision: 235776 URL: http://svn.freebsd.org/changeset/base/235776 Log: Fix booting on ARM. In PHYS_TO_VM_PAGE() when VM_PHYSSEG_DENSE is set the check if we are past the end of vm_page_array was incorrect causing it to return NULL. This value is then used in vm_phys_add_page causing a data abort. Reviewed by: alc, kib, imp Tested by: stas Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue May 22 06:33:08 2012 (r235775) +++ head/sys/vm/vm_page.c Tue May 22 07:04:23 2012 (r235776) @@ -647,7 +647,7 @@ PHYS_TO_VM_PAGE(vm_paddr_t pa) long pi; pi = atop(pa); - if (pi >= first_page && pi < vm_page_array_size) { + if (pi >= first_page && (pi - first_page) < vm_page_array_size) { m = &vm_page_array[pi - first_page]; return (m); } From owner-svn-src-all@FreeBSD.ORG Tue May 22 07:23:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C6131065674; Tue, 22 May 2012 07:23:42 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 881E78FC19; Tue, 22 May 2012 07: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 q4M7NgKu091717; Tue, 22 May 2012 07:23:42 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M7Ng2I091715; Tue, 22 May 2012 07:23:42 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <201205220723.q4M7Ng2I091715@svn.freebsd.org> From: Hartmut Brandt Date: Tue, 22 May 2012 07:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235777 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 07:23:42 -0000 Author: harti Date: Tue May 22 07:23:41 2012 New Revision: 235777 URL: http://svn.freebsd.org/changeset/base/235777 Log: Make dumptid non-static. It is used by libkvm to detect whether this is a VNET-kernel or not. gcc used to put the static symbol into the symbol table, clang does not. This fixes the 'netstat: no namelist' error seen on clang+VNET systems. Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue May 22 07:04:23 2012 (r235776) +++ head/sys/kern/kern_shutdown.c Tue May 22 07:23:41 2012 (r235777) @@ -151,7 +151,7 @@ static struct dumperinfo dumper; /* our /* Context information for dump-debuggers. */ static struct pcb dumppcb; /* Registers. */ -static lwpid_t dumptid; /* Thread ID. */ +lwpid_t dumptid; /* Thread ID. */ static void poweroff_wait(void *, int); static void shutdown_halt(void *junk, int howto); From owner-svn-src-all@FreeBSD.ORG Tue May 22 08:33:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90C231065672; Tue, 22 May 2012 08:33:15 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 789D58FC12; Tue, 22 May 2012 08:33: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 q4M8XFCI093460; Tue, 22 May 2012 08:33:15 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M8XFLM093453; Tue, 22 May 2012 08:33:15 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205220833.q4M8XFLM093453@svn.freebsd.org> From: Grzegorz Bernacki Date: Tue, 22 May 2012 08:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235778 - in head/sys: boot/fdt/dts conf dev/fdt geom sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 08:33:15 -0000 Author: gber Date: Tue May 22 08:33:14 2012 New Revision: 235778 URL: http://svn.freebsd.org/changeset/base/235778 Log: Add a new geom class which allows to divide NAND Flash chip into partitions. Partitions are created based on data in dts file which are extracted and interpreted by slicer. Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks Added: head/sys/dev/fdt/fdt_slicer.c (contents, props changed) head/sys/geom/geom_flashmap.c (contents, props changed) head/sys/sys/slicer.h (contents, props changed) Modified: head/sys/boot/fdt/dts/sheevaplug.dts head/sys/conf/files head/sys/dev/fdt/fdt_common.h Modified: head/sys/boot/fdt/dts/sheevaplug.dts ============================================================================== --- head/sys/boot/fdt/dts/sheevaplug.dts Tue May 22 07:23:41 2012 (r235777) +++ head/sys/boot/fdt/dts/sheevaplug.dts Tue May 22 08:33:14 2012 (r235778) @@ -88,7 +88,16 @@ bank-width = <2>; device-width = <1>; + slice@0 { + reg = <0x0 0x200000>; + label = "u-boot"; + read-only; + }; + slice@200000 { + reg = <0x200000 0x1fe00000>; + label = "root"; + }; }; }; Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 22 07:23:41 2012 (r235777) +++ head/sys/conf/files Tue May 22 08:33:14 2012 (r235778) @@ -1223,6 +1223,7 @@ dev/fatm/if_fatm.c optional fatm pci dev/fb/splash.c optional splash dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_pci.c optional fdt pci +dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static dev/fdt/fdtbus.c optional fdt dev/fdt/simplebus.c optional fdt @@ -2388,6 +2389,7 @@ geom/geom_disk.c standard geom/geom_dump.c standard geom/geom_event.c standard geom/geom_fox.c optional geom_fox +geom/geom_flashmap.c optional fdt cfi | fdt nand geom/geom_io.c standard geom/geom_kern.c standard geom/geom_map.c optional geom_map Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Tue May 22 07:23:41 2012 (r235777) +++ head/sys/dev/fdt/fdt_common.h Tue May 22 08:33:14 2012 (r235778) @@ -32,6 +32,7 @@ #ifndef _FDT_COMMON_H_ #define _FDT_COMMON_H_ +#include #include #include #include Added: head/sys/dev/fdt/fdt_slicer.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/fdt/fdt_slicer.c Tue May 22 08:33:14 2012 (r235778) @@ -0,0 +1,115 @@ +/*- + * Copyright (c) 2012 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +#define DEBUG +#undef DEBUG + +#ifdef DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif + +int +flash_fill_slices(device_t dev, struct flash_slice *slices, int *slices_num) +{ + char *slice_name; + phandle_t dt_node, dt_child; + u_long base, size; + int i; + ssize_t name_len; + + /* + * We assume the caller provides buffer for FLASH_SLICES_MAX_NUM + * flash_slice structures. + */ + if (slices == NULL) { + *slices_num = 0; + return (ENOMEM); + } + + dt_node = ofw_bus_get_node(dev); + for (dt_child = OF_child(dt_node), i = 0; dt_child != 0; + dt_child = OF_peer(dt_child)) { + + if (i == FLASH_SLICES_MAX_NUM) { + debugf("not enough buffer for slice i=%d\n", i); + break; + } + + /* + * Retrieve start and size of the slice. + */ + if (fdt_regsize(dt_child, &base, &size) != 0) { + debugf("error during processing reg property, i=%d\n", + i); + continue; + } + + if (size == 0) { + debugf("slice i=%d with no size\n", i); + continue; + } + + /* + * Retrieve label. + */ + name_len = OF_getprop_alloc(dt_child, "label", sizeof(char), + (void **)&slice_name); + if (name_len <= 0) { + /* Use node name if no label defined */ + name_len = OF_getprop_alloc(dt_child, "name", sizeof(char), + (void **)&slice_name); + if (name_len <= 0) { + debugf("slice i=%d with no name\n", i); + slice_name = NULL; + } + } + + /* + * Fill slice entry data. + */ + slices[i].base = base; + slices[i].size = size; + slices[i].label = slice_name; + i++; + } + + *slices_num = i; + return (0); +} Added: head/sys/geom/geom_flashmap.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/geom_flashmap.c Tue May 22 08:33:14 2012 (r235778) @@ -0,0 +1,255 @@ +/*- + * Copyright (c) 2012 Semihalf + * Copyright (c) 2009 Jakub Klama + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define FLASHMAP_CLASS_NAME "Flashmap" + +struct g_flashmap_slice { + off_t sl_start; + off_t sl_end; + const char *sl_name; + + STAILQ_ENTRY(g_flashmap_slice) sl_link; +}; + +STAILQ_HEAD(g_flashmap_head, g_flashmap_slice); + +static void g_flashmap_print(struct g_flashmap_slice *); +static int g_flashmap_modify(struct g_geom *, const char *, + int, struct g_flashmap_head *); +static int g_flashmap_start(struct bio *); +static int g_flashmap_ioctl(struct g_provider *, u_long, void *, + int, struct thread *); +static void g_flashmap_dumpconf(struct sbuf *, const char *, + struct g_geom *, struct g_consumer *, struct g_provider *); +static struct g_geom *g_flashmap_taste(struct g_class *, + struct g_provider *, int); +static void g_flashmap_config(struct gctl_req *, struct g_class *, + const char *); +static int g_flashmap_load(device_t, struct g_flashmap_head *); + +MALLOC_DECLARE(M_FLASHMAP); +MALLOC_DEFINE(M_FLASHMAP, "geom_flashmap", "GEOM flash memory slicer class"); + +static void +g_flashmap_print(struct g_flashmap_slice *slice) +{ + + printf("%08llx-%08llx: %s (%lluKB)\n", slice->sl_start, slice->sl_end, + slice->sl_name, (slice->sl_end - slice->sl_start) / 1024); +} + +static int +g_flashmap_modify(struct g_geom *gp, const char *devname, int secsize, + struct g_flashmap_head *slices) +{ + struct g_flashmap_slice *slice; + int i, error; + + g_topology_assert(); + + i = 0; + STAILQ_FOREACH(slice, slices, sl_link) { + if (bootverbose) { + printf("%s: slice ", devname); + g_flashmap_print(slice); + } + + error = g_slice_config(gp, i++, G_SLICE_CONFIG_CHECK, + slice->sl_start, + slice->sl_end - slice->sl_start + 1, + secsize, "%ss.%s", gp->name, slice->sl_name); + + if (error) + return (error); + } + + i = 0; + STAILQ_FOREACH(slice, slices, sl_link) { + error = g_slice_config(gp, i++, G_SLICE_CONFIG_SET, + slice->sl_start, + slice->sl_end - slice->sl_start + 1, + secsize, "%ss.%s", gp->name, slice->sl_name); + + if (error) + return (error); + } + + return (0); +} + +static int +g_flashmap_start(struct bio *bp) +{ + + return (0); +} + +static void +g_flashmap_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, + struct g_consumer *cp __unused, struct g_provider *pp) +{ + struct g_slicer *gsp; + + gsp = gp->softc; + g_slice_dumpconf(sb, indent, gp, cp, pp); +} + +static int +g_flashmap_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, + struct thread *td) +{ + struct g_consumer *cp; + struct g_geom *gp; + + if (cmd != NAND_IO_GET_CHIP_PARAM) + return (ENOIOCTL); + + cp = LIST_FIRST(&pp->geom->consumer); + if (cp == NULL) + return (ENOIOCTL); + gp = cp->provider->geom; + if (gp->ioctl == NULL) + return (ENOIOCTL); + + return (gp->ioctl(cp->provider, cmd, data, fflag, td)); +} + + +static struct g_geom * +g_flashmap_taste(struct g_class *mp, struct g_provider *pp, int flags) +{ + struct g_geom *gp = NULL; + struct g_consumer *cp; + struct g_flashmap_head head; + struct g_flashmap_slice *slice, *slice_temp; + device_t dev; + int nslices, size; + + g_trace(G_T_TOPOLOGY, "flashmap_taste(%s,%s)", mp->name, pp->name); + g_topology_assert(); + + if (flags == G_TF_NORMAL && + !strcmp(pp->geom->class->name, FLASHMAP_CLASS_NAME)) + return (NULL); + + gp = g_slice_new(mp, FLASH_SLICES_MAX_NUM, pp, &cp, NULL, 0, + g_flashmap_start); + if (gp == NULL) + return (NULL); + + STAILQ_INIT(&head); + + do { + size = sizeof(device_t); + if (g_io_getattr("NAND::device", cp, &size, &dev)) + break; + + nslices = g_flashmap_load(dev, &head); + if (nslices == 0) + break; + + g_flashmap_modify(gp, cp->provider->name, + cp->provider->sectorsize, &head); + } while (0); + + g_access(cp, -1, 0, 0); + + STAILQ_FOREACH_SAFE(slice, &head, sl_link, slice_temp) { + free(slice, M_FLASHMAP); + } + + if (LIST_EMPTY(&gp->provider)) { + g_slice_spoiled(cp); + return (NULL); + } + return (gp); +} + +static void +g_flashmap_config(struct gctl_req *req, struct g_class *mp, const char *verb) +{ + + gctl_error(req, "unknown config verb"); +} + +static int +g_flashmap_load(device_t dev, struct g_flashmap_head *head) +{ + struct flash_slice *slices; + struct g_flashmap_slice *slice; + uint32_t i, buf_size; + int nslices = 0; + + buf_size = sizeof(struct flash_slice) * FLASH_SLICES_MAX_NUM; + slices = malloc(buf_size, M_FLASHMAP, M_WAITOK | M_ZERO); + if (flash_fill_slices(dev, slices, &nslices) == 0) { + for (i = 0; i < nslices; i++) { + slice = malloc(sizeof(struct g_flashmap_slice), + M_FLASHMAP, M_WAITOK); + + slice->sl_name = slices[i].label; + slice->sl_start = slices[i].base; + slice->sl_end = slices[i].base + slices[i].size - 1; + + STAILQ_INSERT_TAIL(head, slice, sl_link); + } + } + + free(slices, M_FLASHMAP); + return (nslices); +} + +static struct g_class g_flashmap_class = { + .name = FLASHMAP_CLASS_NAME, + .version = G_VERSION, + .taste = g_flashmap_taste, + .dumpconf = g_flashmap_dumpconf, + .ioctl = g_flashmap_ioctl, + .ctlreq = g_flashmap_config, +}; + +DECLARE_GEOM_CLASS(g_flashmap_class, g_flashmap); Added: head/sys/sys/slicer.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/slicer.h Tue May 22 08:33:14 2012 (r235778) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2012 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _FLASH_SLICER_H_ +#define _FLASH_SLICER_H_ + +#include + +#define FLASH_SLICES_MAX_NUM 8 +#define FLASH_SLICES_MAX_NAME_LEN (32 + 1) + +#define FLASH_SLICES_FLAG_NONE 0 +#define FLASH_SLICES_FLAG_RO 1 /* Read only */ + +struct flash_slice { + off_t base; + off_t size; + char *label; + unsigned int flags; +}; + +#ifdef _KERNEL +int flash_fill_slices(device_t, struct flash_slice *, int *); +#endif /* _KERNEL */ + +#endif /* _FLASH_SLICER_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue May 22 09:27:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 124271065673; Tue, 22 May 2012 09:27:58 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F23FF8FC16; Tue, 22 May 2012 09:27: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 q4M9Rvfh094766; Tue, 22 May 2012 09:27:57 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M9RvOc094764; Tue, 22 May 2012 09:27:57 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205220927.q4M9RvOc094764@svn.freebsd.org> From: Grzegorz Bernacki Date: Tue, 22 May 2012 09:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235779 - head/sys/boot/fdt/dts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 09:27:58 -0000 Author: gber Date: Tue May 22 09:27:57 2012 New Revision: 235779 URL: http://svn.freebsd.org/changeset/base/235779 Log: Divide nand flash for DB6281 into two partitions. One for u-boot and second one for general use. Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks Modified: head/sys/boot/fdt/dts/db88f6281.dts Modified: head/sys/boot/fdt/dts/db88f6281.dts ============================================================================== --- head/sys/boot/fdt/dts/db88f6281.dts Tue May 22 08:33:14 2012 (r235778) +++ head/sys/boot/fdt/dts/db88f6281.dts Tue May 22 09:27:57 2012 (r235779) @@ -89,7 +89,16 @@ bank-width = <2>; device-width = <1>; + slice@0 { + reg = <0x0 0x200000>; + label = "u-boot"; + read-only; + }; + slice@200000 { + reg = <0x200000 0x7e00000>; + label = "root"; + }; }; }; From owner-svn-src-all@FreeBSD.ORG Tue May 22 09:59:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 724A8106566C; Tue, 22 May 2012 09:59:50 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D7C88FC0C; Tue, 22 May 2012 09:59: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 q4M9xoke095554; Tue, 22 May 2012 09:59:50 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M9xoB2095552; Tue, 22 May 2012 09:59:50 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <201205220959.q4M9xoB2095552@svn.freebsd.org> From: Hartmut Brandt Date: Tue, 22 May 2012 09:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235780 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 09:59:50 -0000 Author: harti Date: Tue May 22 09:59:49 2012 New Revision: 235780 URL: http://svn.freebsd.org/changeset/base/235780 Log: Fix a compilation error with some compilers: __attribute__ requires two parenthesis for its argument, but instead of using __attribute__ directly, use the appropriate __nonnull macro from cdefs.h. Modified: head/include/malloc_np.h Modified: head/include/malloc_np.h ============================================================================== --- head/include/malloc_np.h Tue May 22 09:27:57 2012 (r235779) +++ head/include/malloc_np.h Tue May 22 09:59:49 2012 (r235780) @@ -55,13 +55,11 @@ int mallctlbymib(const size_t *mib, size #define ALLOCM_ERR_OOM 1 #define ALLOCM_ERR_NOT_MOVED 2 -int allocm(void **ptr, size_t *rsize, size_t size, int flags) - __attribute__(nonnull(1)); +int allocm(void **ptr, size_t *rsize, size_t size, int flags) __nonnull(1); int rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, - int flags) __attribute__(nonnull(1)); -int sallocm(const void *ptr, size_t *rsize, int flags) - __attribute__(nonnull(1)); -int dallocm(void *ptr, int flags) __attribute__(nonnull(1)); + int flags) __nonnull(1); +int sallocm(const void *ptr, size_t *rsize, int flags) __nonnull(1); +int dallocm(void *ptr, int flags) __nonnull(1); int nallocm(size_t *rsize, size_t size, int flags); __END_DECLS From owner-svn-src-all@FreeBSD.ORG Tue May 22 10:22:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12870106566C; Tue, 22 May 2012 10:22:56 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 9928F8FC12; Tue, 22 May 2012 10:22:55 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 009D86AB9; Tue, 22 May 2012 10:22:54 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 9A4869239; Tue, 22 May 2012 12:22:54 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Baptiste Daroussin References: <201205211331.q4LDVRvB060077@svn.freebsd.org> Date: Tue, 22 May 2012 12:22:54 +0200 In-Reply-To: <201205211331.q4LDVRvB060077@svn.freebsd.org> (Baptiste Daroussin's message of "Mon, 21 May 2012 13:31:27 +0000 (UTC)") Message-ID: <86likkpla9.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 10:22:56 -0000 Baptiste Daroussin writes: > Log: > Import byacc from invisible island, it brings us lots of compatibilitie= s with > bison, keeping full compatibility with our previous yacc > implementation. This commit broke the build, in large part because Baptiste tested with Clang instead of GCC, and GCC generates a warning when compiling the generated code. Baptiste has a patch ready to commit, currently undergoing review by myself and other interested parties. I chose not to ask Baptiste to revert the commit, because it is a complex commit that copies some files from a vendor branch into contrib and removes others from the usr.bin/yacc, and I wasn't sure that reverting it wouldn't cause trouble with merge tracking. Lessons learned: 1) always test a *stock* build before committing: % cd /usr/src && env __MAKE_CONF=3D/dev/null make buildworld 2) the contrib part and the usr.bin part should probably have been committed separately. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue May 22 10:51:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EAD5106566C; Tue, 22 May 2012 10:51:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id E2C088FC14; Tue, 22 May 2012 10:51:53 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4MApiUd012829 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 May 2012 20:51:45 +1000 Date: Tue, 22 May 2012 20:51:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper In-Reply-To: Message-ID: <20120522183847.M1344@besplex.bde.org> References: <201205220128.q4M1SXPv081576@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-2035810234-1337683904=:1344" Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235767 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 10:51:54 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-2035810234-1337683904=:1344 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 21 May 2012, Garrett Cooper wrote: > On Mon, May 21, 2012 at 6:28 PM, Kevin Lo wrote: >> Author: kevlo >> Date: Tue May 22 01:28:32 2012 >> New Revision: 235767 >> URL: http://svn.freebsd.org/changeset/base/235767 >> >> Log: >> =A0Add missing header needed by free() >> >> =A0Reported by: =A0tinderbox Please don't use binary characters in mail. > Thank you for saving my mailbox :)!!! > > FWIW, it's weird because my STABLE-9 box didn't reproduce this. This seems to be a bug in both nsparser.y and the new yacc: - new yacc: it is incompatible. Old yacc includes stdlib.h and string.h as the first thing in the generated file, so the C code copied from the .y part sees them too. New yacc puts more its code including its all includes (which still involve stdlib.h) at the end of the generated file. Including stdlib.h nearly first is from Lite2 (skeleton.c 1.7 in 1997). Much later, FreeBSD moved it to the very first thing in the generated file, so as to use namespace pollution (__unused) from it early. __unused was ifdefed and was defined by the yacc skeleton if didn't define it. It took much churn to produce this, but it seems to have been garbage, since old yacc didn't actually generate any use of __unused. The definition was apparently compatibilty cruft to hide unportabilities in .y files that use __unused (I guess these failed for bootstrapping). New yacc doesn't define __unused. - nsparser.y: it uses free() but never declared it. It depended on namespace pollution in the yacc code, and this pollution being in a particular order. The yyparse() incompatibilities seem to be bugs on both sides too: - Old yacc didn't declare yyparse() automatically, so .y files had to do it, but probably shouldn't have. - New yacc still doesn't declare yylex() or yyerror() automatically, so applications still have to declare them. - Some of these may be more the responsibility of the yacc library (to supply defaults) than others. I couldn't see who is required to declare them in POSIX.1-2001. However, a bad example in POSIX.1 has "extern int yyparse();" in main() just before calling yyparse(). Badness in this example include several style bugs and the declaration being incomplete (missing "void"). Old yacc has about 20 lines of ifdefs half just to supply this "void" for STDC but not for K&R. New yacc no longer supports K&R, at least here, but it still has 11 lines of ifdefs to get the declaration of yyparse() right for bison compatibility). I don't know if the badness includes having the home made declaration. Nearby bugs: all CSRG and FreeBSD changes including copyrights and history seem to have been lost. Just after the old include of stdlib.h, skeleton.c used to produce a string yyrcsid[] with __FBSDID() for skeleton.c itself in it. New yacc generates a string yysccsid with a hard-coded berkeley 1993 id in it, and the name in this id doesn't even match the file name (it is "yaccpar"). Another FreeBSD change was to remove this bogus id from the generated file. Some relevant FreeBSD changes: % Index: skeleton.c % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D % RCS file: /home/ncvs/src/usr.bin/yacc/skeleton.c,v % retrieving revision 1.1.1.2 % retrieving revision 1.37 % diff -u -2 -r1.1.1.2 -r1.37 % --- skeleton.c=096 Jan 1997 03:03:46 -0000=091.1.1.2 % +++ skeleton.c=0912 Feb 2003 18:03:55 -0000=091.37 % @@ -35,7 +35,12 @@ % */ %=20 % +#if 0 % #ifndef lint % static char sccsid[] =3D "@(#)skeleton.c=095.8 (Berkeley) 4/29/95"; % -#endif /* not lint */ % +#endif % +#endif FreeBSD normally comments out vendor ids like this. 5.8 is from Lite2; Lite1 had 5.7. New yacc doesn't have any of this. It apparently started from older yacc (before Lite1; indeed, it agrees with the FreeBSD-1 =3D=3D = Net/2 version in not having any CSRG copyrights or this sccsid). % + % +#include % +__FBSDID("$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.37 2003/02/12 18:03:= 55 davidc Exp $"); FreeBSD normally adds this to source files. Except in contrib. yacc is now mostly in contrib, although it hasn't changed all that much. %=20 % #include "defs.h" % @@ -53,31 +58,42 @@ % /* are conditional.=09=09=09=09=09=09=09*/ %=20 % -char *banner[] =3D % +const char *banner[] =3D New yacc has this change too. % { % + "#include ", See above. % "#ifndef lint", % - "static char yysccsid[] =3D \"@(#)yaccpar=091.9 (Berkeley) 02/21/93\= ";", Was in Net/2 (?), FreeBSD-1, Lite1 and Lite2. Came back with new yacc. It's interesting that "yaccpar 1.9 (Berkeley) 1.9 02/21/93" is only 3 month= s before the correct id "skeleton.c 5.7 (Berkeley) 5/24/93". Hmm, the FreeBSD-1 history is even more instructive than I first thought. FreeBSD-1 started with the CSRG version of skeleton.c on 1993/06/12. This had CSRG copyrights and ids, and yaccpar was at 1.8 01/20/90. But this was upgraded to "the newest version on vangogh.cs.berkeley.edu" 17 days later on 1993/06/29. This version has no CSRG copyrights or ids, except for the above rotted one for yaccpar (the 1.9 02/21/93 one). I think it was only missing CSRG copyrights and ids because CSRG only added these to full releases. This resulted in the version in FreeBSD-1 not having any copyright notices inside most files, and none for the directory either. The new byacc seems to be the same as the older yacc here too. % + "#ifdef __unused", % + "__unused", % + "#endif", % + "static char const ", % + "yyrcsid[] =3D \"$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.37 2003/0= 2/12 18:03:55 davidc Exp $\";", % "#endif", % - "#include ", See above. % "#define YYBYACC 1", % "#define YYMAJOR 1", % "#define YYMINOR 9", % - "#define yyclearin (yychar=3D(-1))", % + "#define YYLEX yylex()", % + "#define YYEMPTY -1", % + "#define yyclearin (yychar=3D(YYEMPTY))", % "#define yyerrok (yyerrflag=3D0)", % - "#define YYRECOVERING (yyerrflag!=3D0)", % + "#define YYRECOVERING() (yyerrflag!=3D0)", % + "#if defined(__cplusplus) || __STDC__", % + "static int yygrowstack(void);", % + "#else", % + "static int yygrowstack();", % + "#endif", % 0 % }; Hrmph. It was FreeBSD that added the STDC ifdefs, to avoid breaking support for generating K&R code (older yacc generated fairly pure K&R code without even "const"). For yygrowstack(), this was sloppy: it only changed the declaration -- the function body still doesn't say "void". % @@ -151,13 +174,35 @@ % "#define YYACCEPT goto yyaccept", % "#define YYERROR goto yyerrlab", % + "", % + "#ifndef YYPARSE_PARAM", % + "#if defined(__cplusplus) || __STDC__", % + "#define YYPARSE_PARAM_ARG void", % + "#define YYPARSE_PARAM_DECL", % + "#else=09/* ! ANSI-C/C++ */", % + "#define YYPARSE_PARAM_ARG", % + "#define YYPARSE_PARAM_DECL", % + "#endif=09/* ANSI-C/C++ */", % + "#else=09/* YYPARSE_PARAM */", % + "#ifndef YYPARSE_PARAM_TYPE", % + "#define YYPARSE_PARAM_TYPE void *", % + "#endif", % + "#if defined(__cplusplus) || __STDC__", % + "#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM", % + "#define YYPARSE_PARAM_DECL", % + "#else=09/* ! ANSI-C/C++ */", % + "#define YYPARSE_PARAM_ARG YYPARSE_PARAM", % + "#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;", % + "#endif=09/* ANSI-C/C++ */", % + "#endif=09/* ! YYPARSE_PARAM */", % + "", % "int", % - "yyparse()", % + "yyparse (YYPARSE_PARAM_ARG)", % + " YYPARSE_PARAM_DECL", % "{", % - " register int yym, yyn, yystate;", % + " int yym, yyn, yystate;", % "#if YYDEBUG", % - " register char *yys;", % - " extern char *getenv();", % + " const char *yys;", % "", % - " if (yys =3D getenv(\"YYDEBUG\"))", % + " if ((yys =3D getenv(\"YYDEBUG\")))", % " {", % " yyn =3D *yys;", The STDC support was especially messy for yyparse(). Bruce --0-2035810234-1337683904=:1344-- From owner-svn-src-all@FreeBSD.ORG Tue May 22 10:54:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F421C106564A; Tue, 22 May 2012 10:54:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE7668FC08; Tue, 22 May 2012 10:54: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 q4MAsgNx099494; Tue, 22 May 2012 10:54:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MAsgsm099492; Tue, 22 May 2012 10:54:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205221054.q4MAsgsm099492@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 22 May 2012 10:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235781 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 10:54:43 -0000 Author: trasz Date: Tue May 22 10:54:42 2012 New Revision: 235781 URL: http://svn.freebsd.org/changeset/base/235781 Log: Fix enforcement of file size limit with O_APPEND on ZFS. vn_rlimit_fsize takes uio->uio_offset and uio->uio_resid into account when determining whether given write would exceed RLIMIT_FSIZE. When APPEND flag is specified, ZFS updates uio->uio_offset to point to the end of file. But this happens after a call to vn_rlimit_fsize, so vn_rlimit_fsize check can be rendered ineffective by thread that opens some file with O_APPEND and lseeks below RLIMIT_FSIZE before calling write. Submitted by: Mateusz Guzik MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 22 09:59:49 2012 (r235780) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 22 10:54:42 2012 (r235781) @@ -838,6 +838,12 @@ zfs_write(vnode_t *vp, uio_t *uio, int i rl = zfs_range_lock(zp, woff, n, RL_WRITER); } + if (vn_rlimit_fsize(vp, uio, uio->uio_td)) { + zfs_range_unlock(rl); + ZFS_EXIT(zfsvfs); + return (EFBIG); + } + if (woff >= limit) { zfs_range_unlock(rl); ZFS_EXIT(zfsvfs); @@ -5696,9 +5702,6 @@ zfs_freebsd_write(ap) } */ *ap; { - if (vn_rlimit_fsize(ap->a_vp, ap->a_uio, ap->a_uio->uio_td)) - return (EFBIG); - return (zfs_write(ap->a_vp, ap->a_uio, ioflags(ap->a_ioflag), ap->a_cred, NULL)); } From owner-svn-src-all@FreeBSD.ORG Tue May 22 10:59:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27174106566B; Tue, 22 May 2012 10:59:27 +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 0EADB8FC16; Tue, 22 May 2012 10:59:27 +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 q4MAxRpd099646; Tue, 22 May 2012 10:59:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MAxQRM099642; Tue, 22 May 2012 10:59:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205221059.q4MAxQRM099642@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 May 2012 10:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235782 - in head/sys: dev/agp modules/agp sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 10:59:27 -0000 Author: kib Date: Tue May 22 10:59:26 2012 New Revision: 235782 URL: http://svn.freebsd.org/changeset/base/235782 Log: A rewrite of the i810 bits of the agp(4) driver. New driver supports operations required by GEMified i915.ko. It also attaches to SandyBridge and IvyBridge CPU northbridges now. Sponsored by: The FreeBSD Foundation MFC after: 1 month Added: head/sys/dev/agp/agp_i810.h (contents, props changed) Modified: head/sys/dev/agp/agp.c head/sys/dev/agp/agp_i810.c head/sys/dev/agp/agp_if.m head/sys/dev/agp/agppriv.h head/sys/dev/agp/agpreg.h head/sys/dev/agp/agpvar.h head/sys/modules/agp/Makefile head/sys/sys/agpio.h Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Tue May 22 10:54:42 2012 (r235781) +++ head/sys/dev/agp/agp.c Tue May 22 10:59:26 2012 (r235782) @@ -239,7 +239,8 @@ agp_generic_attach(device_t dev) if (memsize <= agp_max[i][0]) break; } - if (i == agp_max_size) i = agp_max_size - 1; + if (i == agp_max_size) + i = agp_max_size - 1; sc->as_maxmem = agp_max[i][1] << 20U; /* @@ -803,6 +804,13 @@ agp_unbind_user(device_t dev, agp_unbind } static int +agp_chipset_flush(device_t dev) +{ + + return (AGP_CHIPSET_FLUSH(dev)); +} + +static int agp_open(struct cdev *kdev, int oflags, int devtype, struct thread *td) { device_t dev = kdev->si_drv1; @@ -869,6 +877,8 @@ agp_ioctl(struct cdev *kdev, u_long cmd, case AGPIOC_UNBIND: return agp_unbind_user(dev, (agp_unbind *)data); + case AGPIOC_CHIPSET_FLUSH: + return agp_chipset_flush(dev); } return EINVAL; Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Tue May 22 10:54:42 2012 (r235781) +++ head/sys/dev/agp/agp_i810.c Tue May 22 10:59:26 2012 (r235782) @@ -1,8 +1,12 @@ /*- * Copyright (c) 2000 Doug Rabson * Copyright (c) 2000 Ruslan Ermilov + * Copyright (c) 2011 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -28,6 +32,9 @@ /* * Fixes for 830/845G support: David Dawes * 852GM/855GM/865G support added by David Dawes + * + * This is generic Intel GTT handling code, morphed from the AGP + * bridge code. */ #include @@ -35,10 +42,17 @@ __FBSDID("$FreeBSD$"); #include "opt_bus.h" +#if 0 +#define KTR_AGP_I810 KTR_DEV +#else +#define KTR_AGP_I810 0 +#endif + #include #include #include #include +#include #include #include #include @@ -47,8 +61,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include #include @@ -63,6 +79,88 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_AGP); +struct agp_i810_match; + +static int agp_i810_check_active(device_t bridge_dev); +static int agp_i830_check_active(device_t bridge_dev); +static int agp_i915_check_active(device_t bridge_dev); +static int agp_sb_check_active(device_t bridge_dev); + +static void agp_82852_set_desc(device_t dev, + const struct agp_i810_match *match); +static void agp_i810_set_desc(device_t dev, const struct agp_i810_match *match); + +static void agp_i810_dump_regs(device_t dev); +static void agp_i830_dump_regs(device_t dev); +static void agp_i855_dump_regs(device_t dev); +static void agp_i915_dump_regs(device_t dev); +static void agp_i965_dump_regs(device_t dev); +static void agp_sb_dump_regs(device_t dev); + +static int agp_i810_get_stolen_size(device_t dev); +static int agp_i830_get_stolen_size(device_t dev); +static int agp_i915_get_stolen_size(device_t dev); +static int agp_sb_get_stolen_size(device_t dev); + +static int agp_i810_get_gtt_mappable_entries(device_t dev); +static int agp_i830_get_gtt_mappable_entries(device_t dev); +static int agp_i915_get_gtt_mappable_entries(device_t dev); + +static int agp_i810_get_gtt_total_entries(device_t dev); +static int agp_i965_get_gtt_total_entries(device_t dev); +static int agp_gen5_get_gtt_total_entries(device_t dev); +static int agp_sb_get_gtt_total_entries(device_t dev); + +static int agp_i810_install_gatt(device_t dev); +static int agp_i830_install_gatt(device_t dev); + +static void agp_i810_deinstall_gatt(device_t dev); +static void agp_i830_deinstall_gatt(device_t dev); + +static void agp_i810_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); +static void agp_i830_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); +static void agp_i915_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); +static void agp_i965_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); +static void agp_g4x_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); +static void agp_sb_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); + +static void agp_i810_write_gtt(device_t dev, u_int index, uint32_t pte); +static void agp_i915_write_gtt(device_t dev, u_int index, uint32_t pte); +static void agp_i965_write_gtt(device_t dev, u_int index, uint32_t pte); +static void agp_g4x_write_gtt(device_t dev, u_int index, uint32_t pte); +static void agp_sb_write_gtt(device_t dev, u_int index, uint32_t pte); + +static u_int32_t agp_i810_read_gtt_pte(device_t dev, u_int index); +static u_int32_t agp_i915_read_gtt_pte(device_t dev, u_int index); +static u_int32_t agp_i965_read_gtt_pte(device_t dev, u_int index); +static u_int32_t agp_g4x_read_gtt_pte(device_t dev, u_int index); + +static vm_paddr_t agp_i810_read_gtt_pte_paddr(device_t dev, u_int index); +static vm_paddr_t agp_i915_read_gtt_pte_paddr(device_t dev, u_int index); +static vm_paddr_t agp_sb_read_gtt_pte_paddr(device_t dev, u_int index); + +static int agp_i810_set_aperture(device_t dev, u_int32_t aperture); +static int agp_i830_set_aperture(device_t dev, u_int32_t aperture); +static int agp_i915_set_aperture(device_t dev, u_int32_t aperture); + +static int agp_i810_chipset_flush_setup(device_t dev); +static int agp_i915_chipset_flush_setup(device_t dev); +static int agp_i965_chipset_flush_setup(device_t dev); + +static void agp_i810_chipset_flush_teardown(device_t dev); +static void agp_i915_chipset_flush_teardown(device_t dev); +static void agp_i965_chipset_flush_teardown(device_t dev); + +static void agp_i810_chipset_flush(device_t dev); +static void agp_i830_chipset_flush(device_t dev); +static void agp_i915_chipset_flush(device_t dev); + enum { CHIP_I810, /* i810/i815 */ CHIP_I830, /* 830M/845G */ @@ -72,6 +170,7 @@ enum { CHIP_G33, /* G33/Q33/Q35 */ CHIP_IGD, /* Pineview */ CHIP_G4X, /* G45/Q45 */ + CHIP_SB, /* SandyBridge */ }; /* The i810 through i855 have the registers at BAR 1, and the GATT gets @@ -96,19 +195,308 @@ static struct resource_spec agp_i965_res { -1, 0 } }; +static struct resource_spec agp_g4x_res_spec[] = { + { SYS_RES_MEMORY, AGP_G4X_MMADR, RF_ACTIVE | RF_SHAREABLE }, + { SYS_RES_MEMORY, AGP_G4X_GTTADR, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0 } +}; + struct agp_i810_softc { struct agp_softc agp; u_int32_t initial_aperture; /* aperture size at startup */ struct agp_gatt *gatt; - int chiptype; /* i810-like or i830 */ u_int32_t dcache_size; /* i810 only */ - u_int32_t stolen; /* number of i830/845 gtt entries for stolen memory */ + u_int32_t stolen; /* number of i830/845 gtt + entries for stolen memory */ + u_int stolen_size; /* BIOS-reserved graphics memory */ + u_int gtt_total_entries; /* Total number of gtt ptes */ + u_int gtt_mappable_entries; /* Number of gtt ptes mappable by CPU */ device_t bdev; /* bridge device */ - void *argb_cursor; /* contigmalloc area for ARGB cursor */ - - struct resource_spec * sc_res_spec; struct resource *sc_res[2]; + const struct agp_i810_match *match; + int sc_flush_page_rid; + struct resource *sc_flush_page_res; + void *sc_flush_page_vaddr; + int sc_bios_allocated_flush_page; +}; + +static device_t intel_agp; + +struct agp_i810_driver { + int chiptype; + int gen; + int busdma_addr_mask_sz; + struct resource_spec *res_spec; + int (*check_active)(device_t); + void (*set_desc)(device_t, const struct agp_i810_match *); + void (*dump_regs)(device_t); + int (*get_stolen_size)(device_t); + int (*get_gtt_total_entries)(device_t); + int (*get_gtt_mappable_entries)(device_t); + int (*install_gatt)(device_t); + void (*deinstall_gatt)(device_t); + void (*write_gtt)(device_t, u_int, uint32_t); + void (*install_gtt_pte)(device_t, u_int, vm_offset_t, int); + u_int32_t (*read_gtt_pte)(device_t, u_int); + vm_paddr_t (*read_gtt_pte_paddr)(device_t , u_int); + int (*set_aperture)(device_t, u_int32_t); + int (*chipset_flush_setup)(device_t); + void (*chipset_flush_teardown)(device_t); + void (*chipset_flush)(device_t); +}; + +static const struct agp_i810_driver agp_i810_i810_driver = { + .chiptype = CHIP_I810, + .gen = 1, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i810_res_spec, + .check_active = agp_i810_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i810_dump_regs, + .get_stolen_size = agp_i810_get_stolen_size, + .get_gtt_mappable_entries = agp_i810_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i810_install_gatt, + .deinstall_gatt = agp_i810_deinstall_gatt, + .write_gtt = agp_i810_write_gtt, + .install_gtt_pte = agp_i810_install_gtt_pte, + .read_gtt_pte = agp_i810_read_gtt_pte, + .read_gtt_pte_paddr = agp_i810_read_gtt_pte_paddr, + .set_aperture = agp_i810_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i810_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_i815_driver = { + .chiptype = CHIP_I810, + .gen = 2, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i810_res_spec, + .check_active = agp_i810_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i810_dump_regs, + .get_stolen_size = agp_i810_get_stolen_size, + .get_gtt_mappable_entries = agp_i830_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i810_install_gatt, + .deinstall_gatt = agp_i810_deinstall_gatt, + .write_gtt = agp_i810_write_gtt, + .install_gtt_pte = agp_i810_install_gtt_pte, + .read_gtt_pte = agp_i810_read_gtt_pte, + .read_gtt_pte_paddr = agp_i810_read_gtt_pte_paddr, + .set_aperture = agp_i810_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i830_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_i830_driver = { + .chiptype = CHIP_I830, + .gen = 2, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i810_res_spec, + .check_active = agp_i830_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i830_dump_regs, + .get_stolen_size = agp_i830_get_stolen_size, + .get_gtt_mappable_entries = agp_i830_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i810_write_gtt, + .install_gtt_pte = agp_i830_install_gtt_pte, + .read_gtt_pte = agp_i810_read_gtt_pte, + .read_gtt_pte_paddr = agp_i810_read_gtt_pte_paddr, + .set_aperture = agp_i830_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i830_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_i855_driver = { + .chiptype = CHIP_I855, + .gen = 2, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i810_res_spec, + .check_active = agp_i830_check_active, + .set_desc = agp_82852_set_desc, + .dump_regs = agp_i855_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i810_write_gtt, + .install_gtt_pte = agp_i830_install_gtt_pte, + .read_gtt_pte = agp_i810_read_gtt_pte, + .read_gtt_pte_paddr = agp_i810_read_gtt_pte_paddr, + .set_aperture = agp_i830_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i830_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_i865_driver = { + .chiptype = CHIP_I855, + .gen = 2, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i810_res_spec, + .check_active = agp_i830_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i855_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i810_write_gtt, + .install_gtt_pte = agp_i830_install_gtt_pte, + .read_gtt_pte = agp_i810_read_gtt_pte, + .read_gtt_pte_paddr = agp_i810_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i830_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_i915_driver = { + .chiptype = CHIP_I915, + .gen = 3, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i915_res_spec, + .check_active = agp_i915_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i915_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i915_write_gtt, + .install_gtt_pte = agp_i915_install_gtt_pte, + .read_gtt_pte = agp_i915_read_gtt_pte, + .read_gtt_pte_paddr = agp_i915_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i915_chipset_flush_setup, + .chipset_flush_teardown = agp_i915_chipset_flush_teardown, + .chipset_flush = agp_i915_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_g965_driver = { + .chiptype = CHIP_I965, + .gen = 4, + .busdma_addr_mask_sz = 36, + .res_spec = agp_i965_res_spec, + .check_active = agp_i915_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i965_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i965_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i965_write_gtt, + .install_gtt_pte = agp_i965_install_gtt_pte, + .read_gtt_pte = agp_i965_read_gtt_pte, + .read_gtt_pte_paddr = agp_i915_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i965_chipset_flush_setup, + .chipset_flush_teardown = agp_i965_chipset_flush_teardown, + .chipset_flush = agp_i915_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_g33_driver = { + .chiptype = CHIP_G33, + .gen = 3, + .busdma_addr_mask_sz = 36, + .res_spec = agp_i915_res_spec, + .check_active = agp_i915_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i965_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i965_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i915_write_gtt, + .install_gtt_pte = agp_i915_install_gtt_pte, + .read_gtt_pte = agp_i915_read_gtt_pte, + .read_gtt_pte_paddr = agp_i915_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i965_chipset_flush_setup, + .chipset_flush_teardown = agp_i965_chipset_flush_teardown, + .chipset_flush = agp_i915_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_igd_driver = { + .chiptype = CHIP_IGD, + .gen = 3, + .busdma_addr_mask_sz = 36, + .res_spec = agp_i915_res_spec, + .check_active = agp_i915_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i915_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i965_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i915_write_gtt, + .install_gtt_pte = agp_i915_install_gtt_pte, + .read_gtt_pte = agp_i915_read_gtt_pte, + .read_gtt_pte_paddr = agp_i915_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i965_chipset_flush_setup, + .chipset_flush_teardown = agp_i965_chipset_flush_teardown, + .chipset_flush = agp_i915_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_g4x_driver = { + .chiptype = CHIP_G4X, + .gen = 5, + .busdma_addr_mask_sz = 36, + .res_spec = agp_i965_res_spec, + .check_active = agp_i915_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i965_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_gen5_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_g4x_write_gtt, + .install_gtt_pte = agp_g4x_install_gtt_pte, + .read_gtt_pte = agp_g4x_read_gtt_pte, + .read_gtt_pte_paddr = agp_i915_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i965_chipset_flush_setup, + .chipset_flush_teardown = agp_i965_chipset_flush_teardown, + .chipset_flush = agp_i915_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_sb_driver = { + .chiptype = CHIP_SB, + .gen = 6, + .busdma_addr_mask_sz = 40, + .res_spec = agp_g4x_res_spec, + .check_active = agp_sb_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_sb_dump_regs, + .get_stolen_size = agp_sb_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_sb_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_sb_write_gtt, + .install_gtt_pte = agp_sb_install_gtt_pte, + .read_gtt_pte = agp_g4x_read_gtt_pte, + .read_gtt_pte_paddr = agp_sb_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i810_chipset_flush, }; /* For adding new devices, devid is the id of the graphics controller @@ -118,75 +506,232 @@ struct agp_i810_softc { */ static const struct agp_i810_match { int devid; - int chiptype; - int bridge_offset; char *name; + const struct agp_i810_driver *driver; } agp_i810_matches[] = { - {0x71218086, CHIP_I810, 0x00010000, - "Intel 82810 (i810 GMCH) SVGA controller"}, - {0x71238086, CHIP_I810, 0x00010000, - "Intel 82810-DC100 (i810-DC100 GMCH) SVGA controller"}, - {0x71258086, CHIP_I810, 0x00010000, - "Intel 82810E (i810E GMCH) SVGA controller"}, - {0x11328086, CHIP_I810, 0x00020000, - "Intel 82815 (i815 GMCH) SVGA controller"}, - {0x35778086, CHIP_I830, 0x00020000, - "Intel 82830M (830M GMCH) SVGA controller"}, - {0x25628086, CHIP_I830, 0x00020000, - "Intel 82845M (845M GMCH) SVGA controller"}, - {0x35828086, CHIP_I855, 0x00020000, - "Intel 82852/855GM SVGA controller"}, - {0x25728086, CHIP_I855, 0x00020000, - "Intel 82865G (865G GMCH) SVGA controller"}, - {0x25828086, CHIP_I915, 0x00020000, - "Intel 82915G (915G GMCH) SVGA controller"}, - {0x258A8086, CHIP_I915, 0x00020000, - "Intel E7221 SVGA controller"}, - {0x25928086, CHIP_I915, 0x00020000, - "Intel 82915GM (915GM GMCH) SVGA controller"}, - {0x27728086, CHIP_I915, 0x00020000, - "Intel 82945G (945G GMCH) SVGA controller"}, - {0x27A28086, CHIP_I915, 0x00020000, - "Intel 82945GM (945GM GMCH) SVGA controller"}, - {0x27AE8086, CHIP_I915, 0x00020000, - "Intel 945GME SVGA controller"}, - {0x29728086, CHIP_I965, 0x00020000, - "Intel 946GZ SVGA controller"}, - {0x29828086, CHIP_I965, 0x00020000, - "Intel G965 SVGA controller"}, - {0x29928086, CHIP_I965, 0x00020000, - "Intel Q965 SVGA controller"}, - {0x29A28086, CHIP_I965, 0x00020000, - "Intel G965 SVGA controller"}, - {0x29B28086, CHIP_G33, 0x00020000, - "Intel Q35 SVGA controller"}, - {0x29C28086, CHIP_G33, 0x00020000, - "Intel G33 SVGA controller"}, - {0x29D28086, CHIP_G33, 0x00020000, - "Intel Q33 SVGA controller"}, - {0xA0018086, CHIP_IGD, 0x00010000, - "Intel Pineview SVGA controller"}, - {0xA0118086, CHIP_IGD, 0x00010000, - "Intel Pineview (M) SVGA controller"}, - {0x2A028086, CHIP_I965, 0x00020000, - "Intel GM965 SVGA controller"}, - {0x2A128086, CHIP_I965, 0x00020000, - "Intel GME965 SVGA controller"}, - {0x2A428086, CHIP_G4X, 0x00020000, - "Intel GM45 SVGA controller"}, - {0x2E028086, CHIP_G4X, 0x00020000, - "Intel Eaglelake SVGA controller"}, - {0x2E128086, CHIP_G4X, 0x00020000, - "Intel Q45 SVGA controller"}, - {0x2E228086, CHIP_G4X, 0x00020000, - "Intel G45 SVGA controller"}, - {0x2E328086, CHIP_G4X, 0x00020000, - "Intel G41 SVGA controller"}, - {0x00428086, CHIP_G4X, 0x00020000, - "Intel Ironlake (D) SVGA controller"}, - {0x00468086, CHIP_G4X, 0x00020000, - "Intel Ironlake (M) SVGA controller"}, - {0, 0, 0, NULL} + { + .devid = 0x71218086, + .name = "Intel 82810 (i810 GMCH) SVGA controller", + .driver = &agp_i810_i810_driver + }, + { + .devid = 0x71238086, + .name = "Intel 82810-DC100 (i810-DC100 GMCH) SVGA controller", + .driver = &agp_i810_i810_driver + }, + { + .devid = 0x71258086, + .name = "Intel 82810E (i810E GMCH) SVGA controller", + .driver = &agp_i810_i810_driver + }, + { + .devid = 0x11328086, + .name = "Intel 82815 (i815 GMCH) SVGA controller", + .driver = &agp_i810_i815_driver + }, + { + .devid = 0x35778086, + .name = "Intel 82830M (830M GMCH) SVGA controller", + .driver = &agp_i810_i830_driver + }, + { + .devid = 0x25628086, + .name = "Intel 82845M (845M GMCH) SVGA controller", + .driver = &agp_i810_i830_driver + }, + { + .devid = 0x35828086, + .name = "Intel 82852/855GM SVGA controller", + .driver = &agp_i810_i855_driver + }, + { + .devid = 0x25728086, + .name = "Intel 82865G (865G GMCH) SVGA controller", + .driver = &agp_i810_i865_driver + }, + { + .devid = 0x25828086, + .name = "Intel 82915G (915G GMCH) SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x258A8086, + .name = "Intel E7221 SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x25928086, + .name = "Intel 82915GM (915GM GMCH) SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x27728086, + .name = "Intel 82945G (945G GMCH) SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x27A28086, + .name = "Intel 82945GM (945GM GMCH) SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x27AE8086, + .name = "Intel 945GME SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x29728086, + .name = "Intel 946GZ SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x29828086, + .name = "Intel G965 SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x29928086, + .name = "Intel Q965 SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x29A28086, + .name = "Intel G965 SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x29B28086, + .name = "Intel Q35 SVGA controller", + .driver = &agp_i810_g33_driver + }, + { + .devid = 0x29C28086, + .name = "Intel G33 SVGA controller", + .driver = &agp_i810_g33_driver + }, + { + .devid = 0x29D28086, + .name = "Intel Q33 SVGA controller", + .driver = &agp_i810_g33_driver + }, + { + .devid = 0xA0018086, + .name = "Intel Pineview SVGA controller", + .driver = &agp_i810_igd_driver + }, + { + .devid = 0xA0118086, + .name = "Intel Pineview (M) SVGA controller", + .driver = &agp_i810_igd_driver + }, + { + .devid = 0x2A028086, + .name = "Intel GM965 SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x2A128086, + .name = "Intel GME965 SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x2A428086, + .name = "Intel GM45 SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x2E028086, + .name = "Intel Eaglelake SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x2E128086, + .name = "Intel Q45 SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x2E228086, + .name = "Intel G45 SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x2E328086, + .name = "Intel G41 SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x00428086, + .name = "Intel Ironlake (D) SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x00468086, + .name = "Intel Ironlake (M) SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x01028086, + .name = "SandyBridge desktop GT1 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01128086, + .name = "SandyBridge desktop GT2 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01228086, + .name = "SandyBridge desktop GT2+ IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01068086, + .name = "SandyBridge mobile GT1 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01168086, + .name = "SandyBridge mobile GT2 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01268086, + .name = "SandyBridge mobile GT2+ IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01088086, + .name = "SandyBridge server IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01528086, + .name = "IvyBridge desktop GT1 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01628086, + .name = "IvyBridge desktop GT2 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01568086, + .name = "IvyBridge mobile GT1 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01668086, + .name = "IvyBridge mobile GT2 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x015a8086, + .name = "IvyBridge server GT1 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0, + } }; static const struct agp_i810_match* @@ -196,17 +741,17 @@ agp_i810_match(device_t dev) if (pci_get_class(dev) != PCIC_DISPLAY || pci_get_subclass(dev) != PCIS_DISPLAY_VGA) - return NULL; + return (NULL); devid = pci_get_devid(dev); for (i = 0; agp_i810_matches[i].devid != 0; i++) { if (agp_i810_matches[i].devid == devid) - break; + break; } if (agp_i810_matches[i].devid == 0) - return NULL; + return (NULL); else - return &agp_i810_matches[i]; + return (&agp_i810_matches[i]); } /* @@ -215,28 +760,8 @@ agp_i810_match(device_t dev) static device_t agp_i810_find_bridge(device_t dev) { - device_t *children, child; - int nchildren, i; - u_int32_t devid; - const struct agp_i810_match *match; - - match = agp_i810_match(dev); - devid = match->devid - match->bridge_offset; - if (device_get_children(device_get_parent(device_get_parent(dev)), - &children, &nchildren)) - return 0; - - for (i = 0; i < nchildren; i++) { - child = children[i]; - - if (pci_get_devid(child) == devid) { - free(children, M_TEMP); - return child; - } - } - free(children, M_TEMP); - return 0; + return (pci_find_dbsf(0, 0, 0, 0)); } static void @@ -249,92 +774,116 @@ agp_i810_identify(driver_t *driver, devi } static int +agp_i810_check_active(device_t bridge_dev) +{ + u_int8_t smram; + + smram = pci_read_config(bridge_dev, AGP_I810_SMRAM, 1); + if ((smram & AGP_I810_SMRAM_GMS) == AGP_I810_SMRAM_GMS_DISABLED) + return (ENXIO); + return (0); +} + +static int +agp_i830_check_active(device_t bridge_dev) +{ + int gcc1; + + gcc1 = pci_read_config(bridge_dev, AGP_I830_GCC1, 1); + if ((gcc1 & AGP_I830_GCC1_DEV2) == AGP_I830_GCC1_DEV2_DISABLED) + return (ENXIO); + return (0); +} + +static int +agp_i915_check_active(device_t bridge_dev) +{ + int deven; + + deven = pci_read_config(bridge_dev, AGP_I915_DEVEN, 4); + if ((deven & AGP_I915_DEVEN_D2F0) == AGP_I915_DEVEN_D2F0_DISABLED) + return (ENXIO); + return (0); +} + +static int +agp_sb_check_active(device_t bridge_dev) +{ + int deven; + + deven = pci_read_config(bridge_dev, AGP_I915_DEVEN, 4); + if ((deven & AGP_SB_DEVEN_D2EN) == AGP_SB_DEVEN_D2EN_DISABLED) + return (ENXIO); + return (0); +} + +static void +agp_82852_set_desc(device_t dev, const struct agp_i810_match *match) +{ + + switch (pci_read_config(dev, AGP_I85X_CAPID, 1)) { + case AGP_I855_GME: + device_set_desc(dev, + "Intel 82855GME (855GME GMCH) SVGA controller"); + break; + case AGP_I855_GM: + device_set_desc(dev, + "Intel 82855GM (855GM GMCH) SVGA controller"); + break; + case AGP_I852_GME: + device_set_desc(dev, + "Intel 82852GME (852GME GMCH) SVGA controller"); + break; + case AGP_I852_GM: + device_set_desc(dev, + "Intel 82852GM (852GM GMCH) SVGA controller"); + break; + default: + device_set_desc(dev, + "Intel 8285xM (85xGM GMCH) SVGA controller"); + break; + } +} + +static void +agp_i810_set_desc(device_t dev, const struct agp_i810_match *match) +{ + + device_set_desc(dev, match->name); +} + +static int agp_i810_probe(device_t dev) { device_t bdev; const struct agp_i810_match *match; - u_int8_t smram; - int gcc1, deven; + int err; if (resource_disabled("agp", device_get_unit(dev))) return (ENXIO); match = agp_i810_match(dev); if (match == NULL) - return ENXIO; + return (ENXIO); bdev = agp_i810_find_bridge(dev); - if (!bdev) { + if (bdev == NULL) { if (bootverbose) printf("I810: can't find bridge device\n"); - return ENXIO; + return (ENXIO); } /* * checking whether internal graphics device has been activated. */ - switch (match->chiptype) { - case CHIP_I810: - smram = pci_read_config(bdev, AGP_I810_SMRAM, 1); - if ((smram & AGP_I810_SMRAM_GMS) == - AGP_I810_SMRAM_GMS_DISABLED) { - if (bootverbose) - printf("I810: disabled, not probing\n"); - return ENXIO; - } - break; - case CHIP_I830: - case CHIP_I855: - gcc1 = pci_read_config(bdev, AGP_I830_GCC1, 1); - if ((gcc1 & AGP_I830_GCC1_DEV2) == - AGP_I830_GCC1_DEV2_DISABLED) { - if (bootverbose) - printf("I830: disabled, not probing\n"); - return ENXIO; - } - break; - case CHIP_I915: - case CHIP_I965: - case CHIP_G33: - case CHIP_IGD: - case CHIP_G4X: - deven = pci_read_config(bdev, AGP_I915_DEVEN, 4); - if ((deven & AGP_I915_DEVEN_D2F0) == - AGP_I915_DEVEN_D2F0_DISABLED) { - if (bootverbose) - printf("I915: disabled, not probing\n"); - return ENXIO; - } - break; - } - - if (match->devid == 0x35828086) { - switch (pci_read_config(dev, AGP_I85X_CAPID, 1)) { - case AGP_I855_GME: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 22 11:07:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C91D61065696; Tue, 22 May 2012 11:07:45 +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 B105C8FC15; Tue, 22 May 2012 11:07: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 q4MB7jqx099907; Tue, 22 May 2012 11:07:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MB7jx0099903; Tue, 22 May 2012 11:07:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205221107.q4MB7jx0099903@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 May 2012 11:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235783 - in head/sys/dev/drm2: . i915 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 11:07:45 -0000 Author: kib Date: Tue May 22 11:07:44 2012 New Revision: 235783 URL: http://svn.freebsd.org/changeset/base/235783 Log: Add the code for new Intel GPU driver, which supports GEM, KMS and works with new generations of GPUs (IronLake, SandyBridge and supposedly IvyBridge). The driver is not connected to the build yet. Sponsored by: The FreeBSD Foundation MFC after: 1 week Added: head/sys/dev/drm2/ head/sys/dev/drm2/drm.h (contents, props changed) head/sys/dev/drm2/drmP.h (contents, props changed) head/sys/dev/drm2/drm_agpsupport.c (contents, props changed) head/sys/dev/drm2/drm_atomic.h (contents, props changed) head/sys/dev/drm2/drm_auth.c (contents, props changed) head/sys/dev/drm2/drm_bufs.c (contents, props changed) head/sys/dev/drm2/drm_context.c (contents, props changed) head/sys/dev/drm2/drm_crtc.c (contents, props changed) head/sys/dev/drm2/drm_crtc.h (contents, props changed) head/sys/dev/drm2/drm_crtc_helper.c (contents, props changed) head/sys/dev/drm2/drm_crtc_helper.h (contents, props changed) head/sys/dev/drm2/drm_dma.c (contents, props changed) head/sys/dev/drm2/drm_dp_helper.h (contents, props changed) head/sys/dev/drm2/drm_dp_iic_helper.c (contents, props changed) head/sys/dev/drm2/drm_drawable.c (contents, props changed) head/sys/dev/drm2/drm_drv.c (contents, props changed) head/sys/dev/drm2/drm_edid.c (contents, props changed) head/sys/dev/drm2/drm_edid.h (contents, props changed) head/sys/dev/drm2/drm_edid_modes.h (contents, props changed) head/sys/dev/drm2/drm_fb_helper.c (contents, props changed) head/sys/dev/drm2/drm_fb_helper.h (contents, props changed) head/sys/dev/drm2/drm_fops.c (contents, props changed) head/sys/dev/drm2/drm_fourcc.h (contents, props changed) head/sys/dev/drm2/drm_gem.c (contents, props changed) head/sys/dev/drm2/drm_gem_names.c (contents, props changed) head/sys/dev/drm2/drm_gem_names.h (contents, props changed) head/sys/dev/drm2/drm_hashtab.c (contents, props changed) head/sys/dev/drm2/drm_hashtab.h (contents, props changed) head/sys/dev/drm2/drm_internal.h (contents, props changed) head/sys/dev/drm2/drm_ioctl.c (contents, props changed) head/sys/dev/drm2/drm_irq.c (contents, props changed) head/sys/dev/drm2/drm_linux_list.h (contents, props changed) head/sys/dev/drm2/drm_linux_list_sort.c (contents, props changed) head/sys/dev/drm2/drm_lock.c (contents, props changed) head/sys/dev/drm2/drm_memory.c (contents, props changed) head/sys/dev/drm2/drm_mm.c (contents, props changed) head/sys/dev/drm2/drm_mm.h (contents, props changed) head/sys/dev/drm2/drm_mode.h (contents, props changed) head/sys/dev/drm2/drm_modes.c (contents, props changed) head/sys/dev/drm2/drm_pci.c (contents, props changed) head/sys/dev/drm2/drm_pciids.h (contents, props changed) head/sys/dev/drm2/drm_sarea.h (contents, props changed) head/sys/dev/drm2/drm_scatter.c (contents, props changed) head/sys/dev/drm2/drm_sman.c (contents, props changed) head/sys/dev/drm2/drm_sman.h (contents, props changed) head/sys/dev/drm2/drm_stub.c (contents, props changed) head/sys/dev/drm2/drm_sysctl.c (contents, props changed) head/sys/dev/drm2/drm_vm.c (contents, props changed) head/sys/dev/drm2/i915/ head/sys/dev/drm2/i915/i915_debug.c (contents, props changed) head/sys/dev/drm2/i915/i915_dma.c (contents, props changed) head/sys/dev/drm2/i915/i915_drm.h (contents, props changed) head/sys/dev/drm2/i915/i915_drv.c (contents, props changed) head/sys/dev/drm2/i915/i915_drv.h (contents, props changed) head/sys/dev/drm2/i915/i915_gem.c (contents, props changed) head/sys/dev/drm2/i915/i915_gem_evict.c (contents, props changed) head/sys/dev/drm2/i915/i915_gem_execbuffer.c (contents, props changed) head/sys/dev/drm2/i915/i915_gem_gtt.c (contents, props changed) head/sys/dev/drm2/i915/i915_gem_tiling.c (contents, props changed) head/sys/dev/drm2/i915/i915_irq.c (contents, props changed) head/sys/dev/drm2/i915/i915_reg.h (contents, props changed) head/sys/dev/drm2/i915/i915_suspend.c (contents, props changed) head/sys/dev/drm2/i915/intel_bios.c (contents, props changed) head/sys/dev/drm2/i915/intel_bios.h (contents, props changed) head/sys/dev/drm2/i915/intel_crt.c (contents, props changed) head/sys/dev/drm2/i915/intel_display.c (contents, props changed) head/sys/dev/drm2/i915/intel_dp.c (contents, props changed) head/sys/dev/drm2/i915/intel_drv.h (contents, props changed) head/sys/dev/drm2/i915/intel_fb.c (contents, props changed) head/sys/dev/drm2/i915/intel_hdmi.c (contents, props changed) head/sys/dev/drm2/i915/intel_iic.c (contents, props changed) head/sys/dev/drm2/i915/intel_lvds.c (contents, props changed) head/sys/dev/drm2/i915/intel_modes.c (contents, props changed) head/sys/dev/drm2/i915/intel_opregion.c (contents, props changed) head/sys/dev/drm2/i915/intel_overlay.c (contents, props changed) head/sys/dev/drm2/i915/intel_panel.c (contents, props changed) head/sys/dev/drm2/i915/intel_ringbuffer.c (contents, props changed) head/sys/dev/drm2/i915/intel_ringbuffer.h (contents, props changed) head/sys/dev/drm2/i915/intel_sdvo.c (contents, props changed) head/sys/dev/drm2/i915/intel_sdvo_regs.h (contents, props changed) head/sys/dev/drm2/i915/intel_sprite.c (contents, props changed) head/sys/dev/drm2/i915/intel_tv.c (contents, props changed) Added: head/sys/dev/drm2/drm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/drm.h Tue May 22 11:07:44 2012 (r235783) @@ -0,0 +1,1214 @@ +/** + * \file drm.h + * Header for the Direct Rendering Manager + * + * \author Rickard E. (Rik) Faith + * + * \par Acknowledgments: + * Dec 1999, Richard Henderson , move to generic \c cmpxchg. + */ + +/*- + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/** + * \mainpage + * + * The Direct Rendering Manager (DRM) is a device-independent kernel-level + * device driver that provides support for the XFree86 Direct Rendering + * Infrastructure (DRI). + * + * The DRM supports the Direct Rendering Infrastructure (DRI) in four major + * ways: + * -# The DRM provides synchronized access to the graphics hardware via + * the use of an optimized two-tiered lock. + * -# The DRM enforces the DRI security policy for access to the graphics + * hardware by only allowing authenticated X11 clients access to + * restricted regions of memory. + * -# The DRM provides a generic DMA engine, complete with multiple + * queues and the ability to detect the need for an OpenGL context + * switch. + * -# The DRM is extensible via the use of small device-specific modules + * that rely extensively on the API exported by the DRM module. + * + */ + +#ifndef _DRM_H_ +#define _DRM_H_ + +#ifndef __user +#define __user +#endif +#ifndef __iomem +#define __iomem +#endif + +#ifdef __GNUC__ +# define DEPRECATED __attribute__ ((deprecated)) +#else +# define DEPRECATED +#endif + +#if defined(__linux__) +#include /* For _IO* macros */ +#define DRM_IOCTL_NR(n) _IOC_NR(n) +#define DRM_IOC_VOID _IOC_NONE +#define DRM_IOC_READ _IOC_READ +#define DRM_IOC_WRITE _IOC_WRITE +#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE +#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) +#include +#define DRM_IOCTL_NR(n) ((n) & 0xff) +#define DRM_IOC_VOID IOC_VOID +#define DRM_IOC_READ IOC_OUT +#define DRM_IOC_WRITE IOC_IN +#define DRM_IOC_READWRITE IOC_INOUT +#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) +#endif + +#ifdef __OpenBSD__ +#define DRM_MAJOR 81 +#endif +#if defined(__linux__) || defined(__NetBSD__) +#define DRM_MAJOR 226 +#endif +#define DRM_MAX_MINOR 15 + +#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ +#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ +#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ +#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ + +#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ +#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ +#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) +#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) +#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) + +#if defined(__linux__) +typedef unsigned int drm_handle_t; +#else +#include +typedef unsigned long drm_handle_t; /**< To mapped regions */ +#endif +typedef unsigned int drm_context_t; /**< GLXContext handle */ +typedef unsigned int drm_drawable_t; +typedef unsigned int drm_magic_t; /**< Magic for authentication */ + +/** + * Cliprect. + * + * \warning If you change this structure, make sure you change + * XF86DRIClipRectRec in the server as well + * + * \note KW: Actually it's illegal to change either for + * backwards-compatibility reasons. + */ +struct drm_clip_rect { + unsigned short x1; + unsigned short y1; + unsigned short x2; + unsigned short y2; +}; + +/** + * Texture region, + */ +struct drm_tex_region { + unsigned char next; + unsigned char prev; + unsigned char in_use; + unsigned char padding; + unsigned int age; +}; + +/** + * Hardware lock. + * + * The lock structure is a simple cache-line aligned integer. To avoid + * processor bus contention on a multiprocessor system, there should not be any + * other data stored in the same cache line. + */ +struct drm_hw_lock { + __volatile__ unsigned int lock; /**< lock variable */ + char padding[60]; /**< Pad to cache line */ +}; + +/* This is beyond ugly, and only works on GCC. However, it allows me to use + * drm.h in places (i.e., in the X-server) where I can't use size_t. The real + * fix is to use uint32_t instead of size_t, but that fix will break existing + * LP64 (i.e., PowerPC64, SPARC64, IA-64, Alpha, etc.) systems. That *will* + * eventually happen, though. I chose 'unsigned long' to be the fallback type + * because that works on all the platforms I know about. Hopefully, the + * real fix will happen before that bites us. + */ + +#ifdef __SIZE_TYPE__ +# define DRM_SIZE_T __SIZE_TYPE__ +#else +# warning "__SIZE_TYPE__ not defined. Assuming sizeof(size_t) == sizeof(unsigned long)!" +# define DRM_SIZE_T unsigned long +#endif + +/** + * DRM_IOCTL_VERSION ioctl argument type. + * + * \sa drmGetVersion(). + */ +struct drm_version { + int version_major; /**< Major version */ + int version_minor; /**< Minor version */ + int version_patchlevel; /**< Patch level */ + DRM_SIZE_T name_len; /**< Length of name buffer */ + char __user *name; /**< Name of driver */ + DRM_SIZE_T date_len; /**< Length of date buffer */ + char __user *date; /**< User-space buffer to hold date */ + DRM_SIZE_T desc_len; /**< Length of desc buffer */ + char __user *desc; /**< User-space buffer to hold desc */ +}; + +/** + * DRM_IOCTL_GET_UNIQUE ioctl argument type. + * + * \sa drmGetBusid() and drmSetBusId(). + */ +struct drm_unique { + DRM_SIZE_T unique_len; /**< Length of unique */ + char __user *unique; /**< Unique name for driver instantiation */ +}; + +#undef DRM_SIZE_T + +struct drm_list { + int count; /**< Length of user-space structures */ + struct drm_version __user *version; +}; + +struct drm_block { + int unused; +}; + +/** + * DRM_IOCTL_CONTROL ioctl argument type. + * + * \sa drmCtlInstHandler() and drmCtlUninstHandler(). + */ +struct drm_control { + enum { + DRM_ADD_COMMAND, + DRM_RM_COMMAND, + DRM_INST_HANDLER, + DRM_UNINST_HANDLER + } func; + int irq; +}; + +/** + * Type of memory to map. + */ +enum drm_map_type { + _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ + _DRM_REGISTERS = 1, /**< no caching, no core dump */ + _DRM_SHM = 2, /**< shared, cached */ + _DRM_AGP = 3, /**< AGP/GART */ + _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ + _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */ + _DRM_GEM = 6 /**< GEM */ +}; + +/** + * Memory mapping flags. + */ +enum drm_map_flags { + _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ + _DRM_READ_ONLY = 0x02, + _DRM_LOCKED = 0x04, /**< shared, cached, locked */ + _DRM_KERNEL = 0x08, /**< kernel requires access */ + _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ + _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ + _DRM_REMOVABLE = 0x40, /**< Removable mapping */ + _DRM_DRIVER = 0x80 /**< Managed by driver */ +}; + +struct drm_ctx_priv_map { + unsigned int ctx_id; /**< Context requesting private mapping */ + void *handle; /**< Handle of map */ +}; + +/** + * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls + * argument type. + * + * \sa drmAddMap(). + */ +struct drm_map { + unsigned long offset; /**< Requested physical address (0 for SAREA)*/ + unsigned long size; /**< Requested physical size (bytes) */ + enum drm_map_type type; /**< Type of memory to map */ + enum drm_map_flags flags; /**< Flags */ + void *handle; /**< User-space: "Handle" to pass to mmap() */ + /**< Kernel-space: kernel-virtual address */ + int mtrr; /**< MTRR slot used */ + /* Private data */ +}; + +/** + * DRM_IOCTL_GET_CLIENT ioctl argument type. + */ +struct drm_client { + int idx; /**< Which client desired? */ + int auth; /**< Is client authenticated? */ + unsigned long pid; /**< Process ID */ + unsigned long uid; /**< User ID */ + unsigned long magic; /**< Magic */ + unsigned long iocs; /**< Ioctl count */ +}; + +enum drm_stat_type { + _DRM_STAT_LOCK, + _DRM_STAT_OPENS, + _DRM_STAT_CLOSES, + _DRM_STAT_IOCTLS, + _DRM_STAT_LOCKS, + _DRM_STAT_UNLOCKS, + _DRM_STAT_VALUE, /**< Generic value */ + _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ + _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ + + _DRM_STAT_IRQ, /**< IRQ */ + _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ + _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ + _DRM_STAT_DMA, /**< DMA */ + _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ + _DRM_STAT_MISSED /**< Missed DMA opportunity */ + /* Add to the *END* of the list */ +}; + +/** + * DRM_IOCTL_GET_STATS ioctl argument type. + */ +struct drm_stats { + unsigned long count; + struct { + unsigned long value; + enum drm_stat_type type; + } data[15]; +}; + +/** + * Hardware locking flags. + */ +enum drm_lock_flags { + _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ + _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ + _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ + _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ + /* These *HALT* flags aren't supported yet + -- they will be used to support the + full-screen DGA-like mode. */ + _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ + _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ +}; + +/** + * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. + * + * \sa drmGetLock() and drmUnlock(). + */ +struct drm_lock { + int context; + enum drm_lock_flags flags; +}; + +/** + * DMA flags + * + * \warning + * These values \e must match xf86drm.h. + * + * \sa drm_dma. + */ +enum drm_dma_flags { + /* Flags for DMA buffer dispatch */ + _DRM_DMA_BLOCK = 0x01, /**< + * Block until buffer dispatched. + * + * \note The buffer may not yet have + * been processed by the hardware -- + * getting a hardware lock with the + * hardware quiescent will ensure + * that the buffer has been + * processed. + */ + _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ + _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ + + /* Flags for DMA buffer request */ + _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ + _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ + _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ +}; + +/** + * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. + * + * \sa drmAddBufs(). + */ +struct drm_buf_desc { + int count; /**< Number of buffers of this size */ + int size; /**< Size in bytes */ + int low_mark; /**< Low water mark */ + int high_mark; /**< High water mark */ + enum { + _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ + _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ + _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ + _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ + _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ + } flags; + unsigned long agp_start; /**< + * Start address of where the AGP buffers are + * in the AGP aperture + */ +}; + +/** + * DRM_IOCTL_INFO_BUFS ioctl argument type. + */ +struct drm_buf_info { + int count; /**< Number of buffers described in list */ + struct drm_buf_desc __user *list; /**< List of buffer descriptions */ +}; + +/** + * DRM_IOCTL_FREE_BUFS ioctl argument type. + */ +struct drm_buf_free { + int count; + int __user *list; +}; + +/** + * Buffer information + * + * \sa drm_buf_map. + */ +struct drm_buf_pub { + int idx; /**< Index into the master buffer list */ + int total; /**< Buffer size */ + int used; /**< Amount of buffer in use (for DMA) */ + void __user *address; /**< Address of buffer */ +}; + +/** + * DRM_IOCTL_MAP_BUFS ioctl argument type. + */ +struct drm_buf_map { + int count; /**< Length of the buffer list */ +#if defined(__cplusplus) + void __user *c_virtual; +#else + void __user *virtual; /**< Mmap'd area in user-virtual */ +#endif + struct drm_buf_pub __user *list; /**< Buffer information */ +}; + +/** + * DRM_IOCTL_DMA ioctl argument type. + * + * Indices here refer to the offset into the buffer list in drm_buf_get. + * + * \sa drmDMA(). + */ +struct drm_dma { + int context; /**< Context handle */ + int send_count; /**< Number of buffers to send */ + int __user *send_indices; /**< List of handles to buffers */ + int __user *send_sizes; /**< Lengths of data to send */ + enum drm_dma_flags flags; /**< Flags */ + int request_count; /**< Number of buffers requested */ + int request_size; /**< Desired size for buffers */ + int __user *request_indices; /**< Buffer information */ + int __user *request_sizes; + int granted_count; /**< Number of buffers granted */ +}; + +enum drm_ctx_flags { + _DRM_CONTEXT_PRESERVED = 0x01, + _DRM_CONTEXT_2DONLY = 0x02 +}; + +/** + * DRM_IOCTL_ADD_CTX ioctl argument type. + * + * \sa drmCreateContext() and drmDestroyContext(). + */ +struct drm_ctx { + drm_context_t handle; + enum drm_ctx_flags flags; +}; + +/** + * DRM_IOCTL_RES_CTX ioctl argument type. + */ +struct drm_ctx_res { + int count; + struct drm_ctx __user *contexts; +}; + +/** + * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. + */ +struct drm_draw { + drm_drawable_t handle; +}; + +/** + * DRM_IOCTL_UPDATE_DRAW ioctl argument type. + */ +typedef enum { + DRM_DRAWABLE_CLIPRECTS, +} drm_drawable_info_type_t; + +struct drm_update_draw { + drm_drawable_t handle; + unsigned int type; + unsigned int num; + unsigned long long data; +}; + +/** + * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. + */ +struct drm_auth { + drm_magic_t magic; +}; + +/** + * DRM_IOCTL_IRQ_BUSID ioctl argument type. + * + * \sa drmGetInterruptFromBusID(). + */ +struct drm_irq_busid { + int irq; /**< IRQ number */ + int busnum; /**< bus number */ + int devnum; /**< device number */ + int funcnum; /**< function number */ +}; + +enum drm_vblank_seq_type { + _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ + _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ + _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, + _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ + _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ + _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ + _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ + _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */ +}; +#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 + +#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) +#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ + _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) + +struct drm_wait_vblank_request { + enum drm_vblank_seq_type type; + unsigned int sequence; + unsigned long signal; +}; + +struct drm_wait_vblank_reply { + enum drm_vblank_seq_type type; + unsigned int sequence; + long tval_sec; + long tval_usec; +}; + +/** + * DRM_IOCTL_WAIT_VBLANK ioctl argument type. + * + * \sa drmWaitVBlank(). + */ +union drm_wait_vblank { + struct drm_wait_vblank_request request; + struct drm_wait_vblank_reply reply; +}; + + +#define _DRM_PRE_MODESET 1 +#define _DRM_POST_MODESET 2 + +/** + * DRM_IOCTL_MODESET_CTL ioctl argument type + * + * \sa drmModesetCtl(). + */ +struct drm_modeset_ctl { + uint32_t crtc; + uint32_t cmd; +}; + +/** + * DRM_IOCTL_AGP_ENABLE ioctl argument type. + * + * \sa drmAgpEnable(). + */ +struct drm_agp_mode { + unsigned long mode; /**< AGP mode */ +}; + +/** + * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. + * + * \sa drmAgpAlloc() and drmAgpFree(). + */ +struct drm_agp_buffer { + unsigned long size; /**< In bytes -- will round to page boundary */ + unsigned long handle; /**< Used for binding / unbinding */ + unsigned long type; /**< Type of memory to allocate */ + unsigned long physical; /**< Physical used by i810 */ +}; + +/** + * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. + * + * \sa drmAgpBind() and drmAgpUnbind(). + */ +struct drm_agp_binding { + unsigned long handle; /**< From drm_agp_buffer */ + unsigned long offset; /**< In bytes -- will round to page boundary */ +}; + +/** + * DRM_IOCTL_AGP_INFO ioctl argument type. + * + * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), + * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), + * drmAgpVendorId() and drmAgpDeviceId(). + */ +struct drm_agp_info { + int agp_version_major; + int agp_version_minor; + unsigned long mode; + unsigned long aperture_base; /**< physical address */ + unsigned long aperture_size; /**< bytes */ + unsigned long memory_allowed; /**< bytes */ + unsigned long memory_used; + + /** \name PCI information */ + /*@{ */ + unsigned short id_vendor; + unsigned short id_device; + /*@} */ +}; + +/** + * DRM_IOCTL_SG_ALLOC ioctl argument type. + */ +struct drm_scatter_gather { + unsigned long size; /**< In bytes -- will round to page boundary */ + unsigned long handle; /**< Used for mapping / unmapping */ +}; + +/** + * DRM_IOCTL_SET_VERSION ioctl argument type. + */ +struct drm_set_version { + int drm_di_major; + int drm_di_minor; + int drm_dd_major; + int drm_dd_minor; +}; + +#define DRM_FENCE_FLAG_EMIT 0x00000001 +#define DRM_FENCE_FLAG_SHAREABLE 0x00000002 +/** + * On hardware with no interrupt events for operation completion, + * indicates that the kernel should sleep while waiting for any blocking + * operation to complete rather than spinning. + * + * Has no effect otherwise. + */ +#define DRM_FENCE_FLAG_WAIT_LAZY 0x00000004 +#define DRM_FENCE_FLAG_NO_USER 0x00000010 + +/* Reserved for driver use */ +#define DRM_FENCE_MASK_DRIVER 0xFF000000 + +#define DRM_FENCE_TYPE_EXE 0x00000001 + +struct drm_fence_arg { + unsigned int handle; + unsigned int fence_class; + unsigned int type; + unsigned int flags; + unsigned int signaled; + unsigned int error; + unsigned int sequence; + unsigned int pad64; + uint64_t expand_pad[2]; /* Future expansion */ +}; + +/* Buffer permissions, referring to how the GPU uses the buffers. + * these translate to fence types used for the buffers. + * Typically a texture buffer is read, A destination buffer is write and + * a command (batch-) buffer is exe. Can be or-ed together. + */ + +#define DRM_BO_FLAG_READ (1ULL << 0) +#define DRM_BO_FLAG_WRITE (1ULL << 1) +#define DRM_BO_FLAG_EXE (1ULL << 2) + +/* + * All of the bits related to access mode + */ +#define DRM_BO_MASK_ACCESS (DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_EXE) +/* + * Status flags. Can be read to determine the actual state of a buffer. + * Can also be set in the buffer mask before validation. + */ + +/* + * Mask: Never evict this buffer. Not even with force. This type of buffer is only + * available to root and must be manually removed before buffer manager shutdown + * or lock. + * Flags: Acknowledge + */ +#define DRM_BO_FLAG_NO_EVICT (1ULL << 4) + +/* + * Mask: Require that the buffer is placed in mappable memory when validated. + * If not set the buffer may or may not be in mappable memory when validated. + * Flags: If set, the buffer is in mappable memory. + */ +#define DRM_BO_FLAG_MAPPABLE (1ULL << 5) + +/* Mask: The buffer should be shareable with other processes. + * Flags: The buffer is shareable with other processes. + */ +#define DRM_BO_FLAG_SHAREABLE (1ULL << 6) + +/* Mask: If set, place the buffer in cache-coherent memory if available. + * If clear, never place the buffer in cache coherent memory if validated. + * Flags: The buffer is currently in cache-coherent memory. + */ +#define DRM_BO_FLAG_CACHED (1ULL << 7) + +/* Mask: Make sure that every time this buffer is validated, + * it ends up on the same location provided that the memory mask is the same. + * The buffer will also not be evicted when claiming space for + * other buffers. Basically a pinned buffer but it may be thrown out as + * part of buffer manager shutdown or locking. + * Flags: Acknowledge. + */ +#define DRM_BO_FLAG_NO_MOVE (1ULL << 8) + +/* Mask: Make sure the buffer is in cached memory when mapped. In conjunction + * with DRM_BO_FLAG_CACHED it also allows the buffer to be bound into the GART + * with unsnooped PTEs instead of snooped, by using chipset-specific cache + * flushing at bind time. A better name might be DRM_BO_FLAG_TT_UNSNOOPED, + * as the eviction to local memory (TTM unbind) on map is just a side effect + * to prevent aggressive cache prefetch from the GPU disturbing the cache + * management that the DRM is doing. + * + * Flags: Acknowledge. + * Buffers allocated with this flag should not be used for suballocators + * This type may have issues on CPUs with over-aggressive caching + * http://marc.info/?l=linux-kernel&m=102376926732464&w=2 + */ +#define DRM_BO_FLAG_CACHED_MAPPED (1ULL << 19) + + +/* Mask: Force DRM_BO_FLAG_CACHED flag strictly also if it is set. + * Flags: Acknowledge. + */ +#define DRM_BO_FLAG_FORCE_CACHING (1ULL << 13) + +/* + * Mask: Force DRM_BO_FLAG_MAPPABLE flag strictly also if it is clear. + * Flags: Acknowledge. + */ +#define DRM_BO_FLAG_FORCE_MAPPABLE (1ULL << 14) +#define DRM_BO_FLAG_TILE (1ULL << 15) + +/* + * Memory type flags that can be or'ed together in the mask, but only + * one appears in flags. + */ + +/* System memory */ +#define DRM_BO_FLAG_MEM_LOCAL (1ULL << 24) +/* Translation table memory */ +#define DRM_BO_FLAG_MEM_TT (1ULL << 25) +/* Vram memory */ +#define DRM_BO_FLAG_MEM_VRAM (1ULL << 26) +/* Up to the driver to define. */ +#define DRM_BO_FLAG_MEM_PRIV0 (1ULL << 27) +#define DRM_BO_FLAG_MEM_PRIV1 (1ULL << 28) +#define DRM_BO_FLAG_MEM_PRIV2 (1ULL << 29) +#define DRM_BO_FLAG_MEM_PRIV3 (1ULL << 30) +#define DRM_BO_FLAG_MEM_PRIV4 (1ULL << 31) +/* We can add more of these now with a 64-bit flag type */ + +/* + * This is a mask covering all of the memory type flags; easier to just + * use a single constant than a bunch of | values. It covers + * DRM_BO_FLAG_MEM_LOCAL through DRM_BO_FLAG_MEM_PRIV4 + */ +#define DRM_BO_MASK_MEM 0x00000000FF000000ULL +/* + * This adds all of the CPU-mapping options in with the memory + * type to label all bits which change how the page gets mapped + */ +#define DRM_BO_MASK_MEMTYPE (DRM_BO_MASK_MEM | \ + DRM_BO_FLAG_CACHED_MAPPED | \ + DRM_BO_FLAG_CACHED | \ + DRM_BO_FLAG_MAPPABLE) + +/* Driver-private flags */ +#define DRM_BO_MASK_DRIVER 0xFFFF000000000000ULL + +/* + * Don't block on validate and map. Instead, return EBUSY. + */ +#define DRM_BO_HINT_DONT_BLOCK 0x00000002 +/* + * Don't place this buffer on the unfenced list. This means + * that the buffer will not end up having a fence associated + * with it as a result of this operation + */ +#define DRM_BO_HINT_DONT_FENCE 0x00000004 +/** + * On hardware with no interrupt events for operation completion, + * indicates that the kernel should sleep while waiting for any blocking + * operation to complete rather than spinning. + * + * Has no effect otherwise. + */ +#define DRM_BO_HINT_WAIT_LAZY 0x00000008 +/* + * The client has compute relocations refering to this buffer using the + * offset in the presumed_offset field. If that offset ends up matching + * where this buffer lands, the kernel is free to skip executing those + * relocations + */ +#define DRM_BO_HINT_PRESUMED_OFFSET 0x00000010 + +#define DRM_BO_INIT_MAGIC 0xfe769812 +#define DRM_BO_INIT_MAJOR 1 +#define DRM_BO_INIT_MINOR 0 +#define DRM_BO_INIT_PATCH 0 + + +struct drm_bo_info_req { + uint64_t mask; + uint64_t flags; + unsigned int handle; + unsigned int hint; + unsigned int fence_class; + unsigned int desired_tile_stride; + unsigned int tile_info; + unsigned int pad64; + uint64_t presumed_offset; +}; + +struct drm_bo_create_req { + uint64_t flags; + uint64_t size; + uint64_t buffer_start; + unsigned int hint; + unsigned int page_alignment; +}; + + +/* + * Reply flags + */ + +#define DRM_BO_REP_BUSY 0x00000001 + +struct drm_bo_info_rep { + uint64_t flags; + uint64_t proposed_flags; + uint64_t size; + uint64_t offset; + uint64_t arg_handle; + uint64_t buffer_start; + unsigned int handle; + unsigned int fence_flags; + unsigned int rep_flags; + unsigned int page_alignment; + unsigned int desired_tile_stride; + unsigned int hw_tile_stride; + unsigned int tile_info; + unsigned int pad64; + uint64_t expand_pad[4]; /*Future expansion */ +}; + +struct drm_bo_arg_rep { + struct drm_bo_info_rep bo_info; + int ret; + unsigned int pad64; +}; + +struct drm_bo_create_arg { + union { + struct drm_bo_create_req req; + struct drm_bo_info_rep rep; + } d; +}; + +struct drm_bo_handle_arg { + unsigned int handle; +}; + +struct drm_bo_reference_info_arg { + union { + struct drm_bo_handle_arg req; + struct drm_bo_info_rep rep; + } d; +}; + +struct drm_bo_map_wait_idle_arg { + union { + struct drm_bo_info_req req; + struct drm_bo_info_rep rep; + } d; +}; + +struct drm_bo_op_req { + enum { + drm_bo_validate, + drm_bo_fence, + drm_bo_ref_fence, + } op; + unsigned int arg_handle; + struct drm_bo_info_req bo_req; +}; + + +struct drm_bo_op_arg { + uint64_t next; + union { + struct drm_bo_op_req req; + struct drm_bo_arg_rep rep; + } d; + int handled; + unsigned int pad64; +}; + + +#define DRM_BO_MEM_LOCAL 0 +#define DRM_BO_MEM_TT 1 +#define DRM_BO_MEM_VRAM 2 +#define DRM_BO_MEM_PRIV0 3 +#define DRM_BO_MEM_PRIV1 4 +#define DRM_BO_MEM_PRIV2 5 +#define DRM_BO_MEM_PRIV3 6 +#define DRM_BO_MEM_PRIV4 7 + +#define DRM_BO_MEM_TYPES 8 /* For now. */ + +#define DRM_BO_LOCK_UNLOCK_BM (1 << 0) +#define DRM_BO_LOCK_IGNORE_NO_EVICT (1 << 1) + +struct drm_bo_version_arg { + uint32_t major; + uint32_t minor; + uint32_t patchlevel; +}; + +struct drm_mm_type_arg { + unsigned int mem_type; + unsigned int lock_flags; +}; + +struct drm_mm_init_arg { + unsigned int magic; + unsigned int major; + unsigned int minor; + unsigned int mem_type; + uint64_t p_offset; + uint64_t p_size; +}; + +struct drm_mm_info_arg { + unsigned int mem_type; + uint64_t p_size; +}; + +struct drm_gem_close { + /** Handle of the object to be closed. */ + uint32_t handle; + uint32_t pad; +}; + +struct drm_gem_flink { + /** Handle for the object being named */ + uint32_t handle; + + /** Returned global name */ + uint32_t name; +}; + +struct drm_gem_open { + /** Name of object being opened */ + uint32_t name; + + /** Returned handle for the object */ + uint32_t handle; + + /** Returned size of the object */ + uint64_t size; +}; + +struct drm_get_cap { + uint64_t capability; + uint64_t value; +}; + +struct drm_event { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 22 11:42:23 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A1B191065679; Tue, 22 May 2012 11:42:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 376C48FC17; Tue, 22 May 2012 11:42:23 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4MBgEaD032723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 May 2012 21:42:15 +1000 Date: Tue, 22 May 2012 21:42:14 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hartmut Brandt In-Reply-To: <201205220723.q4M7Ng2I091715@svn.freebsd.org> Message-ID: <20120522212307.V1971@besplex.bde.org> References: <201205220723.q4M7Ng2I091715@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235777 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 11:42:23 -0000 On Tue, 22 May 2012, Hartmut Brandt wrote: > Log: > Make dumptid non-static. It is used by libkvm to detect whether > this is a VNET-kernel or not. gcc used to put the static symbol into > the symbol table, clang does not. This fixes the 'netstat: no namelist' > error seen on clang+VNET systems. > > Modified: > head/sys/kern/kern_shutdown.c That would be a bug in clang if it were done for static symbols generally, but here the bug seems to be that the symbol is not declared as __used. gcc does the same for a file containing only "static int x;", but it is apparently confused by dumptid being initialized non-statically, although the initialization has no side effects. If dumptid were a local variable, then clang would probably warn about the variable being unused, but gcc-4.2.1 never detects such unused variables (thus code that compiles with gcc -Wunused -Werror often fails with clang). Here the initialization is to curthread->td_tid, so it isn't clear if the compiler can tell if it has no side effects. curthread() is actually __curthread(). __curthread() is now declared as __pure2, but that never worked for me with older compilers (its result wasn't cached). If the compilers can tell that the expression has no side effects, then it is another bug that they don't warn about it having no effect when it is only assigned to the apparently-unused variable dumptid. > Modified: head/sys/kern/kern_shutdown.c > ============================================================================== > --- head/sys/kern/kern_shutdown.c Tue May 22 07:04:23 2012 (r235776) > +++ head/sys/kern/kern_shutdown.c Tue May 22 07:23:41 2012 (r235777) > @@ -151,7 +151,7 @@ static struct dumperinfo dumper; /* our > > /* Context information for dump-debuggers. */ > static struct pcb dumppcb; /* Registers. */ > -static lwpid_t dumptid; /* Thread ID. */ > +lwpid_t dumptid; /* Thread ID. */ > > static void poweroff_wait(void *, int); > static void shutdown_halt(void *junk, int howto); Now there are 3 bugs instead of 1: - the variable is declared (implicit) extern instead of static - the extern declaration is in a section for static declaration - the variable is still not declared as __used. If the compiler did a more extensive usage analysis, that looked at all object files but not at the libkvm API, then it should remove this variable anyway when it is not declared as __used. Bruce From owner-svn-src-all@FreeBSD.ORG Tue May 22 11:53:41 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79DDF1065673; Tue, 22 May 2012 11:53:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 01D428FC19; Tue, 22 May 2012 11:53:40 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4MBrWv4023321 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 May 2012 21:53:33 +1000 Date: Tue, 22 May 2012 21:53:32 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hartmut Brandt In-Reply-To: <201205220959.q4M9xoB2095552@svn.freebsd.org> Message-ID: <20120522214349.I1971@besplex.bde.org> References: <201205220959.q4M9xoB2095552@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235780 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 11:53:41 -0000 On Tue, 22 May 2012, Hartmut Brandt wrote: > Log: > Fix a compilation error with some compilers: __attribute__ > requires two parenthesis for its argument, but instead of using > __attribute__ directly, use the appropriate __nonnull macro > from cdefs.h. This also fixes: - the style bug of hard-coding __attribute__(()) - the namespace pollution of using nonnull() instead of __nonnull__(). > Modified: head/include/malloc_np.h > ============================================================================== > --- head/include/malloc_np.h Tue May 22 09:27:57 2012 (r235779) > +++ head/include/malloc_np.h Tue May 22 09:59:49 2012 (r235780) > @@ -55,13 +55,11 @@ int mallctlbymib(const size_t *mib, size > #define ALLOCM_ERR_OOM 1 > #define ALLOCM_ERR_NOT_MOVED 2 > > -int allocm(void **ptr, size_t *rsize, size_t size, int flags) > - __attribute__(nonnull(1)); > +int allocm(void **ptr, size_t *rsize, size_t size, int flags) __nonnull(1); > int rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, > - int flags) __attribute__(nonnull(1)); > -int sallocm(const void *ptr, size_t *rsize, int flags) > - __attribute__(nonnull(1)); > -int dallocm(void *ptr, int flags) __attribute__(nonnull(1)); > + int flags) __nonnull(1); > +int sallocm(const void *ptr, size_t *rsize, int flags) __nonnull(1); > +int dallocm(void *ptr, int flags) __nonnull(1); > int nallocm(size_t *rsize, size_t size, int flags); > __END_DECLS Many unfixed bugs are visible nearby, starting with the namespace pollution of parameter names in the application namespace. Bruce From owner-svn-src-all@FreeBSD.ORG Tue May 22 12:47:48 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D14B8106566C; Tue, 22 May 2012 12:47:48 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from mailhost.dlr.de (mailhost.dlr.de [129.247.252.32]) by mx1.freebsd.org (Postfix) with ESMTP id 3879D8FC1D; Tue, 22 May 2012 12:47:48 +0000 (UTC) Received: from DLREXHUB01.intra.dlr.de (172.21.152.130) by dlrexedge01.dlr.de (172.21.163.100) with Microsoft SMTP Server (TLS) id 14.2.298.4; Tue, 22 May 2012 14:45:54 +0200 Received: from KNOP-BEAGLE.kn.op.dlr.de (129.247.178.136) by smtp.dlr.de (172.21.152.151) with Microsoft SMTP Server (TLS) id 14.2.298.4; Tue, 22 May 2012 14:45:55 +0200 Date: Tue, 22 May 2012 14:46:01 +0200 From: Hartmut Brandt X-X-Sender: brandt_h@KNOP-BEAGLE.kn.op.dlr.de To: Bruce Evans In-Reply-To: <20120522212307.V1971@besplex.bde.org> Message-ID: References: <201205220723.q4M7Ng2I091715@svn.freebsd.org> <20120522212307.V1971@besplex.bde.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [129.247.178.136] Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Hartmut Brandt Subject: Re: svn commit: r235777 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 12:47:49 -0000 On Tue, 22 May 2012, Bruce Evans wrote: BE>On Tue, 22 May 2012, Hartmut Brandt wrote: BE> BE>> Log: BE>> Make dumptid non-static. It is used by libkvm to detect whether BE>> this is a VNET-kernel or not. gcc used to put the static symbol into BE>> the symbol table, clang does not. This fixes the 'netstat: no namelist' BE>> error seen on clang+VNET systems. BE>> BE>> Modified: BE>> head/sys/kern/kern_shutdown.c BE> BE>That would be a bug in clang if it were done for static symbols generally, BE>but here the bug seems to be that the symbol is not declared as __used. I don't get this. Why should a symbol declared static be in the symbol table (except for debugging purposes) ? It has internal linkage and so has a meaning only in the given file. What is the linker supposed to do with several static symbols with the same name from several object files? If several files declared static dumptids, which one would kldsym be supposed to return? harti BE> BE>gcc does the same for a file containing only "static int x;", but it BE>is apparently confused by dumptid being initialized non-statically, BE>although the initialization has no side effects. If dumptid were a BE>local variable, then clang would probably warn about the variable being BE>unused, but gcc-4.2.1 never detects such unused variables (thus code BE>that compiles with gcc -Wunused -Werror often fails with clang). Here BE>the initialization is to curthread->td_tid, so it isn't clear if the BE>compiler can tell if it has no side effects. curthread() is actually BE>__curthread(). __curthread() is now declared as __pure2, but that BE>never worked for me with older compilers (its result wasn't cached). BE>If the compilers can tell that the expression has no side effects, BE>then it is another bug that they don't warn about it having no effect BE>when it is only assigned to the apparently-unused variable dumptid. BE> BE>> Modified: head/sys/kern/kern_shutdown.c BE>> ============================================================================== BE>> --- head/sys/kern/kern_shutdown.c Tue May 22 07:04:23 2012 BE>> (r235776) BE>> +++ head/sys/kern/kern_shutdown.c Tue May 22 07:23:41 2012 BE>> (r235777) BE>> @@ -151,7 +151,7 @@ static struct dumperinfo dumper; /* our BE>> BE>> /* Context information for dump-debuggers. */ BE>> static struct pcb dumppcb; /* Registers. */ BE>> -static lwpid_t dumptid; /* Thread ID. */ BE>> +lwpid_t dumptid; /* Thread ID. */ BE>> BE>> static void poweroff_wait(void *, int); BE>> static void shutdown_halt(void *junk, int howto); BE> BE>Now there are 3 bugs instead of 1: BE>- the variable is declared (implicit) extern instead of static BE>- the extern declaration is in a section for static declaration BE>- the variable is still not declared as __used. If the compiler did BE> a more extensive usage analysis, that looked at all object files but BE> not at the libkvm API, then it should remove this variable anyway BE> when it is not declared as __used. BE> BE>Bruce BE> BE> From owner-svn-src-all@FreeBSD.ORG Tue May 22 13:14:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E44FD106566B; Tue, 22 May 2012 13:14: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 B42B38FC08; Tue, 22 May 2012 13:14: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 q4MDELhu003738; Tue, 22 May 2012 13:14:21 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MDELMT003737; Tue, 22 May 2012 13:14:21 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201205221314.q4MDELMT003737@svn.freebsd.org> From: Sean Bruno Date: Tue, 22 May 2012 13:14: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: r235784 - stable/7/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 13:14:22 -0000 Author: sbruno Date: Tue May 22 13:14:21 2012 New Revision: 235784 URL: http://svn.freebsd.org/changeset/base/235784 Log: Update mergeinfo to reflect MFC r235634 Fix and update battery status bits according to linux driver Actual merge occured at r235636 Modified: Directory Properties: stable/7/sys/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue May 22 13:32:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DBB6106564A; Tue, 22 May 2012 13:32:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id 323CF8FC08; Tue, 22 May 2012 13:32:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [192.168.1.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id 3A123A7071; Tue, 22 May 2012 15:31:41 +0200 (CEST) Message-ID: <4FBB9551.6060407@FreeBSD.org> Date: Tue, 22 May 2012 15:32:01 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120512 Thunderbird/13.0 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> In-Reply-To: <86likkpla9.fsf@ds4.des.no> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 13:32:04 -0000 On 2012-05-22 12:22, Dag-Erling Sm=C3=B8rgrav wrote: > Baptiste Daroussin writes: >> Log: >> Import byacc from invisible island, it brings us lots of compatibili= ties with >> bison, keeping full compatibility with our previous yacc >> implementation. >=20 > This commit broke the build, in large part because Baptiste tested with= > Clang instead of GCC, and GCC generates a warning when compiling the > generated code. It doesn't seem to compile with clang either, at least not as of r235777:= /usr/src/bin/expr/expr.y:291:2: error: implicit declaration of function '= yyparse' is invalid in C99 [-Werror,-Wimplicit-function-declaration] yyparse(); ^ Note that it looks like the expr.c file is still generated with the system yacc, so I'm not entirely sure what's going on here... From owner-svn-src-all@FreeBSD.ORG Tue May 22 13:42:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 544581065702; Tue, 22 May 2012 13:42:48 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id B60048FC19; Tue, 22 May 2012 13:42:47 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 19D046B81; Tue, 22 May 2012 13:42:47 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id DB9959267; Tue, 22 May 2012 15:42:46 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Dimitry Andric References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> Date: Tue, 22 May 2012 15:42:46 +0200 In-Reply-To: <4FBB9551.6060407@FreeBSD.org> (Dimitry Andric's message of "Tue, 22 May 2012 15:32:01 +0200") Message-ID: <86txz8nxgp.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 13:42:48 -0000 Dimitry Andric writes: > Note that it looks like the expr.c file is still generated with the > system yacc, so I'm not entirely sure what's going on here... Yes, I am currently testing a patch that (among other things) bumps __FreeBSD_version and makes yacc a bootstrap tool. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue May 22 14:20:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A597106566C; Tue, 22 May 2012 14:20:08 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 466628FC18; Tue, 22 May 2012 14:20:08 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q4MEEfT5044659; Tue, 22 May 2012 09:14:41 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q4MEERTe036305 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 22 May 2012 09:14:28 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q4MEERTe036305 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1337696068; bh=9fY61Zwtw1yqm5BqFEQl/RTKjKKMrodLe2ejqn4XSYk=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=BsH6WQT6QcINcM1LmeUh1KkJGQVEHoYnFQWv6//iyFwtoMshM2Aq1sBhNXxCPLPEj u2uzCKOjwc5geQnm+Y3DvzZ0YF83pw3GLLT+ve1qeIly2bOl+yM7mExwUFT0BAKE9O ASGy7HNXlCxqtSUfhwimXDm0zzBwwx8W+Y0JFzpA= Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <20120522163814.T1056@besplex.bde.org> Date: Tue, 22 May 2012 09:14:27 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <41955DCF-552D-4E44-849D-8C2CD42D7B79@palisadesystems.com> References: <201205212104.q4LL4UDN072617@svn.freebsd.org> <20120522163814.T1056@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1278) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 22 May 2012 09:14:28 -0500 (CDT) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q4MEERTe036305 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=0.884, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, J_CHICKENPOX_54 0.60, J_CHICKENPOX_63 0.60, J_CHICKENPOX_83 0.60, RP_8BIT 1.98) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Guy Helmer Subject: Re: svn commit: r235739 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 14:20:08 -0000 On May 22, 2012, at 1:48 AM, Bruce Evans wrote: > On Mon, 21 May 2012, Guy Helmer wrote: >=20 >> Log: >> Apply style(9) to return and switch/case statements. >>=20 >> Reviewed by: delphij (prior version of the patch) >>=20 >> Modified: >> head/lib/libc/gen/getnetgrent.c >>=20 >> Modified: head/lib/libc/gen/getnetgrent.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/libc/gen/getnetgrent.c Mon May 21 19:58:40 2012 = (r235738) >> +++ head/lib/libc/gen/getnetgrent.c Mon May 21 21:04:29 2012 = (r235739) >> ... >> @@ -311,32 +311,35 @@ _revnetgr_lookup(char* lookupdom, char* >>=20 >> for (rot =3D 0; ; rot++) { >> switch (rot) { >> - case(0): snprintf(key, MAXHOSTNAMELEN, "%s.%s", >> - str, dom?dom:lookupdom); >> - break; >> - case(1): snprintf(key, MAXHOSTNAMELEN, "%s.*", >> - str); >> - break; >> - case(2): snprintf(key, MAXHOSTNAMELEN, "*.%s", >> - dom?dom:lookupdom); >> - break; >> - case(3): snprintf(key, MAXHOSTNAMELEN, "*.*"); >> - break; >> - default: return(0); >> + case(0): >> + snprintf(key, MAXHOSTNAMELEN, "%s.%s", str, >> + dom ? dom : lookupdom); >> + break; >> + case(1): >> + snprintf(key, MAXHOSTNAMELEN, "%s.*", str); >> + break; >> + case(2): >> + snprintf(key, MAXHOSTNAMELEN, "*.%s", >> + dom ? dom : lookupdom); >> + break; >> + case(3): >> + snprintf(key, MAXHOSTNAMELEN, "*.*"); >> + break; >=20 > Thanks, but a fuller application would have removed the obfuscatory > parentheses that make case() look like a function call... >=20 >> + default: return (0); >=20 > ... and split the case statements after ":" in all cases. >=20 >> } >> y =3D yp_match(lookupdom, map, key, strlen(key), = &result, >> &resultlen); >=20 > You fixed the continuation indentation in the case statement but not = here. >=20 >> if (y =3D=3D 0) { >> rv =3D _listmatch(result, group, resultlen); >> free(result); >> - if (rv) return(1); >> + if (rv) return (1); >=20 > Another statement not started on a new line. >=20 >> } else if (y !=3D YPERR_KEY) { >> /* >> * If we get an error other than 'no >> * such key in map' then something is >> * wrong and we should stop the search. >> */ >> - return(-1); >> + return (-1); >> } >> } >> } >=20 > These style bugs weren't in the CSRG version of course. The YP code = added > many. The most obvious ones are the case(n) and gnu-style = continuation > indentation. >=20 I am not sure how to best resolve the long lines in the block of code to = free grp->ng_str[] elements. The indentation is quite deep at that = point, and breaking short statements over multiple lines would make the = code quite ugly. Would this resolve the other issues you pointed out? Index: lib/libc/gen/getnetgrent.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libc/gen/getnetgrent.c (revision 235784) +++ lib/libc/gen/getnetgrent.c (working copy) @@ -309,28 +309,30 @@ =20 for (rot =3D 0; ; rot++) { switch (rot) { - case(0): + case 0: snprintf(key, MAXHOSTNAMELEN, "%s.%s", str, dom ? dom : lookupdom); break; - case(1): + case 1: snprintf(key, MAXHOSTNAMELEN, "%s.*", str); break; - case(2): + case 2: snprintf(key, MAXHOSTNAMELEN, "*.%s", dom ? dom : lookupdom); break; - case(3): + case 3: snprintf(key, MAXHOSTNAMELEN, "*.*"); break; - default: return (0); + default: + return (0); } y =3D yp_match(lookupdom, map, key, strlen(key), = &result, - &resultlen); + &resultlen); if (y =3D=3D 0) { rv =3D _listmatch(result, group, resultlen); free(result); - if (rv) return (1); + if (rv) + return (1); } else if (y !=3D YPERR_KEY) { /* * If we get an error other than 'no @@ -418,7 +420,7 @@ parse_netgrp(const char *group) { char *spos, *epos; - int len, strpos; + int len, strpos, freepos; #ifdef DEBUG int fields; #endif @@ -476,17 +478,16 @@ } else len =3D strlen(spos); if (len > 0) { - grp->ng_str[strpos] =3D = (char *) - malloc(len + 1); + grp->ng_str[strpos] =3D + malloc(len + 1); if (grp->ng_str[strpos] = =3D=3D NULL) { - int freepos; for (freepos =3D = 0; freepos < strpos; freepos++) = free(grp->ng_str[freepos]); free(grp); return (1); } bcopy(spos, = grp->ng_str[strpos], - len + 1); + len + 1); } } else { /* @@ -508,13 +509,13 @@ * stay silent by default for compatibility's = sake. */ if (fields < 3) - fprintf(stderr, "Bad entry = (%s%s%s%s%s) in netgroup \"%s\"\n", - grp->ng_str[NG_HOST] =3D=3D= NULL ? "" : grp->ng_str[NG_HOST], - grp->ng_str[NG_USER] =3D=3D= NULL ? "" : ",", - grp->ng_str[NG_USER] =3D=3D= NULL ? "" : grp->ng_str[NG_USER], - grp->ng_str[NG_DOM] =3D=3D= NULL ? "" : ",", - grp->ng_str[NG_DOM] =3D=3D= NULL ? "" : grp->ng_str[NG_DOM], - lp->l_groupname); + fprintf(stderr, "Bad entry (%s%s%s%s%s) = in netgroup \"%s\"\n", + grp->ng_str[NG_HOST] =3D=3D NULL ? = "" : grp->ng_str[NG_HOST], + grp->ng_str[NG_USER] =3D=3D NULL ? = "" : ",", + grp->ng_str[NG_USER] =3D=3D NULL ? = "" : grp->ng_str[NG_USER], + grp->ng_str[NG_DOM] =3D=3D NULL ? "" = : ",", + grp->ng_str[NG_DOM] =3D=3D NULL ? "" = : grp->ng_str[NG_DOM], + lp->l_groupname); #endif } else { spos =3D strsep(&pos, ", \t"); @@ -552,7 +553,7 @@ = if(yp_get_default_domain(&_netgr_yp_domain)) continue; if (yp_match(_netgr_yp_domain, "netgroup", = group, - strlen(group), &result, = &resultlen)) { + strlen(group), &result, &resultlen)) { free(result); if (_use_only_yp) return ((struct linelist *)0); @@ -613,7 +614,7 @@ } else cont =3D 0; if (len > 0) { - linep =3D (char = *)reallocf(linep, olen + len + 1); + linep =3D reallocf(linep, olen + = len + 1); if (linep =3D=3D NULL) { free(lp->l_groupname); free(lp); -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Tue May 22 14:40:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1B5E1065677; Tue, 22 May 2012 14:40:40 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D609A8FC1C; Tue, 22 May 2012 14:40: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 q4MEee30007385; Tue, 22 May 2012 14:40:40 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MEeeic007359; Tue, 22 May 2012 14:40:40 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201205221440.q4MEeeic007359@svn.freebsd.org> From: David Chisnall Date: Tue, 22 May 2012 14:40: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: r235785 - in stable/9: contrib/gdtoa etc/mtree include include/xlocale lib/libc/gdtoa lib/libc/gen lib/libc/locale lib/libc/regex lib/libc/stdio lib/libc/stdlib lib/libc/stdtime lib/lib... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 14:40:41 -0000 Author: theraven Date: Tue May 22 14:40:39 2012 New Revision: 235785 URL: http://svn.freebsd.org/changeset/base/235785 Log: MFC the xlocale implementation. Merged revisions: 227487,227753,227807,227818,227999,228002,228875,230156,231673,232498,232601,232620,232626,232926-232927,232929,232931,232935,233173,233600,234573,234578,235239 This currently defines __NO_TLS on ARM (unlike head), because the required support function has not been MFC'd. Added: stable/9/include/xlocale/ - copied from r232498, head/include/xlocale/ stable/9/include/xlocale.h - copied, changed from r227753, head/include/xlocale.h stable/9/lib/libc/locale/DESIGN.xlocale - copied unchanged from r227753, head/lib/libc/locale/DESIGN.xlocale stable/9/lib/libc/locale/ctype.c - copied unchanged from r227753, head/lib/libc/locale/ctype.c stable/9/lib/libc/locale/ctype_l.3 - copied unchanged from r232935, head/lib/libc/locale/ctype_l.3 stable/9/lib/libc/locale/duplocale.3 - copied unchanged from r227753, head/lib/libc/locale/duplocale.3 stable/9/lib/libc/locale/freelocale.3 - copied unchanged from r227753, head/lib/libc/locale/freelocale.3 stable/9/lib/libc/locale/newlocale.3 - copied unchanged from r227753, head/lib/libc/locale/newlocale.3 stable/9/lib/libc/locale/querylocale.3 - copied unchanged from r227753, head/lib/libc/locale/querylocale.3 stable/9/lib/libc/locale/uselocale.3 - copied unchanged from r227753, head/lib/libc/locale/uselocale.3 stable/9/lib/libc/locale/xlocale.3 - copied unchanged from r227753, head/lib/libc/locale/xlocale.3 stable/9/lib/libc/locale/xlocale.c - copied, changed from r227753, head/lib/libc/locale/xlocale.c stable/9/lib/libc/locale/xlocale_private.h - copied, changed from r227753, head/lib/libc/locale/xlocale_private.h Modified: stable/9/contrib/gdtoa/gdtoaimp.h stable/9/contrib/gdtoa/strtod.c stable/9/contrib/gdtoa/strtodg.c stable/9/contrib/gdtoa/strtof.c stable/9/contrib/gdtoa/strtorQ.c stable/9/contrib/gdtoa/strtord.c stable/9/contrib/gdtoa/strtorx.c stable/9/etc/mtree/BSD.include.dist stable/9/include/Makefile stable/9/include/ctype.h stable/9/include/inttypes.h stable/9/include/langinfo.h stable/9/include/locale.h stable/9/include/monetary.h stable/9/include/runetype.h stable/9/include/stdio.h stable/9/include/stdlib.h stable/9/include/string.h stable/9/include/time.h stable/9/include/wchar.h stable/9/include/wctype.h stable/9/include/xlocale/_ctype.h stable/9/lib/libc/gdtoa/machdep_ldisQ.c stable/9/lib/libc/gdtoa/machdep_ldisd.c stable/9/lib/libc/gdtoa/machdep_ldisx.c stable/9/lib/libc/gen/_pthread_stubs.c stable/9/lib/libc/gen/fnmatch.c stable/9/lib/libc/gen/glob.c stable/9/lib/libc/locale/Makefile.inc stable/9/lib/libc/locale/Symbol.map stable/9/lib/libc/locale/ascii.c stable/9/lib/libc/locale/big5.c stable/9/lib/libc/locale/btowc.3 stable/9/lib/libc/locale/btowc.c stable/9/lib/libc/locale/collate.c stable/9/lib/libc/locale/collate.h stable/9/lib/libc/locale/collcmp.c stable/9/lib/libc/locale/ctype.3 stable/9/lib/libc/locale/digittoint.3 stable/9/lib/libc/locale/euc.c stable/9/lib/libc/locale/gb18030.c stable/9/lib/libc/locale/gb2312.c stable/9/lib/libc/locale/gbk.c stable/9/lib/libc/locale/isalnum.3 stable/9/lib/libc/locale/isalpha.3 stable/9/lib/libc/locale/isblank.3 stable/9/lib/libc/locale/iscntrl.3 stable/9/lib/libc/locale/isdigit.3 stable/9/lib/libc/locale/lmessages.c stable/9/lib/libc/locale/lmessages.h stable/9/lib/libc/locale/lmonetary.c stable/9/lib/libc/locale/lmonetary.h stable/9/lib/libc/locale/lnumeric.c stable/9/lib/libc/locale/lnumeric.h stable/9/lib/libc/locale/localeconv.3 stable/9/lib/libc/locale/localeconv.c stable/9/lib/libc/locale/mblen.c stable/9/lib/libc/locale/mblocal.h stable/9/lib/libc/locale/mbrlen.c stable/9/lib/libc/locale/mbrtowc.c stable/9/lib/libc/locale/mbsinit.c stable/9/lib/libc/locale/mbsnrtowcs.c stable/9/lib/libc/locale/mbsrtowcs.c stable/9/lib/libc/locale/mbstowcs.c stable/9/lib/libc/locale/mbtowc.c stable/9/lib/libc/locale/mskanji.c stable/9/lib/libc/locale/nextwctype.c stable/9/lib/libc/locale/nl_langinfo.c stable/9/lib/libc/locale/nomacros.c stable/9/lib/libc/locale/none.c stable/9/lib/libc/locale/runetype.c stable/9/lib/libc/locale/setlocale.c stable/9/lib/libc/locale/setrunelocale.c stable/9/lib/libc/locale/table.c stable/9/lib/libc/locale/tolower.c stable/9/lib/libc/locale/toupper.c stable/9/lib/libc/locale/utf8.c stable/9/lib/libc/locale/wcrtomb.c stable/9/lib/libc/locale/wcsftime.c stable/9/lib/libc/locale/wcsnrtombs.c stable/9/lib/libc/locale/wcsrtombs.c stable/9/lib/libc/locale/wcstod.c stable/9/lib/libc/locale/wcstof.c stable/9/lib/libc/locale/wcstoimax.c stable/9/lib/libc/locale/wcstol.c stable/9/lib/libc/locale/wcstold.c stable/9/lib/libc/locale/wcstoll.c stable/9/lib/libc/locale/wcstombs.c stable/9/lib/libc/locale/wcstoul.c stable/9/lib/libc/locale/wcstoull.c stable/9/lib/libc/locale/wcstoumax.c stable/9/lib/libc/locale/wctob.c stable/9/lib/libc/locale/wctomb.c stable/9/lib/libc/locale/wctrans.c stable/9/lib/libc/locale/wctype.c stable/9/lib/libc/locale/wcwidth.c stable/9/lib/libc/regex/regcomp.c stable/9/lib/libc/stdio/Symbol.map stable/9/lib/libc/stdio/asprintf.c stable/9/lib/libc/stdio/fgetwc.c stable/9/lib/libc/stdio/fgetwln.c stable/9/lib/libc/stdio/fgetws.c stable/9/lib/libc/stdio/fprintf.c stable/9/lib/libc/stdio/fputwc.c stable/9/lib/libc/stdio/fputws.c stable/9/lib/libc/stdio/fscanf.c stable/9/lib/libc/stdio/fwprintf.c stable/9/lib/libc/stdio/fwscanf.c stable/9/lib/libc/stdio/getwc.c stable/9/lib/libc/stdio/getwchar.c stable/9/lib/libc/stdio/local.h stable/9/lib/libc/stdio/printf.c stable/9/lib/libc/stdio/printfcommon.h stable/9/lib/libc/stdio/putwc.c stable/9/lib/libc/stdio/putwchar.c stable/9/lib/libc/stdio/scanf.c stable/9/lib/libc/stdio/snprintf.c stable/9/lib/libc/stdio/sprintf.c stable/9/lib/libc/stdio/sscanf.c stable/9/lib/libc/stdio/swprintf.c stable/9/lib/libc/stdio/swscanf.c stable/9/lib/libc/stdio/ungetwc.c stable/9/lib/libc/stdio/vasprintf.c stable/9/lib/libc/stdio/vdprintf.c stable/9/lib/libc/stdio/vfprintf.c stable/9/lib/libc/stdio/vfscanf.c stable/9/lib/libc/stdio/vfwprintf.c stable/9/lib/libc/stdio/vfwscanf.c stable/9/lib/libc/stdio/vprintf.c stable/9/lib/libc/stdio/vscanf.c stable/9/lib/libc/stdio/vsnprintf.c stable/9/lib/libc/stdio/vsprintf.c stable/9/lib/libc/stdio/vsscanf.c stable/9/lib/libc/stdio/vswprintf.c stable/9/lib/libc/stdio/vswscanf.c stable/9/lib/libc/stdio/vwprintf.c stable/9/lib/libc/stdio/vwscanf.c stable/9/lib/libc/stdio/wprintf.c stable/9/lib/libc/stdio/wscanf.c stable/9/lib/libc/stdlib/Symbol.map stable/9/lib/libc/stdlib/atof.c stable/9/lib/libc/stdlib/atoi.c stable/9/lib/libc/stdlib/atol.c stable/9/lib/libc/stdlib/atoll.c stable/9/lib/libc/stdlib/strfmon.c stable/9/lib/libc/stdlib/strtoimax.c stable/9/lib/libc/stdlib/strtol.c stable/9/lib/libc/stdlib/strtoll.c stable/9/lib/libc/stdlib/strtoul.c stable/9/lib/libc/stdlib/strtoull.c stable/9/lib/libc/stdlib/strtoumax.c stable/9/lib/libc/stdtime/strftime.c stable/9/lib/libc/stdtime/strptime.c stable/9/lib/libc/stdtime/timelocal.c stable/9/lib/libc/stdtime/timelocal.h stable/9/lib/libc/string/Symbol.map stable/9/lib/libc/string/strcasecmp.c stable/9/lib/libc/string/strcasestr.c stable/9/lib/libc/string/strcoll.c stable/9/lib/libc/string/strxfrm.c stable/9/lib/libc/string/wcscoll.c stable/9/lib/libc/string/wcswidth.c stable/9/lib/libc/string/wcsxfrm.c stable/9/sys/sys/cdefs.h Directory Properties: stable/9/contrib/gdtoa/ (props changed) stable/9/etc/ (props changed) stable/9/include/ (props changed) stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/contrib/gdtoa/gdtoaimp.h ============================================================================== --- stable/9/contrib/gdtoa/gdtoaimp.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/contrib/gdtoa/gdtoaimp.h Tue May 22 14:40:39 2012 (r235785) @@ -201,6 +201,7 @@ THIS SOFTWARE. #include "namespace.h" #include #include "un-namespace.h" +#include "xlocale_private.h" #ifdef KR_headers #define Char char @@ -525,11 +526,11 @@ extern void memcpy_D2A ANSI((void*, cons #define strtoIQ __strtoIQ #define strtoIx __strtoIx #define strtoIxL __strtoIxL -#define strtord __strtord +#define strtord_l __strtord_l #define strtordd __strtordd #define strtorf __strtorf -#define strtorQ __strtorQ -#define strtorx __strtorx +#define strtorQ_l __strtorQ_l +#define strtorx_l __strtorx_l #define strtorxL __strtorxL #define strtodI __strtodI #define strtopd __strtopd @@ -634,7 +635,7 @@ extern void memcpy_D2A ANSI((void*, cons extern Bigint *s2b ANSI((CONST char*, int, int, ULong, int)); extern Bigint *set_ones ANSI((Bigint*, int)); extern char *strcp ANSI((char*, const char*)); - extern int strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*)); + extern int strtodg_l ANSI((CONST char*, char**, FPI*, Long*, ULong*, locale_t)); extern int strtoId ANSI((CONST char *, char **, double *, double *)); extern int strtoIdd ANSI((CONST char *, char **, double *, double *)); @@ -644,17 +645,18 @@ extern void memcpy_D2A ANSI((void*, cons extern int strtoIx ANSI((CONST char *, char **, void *, void *)); extern int strtoIxL ANSI((CONST char *, char **, void *, void *)); extern double strtod ANSI((const char *s00, char **se)); + extern double strtod_l ANSI((const char *s00, char **se, locale_t)); extern int strtopQ ANSI((CONST char *, char **, Void *)); extern int strtopf ANSI((CONST char *, char **, float *)); extern int strtopd ANSI((CONST char *, char **, double *)); extern int strtopdd ANSI((CONST char *, char **, double *)); extern int strtopx ANSI((CONST char *, char **, Void *)); extern int strtopxL ANSI((CONST char *, char **, Void *)); - extern int strtord ANSI((CONST char *, char **, int, double *)); + extern int strtord_l ANSI((CONST char *, char **, int, double *, locale_t)); extern int strtordd ANSI((CONST char *, char **, int, double *)); extern int strtorf ANSI((CONST char *, char **, int, float *)); - extern int strtorQ ANSI((CONST char *, char **, int, void *)); - extern int strtorx ANSI((CONST char *, char **, int, void *)); + extern int strtorQ_l ANSI((CONST char *, char **, int, void *, locale_t)); + extern int strtorx_l ANSI((CONST char *, char **, int, void *, locale_t)); extern int strtorxL ANSI((CONST char *, char **, int, void *)); extern Bigint *sum ANSI((Bigint*, Bigint*)); extern int trailz ANSI((Bigint*)); Modified: stable/9/contrib/gdtoa/strtod.c ============================================================================== --- stable/9/contrib/gdtoa/strtod.c Tue May 22 13:14:21 2012 (r235784) +++ stable/9/contrib/gdtoa/strtod.c Tue May 22 14:40:39 2012 (r235785) @@ -82,11 +82,11 @@ sulp #endif /*}*/ double -strtod +strtod_l #ifdef KR_headers - (s00, se) CONST char *s00; char **se; + (s00, se, loc) CONST char *s00; char **se; locale_t loc #else - (CONST char *s00, char **se) + (CONST char *s00, char **se, locale_t loc) #endif { #ifdef Avoid_Underflow @@ -108,14 +108,14 @@ strtod #endif #ifdef USE_LOCALE /*{{*/ #ifdef NO_LOCALE_CACHE - char *decimalpoint = localeconv()->decimal_point; + char *decimalpoint = localeconv_l(loc)->decimal_point; int dplen = strlen(decimalpoint); #else char *decimalpoint; static char *decimalpoint_cache; static int dplen; if (!(s0 = decimalpoint_cache)) { - s0 = localeconv()->decimal_point; + s0 = localeconv_l(loc)->decimal_point; if ((decimalpoint_cache = (char*)MALLOC(strlen(s0) + 1))) { strcpy(decimalpoint_cache, s0); s0 = decimalpoint_cache; @@ -1074,3 +1074,14 @@ strtod return sign ? -dval(&rv) : dval(&rv); } + double +strtod +#ifdef KR_headers + (s00, se, loc) CONST char *s00; char **se; locale_t +#else + (CONST char *s00, char **se) +#endif +{ + return strtod_l(s00, se, __get_locale()); +} + Modified: stable/9/contrib/gdtoa/strtodg.c ============================================================================== --- stable/9/contrib/gdtoa/strtodg.c Tue May 22 13:14:21 2012 (r235784) +++ stable/9/contrib/gdtoa/strtodg.c Tue May 22 14:40:39 2012 (r235785) @@ -313,12 +313,12 @@ mantbits(U *d) } int -strtodg +strtodg_l #ifdef KR_headers - (s00, se, fpi, exp, bits) - CONST char *s00; char **se; FPI *fpi; Long *exp; ULong *bits; + (s00, se, fpi, exp, bits, loc) + CONST char *s00; char **se; FPI *fpi; Long *exp; ULong *bits; locale_t loc; #else - (CONST char *s00, char **se, FPI *fpi, Long *exp, ULong *bits) + (CONST char *s00, char **se, FPI *fpi, Long *exp, ULong *bits, locale_t loc) #endif { int abe, abits, asub; @@ -334,14 +334,14 @@ strtodg Bigint *ab, *bb, *bb1, *bd, *bd0, *bs, *delta, *rvb, *rvb0; #ifdef USE_LOCALE /*{{*/ #ifdef NO_LOCALE_CACHE - char *decimalpoint = localeconv()->decimal_point; + char *decimalpoint = localeconv_l(loc)->decimal_point; int dplen = strlen(decimalpoint); #else char *decimalpoint; static char *decimalpoint_cache; static int dplen; if (!(s0 = decimalpoint_cache)) { - s0 = localeconv()->decimal_point; + s0 = localeconv_l(loc)->decimal_point; if ((decimalpoint_cache = (char*)MALLOC(strlen(s0) + 1))) { strcpy(decimalpoint_cache, s0); s0 = decimalpoint_cache; Modified: stable/9/contrib/gdtoa/strtof.c ============================================================================== --- stable/9/contrib/gdtoa/strtof.c Tue May 22 13:14:21 2012 (r235784) +++ stable/9/contrib/gdtoa/strtof.c Tue May 22 14:40:39 2012 (r235785) @@ -35,9 +35,9 @@ THIS SOFTWARE. float #ifdef KR_headers -strtof(s, sp) CONST char *s; char **sp; +strtof_l(s, sp, loc) CONST char *s; char **sp; locale_t loc; #else -strtof(CONST char *s, char **sp) +strtof_l(CONST char *s, char **sp, locale_t loc) #endif { static FPI fpi0 = { 24, 1-127-24+1, 254-127-24+1, 1, SI }; @@ -51,7 +51,7 @@ strtof(CONST char *s, char **sp) #define fpi &fpi0 #endif - k = strtodg(s, sp, fpi, &exp, bits); + k = strtodg_l(s, sp, fpi, &exp, bits, loc); switch(k & STRTOG_Retmask) { case STRTOG_NoNumber: case STRTOG_Zero: @@ -82,3 +82,13 @@ strtof(CONST char *s, char **sp) u.L[0] |= 0x80000000L; return u.f; } + float +#ifdef KR_headers +strtof(s, sp) CONST char *s; char **sp; +#else +strtof(CONST char *s, char **sp) +#endif +{ + return strtof_l(s, sp, __get_locale()); +} + Modified: stable/9/contrib/gdtoa/strtorQ.c ============================================================================== --- stable/9/contrib/gdtoa/strtorQ.c Tue May 22 13:14:21 2012 (r235784) +++ stable/9/contrib/gdtoa/strtorQ.c Tue May 22 14:40:39 2012 (r235785) @@ -103,9 +103,10 @@ ULtoQ(ULong *L, ULong *bits, Long exp, i int #ifdef KR_headers -strtorQ(s, sp, rounding, L) CONST char *s; char **sp; int rounding; void *L; +strtorQ_l(s, sp, rounding, L, locale) CONST char *s; char **sp; int rounding; +void *L; locale_t locale; #else -strtorQ(CONST char *s, char **sp, int rounding, void *L) +strtorQ_l(CONST char *s, char **sp, int rounding, void *L, locale_t locale) #endif { static FPI fpi0 = { 113, 1-16383-113+1, 32766-16383-113+1, 1, SI }; @@ -120,7 +121,7 @@ strtorQ(CONST char *s, char **sp, int ro fpi1.rounding = rounding; fpi = &fpi1; } - k = strtodg(s, sp, fpi, &exp, bits); + k = strtodg_l(s, sp, fpi, &exp, bits, locale); ULtoQ((ULong*)L, bits, exp, k); return k; } Modified: stable/9/contrib/gdtoa/strtord.c ============================================================================== --- stable/9/contrib/gdtoa/strtord.c Tue May 22 13:14:21 2012 (r235784) +++ stable/9/contrib/gdtoa/strtord.c Tue May 22 14:40:39 2012 (r235785) @@ -70,9 +70,10 @@ ULtod(ULong *L, ULong *bits, Long exp, i int #ifdef KR_headers -strtord(s, sp, rounding, d) CONST char *s; char **sp; int rounding; double *d; +strtord_l(s, sp, rounding, d, locale) CONST char *s; char **sp; int rounding; +double *d; locale_t locale; #else -strtord(CONST char *s, char **sp, int rounding, double *d) +strtord_l(CONST char *s, char **sp, int rounding, double *d, locale_t locale) #endif { static FPI fpi0 = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI }; @@ -87,7 +88,8 @@ strtord(CONST char *s, char **sp, int ro fpi1.rounding = rounding; fpi = &fpi1; } - k = strtodg(s, sp, fpi, &exp, bits); + k = strtodg_l(s, sp, fpi, &exp, bits, locale); ULtod((ULong*)d, bits, exp, k); return k; } + Modified: stable/9/contrib/gdtoa/strtorx.c ============================================================================== --- stable/9/contrib/gdtoa/strtorx.c Tue May 22 13:14:21 2012 (r235784) +++ stable/9/contrib/gdtoa/strtorx.c Tue May 22 14:40:39 2012 (r235785) @@ -106,9 +106,10 @@ ULtox(UShort *L, ULong *bits, Long exp, int #ifdef KR_headers -strtorx(s, sp, rounding, L) CONST char *s; char **sp; int rounding; void *L; +strtorx_l(s, sp, rounding, L, locale) CONST char *s; char **sp; int rounding; +void *L; locale_t locale; #else -strtorx(CONST char *s, char **sp, int rounding, void *L) +strtorx_l(CONST char *s, char **sp, int rounding, void *L, locale_t locale) #endif { static FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI }; @@ -123,7 +124,7 @@ strtorx(CONST char *s, char **sp, int ro fpi1.rounding = rounding; fpi = &fpi1; } - k = strtodg(s, sp, fpi, &exp, bits); + k = strtodg_l(s, sp, fpi, &exp, bits, locale); ULtox((UShort*)L, bits, exp, k); return k; } Modified: stable/9/etc/mtree/BSD.include.dist ============================================================================== --- stable/9/etc/mtree/BSD.include.dist Tue May 22 13:14:21 2012 (r235784) +++ stable/9/etc/mtree/BSD.include.dist Tue May 22 14:40:39 2012 (r235785) @@ -325,4 +325,6 @@ .. vm .. + xlocale + .. .. Modified: stable/9/include/Makefile ============================================================================== --- stable/9/include/Makefile Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/Makefile Tue May 22 14:40:39 2012 (r235785) @@ -6,7 +6,7 @@ .include CLEANFILES= osreldate.h version vers.c -SUBDIR= arpa gssapi protocols rpcsvc rpc +SUBDIR= arpa gssapi protocols rpcsvc rpc xlocale INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ db.h \ dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ @@ -24,7 +24,7 @@ INCS= a.out.h ar.h assert.h bitstring.h strings.h sysexits.h tar.h termios.h tgmath.h \ time.h timeconv.h timers.h ttyent.h \ ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h vis.h \ - wchar.h wctype.h wordexp.h + wchar.h wctype.h wordexp.h xlocale.h MHDRS= float.h floatingpoint.h stdarg.h Modified: stable/9/include/ctype.h ============================================================================== --- stable/9/include/ctype.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/ctype.h Tue May 22 14:40:39 2012 (r235785) @@ -78,6 +78,10 @@ int isphonogram(int); int isrune(int); int isspecial(int); #endif + +#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) +#include +#endif __END_DECLS #define isalnum(c) __sbistype((c), _CTYPE_A|_CTYPE_D) Modified: stable/9/include/inttypes.h ============================================================================== --- stable/9/include/inttypes.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/inttypes.h Tue May 22 14:40:39 2012 (r235785) @@ -45,6 +45,9 @@ typedef struct { } imaxdiv_t; __BEGIN_DECLS +#ifdef _XLOCALE_H_ +#include +#endif intmax_t imaxabs(intmax_t) __pure2; imaxdiv_t imaxdiv(intmax_t, intmax_t) __pure2; Modified: stable/9/include/langinfo.h ============================================================================== --- stable/9/include/langinfo.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/langinfo.h Tue May 22 14:40:39 2012 (r235785) @@ -130,6 +130,10 @@ typedef __nl_item nl_item; __BEGIN_DECLS char *nl_langinfo(nl_item); + +#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) +#include +#endif __END_DECLS #endif /* !_LANGINFO_H_ */ Modified: stable/9/include/locale.h ============================================================================== --- stable/9/include/locale.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/locale.h Tue May 22 14:40:39 2012 (r235785) @@ -77,6 +77,11 @@ struct lconv { __BEGIN_DECLS struct lconv *localeconv(void); char *setlocale(int, const char *); + +#if __POSIX_VISIBLE >= 200809 +#include +#endif __END_DECLS + #endif /* _LOCALE_H_ */ Modified: stable/9/include/monetary.h ============================================================================== --- stable/9/include/monetary.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/monetary.h Tue May 22 14:40:39 2012 (r235785) @@ -43,6 +43,9 @@ typedef __ssize_t ssize_t; #endif __BEGIN_DECLS +#ifdef _XLOCALE_H_ +#include +#endif ssize_t strfmon(char * __restrict, size_t, const char * __restrict, ...); __END_DECLS Modified: stable/9/include/runetype.h ============================================================================== --- stable/9/include/runetype.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/runetype.h Tue May 22 14:40:39 2012 (r235785) @@ -83,8 +83,24 @@ typedef struct { } _RuneLocale; #define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */ +__BEGIN_DECLS +extern const _RuneLocale _DefaultRuneLocale; +extern const _RuneLocale *_CurrentRuneLocale; +#if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL) +extern const _RuneLocale *__getCurrentRuneLocale(void); +#else +extern _Thread_local const _RuneLocale *_ThreadRuneLocale; +static __inline const _RuneLocale *__getCurrentRuneLocale(void) +{ -extern _RuneLocale _DefaultRuneLocale; -extern _RuneLocale *_CurrentRuneLocale; + if (_ThreadRuneLocale) + return _ThreadRuneLocale; + if (_CurrentRuneLocale) + return _CurrentRuneLocale; + return &_DefaultRuneLocale; +} +#endif /* __NO_TLS || __RUNETYPE_INTERNAL */ +#define _CurrentRuneLocale (__getCurrentRuneLocale()) +__END_DECLS #endif /* !_RUNETYPE_H_ */ Modified: stable/9/include/stdio.h ============================================================================== --- stable/9/include/stdio.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/stdio.h Tue May 22 14:40:39 2012 (r235785) @@ -107,7 +107,7 @@ struct __sbuf { * inline functions. To preserve ABI compat, these members must not * be disturbed. These members are marked below with (*). */ -typedef struct __sFILE { +struct __sFILE { unsigned char *_p; /* (*) current position in (some) buffer */ int _r; /* (*) read space left for getc() */ int _w; /* (*) write space left for putc() */ @@ -144,8 +144,11 @@ typedef struct __sFILE { int _fl_count; /* recursive lock count */ int _orientation; /* orientation for fwide() */ __mbstate_t _mbstate; /* multibyte conversion state */ -} FILE; - +}; +#ifndef _STDFILE_DECLARED +#define _STDFILE_DECLARED +typedef struct __sFILE FILE; +#endif #ifndef _STDSTREAM_DECLARED __BEGIN_DECLS extern FILE *__stdinp; @@ -222,6 +225,9 @@ __END_DECLS #define stderr __stderrp __BEGIN_DECLS +#ifdef _XLOCALE_H_ +#include +#endif /* * Functions defined in ANSI C standard. */ @@ -468,12 +474,15 @@ static __inline int __sputc(int _c, FILE (*(p)->_p = (c), (int)*(p)->_p++)) #endif +extern int __isthreaded; + +#ifndef __cplusplus + #define __sfeof(p) (((p)->_flags & __SEOF) != 0) #define __sferror(p) (((p)->_flags & __SERR) != 0) #define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) #define __sfileno(p) ((p)->_file) -extern int __isthreaded; #define feof(p) (!__isthreaded ? __sfeof(p) : (feof)(p)) #define ferror(p) (!__isthreaded ? __sferror(p) : (ferror)(p)) @@ -506,6 +515,7 @@ extern int __isthreaded; #define getchar_unlocked() getc_unlocked(stdin) #define putchar_unlocked(x) putc_unlocked(x, stdout) #endif +#endif /* __cplusplus */ __END_DECLS #endif /* !_STDIO_H_ */ Modified: stable/9/include/stdlib.h ============================================================================== --- stable/9/include/stdlib.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/stdlib.h Tue May 22 14:40:39 2012 (r235785) @@ -71,10 +71,14 @@ typedef struct { #define RAND_MAX 0x7fffffff +__BEGIN_DECLS +#ifdef _XLOCALE_H_ +#include +#endif extern int __mb_cur_max; -#define MB_CUR_MAX __mb_cur_max +extern int ___mb_cur_max(void); +#define MB_CUR_MAX (___mb_cur_max()) -__BEGIN_DECLS void abort(void) __dead2; int abs(int) __pure2; int atexit(void (*)(void)); Modified: stable/9/include/string.h ============================================================================== --- stable/9/include/string.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/string.h Tue May 22 14:40:39 2012 (r235785) @@ -132,6 +132,10 @@ void swab(const void * __restrict, void #endif /* _SWAB_DECLARED */ #endif /* __BSD_VISIBLE */ + +#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) +#include +#endif __END_DECLS #endif /* _STRING_H_ */ Modified: stable/9/include/time.h ============================================================================== --- stable/9/include/time.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/time.h Tue May 22 14:40:39 2012 (r235785) @@ -183,6 +183,10 @@ void tzsetwall(void); time_t timelocal(struct tm * const); time_t timegm(struct tm * const); #endif /* __BSD_VISIBLE */ + +#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) +#include +#endif __END_DECLS #endif /* !_TIME_H_ */ Modified: stable/9/include/wchar.h ============================================================================== --- stable/9/include/wchar.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/wchar.h Tue May 22 14:40:39 2012 (r235785) @@ -97,20 +97,23 @@ typedef __wint_t wint_t; #define WEOF ((wint_t)-1) #endif -struct __sFILE; +#ifndef _STDFILE_DECLARED +#define _STDFILE_DECLARED +typedef struct __sFILE FILE; +#endif struct tm; __BEGIN_DECLS wint_t btowc(int); -wint_t fgetwc(struct __sFILE *); +wint_t fgetwc(FILE *); wchar_t * - fgetws(wchar_t * __restrict, int, struct __sFILE * __restrict); -wint_t fputwc(wchar_t, struct __sFILE *); -int fputws(const wchar_t * __restrict, struct __sFILE * __restrict); -int fwide(struct __sFILE *, int); -int fwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, ...); -int fwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, ...); -wint_t getwc(struct __sFILE *); + fgetws(wchar_t * __restrict, int, FILE * __restrict); +wint_t fputwc(wchar_t, FILE *); +int fputws(const wchar_t * __restrict, FILE * __restrict); +int fwide(FILE *, int); +int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...); +int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...); +wint_t getwc(FILE *); wint_t getwchar(void); size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict); size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, @@ -118,13 +121,13 @@ size_t mbrtowc(wchar_t * __restrict, con int mbsinit(const mbstate_t *); size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t, mbstate_t * __restrict); -wint_t putwc(wchar_t, struct __sFILE *); +wint_t putwc(wchar_t, FILE *); wint_t putwchar(wchar_t); int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, ...); int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...); -wint_t ungetwc(wint_t, struct __sFILE *); -int vfwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, +wint_t ungetwc(wint_t, FILE *); +int vfwprintf(FILE * __restrict, const wchar_t * __restrict, __va_list); int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, __va_list); @@ -167,9 +170,9 @@ int wprintf(const wchar_t * __restrict, int wscanf(const wchar_t * __restrict, ...); #ifndef _STDSTREAM_DECLARED -extern struct __sFILE *__stdinp; -extern struct __sFILE *__stdoutp; -extern struct __sFILE *__stderrp; +extern FILE *__stdinp; +extern FILE *__stdoutp; +extern FILE *__stderrp; #define _STDSTREAM_DECLARED #endif @@ -179,7 +182,7 @@ extern struct __sFILE *__stderrp; #define putwchar(wc) fputwc(wc, __stdoutp) #if __ISO_C_VISIBLE >= 1999 -int vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, +int vfwscanf(FILE * __restrict, const wchar_t * __restrict, __va_list); int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict, __va_list); @@ -217,10 +220,14 @@ size_t wcsnrtombs(char * __restrict, con #endif #if __BSD_VISIBLE -wchar_t *fgetwln(struct __sFILE * __restrict, size_t * __restrict); +wchar_t *fgetwln(FILE * __restrict, size_t * __restrict); size_t wcslcat(wchar_t *, const wchar_t *, size_t); size_t wcslcpy(wchar_t *, const wchar_t *, size_t); #endif + +#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) +#include +#endif __END_DECLS #endif /* !_WCHAR_H_ */ Modified: stable/9/include/wctype.h ============================================================================== --- stable/9/include/wctype.h Tue May 22 13:14:21 2012 (r235784) +++ stable/9/include/wctype.h Tue May 22 14:40:39 2012 (r235785) @@ -87,6 +87,11 @@ wint_t iswrune(wint_t); wint_t iswspecial(wint_t); wint_t nextwctype(wint_t, wctype_t); #endif + +#if __POSIX_VISIBLE >= 200809 +#define _XLOCALE_WCTYPES 1 +#include +#endif /* __POSIX_VISIBLE >= 200809 */ __END_DECLS #define iswalnum(wc) __istype((wc), _CTYPE_A|_CTYPE_D) Copied and modified: stable/9/include/xlocale.h (from r227753, head/include/xlocale.h) ============================================================================== --- head/include/xlocale.h Sun Nov 20 14:45:42 2011 (r227753, copy source) +++ stable/9/include/xlocale.h Tue May 22 14:40:39 2012 (r235785) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 The FreeBSD Foundation + * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * * This software was developed by David Chisnall under sponsorship from @@ -8,16 +8,16 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -33,225 +33,52 @@ #define _XLOCALE_H_ #include - __BEGIN_DECLS +#include -/* - * Extended locale versions of the locale-aware functions from string.h. - * - * Include before to expose these. - */ #ifdef _STRING_H_ -int strcoll_l(const char *, const char *, locale_t); -size_t strxfrm_l(char *, const char *, size_t, locale_t); -int strcasecmp_l(const char *, const char *, locale_t); -char *strcasestr_l(const char *, const char *, locale_t); -int strncasecmp_l(const char *, const char *, size_t, locale_t); +#include #endif -/* - * Extended locale versions of the locale-aware functions from inttypes.h. - * - * Include before to expose these. - */ + #ifdef _INTTYPES_H_ -intmax_t -strtoimax_l(const char * __restrict, char ** __restrict, int, locale_t); -uintmax_t -strtoumax_l(const char * __restrict, char ** __restrict, int, locale_t); -intmax_t -wcstoimax_l(const wchar_t * __restrict, wchar_t ** __restrict, int , locale_t); -uintmax_t -wcstoumax_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); +#include #endif -/* - * Extended locale versions of the locale-aware functions from monetary.h. - * - * Include before to expose these. - */ + #ifdef _MONETARY_H_ -ssize_t strfmon_l(char *, size_t, locale_t, const char *, ...) -# if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 - __attribute__((__format__ (__strfmon__, 4, 5))) -# endif - ; +#include #endif -/* - * Extended locale versions of the locale-aware functions from stdlib.h. - * - * Include before to expose these. - */ #ifdef _STDLIB_H_ -double atof_l(const char *, locale_t); -int atoi_l(const char *, locale_t); -long atol_l(const char *, locale_t); -long long atoll_l(const char *, locale_t); -int mblen_l(const char *, size_t, locale_t); -size_t -mbstowcs_l(wchar_t * __restrict, const char * __restrict, size_t, locale_t); -int -mbtowc_l(wchar_t * __restrict, const char * __restrict, size_t, locale_t); -double strtod_l(const char *, char **, locale_t); -float strtof_l(const char *, char **, locale_t); -long strtol_l(const char *, char **, int, locale_t); -long double strtold_l(const char *, char **, locale_t); -long long strtoll_l(const char *, char **, int, locale_t); -unsigned long strtoul_l(const char *, char **, int, locale_t); -unsigned long long strtoull_l(const char *, char **, int, locale_t); -size_t -wcstombs_l(char * __restrict, const wchar_t * __restrict, size_t, locale_t); -int wctomb_l(char *, wchar_t, locale_t); - -int ___mb_cur_max_l(locale_t); -#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) - +#include #endif -/* - * Extended locale versions of the locale-aware functions from time.h. - * - * Include before to expose these. - */ + #ifdef _TIME_H_ -size_t -strftime_l(char * __restrict, size_t, const char * __restrict, const - struct tm * __restrict, locale_t) -# if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 - __attribute__((__format__ (__strftime__, 3, 0))) -# endif - ; -char * -strptime_l(const char * __restrict, const char * __restrict, - struct tm * __restrict, locale_t); +#include #endif + #ifdef _LANGINFO_H_ -char *nl_langinfo_l(nl_item, locale_t); +#include #endif + #ifdef _CTYPE_H_ -#include <_xlocale_ctype.h> +#include #endif + #ifdef _WCTYPE_H_ -#define XLOCALE_WCTYPES 1 -#include <_xlocale_ctype.h> +#define _XLOCALE_WCTYPES 1 +#include #endif #ifdef _STDIO_H_ -int fprintf_l(FILE * __restrict, locale_t, const char * __restrict, ...) - __printflike(3, 4); -int fscanf_l(FILE * __restrict, locale_t, const char * __restrict, ...) - __scanflike(3, 4); -int printf_l(locale_t, const char * __restrict, ...) __printflike(2, 3); -int scanf_l(locale_t, const char * __restrict, ...) __scanflike(2, 3); -int sprintf_l(char * __restrict, locale_t, const char * __restrict, ...) - __printflike(3, 4); -int sscanf_l(const char * __restrict, locale_t, const char * __restrict, ...) - __scanflike(3, 4); -int vfprintf_l(FILE * __restrict, locale_t, const char * __restrict, __va_list) - __printflike(3, 0); -int vprintf_l(locale_t, const char * __restrict, __va_list) __printflike(2, 0); -int vsprintf_l(char * __restrict, locale_t, const char * __restrict, __va_list) - __printflike(3, 0); - -int snprintf_l(char * __restrict, size_t, locale_t, const char * __restrict, - ...) __printflike(4, 5); -int vfscanf_l(FILE * __restrict, locale_t, const char * __restrict, __va_list) - __scanflike(3, 0); -int vscanf_l(locale_t, const char * __restrict, __va_list) __scanflike(2, 0); -int vsnprintf_l(char * __restrict, size_t, locale_t, const char * __restrict, - va_list) __printflike(4, 0); -int vsscanf_l(const char * __restrict, locale_t, const char * __restrict, - va_list) __scanflike(3, 0); -int dprintf_l(int, locale_t, const char * __restrict, ...) __printflike(3, 4); -int vdprintf_l(int, locale_t, const char * __restrict, __va_list) - __printflike(3, 0); -int asprintf_l(char **, locale_t, const char *, ...) __printflike(3, 4); -int vasprintf_l(char **, locale_t, const char *, __va_list) __printflike(3, 0); +#include #endif -#ifdef _WCHAR_H_ -wint_t btowc_l(int, locale_t); -wint_t fgetwc_l(FILE *, locale_t); -wchar_t * -fgetws_l(wchar_t * __restrict, int, FILE * __restrict, locale_t); -wint_t fputwc_l(wchar_t, FILE *, locale_t); -int -fputws_l(const wchar_t * __restrict, FILE * __restrict, locale_t); -int -fwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, - ...); -int -fwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...); -wint_t getwc_l(FILE *, locale_t); -wint_t getwchar_l(locale_t); -size_t -mbrlen_l(const char * __restrict, size_t, mbstate_t * __restrict, locale_t); -size_t -mbrtowc_l(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict, locale_t); -int mbsinit_l(const mbstate_t *, locale_t); -size_t -mbsrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, - mbstate_t * __restrict, locale_t); -wint_t putwc_l(wchar_t, FILE *, locale_t); -wint_t putwchar_l(wchar_t, locale_t); -int -swprintf_l(wchar_t * __restrict, size_t n, locale_t, - const wchar_t * __restrict, ...); -int -swscanf_l(const wchar_t * __restrict, locale_t, const wchar_t * __restrict, - ...); -wint_t ungetwc_l(wint_t, FILE *, locale_t); -int -vfwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, - __va_list); -int -vswprintf_l(wchar_t * __restrict, size_t n, locale_t, - const wchar_t * __restrict, __va_list); -int vwprintf_l(locale_t, const wchar_t * __restrict, __va_list); -size_t -wcrtomb_l(char * __restrict, wchar_t, mbstate_t * __restrict, locale_t); -int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); -size_t -wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict, - const struct tm * __restrict, locale_t); -size_t -wcsrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, - mbstate_t * __restrict, locale_t); -double wcstod_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); -long -wcstol_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); -unsigned long -wcstoul_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); -int wcswidth_l(const wchar_t *, size_t, locale_t); -size_t -wcsxfrm_l(wchar_t * __restrict, const wchar_t * __restrict, size_t, locale_t); -int wctob_l(wint_t, locale_t); -int wcwidth_l(wchar_t, locale_t); -int wprintf_l(locale_t, const wchar_t * __restrict, ...); -int wscanf_l(locale_t, const wchar_t * __restrict, ...); - -int -vfwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, - __va_list); -int vswscanf_l(const wchar_t * __restrict, locale_t, -const wchar_t *__restrict, __va_list); -int vwscanf_l(locale_t, const wchar_t * __restrict, __va_list); -float wcstof_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); -long double -wcstold_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); -long long -wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); -unsigned long long -wcstoull_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); -size_t -mbsnrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, size_t, - mbstate_t * __restrict, locale_t); -int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t); -int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t); -size_t -wcsnrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, size_t, - mbstate_t * __restrict, locale_t); +#ifdef _WCHAR_H_ +#include #endif + + struct lconv *localeconv_l(locale_t); __END_DECLS Modified: stable/9/include/xlocale/_ctype.h ============================================================================== --- head/include/xlocale/_ctype.h Sun Mar 4 15:31:13 2012 (r232498) +++ stable/9/include/xlocale/_ctype.h Tue May 22 14:40:39 2012 (r235785) @@ -55,11 +55,11 @@ _RuneLocale *__runes_for_locale(locale_t #ifndef _XLOCALE_INLINE #if __GNUC__ && !__GNUC_STDC_INLINE__ /* GNU89 inline has nonstandard semantics. */ -#define _XLOCALE_INLINE extern inline +#define _XLOCALE_INLINE extern __inline #else /* Hack to work around people who define inline away */ #ifdef inline -#define _XLOCALE_INLINE __inline static +#define _XLOCALE_INLINE static __inline #else /* Define with C++ / C99 compatible semantics */ #define _XLOCALE_INLINE inline @@ -68,19 +68,24 @@ _RuneLocale *__runes_for_locale(locale_t #endif /* _XLOCALE_INLINE */ #ifdef _XLOCALE_WCTYPES -static __inline int -__maskrune_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +_XLOCALE_INLINE int +__maskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc); +_XLOCALE_INLINE int +__istype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc); + +_XLOCALE_INLINE int +__maskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc) { - int mb_sb_limit; - _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); - return (_c < 0 || _c >= _CACHED_RUNES) ? ___runetype_l(_c, locale) : - runes->__runetype[_c] & _f; + int __limit; + _RuneLocale *runes = __runes_for_locale(__loc, &__limit); + return ((__c < 0 || __c >= _CACHED_RUNES) ? ___runetype_l(__c, __loc) : + runes->__runetype[__c]) & __f; } -static __inline int -__istype_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +_XLOCALE_INLINE int +__istype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc) { - return (!!__maskrune_l(_c, _f, locale)); + return (!!__maskrune_l(__c, __f, __loc)); } #define XLOCALE_ISCTYPE(fname, cat) \ @@ -88,25 +93,30 @@ __istype_l(__ct_rune_t _c, unsigned long _XLOCALE_INLINE int isw##fname##_l(int __c, locale_t __l)\ { return __istype_l(__c, cat, __l); } #else -static __inline int -__sbmaskrune_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +_XLOCALE_INLINE int +__sbmaskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc); +_XLOCALE_INLINE int +__sbistype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc); + +_XLOCALE_INLINE int +__sbmaskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc) { - int mb_sb_limit; - _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); - return (_c < 0 || _c >= mb_sb_limit) ? 0 : - runes->__runetype[_c] & _f; + int __limit; + _RuneLocale *runes = __runes_for_locale(__loc, &__limit); + return (__c < 0 || __c >= __limit) ? 0 : + runes->__runetype[__c] & __f; } -static __inline int -__sbistype_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +_XLOCALE_INLINE int +__sbistype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc) { - return (!!__sbmaskrune_l(_c, _f, locale)); + return (!!__sbmaskrune_l(__c, __f, __loc)); } -#define XLOCALE_ISCTYPE(fname, cat) \ - _XLOCALE_INLINE int is##fname##_l(int c, locale_t l); \ - _XLOCALE_INLINE int is##fname##_l(int c, locale_t l)\ - { return __sbistype_l(c, cat, l); } +#define XLOCALE_ISCTYPE(__fname, __cat) \ + _XLOCALE_INLINE int is##__fname##_l(int, locale_t); \ + _XLOCALE_INLINE int is##__fname##_l(int __c, locale_t __l)\ + { return __sbistype_l(__c, __cat, __l); } #endif XLOCALE_ISCTYPE(alnum, _CTYPE_A|_CTYPE_D) @@ -136,15 +146,15 @@ _XLOCALE_INLINE int towupper_l(int, loca _XLOCALE_INLINE int towlower_l(int __c, locale_t __l) { - int mb_sb_limit; - _RuneLocale *__runes = __runes_for_locale(__l, &mb_sb_limit); + int __limit; + _RuneLocale *__runes = __runes_for_locale(__l, &__limit); return (__c < 0 || __c >= _CACHED_RUNES) ? ___tolower_l(__c, __l) : __runes->__maplower[__c]; } _XLOCALE_INLINE int towupper_l(int __c, locale_t __l) { - int mb_sb_limit; - _RuneLocale *__runes = __runes_for_locale(__l, &mb_sb_limit); + int __limit; + _RuneLocale *__runes = __runes_for_locale(__l, &__limit); return (__c < 0 || __c >= _CACHED_RUNES) ? ___toupper_l(__c, __l) : __runes->__mapupper[__c]; } Modified: stable/9/lib/libc/gdtoa/machdep_ldisQ.c ============================================================================== --- stable/9/lib/libc/gdtoa/machdep_ldisQ.c Tue May 22 13:14:21 2012 (r235784) +++ stable/9/lib/libc/gdtoa/machdep_ldisQ.c Tue May 22 14:40:39 2012 (r235785) @@ -2,6 +2,11 @@ * Copyright (c) 2003 David Schultz * All rights reserved. * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -38,10 +43,10 @@ __FBSDID("$FreeBSD$"); #include "gdtoaimp.h" long double -strtold(const char * __restrict s, char ** __restrict sp) +strtold_l(const char * __restrict s, char ** __restrict sp, locale_t locale) { long double result; - strtorQ(s, sp, FLT_ROUNDS, &result); + strtorQ_l(s, sp, FLT_ROUNDS, &result, locale); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 22 14:44:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B32106566C; Tue, 22 May 2012 14:44:36 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 50D798FC17; Tue, 22 May 2012 14:44:35 +0000 (UTC) Received: by qcsg15 with SMTP id g15so5076425qcs.13 for ; Tue, 22 May 2012 07:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=zRejOaO8OESRFMS7+XA8jlCiiMDx7qyYYk33c78BgdI=; b=b/yCzNoU9nRrgDtPDt7v1fgOPOz0Fig8xji0+RFyPaNznf8J13hGpV76bxB6CfHrjC BXjoNAzA3pxXc7ImLfBz3912lKQ3mlgPriS9F3NiveFCERFuzq4Z5uF5Vrrom0ZfSA4B olZTipM52S0MGMJp4veWnwqh1KexFMY6A4spGNjfzqSO+kpfE/Lnr31UGzQoFnoF8IcZ vfbo282ZGUBVI1OIuFjZN9rEX6gblNqdKhI1/bu7f6M9w1GZJKPBecyE+i+hXd03vGX3 3mAWcfmksMeGSxaH2tRcWfhT6F1FdDbC7isAbopUeIEnm9GDcGkUYnYjO6uo/fpsJvAd cr3w== MIME-Version: 1.0 Received: by 10.60.20.70 with SMTP id l6mr22911858oee.38.1337697874433; Tue, 22 May 2012 07:44:34 -0700 (PDT) Received: by 10.76.153.72 with HTTP; Tue, 22 May 2012 07:44:34 -0700 (PDT) In-Reply-To: <4FBB9551.6060407@FreeBSD.org> References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> Date: Tue, 22 May 2012 07:44:34 -0700 Message-ID: From: Garrett Cooper To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= , Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 14:44:36 -0000 On Tue, May 22, 2012 at 6:32 AM, Dimitry Andric wrote: > On 2012-05-22 12:22, Dag-Erling Sm=F8rgrav wrote: >> Baptiste Daroussin writes: >>> Log: >>> =A0 Import byacc from invisible island, it brings us lots of compatibil= ities with >>> =A0 bison, keeping full compatibility with our previous yacc >>> =A0 implementation. >> >> This commit broke the build, in large part because Baptiste tested with >> Clang instead of GCC, and GCC generates a warning when compiling the >> generated code. > > It doesn't seem to compile with clang either, at least not as of r235777: > > /usr/src/bin/expr/expr.y:291:2: error: implicit declaration of function '= yyparse' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > =A0 =A0 =A0 =A0yyparse(); > =A0 =A0 =A0 =A0^ > > Note that it looks like the expr.c file is still generated with the > system yacc, so I'm not entirely sure what's going on here... I mentioned it in a private email, but the issue is that the yacc used during the build seems to be coming from the base system (despite the fact that it's a bootstrap tool). Once I installed yacc onto my stable-9 system at work, all of the changes that should have been checked in with this commit became apparent. Thanks, -Garrett 1022 .if ${BOOTSTRAPPING} < 900006 1023 _lex=3D usr.bin/lex 1024 _yacc=3D usr.bin/yacc 1025 .endif # ... 1068 bootstrap-tools: 1069 .for _tool in \ 1070 ${_clang_tblgen} \ 1071 ${_kerberos5_bootstrap_tools} \ 1072 ${_dtrace_tools} \ 1073 ${_strfile} \ 1074 ${_gperf} \ 1075 ${_groff} \ 1076 ${_ar} \ 1077 ${_dtc} \ 1078 ${_awk} \ 1079 usr.bin/lorder \ 1080 usr.bin/makewhatis \ 1081 ${_mklocale} \ 1082 usr.bin/rpcgen \ 1083 ${_sed} \ 1084 ${_lex} \ 1085 ${_yacc} \ From owner-svn-src-all@FreeBSD.ORG Tue May 22 15:04:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E037106574B; Tue, 22 May 2012 15:04:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id 1A1CF8FC0A; Tue, 22 May 2012 15:04:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [192.168.1.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id A289CA7071; Tue, 22 May 2012 17:03:38 +0200 (CEST) Message-ID: <4FBBAADE.7000400@FreeBSD.org> Date: Tue, 22 May 2012 17:03:58 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120512 Thunderbird/13.0 MIME-Version: 1.0 To: Garrett Cooper References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 15:04:05 -0000 On 2012-05-22 16:44, Garrett Cooper wrote: ... > I mentioned it in a private email, but the issue is that the yacc > used during the build seems to be coming from the base system (despite > the fact that it's a bootstrap tool). Once I installed yacc onto my > stable-9 system at work, all of the changes that should have been > checked in with this commit became apparent. > Thanks, > -Garrett > > 1022 .if ${BOOTSTRAPPING} < 900006 Yes, Dag-Erling mentioned he will fix this particular test for head, which needs a version bump. Though I still think it might have been less churn if yacc had just continued to not declare yyparse()... :) From owner-svn-src-all@FreeBSD.ORG Tue May 22 15:08:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 402FB1065674; Tue, 22 May 2012 15:08:15 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id D7B6C8FC16; Tue, 22 May 2012 15:08:14 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 6438114E76B7; Tue, 22 May 2012 17:08:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qpB0VaAFqszY; Tue, 22 May 2012 17:08:07 +0200 (CEST) Received: from [192.168.1.117] (catv-80-98-232-12.catv.broadband.hu [80.98.232.12]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id B152C14E76B1; Tue, 22 May 2012 17:08:07 +0200 (CEST) Message-ID: <4FBBABD5.5070406@FreeBSD.org> Date: Tue, 22 May 2012 17:08:05 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120328 Thunderbird/13.0a2 MIME-Version: 1.0 To: Dimitry Andric References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> <4FBBAADE.7000400@FreeBSD.org> In-Reply-To: <4FBBAADE.7000400@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Baptiste Daroussin , src-committers@freebsd.org, Garrett Cooper , svn-src-all@freebsd.org, =?ISO-8859-1?Q?Dag-Erling_Sm=F8?=, svn-src-head@freebsd.org, =?ISO-8859-1?Q?rgrav?= Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 15:08:15 -0000 On 2012.05.22. 17:03, Dimitry Andric wrote: > ... >> > I mentioned it in a private email, but the issue is that the yacc >> >used during the build seems to be coming from the base system (despite >> >the fact that it's a bootstrap tool). Once I installed yacc onto my >> >stable-9 system at work, all of the changes that should have been >> >checked in with this commit became apparent. >> >Thanks, >> >-Garrett >> > >> >1022 .if ${BOOTSTRAPPING} < 900006 > Yes, Dag-Erling mentioned he will fix this particular test for head, > which needs a version bump. Maybe I'm missing some point but what if we always use yacc and lex from the source tree instead of from the base system? That would be the most logical way of doing this and whether they are built early or just in the world phase does not make that much difference, does it? Gabor From owner-svn-src-all@FreeBSD.ORG Tue May 22 15:26:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84F6C106566C; Tue, 22 May 2012 15:26:56 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6238FC16; Tue, 22 May 2012 15:26:56 +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 q4MFQuEO009834; Tue, 22 May 2012 15:26:56 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MFQuUN009818; Tue, 22 May 2012 15:26:56 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201205221526.q4MFQuUN009818@svn.freebsd.org> From: David Chisnall Date: Tue, 22 May 2012 15:26:56 +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: r235786 - in stable/9: include lib/libc/stdlib lib/msun/src sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 15:26:56 -0000 Author: theraven Date: Tue May 22 15:26:55 2012 New Revision: 235786 URL: http://svn.freebsd.org/changeset/base/235786 Log: Merge quick_exit and changes required for C++11 code to compile against FreeBSD headers. Merges changes from: r227472 r227475 r227475 r227476 r227476 r227490 r227490 r228322 r228323 r228329 r228330 r228528 r228529 r228529 r228901 r228918 r228918 r232971 r232971 Also bump __FreeBSD_version for this and the xlocale merge. Added: stable/9/lib/libc/stdlib/at_quick_exit.3 - copied, changed from r228323, head/lib/libc/stdlib/at_quick_exit.3 stable/9/lib/libc/stdlib/quick_exit.3 - copied, changed from r228323, head/lib/libc/stdlib/quick_exit.3 stable/9/lib/libc/stdlib/quick_exit.c - copied, changed from r228323, head/lib/libc/stdlib/quick_exit.c Modified: stable/9/include/ctype.h stable/9/include/stdlib.h stable/9/include/wctype.h stable/9/lib/libc/stdlib/Makefile.inc stable/9/lib/libc/stdlib/Symbol.map stable/9/lib/libc/stdlib/atexit.3 stable/9/lib/libc/stdlib/exit.3 stable/9/lib/msun/src/math.h stable/9/sys/sys/_null.h stable/9/sys/sys/cdefs.h stable/9/sys/sys/param.h stable/9/sys/sys/stdint.h Directory Properties: stable/9/include/ (props changed) stable/9/lib/libc/ (props changed) stable/9/lib/msun/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/include/ctype.h ============================================================================== --- stable/9/include/ctype.h Tue May 22 14:40:39 2012 (r235785) +++ stable/9/include/ctype.h Tue May 22 15:26:55 2012 (r235786) @@ -84,6 +84,7 @@ int isspecial(int); #endif __END_DECLS +#ifndef __cplusplus #define isalnum(c) __sbistype((c), _CTYPE_A|_CTYPE_D) #define isalpha(c) __sbistype((c), _CTYPE_A) #define iscntrl(c) __sbistype((c), _CTYPE_C) @@ -97,6 +98,7 @@ __END_DECLS #define isxdigit(c) __isctype((c), _CTYPE_X) /* ANSI -- locale independent */ #define tolower(c) __sbtolower(c) #define toupper(c) __sbtoupper(c) +#endif /* !__cplusplus */ #if __XSI_VISIBLE /* @@ -116,7 +118,7 @@ __END_DECLS #define toascii(c) ((c) & 0x7F) #endif -#if __ISO_C_VISIBLE >= 1999 +#if __ISO_C_VISIBLE >= 1999 && !defined(__cplusplus) #define isblank(c) __sbistype((c), _CTYPE_B) #endif Modified: stable/9/include/stdlib.h ============================================================================== --- stable/9/include/stdlib.h Tue May 22 14:40:39 2012 (r235785) +++ stable/9/include/stdlib.h Tue May 22 15:26:55 2012 (r235786) @@ -79,7 +79,7 @@ extern int __mb_cur_max; extern int ___mb_cur_max(void); #define MB_CUR_MAX (___mb_cur_max()) -void abort(void) __dead2; +_Noreturn void abort(void); int abs(int) __pure2; int atexit(void (*)(void)); double atof(const char *); @@ -89,7 +89,7 @@ void *bsearch(const void *, const void * size_t, int (*)(const void *, const void *)); void *calloc(size_t, size_t) __malloc_like; div_t div(int, int) __pure2; -void exit(int) __dead2; +_Noreturn void exit(int); void free(void *); char *getenv(const char *); long labs(long) __pure2; @@ -148,10 +148,18 @@ unsigned long long strtoull(const char * __restrict, char ** __restrict, int); #endif /* __LONG_LONG_SUPPORTED */ -void _Exit(int) __dead2; +_Noreturn void _Exit(int); #endif /* __ISO_C_VISIBLE >= 1999 */ /* + * If we're in a mode greater than C99, expose C1x functions. + */ +#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L +_Noreturn void + quick_exit(int); +int at_quick_exit(void (*)(void)); +#endif /* __ISO_C_VISIBLE >= 2011 */ +/* * Extensions made by POSIX relative to C. We don't know yet which edition * of POSIX made these extensions, so assume they've always been there until * research can be done. Modified: stable/9/include/wctype.h ============================================================================== --- stable/9/include/wctype.h Tue May 22 14:40:39 2012 (r235785) +++ stable/9/include/wctype.h Tue May 22 15:26:55 2012 (r235786) @@ -94,6 +94,7 @@ wint_t nextwctype(wint_t, wctype_t); #endif /* __POSIX_VISIBLE >= 200809 */ __END_DECLS +#ifndef __cplusplus #define iswalnum(wc) __istype((wc), _CTYPE_A|_CTYPE_D) #define iswalpha(wc) __istype((wc), _CTYPE_A) #define iswblank(wc) __istype((wc), _CTYPE_B) @@ -118,6 +119,7 @@ __END_DECLS #define iswphonogram(wc) __istype((wc), _CTYPE_Q) #define iswrune(wc) __istype((wc), 0xFFFFFF00L) #define iswspecial(wc) __istype((wc), _CTYPE_T) -#endif +#endif /* __BSD_VISIBLE */ +#endif /* __cplusplus */ #endif /* _WCTYPE_H_ */ Modified: stable/9/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/9/lib/libc/stdlib/Makefile.inc Tue May 22 14:40:39 2012 (r235785) +++ stable/9/lib/libc/stdlib/Makefile.inc Tue May 22 15:26:55 2012 (r235786) @@ -8,8 +8,8 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \ getsubopt.c hcreate.c heapsort.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c malloc.c \ - merge.c ptsname.c qsort.c qsort_r.c radixsort.c rand.c random.c \ - reallocf.c realpath.c remque.c strfmon.c strtoimax.c \ + merge.c ptsname.c qsort.c qsort_r.c quick_exit.c radixsort.c rand.c \ + random.c reallocf.c realpath.c remque.c strfmon.c strtoimax.c \ strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c @@ -18,10 +18,12 @@ SYM_MAPS+= ${.CURDIR}/stdlib/Symbol.map # machine-dependent stdlib sources .sinclude "${.CURDIR}/${LIBC_ARCH}/stdlib/Makefile.inc" -MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \ +MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 \ + at_quick_exit.3 bsearch.3 \ div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \ hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 llabs.3 lldiv.3 \ lsearch.3 malloc.3 memory.3 posix_memalign.3 ptsname.3 qsort.3 \ + quick_exit.3 \ radixsort.3 rand.3 random.3 \ realpath.3 strfmon.3 strtod.3 strtol.3 strtonum.3 strtoul.3 system.3 \ tsearch.3 Modified: stable/9/lib/libc/stdlib/Symbol.map ============================================================================== --- stable/9/lib/libc/stdlib/Symbol.map Tue May 22 14:40:39 2012 (r235785) +++ stable/9/lib/libc/stdlib/Symbol.map Tue May 22 15:26:55 2012 (r235786) @@ -97,6 +97,8 @@ FBSD_1.3 { atoi_l; atol_l; atoll_l; + at_quick_exit; + quick_exit; strtod_l; strtol_l; strtoll_l; Copied and modified: stable/9/lib/libc/stdlib/at_quick_exit.3 (from r228323, head/lib/libc/stdlib/at_quick_exit.3) ============================================================================== --- head/lib/libc/stdlib/at_quick_exit.3 Wed Dec 7 16:12:54 2011 (r228323, copy source) +++ stable/9/lib/libc/stdlib/at_quick_exit.3 Tue May 22 15:26:55 2012 (r235786) @@ -23,13 +23,13 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.\" / -.Dd December 7, 2011o.Dt ATEXIT 3 +.\" +.Dd December 7, 2011 .Dt AT_QUICK_EXIT 3 .Os .Sh NAME .Nm at_quick_exit -.Nd Registers a cleanup function to run on quick exit. +.Nd registers a cleanup function to run on quick exit .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -48,10 +48,13 @@ the program exits by calling .Xr _Exit 3 , or .Xr abort 3 . -.El +.Sh RETURN VALUES +The +.Fn at_quick_exit +function returns the value 0 if successful and a non-zero value on failure. .Sh SEE ALSO .Xr exit 3 , -.Xr at_quick_exit 3 +.Xr quick_exit 3 .Sh STANDARDS The .Fn at_quick_exit Modified: stable/9/lib/libc/stdlib/atexit.3 ============================================================================== --- stable/9/lib/libc/stdlib/atexit.3 Tue May 22 14:40:39 2012 (r235785) +++ stable/9/lib/libc/stdlib/atexit.3 Tue May 22 15:26:55 2012 (r235786) @@ -79,6 +79,7 @@ No memory was available to add the funct The existing list of functions is unmodified. .El .Sh SEE ALSO +.Xr at_quick_exit 3 .Xr exit 3 .Sh STANDARDS The Modified: stable/9/lib/libc/stdlib/exit.3 ============================================================================== --- stable/9/lib/libc/stdlib/exit.3 Tue May 22 14:40:39 2012 (r235785) +++ stable/9/lib/libc/stdlib/exit.3 Tue May 22 15:26:55 2012 (r235786) @@ -118,7 +118,9 @@ never return. .Xr _exit 2 , .Xr wait 2 , .Xr atexit 3 , +.Xr at_quick_exit 3 , .Xr intro 3 , +.Xr quick_exit 3 , .Xr sysexits 3 , .Xr tmpfile 3 .Sh STANDARDS Copied and modified: stable/9/lib/libc/stdlib/quick_exit.3 (from r228323, head/lib/libc/stdlib/quick_exit.3) ============================================================================== --- head/lib/libc/stdlib/quick_exit.3 Wed Dec 7 16:12:54 2011 (r228323, copy source) +++ stable/9/lib/libc/stdlib/quick_exit.3 Tue May 22 15:26:55 2012 (r235786) @@ -23,13 +23,13 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.\" / -.Dd December 7, 2011o.Dt ATEXIT 3 +.\" +.Dd December 7, 2011 .Dt QUICK_EXIT 3 .Os .Sh NAME .Nm quick_exit -.Nd Exits a program quickly, running minimal cleanup +.Nd exits a program quickly, running minimal cleanup .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -44,12 +44,14 @@ with .Xr at_quick_exit 3 but not any C++ destructors or cleanup code registered with .Xr atexit 3 . -.El +.Sh RETURN VALUES +The +.Fn quick_exit +function does not return. .Sh SEE ALSO -.Xr exit 3 , -.Xr at_quick_exit 3 +.Xr at_quick_exit 3 , +.Xr exit 3 .Sh STANDARDS The .Fn quick_exit function conforms to the C1x draft specification. - Copied and modified: stable/9/lib/libc/stdlib/quick_exit.c (from r228323, head/lib/libc/stdlib/quick_exit.c) ============================================================================== --- head/lib/libc/stdlib/quick_exit.c Wed Dec 7 16:12:54 2011 (r228323, copy source) +++ stable/9/lib/libc/stdlib/quick_exit.c Tue May 22 15:26:55 2012 (r235786) @@ -51,10 +51,12 @@ static struct quick_exit_handler *handle int at_quick_exit(void (*func)(void)) { - struct quick_exit_handler *h = malloc(sizeof(struct quick_exit_handler)); + struct quick_exit_handler *h; + + h = malloc(sizeof(*h)); if (NULL == h) - return 1; + return (1); h->cleanup = func; pthread_mutex_lock(&atexit_mutex); h->next = handlers; Modified: stable/9/lib/msun/src/math.h ============================================================================== --- stable/9/lib/msun/src/math.h Tue May 22 14:40:39 2012 (r235785) +++ stable/9/lib/msun/src/math.h Tue May 22 15:26:55 2012 (r235786) @@ -398,32 +398,32 @@ float significandf(float); * long double versions of ISO/POSIX math functions */ #if __ISO_C_VISIBLE >= 1999 -#if 0 +#if _DECLARE_C99_LDBL_MATH long double acoshl(long double); #endif long double acosl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double asinhl(long double); #endif long double asinl(long double); long double atan2l(long double, long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double atanhl(long double); #endif long double atanl(long double); long double cbrtl(long double); long double ceill(long double); long double copysignl(long double, long double) __pure2; -#if 0 +#if _DECLARE_C99_LDBL_MATH long double coshl(long double); #endif long double cosl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double erfcl(long double); long double erfl(long double); #endif long double exp2l(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double expl(long double); long double expm1l(long double); #endif @@ -438,18 +438,18 @@ long double frexpl(long double value, in long double hypotl(long double, long double); int ilogbl(long double) __pure2; long double ldexpl(long double, int); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double lgammal(long double); #endif long long llrintl(long double); long long llroundl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double log10l(long double); long double log1pl(long double); long double log2l(long double); #endif long double logbl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double logl(long double); #endif long lrintl(long double); @@ -461,7 +461,7 @@ long double nextafterl(long double, long double nexttoward(double, long double); float nexttowardf(float, long double); long double nexttowardl(long double, long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double powl(long double, long double); #endif long double remainderl(long double, long double); @@ -470,16 +470,16 @@ long double rintl(long double); long double roundl(long double); long double scalblnl(long double, long); long double scalbnl(long double, int); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double sinhl(long double); #endif long double sinl(long double); long double sqrtl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double tanhl(long double); #endif long double tanl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double tgammal(long double); #endif long double truncl(long double); Modified: stable/9/sys/sys/_null.h ============================================================================== --- stable/9/sys/sys/_null.h Tue May 22 14:40:39 2012 (r235785) +++ stable/9/sys/sys/_null.h Tue May 22 15:26:55 2012 (r235786) @@ -31,7 +31,9 @@ #if !defined(__cplusplus) #define NULL ((void *)0) #else -#if defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4 +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4 #define NULL __null #else #if defined(__LP64__) Modified: stable/9/sys/sys/cdefs.h ============================================================================== --- stable/9/sys/sys/cdefs.h Tue May 22 14:40:39 2012 (r235785) +++ stable/9/sys/sys/cdefs.h Tue May 22 15:26:55 2012 (r235786) @@ -308,6 +308,17 @@ #define __LONG_LONG_SUPPORTED #endif +/* C++11 exposes a load of C99 stuff */ +#if __cplusplus >= 201103L +# define __LONG_LONG_SUPPORTED +# ifndef __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS +# endif +# ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS +# endif +#endif + /* * GCC 2.95 provides `__restrict' as an extension to C90 to support the * C99-specific `restrict' type qualifier. We happen to use `__restrict' as Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Tue May 22 14:40:39 2012 (r235785) +++ stable/9/sys/sys/param.h Tue May 22 15:26:55 2012 (r235786) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900505 /* Master, propagated to newvers */ +#define __FreeBSD_version 900506 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: stable/9/sys/sys/stdint.h ============================================================================== --- stable/9/sys/sys/stdint.h Tue May 22 14:40:39 2012 (r235785) +++ stable/9/sys/sys/stdint.h Tue May 22 15:26:55 2012 (r235786) @@ -64,4 +64,11 @@ typedef __uintmax_t uintmax_t; #define _UINTMAX_T_DECLARED #endif +/* GNU and Darwin define this and people seem to think it's portable */ +#if defined(UINTPTR_MAX) && defined(UINT64_MAX) && (UINTPTR_MAX == UINT64_MAX) +#define __WORDSIZE 64 +#else +#define __WORDSIZE 32 +#endif + #endif /* !_SYS_STDINT_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue May 22 15:58:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E795B1065672; Tue, 22 May 2012 15:58:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D286F8FC15; Tue, 22 May 2012 15:58:27 +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 q4MFwRmh011480; Tue, 22 May 2012 15:58:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MFwRh6011477; Tue, 22 May 2012 15:58:27 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205221558.q4MFwRh6011477@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 22 May 2012 15:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235787 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 15:58:28 -0000 Author: trasz Date: Tue May 22 15:58:27 2012 New Revision: 235787 URL: http://svn.freebsd.org/changeset/base/235787 Log: Fix panic with RACCT that could occur in low memory (or out of swap) situations, due to fork1() calling racct_proc_exit() without calling racct_proc_fork() first. Submitted by: Mateusz Guzik (earlier version) Reviewed by: Mateusz Guzik Modified: head/sys/kern/kern_fork.c head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Tue May 22 15:26:55 2012 (r235786) +++ head/sys/kern/kern_fork.c Tue May 22 15:58:27 2012 (r235787) @@ -939,8 +939,8 @@ fail: #ifdef MAC mac_proc_destroy(newproc); #endif -fail1: racct_proc_exit(newproc); +fail1: if (vm2 != NULL) vmspace_free(vm2); uma_zfree(proc_zone, newproc); Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Tue May 22 15:26:55 2012 (r235786) +++ head/sys/kern/kern_racct.c Tue May 22 15:58:27 2012 (r235787) @@ -573,6 +573,9 @@ out: PROC_UNLOCK(child); PROC_UNLOCK(parent); + if (error != 0) + racct_proc_exit(child); + return (error); } From owner-svn-src-all@FreeBSD.ORG Tue May 22 15:59:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA21F106564A; Tue, 22 May 2012 15:59:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5AA28FC0A; Tue, 22 May 2012 15:59: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 q4MFx7Ic011546; Tue, 22 May 2012 15:59:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MFx7li011543; Tue, 22 May 2012 15:59:07 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205221559.q4MFx7li011543@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 22 May 2012 15:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235788 - in head: . sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 15:59:07 -0000 Author: des Date: Tue May 22 15:59:07 2012 New Revision: 235788 URL: http://svn.freebsd.org/changeset/base/235788 Log: Bump __FreeBSD_version for the byacc import, and update _bootstrap_tools. Modified: head/Makefile.inc1 head/sys/sys/param.h Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 22 15:58:27 2012 (r235787) +++ head/Makefile.inc1 Tue May 22 15:59:07 2012 (r235788) @@ -1021,6 +1021,9 @@ _sed= usr.bin/sed .if ${BOOTSTRAPPING} < 900006 _lex= usr.bin/lex +.endif + +.if ${BOOTSTRAPPING} < 1000013 _yacc= usr.bin/yacc .endif @@ -1081,8 +1084,8 @@ bootstrap-tools: ${_mklocale} \ usr.bin/rpcgen \ ${_sed} \ - ${_lex} \ ${_yacc} \ + ${_lex} \ usr.bin/xinstall \ ${_gensnmptree} \ usr.sbin/config Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue May 22 15:58:27 2012 (r235787) +++ head/sys/sys/param.h Tue May 22 15:59:07 2012 (r235788) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000012 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000013 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Tue May 22 16:01:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF5B1106564A; Tue, 22 May 2012 16:01:38 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 974128FC12; Tue, 22 May 2012 16:01:38 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 904856BF4; Tue, 22 May 2012 16:01:32 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 374AD928A; Tue, 22 May 2012 18:01:32 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Gabor Kovesdan References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> <4FBBAADE.7000400@FreeBSD.org> <4FBBABD5.5070406@FreeBSD.org> Date: Tue, 22 May 2012 18:01:31 +0200 In-Reply-To: <4FBBABD5.5070406@FreeBSD.org> (Gabor Kovesdan's message of "Tue, 22 May 2012 17:08:05 +0200") Message-ID: <86pq9wnr1g.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Baptiste Daroussin , src-committers@freebsd.org, Garrett Cooper , svn-src-all@freebsd.org, Dimitry Andric , svn-src-head@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 16:01:39 -0000 Gabor Kovesdan writes: > Maybe I'm missing some point but what if we always use yacc and lex > from the source tree instead of from the base system? That would be > the most logical way of doing this and whether they are built early or > just in the world phase does not make that much difference, does it? Bootstrap tools are built twice, so we try to only build them when we know that we need them, i.e. when cross-building (for machine-dependent tools) or when building on a system that has an older, incompatible version of the tool. For lex and yacc, the latter case applies, since they are machine-independent. My final test build just completed. I just committed the version bump and the bootstrap change; Baptiste will commit the yyparse() fix later today. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue May 22 16:33:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3D621065693; Tue, 22 May 2012 16:33:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89B4B8FC0C; Tue, 22 May 2012 16:33: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 q4MGXBhU013183; Tue, 22 May 2012 16:33:11 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MGXBsk013178; Tue, 22 May 2012 16:33:11 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205221633.q4MGXBsk013178@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 22 May 2012 16:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235789 - in head: sbin/devd sbin/hastd usr.bin/ar usr.bin/bc usr.bin/find usr.bin/m4 usr.bin/mkcsmapper usr.bin/mklocale usr.sbin/bluetooth/bthidd usr.sbin/bluetooth/hcsecd usr.sbin/co... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 16:33:11 -0000 Author: bapt Date: Tue May 22 16:33:10 2012 New Revision: 235789 URL: http://svn.freebsd.org/changeset/base/235789 Log: Fix world after byacc import: - old yacc(1) use to magicially append stdlib.h, while new one don't - new yacc(1) do declare yyparse by itself, fix redundant declaration of 'yyparse' Approved by: des (mentor) Modified: head/sbin/devd/parse.y head/sbin/hastd/hast.h head/sbin/hastd/parse.y head/usr.bin/ar/acpyacc.y head/usr.bin/bc/bc.y head/usr.bin/find/getdate.y head/usr.bin/m4/parser.y head/usr.bin/mkcsmapper/ldef.h head/usr.bin/mklocale/extern.h head/usr.sbin/bluetooth/bthidd/parser.y head/usr.sbin/bluetooth/hcsecd/parser.y head/usr.sbin/config/config.h head/usr.sbin/config/main.c head/usr.sbin/fifolog/lib/getdate.y head/usr.sbin/jail/config.c head/usr.sbin/jail/jailp.h Modified: head/sbin/devd/parse.y ============================================================================== --- head/sbin/devd/parse.y Tue May 22 15:59:07 2012 (r235788) +++ head/sbin/devd/parse.y Tue May 22 16:33:10 2012 (r235789) @@ -29,6 +29,7 @@ * $FreeBSD$ */ +#include #include "devd.h" #include #include Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Tue May 22 15:59:07 2012 (r235788) +++ head/sbin/hastd/hast.h Tue May 22 16:33:10 2012 (r235789) @@ -244,6 +244,5 @@ void yy_config_free(struct hastd_config void yyerror(const char *); int yylex(void); -int yyparse(void); #endif /* !_HAST_H_ */ Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Tue May 22 15:59:07 2012 (r235788) +++ head/sbin/hastd/parse.y Tue May 22 16:33:10 2012 (r235789) @@ -77,332 +77,483 @@ static int depth1_metaflush; extern void yyrestart(FILE *); -static int -isitme(const char *name) -{ - char buf[MAXHOSTNAMELEN]; - char *pos; - size_t bufsize; - - /* - * First check if the given name matches our full hostname. - */ - if (gethostname(buf, sizeof(buf)) < 0) { - pjdlog_errno(LOG_ERR, "gethostname() failed"); - return (-1); - } - if (strcmp(buf, name) == 0) - return (1); +static int isitme(const char *name); +static bool family_supported(int family); +static int node_names(char **namesp); +%} - /* - * Now check if it matches first part of the host name. - */ - pos = strchr(buf, '.'); - if (pos != NULL && (size_t)(pos - buf) == strlen(name) && - strncmp(buf, name, pos - buf) == 0) { - return (1); - } +%token CONTROL PIDFILE LISTEN REPLICATION CHECKSUM COMPRESSION METAFLUSH +%token TIMEOUT EXEC RESOURCE NAME LOCAL REMOTE SOURCE ON OFF +%token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF +%token NUM STR OB CB - /* - * At the end check if name is equal to our host's UUID. - */ - bufsize = sizeof(buf); - if (sysctlbyname("kern.hostuuid", buf, &bufsize, NULL, 0) < 0) { - pjdlog_errno(LOG_ERR, "sysctlbyname(kern.hostuuid) failed"); - return (-1); - } - if (strcasecmp(buf, name) == 0) - return (1); +%type remote_str +%type replication_type +%type checksum_type +%type compression_type +%type boolean - /* - * Looks like this isn't about us. - */ - return (0); +%union +{ + int num; + char *str; } -static bool -family_supported(int family) -{ - int sock; +%token NUM +%token STR - sock = socket(family, SOCK_STREAM, 0); - if (sock == -1 && errno == EPROTONOSUPPORT) - return (false); - if (sock >= 0) - (void)close(sock); - return (true); -} +%% -static int -node_names(char **namesp) -{ - static char names[MAXHOSTNAMELEN * 3]; - char buf[MAXHOSTNAMELEN]; - char *pos; - size_t bufsize; +statements: + | + statements statement + ; - if (gethostname(buf, sizeof(buf)) < 0) { - pjdlog_errno(LOG_ERR, "gethostname() failed"); - return (-1); +statement: + control_statement + | + pidfile_statement + | + listen_statement + | + replication_statement + | + checksum_statement + | + compression_statement + | + timeout_statement + | + exec_statement + | + metaflush_statement + | + node_statement + | + resource_statement + ; + +control_statement: CONTROL STR + { + switch (depth) { + case 0: + if (strlcpy(depth0_control, $2, + sizeof(depth0_control)) >= + sizeof(depth0_control)) { + pjdlog_error("control argument is too long."); + free($2); + return (1); + } + break; + case 1: + if (!mynode) + break; + if (strlcpy(lconfig->hc_controladdr, $2, + sizeof(lconfig->hc_controladdr)) >= + sizeof(lconfig->hc_controladdr)) { + pjdlog_error("control argument is too long."); + free($2); + return (1); + } + break; + default: + PJDLOG_ABORT("control at wrong depth level"); + } + free($2); } + ; - /* First component of the host name. */ - pos = strchr(buf, '.'); - if (pos != NULL && pos != buf) { - (void)strlcpy(names, buf, MIN((size_t)(pos - buf + 1), - sizeof(names))); - (void)strlcat(names, ", ", sizeof(names)); +pidfile_statement: PIDFILE STR + { + switch (depth) { + case 0: + if (strlcpy(depth0_pidfile, $2, + sizeof(depth0_pidfile)) >= + sizeof(depth0_pidfile)) { + pjdlog_error("pidfile argument is too long."); + free($2); + return (1); + } + break; + case 1: + if (!mynode) + break; + if (strlcpy(lconfig->hc_pidfile, $2, + sizeof(lconfig->hc_pidfile)) >= + sizeof(lconfig->hc_pidfile)) { + pjdlog_error("pidfile argument is too long."); + free($2); + return (1); + } + break; + default: + PJDLOG_ABORT("pidfile at wrong depth level"); + } + free($2); } + ; - /* Full host name. */ - (void)strlcat(names, buf, sizeof(names)); - (void)strlcat(names, ", ", sizeof(names)); +listen_statement: LISTEN STR + { + struct hastd_listen *lst; - /* Host UUID. */ - bufsize = sizeof(buf); - if (sysctlbyname("kern.hostuuid", buf, &bufsize, NULL, 0) < 0) { - pjdlog_errno(LOG_ERR, "sysctlbyname(kern.hostuuid) failed"); - return (-1); + lst = calloc(1, sizeof(*lst)); + if (lst == NULL) { + pjdlog_error("Unable to allocate memory for listen address."); + free($2); + return (1); + } + if (strlcpy(lst->hl_addr, $2, sizeof(lst->hl_addr)) >= + sizeof(lst->hl_addr)) { + pjdlog_error("listen argument is too long."); + free($2); + free(lst); + return (1); + } + switch (depth) { + case 0: + TAILQ_INSERT_TAIL(&depth0_listen, lst, hl_next); + break; + case 1: + if (mynode) + TAILQ_INSERT_TAIL(&depth0_listen, lst, hl_next); + else + free(lst); + break; + default: + PJDLOG_ABORT("listen at wrong depth level"); + } + free($2); } - (void)strlcat(names, buf, sizeof(names)); - - *namesp = names; + ; - return (0); -} +replication_statement: REPLICATION replication_type + { + switch (depth) { + case 0: + depth0_replication = $2; + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + curres->hr_replication = $2; + break; + default: + PJDLOG_ABORT("replication at wrong depth level"); + } + } + ; -void -yyerror(const char *str) -{ +replication_type: + FULLSYNC { $$ = HAST_REPLICATION_FULLSYNC; } + | + MEMSYNC { $$ = HAST_REPLICATION_MEMSYNC; } + | + ASYNC { $$ = HAST_REPLICATION_ASYNC; } + ; - pjdlog_error("Unable to parse configuration file at line %d near '%s': %s", - lineno, yytext, str); -} +checksum_statement: CHECKSUM checksum_type + { + switch (depth) { + case 0: + depth0_checksum = $2; + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + curres->hr_checksum = $2; + break; + default: + PJDLOG_ABORT("checksum at wrong depth level"); + } + } + ; -struct hastd_config * -yy_config_parse(const char *config, bool exitonerror) -{ - int ret; - - curres = NULL; - mynode = false; - depth = 0; - lineno = 0; - - depth0_timeout = HAST_TIMEOUT; - depth0_replication = HAST_REPLICATION_FULLSYNC; - depth0_checksum = HAST_CHECKSUM_NONE; - depth0_compression = HAST_COMPRESSION_HOLE; - strlcpy(depth0_control, HAST_CONTROL, sizeof(depth0_control)); - strlcpy(depth0_pidfile, HASTD_PIDFILE, sizeof(depth0_pidfile)); - TAILQ_INIT(&depth0_listen); - strlcpy(depth0_listen_tcp4, HASTD_LISTEN_TCP4, - sizeof(depth0_listen_tcp4)); - strlcpy(depth0_listen_tcp6, HASTD_LISTEN_TCP6, - sizeof(depth0_listen_tcp6)); - depth0_exec[0] = '\0'; - depth0_metaflush = 1; +checksum_type: + NONE { $$ = HAST_CHECKSUM_NONE; } + | + CRC32 { $$ = HAST_CHECKSUM_CRC32; } + | + SHA256 { $$ = HAST_CHECKSUM_SHA256; } + ; - lconfig = calloc(1, sizeof(*lconfig)); - if (lconfig == NULL) { - pjdlog_error("Unable to allocate memory for configuration."); - if (exitonerror) - exit(EX_TEMPFAIL); - return (NULL); +compression_statement: COMPRESSION compression_type + { + switch (depth) { + case 0: + depth0_compression = $2; + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + curres->hr_compression = $2; + break; + default: + PJDLOG_ABORT("compression at wrong depth level"); + } } + ; - TAILQ_INIT(&lconfig->hc_listen); - TAILQ_INIT(&lconfig->hc_resources); - - yyin = fopen(config, "r"); - if (yyin == NULL) { - pjdlog_errno(LOG_ERR, "Unable to open configuration file %s", - config); - yy_config_free(lconfig); - if (exitonerror) - exit(EX_OSFILE); - return (NULL); - } - yyrestart(yyin); - ret = yyparse(); - fclose(yyin); - if (ret != 0) { - yy_config_free(lconfig); - if (exitonerror) - exit(EX_CONFIG); - return (NULL); - } +compression_type: + NONE { $$ = HAST_COMPRESSION_NONE; } + | + HOLE { $$ = HAST_COMPRESSION_HOLE; } + | + LZF { $$ = HAST_COMPRESSION_LZF; } + ; - /* - * Let's see if everything is set up. - */ - if (lconfig->hc_controladdr[0] == '\0') { - strlcpy(lconfig->hc_controladdr, depth0_control, - sizeof(lconfig->hc_controladdr)); - } - if (lconfig->hc_pidfile[0] == '\0') { - strlcpy(lconfig->hc_pidfile, depth0_pidfile, - sizeof(lconfig->hc_pidfile)); +timeout_statement: TIMEOUT NUM + { + if ($2 <= 0) { + pjdlog_error("Negative or zero timeout."); + return (1); + } + switch (depth) { + case 0: + depth0_timeout = $2; + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + curres->hr_timeout = $2; + break; + default: + PJDLOG_ABORT("timeout at wrong depth level"); + } } - if (!TAILQ_EMPTY(&depth0_listen)) - TAILQ_CONCAT(&lconfig->hc_listen, &depth0_listen, hl_next); - if (TAILQ_EMPTY(&lconfig->hc_listen)) { - struct hastd_listen *lst; + ; - if (family_supported(AF_INET)) { - lst = calloc(1, sizeof(*lst)); - if (lst == NULL) { - pjdlog_error("Unable to allocate memory for listen address."); - yy_config_free(lconfig); - if (exitonerror) - exit(EX_TEMPFAIL); - return (NULL); +exec_statement: EXEC STR + { + switch (depth) { + case 0: + if (strlcpy(depth0_exec, $2, sizeof(depth0_exec)) >= + sizeof(depth0_exec)) { + pjdlog_error("Exec path is too long."); + free($2); + return (1); } - (void)strlcpy(lst->hl_addr, depth0_listen_tcp4, - sizeof(lst->hl_addr)); - TAILQ_INSERT_TAIL(&lconfig->hc_listen, lst, hl_next); - } else { - pjdlog_debug(1, - "No IPv4 support in the kernel, not listening on IPv4 address."); - } - if (family_supported(AF_INET6)) { - lst = calloc(1, sizeof(*lst)); - if (lst == NULL) { - pjdlog_error("Unable to allocate memory for listen address."); - yy_config_free(lconfig); - if (exitonerror) - exit(EX_TEMPFAIL); - return (NULL); + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + if (strlcpy(curres->hr_exec, $2, + sizeof(curres->hr_exec)) >= + sizeof(curres->hr_exec)) { + pjdlog_error("Exec path is too long."); + free($2); + return (1); } - (void)strlcpy(lst->hl_addr, depth0_listen_tcp6, - sizeof(lst->hl_addr)); - TAILQ_INSERT_TAIL(&lconfig->hc_listen, lst, hl_next); - } else { - pjdlog_debug(1, - "No IPv6 support in the kernel, not listening on IPv6 address."); - } - if (TAILQ_EMPTY(&lconfig->hc_listen)) { - pjdlog_error("No address to listen on."); - yy_config_free(lconfig); - if (exitonerror) - exit(EX_TEMPFAIL); - return (NULL); + break; + default: + PJDLOG_ABORT("exec at wrong depth level"); } + free($2); } - TAILQ_FOREACH(curres, &lconfig->hc_resources, hr_next) { - PJDLOG_ASSERT(curres->hr_provname[0] != '\0'); - PJDLOG_ASSERT(curres->hr_localpath[0] != '\0'); - PJDLOG_ASSERT(curres->hr_remoteaddr[0] != '\0'); + ; - if (curres->hr_replication == -1) { - /* - * Replication is not set at resource-level. - * Use global or default setting. - */ - curres->hr_replication = depth0_replication; - } - if (curres->hr_replication == HAST_REPLICATION_MEMSYNC) { - pjdlog_warning("Replication mode \"%s\" is not implemented, falling back to \"%s\".", - "memsync", "fullsync"); - curres->hr_replication = HAST_REPLICATION_FULLSYNC; - } - if (curres->hr_checksum == -1) { - /* - * Checksum is not set at resource-level. - * Use global or default setting. - */ - curres->hr_checksum = depth0_checksum; - } - if (curres->hr_compression == -1) { - /* - * Compression is not set at resource-level. - * Use global or default setting. - */ - curres->hr_compression = depth0_compression; - } - if (curres->hr_timeout == -1) { - /* - * Timeout is not set at resource-level. - * Use global or default setting. - */ - curres->hr_timeout = depth0_timeout; - } - if (curres->hr_exec[0] == '\0') { - /* - * Exec is not set at resource-level. - * Use global or default setting. - */ - strlcpy(curres->hr_exec, depth0_exec, - sizeof(curres->hr_exec)); - } - if (curres->hr_metaflush == -1) { - /* - * Metaflush is not set at resource-level. - * Use global or default setting. - */ - curres->hr_metaflush = depth0_metaflush; +metaflush_statement: METAFLUSH boolean + { + switch (depth) { + case 0: + depth0_metaflush = $2; + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + depth1_metaflush = $2; + break; + case 2: + if (!mynode) + break; + PJDLOG_ASSERT(curres != NULL); + curres->hr_metaflush = $2; + break; + default: + PJDLOG_ABORT("metaflush at wrong depth level"); } } + ; - return (lconfig); -} - -void -yy_config_free(struct hastd_config *config) -{ - struct hastd_listen *lst; - struct hast_resource *res; +boolean: + ON { $$ = 1; } + | + OFF { $$ = 0; } + ; - while ((lst = TAILQ_FIRST(&depth0_listen)) != NULL) { - TAILQ_REMOVE(&depth0_listen, lst, hl_next); - free(lst); +node_statement: ON node_start OB node_entries CB + { + mynode = false; } - while ((lst = TAILQ_FIRST(&config->hc_listen)) != NULL) { - TAILQ_REMOVE(&config->hc_listen, lst, hl_next); - free(lst); - } - while ((res = TAILQ_FIRST(&config->hc_resources)) != NULL) { - TAILQ_REMOVE(&config->hc_resources, res, hr_next); - free(res); - } - free(config); -} -%} - -%token CONTROL PIDFILE LISTEN REPLICATION CHECKSUM COMPRESSION METAFLUSH -%token TIMEOUT EXEC RESOURCE NAME LOCAL REMOTE SOURCE ON OFF -%token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF -%token NUM STR OB CB - -%type remote_str -%type replication_type -%type checksum_type -%type compression_type -%type boolean - -%union -{ - int num; - char *str; -} - -%token NUM -%token STR + ; -%% +node_start: STR + { + switch (isitme($1)) { + case -1: + free($1); + return (1); + case 0: + break; + case 1: + mynode = true; + break; + default: + PJDLOG_ABORT("invalid isitme() return value"); + } + free($1); + } + ; -statements: +node_entries: | - statements statement + node_entries node_entry ; -statement: +node_entry: control_statement | pidfile_statement | listen_statement + ; + +resource_statement: RESOURCE resource_start OB resource_entries CB + { + if (curres != NULL) { + /* + * There must be section for this node, at least with + * remote address configuration. + */ + if (!hadmynode) { + char *names; + + if (node_names(&names) != 0) + return (1); + pjdlog_error("No resource %s configuration for this node (acceptable node names: %s).", + curres->hr_name, names); + return (1); + } + + /* + * Let's see if there are some resource-level settings + * that we can use for node-level settings. + */ + if (curres->hr_provname[0] == '\0' && + depth1_provname[0] != '\0') { + /* + * Provider name is not set at node-level, + * but is set at resource-level, use it. + */ + strlcpy(curres->hr_provname, depth1_provname, + sizeof(curres->hr_provname)); + } + if (curres->hr_localpath[0] == '\0' && + depth1_localpath[0] != '\0') { + /* + * Path to local provider is not set at + * node-level, but is set at resource-level, + * use it. + */ + strlcpy(curres->hr_localpath, depth1_localpath, + sizeof(curres->hr_localpath)); + } + if (curres->hr_metaflush == -1 && depth1_metaflush != -1) { + /* + * Metaflush is not set at node-level, + * but is set at resource-level, use it. + */ + curres->hr_metaflush = depth1_metaflush; + } + + /* + * If provider name is not given, use resource name + * as provider name. + */ + if (curres->hr_provname[0] == '\0') { + strlcpy(curres->hr_provname, curres->hr_name, + sizeof(curres->hr_provname)); + } + + /* + * Remote address has to be configured at this point. + */ + if (curres->hr_remoteaddr[0] == '\0') { + pjdlog_error("Remote address not configured for resource %s.", + curres->hr_name); + return (1); + } + /* + * Path to local provider has to be configured at this + * point. + */ + if (curres->hr_localpath[0] == '\0') { + pjdlog_error("Path to local component not configured for resource %s.", + curres->hr_name); + return (1); + } + + /* Put it onto resource list. */ + TAILQ_INSERT_TAIL(&lconfig->hc_resources, curres, hr_next); + curres = NULL; + } + } + ; + +resource_start: STR + { + /* Check if there is no duplicate entry. */ + TAILQ_FOREACH(curres, &lconfig->hc_resources, hr_next) { + if (strcmp(curres->hr_name, $1) == 0) { + pjdlog_error("Resource %s configured more than once.", + curres->hr_name); + free($1); + return (1); + } + } + + /* + * Clear those, so we can tell if they were set at + * resource-level or not. + */ + depth1_provname[0] = '\0'; + depth1_localpath[0] = '\0'; + depth1_metaflush = -1; + hadmynode = false; + + curres = calloc(1, sizeof(*curres)); + if (curres == NULL) { + pjdlog_error("Unable to allocate memory for resource."); + free($1); + return (1); + } + if (strlcpy(curres->hr_name, $1, + sizeof(curres->hr_name)) >= + sizeof(curres->hr_name)) { + pjdlog_error("Resource name is too long."); + free(curres); + free($1); + return (1); + } + free($1); + curres->hr_role = HAST_ROLE_INIT; + curres->hr_previous_role = HAST_ROLE_INIT; + curres->hr_replication = -1; + curres->hr_checksum = -1; + curres->hr_compression = -1; + curres->hr_timeout = -1; + curres->hr_exec[0] = '\0'; + curres->hr_provname[0] = '\0'; + curres->hr_localpath[0] = '\0'; + curres->hr_localfd = -1; + curres->hr_localflush = true; + curres->hr_metaflush = -1; + curres->hr_remoteaddr[0] = '\0'; + curres->hr_sourceaddr[0] = '\0'; + curres->hr_ggateunit = -1; + } + ; + +resource_entries: | + resource_entries resource_entry + ; + +resource_entry: replication_statement | checksum_statement @@ -415,592 +566,447 @@ statement: | metaflush_statement | - node_statement + name_statement | - resource_statement + local_statement + | + resource_node_statement ; -control_statement: CONTROL STR +name_statement: NAME STR { switch (depth) { - case 0: - if (strlcpy(depth0_control, $2, - sizeof(depth0_control)) >= - sizeof(depth0_control)) { - pjdlog_error("control argument is too long."); + case 1: + if (strlcpy(depth1_provname, $2, + sizeof(depth1_provname)) >= + sizeof(depth1_provname)) { + pjdlog_error("name argument is too long."); free($2); return (1); } break; - case 1: + case 2: if (!mynode) break; - if (strlcpy(lconfig->hc_controladdr, $2, - sizeof(lconfig->hc_controladdr)) >= - sizeof(lconfig->hc_controladdr)) { - pjdlog_error("control argument is too long."); + PJDLOG_ASSERT(curres != NULL); + if (strlcpy(curres->hr_provname, $2, + sizeof(curres->hr_provname)) >= + sizeof(curres->hr_provname)) { + pjdlog_error("name argument is too long."); free($2); return (1); } break; default: - PJDLOG_ABORT("control at wrong depth level"); + PJDLOG_ABORT("name at wrong depth level"); } free($2); } ; -pidfile_statement: PIDFILE STR +local_statement: LOCAL STR { switch (depth) { - case 0: - if (strlcpy(depth0_pidfile, $2, - sizeof(depth0_pidfile)) >= - sizeof(depth0_pidfile)) { - pjdlog_error("pidfile argument is too long."); + case 1: + if (strlcpy(depth1_localpath, $2, + sizeof(depth1_localpath)) >= + sizeof(depth1_localpath)) { + pjdlog_error("local argument is too long."); free($2); return (1); } break; - case 1: + case 2: if (!mynode) break; - if (strlcpy(lconfig->hc_pidfile, $2, - sizeof(lconfig->hc_pidfile)) >= - sizeof(lconfig->hc_pidfile)) { - pjdlog_error("pidfile argument is too long."); + PJDLOG_ASSERT(curres != NULL); + if (strlcpy(curres->hr_localpath, $2, + sizeof(curres->hr_localpath)) >= + sizeof(curres->hr_localpath)) { + pjdlog_error("local argument is too long."); free($2); return (1); } break; default: - PJDLOG_ABORT("pidfile at wrong depth level"); + PJDLOG_ABORT("local at wrong depth level"); } free($2); } ; -listen_statement: LISTEN STR +resource_node_statement:ON resource_node_start OB resource_node_entries CB { - struct hastd_listen *lst; - - lst = calloc(1, sizeof(*lst)); - if (lst == NULL) { - pjdlog_error("Unable to allocate memory for listen address."); - free($2); - return (1); - } - if (strlcpy(lst->hl_addr, $2, sizeof(lst->hl_addr)) >= - sizeof(lst->hl_addr)) { - pjdlog_error("listen argument is too long."); - free($2); - free(lst); - return (1); - } - switch (depth) { - case 0: - TAILQ_INSERT_TAIL(&depth0_listen, lst, hl_next); - break; - case 1: - if (mynode) - TAILQ_INSERT_TAIL(&depth0_listen, lst, hl_next); - else - free(lst); - break; - default: - PJDLOG_ABORT("listen at wrong depth level"); - } - free($2); + mynode = false; } ; -replication_statement: REPLICATION replication_type +resource_node_start: STR { - switch (depth) { - case 0: - depth0_replication = $2; - break; - case 1: - PJDLOG_ASSERT(curres != NULL); - curres->hr_replication = $2; - break; - default: - PJDLOG_ABORT("replication at wrong depth level"); + if (curres != NULL) { + switch (isitme($1)) { + case -1: + free($1); + return (1); + case 0: + break; + case 1: + mynode = hadmynode = true; + break; + default: + PJDLOG_ABORT("invalid isitme() return value"); + } } + free($1); } ; -replication_type: - FULLSYNC { $$ = HAST_REPLICATION_FULLSYNC; } - | - MEMSYNC { $$ = HAST_REPLICATION_MEMSYNC; } +resource_node_entries: | - ASYNC { $$ = HAST_REPLICATION_ASYNC; } - ; - -checksum_statement: CHECKSUM checksum_type - { - switch (depth) { - case 0: - depth0_checksum = $2; - break; - case 1: - PJDLOG_ASSERT(curres != NULL); - curres->hr_checksum = $2; - break; - default: - PJDLOG_ABORT("checksum at wrong depth level"); - } - } + resource_node_entries resource_node_entry ; -checksum_type: - NONE { $$ = HAST_CHECKSUM_NONE; } +resource_node_entry: + name_statement | - CRC32 { $$ = HAST_CHECKSUM_CRC32; } + local_statement | - SHA256 { $$ = HAST_CHECKSUM_SHA256; } + remote_statement + | + source_statement + | + metaflush_statement ; -compression_statement: COMPRESSION compression_type +remote_statement: REMOTE remote_str { - switch (depth) { - case 0: - depth0_compression = $2; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 22 16:46:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D1761065672; Tue, 22 May 2012 16:46:55 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1BA98FC0A; Tue, 22 May 2012 16: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 q4MGksr2014077; Tue, 22 May 2012 16:46:54 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MGksEH014076; Tue, 22 May 2012 16:46:54 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201205221646.q4MGksEH014076@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 22 May 2012 16:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235793 - in vendor/gcc/dist: gcc/doc gcc/objc libobjc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 16:46:55 -0000 Author: obrien Date: Tue May 22 16:46:54 2012 New Revision: 235793 URL: http://svn.freebsd.org/changeset/base/235793 Log: Catch up with r220755 so it can be re-merged into HEAD. Deleted: vendor/gcc/dist/gcc/doc/objc.texi vendor/gcc/dist/gcc/objc/ vendor/gcc/dist/libobjc/ From owner-svn-src-all@FreeBSD.ORG Tue May 22 16:51:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7F9A1065783; Tue, 22 May 2012 16:51:07 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 799508FC08; Tue, 22 May 2012 16:51:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4MGp7Qp066992; Tue, 22 May 2012 16:51:07 GMT (envelope-from bapt@freebsd.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4MGp6Qk066935; Tue, 22 May 2012 16:51:06 GMT (envelope-from bapt@freebsd.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@freebsd.org using -f Date: Tue, 22 May 2012 18:51:02 +0200 From: Baptiste Daroussin To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20120522165102.GP63744@ithaqua.etoilebsd.net> References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> <4FBBAADE.7000400@FreeBSD.org> <4FBBABD5.5070406@FreeBSD.org> <86pq9wnr1g.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R3SAtXwgGp429mN7" Content-Disposition: inline In-Reply-To: <86pq9wnr1g.fsf@ds4.des.no> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, Garrett Cooper , svn-src-all@freebsd.org, Dimitry Andric , Gabor Kovesdan , svn-src-head@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 16:51:07 -0000 --R3SAtXwgGp429mN7 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 22, 2012 at 06:01:31PM +0200, Dag-Erling Sm=F8rgrav wrote: > Gabor Kovesdan writes: > > Maybe I'm missing some point but what if we always use yacc and lex > > from the source tree instead of from the base system? That would be > > the most logical way of doing this and whether they are built early or > > just in the world phase does not make that much difference, does it? >=20 > Bootstrap tools are built twice, so we try to only build them when we > know that we need them, i.e. when cross-building (for machine-dependent > tools) or when building on a system that has an older, incompatible > version of the tool. For lex and yacc, the latter case applies, since > they are machine-independent. >=20 > My final test build just completed. I just committed the version bump > and the bootstrap change; Baptiste will commit the yyparse() fix later > today. >=20 Should be done, sorry all for the mess, lots of lessons learned. regards, Bapt --R3SAtXwgGp429mN7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+7w/YACgkQ8kTtMUmk6EyVDACgpsXpGQyZS6R/LT4OHm/Q+lCA SxgAnisRQoaCw82iHOWPx1EaLjtg5qiQ =4pme -----END PGP SIGNATURE----- --R3SAtXwgGp429mN7-- From owner-svn-src-all@FreeBSD.ORG Tue May 22 16:56:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C5B81065672; Tue, 22 May 2012 16:56:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id EE8568FC16; Tue, 22 May 2012 16:56:00 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id B797F25D39FD; Tue, 22 May 2012 16:55:59 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id E18E7BE780A; Tue, 22 May 2012 16:55:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id jXGDNTkV4cam; Tue, 22 May 2012 16:55:57 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id C9742BE7809; Tue, 22 May 2012 16:55:57 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201205220723.q4M7Ng2I091715@svn.freebsd.org> Date: Tue, 22 May 2012 16:55:56 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <8BFFA477-46C2-49F6-804F-6D38B10AE7F7@FreeBSD.org> References: <201205220723.q4M7Ng2I091715@svn.freebsd.org> To: Hartmut Brandt X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235777 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 16:56:01 -0000 On 22. May 2012, at 07:23 , Hartmut Brandt wrote: > Author: harti > Date: Tue May 22 07:23:41 2012 > New Revision: 235777 > URL: http://svn.freebsd.org/changeset/base/235777 >=20 > Log: > Make dumptid non-static. It is used by libkvm to detect whether > this is a VNET-kernel or not. Just for clarifications - it's used to detect whether we are operating = on a crash dump or not in the vnet case. > gcc used to put the static symbol into > the symbol table, clang does not. This fixes the 'netstat: no = namelist' > error seen on clang+VNET systems. >=20 > Modified: > head/sys/kern/kern_shutdown.c >=20 > Modified: head/sys/kern/kern_shutdown.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/kern_shutdown.c Tue May 22 07:04:23 2012 = (r235776) > +++ head/sys/kern/kern_shutdown.c Tue May 22 07:23:41 2012 = (r235777) > @@ -151,7 +151,7 @@ static struct dumperinfo dumper; /* our=20 >=20 > /* Context information for dump-debuggers. */ > static struct pcb dumppcb; /* Registers. */ > -static lwpid_t dumptid; /* Thread ID. */ > +lwpid_t dumptid; /* Thread ID. */ >=20 > static void poweroff_wait(void *, int); > static void shutdown_halt(void *junk, int howto); --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Tue May 22 17:11:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82CD9106566B; Tue, 22 May 2012 17:11:19 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 548C48FC19; Tue, 22 May 2012 17:11:19 +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 q4MHBJMh015306; Tue, 22 May 2012 17:11:19 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MHBJK4015305; Tue, 22 May 2012 17:11:19 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201205221711.q4MHBJK4015305@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 22 May 2012 17:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235794 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 17:11:19 -0000 Author: obrien Date: Tue May 22 17:11:18 2012 New Revision: 235794 URL: http://svn.freebsd.org/changeset/base/235794 Log: Record that r235793 (-objc) has been merged from vendor/gcc into HEAD. Modified: Directory Properties: head/contrib/gcc/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue May 22 17:30:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 254321065679; Tue, 22 May 2012 17:30:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 101338FC15; Tue, 22 May 2012 17:30:03 +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 q4MHU2dU016197; Tue, 22 May 2012 17:30:02 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MHU2fW016196; Tue, 22 May 2012 17:30:02 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205221730.q4MHU2fW016196@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 22 May 2012 17:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235795 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 17:30:03 -0000 Author: trasz Date: Tue May 22 17:30:02 2012 New Revision: 235795 URL: http://svn.freebsd.org/changeset/base/235795 Log: Don't leak locks in prison_racct_modify(). Submitted by: Mateusz Guzik MFC after: 2 weeks Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue May 22 17:11:18 2012 (r235794) +++ head/sys/kern/kern_jail.c Tue May 22 17:30:02 2012 (r235795) @@ -4491,8 +4491,11 @@ prison_racct_modify(struct prison *pr) sx_slock(&allproc_lock); sx_xlock(&allprison_lock); - if (strcmp(pr->pr_name, pr->pr_prison_racct->prr_name) == 0) + if (strcmp(pr->pr_name, pr->pr_prison_racct->prr_name) == 0) { + sx_xunlock(&allprison_lock); + sx_sunlock(&allproc_lock); return; + } oldprr = pr->pr_prison_racct; pr->pr_prison_racct = NULL; From owner-svn-src-all@FreeBSD.ORG Tue May 22 17:44:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D47AF106564A; Tue, 22 May 2012 17:44:01 +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 BC6268FC14; Tue, 22 May 2012 17:44:01 +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 q4MHi1ix016888; Tue, 22 May 2012 17:44:01 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MHi1SL016883; Tue, 22 May 2012 17:44:01 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201205221744.q4MHi1SL016883@svn.freebsd.org> From: Mitsuru IWASAKI Date: Tue, 22 May 2012 17:44:01 +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: r235796 - in stable/9/sys: i386/acpica i386/i386 i386/include kern pc98/pc98 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 17:44:01 -0000 Author: iwasaki Date: Tue May 22 17:44:01 2012 New Revision: 235796 URL: http://svn.freebsd.org/changeset/base/235796 Log: MFC 235622,235639,235683: Merge SMP/i386 suspend/resume support. Modified: stable/9/sys/i386/acpica/acpi_wakecode.S stable/9/sys/i386/acpica/acpi_wakeup.c stable/9/sys/i386/i386/apic_vector.s stable/9/sys/i386/i386/genassym.c stable/9/sys/i386/i386/initcpu.c stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/i386/mp_machdep.c stable/9/sys/i386/i386/swtch.s stable/9/sys/i386/include/apicvar.h stable/9/sys/i386/include/md_var.h stable/9/sys/i386/include/pcb.h stable/9/sys/i386/include/smp.h stable/9/sys/kern/subr_smp.c stable/9/sys/pc98/pc98/machdep.c stable/9/sys/sys/smp.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/acpica/acpi_wakecode.S ============================================================================== --- stable/9/sys/i386/acpica/acpi_wakecode.S Tue May 22 17:30:02 2012 (r235795) +++ stable/9/sys/i386/acpica/acpi_wakecode.S Tue May 22 17:44:01 2012 (r235796) @@ -1,6 +1,8 @@ /*- * Copyright (c) 2001 Takanori Watanabe - * Copyright (c) 2001 Mitsuru IWASAKI + * Copyright (c) 2001-2012 Mitsuru IWASAKI + * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2008-2012 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,7 +30,9 @@ */ #include +#include #include +#include #include "assym.s" @@ -39,221 +43,163 @@ * Depending on the previous sleep state, we may need to initialize more * of the system (i.e., S3 suspend-to-RAM vs. S4 suspend-to-disk). */ - .align 4 - .code16 -wakeup_16: - nop - cli - cld + .data /* So we can modify it */ + + ALIGN_TEXT + .code16 +wakeup_start: /* * Set up segment registers for real mode, a small stack for * any calls we make, and clear any flags. */ - movw %cs,%ax - movw %ax,%ds - movw %ax,%ss - movw $PAGE_SIZE,%sp - pushl $0 - popfl + cli /* make sure no interrupts */ + mov %cs, %ax /* copy %cs to %ds. Remember these */ + mov %ax, %ds /* are offsets rather than selectors */ + mov %ax, %ss + movw $PAGE_SIZE, %sp + xorw %ax, %ax + pushw %ax + popfw /* To debug resume hangs, beep the speaker if the user requested. */ - cmpl $1,resume_beep - jne nobeep - movb $0xc0,%al - outb %al,$0x42 - movb $0x04,%al - outb %al,$0x42 - inb $0x61,%al - orb $0x3,%al - outb %al,$0x61 -nobeep: + testb $~0, resume_beep - wakeup_start + jz 1f + movb $0, resume_beep - wakeup_start + + /* Set PIC timer2 to beep. */ + movb $(TIMER_SEL2 | TIMER_SQWAVE | TIMER_16BIT), %al + outb %al, $TIMER_MODE + + /* Turn on speaker. */ + inb $IO_PPI, %al + orb $PIT_SPKR, %al + outb %al, $IO_PPI + + /* Set frequency. */ + movw $0x4c0, %ax + outb %al, $TIMER_CNTR2 + shrw $8, %ax + outb %al, $TIMER_CNTR2 +1: /* Re-initialize video BIOS if the reset_video tunable is set. */ - cmpl $1,reset_video - jne nobiosreset - lcall $0xc000,$3 + testb $~0, reset_video - wakeup_start + jz 1f + movb $0, reset_video - wakeup_start + lcall $0xc000, $3 + + /* When we reach here, int 0x10 should be ready. Hide cursor. */ + movb $0x01, %ah + movb $0x20, %ch + int $0x10 + + /* Re-start in case the previous BIOS call clobbers them. */ + jmp wakeup_start +1: /* - * Set up segment registers for real mode again in case the - * previous BIOS call clobbers them. + * Find relocation base and patch the gdt descript and ljmp targets */ - movw %cs,%ax - movw %ax,%ds - movw %ax,%ss -nobiosreset: - - /* Load GDT for real mode. Use 32 bit prefix for addresses >16 MB. */ - lgdtl physical_gdt - - /* Restore CR2, CR3 and CR4 */ - movl previous_cr2,%eax - movl %eax,%cr2 - movl previous_cr3,%eax - movl %eax,%cr3 - movl previous_cr4,%eax - movl %eax,%cr4 - - /* Transfer some values to protected mode with an inline stack */ -#define NVALUES 9 -#define TRANSFER_STACK32(val, idx) \ - movl val,%eax; \ - movl %eax,wakeup_32stack+(idx+1)+(idx*4) - - TRANSFER_STACK32(previous_ss, (NVALUES - 9)) - TRANSFER_STACK32(previous_fs, (NVALUES - 8)) - TRANSFER_STACK32(previous_ds, (NVALUES - 7)) - TRANSFER_STACK32(physical_gdt+2, (NVALUES - 6)) - TRANSFER_STACK32(where_to_recover, (NVALUES - 5)) - TRANSFER_STACK32(previous_idt+2, (NVALUES - 4)) - TRANSFER_STACK32(previous_ldt, (NVALUES - 3)) - TRANSFER_STACK32(previous_gdt+2, (NVALUES - 2)) - TRANSFER_STACK32(previous_tr, (NVALUES - 1)) - TRANSFER_STACK32(previous_cr0, (NVALUES - 0)) + xorl %ebx, %ebx + mov %cs, %bx + sall $4, %ebx /* %ebx is now our relocation base */ - mov physical_esp,%esi /* to be used in 32bit code */ + /* + * Load the descriptor table pointer. We'll need it when running + * in 16-bit protected mode. + */ + lgdtl bootgdtdesc - wakeup_start /* Enable protected mode */ - movl %cr0,%eax - orl $(CR0_PE),%eax - movl %eax,%cr0 + movl $CR0_PE, %eax + mov %eax, %cr0 + /* + * Now execute a far jump to turn on protected mode. This + * causes the segment registers to turn into selectors and causes + * %cs to be loaded from the gdt. + * + * The following instruction is: + * ljmpl $bootcode32 - bootgdt, $wakeup_32 - wakeup_start + * but gas cannot assemble that. And besides, we patch the targets + * in early startup and its a little clearer what we are patching. + */ wakeup_sw32: - /* Switch to protected mode by intersegmental jump */ - ljmpl $KCSEL,$0x12345678 /* Code location, to be replaced */ + .byte 0x66 /* size override to 32 bits */ + .byte 0xea /* opcode for far jump */ + .long wakeup_32 - wakeup_start /* offset in segment */ + .word bootcode32 - bootgdt /* index in gdt for 32 bit code */ /* - * Now switched to protected mode without paging enabled. - * %esi: KERNEL stack pointer (physical address) + * At this point, we are running in 32 bit legacy protected mode. */ + ALIGN_TEXT .code32 wakeup_32: - nop - /* Set up segment registers for protected mode */ - movw $KDSEL,%ax /* KDSEL to segment registers */ - movw %ax,%ds - movw %ax,%es - movw %ax,%gs - movw %ax,%ss - movw $KPSEL,%ax /* KPSEL to %fs */ - movw %ax,%fs - movl %esi,%esp /* physical address stack pointer */ - -wakeup_32stack: - /* Operands are overwritten in 16 bit code by TRANSFER_STACK32 macro */ - pushl $0xabcdef09 /* ss + dummy */ - pushl $0xabcdef08 /* fs + gs */ - pushl $0xabcdef07 /* ds + es */ - pushl $0xabcdef06 /* gdt:base (physical address) */ - pushl $0xabcdef05 /* recover address */ - pushl $0xabcdef04 /* idt:base */ - pushl $0xabcdef03 /* ldt + idt:limit */ - pushl $0xabcdef02 /* gdt:base */ - pushl $0xabcdef01 /* TR + gdt:limit */ - pushl $0xabcdef00 /* CR0 */ - - movl %esp,%ebp -#define CR0_REGISTER 0(%ebp) -#define TASK_REGISTER 4(%ebp) -#define PREVIOUS_GDT 6(%ebp) -#define PREVIOUS_LDT 12(%ebp) -#define PREVIOUS_IDT 14(%ebp) -#define RECOVER_ADDR 20(%ebp) -#define PHYSICAL_GDT_BASE 24(%ebp) -#define PREVIOUS_DS 28(%ebp) -#define PREVIOUS_ES 30(%ebp) -#define PREVIOUS_FS 32(%ebp) -#define PREVIOUS_GS 34(%ebp) -#define PREVIOUS_SS 36(%ebp) - - /* Fixup TSS type field */ -#define TSS_TYPEFIX_MASK 0xf9 - xorl %esi,%esi - movl PHYSICAL_GDT_BASE,%ebx - movw TASK_REGISTER,%si - leal (%ebx,%esi),%eax /* get TSS segment descriptor */ - andb $TSS_TYPEFIX_MASK,5(%eax) - - /* Prepare to return to sleep/wakeup code point */ - lgdtl PREVIOUS_GDT - lidtl PREVIOUS_IDT - - /* Pack values from the GDT to be loaded into segment registers. */ - movl PREVIOUS_DS,%ebx - movl PREVIOUS_FS,%ecx - movl PREVIOUS_SS,%edx - movw TASK_REGISTER,%si - shll $16,%esi - movw PREVIOUS_LDT,%si - movl RECOVER_ADDR,%edi - - /* Enable paging and etc. */ - movl CR0_REGISTER,%eax - movl %eax,%cr0 + mov $bootdata32 - bootgdt, %eax + mov %ax, %ds - /* Flush the prefetch queue */ - jmp 1f -1: jmp 1f -1: + /* Get PCB and return address. */ + movl wakeup_pcb - wakeup_start(%ebx), %esi + movl wakeup_ret - wakeup_start(%ebx), %edi + + /* Restore CR4 and CR3. */ + movl wakeup_cr4 - wakeup_start(%ebx), %eax + mov %eax, %cr4 + movl wakeup_cr3 - wakeup_start(%ebx), %eax + mov %eax, %cr3 /* - * Now we are in kernel virtual memory addressing with the following - * original register values: - * %ebx: ds + es - * %ecx: fs + gs - * %edx: ss + dummy - * %esi: LDTR + TR - * %edi: recover address - * We'll load these back into the segment registers now. + * Finally, switch to long bit mode by enabling paging. We have + * to be very careful here because all the segmentation disappears + * out from underneath us. The spec says we can depend on the + * subsequent pipelined branch to execute, but *only if* everthing + * is still identity mapped. If any mappings change, the pipeline + * will flush. */ - nop - - movl %esi,%eax /* LDTR + TR */ - lldt %ax /* load LDT register */ - shrl $16,%eax - ltr %ax /* load task register */ - - /* Restore segment registers */ - movl %ebx,%eax /* ds + es */ - movw %ax,%ds - shrl $16,%eax - movw %ax,%es - movl %ecx,%eax /* fs + gs */ - movw %ax,%fs - shrl $16,%eax - movw %ax,%gs - movl %edx,%eax /* ss */ - movw %ax,%ss + mov %cr0, %eax + orl $CR0_PG, %eax + mov %eax, %cr0 - /* Jump to acpi_restorecpu() */ + jmp 1f +1: + /* Jump to return address. */ jmp *%edi -/* used in real mode */ -physical_gdt: .word 0 - .long 0 -physical_esp: .long 0 -previous_cr2: .long 0 -previous_cr3: .long 0 -previous_cr4: .long 0 -resume_beep: .long 0 -reset_video: .long 0 + .data -/* - * Transfer from real mode to protected mode. The order of these variables - * is very important, DO NOT INSERT OR CHANGE unless you know why. - */ -previous_cr0: .long 0 -previous_tr: .word 0 -previous_gdt: .word 0 - .long 0 -previous_ldt: .word 0 -previous_idt: .word 0 - .long 0 -where_to_recover: .long 0 -previous_ds: .word 0 -previous_es: .word 0 -previous_fs: .word 0 -previous_gs: .word 0 -previous_ss: .word 0 -dummy: .word 0 +resume_beep: + .byte 0 +reset_video: + .byte 0 + + ALIGN_DATA +bootgdt: + .long 0x00000000 + .long 0x00000000 + +bootcode32: + .long 0x0000ffff + .long 0x00cf9b00 + +bootdata32: + .long 0x0000ffff + .long 0x00cf9300 +bootgdtend: + +bootgdtdesc: + .word bootgdtend - bootgdt /* Length */ + .long bootgdt - wakeup_start /* Offset plus %ds << 4 */ + + ALIGN_DATA +wakeup_cr4: + .long 0 +wakeup_cr3: + .long 0 +wakeup_pcb: + .long 0 +wakeup_ret: + .long 0 +dummy: Modified: stable/9/sys/i386/acpica/acpi_wakeup.c ============================================================================== --- stable/9/sys/i386/acpica/acpi_wakeup.c Tue May 22 17:30:02 2012 (r235795) +++ stable/9/sys/i386/acpica/acpi_wakeup.c Tue May 22 17:44:01 2012 (r235796) @@ -1,6 +1,8 @@ /*- * Copyright (c) 2001 Takanori Watanabe - * Copyright (c) 2001 Mitsuru IWASAKI + * Copyright (c) 2001-2012 Mitsuru IWASAKI + * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2008-2012 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,26 +31,29 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include -#include +#include +#include #include #include -#include -#include +#include #include #include -#include -#include -#include -#include -#include +#include #include #include -#include +#include +#include +#include +#include + +#ifdef SMP +#include +#include +#include +#endif #include @@ -57,164 +62,186 @@ __FBSDID("$FreeBSD$"); #include "acpi_wakecode.h" #include "acpi_wakedata.h" -/* Make sure the code is less than one page and leave room for the stack. */ +/* Make sure the code is less than a page and leave room for the stack. */ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); -#ifndef _SYS_CDEFS_H_ -#error this file needs sys/cdefs.h as a prerequisite +extern int acpi_resume_beep; +extern int acpi_reset_video; + +#ifdef SMP +extern struct pcb **susppcbs; +#else +static struct pcb **susppcbs; #endif -extern uint32_t acpi_resume_beep; -extern uint32_t acpi_reset_video; -extern void initializecpu(void); - -static struct region_descriptor __used saved_idt, saved_gdt; -static struct region_descriptor *p_gdt; -static uint16_t __used saved_ldt; - -static uint32_t __used r_eax, r_ebx, r_ecx, r_edx, r_ebp, r_esi, r_edi, - r_efl, r_cr0, r_cr2, r_cr3, r_cr4, ret_addr; - -static uint16_t __used r_cs, r_ds, r_es, r_fs, r_gs, r_ss, r_tr; -static uint32_t __used r_esp; - -static void acpi_printcpu(void); -static void acpi_realmodeinst(void *arg, bus_dma_segment_t *segs, - int nsegs, int error); -static void acpi_alloc_wakeup_handler(void); - -/* XXX shut gcc up */ -extern int acpi_savecpu(void); -extern int acpi_restorecpu(void); - -#ifdef __GNUCLIKE_ASM -__asm__(" \n\ - .text \n\ - .p2align 2, 0x90 \n\ - .type acpi_restorecpu, @function\n\ -acpi_restorecpu: \n\ - .align 4 \n\ - movl r_eax,%eax \n\ - movl r_ebx,%ebx \n\ - movl r_ecx,%ecx \n\ - movl r_edx,%edx \n\ - movl r_ebp,%ebp \n\ - movl r_esi,%esi \n\ - movl r_edi,%edi \n\ - movl r_esp,%esp \n\ - \n\ - pushl r_efl \n\ - popfl \n\ - \n\ - movl ret_addr,%eax \n\ - movl %eax,(%esp) \n\ - xorl %eax,%eax \n\ - ret \n\ - \n\ - .text \n\ - .p2align 2, 0x90 \n\ - .type acpi_savecpu, @function \n\ -acpi_savecpu: \n\ - movw %cs,r_cs \n\ - movw %ds,r_ds \n\ - movw %es,r_es \n\ - movw %fs,r_fs \n\ - movw %gs,r_gs \n\ - movw %ss,r_ss \n\ - \n\ - movl %eax,r_eax \n\ - movl %ebx,r_ebx \n\ - movl %ecx,r_ecx \n\ - movl %edx,r_edx \n\ - movl %ebp,r_ebp \n\ - movl %esi,r_esi \n\ - movl %edi,r_edi \n\ - \n\ - movl %cr0,%eax \n\ - movl %eax,r_cr0 \n\ - movl %cr2,%eax \n\ - movl %eax,r_cr2 \n\ - movl %cr3,%eax \n\ - movl %eax,r_cr3 \n\ - movl %cr4,%eax \n\ - movl %eax,r_cr4 \n\ - \n\ - pushfl \n\ - popl r_efl \n\ - \n\ - movl %esp,r_esp \n\ - \n\ - sgdt saved_gdt \n\ - sidt saved_idt \n\ - sldt saved_ldt \n\ - str r_tr \n\ - \n\ - movl (%esp),%eax \n\ - movl %eax,ret_addr \n\ - movl $1,%eax \n\ - ret \n\ -"); -#endif /* __GNUCLIKE_ASM */ +static void *acpi_alloc_wakeup_handler(void); +static void acpi_stop_beep(void *); + +#ifdef SMP +static int acpi_wakeup_ap(struct acpi_softc *, int); +static void acpi_wakeup_cpus(struct acpi_softc *, const cpuset_t *); +#endif + +#define ACPI_PAGETABLES 0 +#define WAKECODE_VADDR(sc) ((sc)->acpi_wakeaddr + (ACPI_PAGETABLES * PAGE_SIZE)) +#define WAKECODE_PADDR(sc) ((sc)->acpi_wakephys + (ACPI_PAGETABLES * PAGE_SIZE)) +#define WAKECODE_FIXUP(offset, type, val) do { \ + type *addr; \ + addr = (type *)(WAKECODE_VADDR(sc) + offset); \ + *addr = val; \ +} while (0) static void -acpi_printcpu(void) +acpi_stop_beep(void *arg) { - printf("======== acpi_printcpu() debug dump ========\n"); - printf("gdt[%04x:%08x] idt[%04x:%08x] ldt[%04x] tr[%04x] efl[%08x]\n", - saved_gdt.rd_limit, saved_gdt.rd_base, - saved_idt.rd_limit, saved_idt.rd_base, - saved_ldt, r_tr, r_efl); - printf("eax[%08x] ebx[%08x] ecx[%08x] edx[%08x]\n", - r_eax, r_ebx, r_ecx, r_edx); - printf("esi[%08x] edi[%08x] ebp[%08x] esp[%08x]\n", - r_esi, r_edi, r_ebp, r_esp); - printf("cr0[%08x] cr2[%08x] cr3[%08x] cr4[%08x]\n", - r_cr0, r_cr2, r_cr3, r_cr4); - printf("cs[%04x] ds[%04x] es[%04x] fs[%04x] gs[%04x] ss[%04x]\n", - r_cs, r_ds, r_es, r_fs, r_gs, r_ss); + + if (acpi_resume_beep != 0) + timer_spkr_release(); } -#define WAKECODE_FIXUP(offset, type, val) do { \ - type *addr; \ - addr = (type *)(sc->acpi_wakeaddr + offset); \ - *addr = val; \ -} while (0) +#ifdef SMP +static int +acpi_wakeup_ap(struct acpi_softc *sc, int cpu) +{ + int vector = (WAKECODE_PADDR(sc) >> 12) & 0xff; + int apic_id = cpu_apic_ids[cpu]; + int ms; + + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[cpu]); + + /* do an INIT IPI: assert RESET */ + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, apic_id); + + /* wait for pending status end */ + lapic_ipi_wait(-1); + + /* do an INIT IPI: deassert RESET */ + lapic_ipi_raw(APIC_DEST_ALLESELF | APIC_TRIGMOD_LEVEL | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, 0); + + /* wait for pending status end */ + DELAY(10000); /* wait ~10mS */ + lapic_ipi_wait(-1); -#define WAKECODE_BCOPY(offset, type, val) do { \ - void *addr; \ - addr = (void *)(sc->acpi_wakeaddr + offset); \ - bcopy(&(val), addr, sizeof(type)); \ -} while (0) + /* + * next we do a STARTUP IPI: the previous INIT IPI might still be + * latched, (P5 bug) this 1st STARTUP would then terminate + * immediately, and the previously started INIT IPI would continue. OR + * the previous INIT IPI has already run. and this STARTUP IPI will + * run. OR the previous INIT IPI was ignored. and this STARTUP IPI + * will run. + */ + + /* do a STARTUP IPI */ + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + vector, apic_id); + lapic_ipi_wait(-1); + DELAY(200); /* wait ~200uS */ + + /* + * finally we do a 2nd STARTUP IPI: this 2nd STARTUP IPI should run IF + * the previous STARTUP IPI was cancelled by a latched INIT IPI. OR + * this STARTUP IPI will be ignored, as only ONE STARTUP IPI is + * recognized after hardware RESET or INIT IPI. + */ + + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + vector, apic_id); + lapic_ipi_wait(-1); + DELAY(200); /* wait ~200uS */ + + /* Wait up to 5 seconds for it to start. */ + for (ms = 0; ms < 5000; ms++) { + if (susppcbs[cpu]->pcb_eip == 0) + return (1); /* return SUCCESS */ + DELAY(1000); + } + return (0); /* return FAILURE */ +} + +#define WARMBOOT_TARGET 0 +#define WARMBOOT_OFF (KERNBASE + 0x0467) +#define WARMBOOT_SEG (KERNBASE + 0x0469) + +#define CMOS_REG (0x70) +#define CMOS_DATA (0x71) +#define BIOS_RESET (0x0f) +#define BIOS_WARM (0x0a) -/* Turn off bits 1&2 of the PIT, stopping the beep. */ static void -acpi_stop_beep(void *arg) +acpi_wakeup_cpus(struct acpi_softc *sc, const cpuset_t *wakeup_cpus) { - outb(0x61, inb(0x61) & ~0x3); + uint32_t mpbioswarmvec; + int cpu; + u_char mpbiosreason; + + /* save the current value of the warm-start vector */ + mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); + outb(CMOS_REG, BIOS_RESET); + mpbiosreason = inb(CMOS_DATA); + + /* setup a vector to our boot code */ + *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; + *((volatile u_short *)WARMBOOT_SEG) = WAKECODE_PADDR(sc) >> 4; + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ + + /* Wake up each AP. */ + for (cpu = 1; cpu < mp_ncpus; cpu++) { + if (!CPU_ISSET(cpu, wakeup_cpus)) + continue; + if (acpi_wakeup_ap(sc, cpu) == 0) { + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + panic("acpi_wakeup: failed to resume AP #%d (PHY #%d)", + cpu, cpu_apic_ids[cpu]); + } + } + + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, mpbiosreason); } +#endif int acpi_sleep_machdep(struct acpi_softc *sc, int state) { - ACPI_STATUS status; - struct pmap *pm; - int ret; - uint32_t cr3; - u_long ef; +#ifdef SMP + cpuset_t wakeup_cpus; +#endif + register_t cr3, rf; + ACPI_STATUS status; + struct pmap *pm; + int ret; ret = -1; - if (sc->acpi_wakeaddr == 0) + + if (sc->acpi_wakeaddr == 0ul) return (ret); - AcpiSetFirmwareWakingVector(sc->acpi_wakephys); +#ifdef SMP + wakeup_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &wakeup_cpus); +#endif + + if (acpi_resume_beep != 0) + timer_spkr_acquire(); - ef = intr_disable(); + AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); + + rf = intr_disable(); intr_suspend(); /* - * Temporarily switch to the kernel pmap because it provides an - * identity mapping (setup at boot) for the low physical memory - * region containing the wakeup code. + * Temporarily switch to the kernel pmap because it provides + * an identity mapping (setup at boot) for the low physical + * memory region containing the wakeup code. */ pm = kernel_pmap; cr3 = rcr3(); @@ -224,39 +251,22 @@ acpi_sleep_machdep(struct acpi_softc *sc load_cr3(vtophys(pm->pm_pdir)); #endif - ret_addr = 0; - if (acpi_savecpu()) { - /* Execute Sleep */ - - p_gdt = (struct region_descriptor *) - (sc->acpi_wakeaddr + physical_gdt); - p_gdt->rd_limit = saved_gdt.rd_limit; - p_gdt->rd_base = vtophys(saved_gdt.rd_base); - - WAKECODE_FIXUP(physical_esp, uint32_t, vtophys(r_esp)); - WAKECODE_FIXUP(previous_cr0, uint32_t, r_cr0); - WAKECODE_FIXUP(previous_cr2, uint32_t, r_cr2); - WAKECODE_FIXUP(previous_cr3, uint32_t, r_cr3); - WAKECODE_FIXUP(previous_cr4, uint32_t, r_cr4); - - WAKECODE_FIXUP(resume_beep, uint32_t, acpi_resume_beep); - WAKECODE_FIXUP(reset_video, uint32_t, acpi_reset_video); - - WAKECODE_FIXUP(previous_tr, uint16_t, r_tr); - WAKECODE_BCOPY(previous_gdt, struct region_descriptor, saved_gdt); - WAKECODE_FIXUP(previous_ldt, uint16_t, saved_ldt); - WAKECODE_BCOPY(previous_idt, struct region_descriptor, saved_idt); - - WAKECODE_FIXUP(where_to_recover, void *, acpi_restorecpu); - - WAKECODE_FIXUP(previous_ds, uint16_t, r_ds); - WAKECODE_FIXUP(previous_es, uint16_t, r_es); - WAKECODE_FIXUP(previous_fs, uint16_t, r_fs); - WAKECODE_FIXUP(previous_gs, uint16_t, r_gs); - WAKECODE_FIXUP(previous_ss, uint16_t, r_ss); + if (suspendctx(susppcbs[0])) { +#ifdef SMP + if (!CPU_EMPTY(&wakeup_cpus) && + suspend_cpus(wakeup_cpus) == 0) { + device_printf(sc->acpi_dev, "Failed to suspend APs\n"); + goto out; + } +#endif + + WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0)); + WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); - if (bootverbose) - acpi_printcpu(); + WAKECODE_FIXUP(wakeup_cr4, register_t, susppcbs[0]->pcb_cr4); + WAKECODE_FIXUP(wakeup_cr3, register_t, susppcbs[0]->pcb_cr3); + + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[0]); /* Call ACPICA to enter the desired sleep state */ if (state == ACPI_STATE_S4 && sc->acpi_s4bios) @@ -266,8 +276,8 @@ acpi_sleep_machdep(struct acpi_softc *sc if (status != AE_OK) { device_printf(sc->acpi_dev, - "AcpiEnterSleepState failed - %s\n", - AcpiFormatException(status)); + "AcpiEnterSleepState failed - %s\n", + AcpiFormatException(status)); goto out; } @@ -275,97 +285,96 @@ acpi_sleep_machdep(struct acpi_softc *sc ia32_pause(); } else { pmap_init_pat(); + initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); - if (bootverbose) { - acpi_savecpu(); - acpi_printcpu(); - } +#ifdef SMP + if (!CPU_EMPTY(&wakeup_cpus)) + acpi_wakeup_cpus(sc, &wakeup_cpus); +#endif ret = 0; } out: +#ifdef SMP + if (!CPU_EMPTY(&wakeup_cpus)) + restart_cpus(wakeup_cpus); +#endif + load_cr3(cr3); mca_resume(); intr_resume(); - intr_restore(ef); + intr_restore(rf); + + AcpiSetFirmwareWakingVector(0); if (ret == 0 && mem_range_softc.mr_op != NULL && mem_range_softc.mr_op->reinit != NULL) mem_range_softc.mr_op->reinit(&mem_range_softc); - /* If we beeped, turn it off after a delay. */ - if (acpi_resume_beep) - timeout(acpi_stop_beep, NULL, 3 * hz); - return (ret); } -static bus_dma_tag_t acpi_waketag; -static bus_dmamap_t acpi_wakemap; -static vm_offset_t acpi_wakeaddr; - -static void +static void * acpi_alloc_wakeup_handler(void) { - void *wakeaddr; - - if (!cold) - return; + void *wakeaddr; + int i; /* * Specify the region for our wakeup code. We want it in the low 1 MB - * region, excluding video memory and above (0xa0000). We ask for - * it to be page-aligned, just to be safe. + * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA + * (less than 128KB, below 0xa0000, must be excluded by SMAP and DSDT), + * and ROM area (0xa0000 and above). The temporary page tables must be + * page-aligned. */ - if (bus_dma_tag_create(/*parent*/ NULL, - /*alignment*/ PAGE_SIZE, /*no boundary*/ 0, - /*lowaddr*/ 0x9ffff, /*highaddr*/ BUS_SPACE_MAXADDR, NULL, NULL, - /*maxsize*/ PAGE_SIZE, /*segments*/ 1, /*maxsegsize*/ PAGE_SIZE, - 0, busdma_lock_mutex, &Giant, &acpi_waketag) != 0) { - printf("acpi_alloc_wakeup_handler: can't create wake tag\n"); - return; + wakeaddr = contigmalloc((ACPI_PAGETABLES + 1) * PAGE_SIZE, M_DEVBUF, + M_NOWAIT, 0x500, 0xa0000, PAGE_SIZE, 0ul); + if (wakeaddr == NULL) { + printf("%s: can't alloc wake memory\n", __func__); + return (NULL); } - if (bus_dmamem_alloc(acpi_waketag, &wakeaddr, BUS_DMA_NOWAIT, - &acpi_wakemap) != 0) { - printf("acpi_alloc_wakeup_handler: can't alloc wake memory\n"); - return; + if (EVENTHANDLER_REGISTER(power_resume, acpi_stop_beep, NULL, + EVENTHANDLER_PRI_LAST) == NULL) { + printf("%s: can't register event handler\n", __func__); + contigfree(wakeaddr, (ACPI_PAGETABLES + 1) * PAGE_SIZE, M_DEVBUF); + return (NULL); } - acpi_wakeaddr = (vm_offset_t)wakeaddr; -} - -SYSINIT(acpiwakeup, SI_SUB_KMEM, SI_ORDER_ANY, acpi_alloc_wakeup_handler, 0); - -static void -acpi_realmodeinst(void *arg, bus_dma_segment_t *segs, int nsegs, int error) -{ - struct acpi_softc *sc; - uint32_t *addr; - - /* Overwrite the ljmp target with the real address */ - sc = arg; - sc->acpi_wakephys = segs[0].ds_addr; - addr = (uint32_t *)&wakecode[wakeup_sw32 + 2]; - *addr = sc->acpi_wakephys + wakeup_32; - - /* Copy the wake code into our low page and save its physical addr. */ - bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode)); - if (bootverbose) { - device_printf(sc->acpi_dev, "wakeup code va %#x pa %#jx\n", - acpi_wakeaddr, (uintmax_t)sc->acpi_wakephys); + susppcbs = malloc(mp_ncpus * sizeof(*susppcbs), M_DEVBUF, M_WAITOK); + for (i = 0; i < mp_ncpus; i++) { + susppcbs[i] = malloc(sizeof(**susppcbs), M_DEVBUF, M_WAITOK); } + + return (wakeaddr); } void acpi_install_wakeup_handler(struct acpi_softc *sc) { - if (acpi_wakeaddr == 0) + static void *wakeaddr = NULL; + + if (wakeaddr != NULL) + return; + + wakeaddr = acpi_alloc_wakeup_handler(); + if (wakeaddr == NULL) return; - sc->acpi_waketag = acpi_waketag; - sc->acpi_wakeaddr = acpi_wakeaddr; - sc->acpi_wakemap = acpi_wakemap; + sc->acpi_wakeaddr = (vm_offset_t)wakeaddr; + sc->acpi_wakephys = vtophys(wakeaddr); - bus_dmamap_load(sc->acpi_waketag, sc->acpi_wakemap, - (void *)sc->acpi_wakeaddr, PAGE_SIZE, acpi_realmodeinst, sc, 0); + bcopy(wakecode, (void *)WAKECODE_VADDR(sc), sizeof(wakecode)); + + /* Patch GDT base address, ljmp target. */ + WAKECODE_FIXUP((bootgdtdesc + 2), uint32_t, + WAKECODE_PADDR(sc) + bootgdt); + WAKECODE_FIXUP((wakeup_sw32 + 2), uint32_t, + WAKECODE_PADDR(sc) + wakeup_32); + + /* Save pointers to some global data. */ + WAKECODE_FIXUP(wakeup_ret, void *, resumectx); + + if (bootverbose) + device_printf(sc->acpi_dev, "wakeup code va %#x pa %#jx\n", + sc->acpi_wakeaddr, (uintmax_t)sc->acpi_wakephys); } Modified: stable/9/sys/i386/i386/apic_vector.s ============================================================================== --- stable/9/sys/i386/i386/apic_vector.s Tue May 22 17:30:02 2012 (r235795) +++ stable/9/sys/i386/i386/apic_vector.s Tue May 22 17:44:01 2012 (r235796) @@ -334,6 +334,26 @@ IDTVEC(cpustop) iret /* + * Executed by a CPU when it receives an IPI_SUSPEND from another CPU. + */ +#ifndef XEN + .text + SUPERALIGN_TEXT +IDTVEC(cpususpend) + PUSH_FRAME + SET_KERNEL_SREGS + cld + + movl lapic, %eax + movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ + + call cpususpend_handler + + POP_FRAME + jmp doreti_iret +#endif + +/* * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. * * - Calls the generic rendezvous action function. Modified: stable/9/sys/i386/i386/genassym.c ============================================================================== --- stable/9/sys/i386/i386/genassym.c Tue May 22 17:30:02 2012 (r235795) +++ stable/9/sys/i386/i386/genassym.c Tue May 22 17:44:01 2012 (r235796) @@ -121,7 +121,10 @@ ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADD ASSYM(KERNBASE, KERNBASE); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 22 18:03:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 715CA106566B; Tue, 22 May 2012 18:03:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 084418FC14; Tue, 22 May 2012 18:03:23 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4MI38rn006979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 May 2012 04:03:10 +1000 Date: Wed, 23 May 2012 04:03:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hartmut Brandt In-Reply-To: Message-ID: <20120523023228.L2766@besplex.bde.org> References: <201205220723.q4M7Ng2I091715@svn.freebsd.org> <20120522212307.V1971@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hartmut Brandt , Bruce Evans Subject: Re: svn commit: r235777 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 18:03:24 -0000 On Tue, 22 May 2012, Hartmut Brandt wrote: > On Tue, 22 May 2012, Bruce Evans wrote: > > BE>On Tue, 22 May 2012, Hartmut Brandt wrote: > BE> > BE>> Log: > BE>> Make dumptid non-static. It is used by libkvm to detect whether > BE>> this is a VNET-kernel or not. gcc used to put the static symbol into > BE>> the symbol table, clang does not. This fixes the 'netstat: no namelist' > BE>> error seen on clang+VNET systems. > BE>> > BE>> Modified: > BE>> head/sys/kern/kern_shutdown.c > BE> > BE>That would be a bug in clang if it were done for static symbols generally, > BE>but here the bug seems to be that the symbol is not declared as __used. > > I don't get this. Why should a symbol declared static be in the symbol > table (except for debugging purposes) ? It must be there for debugging purposes and historical compatibility (mainly other debugging uses, including kvm). Static symbols are not really special here. The C standard doesn't even require a symbol table, and it is only implementation details and debugging and historical compatibility that require putting global symbols in symbol tables. > It has internal linkage and so has > a meaning only in the given file. What is the linker supposed to do with > several static symbols with the same name from several object files? Same as it always did. The names are in per-object-file namespaces for the linker, so they don't conflict for linking, but they mess up primitive debuggers starting with nm. > If > several files declared static dumptids, which one would kldsym be supposed > to return? libkvm and kldsym would be broken. I don't know of any even non-primitive debuggers that can handle this. In gdb the only way that I know of to print a non-unique variable is to display the source file that declares the variable using something like `l' on a function in that file; the variable scope is then that of the selected file. The address "file.c:foo" only works for displaying functions. The latter probably depends on a full symbol table. When there is no symbol table, `l' of course doesn't work; `disass foo" works. "disass file.c:foo" of course doesn't work. "disass file.o:foo" should work, but doesn't, even when there is a full symbol table. When the "file.*:" address doesn't work, this is is initially because it misparsed as the symbol "file". Actually, I know of the primitive way which works even using ddb with all symbols broken in ddb, and have had to use this several times: you find the address of things using nm or something less primitive on another system, and guess which address to use if several variables have the same name, and type it in. BTW, kernels have lots of conflicting symbols which mess up debugging using primitive debuggers like ddb. /usr/src/tools/tools/kernxref/kernxref.sh was supposed to be used to find and fix these as well as finding and fixing public variables that should be static, but it is rarely used. uniq reports removing 382 out of 28443 (non-unique) symbols in a fairly current kernel with not many features configured. Bruce From owner-svn-src-all@FreeBSD.ORG Tue May 22 18:18:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EA091065674; Tue, 22 May 2012 18:18:07 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79BFF8FC14; Tue, 22 May 2012 18:18: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 q4MII7d0019628; Tue, 22 May 2012 18:18:07 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MII7lk019626; Tue, 22 May 2012 18:18:07 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201205221818.q4MII7lk019626@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 22 May 2012 18:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 18:18:07 -0000 Author: obrien Date: Tue May 22 18:18:06 2012 New Revision: 235797 URL: http://svn.freebsd.org/changeset/base/235797 Log: Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. Modified: head/contrib/gcc/c-format.c Modified: head/contrib/gcc/c-format.c ============================================================================== --- head/contrib/gcc/c-format.c Tue May 22 17:44:01 2012 (r235796) +++ head/contrib/gcc/c-format.c Tue May 22 18:18:06 2012 (r235797) @@ -287,7 +287,11 @@ static const format_length_info printf_l { { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, +#ifdef __LP64__ + { "q", FMT_LEN_l, STD_EXT, NULL, 0, 0 }, +#else { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, +#endif { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, From owner-svn-src-all@FreeBSD.ORG Tue May 22 18:30:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4EAD106566B; Tue, 22 May 2012 18:30:14 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADF8D8FC0C; Tue, 22 May 2012 18:30: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 q4MIUECp020233; Tue, 22 May 2012 18:30:14 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MIUEtw020224; Tue, 22 May 2012 18:30:14 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201205221830.q4MIUEtw020224@svn.freebsd.org> From: David Chisnall Date: Tue, 22 May 2012 18:30: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: r235798 - in stable/9: . contrib/libc++ contrib/libcxxrt etc/mtree lib lib/libc++ lib/libcxxrt share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 18:30:14 -0000 Author: theraven Date: Tue May 22 18:30:14 2012 New Revision: 235798 URL: http://svn.freebsd.org/changeset/base/235798 Log: Merged libcxxrt and libc++. Now available for testing on 9-stable with -stdlib=libc++. Changes to libstdc++ not yet merged, so it is not yet possible to mix libstdc++ and libc++ in the same program. Merged revisions: 226702,226785,227006,227755,227983,227987,228531,228630,228761,229067,230127,232950,233098,234715-234716,234772 Added: stable/9/contrib/libc++/ - copied from r235786, head/contrib/libc++/ stable/9/contrib/libcxxrt/ - copied from r235786, head/contrib/libcxxrt/ - copied from r227983, head/lib/libc++/ - copied from r227983, head/lib/libcxxrt/ stable/9/lib/libcxxrt/Version.map - copied, changed from r233174, head/lib/libcxxrt/Version.map Directory Properties: stable/9/lib/libc++/ (props changed) stable/9/lib/libcxxrt/ (props changed) Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/etc/mtree/BSD.include.dist stable/9/lib/Makefile stable/9/lib/libc++/Makefile stable/9/lib/libcxxrt/Makefile stable/9/share/mk/bsd.libnames.mk stable/9/share/mk/bsd.own.mk Directory Properties: stable/9/etc/ (props changed) stable/9/lib/ (props changed) stable/9/share/mk/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Tue May 22 18:18:06 2012 (r235797) +++ stable/9/Makefile.inc1 Tue May 22 18:30:14 2012 (r235798) @@ -1235,6 +1235,9 @@ _startup_libs+= lib/csu/${MACHINE_CPUARC _startup_libs+= gnu/lib/libgcc _startup_libs+= lib/libcompiler_rt _startup_libs+= lib/libc +.if ${MK_LIBCPLUSPLUS} != "no" +_startup_libs+= lib/libcxxrt +.endif gnu/lib/libgcc__L: lib/libc__L Modified: stable/9/etc/mtree/BSD.include.dist ============================================================================== --- stable/9/etc/mtree/BSD.include.dist Tue May 22 18:18:06 2012 (r235797) +++ stable/9/etc/mtree/BSD.include.dist Tue May 22 18:30:14 2012 (r235798) @@ -76,6 +76,10 @@ tr1 .. .. + v1 + ext + .. + .. .. cam ata Modified: stable/9/lib/Makefile ============================================================================== --- stable/9/lib/Makefile Tue May 22 18:18:06 2012 (r235797) +++ stable/9/lib/Makefile Tue May 22 18:30:14 2012 (r235798) @@ -48,7 +48,9 @@ SUBDIR_ORDERED= ${_csu} \ libsbuf \ libtacplus \ libutil \ - ${_libypclnt} + ${_libypclnt} \ + ${_libcxxrt} \ + ${_libcplusplus} SUBDIR= ${SUBDIR_ORDERED} \ libalias \ @@ -211,6 +213,11 @@ _libsmb= libsmb _libmp= libmp .endif +.if ${MK_LIBCPLUSPLUS} != "no" +_libcxxrt= libcxxrt +_libcplusplus= libc++ +.endif + .if ${MK_PMC} != "no" _libpmc= libpmc .endif Modified: stable/9/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri Nov 25 20:59:04 2011 (r227983) +++ stable/9/lib/libc++/Makefile Tue May 22 18:30:14 2012 (r235798) @@ -39,7 +39,7 @@ WARNS= 0 CXXFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -std=c++0x -nostdlib -DLIBCXXRT DPADD= ${LIBCXXRT} -LDADD= -L${.OBJDIR}/../libcxxrt/ -lcxxrt +LDADD= -lcxxrt LDFLAGS+= --verbose INCSGROUPS= STD EXT @@ -58,6 +58,7 @@ STD_HEADERS= __bit_reference\ __tree\ __tuple\ __tuple_03\ + __undef_min_max\ algorithm\ array\ atomic\ Modified: stable/9/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Fri Nov 25 20:59:04 2011 (r227983) +++ stable/9/lib/libcxxrt/Makefile Tue May 22 18:30:14 2012 (r235798) @@ -21,6 +21,6 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -I${SRCDIR} -LDADD+= -pthread +VERSION_MAP= ${.CURDIR}/Version.map .include Copied and modified: stable/9/lib/libcxxrt/Version.map (from r233174, head/lib/libcxxrt/Version.map) ============================================================================== --- head/lib/libcxxrt/Version.map Mon Mar 19 11:53:33 2012 (r233174, copy source) +++ stable/9/lib/libcxxrt/Version.map Tue May 22 18:30:14 2012 (r235798) @@ -301,6 +301,11 @@ CXXRT_1.0 { "typeinfo name for std::exception"; "typeinfo name for std::type_info"; + "std::type_info::__is_function_p() const"; + "std::type_info::__do_upcast(__cxxabiv1::__class_type_info const*, void**) const"; + "std::type_info::__is_pointer_p() const"; + + "operator delete[](void*)"; "operator delete(void*)"; "operator new[](unsigned long)"; Modified: stable/9/share/mk/bsd.libnames.mk ============================================================================== --- stable/9/share/mk/bsd.libnames.mk Tue May 22 18:18:06 2012 (r235797) +++ stable/9/share/mk/bsd.libnames.mk Tue May 22 18:30:14 2012 (r235798) @@ -26,6 +26,8 @@ LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxm LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a +LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a +LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a LIBC?= ${DESTDIR}${LIBDIR}/libc.a LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBCALENDAR?= ${DESTDIR}${LIBDIR}/libcalendar.a Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Tue May 22 18:18:06 2012 (r235797) +++ stable/9/share/mk/bsd.own.mk Tue May 22 18:30:14 2012 (r235798) @@ -418,6 +418,7 @@ __DEFAULT_NO_OPTIONS = \ HESIOD \ ICONV \ IDEA \ + LIBCPLUSPLUS \ OFED \ SHARED_TOOLCHAIN @@ -572,6 +573,10 @@ MK_GDB:= no MK_CLANG_IS_CC:= no .endif +MK_LIBCPLUSPLUS?= no + +MK_LIBCPLUSPLUS?= no + # # Set defaults for the MK_*_SUPPORT variables. # From owner-svn-src-all@FreeBSD.ORG Tue May 22 18:30:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 133E410657F3; Tue, 22 May 2012 18:30:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F27988FC0A; Tue, 22 May 2012 18:30: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 q4MIUW5x020290; Tue, 22 May 2012 18:30:32 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MIUW7G020288; Tue, 22 May 2012 18:30:32 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201205221830.q4MIUW7G020288@svn.freebsd.org> From: Jamie Gritton Date: Tue, 22 May 2012 18:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235799 - head/lib/libjail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 18:30:33 -0000 Author: jamie Date: Tue May 22 18:30:32 2012 New Revision: 235799 URL: http://svn.freebsd.org/changeset/base/235799 Log: The fix in r235291 re-broke the "allow.nomount" case. Re-fix it by testing for the right parameter name. Modified: head/lib/libjail/jail.c Modified: head/lib/libjail/jail.c ============================================================================== --- head/lib/libjail/jail.c Tue May 22 18:30:14 2012 (r235798) +++ head/lib/libjail/jail.c Tue May 22 18:30:32 2012 (r235799) @@ -853,7 +853,7 @@ jailparam_free(struct jailparam *jp, uns static int jailparam_type(struct jailparam *jp) { - char *p, *nname; + char *p, *name, *nname; size_t miblen, desclen; int i, isarray; struct { @@ -863,7 +863,8 @@ jailparam_type(struct jailparam *jp) int mib[CTL_MAXNAME]; /* The "lastjid" parameter isn't real. */ - if (!strcmp(jp->jp_name, "lastjid")) { + name = jp->jp_name; + if (!strcmp(name, "lastjid")) { jp->jp_valuelen = sizeof(int); jp->jp_ctltype = CTLTYPE_INT | CTLFLAG_WR; return (0); @@ -872,19 +873,19 @@ jailparam_type(struct jailparam *jp) /* Find the sysctl that describes the parameter. */ mib[0] = 0; mib[1] = 3; - snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", jp->jp_name); + snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", name); miblen = sizeof(mib) - 2 * sizeof(int); if (sysctl(mib, 2, mib + 2, &miblen, desc.s, strlen(desc.s)) < 0) { if (errno != ENOENT) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(0.3.%s): %s", jp->jp_name, strerror(errno)); + "sysctl(0.3.%s): %s", name, strerror(errno)); return (-1); } /* * The parameter probably doesn't exist. But it might be * the "no" counterpart to a boolean. */ - nname = nononame(jp->jp_name); + nname = nononame(name); if (nname == NULL) { unknown_parameter: snprintf(jail_errmsg, JAIL_ERRMSGLEN, @@ -892,8 +893,10 @@ jailparam_type(struct jailparam *jp) errno = ENOENT; return (-1); } - snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", nname); + name = alloca(strlen(nname) + 1); + strcpy(name, nname); free(nname); + snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", name); miblen = sizeof(mib) - 2 * sizeof(int); if (sysctl(mib, 2, mib + 2, &miblen, desc.s, strlen(desc.s)) < 0) @@ -906,7 +909,7 @@ jailparam_type(struct jailparam *jp) if (sysctl(mib, (miblen / sizeof(int)) + 2, &desc, &desclen, NULL, 0) < 0) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(0.4.%s): %s", jp->jp_name, strerror(errno)); + "sysctl(0.4.%s): %s", name, strerror(errno)); return (-1); } jp->jp_ctltype = desc.i; @@ -952,7 +955,7 @@ jailparam_type(struct jailparam *jp) if (sysctl(mib + 2, miblen / sizeof(int), desc.s, &desclen, NULL, 0) < 0) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(" SJPARAM ".%s): %s", jp->jp_name, + "sysctl(" SJPARAM ".%s): %s", name, strerror(errno)); return (-1); } @@ -970,7 +973,7 @@ jailparam_type(struct jailparam *jp) if (sysctl(mib + 2, miblen / sizeof(int), NULL, &jp->jp_valuelen, NULL, 0) < 0) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(" SJPARAM ".%s): %s", jp->jp_name, + "sysctl(" SJPARAM ".%s): %s", name, strerror(errno)); return (-1); } @@ -995,10 +998,9 @@ jailparam_type(struct jailparam *jp) "sysctl(0.1): %s", strerror(errno)); return (-1); } - if (desclen == - sizeof(SJPARAM) + strlen(jp->jp_name) + 2 && + if (desclen == sizeof(SJPARAM) + strlen(name) + 2 && memcmp(SJPARAM ".", desc.s, sizeof(SJPARAM)) == 0 && - memcmp(jp->jp_name, desc.s + sizeof(SJPARAM), + memcmp(name, desc.s + sizeof(SJPARAM), desclen - sizeof(SJPARAM) - 2) == 0 && desc.s[desclen - 2] == '.') goto mib_desc; From owner-svn-src-all@FreeBSD.ORG Tue May 22 18:42:16 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDBE8106566B; Tue, 22 May 2012 18:42:16 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout1-b.corp.bf1.yahoo.com (mrout1-b.corp.bf1.yahoo.com [98.139.253.104]) by mx1.freebsd.org (Postfix) with ESMTP id 5F2DE8FC0A; Tue, 22 May 2012 18:42:16 +0000 (UTC) Received: from [IPv6:::1] (rideseveral.corp.yahoo.com [10.73.160.231]) by mrout1-b.corp.bf1.yahoo.com (8.14.4/8.14.4/y.out) with ESMTP id q4MIfwu2098025; Tue, 22 May 2012 11:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yahoo-inc.com; s=cobra; t=1337712119; bh=zb7WRBswLMGn0sHRAWA5HjXvvDyXZnjH4b2a9VcRW3w=; h=Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date: Message-ID:Mime-Version:Content-Transfer-Encoding; b=i/NOb+R8MR3MWdAIRSaVZppdvxpltUZLSEJ1+iqaDaS1sw6nvO4u5xfyEz139jF5D ObncCX50YBHnYECrCXf0MJLBxdxiQ+VHIkpAyU3Q0MnLtTc1hsGrWSWI75gLtFU6Nf HAJypifhWKKBbOPkHUD9LZSeHpcd+G2Y7Yi2rLLE= From: Sean Bruno To: John Baldwin In-Reply-To: <4FBAD919.2010706@FreeBSD.org> References: <201205211958.q4LJweXG070838@svn.freebsd.org> <201205211718.34896.jhb@freebsd.org> <4FBAD919.2010706@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" Date: Tue, 22 May 2012 11:41:57 -0700 Message-ID: <1337712117.2916.10.camel@powernoodle-l7.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Milter-Version: master.31+4-gbc07cd5+ X-CLX-ID: 712118000 Cc: "svn-src-stable@FreeBSD.org" , Sean Bruno , "src-committers@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "svn-src-stable-9@FreeBSD.org" Subject: Re: svn commit: r235738 - in stable/9/sys: . dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 18:42:16 -0000 On Mon, 2012-05-21 at 17:08 -0700, John Baldwin wrote: > On 5/21/12 5:18 PM, John Baldwin wrote: > > On Monday, May 21, 2012 3:58:40 pm Sean Bruno wrote: > >> Author: sbruno > >> Date: Mon May 21 19:58:40 2012 > >> New Revision: 235738 > >> URL: http://svn.freebsd.org/changeset/base/235738 > >> > >> Log: > >> MFC r235634 > >> > >> Fix and update battery status bits according to linux driver > > > > Hmm, svn seems to have crapped itself. > > > > We should probably at least remove the unnecessary mergeinfo from files. > > > > Ah, it looks like the MFC of the last round of ixgbe changes was merged into a > > sparse checkout, and that is causing the pain. I will try to fix this, but > > can other folks hold off on merging to stable/9/sys while I do so? > > I think I have this cleaned up. However, I have only tried using a 1.6 > client so far (and it was merging things fine before). Sean, I think > you are using a 1.7 client, yes? > Correct: [sbruno@ref9-xen64 /dumpster/scratch/sbruno-scratch/9]$ svn --version svn, version 1.7.2 (r1207936) compiled Dec 10 2011, 23:46:28 Copyright (C) 2011 The Apache Software Foundation. This software consists of contributions made by many people; see the NOTICE file for more information. Subversion is open source software, see http://subversion.apache.org/ The following repository access (RA) modules are available: * ra_neon : Module for accessing a repository via WebDAV protocol using Neon. - handles 'http' scheme - handles 'https' scheme * ra_svn : Module for accessing a repository using the svn network protocol. - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk. - handles 'file' scheme > If anyone does a merge and notices that it adds a ton of new mergeinfo, > can you please wait to commit until after someone else has looked at it? > Hopefully the mergeinfo stuff I adjusted will fix this. (And I'm > done with my current guesses at fixing.) > Sean From owner-svn-src-all@FreeBSD.ORG Tue May 22 18:48:10 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3AA89106566B; Tue, 22 May 2012 18:48:10 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 167AF8FC18; Tue, 22 May 2012 18:48:09 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q4MIRFZd083193; Tue, 22 May 2012 11:27:15 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q4MIRF3P083192; Tue, 22 May 2012 11:27:15 -0700 (PDT) (envelope-from obrien) Date: Tue, 22 May 2012 11:27:15 -0700 From: "David O'Brien" To: "Pedro F. Giffuni" Message-ID: <20120522182715.GA83169@dragon.NUXI.org> References: <201205181902.q4IJ2ecZ070498@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201205181902.q4IJ2ecZ070498@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235623 - in head/contrib/gcc: . config/rs6000 config/sparc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 18:48:10 -0000 On Fri, May 18, 2012 at 07:02:40PM +0000, Pedro F. Giffuni wrote: > Log: > Bring in a subset of gcc fixes that were back ported to > the GCC 4.1 branch and are available under GPLv2. I do not understand this -- We're using GCC 4.2.1 @r127959, but you are bringing in patches that are against 4.1. What version of GCC were the changes back ported from if not 4.2.0 or 4.2.1? BTW, these also should have been imported into ^/vendor/gcc/ and then merged into ^/head/contrib/gcc as there are commercial users of FreeBSD that have to modify their compiler to be able to consume FreeBSD source code. And provenance and licensing matters to these folks. -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Tue May 22 19:30:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D643106566C for ; Tue, 22 May 2012 19:30:29 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm11.bullet.mail.bf1.yahoo.com (nm11.bullet.mail.bf1.yahoo.com [98.139.212.170]) by mx1.freebsd.org (Postfix) with SMTP id EADC68FC08 for ; Tue, 22 May 2012 19:30:28 +0000 (UTC) Received: from [98.139.212.147] by nm11.bullet.mail.bf1.yahoo.com with NNFMP; 22 May 2012 19:30:22 -0000 Received: from [98.139.211.205] by tm4.bullet.mail.bf1.yahoo.com with NNFMP; 22 May 2012 19:30:22 -0000 Received: from [127.0.0.1] by smtp214.mail.bf1.yahoo.com with NNFMP; 22 May 2012 19:30:22 -0000 X-Yahoo-Newman-Id: 731511.24542.bm@smtp214.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: OqttDRcVM1kFG68p5.ZGkLr5z4HbKWM_5k42ZKO9dbtORYM VbNEtCIjT5ecW7TXL9t.Fqu2hEEHQTGOE4DqLiv3DGGK02rLFHrqtKMCUSo6 iaE3.wqY5V4F9iB0haQVQonk7.qKJL.0sCLvhiVkWjz0.aGi7lWz1yN80eyr T8liEcnkbgZZL7INltCcMX5j3Nxe17J6pAdLhCzmbuL94rE_sGzjQc8uHJMQ GFzBaY21oMhA24XQj.I83ZV7rKzxMLZwsx6NcxSlpann1AjEMD9NL_Ys58QX R0chdP9R_a0jCl4CwSWGmA.GLASGDV0EYn9uJjEKn5N4ucA6etlSCyXpVxu0 ldlTrszeTWbwl3GMrFJ3pVnk1rY_31Pk9rj4wdcyXBZ9x6B_E4TQe2B_rz7. oXCHdYJiblH0qmwxZCK7paxt5IsXnMDd2gcUz0UXRFRqXb80t5ye3Ig-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Received: from [192.168.10.102] (pfg@200.118.157.7 with plain) by smtp214.mail.bf1.yahoo.com with SMTP; 22 May 2012 12:30:22 -0700 PDT Message-ID: <4FBBE94C.8010907@FreeBSD.org> Date: Tue, 22 May 2012 14:30:20 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120506 Thunderbird/12.0.1 MIME-Version: 1.0 To: obrien@FreeBSD.org References: <201205181902.q4IJ2ecZ070498@svn.freebsd.org> <20120522182715.GA83169@dragon.NUXI.org> In-Reply-To: <20120522182715.GA83169@dragon.NUXI.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235623 - in head/contrib/gcc: . config/rs6000 config/sparc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:30:29 -0000 Hi David; On 05/22/12 13:27, David O'Brien wrote: > On Fri, May 18, 2012 at 07:02:40PM +0000, Pedro F. Giffuni wrote: >> Log: >> Bring in a subset of gcc fixes that were back ported to >> the GCC 4.1 branch and are available under GPLv2. > I do not understand this -- We're using GCC 4.2.1 @r127959, but you > are bringing in patches that are against 4.1. > > What version of GCC were the changes back ported from if not 4.2.0 or > 4.2.1? Most of them originated in gcc 4.3 branch and were backported to gcc > 4.2.2 under the GPLv3. Those patches were further backported to gcc 4.1.x which continued to be released under GPLv2. Technically I cannot take patches from the gcc 4.2.x where x >=2 so I took them from the gcc 4.1 branch. > > BTW, these also should have been imported into ^/vendor/gcc/ and then > merged into ^/head/contrib/gcc as there are commercial users of FreeBSD > that have to modify their compiler to be able to consume FreeBSD source > code. And provenance and licensing matters to these folks. > This was discussed in private with mm@, as he brought some GPLv2 changes from the gcc 4.3 branch. We don't carry gcc 4.3 or 4.1 in the vendors area and the code from those branches that we can merge is relatively small. (We do keep a changelog for gcc4.3 changes for reference.) FWIW, we also merged the complete libstdc++ from gcc 4.2.4 as libstdc++ remained under LGPLv2 for all the gcc 4.2 branch. Pedro. From owner-svn-src-all@FreeBSD.ORG Tue May 22 19:37:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F020106566B; Tue, 22 May 2012 19:37:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AABD8FC0A; Tue, 22 May 2012 19:37: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 q4MJbC16023311; Tue, 22 May 2012 19:37:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MJbCQ5023309; Tue, 22 May 2012 19:37:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205221937.q4MJbCQ5023309@svn.freebsd.org> From: Adrian Chadd Date: Tue, 22 May 2012 19:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235801 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:37:13 -0000 Author: adrian Date: Tue May 22 19:37:12 2012 New Revision: 235801 URL: http://svn.freebsd.org/changeset/base/235801 Log: Fix some corner cases in the ieee80211_send_bar() handling. * If the first call succeeded but failed to transmit, a timer would reschedule it via bar_timeout(). Unfortunately bar_timeout() didn't check the return value from the ieee80211_send_bar() reattempt and if that failed (eg the driver ic_raw_xmit() failed), it would never re-arm the timer. * If BARPEND is cleared (which ieee80211_send_bar() will do if it can't TX), then re-arming the timer isn't enough - once bar_timeout() occurs, it'll see BARPEND is 0 and not run through the rest of the routine. So when rearming the timer, also set that flag. * If the TX wasn't occuring, bar_tx_complete() wouldn't be called and the driver callback wouldn't be called either. So the driver had no idea that the BAR TX attempt had failed. In the ath(4) case, TX would stay paused. (There's no callback to indicate that BAR TX had failed or not; only a "BAR TX was attempted". That's a separate, later problem.) So call the driver callback (ic_bar_response()) before the ADDBA session is torn down, so it has a chance of being notified that things didn't quite go to plan. I've verified that yes, this does suspend traffic for ath(4), retry BAR TX even if the driver is failing ic_raw_xmit(), and then eventually giving up and sending a DELBA. I'll address the "out of ath_buf" issue in ath(4) in a subsequent commit - this commit just fixes the edge case where any driver is (way) out of internal buffers/descriptors and fails frame TX. PR: kern/168170 Reviewed by: bschmidt MFC after: 1 month Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Tue May 22 18:31:56 2012 (r235800) +++ head/sys/net80211/ieee80211_ht.c Tue May 22 19:37:12 2012 (r235801) @@ -2166,6 +2166,9 @@ ieee80211_ampdu_stop(struct ieee80211_no } } +/* XXX */ +static void bar_start_timer(struct ieee80211_tx_ampdu *tap); + static void bar_timeout(void *arg) { @@ -2184,11 +2187,34 @@ bar_timeout(void *arg) return; /* XXX ? */ if (tap->txa_attempts >= ieee80211_bar_maxtries) { + struct ieee80211com *ic = ni->ni_ic; + ni->ni_vap->iv_stats.is_ampdu_bar_tx_fail++; + /* + * If (at least) the last BAR TX timeout was due to + * an ieee80211_send_bar() failures, then we need + * to make sure we notify the driver that a BAR + * TX did occur and fail. This gives the driver + * a chance to undo any queue pause that may + * have occured. + */ + ic->ic_bar_response(ni, tap, 1); ieee80211_ampdu_stop(ni, tap, IEEE80211_REASON_TIMEOUT); } else { ni->ni_vap->iv_stats.is_ampdu_bar_tx_retry++; - ieee80211_send_bar(ni, tap, tap->txa_seqpending); + if (ieee80211_send_bar(ni, tap, tap->txa_seqpending) != 0) { + /* + * If ieee80211_send_bar() fails here, the + * timer may have stopped and/or the pending + * flag may be clear. Because of this, + * fake the BARPEND and reset the timer. + * A retransmission attempt will then occur + * during the next timeout. + */ + /* XXX locking */ + tap->txa_flags |= IEEE80211_AGGR_BARPEND; + bar_start_timer(tap); + } } } From owner-svn-src-all@FreeBSD.ORG Tue May 22 19:40:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A48291065677; Tue, 22 May 2012 19:40:54 +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 904AF8FC12; Tue, 22 May 2012 19:40: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 q4MJesSI023505; Tue, 22 May 2012 19:40:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MJes9V023503; Tue, 22 May 2012 19:40:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205221940.q4MJes9V023503@svn.freebsd.org> From: Xin LI Date: Tue, 22 May 2012 19:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235802 - head/usr.bin/minigzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:40:54 -0000 Author: delphij Date: Tue May 22 19:40:54 2012 New Revision: 235802 URL: http://svn.freebsd.org/changeset/base/235802 Log: commandline -> command line MFC after: 1 week Modified: head/usr.bin/minigzip/minigzip.1 Modified: head/usr.bin/minigzip/minigzip.1 ============================================================================== --- head/usr.bin/minigzip/minigzip.1 Tue May 22 19:37:12 2012 (r235801) +++ head/usr.bin/minigzip/minigzip.1 Tue May 22 19:40:54 2012 (r235802) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 3, 2002 +.Dd May 22, 2012 .Dt MINIGZIP 1 .Os .Sh NAME @@ -48,7 +48,7 @@ output. The default operation is compression, decompression can be selected by supplying the .Fl d -flag on the commandline. +flag on the command line. .Pp If any .Ar file From owner-svn-src-all@FreeBSD.ORG Tue May 22 19:43:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60EFF1065672; Tue, 22 May 2012 19:43:21 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CABE8FC0A; Tue, 22 May 2012 19:43: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 q4MJhLvq023642; Tue, 22 May 2012 19:43:21 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MJhLDV023640; Tue, 22 May 2012 19:43:21 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205221943.q4MJhLDV023640@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 22 May 2012 19:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235803 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:43:21 -0000 Author: trasz Date: Tue May 22 19:43:20 2012 New Revision: 235803 URL: http://svn.freebsd.org/changeset/base/235803 Log: Fix use-after-free in kern_jail_set() triggered e.g. by attempts to clear "persist" flag from empty persistent jail, like this: jail -c persist=1 jail -n 1 -m persist=0 Submitted by: Mateusz Guzik MFC after: 2 weeks Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue May 22 19:40:54 2012 (r235802) +++ head/sys/kern/kern_jail.c Tue May 22 19:43:20 2012 (r235803) @@ -1811,6 +1811,16 @@ kern_jail_set(struct thread *td, struct } } +#ifdef RACCT + if (!created) { + sx_sunlock(&allprison_lock); + prison_racct_modify(pr); + sx_slock(&allprison_lock); + } +#endif + + td->td_retval[0] = pr->pr_id; + /* * Now that it is all there, drop the temporary reference from existing * prisons. Or add a reference to newly created persistent prisons @@ -1832,12 +1842,6 @@ kern_jail_set(struct thread *td, struct sx_sunlock(&allprison_lock); } -#ifdef RACCT - if (!created) - prison_racct_modify(pr); -#endif - - td->td_retval[0] = pr->pr_id; goto done_errmsg; done_deref_locked: From owner-svn-src-all@FreeBSD.ORG Tue May 22 19:50:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18D27106566C; Tue, 22 May 2012 19:50:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 057058FC15; Tue, 22 May 2012 19:50: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 q4MJoLaS023996; Tue, 22 May 2012 19:50:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MJoLHG023994; Tue, 22 May 2012 19:50:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205221950.q4MJoLHG023994@svn.freebsd.org> From: Adrian Chadd Date: Tue, 22 May 2012 19:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235804 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:50:22 -0000 Author: adrian Date: Tue May 22 19:50:21 2012 New Revision: 235804 URL: http://svn.freebsd.org/changeset/base/235804 Log: Re-up the TX ath_buf limit from 128 to 512. I'll have to leave this high for now, until I've done some significant surgery with how ath_bufs (and descriptors) are handled. This should significantly cut down on the opportunities for a full TX queue hanging traffic. I'll continue making things work though; I'm mostly doing this for users. :) Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue May 22 19:43:20 2012 (r235803) +++ head/sys/dev/ath/if_athvar.h Tue May 22 19:50:21 2012 (r235804) @@ -47,7 +47,7 @@ * 802.11n requires more TX and RX buffers to do AMPDU. */ #ifdef ATH_ENABLE_11N -#define ATH_TXBUF 128 +#define ATH_TXBUF 512 #define ATH_RXBUF 512 #endif From owner-svn-src-all@FreeBSD.ORG Tue May 22 19:53:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AB43106566C; Tue, 22 May 2012 19:53:25 +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 85ED48FC16; Tue, 22 May 2012 19:53:25 +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 q4MJrPqB024185; Tue, 22 May 2012 19:53:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MJrPCL024183; Tue, 22 May 2012 19:53:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205221953.q4MJrPCL024183@svn.freebsd.org> From: Xin LI Date: Tue, 22 May 2012 19:53:25 +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: r235805 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:53:25 -0000 Author: delphij Date: Tue May 22 19:53:25 2012 New Revision: 235805 URL: http://svn.freebsd.org/changeset/base/235805 Log: MFC r235036: Add ToS definitions for DiffServ Codepoints as per RFC2474. Obtained from: OpenBSD Modified: stable/9/sys/netinet/ip.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/ip.h ============================================================================== --- stable/9/sys/netinet/ip.h Tue May 22 19:50:21 2012 (r235804) +++ stable/9/sys/netinet/ip.h Tue May 22 19:53:25 2012 (r235805) @@ -92,6 +92,31 @@ struct ip { #define IPTOS_PREC_ROUTINE 0x00 /* + * Definitions for DiffServ Codepoints as per RFC2474 + */ +#define IPTOS_DSCP_CS0 0x00 +#define IPTOS_DSCP_CS1 0x20 +#define IPTOS_DSCP_AF11 0x28 +#define IPTOS_DSCP_AF12 0x30 +#define IPTOS_DSCP_AF13 0x38 +#define IPTOS_DSCP_CS2 0x40 +#define IPTOS_DSCP_AF21 0x48 +#define IPTOS_DSCP_AF22 0x50 +#define IPTOS_DSCP_AF23 0x58 +#define IPTOS_DSCP_CS3 0x60 +#define IPTOS_DSCP_AF31 0x68 +#define IPTOS_DSCP_AF32 0x70 +#define IPTOS_DSCP_AF33 0x78 +#define IPTOS_DSCP_CS4 0x80 +#define IPTOS_DSCP_AF41 0x88 +#define IPTOS_DSCP_AF42 0x90 +#define IPTOS_DSCP_AF43 0x98 +#define IPTOS_DSCP_CS5 0xa0 +#define IPTOS_DSCP_EF 0xb8 +#define IPTOS_DSCP_CS6 0xc0 +#define IPTOS_DSCP_CS7 0xe0 + +/* * ECN (Explicit Congestion Notification) codepoints in RFC3168 mapped to the * lower 2 bits of the TOS field. */ From owner-svn-src-all@FreeBSD.ORG Tue May 22 19:55:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A3F5106564A; Tue, 22 May 2012 19:55:50 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id B52AC8FC0C; Tue, 22 May 2012 19:55:48 +0000 (UTC) Received: by laai10 with SMTP id i10so6653911laa.13 for ; Tue, 22 May 2012 12:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=RbIoaTumwO9OIZ3MTkrmI0BD7iFPzxjD/cVAd9MKL4w=; b=WbpUliNVEYDSHKYllm7ncffEfii3tWYvgUgEE4uYIVAH9cA1VFeqIL2y2SEFX69nVE xc0iygBPENi1BEDBsJo18fK8kTxQS1CZZkQpdIODxXeA61xRAiqrpotNVPBSOVHNDpam Fy/jKDt+qJYAgFrfptxI4scdHO25v0tRdg22blzxUQKxDANhOfUsmluxI/ghJWlSrJRH KXBOI2WVpCnb7pEy4iPk5VB5V4wyqUzX9q9TtheyYu+lIKf57X84qzIM2VCRActFlD55 8tKRvJnW/u/qnjLgbKYwn1q8Y59BWUIWJiWJLt6HZNdf+zQM804EOp13kY+H4NYp3Hym YAoQ== MIME-Version: 1.0 Received: by 10.152.104.171 with SMTP id gf11mr24516919lab.5.1337716547603; Tue, 22 May 2012 12:55:47 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.27.65 with HTTP; Tue, 22 May 2012 12:55:47 -0700 (PDT) In-Reply-To: <20120422170842.GA18403@garage.freebsd.pl> References: <201204200650.q3K6oiqO026673@svn.freebsd.org> <20120422170842.GA18403@garage.freebsd.pl> Date: Tue, 22 May 2012 20:55:47 +0100 X-Google-Sender-Auth: pPvimYqWzXVn73rtjeOoWfffiGk Message-ID: From: Attilio Rao To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kirk McKusick Subject: Re: svn commit: r234482 - in head/sys: fs/msdosfs fs/nfsserver kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:55:50 -0000 2012/4/22 Pawel Jakub Dawidek : > On Fri, Apr 20, 2012 at 06:50:44AM +0000, Kirk McKusick wrote: >> Author: mckusick >> Date: Fri Apr 20 06:50:44 2012 >> New Revision: 234482 >> URL: http://svn.freebsd.org/changeset/base/234482 >> >> Log: >> =C2=A0 This change creates a new list of active vnodes associated with >> =C2=A0 a mount point. Active vnodes are those with a non-zero use or hol= d >> =C2=A0 count, e.g., those vnodes that are not on the free list. Note tha= t >> =C2=A0 this list is in addition to the list of all the vnodes associated >> =C2=A0 with a mount point. >> >> =C2=A0 To avoid adding another set of linkage pointers to the vnode >> =C2=A0 structure, the active list uses the existing linkage pointers >> =C2=A0 used by the free list (previously named v_freelist, now renamed >> =C2=A0 v_actfreelist). >> >> =C2=A0 This update adds the MNT_VNODE_FOREACH_ACTIVE interface that loop= s >> =C2=A0 over just the active vnodes associated with a mount point (typica= lly >> =C2=A0 less than 1% of the vnodes associated with the mount point). > [...] >> @@ -1099,6 +1128,14 @@ insmntque1(struct vnode *vp, struct moun >> =C2=A0 =C2=A0 =C2=A0 VNASSERT(mp->mnt_nvnodelistsize >=3D 0, vp, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("neg mount point vnode= list size")); >> =C2=A0 =C2=A0 =C2=A0 mp->mnt_nvnodelistsize++; >> + =C2=A0 =C2=A0 KASSERT((vp->v_iflag & VI_ACTIVE) =3D=3D 0, >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("Activating already active vnode")); >> + =C2=A0 =C2=A0 vp->v_iflag |=3D VI_ACTIVE; >> + =C2=A0 =C2=A0 mtx_lock(&vnode_free_list_mtx); >> + =C2=A0 =C2=A0 TAILQ_INSERT_HEAD(&mp->mnt_activevnodelist, vp, v_actfre= elist); >> + =C2=A0 =C2=A0 mp->mnt_activevnodelistsize++; >> + =C2=A0 =C2=A0 mtx_unlock(&vnode_free_list_mtx); >> + =C2=A0 =C2=A0 VI_UNLOCK(vp); >> =C2=A0 =C2=A0 =C2=A0 MNT_IUNLOCK(mp); >> =C2=A0 =C2=A0 =C2=A0 return (0); >> =C2=A0} > > > Now, for every vnode that is activated, it has to go through global > mutex, which seems like scalability issue to me. With ZFS it is typical > to have a lot of file systems and this global mutex was not needed > before (well, it was needed, but only to get vnode from the free list). > > If we require vnode interlock to be held during v_actfreelist > manipulation then why can't we use interlock+vnode_free_list_mtx when > operating on the free list and interlock+per-mountpoint-lock when > operating on mnt_activevnodelist? I think this is the better idea for this case and it should really be fixed= . However, note that a per-mount lock here is far from being ideal as you would contest a lot on the mountpoint if you have a lot of activated vnodes. Anyway the approach you propose doesn't introduce any scalability difference than what we already had in place for pre-234482. Also, it would be good to implement things like: mtx_assert(MNT_MTX(mp), MA_OWNED); by providing appropriate wrappers as we do in vnode interface. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue May 22 20:05:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C6FB106566B; Tue, 22 May 2012 20:05:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id CBBE68FC0A; Tue, 22 May 2012 20:05:15 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4MK57LV006392 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 May 2012 06:05:08 +1000 Date: Wed, 23 May 2012 06:05:06 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "David E. O'Brien" In-Reply-To: <201205221818.q4MII7lk019626@svn.freebsd.org> Message-ID: <20120523050739.H3621@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 20:05:39 -0000 On Tue, 22 May 2012, David E. O'Brien wrote: > Log: > Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. I think I like this, since it is technically correct, and will find a different set of type mismatches. > Modified: head/contrib/gcc/c-format.c > ============================================================================== > --- head/contrib/gcc/c-format.c Tue May 22 17:44:01 2012 (r235796) > +++ head/contrib/gcc/c-format.c Tue May 22 18:18:06 2012 (r235797) > @@ -287,7 +287,11 @@ static const format_length_info printf_l > { > { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, > { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, > +#ifdef __LP64__ > + { "q", FMT_LEN_l, STD_EXT, NULL, 0, 0 }, > +#else > { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, > +#endif > { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, > { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, > { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, > Of course, %qd should never be used. On LP32, quad_t is long long, while on LP64, quad_t is long, so any use of %qd required messy ifdefs or casting a quad_t arg to long long to work on LP64. Now, %qd actually matches quad_t on LP64, so casting to long long is no longer needed, but anything that does it is broken and would require changing to cast to quad_t, or perhaps to omit the cast. You might find too much bugware that (1) uses %qd (2) uses it on args that don't always have type quad_t (3) casts to long long. Casting to quad_t didn't work on LP64 before, so probably nothing in FreeBSD does it. Grepping for %q in /sys finds only a few uses of %q with a few type mismatches (different mismatches before and after this commit). (I didn't grep for more compicated formats with stuff between the % and the q.): % ./compat/ndis/subr_ntoskrnl.c: printf("timer sets: %qu\n", ntoskrnl_timer_sets); % ./compat/ndis/subr_ntoskrnl.c: printf("timer reloads: %qu\n", ntoskrnl_timer_reloads); % ./compat/ndis/subr_ntoskrnl.c: printf("timer cancels: %qu\n", ntoskrnl_timer_cancels); % ./compat/ndis/subr_ntoskrnl.c: printf("timer fires: %qu\n", ntoskrnl_timer_fires); This was broken before on LP64. It now works accidentally. All these %qu formats are bogus, since the variables don't have type quad_t; they have type uint64_t. Now that %q works, quad_t's are actually easier to print that int64_t's since there is a format letter just for them. But this only helps if the variables actually have type quad_t. % ./dev/esp/ncr53c9x.c: panic("%s: lun %qx for ecb %p does not exist", __func__, % ./dev/esp/ncr53c9x.c: panic("%s: slot %d for lun %qx has %p instead of ecb " This is under DIAGNOSTIC and is now broken. Again the variable doesn't have type [u_]quad_t. It has type int64_t. This is printed using the doubly- incompatible format %qx (signed type but unsigned format; int64 type but quad format letter). Then to be bug for bug compatible with old gcc, this incompatible format was cast to a different doubly-incompatible type. % ./fs/msdosfs/msdosfs_vnops.c: printf(" va_blocksize %lx, va_rdev %x, va_bytes %qx, va_gen %lx\n", This is under the non-option MSDOSFS_DEBUG. It was broken before, but now works, since va_bytes actually has type u_quad_t and was not bogusly cast to unsigned long long). % ./fs/nfsclient/nfs_clstate.c: printf("lck typ=%d fst=%qd end=%qd\n", % ./fs/nfsclient/nfs_clstate.c: printf("lck typ=%d fst=%qd end=%qd\n", These are under !__FreeBSD__ ifdefs. The ifdefs are related to the type errors. The types are u_int64_t. Under FreeBSD, they are printed correctly with only 1 type error for each: they are bogusly cast to intmax_t (sign error), then printed with %ju (this matches the sign of the variables but is a sign error relative to the cast. The errors normally cancel). Under !__FreeBSD__, they are printed using %qd, without any casts. There is now a sign error in the format, and type mismatches. This would now compiler under FreeBSD despite all the type mismatches -- the sign error doesn't matter in practice; u_int64_t matches u_quad_t on all supported arches, and after your changes the logical mismatch is no longer detected by gcc. % ./geom/geom_map.c: ret = sscanf(line, "search:%qi:%qi:%63c", This has more than the usual density of bugs: - scanf() is unusable but is used - %q format is used - % the variables are further from being quad_t's than usual. They are off_t's. off_t happens to have type int64_t, so this works accidentally on all supported arches. - %qi is an unusual spelling of %qd. You didn't change gcc for scanf. "q" for it still maps to FMT_LEN_ll. The above should never have compiled on LP64. % ./gnu/fs/xfs/FreeBSD/xfs_buf.c: printf("bread failed specvp %p blkno %qd BBTOB(len) %ld\n", The variable has type xfs_daddr_t, which is __s64, which is signed long long int in xfs/FreeBSD. This used to be compatible with %qd, but no longer is. xfs shouldn't compile any more on LP64. Now I prefer the old way, after fixing the bugs found by switching. It finds more bugs under FreeBSD, and is bug for bug compatible with distribution gcc and probably with other system's headers under !FreeBSD. Except under FreeBSD, I prefer %q to be an error. The above shows it only being used 12 times in /sys, with most uses of it being bugs. Fixing these bugs would leave about 1 correct use of it -- for printing the quad_t in unreachable code in msdosfs. This use would be easy to avoid too (just cast to uintmax_t). Uses in userland are hopefully east to fix and avoid too. In an old userland, there were only about 50, with most in netstat/inet6.c, tcopy.c, ftpd, fsirand, and contrib'ed code. Of course you can't make it an error for the contrib'ed code. Bruce From owner-svn-src-all@FreeBSD.ORG Tue May 22 20:26:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7994C106564A; Tue, 22 May 2012 20:26:15 +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 64FD58FC16; Tue, 22 May 2012 20:26: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 q4MKQF4e025732; Tue, 22 May 2012 20:26:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MKQFO0025730; Tue, 22 May 2012 20:26:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205222026.q4MKQFO0025730@svn.freebsd.org> From: Dimitry Andric Date: Tue, 22 May 2012 20:26: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: r235806 - stable/9/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 20:26:15 -0000 Author: dim Date: Tue May 22 20:26:14 2012 New Revision: 235806 URL: http://svn.freebsd.org/changeset/base/235806 Log: MFC r227478: Fix kernel build breakage after r227475. I had forgotten kernels are built with -Wundef, as opposed to world. Additionally, cdefs.h tends to not use indentation for preprocessor directives, so remove that too. Pointy hat to: me Modified: stable/9/sys/sys/cdefs.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/cdefs.h ============================================================================== --- stable/9/sys/sys/cdefs.h Tue May 22 19:53:25 2012 (r235805) +++ stable/9/sys/sys/cdefs.h Tue May 22 20:26:14 2012 (r235806) @@ -309,14 +309,14 @@ #endif /* C++11 exposes a load of C99 stuff */ -#if __cplusplus >= 201103L -# define __LONG_LONG_SUPPORTED -# ifndef __STDC_LIMIT_MACROS -# define __STDC_LIMIT_MACROS -# endif -# ifndef __STDC_CONSTANT_MACROS -# define __STDC_CONSTANT_MACROS -# endif +#if defined(__cplusplus) && __cplusplus >= 201103L +#define __LONG_LONG_SUPPORTED +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif +#ifndef __STDC_CONSTANT_MACROS +#define __STDC_CONSTANT_MACROS +#endif #endif /* From owner-svn-src-all@FreeBSD.ORG Tue May 22 20:48:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C999C1065672; Tue, 22 May 2012 20:48:42 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id 7C81F8FC0A; Tue, 22 May 2012 20:48:42 +0000 (UTC) Received: from [209.249.190.124] (port=41221 helo=punk.neville-neil.com.neville-neil.com) by vps.hungerhost.com with esmtpa (Exim 4.77) (envelope-from ) id 1SWw0X-00010i-Pj; Tue, 22 May 2012 16:48:41 -0400 Date: Tue, 22 May 2012 16:49:37 -0400 Message-ID: <861umcx7oe.wl%gnn@neville-neil.com> From: gnn@freebsd.org To: Bruce Evans In-Reply-To: <20120523050739.H3621@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/23.4 (amd64-portbld-freebsd10.0) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 20:48:42 -0000 At Wed, 23 May 2012 06:05:06 +1000 (EST), Bruce Evans wrote: > > On Tue, 22 May 2012, David E. O'Brien wrote: > > > Log: > > Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. > > I think I like this, since it is technically correct, and will find a > different set of type mismatches. > > > Modified: head/contrib/gcc/c-format.c > > ============================================================================== > > --- head/contrib/gcc/c-format.c Tue May 22 17:44:01 2012 (r235796) > > +++ head/contrib/gcc/c-format.c Tue May 22 18:18:06 2012 (r235797) > > @@ -287,7 +287,11 @@ static const format_length_info printf_l > > { > > { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, > > { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, > > +#ifdef __LP64__ > > + { "q", FMT_LEN_l, STD_EXT, NULL, 0, 0 }, > > +#else > > { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, > > +#endif > > { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, > > { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, > > { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, > > > > Of course, %qd should never be used. On LP32, quad_t is long long, while > on LP64, quad_t is long, so any use of %qd required messy ifdefs or > casting a quad_t arg to long long to work on LP64. Now, %qd actually > matches quad_t on LP64, so casting to long long is no longer needed, but > anything that does it is broken and would require changing to cast to > quad_t, or perhaps to omit the cast. You might find too much bugware that > (1) uses %qd > (2) uses it on args that don't always have type quad_t > (3) casts to long long. Casting to quad_t didn't work on LP64 before, so > probably nothing in FreeBSD does it. > > Grepping for %q in /sys finds only a few uses of %q with a few type > mismatches (different mismatches before and after this commit). (I > didn't grep for more compicated formats with stuff between the % and the > q.): > > % ./compat/ndis/subr_ntoskrnl.c: printf("timer sets: %qu\n", ntoskrnl_timer_sets); > % ./compat/ndis/subr_ntoskrnl.c: printf("timer reloads: %qu\n", ntoskrnl_timer_reloads); > % ./compat/ndis/subr_ntoskrnl.c: printf("timer cancels: %qu\n", ntoskrnl_timer_cancels); > % ./compat/ndis/subr_ntoskrnl.c: printf("timer fires: %qu\n", ntoskrnl_timer_fires); > > This was broken before on LP64. It now works accidentally. All these %qu > formats are bogus, since the variables don't have type quad_t; they have > type uint64_t. Now that %q works, quad_t's are actually easier to print > that int64_t's since there is a format letter just for them. But this > only helps if the variables actually have type quad_t. > > % ./dev/esp/ncr53c9x.c: panic("%s: lun %qx for ecb %p does not exist", __func__, > % ./dev/esp/ncr53c9x.c: panic("%s: slot %d for lun %qx has %p instead of ecb " > > This is under DIAGNOSTIC and is now broken. Again the variable doesn't have > type [u_]quad_t. It has type int64_t. This is printed using the doubly- > incompatible format %qx (signed type but unsigned format; int64 type but > quad format letter). Then to be bug for bug compatible with old gcc, this > incompatible format was cast to a different doubly-incompatible type. > > % ./fs/msdosfs/msdosfs_vnops.c: printf(" va_blocksize %lx, va_rdev %x, va_bytes %qx, va_gen %lx\n", > > This is under the non-option MSDOSFS_DEBUG. It was broken before, but now > works, since va_bytes actually has type u_quad_t and was not bogusly cast > to unsigned long long). > > % ./fs/nfsclient/nfs_clstate.c: printf("lck typ=%d fst=%qd end=%qd\n", > % ./fs/nfsclient/nfs_clstate.c: printf("lck typ=%d fst=%qd end=%qd\n", > > These are under !__FreeBSD__ ifdefs. The ifdefs are related to the type > errors. The types are u_int64_t. Under FreeBSD, they are printed > correctly with only 1 type error for each: they are bogusly cast to > intmax_t (sign error), then printed with %ju (this matches the sign of > the variables but is a sign error relative to the cast. The errors > normally cancel). Under !__FreeBSD__, they are printed using %qd, > without any casts. There is now a sign error in the format, and type > mismatches. This would now compiler under FreeBSD despite all the > type mismatches -- the sign error doesn't matter in practice; u_int64_t > matches u_quad_t on all supported arches, and after your changes the > logical mismatch is no longer detected by gcc. > > % ./geom/geom_map.c: ret = sscanf(line, "search:%qi:%qi:%63c", > > This has more than the usual density of bugs: > - scanf() is unusable but is used > - %q format is used > - % the variables are further from being quad_t's than usual. They are > off_t's. off_t happens to have type int64_t, so this works accidentally > on all supported arches. > - %qi is an unusual spelling of %qd. > > You didn't change gcc for scanf. "q" for it still maps to FMT_LEN_ll. > The above should never have compiled on LP64. > > % ./gnu/fs/xfs/FreeBSD/xfs_buf.c: printf("bread failed specvp %p blkno %qd BBTOB(len) %ld\n", > > The variable has type xfs_daddr_t, which is __s64, which is signed long long > int in xfs/FreeBSD. This used to be compatible with %qd, but no longer is. > xfs shouldn't compile any more on LP64. > > Now I prefer the old way, after fixing the bugs found by switching. > It finds more bugs under FreeBSD, and is bug for bug compatible with > distribution gcc and probably with other system's headers under > !FreeBSD. Except under FreeBSD, I prefer %q to be an error. The above > shows it only being used 12 times in /sys, with most uses of it being > bugs. Fixing these bugs would leave about 1 correct use of it -- for > printing the quad_t in unreachable code in msdosfs. This use would be > easy to avoid too (just cast to uintmax_t). Uses in userland are > hopefully east to fix and avoid too. In an old userland, there were > only about 50, with most in netstat/inet6.c, tcopy.c, ftpd, fsirand, > and contrib'ed code. Of course you can't make it an error for the > contrib'ed code. > Instead of replying to the original commit I'll just add to the chain. Note that this change broke buildworld: src/usr.sbin/ppp/throughput.c: In function 'throughput_disp': src/usr.sbin/ppp/throughput.c:119: warning: format '%6qu' expects type 'long unsigned int', but argu And several more. Best, George From owner-svn-src-all@FreeBSD.ORG Tue May 22 21:07:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F1F6106566B; Tue, 22 May 2012 21:07:23 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id D12398FC23; Tue, 22 May 2012 21:07:22 +0000 (UTC) Received: by dadv36 with SMTP id v36so9505296dad.13 for ; Tue, 22 May 2012 14:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bQ5SH0aFxzkj3Aog1vsspkBM+ERDfE68kWgWEByryF4=; b=NNYTshrNmE9uedJutZjCAmUeMym9uXimDbRY9ddJcx+4Yp9cNTmmgK9MuC/ujsvB3g 8w1CPRmooZHBgATWgxe3TMrbnQHUh0H+3Hg30LiYJE3khpMCBFUkucVsJvv9xzVjkRZd MLQPQOviXDlAfSuMk/MRwutSRgaqz38Ca/RcXKQJYS0q7305fZqH4V+hbqA6CmrrHMb1 DNjI28BXljXmxJFUmcgn+OseL4SkVQeM2iomlffXsQyTovilMCVEgwnTiU8vyhUdn+yK wB6G9mV56YedzhcP4D+eKYn5fxdYHkuy8uzxSuAYW4YV3dwar1zfu4cjmSe6U2AfzS6B s7cg== MIME-Version: 1.0 Received: by 10.68.224.103 with SMTP id rb7mr2905721pbc.23.1337720842458; Tue, 22 May 2012 14:07:22 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.68.237.226 with HTTP; Tue, 22 May 2012 14:07:22 -0700 (PDT) In-Reply-To: <20120523050739.H3621@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> Date: Tue, 22 May 2012 14:07:22 -0700 X-Google-Sender-Auth: waTy4SSV8TkWFusznzhEYUw4-gw Message-ID: From: mdf@FreeBSD.org To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 21:07:23 -0000 On Tue, May 22, 2012 at 1:05 PM, Bruce Evans wrote: > On Tue, 22 May 2012, David E. O'Brien wrote: > >> Log: >> =A0Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit >> platforms. > > > I think I like this, since it is technically correct, and will find a > different set of type mismatches. We run with the following at Isilon, which is somewhat bogus because it allows a bit of sloppiness in types, but is also terribly convenient since it means no casting on printf arguments is needed: --- contrib/gcc/c-format.c 2012-05-22 14:08:23.538266746 -0700 +++ /data/sb/head/src/contrib/gcc/c-format.c 2012-05-16 12:59:40.937016702 -0700 @@ -2298,10 +2570,20 @@ check_format_types (format_wanted_type * equivalent but the above test won't consider them equivalent. */ if (wanted_type =3D=3D char_type_node && (!pedantic || i < 2) && char_type_flag) continue; + + /* Isilon: FreeBSD defines int64_t (and others) as one type (e.g. lo= ng + long) on i386 and another type (e.g. long) on amd64. This prevents + the use of a common format specifier. Treat equal sized integer ty= pes + as equivalent. */ + if (TREE_CODE (wanted_type) =3D=3D INTEGER_TYPE + && TREE_CODE (cur_type) =3D=3D INTEGER_TYPE + && int_size_in_bytes (wanted_type) =3D=3D int_size_in_bytes (cur_= type)) + continue; + /* Now we have a type mismatch. */ format_type_warning (types->name, format_start, format_length, wanted_type, types->pointer_count, types->wanted_type_name, orig_cur_type, arg_num)= ; } If there's no objections, I (or David or anyone else) can commit to the FreeBSD repository. Cheers, matthew From owner-svn-src-all@FreeBSD.ORG Tue May 22 21:30:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4D811065672; Tue, 22 May 2012 21:30:24 +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 85F638FC0C; Tue, 22 May 2012 21:30:24 +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 q4MLUOYc028549; Tue, 22 May 2012 21:30:24 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MLUOLP028544; Tue, 22 May 2012 21:30:24 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205222130.q4MLUOLP028544@svn.freebsd.org> From: Dimitry Andric Date: Tue, 22 May 2012 21:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235807 - in vendor/llvm/dist: . autoconf docs lib/CodeGen/SelectionDAG X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 21:30:24 -0000 Author: dim Date: Tue May 22 21:30:23 2012 New Revision: 235807 URL: http://svn.freebsd.org/changeset/base/235807 Log: Vendor import of llvm release_31 final r156748: http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_31/final@156748 Modified: vendor/llvm/dist/autoconf/configure.ac vendor/llvm/dist/configure vendor/llvm/dist/docs/ReleaseNotes.html vendor/llvm/dist/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Modified: vendor/llvm/dist/autoconf/configure.ac ============================================================================== --- vendor/llvm/dist/autoconf/configure.ac Tue May 22 20:26:14 2012 (r235806) +++ vendor/llvm/dist/autoconf/configure.ac Tue May 22 21:30:23 2012 (r235807) @@ -31,7 +31,7 @@ dnl=== dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl address for reporting bugs. -AC_INIT([LLVM],[3.1svn],[http://llvm.org/bugs/]) +AC_INIT([LLVM],[3.1],[http://llvm.org/bugs/]) AC_DEFINE([LLVM_VERSION_MAJOR], [3], [Major version of the LLVM API]) AC_DEFINE([LLVM_VERSION_MINOR], [1], [Minor version of the LLVM API]) Modified: vendor/llvm/dist/configure ============================================================================== --- vendor/llvm/dist/configure Tue May 22 20:26:14 2012 (r235806) +++ vendor/llvm/dist/configure Tue May 22 21:30:23 2012 (r235807) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for LLVM 3.1svn. +# Generated by GNU Autoconf 2.60 for LLVM 3.1. # # Report bugs to . # @@ -561,8 +561,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='LLVM' PACKAGE_TARNAME='llvm' -PACKAGE_VERSION='3.1svn' -PACKAGE_STRING='LLVM 3.1svn' +PACKAGE_VERSION='3.1' +PACKAGE_STRING='LLVM 3.1' PACKAGE_BUGREPORT='http://llvm.org/bugs/' ac_unique_file="lib/VMCore/Module.cpp" @@ -1318,7 +1318,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures LLVM 3.1svn to adapt to many kinds of systems. +\`configure' configures LLVM 3.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1384,7 +1384,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of LLVM 3.1svn:";; + short | recursive ) echo "Configuration of LLVM 3.1:";; esac cat <<\_ACEOF @@ -1532,7 +1532,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -LLVM configure 3.1svn +LLVM configure 3.1 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1548,7 +1548,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by LLVM $as_me 3.1svn, which was +It was created by LLVM $as_me 3.1, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -21785,7 +21785,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by LLVM $as_me 3.1svn, which was +This file was extended by LLVM $as_me 3.1, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21838,7 +21838,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -LLVM config.status 3.1svn +LLVM config.status 3.1 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: vendor/llvm/dist/docs/ReleaseNotes.html ============================================================================== --- vendor/llvm/dist/docs/ReleaseNotes.html Tue May 22 20:26:14 2012 (r235806) +++ vendor/llvm/dist/docs/ReleaseNotes.html Tue May 22 21:30:23 2012 (r235807) @@ -3,7 +3,7 @@ - + LLVM 3.1 Release Notes @@ -96,6 +96,7 @@ Release Notes.

In the LLVM 3.1 time-frame, the Clang team has made many improvements:

    +
  • C++11 support is greatly expanded including lambdas, initializer lists, constexpr, user-defined literals, and atomics.
  • ...
@@ -119,17 +120,30 @@ Release Notes.

DragonEgg is a gcc plugin that replaces GCC's - optimizers and code generators with LLVM's. It works with gcc-4.5 or gcc-4.6, - targets the x86-32 and x86-64 processor families, and has been successfully - used on the Darwin, FreeBSD, KFreeBSD, Linux and OpenBSD platforms. It fully - supports Ada, C, C++ and Fortran. It has partial support for Go, Java, Obj-C - and Obj-C++.

+ optimizers and code generators with LLVM's. It works with gcc-4.5 and gcc-4.6 + (and partially with gcc-4.7), can target the x86-32/x86-64 and ARM processor + families, and has been successfully used on the Darwin, FreeBSD, KFreeBSD, + Linux and OpenBSD platforms. It fully supports Ada, C, C++ and Fortran. It + has partial support for Go, Java, Obj-C and Obj-C++.

The 3.1 release has the following notable changes:

    -
  • ...
  • +
  • Partial support for gcc-4.7. Ada support is poor, but other languages work + fairly well.
  • + +
  • Support for ARM processors. Some essential gcc headers that are needed to + build DragonEgg for ARM are not installed by gcc. To work around this, + copy the missing headers from the gcc source tree.
  • + +
  • Better optimization for Fortran by exploiting the fact that Fortran scalar + arguments have 'restrict' semantics.
  • + +
  • Better optimization for all languages by passing information about type + aliasing and type ranges to the LLVM optimizers.
  • + +
  • A regression test-suite was added.
@@ -250,7 +264,21 @@ Release Notes. a lot of other language and tools projects. This section lists some of the projects that have already been updated to work with LLVM 3.1.

- ... to be filled in right before the release ... +

Pure

+ +

Pure (http://pure-lang.googlecode.com/) is an algebraic/functional +programming language based on term rewriting. Programs are collections of +equations which are used to evaluate expressions in a symbolic fashion. The +interpreter uses LLVM as a backend to JIT-compile Pure programs to fast native +code. Pure offers dynamic typing, eager and lazy evaluation, lexical closures, a +hygienic macro system (also based on term rewriting), built-in list and matrix +support (including list and matrix comprehensions) and an easy-to-use interface +to C and other programming languages (including the ability to load LLVM bitcode +modules, and inline C, C++, Fortran and Faust code in Pure programs if the +corresponding LLVM-enabled compilers are installed).

+ +

Pure version 0.54 has been tested and is known to work with LLVM 3.1 (and +continues to work with older LLVM releases >= 2.5).

@@ -536,6 +564,9 @@ syntax, there are still significant gaps
  • The unwind instruction is now gone. With the introduction of the new exception handling system in LLVM 3.0, the unwind instruction became obsolete.
  • +
  • LLVM 3.0 and earlier automatically added the returns_twice fo functions + like setjmp based on the name. This functionality was removed in 3.1. + This affects Clang users, if -ffreestanding is used.
  • ....
  • @@ -604,6 +635,7 @@ syntax, there are still significant gaps
    • llvm-stress is a command line tool for generating random .ll files to fuzz different LLVM components.
    • +
    • llvm-ld has been removed. Use llvm-link or Clang instead.
    • ....
    @@ -682,7 +714,7 @@ syntax, there are still significant gaps src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2012-04-17 03:13:53 +0200 (Tue, 17 Apr 2012) $ + Last modified: $Date: 2012-05-13 12:04:01 +0200 (Sun, 13 May 2012) $ Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Tue May 22 20:26:14 2012 (r235806) +++ vendor/llvm/dist/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Tue May 22 21:30:23 2012 (r235807) @@ -131,30 +131,16 @@ static void CheckForPhysRegDependency(SD } } -static void AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG) { - SmallVector VTs; - SDNode *GlueDestNode = Glue.getNode(); - - // Don't add glue from a node to itself. - if (GlueDestNode == N) return; - - // Don't add glue to something that already has it, either as a use or value. - if (N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Glue || - N->getValueType(N->getNumValues() - 1) == MVT::Glue) { - return; - } - for (unsigned I = 0, E = N->getNumValues(); I != E; ++I) - VTs.push_back(N->getValueType(I)); - - if (AddGlue) - VTs.push_back(MVT::Glue); - +// Helper for AddGlue to clone node operands. +static void CloneNodeWithValues(SDNode *N, SelectionDAG *DAG, + SmallVectorImpl &VTs, + SDValue ExtraOper = SDValue()) { SmallVector Ops; for (unsigned I = 0, E = N->getNumOperands(); I != E; ++I) Ops.push_back(N->getOperand(I)); - if (GlueDestNode) - Ops.push_back(Glue); + if (ExtraOper.getNode()) + Ops.push_back(ExtraOper); SDVTList VTList = DAG->getVTList(&VTs[0], VTs.size()); MachineSDNode::mmo_iterator Begin = 0, End = 0; @@ -173,6 +159,46 @@ static void AddGlue(SDNode *N, SDValue G MN->setMemRefs(Begin, End); } +static bool AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG) { + SmallVector VTs; + SDNode *GlueDestNode = Glue.getNode(); + + // Don't add glue from a node to itself. + if (GlueDestNode == N) return false; + + // Don't add a glue operand to something that already uses glue. + if (GlueDestNode && + N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Glue) { + return false; + } + // Don't add glue to something that already has a glue value. + if (N->getValueType(N->getNumValues() - 1) == MVT::Glue) return false; + + for (unsigned I = 0, E = N->getNumValues(); I != E; ++I) + VTs.push_back(N->getValueType(I)); + + if (AddGlue) + VTs.push_back(MVT::Glue); + + CloneNodeWithValues(N, DAG, VTs, Glue); + + return true; +} + +// Cleanup after unsuccessful AddGlue. Use the standard method of morphing the +// node even though simply shrinking the value list is sufficient. +static void RemoveUnusedGlue(SDNode *N, SelectionDAG *DAG) { + assert((N->getValueType(N->getNumValues() - 1) == MVT::Glue && + !N->hasAnyUseOfValue(N->getNumValues() - 1)) && + "expected an unused glue value"); + + SmallVector VTs; + for (unsigned I = 0, E = N->getNumValues()-1; I != E; ++I) + VTs.push_back(N->getValueType(I)); + + CloneNodeWithValues(N, DAG, VTs); +} + /// ClusterNeighboringLoads - Force nearby loads together by "gluing" them. /// This function finds loads of the same base and different offsets. If the /// offsets are not far apart (target specific), it add MVT::Glue inputs and @@ -240,19 +266,23 @@ void ScheduleDAGSDNodes::ClusterNeighbor // Cluster loads by adding MVT::Glue outputs and inputs. This also // ensure they are scheduled in order of increasing addresses. SDNode *Lead = Loads[0]; - AddGlue(Lead, SDValue(0, 0), true, DAG); - - SDValue InGlue = SDValue(Lead, Lead->getNumValues() - 1); + SDValue InGlue = SDValue(0, 0); + if (AddGlue(Lead, InGlue, true, DAG)) + InGlue = SDValue(Lead, Lead->getNumValues() - 1); for (unsigned I = 1, E = Loads.size(); I != E; ++I) { bool OutGlue = I < E - 1; SDNode *Load = Loads[I]; - AddGlue(Load, InGlue, OutGlue, DAG); + // If AddGlue fails, we could leave an unsused glue value. This should not + // cause any + if (AddGlue(Load, InGlue, OutGlue, DAG)) { + if (OutGlue) + InGlue = SDValue(Load, Load->getNumValues() - 1); - if (OutGlue) - InGlue = SDValue(Load, Load->getNumValues() - 1); - - ++LoadsClustered; + ++LoadsClustered; + } + else if (!OutGlue && InGlue.getNode()) + RemoveUnusedGlue(InGlue.getNode(), DAG); } } From owner-svn-src-all@FreeBSD.ORG Tue May 22 21:32:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 960951065793; Tue, 22 May 2012 21:32:06 +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 66E4B8FC15; Tue, 22 May 2012 21:32: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 q4MLW6Xs028668; Tue, 22 May 2012 21:32:06 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MLW6Cb028667; Tue, 22 May 2012 21:32:06 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205222132.q4MLW6Cb028667@svn.freebsd.org> From: Dimitry Andric Date: Tue, 22 May 2012 21:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235808 - vendor/llvm/llvm-release_31-r156748 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 21:32:06 -0000 Author: dim Date: Tue May 22 21:32:05 2012 New Revision: 235808 URL: http://svn.freebsd.org/changeset/base/235808 Log: Tag llvm release_31 final r156748. Added: vendor/llvm/llvm-release_31-r156748/ - copied from r235807, vendor/llvm/dist/ From owner-svn-src-all@FreeBSD.ORG Tue May 22 21:36:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C1321065670; Tue, 22 May 2012 21:36:40 +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 227298FC1C; Tue, 22 May 2012 21:36:39 +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 q4MLadpK028931; Tue, 22 May 2012 21:36:39 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MLadBh028909; Tue, 22 May 2012 21:36:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205222136.q4MLadBh028909@svn.freebsd.org> From: Dimitry Andric Date: Tue, 22 May 2012 21:36:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235809 - in vendor/clang/dist: docs include/clang/AST include/clang/Basic include/clang/Parse include/clang/Sema lib/Analysis lib/Basic lib/Driver lib/Parse lib/Sema lib/Serialization ... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 21:36:40 -0000 Author: dim Date: Tue May 22 21:36:38 2012 New Revision: 235809 URL: http://svn.freebsd.org/changeset/base/235809 Log: Vendor import of clang release_31 final r156748: http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_31/final@156748 Added: vendor/clang/dist/test/CXX/special/class.copy/p8-cxx11.cpp vendor/clang/dist/test/PCH/cxx11-exception-spec.cpp vendor/clang/dist/test/Parser/recursion-limits.cpp Deleted: vendor/clang/dist/test/CodeGenCXX/x86-64-abi-sret-vs-2word-struct-param.cpp Modified: vendor/clang/dist/docs/ReleaseNotes.html vendor/clang/dist/include/clang/AST/Decl.h vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td vendor/clang/dist/include/clang/Basic/TokenKinds.def vendor/clang/dist/include/clang/Parse/Parser.h vendor/clang/dist/include/clang/Sema/DeclSpec.h vendor/clang/dist/include/clang/Sema/Initialization.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/lib/Analysis/UninitializedValues.cpp vendor/clang/dist/lib/Basic/Version.cpp vendor/clang/dist/lib/Driver/ToolChains.cpp vendor/clang/dist/lib/Parse/ParseCXXInlineMethods.cpp vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp vendor/clang/dist/lib/Parse/ParseExpr.cpp vendor/clang/dist/lib/Parse/ParseExprCXX.cpp vendor/clang/dist/lib/Sema/DeclSpec.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaLookup.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/test/CXX/class/class.mem/p2.cpp vendor/clang/dist/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp vendor/clang/dist/test/CXX/special/class.copy/implicit-move.cpp vendor/clang/dist/test/CodeGenCXX/x86_64-arguments.cpp vendor/clang/dist/test/Rewriter/rewrite-modern-extern-c-func-decl.mm vendor/clang/dist/test/SemaCXX/cxx0x-initializer-references.cpp vendor/clang/dist/test/SemaCXX/dependent-noexcept-unevaluated.cpp vendor/clang/dist/test/SemaCXX/implicit-exception-spec.cpp vendor/clang/dist/test/SemaObjCXX/ivar-construct.mm Modified: vendor/clang/dist/docs/ReleaseNotes.html ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.html Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/docs/ReleaseNotes.html Tue May 22 21:36:38 2012 (r235809) @@ -118,8 +118,8 @@ modes.

    C++11 Feature Support

    -

    Clang 3.1 adds support for -more of the language +

    Clang 3.1 supports +most of the language features added in the latest ISO C++ standard, C++ 2011. Use -std=c++11 or -std=gnu++11 to enable support for Modified: vendor/clang/dist/include/clang/AST/Decl.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Decl.h Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/include/clang/AST/Decl.h Tue May 22 21:36:38 2012 (r235809) @@ -64,9 +64,6 @@ public: /// \brief Return the TypeLoc wrapper for the type source info. TypeLoc getTypeLoc() const; // implemented in TypeLoc.h - - /// \brief Override the type stored in this TypeSourceInfo. Use with caution! - void overrideType(QualType T) { Ty = T; } }; /// TranslationUnitDecl - The top declaration context. Modified: vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td Tue May 22 21:36:38 2012 (r235809) @@ -410,8 +410,6 @@ def ext_ellipsis_exception_spec : Extens "exception specification of '...' is a Microsoft extension">; def err_dynamic_and_noexcept_specification : Error< "cannot have both throw() and noexcept() clause on the same function">; -def err_except_spec_unparsed : Error< - "unexpected end of exception specification">; def warn_cxx98_compat_noexcept_decl : Warning< "noexcept specifications are incompatible with C++98">, InGroup, DefaultIgnore; Modified: vendor/clang/dist/include/clang/Basic/TokenKinds.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/TokenKinds.def Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/include/clang/Basic/TokenKinds.def Tue May 22 21:36:38 2012 (r235809) @@ -105,7 +105,6 @@ TOK(eod) // End of prepr // directive). TOK(code_completion) // Code completion marker TOK(cxx_defaultarg_end) // C++ default argument end marker -TOK(cxx_exceptspec_end) // C++ exception-specification end marker // C99 6.4.9: Comments. TOK(comment) // Comment (only in -E -C[C] mode) Modified: vendor/clang/dist/include/clang/Parse/Parser.h ============================================================================== --- vendor/clang/dist/include/clang/Parse/Parser.h Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/include/clang/Parse/Parser.h Tue May 22 21:36:38 2012 (r235809) @@ -584,11 +584,15 @@ private: class TentativeParsingAction { Parser &P; Token PrevTok; + unsigned short PrevParenCount, PrevBracketCount, PrevBraceCount; bool isActive; public: explicit TentativeParsingAction(Parser& p) : P(p) { PrevTok = P.Tok; + PrevParenCount = P.ParenCount; + PrevBracketCount = P.BracketCount; + PrevBraceCount = P.BraceCount; P.PP.EnableBacktrackAtThisPos(); isActive = true; } @@ -601,6 +605,9 @@ private: assert(isActive && "Parsing action was finished!"); P.PP.Backtrack(); P.Tok = PrevTok; + P.ParenCount = PrevParenCount; + P.BracketCount = PrevBracketCount; + P.BraceCount = PrevBraceCount; isActive = false; } ~TentativeParsingAction() { @@ -1422,12 +1429,10 @@ private: ExprResult ParseThrowExpression(); ExceptionSpecificationType tryParseExceptionSpecification( - bool Delayed, SourceRange &SpecificationRange, SmallVectorImpl &DynamicExceptions, SmallVectorImpl &DynamicExceptionRanges, - ExprResult &NoexceptExpr, - CachedTokens *&ExceptionSpecTokens); + ExprResult &NoexceptExpr); // EndLoc is filled with the location of the last token of the specification. ExceptionSpecificationType ParseDynamicExceptionSpecification( Modified: vendor/clang/dist/include/clang/Sema/DeclSpec.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/DeclSpec.h Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/include/clang/Sema/DeclSpec.h Tue May 22 21:36:38 2012 (r235809) @@ -1150,10 +1150,6 @@ struct DeclaratorChunk { /// \brief Pointer to the expression in the noexcept-specifier of this /// function, if it has one. Expr *NoexceptExpr; - - /// \brief Pointer to the cached tokens for an exception-specification - /// that has not yet been parsed. - CachedTokens *ExceptionSpecTokens; }; /// TrailingReturnType - If this isn't null, it's the trailing return type @@ -1176,8 +1172,6 @@ struct DeclaratorChunk { delete[] ArgInfo; if (getExceptionSpecType() == EST_Dynamic) delete[] Exceptions; - else if (getExceptionSpecType() == EST_Delayed) - delete ExceptionSpecTokens; } /// isKNRPrototype - Return true if this is a K&R style identifier list, @@ -1353,7 +1347,6 @@ struct DeclaratorChunk { SourceRange *ExceptionRanges, unsigned NumExceptions, Expr *NoexceptExpr, - CachedTokens *ExceptionSpecTokens, SourceLocation LocalRangeBegin, SourceLocation LocalRangeEnd, Declarator &TheDeclarator, Modified: vendor/clang/dist/include/clang/Sema/Initialization.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/Initialization.h Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/include/clang/Sema/Initialization.h Tue May 22 21:36:38 2012 (r235809) @@ -225,7 +225,9 @@ public: /// \brief Create the initialization entity for a temporary. static InitializedEntity InitializeTemporary(QualType Type) { - return InitializedEntity(EK_Temporary, SourceLocation(), Type); + InitializedEntity Result(EK_Temporary, SourceLocation(), Type); + Result.TypeInfo = 0; + return Result; } /// \brief Create the initialization entity for a temporary. Modified: vendor/clang/dist/include/clang/Sema/Sema.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/Sema.h Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/include/clang/Sema/Sema.h Tue May 22 21:36:38 2012 (r235809) @@ -331,6 +331,11 @@ public: /// cycle detection at the end of the TU. DelegatingCtorDeclsType DelegatingCtorDecls; + /// \brief All the destructors seen during a class definition that had their + /// exception spec computation delayed because it depended on an unparsed + /// exception spec. + SmallVector DelayedDestructorExceptionSpecs; + /// \brief All the overriding destructors seen during a class definition /// (there could be multiple due to nested classes) that had their exception /// spec checks delayed, plus the overridden destructor. @@ -653,23 +658,19 @@ public: /// SpecialMemberOverloadResult - The overloading result for a special member /// function. /// - /// This is basically a wrapper around PointerIntPair. The lowest bit of the - /// integer is used to determine whether we have a parameter qualification - /// match, the second-lowest is whether we had success in resolving the - /// overload to a unique non-deleted function. - /// - /// The ConstParamMatch bit represents whether, when looking up a copy - /// constructor or assignment operator, we found a potential copy - /// constructor/assignment operator whose first parameter is const-qualified. - /// This is used for determining parameter types of other objects and is - /// utterly meaningless on other types of special members. + /// This is basically a wrapper around PointerIntPair. The lowest bits of the + /// integer are used to determine whether overload resolution succeeded, and + /// whether, when looking up a copy constructor or assignment operator, we + /// found a potential copy constructor/assignment operator whose first + /// parameter is const-qualified. This is used for determining parameter types + /// of other objects and is utterly meaningless on other types of special + /// members. class SpecialMemberOverloadResult : public llvm::FastFoldingSetNode { public: enum Kind { NoMemberOrDeleted, Ambiguous, - SuccessNonConst, - SuccessConst + Success }; private: @@ -685,9 +686,6 @@ public: Kind getKind() const { return static_cast(Pair.getInt()); } void setKind(Kind K) { Pair.setInt(K); } - - bool hasSuccess() const { return getKind() >= SuccessNonConst; } - bool hasConstParamMatch() const { return getKind() == SuccessConst; } }; /// \brief A cache of special member function overload resolution results @@ -1909,11 +1907,9 @@ public: DeclContextLookupResult LookupConstructors(CXXRecordDecl *Class); CXXConstructorDecl *LookupDefaultConstructor(CXXRecordDecl *Class); CXXConstructorDecl *LookupCopyingConstructor(CXXRecordDecl *Class, - unsigned Quals, - bool *ConstParam = 0); + unsigned Quals); CXXMethodDecl *LookupCopyingAssignment(CXXRecordDecl *Class, unsigned Quals, - bool RValueThis, unsigned ThisQuals, - bool *ConstParam = 0); + bool RValueThis, unsigned ThisQuals); CXXConstructorDecl *LookupMovingConstructor(CXXRecordDecl *Class); CXXMethodDecl *LookupMovingAssignment(CXXRecordDecl *Class, bool RValueThis, unsigned ThisQuals); @@ -3158,16 +3154,6 @@ public: llvm::SmallVectorImpl &Exceptions, FunctionProtoType::ExtProtoInfo &EPI); - /// \brief Add an exception-specification to the given member function - /// (or member function template). The exception-specification was parsed - /// after the method itself was declared. - void actOnDelayedExceptionSpecification(Decl *Method, - ExceptionSpecificationType EST, - SourceRange SpecificationRange, - ArrayRef DynamicExceptions, - ArrayRef DynamicExceptionRanges, - Expr *NoexceptExpr); - /// \brief Determine if a special member function should have a deleted /// definition when it is defaulted. bool ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM, @@ -3205,7 +3191,8 @@ public: /// C++11 says that user-defined destructors with no exception spec get one /// that looks as if the destructor was implicitly declared. void AdjustDestructorExceptionSpec(CXXRecordDecl *ClassDecl, - CXXDestructorDecl *Destructor); + CXXDestructorDecl *Destructor, + bool WasDelayed = false); /// \brief Declare all inherited constructors for the given class. /// @@ -4043,6 +4030,7 @@ public: SourceLocation LBrac, SourceLocation RBrac, AttributeList *AttrList); + void ActOnFinishCXXMemberDecls(); void ActOnReenterTemplateScope(Scope *S, Decl *Template); void ActOnReenterDeclaratorTemplateScope(Scope *S, DeclaratorDecl *D); Modified: vendor/clang/dist/lib/Analysis/UninitializedValues.cpp ============================================================================== --- vendor/clang/dist/lib/Analysis/UninitializedValues.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Analysis/UninitializedValues.cpp Tue May 22 21:36:38 2012 (r235809) @@ -168,7 +168,8 @@ static const BinaryOperator *getLogicalO if (block->empty()) return 0; - const CFGStmt *cstmt = block->front().getAs(); + CFGElement front = block->front(); + const CFGStmt *cstmt = front.getAs(); if (!cstmt) return 0; Modified: vendor/clang/dist/lib/Basic/Version.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Version.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Basic/Version.cpp Tue May 22 21:36:38 2012 (r235809) @@ -32,7 +32,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - static StringRef SVNRepository("$URL: http://llvm.org/svn/llvm-project/cfe/branches/release_31/lib/Basic/Version.cpp $"); + static StringRef SVNRepository("$URL: http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_31/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); Modified: vendor/clang/dist/lib/Driver/ToolChains.cpp ============================================================================== --- vendor/clang/dist/lib/Driver/ToolChains.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Driver/ToolChains.cpp Tue May 22 21:36:38 2012 (r235809) @@ -1830,6 +1830,7 @@ enum LinuxDistro { OpenSuse11_3, OpenSuse11_4, OpenSuse12_1, + OpenSuse12_2, UbuntuHardy, UbuntuIntrepid, UbuntuJaunty, @@ -1848,7 +1849,7 @@ static bool IsRedhat(enum LinuxDistro Di } static bool IsOpenSuse(enum LinuxDistro Distro) { - return Distro >= OpenSuse11_3 && Distro <= OpenSuse12_1; + return Distro >= OpenSuse11_3 && Distro <= OpenSuse12_2; } static bool IsDebian(enum LinuxDistro Distro) { @@ -1925,6 +1926,7 @@ static LinuxDistro DetectLinuxDistro(llv .StartsWith("openSUSE 11.3", OpenSuse11_3) .StartsWith("openSUSE 11.4", OpenSuse11_4) .StartsWith("openSUSE 12.1", OpenSuse12_1) + .StartsWith("openSUSE 12.2", OpenSuse12_2) .Default(UnknownDistro); bool Exists; Modified: vendor/clang/dist/lib/Parse/ParseCXXInlineMethods.cpp ============================================================================== --- vendor/clang/dist/lib/Parse/ParseCXXInlineMethods.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Parse/ParseCXXInlineMethods.cpp Tue May 22 21:36:38 2012 (r235809) @@ -348,77 +348,7 @@ void Parser::ParseLexedMethodDeclaration LM.DefaultArgs[I].Toks = 0; } } - - // Parse a delayed exception-specification, if there is one. - if (CachedTokens *Toks = LM.ExceptionSpecTokens) { - // Save the current token position. - SourceLocation origLoc = Tok.getLocation(); - - // Parse the default argument from its saved token stream. - Toks->push_back(Tok); // So that the current token doesn't get lost - PP.EnterTokenStream(&Toks->front(), Toks->size(), true, false); - - // Consume the previously-pushed token. - ConsumeAnyToken(); - - // C++11 [expr.prim.general]p3: - // If a declaration declares a member function or member function - // template of a class X, the expression this is a prvalue of type - // "pointer to cv-qualifier-seq X" between the optional cv-qualifer-seq - // and the end of the function-definition, member-declarator, or - // declarator. - CXXMethodDecl *Method; - if (FunctionTemplateDecl *FunTmpl - = dyn_cast(LM.Method)) - Method = cast(FunTmpl->getTemplatedDecl()); - else - Method = cast(LM.Method); - - Sema::CXXThisScopeRAII ThisScope(Actions, Method->getParent(), - Method->getTypeQualifiers(), - getLangOpts().CPlusPlus0x); - - // Parse the exception-specification. - SourceRange SpecificationRange; - SmallVector DynamicExceptions; - SmallVector DynamicExceptionRanges; - ExprResult NoexceptExpr; - CachedTokens *ExceptionSpecTokens; - - ExceptionSpecificationType EST - = tryParseExceptionSpecification(/*Delayed=*/false, SpecificationRange, - DynamicExceptions, - DynamicExceptionRanges, NoexceptExpr, - ExceptionSpecTokens); - - // Clean up the remaining tokens. - if (Tok.is(tok::cxx_exceptspec_end)) - ConsumeToken(); - else if (EST != EST_None) - Diag(Tok.getLocation(), diag::err_except_spec_unparsed); - // Attach the exception-specification to the method. - if (EST != EST_None) - Actions.actOnDelayedExceptionSpecification(LM.Method, EST, - SpecificationRange, - DynamicExceptions, - DynamicExceptionRanges, - NoexceptExpr.isUsable()? - NoexceptExpr.get() : 0); - - assert(!PP.getSourceManager().isBeforeInTranslationUnit(origLoc, - Tok.getLocation()) && - "tryParseExceptionSpecification went over the exception tokens!"); - - // There could be leftover tokens (e.g. because of an error). - // Skip through until we reach the original token position. - while (Tok.getLocation() != origLoc && Tok.isNot(tok::eof)) - ConsumeAnyToken(); - - delete LM.ExceptionSpecTokens; - LM.ExceptionSpecTokens = 0; - } - PrototypeScope.Exit(); // Finish the delayed C++ method declaration. Modified: vendor/clang/dist/lib/Parse/ParseDecl.cpp ============================================================================== --- vendor/clang/dist/lib/Parse/ParseDecl.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Parse/ParseDecl.cpp Tue May 22 21:36:38 2012 (r235809) @@ -4197,7 +4197,6 @@ void Parser::ParseFunctionDeclarator(Dec SmallVector DynamicExceptions; SmallVector DynamicExceptionRanges; ExprResult NoexceptExpr; - CachedTokens *ExceptionSpecTokens = 0; ParsedAttributes FnAttrs(AttrFactory); ParsedType TrailingReturnType; @@ -4264,18 +4263,12 @@ void Parser::ParseFunctionDeclarator(Dec dyn_cast(Actions.CurContext), DS.getTypeQualifiers(), IsCXX11MemberFunction); - + // Parse exception-specification[opt]. - bool Delayed = (D.getContext() == Declarator::MemberContext && - D.getDeclSpec().getStorageClassSpec() - != DeclSpec::SCS_typedef && - !D.getDeclSpec().isFriendSpecified()); - ESpecType = tryParseExceptionSpecification(Delayed, - ESpecRange, + ESpecType = tryParseExceptionSpecification(ESpecRange, DynamicExceptions, DynamicExceptionRanges, - NoexceptExpr, - ExceptionSpecTokens); + NoexceptExpr); if (ESpecType != EST_None) EndLoc = ESpecRange.getEnd(); @@ -4310,7 +4303,6 @@ void Parser::ParseFunctionDeclarator(Dec DynamicExceptions.size(), NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, - ExceptionSpecTokens, Tracker.getOpenLocation(), EndLoc, D, TrailingReturnType), Modified: vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp ============================================================================== --- vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp Tue May 22 21:36:38 2012 (r235809) @@ -1535,34 +1535,16 @@ AccessSpecifier Parser::getAccessSpecifi } /// \brief If the given declarator has any parts for which parsing has to be -/// delayed, e.g., default arguments or an exception-specification, create a -/// late-parsed method declaration record to handle the parsing at the end of -/// the class definition. +/// delayed, e.g., default arguments, create a late-parsed method declaration +/// record to handle the parsing at the end of the class definition. void Parser::HandleMemberFunctionDeclDelays(Declarator& DeclaratorInfo, Decl *ThisDecl) { // We just declared a member function. If this member function - // has any default arguments or an exception-specification, we'll need to - // parse them later. + // has any default arguments, we'll need to parse them later. LateParsedMethodDeclaration *LateMethod = 0; DeclaratorChunk::FunctionTypeInfo &FTI = DeclaratorInfo.getFunctionTypeInfo(); - - // If there was a delayed exception-specification, hold onto its tokens. - if (FTI.getExceptionSpecType() == EST_Delayed) { - // Push this method onto the stack of late-parsed method - // declarations. - LateMethod = new LateParsedMethodDeclaration(this, ThisDecl); - getCurrentClass().LateParsedDeclarations.push_back(LateMethod); - LateMethod->TemplateScope = getCurScope()->isTemplateParamScope(); - - // Stash the exception-specification tokens in the late-pased mthod. - LateMethod->ExceptionSpecTokens = FTI.ExceptionSpecTokens; - FTI.ExceptionSpecTokens = 0; - // Reserve space for the parameters. - LateMethod->DefaultArgs.reserve(FTI.NumArgs); - } - for (unsigned ParamIdx = 0; ParamIdx < FTI.NumArgs; ++ParamIdx) { if (LateMethod || FTI.ArgInfo[ParamIdx].DefaultArgTokens) { if (!LateMethod) { @@ -1846,7 +1828,7 @@ void Parser::ParseCXXClassMemberDeclarat // Parse the first declarator. ParseDeclarator(DeclaratorInfo); - // Error parsin g the declarator? + // Error parsing the declarator? if (!DeclaratorInfo.hasName()) { // If so, skip until the semi-colon or a }. SkipUntil(tok::r_brace, true, true); @@ -2065,7 +2047,7 @@ void Parser::ParseCXXClassMemberDeclarat DeclsInGroup.push_back(ThisDecl); } - if (DeclaratorInfo.isFunctionDeclarator() && + if (ThisDecl && DeclaratorInfo.isFunctionDeclarator() && DeclaratorInfo.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_typedef) { HandleMemberFunctionDeclDelays(DeclaratorInfo, ThisDecl); @@ -2358,7 +2340,7 @@ void Parser::ParseCXXMemberSpecification // C++11 [class.mem]p2: // Within the class member-specification, the class is regarded as complete - // within function bodies, default arguments, exception-specifications, and + // within function bodies, default arguments, and // brace-or-equal-initializers for non-static data members (including such // things in nested classes). if (TagDecl && NonNestedClass) { @@ -2369,6 +2351,10 @@ void Parser::ParseCXXMemberSpecification SourceLocation SavedPrevTokLocation = PrevTokLocation; ParseLexedAttributes(getCurrentClass()); ParseLexedMethodDeclarations(getCurrentClass()); + + // We've finished with all pending member declarations. + Actions.ActOnFinishCXXMemberDecls(); + ParseLexedMemberInitializers(getCurrentClass()); ParseLexedMethodDefs(getCurrentClass()); PrevTokLocation = SavedPrevTokLocation; @@ -2555,63 +2541,13 @@ Parser::MemInitResult Parser::ParseMemIn /// 'noexcept' /// 'noexcept' '(' constant-expression ')' ExceptionSpecificationType -Parser::tryParseExceptionSpecification(bool Delayed, +Parser::tryParseExceptionSpecification( SourceRange &SpecificationRange, SmallVectorImpl &DynamicExceptions, SmallVectorImpl &DynamicExceptionRanges, - ExprResult &NoexceptExpr, - CachedTokens *&ExceptionSpecTokens) { + ExprResult &NoexceptExpr) { ExceptionSpecificationType Result = EST_None; - ExceptionSpecTokens = 0; - - // Handle delayed parsing of exception-specifications. - if (Delayed) { - if (Tok.isNot(tok::kw_throw) && Tok.isNot(tok::kw_noexcept)) - return EST_None; - - // Consume and cache the starting token. - bool IsNoexcept = Tok.is(tok::kw_noexcept); - Token StartTok = Tok; - SpecificationRange = SourceRange(ConsumeToken()); - - // Check for a '('. - if (!Tok.is(tok::l_paren)) { - // If this is a bare 'noexcept', we're done. - if (IsNoexcept) { - Diag(Tok, diag::warn_cxx98_compat_noexcept_decl); - NoexceptExpr = 0; - return EST_BasicNoexcept; - } - - Diag(Tok, diag::err_expected_lparen_after) << "throw"; - return EST_DynamicNone; - } - - // Cache the tokens for the exception-specification. - ExceptionSpecTokens = new CachedTokens; - ExceptionSpecTokens->push_back(StartTok); // 'throw' or 'noexcept' - ExceptionSpecTokens->push_back(Tok); // '(' - SpecificationRange.setEnd(ConsumeParen()); // '(' - - if (!ConsumeAndStoreUntil(tok::r_paren, *ExceptionSpecTokens, - /*StopAtSemi=*/true, - /*ConsumeFinalToken=*/true)) { - NoexceptExpr = 0; - delete ExceptionSpecTokens; - ExceptionSpecTokens = 0; - return IsNoexcept? EST_BasicNoexcept : EST_DynamicNone; - } - SpecificationRange.setEnd(Tok.getLocation()); - - // Add the 'stop' token. - Token End; - End.startToken(); - End.setKind(tok::cxx_exceptspec_end); - End.setLocation(Tok.getLocation()); - ExceptionSpecTokens->push_back(End); - return EST_Delayed; - } - + // See if there's a dynamic specification. if (Tok.is(tok::kw_throw)) { Result = ParseDynamicExceptionSpecification(SpecificationRange, Modified: vendor/clang/dist/lib/Parse/ParseExpr.cpp ============================================================================== --- vendor/clang/dist/lib/Parse/ParseExpr.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Parse/ParseExpr.cpp Tue May 22 21:36:38 2012 (r235809) @@ -2392,7 +2392,7 @@ ExprResult Parser::ParseBlockLiteralExpr SourceLocation(), EST_None, SourceLocation(), - 0, 0, 0, 0, 0, + 0, 0, 0, 0, CaretLoc, CaretLoc, ParamInfo), attrs, CaretLoc); Modified: vendor/clang/dist/lib/Parse/ParseExprCXX.cpp ============================================================================== --- vendor/clang/dist/lib/Parse/ParseExprCXX.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Parse/ParseExprCXX.cpp Tue May 22 21:36:38 2012 (r235809) @@ -780,13 +780,10 @@ ExprResult Parser::ParseLambdaExpression llvm::SmallVector DynamicExceptions; llvm::SmallVector DynamicExceptionRanges; ExprResult NoexceptExpr; - CachedTokens *ExceptionSpecTokens; - ESpecType = tryParseExceptionSpecification(/*Delayed=*/false, - ESpecRange, + ESpecType = tryParseExceptionSpecification(ESpecRange, DynamicExceptions, DynamicExceptionRanges, - NoexceptExpr, - ExceptionSpecTokens); + NoexceptExpr); if (ESpecType != EST_None) DeclEndLoc = ESpecRange.getEnd(); @@ -821,7 +818,6 @@ ExprResult Parser::ParseLambdaExpression DynamicExceptions.size(), NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, - 0, DeclLoc, DeclEndLoc, D, TrailingReturnType), Attr, DeclEndLoc); @@ -867,7 +863,6 @@ ExprResult Parser::ParseLambdaExpression /*ExceptionRanges=*/0, /*NumExceptions=*/0, /*NoexceptExpr=*/0, - /*ExceptionSpecTokens=*/0, DeclLoc, DeclEndLoc, D, TrailingReturnType), Attr, DeclEndLoc); Modified: vendor/clang/dist/lib/Sema/DeclSpec.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/DeclSpec.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Sema/DeclSpec.cpp Tue May 22 21:36:38 2012 (r235809) @@ -162,7 +162,6 @@ DeclaratorChunk DeclaratorChunk::getFunc SourceRange *ExceptionRanges, unsigned NumExceptions, Expr *NoexceptExpr, - CachedTokens *ExceptionSpecTokens, SourceLocation LocalRangeBegin, SourceLocation LocalRangeEnd, Declarator &TheDeclarator, @@ -227,10 +226,6 @@ DeclaratorChunk DeclaratorChunk::getFunc case EST_ComputedNoexcept: I.Fun.NoexceptExpr = NoexceptExpr; break; - - case EST_Delayed: - I.Fun.ExceptionSpecTokens = ExceptionSpecTokens; - break; } return I; } Modified: vendor/clang/dist/lib/Sema/SemaDecl.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaDecl.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Sema/SemaDecl.cpp Tue May 22 21:36:38 2012 (r235809) @@ -7635,7 +7635,7 @@ NamedDecl *Sema::ImplicitlyDefineFunctio SourceLocation(), SourceLocation(), SourceLocation(), EST_None, SourceLocation(), - 0, 0, 0, 0, 0, Loc, Loc, D), + 0, 0, 0, 0, Loc, Loc, D), DS.getAttributes(), SourceLocation()); D.SetIdentifier(&II, Loc); @@ -9784,21 +9784,6 @@ void Sema::ActOnFields(Scope* S, if (!Completed) Record->completeDefinition(); - // Now that the record is complete, do any delayed exception spec checks - // we were missing. - while (!DelayedDestructorExceptionSpecChecks.empty()) { - const CXXDestructorDecl *Dtor = - DelayedDestructorExceptionSpecChecks.back().first; - if (Dtor->getParent() != Record) - break; - - assert(!Dtor->getParent()->isDependentType() && - "Should not ever add destructors of templates into the list."); - CheckOverridingFunctionExceptionSpec(Dtor, - DelayedDestructorExceptionSpecChecks.back().second); - DelayedDestructorExceptionSpecChecks.pop_back(); - } - } else { ObjCIvarDecl **ClsFields = reinterpret_cast(RecFields.data()); Modified: vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp Tue May 22 21:36:38 2012 (r235809) @@ -7319,15 +7319,42 @@ void Sema::DefineImplicitDestructor(Sour } } +/// \brief Perform any semantic analysis which needs to be delayed until all +/// pending class member declarations have been parsed. +void Sema::ActOnFinishCXXMemberDecls() { + // Now we have parsed all exception specifications, determine the implicit + // exception specifications for destructors. + for (unsigned i = 0, e = DelayedDestructorExceptionSpecs.size(); + i != e; ++i) { + CXXDestructorDecl *Dtor = DelayedDestructorExceptionSpecs[i]; + AdjustDestructorExceptionSpec(Dtor->getParent(), Dtor, true); + } + DelayedDestructorExceptionSpecs.clear(); + + // Perform any deferred checking of exception specifications for virtual + // destructors. + for (unsigned i = 0, e = DelayedDestructorExceptionSpecChecks.size(); + i != e; ++i) { + const CXXDestructorDecl *Dtor = + DelayedDestructorExceptionSpecChecks[i].first; + assert(!Dtor->getParent()->isDependentType() && + "Should not ever add destructors of templates into the list."); + CheckOverridingFunctionExceptionSpec(Dtor, + DelayedDestructorExceptionSpecChecks[i].second); + } + DelayedDestructorExceptionSpecChecks.clear(); +} + void Sema::AdjustDestructorExceptionSpec(CXXRecordDecl *classDecl, - CXXDestructorDecl *destructor) { + CXXDestructorDecl *destructor, + bool WasDelayed) { // C++11 [class.dtor]p3: // A declaration of a destructor that does not have an exception- // specification is implicitly considered to have the same exception- // specification as an implicit declaration. const FunctionProtoType *dtorType = destructor->getType()-> getAs(); - if (dtorType->hasExceptionSpec()) + if (!WasDelayed && dtorType->hasExceptionSpec()) return; ImplicitExceptionSpecification exceptSpec = @@ -7344,6 +7371,14 @@ void Sema::AdjustDestructorExceptionSpec destructor->setType(ty); + // If we can't compute the exception specification for this destructor yet + // (because it depends on an exception specification which we have not parsed + // yet), make a note that we need to try again when the class is complete. + if (epi.ExceptionSpecType == EST_Delayed) { + assert(!WasDelayed && "couldn't compute destructor exception spec"); + DelayedDestructorExceptionSpecs.push_back(destructor); + } + // FIXME: If the destructor has a body that could throw, and the newly created // spec doesn't allow exceptions, we should emit a warning, because this // change in behavior can break conforming C++03 programs at runtime. @@ -7579,8 +7614,9 @@ Sema::ComputeDefaultedCopyAssignmentExce assert(!Base->getType()->isDependentType() && "Cannot generate implicit members for class with dependent bases."); CXXRecordDecl *BaseClassDecl = Base->getType()->getAsCXXRecordDecl(); - LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, false, 0, - &HasConstCopyAssignment); + HasConstCopyAssignment &= + (bool)LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, + false, 0); } // In C++11, the above citation has "or virtual" added @@ -7591,8 +7627,9 @@ Sema::ComputeDefaultedCopyAssignmentExce assert(!Base->getType()->isDependentType() && "Cannot generate implicit members for class with dependent bases."); CXXRecordDecl *BaseClassDecl = Base->getType()->getAsCXXRecordDecl(); - LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, false, 0, - &HasConstCopyAssignment); + HasConstCopyAssignment &= + (bool)LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, + false, 0); } } @@ -7606,8 +7643,9 @@ Sema::ComputeDefaultedCopyAssignmentExce ++Field) { QualType FieldType = Context.getBaseElementType((*Field)->getType()); if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) { - LookupCopyingAssignment(FieldClassDecl, Qualifiers::Const, false, 0, - &HasConstCopyAssignment); + HasConstCopyAssignment &= + (bool)LookupCopyingAssignment(FieldClassDecl, Qualifiers::Const, + false, 0); } } @@ -8610,8 +8648,8 @@ Sema::ComputeDefaultedCopyCtorExceptionS CXXRecordDecl *BaseClassDecl = cast(Base->getType()->getAs()->getDecl()); - LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const, - &HasConstCopyConstructor); + HasConstCopyConstructor &= + (bool)LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const); } for (CXXRecordDecl::base_class_iterator Base = ClassDecl->vbases_begin(), @@ -8620,8 +8658,8 @@ Sema::ComputeDefaultedCopyCtorExceptionS ++Base) { CXXRecordDecl *BaseClassDecl = cast(Base->getType()->getAs()->getDecl()); - LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const, - &HasConstCopyConstructor); + HasConstCopyConstructor &= + (bool)LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const); } // -- for all the nonstatic data members of X that are of a @@ -8634,8 +8672,8 @@ Sema::ComputeDefaultedCopyCtorExceptionS ++Field) { QualType FieldType = Context.getBaseElementType((*Field)->getType()); if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) { - LookupCopyingConstructor(FieldClassDecl, Qualifiers::Const, - &HasConstCopyConstructor); + HasConstCopyConstructor &= + (bool)LookupCopyingConstructor(FieldClassDecl, Qualifiers::Const); } } // Otherwise, the implicitly declared copy constructor will have @@ -11260,66 +11298,6 @@ Sema::checkExceptionSpecification(Except } } -void Sema::actOnDelayedExceptionSpecification(Decl *MethodD, - ExceptionSpecificationType EST, - SourceRange SpecificationRange, - ArrayRef DynamicExceptions, - ArrayRef DynamicExceptionRanges, - Expr *NoexceptExpr) { - if (!MethodD) - return; - - // Dig out the method we're referring to. - CXXMethodDecl *Method = 0; - if (FunctionTemplateDecl *FunTmpl = dyn_cast(MethodD)) - Method = dyn_cast(FunTmpl->getTemplatedDecl()); - else - Method = dyn_cast(MethodD); - - if (!Method) - return; - - // Dig out the prototype. This should never fail. - const FunctionProtoType *Proto - = dyn_cast(Method->getType()); - if (!Proto) - return; - - // Check the exception specification. - llvm::SmallVector Exceptions; - FunctionProtoType::ExtProtoInfo EPI = Proto->getExtProtoInfo(); - checkExceptionSpecification(EST, DynamicExceptions, DynamicExceptionRanges, - NoexceptExpr, Exceptions, EPI); - - // Rebuild the function type. - QualType T = Context.getFunctionType(Proto->getResultType(), - Proto->arg_type_begin(), - Proto->getNumArgs(), - EPI); - if (TypeSourceInfo *TSInfo = Method->getTypeSourceInfo()) { - // FIXME: When we get proper type location information for exceptions, - // we'll also have to rebuild the TypeSourceInfo. For now, we just patch - // up the TypeSourceInfo; - assert(TypeLoc::getFullDataSizeForType(T) - == TypeLoc::getFullDataSizeForType(Method->getType()) && - "TypeLoc size mismatch with delayed exception specification"); - TSInfo->overrideType(T); - } - - Method->setType(T); - - if (Method->isStatic()) - checkThisInStaticMemberFunctionExceptionSpec(Method); - - if (Method->isVirtual()) { - // Check overrides, which we previously had to delay. - for (CXXMethodDecl::method_iterator O = Method->begin_overridden_methods(), - OEnd = Method->end_overridden_methods(); - O != OEnd; ++O) - CheckOverridingFunctionExceptionSpec(Method, *O); - } -} - /// IdentifyCUDATarget - Determine the CUDA compilation target for this function Sema::CUDAFunctionTarget Sema::IdentifyCUDATarget(const FunctionDecl *D) { // Implicitly declared functions (e.g. copy constructors) are Modified: vendor/clang/dist/lib/Sema/SemaLookup.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaLookup.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Sema/SemaLookup.cpp Tue May 22 21:36:38 2012 (r235809) @@ -2277,7 +2277,7 @@ Sema::SpecialMemberOverloadResult *Sema: Result->setMethod(DD); Result->setKind(DD->isDeleted() ? SpecialMemberOverloadResult::NoMemberOrDeleted : - SpecialMemberOverloadResult::SuccessNonConst); + SpecialMemberOverloadResult::Success); return Result; } @@ -2288,6 +2288,9 @@ Sema::SpecialMemberOverloadResult *Sema: Expr *Arg = 0; unsigned NumArgs; + QualType ArgType = CanTy; + ExprValueKind VK = VK_LValue; + if (SM == CXXDefaultConstructor) { Name = Context.DeclarationNames.getCXXConstructorName(CanTy); NumArgs = 0; @@ -2308,7 +2311,6 @@ Sema::SpecialMemberOverloadResult *Sema: DeclareImplicitMoveAssignment(RD); } - QualType ArgType = CanTy; if (ConstArg) ArgType.addConst(); if (VolatileArg) @@ -2321,14 +2323,17 @@ Sema::SpecialMemberOverloadResult *Sema: // Possibly an XValue is actually correct in the case of move, but // there is no semantic difference for class types in this restricted // case. - ExprValueKind VK; if (SM == CXXCopyConstructor || SM == CXXCopyAssignment) VK = VK_LValue; else VK = VK_RValue; + } + OpaqueValueExpr FakeArg(SourceLocation(), ArgType, VK); + + if (SM != CXXDefaultConstructor) { NumArgs = 1; - Arg = new (Context) OpaqueValueExpr(SourceLocation(), ArgType, VK); + Arg = &FakeArg; } // Create the object argument @@ -2338,17 +2343,14 @@ Sema::SpecialMemberOverloadResult *Sema: if (VolatileThis) ThisTy.addVolatile(); Expr::Classification Classification = - (new (Context) OpaqueValueExpr(SourceLocation(), ThisTy, - RValueThis ? VK_RValue : VK_LValue))-> - Classify(Context); + OpaqueValueExpr(SourceLocation(), ThisTy, + RValueThis ? VK_RValue : VK_LValue).Classify(Context); // Now we perform lookup on the name we computed earlier and do overload // resolution. Lookup is only performed directly into the class since there // will always be a (possibly implicit) declaration to shadow any others. OverloadCandidateSet OCS((SourceLocation())); DeclContext::lookup_iterator I, E; - SpecialMemberOverloadResult::Kind SuccessKind = - SpecialMemberOverloadResult::SuccessNonConst; llvm::tie(I, E) = RD->lookup(Name); assert((I != E) && @@ -2378,17 +2380,6 @@ Sema::SpecialMemberOverloadResult *Sema: else AddOverloadCandidate(M, DeclAccessPair::make(M, AS_public), llvm::makeArrayRef(&Arg, NumArgs), OCS, true); - - // Here we're looking for a const parameter to speed up creation of - // implicit copy methods. - if ((SM == CXXCopyAssignment && M->isCopyAssignmentOperator()) || - (SM == CXXCopyConstructor && - cast(M)->isCopyConstructor())) { - QualType ArgType = M->getType()->getAs()->getArgType(0); - if (!ArgType->isReferenceType() || - ArgType->getPointeeType().isConstQualified()) - SuccessKind = SpecialMemberOverloadResult::SuccessConst; - } } else if (FunctionTemplateDecl *Tmpl = dyn_cast(Cand)) { if (SM == CXXCopyAssignment || SM == CXXMoveAssignment) @@ -2409,7 +2400,7 @@ Sema::SpecialMemberOverloadResult *Sema: switch (OCS.BestViableFunction(*this, SourceLocation(), Best)) { case OR_Success: Result->setMethod(cast(Best->Function)); - Result->setKind(SuccessKind); + Result->setKind(SpecialMemberOverloadResult::Success); break; case OR_Deleted: @@ -2442,17 +2433,13 @@ CXXConstructorDecl *Sema::LookupDefaultC /// \brief Look up the copying constructor for the given class. CXXConstructorDecl *Sema::LookupCopyingConstructor(CXXRecordDecl *Class, - unsigned Quals, - bool *ConstParamMatch) { + unsigned Quals) { assert(!(Quals & ~(Qualifiers::Const | Qualifiers::Volatile)) && "non-const, non-volatile qualifiers for copy ctor arg"); SpecialMemberOverloadResult *Result = LookupSpecialMember(Class, CXXCopyConstructor, Quals & Qualifiers::Const, Quals & Qualifiers::Volatile, false, false, false); - if (ConstParamMatch) - *ConstParamMatch = Result->hasConstParamMatch(); - return cast_or_null(Result->getMethod()); } @@ -2485,8 +2472,7 @@ DeclContext::lookup_result Sema::LookupC /// \brief Look up the copying assignment operator for the given class. CXXMethodDecl *Sema::LookupCopyingAssignment(CXXRecordDecl *Class, unsigned Quals, bool RValueThis, - unsigned ThisQuals, - bool *ConstParamMatch) { + unsigned ThisQuals) { assert(!(Quals & ~(Qualifiers::Const | Qualifiers::Volatile)) && "non-const, non-volatile qualifiers for copy assignment arg"); assert(!(ThisQuals & ~(Qualifiers::Const | Qualifiers::Volatile)) && @@ -2497,9 +2483,6 @@ CXXMethodDecl *Sema::LookupCopyingAssign ThisQuals & Qualifiers::Const, ThisQuals & Qualifiers::Volatile); - if (ConstParamMatch) - *ConstParamMatch = Result->hasConstParamMatch(); - return Result->getMethod(); } Modified: vendor/clang/dist/lib/Sema/SemaType.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaType.cpp Tue May 22 21:32:05 2012 (r235808) +++ vendor/clang/dist/lib/Sema/SemaType.cpp Tue May 22 21:36:38 2012 (r235809) @@ -561,7 +561,7 @@ static void maybeSynthesizeBlockSignatur /*const qualifier*/SourceLocation(), /*volatile qualifier*/SourceLocation(), /*mutable qualifier*/SourceLocation(), - /*EH*/ EST_None, SourceLocation(), 0, 0, 0, 0, 0, + /*EH*/ EST_None, SourceLocation(), 0, 0, 0, 0, /*parens*/ loc, loc, declarator)); @@ -4195,7 +4195,8 @@ bool Sema::RequireCompleteType(SourceLoc // class template specialization, or an array with known size of such, // try to instantiate it. QualType MaybeTemplate = T; - if (const ConstantArrayType *Array = Context.getAsConstantArrayType(T)) + while (const ConstantArrayType *Array *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 22 21:37:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41C3C106566B; Tue, 22 May 2012 21:37:30 +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 14AC78FC17; Tue, 22 May 2012 21:37:30 +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 q4MLbTXq029005; Tue, 22 May 2012 21:37:29 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MLbTr5029004; Tue, 22 May 2012 21:37:29 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205222137.q4MLbTr5029004@svn.freebsd.org> From: Dimitry Andric Date: Tue, 22 May 2012 21:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235810 - vendor/clang/clang-release_31-r156748 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 21:37:30 -0000 Author: dim Date: Tue May 22 21:37:29 2012 New Revision: 235810 URL: http://svn.freebsd.org/changeset/base/235810 Log: Tag clang release_31 final r156748. Added: vendor/clang/clang-release_31-r156748/ - copied from r235809, vendor/clang/dist/ From owner-svn-src-all@FreeBSD.ORG Wed May 23 00:04:32 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79A69106566B; Wed, 23 May 2012 00:04:32 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 14BD68FC0C; Wed, 23 May 2012 00:04:32 +0000 (UTC) Received: from sa-nc-mfg-99.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q4N04MMB064893 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 22 May 2012 17:04:30 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: Marcel Moolenaar In-Reply-To: Date: Tue, 22 May 2012 17:04:16 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "David E. O'Brien" , Bruce Evans Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 00:04:32 -0000 On May 22, 2012, at 2:07 PM, mdf@FreeBSD.org wrote: > On Tue, May 22, 2012 at 1:05 PM, Bruce Evans = wrote: >> On Tue, 22 May 2012, David E. O'Brien wrote: >>=20 >>> Log: >>> Do not incorrectly warn when printing a quad_t using "%qd" on = 64-bit >>> platforms. >>=20 >>=20 >> I think I like this, since it is technically correct, and will find a >> different set of type mismatches. >=20 > We run with the following at Isilon, which is somewhat bogus because > it allows a bit of sloppiness in types, but is also terribly > convenient since it means no casting on printf arguments is needed: >=20 > --- contrib/gcc/c-format.c 2012-05-22 14:08:23.538266746 -0700 > +++ /data/sb/head/src/contrib/gcc/c-format.c 2012-05-16 > 12:59:40.937016702 -0700 > @@ -2298,10 +2570,20 @@ check_format_types (format_wanted_type * > equivalent but the above test won't consider them equivalent. = */ > if (wanted_type =3D=3D char_type_node > && (!pedantic || i < 2) > && char_type_flag) > continue; > + > + /* Isilon: FreeBSD defines int64_t (and others) as one type = (e.g. long > + long) on i386 and another type (e.g. long) on amd64. This = prevents > + the use of a common format specifier. Treat equal sized = integer types > + as equivalent. */ > + if (TREE_CODE (wanted_type) =3D=3D INTEGER_TYPE > + && TREE_CODE (cur_type) =3D=3D INTEGER_TYPE > + && int_size_in_bytes (wanted_type) =3D=3D int_size_in_bytes = (cur_type)) > + continue; > + > /* Now we have a type mismatch. */ > format_type_warning (types->name, format_start, format_length, > wanted_type, types->pointer_count, > types->wanted_type_name, orig_cur_type, = arg_num); > } >=20 >=20 > If there's no objections, I (or David or anyone else) can commit to > the FreeBSD repository. I think such would make support for external (i.e. non-FreeBSD) = toolchains even more problematic. Our format extensions are a big hurdle already. I think we should not tweak the compiler. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Wed May 23 01:20:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3A951065677; Wed, 23 May 2012 01:20:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DE9A8FC14; Wed, 23 May 2012 01:20:25 +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 q4N1KPfG039882; Wed, 23 May 2012 01:20:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4N1KP0f039880; Wed, 23 May 2012 01:20:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201205230120.q4N1KP0f039880@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 23 May 2012 01:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235816 - head/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 01:20:25 -0000 Author: yongari Date: Wed May 23 01:20:25 2012 New Revision: 235816 URL: http://svn.freebsd.org/changeset/base/235816 Log: Make IPMI work in the bce driver even when the interface is configured down. Formerly, IPMI communication was lost whenever the interface was not up. The reason was that the BCE_EMAC_MODE register was not configured with the correct media settings. There are two parts to the fix. First, resetting the chip in bce_reset() causes the BCE_EMAC_MODE register to be initialized to a default value that does not necessarily correspond to the actual media settings. The fix implemented here is a bit of a hack. Ideally, at the end of bce_reset() we would poll the PHY to determine the negotiated media, and then we would set the BCE_EMAC_MODE register accordingly. That is difficult, since the PHY is abstracted behind the MII layer and is not supposed to be queried directly from the MAC driver. Instead, we read the BCE_EMAC_MODE register at the beginning of bce_reset() and then restore its media bits to their original values before returning. If IPMI is up and running, then the link is already established and the BCE_EMAC_MODE register is already set appropriately when bce_reset() is called. If IPMI is not running, no harm is done by preserving the BCE_EMAC_MODE settings. The driver will set the register properly once the interface is configured up and link is established. Second, bce_miibus_statchg() is sometimes called when the link is down. In that case, the reported media settings are invalid. Formerly, the driver used them anyway to setup the BCE_EMAC_MODE register. We now avoid changing any MAC registers unless link is active and the reported media settings are valid. Submitted by: jdp Tested by: jdp MFC after: 5 days Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Wed May 23 00:46:19 2012 (r235815) +++ head/sys/dev/bce/if_bce.c Wed May 23 01:20:25 2012 (r235816) @@ -2062,6 +2062,11 @@ bce_miibus_statchg(device_t dev) media_status = mii->mii_media_status; } + /* Ignore invalid media status. */ + if ((media_status & (IFM_ACTIVE | IFM_AVALID)) != + (IFM_ACTIVE | IFM_AVALID)) + goto bce_miibus_statchg_exit; + val = REG_RD(sc, BCE_EMAC_MODE); val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX | BCE_EMAC_MODE_MAC_LOOP | BCE_EMAC_MODE_FORCE_LINK | @@ -2131,6 +2136,7 @@ bce_miibus_statchg(device_t dev) /* ToDo: Update watermarks in bce_init_rx_context(). */ +bce_miibus_statchg_exit: DBEXIT(BCE_VERBOSE_PHY); } @@ -4997,14 +5003,25 @@ bce_stop(struct bce_softc *sc) static int bce_reset(struct bce_softc *sc, u32 reset_code) { - u32 val; + u32 emac_mode_save, val; int i, rc = 0; + static const u32 emac_mode_mask = BCE_EMAC_MODE_PORT | + BCE_EMAC_MODE_HALF_DUPLEX | BCE_EMAC_MODE_25G; DBENTER(BCE_VERBOSE_RESET); DBPRINT(sc, BCE_VERBOSE_RESET, "%s(): reset_code = 0x%08X\n", __FUNCTION__, reset_code); + /* + * If ASF/IPMI is operational, then the EMAC Mode register already + * contains appropriate values for the link settings that have + * been auto-negotiated. Resetting the chip will clobber those + * values. Save the important bits so we can restore them after + * the reset. + */ + emac_mode_save = REG_RD(sc, BCE_EMAC_MODE) & emac_mode_mask; + /* Wait for pending PCI transactions to complete. */ REG_WR(sc, BCE_MISC_ENABLE_CLR_BITS, BCE_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE | @@ -5094,6 +5111,11 @@ bce_reset(struct bce_softc *sc, u32 rese bce_fw_cap_init(sc); bce_reset_exit: + /* Restore EMAC Mode bits needed to keep ASF/IPMI running. */ + val = REG_RD(sc, BCE_EMAC_MODE); + val = (val & ~emac_mode_mask) | emac_mode_save; + REG_WR(sc, BCE_EMAC_MODE, val); + DBEXIT(BCE_VERBOSE_RESET); return (rc); } From owner-svn-src-all@FreeBSD.ORG Wed May 23 02:02:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 693401065688; Wed, 23 May 2012 02:02:30 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5183D8FC18; Wed, 23 May 2012 02:02:30 +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 q4N22UYM041841; Wed, 23 May 2012 02:02:30 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4N22UDA041838; Wed, 23 May 2012 02:02:30 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201205230202.q4N22UDA041838@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 23 May 2012 02:02:30 +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: r235818 - stable/9/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 02:02:30 -0000 Author: yongari Date: Wed May 23 02:02:29 2012 New Revision: 235818 URL: http://svn.freebsd.org/changeset/base/235818 Log: MFC r235151: Implement basic remote PHY support. Remote PHY allows the controller to perform MDIO type accesses to a remote transceiver using message pages defined through MRBE(multirate backplane ethernet). It's used in blade systems(e.g Dell Blade m610) which are connected to pass-through blades rather than traditional switches. This change directly manipulates firmware's mailboxes to control remote PHY such that it does not use mii(4). Alternatively, as David said, it could be implemented in brgphy(4) by creating a fake PHY and let brgphy(4) do necessary mii accesses and bce(4) can implement mailbox accesses based on the type of brgphy(4)'s mii accesses. Personally, I think it would make brgphy(4) hard to maintain since it would have to access many bce(4) registers in brgphy(4). Given that there are users who are suffering from lack of remote PHY support, it would be better to get working system rather than waiting for complete/perfect implementation. Modified: stable/9/sys/dev/bce/if_bce.c stable/9/sys/dev/bce/if_bcereg.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/bce/if_bce.c ============================================================================== --- stable/9/sys/dev/bce/if_bce.c Wed May 23 01:49:50 2012 (r235817) +++ stable/9/sys/dev/bce/if_bce.c Wed May 23 02:02:29 2012 (r235818) @@ -364,6 +364,7 @@ static int bce_nvram_write (struct bce static void bce_get_rx_buffer_sizes(struct bce_softc *, int); static void bce_get_media (struct bce_softc *); static void bce_init_media (struct bce_softc *); +static u32 bce_get_rphy_link (struct bce_softc *); static void bce_dma_map_addr (void *, bus_dma_segment_t *, int, int); static int bce_dma_alloc (device_t); static void bce_dma_free (struct bce_softc *); @@ -372,6 +373,7 @@ static void bce_release_resources (struc /****************************************************************************/ /* BCE Firmware Synchronization and Load */ /****************************************************************************/ +static void bce_fw_cap_init (struct bce_softc *); static int bce_fw_sync (struct bce_softc *, u32); static void bce_load_rv2p_fw (struct bce_softc *, u32 *, u32, u32); static void bce_load_cpu_fw (struct bce_softc *, @@ -418,6 +420,7 @@ static void bce_watchdog (struct bce_s static int bce_ifmedia_upd (struct ifnet *); static int bce_ifmedia_upd_locked (struct ifnet *); static void bce_ifmedia_sts (struct ifnet *, struct ifmediareq *); +static void bce_ifmedia_sts_rphy (struct bce_softc *, struct ifmediareq *); static void bce_init_locked (struct bce_softc *); static void bce_init (void *); static void bce_mgmt_init_locked (struct bce_softc *sc); @@ -757,6 +760,13 @@ bce_print_adapter_info(struct bce_softc printf("2.5G"); i++; } + if (sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) { + if (i > 0) printf("|"); + printf("Remote PHY(%s)", + sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG ? + "FIBER" : "TP"); i++; + } + if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { if (i > 0) printf("|"); printf("MFW); MFW (%s)\n", sc->bce_mfw_ver); @@ -1297,6 +1307,9 @@ bce_attach(device_t dev) if (val & BCE_PCICFG_MISC_STATUS_32BIT_DET) sc->bce_flags |= BCE_PCI_32BIT_FLAG; + /* Find the media type for the adapter. */ + bce_get_media(sc); + /* Reset controller and announce to bootcode that driver is present. */ if (bce_reset(sc, BCE_DRV_MSG_CODE_RESET)) { BCE_PRINTF("%s(%d): Controller reset failed!\n", @@ -1344,9 +1357,6 @@ bce_attach(device_t dev) /* Update statistics once every second. */ sc->bce_stats_ticks = 1000000 & 0xffff00; - /* Find the media type for the adapter. */ - bce_get_media(sc); - /* Store data needed by PHY driver for backplane applications */ sc->bce_shared_hw_cfg = bce_shmem_rd(sc, BCE_SHARED_HW_CFG_CONFIG); sc->bce_port_hw_cfg = bce_shmem_rd(sc, BCE_PORT_HW_CFG_CONFIG); @@ -1386,6 +1396,15 @@ bce_attach(device_t dev) ifp->if_capabilities = BCE_IF_CAPABILITIES; } +#if __FreeBSD_version >= 800505 + /* + * Introducing IFCAP_LINKSTATE didn't bump __FreeBSD_version + * so it's approximate value. + */ + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + ifp->if_capabilities |= IFCAP_LINKSTATE; +#endif + ifp->if_capenable = ifp->if_capabilities; /* @@ -1409,14 +1428,52 @@ bce_attach(device_t dev) /* Handle any special PHY initialization for SerDes PHYs. */ bce_init_media(sc); - /* MII child bus by attaching the PHY. */ - rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, - bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, - MII_OFFSET_ANY, MIIF_DOPAUSE); - if (rc != 0) { - BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, - __LINE__); - goto bce_attach_fail; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + ifmedia_init(&sc->bce_ifmedia, IFM_IMASK, bce_ifmedia_upd, + bce_ifmedia_sts); + /* + * We can't manually override remote PHY's link and assume + * PHY port configuration(Fiber or TP) is not changed after + * device attach. This may not be correct though. + */ + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) != 0) { + if (sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) { + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_2500_SX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_2500_SX | IFM_FDX, 0, NULL); + } + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_SX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_SX | IFM_FDX, 0, NULL); + } else { + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_10_T, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_100_TX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_T, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); + } + ifmedia_add(&sc->bce_ifmedia, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(&sc->bce_ifmedia, IFM_ETHER | IFM_AUTO); + sc->bce_ifmedia.ifm_media = sc->bce_ifmedia.ifm_cur->ifm_media; + } else { + /* MII child bus by attaching the PHY. */ + rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, + bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, + MII_OFFSET_ANY, MIIF_DOPAUSE); + if (rc != 0) { + BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, + __LINE__); + goto bce_attach_fail; + } } /* Attach to the Ethernet interface list. */ @@ -1521,8 +1578,12 @@ bce_detach(device_t dev) ether_ifdetach(ifp); /* If we have a child device on the MII bus remove it too. */ - bus_generic_detach(dev); - device_delete_child(dev, sc->bce_miibus); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + ifmedia_removeall(&sc->bce_ifmedia); + else { + bus_generic_detach(dev); + device_delete_child(dev, sc->bce_miibus); + } /* Release all remaining resources. */ bce_release_resources(sc); @@ -1983,13 +2044,23 @@ bce_miibus_statchg(device_t dev) { struct bce_softc *sc; struct mii_data *mii; - int val; + struct ifmediareq ifmr; + int media_active, media_status, val; sc = device_get_softc(dev); DBENTER(BCE_VERBOSE_PHY); - mii = device_get_softc(sc->bce_miibus); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + bzero(&ifmr, sizeof(ifmr)); + bce_ifmedia_sts_rphy(sc, &ifmr); + media_active = ifmr.ifm_active; + media_status = ifmr.ifm_status; + } else { + mii = device_get_softc(sc->bce_miibus); + media_active = mii->mii_media_active; + media_status = mii->mii_media_status; + } val = REG_RD(sc, BCE_EMAC_MODE); val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX | @@ -1997,7 +2068,7 @@ bce_miibus_statchg(device_t dev) BCE_EMAC_MODE_25G); /* Set MII or GMII interface based on the PHY speed. */ - switch (IFM_SUBTYPE(mii->mii_media_active)) { + switch (IFM_SUBTYPE(media_active)) { case IFM_10_T: if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { DBPRINT(sc, BCE_INFO_PHY, @@ -2026,7 +2097,7 @@ bce_miibus_statchg(device_t dev) } /* Set half or full duplex based on PHY settings. */ - if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) { + if ((IFM_OPTIONS(media_active) & IFM_FDX) == 0) { DBPRINT(sc, BCE_INFO_PHY, "Setting Half-Duplex interface.\n"); val |= BCE_EMAC_MODE_HALF_DUPLEX; @@ -2036,7 +2107,7 @@ bce_miibus_statchg(device_t dev) REG_WR(sc, BCE_EMAC_MODE, val); - if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { + if ((IFM_OPTIONS(media_active) & IFM_ETH_RXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling RX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); @@ -2046,7 +2117,7 @@ bce_miibus_statchg(device_t dev) BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); } - if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { + if ((IFM_OPTIONS(media_active) & IFM_ETH_TXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling TX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); @@ -3130,7 +3201,8 @@ bce_get_media_exit: static void bce_init_media(struct bce_softc *sc) { - if ((sc->bce_phy_flags & BCE_PHY_IEEE_CLAUSE_45_FLAG) != 0) { + if ((sc->bce_phy_flags & (BCE_PHY_IEEE_CLAUSE_45_FLAG | + BCE_PHY_REMOTE_CAP_FLAG)) == BCE_PHY_IEEE_CLAUSE_45_FLAG) { /* * Configure 5709S/5716S PHYs to use traditional IEEE * Clause 22 method. Otherwise we have no way to attach @@ -5018,6 +5090,8 @@ bce_reset(struct bce_softc *sc, u32 rese if (rc) BCE_PRINTF("%s(%d): Firmware did not complete " "initialization!\n", __FILE__, __LINE__); + /* Get firmware capabilities. */ + bce_fw_cap_init(sc); bce_reset_exit: DBEXIT(BCE_VERBOSE_RESET); @@ -6081,6 +6155,55 @@ bce_free_pg_chain(struct bce_softc *sc) } +static u32 +bce_get_rphy_link(struct bce_softc *sc) +{ + u32 advertise, link; + int fdpx; + + advertise = 0; + fdpx = 0; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) != 0) + link = bce_shmem_rd(sc, BCE_RPHY_SERDES_LINK); + else + link = bce_shmem_rd(sc, BCE_RPHY_COPPER_LINK); + if (link & BCE_NETLINK_ANEG_ENB) + advertise |= BCE_NETLINK_ANEG_ENB; + if (link & BCE_NETLINK_SPEED_10HALF) + advertise |= BCE_NETLINK_SPEED_10HALF; + if (link & BCE_NETLINK_SPEED_10FULL) { + advertise |= BCE_NETLINK_SPEED_10FULL; + fdpx++; + } + if (link & BCE_NETLINK_SPEED_100HALF) + advertise |= BCE_NETLINK_SPEED_100HALF; + if (link & BCE_NETLINK_SPEED_100FULL) { + advertise |= BCE_NETLINK_SPEED_100FULL; + fdpx++; + } + if (link & BCE_NETLINK_SPEED_1000HALF) + advertise |= BCE_NETLINK_SPEED_1000HALF; + if (link & BCE_NETLINK_SPEED_1000FULL) { + advertise |= BCE_NETLINK_SPEED_1000FULL; + fdpx++; + } + if (link & BCE_NETLINK_SPEED_2500HALF) + advertise |= BCE_NETLINK_SPEED_2500HALF; + if (link & BCE_NETLINK_SPEED_2500FULL) { + advertise |= BCE_NETLINK_SPEED_2500FULL; + fdpx++; + } + if (fdpx) + advertise |= BCE_NETLINK_FC_PAUSE_SYM | + BCE_NETLINK_FC_PAUSE_ASYM; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + advertise |= BCE_NETLINK_PHY_APP_REMOTE | + BCE_NETLINK_ETH_AT_WIRESPEED; + + return (advertise); +} + + /****************************************************************************/ /* Set media options. */ /* */ @@ -6116,21 +6239,110 @@ bce_ifmedia_upd_locked(struct ifnet *ifp struct bce_softc *sc = ifp->if_softc; struct mii_data *mii; struct mii_softc *miisc; - int error; + struct ifmedia *ifm; + u32 link; + int error, fdx; DBENTER(BCE_VERBOSE_PHY); error = 0; BCE_LOCK_ASSERT(sc); - mii = device_get_softc(sc->bce_miibus); + sc->bce_link_up = FALSE; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + ifm = &sc->bce_ifmedia; + if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) + return (EINVAL); + link = 0; + fdx = IFM_OPTIONS(ifm->ifm_media) & IFM_FDX; + switch(IFM_SUBTYPE(ifm->ifm_media)) { + case IFM_AUTO: + /* + * Check advertised link of remote PHY by reading + * BCE_RPHY_SERDES_LINK or BCE_RPHY_COPPER_LINK. + * Always use the same link type of remote PHY. + */ + link = bce_get_rphy_link(sc); + break; + case IFM_2500_SX: + if ((sc->bce_phy_flags & + (BCE_PHY_REMOTE_PORT_FIBER_FLAG | + BCE_PHY_2_5G_CAPABLE_FLAG)) == 0) + return (EINVAL); + /* + * XXX + * Have to enable forced 2.5Gbps configuration. + */ + if (fdx != 0) + link |= BCE_NETLINK_SPEED_2500FULL; + else + link |= BCE_NETLINK_SPEED_2500HALF; + break; + case IFM_1000_SX: + if ((sc->bce_phy_flags & + BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + return (EINVAL); + /* + * XXX + * Have to disable 2.5Gbps configuration. + */ + if (fdx != 0) + link = BCE_NETLINK_SPEED_1000FULL; + else + link = BCE_NETLINK_SPEED_1000HALF; + break; + case IFM_1000_T: + if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) + return (EINVAL); + if (fdx != 0) + link = BCE_NETLINK_SPEED_1000FULL; + else + link = BCE_NETLINK_SPEED_1000HALF; + break; + case IFM_100_TX: + if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) + return (EINVAL); + if (fdx != 0) + link = BCE_NETLINK_SPEED_100FULL; + else + link = BCE_NETLINK_SPEED_100HALF; + break; + case IFM_10_T: + if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) + return (EINVAL); + if (fdx != 0) + link = BCE_NETLINK_SPEED_10FULL; + else + link = BCE_NETLINK_SPEED_10HALF; + break; + default: + return (EINVAL); + } + if (IFM_SUBTYPE(ifm->ifm_media) != IFM_AUTO) { + /* + * XXX + * Advertise pause capability for full-duplex media. + */ + if (fdx != 0) + link |= BCE_NETLINK_FC_PAUSE_SYM | + BCE_NETLINK_FC_PAUSE_ASYM; + if ((sc->bce_phy_flags & + BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + link |= BCE_NETLINK_PHY_APP_REMOTE | + BCE_NETLINK_ETH_AT_WIRESPEED; + } - /* Make sure the MII bus has been enumerated. */ - if (mii) { - sc->bce_link_up = FALSE; - LIST_FOREACH(miisc, &mii->mii_phys, mii_list) - PHY_RESET(miisc); - error = mii_mediachg(mii); + bce_shmem_wr(sc, BCE_MB_ARGS_0, link); + error = bce_fw_sync(sc, BCE_DRV_MSG_CODE_CMD_SET_LINK); + } else { + mii = device_get_softc(sc->bce_miibus); + + /* Make sure the MII bus has been enumerated. */ + if (mii) { + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + PHY_RESET(miisc); + error = mii_mediachg(mii); + } } DBEXIT(BCE_VERBOSE_PHY); @@ -6138,6 +6350,85 @@ bce_ifmedia_upd_locked(struct ifnet *ifp } +static void +bce_ifmedia_sts_rphy(struct bce_softc *sc, struct ifmediareq *ifmr) +{ + struct ifnet *ifp; + u32 link; + + ifp = sc->bce_ifp; + BCE_LOCK_ASSERT(sc); + + ifmr->ifm_status = IFM_AVALID; + ifmr->ifm_active = IFM_ETHER; + link = bce_shmem_rd(sc, BCE_LINK_STATUS); + /* XXX Handle heart beat status? */ + if ((link & BCE_LINK_STATUS_LINK_UP) != 0) + ifmr->ifm_status |= IFM_ACTIVE; + else { + ifmr->ifm_active |= IFM_NONE; + ifp->if_baudrate = 0; + return; + } + switch (link & BCE_LINK_STATUS_SPEED_MASK) { + case BCE_LINK_STATUS_10HALF: + ifmr->ifm_active |= IFM_10_T | IFM_HDX; + ifp->if_baudrate = IF_Mbps(10UL); + break; + case BCE_LINK_STATUS_10FULL: + ifmr->ifm_active |= IFM_10_T | IFM_FDX; + ifp->if_baudrate = IF_Mbps(10UL); + break; + case BCE_LINK_STATUS_100HALF: + ifmr->ifm_active |= IFM_100_TX | IFM_HDX; + ifp->if_baudrate = IF_Mbps(100UL); + break; + case BCE_LINK_STATUS_100FULL: + ifmr->ifm_active |= IFM_100_TX | IFM_FDX; + ifp->if_baudrate = IF_Mbps(100UL); + break; + case BCE_LINK_STATUS_1000HALF: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + ifmr->ifm_active |= IFM_1000_T | IFM_HDX; + else + ifmr->ifm_active |= IFM_1000_SX | IFM_HDX; + ifp->if_baudrate = IF_Mbps(1000UL); + break; + case BCE_LINK_STATUS_1000FULL: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + ifmr->ifm_active |= IFM_1000_T | IFM_FDX; + else + ifmr->ifm_active |= IFM_1000_SX | IFM_FDX; + ifp->if_baudrate = IF_Mbps(1000UL); + break; + case BCE_LINK_STATUS_2500HALF: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) { + ifmr->ifm_active |= IFM_NONE; + return; + } else + ifmr->ifm_active |= IFM_2500_SX | IFM_HDX; + ifp->if_baudrate = IF_Mbps(2500UL); + break; + case BCE_LINK_STATUS_2500FULL: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) { + ifmr->ifm_active |= IFM_NONE; + return; + } else + ifmr->ifm_active |= IFM_2500_SX | IFM_FDX; + ifp->if_baudrate = IF_Mbps(2500UL); + break; + default: + ifmr->ifm_active |= IFM_NONE; + return; + } + + if ((link & BCE_LINK_STATUS_RX_FC_ENABLED) != 0) + ifmr->ifm_active |= IFM_ETH_RXPAUSE; + if ((link & BCE_LINK_STATUS_TX_FC_ENABLED) != 0) + ifmr->ifm_active |= IFM_ETH_TXPAUSE; +} + + /****************************************************************************/ /* Reports current media status. */ /* */ @@ -6158,11 +6449,15 @@ bce_ifmedia_sts(struct ifnet *ifp, struc BCE_UNLOCK(sc); return; } - mii = device_get_softc(sc->bce_miibus); - mii_pollstat(mii); - ifmr->ifm_active = mii->mii_media_active; - ifmr->ifm_status = mii->mii_media_status; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + bce_ifmedia_sts_rphy(sc, ifmr); + else { + mii = device_get_softc(sc->bce_miibus); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + } BCE_UNLOCK(sc); @@ -6199,14 +6494,26 @@ bce_phy_intr(struct bce_softc *sc) STATUS_ATTN_BITS_LINK_STATE); DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now UP.\n", __FUNCTION__); - } - else { + } else { REG_WR(sc, BCE_PCICFG_STATUS_BIT_CLEAR_CMD, STATUS_ATTN_BITS_LINK_STATE); DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now DOWN.\n", __FUNCTION__); } + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + if (new_link_state) { + if (bootverbose) + if_printf(sc->bce_ifp, "link UP\n"); + if_link_state_change(sc->bce_ifp, + LINK_STATE_UP); + } else { + if (bootverbose) + if_printf(sc->bce_ifp, "link DOWN\n"); + if_link_state_change(sc->bce_ifp, + LINK_STATE_DOWN); + } + } /* * Assume link is down and allow * tick routine to update the state @@ -7495,10 +7802,14 @@ bce_ioctl(struct ifnet *ifp, u_long comm case SIOCGIFMEDIA: DBPRINT(sc, BCE_VERBOSE_MISC, "Received SIOCSIFMEDIA/SIOCGIFMEDIA\n"); - - mii = device_get_softc(sc->bce_miibus); - error = ifmedia_ioctl(ifp, ifr, - &mii->mii_media, command); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + error = ifmedia_ioctl(ifp, ifr, &sc->bce_ifmedia, + command); + else { + mii = device_get_softc(sc->bce_miibus); + error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, + command); + } break; /* Set interface capability */ @@ -8163,6 +8474,7 @@ bce_tick(void *xsc) struct bce_softc *sc = xsc; struct mii_data *mii; struct ifnet *ifp; + struct ifmediareq ifmr; ifp = sc->bce_ifp; @@ -8193,21 +8505,32 @@ bce_tick(void *xsc) goto bce_tick_exit; /* Link is down. Check what the PHY's doing. */ - mii = device_get_softc(sc->bce_miibus); - mii_tick(mii); - - /* Check if the link has come up. */ - if ((mii->mii_media_status & IFM_ACTIVE) && - (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { - DBPRINT(sc, BCE_VERBOSE_MISC, - "%s(): Link up!\n", __FUNCTION__); - sc->bce_link_up = TRUE; - if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || - IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || - IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && - (bce_verbose || bootverbose)) - BCE_PRINTF("Gigabit link up!\n"); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + bzero(&ifmr, sizeof(ifmr)); + bce_ifmedia_sts_rphy(sc, &ifmr); + if ((ifmr.ifm_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + sc->bce_link_up = TRUE; + bce_miibus_statchg(sc->bce_dev); + } + } else { + mii = device_get_softc(sc->bce_miibus); + mii_tick(mii); + /* Check if the link has come up. */ + if ((mii->mii_media_status & IFM_ACTIVE) && + (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { + DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Link up!\n", + __FUNCTION__); + sc->bce_link_up = TRUE; + if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || + IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || + IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && + (bce_verbose || bootverbose)) + BCE_PRINTF("Gigabit link up!\n"); + } + } + if (sc->bce_link_up == TRUE) { /* Now that link is up, handle any outstanding TX traffic. */ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Found " @@ -8221,6 +8544,36 @@ bce_tick_exit: return; } +static void +bce_fw_cap_init(struct bce_softc *sc) +{ + u32 ack, cap, link; + + ack = 0; + cap = bce_shmem_rd(sc, BCE_FW_CAP_MB); + if ((cap & BCE_FW_CAP_SIGNATURE_MAGIC_MASK) != + BCE_FW_CAP_SIGNATURE_MAGIC) + return; + if ((cap & (BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN)) == + (BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN)) + ack |= BCE_DRV_ACK_CAP_SIGNATURE_MAGIC | + BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN; + if ((sc->bce_phy_flags & BCE_PHY_SERDES_FLAG) != 0 && + (cap & BCE_FW_CAP_REMOTE_PHY_CAP) != 0) { + sc->bce_phy_flags &= ~BCE_PHY_REMOTE_PORT_FIBER_FLAG; + sc->bce_phy_flags |= BCE_PHY_REMOTE_CAP_FLAG; + link = bce_shmem_rd(sc, BCE_LINK_STATUS); + if ((link & BCE_LINK_STATUS_SERDES_LINK) != 0) + sc->bce_phy_flags |= BCE_PHY_REMOTE_PORT_FIBER_FLAG; + ack |= BCE_DRV_ACK_CAP_SIGNATURE_MAGIC | + BCE_FW_CAP_REMOTE_PHY_CAP; + } + + if (ack != 0) + bce_shmem_wr(sc, BCE_DRV_ACK_CAP_MB, ack); +} + + #ifdef BCE_DEBUG /****************************************************************************/ /* Allows the driver state to be dumped through the sysctl interface. */ Modified: stable/9/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/9/sys/dev/bce/if_bcereg.h Wed May 23 01:49:50 2012 (r235817) +++ stable/9/sys/dev/bce/if_bcereg.h Wed May 23 02:02:29 2012 (r235818) @@ -814,6 +814,23 @@ struct flash_spec { #define BCE_DRV_PULSE_SEQ_MASK 0x00007fff #define BCE_MB_ARGS_0 0x00000014 +#define BCE_NETLINK_SPEED_10HALF (1<<0) +#define BCE_NETLINK_SPEED_10FULL (1<<1) +#define BCE_NETLINK_SPEED_100HALF (1<<2) +#define BCE_NETLINK_SPEED_100FULL (1<<3) +#define BCE_NETLINK_SPEED_1000HALF (1<<4) +#define BCE_NETLINK_SPEED_1000FULL (1<<5) +#define BCE_NETLINK_SPEED_2500HALF (1<<6) +#define BCE_NETLINK_SPEED_2500FULL (1<<7) +#define BCE_NETLINK_SPEED_10GHALF (1<<8) +#define BCE_NETLINK_SPEED_10GFULL (1<<9) +#define BCE_NETLINK_ANEG_ENB (1<<10) +#define BCE_NETLINK_PHY_APP_REMOTE (1<<11) +#define BCE_NETLINK_FC_PAUSE_SYM (1<<12) +#define BCE_NETLINK_FC_PAUSE_ASYM (1<<13) +#define BCE_NETLINK_ETH_AT_WIRESPEED (1<<14) +#define BCE_NETLINK_PHY_RESET (1<<15) + #define BCE_MB_ARGS_1 0x00000018 /* Indicate to the firmware not to go into the @@ -1079,6 +1096,26 @@ struct flash_spec { #define BCE_BC_STATE_BC_DBG_CMD_LOOP_CNT_MASK 0xffff #define BCE_BC_STATE_BC_DBG_CMD_LOOP_INFINITE 0xffff +#define BCE_FW_EVT_CODE_MB 0x00000354 +#define BCE_FW_EVT_CODE_SW_TIMER_EXPIRE_EVENT 0x00000000 +#define BCE_FW_EVT_CODE_LINK_EVENT 0x00000001 + +#define BCE_DRV_ACK_CAP_MB 0x00000364 +#define BCE_DRV_ACK_CAP_SIGNATURE_MAGIC 0x35450000 + +#define BCE_FW_CAP_MB 0x00000368 +#define BCE_FW_CAP_SIGNATURE_MAGIC 0xaa550000 +#define BCE_FW_ACK_SIGNATURE_MAGIC 0x52500000 +#define BCE_FW_CAP_SIGNATURE_MAGIC_MASK 0xffff0000 +#define BCE_FW_CAP_REMOTE_PHY_CAP 0x00000001 +#define BCE_FW_CAP_REMOTE_PHY_PRESENT 0x00000002 +#define BCE_FW_CAP_MFW_KEEP_VLAN 0x00000008 +#define BCE_FW_CAP_BC_KEEP_VLAN 0x00000010 + +#define BCE_RPHY_SERDES_LINK 0x00000374 + +#define BCE_RPHY_COPPER_LINK 0x00000378 + #define HOST_VIEW_SHMEM_BASE 0x167c00 /* @@ -6454,6 +6491,8 @@ struct bce_softc #define BCE_PHY_INT_MODE_AUTO_POLLING_FLAG 0x00000100 #define BCE_PHY_INT_MODE_LINK_READY_FLAG 0x00000200 #define BCE_PHY_IEEE_CLAUSE_45_FLAG 0x00000400 +#define BCE_PHY_REMOTE_CAP_FLAG 0x00000800 +#define BCE_PHY_REMOTE_PORT_FIBER_FLAG 0x00001000 /* Values that need to be shared with the PHY driver. */ u32 bce_shared_hw_cfg; From owner-svn-src-all@FreeBSD.ORG Wed May 23 02:12:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D29A106564A; Wed, 23 May 2012 02:12:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E984F8FC17; Wed, 23 May 2012 02:12: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 q4N2C0jl042276; Wed, 23 May 2012 02:12:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4N2C0dI042273; Wed, 23 May 2012 02:12:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201205230212.q4N2C0dI042273@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 23 May 2012 02:12:00 +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: r235819 - stable/8/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 02:12:01 -0000 Author: yongari Date: Wed May 23 02:12:00 2012 New Revision: 235819 URL: http://svn.freebsd.org/changeset/base/235819 Log: MFC r235151: Implement basic remote PHY support. Remote PHY allows the controller to perform MDIO type accesses to a remote transceiver using message pages defined through MRBE(multirate backplane ethernet). It's used in blade systems(e.g Dell Blade m610) which are connected to pass-through blades rather than traditional switches. This change directly manipulates firmware's mailboxes to control remote PHY such that it does not use mii(4). Alternatively, as David said, it could be implemented in brgphy(4) by creating a fake PHY and let brgphy(4) do necessary mii accesses and bce(4) can implement mailbox accesses based on the type of brgphy(4)'s mii accesses. Personally, I think it would make brgphy(4) hard to maintain since it would have to access many bce(4) registers in brgphy(4). Given that there are users who are suffering from lack of remote PHY support, it would be better to get working system rather than waiting for complete/perfect implementation. Modified: stable/8/sys/dev/bce/if_bce.c stable/8/sys/dev/bce/if_bcereg.h 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) Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Wed May 23 02:02:29 2012 (r235818) +++ stable/8/sys/dev/bce/if_bce.c Wed May 23 02:12:00 2012 (r235819) @@ -364,6 +364,7 @@ static int bce_nvram_write (struct bce static void bce_get_rx_buffer_sizes(struct bce_softc *, int); static void bce_get_media (struct bce_softc *); static void bce_init_media (struct bce_softc *); +static u32 bce_get_rphy_link (struct bce_softc *); static void bce_dma_map_addr (void *, bus_dma_segment_t *, int, int); static int bce_dma_alloc (device_t); static void bce_dma_free (struct bce_softc *); @@ -372,6 +373,7 @@ static void bce_release_resources (struc /****************************************************************************/ /* BCE Firmware Synchronization and Load */ /****************************************************************************/ +static void bce_fw_cap_init (struct bce_softc *); static int bce_fw_sync (struct bce_softc *, u32); static void bce_load_rv2p_fw (struct bce_softc *, u32 *, u32, u32); static void bce_load_cpu_fw (struct bce_softc *, @@ -418,6 +420,7 @@ static void bce_watchdog (struct bce_s static int bce_ifmedia_upd (struct ifnet *); static int bce_ifmedia_upd_locked (struct ifnet *); static void bce_ifmedia_sts (struct ifnet *, struct ifmediareq *); +static void bce_ifmedia_sts_rphy (struct bce_softc *, struct ifmediareq *); static void bce_init_locked (struct bce_softc *); static void bce_init (void *); static void bce_mgmt_init_locked (struct bce_softc *sc); @@ -757,6 +760,13 @@ bce_print_adapter_info(struct bce_softc printf("2.5G"); i++; } + if (sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) { + if (i > 0) printf("|"); + printf("Remote PHY(%s)", + sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG ? + "FIBER" : "TP"); i++; + } + if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { if (i > 0) printf("|"); printf("MFW); MFW (%s)\n", sc->bce_mfw_ver); @@ -1297,6 +1307,9 @@ bce_attach(device_t dev) if (val & BCE_PCICFG_MISC_STATUS_32BIT_DET) sc->bce_flags |= BCE_PCI_32BIT_FLAG; + /* Find the media type for the adapter. */ + bce_get_media(sc); + /* Reset controller and announce to bootcode that driver is present. */ if (bce_reset(sc, BCE_DRV_MSG_CODE_RESET)) { BCE_PRINTF("%s(%d): Controller reset failed!\n", @@ -1344,9 +1357,6 @@ bce_attach(device_t dev) /* Update statistics once every second. */ sc->bce_stats_ticks = 1000000 & 0xffff00; - /* Find the media type for the adapter. */ - bce_get_media(sc); - /* Store data needed by PHY driver for backplane applications */ sc->bce_shared_hw_cfg = bce_shmem_rd(sc, BCE_SHARED_HW_CFG_CONFIG); sc->bce_port_hw_cfg = bce_shmem_rd(sc, BCE_PORT_HW_CFG_CONFIG); @@ -1386,6 +1396,15 @@ bce_attach(device_t dev) ifp->if_capabilities = BCE_IF_CAPABILITIES; } +#if __FreeBSD_version >= 800505 + /* + * Introducing IFCAP_LINKSTATE didn't bump __FreeBSD_version + * so it's approximate value. + */ + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + ifp->if_capabilities |= IFCAP_LINKSTATE; +#endif + ifp->if_capenable = ifp->if_capabilities; /* @@ -1409,14 +1428,52 @@ bce_attach(device_t dev) /* Handle any special PHY initialization for SerDes PHYs. */ bce_init_media(sc); - /* MII child bus by attaching the PHY. */ - rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, - bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, - MII_OFFSET_ANY, MIIF_DOPAUSE | MIIF_FORCEPAUSE); - if (rc != 0) { - BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, - __LINE__); - goto bce_attach_fail; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + ifmedia_init(&sc->bce_ifmedia, IFM_IMASK, bce_ifmedia_upd, + bce_ifmedia_sts); + /* + * We can't manually override remote PHY's link and assume + * PHY port configuration(Fiber or TP) is not changed after + * device attach. This may not be correct though. + */ + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) != 0) { + if (sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) { + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_2500_SX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_2500_SX | IFM_FDX, 0, NULL); + } + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_SX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_SX | IFM_FDX, 0, NULL); + } else { + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_10_T, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_100_TX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_T, 0, NULL); + ifmedia_add(&sc->bce_ifmedia, + IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); + } + ifmedia_add(&sc->bce_ifmedia, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(&sc->bce_ifmedia, IFM_ETHER | IFM_AUTO); + sc->bce_ifmedia.ifm_media = sc->bce_ifmedia.ifm_cur->ifm_media; + } else { + /* MII child bus by attaching the PHY. */ + rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, + bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, + MII_OFFSET_ANY, MIIF_DOPAUSE | MIIF_FORCEPAUSE); + if (rc != 0) { + BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, + __LINE__); + goto bce_attach_fail; + } } /* Attach to the Ethernet interface list. */ @@ -1521,8 +1578,12 @@ bce_detach(device_t dev) ether_ifdetach(ifp); /* If we have a child device on the MII bus remove it too. */ - bus_generic_detach(dev); - device_delete_child(dev, sc->bce_miibus); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + ifmedia_removeall(&sc->bce_ifmedia); + else { + bus_generic_detach(dev); + device_delete_child(dev, sc->bce_miibus); + } /* Release all remaining resources. */ bce_release_resources(sc); @@ -1983,13 +2044,23 @@ bce_miibus_statchg(device_t dev) { struct bce_softc *sc; struct mii_data *mii; - int val; + struct ifmediareq ifmr; + int media_active, media_status, val; sc = device_get_softc(dev); DBENTER(BCE_VERBOSE_PHY); - mii = device_get_softc(sc->bce_miibus); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + bzero(&ifmr, sizeof(ifmr)); + bce_ifmedia_sts_rphy(sc, &ifmr); + media_active = ifmr.ifm_active; + media_status = ifmr.ifm_status; + } else { + mii = device_get_softc(sc->bce_miibus); + media_active = mii->mii_media_active; + media_status = mii->mii_media_status; + } val = REG_RD(sc, BCE_EMAC_MODE); val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX | @@ -1997,7 +2068,7 @@ bce_miibus_statchg(device_t dev) BCE_EMAC_MODE_25G); /* Set MII or GMII interface based on the PHY speed. */ - switch (IFM_SUBTYPE(mii->mii_media_active)) { + switch (IFM_SUBTYPE(media_active)) { case IFM_10_T: if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { DBPRINT(sc, BCE_INFO_PHY, @@ -2026,7 +2097,7 @@ bce_miibus_statchg(device_t dev) } /* Set half or full duplex based on PHY settings. */ - if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) { + if ((IFM_OPTIONS(media_active) & IFM_FDX) == 0) { DBPRINT(sc, BCE_INFO_PHY, "Setting Half-Duplex interface.\n"); val |= BCE_EMAC_MODE_HALF_DUPLEX; @@ -2036,7 +2107,7 @@ bce_miibus_statchg(device_t dev) REG_WR(sc, BCE_EMAC_MODE, val); - if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { + if ((IFM_OPTIONS(media_active) & IFM_ETH_RXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling RX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); @@ -2046,7 +2117,7 @@ bce_miibus_statchg(device_t dev) BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); } - if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { + if ((IFM_OPTIONS(media_active) & IFM_ETH_TXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling TX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); @@ -3130,7 +3201,8 @@ bce_get_media_exit: static void bce_init_media(struct bce_softc *sc) { - if ((sc->bce_phy_flags & BCE_PHY_IEEE_CLAUSE_45_FLAG) != 0) { + if ((sc->bce_phy_flags & (BCE_PHY_IEEE_CLAUSE_45_FLAG | + BCE_PHY_REMOTE_CAP_FLAG)) == BCE_PHY_IEEE_CLAUSE_45_FLAG) { /* * Configure 5709S/5716S PHYs to use traditional IEEE * Clause 22 method. Otherwise we have no way to attach @@ -5018,6 +5090,8 @@ bce_reset(struct bce_softc *sc, u32 rese if (rc) BCE_PRINTF("%s(%d): Firmware did not complete " "initialization!\n", __FILE__, __LINE__); + /* Get firmware capabilities. */ + bce_fw_cap_init(sc); bce_reset_exit: DBEXIT(BCE_VERBOSE_RESET); @@ -6081,6 +6155,55 @@ bce_free_pg_chain(struct bce_softc *sc) } +static u32 +bce_get_rphy_link(struct bce_softc *sc) +{ + u32 advertise, link; + int fdpx; + + advertise = 0; + fdpx = 0; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) != 0) + link = bce_shmem_rd(sc, BCE_RPHY_SERDES_LINK); + else + link = bce_shmem_rd(sc, BCE_RPHY_COPPER_LINK); + if (link & BCE_NETLINK_ANEG_ENB) + advertise |= BCE_NETLINK_ANEG_ENB; + if (link & BCE_NETLINK_SPEED_10HALF) + advertise |= BCE_NETLINK_SPEED_10HALF; + if (link & BCE_NETLINK_SPEED_10FULL) { + advertise |= BCE_NETLINK_SPEED_10FULL; + fdpx++; + } + if (link & BCE_NETLINK_SPEED_100HALF) + advertise |= BCE_NETLINK_SPEED_100HALF; + if (link & BCE_NETLINK_SPEED_100FULL) { + advertise |= BCE_NETLINK_SPEED_100FULL; + fdpx++; + } + if (link & BCE_NETLINK_SPEED_1000HALF) + advertise |= BCE_NETLINK_SPEED_1000HALF; + if (link & BCE_NETLINK_SPEED_1000FULL) { + advertise |= BCE_NETLINK_SPEED_1000FULL; + fdpx++; + } + if (link & BCE_NETLINK_SPEED_2500HALF) + advertise |= BCE_NETLINK_SPEED_2500HALF; + if (link & BCE_NETLINK_SPEED_2500FULL) { + advertise |= BCE_NETLINK_SPEED_2500FULL; + fdpx++; + } + if (fdpx) + advertise |= BCE_NETLINK_FC_PAUSE_SYM | + BCE_NETLINK_FC_PAUSE_ASYM; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + advertise |= BCE_NETLINK_PHY_APP_REMOTE | + BCE_NETLINK_ETH_AT_WIRESPEED; + + return (advertise); +} + + /****************************************************************************/ /* Set media options. */ /* */ @@ -6116,21 +6239,110 @@ bce_ifmedia_upd_locked(struct ifnet *ifp struct bce_softc *sc = ifp->if_softc; struct mii_data *mii; struct mii_softc *miisc; - int error; + struct ifmedia *ifm; + u32 link; + int error, fdx; DBENTER(BCE_VERBOSE_PHY); error = 0; BCE_LOCK_ASSERT(sc); - mii = device_get_softc(sc->bce_miibus); + sc->bce_link_up = FALSE; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + ifm = &sc->bce_ifmedia; + if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) + return (EINVAL); + link = 0; + fdx = IFM_OPTIONS(ifm->ifm_media) & IFM_FDX; + switch(IFM_SUBTYPE(ifm->ifm_media)) { + case IFM_AUTO: + /* + * Check advertised link of remote PHY by reading + * BCE_RPHY_SERDES_LINK or BCE_RPHY_COPPER_LINK. + * Always use the same link type of remote PHY. + */ + link = bce_get_rphy_link(sc); + break; + case IFM_2500_SX: + if ((sc->bce_phy_flags & + (BCE_PHY_REMOTE_PORT_FIBER_FLAG | + BCE_PHY_2_5G_CAPABLE_FLAG)) == 0) + return (EINVAL); + /* + * XXX + * Have to enable forced 2.5Gbps configuration. + */ + if (fdx != 0) + link |= BCE_NETLINK_SPEED_2500FULL; + else + link |= BCE_NETLINK_SPEED_2500HALF; + break; + case IFM_1000_SX: + if ((sc->bce_phy_flags & + BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + return (EINVAL); + /* + * XXX + * Have to disable 2.5Gbps configuration. + */ + if (fdx != 0) + link = BCE_NETLINK_SPEED_1000FULL; + else + link = BCE_NETLINK_SPEED_1000HALF; + break; + case IFM_1000_T: + if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) + return (EINVAL); + if (fdx != 0) + link = BCE_NETLINK_SPEED_1000FULL; + else + link = BCE_NETLINK_SPEED_1000HALF; + break; + case IFM_100_TX: + if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) + return (EINVAL); + if (fdx != 0) + link = BCE_NETLINK_SPEED_100FULL; + else + link = BCE_NETLINK_SPEED_100HALF; + break; + case IFM_10_T: + if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) + return (EINVAL); + if (fdx != 0) + link = BCE_NETLINK_SPEED_10FULL; + else + link = BCE_NETLINK_SPEED_10HALF; + break; + default: + return (EINVAL); + } + if (IFM_SUBTYPE(ifm->ifm_media) != IFM_AUTO) { + /* + * XXX + * Advertise pause capability for full-duplex media. + */ + if (fdx != 0) + link |= BCE_NETLINK_FC_PAUSE_SYM | + BCE_NETLINK_FC_PAUSE_ASYM; + if ((sc->bce_phy_flags & + BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + link |= BCE_NETLINK_PHY_APP_REMOTE | + BCE_NETLINK_ETH_AT_WIRESPEED; + } - /* Make sure the MII bus has been enumerated. */ - if (mii) { - sc->bce_link_up = FALSE; - LIST_FOREACH(miisc, &mii->mii_phys, mii_list) - mii_phy_reset(miisc); - error = mii_mediachg(mii); + bce_shmem_wr(sc, BCE_MB_ARGS_0, link); + error = bce_fw_sync(sc, BCE_DRV_MSG_CODE_CMD_SET_LINK); + } else { + mii = device_get_softc(sc->bce_miibus); + + /* Make sure the MII bus has been enumerated. */ + if (mii) { + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + mii_phy_reset(miisc); + error = mii_mediachg(mii); + } } DBEXIT(BCE_VERBOSE_PHY); @@ -6138,6 +6350,85 @@ bce_ifmedia_upd_locked(struct ifnet *ifp } +static void +bce_ifmedia_sts_rphy(struct bce_softc *sc, struct ifmediareq *ifmr) +{ + struct ifnet *ifp; + u32 link; + + ifp = sc->bce_ifp; + BCE_LOCK_ASSERT(sc); + + ifmr->ifm_status = IFM_AVALID; + ifmr->ifm_active = IFM_ETHER; + link = bce_shmem_rd(sc, BCE_LINK_STATUS); + /* XXX Handle heart beat status? */ + if ((link & BCE_LINK_STATUS_LINK_UP) != 0) + ifmr->ifm_status |= IFM_ACTIVE; + else { + ifmr->ifm_active |= IFM_NONE; + ifp->if_baudrate = 0; + return; + } + switch (link & BCE_LINK_STATUS_SPEED_MASK) { + case BCE_LINK_STATUS_10HALF: + ifmr->ifm_active |= IFM_10_T | IFM_HDX; + ifp->if_baudrate = IF_Mbps(10UL); + break; + case BCE_LINK_STATUS_10FULL: + ifmr->ifm_active |= IFM_10_T | IFM_FDX; + ifp->if_baudrate = IF_Mbps(10UL); + break; + case BCE_LINK_STATUS_100HALF: + ifmr->ifm_active |= IFM_100_TX | IFM_HDX; + ifp->if_baudrate = IF_Mbps(100UL); + break; + case BCE_LINK_STATUS_100FULL: + ifmr->ifm_active |= IFM_100_TX | IFM_FDX; + ifp->if_baudrate = IF_Mbps(100UL); + break; + case BCE_LINK_STATUS_1000HALF: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + ifmr->ifm_active |= IFM_1000_T | IFM_HDX; + else + ifmr->ifm_active |= IFM_1000_SX | IFM_HDX; + ifp->if_baudrate = IF_Mbps(1000UL); + break; + case BCE_LINK_STATUS_1000FULL: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) + ifmr->ifm_active |= IFM_1000_T | IFM_FDX; + else + ifmr->ifm_active |= IFM_1000_SX | IFM_FDX; + ifp->if_baudrate = IF_Mbps(1000UL); + break; + case BCE_LINK_STATUS_2500HALF: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) { + ifmr->ifm_active |= IFM_NONE; + return; + } else + ifmr->ifm_active |= IFM_2500_SX | IFM_HDX; + ifp->if_baudrate = IF_Mbps(2500UL); + break; + case BCE_LINK_STATUS_2500FULL: + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) { + ifmr->ifm_active |= IFM_NONE; + return; + } else + ifmr->ifm_active |= IFM_2500_SX | IFM_FDX; + ifp->if_baudrate = IF_Mbps(2500UL); + break; + default: + ifmr->ifm_active |= IFM_NONE; + return; + } + + if ((link & BCE_LINK_STATUS_RX_FC_ENABLED) != 0) + ifmr->ifm_active |= IFM_ETH_RXPAUSE; + if ((link & BCE_LINK_STATUS_TX_FC_ENABLED) != 0) + ifmr->ifm_active |= IFM_ETH_TXPAUSE; +} + + /****************************************************************************/ /* Reports current media status. */ /* */ @@ -6158,11 +6449,15 @@ bce_ifmedia_sts(struct ifnet *ifp, struc BCE_UNLOCK(sc); return; } - mii = device_get_softc(sc->bce_miibus); - mii_pollstat(mii); - ifmr->ifm_active = mii->mii_media_active; - ifmr->ifm_status = mii->mii_media_status; + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + bce_ifmedia_sts_rphy(sc, ifmr); + else { + mii = device_get_softc(sc->bce_miibus); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + } BCE_UNLOCK(sc); @@ -6199,14 +6494,26 @@ bce_phy_intr(struct bce_softc *sc) STATUS_ATTN_BITS_LINK_STATE); DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now UP.\n", __FUNCTION__); - } - else { + } else { REG_WR(sc, BCE_PCICFG_STATUS_BIT_CLEAR_CMD, STATUS_ATTN_BITS_LINK_STATE); DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now DOWN.\n", __FUNCTION__); } + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + if (new_link_state) { + if (bootverbose) + if_printf(sc->bce_ifp, "link UP\n"); + if_link_state_change(sc->bce_ifp, + LINK_STATE_UP); + } else { + if (bootverbose) + if_printf(sc->bce_ifp, "link DOWN\n"); + if_link_state_change(sc->bce_ifp, + LINK_STATE_DOWN); + } + } /* * Assume link is down and allow * tick routine to update the state @@ -7495,10 +7802,14 @@ bce_ioctl(struct ifnet *ifp, u_long comm case SIOCGIFMEDIA: DBPRINT(sc, BCE_VERBOSE_MISC, "Received SIOCSIFMEDIA/SIOCGIFMEDIA\n"); - - mii = device_get_softc(sc->bce_miibus); - error = ifmedia_ioctl(ifp, ifr, - &mii->mii_media, command); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) + error = ifmedia_ioctl(ifp, ifr, &sc->bce_ifmedia, + command); + else { + mii = device_get_softc(sc->bce_miibus); + error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, + command); + } break; /* Set interface capability */ @@ -8163,6 +8474,7 @@ bce_tick(void *xsc) struct bce_softc *sc = xsc; struct mii_data *mii; struct ifnet *ifp; + struct ifmediareq ifmr; ifp = sc->bce_ifp; @@ -8193,21 +8505,32 @@ bce_tick(void *xsc) goto bce_tick_exit; /* Link is down. Check what the PHY's doing. */ - mii = device_get_softc(sc->bce_miibus); - mii_tick(mii); - - /* Check if the link has come up. */ - if ((mii->mii_media_status & IFM_ACTIVE) && - (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { - DBPRINT(sc, BCE_VERBOSE_MISC, - "%s(): Link up!\n", __FUNCTION__); - sc->bce_link_up = TRUE; - if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || - IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || - IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && - (bce_verbose || bootverbose)) - BCE_PRINTF("Gigabit link up!\n"); + if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { + bzero(&ifmr, sizeof(ifmr)); + bce_ifmedia_sts_rphy(sc, &ifmr); + if ((ifmr.ifm_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + sc->bce_link_up = TRUE; + bce_miibus_statchg(sc->bce_dev); + } + } else { + mii = device_get_softc(sc->bce_miibus); + mii_tick(mii); + /* Check if the link has come up. */ + if ((mii->mii_media_status & IFM_ACTIVE) && + (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { + DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Link up!\n", + __FUNCTION__); + sc->bce_link_up = TRUE; + if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || + IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || + IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && + (bce_verbose || bootverbose)) + BCE_PRINTF("Gigabit link up!\n"); + } + } + if (sc->bce_link_up == TRUE) { /* Now that link is up, handle any outstanding TX traffic. */ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Found " @@ -8221,6 +8544,36 @@ bce_tick_exit: return; } +static void +bce_fw_cap_init(struct bce_softc *sc) +{ + u32 ack, cap, link; + + ack = 0; + cap = bce_shmem_rd(sc, BCE_FW_CAP_MB); + if ((cap & BCE_FW_CAP_SIGNATURE_MAGIC_MASK) != + BCE_FW_CAP_SIGNATURE_MAGIC) + return; + if ((cap & (BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN)) == + (BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN)) + ack |= BCE_DRV_ACK_CAP_SIGNATURE_MAGIC | + BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN; + if ((sc->bce_phy_flags & BCE_PHY_SERDES_FLAG) != 0 && + (cap & BCE_FW_CAP_REMOTE_PHY_CAP) != 0) { + sc->bce_phy_flags &= ~BCE_PHY_REMOTE_PORT_FIBER_FLAG; + sc->bce_phy_flags |= BCE_PHY_REMOTE_CAP_FLAG; + link = bce_shmem_rd(sc, BCE_LINK_STATUS); + if ((link & BCE_LINK_STATUS_SERDES_LINK) != 0) + sc->bce_phy_flags |= BCE_PHY_REMOTE_PORT_FIBER_FLAG; + ack |= BCE_DRV_ACK_CAP_SIGNATURE_MAGIC | + BCE_FW_CAP_REMOTE_PHY_CAP; + } + + if (ack != 0) + bce_shmem_wr(sc, BCE_DRV_ACK_CAP_MB, ack); +} + + #ifdef BCE_DEBUG /****************************************************************************/ /* Allows the driver state to be dumped through the sysctl interface. */ Modified: stable/8/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/8/sys/dev/bce/if_bcereg.h Wed May 23 02:02:29 2012 (r235818) +++ stable/8/sys/dev/bce/if_bcereg.h Wed May 23 02:12:00 2012 (r235819) @@ -814,6 +814,23 @@ struct flash_spec { #define BCE_DRV_PULSE_SEQ_MASK 0x00007fff #define BCE_MB_ARGS_0 0x00000014 +#define BCE_NETLINK_SPEED_10HALF (1<<0) +#define BCE_NETLINK_SPEED_10FULL (1<<1) +#define BCE_NETLINK_SPEED_100HALF (1<<2) +#define BCE_NETLINK_SPEED_100FULL (1<<3) +#define BCE_NETLINK_SPEED_1000HALF (1<<4) +#define BCE_NETLINK_SPEED_1000FULL (1<<5) +#define BCE_NETLINK_SPEED_2500HALF (1<<6) +#define BCE_NETLINK_SPEED_2500FULL (1<<7) +#define BCE_NETLINK_SPEED_10GHALF (1<<8) +#define BCE_NETLINK_SPEED_10GFULL (1<<9) +#define BCE_NETLINK_ANEG_ENB (1<<10) +#define BCE_NETLINK_PHY_APP_REMOTE (1<<11) +#define BCE_NETLINK_FC_PAUSE_SYM (1<<12) +#define BCE_NETLINK_FC_PAUSE_ASYM (1<<13) +#define BCE_NETLINK_ETH_AT_WIRESPEED (1<<14) +#define BCE_NETLINK_PHY_RESET (1<<15) + #define BCE_MB_ARGS_1 0x00000018 /* Indicate to the firmware not to go into the @@ -1079,6 +1096,26 @@ struct flash_spec { #define BCE_BC_STATE_BC_DBG_CMD_LOOP_CNT_MASK 0xffff #define BCE_BC_STATE_BC_DBG_CMD_LOOP_INFINITE 0xffff +#define BCE_FW_EVT_CODE_MB 0x00000354 +#define BCE_FW_EVT_CODE_SW_TIMER_EXPIRE_EVENT 0x00000000 +#define BCE_FW_EVT_CODE_LINK_EVENT 0x00000001 + +#define BCE_DRV_ACK_CAP_MB 0x00000364 +#define BCE_DRV_ACK_CAP_SIGNATURE_MAGIC 0x35450000 + +#define BCE_FW_CAP_MB 0x00000368 +#define BCE_FW_CAP_SIGNATURE_MAGIC 0xaa550000 +#define BCE_FW_ACK_SIGNATURE_MAGIC 0x52500000 +#define BCE_FW_CAP_SIGNATURE_MAGIC_MASK 0xffff0000 +#define BCE_FW_CAP_REMOTE_PHY_CAP 0x00000001 +#define BCE_FW_CAP_REMOTE_PHY_PRESENT 0x00000002 +#define BCE_FW_CAP_MFW_KEEP_VLAN 0x00000008 +#define BCE_FW_CAP_BC_KEEP_VLAN 0x00000010 + +#define BCE_RPHY_SERDES_LINK 0x00000374 + +#define BCE_RPHY_COPPER_LINK 0x00000378 + #define HOST_VIEW_SHMEM_BASE 0x167c00 /* @@ -6454,6 +6491,8 @@ struct bce_softc #define BCE_PHY_INT_MODE_AUTO_POLLING_FLAG 0x00000100 #define BCE_PHY_INT_MODE_LINK_READY_FLAG 0x00000200 #define BCE_PHY_IEEE_CLAUSE_45_FLAG 0x00000400 +#define BCE_PHY_REMOTE_CAP_FLAG 0x00000800 +#define BCE_PHY_REMOTE_PORT_FIBER_FLAG 0x00001000 /* Values that need to be shared with the PHY driver. */ u32 bce_shared_hw_cfg; From owner-svn-src-all@FreeBSD.ORG Wed May 23 02:43:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF48F1065672; Wed, 23 May 2012 02:43:05 +0000 (UTC) (envelope-from bjk@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A89208FC0C; Wed, 23 May 2012 02:43:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4N2h5Zu030704; Wed, 23 May 2012 02:43:05 GMT (envelope-from bjk@freebsd.org) Received: from localhost (bjk@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) with ESMTP id q4N2h5jB030701; Wed, 23 May 2012 02:43:05 GMT (envelope-from bjk@freebsd.org) X-Authentication-Warning: freefall.freebsd.org: bjk owned process doing -bs Date: Wed, 23 May 2012 02:43:05 +0000 (UTC) From: Benjamin Kaduk To: John Baldwin In-Reply-To: <201205211127.34052.jhb@freebsd.org> Message-ID: References: <201205181001.q4IA1VED044374@svn.freebsd.org> <201205180941.48076.jhb@freebsd.org> <20120518152436.GA9116@reks> <201205211127.34052.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Gleb Kurtsou , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235601 - head/include/protocols X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 02:43:06 -0000 On Mon, 21 May 2012, John Baldwin wrote: > On Friday, May 18, 2012 11:24:36 am Gleb Kurtsou wrote: >> On (18/05/2012 09:41), John Baldwin wrote: >>> On Friday, May 18, 2012 6:01:31 am Gleb Kurtsou wrote: >>>> Author: gleb >>>> Date: Fri May 18 10:01:31 2012 >>>> New Revision: 235601 >>>> URL: http://svn.freebsd.org/changeset/base/235601 >>>> >>>> Log: >>>> Don't use ino_t in dumprestore protocol definition. >>>> >>>> Since ino_t size is about to change to 64-bits, replace ino_t used in >>>> dump protocol definition with 32-bit dump_ino_t to preserve backward >>>> compatibility. At some point, it may be necessary to use spare fields >>>> in struct in order to fully support 64-bit inode numbers. >>>> >>>> Sponsored by: Google Summer of Code 2011 >>> >>> A question about your stat changes: did you expand dev_t to 32 bits for > the >>> AFS folks, or did you leave it as 16 bits? >> >> dev_t is already 32-bit. Changing it to 64-bit was discussed at some >> point and from what I recall no decision was made: >> >> http://marc.info/?t=129119478700005&r=1&w=2 >> >> I'm going to commit preparatory changes only for now. Then publish diff >> for testing. We can still change dev_t to 64-bit if needed. Although I >> didn't work on it. > > Ah, it was 64-bit they asked for. If it is easy to do so, I'd favor changing > it since you've already done all the hard work of rolling a new stat > structure. I'd rather err on wasting 32-bits for dev_t than having to do all > this over again. Hi John, Thanks for remembering this -- I'm still pretty swamped with other stuff and missed it. It would indeed be nice for us to have a 64-bit dev_t to work with. -Ben From owner-svn-src-all@FreeBSD.ORG Wed May 23 02:43:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0634410657F5; Wed, 23 May 2012 02:43:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA4068FC19; Wed, 23 May 2012 02:43: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 q4N2hS0R043641; Wed, 23 May 2012 02:43:28 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4N2hSnb043638; Wed, 23 May 2012 02:43:28 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201205230243.q4N2hSnb043638@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 23 May 2012 02:43: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: r235820 - stable/9/sys/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 02:43:29 -0000 Author: pfg Date: Wed May 23 02:43:28 2012 New Revision: 235820 URL: http://svn.freebsd.org/changeset/base/235820 Log: MFC: r235508 Fix a couple of issues that appear to be inherited from the old 8.x code: - If the lock cannot be acquired immediately unlocks 'bar' vnode and then locks both vnodes in order. - wrong vnode type panics from cache_enter_time after calls by ext2_lookup. The fix merges changes from ufs/ufs_lookup.c. Submitted by: Mateusz Guzik Approved by: jhb (mentor) Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c stable/9/sys/fs/ext2fs/ext2_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_lookup.c Wed May 23 02:12:00 2012 (r235819) +++ stable/9/sys/fs/ext2fs/ext2_lookup.c Wed May 23 02:43:28 2012 (r235820) @@ -115,6 +115,8 @@ static u_char dt_to_ext2_ft[] = { static int ext2_dirbadentry(struct vnode *dp, struct ext2fs_direct_2 *de, int entryoffsetinblock); +static int ext2_lookup_ino(struct vnode *vdp, struct vnode **vpp, + struct componentname *cnp, ino_t *dd_ino); /* * Vnode op for reading directories. @@ -285,7 +287,14 @@ ext2_lookup(ap) struct componentname *a_cnp; } */ *ap; { - struct vnode *vdp; /* vnode for directory being searched */ + + return (ext2_lookup_ino(ap->a_dvp, ap->a_vpp, ap->a_cnp, NULL)); +} + +static int +ext2_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp, + ino_t *dd_ino) +{ struct inode *dp; /* inode for directory being searched */ struct buf *bp; /* a buffer of directory entries */ struct ext2fs_direct_2 *ep; /* the current directory entry */ @@ -305,22 +314,22 @@ ext2_lookup(ap) doff_t enduseful; /* pointer past last used dir slot */ u_long bmask; /* block offset mask */ int namlen, error; - struct vnode **vpp = ap->a_vpp; - struct componentname *cnp = ap->a_cnp; struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - ino_t ino; + ino_t ino, ino1; int ltype; - int DIRBLKSIZ = VTOI(ap->a_dvp)->i_e2fs->e2fs_bsize; + int DIRBLKSIZ = VTOI(vdp)->i_e2fs->e2fs_bsize; + + if (vpp != NULL) + *vpp = NULL; - bp = NULL; - slotoffset = -1; - *vpp = NULL; - vdp = ap->a_dvp; dp = VTOI(vdp); bmask = VFSTOEXT2(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; +restart: + bp = NULL; + slotoffset = -1; /* * We now have a segment name to search for, and a directory to search. @@ -536,10 +545,12 @@ searchloop: * Insert name into cache (as non-existent) if appropriate. */ if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) - cache_enter(vdp, *vpp, cnp); + cache_enter(vdp, NULL, cnp); return (ENOENT); found: + if (dd_ino != NULL) + *dd_ino = ino; if (numdirpasses == 2) nchstats.ncs_pass2++; /* @@ -582,6 +593,8 @@ found: dp->i_count = 0; else dp->i_count = dp->i_offset - prevoff; + if (dd_ino != NULL) + return (0); if (dp->i_number == ino) { VREF(vdp); *vpp = vdp; @@ -622,6 +635,8 @@ found: */ if (dp->i_number == ino) return (EISDIR); + if (dd_ino != NULL) + return (0); if ((error = VFS_VGET(vdp->v_mount, ino, LK_EXCLUSIVE, &tdp)) != 0) return (error); @@ -629,6 +644,8 @@ found: cnp->cn_flags |= SAVENAME; return (0); } + if (dd_ino != NULL) + return (0); /* * Step through the translation in the name. We do not `vput' the @@ -655,8 +672,27 @@ found: VOP_UNLOCK(pdp, 0); /* race to get the inode */ error = VFS_VGET(vdp->v_mount, ino, cnp->cn_lkflags, &tdp); vn_lock(pdp, ltype | LK_RETRY); - if (error != 0) + if (pdp->v_iflag & VI_DOOMED) { + if (error == 0) + vput(tdp); + error = ENOENT; + } + if (error) return (error); + /* + * Recheck that ".." entry in the vdp directory points + * to the inode we looked up before vdp lock was + * dropped. + */ + error = ext2_lookup_ino(pdp, NULL, cnp, &ino1); + if (error) { + vput(tdp); + return (error); + } + if (ino1 != ino) { + vput(tdp); + goto restart; + } *vpp = tdp; } else if (dp->i_number == ino) { VREF(vdp); /* we want ourself, ie "." */ Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vnops.c Wed May 23 02:12:00 2012 (r235819) +++ stable/9/sys/fs/ext2fs/ext2_vnops.c Wed May 23 02:43:28 2012 (r235820) @@ -1342,7 +1342,11 @@ ext2_rmdir(ap) error = ext2_truncate(vp, (off_t)0, IO_SYNC, cnp->cn_cred, cnp->cn_thread); cache_purge(ITOV(ip)); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); + if (vn_lock(dvp, LK_EXCLUSIVE | LK_NOWAIT) != 0) { + VOP_UNLOCK(vp, 0); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + } out: return (error); } From owner-svn-src-all@FreeBSD.ORG Wed May 23 03:35:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97A3A106564A; Wed, 23 May 2012 03:35:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82C668FC16; Wed, 23 May 2012 03:35: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 q4N3Z964046120; Wed, 23 May 2012 03:35:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4N3Z9Eo046118; Wed, 23 May 2012 03:35:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201205230335.q4N3Z9Eo046118@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 23 May 2012 03:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235821 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 03:35:09 -0000 Author: yongari Date: Wed May 23 03:35:08 2012 New Revision: 235821 URL: http://svn.freebsd.org/changeset/base/235821 Log: Don't force max payload size to 128. Root complex and Endpoint will negotiate with each other on the TLP payload size so blindly forcing the size to 128 can cause a completion error which in turn will stop device. Reported by: Geans Pin < geanspin <> broadcom dot com > MFC after: 5 days Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed May 23 02:43:28 2012 (r235820) +++ head/sys/dev/bge/if_bge.c Wed May 23 03:35:08 2012 (r235821) @@ -3638,8 +3638,6 @@ bge_reset(struct bge_softc *sc) /* Clear enable no snoop and disable relaxed ordering. */ devctl &= ~(PCIM_EXP_CTL_RELAXED_ORD_ENABLE | PCIM_EXP_CTL_NOSNOOP_ENABLE); - /* Set PCIE max payload size to 128. */ - devctl &= ~PCIM_EXP_CTL_MAX_PAYLOAD; pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, devctl, 2); /* Clear error status. */ From owner-svn-src-all@FreeBSD.ORG Wed May 23 06:41:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FF031065670; Wed, 23 May 2012 06:41:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id 14A6E8FC0C; Wed, 23 May 2012 06:41:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [192.168.1.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id 2A545A7071; Wed, 23 May 2012 08:41:33 +0200 (CEST) Message-ID: <4FBC86B3.8020105@FreeBSD.org> Date: Wed, 23 May 2012 08:41:55 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120512 Thunderbird/13.0 MIME-Version: 1.0 To: mdf@FreeBSD.org References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> In-Reply-To: X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" , Bruce Evans Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 06:41:55 -0000 On 2012-05-22 23:07, mdf@FreeBSD.org wrote: ... > We run with the following at Isilon, which is somewhat bogus because > it allows a bit of sloppiness in types, but is also terribly > convenient since it means no casting on printf arguments is needed: Please don't. If you want to write portable code, use the (admittedly horrible) PRId64 macros instead. From owner-svn-src-all@FreeBSD.ORG Wed May 23 06:49:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5250F1065670; Wed, 23 May 2012 06:49:51 +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 3240B8FC0A; Wed, 23 May 2012 06:49: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 q4N6npOK053891; Wed, 23 May 2012 06:49:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4N6nofV053886; Wed, 23 May 2012 06:49:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205230649.q4N6nofV053886@svn.freebsd.org> From: Xin LI Date: Wed, 23 May 2012 06:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235822 - in head: sys/dev/esp sys/gnu/fs/xfs/FreeBSD usr.sbin/ppp usr.sbin/rpc.lockd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 06:49:51 -0000 Author: delphij Date: Wed May 23 06:49:50 2012 New Revision: 235822 URL: http://svn.freebsd.org/changeset/base/235822 Log: Fix build: - Use %ll instead of %q for explicit long long casts; - Use %j instead of %q in XFS and cast to intmax_t. Tested with: make universe Modified: head/sys/dev/esp/ncr53c9x.c head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c head/usr.sbin/ppp/throughput.c head/usr.sbin/rpc.lockd/kern.c Modified: head/sys/dev/esp/ncr53c9x.c ============================================================================== --- head/sys/dev/esp/ncr53c9x.c Wed May 23 03:35:08 2012 (r235821) +++ head/sys/dev/esp/ncr53c9x.c Wed May 23 06:49:50 2012 (r235822) @@ -1504,7 +1504,7 @@ ncr53c9x_dequeue(struct ncr53c9x_softc * li = TINFO_LUN(ti, lun); #ifdef DIAGNOSTIC if (li == NULL || li->lun != lun) - panic("%s: lun %qx for ecb %p does not exist", __func__, + panic("%s: lun %llx for ecb %p does not exist", __func__, (long long)lun, ecb); #endif if (li->untagged == ecb) { @@ -1515,7 +1515,7 @@ ncr53c9x_dequeue(struct ncr53c9x_softc * #ifdef DIAGNOSTIC if (li->queued[ecb->tag[1]] != NULL && (li->queued[ecb->tag[1]] != ecb)) - panic("%s: slot %d for lun %qx has %p instead of ecb " + panic("%s: slot %d for lun %llx has %p instead of ecb " "%p", __func__, ecb->tag[1], (long long)lun, li->queued[ecb->tag[1]], ecb); #endif Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c Wed May 23 03:35:08 2012 (r235821) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c Wed May 23 06:49:50 2012 (r235822) @@ -50,8 +50,8 @@ xfs_buf_read_flags(xfs_buftarg_t *target KASSERT((target != NULL), ("got NULL buftarg_t")); if (bread(target->specvp, blkno, BBTOB(len), NOCRED, &bp)) { - printf("bread failed specvp %p blkno %qd BBTOB(len) %ld\n", - target->specvp, blkno, (long)BBTOB(len)); + printf("bread failed specvp %p blkno %jd BBTOB(len) %ld\n", + target->specvp, (intmax_t)blkno, (long)BBTOB(len)); bp = NULL; } Modified: head/usr.sbin/ppp/throughput.c ============================================================================== --- head/usr.sbin/ppp/throughput.c Wed May 23 03:35:08 2012 (r235821) +++ head/usr.sbin/ppp/throughput.c Wed May 23 06:49:50 2012 (r235822) @@ -115,14 +115,14 @@ throughput_disp(struct pppThroughput *t, prompt_Printf(prompt, "%llu packets in, %llu packets out\n", t->PacketsIn, t->PacketsOut); if (t->rolling) { - prompt_Printf(prompt, " overall %6qu bytes/sec\n", + prompt_Printf(prompt, " overall %6llu bytes/sec\n", (t->OctetsIn + t->OctetsOut) / divisor); - prompt_Printf(prompt, " %s %6qu bytes/sec in, %6qu bytes/sec out " + prompt_Printf(prompt, " %s %6llu bytes/sec in, %6llu bytes/sec out " "(over the last %d secs)\n", t->downtime ? "average " : "currently", t->in.OctetsPerSecond, t->out.OctetsPerSecond, secs_up > t->SamplePeriod ? t->SamplePeriod : secs_up); - prompt_Printf(prompt, " peak %6qu bytes/sec on %s", + prompt_Printf(prompt, " peak %6llu bytes/sec on %s", t->BestOctetsPerSecond, ctime(&t->BestOctetsPerSecondTime)); } else prompt_Printf(prompt, "Overall %llu bytes/sec\n", @@ -266,7 +266,7 @@ throughput_clear(struct pppThroughput *t if ((divisor = throughput_uptime(t)) == 0) divisor = 1; - prompt_Printf(prompt, "overall cleared (was %6qu bytes/sec)\n", + prompt_Printf(prompt, "overall cleared (was %6llu bytes/sec)\n", (t->OctetsIn + t->OctetsOut) / divisor); t->OctetsIn = t->OctetsOut = t->PacketsIn = t->PacketsOut = 0; t->downtime = 0; @@ -274,8 +274,8 @@ throughput_clear(struct pppThroughput *t } if (clear_type & THROUGHPUT_CURRENT) { - prompt_Printf(prompt, "current cleared (was %6qu bytes/sec in," - " %6qu bytes/sec out)\n", + prompt_Printf(prompt, "current cleared (was %6llu bytes/sec in," + " %6llu bytes/sec out)\n", t->in.OctetsPerSecond, t->out.OctetsPerSecond); t->in.OctetsPerSecond = t->out.OctetsPerSecond = 0; } @@ -287,7 +287,7 @@ throughput_clear(struct pppThroughput *t last = time_buf + strlen(time_buf); if (last > time_buf && *--last == '\n') *last = '\0'; - prompt_Printf(prompt, "peak cleared (was %6qu bytes/sec on %s)\n", + prompt_Printf(prompt, "peak cleared (was %6llu bytes/sec on %s)\n", t->BestOctetsPerSecond, time_buf); t->BestOctetsPerSecond = 0; time(&t->BestOctetsPerSecondTime); Modified: head/usr.sbin/rpc.lockd/kern.c ============================================================================== --- head/usr.sbin/rpc.lockd/kern.c Wed May 23 03:35:08 2012 (r235821) +++ head/usr.sbin/rpc.lockd/kern.c Wed May 23 06:49:50 2012 (r235822) @@ -595,7 +595,7 @@ show(LOCKD_MSG *mp) syslog(LOG_DEBUG, "fh_len %d, fh %s\n", (int)mp->lm_fh_len, buf); /* Show flock structure. */ - syslog(LOG_DEBUG, "start %qu; len %qu; pid %lu; type %d; whence %d\n", + syslog(LOG_DEBUG, "start %llu; len %llu; pid %lu; type %d; whence %d\n", (unsigned long long)mp->lm_fl.l_start, (unsigned long long)mp->lm_fl.l_len, (u_long)mp->lm_fl.l_pid, mp->lm_fl.l_type, mp->lm_fl.l_whence); From owner-svn-src-all@FreeBSD.ORG Wed May 23 07:01:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECCF51065673; Wed, 23 May 2012 07:01:36 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 98A4E8FC0C; Wed, 23 May 2012 07:01:36 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so10219700pbb.13 for ; Wed, 23 May 2012 00:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=z57VCxhiYQtj+iHUqRva0J2wXgOSNtJYPSTKU+XqeBY=; b=aRfGmKC+3cPrV65lRJkCaiZC5ZpBdzWLETrOwiQZPIn0X0zBLRzuEEMuZ71haqLeKw 0VLKbShNsf28lcjq7wupvpxXva8zDav4kQkZ8cAFuoYBg4lip0uzdSCIOY+gM90xO2Y0 eVzOPzOHFs6totqZST7JKZbMEYaH7ak6emJb8ejswzTHgmYs4RM4Bfzu2ifJ87WvwCDt d6KvhrkXQur8yboYhd34gZXGULlNDEhDoZVFJfelOQSuLXQlqRGdPwwAWkMdFHrLTTWl b2YeBhSfs3UPl/Wx9KtgcLaU5RcZx/XI2+PS+nSeXAmyXp44TffshZjMmX3mLFODqnGm 7PKw== Received: by 10.68.197.166 with SMTP id iv6mr7658240pbc.40.1337756496391; Wed, 23 May 2012 00:01:36 -0700 (PDT) Received: from [10.65.51.135] (mobile-166-147-092-070.mycingular.net. [166.147.92.70]) by mx.google.com with ESMTPS id px4sm873141pbb.53.2012.05.23.00.01.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 May 2012 00:01:35 -0700 (PDT) References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> <4FBC86B3.8020105@FreeBSD.org> In-Reply-To: <4FBC86B3.8020105@FreeBSD.org> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: X-Mailer: iPhone Mail (9B206) From: Garrett Cooper Date: Wed, 23 May 2012 00:01:29 -0700 To: Dimitry Andric Cc: "mdf@FreeBSD.org" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "David E. O'Brien" , BruceEvans , "svn-src-head@freebsd.org" Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 07:01:37 -0000 On May 22, 2012, at 11:41 PM, Dimitry Andric wrote: > On 2012-05-22 23:07, mdf@FreeBSD.org wrote: > ... >> We run with the following at Isilon, which is somewhat bogus because >> it allows a bit of sloppiness in types, but is also terribly >> convenient since it means no casting on printf arguments is needed: >=20 > Please don't. If you want to write portable code, use the (admittedly > horrible) PRId64 macros instead. Agreed, because the patch attached earlier disguises issues with signedness (= for one) and I've seen some interesting bugs creep in because of issues like= that, an it's painful cleaning up those problems later on (esp. considering= that clang will replace gcc not too far down the line)... Thanks, -Garrett= From owner-svn-src-all@FreeBSD.ORG Wed May 23 09:03:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 021DA1065672; Wed, 23 May 2012 09:03:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx09.syd.optusnet.com.au (fallbackmx09.syd.optusnet.com.au [211.29.132.242]) by mx1.freebsd.org (Postfix) with ESMTP id 86F048FC08; Wed, 23 May 2012 09:03:11 +0000 (UTC) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by fallbackmx09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4N8vYSf004054; Wed, 23 May 2012 18:57:34 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4N8vPc1017913 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 May 2012 18:57:26 +1000 Date: Wed, 23 May 2012 18:57:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: gnn@freebsd.org In-Reply-To: <861umcx7oe.wl%gnn@neville-neil.com> Message-ID: <20120523173439.I902@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> <861umcx7oe.wl%gnn@neville-neil.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" , Bruce Evans Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 09:03:12 -0000 On Tue, 22 May 2012 gnn@freebsd.org wrote: > At Wed, 23 May 2012 06:05:06 +1000 (EST), > Bruce Evans wrote: >> [... excessive quoting deleted] > >> Now I prefer the old way, after fixing the bugs found by switching. >> It finds more bugs under FreeBSD, and is bug for bug compatible with >> distribution gcc and probably with other system's headers under >> !FreeBSD. Except under FreeBSD, I prefer %q to be an error. The above >> shows it only being used 12 times in /sys, with most uses of it being >> bugs. Fixing these bugs would leave about 1 correct use of it -- for >> printing the quad_t in unreachable code in msdosfs. This use would be >> easy to avoid too (just cast to uintmax_t). Uses in userland are >> hopefully east to fix and avoid too. In an old userland, there were >> only about 50, with most in netstat/inet6.c, tcopy.c, ftpd, fsirand, >> and contrib'ed code. Of course you can't make it an error for the >> contrib'ed code. > > Instead of replying to the original commit I'll just add to the chain. Please don't quote the whole thing, especially when not replying to any of it. > Note that this change broke buildworld: > > src/usr.sbin/ppp/throughput.c: In function 'throughput_disp': > src/usr.sbin/ppp/throughput.c:119: warning: format '%6qu' expects type 'long unsigned int', but argu > > And several more. Of course ppp has several style bugs and type mismatches, else its brokenness wouldn't have been exposed: - the variables have the bogus type "unsigned long long" - they are printed with the mismatched format "%6qu", although there is a perfectly bogus format "%6llu" that matches them exactly. Another point is that libc printf doesn't really support %q. It just maps %q to %ll and accesses the arg using va_arg(ap, long long). Thus it is technically correct in userland for the format checker to also map %q to %ll and disallow printing int64_t with each in the LP64 case. This is also bug for bug compatible with the gcc distribution and perhaps with other OS's. However the kernel printf is more careful. It doesn't map %q to %ll, and it accesses %q args using va_arg(ap, quad_t). Thus it is technically correct in the kernel for the format checker to also _not_ map %q to %ll and _allow_ printing int64_t with %q. However, %q should never be used. The history of the kernel printf shows that I objected to adding %q support to it in 1999, but not strongly enough to keep it out. I should have objected more to adding support for %ll. This was slightly before C99 came out. %j support was needed before then but was not added until 2002. I had prepared for killing long long and quad_t in the kernel by removing many uses of them. When the %q mistake was committed, there were just 90 instances of 'long long' in /sys. 61 of these were in the i386 FPU emulator. 20 were in other code that I didn't care about and/or was soon to go away: alpha: 6 (half wrong and/or easy to avoid) coda: 3 (all wrong and/or easy to avoid) svr4: 4 (all wrong and/or easy to avoid) vinum: 4 (all easy to avoid?) powerpc: 3 (cloned from wrong ones for alpha) The remaining 9 were: 3 that I was responsible for in i386 clock code and a copy for pc98 (to avoid overflow in multiplication) 2 that I was responsible for in i386 basic typedefs (only used for non-gcc) 1 that I was responsible for in sys/param.h (to avoid overflow in shift) 3 in ntp code (all wrong and easy to avoid. The code wanted precisely 64 bits and assumed that long long gave that. The type that gives 64 bits, int64_t, has been standard in FreeBSD since FreeBSD-2. It came from 4.4BSD-Lite1. While counting the above, I noticed that in the middle of 1999 just before the %q changes, there were about 700 references to int64_t (now counting ones in comments). Just 1 year earlier, there were only about 300. The count of long longs didn't change much in that time. For quad_t, the raw counts were 419 in the middle of 1998 and 441 in the middle of 1999. About half were in nfs (183) and libkern (64). Now /sys has and oldnfs has 58. For long long, the raw count is 1577. So, 13 years after C99 stdint.h made long long unnecessary and after mostly avoiding long long when it was only a gcc misfeature, the use of long long has exploded by a factor of about 1577/91 = 17 :-(. The use of int64_t has also exploded: its raw count is 66730 (!); it has exploded by a factor of about 66730/700 = 95. int32_t is only used 46715 times. I fear than many of the uses of fixed width types are wrong too. The fixed widths become part of both APIs and ABIs so they will be hard to change to support 128-bit things. off_t is only used 2223 times. It has the opposite problem that its API is perfect and supports it having any width, but you can't actually change its width easily since bugware will have assumptions that it is precisely 64 bits, just like old bugware assumed that it and long are precisely 32 bits, but multiplied by a bloat factor of 95 or so. intmax_t is only used 1090 times. It has the same expansion problems for ABIs that long used to have. Bruce From owner-svn-src-all@FreeBSD.ORG Wed May 23 09:10:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CF9A106564A; Wed, 23 May 2012 09:10:47 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 261E28FC15; Wed, 23 May 2012 09:10: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 q4N9AlUJ059668; Wed, 23 May 2012 09:10:47 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4N9Ak62059664; Wed, 23 May 2012 09:10:46 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201205230910.q4N9Ak62059664@svn.freebsd.org> From: David Chisnall Date: Wed, 23 May 2012 09:10:46 +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: r235825 - in stable/9/gnu/lib: libstdc++ libsupc++ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 09:10:47 -0000 Author: theraven Date: Wed May 23 09:10:46 2012 New Revision: 235825 URL: http://svn.freebsd.org/changeset/base/235825 Log: Merge r233749, building libsupc++ as a shared library and making libstdc++ a filter library. It should now be possible to build applications on 9-STABLE that link against both libc++ and libstdc++ and to test libcxxrt with libstdc++. If you wish to test libcxxrt, please add this to your /etc/libmap.conf: libsupc++.so.1 libcxxrt.so.1 If you wish to test libc++, add -std=libc++ to your compile and link flags for your favourite C++ applications and / or libraries. Added: stable/9/gnu/lib/libsupc++/Version.map - copied unchanged from r233749, head/gnu/lib/libsupc++/Version.map Modified: stable/9/gnu/lib/libstdc++/Makefile stable/9/gnu/lib/libsupc++/Makefile Directory Properties: stable/9/gnu/lib/libstdc++/ (props changed) stable/9/gnu/lib/libsupc++/ (props changed) Modified: stable/9/gnu/lib/libstdc++/Makefile ============================================================================== --- stable/9/gnu/lib/libstdc++/Makefile Wed May 23 07:50:23 2012 (r235824) +++ stable/9/gnu/lib/libstdc++/Makefile Wed May 23 09:10:46 2012 (r235825) @@ -25,7 +25,7 @@ CXXFLAGS+= -fno-implicit-templates -ffun PO_CXXFLAGS= ${CXXFLAGS:N-ffunction-sections} DPADD= ${LIBM} -LDADD= -lm +LDADD= -lm -Wl,-f,libsupc++.so.1 # libstdc++ sources SRCS+= bitmap_allocator.cc pool_allocator.cc \ Modified: stable/9/gnu/lib/libsupc++/Makefile ============================================================================== --- stable/9/gnu/lib/libsupc++/Makefile Wed May 23 07:50:23 2012 (r235824) +++ stable/9/gnu/lib/libsupc++/Makefile Wed May 23 09:10:46 2012 (r235825) @@ -7,8 +7,8 @@ SRCDIR= ${.CURDIR}/../../../contrib/libs .PATH: ${SRCDIR} ${GCCLIB}/libiberty -# Static only. LIB= supc++ +SHLIB_MAJOR=1 SRCS+= del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc eh_alloc.cc eh_arm.cc \ eh_aux_runtime.cc eh_call.cc eh_catch.cc eh_exception.cc eh_globals.cc \ eh_personality.cc eh_term_handler.cc eh_terminate.cc eh_throw.cc \ @@ -36,4 +36,9 @@ unwind.h: ${GCCDIR}/unwind-generic.h SRCS+= unwind.h CLEANFILES+= unwind.h +# Symbol versioning + +VERSION_MAP= ${.CURDIR}/Version.map + + .include Copied: stable/9/gnu/lib/libsupc++/Version.map (from r233749, head/gnu/lib/libsupc++/Version.map) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/gnu/lib/libsupc++/Version.map Wed May 23 09:10:46 2012 (r235825, copy of r233749, head/gnu/lib/libsupc++/Version.map) @@ -0,0 +1,137 @@ +## Linker script for GNU versioning (GNU ld 2.13.91+ only.) +## +## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 +## Free Software Foundation, Inc. +## +## This file is part of the GNU ISO C++ Library. This library is free +## software; you can redistribute it and/or modify it under the +## terms of the GNU General Public License as published by the +## Free Software Foundation; either version 2, or (at your option) +## any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License along +## with this library; see the file COPYING. If not, write to the Free +## Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +## USA. + +## $FreeBSD$ + + +# Symbols in the support library (libsupc++) have their own tag. +CXXABI_1.3 { + + global: + __cxa_allocate_exception; + __cxa_bad_cast; + __cxa_bad_typeid; + __cxa_begin_catch; + __cxa_begin_cleanup; + __cxa_call_unexpected; + __cxa_current_exception_type; + __cxa_demangle; + __cxa_end_catch; + __cxa_end_cleanup; + __cxa_free_exception; + __cxa_get_globals; + __cxa_get_globals_fast; + __cxa_guard_abort; + __cxa_guard_acquire; + __cxa_guard_release; + __cxa_pure_virtual; + __cxa_rethrow; + __cxa_throw; + __cxa_type_match; + __cxa_vec_cctor; + __cxa_vec_cleanup; + __cxa_vec_ctor; + __cxa_vec_delete2; + __cxa_vec_delete3; + __cxa_vec_delete; + __cxa_vec_dtor; + __cxa_vec_new2; + __cxa_vec_new3; + __cxa_vec_new; + __gxx_personality_v0; + __gxx_personality_sj0; + __dynamic_cast; + + # *_type_info classes, ctor and dtor + _ZN10__cxxabiv117__array_type_info*; + _ZN10__cxxabiv117__class_type_info*; + _ZN10__cxxabiv116__enum_type_info*; + _ZN10__cxxabiv120__function_type_info*; + _ZN10__cxxabiv123__fundamental_type_info*; + _ZN10__cxxabiv117__pbase_type_info*; + _ZN10__cxxabiv129__pointer_to_member_type_info*; + _ZN10__cxxabiv119__pointer_type_info*; + _ZN10__cxxabiv120__si_class_type_info*; + _ZN10__cxxabiv121__vmi_class_type_info*; + + # *_type_info classes, member functions + _ZNK10__cxxabiv117__class_type_info*; + _ZNK10__cxxabiv120__function_type_info*; + _ZNK10__cxxabiv117__pbase_type_info*; + _ZNK10__cxxabiv129__pointer_to_member_type_info*; + _ZNK10__cxxabiv119__pointer_type_info*; + _ZNK10__cxxabiv120__si_class_type_info*; + _ZNK10__cxxabiv121__vmi_class_type_info*; + + # virtual table + _ZTVN10__cxxabiv117__array_type_infoE; + _ZTVN10__cxxabiv117__class_type_infoE; + _ZTVN10__cxxabiv116__enum_type_infoE; + _ZTVN10__cxxabiv120__function_type_infoE; + _ZTVN10__cxxabiv123__fundamental_type_infoE; + _ZTVN10__cxxabiv117__pbase_type_infoE; + _ZTVN10__cxxabiv129__pointer_to_member_type_infoE; + _ZTVN10__cxxabiv119__pointer_type_infoE; + _ZTVN10__cxxabiv120__si_class_type_infoE; + _ZTVN10__cxxabiv121__vmi_class_type_infoE; + + # typeinfo structure (and some names) + _ZTI[a-fh-z]; + _ZTIP[a-fh-z]; + _ZTIPK[a-fh-z]; + _ZTIN10__cxxabiv117__array_type_infoE; + _ZTIN10__cxxabiv117__class_type_infoE; + _ZTIN10__cxxabiv116__enum_type_infoE; + _ZTIN10__cxxabiv120__function_type_infoE; + _ZTIN10__cxxabiv123__fundamental_type_infoE; + _ZTIN10__cxxabiv117__pbase_type_infoE; + _ZTIN10__cxxabiv129__pointer_to_member_type_infoE; + _ZTIN10__cxxabiv119__pointer_type_infoE; + _ZTIN10__cxxabiv120__si_class_type_infoE; + _ZTIN10__cxxabiv121__vmi_class_type_infoE; + + # typeinfo name + _ZTS[a-fh-z]; + _ZTSP[a-fh-z]; + _ZTSPK[a-fh-z]; + _ZTSN10__cxxabiv117__array_type_infoE; + _ZTSN10__cxxabiv117__class_type_infoE; + _ZTSN10__cxxabiv116__enum_type_infoE; + _ZTSN10__cxxabiv120__function_type_infoE; + _ZTSN10__cxxabiv123__fundamental_type_infoE; + _ZTSN10__cxxabiv117__pbase_type_infoE; + _ZTSN10__cxxabiv129__pointer_to_member_type_infoE; + _ZTSN10__cxxabiv119__pointer_type_infoE; + _ZTSN10__cxxabiv120__si_class_type_infoE; + _ZTSN10__cxxabiv121__vmi_class_type_infoE; + + # __gnu_cxx::_verbose_terminate_handler() + _ZN9__gnu_cxx27__verbose_terminate_handlerEv; + + local: + *; +}; + +CXXABI_1.3.1 { + + __cxa_get_exception_ptr; + +} CXXABI_1.3; From owner-svn-src-all@FreeBSD.ORG Wed May 23 09:34:38 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3D9D1065673; Wed, 23 May 2012 09:34:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 5576E8FC21; Wed, 23 May 2012 09:34:38 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4N9YX1n008435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 May 2012 19:34:35 +1000 Date: Wed, 23 May 2012 19:34:33 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar In-Reply-To: Message-ID: <20120523193428.V902@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: mdf@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, "David E. O'Brien" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 09:34:38 -0000 On Tue, 22 May 2012, Marcel Moolenaar wrote: > On May 22, 2012, at 2:07 PM, mdf@FreeBSD.org wrote: > >> On Tue, May 22, 2012 at 1:05 PM, Bruce Evans wrote: >>> On Tue, 22 May 2012, David E. O'Brien wrote: >>> >>>> Log: >>>> Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit >>>> platforms. >>> >>> I think I like this, since it is technically correct, and will find a >>> different set of type mismatches. >> >> We run with the following at Isilon, which is somewhat bogus because >> it allows a bit of sloppiness in types, but is also terribly >> convenient since it means no casting on printf arguments is needed: Without casts, the code will be unportable (sideways and future). >> --- contrib/gcc/c-format.c 2012-05-22 14:08:23.538266746 -0700 >> +++ /data/sb/head/src/contrib/gcc/c-format.c 2012-05-16 >> 12:59:40.937016702 -0700 >> @@ -2298,10 +2570,20 @@ check_format_types (format_wanted_type * >> equivalent but the above test won't consider them equivalent. */ >> if (wanted_type == char_type_node >> && (!pedantic || i < 2) >> && char_type_flag) >> continue; >> + >> + /* Isilon: FreeBSD defines int64_t (and others) as one type (e.g. long >> + long) on i386 and another type (e.g. long) on amd64. This prevents >> + the use of a common format specifier. Treat equal sized integer types >> + as equivalent. */ >> + if (TREE_CODE (wanted_type) == INTEGER_TYPE >> + && TREE_CODE (cur_type) == INTEGER_TYPE >> + && int_size_in_bytes (wanted_type) == int_size_in_bytes (cur_type)) >> + continue; >> + >> /* Now we have a type mismatch. */ >> format_type_warning (types->name, format_start, format_length, >> wanted_type, types->pointer_count, >> types->wanted_type_name, orig_cur_type, arg_num); >> } >> >> >> If there's no objections, I (or David or anyone else) can commit to >> the FreeBSD repository. > > I think such would make support for external (i.e. non-FreeBSD) toolchains > even more problematic. Our format extensions are a big hurdle already. I > think we should not tweak the compiler. I certainly object. It breaks the warning, without even an option to control this. The current checking gives some chance of detecting type mismatches in printf formats without compiling all on arches. It is only for some 64-bit types and formats that the warnings don't correspond to runtime bugs on any currently supported arch. This is because 64 bits is the largest integer size on all supported arch. All of %ll, %q and %j are specified to have >= 64 bits and limited by this, so they have precisely 64 bits and there are no runtime incompatibilities. However, %l doesn't give 64 bits on 32-bit arches, and the compile time warning for using %l to print an int64_t value on a 64-bit system is useful on currently supported arches for preventing unportabilty to 32-bit systems, although %l is correct for this on 64 bit systems. Bruce From owner-svn-src-all@FreeBSD.ORG Wed May 23 10:35:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75A771065673; Wed, 23 May 2012 10:35:41 +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 60CF48FC0C; Wed, 23 May 2012 10:35: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 q4NAZepj063268; Wed, 23 May 2012 10:35:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NAZeTt063266; Wed, 23 May 2012 10:35:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205231035.q4NAZeTt063266@svn.freebsd.org> From: Michael Tuexen Date: Wed, 23 May 2012 10:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235827 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 10:35:41 -0000 Author: tuexen Date: Wed May 23 10:35:40 2012 New Revision: 235827 URL: http://svn.freebsd.org/changeset/base/235827 Log: Update copyright date. MFC after: 3 days Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Wed May 23 09:38:37 2012 (r235826) +++ head/lib/libc/net/sctp_sys_calls.c Wed May 23 10:35:40 2012 (r235827) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -32,6 +32,7 @@ #include __FBSDID("$FreeBSD$"); + #include #include #include From owner-svn-src-all@FreeBSD.ORG Wed May 23 10:46:31 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 68A231065673; Wed, 23 May 2012 10:46:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id CA4838FC0A; Wed, 23 May 2012 10:46:30 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4NAkPCK014082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 May 2012 20:46:26 +1000 Date: Wed, 23 May 2012 20:46:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper In-Reply-To: Message-ID: <20120523203051.J1464@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> <4FBC86B3.8020105@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: "mdf@FreeBSD.org" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Dimitry Andric , "David E. O'Brien" , BruceEvans , "svn-src-head@freebsd.org" Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 10:46:31 -0000 On Wed, 23 May 2012, Garrett Cooper wrote: > On May 22, 2012, at 11:41 PM, Dimitry Andric wrote: > >> On 2012-05-22 23:07, mdf@FreeBSD.org wrote: >> ... >>> We run with the following at Isilon, which is somewhat bogus because >>> it allows a bit of sloppiness in types, but is also terribly >>> convenient since it means no casting on printf arguments is needed: >> >> Please don't. If you want to write portable code, use the (admittedly >> horrible) PRId64 macros instead. Please don't. The PRI macros are almost as abominable as long long. > Agreed, because the patch attached earlier disguises issues with signedness (for one) and I've seen some interesting bugs creep in because of issues like that, an it's painful cleaning up those problems later on (esp. considering that clang will replace gcc not too far down the line)... Disagreed (except I always notice sign errors in printf formats too. I once fixed -Wformat to detect sign errors, but ran away since it found even more sign errors than size errors. Now I only notice the sign errors when a size error turns up). Apart from being even uglier looking than long long, the PRI macros are not even usable for printing an averaged typedefed type, since unless there is a format letter and a corresponding PRI macro for just that type, you have to peer inside the opaque details of the type to determine its size and perhaps its signedness and then hard-code the corresponding PRI macro. This breaks as soon as the opaque details change and thus defeats the point of having (semi-)opaque typedefed types. If a variable's type is known to be 64 bits, then you can hard-code PRI64 for it. This breaks as soon as the knowledge becomes out of date. Since the type isn't typedefed, it is less likely to change, but there is no guarantee. Everyone knew that all types were 32 bits and had to change too much to support 64 bit systems. Bruce From owner-svn-src-all@FreeBSD.ORG Wed May 23 11:26:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 250BE1065674; Wed, 23 May 2012 11:26:30 +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 0A1F08FC0A; Wed, 23 May 2012 11:26:30 +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 q4NBQTLB069863; Wed, 23 May 2012 11:26:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NBQTIN069822; Wed, 23 May 2012 11:26:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205231126.q4NBQTIN069822@svn.freebsd.org> From: Michael Tuexen Date: Wed, 23 May 2012 11:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235828 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 11:26:30 -0000 Author: tuexen Date: Wed May 23 11:26:28 2012 New Revision: 235828 URL: http://svn.freebsd.org/changeset/base/235828 Log: Use consistent text at the begining of the files. MFC after: 3 days Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_asconf.h head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_auth.h head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_bsd_addr.h head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_crc32.c head/sys/netinet/sctp_crc32.h head/sys/netinet/sctp_dtrace_declare.h head/sys/netinet/sctp_dtrace_define.h head/sys/netinet/sctp_header.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_indata.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_input.h head/sys/netinet/sctp_lock_bsd.h head/sys/netinet/sctp_os.h head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_peeloff.h head/sys/netinet/sctp_ss_functions.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_timer.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h head/sys/netinet6/sctp6_usrreq.c head/sys/netinet6/sctp6_var.h Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,7 +29,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp.h,v 1.18 2005/03/06 16:04:16 itojun Exp $ */ #include __FBSDID("$FreeBSD$"); @@ -37,6 +36,7 @@ __FBSDID("$FreeBSD$"); #ifndef _NETINET_SCTP_H_ #define _NETINET_SCTP_H_ + #include Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_asconf.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,10 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_asconf.c,v 1.24 2005/03/06 16:04:16 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: head/sys/netinet/sctp_asconf.h ============================================================================== --- head/sys/netinet/sctp_asconf.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_asconf.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_asconf.h,v 1.8 2005/03/06 16:04:16 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_auth.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: head/sys/netinet/sctp_auth.h ============================================================================== --- head/sys/netinet/sctp_auth.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_auth.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,8 +33,8 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __SCTP_AUTH_H__ -#define __SCTP_AUTH_H__ +#ifndef _NETINET_SCTP_AUTH_H_ +#define _NETINET_SCTP_AUTH_H_ /* digest lengths */ Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_bsd_addr.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_output.c,v 1.46 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_bsd_addr.h ============================================================================== --- head/sys/netinet/sctp_bsd_addr.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_bsd_addr.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,8 +33,9 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_bsd_addr_h__ -#define __sctp_bsd_addr_h__ +#ifndef _NETINET_SCTP_BSD_ADDR_H_ +#define _NETINET_SCTP_BSD_ADDR_H_ + #include #if defined(_KERNEL) || defined(__Userspace__) Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_cc_functions.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,6 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -44,8 +47,6 @@ #include #include #include -#include -__FBSDID("$FreeBSD$"); #define SHIFT_MPTCP_MULTI_N 40 #define SHIFT_MPTCP_MULTI_Z 16 Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_constants.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_constants.h,v 1.17 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_constants_h__ -#define __sctp_constants_h__ +#ifndef _NETINET_SCTP_CONSTANTS_H_ +#define _NETINET_SCTP_CONSTANTS_H_ /* IANA assigned port number for SCTP over UDP encapsulation */ /* For freebsd we cannot bind the port at Modified: head/sys/netinet/sctp_crc32.c ============================================================================== --- head/sys/netinet/sctp_crc32.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_crc32.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,9 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_crc32.c,v 1.12 2005/03/06 16:04:17 itojun Exp $ */ - - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_crc32.h ============================================================================== --- head/sys/netinet/sctp_crc32.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_crc32.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_crc32.h,v 1.5 2004/08/17 04:06:16 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __crc32c_h__ -#define __crc32c_h__ +#ifndef _NETINET_SCTP_CRC32_H_ +#define _NETINET_SCTP_CRC32_H_ #if defined(_KERNEL) #if !defined(SCTP_WITH_NO_CSUM) Modified: head/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- head/sys/netinet/sctp_dtrace_declare.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_dtrace_declare.h Wed May 23 11:26:28 2012 (r235828) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -28,9 +28,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_dtrace_declare_h__ + +#ifndef _NETINET_SCTP_DTRACE_DECLARE_H_ +#define _NETINET_SCTP_DTRACE_DECLARE_H_ + #include "opt_kdtrace.h" #include #include Modified: head/sys/netinet/sctp_dtrace_define.h ============================================================================== --- head/sys/netinet/sctp_dtrace_define.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_dtrace_define.h Wed May 23 11:26:28 2012 (r235828) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -28,9 +28,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_dtrace_define_h__ + +#ifndef _NETINET_SCTP_DTRACE_DEFINE_H_ +#define _NETINET_SCTP_DTRACE_DEFINE_H_ + #include "opt_kdtrace.h" #include #include Modified: head/sys/netinet/sctp_header.h ============================================================================== --- head/sys/netinet/sctp_header.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_header.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_header.h,v 1.14 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_header_h__ -#define __sctp_header_h__ +#ifndef _NETINET_SCTP_HEADER_H_ +#define _NETINET_SCTP_HEADER_H_ #include #include Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_indata.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_indata.c,v 1.36 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_indata.h ============================================================================== --- head/sys/netinet/sctp_indata.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_indata.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_indata.h,v 1.9 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_indata_h__ -#define __sctp_indata_h__ +#ifndef _NETINET_SCTP_INDATA_H_ +#define _NETINET_SCTP_INDATA_H_ #if defined(_KERNEL) || defined(__Userspace__) Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_input.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_input.c,v 1.27 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_input.h ============================================================================== --- head/sys/netinet/sctp_input.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_input.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_input.h,v 1.6 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_input_h__ -#define __sctp_input_h__ +#ifndef _NETINET_SCTP_INPUT_H_ +#define _NETINET_SCTP_INPUT_H_ #if defined(_KERNEL) || defined(__Userspace__) void Modified: head/sys/netinet/sctp_lock_bsd.h ============================================================================== --- head/sys/netinet/sctp_lock_bsd.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_lock_bsd.h Wed May 23 11:26:28 2012 (r235828) @@ -1,9 +1,7 @@ -#ifndef __sctp_lock_bsd_h__ -#define __sctp_lock_bsd_h__ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -32,6 +30,12 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + +#ifndef _NETINET_SCTP_LOCK_BSD_H_ +#define _NETINET_SCTP_LOCK_BSD_H_ + /* * General locking concepts: The goal of our locking is to of course provide * consistency and yet minimize overhead. We will attempt to use @@ -70,9 +74,6 @@ * SCTP_INP_INFO_RLOCK() and then when we want to add a new association to * the SCTP_BASE_INFO() list's we will do a SCTP_INP_INFO_WLOCK(). */ -#include -__FBSDID("$FreeBSD$"); - extern struct sctp_foo_stuff sctp_logoff[]; extern int sctp_logoff_stuff; Modified: head/sys/netinet/sctp_os.h ============================================================================== --- head/sys/netinet/sctp_os.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_os.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,10 +29,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_os_h__ -#define __sctp_os_h__ + +#ifndef _NETINET_SCTP_OS_H_ +#define _NETINET_SCTP_OS_H_ /* * General kernel memory allocation: Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_os_bsd.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,10 +29,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_os_bsd_h__ -#define __sctp_os_bsd_h__ + +#ifndef _NETINET_SCTP_OS_BSD_H_ +#define _NETINET_SCTP_OS_BSD_H_ /* * includes */ Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_output.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_output.c,v 1.46 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_output.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_output.h,v 1.14 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_output_h__ -#define __sctp_output_h__ +#ifndef _NETINET_SCTP_OUTPUT_H_ +#define _NETINET_SCTP_OUTPUT_H_ #include Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_pcb.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_pcb.c,v 1.38 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_pcb.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -29,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_pcb.h,v 1.21 2005/07/16 01:18:47 suz Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_pcb_h__ -#define __sctp_pcb_h__ +#ifndef _NETINET_SCTP_PCB_H_ +#define _NETINET_SCTP_PCB_H_ #include #include Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_peeloff.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,11 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ - -/* $KAME: sctp_peeloff.c,v 1.13 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: head/sys/netinet/sctp_peeloff.h ============================================================================== --- head/sys/netinet/sctp_peeloff.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_peeloff.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_peeloff.h,v 1.6 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_peeloff_h__ -#define __sctp_peeloff_h__ +#ifndef _NETINET_SCTP_PEELOFF_H_ +#define _NETINET_SCTP_PEELOFF_H_ Modified: head/sys/netinet/sctp_ss_functions.c ============================================================================== --- head/sys/netinet/sctp_ss_functions.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_ss_functions.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- - * Copyright (c) 2010-2011, by Michael Tuexen. All rights reserved. - * Copyright (c) 2010-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2010-2011, by Robin Seggelmann. All rights reserved. + * Copyright (c) 2010-2012, by Michael Tuexen. All rights reserved. + * Copyright (c) 2010-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2010-2012, by Robin Seggelmann. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_structs.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_structs.h,v 1.13 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_structs_h__ -#define __sctp_structs_h__ +#ifndef _NETINET_SCTP_STRUCTS_H_ +#define _NETINET_SCTP_STRUCTS_H_ #include #include Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_sysctl.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_sysctl.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,8 +33,8 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_sysctl_h__ -#define __sctp_sysctl_h__ +#ifndef _NETINET_SCTP_SYSCTL_H_ +#define _NETINET_SCTP_SYSCTL_H_ #include #include Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_timer.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_timer.c,v 1.29 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_timer.h ============================================================================== --- head/sys/netinet/sctp_timer.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_timer.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,12 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_timer.h,v 1.6 2005/03/06 16:04:18 itojun Exp $ */ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_timer_h__ -#define __sctp_timer_h__ +#ifndef _NETINET_SCTP_TIMER_H_ +#define _NETINET_SCTP_TIMER_H_ #if defined(_KERNEL) || defined(__Userspace__) Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_uio.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,12 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_uio.h,v 1.11 2005/03/06 16:04:18 itojun Exp $ */ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_uio_h__ -#define __sctp_uio_h__ +#ifndef _NETINET_SCTP_UIO_H_ +#define _NETINET_SCTP_UIO_H_ #if ! defined(_KERNEL) Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_usrreq.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,10 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_usrreq.c,v 1.48 2005/03/07 23:26:08 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: head/sys/netinet/sctp_var.h ============================================================================== --- head/sys/netinet/sctp_var.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_var.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_var.h,v 1.24 2005/03/06 16:04:19 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctputil.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctputil.c,v 1.37 2005/03/07 23:26:09 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctputil.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,14 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ - -/* $KAME: sctputil.h,v 1.15 2005/03/06 16:04:19 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctputil_h__ -#define __sctputil_h__ +#ifndef _NETINET_SCTP_UTIL_H_ +#define _NETINET_SCTP_UTIL_H_ #if defined(_KERNEL) || defined(__Userspace__) Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet6/sctp6_usrreq.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,7 +29,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp6_usrreq.c,v 1.38 2005/08/24 08:08:56 suz Exp $ */ #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet6/sctp6_var.h ============================================================================== --- head/sys/netinet6/sctp6_var.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet6/sctp6_var.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,14 +29,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp6_var.h,v 1.7 2004/08/17 04:06:22 itojun Exp $ */ - -#ifndef _NETINET6_SCTP6_VAR_H_ -#define _NETINET6_SCTP6_VAR_H_ #include __FBSDID("$FreeBSD$"); +#ifndef _NETINET6_SCTP6_VAR_H_ +#define _NETINET6_SCTP6_VAR_H_ + #if defined(_KERNEL) SYSCTL_DECL(_net_inet6_sctp6); From owner-svn-src-all@FreeBSD.ORG Wed May 23 11:49:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47851106566B; Wed, 23 May 2012 11:49:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id D3C6C8FC0A; Wed, 23 May 2012 11:49:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [192.168.1.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id 41E5BA7071; Wed, 23 May 2012 13:49:24 +0200 (CEST) Message-ID: <4FBCCED9.9050308@FreeBSD.org> Date: Wed, 23 May 2012 13:49:45 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120512 Thunderbird/13.0 MIME-Version: 1.0 To: "David E. O'Brien" References: <201205221818.q4MII7lk019626@svn.freebsd.org> In-Reply-To: <201205221818.q4MII7lk019626@svn.freebsd.org> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 11:49:43 -0000 On 2012-05-22 20:18, David E. O'Brien wrote: > Author: obrien > Date: Tue May 22 18:18:06 2012 > New Revision: 235797 > URL: http://svn.freebsd.org/changeset/base/235797 > > Log: > Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. > > Modified: > head/contrib/gcc/c-format.c > > Modified: head/contrib/gcc/c-format.c > ============================================================================== > --- head/contrib/gcc/c-format.c Tue May 22 17:44:01 2012 (r235796) > +++ head/contrib/gcc/c-format.c Tue May 22 18:18:06 2012 (r235797) > @@ -287,7 +287,11 @@ static const format_length_info printf_l > { > { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, > { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, > +#ifdef __LP64__ > + { "q", FMT_LEN_l, STD_EXT, NULL, 0, 0 }, > +#else > { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, > +#endif > { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, > { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, > { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, Until all the additional warnings this causes have been fixed, can this commit please be reverted for now? From owner-svn-src-all@FreeBSD.ORG Wed May 23 12:51:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29A01106564A; Wed, 23 May 2012 12:51:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 143948FC08; Wed, 23 May 2012 12:51: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 q4NCpnSD073342; Wed, 23 May 2012 12:51:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NCpnat073340; Wed, 23 May 2012 12:51:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205231251.q4NCpnat073340@svn.freebsd.org> From: Andriy Gapon Date: Wed, 23 May 2012 12:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235829 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 12:51:50 -0000 Author: avg Date: Wed May 23 12:51:49 2012 New Revision: 235829 URL: http://svn.freebsd.org/changeset/base/235829 Log: vm_pager_object_lookup: small performance optimization do not needlessly lock an object if its handle doesn't match Reviewed by: kib, alc MFC after: 1 week Modified: head/sys/vm/vm_pager.c Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Wed May 23 11:26:28 2012 (r235828) +++ head/sys/vm/vm_pager.c Wed May 23 12:51:49 2012 (r235829) @@ -271,14 +271,15 @@ vm_pager_object_lookup(struct pagerlst * vm_object_t object; TAILQ_FOREACH(object, pg_list, pager_object_list) { - VM_OBJECT_LOCK(object); - if (object->handle == handle && - (object->flags & OBJ_DEAD) == 0) { - vm_object_reference_locked(object); + if (object->handle == handle) { + VM_OBJECT_LOCK(object); + if ((object->flags & OBJ_DEAD) == 0) { + vm_object_reference_locked(object); + VM_OBJECT_UNLOCK(object); + break; + } VM_OBJECT_UNLOCK(object); - break; } - VM_OBJECT_UNLOCK(object); } return (object); } From owner-svn-src-all@FreeBSD.ORG Wed May 23 13:01:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93AAF106566C; Wed, 23 May 2012 13:01:23 +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 6494E8FC16; Wed, 23 May 2012 13:01:23 +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 q4ND1Nae073848; Wed, 23 May 2012 13:01:23 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ND1NpO073846; Wed, 23 May 2012 13:01:23 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201205231301.q4ND1NpO073846@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 23 May 2012 13:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235830 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 13:01:23 -0000 Author: gavin Date: Wed May 23 13:01:22 2012 New Revision: 235830 URL: http://svn.freebsd.org/changeset/base/235830 Log: Take yar's commit bit into safekeeping, per his request to core. Many thanks for all of your work on FreeBSD in the past. Approved by: core (implicit) Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed May 23 12:51:49 2012 (r235829) +++ svnadmin/conf/access Wed May 23 13:01:22 2012 (r235830) @@ -261,7 +261,6 @@ wkoszek wollman wpaul wsalamon -yar yongari zack zec From owner-svn-src-all@FreeBSD.ORG Wed May 23 13:23:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0079C1065672; Wed, 23 May 2012 13:23:41 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5D9B8FC08; Wed, 23 May 2012 13:23: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 q4NDNePp074802; Wed, 23 May 2012 13:23:40 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NDNekx074798; Wed, 23 May 2012 13:23:40 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201205231323.q4NDNekx074798@svn.freebsd.org> From: Fabien Thomas Date: Wed, 23 May 2012 13:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235831 - in head/sys: arm/arm arm/include dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 13:23:41 -0000 Author: fabient Date: Wed May 23 13:23:40 2012 New Revision: 235831 URL: http://svn.freebsd.org/changeset/base/235831 Log: Soft PMC support for ARM. Callgraph is not captured, only current location. Sample system wide profiling: "pmcstat -Sclock.hard -T" Modified: head/sys/arm/arm/machdep.c head/sys/arm/include/pmc_mdep.h head/sys/dev/hwpmc/hwpmc_arm.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed May 23 13:01:22 2012 (r235830) +++ head/sys/arm/arm/machdep.c Wed May 23 13:23:40 2012 (r235831) @@ -674,9 +674,9 @@ fake_preload_metadata(void) static uint32_t fake_preload[35]; fake_preload[i++] = MODINFO_NAME; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; + fake_preload[i++] = strlen("kernel") + 1; + strcpy((char*)&fake_preload[i++], "kernel"); + i += 1; fake_preload[i++] = MODINFO_TYPE; fake_preload[i++] = strlen("elf kernel") + 1; strcpy((char*)&fake_preload[i++], "elf kernel"); Modified: head/sys/arm/include/pmc_mdep.h ============================================================================== --- head/sys/arm/include/pmc_mdep.h Wed May 23 13:01:22 2012 (r235830) +++ head/sys/arm/include/pmc_mdep.h Wed May 23 13:23:40 2012 (r235831) @@ -54,6 +54,12 @@ union pmc_md_pmc { #define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_usr_lr) #define PMC_TRAPFRAME_TO_SP(TF) ((TF)->tf_usr_sp) +/* Build a fake kernel trapframe from current instruction pointer. */ +#define PMC_FAKE_TRAPFRAME(TF) \ + do { \ + __asm __volatile("mov %0, pc" : "=r" ((TF)->tf_pc)); \ + } while (0) + /* * Prototypes */ Modified: head/sys/dev/hwpmc/hwpmc_arm.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_arm.c Wed May 23 13:01:22 2012 (r235830) +++ head/sys/dev/hwpmc/hwpmc_arm.c Wed May 23 13:23:40 2012 (r235831) @@ -38,38 +38,47 @@ __FBSDID("$FreeBSD$"); struct pmc_mdep * pmc_md_initialize() { +#ifdef CPU_XSCALE_IXP425 if (cpu_class == CPU_CLASS_XSCALE) return pmc_xscale_initialize(); else +#endif return NULL; } void pmc_md_finalize(struct pmc_mdep *md) { +#ifdef CPU_XSCALE_IXP425 if (cpu_class == CPU_CLASS_XSCALE) pmc_xscale_finalize(md); else KASSERT(0, ("[arm,%d] Unknown CPU Class 0x%x", __LINE__, cpu_class)); +#endif +} + +static int +pmc_save_callchain(uintptr_t *cc, int maxsamples, + struct trapframe *tf) +{ + + *cc = PMC_TRAPFRAME_TO_PC(tf); + return (1); } int pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, struct trapframe *tf) { - (void) cc; - (void) maxsamples; - (void) tf; - return (0); + + return pmc_save_callchain(cc, maxsamples, tf); } int pmc_save_user_callchain(uintptr_t *cc, int maxsamples, struct trapframe *tf) { - (void) cc; - (void) maxsamples; - (void) tf; - return (0); + + return pmc_save_callchain(cc, maxsamples, tf); } From owner-svn-src-all@FreeBSD.ORG Wed May 23 13:41:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3883B106566B; Wed, 23 May 2012 13:41:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 239248FC1B; Wed, 23 May 2012 13:41: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 q4NDfCuR075647; Wed, 23 May 2012 13:41:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NDfCRW075645; Wed, 23 May 2012 13:41:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205231341.q4NDfCRW075645@svn.freebsd.org> From: John Baldwin Date: Wed, 23 May 2012 13:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235833 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 13:41:13 -0000 Author: jhb Date: Wed May 23 13:41:12 2012 New Revision: 235833 URL: http://svn.freebsd.org/changeset/base/235833 Log: Only check to see if a memory resource is a PCI ROM BAR when activating and deactivating PCI resources. Previously, if a device had more than 48 MSI interrupts, then activating message 48 (which has a rid == PCIR_BIOS) would incorrectly try to enable the PCI ROM BAR. Tested by: Olivier Cinquin ocinquin uci edu MFC after: 3 days Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed May 23 13:39:46 2012 (r235832) +++ head/sys/dev/pci/pci.c Wed May 23 13:41:12 2012 (r235833) @@ -4260,7 +4260,7 @@ pci_activate_resource(device_t dev, devi if (device_get_parent(child) == dev) { /* Device ROMs need their decoding explicitly enabled. */ dinfo = device_get_ivars(child); - if (PCIR_IS_BIOS(&dinfo->cfg, rid)) + if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) pci_write_bar(child, pci_find_bar(child, rid), rman_get_start(r) | PCIM_BIOS_ENABLE); switch (type) { @@ -4287,7 +4287,7 @@ pci_deactivate_resource(device_t dev, de /* Disable decoding for device ROMs. */ if (device_get_parent(child) == dev) { dinfo = device_get_ivars(child); - if (PCIR_IS_BIOS(&dinfo->cfg, rid)) + if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) pci_write_bar(child, pci_find_bar(child, rid), rman_get_start(r)); } From owner-svn-src-all@FreeBSD.ORG Wed May 23 13:45:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23D60106564A; Wed, 23 May 2012 13:45:53 +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 0D35D8FC18; Wed, 23 May 2012 13:45:53 +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 q4NDjqHB075935; Wed, 23 May 2012 13:45:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NDjq5d075932; Wed, 23 May 2012 13:45:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205231345.q4NDjq5d075932@svn.freebsd.org> From: John Baldwin Date: Wed, 23 May 2012 13:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235834 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 13:45:53 -0000 Author: jhb Date: Wed May 23 13:45:52 2012 New Revision: 235834 URL: http://svn.freebsd.org/changeset/base/235834 Log: Rework the previous change to honor MADT processor IDs when probing processor objects. Instead of forcing the new-bus CPU objects to use a unit number equal to pc_cpuid, adjust acpi_pcpu_get_id() to honor the MADT IDs by default. As with the previous change, setting debug.acpi.cpu_unordered to 1 in the loader will revert to the old behavior. Tested by: jimharris MFC after: 1 month Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed May 23 13:41:12 2012 (r235833) +++ head/sys/dev/acpica/acpi.c Wed May 23 13:45:52 2012 (r235834) @@ -289,13 +289,6 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, reset_ &acpi_reset_clock, 1, "Reset system clock while resuming."); #endif -/* Allow users to ignore processor orders in MADT. */ -static int acpi_cpu_unordered; -TUNABLE_INT("debug.acpi.cpu_unordered", &acpi_cpu_unordered); -SYSCTL_INT(_debug_acpi, OID_AUTO, cpu_unordered, CTLFLAG_RDTUN, - &acpi_cpu_unordered, 0, - "Do not use the MADT to match ACPI Processor objects to CPUs."); - /* Allow users to override quirks. */ TUNABLE_INT("debug.acpi.quirks", &acpi_quirks); @@ -1863,15 +1856,11 @@ static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status) { struct acpi_prw_data prw; - ACPI_BUFFER buf; - ACPI_OBJECT obj; ACPI_OBJECT_TYPE type; ACPI_HANDLE h; - struct pcpu *pc; device_t bus, child; char *handle_str; - u_int cpuid; - int order, unit; + int order; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -1909,31 +1898,6 @@ acpi_probe_child(ACPI_HANDLE handle, UIN case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: case ACPI_TYPE_POWER: - unit = -1; - if (type == ACPI_TYPE_PROCESSOR && acpi_cpu_unordered == 0) { - ACPI_STATUS s; - buf.Pointer = &obj; - buf.Length = sizeof(obj); - s = AcpiEvaluateObject(handle, NULL, NULL, &buf); - if (ACPI_SUCCESS(s)) { - CPU_FOREACH(cpuid) { - pc = pcpu_find(cpuid); - if (pc->pc_acpi_id == obj.Processor.ProcId) { - unit = cpuid; - if (bootverbose) - printf("ACPI: %s (ACPI ID %u) -> cpu%d\n", - handle_str, obj.Processor.ProcId, unit); - break; - } - } - if (unit == -1) { - if (bootverbose) - printf("ACPI: %s (ACPI ID %u) ignored\n", - handle_str, obj.Processor.ProcId); - break; - } - } - } /* * Create a placeholder device for this node. Sort the * placeholder so that the probe/attach passes will run @@ -1944,7 +1908,7 @@ acpi_probe_child(ACPI_HANDLE handle, UIN ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", handle_str)); order = level * 10 + ACPI_DEV_BASE_ORDER; acpi_probe_order(handle, &order); - child = BUS_ADD_CHILD(bus, order, NULL, unit); + child = BUS_ADD_CHILD(bus, order, NULL, -1); if (child == NULL) break; Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed May 23 13:41:12 2012 (r235833) +++ head/sys/dev/acpica/acpi_cpu.c Wed May 23 13:45:52 2012 (r235834) @@ -124,6 +124,13 @@ struct acpi_cpu_device { #define PIIX4_STOP_BREAK_MASK (PIIX4_BRLD_EN_IRQ0 | PIIX4_BRLD_EN_IRQ | PIIX4_BRLD_EN_IRQ8) #define PIIX4_PCNTRL_BST_EN (1<<10) +/* Allow users to ignore processor orders in MADT. */ +static int cpu_unordered; +TUNABLE_INT("debug.acpi.cpu_unordered", &cpu_unordered); +SYSCTL_INT(_debug_acpi, OID_AUTO, cpu_unordered, CTLFLAG_RDTUN, + &cpu_unordered, 0, + "Do not use the MADT to match ACPI Processor objects to CPUs."); + /* Platform hardware resource information. */ static uint32_t cpu_smi_cmd; /* Value to write to SMI_CMD. */ static uint8_t cpu_cst_cnt; /* Indicate we are _CST aware. */ @@ -148,7 +155,7 @@ static int acpi_cpu_probe(device_t dev); static int acpi_cpu_attach(device_t dev); static int acpi_cpu_suspend(device_t dev); static int acpi_cpu_resume(device_t dev); -static int acpi_pcpu_get_id(uint32_t idx, uint32_t *acpi_id, +static int acpi_pcpu_get_id(device_t dev, uint32_t *acpi_id, uint32_t *cpu_id); static struct resource_list *acpi_cpu_get_rlist(device_t dev, device_t child); static device_t acpi_cpu_add_child(device_t dev, u_int order, const char *name, @@ -245,7 +252,7 @@ acpi_cpu_probe(device_t dev) */ acpi_id = obj->Processor.ProcId; AcpiOsFree(obj); - if (acpi_pcpu_get_id(device_get_unit(dev), &acpi_id, &cpu_id) != 0) + if (acpi_pcpu_get_id(dev, &acpi_id, &cpu_id) != 0) return (ENXIO); /* @@ -436,36 +443,64 @@ acpi_cpu_resume(device_t dev) } /* - * Find the nth present CPU and return its pc_cpuid as well as set the - * pc_acpi_id from the most reliable source. + * Find the processor associated with a given ACPI ID. By default, + * use the MADT to map ACPI IDs to APIC IDs and use that to locate a + * processor. Some systems have inconsistent ASL and MADT however. + * For these systems the cpu_unordered tunable can be set in which + * case we assume that Processor objects are listed in the same order + * in both the MADT and ASL. */ static int -acpi_pcpu_get_id(uint32_t idx, uint32_t *acpi_id, uint32_t *cpu_id) +acpi_pcpu_get_id(device_t dev, uint32_t *acpi_id, uint32_t *cpu_id) { - struct pcpu *pcpu_data; - uint32_t i; + struct pcpu *pc; + uint32_t i, idx; KASSERT(acpi_id != NULL, ("Null acpi_id")); KASSERT(cpu_id != NULL, ("Null cpu_id")); + idx = device_get_unit(dev); + + /* + * If pc_acpi_id for CPU 0 is not initialized (e.g. a non-APIC + * UP box) use the ACPI ID from the first processor we find. + */ + if (idx == 0 && mp_ncpus == 1) { + pc = pcpu_find(0); + if (pc->pc_acpi_id == 0xffffffff) + pc->pc_acpi_id = *acpi_id; + *cpu_id = 0; + return (0); + } + CPU_FOREACH(i) { - pcpu_data = pcpu_find(i); - KASSERT(pcpu_data != NULL, ("no pcpu data for %d", i)); - if (idx-- == 0) { - /* - * If pc_acpi_id was not initialized (e.g., a non-APIC UP box) - * override it with the value from the ASL. Otherwise, if the - * two don't match, prefer the MADT-derived value. Finally, - * return the pc_cpuid to reference this processor. - */ - if (pcpu_data->pc_acpi_id == 0xffffffff) - pcpu_data->pc_acpi_id = *acpi_id; - else if (pcpu_data->pc_acpi_id != *acpi_id) - *acpi_id = pcpu_data->pc_acpi_id; - *cpu_id = pcpu_data->pc_cpuid; - return (0); + pc = pcpu_find(i); + KASSERT(pc != NULL, ("no pcpu data for %d", i)); + if (cpu_unordered) { + if (idx-- == 0) { + /* + * If pc_acpi_id doesn't match the ACPI ID from the + * ASL, prefer the MADT-derived value. + */ + if (pc->pc_acpi_id != *acpi_id) + *acpi_id = pc->pc_acpi_id; + *cpu_id = pc->pc_cpuid; + return (0); + } + } else { + if (pc->pc_acpi_id == *acpi_id) { + if (bootverbose) + device_printf(dev, "(ACPI ID %u) -> APIC ID %d\n", + *acpi_id, pc->pc_cpuid); + *cpu_id = pc->pc_cpuid; + return (0); + } } } + if (bootverbose) + printf("ACPI: Processor %s (ACPI ID %u) ignored\n", + acpi_name(acpi_get_handle(dev)), *acpi_id); + return (ESRCH); } From owner-svn-src-all@FreeBSD.ORG Wed May 23 14:44:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55579106566B; Wed, 23 May 2012 14:44:58 +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 3FA138FC14; Wed, 23 May 2012 14:44: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 q4NEiwai078387; Wed, 23 May 2012 14:44:58 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NEiwbx078385; Wed, 23 May 2012 14:44:58 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201205231444.q4NEiwbx078385@svn.freebsd.org> From: Mitsuru IWASAKI Date: Wed, 23 May 2012 14:44: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: r235835 - stable/9/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 14:44:58 -0000 Author: iwasaki Date: Wed May 23 14:44:57 2012 New Revision: 235835 URL: http://svn.freebsd.org/changeset/base/235835 Log: MFC 235692,235772: - Don't start the sleep state transition procedure while sleep is disabled or the system is in shutdown procedure. - Ignore the power button press event for resuming rather than starting shutdown. Modified: stable/9/sys/dev/acpica/acpi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi.c ============================================================================== --- stable/9/sys/dev/acpica/acpi.c Wed May 23 13:45:52 2012 (r235834) +++ stable/9/sys/dev/acpica/acpi.c Wed May 23 14:44:57 2012 (r235835) @@ -2468,14 +2468,20 @@ acpi_ReqSleepState(struct acpi_softc *sc if (!acpi_sleep_states[state]) return (EOPNOTSUPP); - ACPI_LOCK(acpi); - /* If a suspend request is already in progress, just return. */ if (sc->acpi_next_sstate != 0) { - ACPI_UNLOCK(acpi); return (0); } + /* Wait until sleep is enabled. */ + while (sc->acpi_sleep_disabled) { + AcpiOsSleep(1000); + } + + ACPI_LOCK(acpi); + + sc->acpi_next_sstate = state; + /* S5 (soft-off) should be entered directly with no waiting. */ if (state == ACPI_STATE_S5) { ACPI_UNLOCK(acpi); @@ -2484,7 +2490,6 @@ acpi_ReqSleepState(struct acpi_softc *sc } /* Record the pending state and notify all apm devices. */ - sc->acpi_next_sstate = state; STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { clone->notify_status = APM_EV_NONE; if ((clone->flags & ACPI_EVF_DEVD) == 0) { From owner-svn-src-all@FreeBSD.ORG Wed May 23 14:48:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21567106564A; Wed, 23 May 2012 14:48:15 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B4918FC0A; Wed, 23 May 2012 14:48: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 q4NEmEeC078645; Wed, 23 May 2012 14:48:14 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NEmEVg078643; Wed, 23 May 2012 14:48:14 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201205231448.q4NEmEVg078643@svn.freebsd.org> From: Jamie Gritton Date: Wed, 23 May 2012 14: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: r235836 - stable/9/lib/libjail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 14:48:15 -0000 Author: jamie Date: Wed May 23 14:48:14 2012 New Revision: 235836 URL: http://svn.freebsd.org/changeset/base/235836 Log: MFC r235799: The fix in r235291 (r235624) re-broke the "allow.nomount" case. Re-fix it by testing for the right parameter name. PR: bin/168250 Modified: stable/9/lib/libjail/jail.c Directory Properties: stable/9/lib/libjail/ (props changed) Modified: stable/9/lib/libjail/jail.c ============================================================================== --- stable/9/lib/libjail/jail.c Wed May 23 14:44:57 2012 (r235835) +++ stable/9/lib/libjail/jail.c Wed May 23 14:48:14 2012 (r235836) @@ -853,7 +853,7 @@ jailparam_free(struct jailparam *jp, uns static int jailparam_type(struct jailparam *jp) { - char *p, *nname; + char *p, *name, *nname; size_t miblen, desclen; int i, isarray; struct { @@ -863,7 +863,8 @@ jailparam_type(struct jailparam *jp) int mib[CTL_MAXNAME]; /* The "lastjid" parameter isn't real. */ - if (!strcmp(jp->jp_name, "lastjid")) { + name = jp->jp_name; + if (!strcmp(name, "lastjid")) { jp->jp_valuelen = sizeof(int); jp->jp_ctltype = CTLTYPE_INT | CTLFLAG_WR; return (0); @@ -872,19 +873,19 @@ jailparam_type(struct jailparam *jp) /* Find the sysctl that describes the parameter. */ mib[0] = 0; mib[1] = 3; - snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", jp->jp_name); + snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", name); miblen = sizeof(mib) - 2 * sizeof(int); if (sysctl(mib, 2, mib + 2, &miblen, desc.s, strlen(desc.s)) < 0) { if (errno != ENOENT) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(0.3.%s): %s", jp->jp_name, strerror(errno)); + "sysctl(0.3.%s): %s", name, strerror(errno)); return (-1); } /* * The parameter probably doesn't exist. But it might be * the "no" counterpart to a boolean. */ - nname = nononame(jp->jp_name); + nname = nononame(name); if (nname == NULL) { unknown_parameter: snprintf(jail_errmsg, JAIL_ERRMSGLEN, @@ -892,8 +893,10 @@ jailparam_type(struct jailparam *jp) errno = ENOENT; return (-1); } - snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", nname); + name = alloca(strlen(nname) + 1); + strcpy(name, nname); free(nname); + snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", name); miblen = sizeof(mib) - 2 * sizeof(int); if (sysctl(mib, 2, mib + 2, &miblen, desc.s, strlen(desc.s)) < 0) @@ -906,7 +909,7 @@ jailparam_type(struct jailparam *jp) if (sysctl(mib, (miblen / sizeof(int)) + 2, &desc, &desclen, NULL, 0) < 0) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(0.4.%s): %s", jp->jp_name, strerror(errno)); + "sysctl(0.4.%s): %s", name, strerror(errno)); return (-1); } jp->jp_ctltype = desc.i; @@ -952,7 +955,7 @@ jailparam_type(struct jailparam *jp) if (sysctl(mib + 2, miblen / sizeof(int), desc.s, &desclen, NULL, 0) < 0) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(" SJPARAM ".%s): %s", jp->jp_name, + "sysctl(" SJPARAM ".%s): %s", name, strerror(errno)); return (-1); } @@ -970,7 +973,7 @@ jailparam_type(struct jailparam *jp) if (sysctl(mib + 2, miblen / sizeof(int), NULL, &jp->jp_valuelen, NULL, 0) < 0) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(" SJPARAM ".%s): %s", jp->jp_name, + "sysctl(" SJPARAM ".%s): %s", name, strerror(errno)); return (-1); } @@ -995,10 +998,9 @@ jailparam_type(struct jailparam *jp) "sysctl(0.1): %s", strerror(errno)); return (-1); } - if (desclen == - sizeof(SJPARAM) + strlen(jp->jp_name) + 2 && + if (desclen == sizeof(SJPARAM) + strlen(name) + 2 && memcmp(SJPARAM ".", desc.s, sizeof(SJPARAM)) == 0 && - memcmp(jp->jp_name, desc.s + sizeof(SJPARAM), + memcmp(name, desc.s + sizeof(SJPARAM), desclen - sizeof(SJPARAM) - 2) == 0 && desc.s[desclen - 2] == '.') goto mib_desc; From owner-svn-src-all@FreeBSD.ORG Wed May 23 14:57:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31E70106566C; Wed, 23 May 2012 14:57:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id D208F8FC0C; Wed, 23 May 2012 14:57:06 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 4958525D385D; Wed, 23 May 2012 14:57:05 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 5B871BE7913; Wed, 23 May 2012 14:57:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id bL7JGtXK+vck; Wed, 23 May 2012 14:57:03 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0EE00BE7911; Wed, 23 May 2012 14:57:02 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201205230649.q4N6nofV053886@svn.freebsd.org> Date: Wed, 23 May 2012 14:56:59 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205230649.q4N6nofV053886@svn.freebsd.org> To: Xin LI X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235822 - in head: sys/dev/esp sys/gnu/fs/xfs/FreeBSD usr.sbin/ppp usr.sbin/rpc.lockd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 14:57:07 -0000 On 23. May 2012, at 06:49 , Xin LI wrote: > Author: delphij > Date: Wed May 23 06:49:50 2012 > New Revision: 235822 > URL: http://svn.freebsd.org/changeset/base/235822 >=20 > Log: > Fix build: >=20 > - Use %ll instead of %q for explicit long long casts; > - Use %j instead of %q in XFS and cast to intmax_t. >=20 > Tested with: make universe I am still seeing XLP64 failing to compile: cc1: warnings being treated as errors /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c: In function = 'g_flashmap_print': /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: format = '%08llx' expects type 'long long unsigned int', but argument 2 has type = 'off_t' [-Wformat] /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: format = '%08llx' expects type 'long long unsigned int', but argument 3 has type = 'off_t' [-Wformat] /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: format = '%llu' expects type 'long long unsigned int', but argument 5 has type = 'off_t' [-Wformat] --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Wed May 23 15:06:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54BC7106564A; Wed, 23 May 2012 15:06:14 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 267DD8FC18; Wed, 23 May 2012 15:06: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 q4NF6EVt079454; Wed, 23 May 2012 15:06:14 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NF6DVH079451; Wed, 23 May 2012 15:06:13 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205231506.q4NF6DVH079451@svn.freebsd.org> From: Joel Dahl Date: Wed, 23 May 2012 15:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235837 - in head/sbin: dump restore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 15:06:14 -0000 Author: joel (doc committer) Date: Wed May 23 15:06:13 2012 New Revision: 235837 URL: http://svn.freebsd.org/changeset/base/235837 Log: mdoc: move two sentences from synopsis to description (where they really belong). With this change, mandoc now formats these manpages properly. Modified: head/sbin/dump/dump.8 head/sbin/restore/restore.8 Modified: head/sbin/dump/dump.8 ============================================================================== --- head/sbin/dump/dump.8 Wed May 23 14:48:14 2012 (r235836) +++ head/sbin/dump/dump.8 Wed May 23 15:06:13 2012 (r235837) @@ -51,16 +51,6 @@ .Ar filesystem .Nm .Fl W | Fl w -.Pp -.Nm rdump -is an alternate name for -.Nm . -.Pp -.in \" XXX -(The -.Bx 4.3 -option syntax is implemented for backward compatibility, but -is not documented here.) .Sh DESCRIPTION The .Nm @@ -97,6 +87,14 @@ as either its device-special file or its (if that is in a standard entry in .Pa /etc/fstab ) . .Pp +.Nm +may also be invoked as +.Nm rdump . +The +.Bx 4.3 +option syntax is implemented for backward compatibility, but +is not documented here. +.Pp The following options are supported by .Nm : .Bl -tag -width Ds Modified: head/sbin/restore/restore.8 ============================================================================== --- head/sbin/restore/restore.8 Wed May 23 14:48:14 2012 (r235836) +++ head/sbin/restore/restore.8 Wed May 23 15:06:13 2012 (r235837) @@ -68,16 +68,6 @@ .Op Fl f Ar file | Fl P Ar pipecommand .Op Fl s Ar fileno .Op Ar -.Pp -.Nm rrestore -is an alternate name for -.Nm . -.Pp -.in \" XXX -(The -.Bx 4.3 -option syntax is implemented for backward compatibility, but -is not documented here.) .Sh DESCRIPTION The .Nm @@ -104,6 +94,14 @@ flag is specified (see below), the appearance of a directory name refers to the files and (recursively) subdirectories of that directory. .Pp +.Nm +may also be invoked as +.Nm rrestore . +The +.Bx 4.3 +option syntax is implemented for backward compatibility, but +is not documented here. +.Pp Exactly one of the following flags is required: .Bl -tag -width Ds .It Fl i From owner-svn-src-all@FreeBSD.ORG Wed May 23 15:29:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1498106567B; Wed, 23 May 2012 15:29:34 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D95BD8FC08; Wed, 23 May 2012 15:29: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 q4NFTYrk080720; Wed, 23 May 2012 15:29:34 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NFTYZc080713; Wed, 23 May 2012 15:29:34 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201205231529.q4NFTYZc080713@svn.freebsd.org> From: Jamie Gritton Date: Wed, 23 May 2012 15:29:34 +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: r235839 - in stable/9: lib/libc/sys usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 15:29:35 -0000 Author: jamie Date: Wed May 23 15:29:34 2012 New Revision: 235839 URL: http://svn.freebsd.org/changeset/base/235839 Log: MFC r234712, r234744, r234934, r234988, r235294, r235335, and bits of r235337 and r235355: A new jail(8) with a configuration file, ultimately to replace the work currently done by /etc/rc.d/jail. Added: stable/9/usr.sbin/jail/command.c - copied, changed from r234712, head/usr.sbin/jail/command.c stable/9/usr.sbin/jail/config.c - copied, changed from r234712, head/usr.sbin/jail/config.c stable/9/usr.sbin/jail/jail.conf.5 - copied, changed from r234712, head/usr.sbin/jail/jail.conf.5 stable/9/usr.sbin/jail/jaillex.l - copied, changed from r234712, head/usr.sbin/jail/jaillex.l stable/9/usr.sbin/jail/jailp.h - copied, changed from r234712, head/usr.sbin/jail/jailp.h stable/9/usr.sbin/jail/jailparse.y - copied unchanged from r234712, head/usr.sbin/jail/jailparse.y stable/9/usr.sbin/jail/state.c - copied unchanged from r234712, head/usr.sbin/jail/state.c Modified: stable/9/lib/libc/sys/jail.2 stable/9/usr.sbin/jail/Makefile stable/9/usr.sbin/jail/jail.8 stable/9/usr.sbin/jail/jail.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/usr.sbin/jail/ (props changed) Modified: stable/9/lib/libc/sys/jail.2 ============================================================================== --- stable/9/lib/libc/sys/jail.2 Wed May 23 15:10:41 2012 (r235838) +++ stable/9/lib/libc/sys/jail.2 Wed May 23 15:29:34 2012 (r235839) @@ -59,7 +59,7 @@ system call sets up a jail and locks the The argument is a pointer to a structure describing the prison: .Bd -literal -offset indent struct jail { - u_int32_t version; + uint32_t version; char *path; char *hostname; char *jailname; @@ -247,44 +247,6 @@ They return \-1 on failure, and set to indicate the error. .Pp .Rv -std jail_attach jail_remove -.Sh PRISON? -Once a process has been put in a prison, it and its descendants cannot escape -the prison. -.Pp -Inside the prison, the concept of -.Dq superuser -is very diluted. -In general, -it can be assumed that nothing can be mangled from inside a prison which -does not exist entirely inside that prison. -For instance the directory -tree below -.Dq Li path -can be manipulated all the ways a root can normally do it, including -.Dq Li "rm -rf /*" -but new device special nodes cannot be created because they reference -shared resources (the device drivers in the kernel). -The effective -.Dq securelevel -for a process is the greater of the global -.Dq securelevel -or, if present, the per-jail -.Dq securelevel . -.Pp -All IP activity will be forced to happen to/from the IP number specified, -which should be an alias on one of the network interfaces. -All connections to/from the loopback address -.Pf ( Li 127.0.0.1 -for IPv4, -.Li ::1 -for IPv6) will be changed to be to/from the primary address -of the jail for the given address family. -.Pp -It is possible to identify a process as jailed by examining -.Dq Li /proc//status : -it will show a field near the end of the line, either as -a single hyphen for a process at large, or the name currently -set for the prison for jailed processes. .Sh ERRORS The .Fn jail @@ -334,7 +296,7 @@ flag is not set. The jail referred to by a .Va jid is not accessible by the process, because the process is in a different -jail. +jail. .It Bq Er EEXIST The jail referred to by a .Va jid @@ -382,7 +344,7 @@ parameter does not exist. The jail referred to by a .Va jid is not accessible by the process, because the process is in a different -jail. +jail. .It Bq Er ENOENT The .Va lastjid @@ -415,7 +377,7 @@ and .Fn jail_attach call .Xr chroot 2 -internally, so it can fail for all the same reasons. +internally, so they can fail for all the same reasons. Please consult the .Xr chroot 2 manual page for details. Modified: stable/9/usr.sbin/jail/Makefile ============================================================================== --- stable/9/usr.sbin/jail/Makefile Wed May 23 15:10:41 2012 (r235838) +++ stable/9/usr.sbin/jail/Makefile Wed May 23 15:29:34 2012 (r235839) @@ -3,9 +3,14 @@ .include PROG= jail -MAN= jail.8 -DPADD= ${LIBJAIL} ${LIBUTIL} -LDADD= -ljail -lutil +MAN= jail.8 jail.conf.5 +SRCS= jail.c command.c config.c state.c jailp.h jaillex.l jailparse.y y.tab.h + +DPADD= ${LIBJAIL} ${LIBKVM} ${LIBUTIL} ${LIBL} +LDADD= -ljail -lkvm -lutil -ll + +YFLAGS+=-v +CFLAGS+=-I. -I${.CURDIR} .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 @@ -14,4 +19,6 @@ CFLAGS+= -DINET6 CFLAGS+= -DINET .endif +CLEANFILES= y.output + .include Copied and modified: stable/9/usr.sbin/jail/command.c (from r234712, head/usr.sbin/jail/command.c) ============================================================================== --- head/usr.sbin/jail/command.c Thu Apr 26 17:36:05 2012 (r234712, copy source) +++ stable/9/usr.sbin/jail/command.c Wed May 23 15:29:34 2012 (r235839) @@ -100,7 +100,7 @@ next_command(struct cfjail *j) if (j->comstring == NULL) { j->comparam += create_failed ? -1 : 1; switch ((comparam = *j->comparam)) { - case 0: + case IP__NULL: return 0; case IP_MOUNT_DEVFS: if (!bool_param(j->intparams[IP_MOUNT_DEVFS])) Copied and modified: stable/9/usr.sbin/jail/config.c (from r234712, head/usr.sbin/jail/config.c) ============================================================================== --- head/usr.sbin/jail/config.c Thu Apr 26 17:36:05 2012 (r234712, copy source) +++ stable/9/usr.sbin/jail/config.c Wed May 23 15:29:34 2012 (r235839) @@ -328,7 +328,7 @@ add_param(struct cfjail *j, const struct } } else { flags = PF_APPEND; - if (ipnum != 0) { + if (ipnum != IP__NULL) { name = intparams[ipnum].name; flags |= intparams[ipnum].flags; } else if ((cs = strchr(value, '='))) { @@ -350,7 +350,7 @@ add_param(struct cfjail *j, const struct } /* See if this parameter has already been added. */ - if (ipnum != 0) + if (ipnum != IP__NULL) dp = j->intparams[ipnum]; else TAILQ_FOREACH(dp, &j->params, tq) @@ -375,10 +375,10 @@ add_param(struct cfjail *j, const struct np->flags = flags; np->gen = 0; TAILQ_INSERT_TAIL(&j->params, np, tq); - if (ipnum != 0) + if (ipnum != IP__NULL) j->intparams[ipnum] = np; else - for (ipnum = 1; ipnum < IP_NPARAM; ipnum++) + for (ipnum = IP__NULL + 1; ipnum < IP_NPARAM; ipnum++) if (!(intparams[ipnum].flags & PF_CONV) && equalopts(name, intparams[ipnum].name)) { j->intparams[ipnum] = np; Modified: stable/9/usr.sbin/jail/jail.8 ============================================================================== --- stable/9/usr.sbin/jail/jail.8 Wed May 23 15:10:41 2012 (r235838) +++ stable/9/usr.sbin/jail/jail.8 Wed May 23 15:29:34 2012 (r235839) @@ -1,6 +1,5 @@ -.\" .\" Copyright (c) 2000, 2003 Robert N. M. Watson -.\" Copyright (c) 2008 James Gritton +.\" Copyright (c) 2008-2012 James Gritton .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,186 +23,263 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" -.\" ---------------------------------------------------------------------------- -.\" "THE BEER-WARE LICENSE" (Revision 42): -.\" wrote this file. As long as you retain this notice you -.\" can do whatever you want with this stuff. If we meet some day, and you think -.\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp -.\" ---------------------------------------------------------------------------- -.\" .\" $FreeBSD$ .\" -.Dd February 29, 2012 +.Dd May 23, 2012 .Dt JAIL 8 .Os .Sh NAME .Nm jail -.Nd "create or modify a system jail" +.Nd "manage system jails" .Sh SYNOPSIS .Nm -.Op Fl dhi +.Op Fl dhilqv .Op Fl J Ar jid_file -.Op Fl l u Ar username | Fl U Ar username -.Op Fl c | m -.Op Ar parameter=value ... +.Op Fl u Ar username +.Op Fl U Ar username +.Op Fl cmr +.Ar param Ns = Ns Ar value ... +.Op Cm command Ns = Ns Ar command ... .Nm -.Op Fl hi -.Op Fl n Ar jailname +.Op Fl dqv +.Op Fl f Ar conf_file +.Op Fl p Ar limit +.Op Fl cmr +.Op Ar jail +.Nm +.Op Fl qv +.Op Fl f Ar conf_file +.Op Fl rR +.Op Cm * | Ar jail ... +.Nm +.Op Fl dhilqv .Op Fl J Ar jid_file +.Op Fl u Ar username +.Op Fl U Ar username +.Op Fl n Ar jailname .Op Fl s Ar securelevel -.Op Fl l u Ar username | Fl U Ar username -.Op Ar path hostname [ip[,..]] command ... -.Nm -.Op Fl r Ar jail +.Op Ar path hostname [ Ar ip Ns [ Ns Ar ,... Ns ]] Ar command ... .Sh DESCRIPTION The .Nm -utility creates a new jail or modifies an existing jail, optionally -imprisoning the current process (and future descendants) inside it. +utility creates new jails, or modifies or removes existing jails. +A jail is specified via parameters on the command line, or in the +.Xr jail.conf 5 +file. +.Pp +At least one of the options +.Fl c , +.Fl m +or +.Fl r +must be specified. +These options are used alone or in combination describe the operation to +perform: +.Bl -tag -width indent +.It Fl c +Create a new jail. +The jail +.Va jid +and +.Va name +parameters (if specified) on the command line, +or any jails +must not refer to an existing jail. +.It Fl m +Modify an existing jail. +One of the +.Va jid +or +.Va name +parameters must exist and refer to an existing jail. +Some parameters may not be changed on a running jail. +.It Fl r +Remove the +.Ar jail +specified by jid or name. +All jailed processes are killed, and all children of this jail are also +removed. +.It Fl rc +Restart an existing jail. +The jail is first removed and then re-created, as if +.Dq Nm Fl c +and +.Dq Nm Fl r +were run in succession. +.It Fl cm +Create a jail if it does not exist, or modify the jail if it does exist. +.It Fl mr +Modify an existing jail. +The jail may be restarted if necessary to modify parameters than could +not otherwise be changed. +.It Fl cmr +Create a jail if it doesn't exist, or modify (and possibly restart) the +jail if it does exist. +.El .Pp -The options are as follows: +Other available options are: .Bl -tag -width indent .It Fl d -Allow making changes to a dying jail. +Allow making changes to a dying jail, equivalent to the +.Va allow.dying +parameter. +.It Fl f Ar conf_file +Use configuration file +.Ar conf_file +instead of the default +.Pa /etc/jail.conf . .It Fl h Resolve the .Va host.hostname parameter (or .Va hostname ) and add all IP addresses returned by the resolver -to the list of -.Va ip -addresses for this prison. -This may affect default address selection for outgoing IPv4 connections -of prisons. -The address first returned by the resolver for each address family -will be used as primary address. -See the -.Va ip4.addr -and -.Va ip6.addr -parameters further down for details. -.It Fl i -Output the jail identifier of the newly created jail. -.It Fl n Ar jailname -Set the jail's name. -This is deprecated and is equivalent to setting the -.Va name +to the list of addresses for this prison. +This is equivalent to the +.Va ip_hostname parameter. +.It Fl i +Output (only) the jail identifier of the newly created jail(s). +This implies the +.Fl q +option. .It Fl J Ar jid_file Write a .Ar jid_file -file, containing jail identifier, path, hostname, IP and -command used to start the jail. +file, containing parameters used to start the jail. .It Fl l -Run program in the clean environment. -The environment is discarded except for -.Ev HOME , SHELL , TERM -and -.Ev USER . -.Ev HOME -and -.Ev SHELL -are set to the target login's default values. -.Ev USER -is set to the target login. -.Ev TERM -is imported from the current environment. -The environment variables from the login class capability database for the -target login are also set. +Run commands in a clean environment. +This is deprecated and is equivalent to the exec.clean parameter. +.It Fl n Ar jailname +Set the jail's name. +This is deprecated and is equivalent to the +.Va name +parameter. +.It Fl p Ar limit +Limit the number of commands from +.Va exec.* +that can run simultaneously. +.It Fl q +Suppress the message printed whenever a jail is created, modified or removed. +Only error messages will be printed. +.It Fl R +A variation of the +.Fl r +option that removes an existing jail without using the configuration file. +No removal-related parameters for this jail will be used - the jail will +simply be removed. .It Fl s Ar securelevel Set the .Va kern.securelevel MIB entry to the specified value inside the newly created jail. -This is deprecated and is equivalent to setting the +This is deprecated and is equivalent to the .Va securelevel parameter. .It Fl u Ar username -The user name from host environment as whom the -.Ar command -should run. -.It Fl U Ar username -The user name from jailed environment as whom the -.Ar command -should run. -.It Fl c -Create a new jail. -The -.Va jid +The user name from host environment as whom jailed commands should run. +This is deprecated and is equivalent to the +.Va exec.jail_user and -.Va name -parameters (if specified) must not refer to an existing jail. -.It Fl m -Modify an existing jail. -One of the -.Va jid -or -.Va name -parameters must exist and refer to an existing jail. -.It Fl cm -Create a jail if it does not exist, or modify a jail if it does exist. -.It Fl r -Remove the -.Ar jail -specified by jid or name. -All jailed processes are killed, and all children of this jail are also -removed. +.Va exec.system_jail_user +parameters. +.It Fl U Ar username +The user name from jailed environment as whom jailed commands should run. +This is deprecated and is equivalent to the +.Va exec.jail_user +parameter. +.It Fl v +Print a message on every operation, such as running commands and +mounting filesystems. .El .Pp -At least one of the -.Fl c , -.Fl m -or +If no arguments are given after the options, the operation (except +remove) will be performed on all jails specified in the +.Xr jail.conf 5 +file. +A single argument of a jail name will operate only on the specified jail. +The .Fl r -options must be specified. -.Pp -.Ar Parameters -are listed in -.Dq name=value -form, following the options. -Some parameters are boolean, and do not have a value but are set by the -name alone with or without a -.Dq no -prefix, e.g. -.Va persist -or -.Va nopersist . -Any parameters not set will be given default values, often based on the -current environment. +and +.Fl R +options can also remove running jails that aren't in the +.Xr jail.conf 5 +file, specified by name or jid. +.Pp +An argument of +.Dq * +is a wildcard that will operate on all jails, regardless of whether +they appear in +.Xr jail.conf 5 ; +this is the surest way for +.Fl r +to remove all jails. +If hierarchical jails exist, a partial-matching wildcard definition may +be specified. +For example, an argument of +.Dq foo.* +would apply to jails with names like +.Dq foo.bar +and +.Dq foo.bar.baz . .Pp -The pseudo-parameter -.Va command -specifies that the current process should enter the new (or modified) jail, -and run the specified command. -It must be the last parameter specified, because it includes not only -the value following the -.Sq = -sign, but also passes the rest of the arguments to the command. -.Pp -Instead of supplying named -.Ar parameters , -four fixed parameters may be supplied in order on the command line: +A jail may be specified with parameters directly on the command line. +In this case, the +.Xr jail.conf 5 +file will not be used. +For backward compatibility, the command line may also have four fixed +parameters, without names: .Ar path , .Ar hostname , .Ar ip , and .Ar command . -As the -.Va jid -and -.Va name -parameters aren't in this list, this mode will always create a new jail, and -the +This mode will always create a new jail, and the .Fl c and .Fl m options don't apply (and must not exist). +.Ss Jail Parameters +Parameters in the +.Xr jail.conf 5 +file, or on the command line, are generally in +.Dq name=value +form. +Some parameters are boolean, and do not have a value but are set by the +name alone with or without a +.Dq no +prefix, e.g. +.Va persist +or +.Va nopersist . +They can also be given the values +.Dq true +and +.Dq false . +Other partameters may have more than one value, specified as a +comma-separated list or with +.Dq += +in the configuration file (see +.Xr jail.conf 5 +for details). .Pp -Jails have a set a core parameters, and modules can add their own jail -parameters. +The +.Nm +utility recognizes two classes of parameters. There are the true jail +parameters that are passed to the kernel when the jail is created, +can be seen with +.Xr jls 8 , +and can (usually) be changed with +.Dq Nm Fl m. +Then there are pseudo-parameters that are only used by +.Nm +itself. +.Pp +Jails have a set a core parameters, and kernel modules can add their own +jail parameters. The current set of available parameters can be retrieved via .Dq Nm sysctl Fl d Va security.jail.param . +Any parameters not set will be given default values, often based on the +current environment. The core parameters are: .Bl -tag -width indent .It Va jid @@ -231,14 +307,21 @@ If no .Va name is supplied, a default is assumed that is the same as the .Va jid . -.It Va path -Directory which is to be the root of the prison. The -.Va command -(if any) is run from this directory, as are commands from -.Xr jexec 8 . +.Va name +parameter is implied by the +.Xr jail.conf 5 +file format, and need not be explicitly set when using the configuration +file. +.It Va path +The directory which is to be the root of the prison. +Any commands run inside the prison, either by +.Nm +or from +.Xr jexec 8 , +are run from this directory. .It Va ip4.addr -A comma-separated list of IPv4 addresses assigned to the prison. +A list of IPv4 addresses assigned to the prison. If this is set, the jail is restricted to using only these addresses. Any attempts to use other addresses fail, and attempts to use wildcard addresses silently use the jailed address instead. @@ -252,7 +335,7 @@ assigned to itself. A boolean option to change the formerly mentioned behaviour and disable IPv4 source address selection for the prison in favour of the primary IPv4 address of the jail. -Source address selection is enabled by default for all jails and a +Source address selection is enabled by default for all jails and the .Va ip4.nosaddrsel setting of a parent jail is not inherited for any child jails. .It Va ip4 @@ -277,8 +360,20 @@ A set of IPv6 options for the prison, th and .Va ip4 above. +.It vnet +Create the prison with its own virtual network stack, +with its own network interfaces, addresses, routing table, etc. +The kernel must have been compiled with the +.Sy VIMAGE option +for this to be available. +Possible values are +.Dq inherit +to use the system network stack, possibly with restricted IP addresses, +and +.Dq new +to create a new network stack. .It Va host.hostname -Hostname of the prison. +The hostname of the prison. Other similar parameters are .Va host.domainname , .Va host.hostuuid @@ -314,13 +409,24 @@ permissions are effective and .Va enforce_statfs is set to a value lower than 2. Devfs rules and rulesets cannot be viewed or modified from inside a jail. +.Pp +NOTE: It is important that only appropriate device nodes in devfs be +exposed to a jail; access to disk devices in the jail may permit processes +in the jail to bypass the jail sandboxing by modifying files outside of +the jail. +See +.Xr devfs 8 +for information on how to use devfs rules to limit access to entries +in the per-jail devfs. +A simple devfs ruleset for jails is available as ruleset #4 in +.Pa /etc/defaults/devfs.rules . .It Va children.max The number of child jails allowed to be created by this jail (or by other jails under this jail). This limit is zero by default, indicating the jail is not allowed to create child jails. See the -.Va "Hierarchical Jails" +.Sx "Hierarchical Jails" section for more information. .It Va children.cur The number of descendents of this jail, including its own child jails @@ -345,10 +451,13 @@ where the jail's chroot directory is loc .It Va persist Setting this boolean parameter allows a jail to exist without any processes. -Normally, a jail is destroyed as its last process exits. +Normally, a command is run as part of jail creation, and then the jail +is destroyed as its last process exits. A new jail must have either the .Va persist parameter or +.Va exec.start +or .Va command pseudo-parameter set. .It Va cpuset.id @@ -459,6 +568,171 @@ have not had jail functionality added to .El .El .Pp +There are pseudo-parameters that aren't passed to the kernel, but are +used by +.Nm +to set up the prison environment, often by running specified commands +when jails are created or removed. +The +.Va exec.* +command parameters are +.Xr sh 1 +command lines that are run in either the system or prison environment. +They may be given multiple values, which run would the specified +commands in sequence. +All commands must succed (return a zero exit status), or the jail will +not be created or removed. +.Pp +The pseudo-parameters are: +.Bl -tag -width indent +.It Va exec.prestart +Command(s) to run in the system environment before a prison is created. +.It Va exec.start +Command(s) to run in the prison environment when a jail is created. +A typical command to run is +.Dq sh /etc/rc . +.It Va command +A synonym for +.Va exec.start +for use when specifying a prison directly on the command line. +Unlike other parameters whose value is a single string, +.Va command +uses the remainder of the +.Nm +command line as its own arguments. +.It Va exec.poststart +Command(s) to run in the system environment after a jail is created, +and after any +.Va exec.start +commands have completed. +.It Va exec.prestop +Command(s) to run in the system environment before a jail is removed. +.It Va exec.stop +Command(s) to run in the prison environment before a jail is removed, +and after any +.Va exec.prestop +commands have completed. +A typical command to run is +.Dq sh /etc/rc.shutdown . +.It Va exec.poststop +Command(s) to run in the system environment after a jail is removed. +.It Va exec.clean +Run commands in a clean environment. +The environment is discarded except for +.Ev HOME , SHELL , TERM +and +.Ev USER . +.Ev HOME +and +.Ev SHELL +are set to the target login's default values. +.Ev USER +is set to the target login. +.Ev TERM +is imported from the current environment. +The environment variables from the login class capability database for the +target login are also set. +.It Va exec.jail_user +The user to run commands as, when running in the prison environment. +The default is to run the commands as the current user. +.It Va exec.system_jail_user +This boolean option looks for the +.Va exec.jail_user +in the system +.Xr passwd 5 +file, instead of in the prison's file. +.It Va exec.system_user +The user to run commands as, when running in the system environment. +The default is to run the commands as the current user. +.It Va exec.timeout +The maximum amount of time to wait for a command to complete. +If a command is still running after this many seconds have passed, +the jail not be created or removed. +.It Va exec.consolelog +A file to direct command output (stdout and stderr) to. +.It Va exec.fib +The FIB (routing table) to set when running commands inside the prison. +.It Va stop.timeout +The maximum amount of time to wait for a prison's processes to exit +after sending them a +.Dv SIGTERM +signal (which happens after the +.Va exec.stop commands have completed). +After this many seconds have passed, the prison will be removed, which +will kill any remaining processes. +If this is set to zero, no +.Dv SIGTERM +is sent and the prison is immediately removed. +The default is 10 seconds. +.It Va interface +A network interface to add the prison's IP addresses +.Va ( ip4.addr +and +.Va ip6.addr ) +to. +An alias for each address will be added to the interface before the +prison is created, and will be removed from the interface after the +prison is removed. +.It Op Va ip4.addr +In addition to the IP addresses that are passed to the kernel, and +interface and/or a netmask may also be specified, in the form +.Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar netmask . +If an interface is given before the IP address, an alias for the address +will be added to that interface, as it is with the +.Va interface +parameter. If a netmask in either dotted-quad or CIDR form is given +after IP address, it will be used when adding the IP alias. +.It Op Va ip6.addr +In addition to the IP addresses that are passed to the kernel, +and interface and/or a prefix may also be specified, in the form +.Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar prefix . +.It Va vnet.interface +A network interface to give to a vnet-enabled jail after is it created. +The interface will automatically be returned when the jail is removed. +.It Va ip_hostname +Resolve the +.Va host.hostname +parameter and add all IP addresses returned by the resolver +to the list of addresses +.Va ( ip4.addr +or +.Va ip6.addr ) +for this prison. +This may affect default address selection for outgoing IPv4 connections +of prisons. +The address first returned by the resolver for each address family +will be used as primary address. +.It Va mount +A filesystem to mount before creating the jail (and to unmount after +removing it), given as a single +.Xr fstab 5 +line. +.It Va mount.fstab +An +.Xr fstab 5 +format file containing filesystems to mount before creating a jail. +.It Va mount.devfs +Mount a +.Xr devfs +filesystem on the chrooted /dev directory, and apply the ruleset in the +.Va devfs_ruleset +parameter (or a default of ruleset 4: devfsrules_jail) +to restrict the devices visible inside the prison. +.It Va allow.dying +Allow making changes to a +.Va dying +jail. +.It Va depend +Specify a jail (or jails) that this jail depends on. +Any such jails must be fully created, up to the last +.Va exec.poststart +command, before any action will taken to create this jail. +When jails are removed the opposite is true: +this jail must be fully removed, up to the last +.Va exec.poststop +command, before the jail(s) it depends on are stopped. +.El +.Sh EXAMPLES Jails are typically set up using one of two philosophies: either to constrain a specific application (possibly running with privilege), or to create a @@ -476,7 +750,6 @@ process. This manual page documents the configuration steps necessary to support either of these steps, although the configuration steps may be refined based on local requirements. -.Sh EXAMPLES .Ss "Setting up a Jail Directory Tree" To set up a jail directory tree containing an entire .Fx @@ -489,20 +762,8 @@ cd /usr/src mkdir -p $D make world DESTDIR=$D make distribution DESTDIR=$D -mount -t devfs devfs $D/dev .Ed .Pp -NOTE: It is important that only appropriate device nodes in devfs be -exposed to a jail; access to disk devices in the jail may permit processes -in the jail to bypass the jail sandboxing by modifying files outside of -the jail. -See -.Xr devfs 8 -for information on how to use devfs rules to limit access to entries -in the per-jail devfs. -A simple devfs ruleset for jails is available as ruleset #4 in -.Pa /etc/defaults/devfs.rules . -.Pp In many cases this example would put far more in the jail than needed. In the other extreme case a jail might contain only one file: the executable to be run in the jail. @@ -520,8 +781,9 @@ Do what was described in to build the jail directory tree. For the sake of this example, we will assume you built it in -.Pa /data/jail/192.0.2.100 , -named for the jailed IP address. +.Pa /data/jail/testjail , +for a jail named +.Dq testjail . Substitute below as needed with your own directory, IP address, and hostname. .Ss "Setting up the Host Environment" @@ -619,7 +881,7 @@ or for running a virtual server. .Pp Start a shell in the jail: .Bd -literal -offset indent -jail -c path=/data/jail/192.0.2.100 host.hostname=testhostname \\ +jail -c path=/data/jail/testjail mount.devfs host.hostname=testhostname \\ ip4.addr=192.0.2.100 command=/bin/sh .Ed .Pp @@ -633,15 +895,6 @@ etc. .Pp .Bl -bullet -offset indent -compact .It -Create an empty -.Pa /etc/fstab -to quell startup warnings about missing fstab (virtual server only) -.It -Disable the port mapper -.Pa ( /etc/rc.conf : -.Li rpcbind_enable="NO" ) -(virtual server only) -.It Configure .Pa /etc/resolv.conf so that name resolution within the jail will work correctly @@ -652,11 +905,6 @@ to quell .Xr sendmail 8 warnings. .It -Disable interface configuration to quell startup warnings about -.Xr ifconfig 8 -.Pq Li network_interfaces="" -(virtual server only) -.It Set a root password, probably different from the real host system .It Set the timezone @@ -674,36 +922,47 @@ If you are not using a virtual server, y .Xr syslogd 8 in the host environment to listen on the syslog socket in the jail environment; in this example, the syslog socket would be stored in -.Pa /data/jail/192.0.2.100/var/run/log . +.Pa /data/jail/testjail/var/run/log . .Pp Exit from the shell, and the jail will be shut down. .Ss "Starting the Jail" You are now ready to restart the jail and bring up the environment with all of its daemons and other programs. -If you are running a single application in the jail, substitute the -command used to start the application for -.Pa /etc/rc -in the examples below. +Create an entry for the jail in +.Pa /etc/jail.conf : +.Bd -literal -offset indent +testjail { + path = /tmp/jail/testjail; + mount.devfs; + host.hostname = testhostname; + ip4.addr = 192.0.2.100; + interface = ed0; + exec.start = "/bin/sh /etc/rc"; + exec.stop = "/bin/sh /etc/rc.shutdown"; +} +.Ed +.Pp To start a virtual server environment, .Pa /etc/rc -is run to launch various daemons and services. -To do this, first bring up the -virtual host interface, and then start the jail's -.Pa /etc/rc -script from within the jail. +is run to launch various daemons and services, and +.Pa /etc/rc.shutdown +is run to shut them down when the jail is removed. +If you are running a single application in the jail, +substitute the command used to start the application for +.Dq /bin/sh /etc/rc ; +there may be some script available to cleanly shut down the application, +or it may be sufficient to go without a stop command, and have +.Nm +send +.Dv SIGTERM +to the application. +.Pp +Start the jail by running: .Bd -literal -offset indent -ifconfig ed0 inet alias 192.0.2.100/32 -mount -t procfs proc /data/jail/192.0.2.100/proc -jail -c path=/data/jail/192.0.2.100 host.hostname=testhostname \\ - ip4.addr=192.0.2.100 command=/bin/sh /etc/rc +jail -c testjail .Ed .Pp -A few warnings will be produced, because most -.Xr sysctl 8 -configuration variables cannot be set from within the jail, as they are -global across all jails and the host environment. -However, it should all -work properly. +A few warnings may be produced; however, it should all work properly. You should be able to see .Xr inetd 8 , .Xr syslogd 8 , @@ -726,15 +985,6 @@ Please refer to the variables in .Xr rc.conf 5 for more information. -The -.Xr rc 8 -jail script provides a flexible system to start/stop jails: -.Bd -literal -/etc/rc.d/jail start -/etc/rc.d/jail stop -/etc/rc.d/jail start myjail -/etc/rc.d/jail stop myjail -.Ed .Ss "Managing the Jail" Normal machine shutdown commands, such as .Xr halt 8 , @@ -742,9 +992,8 @@ Normal machine shutdown commands, such a and .Xr shutdown 8 , cannot be used successfully within the jail. -To kill all processes in a -jail, you may log into the jail and, as root, use one of the following -commands, depending on what you want to accomplish: +To kill all processes from within a jail, you may use one of the +following commands, depending on what you want to accomplish: .Bd -literal -offset indent kill -TERM -1 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed May 23 15:30:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D2ADD1065670; Wed, 23 May 2012 15:30:13 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE3BE8FC0C; Wed, 23 May 2012 15:30: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 q4NFUD3k080793; Wed, 23 May 2012 15:30:13 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NFUDIv080790; Wed, 23 May 2012 15:30:13 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201205231530.q4NFUDIv080790@svn.freebsd.org> From: Jamie Gritton Date: Wed, 23 May 2012 15:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235840 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 15:30:13 -0000 Author: jamie Date: Wed May 23 15:30:13 2012 New Revision: 235840 URL: http://svn.freebsd.org/changeset/base/235840 Log: Note that the new jail(8) will be appearing in 9.1. Modified: head/usr.sbin/jail/jail.8 head/usr.sbin/jail/jail.conf.5 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Wed May 23 15:29:34 2012 (r235839) +++ head/usr.sbin/jail/jail.8 Wed May 23 15:30:13 2012 (r235840) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2012 +.Dd May 23, 2012 .Dt JAIL 8 .Os .Sh NAME @@ -1183,7 +1183,7 @@ utility appeared in Hierarchical/extensible jails were introduced in .Fx 8.0 . The configuration file was introduced in -.Fx 10.0 . +.Fx 9.1 . .Sh AUTHORS .An -nosplit The jail feature was written by Modified: head/usr.sbin/jail/jail.conf.5 ============================================================================== --- head/usr.sbin/jail/jail.conf.5 Wed May 23 15:29:34 2012 (r235839) +++ head/usr.sbin/jail/jail.conf.5 Wed May 23 15:30:13 2012 (r235840) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2012 +.Dd May 23, 2012 .Dt JAIL.CONF 5 .Os .Sh NAME @@ -217,7 +217,7 @@ utility appeared in The .Nm file was added in -.Fx 10.0 . +.Fx 9.1 . .Sh AUTHORS .An -nosplit The jail feature was written by From owner-svn-src-all@FreeBSD.ORG Wed May 23 15:47:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C6491065674; Wed, 23 May 2012 15:47:08 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D6808FC14; Wed, 23 May 2012 15:47: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 q4NFl8Ui081740; Wed, 23 May 2012 15:47:08 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NFl7sN081737; Wed, 23 May 2012 15:47:07 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201205231547.q4NFl7sN081737@svn.freebsd.org> From: Jamie Gritton Date: Wed, 23 May 2012 15:47:07 +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: r235841 - stable/8/usr.sbin/jls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 15:47:08 -0000 Author: jamie Date: Wed May 23 15:47:07 2012 New Revision: 235841 URL: http://svn.freebsd.org/changeset/base/235841 Log: MFC r222465, r223224, r224841, r232613: Check for IPv4 or IPv6 to be available by the kernel to not provoke errors trying to query options not available. Make it possible to compile out INET or INET6 only parts. PR: bin/161957 Modified: stable/8/usr.sbin/jls/Makefile stable/8/usr.sbin/jls/jls.c Directory Properties: stable/8/usr.sbin/jls/ (props changed) Modified: stable/8/usr.sbin/jls/Makefile ============================================================================== --- stable/8/usr.sbin/jls/Makefile Wed May 23 15:30:13 2012 (r235840) +++ stable/8/usr.sbin/jls/Makefile Wed May 23 15:47:07 2012 (r235841) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= jls MAN= jls.8 DPADD= ${LIBJAIL} @@ -7,4 +9,11 @@ LDADD= -ljail WARNS?= 6 +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+= -DINET6 +.endif +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif + .include Modified: stable/8/usr.sbin/jls/jls.c ============================================================================== --- stable/8/usr.sbin/jls/jls.c Wed May 23 15:30:13 2012 (r235840) +++ stable/8/usr.sbin/jls/jls.c Wed May 23 15:47:07 2012 (r235841) @@ -59,6 +59,12 @@ __FBSDID("$FreeBSD$"); static struct jailparam *params; static int *param_parent; static int nparams; +#ifdef INET6 +static int ip6_ok; +#endif +#ifdef INET +static int ip4_ok; +#endif static int add_param(const char *name, void *value, size_t valuelen, struct jailparam *source, unsigned flags); @@ -112,6 +118,13 @@ main(int argc, char **argv) errx(1, "usage: jls [-dhnqv] [-j jail] [param ...]"); } +#ifdef INET6 + ip6_ok = feature_present("inet6"); +#endif +#ifdef INET + ip4_ok = feature_present("inet"); +#endif + /* Add the parameters to print. */ if (optind == argc) { if (pflags & (PRINT_HEADER | PRINT_NAMEVAL)) @@ -124,13 +137,24 @@ main(int argc, char **argv) add_param("name", NULL, (size_t)0, NULL, JP_USER); add_param("dying", NULL, (size_t)0, NULL, JP_USER); add_param("cpuset.id", NULL, (size_t)0, NULL, JP_USER); - add_param("ip4.addr", NULL, (size_t)0, NULL, JP_USER); - add_param("ip6.addr", NULL, (size_t)0, NULL, - JP_USER | JP_OPT); +#ifdef INET + if (ip4_ok) + add_param("ip4.addr", NULL, (size_t)0, NULL, + JP_USER); +#endif +#ifdef INET6 + if (ip6_ok) + add_param("ip6.addr", NULL, (size_t)0, NULL, + JP_USER | JP_OPT); +#endif } else { pflags |= PRINT_DEFAULT; add_param("jid", NULL, (size_t)0, NULL, JP_USER); - add_param("ip4.addr", NULL, (size_t)0, NULL, JP_USER); +#ifdef INET + if (ip4_ok) + add_param("ip4.addr", NULL, (size_t)0, NULL, + JP_USER); +#endif add_param("host.hostname", NULL, (size_t)0, NULL, JP_USER); add_param("path", NULL, (size_t)0, NULL, JP_USER); @@ -327,7 +351,7 @@ print_jail(int pflags, int jflags) { char *nname; char **param_values; - int i, ai, jid, count, spc; + int i, ai, jid, count, n, spc; char ipbuf[INET6_ADDRSTRLEN]; jid = jailparam_get(params, nparams, jflags); @@ -345,31 +369,47 @@ print_jail(int pflags, int jflags) *(int *)params[4].jp_value ? "DYING" : "ACTIVE", "", *(int *)params[5].jp_value); - count = params[6].jp_valuelen / sizeof(struct in_addr); - for (ai = 0; ai < count; ai++) - if (inet_ntop(AF_INET, - &((struct in_addr *)params[6].jp_value)[ai], - ipbuf, sizeof(ipbuf)) == NULL) - err(1, "inet_ntop"); - else - printf("%6s %-15.15s\n", "", ipbuf); - if (!strcmp(params[7].jp_name, "ip6.addr")) { - count = params[7].jp_valuelen / sizeof(struct in6_addr); + n = 6; +#ifdef INET + if (ip4_ok && !strcmp(params[n].jp_name, "ip4.addr")) { + count = params[n].jp_valuelen / sizeof(struct in_addr); + for (ai = 0; ai < count; ai++) + if (inet_ntop(AF_INET, + &((struct in_addr *)params[n].jp_value)[ai], + ipbuf, sizeof(ipbuf)) == NULL) + err(1, "inet_ntop"); + else + printf("%6s %-15.15s\n", "", ipbuf); + n++; + } +#endif +#ifdef INET6 + if (ip6_ok && !strcmp(params[n].jp_name, "ip6.addr")) { + count = params[n].jp_valuelen / sizeof(struct in6_addr); for (ai = 0; ai < count; ai++) if (inet_ntop(AF_INET6, - &((struct in6_addr *)params[7].jp_value)[ai], + &((struct in6_addr *) + params[n].jp_value)[ai], ipbuf, sizeof(ipbuf)) == NULL) err(1, "inet_ntop"); else printf("%6s %s\n", "", ipbuf); + n++; } +#endif } else if (pflags & PRINT_DEFAULT) printf("%6d %-15.15s %-29.29s %.74s\n", *(int *)params[0].jp_value, - params[1].jp_valuelen == 0 ? "-" +#ifdef INET + (!ip4_ok || params[1].jp_valuelen == 0) ? "-" : inet_ntoa(*(struct in_addr *)params[1].jp_value), - (char *)params[2].jp_value, - (char *)params[3].jp_value); + (char *)params[2-!ip4_ok].jp_value, + (char *)params[3-!ip4_ok].jp_value); +#else + "-", + (char *)params[1].jp_value, + (char *)params[2].jp_value); +#endif else { param_values = alloca(nparams * sizeof(*param_values)); for (i = 0; i < nparams; i++) { From owner-svn-src-all@FreeBSD.ORG Wed May 23 16:19:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4F5F106566C; Wed, 23 May 2012 16:19:19 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D02198FC14; Wed, 23 May 2012 16:19:19 +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 q4NGJJAB083071; Wed, 23 May 2012 16:19:19 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NGJJRE083069; Wed, 23 May 2012 16:19:19 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201205231619.q4NGJJRE083069@svn.freebsd.org> From: Warren Block Date: Wed, 23 May 2012 16:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235842 - head/bin/uuidgen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 16:19:20 -0000 Author: wblock (doc committer) Date: Wed May 23 16:19:19 2012 New Revision: 235842 URL: http://svn.freebsd.org/changeset/base/235842 Log: Mention the upper hard limit for -n option. Patch slightly modified from PR version. PR: 168255 Submitted by: Andy Kosela Approved by: gjb MFC after: 3 days Modified: head/bin/uuidgen/uuidgen.1 Modified: head/bin/uuidgen/uuidgen.1 ============================================================================== --- head/bin/uuidgen/uuidgen.1 Wed May 23 15:47:07 2012 (r235841) +++ head/bin/uuidgen/uuidgen.1 Wed May 23 16:19:19 2012 (r235842) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 7, 2005 +.Dd May 23, 2012 .Dt UUIDGEN 1 .Os .Sh NAME @@ -52,8 +52,11 @@ instructs to not generate them in batch, but one at a time. .It Fl n This option controls the number of identifiers generated. -By default, multiple -identifiers are generated in batch. +By default, multiple identifiers are generated in batch. +The upper hard limit is 2048 +.Po see +.Xr uuidgen 2 +.Pc . .It Fl o Redirect output to .Ar filename From owner-svn-src-all@FreeBSD.ORG Wed May 23 16:43:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D391106564A; Wed, 23 May 2012 16:43:17 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3798E8FC08; Wed, 23 May 2012 16:43: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 q4NGhHQ0084057; Wed, 23 May 2012 16:43:17 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NGhHbt084055; Wed, 23 May 2012 16:43:17 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205231643.q4NGhHbt084055@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 23 May 2012 16:43: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: r235843 - stable/9/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 16:43:17 -0000 Author: bschmidt Date: Wed May 23 16:43:16 2012 New Revision: 235843 URL: http://svn.freebsd.org/changeset/base/235843 Log: MFC r235684: Add some more 100/130 series device IDs. Modified: stable/9/sys/dev/iwn/if_iwn.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/9/sys/dev/iwn/if_iwn.c Wed May 23 16:19:19 2012 (r235842) +++ stable/9/sys/dev/iwn/if_iwn.c Wed May 23 16:43:16 2012 (r235843) @@ -92,6 +92,9 @@ static const struct iwn_ident iwn_ident_ { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" }, + { 0x8086, 0x0887, "Intel Centrino Wireless-N 130" }, + { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" }, + { 0x8086, 0x08af, "Intel Centrino Wireless-N 100" }, { 0x8086, 0x4229, "Intel Wireless WiFi Link 4965" }, { 0x8086, 0x422b, "Intel Centrino Ultimate-N 6300" }, { 0x8086, 0x422c, "Intel Centrino Advanced-N 6200" }, From owner-svn-src-all@FreeBSD.ORG Wed May 23 16:43:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ED6710657DC; Wed, 23 May 2012 16:43:38 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4984B8FC08; Wed, 23 May 2012 16:43: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 q4NGhcow084108; Wed, 23 May 2012 16:43:38 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NGhcxD084106; Wed, 23 May 2012 16:43:38 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205231643.q4NGhcxD084106@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 23 May 2012 16:43:38 +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: r235844 - stable/8/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 16:43:38 -0000 Author: bschmidt Date: Wed May 23 16:43:37 2012 New Revision: 235844 URL: http://svn.freebsd.org/changeset/base/235844 Log: MFC r235684: Add some more 100/130 series device IDs. Modified: stable/8/sys/dev/iwn/if_iwn.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Wed May 23 16:43:16 2012 (r235843) +++ stable/8/sys/dev/iwn/if_iwn.c Wed May 23 16:43:37 2012 (r235844) @@ -92,6 +92,9 @@ static const struct iwn_ident iwn_ident_ { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" }, + { 0x8086, 0x0887, "Intel Centrino Wireless-N 130" }, + { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" }, + { 0x8086, 0x08af, "Intel Centrino Wireless-N 100" }, { 0x8086, 0x4229, "Intel Wireless WiFi Link 4965" }, { 0x8086, 0x422b, "Intel Centrino Ultimate-N 6300" }, { 0x8086, 0x422c, "Intel Centrino Advanced-N 6200" }, From owner-svn-src-all@FreeBSD.ORG Wed May 23 17:03:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB6C1106567F; Wed, 23 May 2012 17:03:09 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96E258FC15; Wed, 23 May 2012 17:03: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 q4NH39fo085009; Wed, 23 May 2012 17:03:09 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NH39Yq085007; Wed, 23 May 2012 17:03:09 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201205231703.q4NH39Yq085007@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 23 May 2012 17:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235845 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:03:09 -0000 Author: jkim Date: Wed May 23 17:03:09 2012 New Revision: 235845 URL: http://svn.freebsd.org/changeset/base/235845 Log: Restore Processor object path for verbose boot message. Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed May 23 16:43:37 2012 (r235844) +++ head/sys/dev/acpica/acpi_cpu.c Wed May 23 17:03:09 2012 (r235845) @@ -489,8 +489,10 @@ acpi_pcpu_get_id(device_t dev, uint32_t } else { if (pc->pc_acpi_id == *acpi_id) { if (bootverbose) - device_printf(dev, "(ACPI ID %u) -> APIC ID %d\n", - *acpi_id, pc->pc_cpuid); + device_printf(dev, + "Processor %s (ACPI ID %u) -> APIC ID %d\n", + acpi_name(acpi_get_handle(dev)), *acpi_id, + pc->pc_cpuid); *cpu_id = pc->pc_cpuid; return (0); } From owner-svn-src-all@FreeBSD.ORG Wed May 23 17:09:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75D3E1065677; Wed, 23 May 2012 17:09: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 618DA8FC16; Wed, 23 May 2012 17:09: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 q4NH9FQR085297; Wed, 23 May 2012 17:09:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NH9Fqc085295; Wed, 23 May 2012 17:09:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205231709.q4NH9Fqc085295@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 May 2012 17:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235846 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:09:15 -0000 Author: kib Date: Wed May 23 17:09:14 2012 New Revision: 235846 URL: http://svn.freebsd.org/changeset/base/235846 Log: Add 'drmn' device as another drm child, to allow drm2 drivers to live in parallel with drm1. Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/dev/pci/vga_pci.c Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Wed May 23 17:03:09 2012 (r235845) +++ head/sys/dev/pci/vga_pci.c Wed May 23 17:09:14 2012 (r235846) @@ -105,6 +105,7 @@ vga_pci_attach(device_t dev) /* Always create a drm child for now to make it easier on drm. */ device_add_child(dev, "drm", -1); + device_add_child(dev, "drmn", -1); bus_generic_attach(dev); return (0); } From owner-svn-src-all@FreeBSD.ORG Wed May 23 17:10:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E1FE106564A; Wed, 23 May 2012 17:10:23 +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 4F3F08FC12; Wed, 23 May 2012 17:10:23 +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 q4NHANLB085387; Wed, 23 May 2012 17:10:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NHAN9s085383; Wed, 23 May 2012 17:10:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205231710.q4NHAN9s085383@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 May 2012 17:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235847 - in head/sys/modules/drm2: . drm2 i915kms X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:10:23 -0000 Author: kib Date: Wed May 23 17:10:22 2012 New Revision: 235847 URL: http://svn.freebsd.org/changeset/base/235847 Log: The drm2 modules makefiles commit. Still not attached to the build. Sponsored by: The FreeBSD Foundation MFC after: 1 month Added: head/sys/modules/drm2/ head/sys/modules/drm2/Makefile (contents, props changed) head/sys/modules/drm2/Makefile.inc (contents, props changed) head/sys/modules/drm2/drm2/ head/sys/modules/drm2/drm2/Makefile (contents, props changed) head/sys/modules/drm2/i915kms/ head/sys/modules/drm2/i915kms/Makefile (contents, props changed) Added: head/sys/modules/drm2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/drm2/Makefile Wed May 23 17:10:22 2012 (r235847) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +SUBDIR = \ + drm2 \ + i915kms + +.include Added: head/sys/modules/drm2/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/drm2/Makefile.inc Wed May 23 17:10:22 2012 (r235847) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Added: head/sys/modules/drm2/drm2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/drm2/drm2/Makefile Wed May 23 17:10:22 2012 (r235847) @@ -0,0 +1,39 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/drm2 +KMOD = drm2 +SRCS = \ + drm_agpsupport.c \ + drm_auth.c \ + drm_bufs.c \ + drm_context.c \ + drm_crtc.c \ + drm_crtc_helper.c \ + drm_dma.c \ + drm_dp_iic_helper.c \ + drm_drawable.c \ + drm_drv.c \ + drm_edid.c \ + drm_fb_helper.c \ + drm_fops.c \ + drm_gem.c \ + drm_gem_names.c \ + drm_hashtab.c \ + drm_ioctl.c \ + drm_irq.c \ + drm_linux_list_sort.c \ + drm_lock.c \ + drm_memory.c \ + drm_mm.c \ + drm_modes.c \ + drm_pci.c \ + drm_scatter.c \ + drm_sman.c \ + drm_stub.c \ + drm_sysctl.c \ + drm_vm.c + +SRCS +=device_if.h bus_if.h pci_if.h device_if.h iicbus_if.h opt_drm.h \ + opt_vm.h + +.include Added: head/sys/modules/drm2/i915kms/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/drm2/i915kms/Makefile Wed May 23 17:10:22 2012 (r235847) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/drm2/i915 +KMOD = i915kms +SRCS = \ + i915_debug.c \ + i915_dma.c \ + i915_drv.c \ + i915_gem.c \ + i915_gem_execbuffer.c \ + i915_gem_evict.c \ + i915_gem_gtt.c \ + i915_gem_tiling.c \ + i915_irq.c \ + i915_suspend.c \ + intel_bios.c \ + intel_crt.c \ + intel_display.c \ + intel_dp.c \ + intel_fb.c \ + intel_hdmi.c \ + intel_iic.c \ + intel_lvds.c \ + intel_modes.c \ + intel_opregion.c \ + intel_overlay.c \ + intel_panel.c \ + intel_ringbuffer.c \ + intel_sdvo.c \ + intel_sprite.c \ + intel_tv.c +SRCS += device_if.h bus_if.h pci_if.h iicbus_if.h iicbb_if.h opt_drm.h + +.include From owner-svn-src-all@FreeBSD.ORG Wed May 23 17:13:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AFAA106566B; Wed, 23 May 2012 17:13:31 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 042838FC16; Wed, 23 May 2012 17:13: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 q4NHDU8O085576; Wed, 23 May 2012 17:13:30 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NHDUaR085572; Wed, 23 May 2012 17:13:30 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201205231713.q4NHDUaR085572@svn.freebsd.org> From: Isabell Long Date: Wed, 23 May 2012 17:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235848 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:13:31 -0000 Author: issyl0 (doc committer) Date: Wed May 23 17:13:30 2012 New Revision: 235848 URL: http://svn.freebsd.org/changeset/base/235848 Log: Add two new locale-specific man pages: - libc/stdio/scanf_l.3 - libc/stdio/printf_l.3 Reviewed by: theraven Approved by: gabor (mentor) MFC after: 5 days Added: head/lib/libc/stdio/printf_l.3 (contents, props changed) head/lib/libc/stdio/scanf_l.3 (contents, props changed) Modified: head/lib/libc/stdio/Makefile.inc Modified: head/lib/libc/stdio/Makefile.inc ============================================================================== --- head/lib/libc/stdio/Makefile.inc Wed May 23 17:10:22 2012 (r235847) +++ head/lib/libc/stdio/Makefile.inc Wed May 23 17:13:30 2012 (r235848) @@ -36,7 +36,8 @@ MAN+= fclose.3 ferror.3 fflush.3 fgetln. fopen.3 fputs.3 \ fputws.3 fread.3 fseek.3 funopen.3 fwide.3 getc.3 \ getline.3 getwc.3 mktemp.3 \ - printf.3 putc.3 putwc.3 remove.3 scanf.3 setbuf.3 stdio.3 tmpnam.3 \ + printf.3 printf_l.3 putc.3 putwc.3 remove.3 scanf.3 scanf_l.3 setbuf.3 \ + stdio.3 tmpnam.3 \ ungetc.3 ungetwc.3 wprintf.3 wscanf.3 MLINKS+=fclose.3 fcloseall.3 @@ -63,11 +64,16 @@ MLINKS+=printf.3 asprintf.3 printf.3 dpr printf.3 vasprintf.3 printf.3 vdprintf.3 \ printf.3 vfprintf.3 printf.3 vprintf.3 printf.3 vsnprintf.3 \ printf.3 vsprintf.3 +MLINKS+=printf_l.3 asprintf_l.3 printf_l.3 fprintf_l.3 printf_l.3 snprintf_l.3 \ + printf_l.3 sprintf_l.3 printf_l.3 vasprintf_l.3 printf_l.3 vfprintf_l.3 \ + printf_l.3 vprintf_l.3 printf_l.3 vsnprintf_l.3 printf_l.3 vsprintf_l.3 MLINKS+=putc.3 fputc.3 putc.3 putc_unlocked.3 putc.3 putchar.3 \ putc.3 putchar_unlocked.3 putc.3 putw.3 MLINKS+=putwc.3 fputwc.3 putwc.3 putwchar.3 MLINKS+=scanf.3 fscanf.3 scanf.3 sscanf.3 scanf.3 vfscanf.3 scanf.3 vscanf.3 \ scanf.3 vsscanf.3 +MLINKS+=scanf_l.3 fscanf_l.3 scanf_l.3 sscanf_l.3 scanf_l.3 vfscanf_l.3 \ + scanf_l.3 vscanf_l.3 scanf_l.3 vsscanf_l.3 MLINKS+=setbuf.3 setbuffer.3 setbuf.3 setlinebuf.3 setbuf.3 setvbuf.3 MLINKS+=tmpnam.3 tempnam.3 tmpnam.3 tmpfile.3 MLINKS+=wprintf.3 fwprintf.3 wprintf.3 swprintf.3 \ Added: head/lib/libc/stdio/printf_l.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdio/printf_l.3 Wed May 23 17:13:30 2012 (r235848) @@ -0,0 +1,80 @@ +.\" Copyright (c) 2012 Isabell Long +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 7, 2012 +.Dt PRINTF_L 3 +.Os +.Sh NAME +.Nm printf_l , +.Nm asprintf_l , +.Nm fprintf_l , +.Nm snprintf_l , +.Nm sprintf_l , +.Nm vasprintf_l , +.Nm vfprintf_l , +.Nm vprintf_l , +.Nm vsnprintf_l , +.Nm vsprintf_l +.Nd formatted output conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fn printf_l "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn asprintf_l "char **ret" "locale_t loc" "const char * format" "..." +.Ft int +.Fn fprintf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn snprintf_l "char * restrict str" "size_t size" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn sprintf_l "char * restrict str" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn vasprintf_l "char **ret" "locale_t loc" "const char *format" "va_list ap" +.Ft int +.Fn vfprintf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vprintf_l "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsnprintf_l "char * restrict str" "size_t size" "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsprintf_l "char * restrict str" "locale_t loc" "const char * restrict format" "va_list ap" +.Sh DESCRIPTION +The above functions are used to convert formatted output in the locale +.Fa loc . +They behave in the same way as the versions without the _l suffix, but use +the specified locale rather than the global or per-thread locale. +See the specific manual pages for more information. +.Sh SEE ALSO +.Xr printf 3 , +.Xr xlocale 3 +.Sh STANDARDS +These functions do not conform to any specific standard so they should be +considered as non-portable local extensions. +.Sh HISTORY +These functions first appeared in Darwin and were first implemented in +.Fx 9.1 . Added: head/lib/libc/stdio/scanf_l.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdio/scanf_l.3 Wed May 23 17:13:30 2012 (r235848) @@ -0,0 +1,70 @@ +.\" Copyright (c) 2012 Isabell Long +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 8, 2012 +.Dt SCANF_L 3 +.Os +.Sh NAME +.Nm scanf_l , +.Nm fscanf_l , +.Nm sscanf_l , +.Nm vfscanf_l , +.Nm vscanf_l , +.Nm vsscanf_l +.Nd input format conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fn scanf_l "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn fscanf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn sscanf_l "const char * restrict str" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn vfscanf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vscanf_l "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsscanf_l "const char * restrict str" "locale_t loc" "const char * restrict format" "va_list ap" +.Sh DESCRIPTION +The above functions scan input according to a specified +.Fa format +in the locale +.Fa loc . +They behave in the same way as the versions without the _l suffix, but use +the specific locale rather than the the global or per-thread locale. +See the specific manual pages for more information. +.Sh SEE ALSO +.Xr scanf 3 , +.Xr xlocale 3 +.Sh STANDARDS +These functions do not conform to any specific standard so they should be +considered as non-portable local extensions. +.Sh HISTORY +These functions first appeared in Darwin and were first implemented in +.Fx 9.1 . From owner-svn-src-all@FreeBSD.ORG Wed May 23 17:50:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 490D0106566C; Wed, 23 May 2012 17:50:00 +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 340448FC14; Wed, 23 May 2012 17:50: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 q4NHo05m087062; Wed, 23 May 2012 17:50:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NHo0kJ087060; Wed, 23 May 2012 17:50:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205231750.q4NHo0kJ087060@svn.freebsd.org> From: Xin LI Date: Wed, 23 May 2012 17:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235849 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:50:00 -0000 Author: delphij Date: Wed May 23 17:49:59 2012 New Revision: 235849 URL: http://svn.freebsd.org/changeset/base/235849 Log: Use %j and cast off_t to intmax_t for now to fix build. Noticed by: bz Modified: head/sys/geom/geom_flashmap.c Modified: head/sys/geom/geom_flashmap.c ============================================================================== --- head/sys/geom/geom_flashmap.c Wed May 23 17:13:30 2012 (r235848) +++ head/sys/geom/geom_flashmap.c Wed May 23 17:49:59 2012 (r235849) @@ -78,8 +78,8 @@ static void g_flashmap_print(struct g_flashmap_slice *slice) { - printf("%08llx-%08llx: %s (%lluKB)\n", slice->sl_start, slice->sl_end, - slice->sl_name, (slice->sl_end - slice->sl_start) / 1024); + printf("%08jx-%08jx: %s (%lluKB)\n", (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, + slice->sl_name, (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); } static int From owner-svn-src-all@FreeBSD.ORG Wed May 23 17:51:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75ACC106564A; Wed, 23 May 2012 17:51:16 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 5498D8FC08; Wed, 23 May 2012 17:51:16 +0000 (UTC) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id EEA3D1213D; Wed, 23 May 2012 10:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1337795476; bh=KYalf5lV/HYPv0/pkJyD9XEhejhLN55UG7YXEIySTKQ=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=xkzrrIziT8+gmbyZuQSlzQ3AvWH4d9lC4XG4AY3idj10+VWdquN7vu/BroWX1KdXB PClXVWQDPLrVoikZHyrJnzot3EubGATMzcIxlOSMa0/4Pw0wjWYDrROlC+p2XCiPJT 58DA6CliLkzt81zjDBfXy3Rm6s37KTuhM0yofIoU= Message-ID: <4FBD2393.708@delphij.net> Date: Wed, 23 May 2012 10:51:15 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201205230649.q4N6nofV053886@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, d@delphij.net, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r235822 - in head: sys/dev/esp sys/gnu/fs/xfs/FreeBSD usr.sbin/ppp usr.sbin/rpc.lockd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:51:16 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 05/23/12 07:56, Bjoern A. Zeeb wrote: > > On 23. May 2012, at 06:49 , Xin LI wrote: > >> Author: delphij Date: Wed May 23 06:49:50 2012 New Revision: >> 235822 URL: http://svn.freebsd.org/changeset/base/235822 >> >> Log: Fix build: >> >> - Use %ll instead of %q for explicit long long casts; - Use %j >> instead of %q in XFS and cast to intmax_t. >> >> Tested with: make universe > > > I am still seeing XLP64 failing to compile: > > cc1: warnings being treated as errors > /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c: In function > 'g_flashmap_print': > /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: > format '%08llx' expects type 'long long unsigned int', but argument > 2 has type 'off_t' [-Wformat] > /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: > format '%08llx' expects type 'long long unsigned int', but argument > 3 has type 'off_t' [-Wformat] > /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: > format '%llu' expects type 'long long unsigned int', but argument 5 > has type 'off_t' [-Wformat] Weird, I don't know why I didn't caught this :-/ It seems that 'universe_kernel' does not do things after an existing universe build? Should be fixed in r235849. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJPvSOSAAoJEG80Jeu8UPuz6YwH/2zRaib16TwoUKMWPvRYgrDi JikyBmSqddhuN7uLJubT9KoiDNmX6dAjVHwGZt+p+EvIkYTCw96hUPR5XY/JrHXz YxKF0u5MsqpOGOkWWtlKIjwC3YE96TG5GAx9l8UzLU3FgGtM4OHjUmj3JUA1zXZ9 Fe4Cw1fzYcIW8xezghBbSzhfcOefWkizRY8gFSDRNUTn8GMEdngJ+f5uetzKBo7F juE3OtcgB6sHNaxf9rNup1RvfN7x9odlQyK/IAPrp2G/LlaeBN8szI1fcJjK2q8A qzA9/QPE3258slir0n8JGy809+9L8VZIC1edSanXqU8CAh/+6SLLNhtfd/XhCjU= =H/R1 -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Wed May 23 17:55:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2FD86106567A; Wed, 23 May 2012 17:55:20 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id D44CE8FC19; Wed, 23 May 2012 17:55:19 +0000 (UTC) Received: by dadv36 with SMTP id v36so10899805dad.13 for ; Wed, 23 May 2012 10:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=VmcX7iZBofhhHNkp/Mzn0SqOG0OKiNKRpNV3tCiJHj4=; b=WvA7XofhxuZ0iy2UiogwaYus7tVMAnkKzEHgAuf/CarIR6P/V1ok838ChVm3ntPScR m5NdgJRABRnMPaNgFzsLlCJM79Z7r9LTRGY5GbjG71CKc8i0J1+CGDGiFNkXde3NY/yk CysP6fXzM/ZfmMaSheZyfL3ksRGIqmilQi4PaHaZs+lV8xSb56CasXgDX6iWNTxlqoAU DS8OkHTxHEx6FZbtUaP/W5nlj9nwIL+a6AyEBQrzwIHAc/xfctHcW5Azj+5DOZmpLFKw emygrDy+aBk3Dh9GQx/zH+91OOvAzE4k69UbeYiQipvMiNGqTFucT/ZcVdBNdV311DxT QLxA== MIME-Version: 1.0 Received: by 10.68.223.167 with SMTP id qv7mr12183516pbc.127.1337795719333; Wed, 23 May 2012 10:55:19 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.142.203.2 with HTTP; Wed, 23 May 2012 10:55:18 -0700 (PDT) In-Reply-To: <201205230202.q4N22UDA041838@svn.freebsd.org> References: <201205230202.q4N22UDA041838@svn.freebsd.org> Date: Wed, 23 May 2012 10:55:18 -0700 X-Google-Sender-Auth: mSfHb8FA7O53PGTsbzcsqHzLWA8 Message-ID: From: Adrian Chadd To: Pyun YongHyeon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r235818 - stable/9/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:55:20 -0000 Hi, Have you looked at the MDIO bus support that I brought in from Stefan? This almost feels like a poster child for that - you'd write an MDIO bus driver for this particular mailbox hardware interface and modify the driver to use that, then the MDIO bus will automatically probe whatever PHYs exist there That way it could be reused for other MDIO bus consumers too, such as switch PHYs and other MDIO-but-not-quite-PHY devices. Adrian On 22 May 2012 19:02, Pyun YongHyeon wrote: > Author: yongari > Date: Wed May 23 02:02:29 2012 > New Revision: 235818 > URL: http://svn.freebsd.org/changeset/base/235818 > > Log: > =A0MFC r235151: > =A0 =A0Implement basic remote PHY support. Remote PHY allows the > =A0 =A0controller to perform MDIO type accesses to a remote transceiver > =A0 =A0using message pages defined through MRBE(multirate backplane > =A0 =A0ethernet). =A0It's used in blade systems(e.g Dell Blade m610) whic= h > =A0 =A0are connected to pass-through blades rather than traditional > =A0 =A0switches. > =A0 =A0This change directly manipulates firmware's mailboxes to control > =A0 =A0remote PHY such that it does not use mii(4). =A0Alternatively, as > =A0 =A0David said, it could be implemented in brgphy(4) by creating a fak= e > =A0 =A0PHY and let brgphy(4) do necessary mii accesses and bce(4) can > =A0 =A0implement mailbox accesses based on the type of brgphy(4)'s mii > =A0 =A0accesses. Personally, I think it would make brgphy(4) hard to > =A0 =A0maintain since it would have to access many bce(4) registers in > =A0 =A0brgphy(4). Given that there are users who are suffering from lack > =A0 =A0of remote PHY support, it would be better to get working system > =A0 =A0rather than waiting for complete/perfect implementation. > > Modified: > =A0stable/9/sys/dev/bce/if_bce.c > =A0stable/9/sys/dev/bce/if_bcereg.h > Directory Properties: > =A0stable/9/sys/ =A0 (props changed) > =A0stable/9/sys/amd64/include/xen/ =A0 (props changed) > =A0stable/9/sys/boot/ =A0 (props changed) > =A0stable/9/sys/boot/i386/efi/ =A0 (props changed) > =A0stable/9/sys/boot/ia64/efi/ =A0 (props changed) > =A0stable/9/sys/boot/ia64/ski/ =A0 (props changed) > =A0stable/9/sys/boot/powerpc/boot1.chrp/ =A0 (props changed) > =A0stable/9/sys/boot/powerpc/ofw/ =A0 (props changed) > =A0stable/9/sys/cddl/contrib/opensolaris/ =A0 (props changed) > =A0stable/9/sys/conf/ =A0 (props changed) > =A0stable/9/sys/contrib/dev/acpica/ =A0 (props changed) > =A0stable/9/sys/contrib/octeon-sdk/ =A0 (props changed) > =A0stable/9/sys/contrib/pf/ =A0 (props changed) > =A0stable/9/sys/contrib/x86emu/ =A0 (props changed) > =A0stable/9/sys/dev/ =A0 (props changed) > =A0stable/9/sys/dev/e1000/ =A0 (props changed) > =A0stable/9/sys/dev/ixgbe/ =A0 (props changed) > =A0stable/9/sys/fs/ =A0 (props changed) > =A0stable/9/sys/fs/ntfs/ =A0 (props changed) > =A0stable/9/sys/modules/ =A0 (props changed) > > Modified: stable/9/sys/dev/bce/if_bce.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/9/sys/dev/bce/if_bce.c =A0 =A0 =A0 Wed May 23 01:49:50 2012 = =A0 =A0 =A0 =A0(r235817) > +++ stable/9/sys/dev/bce/if_bce.c =A0 =A0 =A0 Wed May 23 02:02:29 2012 = =A0 =A0 =A0 =A0(r235818) > @@ -364,6 +364,7 @@ static int =A0bce_nvram_write =A0 =A0 =A0 =A0 (struct= bce > =A0static void bce_get_rx_buffer_sizes(struct bce_softc *, int); > =A0static void bce_get_media =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(= struct bce_softc *); > =A0static void bce_init_media =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (st= ruct bce_softc *); > +static u32 bce_get_rphy_link =A0 =A0 =A0 =A0 =A0 (struct bce_softc *); > =A0static void bce_dma_map_addr =A0 =A0 =A0 =A0 =A0 (void *, bus_dma_segm= ent_t *, int, int); > =A0static int =A0bce_dma_alloc =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0(device_t); > =A0static void bce_dma_free =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (= struct bce_softc *); > @@ -372,6 +373,7 @@ static void bce_release_resources =A0 (struc > =A0/*********************************************************************= *******/ > =A0/* BCE Firmware Synchronization and Load =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > =A0/*********************************************************************= *******/ > +static void bce_fw_cap_init =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(stru= ct bce_softc *); > =A0static int =A0bce_fw_sync =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0(struct bce_softc *, u32); > =A0static void bce_load_rv2p_fw =A0 =A0 =A0 =A0 =A0 (struct bce_softc *, = u32 *, u32, u32); > =A0static void bce_load_cpu_fw =A0 =A0 =A0 =A0 =A0 =A0(struct bce_softc *= , > @@ -418,6 +420,7 @@ static void bce_watchdog =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0(struct bce_s > =A0static int =A0bce_ifmedia_upd =A0 =A0 =A0 =A0 =A0 =A0(struct ifnet *); > =A0static int =A0bce_ifmedia_upd_locked =A0 =A0 (struct ifnet *); > =A0static void bce_ifmedia_sts =A0 =A0 =A0 =A0 =A0 =A0(struct ifnet *, st= ruct ifmediareq *); > +static void bce_ifmedia_sts_rphy =A0 =A0 =A0 (struct bce_softc *, struct= ifmediareq *); > =A0static void bce_init_locked =A0 =A0 =A0 =A0 =A0 =A0(struct bce_softc *= ); > =A0static void bce_init =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 (void *); > =A0static void bce_mgmt_init_locked =A0 =A0 =A0 (struct bce_softc *sc); > @@ -757,6 +760,13 @@ bce_print_adapter_info(struct bce_softc > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("2.5G"); i++; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_= FLAG) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (i > 0) printf("|"); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf("Remote PHY(%s)", > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->bce_phy_flags &= BCE_PHY_REMOTE_PORT_FIBER_FLAG ? > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "FIBER" : "TP"); i+= +; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (i > 0) printf("|"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("MFW); MFW (%s)\n",= sc->bce_mfw_ver); > @@ -1297,6 +1307,9 @@ bce_attach(device_t dev) > =A0 =A0 =A0 =A0if (val & BCE_PCICFG_MISC_STATUS_32BIT_DET) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sc->bce_flags |=3D BCE_PCI_32BIT_FLAG; > > + =A0 =A0 =A0 /* Find the media type for the adapter. */ > + =A0 =A0 =A0 bce_get_media(sc); > + > =A0 =A0 =A0 =A0/* Reset controller and announce to bootcode that driver i= s present. */ > =A0 =A0 =A0 =A0if (bce_reset(sc, BCE_DRV_MSG_CODE_RESET)) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0BCE_PRINTF("%s(%d): Controller reset faile= d!\n", > @@ -1344,9 +1357,6 @@ bce_attach(device_t dev) > =A0 =A0 =A0 =A0/* Update statistics once every second. */ > =A0 =A0 =A0 =A0sc->bce_stats_ticks =3D 1000000 & 0xffff00; > > - =A0 =A0 =A0 /* Find the media type for the adapter. */ > - =A0 =A0 =A0 bce_get_media(sc); > - > =A0 =A0 =A0 =A0/* Store data needed by PHY driver for backplane applicati= ons */ > =A0 =A0 =A0 =A0sc->bce_shared_hw_cfg =3D bce_shmem_rd(sc, BCE_SHARED_HW_C= FG_CONFIG); > =A0 =A0 =A0 =A0sc->bce_port_hw_cfg =A0 =3D bce_shmem_rd(sc, BCE_PORT_HW_C= FG_CONFIG); > @@ -1386,6 +1396,15 @@ bce_attach(device_t dev) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ifp->if_capabilities =3D BCE_IF_CAPABILITI= ES; > =A0 =A0 =A0 =A0} > > +#if __FreeBSD_version >=3D 800505 > + =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0* Introducing IFCAP_LINKSTATE didn't bump __FreeBSD_vers= ion > + =A0 =A0 =A0 =A0* so it's approximate value. > + =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifp->if_capabilities |=3D IFCAP_LINKSTATE; > +#endif > + > =A0 =A0 =A0 =A0ifp->if_capenable =3D ifp->if_capabilities; > > =A0 =A0 =A0 =A0/* > @@ -1409,14 +1428,52 @@ bce_attach(device_t dev) > =A0 =A0 =A0 =A0/* Handle any special PHY initialization for SerDes PHYs. = */ > =A0 =A0 =A0 =A0bce_init_media(sc); > > - =A0 =A0 =A0 /* MII child bus by attaching the PHY. */ > - =A0 =A0 =A0 rc =3D mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_up= d, > - =A0 =A0 =A0 =A0 =A0 bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, > - =A0 =A0 =A0 =A0 =A0 MII_OFFSET_ANY, MIIF_DOPAUSE); > - =A0 =A0 =A0 if (rc !=3D 0) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE_PRINTF("%s(%d): attaching PHYs failed\n= ", __FILE__, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 __LINE__); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto bce_attach_fail; > + =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) !=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_init(&sc->bce_ifmedia, IFM_IMASK, b= ce_ifmedia_upd, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bce_ifmedia_sts); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* We can't manually override remote PHY'= s link and assume > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* PHY port configuration(Fiber or TP) is= not changed after > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* device attach. =A0This may not be corr= ect though. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_POR= T_FIBER_FLAG) !=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (sc->bce_phy_flags & BCE= _PHY_2_5G_CAPABLE_FLAG) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_add= (&sc->bce_ifmedia, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM= _ETHER | IFM_2500_SX, 0, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_add= (&sc->bce_ifmedia, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM= _ETHER | IFM_2500_SX | IFM_FDX, 0, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_add(&sc->bce_ifmedi= a, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_ETHER | IFM_100= 0_SX, 0, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_add(&sc->bce_ifmedi= a, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_ETHER | IFM_100= 0_SX | IFM_FDX, 0, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_add(&sc->bce_ifmedi= a, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_ETHER | IFM_10_= T, 0, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_add(&sc->bce_ifmedi= a, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_ETHER | IFM_10_= T | IFM_FDX, 0, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_add(&sc->bce_ifmedi= a, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_ETHER | IFM_100= _TX, 0, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_add(&sc->bce_ifmedi= a, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_ETHER | IFM_100= _TX | IFM_FDX, 0, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_add(&sc->bce_ifmedi= a, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_ETHER | IFM_100= 0_T, 0, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_add(&sc->bce_ifmedi= a, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_ETHER | IFM_100= 0_T | IFM_FDX, 0, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_add(&sc->bce_ifmedia, IFM_ETHER | I= FM_AUTO, 0, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_set(&sc->bce_ifmedia, IFM_ETHER | I= FM_AUTO); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->bce_ifmedia.ifm_media =3D sc->bce_ifmed= ia.ifm_cur->ifm_media; > + =A0 =A0 =A0 } else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* MII child bus by attaching the PHY. */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rc =3D mii_attach(dev, &sc->bce_miibus, ifp= , bce_ifmedia_upd, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bce_ifmedia_sts, BMSR_DEFCAPMASK, s= c->bce_phy_addr, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MII_OFFSET_ANY, MIIF_DOPAUSE); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (rc !=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE_PRINTF("%s(%d): attachi= ng PHYs failed\n", __FILE__, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 __LINE__); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto bce_attach_fail; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0} > > =A0 =A0 =A0 =A0/* Attach to the Ethernet interface list. */ > @@ -1521,8 +1578,12 @@ bce_detach(device_t dev) > =A0 =A0 =A0 =A0ether_ifdetach(ifp); > > =A0 =A0 =A0 =A0/* If we have a child device on the MII bus remove it too.= */ > - =A0 =A0 =A0 bus_generic_detach(dev); > - =A0 =A0 =A0 device_delete_child(dev, sc->bce_miibus); > + =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmedia_removeall(&sc->bce_ifmedia); > + =A0 =A0 =A0 else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bus_generic_detach(dev); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 device_delete_child(dev, sc->bce_miibus); > + =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0/* Release all remaining resources. */ > =A0 =A0 =A0 =A0bce_release_resources(sc); > @@ -1983,13 +2044,23 @@ bce_miibus_statchg(device_t dev) > =A0{ > =A0 =A0 =A0 =A0struct bce_softc *sc; > =A0 =A0 =A0 =A0struct mii_data *mii; > - =A0 =A0 =A0 int val; > + =A0 =A0 =A0 struct ifmediareq ifmr; > + =A0 =A0 =A0 int media_active, media_status, val; > > =A0 =A0 =A0 =A0sc =3D device_get_softc(dev); > > =A0 =A0 =A0 =A0DBENTER(BCE_VERBOSE_PHY); > > - =A0 =A0 =A0 mii =3D device_get_softc(sc->bce_miibus); > + =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) !=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bzero(&ifmr, sizeof(ifmr)); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bce_ifmedia_sts_rphy(sc, &ifmr); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 media_active =3D ifmr.ifm_active; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 media_status =3D ifmr.ifm_status; > + =A0 =A0 =A0 } else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 mii =3D device_get_softc(sc->bce_miibus); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 media_active =3D mii->mii_media_active; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 media_status =3D mii->mii_media_status; > + =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0val =3D REG_RD(sc, BCE_EMAC_MODE); > =A0 =A0 =A0 =A0val &=3D ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX = | > @@ -1997,7 +2068,7 @@ bce_miibus_statchg(device_t dev) > =A0 =A0 =A0 =A0 =A0 =A0BCE_EMAC_MODE_25G); > > =A0 =A0 =A0 =A0/* Set MII or GMII interface based on the PHY speed. */ > - =A0 =A0 =A0 switch (IFM_SUBTYPE(mii->mii_media_active)) { > + =A0 =A0 =A0 switch (IFM_SUBTYPE(media_active)) { > =A0 =A0 =A0 =A0case IFM_10_T: > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (BCE_CHIP_NUM(sc) !=3D BCE_CHIP_NUM_570= 6) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DBPRINT(sc, BCE_INFO_PHY, > @@ -2026,7 +2097,7 @@ bce_miibus_statchg(device_t dev) > =A0 =A0 =A0 =A0} > > =A0 =A0 =A0 =A0/* Set half or full duplex based on PHY settings. */ > - =A0 =A0 =A0 if ((mii->mii_media_active & IFM_GMASK) =3D=3D IFM_HDX) { > + =A0 =A0 =A0 if ((IFM_OPTIONS(media_active) & IFM_FDX) =3D=3D 0) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DBPRINT(sc, BCE_INFO_PHY, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"Setting Half-Duplex interface.\n"= ); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0val |=3D BCE_EMAC_MODE_HALF_DUPLEX; > @@ -2036,7 +2107,7 @@ bce_miibus_statchg(device_t dev) > > =A0 =A0 =A0 =A0REG_WR(sc, BCE_EMAC_MODE, val); > > - =A0 =A0 =A0 if ((mii->mii_media_active & IFM_ETH_RXPAUSE) !=3D 0) { > + =A0 =A0 =A0 if ((IFM_OPTIONS(media_active) & IFM_ETH_RXPAUSE) !=3D 0) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DBPRINT(sc, BCE_INFO_PHY, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"%s(): Enabling RX flow control.\n= ", __FUNCTION__); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_= RX_MODE_FLOW_EN); > @@ -2046,7 +2117,7 @@ bce_miibus_statchg(device_t dev) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_= RX_MODE_FLOW_EN); > =A0 =A0 =A0 =A0} > > - =A0 =A0 =A0 if ((mii->mii_media_active & IFM_ETH_TXPAUSE) !=3D 0) { > + =A0 =A0 =A0 if ((IFM_OPTIONS(media_active) & IFM_ETH_TXPAUSE) !=3D 0) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DBPRINT(sc, BCE_INFO_PHY, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"%s(): Enabling TX flow control.\n= ", __FUNCTION__); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_= TX_MODE_FLOW_EN); > @@ -3130,7 +3201,8 @@ bce_get_media_exit: > =A0static void > =A0bce_init_media(struct bce_softc *sc) > =A0{ > - =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_IEEE_CLAUSE_45_FLAG) !=3D = 0) { > + =A0 =A0 =A0 if ((sc->bce_phy_flags & (BCE_PHY_IEEE_CLAUSE_45_FLAG | > + =A0 =A0 =A0 =A0 =A0 BCE_PHY_REMOTE_CAP_FLAG)) =3D=3D BCE_PHY_IEEE_CLAUS= E_45_FLAG) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * Configure 5709S/5716S PHYs to use tradi= tional IEEE > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * Clause 22 method. Otherwise we have no = way to attach > @@ -5018,6 +5090,8 @@ bce_reset(struct bce_softc *sc, u32 rese > =A0 =A0 =A0 =A0if (rc) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0BCE_PRINTF("%s(%d): Firmware did not compl= ete " > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"initialization!\n", __FILE__, __L= INE__); > + =A0 =A0 =A0 /* Get firmware capabilities. */ > + =A0 =A0 =A0 bce_fw_cap_init(sc); > > =A0bce_reset_exit: > =A0 =A0 =A0 =A0DBEXIT(BCE_VERBOSE_RESET); > @@ -6081,6 +6155,55 @@ bce_free_pg_chain(struct bce_softc *sc) > =A0} > > > +static u32 > +bce_get_rphy_link(struct bce_softc *sc) > +{ > + =A0 =A0 =A0 u32 advertise, link; > + =A0 =A0 =A0 int fdpx; > + > + =A0 =A0 =A0 advertise =3D 0; > + =A0 =A0 =A0 fdpx =3D 0; > + =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) != =3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D bce_shmem_rd(sc, BCE_RPHY_SERDES_L= INK); > + =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D bce_shmem_rd(sc, BCE_RPHY_COPPER_L= INK); > + =A0 =A0 =A0 if (link & BCE_NETLINK_ANEG_ENB) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 advertise |=3D BCE_NETLINK_ANEG_ENB; > + =A0 =A0 =A0 if (link & BCE_NETLINK_SPEED_10HALF) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 advertise |=3D BCE_NETLINK_SPEED_10HALF; > + =A0 =A0 =A0 if (link & BCE_NETLINK_SPEED_10FULL) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 advertise |=3D BCE_NETLINK_SPEED_10FULL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 fdpx++; > + =A0 =A0 =A0 } > + =A0 =A0 =A0 if (link & BCE_NETLINK_SPEED_100HALF) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 advertise |=3D BCE_NETLINK_SPEED_100HALF; > + =A0 =A0 =A0 if (link & BCE_NETLINK_SPEED_100FULL) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 advertise |=3D BCE_NETLINK_SPEED_100FULL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 fdpx++; > + =A0 =A0 =A0 } > + =A0 =A0 =A0 if (link & BCE_NETLINK_SPEED_1000HALF) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 advertise |=3D BCE_NETLINK_SPEED_1000HALF; > + =A0 =A0 =A0 if (link & BCE_NETLINK_SPEED_1000FULL) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 advertise |=3D BCE_NETLINK_SPEED_1000FULL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 fdpx++; > + =A0 =A0 =A0 } > + =A0 =A0 =A0 if (link & BCE_NETLINK_SPEED_2500HALF) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 advertise |=3D BCE_NETLINK_SPEED_2500HALF; > + =A0 =A0 =A0 if (link & BCE_NETLINK_SPEED_2500FULL) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 advertise |=3D BCE_NETLINK_SPEED_2500FULL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 fdpx++; > + =A0 =A0 =A0 } > + =A0 =A0 =A0 if (fdpx) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 advertise |=3D BCE_NETLINK_FC_PAUSE_SYM | > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE_NETLINK_FC_PAUSE_ASYM; > + =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) = =3D=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 advertise |=3D BCE_NETLINK_PHY_APP_REMOTE | > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE_NETLINK_ETH_AT_WIRESPEED; > + > + =A0 =A0 =A0 return (advertise); > +} > + > + > =A0/*********************************************************************= *******/ > =A0/* Set media options. =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */ > =A0/* =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0*/ > @@ -6116,21 +6239,110 @@ bce_ifmedia_upd_locked(struct ifnet *ifp > =A0 =A0 =A0 =A0struct bce_softc *sc =3D ifp->if_softc; > =A0 =A0 =A0 =A0struct mii_data *mii; > =A0 =A0 =A0 =A0struct mii_softc *miisc; > - =A0 =A0 =A0 int error; > + =A0 =A0 =A0 struct ifmedia *ifm; > + =A0 =A0 =A0 u32 link; > + =A0 =A0 =A0 int error, fdx; > > =A0 =A0 =A0 =A0DBENTER(BCE_VERBOSE_PHY); > > =A0 =A0 =A0 =A0error =3D 0; > =A0 =A0 =A0 =A0BCE_LOCK_ASSERT(sc); > > - =A0 =A0 =A0 mii =3D device_get_softc(sc->bce_miibus); > + =A0 =A0 =A0 sc->bce_link_up =3D FALSE; > + =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) !=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifm =3D &sc->bce_ifmedia; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (IFM_TYPE(ifm->ifm_media) !=3D IFM_ETHER= ) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EINVAL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D 0; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 fdx =3D IFM_OPTIONS(ifm->ifm_media) & IFM_F= DX; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 switch(IFM_SUBTYPE(ifm->ifm_media)) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case IFM_AUTO: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Check advertised link = of remote PHY by reading > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* BCE_RPHY_SERDES_LINK o= r BCE_RPHY_COPPER_LINK. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Always use the same li= nk type of remote PHY. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D bce_get_rphy_link(= sc); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case IFM_2500_SX: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((sc->bce_phy_flags & > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (BCE_PHY_REMOTE_POR= T_FIBER_FLAG | > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE_PHY_2_5G_CAPABL= E_FLAG)) =3D=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EIN= VAL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* XXX > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Have to enable forced = 2.5Gbps configuration. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (fdx !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link |=3D B= CE_NETLINK_SPEED_2500FULL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link |=3D B= CE_NETLINK_SPEED_2500HALF; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case IFM_1000_SX: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((sc->bce_phy_flags & > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE_PHY_REMOTE_PORT= _FIBER_FLAG) =3D=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EIN= VAL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* XXX > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Have to disable 2.5Gbp= s configuration. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (fdx !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D BC= E_NETLINK_SPEED_1000FULL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D BC= E_NETLINK_SPEED_1000HALF; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case IFM_1000_T: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (sc->bce_phy_flags & BCE= _PHY_REMOTE_PORT_FIBER_FLAG) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EIN= VAL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (fdx !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D BC= E_NETLINK_SPEED_1000FULL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D BC= E_NETLINK_SPEED_1000HALF; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case IFM_100_TX: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (sc->bce_phy_flags & BCE= _PHY_REMOTE_PORT_FIBER_FLAG) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EIN= VAL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (fdx !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D BC= E_NETLINK_SPEED_100FULL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D BC= E_NETLINK_SPEED_100HALF; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case IFM_10_T: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (sc->bce_phy_flags & BCE= _PHY_REMOTE_PORT_FIBER_FLAG) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EIN= VAL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (fdx !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D BC= E_NETLINK_SPEED_10FULL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D BC= E_NETLINK_SPEED_10HALF; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 default: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EINVAL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (IFM_SUBTYPE(ifm->ifm_media) !=3D IFM_AU= TO) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* XXX > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Advertise pause capabi= lity for full-duplex media. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (fdx !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link |=3D B= CE_NETLINK_FC_PAUSE_SYM | > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE= _NETLINK_FC_PAUSE_ASYM; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((sc->bce_phy_flags & > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE_PHY_REMOTE_PORT= _FIBER_FLAG) =3D=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 link |=3D B= CE_NETLINK_PHY_APP_REMOTE | > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE= _NETLINK_ETH_AT_WIRESPEED; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > - =A0 =A0 =A0 /* Make sure the MII bus has been enumerated. */ > - =A0 =A0 =A0 if (mii) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->bce_link_up =3D FALSE; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 LIST_FOREACH(miisc, &mii->mii_phys, mii_lis= t) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PHY_RESET(miisc); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D mii_mediachg(mii); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bce_shmem_wr(sc, BCE_MB_ARGS_0, link); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D bce_fw_sync(sc, BCE_DRV_MSG_CODE_= CMD_SET_LINK); > + =A0 =A0 =A0 } else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 mii =3D device_get_softc(sc->bce_miibus); > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Make sure the MII bus has been enumerate= d. */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (mii) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 LIST_FOREACH(miisc, &mii->m= ii_phys, mii_list) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PHY_RESET(m= iisc); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D mii_mediachg(mii)= ; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0} > > =A0 =A0 =A0 =A0DBEXIT(BCE_VERBOSE_PHY); > @@ -6138,6 +6350,85 @@ bce_ifmedia_upd_locked(struct ifnet *ifp > =A0} > > > +static void > +bce_ifmedia_sts_rphy(struct bce_softc *sc, struct ifmediareq *ifmr) > +{ > + =A0 =A0 =A0 struct ifnet *ifp; > + =A0 =A0 =A0 u32 link; > + > + =A0 =A0 =A0 ifp =3D sc->bce_ifp; > + =A0 =A0 =A0 BCE_LOCK_ASSERT(sc); > + > + =A0 =A0 =A0 ifmr->ifm_status =3D IFM_AVALID; > + =A0 =A0 =A0 ifmr->ifm_active =3D IFM_ETHER; > + =A0 =A0 =A0 link =3D bce_shmem_rd(sc, BCE_LINK_STATUS); > + =A0 =A0 =A0 /* XXX Handle heart beat status? */ > + =A0 =A0 =A0 if ((link & BCE_LINK_STATUS_LINK_UP) !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_status |=3D IFM_ACTIVE; > + =A0 =A0 =A0 else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_NONE; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifp->if_baudrate =3D 0; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > + =A0 =A0 =A0 } > + =A0 =A0 =A0 switch (link & BCE_LINK_STATUS_SPEED_MASK) { > + =A0 =A0 =A0 case BCE_LINK_STATUS_10HALF: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_10_T | IFM_HDX; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifp->if_baudrate =3D IF_Mbps(10UL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 case BCE_LINK_STATUS_10FULL: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_10_T | IFM_FDX; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifp->if_baudrate =3D IF_Mbps(10UL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 case BCE_LINK_STATUS_100HALF: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_100_TX | IFM_HDX; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifp->if_baudrate =3D IF_Mbps(100UL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 case BCE_LINK_STATUS_100FULL: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_100_TX | IFM_FDX; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifp->if_baudrate =3D IF_Mbps(100UL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 case BCE_LINK_STATUS_1000HALF: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_POR= T_FIBER_FLAG) =3D=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_1= 000_T | IFM_HDX; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_1= 000_SX | IFM_HDX; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifp->if_baudrate =3D IF_Mbps(1000UL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 case BCE_LINK_STATUS_1000FULL: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_POR= T_FIBER_FLAG) =3D=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_1= 000_T | IFM_FDX; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_1= 000_SX | IFM_FDX; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifp->if_baudrate =3D IF_Mbps(1000UL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 case BCE_LINK_STATUS_2500HALF: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_POR= T_FIBER_FLAG) =3D=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_N= ONE; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_2= 500_SX | IFM_HDX; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifp->if_baudrate =3D IF_Mbps(2500UL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 case BCE_LINK_STATUS_2500FULL: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_POR= T_FIBER_FLAG) =3D=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_N= ONE; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_2= 500_SX | IFM_FDX; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifp->if_baudrate =3D IF_Mbps(2500UL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 default: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_NONE; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > + =A0 =A0 =A0 } > + > + =A0 =A0 =A0 if ((link & BCE_LINK_STATUS_RX_FC_ENABLED) !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_ETH_RXPAUSE; > + =A0 =A0 =A0 if ((link & BCE_LINK_STATUS_TX_FC_ENABLED) !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active |=3D IFM_ETH_TXPAUSE; > +} > + > + > =A0/*********************************************************************= *******/ > =A0/* Reports current media status. =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > =A0/* =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0*/ > @@ -6158,11 +6449,15 @@ bce_ifmedia_sts(struct ifnet *ifp, struc > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0BCE_UNLOCK(sc); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return; > =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 mii =3D device_get_softc(sc->bce_miibus); > > - =A0 =A0 =A0 mii_pollstat(mii); > - =A0 =A0 =A0 ifmr->ifm_active =3D mii->mii_media_active; > - =A0 =A0 =A0 ifmr->ifm_status =3D mii->mii_media_status; > + =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bce_ifmedia_sts_rphy(sc, ifmr); > + =A0 =A0 =A0 else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 mii =3D device_get_softc(sc->bce_miibus); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 mii_pollstat(mii); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_active =3D mii->mii_media_active; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifmr->ifm_status =3D mii->mii_media_status; > + =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0BCE_UNLOCK(sc); > > @@ -6199,14 +6494,26 @@ bce_phy_intr(struct bce_softc *sc) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0STATUS_ATTN_BITS_L= INK_STATE); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DBPRINT(sc, BCE_INFO_PHY, = "%s(): Link is now UP.\n", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0__FUNCTION__); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0REG_WR(sc, BCE_PCICFG_STAT= US_BIT_CLEAR_CMD, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0STATUS_ATTN_BITS_L= INK_STATE); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DBPRINT(sc, BCE_INFO_PHY, = "%s(): Link is now DOWN.\n", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0__FUNCTION__); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP= _FLAG) !=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (new_link_state) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (bootver= bose) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 if_printf(sc->bce_ifp, "link UP\n"); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if_link_sta= te_change(sc->bce_ifp, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 LIN= K_STATE_UP); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (bootver= bose) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 if_printf(sc->bce_ifp, "link DOWN\n"); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if_link_sta= te_change(sc->bce_ifp, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 LIN= K_STATE_DOWN); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * Assume link is down and allow > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * tick routine to update the state > @@ -7495,10 +7802,14 @@ bce_ioctl(struct ifnet *ifp, u_long comm > =A0 =A0 =A0 =A0case SIOCGIFMEDIA: > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DBPRINT(sc, BCE_VERBOSE_MISC, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"Received SIOCSIFMEDIA/SIOCGIFMEDI= A\n"); > - > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 mii =3D device_get_softc(sc->bce_miibus); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D ifmedia_ioctl(ifp, ifr, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &mii->mii_media, command); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP= _FLAG) !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D ifmedia_ioctl(ifp= , ifr, &sc->bce_ifmedia, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 command); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mii =3D device_get_softc(sc= ->bce_miibus); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D ifmedia_ioctl(ifp= , ifr, &mii->mii_media, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 command); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > > =A0 =A0 =A0 =A0/* Set interface capability */ > @@ -8163,6 +8474,7 @@ bce_tick(void *xsc) > =A0 =A0 =A0 =A0struct bce_softc *sc =3D xsc; > =A0 =A0 =A0 =A0struct mii_data *mii; > =A0 =A0 =A0 =A0struct ifnet *ifp; > + =A0 =A0 =A0 struct ifmediareq ifmr; > > =A0 =A0 =A0 =A0ifp =3D sc->bce_ifp; > > @@ -8193,21 +8505,32 @@ bce_tick(void *xsc) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto bce_tick_exit; > > =A0 =A0 =A0 =A0/* Link is down. =A0Check what the PHY's doing. */ > - =A0 =A0 =A0 mii =3D device_get_softc(sc->bce_miibus); > - =A0 =A0 =A0 mii_tick(mii); > - > - =A0 =A0 =A0 /* Check if the link has come up. */ > - =A0 =A0 =A0 if ((mii->mii_media_status & IFM_ACTIVE) && > - =A0 =A0 =A0 =A0 =A0 (IFM_SUBTYPE(mii->mii_media_active) !=3D IFM_NONE))= { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 DBPRINT(sc, BCE_VERBOSE_MISC, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "%s(): Link up!\n", __FUNCTION__); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->bce_link_up =3D TRUE; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((IFM_SUBTYPE(mii->mii_media_active) =3D= =3D IFM_1000_T || > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_SUBTYPE(mii->mii_media_active) = =3D=3D IFM_1000_SX || > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_SUBTYPE(mii->mii_media_active) = =3D=3D IFM_2500_SX) && > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (bce_verbose || bootverbose)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE_PRINTF("Gigabit link up= !\n"); > + =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) !=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bzero(&ifmr, sizeof(ifmr)); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bce_ifmedia_sts_rphy(sc, &ifmr); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((ifmr.ifm_status & (IFM_ACTIVE | IFM_AV= ALID)) =3D=3D > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (IFM_ACTIVE | IFM_AVALID)) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->bce_link_up =3D TRUE; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bce_miibus_statchg(sc->bce_= dev); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 } else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 mii =3D device_get_softc(sc->bce_miibus); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 mii_tick(mii); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Check if the link has come up. */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((mii->mii_media_status & IFM_ACTIVE) && > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (IFM_SUBTYPE(mii->mii_media_active)= !=3D IFM_NONE)) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 DBPRINT(sc, BCE_VERBOSE_MIS= C, "%s(): Link up!\n", > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 __FUNCTION__); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->bce_link_up =3D TRUE; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((IFM_SUBTYPE(mii->mii_m= edia_active) =3D=3D IFM_1000_T || > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_SUBTYPE(mii->mi= i_media_active) =3D=3D IFM_1000_SX || > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFM_SUBTYPE(mii->mi= i_media_active) =3D=3D IFM_2500_SX) && > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (bce_verbose || boo= tverbose)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE_PRINTF(= "Gigabit link up!\n"); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > + =A0 =A0 =A0 } > + =A0 =A0 =A0 if (sc->bce_link_up =3D=3D TRUE) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Now that link is up, handle any outstan= ding TX traffic. */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DBPRINT(sc, BCE_VERBOSE_MI= SC, "%s(): Found " > @@ -8221,6 +8544,36 @@ bce_tick_exit: > =A0 =A0 =A0 =A0return; > =A0} > > +static void > +bce_fw_cap_init(struct bce_softc *sc) > +{ > + =A0 =A0 =A0 u32 ack, cap, link; > + > + =A0 =A0 =A0 ack =3D 0; > + =A0 =A0 =A0 cap =3D bce_shmem_rd(sc, BCE_FW_CAP_MB); > + =A0 =A0 =A0 if ((cap & BCE_FW_CAP_SIGNATURE_MAGIC_MASK) !=3D > + =A0 =A0 =A0 =A0 =A0 BCE_FW_CAP_SIGNATURE_MAGIC) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > + =A0 =A0 =A0 if ((cap & (BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_V= LAN)) =3D=3D > + =A0 =A0 =A0 =A0 =A0 (BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN= )) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ack |=3D BCE_DRV_ACK_CAP_SIGNATURE_MAGIC | > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_C= AP_BC_KEEP_VLAN; > + =A0 =A0 =A0 if ((sc->bce_phy_flags & BCE_PHY_SERDES_FLAG) !=3D 0 && > + =A0 =A0 =A0 =A0 =A0 (cap & BCE_FW_CAP_REMOTE_PHY_CAP) !=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->bce_phy_flags &=3D ~BCE_PHY_REMOTE_PORT= _FIBER_FLAG; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->bce_phy_flags |=3D BCE_PHY_REMOTE_CAP_F= LAG; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 link =3D bce_shmem_rd(sc, BCE_LINK_STATUS); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((link & BCE_LINK_STATUS_SERDES_LINK) != =3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->bce_phy_flags |=3D BCE_= PHY_REMOTE_PORT_FIBER_FLAG; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ack |=3D BCE_DRV_ACK_CAP_SIGNATURE_MAGIC | > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BCE_FW_CAP_REMOTE_PHY_CAP; > + =A0 =A0 =A0 } > + > + =A0 =A0 =A0 if (ack !=3D 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bce_shmem_wr(sc, BCE_DRV_ACK_CAP_MB, ack); > +} > + > + > =A0#ifdef BCE_DEBUG > =A0/*********************************************************************= *******/ > =A0/* Allows the driver state to be dumped through the sysctl interface. = =A0 =A0 =A0 */ > > Modified: stable/9/sys/dev/bce/if_bcereg.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/9/sys/dev/bce/if_bcereg.h =A0 =A0Wed May 23 01:49:50 2012 =A0 = =A0 =A0 =A0(r235817) > +++ stable/9/sys/dev/bce/if_bcereg.h =A0 =A0Wed May 23 02:02:29 2012 =A0 = =A0 =A0 =A0(r235818) > @@ -814,6 +814,23 @@ struct flash_spec { > =A0#define BCE_DRV_PULSE_SEQ_MASK =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A00x00= 007fff > > =A0#define BCE_MB_ARGS_0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A00x00000014 > +#define =A0 =A0 =A0 =A0BCE_NETLINK_SPEED_10HALF =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 (1<<0) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_SPEED_10FULL =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 (1<<1) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_SPEED_100HALF =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0(1<<2) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_SPEED_100FULL =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0(1<<3) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_SPEED_1000HALF =A0 =A0 =A0 =A0 =A0 = =A0 =A0 (1<<4) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_SPEED_1000FULL =A0 =A0 =A0 =A0 =A0 = =A0 =A0 (1<<5) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_SPEED_2500HALF =A0 =A0 =A0 =A0 =A0 = =A0 =A0 (1<<6) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_SPEED_2500FULL =A0 =A0 =A0 =A0 =A0 = =A0 =A0 (1<<7) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_SPEED_10GHALF =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0(1<<8) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_SPEED_10GFULL =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0(1<<9) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_ANEG_ENB =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 (1<<10) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_PHY_APP_REMOTE =A0 =A0 =A0 =A0 =A0 = =A0 =A0 (1<<11) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_FC_PAUSE_SYM =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 (1<<12) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_FC_PAUSE_ASYM =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0(1<<13) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_ETH_AT_WIRESPEED =A0 =A0 =A0 =A0 =A0 = =A0 (1<<14) > +#define =A0 =A0 =A0 =A0BCE_NETLINK_PHY_RESET =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0(1<<15) > + > =A0#define BCE_MB_ARGS_1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A00x00000018 > > =A0/* Indicate to the firmware not to go into the > @@ -1079,6 +1096,26 @@ struct flash_spec { > =A0#define BCE_BC_STATE_BC_DBG_CMD_LOOP_CNT_MASK =A00xffff > =A0#define BCE_BC_STATE_BC_DBG_CMD_LOOP_INFINITE =A00xffff > > +#define =A0 =A0 =A0 =A0BCE_FW_EVT_CODE_MB =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A00x00000354 > +#define =A0 =A0 =A0 =A0BCE_FW_EVT_CODE_SW_TIMER_EXPIRE_EVENT =A0 0x00000= 000 > +#define =A0 =A0 =A0 =A0BCE_FW_EVT_CODE_LINK_EVENT =A0 =A0 =A0 =A0 =A0 = =A0 =A00x00000001 > + > +#define =A0 =A0 =A0 =A0BCE_DRV_ACK_CAP_MB =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A00x00000364 > +#define =A0 =A0 =A0 =A0BCE_DRV_ACK_CAP_SIGNATURE_MAGIC =A0 =A0 =A0 =A0 0= x35450000 > + > +#define =A0 =A0 =A0 =A0BCE_FW_CAP_MB =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 0x00000368 > +#define =A0 =A0 =A0 =A0BCE_FW_CAP_SIGNATURE_MAGIC =A0 =A0 =A0 =A0 =A0 = =A0 =A00xaa550000 > +#define =A0 =A0 =A0 =A0BCE_FW_ACK_SIGNATURE_MAGIC =A0 =A0 =A0 =A0 =A0 = =A0 =A00x52500000 > +#define =A0 =A0 =A0 =A0BCE_FW_CAP_SIGNATURE_MAGIC_MASK =A0 =A0 =A0 =A0 0= xffff0000 > +#define =A0 =A0 =A0 =A0BCE_FW_CAP_REMOTE_PHY_CAP =A0 =A0 =A0 =A0 =A0 =A0= =A0 0x00000001 > +#define =A0 =A0 =A0 =A0BCE_FW_CAP_REMOTE_PHY_PRESENT =A0 =A0 =A0 =A0 =A0= 0x00000002 > +#define =A0 =A0 =A0 =A0BCE_FW_CAP_MFW_KEEP_VLAN =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A00x00000008 > +#define =A0 =A0 =A0 =A0BCE_FW_CAP_BC_KEEP_VLAN =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 0x00000010 > + > +#define =A0 =A0 =A0 =A0BCE_RPHY_SERDES_LINK =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A00x00000374 > + > +#define =A0 =A0 =A0 =A0BCE_RPHY_COPPER_LINK =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A00x00000378 > + > =A0#define HOST_VIEW_SHMEM_BASE =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0x167= c00 > > =A0/* > @@ -6454,6 +6491,8 @@ struct bce_softc > =A0#define BCE_PHY_INT_MODE_AUTO_POLLING_FLAG =A0 =A0 0x00000100 > =A0#define BCE_PHY_INT_MODE_LINK_READY_FLAG =A0 =A0 =A0 0x00000200 > =A0#define BCE_PHY_IEEE_CLAUSE_45_FLAG =A0 =A0 =A0 =A0 =A0 =A00x00000400 > +#define =A0 =A0 =A0 =A0BCE_PHY_REMOTE_CAP_FLAG =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 0x00000800 > +#define =A0 =A0 =A0 =A0BCE_PHY_REMOTE_PORT_FIBER_FLAG =A0 =A0 =A0 =A0 = =A00x00001000 > > =A0 =A0 =A0 =A0/* Values that need to be shared with the PHY driver. */ > =A0 =A0 =A0 =A0u32 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bce_shared_hw_= cfg; From owner-svn-src-all@FreeBSD.ORG Wed May 23 18:10:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6318B106566B; Wed, 23 May 2012 18:10: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 4367B8FC17; Wed, 23 May 2012 18:10: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 q4NIAtxx087929; Wed, 23 May 2012 18:10:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NIAteP087924; Wed, 23 May 2012 18:10:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205231810.q4NIAteP087924@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 May 2012 18:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235850 - in head/sys: kern sys vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:10:55 -0000 Author: kib Date: Wed May 23 18:10:54 2012 New Revision: 235850 URL: http://svn.freebsd.org/changeset/base/235850 Log: Calculate the count of per-process cow faults. Export the count to userspace using the obscure spare int field in struct kinfo_proc. Submitted by: Andrey Zonov MFC after: 1 week Modified: head/sys/kern/kern_proc.c head/sys/sys/proc.h head/sys/sys/user.h head/sys/vm/vm_fault.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed May 23 17:49:59 2012 (r235849) +++ head/sys/kern/kern_proc.c Wed May 23 18:10:54 2012 (r235850) @@ -878,6 +878,9 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_childtime = kp->ki_childstime; timevaladd(&kp->ki_childtime, &kp->ki_childutime); + FOREACH_THREAD_IN_PROC(p, td0) + kp->ki_cow += td0->td_cow; + tp = NULL; if (p->p_pgrp) { kp->ki_pgid = p->p_pgrp->pg_id; @@ -990,6 +993,7 @@ fill_kinfo_thread(struct thread *td, str kp->ki_runtime = cputick2usec(td->td_rux.rux_runtime); kp->ki_pctcpu = sched_pctcpu(td); kp->ki_estcpu = td->td_estcpu; + kp->ki_cow = td->td_cow; } /* We can't get this anymore but ps etc never used it anyway. */ Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed May 23 17:49:59 2012 (r235849) +++ head/sys/sys/proc.h Wed May 23 18:10:54 2012 (r235850) @@ -247,6 +247,7 @@ struct thread { int td_slptick; /* (t) Time at sleep. */ int td_blktick; /* (t) Time spent blocked. */ int td_swvoltick; /* (t) Time at last SW_VOL switch. */ + u_int td_cow; /* (*) Number of copy-on-write faults */ struct rusage td_ru; /* (t) rusage information. */ struct rusage_ext td_rux; /* (t) Internal rusage information. */ uint64_t td_incruntime; /* (t) Cpu ticks to transfer to proc. */ Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Wed May 23 17:49:59 2012 (r235849) +++ head/sys/sys/user.h Wed May 23 18:10:54 2012 (r235850) @@ -159,7 +159,7 @@ struct kinfo_proc { u_int ki_estcpu; /* Time averaged value of ki_cpticks */ u_int ki_slptime; /* Time since last blocked */ u_int ki_swtime; /* Time swapped in or out */ - int ki_spareint1; /* unused (just here for alignment) */ + u_int ki_cow; /* number of copy-on-write faults */ u_int64_t ki_runtime; /* Real time in microsec */ struct timeval ki_start; /* starting time */ struct timeval ki_childtime; /* time used by process children */ Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed May 23 17:49:59 2012 (r235849) +++ head/sys/vm/vm_fault.c Wed May 23 18:10:54 2012 (r235850) @@ -805,6 +805,7 @@ vnode_locked: if (!is_first_object_locked) VM_OBJECT_LOCK(fs.object); PCPU_INC(cnt.v_cow_faults); + curthread->td_cow++; } else { prot &= ~VM_PROT_WRITE; } From owner-svn-src-all@FreeBSD.ORG Wed May 23 18:11:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 828C31065670; Wed, 23 May 2012 18:11: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 6DE8A8FC0C; Wed, 23 May 2012 18:11: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 q4NIBb0K088003; Wed, 23 May 2012 18:11:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NIBbHX088000; Wed, 23 May 2012 18:11:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205231811.q4NIBbHX088000@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 May 2012 18:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235851 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:11:37 -0000 Author: kib Date: Wed May 23 18:11:36 2012 New Revision: 235851 URL: http://svn.freebsd.org/changeset/base/235851 Log: Add 'cow' keyword to show per-process cow count. Submitted by: Andrey Zonov MFC after: 1 week Modified: head/bin/ps/keyword.c head/bin/ps/ps.1 Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Wed May 23 18:10:54 2012 (r235850) +++ head/bin/ps/keyword.c Wed May 23 18:11:36 2012 (r235851) @@ -76,6 +76,7 @@ static VAR var[] = { {"comm", "COMMAND", NULL, LJUST, ucomm, 0, CHAR, NULL, 0}, {"command", "COMMAND", NULL, COMM|LJUST|USER, command, 0, CHAR, NULL, 0}, + {"cow", "COW", NULL, 0, kvar, KOFF(ki_cow), UINT, "u", 0}, {"cpu", "CPU", NULL, 0, kvar, KOFF(ki_estcpu), UINT, "d", 0}, {"cputime", "", "time", 0, NULL, 0, CHAR, NULL, 0}, {"egid", "", "gid", 0, NULL, 0, CHAR, NULL, 0}, Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Wed May 23 18:10:54 2012 (r235850) +++ head/bin/ps/ps.1 Wed May 23 18:11:36 2012 (r235851) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 8, 2012 +.Dd May 20, 2012 .Dt PS 1 .Os .Sh NAME @@ -496,6 +496,8 @@ login class command .It Cm command command and arguments +.It Cm cow +number of copy-on-write faults .It Cm cpu short-term CPU usage factor (for scheduling) .It Cm emul From owner-svn-src-all@FreeBSD.ORG Wed May 23 18:17:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36D89106564A; Wed, 23 May 2012 18:17:03 +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 21A908FC08; Wed, 23 May 2012 18:17:03 +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 q4NIH2U8088269; Wed, 23 May 2012 18:17:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NIH2t7088267; Wed, 23 May 2012 18:17:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205231817.q4NIH2t7088267@svn.freebsd.org> From: Xin LI Date: Wed, 23 May 2012 18:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235852 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:17:03 -0000 Author: delphij Date: Wed May 23 18:17:02 2012 New Revision: 235852 URL: http://svn.freebsd.org/changeset/base/235852 Log: Use %ju to match uintmax_t usage Modified: head/sys/geom/geom_flashmap.c Modified: head/sys/geom/geom_flashmap.c ============================================================================== --- head/sys/geom/geom_flashmap.c Wed May 23 18:11:36 2012 (r235851) +++ head/sys/geom/geom_flashmap.c Wed May 23 18:17:02 2012 (r235852) @@ -78,7 +78,7 @@ static void g_flashmap_print(struct g_flashmap_slice *slice) { - printf("%08jx-%08jx: %s (%lluKB)\n", (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, + printf("%08jx-%08jx: %s (%juKB)\n", (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, slice->sl_name, (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); } From owner-svn-src-all@FreeBSD.ORG Wed May 23 18:41:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C70AC1065672; Wed, 23 May 2012 18:41:45 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B25968FC14; Wed, 23 May 2012 18:41: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 q4NIfjVt089273; Wed, 23 May 2012 18:41:45 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NIfjNG089271; Wed, 23 May 2012 18:41:45 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205231841.q4NIfjNG089271@svn.freebsd.org> From: Joel Dahl Date: Wed, 23 May 2012 18:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235853 - head/usr.bin/lex X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:41:45 -0000 Author: joel (doc committer) Date: Wed May 23 18:41:45 2012 New Revision: 235853 URL: http://svn.freebsd.org/changeset/base/235853 Log: Fix error reported by mandoc. Modified: head/usr.bin/lex/lex.1 Modified: head/usr.bin/lex/lex.1 ============================================================================== --- head/usr.bin/lex/lex.1 Wed May 23 18:17:02 2012 (r235852) +++ head/usr.bin/lex/lex.1 Wed May 23 18:41:45 2012 (r235853) @@ -2247,8 +2247,7 @@ automatically anyway. .TP .B \-F specifies that the -.ul -fast +.I fast scanner table representation should be used (and stdio bypassed). This representation is about as fast as the full table representation From owner-svn-src-all@FreeBSD.ORG Wed May 23 18:44:49 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA7491065672; Wed, 23 May 2012 18:44:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8974F8FC0A; Wed, 23 May 2012 18:44:49 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4NIintY074336; Wed, 23 May 2012 18:44:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4NIinMS074335; Wed, 23 May 2012 18:44:49 GMT (envelope-from bapt@FreeBSD.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f Date: Wed, 23 May 2012 20:44:46 +0200 From: Baptiste Daroussin To: Bruce Evans Message-ID: <20120523184446.GB64580@ithaqua.etoilebsd.net> References: <201205220128.q4M1SXPv081576@svn.freebsd.org> <20120522183847.M1344@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" Content-Disposition: inline In-Reply-To: <20120522183847.M1344@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Garrett Cooper , Kevin Lo , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r235767 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:44:49 -0000 --8GpibOaaTibBMecb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 22, 2012 at 08:51:44PM +1000, Bruce Evans wrote: > On Mon, 21 May 2012, Garrett Cooper wrote: >=20 > > On Mon, May 21, 2012 at 6:28 PM, Kevin Lo wrote: > >> Author: kevlo > >> Date: Tue May 22 01:28:32 2012 > >> New Revision: 235767 > >> URL: http://svn.freebsd.org/changeset/base/235767 > >> > >> Log: > >> =A0Add missing header needed by free() > >> > >> =A0Reported by: =A0tinderbox >=20 > Please don't use binary characters in mail. >=20 > > Thank you for saving my mailbox :)!!! > > > > FWIW, it's weird because my STABLE-9 box didn't reproduce this. >=20 > This seems to be a bug in both nsparser.y and the new yacc: > - new yacc: it is incompatible. >=20 > Old yacc includes stdlib.h and string.h as the first thing in the > generated file, so the C code copied from the .y part sees them too. >=20 > New yacc puts more its code including its all includes (which still > involve stdlib.h) at the end of the generated file. >=20 > Including stdlib.h nearly first is from Lite2 (skeleton.c 1.7 in 1997). > Much later, FreeBSD moved it to the very first thing in the generated > file, so as to use namespace pollution (__unused) from it early. > __unused was ifdefed and was defined by the yacc skeleton if > didn't define it. It took much churn to produce this, but it seems to > have been garbage, since old yacc didn't actually generate any use of > __unused. The definition was apparently compatibilty cruft to hide > unportabilities in .y files that use __unused (I guess these failed for > bootstrapping). New yacc doesn't define __unused. >=20 > - nsparser.y: it uses free() but never declared it. It depended on > namespace pollution in the yacc code, and this pollution being in a > particular order. >=20 > The yyparse() incompatibilities seem to be bugs on both sides too: > - Old yacc didn't declare yyparse() automatically, so .y files had to do > it, but probably shouldn't have. >=20 > - New yacc still doesn't declare yylex() or yyerror() automatically, so > applications still have to declare them. >=20 > - Some of these may be more the responsibility of the yacc library (to > supply defaults) than others. I couldn't see who is required to decla= re > them in POSIX.1-2001. However, a bad example in POSIX.1 has "extern i= nt > yyparse();" in main() just before calling yyparse(). Badness in this > example include several style bugs and the declaration being incomplete > (missing "void"). > Old yacc has about 20 lines of ifdefs half just to supply this "void" > for STDC but not for K&R. New yacc no longer supports K&R, at least > here, but it still has 11 lines of ifdefs to get the declaration of > yyparse() right for bison compatibility). > I don't know if the badness includes having the home made declaration. >=20 > Nearby bugs: all CSRG and FreeBSD changes including copyrights and > history seem to have been lost. Just after the old include of stdlib.h, > skeleton.c used to produce a string yyrcsid[] with __FBSDID() for > skeleton.c itself in it. New yacc generates a string yysccsid with > a hard-coded berkeley 1993 id in it, and the name in this id doesn't > even match the file name (it is "yaccpar"). Another FreeBSD change was > to remove this bogus id from the generated file. >=20 > Some relevant FreeBSD changes: >=20 > % Index: skeleton.c > % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > % RCS file: /home/ncvs/src/usr.bin/yacc/skeleton.c,v > % retrieving revision 1.1.1.2 > % retrieving revision 1.37 > % diff -u -2 -r1.1.1.2 -r1.37 > % --- skeleton.c 6 Jan 1997 03:03:46 -0000 1.1.1.2 > % +++ skeleton.c 12 Feb 2003 18:03:55 -0000 1.37 > % @@ -35,7 +35,12 @@ > % */ > %=20 > % +#if 0 > % #ifndef lint > % static char sccsid[] =3D "@(#)skeleton.c 5.8 (Berkeley) 4/29/95"; > % -#endif /* not lint */ > % +#endif > % +#endif >=20 > FreeBSD normally comments out vendor ids like this. 5.8 is from Lite2; > Lite1 had 5.7. New yacc doesn't have any of this. It apparently started > from older yacc (before Lite1; indeed, it agrees with the FreeBSD-1 =3D= =3D Net/2 > version in not having any CSRG copyrights or this sccsid). >=20 > % + > % +#include > % +__FBSDID("$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.37 2003/02/12 18:0= 3:55 davidc Exp $"); >=20 > FreeBSD normally adds this to source files. Except in contrib. yacc is > now mostly in contrib, although it hasn't changed all that much. >=20 > %=20 > % #include "defs.h" > % @@ -53,31 +58,42 @@ > % /* are conditional. */ > %=20 > % -char *banner[] =3D > % +const char *banner[] =3D >=20 > New yacc has this change too. >=20 > % { > % + "#include ", >=20 > See above. >=20 > % "#ifndef lint", > % - "static char yysccsid[] =3D \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\= ";", >=20 > Was in Net/2 (?), FreeBSD-1, Lite1 and Lite2. Came back with new yacc. > It's interesting that "yaccpar 1.9 (Berkeley) 1.9 02/21/93" is only 3 mon= ths > before the correct id "skeleton.c 5.7 (Berkeley) 5/24/93". >=20 > Hmm, the FreeBSD-1 history is even more instructive than I first > thought. FreeBSD-1 started with the CSRG version of skeleton.c on > 1993/06/12. This had CSRG copyrights and ids, and yaccpar was at 1.8 > 01/20/90. But this was upgraded to "the newest version on > vangogh.cs.berkeley.edu" 17 days later on 1993/06/29. This version > has no CSRG copyrights or ids, except for the above rotted one for > yaccpar (the 1.9 02/21/93 one). I think it was only missing CSRG > copyrights and ids because CSRG only added these to full releases. > This resulted in the version in FreeBSD-1 not having any copyright > notices inside most files, and none for the directory either. The > new byacc seems to be the same as the older yacc here too. >=20 > % + "#ifdef __unused", > % + "__unused", > % + "#endif", > % + "static char const ", > % + "yyrcsid[] =3D \"$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.37 2003= /02/12 18:03:55 davidc Exp $\";", > % "#endif", > % - "#include ", >=20 > See above. >=20 > % "#define YYBYACC 1", > % "#define YYMAJOR 1", > % "#define YYMINOR 9", > % - "#define yyclearin (yychar=3D(-1))", > % + "#define YYLEX yylex()", > % + "#define YYEMPTY -1", > % + "#define yyclearin (yychar=3D(YYEMPTY))", > % "#define yyerrok (yyerrflag=3D0)", > % - "#define YYRECOVERING (yyerrflag!=3D0)", > % + "#define YYRECOVERING() (yyerrflag!=3D0)", > % + "#if defined(__cplusplus) || __STDC__", > % + "static int yygrowstack(void);", > % + "#else", > % + "static int yygrowstack();", > % + "#endif", >=20 > % 0 > % }; >=20 > Hrmph. It was FreeBSD that added the STDC ifdefs, to avoid breaking > support for generating K&R code (older yacc generated fairly pure K&R > code without even "const"). For yygrowstack(), this was sloppy: > it only changed the declaration -- the function body still doesn't > say "void". >=20 > % @@ -151,13 +174,35 @@ > % "#define YYACCEPT goto yyaccept", > % "#define YYERROR goto yyerrlab", > % + "", > % + "#ifndef YYPARSE_PARAM", > % + "#if defined(__cplusplus) || __STDC__", > % + "#define YYPARSE_PARAM_ARG void", > % + "#define YYPARSE_PARAM_DECL", > % + "#else /* ! ANSI-C/C++ */", > % + "#define YYPARSE_PARAM_ARG", > % + "#define YYPARSE_PARAM_DECL", > % + "#endif /* ANSI-C/C++ */", > % + "#else /* YYPARSE_PARAM */", > % + "#ifndef YYPARSE_PARAM_TYPE", > % + "#define YYPARSE_PARAM_TYPE void *", > % + "#endif", > % + "#if defined(__cplusplus) || __STDC__", > % + "#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM", > % + "#define YYPARSE_PARAM_DECL", > % + "#else /* ! ANSI-C/C++ */", > % + "#define YYPARSE_PARAM_ARG YYPARSE_PARAM", > % + "#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;", > % + "#endif /* ANSI-C/C++ */", > % + "#endif /* ! YYPARSE_PARAM */", > % + "", > % "int", > % - "yyparse()", > % + "yyparse (YYPARSE_PARAM_ARG)", > % + " YYPARSE_PARAM_DECL", > % "{", > % - " register int yym, yyn, yystate;", > % + " int yym, yyn, yystate;", > % "#if YYDEBUG", > % - " register char *yys;", > % - " extern char *getenv();", > % + " const char *yys;", > % "", > % - " if (yys =3D getenv(\"YYDEBUG\"))", > % + " if ((yys =3D getenv(\"YYDEBUG\")))", > % " {", > % " yyn =3D *yys;", >=20 > The STDC support was especially messy for yyparse(). >=20 > Bruce Thanks for all the remarks, I'll try to fix all issues you have spotted as = soon as possible. regards, Bapt --8GpibOaaTibBMecb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+9MB4ACgkQ8kTtMUmk6EyaMQCfeORSrtD3jcxwMhR2k1aJKqk0 8G8AniPcgzyUC3EuuVCNbqTY6glMNE1l =7Z87 -----END PGP SIGNATURE----- --8GpibOaaTibBMecb-- From owner-svn-src-all@FreeBSD.ORG Wed May 23 18:56:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2FFB9106566B; Wed, 23 May 2012 18:56:30 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0798FC12; Wed, 23 May 2012 18:56:30 +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 q4NIuTox089913; Wed, 23 May 2012 18:56:29 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NIuTBC089911; Wed, 23 May 2012 18:56:29 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201205231856.q4NIuTBC089911@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 23 May 2012 18:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235854 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:56:30 -0000 Author: emax Date: Wed May 23 18:56:29 2012 New Revision: 235854 URL: http://svn.freebsd.org/changeset/base/235854 Log: Tweak condition for disabling allocation from per-CPU buckets in low memory situation. I've observed a situation where per-CPU allocations were disabled while there were enough free cached pages. Basically, cnt.v_free_count was sitting stable at a value lower than cnt.v_free_min and that caused massive performance drop. Reviewed by: alc MFC after: 1 week Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed May 23 18:41:45 2012 (r235853) +++ head/sys/vm/uma_core.c Wed May 23 18:56:29 2012 (r235854) @@ -272,10 +272,7 @@ SYSCTL_PROC(_vm, OID_AUTO, zone_stats, C static void bucket_enable(void) { - if (cnt.v_free_count < cnt.v_free_min) - bucketdisable = 1; - else - bucketdisable = 0; + bucketdisable = vm_page_count_min(); } /* From owner-svn-src-all@FreeBSD.ORG Wed May 23 19:24:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5333C1065673; Wed, 23 May 2012 19:24:25 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 015DC8FC12; Wed, 23 May 2012 19:24:25 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 62FEA32B; Wed, 23 May 2012 21:24:17 +0200 (CEST) Date: Wed, 23 May 2012 21:22:32 +0200 From: Pawel Jakub Dawidek To: Xin LI Message-ID: <20120523192232.GA1399@garage.freebsd.pl> References: <201205231817.q4NIH2t7088267@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: <201205231817.q4NIH2t7088267@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235852 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 19:24:25 -0000 --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 23, 2012 at 06:17:02PM +0000, Xin LI wrote: > Author: delphij > Date: Wed May 23 18:17:02 2012 > New Revision: 235852 > URL: http://svn.freebsd.org/changeset/base/235852 >=20 > Log: > Use %ju to match uintmax_t usage >=20 > Modified: > head/sys/geom/geom_flashmap.c >=20 > Modified: head/sys/geom/geom_flashmap.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/geom/geom_flashmap.c Wed May 23 18:11:36 2012 (r235851) > +++ head/sys/geom/geom_flashmap.c Wed May 23 18:17:02 2012 (r235852) > @@ -78,7 +78,7 @@ static void > g_flashmap_print(struct g_flashmap_slice *slice) > { > =20 > - printf("%08jx-%08jx: %s (%lluKB)\n", (intmax_t)slice->sl_start, (intmax= _t)slice->sl_end, > + printf("%08jx-%08jx: %s (%juKB)\n", (intmax_t)slice->sl_start, (intmax_= t)slice->sl_end, > slice->sl_name, (uintmax_t)(slice->sl_end - slice->sl_start) / 1024= ); BTW, %jx is also uintmax_t, not intmax_t, right? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --2oS5YaxWCcQjTEyO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+9OPgACgkQForvXbEpPzRtjwCgrJG3TjGRhilrq/jbnSJYgw1v zh0AoNBxqk2AisHWQxv1UpJzvSA4jJrw =RtsC -----END PGP SIGNATURE----- --2oS5YaxWCcQjTEyO-- From owner-svn-src-all@FreeBSD.ORG Wed May 23 19:25:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B32C106564A; Wed, 23 May 2012 19:25:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 665A98FC14; Wed, 23 May 2012 19:25: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 q4NJPlkJ091180; Wed, 23 May 2012 19:25:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NJPlWX091178; Wed, 23 May 2012 19:25:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201205231925.q4NJPlWX091178@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 23 May 2012 19:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235855 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 19:25:47 -0000 Author: jilles Date: Wed May 23 19:25:46 2012 New Revision: 235855 URL: http://svn.freebsd.org/changeset/base/235855 Log: shutdown: Remove unnecessary 2-second delay. Modified: head/sbin/shutdown/shutdown.c Modified: head/sbin/shutdown/shutdown.c ============================================================================== --- head/sbin/shutdown/shutdown.c Wed May 23 18:56:29 2012 (r235854) +++ head/sbin/shutdown/shutdown.c Wed May 23 19:25:46 2012 (r235855) @@ -356,7 +356,6 @@ perform_shutdown(void) syslog(LOG_NOTICE, "%s by %s: %s", doreboot ? "reboot" : dohalt ? "halt" : dopower ? "power-down" : "shutdown", whom, mbuf); - (void)sleep(2); (void)printf("\r\nSystem shutdown time has arrived\007\007\r\n"); if (killflg) { From owner-svn-src-all@FreeBSD.ORG Wed May 23 19:57:38 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7880B1065672; Wed, 23 May 2012 19:57:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 03C4D8FC16; Wed, 23 May 2012 19:57:36 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA26437; Wed, 23 May 2012 22:57:29 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1SXHgX-0002dC-4d; Wed, 23 May 2012 22:57:29 +0300 Message-ID: <4FBD4124.5030205@FreeBSD.org> Date: Wed, 23 May 2012 22:57:24 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120503 Thunderbird/12.0.1 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201205231817.q4NIH2t7088267@svn.freebsd.org> <20120523192232.GA1399@garage.freebsd.pl> In-Reply-To: <20120523192232.GA1399@garage.freebsd.pl> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Xin LI Subject: Re: svn commit: r235852 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 19:57:38 -0000 on 23/05/2012 22:22 Pawel Jakub Dawidek said the following: > On Wed, May 23, 2012 at 06:17:02PM +0000, Xin LI wrote: >> Author: delphij Date: Wed May 23 18:17:02 2012 New Revision: 235852 URL: >> http://svn.freebsd.org/changeset/base/235852 >> >> Log: Use %ju to match uintmax_t usage >> >> Modified: head/sys/geom/geom_flashmap.c >> >> Modified: head/sys/geom/geom_flashmap.c >> ============================================================================== >> >> --- head/sys/geom/geom_flashmap.c Wed May 23 18:11:36 2012 (r235851) >> +++ head/sys/geom/geom_flashmap.c Wed May 23 18:17:02 2012 (r235852) @@ >> -78,7 +78,7 @@ static void g_flashmap_print(struct g_flashmap_slice >> *slice) { >> >> - printf("%08jx-%08jx: %s (%lluKB)\n", (intmax_t)slice->sl_start, >> (intmax_t)slice->sl_end, + printf("%08jx-%08jx: %s (%juKB)\n", >> (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, slice->sl_name, >> (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); > > BTW, %jx is also uintmax_t, not intmax_t, right? > I think that non-decimal representation generally implies unsigned-ness. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed May 23 20:22:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41866106564A; Wed, 23 May 2012 20:22:10 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C7B18FC12; Wed, 23 May 2012 20:22: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 q4NKMAtE093503; Wed, 23 May 2012 20:22:10 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NKM9mO093501; Wed, 23 May 2012 20:22:09 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205232022.q4NKM9mO093501@svn.freebsd.org> From: Joel Dahl Date: Wed, 23 May 2012 20:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235856 - head/libexec/rbootd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 20:22:10 -0000 Author: joel (doc committer) Date: Wed May 23 20:22:09 2012 New Revision: 235856 URL: http://svn.freebsd.org/changeset/base/235856 Log: mdoc: fix .Bl -offset. Modified: head/libexec/rbootd/rbootd.8 Modified: head/libexec/rbootd/rbootd.8 ============================================================================== --- head/libexec/rbootd/rbootd.8 Wed May 23 19:25:46 2012 (r235855) +++ head/libexec/rbootd/rbootd.8 Wed May 23 20:22:09 2012 (r235856) @@ -126,7 +126,7 @@ The following signals have the specified process using the .Xr kill 1 command: -.Bl -tag -width SIGUSR1 -offset -compact +.Bl -tag -width SIGUSR1 -offset xxxxxxxx .It SIGHUP Drop all active connections and reconfigure. .It SIGUSR1 From owner-svn-src-all@FreeBSD.ORG Wed May 23 20:29:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F6E8106564A; Wed, 23 May 2012 20:29:17 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AAE88FC15; Wed, 23 May 2012 20:29: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 q4NKTHgi093826; Wed, 23 May 2012 20:29:17 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NKTHBL093824; Wed, 23 May 2012 20:29:17 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205232029.q4NKTHBL093824@svn.freebsd.org> From: Joel Dahl Date: Wed, 23 May 2012 20:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235857 - head/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 20:29:17 -0000 Author: joel (doc committer) Date: Wed May 23 20:29:16 2012 New Revision: 235857 URL: http://svn.freebsd.org/changeset/base/235857 Log: mdoc: Only use macros inside a reference block. Modified: head/libexec/tftpd/tftpd.8 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Wed May 23 20:22:09 2012 (r235856) +++ head/libexec/tftpd/tftpd.8 Wed May 23 20:29:16 2012 (r235857) @@ -238,20 +238,16 @@ option. .Pp The following RFC's are supported: .Rs -RFC 1350 -.%T The TFTP Protocol (Revision 2) +.%T RFC 1350: The TFTP Protocol (Revision 2) .Re .Rs -RFC 2347 -.%T TFTP Option Extension +.%T RFC 2347: TFTP Option Extension .Re .Rs -RFC 2348 -.%T TFTP Blocksize Option +.%T RFC 2348: TFTP Blocksize Option .Re .Rs -RFC 2349 -.%T TFTP Timeout Interval and Transfer Size Options +.%T RFC 2349: TFTP Timeout Interval and Transfer Size Options .Re .Pp The non-standard From owner-svn-src-all@FreeBSD.ORG Wed May 23 20:51:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01B0106564A; Wed, 23 May 2012 20:51:21 +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 AB49D8FC08; Wed, 23 May 2012 20:51: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 q4NKpLGe094789; Wed, 23 May 2012 20:51:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NKpL9i094787; Wed, 23 May 2012 20:51:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205232051.q4NKpL9i094787@svn.freebsd.org> From: Xin LI Date: Wed, 23 May 2012 20:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235858 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 20:51:21 -0000 Author: delphij Date: Wed May 23 20:51:21 2012 New Revision: 235858 URL: http://svn.freebsd.org/changeset/base/235858 Log: - Correct signedness for casts; - Wrap long line while I'm there. Noticed by: pjd, avg Modified: head/sys/geom/geom_flashmap.c Modified: head/sys/geom/geom_flashmap.c ============================================================================== --- head/sys/geom/geom_flashmap.c Wed May 23 20:29:16 2012 (r235857) +++ head/sys/geom/geom_flashmap.c Wed May 23 20:51:21 2012 (r235858) @@ -78,8 +78,9 @@ static void g_flashmap_print(struct g_flashmap_slice *slice) { - printf("%08jx-%08jx: %s (%juKB)\n", (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, - slice->sl_name, (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); + printf("%08jx-%08jx: %s (%juKB)\n", (uintmax_t)slice->sl_start, + (uintmax_t)slice->sl_end, slice->sl_name, + (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); } static int From owner-svn-src-all@FreeBSD.ORG Wed May 23 21:07:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2262E106566C; Wed, 23 May 2012 21:07: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 0D8D28FC1B; Wed, 23 May 2012 21:07: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 q4NL712H095463; Wed, 23 May 2012 21:07:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NL71dw095460; Wed, 23 May 2012 21:07:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205232107.q4NL71dw095460@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 May 2012 21:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 21:07:02 -0000 Author: kib Date: Wed May 23 21:07:01 2012 New Revision: 235859 URL: http://svn.freebsd.org/changeset/base/235859 Log: Enable drm2 modules build. Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/i386/conf/XEN head/sys/modules/Makefile Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Wed May 23 20:51:21 2012 (r235858) +++ head/sys/i386/conf/XEN Wed May 23 21:07:01 2012 (r235859) @@ -7,7 +7,7 @@ cpu I686_CPU ident XEN makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WITHOUT_MODULES="aha ahb amd cxgb dpt drm hptmv ida malo mps mwl nve sound sym trm xfs" +makeoptions WITHOUT_MODULES="aha ahb amd cxgb dpt drm drm2 hptmv ida malo mps mwl nve sound sym trm xfs" options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed May 23 20:51:21 2012 (r235858) +++ head/sys/modules/Makefile Wed May 23 21:07:01 2012 (r235859) @@ -87,6 +87,7 @@ SUBDIR= ${_3dfx} \ ${_dpms} \ ${_dpt} \ ${_drm} \ + ${_drm2} \ ${_dtrace} \ dummynet \ ${_ed} \ @@ -461,6 +462,7 @@ _cyclic= cyclic .endif _dpms= dpms _drm= drm +_drm2= drm2 .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _dtrace= dtrace .endif @@ -630,6 +632,7 @@ _cyclic= cyclic .endif _dpms= dpms _drm= drm +_drm2= drm2 .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _dtrace= dtrace .endif From owner-svn-src-all@FreeBSD.ORG Wed May 23 21:37:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4D76106564A; Wed, 23 May 2012 21:37:34 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 35BEF8FC0A; Wed, 23 May 2012 21:37:34 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 6E56140009; Wed, 23 May 2012 23:37:33 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 63D1C40010; Wed, 23 May 2012 23:37:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (h-45-105.a163.priv.bahnhof.se [94.254.45.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 590E040009; Wed, 23 May 2012 23:37:32 +0200 (CEST) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3VyRs80YJMz8ggx; Wed, 23 May 2012 23:37:32 +0200 (CEST) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id sRMUR2cChm_O; Wed, 23 May 2012 23:37:29 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3VyRs554G0z8ggv; Wed, 23 May 2012 23:37:29 +0200 (CEST) Received: from tifa.daemonic.se (tifa.daemonic.se [IPv6:2001:470:dca9:1::6]) by mail.daemonic.se (Postfix) with ESMTPSA id 3VyRs54Tpjz9Ctq; Wed, 23 May 2012 23:37:29 +0200 (CEST) Received: from tifa.daemonic.se (localhost [IPv6:::1]) by tifa.daemonic.se (Postfix) with ESMTP id 713F922AC3; Wed, 23 May 2012 23:37:29 +0200 (CEST) Message-ID: <4FBD5899.9000808@daemonic.se> Date: Wed, 23 May 2012 23:37:29 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Konstantin Belousov References: <201205232107.q4NL71dw095460@svn.freebsd.org> In-Reply-To: <201205232107.q4NL71dw095460@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 21:37:34 -0000 On 05/23/12 23:07, Konstantin Belousov wrote: > Author: kib > Date: Wed May 23 21:07:01 2012 > New Revision: 235859 > URL: http://svn.freebsd.org/changeset/base/235859 > > Log: > Enable drm2 modules build. > > Sponsored by: The FreeBSD Foundation > MFC after: 1 month > > Modified: > head/sys/i386/conf/XEN > head/sys/modules/Makefile > Hi! Thank you very much for all your work! With this commit, is there any need for any patches from you, or have they all been incorporated by now? Perhaps a note in UPDATING would be good, at least to make people more aware of the fact that GEM/KMS finally has come to FreeBSD as well. An update to the wiki might be good as well. I can help you with patches and updating the wiki, just let me know. Once again, a big thank you! Regards! -- Niclas Zeising From owner-svn-src-all@FreeBSD.ORG Wed May 23 21:37:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07B6A1065677; Wed, 23 May 2012 21:37:40 +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 B766E8FC15; Wed, 23 May 2012 21:37:39 +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 q4NLbdun096759; Wed, 23 May 2012 21:37:39 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NLbd1F096747; Wed, 23 May 2012 21:37:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205232137.q4NLbd1F096747@svn.freebsd.org> From: Dimitry Andric Date: Wed, 23 May 2012 21:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235860 - in vendor/llvm/dist: . docs lib/ExecutionEngine/IntelJITEvents lib/ExecutionEngine/OProfileJIT tools/llvm-config utils/llvm-build/llvmbuild utils/unittest X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 21:37:40 -0000 Author: dim Date: Wed May 23 21:37:39 2012 New Revision: 235860 URL: http://svn.freebsd.org/changeset/base/235860 Log: Vendor import of llvm release_31 r156863 (the actual 3.1 release): http://llvm.org/svn/llvm-project/llvm/branches/release_31@156863 Modified: vendor/llvm/dist/CMakeLists.txt vendor/llvm/dist/Makefile.config.in vendor/llvm/dist/Makefile.rules vendor/llvm/dist/docs/LLVMBuild.html vendor/llvm/dist/docs/ReleaseNotes.html vendor/llvm/dist/lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt vendor/llvm/dist/lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt vendor/llvm/dist/tools/llvm-config/llvm-config.cpp vendor/llvm/dist/utils/llvm-build/llvmbuild/componentinfo.py vendor/llvm/dist/utils/llvm-build/llvmbuild/main.py vendor/llvm/dist/utils/unittest/LLVMBuild.txt Modified: vendor/llvm/dist/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/CMakeLists.txt Wed May 23 21:07:01 2012 (r235859) +++ vendor/llvm/dist/CMakeLists.txt Wed May 23 21:37:39 2012 (r235860) @@ -268,11 +268,21 @@ set(LLVMCONFIGLIBRARYDEPENDENCIESINC "${LLVM_BINARY_DIR}/tools/llvm-config/LibraryDependencies.inc") set(LLVMBUILDCMAKEFRAG "${LLVM_BINARY_DIR}/LLVMBuild.cmake") + +# Create the list of optional components that are enabled +if (LLVM_USE_INTEL_JITEVENTS) + set(LLVMOPTIONALCOMPONENTS IntelJITEvents) +endif (LLVM_USE_INTEL_JITEVENTS) +if (LLVM_USE_OPROFILE) + set(LLVMOPTIONALCOMPONENTS ${LLVMOPTIONALCOMPONENTS} OProfileJIT) +endif (LLVM_USE_OPROFILE) + message(STATUS "Constructing LLVMBuild project information") execute_process( COMMAND ${PYTHON_EXECUTABLE} ${LLVMBUILDTOOL} --native-target "${LLVM_NATIVE_ARCH}" --enable-targets "${LLVM_TARGETS_TO_BUILD}" + --enable-optional-components "${LLVMOPTIONALCOMPONENTS}" --write-library-table ${LLVMCONFIGLIBRARYDEPENDENCIESINC} --write-cmake-fragment ${LLVMBUILDCMAKEFRAG} ERROR_VARIABLE LLVMBUILDOUTPUT Modified: vendor/llvm/dist/Makefile.config.in ============================================================================== --- vendor/llvm/dist/Makefile.config.in Wed May 23 21:07:01 2012 (r235859) +++ vendor/llvm/dist/Makefile.config.in Wed May 23 21:37:39 2012 (r235860) @@ -351,3 +351,10 @@ INTEL_JITEVENTS_LIBDIR := @INTEL_JITEVEN # Flags to control building support for OProfile JIT API USE_OPROFILE := @USE_OPROFILE@ + +ifeq ($(USE_INTEL_JITEVENTS), 1) + OPTIONAL_COMPONENTS += IntelJITEvents +endif +ifeq ($(USE_OPROFILE), 1) + OPTIONAL_COMPONENTS += OProfileJIT +endif Modified: vendor/llvm/dist/Makefile.rules ============================================================================== --- vendor/llvm/dist/Makefile.rules Wed May 23 21:07:01 2012 (r235859) +++ vendor/llvm/dist/Makefile.rules Wed May 23 21:37:39 2012 (r235860) @@ -100,6 +100,7 @@ $(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/M $(Verb) $(LLVMBuildTool) \ --native-target "$(TARGET_NATIVE_ARCH)" \ --enable-targets "$(TARGETS_TO_BUILD)" \ + --enable-optional-components "$(OPTIONAL_COMPONENTS)" \ --write-library-table $(LLVMConfigLibraryDependenciesInc) \ --write-make-fragment $(LLVMBuildMakeFrag) Modified: vendor/llvm/dist/docs/LLVMBuild.html ============================================================================== --- vendor/llvm/dist/docs/LLVMBuild.html Wed May 23 21:07:01 2012 (r235859) +++ vendor/llvm/dist/docs/LLVMBuild.html Wed May 23 21:37:39 2012 (r235860) @@ -272,6 +272,11 @@ required_libraries = Archive BitReader C components. For example, the X86 target might define a library group for all of the X86 components. That library group might then be included in the all-targets library group.

    + +
  • installed [optional] [boolean] +

    Whether this library is installed. Libraries that are not installed + are only reported by llvm-config when it is run as part of a + development directory.

  • Modified: vendor/llvm/dist/docs/ReleaseNotes.html ============================================================================== --- vendor/llvm/dist/docs/ReleaseNotes.html Wed May 23 21:07:01 2012 (r235859) +++ vendor/llvm/dist/docs/ReleaseNotes.html Wed May 23 21:37:39 2012 (r235860) @@ -29,12 +29,6 @@

    Written by the LLVM Team

    -

    These are in-progress notes for the upcoming LLVM 3.1 -release.
    -You may prefer the -LLVM 3.0 -Release Notes.

    -

    Introduction @@ -74,9 +68,9 @@ Release Notes.

    The LLVM 3.1 distribution currently consists of code from the core LLVM repository (which roughly includes the LLVM optimizers, code generators and - supporting tools), and the Clang repository. In - addition to this code, the LLVM Project includes other sub-projects that are - in development. Here we include updates on these subprojects.

    + supporting tools), and the Clang repository. In addition to this code, the + LLVM Project includes other sub-projects that are in development. Here we + include updates on these subprojects.

    @@ -94,16 +88,22 @@ Release Notes.

    production-quality compiler for C, Objective-C, C++ and Objective-C++ on x86 (32- and 64-bit), and for Darwin/ARM targets.

    -

    In the LLVM 3.1 time-frame, the Clang team has made many improvements:

    +

    In the LLVM 3.1 time-frame, the Clang team has made many improvements. + Highlights include:

      -
    • C++11 support is greatly expanded including lambdas, initializer lists, constexpr, user-defined literals, and atomics.
    • -
    • ...
    • -
    - -

    For more details about the changes to Clang since the 2.9 release, see the -Clang release notes -

    - +
  • Greatly expanded C++11 + support including lambdas, initializer lists, constexpr, user-defined + literals, and atomics.
  • +
  • A new tooling + library to ease building of clang-based standalone tools.
  • +
  • Extended support for + literals in + Objective C.
  • + + +

    For more details about the changes to Clang since the 3.0 release, see the + Clang release + notes.

    If Clang rejects your code but another compiler accepts it, please take a look at the language @@ -118,6 +118,7 @@ Release Notes.

    +

    DragonEgg is a gcc plugin that replaces GCC's optimizers and code generators with LLVM's. It works with gcc-4.5 and gcc-4.6 @@ -128,8 +129,7 @@ Release Notes.

    The 3.1 release has the following notable changes:

    -
      - +
      • Partial support for gcc-4.7. Ada support is poor, but other languages work fairly well.
      • @@ -144,7 +144,6 @@ Release Notes. aliasing and type ranges to the LLVM optimizers.
      • A regression test-suite was added.
      • -
    @@ -165,7 +164,9 @@ Release Notes. implementations of this and other low-level routines (some are 3x faster than the equivalent libgcc routines).

    -

    ....

    +

    As of 3.1, compiler-rt includes the helper functions for atomic operations, + allowing atomic operations on arbitrary-sized quantities to work. These + functions follow the specification defined by gcc and are used by clang.

    @@ -176,12 +177,11 @@ Release Notes.
    -

    LLDB is a ground-up implementation of a command line debugger, as well as a - debugger API that can be used from other applications. LLDB makes use of the - Clang parser to provide high-fidelity expression parsing (particularly for - C++) and uses the LLVM JIT for target support.

    - -

    ...

    +

    LLDB is a ground-up implementation of a + command line debugger, as well as a debugger API that can be used from other + applications. LLDB makes use of the Clang parser to provide high-fidelity + expression parsing (particularly for C++) and uses the LLVM JIT for target + support.

    @@ -196,7 +196,16 @@ Release Notes. licensed under the MIT and UIUC license, allowing it to be used more permissively.

    -

    ...

    +

    Within the LLVM 3.1 time-frame there were the following highlights:

    + +
      +
    • The <atomic> header is now passing all tests, when + compiling with clang and linking against the support code from + compiler-rt.
    • +
    • FreeBSD now includes libc++ as part of the base system.
    • +
    • libc++ has been ported to Solaris and, in combination with libcxxrt and + clang, is working with a large body of existing code.
    • +
    @@ -207,16 +216,12 @@ Release Notes.
    -

    The VMKit project is an - implementation of a Java Virtual Machine (Java VM or JVM) that uses LLVM for - static and just-in-time compilation. - -

    In the LLVM 3.1 time-frame, VMKit has had significant improvements on both - runtime and startup performance:

    - -
      -
    • ...
    • -
    +

    The VMKit project is an implementation + of a Java Virtual Machine (Java VM or JVM) that uses LLVM for static and + just-in-time compilation.

    + +

    In the LLVM 3.1 time-frame, VMKit has had significant improvements on both + runtime and startup performance.

    @@ -228,25 +233,23 @@ Release Notes.
    -

    Polly is an experimental +

    Polly is an experimental optimizer for data locality and parallelism. It currently provides high-level loop optimizations and automatic parallelisation (using the OpenMP run time). Work in the area of automatic SIMD and accelerator code generation was - started. + started.

    -

    Within the LLVM 3.1 time-frame there were the following highlights:

    +

    Within the LLVM 3.1 time-frame there were the following highlights:

    -
      +
      • Polly became an official LLVM project
      • -
      • Polly can be loaded directly into clang (Enabled by '-O3 -mllvm -polly' - )
      • -
      • An automatic scheduling optimizer (derived from Pluto) was integrated. It - performs loop transformations to optimize for data-locality and parallelism. - The transformations include, but are not limited to interchange, fusion, - fission, skewing and tiling. -
      • -
      +
    • Polly can be loaded directly into clang (enabled by '-O3 -mllvm -polly')
    • +
    • An automatic scheduling optimizer (derived + from Pluto) was + integrated. It performs loop transformations to optimize for data-locality + and parallelism. The transformations include, but are not limited to + interchange, fusion, fission, skewing and tiling.
    • +
    @@ -264,21 +267,143 @@ Release Notes. a lot of other language and tools projects. This section lists some of the projects that have already been updated to work with LLVM 3.1.

    +

    Crack

    + +
    + +

    Crack aims to provide + the ease of development of a scripting language with the performance of a + compiled language. The language derives concepts from C++, Java and Python, + incorporating object-oriented programming, operator overloading and strong + typing.

    + +
    + +

    FAUST

    + +
    + +

    FAUST is a compiled language for + real-time audio signal processing. The name FAUST stands for Functional + AUdio STream. Its programming model combines two approaches: functional + programming and block diagram composition. In addition with the C, C++, Java, + JavaScript output formats, the Faust compiler can generate LLVM bitcode, and + works with LLVM 2.7-3.1.

    + +
    + +

    Glasgow Haskell Compiler (GHC)

    + +
    + +

    GHC is an open source compiler and + programming suite for Haskell, a lazy functional programming language. It + includes an optimizing static compiler generating good code for a variety of + platforms, together with an interactive system for convenient, quick + development.

    + +

    GHC 7.0 and onwards include an LLVM code generator, supporting LLVM 2.8 and + later.

    + +
    + +

    Julia

    + +
    + +

    Julia is a high-level, + high-performance dynamic language for technical computing. It provides a + sophisticated compiler, distributed parallel execution, numerical accuracy, + and an extensive mathematical function library. The compiler uses type + inference to generate fast code without any type declarations, and uses + LLVM's optimization passes and JIT compiler. The + Julia Language is designed + around multiple dispatch, giving programs a large degree of flexibility. It + is ready for use on many kinds of problems.

    + +
    + +

    LLVM D Compiler

    + +
    + +

    LLVM D Compiler (LDC) is + a compiler for the D programming Language. It is based on the DMD frontend + and uses LLVM as backend.

    + +
    + +

    Open Shading Language

    + +
    + +

    Open Shading + Language (OSL) is a small but rich language for programmable shading in + advanced global illumination renderers and other applications, ideal for + describing materials, lights, displacement, and pattern generation. It uses + LLVM to JIT complex shader networks to x86 code at runtime.

    + +

    OSL was developed by Sony Pictures Imageworks for use in its in-house + renderer used for feature film animation and visual effects, and is + distributed as open source software with the "New BSD" license.

    + +
    + +

    Portable OpenCL (pocl)

    + +
    + +

    In addition to producing an easily portable open source OpenCL + implementation, another major goal of + pocl is improving performance portability of OpenCL programs with + compiler optimizations, reducing the need for target-dependent manual + optimizations. An important part of pocl is a set of LLVM passes used to + statically parallelize multiple work-items with the kernel compiler, even in + the presence of work-group barriers. This enables static parallelization of + the fine-grained static concurrency in the work groups in multiple ways + (SIMD, VLIW, superscalar,...).

    + +
    +

    Pure

    -

    Pure (http://pure-lang.googlecode.com/) is an algebraic/functional -programming language based on term rewriting. Programs are collections of -equations which are used to evaluate expressions in a symbolic fashion. The -interpreter uses LLVM as a backend to JIT-compile Pure programs to fast native -code. Pure offers dynamic typing, eager and lazy evaluation, lexical closures, a -hygienic macro system (also based on term rewriting), built-in list and matrix -support (including list and matrix comprehensions) and an easy-to-use interface -to C and other programming languages (including the ability to load LLVM bitcode -modules, and inline C, C++, Fortran and Faust code in Pure programs if the -corresponding LLVM-enabled compilers are installed).

    +
    + +

    Pure is an + algebraic/functional programming language based on term rewriting. Programs + are collections of equations which are used to evaluate expressions in a + symbolic fashion. The interpreter uses LLVM as a backend to JIT-compile Pure + programs to fast native code. Pure offers dynamic typing, eager and lazy + evaluation, lexical closures, a hygienic macro system (also based on term + rewriting), built-in list and matrix support (including list and matrix + comprehensions) and an easy-to-use interface to C and other programming + languages (including the ability to load LLVM bitcode modules, and inline C, + C++, Fortran and Faust code in Pure programs if the corresponding + LLVM-enabled compilers are installed).

    Pure version 0.54 has been tested and is known to work with LLVM 3.1 (and -continues to work with older LLVM releases >= 2.5).

    + continues to work with older LLVM releases >= 2.5).

    + +
    + +

    TTA-based Co-design Environment (TCE)

    + +
    + +

    TCE is a toolset for designing + application-specific processors (ASP) based on the Transport triggered + architecture (TTA). The toolset provides a complete co-design flow from C/C++ + programs down to synthesizable VHDL/Verilog and parallel program binaries. + Processor customization points include the register files, function units, + supported operations, and the interconnection network.

    + +

    TCE uses Clang and LLVM for C/C++ language support, target independent + optimizations and also for parts of code generation. It generates new + LLVM-based code generators "on the fly" for the designed TTA processors and + loads them in to the compiler backend as runtime libraries to avoid + per-target recompilation of larger parts of the compiler chain.

    + +
    @@ -329,7 +454,6 @@ continues to work with older LLVM releas A full featured assembler and direct-to-object support for ARM.
  • Basic Block Placement Probability driven basic block placement.
  • -
  • ....
  • @@ -345,18 +469,22 @@ continues to work with older LLVM releas

    LLVM IR has several new features for better support of new targets and that expose new optimization opportunities:

    -
      -
    • IR support for half float
    • -
    • IR support for vectors of pointers, including vector GEPs.
    • -
    • Module flags have been introduced. They convey information about the - module as a whole to LLVM subsystems.
    • -
    • Loads can now have range metadata attached to them to describe the - possible values being loaded.
    • -
    • Inline cost heuristics have been completely overhauled and now closely - model constant propagation through call sites, disregard trivially dead - code costs, and can model C++ STL iterator patterns.
    • -
    • ....
    • -
    +
      +
    • A new type representing 16 bit half floating point values has + been added.
    • +
    • IR now supports vectors of pointers, including vector GEPs.
    • +
    • Module flags have been introduced. They convey information about the + module as a whole to LLVM subsystems. This is currently used to encode + Objective C ABI information.
    • +
    • Loads can now have range metadata attached to them to describe the + possible values being loaded.
    • +
    • The llvm.ctlz and llvm.cttz intrinsics now have an + additional argument which indicates whether the behavior of the intrinsic + is undefined on a zero input. This can be used to generate more efficient + code on platforms that only have instructions which don't return the type + size when counting bits in 0.
    • +
    + @@ -379,7 +507,9 @@ continues to work with older LLVM releas post-vectorization cleanup passes. For more information, see the EuroLLVM 2012 slides: Autovectorization with LLVM. -
  • ....
  • +
  • Inline cost heuristics have been completely overhauled and now closely + model constant propagation through call sites, disregard trivially dead + code costs, and can model C++ STL iterator patterns.
  • @@ -399,7 +529,9 @@ continues to work with older LLVM releas to the LLVM MC Project Blog Post.

      -
    • ....
    • +
    • The integrated assembler can optionally emit debug information when + assembling a .s file. It can be enabled by passing the + -g option to llvm-mc.
    @@ -436,6 +568,9 @@ continues to work with older LLVM releas representation of large clobber lists on call instructions. The register mask operand references a bit mask of preserved registers. Everything else is clobbered. +
  • The DWARF debug info writer gained support for emitting data for the + name accelerator tables + DWARF extension. It is used by LLDB to speed up name lookup.
  • We added new TableGen infrastructure to support bundling for @@ -469,13 +604,14 @@ static heuristics as well as source code

    New features and major changes in the X86 target include:

      -
    • Bug fixes and improved support for AVX1
    • -
    • Support for AVX2 (still incomplete at this point)
    • +
    • Greatly improved support for AVX2.
    • +
    • Lots of bug fixes and improvements for AVX1.
    • +
    • Support for the FMA4 and XOP instruction set extensions.
    • Call instructions use the new register mask operands for faster compile times and better support for different calling conventions. The old WINCALL instructions are no longer needed.
    • DW2 Exception Handling is enabled on Cygwin and MinGW.
    • -
    • Support for implicit TLS model used with MS VC runtime
    • +
    • Support for implicit TLS model used with MSVC runtime.
    @@ -520,28 +656,47 @@ syntax, there are still significant gaps
    - -

    This release has seen major new work on just about every aspect of the MIPS - backend. Some of the major new features include:

    +New features and major changes in the MIPS target include:

      -
    • ....
    • +
    • MIPS32 little-endian direct object code emission is functional.
    • +
    • MIPS64 little-endian code generation is largely functional for N64 ABI in assembly printing mode with the exception of handling of long double (f128) type.
    • +
    • Support for new instructions has been added, which includes swap-bytes + instructions (WSBH and DSBH), floating point multiply-add/subtract and + negative multiply-add/subtract instructions, and floating + point load/store instructions with reg+reg addressing (LWXC1, etc.)
    • +
    • Various fixes to improve performance have been implemented.
    • +
    • Post-RA scheduling is now enabled at -O3.
    • +
    • Support for soft-float code generation has been added.
    • +
    • clang driver's support for MIPS 64-bits targets.
    • +
    • Support for MIPS floating point ABI option in clang driver.

    -Other Target Specific Improvements +PTX Target Improvements

    -

    Support for Qualcomm's Hexagon VLIW processor has been added.

    +

    An outstanding conditional inversion bug was fixed in this release.

    -
      -
    • ....
    • +

      NOTE: LLVM 3.1 marks the last release of the PTX back-end, in its + current form. The back-end is currently being replaced by the NVPTX + back-end, currently in SVN ToT.

      + +
    + + +

    +Other Target Specific Improvements +

    +
    +
      +
    • Support for Qualcomm's Hexagon VLIW processor has been added.
    @@ -558,6 +713,12 @@ syntax, there are still significant gaps from the previous release.

      +
    • LLVM's build system now requires a python 2 interpreter to be present at + build time. A perl interpreter is no longer required.
    • +
    • The C backend has been removed. It had numerous problems, to the point of + not being able to compile any nontrivial program.
    • +
    • The Alpha, Blackfin and SystemZ targets have been removed due to lack of + maintenance.
    • LLVM 3.1 removes support for reading LLVM 2.9 bitcode files. Going forward, we aim for all future versions of LLVM to read bitcode files and .ll files produced by LLVM 3.0 and later.
    • @@ -567,7 +728,6 @@ syntax, there are still significant gaps
    • LLVM 3.0 and earlier automatically added the returns_twice fo functions like setjmp based on the name. This functionality was removed in 3.1. This affects Clang users, if -ffreestanding is used.
    • -
    • ....
    @@ -614,9 +774,9 @@ syntax, there are still significant gaps
  • llvm::getTrapFunctionName()
  • llvm::EnableSegmentedStacks
  • -
  • The MDBuilder class has been added to simplify the creation of - metadata.
  • -
  • ....
  • + +
  • The MDBuilder class has been added to simplify the creation + of metadata.
  • @@ -633,16 +793,37 @@ syntax, there are still significant gaps
      -
    • llvm-stress is a command line tool for generating random .ll files to fuzz - different LLVM components.
    • -
    • llvm-ld has been removed. Use llvm-link or Clang instead.
    • -
    • ....
    • +
    • llvm-stress is a command line tool for generating random + .ll files to fuzz different LLVM components.
    • +
    • The llvm-ld tool has been removed. The clang driver provides a + more reliable solution for turning a set of bitcode files into a binary. + To merge bitcode files llvm-link can be used instead.
    + + + + +

    +Python Bindings +

    + +
    + +

    Officially supported Python bindings have been added! Feature support is far +from complete. The current bindings support interfaces to:

      -
    • ....
    • +
    • Object File Interface
    • +
    • Disassembler
    +

    Using the Object File Interface, it is possible to inspect binary object files. +Think of it as a Python version of readelf or llvm-objdump.

    + +

    Support for additional features is currently being developed by community +contributors. If you are interested in shaping the direction of the Python +bindings, please express your intent on IRC or the developers list.

    +
    @@ -667,18 +848,13 @@ syntax, there are still significant gaps

    Known problem areas include:

      -
    • The Alpha, Blackfin, CellSPU, MSP430, PTX, SystemZ and - XCore backends are experimental, and the Alpha, Blackfin and SystemZ - targets have already been removed from mainline.
    • +
    • The CellSPU, MSP430, PTX and XCore backends are experimental.
    • The integrated assembler, disassembler, and JIT is not supported by several targets. If an integrated assembler is not supported, then a system assembler is required. For more details, see the Target Features Matrix.
    • - -
    • The C backend has numerous problems and is not being actively maintained. - Depending on it for anything serious is not advised.
    @@ -714,7 +890,7 @@ syntax, there are still significant gaps src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2012-05-13 12:04:01 +0200 (Sun, 13 May 2012) $ + Last modified: $Date: 2012-05-15 23:58:06 +0200 (Tue, 15 May 2012) $ Modified: vendor/llvm/dist/lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt ============================================================================== --- vendor/llvm/dist/lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt Wed May 23 21:07:01 2012 (r235859) +++ vendor/llvm/dist/lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt Wed May 23 21:37:39 2012 (r235860) @@ -18,6 +18,6 @@ [common] [component_0] -type = Library +type = OptionalLibrary name = IntelJITEvents parent = ExecutionEngine Modified: vendor/llvm/dist/lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt ============================================================================== --- vendor/llvm/dist/lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt Wed May 23 21:07:01 2012 (r235859) +++ vendor/llvm/dist/lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt Wed May 23 21:37:39 2012 (r235860) @@ -18,6 +18,6 @@ [common] [component_0] -type = Library +type = OptionalLibrary name = OProfileJIT parent = ExecutionEngine Modified: vendor/llvm/dist/tools/llvm-config/llvm-config.cpp ============================================================================== --- vendor/llvm/dist/tools/llvm-config/llvm-config.cpp Wed May 23 21:07:01 2012 (r235859) +++ vendor/llvm/dist/tools/llvm-config/llvm-config.cpp Wed May 23 21:37:39 2012 (r235860) @@ -54,7 +54,8 @@ using namespace llvm; static void VisitComponent(StringRef Name, const StringMap &ComponentMap, std::set &VisitedComponents, - std::vector &RequiredLibs) { + std::vector &RequiredLibs, + bool IncludeNonInstalled) { // Lookup the component. AvailableComponent *AC = ComponentMap.lookup(Name); assert(AC && "Invalid component name!"); @@ -65,10 +66,14 @@ static void VisitComponent(StringRef Nam return; } + // Only include non-installed components if requested. + if (!AC->IsInstalled && !IncludeNonInstalled) + return; + // Otherwise, visit all the dependencies. for (unsigned i = 0; AC->RequiredLibraries[i]; ++i) { VisitComponent(AC->RequiredLibraries[i], ComponentMap, VisitedComponents, - RequiredLibs); + RequiredLibs, IncludeNonInstalled); } // Add to the required library list. @@ -83,8 +88,11 @@ static void VisitComponent(StringRef Nam /// \param Components - The names of the components to find libraries for. /// \param RequiredLibs [out] - On return, the ordered list of libraries that /// are required to link the given components. +/// \param IncludeNonInstalled - Whether non-installed components should be +/// reported. void ComputeLibsForComponents(const std::vector &Components, - std::vector &RequiredLibs) { + std::vector &RequiredLibs, + bool IncludeNonInstalled) { std::set VisitedComponents; // Build a map of component names to information. @@ -107,7 +115,7 @@ void ComputeLibsForComponents(const std: } VisitComponent(ComponentLower, ComponentMap, VisitedComponents, - RequiredLibs); + RequiredLibs, IncludeNonInstalled); } // The list is now ordered with leafs first, we want the libraries to printed @@ -278,6 +286,10 @@ int main(int argc, char **argv) { PrintLibFiles = true; } else if (Arg == "--components") { for (unsigned j = 0; j != array_lengthof(AvailableComponents); ++j) { + // Only include non-installed components when in a development tree. + if (!AvailableComponents[j].IsInstalled && !IsInDevelopmentTree) + continue; + OS << ' '; OS << AvailableComponents[j].Name; } @@ -310,7 +322,8 @@ int main(int argc, char **argv) { // Construct the list of all the required libraries. std::vector RequiredLibs; - ComputeLibsForComponents(Components, RequiredLibs); + ComputeLibsForComponents(Components, RequiredLibs, + /*IncludeNonInstalled=*/IsInDevelopmentTree); for (unsigned i = 0, e = RequiredLibs.size(); i != e; ++i) { StringRef Lib = RequiredLibs[i]; Modified: vendor/llvm/dist/utils/llvm-build/llvmbuild/componentinfo.py ============================================================================== --- vendor/llvm/dist/utils/llvm-build/llvmbuild/componentinfo.py Wed May 23 21:07:01 2012 (r235859) +++ vendor/llvm/dist/utils/llvm-build/llvmbuild/componentinfo.py Wed May 23 21:37:39 2012 (r235860) @@ -68,6 +68,21 @@ class ComponentInfo(object): def get_llvmbuild_fragment(self): abstract + def get_parent_target_group(self): + """get_parent_target_group() -> ComponentInfo or None + + Return the nearest parent target group (if any), or None if the + component is not part of any target group. + """ + + # If this is a target group, return it. + if self.type_name == 'TargetGroup': + return self + + # Otherwise recurse on the parent, if any. + if self.parent_instance: + return self.parent_instance.get_parent_target_group() + class GroupComponentInfo(ComponentInfo): """ Group components have no semantics as far as the build system are concerned, @@ -95,16 +110,22 @@ class LibraryComponentInfo(ComponentInfo type_name = 'Library' @staticmethod - def parse(subpath, items): + def parse_items(items): kwargs = ComponentInfo.parse_items(items) kwargs['library_name'] = items.get_optional_string('library_name') kwargs['required_libraries'] = items.get_list('required_libraries') kwargs['add_to_library_groups'] = items.get_list( 'add_to_library_groups') + kwargs['installed'] = items.get_optional_bool('installed', True) + return kwargs + + @staticmethod + def parse(subpath, items): + kwargs = LibraryComponentInfo.parse_items(items) return LibraryComponentInfo(subpath, **kwargs) def __init__(self, subpath, name, dependencies, parent, library_name, - required_libraries, add_to_library_groups): + required_libraries, add_to_library_groups, installed): ComponentInfo.__init__(self, subpath, name, dependencies, parent) # If given, the name to use for the library instead of deriving it from @@ -119,6 +140,9 @@ class LibraryComponentInfo(ComponentInfo # considered part of. self.add_to_library_groups = list(add_to_library_groups) + # Whether or not this library is installed. + self.installed = installed + def get_component_references(self): for r in ComponentInfo.get_component_references(self): yield r @@ -140,6 +164,8 @@ class LibraryComponentInfo(ComponentInfo if self.add_to_library_groups: print >>result, 'add_to_library_groups = %s' % ' '.join( self.add_to_library_groups) + if not self.installed: + print >>result, 'installed = 0' return result.getvalue() def get_library_name(self): @@ -165,6 +191,20 @@ class LibraryComponentInfo(ComponentInfo def get_llvmconfig_component_name(self): return self.get_library_name().lower() +class OptionalLibraryComponentInfo(LibraryComponentInfo): + type_name = "OptionalLibrary" + + @staticmethod + def parse(subpath, items): + kwargs = LibraryComponentInfo.parse_items(items) + return OptionalLibraryComponentInfo(subpath, **kwargs) + + def __init__(self, subpath, name, dependencies, parent, library_name, + required_libraries, add_to_library_groups, installed): + LibraryComponentInfo.__init__(self, subpath, name, dependencies, parent, + library_name, required_libraries, + add_to_library_groups, installed) + class LibraryGroupComponentInfo(ComponentInfo): type_name = 'LibraryGroup' @@ -375,7 +415,7 @@ _component_type_map = dict( for t in (GroupComponentInfo, LibraryComponentInfo, LibraryGroupComponentInfo, ToolComponentInfo, BuildToolComponentInfo, - TargetGroupComponentInfo)) + TargetGroupComponentInfo, OptionalLibraryComponentInfo)) def load_from_path(path, subpath): # Load the LLVMBuild.txt file as an .ini format file. parser = ConfigParser.RawConfigParser() Modified: vendor/llvm/dist/utils/llvm-build/llvmbuild/main.py ============================================================================== --- vendor/llvm/dist/utils/llvm-build/llvmbuild/main.py Wed May 23 21:07:01 2012 (r235859) +++ vendor/llvm/dist/utils/llvm-build/llvmbuild/main.py Wed May 23 21:37:39 2012 (r235860) @@ -312,15 +312,26 @@ subdirectories = %s f.close() - def write_library_table(self, output_path): + def write_library_table(self, output_path, enabled_optional_components): # Write out the mapping from component names to required libraries. # # We do this in topological order so that we know we can append the # dependencies for added library groups. entries = {} for c in self.ordered_component_infos: + # Skip optional components which are not enabled. + if c.type_name == 'OptionalLibrary' \ + and c.name not in enabled_optional_components: + continue + + # Skip target groups which are not enabled. + tg = c.get_parent_target_group() + if tg and not tg.enabled: + continue + # Only certain components are in the table. - if c.type_name not in ('Library', 'LibraryGroup', 'TargetGroup'): + if c.type_name not in ('Library', 'OptionalLibrary', \ + 'LibraryGroup', 'TargetGroup'): continue # Compute the llvm-config "component name". For historical reasons, @@ -328,10 +339,12 @@ subdirectories = %s llvmconfig_component_name = c.get_llvmconfig_component_name() # Get the library name, or None for LibraryGroups. - if c.type_name == 'Library': + if c.type_name == 'Library' or c.type_name == 'OptionalLibrary': library_name = c.get_prefixed_library_name() + is_installed = c.installed else: library_name = None + is_installed = True # Get the component names of all the required libraries. required_llvmconfig_component_names = [ @@ -344,7 +357,8 @@ subdirectories = %s # Add the entry. entries[c.name] = (llvmconfig_component_name, library_name, - required_llvmconfig_component_names) + required_llvmconfig_component_names, + is_installed) # Convert to a list of entries and sort by name. entries = entries.values() @@ -352,16 +366,16 @@ subdirectories = %s # Create an 'all' pseudo component. We keep the dependency list small by # only listing entries that have no other dependents. root_entries = set(e[0] for e in entries) - for _,_,deps in entries: + for _,_,deps,_ in entries: root_entries -= set(deps) - entries.append(('all', None, root_entries)) + entries.append(('all', None, root_entries, True)) entries.sort() # Compute the maximum number of required libraries, plus one so there is # always a sentinel. max_required_libraries = max(len(deps) - for _,_,deps in entries) + 1 + for _,_,deps,_ in entries) + 1 # Write out the library table. make_install_dir(os.path.dirname(output_path)) @@ -382,18 +396,21 @@ subdirectories = %s print >>f, ' /// The name of the library for this component (or NULL).' print >>f, ' const char *Library;' print >>f, '' + print >>f, ' /// Whether the component is installed.' + print >>f, ' bool IsInstalled;' + print >>f, '' print >>f, '\ /// The list of libraries required when linking this component.' print >>f, ' const char *RequiredLibraries[%d];' % ( max_required_libraries) print >>f, '} AvailableComponents[%d] = {' % len(entries) - for name,library_name,required_names in entries: + for name,library_name,required_names,is_installed in entries: if library_name is None: library_name_as_cstr = '0' else: library_name_as_cstr = '"lib%s.a"' % library_name - print >>f, ' { "%s", %s, { %s } },' % ( - name, library_name_as_cstr, + print >>f, ' { "%s", %s, %d, { %s } },' % ( + name, library_name_as_cstr, is_installed, ', '.join('"%s"' % dep for dep in required_names)) print >>f, '};' @@ -778,6 +795,11 @@ given by --build-root) at the same SUBPA help=("Enable the given space or semi-colon separated " "list of targets, or all targets if not present"), action="store", default=None) + group.add_option("", "--enable-optional-components", + dest="optional_components", metavar="NAMES", + help=("Enable the given space or semi-colon separated " + "list of optional components"), + action="store", default=None) parser.add_option_group(group) (opts, args) = parser.parse_args() @@ -819,7 +841,8 @@ given by --build-root) at the same SUBPA # Write out the required library table, if requested. if opts.write_library_table: - project_info.write_library_table(opts.write_library_table) + project_info.write_library_table(opts.write_library_table, + opts.optional_components) # Write out the make fragment, if requested. if opts.write_make_fragment: Modified: vendor/llvm/dist/utils/unittest/LLVMBuild.txt ============================================================================== --- vendor/llvm/dist/utils/unittest/LLVMBuild.txt Wed May 23 21:07:01 2012 (r235859) +++ vendor/llvm/dist/utils/unittest/LLVMBuild.txt Wed May 23 21:37:39 2012 (r235860) @@ -20,9 +20,11 @@ type = Library name = gtest parent = Libraries required_libraries = Support +installed = 0 [component_1] type = Library name = gtest_main parent = Libraries required_libraries = gtest +installed = 0 From owner-svn-src-all@FreeBSD.ORG Wed May 23 21:38:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 903B61065700; Wed, 23 May 2012 21:38:27 +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 62A578FC08; Wed, 23 May 2012 21:38:27 +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 q4NLcRrL096827; Wed, 23 May 2012 21:38:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NLcR5t096826; Wed, 23 May 2012 21:38:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205232138.q4NLcR5t096826@svn.freebsd.org> From: Dimitry Andric Date: Wed, 23 May 2012 21:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235861 - vendor/llvm/llvm-release_31-r156863 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 21:38:27 -0000 Author: dim Date: Wed May 23 21:38:26 2012 New Revision: 235861 URL: http://svn.freebsd.org/changeset/base/235861 Log: Tag llvm release_31 r156863 (the actual 3.1 release). Added: vendor/llvm/llvm-release_31-r156863/ - copied from r235860, vendor/llvm/dist/ From owner-svn-src-all@FreeBSD.ORG Wed May 23 21:39:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65F8A10657A7; Wed, 23 May 2012 21:39:14 +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 3FE3E8FC20; Wed, 23 May 2012 21:39: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 q4NLdDS8096897; Wed, 23 May 2012 21:39:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NLdDt0096894; Wed, 23 May 2012 21:39:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205232139.q4NLdDt0096894@svn.freebsd.org> From: Dimitry Andric Date: Wed, 23 May 2012 21:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235862 - in vendor/clang/dist: docs lib/Basic X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 21:39:14 -0000 Author: dim Date: Wed May 23 21:39:13 2012 New Revision: 235862 URL: http://svn.freebsd.org/changeset/base/235862 Log: Vendor import of clang release_31 r156863 (the actual 3.1 release): http://llvm.org/svn/llvm-project/cfe/branches/release_31@156863 Modified: vendor/clang/dist/docs/ReleaseNotes.html vendor/clang/dist/lib/Basic/Version.cpp Modified: vendor/clang/dist/docs/ReleaseNotes.html ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.html Wed May 23 21:38:26 2012 (r235861) +++ vendor/clang/dist/docs/ReleaseNotes.html Wed May 23 21:39:13 2012 (r235862) @@ -26,14 +26,12 @@ td {
  • Introduction
  • What's New in Clang 3.1?
  • -
  • Known Problems
  • Additional Information
  • @@ -41,12 +39,6 @@ td {

    Written by the LLVM Team

    -

    These are in-progress notes for the upcoming Clang 3.1 -release.
    -You may prefer the -Clang 3.0 -Release Notes.

    -

    Introduction

    @@ -79,25 +71,6 @@ are described first, followed by languag Clang's support for those languages.

    -

    Major New Features

    - - -

    Feature 1

    -... - -

    New and better diagnostics

    - -

    New: -Wdangling-else, -Wstrncat-size, ...

    - -

    Improved: -Wformat, -Wempty-body, --Wliteral-conversion, ...

    - -

    Tooling

    - -

    Added an API to enable clang-based standalone tools, including initial build -system integration.

    - -

    C Language Changes in Clang

    @@ -141,24 +114,47 @@ following are now considered to be of pr Clang 3.1 introduces several new Objective-C language features and improvements. +

    Objective-C literals and subscripting

    + +

    Objective-C now provides additional literal expressions, including numeric, array, and dictionary literals. Additionally, array and dictionary elements can be accesses via the subscripting operator. For more information about the new literals, see the documentation for Objective-C literals and subscripting. +

    Format string checking for NSString literals

    --Wformat now checks @"nsstring literals". +-Wformat now checks @"NSString literals". -

    Internal API Changes

    +

    Python Binding Changes

    -These are major API changes that have happened since the 3.0 release of Clang. -If upgrading an external codebase that uses Clang as a library, this section -should help get you past the largest hurdles of upgrading. - -

    API change 1

    -... - - -

    Significant Known Problems

    - +The following methods have been added: +
      +
    • SourceLocation.from_position (static)
    • +
    • SourceLocation.__eq__ and SourceLocation.__ne__
    • +
    • SourceRange.__eq__ and SourceRange.__ne__
    • +
    • Diagnostic.category_number (property)
    • +
    • Diagnostic.category_name (property)
    • +
    • Diagnostic.option (property)
    • +
    • Diagnostic.disable_option (property)
    • +
    • CursorKind.is_translation_unit
    • +
    • CursorKind.is_preprocessing
    • +
    • CursorKind.is_unexposed
    • +
    • Cursor.from_location (static)
    • +
    • Cursor.underlying_typedef_type (property)
    • +
    • Cursor.enum_type (property)
    • +
    • Cursor.objc_type_encoding (property)
    • +
    • Cursor.hash
    • +
    • TypeKind.spelling
    • +
    • Type.argument_types
    • +
    • Type.element_type (property)
    • +
    • Type.element_count (property)
    • +
    • Type.is_function_variadic
    • +
    • Type.is_pod
    • +
    • Type.get_array_element_type
    • +
    • Type.get_array_size
    • +
    • Type.__eq__ and Type.__ne__
    • +
    • File.from_name (static)
    • +
    • File.__str__ and File.__repr__
    • +

    Additional Information

    @@ -176,18 +172,6 @@ contact us via the Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD29C106564A; Wed, 23 May 2012 21:39:39 +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 9EBDF8FC14; Wed, 23 May 2012 21:39:39 +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 q4NLddjW096948; Wed, 23 May 2012 21:39:39 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NLddfi096947; Wed, 23 May 2012 21:39:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205232139.q4NLddfi096947@svn.freebsd.org> From: Dimitry Andric Date: Wed, 23 May 2012 21:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235863 - vendor/clang/clang-release_31-r156863 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 21:39:39 -0000 Author: dim Date: Wed May 23 21:39:39 2012 New Revision: 235863 URL: http://svn.freebsd.org/changeset/base/235863 Log: Tag clang release_31 r156863 (the actual 3.1 release). Added: vendor/clang/clang-release_31-r156863/ - copied from r235862, vendor/clang/dist/ From owner-svn-src-all@FreeBSD.ORG Wed May 23 21:48:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1C20106564A; Wed, 23 May 2012 21:48:50 +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 B79638FC08; Wed, 23 May 2012 21:48: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 q4NLmoZe097403; Wed, 23 May 2012 21:48:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NLmoXp097382; Wed, 23 May 2012 21:48:50 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205232148.q4NLmoXp097382@svn.freebsd.org> From: Dimitry Andric Date: Wed, 23 May 2012 21:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235864 - in head: contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/tools/clang/include/clang/AST contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/include/clang/P... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 21:48:50 -0000 Author: dim Date: Wed May 23 21:48:49 2012 New Revision: 235864 URL: http://svn.freebsd.org/changeset/base/235864 Log: Upgrade our copy of llvm/clang to 3.1 release. Release notes can be found at: http://llvm.org/releases/3.1/docs/ReleaseNotes.html MFC after: 3 days Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp head/contrib/llvm/tools/clang/include/clang/AST/Decl.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/llvm/Config/config.h Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Wed May 23 21:48:49 2012 (r235864) @@ -131,30 +131,16 @@ static void CheckForPhysRegDependency(SD } } -static void AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG) { - SmallVector VTs; - SDNode *GlueDestNode = Glue.getNode(); - - // Don't add glue from a node to itself. - if (GlueDestNode == N) return; - - // Don't add glue to something that already has it, either as a use or value. - if (N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Glue || - N->getValueType(N->getNumValues() - 1) == MVT::Glue) { - return; - } - for (unsigned I = 0, E = N->getNumValues(); I != E; ++I) - VTs.push_back(N->getValueType(I)); - - if (AddGlue) - VTs.push_back(MVT::Glue); - +// Helper for AddGlue to clone node operands. +static void CloneNodeWithValues(SDNode *N, SelectionDAG *DAG, + SmallVectorImpl &VTs, + SDValue ExtraOper = SDValue()) { SmallVector Ops; for (unsigned I = 0, E = N->getNumOperands(); I != E; ++I) Ops.push_back(N->getOperand(I)); - if (GlueDestNode) - Ops.push_back(Glue); + if (ExtraOper.getNode()) + Ops.push_back(ExtraOper); SDVTList VTList = DAG->getVTList(&VTs[0], VTs.size()); MachineSDNode::mmo_iterator Begin = 0, End = 0; @@ -173,6 +159,46 @@ static void AddGlue(SDNode *N, SDValue G MN->setMemRefs(Begin, End); } +static bool AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG) { + SmallVector VTs; + SDNode *GlueDestNode = Glue.getNode(); + + // Don't add glue from a node to itself. + if (GlueDestNode == N) return false; + + // Don't add a glue operand to something that already uses glue. + if (GlueDestNode && + N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Glue) { + return false; + } + // Don't add glue to something that already has a glue value. + if (N->getValueType(N->getNumValues() - 1) == MVT::Glue) return false; + + for (unsigned I = 0, E = N->getNumValues(); I != E; ++I) + VTs.push_back(N->getValueType(I)); + + if (AddGlue) + VTs.push_back(MVT::Glue); + + CloneNodeWithValues(N, DAG, VTs, Glue); + + return true; +} + +// Cleanup after unsuccessful AddGlue. Use the standard method of morphing the +// node even though simply shrinking the value list is sufficient. +static void RemoveUnusedGlue(SDNode *N, SelectionDAG *DAG) { + assert((N->getValueType(N->getNumValues() - 1) == MVT::Glue && + !N->hasAnyUseOfValue(N->getNumValues() - 1)) && + "expected an unused glue value"); + + SmallVector VTs; + for (unsigned I = 0, E = N->getNumValues()-1; I != E; ++I) + VTs.push_back(N->getValueType(I)); + + CloneNodeWithValues(N, DAG, VTs); +} + /// ClusterNeighboringLoads - Force nearby loads together by "gluing" them. /// This function finds loads of the same base and different offsets. If the /// offsets are not far apart (target specific), it add MVT::Glue inputs and @@ -240,19 +266,23 @@ void ScheduleDAGSDNodes::ClusterNeighbor // Cluster loads by adding MVT::Glue outputs and inputs. This also // ensure they are scheduled in order of increasing addresses. SDNode *Lead = Loads[0]; - AddGlue(Lead, SDValue(0, 0), true, DAG); - - SDValue InGlue = SDValue(Lead, Lead->getNumValues() - 1); + SDValue InGlue = SDValue(0, 0); + if (AddGlue(Lead, InGlue, true, DAG)) + InGlue = SDValue(Lead, Lead->getNumValues() - 1); for (unsigned I = 1, E = Loads.size(); I != E; ++I) { bool OutGlue = I < E - 1; SDNode *Load = Loads[I]; - AddGlue(Load, InGlue, OutGlue, DAG); + // If AddGlue fails, we could leave an unsused glue value. This should not + // cause any + if (AddGlue(Load, InGlue, OutGlue, DAG)) { + if (OutGlue) + InGlue = SDValue(Load, Load->getNumValues() - 1); - if (OutGlue) - InGlue = SDValue(Load, Load->getNumValues() - 1); - - ++LoadsClustered; + ++LoadsClustered; + } + else if (!OutGlue && InGlue.getNode()) + RemoveUnusedGlue(InGlue.getNode(), DAG); } } Modified: head/contrib/llvm/tools/clang/include/clang/AST/Decl.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/AST/Decl.h Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/AST/Decl.h Wed May 23 21:48:49 2012 (r235864) @@ -64,9 +64,6 @@ public: /// \brief Return the TypeLoc wrapper for the type source info. TypeLoc getTypeLoc() const; // implemented in TypeLoc.h - - /// \brief Override the type stored in this TypeSourceInfo. Use with caution! - void overrideType(QualType T) { Ty = T; } }; /// TranslationUnitDecl - The top declaration context. Modified: head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td Wed May 23 21:48:49 2012 (r235864) @@ -410,8 +410,6 @@ def ext_ellipsis_exception_spec : Extens "exception specification of '...' is a Microsoft extension">; def err_dynamic_and_noexcept_specification : Error< "cannot have both throw() and noexcept() clause on the same function">; -def err_except_spec_unparsed : Error< - "unexpected end of exception specification">; def warn_cxx98_compat_noexcept_decl : Warning< "noexcept specifications are incompatible with C++98">, InGroup, DefaultIgnore; Modified: head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def Wed May 23 21:48:49 2012 (r235864) @@ -105,7 +105,6 @@ TOK(eod) // End of prepr // directive). TOK(code_completion) // Code completion marker TOK(cxx_defaultarg_end) // C++ default argument end marker -TOK(cxx_exceptspec_end) // C++ exception-specification end marker // C99 6.4.9: Comments. TOK(comment) // Comment (only in -E -C[C] mode) Modified: head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h Wed May 23 21:48:49 2012 (r235864) @@ -584,11 +584,15 @@ private: class TentativeParsingAction { Parser &P; Token PrevTok; + unsigned short PrevParenCount, PrevBracketCount, PrevBraceCount; bool isActive; public: explicit TentativeParsingAction(Parser& p) : P(p) { PrevTok = P.Tok; + PrevParenCount = P.ParenCount; + PrevBracketCount = P.BracketCount; + PrevBraceCount = P.BraceCount; P.PP.EnableBacktrackAtThisPos(); isActive = true; } @@ -601,6 +605,9 @@ private: assert(isActive && "Parsing action was finished!"); P.PP.Backtrack(); P.Tok = PrevTok; + P.ParenCount = PrevParenCount; + P.BracketCount = PrevBracketCount; + P.BraceCount = PrevBraceCount; isActive = false; } ~TentativeParsingAction() { @@ -1422,12 +1429,10 @@ private: ExprResult ParseThrowExpression(); ExceptionSpecificationType tryParseExceptionSpecification( - bool Delayed, SourceRange &SpecificationRange, SmallVectorImpl &DynamicExceptions, SmallVectorImpl &DynamicExceptionRanges, - ExprResult &NoexceptExpr, - CachedTokens *&ExceptionSpecTokens); + ExprResult &NoexceptExpr); // EndLoc is filled with the location of the last token of the specification. ExceptionSpecificationType ParseDynamicExceptionSpecification( Modified: head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h Wed May 23 21:48:49 2012 (r235864) @@ -1150,10 +1150,6 @@ struct DeclaratorChunk { /// \brief Pointer to the expression in the noexcept-specifier of this /// function, if it has one. Expr *NoexceptExpr; - - /// \brief Pointer to the cached tokens for an exception-specification - /// that has not yet been parsed. - CachedTokens *ExceptionSpecTokens; }; /// TrailingReturnType - If this isn't null, it's the trailing return type @@ -1176,8 +1172,6 @@ struct DeclaratorChunk { delete[] ArgInfo; if (getExceptionSpecType() == EST_Dynamic) delete[] Exceptions; - else if (getExceptionSpecType() == EST_Delayed) - delete ExceptionSpecTokens; } /// isKNRPrototype - Return true if this is a K&R style identifier list, @@ -1353,7 +1347,6 @@ struct DeclaratorChunk { SourceRange *ExceptionRanges, unsigned NumExceptions, Expr *NoexceptExpr, - CachedTokens *ExceptionSpecTokens, SourceLocation LocalRangeBegin, SourceLocation LocalRangeEnd, Declarator &TheDeclarator, Modified: head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h Wed May 23 21:48:49 2012 (r235864) @@ -225,7 +225,9 @@ public: /// \brief Create the initialization entity for a temporary. static InitializedEntity InitializeTemporary(QualType Type) { - return InitializedEntity(EK_Temporary, SourceLocation(), Type); + InitializedEntity Result(EK_Temporary, SourceLocation(), Type); + Result.TypeInfo = 0; + return Result; } /// \brief Create the initialization entity for a temporary. Modified: head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h Wed May 23 21:48:49 2012 (r235864) @@ -331,6 +331,11 @@ public: /// cycle detection at the end of the TU. DelegatingCtorDeclsType DelegatingCtorDecls; + /// \brief All the destructors seen during a class definition that had their + /// exception spec computation delayed because it depended on an unparsed + /// exception spec. + SmallVector DelayedDestructorExceptionSpecs; + /// \brief All the overriding destructors seen during a class definition /// (there could be multiple due to nested classes) that had their exception /// spec checks delayed, plus the overridden destructor. @@ -653,23 +658,19 @@ public: /// SpecialMemberOverloadResult - The overloading result for a special member /// function. /// - /// This is basically a wrapper around PointerIntPair. The lowest bit of the - /// integer is used to determine whether we have a parameter qualification - /// match, the second-lowest is whether we had success in resolving the - /// overload to a unique non-deleted function. - /// - /// The ConstParamMatch bit represents whether, when looking up a copy - /// constructor or assignment operator, we found a potential copy - /// constructor/assignment operator whose first parameter is const-qualified. - /// This is used for determining parameter types of other objects and is - /// utterly meaningless on other types of special members. + /// This is basically a wrapper around PointerIntPair. The lowest bits of the + /// integer are used to determine whether overload resolution succeeded, and + /// whether, when looking up a copy constructor or assignment operator, we + /// found a potential copy constructor/assignment operator whose first + /// parameter is const-qualified. This is used for determining parameter types + /// of other objects and is utterly meaningless on other types of special + /// members. class SpecialMemberOverloadResult : public llvm::FastFoldingSetNode { public: enum Kind { NoMemberOrDeleted, Ambiguous, - SuccessNonConst, - SuccessConst + Success }; private: @@ -685,9 +686,6 @@ public: Kind getKind() const { return static_cast(Pair.getInt()); } void setKind(Kind K) { Pair.setInt(K); } - - bool hasSuccess() const { return getKind() >= SuccessNonConst; } - bool hasConstParamMatch() const { return getKind() == SuccessConst; } }; /// \brief A cache of special member function overload resolution results @@ -1909,11 +1907,9 @@ public: DeclContextLookupResult LookupConstructors(CXXRecordDecl *Class); CXXConstructorDecl *LookupDefaultConstructor(CXXRecordDecl *Class); CXXConstructorDecl *LookupCopyingConstructor(CXXRecordDecl *Class, - unsigned Quals, - bool *ConstParam = 0); + unsigned Quals); CXXMethodDecl *LookupCopyingAssignment(CXXRecordDecl *Class, unsigned Quals, - bool RValueThis, unsigned ThisQuals, - bool *ConstParam = 0); + bool RValueThis, unsigned ThisQuals); CXXConstructorDecl *LookupMovingConstructor(CXXRecordDecl *Class); CXXMethodDecl *LookupMovingAssignment(CXXRecordDecl *Class, bool RValueThis, unsigned ThisQuals); @@ -3158,16 +3154,6 @@ public: llvm::SmallVectorImpl &Exceptions, FunctionProtoType::ExtProtoInfo &EPI); - /// \brief Add an exception-specification to the given member function - /// (or member function template). The exception-specification was parsed - /// after the method itself was declared. - void actOnDelayedExceptionSpecification(Decl *Method, - ExceptionSpecificationType EST, - SourceRange SpecificationRange, - ArrayRef DynamicExceptions, - ArrayRef DynamicExceptionRanges, - Expr *NoexceptExpr); - /// \brief Determine if a special member function should have a deleted /// definition when it is defaulted. bool ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM, @@ -3205,7 +3191,8 @@ public: /// C++11 says that user-defined destructors with no exception spec get one /// that looks as if the destructor was implicitly declared. void AdjustDestructorExceptionSpec(CXXRecordDecl *ClassDecl, - CXXDestructorDecl *Destructor); + CXXDestructorDecl *Destructor, + bool WasDelayed = false); /// \brief Declare all inherited constructors for the given class. /// @@ -4043,6 +4030,7 @@ public: SourceLocation LBrac, SourceLocation RBrac, AttributeList *AttrList); + void ActOnFinishCXXMemberDecls(); void ActOnReenterTemplateScope(Scope *S, Decl *Template); void ActOnReenterDeclaratorTemplateScope(Scope *S, DeclaratorDecl *D); Modified: head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp Wed May 23 21:48:49 2012 (r235864) @@ -168,7 +168,8 @@ static const BinaryOperator *getLogicalO if (block->empty()) return 0; - const CFGStmt *cstmt = block->front().getAs(); + CFGElement front = block->front(); + const CFGStmt *cstmt = front.getAs(); if (!cstmt) return 0; Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Wed May 23 21:48:49 2012 (r235864) @@ -1830,6 +1830,7 @@ enum LinuxDistro { OpenSuse11_3, OpenSuse11_4, OpenSuse12_1, + OpenSuse12_2, UbuntuHardy, UbuntuIntrepid, UbuntuJaunty, @@ -1848,7 +1849,7 @@ static bool IsRedhat(enum LinuxDistro Di } static bool IsOpenSuse(enum LinuxDistro Distro) { - return Distro >= OpenSuse11_3 && Distro <= OpenSuse12_1; + return Distro >= OpenSuse11_3 && Distro <= OpenSuse12_2; } static bool IsDebian(enum LinuxDistro Distro) { @@ -1925,6 +1926,7 @@ static LinuxDistro DetectLinuxDistro(llv .StartsWith("openSUSE 11.3", OpenSuse11_3) .StartsWith("openSUSE 11.4", OpenSuse11_4) .StartsWith("openSUSE 12.1", OpenSuse12_1) + .StartsWith("openSUSE 12.2", OpenSuse12_2) .Default(UnknownDistro); bool Exists; Modified: head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp Wed May 23 21:48:49 2012 (r235864) @@ -348,77 +348,7 @@ void Parser::ParseLexedMethodDeclaration LM.DefaultArgs[I].Toks = 0; } } - - // Parse a delayed exception-specification, if there is one. - if (CachedTokens *Toks = LM.ExceptionSpecTokens) { - // Save the current token position. - SourceLocation origLoc = Tok.getLocation(); - - // Parse the default argument from its saved token stream. - Toks->push_back(Tok); // So that the current token doesn't get lost - PP.EnterTokenStream(&Toks->front(), Toks->size(), true, false); - - // Consume the previously-pushed token. - ConsumeAnyToken(); - - // C++11 [expr.prim.general]p3: - // If a declaration declares a member function or member function - // template of a class X, the expression this is a prvalue of type - // "pointer to cv-qualifier-seq X" between the optional cv-qualifer-seq - // and the end of the function-definition, member-declarator, or - // declarator. - CXXMethodDecl *Method; - if (FunctionTemplateDecl *FunTmpl - = dyn_cast(LM.Method)) - Method = cast(FunTmpl->getTemplatedDecl()); - else - Method = cast(LM.Method); - - Sema::CXXThisScopeRAII ThisScope(Actions, Method->getParent(), - Method->getTypeQualifiers(), - getLangOpts().CPlusPlus0x); - - // Parse the exception-specification. - SourceRange SpecificationRange; - SmallVector DynamicExceptions; - SmallVector DynamicExceptionRanges; - ExprResult NoexceptExpr; - CachedTokens *ExceptionSpecTokens; - - ExceptionSpecificationType EST - = tryParseExceptionSpecification(/*Delayed=*/false, SpecificationRange, - DynamicExceptions, - DynamicExceptionRanges, NoexceptExpr, - ExceptionSpecTokens); - - // Clean up the remaining tokens. - if (Tok.is(tok::cxx_exceptspec_end)) - ConsumeToken(); - else if (EST != EST_None) - Diag(Tok.getLocation(), diag::err_except_spec_unparsed); - // Attach the exception-specification to the method. - if (EST != EST_None) - Actions.actOnDelayedExceptionSpecification(LM.Method, EST, - SpecificationRange, - DynamicExceptions, - DynamicExceptionRanges, - NoexceptExpr.isUsable()? - NoexceptExpr.get() : 0); - - assert(!PP.getSourceManager().isBeforeInTranslationUnit(origLoc, - Tok.getLocation()) && - "tryParseExceptionSpecification went over the exception tokens!"); - - // There could be leftover tokens (e.g. because of an error). - // Skip through until we reach the original token position. - while (Tok.getLocation() != origLoc && Tok.isNot(tok::eof)) - ConsumeAnyToken(); - - delete LM.ExceptionSpecTokens; - LM.ExceptionSpecTokens = 0; - } - PrototypeScope.Exit(); // Finish the delayed C++ method declaration. Modified: head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp Wed May 23 21:48:49 2012 (r235864) @@ -4197,7 +4197,6 @@ void Parser::ParseFunctionDeclarator(Dec SmallVector DynamicExceptions; SmallVector DynamicExceptionRanges; ExprResult NoexceptExpr; - CachedTokens *ExceptionSpecTokens = 0; ParsedAttributes FnAttrs(AttrFactory); ParsedType TrailingReturnType; @@ -4264,18 +4263,12 @@ void Parser::ParseFunctionDeclarator(Dec dyn_cast(Actions.CurContext), DS.getTypeQualifiers(), IsCXX11MemberFunction); - + // Parse exception-specification[opt]. - bool Delayed = (D.getContext() == Declarator::MemberContext && - D.getDeclSpec().getStorageClassSpec() - != DeclSpec::SCS_typedef && - !D.getDeclSpec().isFriendSpecified()); - ESpecType = tryParseExceptionSpecification(Delayed, - ESpecRange, + ESpecType = tryParseExceptionSpecification(ESpecRange, DynamicExceptions, DynamicExceptionRanges, - NoexceptExpr, - ExceptionSpecTokens); + NoexceptExpr); if (ESpecType != EST_None) EndLoc = ESpecRange.getEnd(); @@ -4310,7 +4303,6 @@ void Parser::ParseFunctionDeclarator(Dec DynamicExceptions.size(), NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, - ExceptionSpecTokens, Tracker.getOpenLocation(), EndLoc, D, TrailingReturnType), Modified: head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp Wed May 23 21:48:49 2012 (r235864) @@ -1535,34 +1535,16 @@ AccessSpecifier Parser::getAccessSpecifi } /// \brief If the given declarator has any parts for which parsing has to be -/// delayed, e.g., default arguments or an exception-specification, create a -/// late-parsed method declaration record to handle the parsing at the end of -/// the class definition. +/// delayed, e.g., default arguments, create a late-parsed method declaration +/// record to handle the parsing at the end of the class definition. void Parser::HandleMemberFunctionDeclDelays(Declarator& DeclaratorInfo, Decl *ThisDecl) { // We just declared a member function. If this member function - // has any default arguments or an exception-specification, we'll need to - // parse them later. + // has any default arguments, we'll need to parse them later. LateParsedMethodDeclaration *LateMethod = 0; DeclaratorChunk::FunctionTypeInfo &FTI = DeclaratorInfo.getFunctionTypeInfo(); - - // If there was a delayed exception-specification, hold onto its tokens. - if (FTI.getExceptionSpecType() == EST_Delayed) { - // Push this method onto the stack of late-parsed method - // declarations. - LateMethod = new LateParsedMethodDeclaration(this, ThisDecl); - getCurrentClass().LateParsedDeclarations.push_back(LateMethod); - LateMethod->TemplateScope = getCurScope()->isTemplateParamScope(); - - // Stash the exception-specification tokens in the late-pased mthod. - LateMethod->ExceptionSpecTokens = FTI.ExceptionSpecTokens; - FTI.ExceptionSpecTokens = 0; - // Reserve space for the parameters. - LateMethod->DefaultArgs.reserve(FTI.NumArgs); - } - for (unsigned ParamIdx = 0; ParamIdx < FTI.NumArgs; ++ParamIdx) { if (LateMethod || FTI.ArgInfo[ParamIdx].DefaultArgTokens) { if (!LateMethod) { @@ -1846,7 +1828,7 @@ void Parser::ParseCXXClassMemberDeclarat // Parse the first declarator. ParseDeclarator(DeclaratorInfo); - // Error parsin g the declarator? + // Error parsing the declarator? if (!DeclaratorInfo.hasName()) { // If so, skip until the semi-colon or a }. SkipUntil(tok::r_brace, true, true); @@ -2065,7 +2047,7 @@ void Parser::ParseCXXClassMemberDeclarat DeclsInGroup.push_back(ThisDecl); } - if (DeclaratorInfo.isFunctionDeclarator() && + if (ThisDecl && DeclaratorInfo.isFunctionDeclarator() && DeclaratorInfo.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_typedef) { HandleMemberFunctionDeclDelays(DeclaratorInfo, ThisDecl); @@ -2358,7 +2340,7 @@ void Parser::ParseCXXMemberSpecification // C++11 [class.mem]p2: // Within the class member-specification, the class is regarded as complete - // within function bodies, default arguments, exception-specifications, and + // within function bodies, default arguments, and // brace-or-equal-initializers for non-static data members (including such // things in nested classes). if (TagDecl && NonNestedClass) { @@ -2369,6 +2351,10 @@ void Parser::ParseCXXMemberSpecification SourceLocation SavedPrevTokLocation = PrevTokLocation; ParseLexedAttributes(getCurrentClass()); ParseLexedMethodDeclarations(getCurrentClass()); + + // We've finished with all pending member declarations. + Actions.ActOnFinishCXXMemberDecls(); + ParseLexedMemberInitializers(getCurrentClass()); ParseLexedMethodDefs(getCurrentClass()); PrevTokLocation = SavedPrevTokLocation; @@ -2555,63 +2541,13 @@ Parser::MemInitResult Parser::ParseMemIn /// 'noexcept' /// 'noexcept' '(' constant-expression ')' ExceptionSpecificationType -Parser::tryParseExceptionSpecification(bool Delayed, +Parser::tryParseExceptionSpecification( SourceRange &SpecificationRange, SmallVectorImpl &DynamicExceptions, SmallVectorImpl &DynamicExceptionRanges, - ExprResult &NoexceptExpr, - CachedTokens *&ExceptionSpecTokens) { + ExprResult &NoexceptExpr) { ExceptionSpecificationType Result = EST_None; - ExceptionSpecTokens = 0; - - // Handle delayed parsing of exception-specifications. - if (Delayed) { - if (Tok.isNot(tok::kw_throw) && Tok.isNot(tok::kw_noexcept)) - return EST_None; - - // Consume and cache the starting token. - bool IsNoexcept = Tok.is(tok::kw_noexcept); - Token StartTok = Tok; - SpecificationRange = SourceRange(ConsumeToken()); - - // Check for a '('. - if (!Tok.is(tok::l_paren)) { - // If this is a bare 'noexcept', we're done. - if (IsNoexcept) { - Diag(Tok, diag::warn_cxx98_compat_noexcept_decl); - NoexceptExpr = 0; - return EST_BasicNoexcept; - } - - Diag(Tok, diag::err_expected_lparen_after) << "throw"; - return EST_DynamicNone; - } - - // Cache the tokens for the exception-specification. - ExceptionSpecTokens = new CachedTokens; - ExceptionSpecTokens->push_back(StartTok); // 'throw' or 'noexcept' - ExceptionSpecTokens->push_back(Tok); // '(' - SpecificationRange.setEnd(ConsumeParen()); // '(' - - if (!ConsumeAndStoreUntil(tok::r_paren, *ExceptionSpecTokens, - /*StopAtSemi=*/true, - /*ConsumeFinalToken=*/true)) { - NoexceptExpr = 0; - delete ExceptionSpecTokens; - ExceptionSpecTokens = 0; - return IsNoexcept? EST_BasicNoexcept : EST_DynamicNone; - } - SpecificationRange.setEnd(Tok.getLocation()); - - // Add the 'stop' token. - Token End; - End.startToken(); - End.setKind(tok::cxx_exceptspec_end); - End.setLocation(Tok.getLocation()); - ExceptionSpecTokens->push_back(End); - return EST_Delayed; - } - + // See if there's a dynamic specification. if (Tok.is(tok::kw_throw)) { Result = ParseDynamicExceptionSpecification(SpecificationRange, Modified: head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp Wed May 23 21:48:49 2012 (r235864) @@ -2392,7 +2392,7 @@ ExprResult Parser::ParseBlockLiteralExpr SourceLocation(), EST_None, SourceLocation(), - 0, 0, 0, 0, 0, + 0, 0, 0, 0, CaretLoc, CaretLoc, ParamInfo), attrs, CaretLoc); Modified: head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp Wed May 23 21:48:49 2012 (r235864) @@ -780,13 +780,10 @@ ExprResult Parser::ParseLambdaExpression llvm::SmallVector DynamicExceptions; llvm::SmallVector DynamicExceptionRanges; ExprResult NoexceptExpr; - CachedTokens *ExceptionSpecTokens; - ESpecType = tryParseExceptionSpecification(/*Delayed=*/false, - ESpecRange, + ESpecType = tryParseExceptionSpecification(ESpecRange, DynamicExceptions, DynamicExceptionRanges, - NoexceptExpr, - ExceptionSpecTokens); + NoexceptExpr); if (ESpecType != EST_None) DeclEndLoc = ESpecRange.getEnd(); @@ -821,7 +818,6 @@ ExprResult Parser::ParseLambdaExpression DynamicExceptions.size(), NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, - 0, DeclLoc, DeclEndLoc, D, TrailingReturnType), Attr, DeclEndLoc); @@ -867,7 +863,6 @@ ExprResult Parser::ParseLambdaExpression /*ExceptionRanges=*/0, /*NumExceptions=*/0, /*NoexceptExpr=*/0, - /*ExceptionSpecTokens=*/0, DeclLoc, DeclEndLoc, D, TrailingReturnType), Attr, DeclEndLoc); Modified: head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp Wed May 23 21:48:49 2012 (r235864) @@ -162,7 +162,6 @@ DeclaratorChunk DeclaratorChunk::getFunc SourceRange *ExceptionRanges, unsigned NumExceptions, Expr *NoexceptExpr, - CachedTokens *ExceptionSpecTokens, SourceLocation LocalRangeBegin, SourceLocation LocalRangeEnd, Declarator &TheDeclarator, @@ -227,10 +226,6 @@ DeclaratorChunk DeclaratorChunk::getFunc case EST_ComputedNoexcept: I.Fun.NoexceptExpr = NoexceptExpr; break; - - case EST_Delayed: - I.Fun.ExceptionSpecTokens = ExceptionSpecTokens; - break; } return I; } Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Wed May 23 21:48:49 2012 (r235864) @@ -7635,7 +7635,7 @@ NamedDecl *Sema::ImplicitlyDefineFunctio SourceLocation(), SourceLocation(), SourceLocation(), EST_None, SourceLocation(), - 0, 0, 0, 0, 0, Loc, Loc, D), + 0, 0, 0, 0, Loc, Loc, D), DS.getAttributes(), SourceLocation()); D.SetIdentifier(&II, Loc); @@ -9784,21 +9784,6 @@ void Sema::ActOnFields(Scope* S, if (!Completed) Record->completeDefinition(); - // Now that the record is complete, do any delayed exception spec checks - // we were missing. - while (!DelayedDestructorExceptionSpecChecks.empty()) { - const CXXDestructorDecl *Dtor = - DelayedDestructorExceptionSpecChecks.back().first; - if (Dtor->getParent() != Record) - break; - - assert(!Dtor->getParent()->isDependentType() && - "Should not ever add destructors of templates into the list."); - CheckOverridingFunctionExceptionSpec(Dtor, - DelayedDestructorExceptionSpecChecks.back().second); - DelayedDestructorExceptionSpecChecks.pop_back(); - } - } else { ObjCIvarDecl **ClsFields = reinterpret_cast(RecFields.data()); Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp Wed May 23 21:48:49 2012 (r235864) @@ -7319,15 +7319,42 @@ void Sema::DefineImplicitDestructor(Sour } } +/// \brief Perform any semantic analysis which needs to be delayed until all +/// pending class member declarations have been parsed. +void Sema::ActOnFinishCXXMemberDecls() { + // Now we have parsed all exception specifications, determine the implicit + // exception specifications for destructors. + for (unsigned i = 0, e = DelayedDestructorExceptionSpecs.size(); + i != e; ++i) { + CXXDestructorDecl *Dtor = DelayedDestructorExceptionSpecs[i]; + AdjustDestructorExceptionSpec(Dtor->getParent(), Dtor, true); + } + DelayedDestructorExceptionSpecs.clear(); + + // Perform any deferred checking of exception specifications for virtual + // destructors. + for (unsigned i = 0, e = DelayedDestructorExceptionSpecChecks.size(); + i != e; ++i) { + const CXXDestructorDecl *Dtor = + DelayedDestructorExceptionSpecChecks[i].first; + assert(!Dtor->getParent()->isDependentType() && + "Should not ever add destructors of templates into the list."); + CheckOverridingFunctionExceptionSpec(Dtor, + DelayedDestructorExceptionSpecChecks[i].second); + } + DelayedDestructorExceptionSpecChecks.clear(); +} + void Sema::AdjustDestructorExceptionSpec(CXXRecordDecl *classDecl, - CXXDestructorDecl *destructor) { + CXXDestructorDecl *destructor, + bool WasDelayed) { // C++11 [class.dtor]p3: // A declaration of a destructor that does not have an exception- // specification is implicitly considered to have the same exception- // specification as an implicit declaration. const FunctionProtoType *dtorType = destructor->getType()-> getAs(); - if (dtorType->hasExceptionSpec()) + if (!WasDelayed && dtorType->hasExceptionSpec()) return; ImplicitExceptionSpecification exceptSpec = @@ -7344,6 +7371,14 @@ void Sema::AdjustDestructorExceptionSpec destructor->setType(ty); + // If we can't compute the exception specification for this destructor yet + // (because it depends on an exception specification which we have not parsed + // yet), make a note that we need to try again when the class is complete. + if (epi.ExceptionSpecType == EST_Delayed) { + assert(!WasDelayed && "couldn't compute destructor exception spec"); + DelayedDestructorExceptionSpecs.push_back(destructor); + } + // FIXME: If the destructor has a body that could throw, and the newly created // spec doesn't allow exceptions, we should emit a warning, because this // change in behavior can break conforming C++03 programs at runtime. @@ -7579,8 +7614,9 @@ Sema::ComputeDefaultedCopyAssignmentExce assert(!Base->getType()->isDependentType() && "Cannot generate implicit members for class with dependent bases."); CXXRecordDecl *BaseClassDecl = Base->getType()->getAsCXXRecordDecl(); - LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, false, 0, - &HasConstCopyAssignment); + HasConstCopyAssignment &= + (bool)LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, + false, 0); } // In C++11, the above citation has "or virtual" added @@ -7591,8 +7627,9 @@ Sema::ComputeDefaultedCopyAssignmentExce assert(!Base->getType()->isDependentType() && "Cannot generate implicit members for class with dependent bases."); CXXRecordDecl *BaseClassDecl = Base->getType()->getAsCXXRecordDecl(); - LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, false, 0, - &HasConstCopyAssignment); + HasConstCopyAssignment &= + (bool)LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, + false, 0); } } @@ -7606,8 +7643,9 @@ Sema::ComputeDefaultedCopyAssignmentExce ++Field) { QualType FieldType = Context.getBaseElementType((*Field)->getType()); if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) { - LookupCopyingAssignment(FieldClassDecl, Qualifiers::Const, false, 0, - &HasConstCopyAssignment); + HasConstCopyAssignment &= + (bool)LookupCopyingAssignment(FieldClassDecl, Qualifiers::Const, + false, 0); } } @@ -8610,8 +8648,8 @@ Sema::ComputeDefaultedCopyCtorExceptionS CXXRecordDecl *BaseClassDecl = cast(Base->getType()->getAs()->getDecl()); - LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const, - &HasConstCopyConstructor); + HasConstCopyConstructor &= + (bool)LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const); } for (CXXRecordDecl::base_class_iterator Base = ClassDecl->vbases_begin(), @@ -8620,8 +8658,8 @@ Sema::ComputeDefaultedCopyCtorExceptionS ++Base) { CXXRecordDecl *BaseClassDecl = cast(Base->getType()->getAs()->getDecl()); - LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const, - &HasConstCopyConstructor); + HasConstCopyConstructor &= + (bool)LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const); } // -- for all the nonstatic data members of X that are of a @@ -8634,8 +8672,8 @@ Sema::ComputeDefaultedCopyCtorExceptionS ++Field) { QualType FieldType = Context.getBaseElementType((*Field)->getType()); if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) { - LookupCopyingConstructor(FieldClassDecl, Qualifiers::Const, - &HasConstCopyConstructor); + HasConstCopyConstructor &= + (bool)LookupCopyingConstructor(FieldClassDecl, Qualifiers::Const); } } // Otherwise, the implicitly declared copy constructor will have @@ -11260,66 +11298,6 @@ Sema::checkExceptionSpecification(Except } } -void Sema::actOnDelayedExceptionSpecification(Decl *MethodD, - ExceptionSpecificationType EST, - SourceRange SpecificationRange, - ArrayRef DynamicExceptions, - ArrayRef DynamicExceptionRanges, - Expr *NoexceptExpr) { - if (!MethodD) - return; - - // Dig out the method we're referring to. - CXXMethodDecl *Method = 0; - if (FunctionTemplateDecl *FunTmpl = dyn_cast(MethodD)) - Method = dyn_cast(FunTmpl->getTemplatedDecl()); - else - Method = dyn_cast(MethodD); - - if (!Method) - return; - - // Dig out the prototype. This should never fail. - const FunctionProtoType *Proto - = dyn_cast(Method->getType()); - if (!Proto) - return; - - // Check the exception specification. - llvm::SmallVector Exceptions; - FunctionProtoType::ExtProtoInfo EPI = Proto->getExtProtoInfo(); - checkExceptionSpecification(EST, DynamicExceptions, DynamicExceptionRanges, - NoexceptExpr, Exceptions, EPI); - - // Rebuild the function type. - QualType T = Context.getFunctionType(Proto->getResultType(), - Proto->arg_type_begin(), - Proto->getNumArgs(), - EPI); - if (TypeSourceInfo *TSInfo = Method->getTypeSourceInfo()) { - // FIXME: When we get proper type location information for exceptions, - // we'll also have to rebuild the TypeSourceInfo. For now, we just patch - // up the TypeSourceInfo; - assert(TypeLoc::getFullDataSizeForType(T) - == TypeLoc::getFullDataSizeForType(Method->getType()) && - "TypeLoc size mismatch with delayed exception specification"); - TSInfo->overrideType(T); - } - - Method->setType(T); - - if (Method->isStatic()) - checkThisInStaticMemberFunctionExceptionSpec(Method); - - if (Method->isVirtual()) { - // Check overrides, which we previously had to delay. - for (CXXMethodDecl::method_iterator O = Method->begin_overridden_methods(), - OEnd = Method->end_overridden_methods(); - O != OEnd; ++O) - CheckOverridingFunctionExceptionSpec(Method, *O); - } -} - /// IdentifyCUDATarget - Determine the CUDA compilation target for this function Sema::CUDAFunctionTarget Sema::IdentifyCUDATarget(const FunctionDecl *D) { // Implicitly declared functions (e.g. copy constructors) are Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp Wed May 23 21:48:49 2012 (r235864) @@ -2277,7 +2277,7 @@ Sema::SpecialMemberOverloadResult *Sema: Result->setMethod(DD); Result->setKind(DD->isDeleted() ? SpecialMemberOverloadResult::NoMemberOrDeleted : - SpecialMemberOverloadResult::SuccessNonConst); + SpecialMemberOverloadResult::Success); return Result; } @@ -2288,6 +2288,9 @@ Sema::SpecialMemberOverloadResult *Sema: Expr *Arg = 0; unsigned NumArgs; + QualType ArgType = CanTy; + ExprValueKind VK = VK_LValue; + if (SM == CXXDefaultConstructor) { Name = Context.DeclarationNames.getCXXConstructorName(CanTy); NumArgs = 0; @@ -2308,7 +2311,6 @@ Sema::SpecialMemberOverloadResult *Sema: DeclareImplicitMoveAssignment(RD); } - QualType ArgType = CanTy; if (ConstArg) ArgType.addConst(); if (VolatileArg) @@ -2321,14 +2323,17 @@ Sema::SpecialMemberOverloadResult *Sema: // Possibly an XValue is actually correct in the case of move, but // there is no semantic difference for class types in this restricted // case. - ExprValueKind VK; if (SM == CXXCopyConstructor || SM == CXXCopyAssignment) VK = VK_LValue; else VK = VK_RValue; + } + OpaqueValueExpr FakeArg(SourceLocation(), ArgType, VK); + + if (SM != CXXDefaultConstructor) { NumArgs = 1; - Arg = new (Context) OpaqueValueExpr(SourceLocation(), ArgType, VK); + Arg = &FakeArg; } // Create the object argument @@ -2338,17 +2343,14 @@ Sema::SpecialMemberOverloadResult *Sema: if (VolatileThis) ThisTy.addVolatile(); Expr::Classification Classification = - (new (Context) OpaqueValueExpr(SourceLocation(), ThisTy, - RValueThis ? VK_RValue : VK_LValue))-> - Classify(Context); + OpaqueValueExpr(SourceLocation(), ThisTy, + RValueThis ? VK_RValue : VK_LValue).Classify(Context); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed May 23 23:42:00 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54501106564A; Wed, 23 May 2012 23:42:00 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 318988FC08; Wed, 23 May 2012 23:42:00 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q4NNfsh1022421; Wed, 23 May 2012 16:41:54 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q4NNfsQI022420; Wed, 23 May 2012 16:41:54 -0700 (PDT) (envelope-from obrien) Date: Wed, 23 May 2012 16:41:54 -0700 From: "David O'Brien" To: Dimitry Andric Message-ID: <20120523234154.GA22380@dragon.NUXI.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <4FBCCED9.9050308@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FBCCED9.9050308@FreeBSD.org> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 23:42:00 -0000 On Wed, May 23, 2012 at 01:49:45PM +0200, Dimitry Andric wrote: > On 2012-05-22 20:18, David E. O'Brien wrote: > > Log: > > Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. ... > Until all the additional warnings this causes have been fixed, can this > commit please be reverted for now? Yes. I cannot believe we've been abusing "%q" this badly. -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Wed May 23 23:43:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DA381065670; Wed, 23 May 2012 23:43:56 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68DAE8FC0A; Wed, 23 May 2012 23:43:56 +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 q4NNhuVB002237; Wed, 23 May 2012 23:43:56 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NNhuKp002235; Wed, 23 May 2012 23:43:56 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201205232343.q4NNhuKp002235@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 23 May 2012 23:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235865 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 23:43:56 -0000 Author: obrien Date: Wed May 23 23:43:55 2012 New Revision: 235865 URL: http://svn.freebsd.org/changeset/base/235865 Log: Revert r235797. GCC's mis-assumptions has led to incorrect usage of "%q[diouxX]" within FreeBSD sources. Modified: head/contrib/gcc/c-format.c Modified: head/contrib/gcc/c-format.c ============================================================================== --- head/contrib/gcc/c-format.c Wed May 23 21:48:49 2012 (r235864) +++ head/contrib/gcc/c-format.c Wed May 23 23:43:55 2012 (r235865) @@ -287,11 +287,7 @@ static const format_length_info printf_l { { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, -#ifdef __LP64__ - { "q", FMT_LEN_l, STD_EXT, NULL, 0, 0 }, -#else { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, -#endif { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, From owner-svn-src-all@FreeBSD.ORG Wed May 23 23:47:53 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B12E61065673; Wed, 23 May 2012 23:47:53 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8B14D8FC16; Wed, 23 May 2012 23:47:53 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q4NNlraI022515; Wed, 23 May 2012 16:47:53 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q4NNlqtK022514; Wed, 23 May 2012 16:47:52 -0700 (PDT) (envelope-from obrien) Date: Wed, 23 May 2012 16:47:52 -0700 From: "David O'Brien" To: mdf@FreeBSD.org Message-ID: <20120523234752.GB22380@dragon.NUXI.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 23:47:53 -0000 On Tue, May 22, 2012 at 02:07:22PM -0700, mdf@FreeBSD.org wrote: > We run with the following at Isilon, which is somewhat bogus because > it allows a bit of sloppiness in types, but is also terribly > convenient since it means no casting on printf arguments is needed: ... > If there's no objections, I (or David or anyone else) can commit to > the FreeBSD repository. Unfortunately I don't like this change -- it promotes type sloppiness that flies in the face of ISO/IEC 9899:1999 (E). the mixed definition of [u]_?int64_t as it catches improper code -- such as assuming you can printf an int64_t with "%lld" when that is against the standard. -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Thu May 24 00:18:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC889106564A; Thu, 24 May 2012 00:18:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3BC128FC0A; Thu, 24 May 2012 00:18:46 +0000 (UTC) Message-ID: <4FBD7E65.1060205@FreeBSD.org> Date: Wed, 23 May 2012 20:18:45 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0.1 MIME-Version: 1.0 To: "Alexander V. Chernikov" References: <201205212219.q4LMJKR9076035@svn.freebsd.org> In-Reply-To: <201205212219.q4LMJKR9076035@svn.freebsd.org> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235746 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 00:18:46 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-05-21 18:19:20 -0400, Alexander V. Chernikov wrote: > Author: melifaro Date: Mon May 21 22:19:19 2012 New Revision: > 235746 URL: http://svn.freebsd.org/changeset/base/235746 > > Log: Call bpf_jitter() before acquiring BPF global lock due to > malloc() being used inside bpf_jitter. > > Eliminate bpf_buffer_alloc() and allocate BPF buffers on descriptor > creation and BIOCSBLEN ioctl. This permits us not to allocate > buffers inside bpf_attachd() which is protected by global lock. > > Approved by: kib(mentor) MFC in: 4 weeks > > Modified: head/sys/net/bpf.c head/sys/net/bpf_buffer.c > head/sys/net/bpf_buffer.h > > Modified: head/sys/net/bpf.c > ============================================================================== > > - --- head/sys/net/bpf.c Mon May 21 22:17:29 2012 (r235745) > +++ head/sys/net/bpf.c Mon May 21 22:19:19 2012 (r235746) ... > @@ -1664,7 +1668,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro > struct bpf_insn *fcode, *old; u_int wfilter, flen, size; #ifdef > BPF_JITTER - bpf_jit_filter *ofunc; + bpf_jit_filter *ofunc, > *jfunc; #endif int need_upgrade; #ifdef COMPAT_FREEBSD32 @@ -1695,6 > +1699,13 @@ bpf_setf(struct bpf_d *d, struct bpf_pro else fcode = > NULL; /* Make compiler happy */ > > +#ifdef BPF_JITTER + if (fp->bf_insns != NULL) + jfunc = > bpf_jitter(fcode, flen); + else + jfunc = NULL; /* Make compiler > happy */ +#endif + BPF_LOCK(); > > if (cmd == BIOCSETWF) { ... This is completely wrong. First, fcode has not been initialized with copyin(). Second, you must not compile random filter code without validation, i.e., bpf_validate(). Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+9fmUACgkQmlay1b9qnVOlBACgtljVNwOiFb7Ds7GgeoQMyRRr jU4An3b43yEND8yPs8GSn20ZeCRrI9pu =z4sw -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Thu May 24 01:23:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B121D1065672; Thu, 24 May 2012 01:23:30 +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 9C1CF8FC0A; Thu, 24 May 2012 01:23:30 +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 q4O1NU88006420; Thu, 24 May 2012 01:23:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O1NUsG006417; Thu, 24 May 2012 01:23:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240123.q4O1NUsG006417@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 01:23:30 +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: r235866 - in stable/9: lib/libusbhid sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 01:23:30 -0000 Author: mav Date: Thu May 24 01:23:30 2012 New Revision: 235866 URL: http://svn.freebsd.org/changeset/base/235866 Log: MFC r235510: HID Report ID is unsigned value, so clear the rest of bits from possible sign expansion. Modified: stable/9/lib/libusbhid/parse.c stable/9/sys/dev/usb/usb_hid.c Directory Properties: stable/9/lib/libusbhid/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/lib/libusbhid/parse.c ============================================================================== --- stable/9/lib/libusbhid/parse.c Wed May 23 23:43:55 2012 (r235865) +++ stable/9/lib/libusbhid/parse.c Thu May 24 01:23:30 2012 (r235866) @@ -392,7 +392,7 @@ hid_get_item(hid_data_t s, hid_item_t *h s->loc_size = dval & mask; break; case 8: - hid_switch_rid(s, c, dval); + hid_switch_rid(s, c, dval & mask); break; case 9: /* mask because value is unsigned */ Modified: stable/9/sys/dev/usb/usb_hid.c ============================================================================== --- stable/9/sys/dev/usb/usb_hid.c Wed May 23 23:43:55 2012 (r235865) +++ stable/9/sys/dev/usb/usb_hid.c Thu May 24 01:23:30 2012 (r235866) @@ -425,7 +425,7 @@ hid_get_item(struct hid_data *s, struct s->loc_size = dval & mask; break; case 8: - hid_switch_rid(s, c, dval); + hid_switch_rid(s, c, dval & mask); break; case 9: /* mask because value is unsigned */ From owner-svn-src-all@FreeBSD.ORG Thu May 24 01:24:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 668141065670; Thu, 24 May 2012 01:24:50 +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 515428FC15; Thu, 24 May 2012 01:24: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 q4O1Oo1i006533; Thu, 24 May 2012 01:24:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O1OoOS006530; Thu, 24 May 2012 01:24:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240124.q4O1OoOS006530@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 01:24:50 +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: r235867 - in stable/8: lib/libusbhid sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 01:24:50 -0000 Author: mav Date: Thu May 24 01:24:49 2012 New Revision: 235867 URL: http://svn.freebsd.org/changeset/base/235867 Log: MFC r235510: HID Report ID is unsigned value, so clear the rest of bits from possible sign expansion. Modified: stable/8/lib/libusbhid/parse.c stable/8/sys/dev/usb/usb_hid.c Directory Properties: stable/8/lib/libusbhid/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/lib/libusbhid/parse.c ============================================================================== --- stable/8/lib/libusbhid/parse.c Thu May 24 01:23:30 2012 (r235866) +++ stable/8/lib/libusbhid/parse.c Thu May 24 01:24:49 2012 (r235867) @@ -392,7 +392,7 @@ hid_get_item(hid_data_t s, hid_item_t *h s->loc_size = dval & mask; break; case 8: - hid_switch_rid(s, c, dval); + hid_switch_rid(s, c, dval & mask); break; case 9: /* mask because value is unsigned */ Modified: stable/8/sys/dev/usb/usb_hid.c ============================================================================== --- stable/8/sys/dev/usb/usb_hid.c Thu May 24 01:23:30 2012 (r235866) +++ stable/8/sys/dev/usb/usb_hid.c Thu May 24 01:24:49 2012 (r235867) @@ -425,7 +425,7 @@ hid_get_item(struct hid_data *s, struct s->loc_size = dval & mask; break; case 8: - hid_switch_rid(s, c, dval); + hid_switch_rid(s, c, dval & mask); break; case 9: /* mask because value is unsigned */ From owner-svn-src-all@FreeBSD.ORG Thu May 24 01:28:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9EE50106566B; Thu, 24 May 2012 01:28:59 +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 89FFA8FC0A; Thu, 24 May 2012 01:28:59 +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 q4O1Sx36006748; Thu, 24 May 2012 01:28:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O1Sxag006746; Thu, 24 May 2012 01:28:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240128.q4O1Sxag006746@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 01:28:59 +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: r235868 - stable/9/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 01:28:59 -0000 Author: mav Date: Thu May 24 01:28:58 2012 New Revision: 235868 URL: http://svn.freebsd.org/changeset/base/235868 Log: MFC r235558, r235569: Add support for writing to HID devices through the interrupt output pipe. Supermicro LCD screen modules seem to not support accessing reports through the control pipes, but working fine with the interrupt pipes. Modified: stable/9/sys/dev/usb/input/uhid.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/input/uhid.c ============================================================================== --- stable/9/sys/dev/usb/input/uhid.c Thu May 24 01:24:49 2012 (r235867) +++ stable/9/sys/dev/usb/input/uhid.c Thu May 24 01:28:58 2012 (r235868) @@ -87,6 +87,7 @@ SYSCTL_INT(_hw_usb_uhid, OID_AUTO, debug #define UHID_FRAME_NUM 50 /* bytes, frame number */ enum { + UHID_INTR_DT_WR, UHID_INTR_DT_RD, UHID_CTRL_DT_WR, UHID_CTRL_DT_RD, @@ -128,7 +129,8 @@ static device_probe_t uhid_probe; static device_attach_t uhid_attach; static device_detach_t uhid_detach; -static usb_callback_t uhid_intr_callback; +static usb_callback_t uhid_intr_write_callback; +static usb_callback_t uhid_intr_read_callback; static usb_callback_t uhid_write_callback; static usb_callback_t uhid_read_callback; @@ -152,7 +154,36 @@ static struct usb_fifo_methods uhid_fifo }; static void -uhid_intr_callback(struct usb_xfer *xfer, usb_error_t error) +uhid_intr_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uhid_softc *sc = usbd_xfer_softc(xfer); + struct usb_page_cache *pc; + int actlen; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + case USB_ST_SETUP: +tr_setup: + pc = usbd_xfer_get_frame(xfer, 0); + if (usb_fifo_get_data(sc->sc_fifo.fp[USB_FIFO_TX], pc, + 0, usbd_xfer_max_len(xfer), &actlen, 0)) { + usbd_xfer_set_frame_len(xfer, 0, actlen); + usbd_transfer_submit(xfer); + } + return; + + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + } +} + +static void +uhid_intr_read_callback(struct usb_xfer *xfer, usb_error_t error) { struct uhid_softc *sc = usbd_xfer_softc(xfer); struct usb_page_cache *pc; @@ -327,13 +358,22 @@ uhid_read_callback(struct usb_xfer *xfer static const struct usb_config uhid_config[UHID_N_TRANSFER] = { + [UHID_INTR_DT_WR] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .flags = {.pipe_bof = 1,.no_pipe_ok = 1, }, + .bufsize = UHID_BSIZE, + .callback = &uhid_intr_write_callback, + }, + [UHID_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .bufsize = UHID_BSIZE, - .callback = &uhid_intr_callback, + .callback = &uhid_intr_read_callback, }, [UHID_CTRL_DT_WR] = { @@ -381,7 +421,12 @@ uhid_start_write(struct usb_fifo *fifo) { struct uhid_softc *sc = usb_fifo_softc(fifo); - usbd_transfer_start(sc->sc_xfer[UHID_CTRL_DT_WR]); + if ((sc->sc_flags & UHID_FLAG_IMMED) || + sc->sc_xfer[UHID_INTR_DT_WR] == NULL) { + usbd_transfer_start(sc->sc_xfer[UHID_CTRL_DT_WR]); + } else { + usbd_transfer_start(sc->sc_xfer[UHID_INTR_DT_WR]); + } } static void @@ -390,6 +435,7 @@ uhid_stop_write(struct usb_fifo *fifo) struct uhid_softc *sc = usb_fifo_softc(fifo); usbd_transfer_stop(sc->sc_xfer[UHID_CTRL_DT_WR]); + usbd_transfer_stop(sc->sc_xfer[UHID_INTR_DT_WR]); } static int From owner-svn-src-all@FreeBSD.ORG Thu May 24 01:30:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E450E106564A; Thu, 24 May 2012 01:30: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 CE6C88FC19; Thu, 24 May 2012 01:30: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 q4O1UHva006858; Thu, 24 May 2012 01:30:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O1UHsm006855; Thu, 24 May 2012 01:30:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240130.q4O1UHsm006855@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 01:30:17 +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: r235869 - stable/8/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 01:30:18 -0000 Author: mav Date: Thu May 24 01:30:17 2012 New Revision: 235869 URL: http://svn.freebsd.org/changeset/base/235869 Log: MFC r235558, r235569: Add support for writing to HID devices through the interrupt output pipe. Supermicro LCD screen modules seem to not support accessing reports through the control pipes, but working fine with the interrupt pipes. Modified: stable/8/sys/dev/usb/input/uhid.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/usb/input/uhid.c ============================================================================== --- stable/8/sys/dev/usb/input/uhid.c Thu May 24 01:28:58 2012 (r235868) +++ stable/8/sys/dev/usb/input/uhid.c Thu May 24 01:30:17 2012 (r235869) @@ -87,6 +87,7 @@ SYSCTL_INT(_hw_usb_uhid, OID_AUTO, debug #define UHID_FRAME_NUM 50 /* bytes, frame number */ enum { + UHID_INTR_DT_WR, UHID_INTR_DT_RD, UHID_CTRL_DT_WR, UHID_CTRL_DT_RD, @@ -128,7 +129,8 @@ static device_probe_t uhid_probe; static device_attach_t uhid_attach; static device_detach_t uhid_detach; -static usb_callback_t uhid_intr_callback; +static usb_callback_t uhid_intr_write_callback; +static usb_callback_t uhid_intr_read_callback; static usb_callback_t uhid_write_callback; static usb_callback_t uhid_read_callback; @@ -152,7 +154,36 @@ static struct usb_fifo_methods uhid_fifo }; static void -uhid_intr_callback(struct usb_xfer *xfer, usb_error_t error) +uhid_intr_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uhid_softc *sc = usbd_xfer_softc(xfer); + struct usb_page_cache *pc; + int actlen; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + case USB_ST_SETUP: +tr_setup: + pc = usbd_xfer_get_frame(xfer, 0); + if (usb_fifo_get_data(sc->sc_fifo.fp[USB_FIFO_TX], pc, + 0, usbd_xfer_max_len(xfer), &actlen, 0)) { + usbd_xfer_set_frame_len(xfer, 0, actlen); + usbd_transfer_submit(xfer); + } + return; + + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + } +} + +static void +uhid_intr_read_callback(struct usb_xfer *xfer, usb_error_t error) { struct uhid_softc *sc = usbd_xfer_softc(xfer); struct usb_page_cache *pc; @@ -327,13 +358,22 @@ uhid_read_callback(struct usb_xfer *xfer static const struct usb_config uhid_config[UHID_N_TRANSFER] = { + [UHID_INTR_DT_WR] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .flags = {.pipe_bof = 1,.no_pipe_ok = 1, }, + .bufsize = UHID_BSIZE, + .callback = &uhid_intr_write_callback, + }, + [UHID_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .bufsize = UHID_BSIZE, - .callback = &uhid_intr_callback, + .callback = &uhid_intr_read_callback, }, [UHID_CTRL_DT_WR] = { @@ -381,7 +421,12 @@ uhid_start_write(struct usb_fifo *fifo) { struct uhid_softc *sc = usb_fifo_softc(fifo); - usbd_transfer_start(sc->sc_xfer[UHID_CTRL_DT_WR]); + if ((sc->sc_flags & UHID_FLAG_IMMED) || + sc->sc_xfer[UHID_INTR_DT_WR] == NULL) { + usbd_transfer_start(sc->sc_xfer[UHID_CTRL_DT_WR]); + } else { + usbd_transfer_start(sc->sc_xfer[UHID_INTR_DT_WR]); + } } static void @@ -390,6 +435,7 @@ uhid_stop_write(struct usb_fifo *fifo) struct uhid_softc *sc = usb_fifo_softc(fifo); usbd_transfer_stop(sc->sc_xfer[UHID_CTRL_DT_WR]); + usbd_transfer_stop(sc->sc_xfer[UHID_INTR_DT_WR]); } static int From owner-svn-src-all@FreeBSD.ORG Thu May 24 01:31:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96739106564A; Thu, 24 May 2012 01:31:11 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 780CA8FC15; Thu, 24 May 2012 01:31: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 q4O1VBtU006930; Thu, 24 May 2012 01:31:11 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O1VBiO006927; Thu, 24 May 2012 01:31:11 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205240131.q4O1VBiO006927@svn.freebsd.org> From: Andrew Thompson Date: Thu, 24 May 2012 01:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235870 - head/usr.bin/sockstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 01:31:11 -0000 Author: thompsa Date: Thu May 24 01:31:10 2012 New Revision: 235870 URL: http://svn.freebsd.org/changeset/base/235870 Log: Allow the socket list to be limited to a specific jail id. No objections: current@ Modified: head/usr.bin/sockstat/sockstat.1 head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.1 ============================================================================== --- head/usr.bin/sockstat/sockstat.1 Thu May 24 01:30:17 2012 (r235869) +++ head/usr.bin/sockstat/sockstat.1 Thu May 24 01:31:10 2012 (r235870) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2012 +.Dd May 16, 2012 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -36,6 +36,7 @@ .Sh SYNOPSIS .Nm .Op Fl 46cLlu +.Op Fl j Ar jid .Op Fl p Ar ports .Op Fl P Ar protocols .Sh DESCRIPTION @@ -57,6 +58,8 @@ Show (IPv6) sockets. .It Fl c Show connected sockets. +.It Fl j Ar jid +Show only sockets belonging to the specified jail ID. .It Fl L Only show Internet sockets if the local or foreign addresses are not in the loopback network prefix Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Thu May 24 01:30:17 2012 (r235869) +++ head/usr.bin/sockstat/sockstat.c Thu May 24 01:31:10 2012 (r235870) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); static int opt_4; /* Show IPv4 sockets */ static int opt_6; /* Show IPv6 sockets */ static int opt_c; /* Show connected sockets */ +static int opt_j; /* Show specified jail */ static int opt_L; /* Don't show IPv4 or IPv6 loopback sockets */ static int opt_l; /* Show listening sockets */ static int opt_u; /* Show Unix domain sockets */ @@ -549,6 +550,27 @@ getprocname(pid_t pid) } static int +getprocjid(pid_t pid) +{ + static struct kinfo_proc proc; + size_t len; + int mib[4]; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PID; + mib[3] = (int)pid; + len = sizeof proc; + if (sysctl(mib, 4, &proc, &len, NULL, 0) == -1) { + /* Do not warn if the process exits before we get its jid. */ + if (errno != ESRCH) + warn("sysctl()"); + return (-1); + } + return (proc.ki_jid); +} + +static int check_ports(struct sock *s) { int port; @@ -643,6 +665,8 @@ display(void) for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) { if (xf->xf_data == NULL) continue; + if (opt_j >= 0 && opt_j != getprocjid(xf->xf_pid)) + continue; hash = (int)((uintptr_t)xf->xf_data % HASHSIZE); for (s = sockhash[hash]; s != NULL; s = s->next) if ((void *)s->socket == xf->xf_data) @@ -668,6 +692,8 @@ display(void) pos += xprintf("%d ", xf->xf_fd); displaysock(s, pos); } + if (opt_j >= 0) + return; for (hash = 0; hash < HASHSIZE; hash++) { for (s = sockhash[hash]; s != NULL; s = s->next) { if (s->shown) @@ -716,7 +742,8 @@ main(int argc, char *argv[]) int protos_defined = -1; int o, i; - while ((o = getopt(argc, argv, "46cLlp:P:uv")) != -1) + opt_j = -1; + while ((o = getopt(argc, argv, "46cj:Llp:P:uv")) != -1) switch (o) { case '4': opt_4 = 1; @@ -727,6 +754,9 @@ main(int argc, char *argv[]) case 'c': opt_c = 1; break; + case 'j': + opt_j = atoi(optarg); + break; case 'L': opt_L = 1; break; From owner-svn-src-all@FreeBSD.ORG Thu May 24 01:41:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E64681065672; Thu, 24 May 2012 01:41:54 +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 C7F3D8FC0A; Thu, 24 May 2012 01:41: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 q4O1fsqj007528; Thu, 24 May 2012 01:41:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O1fsaK007525; Thu, 24 May 2012 01:41:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240141.q4O1fsaK007525@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 01:41: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: r235871 - stable/9/sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 01:41:55 -0000 Author: mav Date: Thu May 24 01:41:54 2012 New Revision: 235871 URL: http://svn.freebsd.org/changeset/base/235871 Log: MFC r235270: - Prevent error status leak if write to some of the RAID1/1E volume disks failed while write to some other succeeded. Instead mark disk as failed. - Make RAID1E less aggressive in failing disks to avoid volume breakage. Modified: stable/9/sys/geom/raid/tr_raid1.c stable/9/sys/geom/raid/tr_raid1e.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/tr_raid1.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid1.c Thu May 24 01:31:10 2012 (r235870) +++ stable/9/sys/geom/raid/tr_raid1.c Thu May 24 01:41:54 2012 (r235871) @@ -893,7 +893,16 @@ rebuild_round_done: g_raid_unlock_range(sd->sd_volume, bp->bio_offset, bp->bio_length); } - error = bp->bio_error; + if (pbp->bio_cmd != BIO_READ) { + if (pbp->bio_inbed == 1 || pbp->bio_error != 0) + pbp->bio_error = bp->bio_error; + if (bp->bio_error != 0) { + G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); + g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk); + } + error = pbp->bio_error; + } else + error = bp->bio_error; g_destroy_bio(bp); if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; Modified: stable/9/sys/geom/raid/tr_raid1e.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid1e.c Thu May 24 01:31:10 2012 (r235870) +++ stable/9/sys/geom/raid/tr_raid1e.c Thu May 24 01:41:54 2012 (r235871) @@ -338,6 +338,9 @@ static void g_raid_tr_raid1e_fail_disk(struct g_raid_softc *sc, struct g_raid_subdisk *sd, struct g_raid_disk *disk) { + struct g_raid_volume *vol; + + vol = sd->sd_volume; /* * We don't fail the last disk in the pack, since it still has decent * data on it and that's better than failing the disk if it is the root @@ -347,8 +350,12 @@ g_raid_tr_raid1e_fail_disk(struct g_raid * the volume that has / on it. I can't think of a case where we'd * want the volume to go away on this kind of event. */ - if (g_raid_nsubdisks(sd->sd_volume, G_RAID_SUBDISK_S_ACTIVE) == 1 && - g_raid_get_subdisk(sd->sd_volume, G_RAID_SUBDISK_S_ACTIVE) == sd) + if ((g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_ACTIVE) + + g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_RESYNC) + + g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_STALE) + + g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_UNINITIALIZED) < + vol->v_disks_count) && + (sd->sd_state >= G_RAID_SUBDISK_S_UNINITIALIZED)) return; g_raid_fail_disk(sc, sd, disk); } @@ -1113,7 +1120,16 @@ rebuild_round_done: G_RAID_LOGREQ(2, bp, "REMAP done %d.", bp->bio_error); g_raid_unlock_range(sd->sd_volume, virtual, bp->bio_length); } - error = bp->bio_error; + if (pbp->bio_cmd != BIO_READ) { + if (pbp->bio_inbed == 1 || pbp->bio_error != 0) + pbp->bio_error = bp->bio_error; + if (bp->bio_error != 0) { + G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); + g_raid_tr_raid1e_fail_disk(sd->sd_softc, sd, sd->sd_disk); + } + error = pbp->bio_error; + } else + error = bp->bio_error; g_destroy_bio(bp); if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; From owner-svn-src-all@FreeBSD.ORG Thu May 24 01:43:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D88C1065674; Thu, 24 May 2012 01:43: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 F396D8FC1B; Thu, 24 May 2012 01:43: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 q4O1h8ED007633; Thu, 24 May 2012 01:43:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O1h88L007630; Thu, 24 May 2012 01:43:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240143.q4O1h88L007630@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 01:43: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: r235872 - stable/8/sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 01:43:09 -0000 Author: mav Date: Thu May 24 01:43:08 2012 New Revision: 235872 URL: http://svn.freebsd.org/changeset/base/235872 Log: MFC r235270: - Prevent error status leak if write to some of the RAID1/1E volume disks failed while write to some other succeeded. Instead mark disk as failed. - Make RAID1E less aggressive in failing disks to avoid volume breakage. Modified: stable/8/sys/geom/raid/tr_raid1.c stable/8/sys/geom/raid/tr_raid1e.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/raid/tr_raid1.c ============================================================================== --- stable/8/sys/geom/raid/tr_raid1.c Thu May 24 01:41:54 2012 (r235871) +++ stable/8/sys/geom/raid/tr_raid1.c Thu May 24 01:43:08 2012 (r235872) @@ -893,7 +893,16 @@ rebuild_round_done: g_raid_unlock_range(sd->sd_volume, bp->bio_offset, bp->bio_length); } - error = bp->bio_error; + if (pbp->bio_cmd != BIO_READ) { + if (pbp->bio_inbed == 1 || pbp->bio_error != 0) + pbp->bio_error = bp->bio_error; + if (bp->bio_error != 0) { + G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); + g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk); + } + error = pbp->bio_error; + } else + error = bp->bio_error; g_destroy_bio(bp); if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; Modified: stable/8/sys/geom/raid/tr_raid1e.c ============================================================================== --- stable/8/sys/geom/raid/tr_raid1e.c Thu May 24 01:41:54 2012 (r235871) +++ stable/8/sys/geom/raid/tr_raid1e.c Thu May 24 01:43:08 2012 (r235872) @@ -338,6 +338,9 @@ static void g_raid_tr_raid1e_fail_disk(struct g_raid_softc *sc, struct g_raid_subdisk *sd, struct g_raid_disk *disk) { + struct g_raid_volume *vol; + + vol = sd->sd_volume; /* * We don't fail the last disk in the pack, since it still has decent * data on it and that's better than failing the disk if it is the root @@ -347,8 +350,12 @@ g_raid_tr_raid1e_fail_disk(struct g_raid * the volume that has / on it. I can't think of a case where we'd * want the volume to go away on this kind of event. */ - if (g_raid_nsubdisks(sd->sd_volume, G_RAID_SUBDISK_S_ACTIVE) == 1 && - g_raid_get_subdisk(sd->sd_volume, G_RAID_SUBDISK_S_ACTIVE) == sd) + if ((g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_ACTIVE) + + g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_RESYNC) + + g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_STALE) + + g_raid_nsubdisks(vol, G_RAID_SUBDISK_S_UNINITIALIZED) < + vol->v_disks_count) && + (sd->sd_state >= G_RAID_SUBDISK_S_UNINITIALIZED)) return; g_raid_fail_disk(sc, sd, disk); } @@ -1113,7 +1120,16 @@ rebuild_round_done: G_RAID_LOGREQ(2, bp, "REMAP done %d.", bp->bio_error); g_raid_unlock_range(sd->sd_volume, virtual, bp->bio_length); } - error = bp->bio_error; + if (pbp->bio_cmd != BIO_READ) { + if (pbp->bio_inbed == 1 || pbp->bio_error != 0) + pbp->bio_error = bp->bio_error; + if (bp->bio_error != 0) { + G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); + g_raid_tr_raid1e_fail_disk(sd->sd_softc, sd, sd->sd_disk); + } + error = pbp->bio_error; + } else + error = bp->bio_error; g_destroy_bio(bp); if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; From owner-svn-src-all@FreeBSD.ORG Thu May 24 02:24:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEB221065672; Thu, 24 May 2012 02:24:04 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B666D8FC08; Thu, 24 May 2012 02:24: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 q4O2O45f009577; Thu, 24 May 2012 02:24:04 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O2O4OY009544; Thu, 24 May 2012 02:24:04 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201205240224.q4O2O4OY009544@svn.freebsd.org> From: Warren Block Date: Thu, 24 May 2012 02:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235873 - in head: lib/libpam/modules/pam_exec sbin/atacontrol sbin/etherswitchcfg sbin/geom/class/part sbin/geom/class/raid sbin/geom/class/virstor sbin/gvinum sbin/hastctl sbin/hastd ... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 02:24:04 -0000 Author: wblock (doc committer) Date: Thu May 24 02:24:03 2012 New Revision: 235873 URL: http://svn.freebsd.org/changeset/base/235873 Log: Fixes to man8 groff mandoc style, usage mistakes, or typos. PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb MFC after: 3 days Modified: head/lib/libpam/modules/pam_exec/pam_exec.8 head/sbin/atacontrol/atacontrol.8 head/sbin/etherswitchcfg/etherswitchcfg.8 head/sbin/geom/class/part/gpart.8 head/sbin/geom/class/raid/graid.8 head/sbin/geom/class/virstor/gvirstor.8 head/sbin/gvinum/gvinum.8 head/sbin/hastctl/hastctl.8 head/sbin/hastd/hastd.8 head/sbin/mount/mount.8 head/sbin/natd/natd.8 head/share/man/man8/picobsd.8 head/share/man/man8/rc.8 head/sys/boot/common/loader.8 head/sys/boot/forth/beastie.4th.8 head/sys/boot/forth/brand.4th.8 head/sys/boot/forth/check-password.4th.8 head/sys/boot/forth/color.4th.8 head/sys/boot/forth/delay.4th.8 head/sys/boot/forth/menu.4th.8 head/sys/boot/forth/version.4th.8 head/usr.bin/ctlstat/ctlstat.8 head/usr.sbin/cpucontrol/cpucontrol.8 head/usr.sbin/ctladm/ctladm.8 head/usr.sbin/flowctl/flowctl.8 head/usr.sbin/freebsd-update/freebsd-update.8 head/usr.sbin/i2c/i2c.8 head/usr.sbin/jail/jail.8 head/usr.sbin/rtadvctl/rtadvctl.8 head/usr.sbin/rtadvd/rtadvd.8 head/usr.sbin/smbmsg/smbmsg.8 head/usr.sbin/wpa/ndis_events/ndis_events.8 Modified: head/lib/libpam/modules/pam_exec/pam_exec.8 ============================================================================== --- head/lib/libpam/modules/pam_exec/pam_exec.8 Thu May 24 01:43:08 2012 (r235872) +++ head/lib/libpam/modules/pam_exec/pam_exec.8 Thu May 24 02:24:03 2012 (r235873) @@ -131,10 +131,10 @@ This is useful in shell scripts for inst .Xr pam 8 , .Xr pam_sm_acct_mgmt 8 , .Xr pam_sm_authenticate 8 , -.Xr pam_sm_chauthtok 8, +.Xr pam_sm_chauthtok 8 , .Xr pam_sm_close_session 8 , .Xr pam_sm_open_session 8 , -.Xr pam_sm_setcred 8 . +.Xr pam_sm_setcred 8 .Sh AUTHORS The .Nm Modified: head/sbin/atacontrol/atacontrol.8 ============================================================================== --- head/sbin/atacontrol/atacontrol.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/atacontrol/atacontrol.8 Thu May 24 02:24:03 2012 (r235873) @@ -367,8 +367,8 @@ You should not set a spindown timeout on or syslog logging on it as the disk will be worn out spinning down and up all the time. .Sh SEE ALSO -.Xr ata 4 -.Xr cam 4 +.Xr ata 4 , +.Xr cam 4 , .Xr camcontrol 8 .Sh HISTORY The Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/etherswitchcfg/etherswitchcfg.8 Thu May 24 02:24:03 2012 (r235873) @@ -71,7 +71,8 @@ Specifies the physical media configurati Specifies a list of media options for a port. See .Xr ifconfig 8 for details on -.Ar media and +.Ar media +and .Ar mediaopt . .El .Ss reg Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/geom/class/part/gpart.8 Thu May 24 02:24:03 2012 (r235873) @@ -650,7 +650,7 @@ for MBR, for GPT. .It Cm ms-ldm-metadata A partition that contains Logical Disk Manager (LDM) database. -The scheme-specifig type is +The scheme-specific type is .Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3" for GPT. .El @@ -971,7 +971,7 @@ By default mirrored volumes are shown as .Sx "PARTITION TYPES" section). If this variable set to 1 each component of the mirrored volume will be -present as independet partition. +present as independent partition. .Em NOTE : This may break a mirrored volume and lead to data damage. .El Modified: head/sbin/geom/class/raid/graid.8 ============================================================================== --- head/sbin/geom/class/raid/graid.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/geom/class/raid/graid.8 Thu May 24 02:24:03 2012 (r235873) @@ -294,7 +294,7 @@ Debug level of the .Nm RAID GEOM class. .It Va kern.geom.raid.idle_threshold : No 1000000 -Time in microseconds to consider a volume idle for rebuild puroses. +Time in microseconds to consider a volume idle for rebuild purposes. .It Va kern.geom.raid.name_format : No 0 Providers name format: 0 -- raid/r{num}, 1 -- raid/{label}. .It Va kern.geom.raid.read_err_thresh : No 10 Modified: head/sbin/geom/class/virstor/gvirstor.8 ============================================================================== --- head/sbin/geom/class/virstor/gvirstor.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/geom/class/virstor/gvirstor.8 Thu May 24 02:24:03 2012 (r235873) @@ -113,7 +113,7 @@ Adds new components to existing virtual The specified virstor device must exist and be active .Pq i.e. module loaded, device present in Pa /dev . This action can be safely performed while the virstor device is in use -.Pq Qo hot Qc operation +.Pq Qo hot Qc operation . .It Cm remove Removes components from existing virtual device with the given .Ar name . @@ -268,7 +268,8 @@ change once it is set, and that the size components will always remain constant during their existence. For alternative ways to implement virtual or resizable file systems see .Xr zfs 1M , -.Xr gconcat 8 and +.Xr gconcat 8 +and .Xr growfs 8 . .Pp Note that Modified: head/sbin/gvinum/gvinum.8 ============================================================================== --- head/sbin/gvinum/gvinum.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/gvinum/gvinum.8 Thu May 24 02:24:03 2012 (r235873) @@ -58,7 +58,8 @@ All subdisks in the plex must be up for a parity check. .It Ic concat Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives Create a concatenated volume from the specified drives. -If no name is specified, a unique name will be set by gvinum. +If no name is specified, a unique name will be set by +.Ic gvinum . .It Ic create Oo Fl f Oc Op Ar description-file Create a volume as described in .Ar description-file . @@ -148,8 +149,8 @@ Normally this would be done by entering EOF character. .It Ic raid5 Oo Fl fv Oc Oo Fl s Ar stripesize Oc Oo Fl n Ar name Oc Ar drives Create a RAID-5 volume from the specified drives. -If no name is specified,a unique name will be set by -.Ic gvinum. +If no name is specified, a unique name will be set by +.Ic gvinum . This organization requires at least three drives. .It Ic rename Oo Fl r Oc Ar drive | subdisk | plex | volume newname Change the name of the specified object. @@ -202,8 +203,9 @@ Terminate access to the objects, or stop if no parameters are specified. .It Ic stripe Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives Create a striped volume from the specified drives. If no name is specified, -a unique name will be set by Ic gvinum. This organization requires at least two -drives. +a unique name will be set by +.Ic gvinum . +This organization requires at least two drives. .El .Sh DESCRIPTION The @@ -278,7 +280,8 @@ objects .El .Sh EXAMPLES To create a mirror on disks /dev/ad1 and /dev/ad2, create a filesystem, mount, -unmount and then stop Ic gvinum: +unmount and then stop +.Ic gvinum : .Pp .Dl "gvinum mirror /dev/ad1 /dev/ad2" .Dl "newfs /dev/gvinum/gvinumvolume0" Modified: head/sbin/hastctl/hastctl.8 ============================================================================== --- head/sbin/hastctl/hastctl.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/hastctl/hastctl.8 Thu May 24 02:24:03 2012 (r235873) @@ -211,7 +211,7 @@ nodeB# application_start .Xr ggatel 8 , .Xr hastd 8 , .Xr mount 8 , -.Xr newfs 8 . +.Xr newfs 8 .Sh AUTHORS The .Nm Modified: head/sbin/hastd/hastd.8 ============================================================================== --- head/sbin/hastd/hastd.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/hastd/hastd.8 Thu May 24 02:24:03 2012 (r235873) @@ -223,7 +223,7 @@ nodeA# mount -o noatime /dev/hast/shared .Xr hastctl 8 , .Xr mount 8 , .Xr newfs 8 , -.Xr g_bio 9 . +.Xr g_bio 9 .Sh AUTHORS The .Nm Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/mount/mount.8 Thu May 24 02:24:03 2012 (r235873) @@ -448,7 +448,7 @@ However, for the following file system t .Cm smbfs , .Cm udf , and -.Cm unionfs , +.Cm unionfs . .Nm will not call .Xr nmount 2 Modified: head/sbin/natd/natd.8 ============================================================================== --- head/sbin/natd/natd.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/natd/natd.8 Thu May 24 02:24:03 2012 (r235873) @@ -787,7 +787,7 @@ ipfw add allow ip from any to any .Pp Here the packet from internal network to Internet goes out via .Ql sis0 -(rule number 2000) and gets catched by the +(rule number 2000) and gets caught by the .Ic globalport socket (3000). After that, either a match is found in a translation table Modified: head/share/man/man8/picobsd.8 ============================================================================== --- head/share/man/man8/picobsd.8 Thu May 24 01:43:08 2012 (r235872) +++ head/share/man/man8/picobsd.8 Thu May 24 02:24:03 2012 (r235873) @@ -54,7 +54,7 @@ The most important options for common op .Fl src , .Fl init , .Fl n and -.Fl v. +.Fl v . .Bl -tag -width indent .\" .It Fl -all_in_mfs @@ -94,7 +94,10 @@ subtree as necessary to subsequently bui images. .\" .It Fl -iso -Generate an ISO image, picobsd.iso, in addition to the disk image picobsd.bin +Generate an ISO image, +.Pa picobsd.iso , +in addition to the disk image +.Pa picobsd.bin . .\" .It Fl -modules Also build kernel modules. Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Thu May 24 01:43:08 2012 (r235872) +++ head/share/man/man8/rc.8 Thu May 24 02:24:03 2012 (r235873) @@ -253,7 +253,7 @@ The boot does not stop if such a script but a script can stop the boot if necessary by invoking the .Fn stop_boot function (from -.Xr rc.subr 8 ). +.Xr rc.subr 8 ) . .El .Pp Each script should contain Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/common/loader.8 Thu May 24 02:24:03 2012 (r235873) @@ -423,7 +423,7 @@ variable take effect immediately. Defines the base i/o port used to access console UART (i386 and amd64 only). If the variable is not set, its assumed value is 0x3F8, which -corresponds to PC port COM1, unless overriden by +corresponds to PC port COM1, unless overridden by .Va BOOT_COMCONSOLE_PORT variable during the compilation of .Nm . Modified: head/sys/boot/forth/beastie.4th.8 ============================================================================== --- head/sys/boot/forth/beastie.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/beastie.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm beastie.4th -.Nd FreeBSD ASCII art boot module. +.Nd FreeBSD ASCII art boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/brand.4th.8 ============================================================================== --- head/sys/boot/forth/brand.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/brand.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm brand.4th -.Nd FreeBSD ASCII art boot module. +.Nd FreeBSD ASCII art boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/check-password.4th.8 ============================================================================== --- head/sys/boot/forth/check-password.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/check-password.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm check-password.4th -.Nd FreeBSD password-checking boot module. +.Nd FreeBSD password-checking boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/color.4th.8 ============================================================================== --- head/sys/boot/forth/color.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/color.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm color.4th -.Nd FreeBSD color-detection boot module. +.Nd FreeBSD color-detection boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/delay.4th.8 ============================================================================== --- head/sys/boot/forth/delay.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/delay.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm delay.4th -.Nd FreeBSD debugging boot module. +.Nd FreeBSD debugging boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/menu.4th.8 ============================================================================== --- head/sys/boot/forth/menu.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/menu.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm menu.4th -.Nd FreeBSD dynamic menu boot module. +.Nd FreeBSD dynamic menu boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/version.4th.8 ============================================================================== --- head/sys/boot/forth/version.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/version.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm version.4th -.Nd FreeBSD version string boot module. +.Nd FreeBSD version string boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/usr.bin/ctlstat/ctlstat.8 ============================================================================== --- head/usr.bin/ctlstat/ctlstat.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.bin/ctlstat/ctlstat.8 Thu May 24 02:24:03 2012 (r235873) @@ -86,8 +86,8 @@ Notation (JSON) format. No statistics are computed in this mode, only raw numbers are displayed. .It Fl l Ar lun Request statistics for the specified LUN. -This option is incompatible with total ( -.Fl t ) +This option is incompatible with total +.Fl ( t ) mode. .It Fl n Ar numdevs Display statistics for this many devices. Modified: head/usr.sbin/cpucontrol/cpucontrol.8 ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/cpucontrol/cpucontrol.8 Thu May 24 02:24:03 2012 (r235873) @@ -31,7 +31,7 @@ .Nm cpucontrol .Nd control utility for the .Xr cpuctl 4 -device. +device .Sh SYNOPSIS .Nm .Op Fl vh Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/ctladm/ctladm.8 Thu May 24 02:24:03 2012 (r235873) @@ -542,7 +542,7 @@ List all LUNs registered with CTL. Because this command uses the ioctl port, it will only work when the FETDs (Front End Target Drivers) are enabled. This command is the equivalent of doing a REPORT LUNS on one LUN and then -and then an INQUIRY on each LUN in the system. +an INQUIRY on each LUN in the system. .It Ic delay Delay commands at the given location. There are two places where commands may be delayed currently: before data is transferred @@ -749,7 +749,7 @@ single port. As a general rule, the WWNN should be the same across all ports on the system. .It Fl W Ar wwpn -Set the World Wide Node Name for the given port. +Set the World Wide Port Name for the given port. The .Fl n argument must be specified, since this is only possible to implement on a @@ -939,10 +939,10 @@ Create a LUN using the block backend, sp .Pa src/usr.sbin/ctladm/ctladm.8 as the backing store, and specify the .Tn SCSI -VPD page 0x80 and 0x83 serial number ( -.Fl S) -and device ID ( -.Fl d). +VPD page 0x80 and 0x83 serial number +.Fl ( S ) +and device ID +.Fl ( d ) . .Pp .Dl ctladm remove -b block -l 12 .Pp Modified: head/usr.sbin/flowctl/flowctl.8 ============================================================================== --- head/usr.sbin/flowctl/flowctl.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/flowctl/flowctl.8 Thu May 24 02:24:03 2012 (r235873) @@ -60,7 +60,7 @@ This command is the analog of the .Dq "show ip cache flow" command of a Cisco router. It dumps the contents of the flow cache in Cisco-like format. -Specifing either +Specifying either .Cm ipv4 or .Cm ipv6 Modified: head/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Thu May 24 02:24:03 2012 (r235873) @@ -62,7 +62,7 @@ Release Engineering Team, e.g., .Fx 9.0-CURRENT. .Sh OPTIONS -The following options are supported +The following options are supported: .Bl -tag -width "-f conffile" .It Fl b Ar basedir Operate on a system mounted at Modified: head/usr.sbin/i2c/i2c.8 ============================================================================== --- head/usr.sbin/i2c/i2c.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/i2c/i2c.8 Thu May 24 02:24:03 2012 (r235873) @@ -88,7 +88,7 @@ reset the controller. .It Fl s scan the bus for devices. .It Fl v -be verbose +be verbose. .It Fl w Ar 0|8|16 device addressing width (in bits). .El Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/jail/jail.8 Thu May 24 02:24:03 2012 (r235873) @@ -255,7 +255,7 @@ They can also be given the values .Dq true and .Dq false . -Other partameters may have more than one value, specified as a +Other parameters may have more than one value, specified as a comma-separated list or with .Dq += in the configuration file (see @@ -269,7 +269,7 @@ parameters that are passed to the kernel can be seen with .Xr jls 8 , and can (usually) be changed with -.Dq Nm Fl m. +.Dq Nm Fl m . Then there are pseudo-parameters that are only used by .Nm itself. @@ -580,7 +580,7 @@ command parameters are command lines that are run in either the system or prison environment. They may be given multiple values, which run would the specified commands in sequence. -All commands must succed (return a zero exit status), or the jail will +All commands must succeed (return a zero exit status), or the jail will not be created or removed. .Pp The pseudo-parameters are: @@ -657,7 +657,8 @@ The maximum amount of time to wait for a after sending them a .Dv SIGTERM signal (which happens after the -.Va exec.stop commands have completed). +.Va exec.stop +commands have completed). After this many seconds have passed, the prison will be removed, which will kill any remaining processes. If this is set to zero, no Modified: head/usr.sbin/rtadvctl/rtadvctl.8 ============================================================================== --- head/usr.sbin/rtadvctl/rtadvctl.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/rtadvctl/rtadvctl.8 Thu May 24 02:24:03 2012 (r235873) @@ -31,7 +31,8 @@ .Sh NAME .Nm rtadvctl .Nd control program for -.Xr rtadvd 8 daemon +.Xr rtadvd 8 +daemon .Sh SYNOPSIS .Nm .Op Fl v Modified: head/usr.sbin/rtadvd/rtadvd.8 ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/rtadvd/rtadvd.8 Thu May 24 02:24:03 2012 (r235873) @@ -140,7 +140,7 @@ option, which enables routing renumberin .It Fl p Specify an alternative file in which to store the process ID. The default is -.Pa /var/run/rtadvd.pid. +.Pa /var/run/rtadvd.pid . .It Fl R Accept router renumbering requests. If you enable it, certain IPsec setup is suggested for security reasons. Modified: head/usr.sbin/smbmsg/smbmsg.8 ============================================================================== --- head/usr.sbin/smbmsg/smbmsg.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/smbmsg/smbmsg.8 Thu May 24 02:24:03 2012 (r235873) @@ -70,7 +70,7 @@ and writeable, respectively. The only valid additional option for this modus of operation (besides the .Fl p -option that choses the modus) is +option that chooses the modus) is .Fl f Ar dev . See below for a description. .Pp Modified: head/usr.sbin/wpa/ndis_events/ndis_events.8 ============================================================================== --- head/usr.sbin/wpa/ndis_events/ndis_events.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/wpa/ndis_events/ndis_events.8 Thu May 24 02:24:03 2012 (r235873) @@ -71,7 +71,7 @@ When it detects an event that was genera interface, it transmits it via UDP packet on the loopback interface, where .Xr wpa_supplicant 8 -is presumeably listening. +is presumably listening. The standard .Xr wpa_supplicant 8 distribution includes its own version of this utility for use with From owner-svn-src-all@FreeBSD.ORG Thu May 24 02:34:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 488F81065673; Thu, 24 May 2012 02:34: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 2DE708FC12; Thu, 24 May 2012 02:34: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 q4O2Y4Ij010083; Thu, 24 May 2012 02:34:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O2Y3lq010073; Thu, 24 May 2012 02:34:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240234.q4O2Y3lq010073@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 02:34: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: r235874 - in stable/9: sbin/geom/class/raid sys/conf sys/geom/raid sys/modules/geom/geom_raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 02:34:04 -0000 Author: mav Date: Thu May 24 02:34:03 2012 New Revision: 235874 URL: http://svn.freebsd.org/changeset/base/235874 Log: MFC r234458, r234603, r234610, r234727, r234816, r234848, r234868, r234869, r234899, r234940, r234993, r234994, r235071 -c r235076, r235080, r235096: - Add support for the DDF metadata format, as defined by the SNIA Common RAID Disk Data Format Specification v2.0; - Add support for reading non-degraded RAID4/5/5E/5EE/5R/6/MDF volumes. Sponsored by: iXsystems, Inc. Added: stable/9/sys/geom/raid/md_ddf.c - copied, changed from r234848, head/sys/geom/raid/md_ddf.c stable/9/sys/geom/raid/md_ddf.h - copied unchanged from r234848, head/sys/geom/raid/md_ddf.h stable/9/sys/geom/raid/tr_raid5.c - copied, changed from r234458, head/sys/geom/raid/tr_raid5.c Modified: stable/9/sbin/geom/class/raid/geom_raid.c stable/9/sbin/geom/class/raid/graid.8 stable/9/sys/conf/files stable/9/sys/geom/raid/g_raid.c stable/9/sys/geom/raid/g_raid.h stable/9/sys/geom/raid/g_raid_ctl.c stable/9/sys/geom/raid/g_raid_md_if.m stable/9/sys/geom/raid/md_intel.c stable/9/sys/geom/raid/md_jmicron.c stable/9/sys/geom/raid/md_nvidia.c stable/9/sys/geom/raid/md_promise.c stable/9/sys/geom/raid/md_sii.c stable/9/sys/geom/raid/tr_raid1.c stable/9/sys/geom/raid/tr_raid1e.c stable/9/sys/modules/geom/geom_raid/Makefile Directory Properties: stable/9/sbin/geom/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sbin/geom/class/raid/geom_raid.c ============================================================================== --- stable/9/sbin/geom/class/raid/geom_raid.c Thu May 24 02:24:03 2012 (r235873) +++ stable/9/sbin/geom/class/raid/geom_raid.c Thu May 24 02:34:03 2012 (r235874) @@ -48,11 +48,12 @@ struct g_command class_commands[] = { { "label", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, + { 'o', "fmtopt", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'S', "size", G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 's', "strip", G_VAL_OPTIONAL, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - "[-fv] [-S size] [-s stripsize] format label level prov ..." + "[-fv] [-o fmtopt] [-S size] [-s stripsize] format label level prov ..." }, { "add", G_FLAG_VERBOSE, NULL, { Modified: stable/9/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/9/sbin/geom/class/raid/graid.8 Thu May 24 02:24:03 2012 (r235873) +++ stable/9/sbin/geom/class/raid/graid.8 Thu May 24 02:34:03 2012 (r235874) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2011 +.Dd May 6, 2012 .Dt GRAID 8 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nm .Cm label .Op Fl f +.Op Fl o Ar fmtopt .Op Fl S Ar size .Op Fl s Ar strip .Ar format @@ -119,6 +120,8 @@ Additional options include: .It Fl f Enforce specified configuration creation if it is officially unsupported, but technically can be created. +.It Fl o Ar fmtopt +Specifies metadata format options. .It Fl S Ar size Use .Ar size @@ -200,6 +203,23 @@ The GEOM RAID class follows a modular de formats to be used. Support is currently implemented for the following formats: .Bl -tag -width "Intel" +.It DDF +The format defined by the SNIA Common RAID Disk Data Format v2.0 specification. +Used by some Adaptec RAID BIOSes and some hardware RAID controllers. +Because of high format flexibility different implementations support +different set of features and have different on-disk metadata layouts. +To provide compatibility, the GEOM RAID class mimics capabilities +of the first detected DDF array. +Respecting that, it may support different number of disks per volume, +volumes per array, partitions per disk, etc. +The following configurations are supported: RAID0 (2+ disks), RAID1 (2+ disks), +RAID1E (3+ disks), RAID3 (3+ disks), RAID4 (3+ disks), RAID5 (3+ disks), +RAID5E (4+ disks), RAID5EE (4+ disks), RAID5R (3+ disks), RAID6 (4+ disks), +RAIDMDF (4+ disks), RAID10 (4+ disks), SINGLE (1 disk), CONCAT (2+ disks). +.Pp +Format supports two options "BE" and "LE", that mean big-endian byte order +defined by specification (default) and little-endian used by some Adaptec +controllers. .It Intel The format used by Intel RAID BIOS. Supports up to two volumes per array. @@ -241,8 +261,11 @@ own risk: RAID1 (3+ disks), RAID10 (6+ d .Sh SUPPORTED RAID LEVELS The GEOM RAID class follows a modular design, allowing different RAID levels to be used. -Support for the following RAID levels is currently implemented: RAID0, RAID1, -RAID1E, RAID10, SINGLE, CONCAT. +Full support for the following RAID levels is currently implemented: +RAID0, RAID1, RAID1E, RAID10, SINGLE, CONCAT. +The following RAID levels supported as read-only for volumes in optimal +state (without using redundancy): RAID4, RAID5, RAID5E, RAID5EE, RAID5R, +RAID6, RAIDMDF. .Sh RAID LEVEL MIGRATION The GEOM RAID class has no support for RAID level migration, allowed by some metadata formats. @@ -253,6 +276,33 @@ corruption! .Sh 2TiB BARRIERS Promise metadata format does not support disks above 2TiB. NVIDIA metadata format does not support volumes above 2TiB. +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variable can be used to control the behavior of the +.Nm RAID +GEOM class. +.Bl -tag -width indent +.It Va kern.geom.raid.aggressive_spare : No 0 +Use any disks without metadata connected to controllers of the vendor +matching to volume metadata format as spare. +Use it with much care to not lose data if connecting unrelated disk! +.It Va kern.geom.raid.clean_time : No 5 +Mark volume as clean when idle for the specified number of seconds. +.It Va kern.geom.raid.debug : No 0 +Debug level of the +.Nm RAID +GEOM class. +.It Va kern.geom.raid.idle_threshold : No 1000000 +Time in microseconds to consider a volume idle for rebuild puroses. +.It Va kern.geom.raid.name_format : No 0 +Providers name format: 0 -- raid/r{num}, 1 -- raid/{label}. +.It Va kern.geom.raid.read_err_thresh : No 10 +Number of read errors equated to disk failure. +Write errors are always considered as disk failures. +.It Va kern.geom.raid.start_timeout : No 30 +Time to wait for missing array components on startup. +.El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. .Sh SEE ALSO Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Thu May 24 02:24:03 2012 (r235873) +++ stable/9/sys/conf/files Thu May 24 02:34:03 2012 (r235874) @@ -2253,6 +2253,7 @@ geom/raid/g_raid.c optional geom_raid geom/raid/g_raid_ctl.c optional geom_raid geom/raid/g_raid_md_if.m optional geom_raid geom/raid/g_raid_tr_if.m optional geom_raid +geom/raid/md_ddf.c optional geom_raid geom/raid/md_intel.c optional geom_raid geom/raid/md_jmicron.c optional geom_raid geom/raid/md_nvidia.c optional geom_raid @@ -2262,6 +2263,7 @@ geom/raid/tr_concat.c optional geom_rai geom/raid/tr_raid0.c optional geom_raid geom/raid/tr_raid1.c optional geom_raid geom/raid/tr_raid1e.c optional geom_raid +geom/raid/tr_raid5.c optional geom_raid geom/raid3/g_raid3.c optional geom_raid3 geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Thu May 24 02:24:03 2012 (r235873) +++ stable/9/sys/geom/raid/g_raid.c Thu May 24 02:34:03 2012 (r235874) @@ -277,23 +277,87 @@ g_raid_volume_level2str(int level, int q case G_RAID_VOLUME_RL_RAID1: return ("RAID1"); case G_RAID_VOLUME_RL_RAID3: + if (qual == G_RAID_VOLUME_RLQ_R3P0) + return ("RAID3-P0"); + if (qual == G_RAID_VOLUME_RLQ_R3PN) + return ("RAID3-PN"); return ("RAID3"); case G_RAID_VOLUME_RL_RAID4: + if (qual == G_RAID_VOLUME_RLQ_R4P0) + return ("RAID4-P0"); + if (qual == G_RAID_VOLUME_RLQ_R4PN) + return ("RAID4-PN"); return ("RAID4"); case G_RAID_VOLUME_RL_RAID5: + if (qual == G_RAID_VOLUME_RLQ_R5RA) + return ("RAID5-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5RS) + return ("RAID5-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5LA) + return ("RAID5-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5LS) + return ("RAID5-LS"); return ("RAID5"); case G_RAID_VOLUME_RL_RAID6: + if (qual == G_RAID_VOLUME_RLQ_R6RA) + return ("RAID6-RA"); + if (qual == G_RAID_VOLUME_RLQ_R6RS) + return ("RAID6-RS"); + if (qual == G_RAID_VOLUME_RLQ_R6LA) + return ("RAID6-LA"); + if (qual == G_RAID_VOLUME_RLQ_R6LS) + return ("RAID6-LS"); return ("RAID6"); + case G_RAID_VOLUME_RL_RAIDMDF: + if (qual == G_RAID_VOLUME_RLQ_RMDFRA) + return ("RAIDMDF-RA"); + if (qual == G_RAID_VOLUME_RLQ_RMDFRS) + return ("RAIDMDF-RS"); + if (qual == G_RAID_VOLUME_RLQ_RMDFLA) + return ("RAIDMDF-LA"); + if (qual == G_RAID_VOLUME_RLQ_RMDFLS) + return ("RAIDMDF-LS"); + return ("RAIDMDF"); case G_RAID_VOLUME_RL_RAID1E: + if (qual == G_RAID_VOLUME_RLQ_R1EA) + return ("RAID1E-A"); + if (qual == G_RAID_VOLUME_RLQ_R1EO) + return ("RAID1E-O"); return ("RAID1E"); case G_RAID_VOLUME_RL_SINGLE: return ("SINGLE"); case G_RAID_VOLUME_RL_CONCAT: return ("CONCAT"); case G_RAID_VOLUME_RL_RAID5E: + if (qual == G_RAID_VOLUME_RLQ_R5ERA) + return ("RAID5E-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5ERS) + return ("RAID5E-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5ELA) + return ("RAID5E-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5ELS) + return ("RAID5E-LS"); return ("RAID5E"); case G_RAID_VOLUME_RL_RAID5EE: + if (qual == G_RAID_VOLUME_RLQ_R5EERA) + return ("RAID5EE-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5EERS) + return ("RAID5EE-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5EELA) + return ("RAID5EE-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5EELS) + return ("RAID5EE-LS"); return ("RAID5EE"); + case G_RAID_VOLUME_RL_RAID5R: + if (qual == G_RAID_VOLUME_RLQ_R5RRA) + return ("RAID5R-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5RRS) + return ("RAID5R-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5RLA) + return ("RAID5R-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5RLS) + return ("RAID5R-LS"); + return ("RAID5E"); default: return ("UNKNOWN"); } @@ -309,26 +373,111 @@ g_raid_volume_str2level(const char *str, *level = G_RAID_VOLUME_RL_RAID0; else if (strcasecmp(str, "RAID1") == 0) *level = G_RAID_VOLUME_RL_RAID1; - else if (strcasecmp(str, "RAID3") == 0) + else if (strcasecmp(str, "RAID3-P0") == 0) { + *level = G_RAID_VOLUME_RL_RAID3; + *qual = G_RAID_VOLUME_RLQ_R3P0; + } else if (strcasecmp(str, "RAID3-PN") == 0 || + strcasecmp(str, "RAID3") == 0) { *level = G_RAID_VOLUME_RL_RAID3; - else if (strcasecmp(str, "RAID4") == 0) + *qual = G_RAID_VOLUME_RLQ_R3PN; + } else if (strcasecmp(str, "RAID4-P0") == 0) { + *level = G_RAID_VOLUME_RL_RAID4; + *qual = G_RAID_VOLUME_RLQ_R4P0; + } else if (strcasecmp(str, "RAID4-PN") == 0 || + strcasecmp(str, "RAID4") == 0) { *level = G_RAID_VOLUME_RL_RAID4; - else if (strcasecmp(str, "RAID5") == 0) + *qual = G_RAID_VOLUME_RLQ_R4PN; + } else if (strcasecmp(str, "RAID5-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5; + *qual = G_RAID_VOLUME_RLQ_R5RA; + } else if (strcasecmp(str, "RAID5-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5; + *qual = G_RAID_VOLUME_RLQ_R5RS; + } else if (strcasecmp(str, "RAID5") == 0 || + strcasecmp(str, "RAID5-LA") == 0) { *level = G_RAID_VOLUME_RL_RAID5; - else if (strcasecmp(str, "RAID6") == 0) + *qual = G_RAID_VOLUME_RLQ_R5LA; + } else if (strcasecmp(str, "RAID5-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5; + *qual = G_RAID_VOLUME_RLQ_R5LS; + } else if (strcasecmp(str, "RAID6-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID6; + *qual = G_RAID_VOLUME_RLQ_R6RA; + } else if (strcasecmp(str, "RAID6-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID6; + *qual = G_RAID_VOLUME_RLQ_R6RS; + } else if (strcasecmp(str, "RAID6") == 0 || + strcasecmp(str, "RAID6-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAID6; + *qual = G_RAID_VOLUME_RLQ_R6LA; + } else if (strcasecmp(str, "RAID6-LS") == 0) { *level = G_RAID_VOLUME_RL_RAID6; - else if (strcasecmp(str, "RAID10") == 0 || - strcasecmp(str, "RAID1E") == 0) + *qual = G_RAID_VOLUME_RLQ_R6LS; + } else if (strcasecmp(str, "RAIDMDF-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFRA; + } else if (strcasecmp(str, "RAIDMDF-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFRS; + } else if (strcasecmp(str, "RAIDMDF") == 0 || + strcasecmp(str, "RAIDMDF-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFLA; + } else if (strcasecmp(str, "RAIDMDF-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFLS; + } else if (strcasecmp(str, "RAID10") == 0 || + strcasecmp(str, "RAID1E") == 0 || + strcasecmp(str, "RAID1E-A") == 0) { *level = G_RAID_VOLUME_RL_RAID1E; - else if (strcasecmp(str, "SINGLE") == 0) + *qual = G_RAID_VOLUME_RLQ_R1EA; + } else if (strcasecmp(str, "RAID1E-O") == 0) { + *level = G_RAID_VOLUME_RL_RAID1E; + *qual = G_RAID_VOLUME_RLQ_R1EO; + } else if (strcasecmp(str, "SINGLE") == 0) *level = G_RAID_VOLUME_RL_SINGLE; else if (strcasecmp(str, "CONCAT") == 0) *level = G_RAID_VOLUME_RL_CONCAT; - else if (strcasecmp(str, "RAID5E") == 0) + else if (strcasecmp(str, "RAID5E-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5E; + *qual = G_RAID_VOLUME_RLQ_R5ERA; + } else if (strcasecmp(str, "RAID5E-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5E; + *qual = G_RAID_VOLUME_RLQ_R5ERS; + } else if (strcasecmp(str, "RAID5E") == 0 || + strcasecmp(str, "RAID5E-LA") == 0) { *level = G_RAID_VOLUME_RL_RAID5E; - else if (strcasecmp(str, "RAID5EE") == 0) + *qual = G_RAID_VOLUME_RLQ_R5ELA; + } else if (strcasecmp(str, "RAID5E-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5E; + *qual = G_RAID_VOLUME_RLQ_R5ELS; + } else if (strcasecmp(str, "RAID5EE-RA") == 0) { *level = G_RAID_VOLUME_RL_RAID5EE; - else + *qual = G_RAID_VOLUME_RLQ_R5EERA; + } else if (strcasecmp(str, "RAID5EE-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5EE; + *qual = G_RAID_VOLUME_RLQ_R5EERS; + } else if (strcasecmp(str, "RAID5EE") == 0 || + strcasecmp(str, "RAID5EE-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5EE; + *qual = G_RAID_VOLUME_RLQ_R5EELA; + } else if (strcasecmp(str, "RAID5EE-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5EE; + *qual = G_RAID_VOLUME_RLQ_R5EELS; + } else if (strcasecmp(str, "RAID5R-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RRA; + } else if (strcasecmp(str, "RAID5R-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RRS; + } else if (strcasecmp(str, "RAID5R") == 0 || + strcasecmp(str, "RAID5R-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RLA; + } else if (strcasecmp(str, "RAID5R-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RLS; + } else return (-1); return (0); } @@ -1674,8 +1823,8 @@ g_raid_create_node(struct g_class *mp, sc->sc_flags = 0; TAILQ_INIT(&sc->sc_volumes); TAILQ_INIT(&sc->sc_disks); - sx_init(&sc->sc_lock, "gmirror:lock"); - mtx_init(&sc->sc_queue_mtx, "gmirror:queue", NULL, MTX_DEF); + sx_init(&sc->sc_lock, "graid:lock"); + mtx_init(&sc->sc_queue_mtx, "graid:queue", NULL, MTX_DEF); TAILQ_INIT(&sc->sc_events); bioq_init(&sc->sc_queue); gp->softc = sc; @@ -1707,6 +1856,7 @@ g_raid_create_volume(struct g_raid_softc vol->v_state = G_RAID_VOLUME_S_STARTING; vol->v_raid_level = G_RAID_VOLUME_RL_UNKNOWN; vol->v_raid_level_qualifier = G_RAID_VOLUME_RLQ_UNKNOWN; + vol->v_rotate_parity = 1; bioq_init(&vol->v_inflight); bioq_init(&vol->v_locked); LIST_INIT(&vol->v_locks); @@ -1994,7 +2144,7 @@ g_raid_taste(struct g_class *mp, struct g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); G_RAID_DEBUG(2, "Tasting provider %s.", pp->name); - gp = g_new_geomf(mp, "mirror:taste"); + gp = g_new_geomf(mp, "raid:taste"); /* * This orphan function should be never called. */ @@ -2024,7 +2174,8 @@ g_raid_taste(struct g_class *mp, struct } int -g_raid_create_node_format(const char *format, struct g_geom **gp) +g_raid_create_node_format(const char *format, struct gctl_req *req, + struct g_geom **gp) { struct g_raid_md_class *class; struct g_raid_md_object *obj; @@ -2042,7 +2193,7 @@ g_raid_create_node_format(const char *fo obj = (void *)kobj_create((kobj_class_t)class, M_RAID, M_WAITOK); obj->mdo_class = class; - status = G_RAID_MD_CREATE(obj, &g_raid_class, gp); + status = G_RAID_MD_CREATE_REQ(obj, &g_raid_class, req, gp); if (status != G_RAID_MD_TASTE_NEW) kobj_delete((kobj_t)obj, M_RAID); return (status); Modified: stable/9/sys/geom/raid/g_raid.h ============================================================================== --- stable/9/sys/geom/raid/g_raid.h Thu May 24 02:24:03 2012 (r235873) +++ stable/9/sys/geom/raid/g_raid.h Thu May 24 02:34:03 2012 (r235874) @@ -219,14 +219,48 @@ struct g_raid_subdisk { #define G_RAID_VOLUME_RL_RAID4 0x04 #define G_RAID_VOLUME_RL_RAID5 0x05 #define G_RAID_VOLUME_RL_RAID6 0x06 +#define G_RAID_VOLUME_RL_RAIDMDF 0x07 #define G_RAID_VOLUME_RL_RAID1E 0x11 #define G_RAID_VOLUME_RL_SINGLE 0x0f #define G_RAID_VOLUME_RL_CONCAT 0x1f #define G_RAID_VOLUME_RL_RAID5E 0x15 #define G_RAID_VOLUME_RL_RAID5EE 0x25 +#define G_RAID_VOLUME_RL_RAID5R 0x35 #define G_RAID_VOLUME_RL_UNKNOWN 0xff #define G_RAID_VOLUME_RLQ_NONE 0x00 +#define G_RAID_VOLUME_RLQ_R1SM 0x00 +#define G_RAID_VOLUME_RLQ_R1MM 0x01 +#define G_RAID_VOLUME_RLQ_R3P0 0x00 +#define G_RAID_VOLUME_RLQ_R3PN 0x01 +#define G_RAID_VOLUME_RLQ_R4P0 0x00 +#define G_RAID_VOLUME_RLQ_R4PN 0x01 +#define G_RAID_VOLUME_RLQ_R5RA 0x00 +#define G_RAID_VOLUME_RLQ_R5RS 0x01 +#define G_RAID_VOLUME_RLQ_R5LA 0x02 +#define G_RAID_VOLUME_RLQ_R5LS 0x03 +#define G_RAID_VOLUME_RLQ_R6RA 0x00 +#define G_RAID_VOLUME_RLQ_R6RS 0x01 +#define G_RAID_VOLUME_RLQ_R6LA 0x02 +#define G_RAID_VOLUME_RLQ_R6LS 0x03 +#define G_RAID_VOLUME_RLQ_RMDFRA 0x00 +#define G_RAID_VOLUME_RLQ_RMDFRS 0x01 +#define G_RAID_VOLUME_RLQ_RMDFLA 0x02 +#define G_RAID_VOLUME_RLQ_RMDFLS 0x03 +#define G_RAID_VOLUME_RLQ_R1EA 0x00 +#define G_RAID_VOLUME_RLQ_R1EO 0x01 +#define G_RAID_VOLUME_RLQ_R5ERA 0x00 +#define G_RAID_VOLUME_RLQ_R5ERS 0x01 +#define G_RAID_VOLUME_RLQ_R5ELA 0x02 +#define G_RAID_VOLUME_RLQ_R5ELS 0x03 +#define G_RAID_VOLUME_RLQ_R5EERA 0x00 +#define G_RAID_VOLUME_RLQ_R5EERS 0x01 +#define G_RAID_VOLUME_RLQ_R5EELA 0x02 +#define G_RAID_VOLUME_RLQ_R5EELS 0x03 +#define G_RAID_VOLUME_RLQ_R5RRA 0x00 +#define G_RAID_VOLUME_RLQ_R5RRS 0x01 +#define G_RAID_VOLUME_RLQ_R5RLA 0x02 +#define G_RAID_VOLUME_RLQ_R5RLS 0x03 #define G_RAID_VOLUME_RLQ_UNKNOWN 0xff struct g_raid_volume; @@ -244,7 +278,13 @@ struct g_raid_volume { u_int v_raid_level; /* Array RAID level. */ u_int v_raid_level_qualifier; /* RAID level det. */ u_int v_disks_count; /* Number of disks in array. */ + u_int v_mdf_pdisks; /* Number of parity disks + in RAIDMDF array. */ + uint16_t v_mdf_polynomial; /* Polynomial for RAIDMDF. */ + uint8_t v_mdf_method; /* Generation method for RAIDMDF. */ u_int v_strip_size; /* Array strip size. */ + u_int v_rotate_parity; /* Rotate RAID5R parity + after numer of stripes. */ u_int v_sectorsize; /* Volume sector size. */ off_t v_mediasize; /* Volume media size. */ struct bio_queue_head v_inflight; /* In-flight write requests. */ @@ -348,7 +388,8 @@ const char * g_raid_disk_state2str(int s struct g_raid_softc * g_raid_create_node(struct g_class *mp, const char *name, struct g_raid_md_object *md); -int g_raid_create_node_format(const char *format, struct g_geom **gp); +int g_raid_create_node_format(const char *format, struct gctl_req *req, + struct g_geom **gp); struct g_raid_volume * g_raid_create_volume(struct g_raid_softc *sc, const char *name, int id); struct g_raid_disk * g_raid_create_disk(struct g_raid_softc *sc); Modified: stable/9/sys/geom/raid/g_raid_ctl.c ============================================================================== --- stable/9/sys/geom/raid/g_raid_ctl.c Thu May 24 02:24:03 2012 (r235873) +++ stable/9/sys/geom/raid/g_raid_ctl.c Thu May 24 02:34:03 2012 (r235874) @@ -88,7 +88,7 @@ g_raid_ctl_label(struct gctl_req *req, s gctl_error(req, "No format recieved."); return; } - crstatus = g_raid_create_node_format(format, &geom); + crstatus = g_raid_create_node_format(format, req, &geom); if (crstatus == G_RAID_MD_TASTE_FAIL) { gctl_error(req, "Failed to create array with format '%s'.", format); Modified: stable/9/sys/geom/raid/g_raid_md_if.m ============================================================================== --- stable/9/sys/geom/raid/g_raid_md_if.m Thu May 24 02:24:03 2012 (r235873) +++ stable/9/sys/geom/raid/g_raid_md_if.m Thu May 24 02:34:03 2012 (r235874) @@ -49,13 +49,22 @@ HEADER { # Default implementations of methods. CODE { static int - g_raid_md_create_default(struct g_raid_md_object *md) + g_raid_md_create_default(struct g_raid_md_object *md, + struct g_class *mp, struct g_geom **gp) { return (G_RAID_MD_TASTE_FAIL); } static int + g_raid_md_create_req_default(struct g_raid_md_object *md, + struct g_class *mp, struct gctl_req *req, struct g_geom **gp) + { + + return (G_RAID_MD_CREATE(md, mp, gp)); + } + + static int g_raid_md_ctl_default(struct g_raid_md_object *md, struct gctl_req *req) { @@ -95,6 +104,14 @@ METHOD int create { struct g_geom **gp; } DEFAULT g_raid_md_create_default; +# create_req() - create new node from scratch, with request argument. +METHOD int create_req { + struct g_raid_md_object *md; + struct g_class *mp; + struct gctl_req *req; + struct g_geom **gp; +} DEFAULT g_raid_md_create_req_default; + # taste() - taste disk and, if needed, create new node. METHOD int taste { struct g_raid_md_object *md; Copied and modified: stable/9/sys/geom/raid/md_ddf.c (from r234848, head/sys/geom/raid/md_ddf.c) ============================================================================== --- head/sys/geom/raid/md_ddf.c Mon Apr 30 17:53:02 2012 (r234848, copy source) +++ stable/9/sys/geom/raid/md_ddf.c Thu May 24 02:34:03 2012 (r235874) @@ -88,14 +88,15 @@ struct g_raid_md_ddf_pervolume { struct g_raid_md_ddf_object { struct g_raid_md_object mdio_base; + u_int mdio_bigendian; struct ddf_meta mdio_meta; + int mdio_starting; struct callout mdio_start_co; /* STARTING state timer. */ int mdio_started; - int mdio_incomplete; struct root_hold_token *mdio_rootmount; /* Root mount delay token. */ }; -static g_raid_md_create_t g_raid_md_create_ddf; +static g_raid_md_create_req_t g_raid_md_create_req_ddf; static g_raid_md_taste_t g_raid_md_taste_ddf; static g_raid_md_event_t g_raid_md_event_ddf; static g_raid_md_volume_event_t g_raid_md_volume_event_ddf; @@ -107,7 +108,7 @@ static g_raid_md_free_volume_t g_raid_md static g_raid_md_free_t g_raid_md_free_ddf; static kobj_method_t g_raid_md_ddf_methods[] = { - KOBJMETHOD(g_raid_md_create, g_raid_md_create_ddf), + KOBJMETHOD(g_raid_md_create_req, g_raid_md_create_req_ddf), KOBJMETHOD(g_raid_md_taste, g_raid_md_taste_ddf), KOBJMETHOD(g_raid_md_event, g_raid_md_event_ddf), KOBJMETHOD(g_raid_md_volume_event, g_raid_md_volume_event_ddf), @@ -172,6 +173,17 @@ static struct g_raid_md_class g_raid_md_ #define SET32D(m, f, v) SET32P((m), &(f), (v)) #define SET64D(m, f, v) SET64P((m), &(f), (v)) +#define GETCRNUM(m) (GET32((m), hdr->cr_length) / \ + GET16((m), hdr->Configuration_Record_Length)) + +#define GETVDCPTR(m, n) ((struct ddf_vdc_record *)((uint8_t *)(m)->cr + \ + (n) * GET16((m), hdr->Configuration_Record_Length) * \ + (m)->sectorsize)) + +#define GETSAPTR(m, n) ((struct ddf_sa_record *)((uint8_t *)(m)->cr + \ + (n) * GET16((m), hdr->Configuration_Record_Length) * \ + (m)->sectorsize)) + static int isff(uint8_t *buf, int size) { @@ -254,7 +266,7 @@ g_raid_md_ddf_print(struct ddf_meta *met GET16(meta, cdr->Controller_Type.SubVendor_ID), GET16(meta, cdr->Controller_Type.SubDevice_ID)); printf("Product_ID '%.16s'\n", (char *)&meta->cdr->Product_ID[0]); - printf("**** Physical Disk Data ****\n"); + printf("**** Physical Disk Records ****\n"); printf("Populated_PDEs %u\n", GET16(meta, pdr->Populated_PDEs)); printf("Max_PDE_Supported %u\n", GET16(meta, pdr->Max_PDE_Supported)); for (j = 0; j < GET16(meta, pdr->Populated_PDEs); j++) { @@ -276,7 +288,7 @@ g_raid_md_ddf_print(struct ddf_meta *met printf("Block_Size %u\n", GET16(meta, pdr->entry[j].Block_Size)); } - printf("**** Virtual Disk Data ****\n"); + printf("**** Virtual Disk Records ****\n"); printf("Populated_VDEs %u\n", GET16(meta, vdr->Populated_VDEs)); printf("Max_VDE_Supported %u\n", GET16(meta, vdr->Max_VDE_Supported)); for (j = 0; j < GET16(meta, vdr->Populated_VDEs); j++) { @@ -287,8 +299,8 @@ g_raid_md_ddf_print(struct ddf_meta *met printf("\n"); printf("VD_Number 0x%04x\n", GET16(meta, vdr->entry[j].VD_Number)); - printf("VD_Type 0x%02x\n", - GET8(meta, vdr->entry[j].VD_Type)); + printf("VD_Type 0x%04x\n", + GET16(meta, vdr->entry[j].VD_Type)); printf("VD_State 0x%02x\n", GET8(meta, vdr->entry[j].VD_State)); printf("Init_State 0x%02x\n", @@ -299,11 +311,9 @@ g_raid_md_ddf_print(struct ddf_meta *met (char *)&meta->vdr->entry[j].VD_Name); } printf("**** Configuration Records ****\n"); - num = GET32(meta, hdr->cr_length) / GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (j = 0; j < num; j++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - j * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, j); val = GET32D(meta, vdc->Signature); switch (val) { case DDF_VDCR_SIGNATURE: @@ -391,6 +401,7 @@ g_raid_md_ddf_print(struct ddf_meta *met GET16D(meta, sa->entry[i].Secondary_Element)); } break; + case 0x00000000: case 0xFFFFFFFF: break; default: @@ -463,17 +474,16 @@ ddf_meta_find_vdc(struct ddf_meta *meta, struct ddf_vdc_record *vdc; int i, num; - num = GET32(meta, hdr->cr_length) / GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - i * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, i); if (GUID != NULL) { if (GET32D(meta, vdc->Signature) == DDF_VDCR_SIGNATURE && memcmp(vdc->VD_GUID, GUID, 24) == 0) return (vdc); } else - if (GET32D(meta, vdc->Signature) == 0xffffffff) + if (GET32D(meta, vdc->Signature) == 0xffffffff || + GET32D(meta, vdc->Signature) == 0) return (vdc); } return (NULL); @@ -486,11 +496,9 @@ ddf_meta_count_vdc(struct ddf_meta *meta int i, num, cnt; cnt = 0; - num = GET32(meta, hdr->cr_length) / GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - i * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, i); if (GET32D(meta, vdc->Signature) != DDF_VDCR_SIGNATURE) continue; if (GUID == NULL || memcmp(vdc->VD_GUID, GUID, 24) == 0) @@ -526,12 +534,36 @@ ddf_meta_find_disk(struct ddf_vol_meta * return (-1); } +static struct ddf_sa_record * +ddf_meta_find_sa(struct ddf_meta *meta, int create) +{ + struct ddf_sa_record *sa; + int i, num; + + num = GETCRNUM(meta); + for (i = 0; i < num; i++) { + sa = GETSAPTR(meta, i); + if (GET32D(meta, sa->Signature) == DDF_SA_SIGNATURE) + return (sa); + } + if (create) { + for (i = 0; i < num; i++) { + sa = GETSAPTR(meta, i); + if (GET32D(meta, sa->Signature) == 0xffffffff || + GET32D(meta, sa->Signature) == 0) + return (sa); + } + } + return (NULL); +} + static void ddf_meta_create(struct g_raid_disk *disk, struct ddf_meta *sample) { struct timespec ts; struct clocktime ct; struct g_raid_md_ddf_perdisk *pd; + struct g_raid_md_ddf_object *mdi; struct ddf_meta *meta; struct ddf_pd_entry *pde; off_t anchorlba; @@ -542,13 +574,14 @@ ddf_meta_create(struct g_raid_disk *disk if (sample->hdr == NULL) sample = NULL; + mdi = (struct g_raid_md_ddf_object *)disk->d_softc->sc_md; pd = (struct g_raid_md_ddf_perdisk *)disk->d_md_data; meta = &pd->pd_meta; ss = disk->d_consumer->provider->sectorsize; anchorlba = disk->d_consumer->provider->mediasize / ss - 1; meta->sectorsize = ss; - meta->bigendian = sample ? sample->bigendian : 0; + meta->bigendian = sample ? sample->bigendian : mdi->mdio_bigendian; getnanotime(&ts); clock_ts_to_ct(&ts, &ct); @@ -642,9 +675,9 @@ ddf_meta_create(struct g_raid_disk *disk pos += GET32(meta, hdr->Diagnostic_Space_Length); SET32(meta, hdr->Vendor_Specific_Logs, GET32(meta, hdr->Vendor_Specific_Logs_Length) != 0 ? pos : 0xffffffff); - pos += GET32(meta, hdr->Vendor_Specific_Logs_Length); + pos += min(GET32(meta, hdr->Vendor_Specific_Logs_Length), 1); SET64(meta, hdr->Primary_Header_LBA, - anchorlba - pos - 16); + anchorlba - pos); SET64(meta, hdr->Secondary_Header_LBA, 0xffffffffffffffffULL); SET64(meta, hdr->WorkSpace_LBA, @@ -756,7 +789,7 @@ ddf_meta_update(struct ddf_meta *meta, s if (isff(spde->PD_GUID, 24)) continue; j = ddf_meta_find_pd(meta, NULL, - src->pdr->entry[i].PD_Reference); + GET32(src, pdr->entry[i].PD_Reference)); if (j < 0) { j = ddf_meta_find_pd(meta, NULL, 0xffffffff); pde = &meta->pdr->entry[j]; @@ -835,7 +868,8 @@ ddf_vol_meta_create(struct ddf_vol_meta } static void -ddf_vol_meta_update(struct ddf_vol_meta *dst, struct ddf_meta *src, uint8_t *GUID) +ddf_vol_meta_update(struct ddf_vol_meta *dst, struct ddf_meta *src, + uint8_t *GUID, int started) { struct ddf_header *hdr; struct ddf_vd_entry *vde; @@ -850,15 +884,15 @@ ddf_vol_meta_update(struct ddf_vol_meta size = GET16(src, hdr->Configuration_Record_Length) * src->sectorsize; if (dst->vdc == NULL || - ((int32_t)(GET32D(src, vdc->Sequence_Number) - - GET32(dst, vdc->Sequence_Number))) > 0) + (!started && ((int32_t)(GET32D(src, vdc->Sequence_Number) - + GET32(dst, vdc->Sequence_Number))) > 0)) vnew = 1; else vnew = 0; if (dst->bvdc[bvd] == NULL || - ((int32_t)(GET32D(src, vdc->Sequence_Number) - - GET32(dst, bvdc[bvd]->Sequence_Number))) > 0) + (!started && ((int32_t)(GET32D(src, vdc->Sequence_Number) - + GET32(dst, bvdc[bvd]->Sequence_Number))) > 0)) bvnew = 1; else bvnew = 0; @@ -936,12 +970,9 @@ ddf_meta_unused_range(struct ddf_meta *m beg[0] = 0; end[0] = GET64(meta, pdr->entry[pos].Configured_Size); n = 1; - num = GET32(meta, hdr->cr_length) / - GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - i * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, i); if (GET32D(meta, vdc->Signature) != DDF_VDCR_SIGNATURE) continue; for (pos = 0; pos < GET16D(meta, vdc->Primary_Element_Count); pos++) @@ -1197,7 +1228,7 @@ hdrerror: } done: - free(abuf, M_MD_DDF); + g_free(abuf); if (error != 0) ddf_meta_free(meta); return (error); @@ -1260,11 +1291,10 @@ err: if (error != 0) goto err; - size = GET16(meta, hdr->Configuration_Record_Length); - num = GET32(meta, hdr->cr_length) / size; - size *= ss; + size = GET16(meta, hdr->Configuration_Record_Length) * ss; + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + i * size); + vdc = GETVDCPTR(meta, i); SET32D(meta, vdc->CRC, 0xffffffff); SET32D(meta, vdc->CRC, crc32(vdc, size)); } @@ -1320,29 +1350,6 @@ ddf_meta_erase(struct g_consumer *cp) return (error); } -#if 0 -static int -ddf_meta_write_spare(struct g_consumer *cp) -{ - struct ddf_header *meta; - int error; - - meta = malloc(sizeof(*meta), M_MD_DDF, M_WAITOK | M_ZERO); - memcpy(&meta->ddf_id[0], DDF_MAGIC, sizeof(DDF_MAGIC) - 1); - meta->dummy_0 = 0x00020000; - meta->integrity = DDF_I_VALID; - meta->disk.flags = DDF_F_SPARE | DDF_F_ONLINE | DDF_F_VALID; - meta->disk.number = 0xff; - arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_sectors = cp->provider->mediasize / cp->provider->sectorsize; - meta->disk_sectors -= 131072; - meta->rebuild_lba = UINT32_MAX; - error = ddf_meta_write(cp, &meta, 1); - free(meta, M_MD_DDF); - return (error); -} -#endif - static struct g_raid_volume * g_raid_md_ddf_get_volume(struct g_raid_softc *sc, uint8_t *GUID) { @@ -1510,16 +1517,14 @@ g_raid_md_ddf_supported(int level, int q qual != G_RAID_VOLUME_RLQ_RMDFLA && qual != G_RAID_VOLUME_RLQ_RMDFLS) return (0); - if (disks < 5) + if (disks < 4) return (0); break; case G_RAID_VOLUME_RL_RAID1E: if (qual != G_RAID_VOLUME_RLQ_R1EA && qual != G_RAID_VOLUME_RLQ_R1EO) return (0); - if (disks < 2) - return (0); - if (disks % 2 != 0) + if (disks < 3) return (0); break; case G_RAID_VOLUME_RL_SINGLE: @@ -1578,6 +1583,7 @@ g_raid_md_ddf_start_disk(struct g_raid_d struct ddf_vol_meta *vmeta; struct ddf_meta *pdmeta, *gmeta; struct ddf_vdc_record *vdc1; + struct ddf_sa_record *sa; off_t size, eoff = 0, esize = 0; uint64_t *val2; int disk_pos, md_disk_bvd = -1, md_disk_pos = -1, md_pde_pos; @@ -1600,7 +1606,8 @@ g_raid_md_ddf_start_disk(struct g_raid_d md_pde_pos = ddf_meta_find_pd(gmeta, NULL, reference); if (disk_pos < 0) { - G_RAID_DEBUG1(1, sc, "Disk %s is not part of the volume %s", + G_RAID_DEBUG1(1, sc, + "Disk %s is not a present part of the volume %s", g_raid_get_diskname(disk), vol->v_name); /* Failed stale disk is useless for us. */ @@ -1610,10 +1617,8 @@ g_raid_md_ddf_start_disk(struct g_raid_d } /* If disk has some metadata for this volume - erase. */ - if (pdmeta->cr != NULL && - (vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) { + if ((vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) SET32D(pdmeta, vdc1->Signature, 0xffffffff); - } /* If we are in the start process, that's all for now. */ if (!pv->pv_started) @@ -1634,6 +1639,8 @@ g_raid_md_ddf_start_disk(struct g_raid_d g_raid_get_diskname(disk)); goto nofit; } + eoff *= pd->pd_meta.sectorsize; + esize *= pd->pd_meta.sectorsize; size = INT64_MAX; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; @@ -1646,26 +1653,41 @@ g_raid_md_ddf_start_disk(struct g_raid_d } if (disk_pos >= 0 && vol->v_raid_level != G_RAID_VOLUME_RL_CONCAT && - (off_t)esize * 512 < size) { + esize < size) { G_RAID_DEBUG1(1, sc, "Disk %s free space " "is too small (%ju < %ju)", - g_raid_get_diskname(disk), - (off_t)esize * 512, size); + g_raid_get_diskname(disk), esize, size); disk_pos = -1; } if (disk_pos >= 0) { if (vol->v_raid_level != G_RAID_VOLUME_RL_CONCAT) - esize = size / 512; + esize = size; md_disk_bvd = disk_pos / GET16(vmeta, vdc->Primary_Element_Count); // XXX md_disk_pos = disk_pos % GET16(vmeta, vdc->Primary_Element_Count); // XXX } else { nofit: - if (ddf_meta_count_vdc(&pd->pd_meta, NULL) == 0) { + if (disk->d_state == G_RAID_DISK_S_NONE) g_raid_change_disk_state(disk, - G_RAID_DISK_S_SPARE); - } + G_RAID_DISK_S_STALE); return (0); } + + /* + * If spare is committable, delete spare record. + * Othersize, mark it active and leave there. + */ + sa = ddf_meta_find_sa(&pd->pd_meta, 0); + if (sa != NULL) { + if ((GET8D(&pd->pd_meta, sa->Spare_Type) & + DDF_SAR_TYPE_REVERTIBLE) == 0) { + SET32D(&pd->pd_meta, sa->Signature, 0xffffffff); + } else { + SET8D(&pd->pd_meta, sa->Spare_Type, + GET8D(&pd->pd_meta, sa->Spare_Type) | + DDF_SAR_TYPE_ACTIVE); + } + } + G_RAID_DEBUG1(1, sc, "Disk %s takes pos %d in the volume %s", g_raid_get_diskname(disk), disk_pos, vol->v_name); resurrection = 1; @@ -1691,8 +1713,8 @@ nofit: g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); if (resurrection) { - sd->sd_offset = (off_t)eoff * 512; - sd->sd_size = (off_t)esize * 512; + sd->sd_offset = eoff; + sd->sd_size = esize; } else if (pdmeta->cr != NULL && (vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) { val2 = (uint64_t *)&(vdc1->Physical_Disk_Sequence[GET16(vmeta, hdr->Max_Primary_Element_Entries)]); @@ -1802,7 +1824,9 @@ g_raid_md_ddf_start(struct g_raid_volume struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_object *md; + struct g_raid_md_ddf_perdisk *pd; struct g_raid_md_ddf_pervolume *pv; + struct g_raid_md_ddf_object *mdi; struct ddf_vol_meta *vmeta; struct ddf_vdc_record *vdc; uint64_t *val2; @@ -1810,6 +1834,7 @@ g_raid_md_ddf_start(struct g_raid_volume sc = vol->v_softc; md = sc->sc_md; + mdi = (struct g_raid_md_ddf_object *)md; pv = vol->v_md_data; vmeta = &pv->pv_meta; vdc = vmeta->vdc; @@ -1826,6 +1851,13 @@ g_raid_md_ddf_start(struct g_raid_volume vol->v_strip_size = vol->v_sectorsize << GET8(vmeta, vdc->Stripe_Size); vol->v_disks_count = GET16(vmeta, vdc->Primary_Element_Count) * GET8(vmeta, vdc->Secondary_Element_Count); + vol->v_mdf_pdisks = GET8(vmeta, vdc->MDF_Parity_Disks); + vol->v_mdf_polynomial = GET16(vmeta, vdc->MDF_Parity_Generator_Polynomial); + vol->v_mdf_method = GET8(vmeta, vdc->MDF_Constant_Generation_Method); + if (GET8(vmeta, vdc->Rotate_Parity_count) > 31) + vol->v_rotate_parity = 1; + else + vol->v_rotate_parity = 1 << GET8(vmeta, vdc->Rotate_Parity_count); vol->v_mediasize = GET64(vmeta, vdc->VD_Size) * vol->v_sectorsize; for (i = 0, j = 0, bvd = 0; i < vol->v_disks_count; i++, j++) { if (j == GET16(vmeta, vdc->Primary_Element_Count)) { @@ -1848,20 +1880,14 @@ g_raid_md_ddf_start(struct g_raid_volume g_raid_start_volume(vol); /* Make all disks found till the moment take their places. */ - for (i = 0, j = 0, bvd = 0; i < vol->v_disks_count; i++, j++) { - if (j == GET16(vmeta, vdc->Primary_Element_Count)) { - j = 0; - bvd++; - } - if (vmeta->bvdc[bvd] == NULL) - continue; - disk = g_raid_md_ddf_get_disk(sc, NULL, - GET32(vmeta, bvdc[bvd]->Physical_Disk_Sequence[j])); - if (disk != NULL) + TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { + pd = (struct g_raid_md_ddf_perdisk *)disk->d_md_data; + if (ddf_meta_find_vdc(&pd->pd_meta, vmeta->vdc->VD_GUID) != NULL) g_raid_md_ddf_start_disk(disk, vol); } pv->pv_started = 1; + mdi->mdio_starting--; callout_stop(&pv->pv_start_co); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 24 02:36:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35C7B106566B; Thu, 24 May 2012 02:36:59 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id D689A8FC08; Thu, 24 May 2012 02:36:58 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so11586620pbb.13 for ; Wed, 23 May 2012 19:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=w5+P739jRAHdRWQSBhAA8yA+LnM7KAFplmgnJxjnLc4=; b=T/mYDfiZ2+BigqLTDr66ejuvKkXl5SIRvs4uJG4+UVq8Ep7d7GLjU+FA0e+269be37 zD5DUx4Iwn31ItE0Xt1iWy9+lyoT4Op5h11z2W1ctaIfsC9nY68awsJ7mXpvNnHkqGJU W8yuUWGk5O25kk3OzDBjLVtaQTjEubLRTgdaM/ldDlQdk/W1hEtHxaLIdQ5UaDKFJkVl ZkA6fOY37BPZgdaIwd9QiUSqPoT8d6vZfEOWJNwo+0gfUH+kRXLSzLnYlveBTIA3FoVQ 8/2778mUj5ZKlPrah0m+dbkoUcl9JJ20GegtfrkDeYFPycTJoeelkVhDc8G/rfKOPB80 +Oyg== Received: by 10.68.132.166 with SMTP id ov6mr16943603pbb.24.1337827018396; Wed, 23 May 2012 19:36:58 -0700 (PDT) Received: from pyunyh@gmail.com ([114.111.62.249]) by mx.google.com with ESMTPS id ku7sm3811505pbc.31.2012.05.23.19.36.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 May 2012 19:36:57 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 24 May 2012 11:36:49 -0700 From: YongHyeon PYUN Date: Thu, 24 May 2012 11:36:49 -0700 To: Adrian Chadd Message-ID: <20120524183649.GA14593@michelle.cdnetworks.com> References: <201205230202.q4N22UDA041838@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r235818 - stable/9/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 02:36:59 -0000 On Wed, May 23, 2012 at 10:55:18AM -0700, Adrian Chadd wrote: > Hi, > > Have you looked at the MDIO bus support that I brought in from Stefan? > > This almost feels like a poster child for that - you'd write an MDIO > bus driver for this particular mailbox hardware interface and modify > the driver to use that, then the MDIO bus will automatically probe > whatever PHYs exist there > I'm not familiar with that code but I don't want to write another driver just to access a couple of mailbox registers. > That way it could be reused for other MDIO bus consumers too, such as > switch PHYs and other MDIO-but-not-quite-PHY devices. Not sure how well it fits to brgphy(4). > > Adrian > > On 22 May 2012 19:02, Pyun YongHyeon wrote: > > Author: yongari > > Date: Wed May 23 02:02:29 2012 > > New Revision: 235818 > > URL: http://svn.freebsd.org/changeset/base/235818 > > > > Log: > > ?MFC r235151: > > ? ?Implement basic remote PHY support. Remote PHY allows the > > ? ?controller to perform MDIO type accesses to a remote transceiver > > ? ?using message pages defined through MRBE(multirate backplane > > ? ?ethernet). ?It's used in blade systems(e.g Dell Blade m610) which > > ? ?are connected to pass-through blades rather than traditional > > ? ?switches. > > ? ?This change directly manipulates firmware's mailboxes to control > > ? ?remote PHY such that it does not use mii(4). ?Alternatively, as > > ? ?David said, it could be implemented in brgphy(4) by creating a fake > > ? ?PHY and let brgphy(4) do necessary mii accesses and bce(4) can > > ? ?implement mailbox accesses based on the type of brgphy(4)'s mii > > ? ?accesses. Personally, I think it would make brgphy(4) hard to > > ? ?maintain since it would have to access many bce(4) registers in > > ? ?brgphy(4). Given that there are users who are suffering from lack > > ? ?of remote PHY support, it would be better to get working system > > ? ?rather than waiting for complete/perfect implementation. > > > > Modified: > > ?stable/9/sys/dev/bce/if_bce.c > > ?stable/9/sys/dev/bce/if_bcereg.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/dev/ ? (props changed) > > ?stable/9/sys/dev/e1000/ ? (props changed) > > ?stable/9/sys/dev/ixgbe/ ? (props changed) > > ?stable/9/sys/fs/ ? (props changed) > > ?stable/9/sys/fs/ntfs/ ? (props changed) > > ?stable/9/sys/modules/ ? (props changed) > > > > Modified: stable/9/sys/dev/bce/if_bce.c > > ============================================================================== > > --- stable/9/sys/dev/bce/if_bce.c ? ? ? Wed May 23 01:49:50 2012 ? ? ? ?(r235817) > > +++ stable/9/sys/dev/bce/if_bce.c ? ? ? Wed May 23 02:02:29 2012 ? ? ? ?(r235818) > > @@ -364,6 +364,7 @@ static int ?bce_nvram_write ? ? ? ? (struct bce > > ?static void bce_get_rx_buffer_sizes(struct bce_softc *, int); > > ?static void bce_get_media ? ? ? ? ? ? ? ? ? ? ?(struct bce_softc *); > > ?static void bce_init_media ? ? ? ? ? ? ? ? ? ? (struct bce_softc *); > > +static u32 bce_get_rphy_link ? ? ? ? ? (struct bce_softc *); > > ?static void bce_dma_map_addr ? ? ? ? ? (void *, bus_dma_segment_t *, int, int); > > ?static int ?bce_dma_alloc ? ? ? ? ? ? ? ? ? ? ?(device_t); > > ?static void bce_dma_free ? ? ? ? ? ? ? ? ? ? ? (struct bce_softc *); > > @@ -372,6 +373,7 @@ static void bce_release_resources ? (struc > > ?/****************************************************************************/ > > ?/* BCE Firmware Synchronization and Load ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*/ > > ?/****************************************************************************/ > > +static void bce_fw_cap_init ? ? ? ? ? ? ? ? ? ?(struct bce_softc *); > > ?static int ?bce_fw_sync ? ? ? ? ? ? ? ? ? ? ? ?(struct bce_softc *, u32); > > ?static void bce_load_rv2p_fw ? ? ? ? ? (struct bce_softc *, u32 *, u32, u32); > > ?static void bce_load_cpu_fw ? ? ? ? ? ?(struct bce_softc *, > > @@ -418,6 +420,7 @@ static void bce_watchdog ? ? ? ? ? ? ? ? ? ?(struct bce_s > > ?static int ?bce_ifmedia_upd ? ? ? ? ? ?(struct ifnet *); > > ?static int ?bce_ifmedia_upd_locked ? ? (struct ifnet *); > > ?static void bce_ifmedia_sts ? ? ? ? ? ?(struct ifnet *, struct ifmediareq *); > > +static void bce_ifmedia_sts_rphy ? ? ? (struct bce_softc *, struct ifmediareq *); > > ?static void bce_init_locked ? ? ? ? ? ?(struct bce_softc *); > > ?static void bce_init ? ? ? ? ? ? ? ? ? ? ? ? ? (void *); > > ?static void bce_mgmt_init_locked ? ? ? (struct bce_softc *sc); > > @@ -757,6 +760,13 @@ bce_print_adapter_info(struct bce_softc > > ? ? ? ? ? ? ? ? ? ? ? ?printf("2.5G"); i++; > > ? ? ? ? ? ? ? ?} > > > > + ? ? ? ? ? ? ? if (sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) { > > + ? ? ? ? ? ? ? ? ? ? ? if (i > 0) printf("|"); > > + ? ? ? ? ? ? ? ? ? ? ? printf("Remote PHY(%s)", > > + ? ? ? ? ? ? ? ? ? ? ? ? ? sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG ? > > + ? ? ? ? ? ? ? ? ? ? ? ? ? "FIBER" : "TP"); i++; > > + ? ? ? ? ? ? ? } > > + > > ? ? ? ? ? ? ? ?if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { > > ? ? ? ? ? ? ? ? ? ? ? ?if (i > 0) printf("|"); > > ? ? ? ? ? ? ? ? ? ? ? ?printf("MFW); MFW (%s)\n", sc->bce_mfw_ver); > > @@ -1297,6 +1307,9 @@ bce_attach(device_t dev) > > ? ? ? ?if (val & BCE_PCICFG_MISC_STATUS_32BIT_DET) > > ? ? ? ? ? ? ? ?sc->bce_flags |= BCE_PCI_32BIT_FLAG; > > > > + ? ? ? /* Find the media type for the adapter. */ > > + ? ? ? bce_get_media(sc); > > + > > ? ? ? ?/* Reset controller and announce to bootcode that driver is present. */ > > ? ? ? ?if (bce_reset(sc, BCE_DRV_MSG_CODE_RESET)) { > > ? ? ? ? ? ? ? ?BCE_PRINTF("%s(%d): Controller reset failed!\n", > > @@ -1344,9 +1357,6 @@ bce_attach(device_t dev) > > ? ? ? ?/* Update statistics once every second. */ > > ? ? ? ?sc->bce_stats_ticks = 1000000 & 0xffff00; > > > > - ? ? ? /* Find the media type for the adapter. */ > > - ? ? ? bce_get_media(sc); > > - > > ? ? ? ?/* Store data needed by PHY driver for backplane applications */ > > ? ? ? ?sc->bce_shared_hw_cfg = bce_shmem_rd(sc, BCE_SHARED_HW_CFG_CONFIG); > > ? ? ? ?sc->bce_port_hw_cfg ? = bce_shmem_rd(sc, BCE_PORT_HW_CFG_CONFIG); > > @@ -1386,6 +1396,15 @@ bce_attach(device_t dev) > > ? ? ? ? ? ? ? ?ifp->if_capabilities = BCE_IF_CAPABILITIES; > > ? ? ? ?} > > > > +#if __FreeBSD_version >= 800505 > > + ? ? ? /* > > + ? ? ? ?* Introducing IFCAP_LINKSTATE didn't bump __FreeBSD_version > > + ? ? ? ?* so it's approximate value. > > + ? ? ? ?*/ > > + ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) > > + ? ? ? ? ? ? ? ifp->if_capabilities |= IFCAP_LINKSTATE; > > +#endif > > + > > ? ? ? ?ifp->if_capenable = ifp->if_capabilities; > > > > ? ? ? ?/* > > @@ -1409,14 +1428,52 @@ bce_attach(device_t dev) > > ? ? ? ?/* Handle any special PHY initialization for SerDes PHYs. */ > > ? ? ? ?bce_init_media(sc); > > > > - ? ? ? /* MII child bus by attaching the PHY. */ > > - ? ? ? rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, > > - ? ? ? ? ? bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, > > - ? ? ? ? ? MII_OFFSET_ANY, MIIF_DOPAUSE); > > - ? ? ? if (rc != 0) { > > - ? ? ? ? ? ? ? BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, > > - ? ? ? ? ? ? ? ? ? __LINE__); > > - ? ? ? ? ? ? ? goto bce_attach_fail; > > + ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { > > + ? ? ? ? ? ? ? ifmedia_init(&sc->bce_ifmedia, IFM_IMASK, bce_ifmedia_upd, > > + ? ? ? ? ? ? ? ? ? bce_ifmedia_sts); > > + ? ? ? ? ? ? ? /* > > + ? ? ? ? ? ? ? ?* We can't manually override remote PHY's link and assume > > + ? ? ? ? ? ? ? ?* PHY port configuration(Fiber or TP) is not changed after > > + ? ? ? ? ? ? ? ?* device attach. ?This may not be correct though. > > + ? ? ? ? ? ? ? ?*/ > > + ? ? ? ? ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) != 0) { > > + ? ? ? ? ? ? ? ? ? ? ? if (sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) { > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ifmedia_add(&sc->bce_ifmedia, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_ETHER | IFM_2500_SX, 0, NULL); > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ifmedia_add(&sc->bce_ifmedia, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_ETHER | IFM_2500_SX | IFM_FDX, 0, NULL); > > + ? ? ? ? ? ? ? ? ? ? ? } > > + ? ? ? ? ? ? ? ? ? ? ? ifmedia_add(&sc->bce_ifmedia, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_ETHER | IFM_1000_SX, 0, NULL); > > + ? ? ? ? ? ? ? ? ? ? ? ifmedia_add(&sc->bce_ifmedia, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_ETHER | IFM_1000_SX | IFM_FDX, 0, NULL); > > + ? ? ? ? ? ? ? } else { > > + ? ? ? ? ? ? ? ? ? ? ? ifmedia_add(&sc->bce_ifmedia, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_ETHER | IFM_10_T, 0, NULL); > > + ? ? ? ? ? ? ? ? ? ? ? ifmedia_add(&sc->bce_ifmedia, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); > > + ? ? ? ? ? ? ? ? ? ? ? ifmedia_add(&sc->bce_ifmedia, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_ETHER | IFM_100_TX, 0, NULL); > > + ? ? ? ? ? ? ? ? ? ? ? ifmedia_add(&sc->bce_ifmedia, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); > > + ? ? ? ? ? ? ? ? ? ? ? ifmedia_add(&sc->bce_ifmedia, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_ETHER | IFM_1000_T, 0, NULL); > > + ? ? ? ? ? ? ? ? ? ? ? ifmedia_add(&sc->bce_ifmedia, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); > > + ? ? ? ? ? ? ? } > > + ? ? ? ? ? ? ? ifmedia_add(&sc->bce_ifmedia, IFM_ETHER | IFM_AUTO, 0, NULL); > > + ? ? ? ? ? ? ? ifmedia_set(&sc->bce_ifmedia, IFM_ETHER | IFM_AUTO); > > + ? ? ? ? ? ? ? sc->bce_ifmedia.ifm_media = sc->bce_ifmedia.ifm_cur->ifm_media; > > + ? ? ? } else { > > + ? ? ? ? ? ? ? /* MII child bus by attaching the PHY. */ > > + ? ? ? ? ? ? ? rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, > > + ? ? ? ? ? ? ? ? ? bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, > > + ? ? ? ? ? ? ? ? ? MII_OFFSET_ANY, MIIF_DOPAUSE); > > + ? ? ? ? ? ? ? if (rc != 0) { > > + ? ? ? ? ? ? ? ? ? ? ? BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? __LINE__); > > + ? ? ? ? ? ? ? ? ? ? ? goto bce_attach_fail; > > + ? ? ? ? ? ? ? } > > ? ? ? ?} > > > > ? ? ? ?/* Attach to the Ethernet interface list. */ > > @@ -1521,8 +1578,12 @@ bce_detach(device_t dev) > > ? ? ? ?ether_ifdetach(ifp); > > > > ? ? ? ?/* If we have a child device on the MII bus remove it too. */ > > - ? ? ? bus_generic_detach(dev); > > - ? ? ? device_delete_child(dev, sc->bce_miibus); > > + ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) > > + ? ? ? ? ? ? ? ifmedia_removeall(&sc->bce_ifmedia); > > + ? ? ? else { > > + ? ? ? ? ? ? ? bus_generic_detach(dev); > > + ? ? ? ? ? ? ? device_delete_child(dev, sc->bce_miibus); > > + ? ? ? } > > > > ? ? ? ?/* Release all remaining resources. */ > > ? ? ? ?bce_release_resources(sc); > > @@ -1983,13 +2044,23 @@ bce_miibus_statchg(device_t dev) > > ?{ > > ? ? ? ?struct bce_softc *sc; > > ? ? ? ?struct mii_data *mii; > > - ? ? ? int val; > > + ? ? ? struct ifmediareq ifmr; > > + ? ? ? int media_active, media_status, val; > > > > ? ? ? ?sc = device_get_softc(dev); > > > > ? ? ? ?DBENTER(BCE_VERBOSE_PHY); > > > > - ? ? ? mii = device_get_softc(sc->bce_miibus); > > + ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { > > + ? ? ? ? ? ? ? bzero(&ifmr, sizeof(ifmr)); > > + ? ? ? ? ? ? ? bce_ifmedia_sts_rphy(sc, &ifmr); > > + ? ? ? ? ? ? ? media_active = ifmr.ifm_active; > > + ? ? ? ? ? ? ? media_status = ifmr.ifm_status; > > + ? ? ? } else { > > + ? ? ? ? ? ? ? mii = device_get_softc(sc->bce_miibus); > > + ? ? ? ? ? ? ? media_active = mii->mii_media_active; > > + ? ? ? ? ? ? ? media_status = mii->mii_media_status; > > + ? ? ? } > > > > ? ? ? ?val = REG_RD(sc, BCE_EMAC_MODE); > > ? ? ? ?val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX | > > @@ -1997,7 +2068,7 @@ bce_miibus_statchg(device_t dev) > > ? ? ? ? ? ?BCE_EMAC_MODE_25G); > > > > ? ? ? ?/* Set MII or GMII interface based on the PHY speed. */ > > - ? ? ? switch (IFM_SUBTYPE(mii->mii_media_active)) { > > + ? ? ? switch (IFM_SUBTYPE(media_active)) { > > ? ? ? ?case IFM_10_T: > > ? ? ? ? ? ? ? ?if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { > > ? ? ? ? ? ? ? ? ? ? ? ?DBPRINT(sc, BCE_INFO_PHY, > > @@ -2026,7 +2097,7 @@ bce_miibus_statchg(device_t dev) > > ? ? ? ?} > > > > ? ? ? ?/* Set half or full duplex based on PHY settings. */ > > - ? ? ? if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) { > > + ? ? ? if ((IFM_OPTIONS(media_active) & IFM_FDX) == 0) { > > ? ? ? ? ? ? ? ?DBPRINT(sc, BCE_INFO_PHY, > > ? ? ? ? ? ? ? ? ? ?"Setting Half-Duplex interface.\n"); > > ? ? ? ? ? ? ? ?val |= BCE_EMAC_MODE_HALF_DUPLEX; > > @@ -2036,7 +2107,7 @@ bce_miibus_statchg(device_t dev) > > > > ? ? ? ?REG_WR(sc, BCE_EMAC_MODE, val); > > > > - ? ? ? if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { > > + ? ? ? if ((IFM_OPTIONS(media_active) & IFM_ETH_RXPAUSE) != 0) { > > ? ? ? ? ? ? ? ?DBPRINT(sc, BCE_INFO_PHY, > > ? ? ? ? ? ? ? ? ? ?"%s(): Enabling RX flow control.\n", __FUNCTION__); > > ? ? ? ? ? ? ? ?BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); > > @@ -2046,7 +2117,7 @@ bce_miibus_statchg(device_t dev) > > ? ? ? ? ? ? ? ?BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); > > ? ? ? ?} > > > > - ? ? ? if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { > > + ? ? ? if ((IFM_OPTIONS(media_active) & IFM_ETH_TXPAUSE) != 0) { > > ? ? ? ? ? ? ? ?DBPRINT(sc, BCE_INFO_PHY, > > ? ? ? ? ? ? ? ? ? ?"%s(): Enabling TX flow control.\n", __FUNCTION__); > > ? ? ? ? ? ? ? ?BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); > > @@ -3130,7 +3201,8 @@ bce_get_media_exit: > > ?static void > > ?bce_init_media(struct bce_softc *sc) > > ?{ > > - ? ? ? if ((sc->bce_phy_flags & BCE_PHY_IEEE_CLAUSE_45_FLAG) != 0) { > > + ? ? ? if ((sc->bce_phy_flags & (BCE_PHY_IEEE_CLAUSE_45_FLAG | > > + ? ? ? ? ? BCE_PHY_REMOTE_CAP_FLAG)) == BCE_PHY_IEEE_CLAUSE_45_FLAG) { > > ? ? ? ? ? ? ? ?/* > > ? ? ? ? ? ? ? ? * Configure 5709S/5716S PHYs to use traditional IEEE > > ? ? ? ? ? ? ? ? * Clause 22 method. Otherwise we have no way to attach > > @@ -5018,6 +5090,8 @@ bce_reset(struct bce_softc *sc, u32 rese > > ? ? ? ?if (rc) > > ? ? ? ? ? ? ? ?BCE_PRINTF("%s(%d): Firmware did not complete " > > ? ? ? ? ? ? ? ? ? ?"initialization!\n", __FILE__, __LINE__); > > + ? ? ? /* Get firmware capabilities. */ > > + ? ? ? bce_fw_cap_init(sc); > > > > ?bce_reset_exit: > > ? ? ? ?DBEXIT(BCE_VERBOSE_RESET); > > @@ -6081,6 +6155,55 @@ bce_free_pg_chain(struct bce_softc *sc) > > ?} > > > > > > +static u32 > > +bce_get_rphy_link(struct bce_softc *sc) > > +{ > > + ? ? ? u32 advertise, link; > > + ? ? ? int fdpx; > > + > > + ? ? ? advertise = 0; > > + ? ? ? fdpx = 0; > > + ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) != 0) > > + ? ? ? ? ? ? ? link = bce_shmem_rd(sc, BCE_RPHY_SERDES_LINK); > > + ? ? ? else > > + ? ? ? ? ? ? ? link = bce_shmem_rd(sc, BCE_RPHY_COPPER_LINK); > > + ? ? ? if (link & BCE_NETLINK_ANEG_ENB) > > + ? ? ? ? ? ? ? advertise |= BCE_NETLINK_ANEG_ENB; > > + ? ? ? if (link & BCE_NETLINK_SPEED_10HALF) > > + ? ? ? ? ? ? ? advertise |= BCE_NETLINK_SPEED_10HALF; > > + ? ? ? if (link & BCE_NETLINK_SPEED_10FULL) { > > + ? ? ? ? ? ? ? advertise |= BCE_NETLINK_SPEED_10FULL; > > + ? ? ? ? ? ? ? fdpx++; > > + ? ? ? } > > + ? ? ? if (link & BCE_NETLINK_SPEED_100HALF) > > + ? ? ? ? ? ? ? advertise |= BCE_NETLINK_SPEED_100HALF; > > + ? ? ? if (link & BCE_NETLINK_SPEED_100FULL) { > > + ? ? ? ? ? ? ? advertise |= BCE_NETLINK_SPEED_100FULL; > > + ? ? ? ? ? ? ? fdpx++; > > + ? ? ? } > > + ? ? ? if (link & BCE_NETLINK_SPEED_1000HALF) > > + ? ? ? ? ? ? ? advertise |= BCE_NETLINK_SPEED_1000HALF; > > + ? ? ? if (link & BCE_NETLINK_SPEED_1000FULL) { > > + ? ? ? ? ? ? ? advertise |= BCE_NETLINK_SPEED_1000FULL; > > + ? ? ? ? ? ? ? fdpx++; > > + ? ? ? } > > + ? ? ? if (link & BCE_NETLINK_SPEED_2500HALF) > > + ? ? ? ? ? ? ? advertise |= BCE_NETLINK_SPEED_2500HALF; > > + ? ? ? if (link & BCE_NETLINK_SPEED_2500FULL) { > > + ? ? ? ? ? ? ? advertise |= BCE_NETLINK_SPEED_2500FULL; > > + ? ? ? ? ? ? ? fdpx++; > > + ? ? ? } > > + ? ? ? if (fdpx) > > + ? ? ? ? ? ? ? advertise |= BCE_NETLINK_FC_PAUSE_SYM | > > + ? ? ? ? ? ? ? ? ? BCE_NETLINK_FC_PAUSE_ASYM; > > + ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) > > + ? ? ? ? ? ? ? advertise |= BCE_NETLINK_PHY_APP_REMOTE | > > + ? ? ? ? ? ? ? ? ? BCE_NETLINK_ETH_AT_WIRESPEED; > > + > > + ? ? ? return (advertise); > > +} > > + > > + > > ?/****************************************************************************/ > > ?/* Set media options. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? */ > > ?/* ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*/ > > @@ -6116,21 +6239,110 @@ bce_ifmedia_upd_locked(struct ifnet *ifp > > ? ? ? ?struct bce_softc *sc = ifp->if_softc; > > ? ? ? ?struct mii_data *mii; > > ? ? ? ?struct mii_softc *miisc; > > - ? ? ? int error; > > + ? ? ? struct ifmedia *ifm; > > + ? ? ? u32 link; > > + ? ? ? int error, fdx; > > > > ? ? ? ?DBENTER(BCE_VERBOSE_PHY); > > > > ? ? ? ?error = 0; > > ? ? ? ?BCE_LOCK_ASSERT(sc); > > > > - ? ? ? mii = device_get_softc(sc->bce_miibus); > > + ? ? ? sc->bce_link_up = FALSE; > > + ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { > > + ? ? ? ? ? ? ? ifm = &sc->bce_ifmedia; > > + ? ? ? ? ? ? ? if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) > > + ? ? ? ? ? ? ? ? ? ? ? return (EINVAL); > > + ? ? ? ? ? ? ? link = 0; > > + ? ? ? ? ? ? ? fdx = IFM_OPTIONS(ifm->ifm_media) & IFM_FDX; > > + ? ? ? ? ? ? ? switch(IFM_SUBTYPE(ifm->ifm_media)) { > > + ? ? ? ? ? ? ? case IFM_AUTO: > > + ? ? ? ? ? ? ? ? ? ? ? /* > > + ? ? ? ? ? ? ? ? ? ? ? ?* Check advertised link of remote PHY by reading > > + ? ? ? ? ? ? ? ? ? ? ? ?* BCE_RPHY_SERDES_LINK or BCE_RPHY_COPPER_LINK. > > + ? ? ? ? ? ? ? ? ? ? ? ?* Always use the same link type of remote PHY. > > + ? ? ? ? ? ? ? ? ? ? ? ?*/ > > + ? ? ? ? ? ? ? ? ? ? ? link = bce_get_rphy_link(sc); > > + ? ? ? ? ? ? ? ? ? ? ? break; > > + ? ? ? ? ? ? ? case IFM_2500_SX: > > + ? ? ? ? ? ? ? ? ? ? ? if ((sc->bce_phy_flags & > > + ? ? ? ? ? ? ? ? ? ? ? ? ? (BCE_PHY_REMOTE_PORT_FIBER_FLAG | > > + ? ? ? ? ? ? ? ? ? ? ? ? ? BCE_PHY_2_5G_CAPABLE_FLAG)) == 0) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return (EINVAL); > > + ? ? ? ? ? ? ? ? ? ? ? /* > > + ? ? ? ? ? ? ? ? ? ? ? ?* XXX > > + ? ? ? ? ? ? ? ? ? ? ? ?* Have to enable forced 2.5Gbps configuration. > > + ? ? ? ? ? ? ? ? ? ? ? ?*/ > > + ? ? ? ? ? ? ? ? ? ? ? if (fdx != 0) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link |= BCE_NETLINK_SPEED_2500FULL; > > + ? ? ? ? ? ? ? ? ? ? ? else > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link |= BCE_NETLINK_SPEED_2500HALF; > > + ? ? ? ? ? ? ? ? ? ? ? break; > > + ? ? ? ? ? ? ? case IFM_1000_SX: > > + ? ? ? ? ? ? ? ? ? ? ? if ((sc->bce_phy_flags & > > + ? ? ? ? ? ? ? ? ? ? ? ? ? BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return (EINVAL); > > + ? ? ? ? ? ? ? ? ? ? ? /* > > + ? ? ? ? ? ? ? ? ? ? ? ?* XXX > > + ? ? ? ? ? ? ? ? ? ? ? ?* Have to disable 2.5Gbps configuration. > > + ? ? ? ? ? ? ? ? ? ? ? ?*/ > > + ? ? ? ? ? ? ? ? ? ? ? if (fdx != 0) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link = BCE_NETLINK_SPEED_1000FULL; > > + ? ? ? ? ? ? ? ? ? ? ? else > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link = BCE_NETLINK_SPEED_1000HALF; > > + ? ? ? ? ? ? ? ? ? ? ? break; > > + ? ? ? ? ? ? ? case IFM_1000_T: > > + ? ? ? ? ? ? ? ? ? ? ? if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return (EINVAL); > > + ? ? ? ? ? ? ? ? ? ? ? if (fdx != 0) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link = BCE_NETLINK_SPEED_1000FULL; > > + ? ? ? ? ? ? ? ? ? ? ? else > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link = BCE_NETLINK_SPEED_1000HALF; > > + ? ? ? ? ? ? ? ? ? ? ? break; > > + ? ? ? ? ? ? ? case IFM_100_TX: > > + ? ? ? ? ? ? ? ? ? ? ? if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return (EINVAL); > > + ? ? ? ? ? ? ? ? ? ? ? if (fdx != 0) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link = BCE_NETLINK_SPEED_100FULL; > > + ? ? ? ? ? ? ? ? ? ? ? else > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link = BCE_NETLINK_SPEED_100HALF; > > + ? ? ? ? ? ? ? ? ? ? ? break; > > + ? ? ? ? ? ? ? case IFM_10_T: > > + ? ? ? ? ? ? ? ? ? ? ? if (sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return (EINVAL); > > + ? ? ? ? ? ? ? ? ? ? ? if (fdx != 0) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link = BCE_NETLINK_SPEED_10FULL; > > + ? ? ? ? ? ? ? ? ? ? ? else > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link = BCE_NETLINK_SPEED_10HALF; > > + ? ? ? ? ? ? ? ? ? ? ? break; > > + ? ? ? ? ? ? ? default: > > + ? ? ? ? ? ? ? ? ? ? ? return (EINVAL); > > + ? ? ? ? ? ? ? } > > + ? ? ? ? ? ? ? if (IFM_SUBTYPE(ifm->ifm_media) != IFM_AUTO) { > > + ? ? ? ? ? ? ? ? ? ? ? /* > > + ? ? ? ? ? ? ? ? ? ? ? ?* XXX > > + ? ? ? ? ? ? ? ? ? ? ? ?* Advertise pause capability for full-duplex media. > > + ? ? ? ? ? ? ? ? ? ? ? ?*/ > > + ? ? ? ? ? ? ? ? ? ? ? if (fdx != 0) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link |= BCE_NETLINK_FC_PAUSE_SYM | > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? BCE_NETLINK_FC_PAUSE_ASYM; > > + ? ? ? ? ? ? ? ? ? ? ? if ((sc->bce_phy_flags & > > + ? ? ? ? ? ? ? ? ? ? ? ? ? BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? link |= BCE_NETLINK_PHY_APP_REMOTE | > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? BCE_NETLINK_ETH_AT_WIRESPEED; > > + ? ? ? ? ? ? ? } > > > > - ? ? ? /* Make sure the MII bus has been enumerated. */ > > - ? ? ? if (mii) { > > - ? ? ? ? ? ? ? sc->bce_link_up = FALSE; > > - ? ? ? ? ? ? ? LIST_FOREACH(miisc, &mii->mii_phys, mii_list) > > - ? ? ? ? ? ? ? ? ? PHY_RESET(miisc); > > - ? ? ? ? ? ? ? error = mii_mediachg(mii); > > + ? ? ? ? ? ? ? bce_shmem_wr(sc, BCE_MB_ARGS_0, link); > > + ? ? ? ? ? ? ? error = bce_fw_sync(sc, BCE_DRV_MSG_CODE_CMD_SET_LINK); > > + ? ? ? } else { > > + ? ? ? ? ? ? ? mii = device_get_softc(sc->bce_miibus); > > + > > + ? ? ? ? ? ? ? /* Make sure the MII bus has been enumerated. */ > > + ? ? ? ? ? ? ? if (mii) { > > + ? ? ? ? ? ? ? ? ? ? ? LIST_FOREACH(miisc, &mii->mii_phys, mii_list) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PHY_RESET(miisc); > > + ? ? ? ? ? ? ? ? ? ? ? error = mii_mediachg(mii); > > + ? ? ? ? ? ? ? } > > ? ? ? ?} > > > > ? ? ? ?DBEXIT(BCE_VERBOSE_PHY); > > @@ -6138,6 +6350,85 @@ bce_ifmedia_upd_locked(struct ifnet *ifp > > ?} > > > > > > +static void > > +bce_ifmedia_sts_rphy(struct bce_softc *sc, struct ifmediareq *ifmr) > > +{ > > + ? ? ? struct ifnet *ifp; > > + ? ? ? u32 link; > > + > > + ? ? ? ifp = sc->bce_ifp; > > + ? ? ? BCE_LOCK_ASSERT(sc); > > + > > + ? ? ? ifmr->ifm_status = IFM_AVALID; > > + ? ? ? ifmr->ifm_active = IFM_ETHER; > > + ? ? ? link = bce_shmem_rd(sc, BCE_LINK_STATUS); > > + ? ? ? /* XXX Handle heart beat status? */ > > + ? ? ? if ((link & BCE_LINK_STATUS_LINK_UP) != 0) > > + ? ? ? ? ? ? ? ifmr->ifm_status |= IFM_ACTIVE; > > + ? ? ? else { > > + ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_NONE; > > + ? ? ? ? ? ? ? ifp->if_baudrate = 0; > > + ? ? ? ? ? ? ? return; > > + ? ? ? } > > + ? ? ? switch (link & BCE_LINK_STATUS_SPEED_MASK) { > > + ? ? ? case BCE_LINK_STATUS_10HALF: > > + ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_10_T | IFM_HDX; > > + ? ? ? ? ? ? ? ifp->if_baudrate = IF_Mbps(10UL); > > + ? ? ? ? ? ? ? break; > > + ? ? ? case BCE_LINK_STATUS_10FULL: > > + ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_10_T | IFM_FDX; > > + ? ? ? ? ? ? ? ifp->if_baudrate = IF_Mbps(10UL); > > + ? ? ? ? ? ? ? break; > > + ? ? ? case BCE_LINK_STATUS_100HALF: > > + ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_100_TX | IFM_HDX; > > + ? ? ? ? ? ? ? ifp->if_baudrate = IF_Mbps(100UL); > > + ? ? ? ? ? ? ? break; > > + ? ? ? case BCE_LINK_STATUS_100FULL: > > + ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_100_TX | IFM_FDX; > > + ? ? ? ? ? ? ? ifp->if_baudrate = IF_Mbps(100UL); > > + ? ? ? ? ? ? ? break; > > + ? ? ? case BCE_LINK_STATUS_1000HALF: > > + ? ? ? ? ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) > > + ? ? ? ? ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_1000_T | IFM_HDX; > > + ? ? ? ? ? ? ? else > > + ? ? ? ? ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_1000_SX | IFM_HDX; > > + ? ? ? ? ? ? ? ifp->if_baudrate = IF_Mbps(1000UL); > > + ? ? ? ? ? ? ? break; > > + ? ? ? case BCE_LINK_STATUS_1000FULL: > > + ? ? ? ? ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) > > + ? ? ? ? ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_1000_T | IFM_FDX; > > + ? ? ? ? ? ? ? else > > + ? ? ? ? ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_1000_SX | IFM_FDX; > > + ? ? ? ? ? ? ? ifp->if_baudrate = IF_Mbps(1000UL); > > + ? ? ? ? ? ? ? break; > > + ? ? ? case BCE_LINK_STATUS_2500HALF: > > + ? ? ? ? ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) { > > + ? ? ? ? ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_NONE; > > + ? ? ? ? ? ? ? ? ? ? ? return; > > + ? ? ? ? ? ? ? } else > > + ? ? ? ? ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_2500_SX | IFM_HDX; > > + ? ? ? ? ? ? ? ifp->if_baudrate = IF_Mbps(2500UL); > > + ? ? ? ? ? ? ? break; > > + ? ? ? case BCE_LINK_STATUS_2500FULL: > > + ? ? ? ? ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_PORT_FIBER_FLAG) == 0) { > > + ? ? ? ? ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_NONE; > > + ? ? ? ? ? ? ? ? ? ? ? return; > > + ? ? ? ? ? ? ? } else > > + ? ? ? ? ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_2500_SX | IFM_FDX; > > + ? ? ? ? ? ? ? ifp->if_baudrate = IF_Mbps(2500UL); > > + ? ? ? ? ? ? ? break; > > + ? ? ? default: > > + ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_NONE; > > + ? ? ? ? ? ? ? return; > > + ? ? ? } > > + > > + ? ? ? if ((link & BCE_LINK_STATUS_RX_FC_ENABLED) != 0) > > + ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_ETH_RXPAUSE; > > + ? ? ? if ((link & BCE_LINK_STATUS_TX_FC_ENABLED) != 0) > > + ? ? ? ? ? ? ? ifmr->ifm_active |= IFM_ETH_TXPAUSE; > > +} > > + > > + > > ?/****************************************************************************/ > > ?/* Reports current media status. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*/ > > ?/* ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*/ > > @@ -6158,11 +6449,15 @@ bce_ifmedia_sts(struct ifnet *ifp, struc > > ? ? ? ? ? ? ? ?BCE_UNLOCK(sc); > > ? ? ? ? ? ? ? ?return; > > ? ? ? ?} > > - ? ? ? mii = device_get_softc(sc->bce_miibus); > > > > - ? ? ? mii_pollstat(mii); > > - ? ? ? ifmr->ifm_active = mii->mii_media_active; > > - ? ? ? ifmr->ifm_status = mii->mii_media_status; > > + ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) > > + ? ? ? ? ? ? ? bce_ifmedia_sts_rphy(sc, ifmr); > > + ? ? ? else { > > + ? ? ? ? ? ? ? mii = device_get_softc(sc->bce_miibus); > > + ? ? ? ? ? ? ? mii_pollstat(mii); > > + ? ? ? ? ? ? ? ifmr->ifm_active = mii->mii_media_active; > > + ? ? ? ? ? ? ? ifmr->ifm_status = mii->mii_media_status; > > + ? ? ? } > > > > ? ? ? ?BCE_UNLOCK(sc); > > > > @@ -6199,14 +6494,26 @@ bce_phy_intr(struct bce_softc *sc) > > ? ? ? ? ? ? ? ? ? ? ? ? ? ?STATUS_ATTN_BITS_LINK_STATE); > > ? ? ? ? ? ? ? ? ? ? ? ?DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now UP.\n", > > ? ? ? ? ? ? ? ? ? ? ? ? ? ?__FUNCTION__); > > - ? ? ? ? ? ? ? } > > - ? ? ? ? ? ? ? else { > > + ? ? ? ? ? ? ? } else { > > ? ? ? ? ? ? ? ? ? ? ? ?REG_WR(sc, BCE_PCICFG_STATUS_BIT_CLEAR_CMD, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ?STATUS_ATTN_BITS_LINK_STATE); > > ? ? ? ? ? ? ? ? ? ? ? ?DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now DOWN.\n", > > ? ? ? ? ? ? ? ? ? ? ? ? ? ?__FUNCTION__); > > ? ? ? ? ? ? ? ?} > > > > + ? ? ? ? ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { > > + ? ? ? ? ? ? ? ? ? ? ? if (new_link_state) { > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (bootverbose) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if_printf(sc->bce_ifp, "link UP\n"); > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if_link_state_change(sc->bce_ifp, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? LINK_STATE_UP); > > + ? ? ? ? ? ? ? ? ? ? ? } else { > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (bootverbose) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if_printf(sc->bce_ifp, "link DOWN\n"); > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if_link_state_change(sc->bce_ifp, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? LINK_STATE_DOWN); > > + ? ? ? ? ? ? ? ? ? ? ? } > > + ? ? ? ? ? ? ? } > > ? ? ? ? ? ? ? ?/* > > ? ? ? ? ? ? ? ? * Assume link is down and allow > > ? ? ? ? ? ? ? ? * tick routine to update the state > > @@ -7495,10 +7802,14 @@ bce_ioctl(struct ifnet *ifp, u_long comm > > ? ? ? ?case SIOCGIFMEDIA: > > ? ? ? ? ? ? ? ?DBPRINT(sc, BCE_VERBOSE_MISC, > > ? ? ? ? ? ? ? ? ? ?"Received SIOCSIFMEDIA/SIOCGIFMEDIA\n"); > > - > > - ? ? ? ? ? ? ? mii = device_get_softc(sc->bce_miibus); > > - ? ? ? ? ? ? ? error = ifmedia_ioctl(ifp, ifr, > > - ? ? ? ? ? ? ? ? ? &mii->mii_media, command); > > + ? ? ? ? ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) > > + ? ? ? ? ? ? ? ? ? ? ? error = ifmedia_ioctl(ifp, ifr, &sc->bce_ifmedia, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? command); > > + ? ? ? ? ? ? ? else { > > + ? ? ? ? ? ? ? ? ? ? ? mii = device_get_softc(sc->bce_miibus); > > + ? ? ? ? ? ? ? ? ? ? ? error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, > > + ? ? ? ? ? ? ? ? ? ? ? ? ? command); > > + ? ? ? ? ? ? ? } > > ? ? ? ? ? ? ? ?break; > > > > ? ? ? ?/* Set interface capability */ > > @@ -8163,6 +8474,7 @@ bce_tick(void *xsc) > > ? ? ? ?struct bce_softc *sc = xsc; > > ? ? ? ?struct mii_data *mii; > > ? ? ? ?struct ifnet *ifp; > > + ? ? ? struct ifmediareq ifmr; > > > > ? ? ? ?ifp = sc->bce_ifp; > > > > @@ -8193,21 +8505,32 @@ bce_tick(void *xsc) > > ? ? ? ? ? ? ? ?goto bce_tick_exit; > > > > ? ? ? ?/* Link is down. ?Check what the PHY's doing. */ > > - ? ? ? mii = device_get_softc(sc->bce_miibus); > > - ? ? ? mii_tick(mii); > > - > > - ? ? ? /* Check if the link has come up. */ > > - ? ? ? if ((mii->mii_media_status & IFM_ACTIVE) && > > - ? ? ? ? ? (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { > > - ? ? ? ? ? ? ? DBPRINT(sc, BCE_VERBOSE_MISC, > > - ? ? ? ? ? ? ? ? ? "%s(): Link up!\n", __FUNCTION__); > > - ? ? ? ? ? ? ? sc->bce_link_up = TRUE; > > - ? ? ? ? ? ? ? if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || > > - ? ? ? ? ? ? ? ? ? IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || > > - ? ? ? ? ? ? ? ? ? IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && > > - ? ? ? ? ? ? ? ? ? (bce_verbose || bootverbose)) > > - ? ? ? ? ? ? ? ? ? ? ? BCE_PRINTF("Gigabit link up!\n"); > > + ? ? ? if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0) { > > + ? ? ? ? ? ? ? bzero(&ifmr, sizeof(ifmr)); > > + ? ? ? ? ? ? ? bce_ifmedia_sts_rphy(sc, &ifmr); > > + ? ? ? ? ? ? ? if ((ifmr.ifm_status & (IFM_ACTIVE | IFM_AVALID)) == > > + ? ? ? ? ? ? ? ? ? (IFM_ACTIVE | IFM_AVALID)) { > > + ? ? ? ? ? ? ? ? ? ? ? sc->bce_link_up = TRUE; > > + ? ? ? ? ? ? ? ? ? ? ? bce_miibus_statchg(sc->bce_dev); > > + ? ? ? ? ? ? ? } > > + ? ? ? } else { > > + ? ? ? ? ? ? ? mii = device_get_softc(sc->bce_miibus); > > + ? ? ? ? ? ? ? mii_tick(mii); > > + ? ? ? ? ? ? ? /* Check if the link has come up. */ > > + ? ? ? ? ? ? ? if ((mii->mii_media_status & IFM_ACTIVE) && > > + ? ? ? ? ? ? ? ? ? (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { > > + ? ? ? ? ? ? ? ? ? ? ? DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Link up!\n", > > + ? ? ? ? ? ? ? ? ? ? ? ? ? __FUNCTION__); > > + ? ? ? ? ? ? ? ? ? ? ? sc->bce_link_up = TRUE; > > + ? ? ? ? ? ? ? ? ? ? ? if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || > > + ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || > > + ? ? ? ? ? ? ? ? ? ? ? ? ? IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && > > + ? ? ? ? ? ? ? ? ? ? ? ? ? (bce_verbose || bootverbose)) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? BCE_PRINTF("Gigabit link up!\n"); > > + ? ? ? ? ? ? ? } > > > > + ? ? ? } > > + ? ? ? if (sc->bce_link_up == TRUE) { > > ? ? ? ? ? ? ? ?/* Now that link is up, handle any outstanding TX traffic. */ > > ? ? ? ? ? ? ? ?if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { > > ? ? ? ? ? ? ? ? ? ? ? ?DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Found " > > @@ -8221,6 +8544,36 @@ bce_tick_exit: > > ? ? ? ?return; > > ?} > > > > +static void > > +bce_fw_cap_init(struct bce_softc *sc) > > +{ > > + ? ? ? u32 ack, cap, link; > > + > > + ? ? ? ack = 0; > > + ? ? ? cap = bce_shmem_rd(sc, BCE_FW_CAP_MB); > > + ? ? ? if ((cap & BCE_FW_CAP_SIGNATURE_MAGIC_MASK) != > > + ? ? ? ? ? BCE_FW_CAP_SIGNATURE_MAGIC) > > + ? ? ? ? ? ? ? return; > > + ? ? ? if ((cap & (BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN)) == > > + ? ? ? ? ? (BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN)) > > + ? ? ? ? ? ? ? ack |= BCE_DRV_ACK_CAP_SIGNATURE_MAGIC | > > + ? ? ? ? ? ? ? ? ? BCE_FW_CAP_MFW_KEEP_VLAN | BCE_FW_CAP_BC_KEEP_VLAN; > > + ? ? ? if ((sc->bce_phy_flags & BCE_PHY_SERDES_FLAG) != 0 && > > + ? ? ? ? ? (cap & BCE_FW_CAP_REMOTE_PHY_CAP) != 0) { > > + ? ? ? ? ? ? ? sc->bce_phy_flags &= ~BCE_PHY_REMOTE_PORT_FIBER_FLAG; > > + ? ? ? ? ? ? ? sc->bce_phy_flags |= BCE_PHY_REMOTE_CAP_FLAG; > > + ? ? ? ? ? ? ? link = bce_shmem_rd(sc, BCE_LINK_STATUS); > > + ? ? ? ? ? ? ? if ((link & BCE_LINK_STATUS_SERDES_LINK) != 0) > > + ? ? ? ? ? ? ? ? ? ? ? sc->bce_phy_flags |= BCE_PHY_REMOTE_PORT_FIBER_FLAG; > > + ? ? ? ? ? ? ? ack |= BCE_DRV_ACK_CAP_SIGNATURE_MAGIC | > > + ? ? ? ? ? ? ? ? ? BCE_FW_CAP_REMOTE_PHY_CAP; > > + ? ? ? } > > + > > + ? ? ? if (ack != 0) > > + ? ? ? ? ? ? ? bce_shmem_wr(sc, BCE_DRV_ACK_CAP_MB, ack); > > +} > > + > > + > > ?#ifdef BCE_DEBUG > > ?/****************************************************************************/ > > ?/* Allows the driver state to be dumped through the sysctl interface. ? ? ? */ > > > > Modified: stable/9/sys/dev/bce/if_bcereg.h > > ============================================================================== > > --- stable/9/sys/dev/bce/if_bcereg.h ? ?Wed May 23 01:49:50 2012 ? ? ? ?(r235817) > > +++ stable/9/sys/dev/bce/if_bcereg.h ? ?Wed May 23 02:02:29 2012 ? ? ? ?(r235818) > > @@ -814,6 +814,23 @@ struct flash_spec { > > ?#define BCE_DRV_PULSE_SEQ_MASK ? ? ? ? ? ? ? ? ?0x00007fff > > > > ?#define BCE_MB_ARGS_0 ? ? ? ? ? ? ? ? ? ? ? ? ?0x00000014 > > +#define ? ? ? ?BCE_NETLINK_SPEED_10HALF ? ? ? ? ? ? ? ? (1<<0) > > +#define ? ? ? ?BCE_NETLINK_SPEED_10FULL ? ? ? ? ? ? ? ? (1<<1) > > +#define ? ? ? ?BCE_NETLINK_SPEED_100HALF ? ? ? ? ? ? ? ?(1<<2) > > +#define ? ? ? ?BCE_NETLINK_SPEED_100FULL ? ? ? ? ? ? ? ?(1<<3) > > +#define ? ? ? ?BCE_NETLINK_SPEED_1000HALF ? ? ? ? ? ? ? (1<<4) > > +#define ? ? ? ?BCE_NETLINK_SPEED_1000FULL ? ? ? ? ? ? ? (1<<5) > > +#define ? ? ? ?BCE_NETLINK_SPEED_2500HALF ? ? ? ? ? ? ? (1<<6) > > +#define ? ? ? ?BCE_NETLINK_SPEED_2500FULL ? ? ? ? ? ? ? (1<<7) > > +#define ? ? ? ?BCE_NETLINK_SPEED_10GHALF ? ? ? ? ? ? ? ?(1<<8) > > +#define ? ? ? ?BCE_NETLINK_SPEED_10GFULL ? ? ? ? ? ? ? ?(1<<9) > > +#define ? ? ? ?BCE_NETLINK_ANEG_ENB ? ? ? ? ? ? ? ? ? ? (1<<10) > > +#define ? ? ? ?BCE_NETLINK_PHY_APP_REMOTE ? ? ? ? ? ? ? (1<<11) > > +#define ? ? ? ?BCE_NETLINK_FC_PAUSE_SYM ? ? ? ? ? ? ? ? (1<<12) > > +#define ? ? ? ?BCE_NETLINK_FC_PAUSE_ASYM ? ? ? ? ? ? ? ?(1<<13) > > +#define ? ? ? ?BCE_NETLINK_ETH_AT_WIRESPEED ? ? ? ? ? ? (1<<14) > > +#define ? ? ? ?BCE_NETLINK_PHY_RESET ? ? ? ? ? ? ? ? ? ?(1<<15) > > + > > ?#define BCE_MB_ARGS_1 ? ? ? ? ? ? ? ? ? ? ? ? ?0x00000018 > > > > ?/* Indicate to the firmware not to go into the > > @@ -1079,6 +1096,26 @@ struct flash_spec { > > ?#define BCE_BC_STATE_BC_DBG_CMD_LOOP_CNT_MASK ?0xffff > > ?#define BCE_BC_STATE_BC_DBG_CMD_LOOP_INFINITE ?0xffff > > > > +#define ? ? ? ?BCE_FW_EVT_CODE_MB ? ? ? ? ? ? ? ? ? ? ?0x00000354 > > +#define ? ? ? ?BCE_FW_EVT_CODE_SW_TIMER_EXPIRE_EVENT ? 0x00000000 > > +#define ? ? ? ?BCE_FW_EVT_CODE_LINK_EVENT ? ? ? ? ? ? ?0x00000001 > > + > > +#define ? ? ? ?BCE_DRV_ACK_CAP_MB ? ? ? ? ? ? ? ? ? ? ?0x00000364 > > +#define ? ? ? ?BCE_DRV_ACK_CAP_SIGNATURE_MAGIC ? ? ? ? 0x35450000 > > + > > +#define ? ? ? ?BCE_FW_CAP_MB ? ? ? ? ? ? ? ? ? ? ? ? ? 0x00000368 > > +#define ? ? ? ?BCE_FW_CAP_SIGNATURE_MAGIC ? ? ? ? ? ? ?0xaa550000 > > +#define ? ? ? ?BCE_FW_ACK_SIGNATURE_MAGIC ? ? ? ? ? ? ?0x52500000 > > +#define ? ? ? ?BCE_FW_CAP_SIGNATURE_MAGIC_MASK ? ? ? ? 0xffff0000 > > +#define ? ? ? ?BCE_FW_CAP_REMOTE_PHY_CAP ? ? ? ? ? ? ? 0x00000001 > > +#define ? ? ? ?BCE_FW_CAP_REMOTE_PHY_PRESENT ? ? ? ? ? 0x00000002 > > +#define ? ? ? ?BCE_FW_CAP_MFW_KEEP_VLAN ? ? ? ? ? ? ? ?0x00000008 > > +#define ? ? ? ?BCE_FW_CAP_BC_KEEP_VLAN ? ? ? ? ? ? ? ? 0x00000010 > > + > > +#define ? ? ? ?BCE_RPHY_SERDES_LINK ? ? ? ? ? ? ? ? ? ?0x00000374 > > + > > +#define ? ? ? ?BCE_RPHY_COPPER_LINK ? ? ? ? ? ? ? ? ? ?0x00000378 > > + > > ?#define HOST_VIEW_SHMEM_BASE ? ? ? ? ? ? ? ? ? 0x167c00 > > > > ?/* > > @@ -6454,6 +6491,8 @@ struct bce_softc > > ?#define BCE_PHY_INT_MODE_AUTO_POLLING_FLAG ? ? 0x00000100 > > ?#define BCE_PHY_INT_MODE_LINK_READY_FLAG ? ? ? 0x00000200 > > ?#define BCE_PHY_IEEE_CLAUSE_45_FLAG ? ? ? ? ? ?0x00000400 > > +#define ? ? ? ?BCE_PHY_REMOTE_CAP_FLAG ? ? ? ? ? ? ? ? 0x00000800 > > +#define ? ? ? ?BCE_PHY_REMOTE_PORT_FIBER_FLAG ? ? ? ? ?0x00001000 > > > > ? ? ? ?/* Values that need to be shared with the PHY driver. */ > > ? ? ? ?u32 ? ? ? ? ? ? ? ? ? ? bce_shared_hw_cfg; > From owner-svn-src-all@FreeBSD.ORG Thu May 24 02:46:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FAC3106564A; Thu, 24 May 2012 02:46:36 +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 467D78FC08; Thu, 24 May 2012 02:46: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 q4O2ka5B010634; Thu, 24 May 2012 02:46:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O2kaMZ010624; Thu, 24 May 2012 02:46:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240246.q4O2kaMZ010624@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 02:46: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: r235875 - in stable/8: sbin/geom/class/raid sys/conf sys/geom/raid sys/modules/geom/geom_raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 02:46:36 -0000 Author: mav Date: Thu May 24 02:46:35 2012 New Revision: 235875 URL: http://svn.freebsd.org/changeset/base/235875 Log: MFC r234458, r234603, r234610, r234727, r234816, r234848, r234868, r234869, r234899, r234940, r234993, r234994, r235071 -c r235076, r235080, r235096: - Add support for the DDF metadata format, as defined by the SNIA Common RAID Disk Data Format Specification v2.0; - Add support for reading non-degraded RAID4/5/5E/5EE/5R/6/MDF volumes. Sponsored by: iXsystems, Inc. Added: stable/8/sys/geom/raid/md_ddf.c - copied, changed from r234848, head/sys/geom/raid/md_ddf.c stable/8/sys/geom/raid/md_ddf.h - copied unchanged from r234848, head/sys/geom/raid/md_ddf.h stable/8/sys/geom/raid/tr_raid5.c - copied, changed from r234458, head/sys/geom/raid/tr_raid5.c Modified: stable/8/sbin/geom/class/raid/geom_raid.c stable/8/sbin/geom/class/raid/graid.8 stable/8/sys/conf/files stable/8/sys/geom/raid/g_raid.c stable/8/sys/geom/raid/g_raid.h stable/8/sys/geom/raid/g_raid_ctl.c stable/8/sys/geom/raid/g_raid_md_if.m stable/8/sys/geom/raid/md_intel.c stable/8/sys/geom/raid/md_jmicron.c stable/8/sys/geom/raid/md_nvidia.c stable/8/sys/geom/raid/md_promise.c stable/8/sys/geom/raid/md_sii.c stable/8/sys/geom/raid/tr_raid1.c stable/8/sys/geom/raid/tr_raid1e.c stable/8/sys/modules/geom/geom_raid/Makefile Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/sbin/geom/class/raid/geom_raid.c ============================================================================== --- stable/8/sbin/geom/class/raid/geom_raid.c Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sbin/geom/class/raid/geom_raid.c Thu May 24 02:46:35 2012 (r235875) @@ -48,11 +48,12 @@ struct g_command class_commands[] = { { "label", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, + { 'o', "fmtopt", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'S', "size", G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 's', "strip", G_VAL_OPTIONAL, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-fv] [-S size] [-s stripsize] format label level prov ..." + NULL, "[-fv] [-o fmtopt] [-S size] [-s stripsize] format label level prov ..." }, { "add", G_FLAG_VERBOSE, NULL, { Modified: stable/8/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/8/sbin/geom/class/raid/graid.8 Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sbin/geom/class/raid/graid.8 Thu May 24 02:46:35 2012 (r235875) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2011 +.Dd May 6, 2012 .Dt GRAID 8 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nm .Cm label .Op Fl f +.Op Fl o Ar fmtopt .Op Fl S Ar size .Op Fl s Ar strip .Ar format @@ -119,6 +120,8 @@ Additional options include: .It Fl f Enforce specified configuration creation if it is officially unsupported, but technically can be created. +.It Fl o Ar fmtopt +Specifies metadata format options. .It Fl S Ar size Use .Ar size @@ -200,6 +203,23 @@ The GEOM RAID class follows a modular de formats to be used. Support is currently implemented for the following formats: .Bl -tag -width "Intel" +.It DDF +The format defined by the SNIA Common RAID Disk Data Format v2.0 specification. +Used by some Adaptec RAID BIOSes and some hardware RAID controllers. +Because of high format flexibility different implementations support +different set of features and have different on-disk metadata layouts. +To provide compatibility, the GEOM RAID class mimics capabilities +of the first detected DDF array. +Respecting that, it may support different number of disks per volume, +volumes per array, partitions per disk, etc. +The following configurations are supported: RAID0 (2+ disks), RAID1 (2+ disks), +RAID1E (3+ disks), RAID3 (3+ disks), RAID4 (3+ disks), RAID5 (3+ disks), +RAID5E (4+ disks), RAID5EE (4+ disks), RAID5R (3+ disks), RAID6 (4+ disks), +RAIDMDF (4+ disks), RAID10 (4+ disks), SINGLE (1 disk), CONCAT (2+ disks). +.Pp +Format supports two options "BE" and "LE", that mean big-endian byte order +defined by specification (default) and little-endian used by some Adaptec +controllers. .It Intel The format used by Intel RAID BIOS. Supports up to two volumes per array. @@ -241,8 +261,11 @@ own risk: RAID1 (3+ disks), RAID10 (6+ d .Sh SUPPORTED RAID LEVELS The GEOM RAID class follows a modular design, allowing different RAID levels to be used. -Support for the following RAID levels is currently implemented: RAID0, RAID1, -RAID1E, RAID10, SINGLE, CONCAT. +Full support for the following RAID levels is currently implemented: +RAID0, RAID1, RAID1E, RAID10, SINGLE, CONCAT. +The following RAID levels supported as read-only for volumes in optimal +state (without using redundancy): RAID4, RAID5, RAID5E, RAID5EE, RAID5R, +RAID6, RAIDMDF. .Sh RAID LEVEL MIGRATION The GEOM RAID class has no support for RAID level migration, allowed by some metadata formats. @@ -253,6 +276,33 @@ corruption! .Sh 2TiB BARRIERS Promise metadata format does not support disks above 2TiB. NVIDIA metadata format does not support volumes above 2TiB. +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variable can be used to control the behavior of the +.Nm RAID +GEOM class. +.Bl -tag -width indent +.It Va kern.geom.raid.aggressive_spare : No 0 +Use any disks without metadata connected to controllers of the vendor +matching to volume metadata format as spare. +Use it with much care to not lose data if connecting unrelated disk! +.It Va kern.geom.raid.clean_time : No 5 +Mark volume as clean when idle for the specified number of seconds. +.It Va kern.geom.raid.debug : No 0 +Debug level of the +.Nm RAID +GEOM class. +.It Va kern.geom.raid.idle_threshold : No 1000000 +Time in microseconds to consider a volume idle for rebuild puroses. +.It Va kern.geom.raid.name_format : No 0 +Providers name format: 0 -- raid/r{num}, 1 -- raid/{label}. +.It Va kern.geom.raid.read_err_thresh : No 10 +Number of read errors equated to disk failure. +Write errors are always considered as disk failures. +.It Va kern.geom.raid.start_timeout : No 30 +Time to wait for missing array components on startup. +.El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. .Sh SEE ALSO Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sys/conf/files Thu May 24 02:46:35 2012 (r235875) @@ -2064,6 +2064,7 @@ geom/raid/g_raid.c optional geom_raid geom/raid/g_raid_ctl.c optional geom_raid geom/raid/g_raid_md_if.m optional geom_raid geom/raid/g_raid_tr_if.m optional geom_raid +geom/raid/md_ddf.c optional geom_raid geom/raid/md_intel.c optional geom_raid geom/raid/md_jmicron.c optional geom_raid geom/raid/md_nvidia.c optional geom_raid @@ -2073,6 +2074,7 @@ geom/raid/tr_concat.c optional geom_rai geom/raid/tr_raid0.c optional geom_raid geom/raid/tr_raid1.c optional geom_raid geom/raid/tr_raid1e.c optional geom_raid +geom/raid/tr_raid5.c optional geom_raid geom/raid3/g_raid3.c optional geom_raid3 geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec Modified: stable/8/sys/geom/raid/g_raid.c ============================================================================== --- stable/8/sys/geom/raid/g_raid.c Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sys/geom/raid/g_raid.c Thu May 24 02:46:35 2012 (r235875) @@ -276,23 +276,87 @@ g_raid_volume_level2str(int level, int q case G_RAID_VOLUME_RL_RAID1: return ("RAID1"); case G_RAID_VOLUME_RL_RAID3: + if (qual == G_RAID_VOLUME_RLQ_R3P0) + return ("RAID3-P0"); + if (qual == G_RAID_VOLUME_RLQ_R3PN) + return ("RAID3-PN"); return ("RAID3"); case G_RAID_VOLUME_RL_RAID4: + if (qual == G_RAID_VOLUME_RLQ_R4P0) + return ("RAID4-P0"); + if (qual == G_RAID_VOLUME_RLQ_R4PN) + return ("RAID4-PN"); return ("RAID4"); case G_RAID_VOLUME_RL_RAID5: + if (qual == G_RAID_VOLUME_RLQ_R5RA) + return ("RAID5-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5RS) + return ("RAID5-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5LA) + return ("RAID5-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5LS) + return ("RAID5-LS"); return ("RAID5"); case G_RAID_VOLUME_RL_RAID6: + if (qual == G_RAID_VOLUME_RLQ_R6RA) + return ("RAID6-RA"); + if (qual == G_RAID_VOLUME_RLQ_R6RS) + return ("RAID6-RS"); + if (qual == G_RAID_VOLUME_RLQ_R6LA) + return ("RAID6-LA"); + if (qual == G_RAID_VOLUME_RLQ_R6LS) + return ("RAID6-LS"); return ("RAID6"); + case G_RAID_VOLUME_RL_RAIDMDF: + if (qual == G_RAID_VOLUME_RLQ_RMDFRA) + return ("RAIDMDF-RA"); + if (qual == G_RAID_VOLUME_RLQ_RMDFRS) + return ("RAIDMDF-RS"); + if (qual == G_RAID_VOLUME_RLQ_RMDFLA) + return ("RAIDMDF-LA"); + if (qual == G_RAID_VOLUME_RLQ_RMDFLS) + return ("RAIDMDF-LS"); + return ("RAIDMDF"); case G_RAID_VOLUME_RL_RAID1E: + if (qual == G_RAID_VOLUME_RLQ_R1EA) + return ("RAID1E-A"); + if (qual == G_RAID_VOLUME_RLQ_R1EO) + return ("RAID1E-O"); return ("RAID1E"); case G_RAID_VOLUME_RL_SINGLE: return ("SINGLE"); case G_RAID_VOLUME_RL_CONCAT: return ("CONCAT"); case G_RAID_VOLUME_RL_RAID5E: + if (qual == G_RAID_VOLUME_RLQ_R5ERA) + return ("RAID5E-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5ERS) + return ("RAID5E-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5ELA) + return ("RAID5E-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5ELS) + return ("RAID5E-LS"); return ("RAID5E"); case G_RAID_VOLUME_RL_RAID5EE: + if (qual == G_RAID_VOLUME_RLQ_R5EERA) + return ("RAID5EE-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5EERS) + return ("RAID5EE-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5EELA) + return ("RAID5EE-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5EELS) + return ("RAID5EE-LS"); return ("RAID5EE"); + case G_RAID_VOLUME_RL_RAID5R: + if (qual == G_RAID_VOLUME_RLQ_R5RRA) + return ("RAID5R-RA"); + if (qual == G_RAID_VOLUME_RLQ_R5RRS) + return ("RAID5R-RS"); + if (qual == G_RAID_VOLUME_RLQ_R5RLA) + return ("RAID5R-LA"); + if (qual == G_RAID_VOLUME_RLQ_R5RLS) + return ("RAID5R-LS"); + return ("RAID5E"); default: return ("UNKNOWN"); } @@ -308,26 +372,111 @@ g_raid_volume_str2level(const char *str, *level = G_RAID_VOLUME_RL_RAID0; else if (strcasecmp(str, "RAID1") == 0) *level = G_RAID_VOLUME_RL_RAID1; - else if (strcasecmp(str, "RAID3") == 0) + else if (strcasecmp(str, "RAID3-P0") == 0) { + *level = G_RAID_VOLUME_RL_RAID3; + *qual = G_RAID_VOLUME_RLQ_R3P0; + } else if (strcasecmp(str, "RAID3-PN") == 0 || + strcasecmp(str, "RAID3") == 0) { *level = G_RAID_VOLUME_RL_RAID3; - else if (strcasecmp(str, "RAID4") == 0) + *qual = G_RAID_VOLUME_RLQ_R3PN; + } else if (strcasecmp(str, "RAID4-P0") == 0) { + *level = G_RAID_VOLUME_RL_RAID4; + *qual = G_RAID_VOLUME_RLQ_R4P0; + } else if (strcasecmp(str, "RAID4-PN") == 0 || + strcasecmp(str, "RAID4") == 0) { *level = G_RAID_VOLUME_RL_RAID4; - else if (strcasecmp(str, "RAID5") == 0) + *qual = G_RAID_VOLUME_RLQ_R4PN; + } else if (strcasecmp(str, "RAID5-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5; + *qual = G_RAID_VOLUME_RLQ_R5RA; + } else if (strcasecmp(str, "RAID5-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5; + *qual = G_RAID_VOLUME_RLQ_R5RS; + } else if (strcasecmp(str, "RAID5") == 0 || + strcasecmp(str, "RAID5-LA") == 0) { *level = G_RAID_VOLUME_RL_RAID5; - else if (strcasecmp(str, "RAID6") == 0) + *qual = G_RAID_VOLUME_RLQ_R5LA; + } else if (strcasecmp(str, "RAID5-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5; + *qual = G_RAID_VOLUME_RLQ_R5LS; + } else if (strcasecmp(str, "RAID6-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID6; + *qual = G_RAID_VOLUME_RLQ_R6RA; + } else if (strcasecmp(str, "RAID6-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID6; + *qual = G_RAID_VOLUME_RLQ_R6RS; + } else if (strcasecmp(str, "RAID6") == 0 || + strcasecmp(str, "RAID6-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAID6; + *qual = G_RAID_VOLUME_RLQ_R6LA; + } else if (strcasecmp(str, "RAID6-LS") == 0) { *level = G_RAID_VOLUME_RL_RAID6; - else if (strcasecmp(str, "RAID10") == 0 || - strcasecmp(str, "RAID1E") == 0) + *qual = G_RAID_VOLUME_RLQ_R6LS; + } else if (strcasecmp(str, "RAIDMDF-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFRA; + } else if (strcasecmp(str, "RAIDMDF-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFRS; + } else if (strcasecmp(str, "RAIDMDF") == 0 || + strcasecmp(str, "RAIDMDF-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFLA; + } else if (strcasecmp(str, "RAIDMDF-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAIDMDF; + *qual = G_RAID_VOLUME_RLQ_RMDFLS; + } else if (strcasecmp(str, "RAID10") == 0 || + strcasecmp(str, "RAID1E") == 0 || + strcasecmp(str, "RAID1E-A") == 0) { *level = G_RAID_VOLUME_RL_RAID1E; - else if (strcasecmp(str, "SINGLE") == 0) + *qual = G_RAID_VOLUME_RLQ_R1EA; + } else if (strcasecmp(str, "RAID1E-O") == 0) { + *level = G_RAID_VOLUME_RL_RAID1E; + *qual = G_RAID_VOLUME_RLQ_R1EO; + } else if (strcasecmp(str, "SINGLE") == 0) *level = G_RAID_VOLUME_RL_SINGLE; else if (strcasecmp(str, "CONCAT") == 0) *level = G_RAID_VOLUME_RL_CONCAT; - else if (strcasecmp(str, "RAID5E") == 0) + else if (strcasecmp(str, "RAID5E-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5E; + *qual = G_RAID_VOLUME_RLQ_R5ERA; + } else if (strcasecmp(str, "RAID5E-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5E; + *qual = G_RAID_VOLUME_RLQ_R5ERS; + } else if (strcasecmp(str, "RAID5E") == 0 || + strcasecmp(str, "RAID5E-LA") == 0) { *level = G_RAID_VOLUME_RL_RAID5E; - else if (strcasecmp(str, "RAID5EE") == 0) + *qual = G_RAID_VOLUME_RLQ_R5ELA; + } else if (strcasecmp(str, "RAID5E-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5E; + *qual = G_RAID_VOLUME_RLQ_R5ELS; + } else if (strcasecmp(str, "RAID5EE-RA") == 0) { *level = G_RAID_VOLUME_RL_RAID5EE; - else + *qual = G_RAID_VOLUME_RLQ_R5EERA; + } else if (strcasecmp(str, "RAID5EE-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5EE; + *qual = G_RAID_VOLUME_RLQ_R5EERS; + } else if (strcasecmp(str, "RAID5EE") == 0 || + strcasecmp(str, "RAID5EE-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5EE; + *qual = G_RAID_VOLUME_RLQ_R5EELA; + } else if (strcasecmp(str, "RAID5EE-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5EE; + *qual = G_RAID_VOLUME_RLQ_R5EELS; + } else if (strcasecmp(str, "RAID5R-RA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RRA; + } else if (strcasecmp(str, "RAID5R-RS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RRS; + } else if (strcasecmp(str, "RAID5R") == 0 || + strcasecmp(str, "RAID5R-LA") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RLA; + } else if (strcasecmp(str, "RAID5R-LS") == 0) { + *level = G_RAID_VOLUME_RL_RAID5R; + *qual = G_RAID_VOLUME_RLQ_R5RLS; + } else return (-1); return (0); } @@ -1673,8 +1822,8 @@ g_raid_create_node(struct g_class *mp, sc->sc_flags = 0; TAILQ_INIT(&sc->sc_volumes); TAILQ_INIT(&sc->sc_disks); - sx_init(&sc->sc_lock, "gmirror:lock"); - mtx_init(&sc->sc_queue_mtx, "gmirror:queue", NULL, MTX_DEF); + sx_init(&sc->sc_lock, "graid:lock"); + mtx_init(&sc->sc_queue_mtx, "graid:queue", NULL, MTX_DEF); TAILQ_INIT(&sc->sc_events); bioq_init(&sc->sc_queue); gp->softc = sc; @@ -1706,6 +1855,7 @@ g_raid_create_volume(struct g_raid_softc vol->v_state = G_RAID_VOLUME_S_STARTING; vol->v_raid_level = G_RAID_VOLUME_RL_UNKNOWN; vol->v_raid_level_qualifier = G_RAID_VOLUME_RLQ_UNKNOWN; + vol->v_rotate_parity = 1; bioq_init(&vol->v_inflight); bioq_init(&vol->v_locked); LIST_INIT(&vol->v_locks); @@ -1993,7 +2143,7 @@ g_raid_taste(struct g_class *mp, struct g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); G_RAID_DEBUG(2, "Tasting provider %s.", pp->name); - gp = g_new_geomf(mp, "mirror:taste"); + gp = g_new_geomf(mp, "raid:taste"); /* * This orphan function should be never called. */ @@ -2023,7 +2173,8 @@ g_raid_taste(struct g_class *mp, struct } int -g_raid_create_node_format(const char *format, struct g_geom **gp) +g_raid_create_node_format(const char *format, struct gctl_req *req, + struct g_geom **gp) { struct g_raid_md_class *class; struct g_raid_md_object *obj; @@ -2041,7 +2192,7 @@ g_raid_create_node_format(const char *fo obj = (void *)kobj_create((kobj_class_t)class, M_RAID, M_WAITOK); obj->mdo_class = class; - status = G_RAID_MD_CREATE(obj, &g_raid_class, gp); + status = G_RAID_MD_CREATE_REQ(obj, &g_raid_class, req, gp); if (status != G_RAID_MD_TASTE_NEW) kobj_delete((kobj_t)obj, M_RAID); return (status); Modified: stable/8/sys/geom/raid/g_raid.h ============================================================================== --- stable/8/sys/geom/raid/g_raid.h Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sys/geom/raid/g_raid.h Thu May 24 02:46:35 2012 (r235875) @@ -219,14 +219,48 @@ struct g_raid_subdisk { #define G_RAID_VOLUME_RL_RAID4 0x04 #define G_RAID_VOLUME_RL_RAID5 0x05 #define G_RAID_VOLUME_RL_RAID6 0x06 +#define G_RAID_VOLUME_RL_RAIDMDF 0x07 #define G_RAID_VOLUME_RL_RAID1E 0x11 #define G_RAID_VOLUME_RL_SINGLE 0x0f #define G_RAID_VOLUME_RL_CONCAT 0x1f #define G_RAID_VOLUME_RL_RAID5E 0x15 #define G_RAID_VOLUME_RL_RAID5EE 0x25 +#define G_RAID_VOLUME_RL_RAID5R 0x35 #define G_RAID_VOLUME_RL_UNKNOWN 0xff #define G_RAID_VOLUME_RLQ_NONE 0x00 +#define G_RAID_VOLUME_RLQ_R1SM 0x00 +#define G_RAID_VOLUME_RLQ_R1MM 0x01 +#define G_RAID_VOLUME_RLQ_R3P0 0x00 +#define G_RAID_VOLUME_RLQ_R3PN 0x01 +#define G_RAID_VOLUME_RLQ_R4P0 0x00 +#define G_RAID_VOLUME_RLQ_R4PN 0x01 +#define G_RAID_VOLUME_RLQ_R5RA 0x00 +#define G_RAID_VOLUME_RLQ_R5RS 0x01 +#define G_RAID_VOLUME_RLQ_R5LA 0x02 +#define G_RAID_VOLUME_RLQ_R5LS 0x03 +#define G_RAID_VOLUME_RLQ_R6RA 0x00 +#define G_RAID_VOLUME_RLQ_R6RS 0x01 +#define G_RAID_VOLUME_RLQ_R6LA 0x02 +#define G_RAID_VOLUME_RLQ_R6LS 0x03 +#define G_RAID_VOLUME_RLQ_RMDFRA 0x00 +#define G_RAID_VOLUME_RLQ_RMDFRS 0x01 +#define G_RAID_VOLUME_RLQ_RMDFLA 0x02 +#define G_RAID_VOLUME_RLQ_RMDFLS 0x03 +#define G_RAID_VOLUME_RLQ_R1EA 0x00 +#define G_RAID_VOLUME_RLQ_R1EO 0x01 +#define G_RAID_VOLUME_RLQ_R5ERA 0x00 +#define G_RAID_VOLUME_RLQ_R5ERS 0x01 +#define G_RAID_VOLUME_RLQ_R5ELA 0x02 +#define G_RAID_VOLUME_RLQ_R5ELS 0x03 +#define G_RAID_VOLUME_RLQ_R5EERA 0x00 +#define G_RAID_VOLUME_RLQ_R5EERS 0x01 +#define G_RAID_VOLUME_RLQ_R5EELA 0x02 +#define G_RAID_VOLUME_RLQ_R5EELS 0x03 +#define G_RAID_VOLUME_RLQ_R5RRA 0x00 +#define G_RAID_VOLUME_RLQ_R5RRS 0x01 +#define G_RAID_VOLUME_RLQ_R5RLA 0x02 +#define G_RAID_VOLUME_RLQ_R5RLS 0x03 #define G_RAID_VOLUME_RLQ_UNKNOWN 0xff struct g_raid_volume; @@ -244,7 +278,13 @@ struct g_raid_volume { u_int v_raid_level; /* Array RAID level. */ u_int v_raid_level_qualifier; /* RAID level det. */ u_int v_disks_count; /* Number of disks in array. */ + u_int v_mdf_pdisks; /* Number of parity disks + in RAIDMDF array. */ + uint16_t v_mdf_polynomial; /* Polynomial for RAIDMDF. */ + uint8_t v_mdf_method; /* Generation method for RAIDMDF. */ u_int v_strip_size; /* Array strip size. */ + u_int v_rotate_parity; /* Rotate RAID5R parity + after numer of stripes. */ u_int v_sectorsize; /* Volume sector size. */ off_t v_mediasize; /* Volume media size. */ struct bio_queue_head v_inflight; /* In-flight write requests. */ @@ -348,7 +388,8 @@ const char * g_raid_disk_state2str(int s struct g_raid_softc * g_raid_create_node(struct g_class *mp, const char *name, struct g_raid_md_object *md); -int g_raid_create_node_format(const char *format, struct g_geom **gp); +int g_raid_create_node_format(const char *format, struct gctl_req *req, + struct g_geom **gp); struct g_raid_volume * g_raid_create_volume(struct g_raid_softc *sc, const char *name, int id); struct g_raid_disk * g_raid_create_disk(struct g_raid_softc *sc); Modified: stable/8/sys/geom/raid/g_raid_ctl.c ============================================================================== --- stable/8/sys/geom/raid/g_raid_ctl.c Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sys/geom/raid/g_raid_ctl.c Thu May 24 02:46:35 2012 (r235875) @@ -88,7 +88,7 @@ g_raid_ctl_label(struct gctl_req *req, s gctl_error(req, "No format recieved."); return; } - crstatus = g_raid_create_node_format(format, &geom); + crstatus = g_raid_create_node_format(format, req, &geom); if (crstatus == G_RAID_MD_TASTE_FAIL) { gctl_error(req, "Failed to create array with format '%s'.", format); Modified: stable/8/sys/geom/raid/g_raid_md_if.m ============================================================================== --- stable/8/sys/geom/raid/g_raid_md_if.m Thu May 24 02:34:03 2012 (r235874) +++ stable/8/sys/geom/raid/g_raid_md_if.m Thu May 24 02:46:35 2012 (r235875) @@ -49,13 +49,22 @@ HEADER { # Default implementations of methods. CODE { static int - g_raid_md_create_default(struct g_raid_md_object *md) + g_raid_md_create_default(struct g_raid_md_object *md, + struct g_class *mp, struct g_geom **gp) { return (G_RAID_MD_TASTE_FAIL); } static int + g_raid_md_create_req_default(struct g_raid_md_object *md, + struct g_class *mp, struct gctl_req *req, struct g_geom **gp) + { + + return (G_RAID_MD_CREATE(md, mp, gp)); + } + + static int g_raid_md_ctl_default(struct g_raid_md_object *md, struct gctl_req *req) { @@ -95,6 +104,14 @@ METHOD int create { struct g_geom **gp; } DEFAULT g_raid_md_create_default; +# create_req() - create new node from scratch, with request argument. +METHOD int create_req { + struct g_raid_md_object *md; + struct g_class *mp; + struct gctl_req *req; + struct g_geom **gp; +} DEFAULT g_raid_md_create_req_default; + # taste() - taste disk and, if needed, create new node. METHOD int taste { struct g_raid_md_object *md; Copied and modified: stable/8/sys/geom/raid/md_ddf.c (from r234848, head/sys/geom/raid/md_ddf.c) ============================================================================== --- head/sys/geom/raid/md_ddf.c Mon Apr 30 17:53:02 2012 (r234848, copy source) +++ stable/8/sys/geom/raid/md_ddf.c Thu May 24 02:46:35 2012 (r235875) @@ -88,14 +88,15 @@ struct g_raid_md_ddf_pervolume { struct g_raid_md_ddf_object { struct g_raid_md_object mdio_base; + u_int mdio_bigendian; struct ddf_meta mdio_meta; + int mdio_starting; struct callout mdio_start_co; /* STARTING state timer. */ int mdio_started; - int mdio_incomplete; struct root_hold_token *mdio_rootmount; /* Root mount delay token. */ }; -static g_raid_md_create_t g_raid_md_create_ddf; +static g_raid_md_create_req_t g_raid_md_create_req_ddf; static g_raid_md_taste_t g_raid_md_taste_ddf; static g_raid_md_event_t g_raid_md_event_ddf; static g_raid_md_volume_event_t g_raid_md_volume_event_ddf; @@ -107,7 +108,7 @@ static g_raid_md_free_volume_t g_raid_md static g_raid_md_free_t g_raid_md_free_ddf; static kobj_method_t g_raid_md_ddf_methods[] = { - KOBJMETHOD(g_raid_md_create, g_raid_md_create_ddf), + KOBJMETHOD(g_raid_md_create_req, g_raid_md_create_req_ddf), KOBJMETHOD(g_raid_md_taste, g_raid_md_taste_ddf), KOBJMETHOD(g_raid_md_event, g_raid_md_event_ddf), KOBJMETHOD(g_raid_md_volume_event, g_raid_md_volume_event_ddf), @@ -172,6 +173,17 @@ static struct g_raid_md_class g_raid_md_ #define SET32D(m, f, v) SET32P((m), &(f), (v)) #define SET64D(m, f, v) SET64P((m), &(f), (v)) +#define GETCRNUM(m) (GET32((m), hdr->cr_length) / \ + GET16((m), hdr->Configuration_Record_Length)) + +#define GETVDCPTR(m, n) ((struct ddf_vdc_record *)((uint8_t *)(m)->cr + \ + (n) * GET16((m), hdr->Configuration_Record_Length) * \ + (m)->sectorsize)) + +#define GETSAPTR(m, n) ((struct ddf_sa_record *)((uint8_t *)(m)->cr + \ + (n) * GET16((m), hdr->Configuration_Record_Length) * \ + (m)->sectorsize)) + static int isff(uint8_t *buf, int size) { @@ -254,7 +266,7 @@ g_raid_md_ddf_print(struct ddf_meta *met GET16(meta, cdr->Controller_Type.SubVendor_ID), GET16(meta, cdr->Controller_Type.SubDevice_ID)); printf("Product_ID '%.16s'\n", (char *)&meta->cdr->Product_ID[0]); - printf("**** Physical Disk Data ****\n"); + printf("**** Physical Disk Records ****\n"); printf("Populated_PDEs %u\n", GET16(meta, pdr->Populated_PDEs)); printf("Max_PDE_Supported %u\n", GET16(meta, pdr->Max_PDE_Supported)); for (j = 0; j < GET16(meta, pdr->Populated_PDEs); j++) { @@ -276,7 +288,7 @@ g_raid_md_ddf_print(struct ddf_meta *met printf("Block_Size %u\n", GET16(meta, pdr->entry[j].Block_Size)); } - printf("**** Virtual Disk Data ****\n"); + printf("**** Virtual Disk Records ****\n"); printf("Populated_VDEs %u\n", GET16(meta, vdr->Populated_VDEs)); printf("Max_VDE_Supported %u\n", GET16(meta, vdr->Max_VDE_Supported)); for (j = 0; j < GET16(meta, vdr->Populated_VDEs); j++) { @@ -287,8 +299,8 @@ g_raid_md_ddf_print(struct ddf_meta *met printf("\n"); printf("VD_Number 0x%04x\n", GET16(meta, vdr->entry[j].VD_Number)); - printf("VD_Type 0x%02x\n", - GET8(meta, vdr->entry[j].VD_Type)); + printf("VD_Type 0x%04x\n", + GET16(meta, vdr->entry[j].VD_Type)); printf("VD_State 0x%02x\n", GET8(meta, vdr->entry[j].VD_State)); printf("Init_State 0x%02x\n", @@ -299,11 +311,9 @@ g_raid_md_ddf_print(struct ddf_meta *met (char *)&meta->vdr->entry[j].VD_Name); } printf("**** Configuration Records ****\n"); - num = GET32(meta, hdr->cr_length) / GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (j = 0; j < num; j++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - j * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, j); val = GET32D(meta, vdc->Signature); switch (val) { case DDF_VDCR_SIGNATURE: @@ -391,6 +401,7 @@ g_raid_md_ddf_print(struct ddf_meta *met GET16D(meta, sa->entry[i].Secondary_Element)); } break; + case 0x00000000: case 0xFFFFFFFF: break; default: @@ -463,17 +474,16 @@ ddf_meta_find_vdc(struct ddf_meta *meta, struct ddf_vdc_record *vdc; int i, num; - num = GET32(meta, hdr->cr_length) / GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - i * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, i); if (GUID != NULL) { if (GET32D(meta, vdc->Signature) == DDF_VDCR_SIGNATURE && memcmp(vdc->VD_GUID, GUID, 24) == 0) return (vdc); } else - if (GET32D(meta, vdc->Signature) == 0xffffffff) + if (GET32D(meta, vdc->Signature) == 0xffffffff || + GET32D(meta, vdc->Signature) == 0) return (vdc); } return (NULL); @@ -486,11 +496,9 @@ ddf_meta_count_vdc(struct ddf_meta *meta int i, num, cnt; cnt = 0; - num = GET32(meta, hdr->cr_length) / GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - i * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, i); if (GET32D(meta, vdc->Signature) != DDF_VDCR_SIGNATURE) continue; if (GUID == NULL || memcmp(vdc->VD_GUID, GUID, 24) == 0) @@ -526,12 +534,36 @@ ddf_meta_find_disk(struct ddf_vol_meta * return (-1); } +static struct ddf_sa_record * +ddf_meta_find_sa(struct ddf_meta *meta, int create) +{ + struct ddf_sa_record *sa; + int i, num; + + num = GETCRNUM(meta); + for (i = 0; i < num; i++) { + sa = GETSAPTR(meta, i); + if (GET32D(meta, sa->Signature) == DDF_SA_SIGNATURE) + return (sa); + } + if (create) { + for (i = 0; i < num; i++) { + sa = GETSAPTR(meta, i); + if (GET32D(meta, sa->Signature) == 0xffffffff || + GET32D(meta, sa->Signature) == 0) + return (sa); + } + } + return (NULL); +} + static void ddf_meta_create(struct g_raid_disk *disk, struct ddf_meta *sample) { struct timespec ts; struct clocktime ct; struct g_raid_md_ddf_perdisk *pd; + struct g_raid_md_ddf_object *mdi; struct ddf_meta *meta; struct ddf_pd_entry *pde; off_t anchorlba; @@ -542,13 +574,14 @@ ddf_meta_create(struct g_raid_disk *disk if (sample->hdr == NULL) sample = NULL; + mdi = (struct g_raid_md_ddf_object *)disk->d_softc->sc_md; pd = (struct g_raid_md_ddf_perdisk *)disk->d_md_data; meta = &pd->pd_meta; ss = disk->d_consumer->provider->sectorsize; anchorlba = disk->d_consumer->provider->mediasize / ss - 1; meta->sectorsize = ss; - meta->bigendian = sample ? sample->bigendian : 0; + meta->bigendian = sample ? sample->bigendian : mdi->mdio_bigendian; getnanotime(&ts); clock_ts_to_ct(&ts, &ct); @@ -642,9 +675,9 @@ ddf_meta_create(struct g_raid_disk *disk pos += GET32(meta, hdr->Diagnostic_Space_Length); SET32(meta, hdr->Vendor_Specific_Logs, GET32(meta, hdr->Vendor_Specific_Logs_Length) != 0 ? pos : 0xffffffff); - pos += GET32(meta, hdr->Vendor_Specific_Logs_Length); + pos += min(GET32(meta, hdr->Vendor_Specific_Logs_Length), 1); SET64(meta, hdr->Primary_Header_LBA, - anchorlba - pos - 16); + anchorlba - pos); SET64(meta, hdr->Secondary_Header_LBA, 0xffffffffffffffffULL); SET64(meta, hdr->WorkSpace_LBA, @@ -756,7 +789,7 @@ ddf_meta_update(struct ddf_meta *meta, s if (isff(spde->PD_GUID, 24)) continue; j = ddf_meta_find_pd(meta, NULL, - src->pdr->entry[i].PD_Reference); + GET32(src, pdr->entry[i].PD_Reference)); if (j < 0) { j = ddf_meta_find_pd(meta, NULL, 0xffffffff); pde = &meta->pdr->entry[j]; @@ -835,7 +868,8 @@ ddf_vol_meta_create(struct ddf_vol_meta } static void -ddf_vol_meta_update(struct ddf_vol_meta *dst, struct ddf_meta *src, uint8_t *GUID) +ddf_vol_meta_update(struct ddf_vol_meta *dst, struct ddf_meta *src, + uint8_t *GUID, int started) { struct ddf_header *hdr; struct ddf_vd_entry *vde; @@ -850,15 +884,15 @@ ddf_vol_meta_update(struct ddf_vol_meta size = GET16(src, hdr->Configuration_Record_Length) * src->sectorsize; if (dst->vdc == NULL || - ((int32_t)(GET32D(src, vdc->Sequence_Number) - - GET32(dst, vdc->Sequence_Number))) > 0) + (!started && ((int32_t)(GET32D(src, vdc->Sequence_Number) - + GET32(dst, vdc->Sequence_Number))) > 0)) vnew = 1; else vnew = 0; if (dst->bvdc[bvd] == NULL || - ((int32_t)(GET32D(src, vdc->Sequence_Number) - - GET32(dst, bvdc[bvd]->Sequence_Number))) > 0) + (!started && ((int32_t)(GET32D(src, vdc->Sequence_Number) - + GET32(dst, bvdc[bvd]->Sequence_Number))) > 0)) bvnew = 1; else bvnew = 0; @@ -936,12 +970,9 @@ ddf_meta_unused_range(struct ddf_meta *m beg[0] = 0; end[0] = GET64(meta, pdr->entry[pos].Configured_Size); n = 1; - num = GET32(meta, hdr->cr_length) / - GET16(meta, hdr->Configuration_Record_Length); + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + - i * GET16(meta, hdr->Configuration_Record_Length) * - meta->sectorsize); + vdc = GETVDCPTR(meta, i); if (GET32D(meta, vdc->Signature) != DDF_VDCR_SIGNATURE) continue; for (pos = 0; pos < GET16D(meta, vdc->Primary_Element_Count); pos++) @@ -1197,7 +1228,7 @@ hdrerror: } done: - free(abuf, M_MD_DDF); + g_free(abuf); if (error != 0) ddf_meta_free(meta); return (error); @@ -1260,11 +1291,10 @@ err: if (error != 0) goto err; - size = GET16(meta, hdr->Configuration_Record_Length); - num = GET32(meta, hdr->cr_length) / size; - size *= ss; + size = GET16(meta, hdr->Configuration_Record_Length) * ss; + num = GETCRNUM(meta); for (i = 0; i < num; i++) { - vdc = (struct ddf_vdc_record *)((uint8_t *)meta->cr + i * size); + vdc = GETVDCPTR(meta, i); SET32D(meta, vdc->CRC, 0xffffffff); SET32D(meta, vdc->CRC, crc32(vdc, size)); } @@ -1320,29 +1350,6 @@ ddf_meta_erase(struct g_consumer *cp) return (error); } -#if 0 -static int -ddf_meta_write_spare(struct g_consumer *cp) -{ - struct ddf_header *meta; - int error; - - meta = malloc(sizeof(*meta), M_MD_DDF, M_WAITOK | M_ZERO); - memcpy(&meta->ddf_id[0], DDF_MAGIC, sizeof(DDF_MAGIC) - 1); - meta->dummy_0 = 0x00020000; - meta->integrity = DDF_I_VALID; - meta->disk.flags = DDF_F_SPARE | DDF_F_ONLINE | DDF_F_VALID; - meta->disk.number = 0xff; - arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_sectors = cp->provider->mediasize / cp->provider->sectorsize; - meta->disk_sectors -= 131072; - meta->rebuild_lba = UINT32_MAX; - error = ddf_meta_write(cp, &meta, 1); - free(meta, M_MD_DDF); - return (error); -} -#endif - static struct g_raid_volume * g_raid_md_ddf_get_volume(struct g_raid_softc *sc, uint8_t *GUID) { @@ -1510,16 +1517,14 @@ g_raid_md_ddf_supported(int level, int q qual != G_RAID_VOLUME_RLQ_RMDFLA && qual != G_RAID_VOLUME_RLQ_RMDFLS) return (0); - if (disks < 5) + if (disks < 4) return (0); break; case G_RAID_VOLUME_RL_RAID1E: if (qual != G_RAID_VOLUME_RLQ_R1EA && qual != G_RAID_VOLUME_RLQ_R1EO) return (0); - if (disks < 2) - return (0); - if (disks % 2 != 0) + if (disks < 3) return (0); break; case G_RAID_VOLUME_RL_SINGLE: @@ -1578,6 +1583,7 @@ g_raid_md_ddf_start_disk(struct g_raid_d struct ddf_vol_meta *vmeta; struct ddf_meta *pdmeta, *gmeta; struct ddf_vdc_record *vdc1; + struct ddf_sa_record *sa; off_t size, eoff = 0, esize = 0; uint64_t *val2; int disk_pos, md_disk_bvd = -1, md_disk_pos = -1, md_pde_pos; @@ -1600,7 +1606,8 @@ g_raid_md_ddf_start_disk(struct g_raid_d md_pde_pos = ddf_meta_find_pd(gmeta, NULL, reference); if (disk_pos < 0) { - G_RAID_DEBUG1(1, sc, "Disk %s is not part of the volume %s", + G_RAID_DEBUG1(1, sc, + "Disk %s is not a present part of the volume %s", g_raid_get_diskname(disk), vol->v_name); /* Failed stale disk is useless for us. */ @@ -1610,10 +1617,8 @@ g_raid_md_ddf_start_disk(struct g_raid_d } /* If disk has some metadata for this volume - erase. */ - if (pdmeta->cr != NULL && - (vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) { + if ((vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) SET32D(pdmeta, vdc1->Signature, 0xffffffff); - } /* If we are in the start process, that's all for now. */ if (!pv->pv_started) @@ -1634,6 +1639,8 @@ g_raid_md_ddf_start_disk(struct g_raid_d g_raid_get_diskname(disk)); goto nofit; } + eoff *= pd->pd_meta.sectorsize; + esize *= pd->pd_meta.sectorsize; size = INT64_MAX; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; @@ -1646,26 +1653,41 @@ g_raid_md_ddf_start_disk(struct g_raid_d } if (disk_pos >= 0 && vol->v_raid_level != G_RAID_VOLUME_RL_CONCAT && - (off_t)esize * 512 < size) { + esize < size) { G_RAID_DEBUG1(1, sc, "Disk %s free space " "is too small (%ju < %ju)", - g_raid_get_diskname(disk), - (off_t)esize * 512, size); + g_raid_get_diskname(disk), esize, size); disk_pos = -1; } if (disk_pos >= 0) { if (vol->v_raid_level != G_RAID_VOLUME_RL_CONCAT) - esize = size / 512; + esize = size; md_disk_bvd = disk_pos / GET16(vmeta, vdc->Primary_Element_Count); // XXX md_disk_pos = disk_pos % GET16(vmeta, vdc->Primary_Element_Count); // XXX } else { nofit: - if (ddf_meta_count_vdc(&pd->pd_meta, NULL) == 0) { + if (disk->d_state == G_RAID_DISK_S_NONE) g_raid_change_disk_state(disk, - G_RAID_DISK_S_SPARE); - } + G_RAID_DISK_S_STALE); return (0); } + + /* + * If spare is committable, delete spare record. + * Othersize, mark it active and leave there. + */ + sa = ddf_meta_find_sa(&pd->pd_meta, 0); + if (sa != NULL) { + if ((GET8D(&pd->pd_meta, sa->Spare_Type) & + DDF_SAR_TYPE_REVERTIBLE) == 0) { + SET32D(&pd->pd_meta, sa->Signature, 0xffffffff); + } else { + SET8D(&pd->pd_meta, sa->Spare_Type, + GET8D(&pd->pd_meta, sa->Spare_Type) | + DDF_SAR_TYPE_ACTIVE); + } + } + G_RAID_DEBUG1(1, sc, "Disk %s takes pos %d in the volume %s", g_raid_get_diskname(disk), disk_pos, vol->v_name); resurrection = 1; @@ -1691,8 +1713,8 @@ nofit: g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); if (resurrection) { - sd->sd_offset = (off_t)eoff * 512; - sd->sd_size = (off_t)esize * 512; + sd->sd_offset = eoff; + sd->sd_size = esize; } else if (pdmeta->cr != NULL && (vdc1 = ddf_meta_find_vdc(pdmeta, vmeta->vdc->VD_GUID)) != NULL) { val2 = (uint64_t *)&(vdc1->Physical_Disk_Sequence[GET16(vmeta, hdr->Max_Primary_Element_Entries)]); @@ -1802,7 +1824,9 @@ g_raid_md_ddf_start(struct g_raid_volume struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_object *md; + struct g_raid_md_ddf_perdisk *pd; struct g_raid_md_ddf_pervolume *pv; + struct g_raid_md_ddf_object *mdi; struct ddf_vol_meta *vmeta; struct ddf_vdc_record *vdc; uint64_t *val2; @@ -1810,6 +1834,7 @@ g_raid_md_ddf_start(struct g_raid_volume sc = vol->v_softc; md = sc->sc_md; + mdi = (struct g_raid_md_ddf_object *)md; pv = vol->v_md_data; vmeta = &pv->pv_meta; vdc = vmeta->vdc; @@ -1826,6 +1851,13 @@ g_raid_md_ddf_start(struct g_raid_volume vol->v_strip_size = vol->v_sectorsize << GET8(vmeta, vdc->Stripe_Size); vol->v_disks_count = GET16(vmeta, vdc->Primary_Element_Count) * GET8(vmeta, vdc->Secondary_Element_Count); + vol->v_mdf_pdisks = GET8(vmeta, vdc->MDF_Parity_Disks); + vol->v_mdf_polynomial = GET16(vmeta, vdc->MDF_Parity_Generator_Polynomial); + vol->v_mdf_method = GET8(vmeta, vdc->MDF_Constant_Generation_Method); + if (GET8(vmeta, vdc->Rotate_Parity_count) > 31) + vol->v_rotate_parity = 1; + else + vol->v_rotate_parity = 1 << GET8(vmeta, vdc->Rotate_Parity_count); vol->v_mediasize = GET64(vmeta, vdc->VD_Size) * vol->v_sectorsize; for (i = 0, j = 0, bvd = 0; i < vol->v_disks_count; i++, j++) { if (j == GET16(vmeta, vdc->Primary_Element_Count)) { @@ -1848,20 +1880,14 @@ g_raid_md_ddf_start(struct g_raid_volume g_raid_start_volume(vol); /* Make all disks found till the moment take their places. */ - for (i = 0, j = 0, bvd = 0; i < vol->v_disks_count; i++, j++) { - if (j == GET16(vmeta, vdc->Primary_Element_Count)) { - j = 0; - bvd++; - } - if (vmeta->bvdc[bvd] == NULL) - continue; - disk = g_raid_md_ddf_get_disk(sc, NULL, - GET32(vmeta, bvdc[bvd]->Physical_Disk_Sequence[j])); - if (disk != NULL) + TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { + pd = (struct g_raid_md_ddf_perdisk *)disk->d_md_data; + if (ddf_meta_find_vdc(&pd->pd_meta, vmeta->vdc->VD_GUID) != NULL) g_raid_md_ddf_start_disk(disk, vol); } pv->pv_started = 1; + mdi->mdio_starting--; callout_stop(&pv->pv_start_co); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 24 03:38:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA4661065676; Thu, 24 May 2012 03:38:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA6138FC12; Thu, 24 May 2012 03:38: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 q4O3clCE012992; Thu, 24 May 2012 03:38:47 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O3cl6x012988; Thu, 24 May 2012 03:38:47 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205240338.q4O3cl6x012988@svn.freebsd.org> From: Alan Cox Date: Thu, 24 May 2012 03:38: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: r235876 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 03:38:48 -0000 Author: alc Date: Thu May 24 03:38:47 2012 New Revision: 235876 URL: http://svn.freebsd.org/changeset/base/235876 Log: MFC r235230 Give vm_fault()'s sequential access optimization a makeover. There are two aspects to the sequential access optimization: (1) read ahead of pages that are expected to be accessed in the near future and (2) unmap and cache behind of pages that are not expected to be accessed again. This revision changes both aspects. The read ahead optimization is now more effective. It starts with the same initial read window as before, but arithmetically grows the window on sequential page faults. This can yield increased read bandwidth. For example, on one of my machines, a program using mmap() to read a file that is several times larger than the machine's physical memory takes about 17% less time to complete. The unmap and cache behind optimization is now more selectively applied. The read ahead window must grow to its maximum size before unmap and cache behind is performed. This significantly reduces the number of times that pages are unmapped and cached only to be reactivated a short time later. The unmap and cache behind optimization now clears each page's referenced flag. Previously, in the case of dirty pages, if the containing file was still mapped at the time that the page daemon examined the dirty pages, they would be reactivated. From a stylistic standpoint, this revision also cleanly separates the implementation of the read ahead and unmap/cache behind optimizations. Modified: stable/9/sys/vm/vm_fault.c stable/9/sys/vm/vm_map.c stable/9/sys/vm/vm_map.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_fault.c ============================================================================== --- stable/9/sys/vm/vm_fault.c Thu May 24 02:46:35 2012 (r235875) +++ stable/9/sys/vm/vm_fault.c Thu May 24 03:38:47 2012 (r235876) @@ -114,9 +114,11 @@ static int prefault_pageorder[] = { static int vm_fault_additional_pages(vm_page_t, int, int, vm_page_t *, int *); static void vm_fault_prefault(pmap_t, vm_offset_t, vm_map_entry_t); -#define VM_FAULT_READ_AHEAD 8 -#define VM_FAULT_READ_BEHIND 7 -#define VM_FAULT_READ (VM_FAULT_READ_AHEAD+VM_FAULT_READ_BEHIND+1) +#define VM_FAULT_READ_BEHIND 8 +#define VM_FAULT_READ_MAX (1 + VM_FAULT_READ_AHEAD_MAX) +#define VM_FAULT_NINCR (VM_FAULT_READ_MAX / VM_FAULT_READ_BEHIND) +#define VM_FAULT_SUM (VM_FAULT_NINCR * (VM_FAULT_NINCR + 1) / 2) +#define VM_FAULT_CACHE_BEHIND (VM_FAULT_READ_BEHIND * VM_FAULT_SUM) struct faultstate { vm_page_t m; @@ -132,6 +134,8 @@ struct faultstate { int vfslocked; }; +static void vm_fault_cache_behind(const struct faultstate *fs, int distance); + static inline void release_page(struct faultstate *fs) { @@ -219,13 +223,13 @@ vm_fault_hold(vm_map_t map, vm_offset_t int fault_flags, vm_page_t *m_hold) { vm_prot_t prot; - int is_first_object_locked, result; - boolean_t growstack, wired; + long ahead, behind; + int alloc_req, era, faultcount, nera, reqpage, result; + boolean_t growstack, is_first_object_locked, wired; int map_generation; vm_object_t next_object; - vm_page_t marray[VM_FAULT_READ], mt, mt_prev; + vm_page_t marray[VM_FAULT_READ_MAX]; int hardfault; - int faultcount, ahead, behind, alloc_req; struct faultstate fs; struct vnode *vp; int locked, error; @@ -235,7 +239,7 @@ vm_fault_hold(vm_map_t map, vm_offset_t PCPU_INC(cnt.v_vm_faults); fs.vp = NULL; fs.vfslocked = 0; - faultcount = behind = 0; + faultcount = reqpage = 0; RetryFault:; @@ -443,75 +447,47 @@ readrest: */ if (TRYPAGER) { int rv; - int reqpage = 0; u_char behavior = vm_map_entry_behavior(fs.entry); if (behavior == MAP_ENTRY_BEHAV_RANDOM || P_KILLED(curproc)) { + behind = 0; ahead = 0; + } else if (behavior == MAP_ENTRY_BEHAV_SEQUENTIAL) { behind = 0; + ahead = atop(fs.entry->end - vaddr) - 1; + if (ahead > VM_FAULT_READ_AHEAD_MAX) + ahead = VM_FAULT_READ_AHEAD_MAX; + if (fs.pindex == fs.entry->next_read) + vm_fault_cache_behind(&fs, + VM_FAULT_READ_MAX); } else { - behind = (vaddr - fs.entry->start) >> PAGE_SHIFT; - if (behind > VM_FAULT_READ_BEHIND) - behind = VM_FAULT_READ_BEHIND; - - ahead = ((fs.entry->end - vaddr) >> PAGE_SHIFT) - 1; - if (ahead > VM_FAULT_READ_AHEAD) - ahead = VM_FAULT_READ_AHEAD; - } - is_first_object_locked = FALSE; - if ((behavior == MAP_ENTRY_BEHAV_SEQUENTIAL || - (behavior != MAP_ENTRY_BEHAV_RANDOM && - fs.pindex >= fs.entry->lastr && - fs.pindex < fs.entry->lastr + VM_FAULT_READ)) && - (fs.first_object == fs.object || - (is_first_object_locked = VM_OBJECT_TRYLOCK(fs.first_object))) && - fs.first_object->type != OBJT_DEVICE && - fs.first_object->type != OBJT_PHYS && - fs.first_object->type != OBJT_SG) { - vm_pindex_t firstpindex; - - if (fs.first_pindex < 2 * VM_FAULT_READ) - firstpindex = 0; - else - firstpindex = fs.first_pindex - 2 * VM_FAULT_READ; - mt = fs.first_object != fs.object ? - fs.first_m : fs.m; - KASSERT(mt != NULL, ("vm_fault: missing mt")); - KASSERT((mt->oflags & VPO_BUSY) != 0, - ("vm_fault: mt %p not busy", mt)); - mt_prev = vm_page_prev(mt); - /* - * note: partially valid pages cannot be - * included in the lookahead - NFS piecemeal - * writes will barf on it badly. + * If this is a sequential page fault, then + * arithmetically increase the number of pages + * in the read-ahead window. Otherwise, reset + * the read-ahead window to its smallest size. */ - while ((mt = mt_prev) != NULL && - mt->pindex >= firstpindex && - mt->valid == VM_PAGE_BITS_ALL) { - mt_prev = vm_page_prev(mt); - if (mt->busy || - (mt->oflags & VPO_BUSY)) - continue; - vm_page_lock(mt); - if (mt->hold_count || - mt->wire_count) { - vm_page_unlock(mt); - continue; - } - pmap_remove_all(mt); - if (mt->dirty != 0) - vm_page_deactivate(mt); - else - vm_page_cache(mt); - vm_page_unlock(mt); - } - ahead += behind; - behind = 0; + behind = atop(vaddr - fs.entry->start); + if (behind > VM_FAULT_READ_BEHIND) + behind = VM_FAULT_READ_BEHIND; + ahead = atop(fs.entry->end - vaddr) - 1; + era = fs.entry->read_ahead; + if (fs.pindex == fs.entry->next_read) { + nera = era + behind; + if (nera > VM_FAULT_READ_AHEAD_MAX) + nera = VM_FAULT_READ_AHEAD_MAX; + behind = 0; + if (ahead > nera) + ahead = nera; + if (era == VM_FAULT_READ_AHEAD_MAX) + vm_fault_cache_behind(&fs, + VM_FAULT_CACHE_BEHIND); + } else if (ahead > VM_FAULT_READ_AHEAD_MIN) + ahead = VM_FAULT_READ_AHEAD_MIN; + if (era != ahead) + fs.entry->read_ahead = ahead; } - if (is_first_object_locked) - VM_OBJECT_UNLOCK(fs.first_object); /* * Call the pager to retrieve the data, if any, after @@ -882,7 +858,7 @@ vnode_locked: * without holding a write lock on it. */ if (hardfault) - fs.entry->lastr = fs.pindex + faultcount - behind; + fs.entry->next_read = fs.pindex + faultcount - reqpage; if ((prot & VM_PROT_WRITE) != 0 || (fault_flags & VM_FAULT_DIRTY) != 0) { @@ -975,6 +951,60 @@ vnode_locked: } /* + * Speed up the reclamation of up to "distance" pages that precede the + * faulting pindex within the first object of the shadow chain. + */ +static void +vm_fault_cache_behind(const struct faultstate *fs, int distance) +{ + vm_object_t first_object, object; + vm_page_t m, m_prev; + vm_pindex_t pindex; + + object = fs->object; + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + first_object = fs->first_object; + if (first_object != object) { + if (!VM_OBJECT_TRYLOCK(first_object)) { + VM_OBJECT_UNLOCK(object); + VM_OBJECT_LOCK(first_object); + VM_OBJECT_LOCK(object); + } + } + if (first_object->type != OBJT_DEVICE && + first_object->type != OBJT_PHYS && first_object->type != OBJT_SG) { + if (fs->first_pindex < distance) + pindex = 0; + else + pindex = fs->first_pindex - distance; + if (pindex < OFF_TO_IDX(fs->entry->offset)) + pindex = OFF_TO_IDX(fs->entry->offset); + m = first_object != object ? fs->first_m : fs->m; + KASSERT((m->oflags & VPO_BUSY) != 0, + ("vm_fault_cache_behind: page %p is not busy", m)); + m_prev = vm_page_prev(m); + while ((m = m_prev) != NULL && m->pindex >= pindex && + m->valid == VM_PAGE_BITS_ALL) { + m_prev = vm_page_prev(m); + if (m->busy != 0 || (m->oflags & VPO_BUSY) != 0) + continue; + vm_page_lock(m); + if (m->hold_count == 0 && m->wire_count == 0) { + pmap_remove_all(m); + vm_page_aflag_clear(m, PGA_REFERENCED); + if (m->dirty != 0) + vm_page_deactivate(m); + else + vm_page_cache(m); + } + vm_page_unlock(m); + } + } + if (first_object != object) + VM_OBJECT_UNLOCK(first_object); +} + +/* * vm_fault_prefault provides a quick way of clustering * pagefaults into a processes address space. It is a "cousin" * of vm_map_pmap_enter, except it runs at page fault time instead Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Thu May 24 02:46:35 2012 (r235875) +++ stable/9/sys/vm/vm_map.c Thu May 24 03:38:47 2012 (r235876) @@ -1300,6 +1300,8 @@ charged: new_entry->protection = prot; new_entry->max_protection = max; new_entry->wired_count = 0; + new_entry->read_ahead = VM_FAULT_READ_AHEAD_INIT; + new_entry->next_read = OFF_TO_IDX(offset); KASSERT(cred == NULL || !ENTRY_CHARGED(new_entry), ("OVERCOMMIT: vm_map_insert leaks vm_map %p", new_entry)); Modified: stable/9/sys/vm/vm_map.h ============================================================================== --- stable/9/sys/vm/vm_map.h Thu May 24 02:46:35 2012 (r235875) +++ stable/9/sys/vm/vm_map.h Thu May 24 03:38:47 2012 (r235876) @@ -112,8 +112,9 @@ struct vm_map_entry { vm_prot_t protection; /* protection code */ vm_prot_t max_protection; /* maximum protection */ vm_inherit_t inheritance; /* inheritance */ + uint8_t read_ahead; /* pages in the read-ahead window */ int wired_count; /* can be paged if = 0 */ - vm_pindex_t lastr; /* last read */ + vm_pindex_t next_read; /* index of the next sequential read */ struct ucred *cred; /* tmp storage for creator ref */ }; @@ -330,6 +331,14 @@ long vmspace_wired_count(struct vmspace #define VM_FAULT_DIRTY 2 /* Dirty the page; use w/VM_PROT_COPY */ /* + * Initially, mappings are slightly sequential. The maximum window size must + * account for the map entry's "read_ahead" field being defined as an uint8_t. + */ +#define VM_FAULT_READ_AHEAD_MIN 7 +#define VM_FAULT_READ_AHEAD_INIT 15 +#define VM_FAULT_READ_AHEAD_MAX min(atop(MAXPHYS) - 1, UINT8_MAX) + +/* * The following "find_space" options are supported by vm_map_find() */ #define VMFS_NO_SPACE 0 /* don't find; use the given range */ From owner-svn-src-all@FreeBSD.ORG Thu May 24 03:45:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D353106566C; Thu, 24 May 2012 03:45:14 +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 77DBE8FC0C; Thu, 24 May 2012 03:45: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 q4O3jEfl013315; Thu, 24 May 2012 03:45:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O3jEbH013312; Thu, 24 May 2012 03:45:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240345.q4O3jEbH013312@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 03:45: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: r235877 - in stable/9/sys: amd64/conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 03:45:14 -0000 Author: mav Date: Thu May 24 03:45:13 2012 New Revision: 235877 URL: http://svn.freebsd.org/changeset/base/235877 Log: MFC r235226: Add `options GEOM_RAID` into i386 and amd64 GENERIC kernels. ataraid(4) previously was present there and having GEOM RAID is convinient. Unlike other classes GEOM RAID can be set up from BIOS before install and users are expecting it to be detected automatically. Modified: stable/9/sys/amd64/conf/GENERIC stable/9/sys/i386/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Thu May 24 03:38:47 2012 (r235876) +++ stable/9/sys/amd64/conf/GENERIC Thu May 24 03:45:13 2012 (r235877) @@ -43,6 +43,7 @@ options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD32 # Compatible with i386 binaries options COMPAT_FREEBSD4 # Compatible with FreeBSD4 Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Thu May 24 03:38:47 2012 (r235876) +++ stable/9/sys/i386/conf/GENERIC Thu May 24 03:45:13 2012 (r235877) @@ -45,6 +45,7 @@ options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options COMPAT_FREEBSD5 # Compatible with FreeBSD5 From owner-svn-src-all@FreeBSD.ORG Thu May 24 04:09:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71427106564A; Thu, 24 May 2012 04:09:48 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 427DA8FC08; Thu, 24 May 2012 04:09:48 +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 q4O49maq014341; Thu, 24 May 2012 04:09:48 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O49mDA014338; Thu, 24 May 2012 04:09:48 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205240409.q4O49mDA014338@svn.freebsd.org> From: Alan Cox Date: Thu, 24 May 2012 04:09:48 +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: r235878 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 04:09:48 -0000 Author: alc Date: Thu May 24 04:09:47 2012 New Revision: 235878 URL: http://svn.freebsd.org/changeset/base/235878 Log: MFC r232160 Simplify vmspace_fork()'s control flow by copying immutable data before the vm map locks are acquired. Also, eliminate redundant initialization of the new vm map's timestamp. Modified: stable/9/sys/vm/vm_map.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Thu May 24 03:45:13 2012 (r235877) +++ stable/9/sys/vm/vm_map.c Thu May 24 04:09:47 2012 (r235878) @@ -3087,27 +3087,25 @@ struct vmspace * vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_charge) { struct vmspace *vm2; - vm_map_t old_map = &vm1->vm_map; - vm_map_t new_map; - vm_map_entry_t old_entry; - vm_map_entry_t new_entry; + vm_map_t new_map, old_map; + vm_map_entry_t new_entry, old_entry; vm_object_t object; int locked; - vm_map_lock(old_map); - if (old_map->busy) - vm_map_wait_busy(old_map); - new_map = NULL; /* silence gcc */ + old_map = &vm1->vm_map; + /* Copy immutable fields of vm1 to vm2. */ vm2 = vmspace_alloc(old_map->min_offset, old_map->max_offset); if (vm2 == NULL) - goto unlock_and_return; + return (NULL); vm2->vm_taddr = vm1->vm_taddr; vm2->vm_daddr = vm1->vm_daddr; vm2->vm_maxsaddr = vm1->vm_maxsaddr; - new_map = &vm2->vm_map; /* XXX */ + vm_map_lock(old_map); + if (old_map->busy) + vm_map_wait_busy(old_map); + new_map = &vm2->vm_map; locked = vm_map_trylock(new_map); /* trylock to silence WITNESS */ KASSERT(locked, ("vmspace_fork: lock failed")); - new_map->timestamp = 1; old_entry = old_map->header.next; @@ -3228,15 +3226,13 @@ vmspace_fork(struct vmspace *vm1, vm_oof } old_entry = old_entry->next; } -unlock_and_return: /* * 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) - sx_xunlock(&new_map->lock); + sx_xunlock(&new_map->lock); vm_map_process_deferred(); return (vm2); From owner-svn-src-all@FreeBSD.ORG Thu May 24 04:10:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D69C41065670; Thu, 24 May 2012 04:10:35 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86D268FC16; Thu, 24 May 2012 04:10: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 q4O4AZCD014413; Thu, 24 May 2012 04:10:35 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O4AZDE014411; Thu, 24 May 2012 04:10:35 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201205240410.q4O4AZDE014411@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 24 May 2012 04:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235879 - head/sys/modules/aesni X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 04:10:35 -0000 Author: obrien Date: Thu May 24 04:10:34 2012 New Revision: 235879 URL: http://svn.freebsd.org/changeset/base/235879 Log: style.Makefile(5) Modified: head/sys/modules/aesni/Makefile Modified: head/sys/modules/aesni/Makefile ============================================================================== --- head/sys/modules/aesni/Makefile Thu May 24 04:09:47 2012 (r235878) +++ head/sys/modules/aesni/Makefile Thu May 24 04:10:34 2012 (r235879) @@ -4,7 +4,7 @@ KMOD= aesni SRCS= aesni.c aesni_wrap.c -SRCS+= aesencdec_$(MACHINE_CPUARCH).S aeskeys_$(MACHINE_CPUARCH).S +SRCS+= aesencdec_${MACHINE_CPUARCH}.S aeskeys_${MACHINE_CPUARCH}.S SRCS+= device_if.h bus_if.h opt_bus.h cryptodev_if.h .include From owner-svn-src-all@FreeBSD.ORG Thu May 24 04:23:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07444106566B; Thu, 24 May 2012 04:23:07 +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 CB5808FC0C; Thu, 24 May 2012 04:23: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 q4O4N6Rx014993; Thu, 24 May 2012 04:23:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O4N6Bk014989; Thu, 24 May 2012 04:23:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240423.q4O4N6Bk014989@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 04:23: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: r235880 - stable/9/usr.bin/usbhidctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 04:23:07 -0000 Author: mav Date: Thu May 24 04:23:06 2012 New Revision: 235880 URL: http://svn.freebsd.org/changeset/base/235880 Log: MFC r235519: Add support for -z option for reading operations. It allows to not request current values from device, but only receive changes. Sponsored by: iXsystems, Inc. Modified: stable/9/usr.bin/usbhidctl/usbhid.c stable/9/usr.bin/usbhidctl/usbhidctl.1 Directory Properties: stable/9/usr.bin/usbhidctl/ (props changed) Modified: stable/9/usr.bin/usbhidctl/usbhid.c ============================================================================== --- stable/9/usr.bin/usbhidctl/usbhid.c Thu May 24 04:10:34 2012 (r235879) +++ stable/9/usr.bin/usbhidctl/usbhid.c Thu May 24 04:23:06 2012 (r235880) @@ -182,11 +182,11 @@ usage(void) fprintf(stderr, "usage: %s -f device " - "[-l] [-n] [-r] [-t tablefile] [-v] [-x] name ...\n", + "[-l] [-n] [-r] [-t tablefile] [-v] [-x] [-z] name ...\n", getprogname()); fprintf(stderr, " %s -f device " - "[-l] [-n] [-r] [-t tablefile] [-v] [-x] -a\n", + "[-l] [-n] [-r] [-t tablefile] [-v] [-x] [-z] -a\n", getprogname()); fprintf(stderr, " %s -f device " @@ -304,7 +304,7 @@ dumpdata(int f, report_desc_t rd, int lo u_char *dbuf; enum hid_kind kind; - kind = 0; + kind = zflag ? 3 : 0; rid = -1; use_rid = !!hid_get_report_id(f); do { Modified: stable/9/usr.bin/usbhidctl/usbhidctl.1 ============================================================================== --- stable/9/usr.bin/usbhidctl/usbhidctl.1 Thu May 24 04:10:34 2012 (r235879) +++ stable/9/usr.bin/usbhidctl/usbhidctl.1 Thu May 24 04:23:06 2012 (r235880) @@ -47,6 +47,7 @@ .Op Fl l .Op Fl v .Op Fl x +.Op Fl z .Fl a .Nm .Fl f Ar device @@ -55,6 +56,7 @@ .Op Fl n .Op Fl v .Op Fl x +.Op Fl z .Ar item ... .Nm .Fl f Ar device @@ -99,9 +101,8 @@ Only 'output' and 'feature' kinds can be .It Fl x Dump data in hexadecimal as well as decimal. .It Fl z -Reset reports to zero before processing -.Fl w -arguments. If not specified, current values will be requested from device. +Reset reports to zero before processing other arguments. +If not specified, current values will be requested from device. .El .Sh SYNTAX .Nm From owner-svn-src-all@FreeBSD.ORG Thu May 24 04:24:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B457E106566B; Thu, 24 May 2012 04:24:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 856958FC12; Thu, 24 May 2012 04:24: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 q4O4OIqq015093; Thu, 24 May 2012 04:24:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O4OI6A015089; Thu, 24 May 2012 04:24:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205240424.q4O4OI6A015089@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 04:24: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: r235881 - stable/8/usr.bin/usbhidctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 04:24:18 -0000 Author: mav Date: Thu May 24 04:24:17 2012 New Revision: 235881 URL: http://svn.freebsd.org/changeset/base/235881 Log: MFC r235519: Add support for -z option for reading operations. It allows to not request current values from device, but only receive changes. Sponsored by: iXsystems, Inc. Modified: stable/8/usr.bin/usbhidctl/usbhid.c stable/8/usr.bin/usbhidctl/usbhidctl.1 Directory Properties: stable/8/usr.bin/usbhidctl/ (props changed) Modified: stable/8/usr.bin/usbhidctl/usbhid.c ============================================================================== --- stable/8/usr.bin/usbhidctl/usbhid.c Thu May 24 04:23:06 2012 (r235880) +++ stable/8/usr.bin/usbhidctl/usbhid.c Thu May 24 04:24:17 2012 (r235881) @@ -189,11 +189,11 @@ usage(void) fprintf(stderr, "usage: %s -f device " - "[-l] [-n] [-r] [-t tablefile] [-v] [-x] name ...\n", + "[-l] [-n] [-r] [-t tablefile] [-v] [-x] [-z] name ...\n", getprogname()); fprintf(stderr, " %s -f device " - "[-l] [-n] [-r] [-t tablefile] [-v] [-x] -a\n", + "[-l] [-n] [-r] [-t tablefile] [-v] [-x] [-z] -a\n", getprogname()); fprintf(stderr, " %s -f device " @@ -311,7 +311,7 @@ dumpdata(int f, report_desc_t rd, int lo u_char *dbuf; enum hid_kind kind; - kind = 0; + kind = zflag ? 3 : 0; rid = -1; use_rid = !!hid_get_report_id(f); do { Modified: stable/8/usr.bin/usbhidctl/usbhidctl.1 ============================================================================== --- stable/8/usr.bin/usbhidctl/usbhidctl.1 Thu May 24 04:23:06 2012 (r235880) +++ stable/8/usr.bin/usbhidctl/usbhidctl.1 Thu May 24 04:24:17 2012 (r235881) @@ -54,6 +54,7 @@ .Op Fl l .Op Fl v .Op Fl x +.Op Fl z .Fl a .Nm .Fl f Ar device @@ -62,6 +63,7 @@ .Op Fl n .Op Fl v .Op Fl x +.Op Fl z .Ar item ... .Nm .Fl f Ar device @@ -106,9 +108,8 @@ Only 'output' and 'feature' kinds can be .It Fl x Dump data in hexadecimal as well as decimal. .It Fl z -Reset reports to zero before processing -.Fl w -arguments. If not specified, current values will be requested from device. +Reset reports to zero before processing other arguments. +If not specified, current values will be requested from device. .El .Sh SYNTAX .Nm From owner-svn-src-all@FreeBSD.ORG Thu May 24 04:33:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D13BC106566B; Thu, 24 May 2012 04:33:32 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A269A8FC0C; Thu, 24 May 2012 04:33: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 q4O4XWU0015498; Thu, 24 May 2012 04:33:32 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O4XWKT015496; Thu, 24 May 2012 04:33:32 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205240433.q4O4XWKT015496@svn.freebsd.org> From: Alan Cox Date: Thu, 24 May 2012 04:33:32 +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: r235882 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 04:33:32 -0000 Author: alc Date: Thu May 24 04:33:32 2012 New Revision: 235882 URL: http://svn.freebsd.org/changeset/base/235882 Log: MFC r232288 Simplify kmem_alloc() by eliminating code that existed on account of external pagers in Mach. Modified: stable/9/sys/vm/vm_kern.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_kern.c ============================================================================== --- stable/9/sys/vm/vm_kern.c Thu May 24 04:24:17 2012 (r235881) +++ stable/9/sys/vm/vm_kern.c Thu May 24 04:33:32 2012 (r235882) @@ -161,7 +161,6 @@ kmem_alloc(map, size) { vm_offset_t addr; vm_offset_t offset; - vm_offset_t i; size = round_page(size); @@ -187,35 +186,6 @@ kmem_alloc(map, size) vm_map_unlock(map); /* - * Guarantee that there are pages already in this object before - * calling vm_map_wire. This is to prevent the following - * scenario: - * - * 1) Threads have swapped out, so that there is a pager for the - * kernel_object. 2) The kmsg zone is empty, and so we are - * kmem_allocing a new page for it. 3) vm_map_wire calls vm_fault; - * there is no page, but there is a pager, so we call - * pager_data_request. But the kmsg zone is empty, so we must - * kmem_alloc. 4) goto 1 5) Even if the kmsg zone is not empty: when - * we get the data back from the pager, it will be (very stale) - * non-zero data. kmem_alloc is defined to return zero-filled memory. - * - * We're intentionally not activating the pages we allocate to prevent a - * race with page-out. vm_map_wire will wire the pages. - */ - VM_OBJECT_LOCK(kernel_object); - for (i = 0; i < size; i += PAGE_SIZE) { - vm_page_t mem; - - mem = vm_page_grab(kernel_object, OFF_TO_IDX(offset + i), - VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_RETRY); - mem->valid = VM_PAGE_BITS_ALL; - KASSERT((mem->oflags & VPO_UNMANAGED) != 0, - ("kmem_alloc: page %p is managed", mem)); - } - VM_OBJECT_UNLOCK(kernel_object); - - /* * And finally, mark the data as non-pageable. */ (void) vm_map_wire(map, addr, addr + size, From owner-svn-src-all@FreeBSD.ORG Thu May 24 04:46:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EFBE8106566C; Thu, 24 May 2012 04:46:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA52F8FC0C; Thu, 24 May 2012 04:46: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 q4O4keIw016159; Thu, 24 May 2012 04:46:40 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O4ke7C016157; Thu, 24 May 2012 04:46:40 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205240446.q4O4ke7C016157@svn.freebsd.org> From: Alan Cox Date: Thu, 24 May 2012 04:46: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: r235883 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 04:46:41 -0000 Author: alc Date: Thu May 24 04:46:40 2012 New Revision: 235883 URL: http://svn.freebsd.org/changeset/base/235883 Log: MFC r232192 Fix typo. Modified: stable/9/sys/kern/vfs_bio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Thu May 24 04:33:32 2012 (r235882) +++ stable/9/sys/kern/vfs_bio.c Thu May 24 04:46:40 2012 (r235883) @@ -3081,7 +3081,7 @@ allocbuf(struct buf *bp, int size) /* * We must allocate system pages since blocking - * here could intefere with paging I/O, no + * here could interfere with paging I/O, no * matter which process we are. * * We can only test VPO_BUSY here. Blocking on From owner-svn-src-all@FreeBSD.ORG Thu May 24 05:11:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 941D8106564A; Thu, 24 May 2012 05:11:22 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DDB68FC0A; Thu, 24 May 2012 05:11: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 q4O5BMP3017191; Thu, 24 May 2012 05:11:22 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O5BMLC017184; Thu, 24 May 2012 05:11:22 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205240511.q4O5BMLC017184@svn.freebsd.org> From: Alan Cox Date: Thu, 24 May 2012 05:11: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: r235884 - in stable/9/sys: amd64/amd64 amd64/conf conf i386/conf i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 05:11:22 -0000 Author: alc Date: Thu May 24 05:11:21 2012 New Revision: 235884 URL: http://svn.freebsd.org/changeset/base/235884 Log: MFC r233433 Disable detailed PV entry accounting by default. Add a config option to enable it. Modified: stable/9/sys/amd64/amd64/pmap.c stable/9/sys/amd64/conf/NOTES stable/9/sys/conf/options.amd64 stable/9/sys/conf/options.i386 stable/9/sys/i386/conf/NOTES stable/9/sys/i386/i386/pmap.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/amd64/amd64/pmap.c ============================================================================== --- stable/9/sys/amd64/amd64/pmap.c Thu May 24 04:46:40 2012 (r235883) +++ stable/9/sys/amd64/amd64/pmap.c Thu May 24 05:11:21 2012 (r235884) @@ -158,7 +158,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_INLINE #endif -#define PV_STATS #ifdef PV_STATS #define PV_STAT(x) do { x ; } while (0) #else Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Thu May 24 04:46:40 2012 (r235883) +++ stable/9/sys/amd64/conf/NOTES Thu May 24 05:11:21 2012 (r235884) @@ -556,6 +556,10 @@ options LINSYSFS options KSTACK_PAGES=5 +# Enable detailed accounting by the PV entry allocator. + +options PV_STATS + ##################################################################### # More undocumented options for linting. Modified: stable/9/sys/conf/options.amd64 ============================================================================== --- stable/9/sys/conf/options.amd64 Thu May 24 04:46:40 2012 (r235883) +++ stable/9/sys/conf/options.amd64 Thu May 24 05:11:21 2012 (r235884) @@ -10,6 +10,7 @@ PERFMON MPTABLE_FORCE_HTT MP_WATCHDOG NKPT opt_pmap.h +PV_STATS opt_pmap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems Modified: stable/9/sys/conf/options.i386 ============================================================================== --- stable/9/sys/conf/options.i386 Thu May 24 04:46:40 2012 (r235883) +++ stable/9/sys/conf/options.i386 Thu May 24 05:11:21 2012 (r235884) @@ -16,6 +16,7 @@ NKPT opt_pmap.h PERFMON PMAP_SHPGPERPROC opt_pmap.h POWERFAIL_NMI opt_trap.h +PV_STATS opt_pmap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems Modified: stable/9/sys/i386/conf/NOTES ============================================================================== --- stable/9/sys/i386/conf/NOTES Thu May 24 04:46:40 2012 (r235883) +++ stable/9/sys/i386/conf/NOTES Thu May 24 05:11:21 2012 (r235884) @@ -973,6 +973,10 @@ device lindev options KSTACK_PAGES=3 +# Enable detailed accounting by the PV entry allocator. + +options PV_STATS + ##################################################################### # More undocumented options for linting. Modified: stable/9/sys/i386/i386/pmap.c ============================================================================== --- stable/9/sys/i386/i386/pmap.c Thu May 24 04:46:40 2012 (r235883) +++ stable/9/sys/i386/i386/pmap.c Thu May 24 05:11:21 2012 (r235884) @@ -172,7 +172,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_INLINE #endif -#define PV_STATS #ifdef PV_STATS #define PV_STAT(x) do { x ; } while (0) #else From owner-svn-src-all@FreeBSD.ORG Thu May 24 05:30:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 26C2F106566B; Thu, 24 May 2012 05:30:18 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 109738FC16; Thu, 24 May 2012 05:30: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 q4O5UHB6017999; Thu, 24 May 2012 05:30:17 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O5UHGn017992; Thu, 24 May 2012 05:30:17 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205240530.q4O5UHGn017992@svn.freebsd.org> From: Alan Cox Date: Thu, 24 May 2012 05:30:17 +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: r235885 - in stable/8/sys: amd64/amd64 amd64/conf conf i386/conf i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 05:30:18 -0000 Author: alc Date: Thu May 24 05:30:17 2012 New Revision: 235885 URL: http://svn.freebsd.org/changeset/base/235885 Log: MFC r233433 Disable detailed PV entry accounting by default. Add a config option to enable it. Modified: stable/8/sys/amd64/amd64/pmap.c stable/8/sys/amd64/conf/NOTES stable/8/sys/conf/options.amd64 stable/8/sys/conf/options.i386 stable/8/sys/i386/conf/NOTES stable/8/sys/i386/i386/pmap.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/amd64/amd64/pmap.c ============================================================================== --- stable/8/sys/amd64/amd64/pmap.c Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/amd64/amd64/pmap.c Thu May 24 05:30:17 2012 (r235885) @@ -152,7 +152,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_INLINE #endif -#define PV_STATS #ifdef PV_STATS #define PV_STAT(x) do { x ; } while (0) #else Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/amd64/conf/NOTES Thu May 24 05:30:17 2012 (r235885) @@ -557,6 +557,10 @@ options LINSYSFS options KSTACK_PAGES=5 +# Enable detailed accounting by the PV entry allocator. + +options PV_STATS + ##################################################################### # More undocumented options for linting. Modified: stable/8/sys/conf/options.amd64 ============================================================================== --- stable/8/sys/conf/options.amd64 Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/conf/options.amd64 Thu May 24 05:30:17 2012 (r235885) @@ -8,6 +8,7 @@ PERFMON MPTABLE_FORCE_HTT MP_WATCHDOG NKPT opt_pmap.h +PV_STATS opt_pmap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems Modified: stable/8/sys/conf/options.i386 ============================================================================== --- stable/8/sys/conf/options.i386 Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/conf/options.i386 Thu May 24 05:30:17 2012 (r235885) @@ -16,6 +16,7 @@ NKPT opt_pmap.h PERFMON PMAP_SHPGPERPROC opt_pmap.h POWERFAIL_NMI opt_trap.h +PV_STATS opt_pmap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/i386/conf/NOTES Thu May 24 05:30:17 2012 (r235885) @@ -986,6 +986,10 @@ device lindev options KSTACK_PAGES=3 +# Enable detailed accounting by the PV entry allocator. + +options PV_STATS + ##################################################################### # More undocumented options for linting. Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Thu May 24 05:11:21 2012 (r235884) +++ stable/8/sys/i386/i386/pmap.c Thu May 24 05:30:17 2012 (r235885) @@ -166,7 +166,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_INLINE #endif -#define PV_STATS #ifdef PV_STATS #define PV_STAT(x) do { x ; } while (0) #else From owner-svn-src-all@FreeBSD.ORG Thu May 24 06:37:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60300106564A; Thu, 24 May 2012 06:37:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by mx1.freebsd.org (Postfix) with ESMTP id D18008FC18; Thu, 24 May 2012 06:37:32 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4O6bNkM019413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 May 2012 16:37:24 +1000 Date: Thu, 24 May 2012 16:37:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "David O'Brien" In-Reply-To: <20120523234154.GA22380@dragon.NUXI.org> Message-ID: <20120524163545.T1094@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <4FBCCED9.9050308@FreeBSD.org> <20120523234154.GA22380@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 06:37:33 -0000 On Wed, 23 May 2012, David O'Brien wrote: > On Wed, May 23, 2012 at 01:49:45PM +0200, Dimitry Andric wrote: >> On 2012-05-22 20:18, David E. O'Brien wrote: >>> Log: >>> Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. > ... >> Until all the additional warnings this causes have been fixed, can this >> commit please be reverted for now? > > Yes. I cannot believe we've been abusing "%q" this badly. Using it at all is using it badly, so your change should have had no effect. But when it was used to print quad_t's, its use was almost reasonable, and the change broke that too. Bruce From owner-svn-src-all@FreeBSD.ORG Thu May 24 07:06:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3FAC106566B; Thu, 24 May 2012 07:06:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 1B8108FC18; Thu, 24 May 2012 07:06:42 +0000 (UTC) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4O70fmZ004936; Thu, 24 May 2012 17:00:42 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4O70MnT008164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 May 2012 17:00:24 +1000 Date: Thu, 24 May 2012 17:00:22 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: d@delphij.net In-Reply-To: <4FBD2393.708@delphij.net> Message-ID: <20120524163735.E1094@besplex.bde.org> References: <201205230649.q4N6nofV053886@svn.freebsd.org> <4FBD2393.708@delphij.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, "Bjoern A. Zeeb" , svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r235822 - in head: sys/dev/esp sys/gnu/fs/xfs/FreeBSD usr.sbin/ppp usr.sbin/rpc.lockd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 07:06:43 -0000 On Wed, 23 May 2012, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 05/23/12 07:56, Bjoern A. Zeeb wrote: >> >> On 23. May 2012, at 06:49 , Xin LI wrote: >> >>> Author: delphij Date: Wed May 23 06:49:50 2012 New Revision: >>> 235822 URL: http://svn.freebsd.org/changeset/base/235822 >>> >>> Log: Fix build: >>> >>> - Use %ll instead of %q for explicit long long casts; - Use %j >>> instead of %q in XFS and cast to intmax_t. >>> >>> Tested with: make universe >> >> >> I am still seeing XLP64 failing to compile: >> >> cc1: warnings being treated as errors >> /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c: In function >> 'g_flashmap_print': >> /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: >> format '%08llx' expects type 'long long unsigned int', but argument >> 2 has type 'off_t' [-Wformat] >> /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: >> format '%08llx' expects type 'long long unsigned int', but argument >> 3 has type 'off_t' [-Wformat] >> /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: >> format '%llu' expects type 'long long unsigned int', but argument 5 >> has type 'off_t' [-Wformat] > > Weird, I don't know why I didn't caught this :-/ It seems that > 'universe_kernel' does not do things after an existing universe build? Well, new printf format errors/style bugs involving %ll have little to do with old ones involving %q, even if they are not even style bugs but fatal type mismatches. > Should be fixed in r235849. The following bugs remain: - bogus types off_t for sl_start and sl_end. The typedef for file offsets is very inappropriate for disk offsets. But this seems to be a generic bug in geom. - printing the signed type off_t using the unsigned formats %...x and %...u. (The casts are to unsigned to match the formats.) - printing sl_start and sl_end in hex format - printing sl_start and sl_end in %08jx format: - this hex format doesn't even use '%#' or '0x%', so it is ambiguous - the output is not in tab format, so '08' is not needed to line it up - 08 doesn't even work for lining things up, except for 32-bit values. 016 might work for 64-bit values. But for general uint64_t values, there is no correct field width to use. Bruce From owner-svn-src-all@FreeBSD.ORG Thu May 24 07:52:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 545111065670; Thu, 24 May 2012 07:52:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id DE8F58FC0C; Thu, 24 May 2012 07:52:02 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4O7prha005272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 May 2012 17:51:55 +1000 Date: Thu, 24 May 2012 17:51:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon In-Reply-To: <4FBD4124.5030205@FreeBSD.org> Message-ID: <20120524174234.O1352@besplex.bde.org> References: <201205231817.q4NIH2t7088267@svn.freebsd.org> <20120523192232.GA1399@garage.freebsd.pl> <4FBD4124.5030205@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Xin LI , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r235852 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 07:52:03 -0000 On Wed, 23 May 2012, Andriy Gapon wrote: > on 23/05/2012 22:22 Pawel Jakub Dawidek said the following: >> On Wed, May 23, 2012 at 06:17:02PM +0000, Xin LI wrote: >>> Author: delphij Date: Wed May 23 18:17:02 2012 New Revision: 235852 URL: >>> http://svn.freebsd.org/changeset/base/235852 >>> >>> Log: Use %ju to match uintmax_t usage >>> >>> Modified: head/sys/geom/geom_flashmap.c >>> >>> Modified: head/sys/geom/geom_flashmap.c >>> ============================================================================== >>> >>> > --- head/sys/geom/geom_flashmap.c Wed May 23 18:11:36 2012 (r235851) >>> +++ head/sys/geom/geom_flashmap.c Wed May 23 18:17:02 2012 (r235852) @@ >>> -78,7 +78,7 @@ static void g_flashmap_print(struct g_flashmap_slice >>> *slice) { >>> >>> - printf("%08jx-%08jx: %s (%lluKB)\n", (intmax_t)slice->sl_start, >>> (intmax_t)slice->sl_end, + printf("%08jx-%08jx: %s (%juKB)\n", >>> (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, slice->sl_name, >>> (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); >> >> BTW, %jx is also uintmax_t, not intmax_t, right? > > I think that non-decimal representation generally implies unsigned-ness. But it is another bug. I already pointed this out. but didn't notice then that it took 3-4 commits to get this far. Sometimes negative values need to be printed in hex, with the burden of interpreting the sign bit left to the user. Then the correct cast to use is problematic -- if you actually want to see the bits, then you don't want casting to change them, but perhaps it does change them for the 1's complement and other exotic cases. So hex printing of negative values probably shouldn't use casts at all, but should point at the object using u_char * and print the bits 1 byte at a time. These complications probably don't apply here. Probably the values are always nonnegative, so they can be printed in hex by simply casting them, and the casts should be to an unsigned type to match the format. The hex format is just bad here, with 2 or 3 internal bugs starting with it never having an 0x prefix -- see a previous reply. Bruce From owner-svn-src-all@FreeBSD.ORG Thu May 24 08:00:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06608106566B; Thu, 24 May 2012 08:00:27 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4F2E8FC0A; Thu, 24 May 2012 08:00: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 q4O80QlY023998; Thu, 24 May 2012 08:00:26 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O80QQk023994; Thu, 24 May 2012 08:00:26 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205240800.q4O80QQk023994@svn.freebsd.org> From: Gleb Kurtsou Date: Thu, 24 May 2012 08:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235886 - in head/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 08:00:27 -0000 Author: gleb Date: Thu May 24 08:00:26 2012 New Revision: 235886 URL: http://svn.freebsd.org/changeset/base/235886 Log: Add kern_fhstat(), adjust sys_fhstat() to use it. Extend kern_getdirentries() to accept uio segflag and optionally return buffer residue. Sponsored by: Google Summer of Code 2011 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu May 24 05:30:17 2012 (r235885) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu May 24 08:00:26 2012 (r235886) @@ -1528,7 +1528,8 @@ freebsd32_getdirentries(struct thread *t int32_t base32; int error; - error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base); + error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base, + NULL, UIO_USERSPACE); if (error) return (error); if (uap->basep != NULL) { Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu May 24 05:30:17 2012 (r235885) +++ head/sys/kern/vfs_syscalls.c Thu May 24 08:00:26 2012 (r235886) @@ -4136,7 +4136,8 @@ sys_getdirentries(td, uap) long base; int error; - error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base); + error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base, + NULL, UIO_USERSPACE); if (error) return (error); if (uap->basep != NULL) @@ -4146,7 +4147,7 @@ sys_getdirentries(td, uap) int kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, - long *basep) + long *basep, ssize_t *residp, enum uio_seg bufseg) { struct vnode *vp; struct file *fp; @@ -4180,7 +4181,7 @@ unionread: auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_rw = UIO_READ; - auio.uio_segflg = UIO_USERSPACE; + auio.uio_segflg = bufseg; auio.uio_td = td; vn_lock(vp, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(vp); @@ -4213,6 +4214,8 @@ unionread: VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); *basep = loff; + if (residp != NULL) + *residp = auio.uio_resid; td->td_retval[0] = count - auio.uio_resid; fail: fdrop(fp, td); @@ -4679,7 +4682,22 @@ sys_fhstat(td, uap) } */ *uap; { struct stat sb; - fhandle_t fh; + struct fhandle fh; + int error; + + error = copyin(uap->u_fhp, &fh, sizeof(fh)); + if (error != 0) + return (error); + error = kern_fhstat(td, fh, &sb); + if (error != 0) + return (error); + error = copyout(&sb, uap->sb, sizeof(sb)); + return (error); +} + +int +kern_fhstat(struct thread *td, struct fhandle fh, struct stat *sb) +{ struct mount *mp; struct vnode *vp; int vfslocked; @@ -4688,9 +4706,6 @@ sys_fhstat(td, uap) error = priv_check(td, PRIV_VFS_FHSTAT); if (error) return (error); - error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t)); - if (error) - return (error); if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL) return (ESTALE); vfslocked = VFS_LOCK_GIANT(mp); @@ -4700,12 +4715,9 @@ sys_fhstat(td, uap) VFS_UNLOCK_GIANT(vfslocked); return (error); } - error = vn_stat(vp, &sb, td->td_ucred, NOCRED, td); + error = vn_stat(vp, sb, td->td_ucred, NOCRED, td); vput(vp); VFS_UNLOCK_GIANT(vfslocked); - if (error) - return (error); - error = copyout(&sb, uap->sb, sizeof(sb)); return (error); } Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu May 24 05:30:17 2012 (r235885) +++ head/sys/sys/syscallsubr.h Thu May 24 08:00:26 2012 (r235886) @@ -89,6 +89,7 @@ int kern_fchmodat(struct thread *td, int int kern_fchownat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int uid, int gid, int flag); int kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg); +int kern_fhstat(struct thread *td, fhandle_t fh, struct stat *buf); int kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf); int kern_fstat(struct thread *td, int fd, struct stat *sbp); int kern_fstatfs(struct thread *td, int fd, struct statfs *buf); @@ -96,7 +97,7 @@ int kern_ftruncate(struct thread *td, in int kern_futimes(struct thread *td, int fd, struct timeval *tptr, enum uio_seg tptrseg); int kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, - long *basep); + long *basep, ssize_t *residp, enum uio_seg bufseg); int kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, enum uio_seg bufseg, int flags); int kern_getgroups(struct thread *td, u_int *ngrp, gid_t *groups); From owner-svn-src-all@FreeBSD.ORG Thu May 24 08:43:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 649731065670; Thu, 24 May 2012 08:43:11 +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 4E8408FC1B; Thu, 24 May 2012 08:43: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 q4O8hBfh025775; Thu, 24 May 2012 08:43:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O8hBc2025772; Thu, 24 May 2012 08:43:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205240843.q4O8hBc2025772@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 24 May 2012 08:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235887 - stable/9/usr.bin/lastcomm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 08:43:11 -0000 Author: kib Date: Thu May 24 08:43:10 2012 New Revision: 235887 URL: http://svn.freebsd.org/changeset/base/235887 Log: MFC r235541: Allow to specify strftime(3) format for process start end exit times. Modified: stable/9/usr.bin/lastcomm/lastcomm.1 stable/9/usr.bin/lastcomm/lastcomm.c Directory Properties: stable/9/usr.bin/lastcomm/ (props changed) Modified: stable/9/usr.bin/lastcomm/lastcomm.1 ============================================================================== --- stable/9/usr.bin/lastcomm/lastcomm.1 Thu May 24 08:00:26 2012 (r235886) +++ stable/9/usr.bin/lastcomm/lastcomm.1 Thu May 24 08:43:10 2012 (r235887) @@ -28,7 +28,7 @@ .\" From: @(#)lastcomm.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 14, 2007 +.Dd May 17, 2012 .Dt LASTCOMM 1 .Os .Sh NAME @@ -38,6 +38,7 @@ .Nm .Op Fl EScesu .Op Fl f Ar file +.Op Cm + Ns Ar format .Op Ar command ...\& .Op Ar user ...\& .Op Ar terminal ...\& @@ -77,6 +78,15 @@ is a single dash reads accounting entries from the standard input. .El .Pp +An operand with a leading plus sign +.Pq Sq + +is followed a user-defined format string which specifies the format +in which to display the process's start or exit date and time. +The format string may contain any of the conversion specifications +described in the +.Xr strftime 3 +manual page, as well as arbitrary text. +.Pp If no options are specified, .Fl cS is assumed. @@ -165,6 +175,7 @@ will print details of each terminating c .Sh SEE ALSO .Xr last 1 , .Xr sigaction 2 , +.Xr strftime 3 , .Xr acct 5 , .Xr core 5 .Sh HISTORY Modified: stable/9/usr.bin/lastcomm/lastcomm.c ============================================================================== --- stable/9/usr.bin/lastcomm/lastcomm.c Thu May 24 08:00:26 2012 (r235886) +++ stable/9/usr.bin/lastcomm/lastcomm.c Thu May 24 08:43:10 2012 (r235887) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "pathnames.h" @@ -82,10 +83,12 @@ main(int argc, char *argv[]) int (*readrec)(FILE *f, struct acctv2 *av2); time_t t; int ch, rv; - const char *acctfile; + const char *acctfile, *format; + char buf[1024]; int flags = 0; acctfile = _PATH_ACCT; + format = NULL; while ((ch = getopt(argc, argv, "f:usecSE")) != -1) switch((char)ch) { case 'f': @@ -126,6 +129,12 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (argc > 0 && **argv == '+') { + format = *argv + 1; /* skip + */ + argc--; + argv++; + } + if (strcmp(acctfile, "-") == 0) { fp = stdin; readrec = readrec_forward; @@ -177,14 +186,24 @@ main(int argc, char *argv[]) /* starting time */ if (flags & AC_BTIME) { - (void)printf(" %.16s", ctime(&ab.ac_btime)); + if (format != NULL) { + (void)strftime(buf, sizeof(buf), format, + localtime(&ab.ac_btime)); + (void)printf(" %s", buf); + } else + (void)printf(" %.16s", ctime(&ab.ac_btime)); } /* exit time (starting time + elapsed time )*/ if (flags & AC_FTIME) { t = ab.ac_btime; t += (time_t)(ab.ac_etime / 1000000); - (void)printf(" %.16s", ctime(&t)); + if (format != NULL) { + (void)strftime(buf, sizeof(buf), format, + localtime(&t)); + (void)printf(" %s", buf); + } else + (void)printf(" %.16s", ctime(&t)); } printf("\n"); } @@ -250,6 +269,7 @@ static void usage(void) { (void)fprintf(stderr, -"usage: lastcomm [-EScesu] [-f file] [command ...] [user ...] [terminal ...]\n"); + "usage: lastcomm [-EScesu] [-f file] [+format] [command ...] " + "[user ...] [terminal ...]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu May 24 09:11:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83E2E1065670; Thu, 24 May 2012 09:11:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D0448FC0C; Thu, 24 May 2012 09:11:39 +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 q4O9BdDN026974; Thu, 24 May 2012 09:11:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O9BdUw026971; Thu, 24 May 2012 09:11:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205240911.q4O9BdUw026971@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 24 May 2012 09:11:39 +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: r235888 - stable/8/usr.bin/lastcomm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 09:11:39 -0000 Author: kib Date: Thu May 24 09:11:38 2012 New Revision: 235888 URL: http://svn.freebsd.org/changeset/base/235888 Log: MFC r235541: Allow to specify strftime(3) format for process start end exit times. Modified: stable/8/usr.bin/lastcomm/lastcomm.1 stable/8/usr.bin/lastcomm/lastcomm.c Directory Properties: stable/8/usr.bin/lastcomm/ (props changed) Modified: stable/8/usr.bin/lastcomm/lastcomm.1 ============================================================================== --- stable/8/usr.bin/lastcomm/lastcomm.1 Thu May 24 08:43:10 2012 (r235887) +++ stable/8/usr.bin/lastcomm/lastcomm.1 Thu May 24 09:11:38 2012 (r235888) @@ -32,7 +32,7 @@ .\" From: @(#)lastcomm.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 14, 2007 +.Dd May 17, 2012 .Dt LASTCOMM 1 .Os .Sh NAME @@ -42,6 +42,7 @@ .Nm .Op Fl EScesu .Op Fl f Ar file +.Op Cm + Ns Ar format .Op Ar command ...\& .Op Ar user ...\& .Op Ar terminal ...\& @@ -81,6 +82,15 @@ is a single dash reads accounting entries from the standard input. .El .Pp +An operand with a leading plus sign +.Pq Sq + +is followed a user-defined format string which specifies the format +in which to display the process's start or exit date and time. +The format string may contain any of the conversion specifications +described in the +.Xr strftime 3 +manual page, as well as arbitrary text. +.Pp If no options are specified, .Fl cS is assumed. @@ -169,6 +179,7 @@ will print details of each terminating c .Sh SEE ALSO .Xr last 1 , .Xr sigaction 2 , +.Xr strftime 3 , .Xr acct 5 , .Xr core 5 .Sh HISTORY Modified: stable/8/usr.bin/lastcomm/lastcomm.c ============================================================================== --- stable/8/usr.bin/lastcomm/lastcomm.c Thu May 24 08:43:10 2012 (r235887) +++ stable/8/usr.bin/lastcomm/lastcomm.c Thu May 24 09:11:38 2012 (r235888) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "pathnames.h" @@ -87,10 +88,12 @@ main(int argc, char *argv[]) int (*readrec)(FILE *f, struct acctv2 *av2); time_t t; int ch, rv; - const char *acctfile; + const char *acctfile, *format; + char buf[1024]; int flags = 0; acctfile = _PATH_ACCT; + format = NULL; while ((ch = getopt(argc, argv, "f:usecSE")) != -1) switch((char)ch) { case 'f': @@ -131,6 +134,12 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (argc > 0 && **argv == '+') { + format = *argv + 1; /* skip + */ + argc--; + argv++; + } + if (strcmp(acctfile, "-") == 0) { fp = stdin; readrec = readrec_forward; @@ -182,14 +191,24 @@ main(int argc, char *argv[]) /* starting time */ if (flags & AC_BTIME) { - (void)printf(" %.16s", ctime(&ab.ac_btime)); + if (format != NULL) { + (void)strftime(buf, sizeof(buf), format, + localtime(&ab.ac_btime)); + (void)printf(" %s", buf); + } else + (void)printf(" %.16s", ctime(&ab.ac_btime)); } /* exit time (starting time + elapsed time )*/ if (flags & AC_FTIME) { t = ab.ac_btime; t += (time_t)(ab.ac_etime / 1000000); - (void)printf(" %.16s", ctime(&t)); + if (format != NULL) { + (void)strftime(buf, sizeof(buf), format, + localtime(&t)); + (void)printf(" %s", buf); + } else + (void)printf(" %.16s", ctime(&t)); } printf("\n"); } @@ -255,6 +274,7 @@ static void usage(void) { (void)fprintf(stderr, -"usage: lastcomm [-EScesu] [-f file] [command ...] [user ...] [terminal ...]\n"); + "usage: lastcomm [-EScesu] [-f file] [+format] [command ...] " + "[user ...] [terminal ...]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu May 24 09:27:42 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E775106564A; Thu, 24 May 2012 09:27:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id F2F5E8FC0C; Thu, 24 May 2012 09:27:40 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4O9QoZp060366; Thu, 24 May 2012 12:26:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4O9QobQ063966; Thu, 24 May 2012 12:26:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4O9QnL2063965; Thu, 24 May 2012 12:26:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 May 2012 12:26:49 +0300 From: Konstantin Belousov To: Niclas Zeising Message-ID: <20120524092649.GH2358@deviant.kiev.zoral.com.ua> References: <201205232107.q4NL71dw095460@svn.freebsd.org> <4FBD5899.9000808@daemonic.se> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VfjHX4a4S/LzE4mr" Content-Disposition: inline In-Reply-To: <4FBD5899.9000808@daemonic.se> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 09:27:42 -0000 --VfjHX4a4S/LzE4mr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 23, 2012 at 11:37:29PM +0200, Niclas Zeising wrote: > On 05/23/12 23:07, Konstantin Belousov wrote: > >Author: kib > >Date: Wed May 23 21:07:01 2012 > >New Revision: 235859 > >URL: http://svn.freebsd.org/changeset/base/235859 > > > >Log: > > Enable drm2 modules build. > > > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 month > > > >Modified: > > head/sys/i386/conf/XEN > > head/sys/modules/Makefile > > >=20 > Hi! > Thank you very much for all your work! > With this commit, is there any need for any patches from you, or have=20 > they all been incorporated by now? Perhaps a note in UPDATING would be=20 > good, at least to make people more aware of the fact that GEM/KMS=20 > finally has come to FreeBSD as well. An update to the wiki might be=20 > good as well. I can help you with patches and updating the wiki, just=20 > let me know. > Once again, a big thank you! ATM no more patches are needed to run new driver. I do not see a need in any UPDATING entry, since nothing should have been changed for users who did not used my patch before. Wiki ought to get complete rewrite, I might get time to do it at the end of week. --VfjHX4a4S/LzE4mr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+9/tkACgkQC3+MBN1Mb4iP8ACeJbRtUbuktUgQjDteJwTpxL/g yAYAoJJYTsWBA/MTgdSRYF7U4vpOkwxQ =h1I+ -----END PGP SIGNATURE----- --VfjHX4a4S/LzE4mr-- From owner-svn-src-all@FreeBSD.ORG Thu May 24 09:34:19 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38CBF1065674; Thu, 24 May 2012 09:34:19 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id A4DF18FC08; Thu, 24 May 2012 09:34:18 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 7BC1840014; Thu, 24 May 2012 11:34:17 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 6F6DC4000B; Thu, 24 May 2012 11:34:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (h-45-105.a163.priv.bahnhof.se [94.254.45.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 27BDE40002; Thu, 24 May 2012 11:34:17 +0200 (CEST) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3Vylm862msz8ggx; Thu, 24 May 2012 11:34:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id GLouEDiNJmvf; Thu, 24 May 2012 11:34:11 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3Vylm32V6sz8ggv; Thu, 24 May 2012 11:34:11 +0200 (CEST) Received: from [IPv6:2001:470:dca9:1::4] (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 3Vylm31mDrz9Ctq; Thu, 24 May 2012 11:34:11 +0200 (CEST) Message-ID: <4FBE0086.1050801@daemonic.se> Date: Thu, 24 May 2012 11:33:58 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Konstantin Belousov References: <201205232107.q4NL71dw095460@svn.freebsd.org> <4FBD5899.9000808@daemonic.se> <20120524092649.GH2358@deviant.kiev.zoral.com.ua> In-Reply-To: <20120524092649.GH2358@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 09:34:19 -0000 On 2012-05-24 11:26, Konstantin Belousov wrote: > On Wed, May 23, 2012 at 11:37:29PM +0200, Niclas Zeising wrote: >> On 05/23/12 23:07, Konstantin Belousov wrote: >>> Author: kib >>> Date: Wed May 23 21:07:01 2012 >>> New Revision: 235859 >>> URL: http://svn.freebsd.org/changeset/base/235859 >>> >>> Log: >>> Enable drm2 modules build. >>> >>> Sponsored by: The FreeBSD Foundation >>> MFC after: 1 month >>> >>> Modified: >>> head/sys/i386/conf/XEN >>> head/sys/modules/Makefile >>> >> >> Hi! >> Thank you very much for all your work! >> With this commit, is there any need for any patches from you, or have >> they all been incorporated by now? Perhaps a note in UPDATING would be >> good, at least to make people more aware of the fact that GEM/KMS >> finally has come to FreeBSD as well. An update to the wiki might be >> good as well. I can help you with patches and updating the wiki, just >> let me know. >> Once again, a big thank you! > > ATM no more patches are needed to run new driver. > > I do not see a need in any UPDATING entry, since nothing should have > been changed for users who did not used my patch before. > > Wiki ought to get complete rewrite, I might get time to do it at the end > of week. Hi! Thank you for the clarifications! Regards! -- Niclas From owner-svn-src-all@FreeBSD.ORG Thu May 24 09:59:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52E6A106564A; Thu, 24 May 2012 09:59:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2379E8FC18; Thu, 24 May 2012 09:59:59 +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 q4O9xwiN028974; Thu, 24 May 2012 09:59:58 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O9xwcd028972; Thu, 24 May 2012 09:59:58 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205240959.q4O9xwcd028972@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 May 2012 09:59: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: r235889 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 09:59:59 -0000 Author: trasz Date: Thu May 24 09:59:58 2012 New Revision: 235889 URL: http://svn.freebsd.org/changeset/base/235889 Log: MFC r226043: Remove assertion against empty NFSv4 ACLs. An empty ACL is not exactly valid - we don't allow for setting it on a file, for example - but it's not something we should assert on. For STABLE kernel, it changes nothing, because it's not compiled with INVARIANTS. If it was, it would fix crashes. It also fixes an assert in libc encountered with NFSv4 without nfsuserd(8) running. Modified: stable/9/sys/kern/subr_acl_nfs4.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_acl_nfs4.c ============================================================================== --- stable/9/sys/kern/subr_acl_nfs4.c Thu May 24 09:11:38 2012 (r235888) +++ stable/9/sys/kern/subr_acl_nfs4.c Thu May 24 09:59:58 2012 (r235889) @@ -114,7 +114,6 @@ _acl_denies(const struct acl *aclp, int if (denied_explicitly != NULL) *denied_explicitly = 0; - KASSERT(aclp->acl_cnt > 0, ("aclp->acl_cnt > 0")); KASSERT(aclp->acl_cnt <= ACL_MAX_ENTRIES, ("aclp->acl_cnt <= ACL_MAX_ENTRIES")); @@ -723,7 +722,6 @@ acl_nfs4_sync_mode_from_acl(mode_t *_mod mode_t old_mode = *_mode, mode = 0, seen = 0; const struct acl_entry *entry; - KASSERT(aclp->acl_cnt > 0, ("aclp->acl_cnt > 0")); KASSERT(aclp->acl_cnt <= ACL_MAX_ENTRIES, ("aclp->acl_cnt <= ACL_MAX_ENTRIES")); @@ -854,7 +852,6 @@ acl_nfs4_compute_inherited_acl_draft(con struct acl_entry *entry, *copy; KASSERT(child_aclp->acl_cnt == 0, ("child_aclp->acl_cnt == 0")); - KASSERT(parent_aclp->acl_cnt > 0, ("parent_aclp->acl_cnt > 0")); KASSERT(parent_aclp->acl_cnt <= ACL_MAX_ENTRIES, ("parent_aclp->acl_cnt <= ACL_MAX_ENTRIES")); @@ -1017,7 +1014,6 @@ acl_nfs4_inherit_entries(const struct ac const struct acl_entry *parent_entry; struct acl_entry *entry; - KASSERT(parent_aclp->acl_cnt > 0, ("parent_aclp->acl_cnt > 0")); KASSERT(parent_aclp->acl_cnt <= ACL_MAX_ENTRIES, ("parent_aclp->acl_cnt <= ACL_MAX_ENTRIES")); From owner-svn-src-all@FreeBSD.ORG Thu May 24 10:02:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B23B106566B; Thu, 24 May 2012 10:02:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 056F58FC12; Thu, 24 May 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 q4OA2gKu029182; Thu, 24 May 2012 10:02:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OA2gOf029180; Thu, 24 May 2012 10:02:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205241002.q4OA2gOf029180@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 May 2012 10:02:42 +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: r235890 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 10:02:43 -0000 Author: trasz Date: Thu May 24 10:02:42 2012 New Revision: 235890 URL: http://svn.freebsd.org/changeset/base/235890 Log: MFC r234385: Fix bug where NFSv4 ACL enforcement code wouldn't unconditionally allow the owner to read and write ACL and file attributes when there was no entry with subject matching the owner. In other words, 'getfacl meh' shouldn't fail for the owner if the ACL looks like this: # file: meh # owner: trasz # group: wheel user:root:------a-------:------:allow Modified: stable/9/sys/kern/subr_acl_nfs4.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_acl_nfs4.c ============================================================================== --- stable/9/sys/kern/subr_acl_nfs4.c Thu May 24 09:59:58 2012 (r235889) +++ stable/9/sys/kern/subr_acl_nfs4.c Thu May 24 10:02:42 2012 (r235890) @@ -160,6 +160,9 @@ _acl_denies(const struct acl *aclp, int return (0); } + if (access_mask == 0) + return (0); + return (1); } From owner-svn-src-all@FreeBSD.ORG Thu May 24 10:20:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC95B106564A; Thu, 24 May 2012 10:20:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 936368FC0A; Thu, 24 May 2012 10:20:23 +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 q4OAKNRN029948; Thu, 24 May 2012 10:20:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OAKNVt029943; Thu, 24 May 2012 10:20:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205241020.q4OAKNVt029943@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 May 2012 10:20:23 +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: r235891 - stable/9/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 10:20:23 -0000 Author: trasz Date: Thu May 24 10:20:23 2012 New Revision: 235891 URL: http://svn.freebsd.org/changeset/base/235891 Log: MFC r225868: Make ps(1) automatically size its column widths. Modified: stable/9/bin/ps/extern.h stable/9/bin/ps/keyword.c stable/9/bin/ps/print.c stable/9/bin/ps/ps.c stable/9/bin/ps/ps.h Directory Properties: stable/9/bin/ps/ (props changed) Modified: stable/9/bin/ps/extern.h ============================================================================== --- stable/9/bin/ps/extern.h Thu May 24 10:02:42 2012 (r235890) +++ stable/9/bin/ps/extern.h Thu May 24 10:20:23 2012 (r235891) @@ -39,63 +39,52 @@ extern fixpt_t ccpu; extern int cflag, eval, fscale, nlistread, rawcpu; extern unsigned long mempages; extern time_t now; -extern int showthreads, sumrusage, termwidth, totwidth; +extern int showthreads, sumrusage, termwidth; extern STAILQ_HEAD(velisthead, varent) varlist; __BEGIN_DECLS -void arguments(KINFO *, VARENT *); -void command(KINFO *, VARENT *); -void cputime(KINFO *, VARENT *); +char *arguments(KINFO *, VARENT *); +char *command(KINFO *, VARENT *); +char *cputime(KINFO *, VARENT *); int donlist(void); -void elapsed(KINFO *, VARENT *); -void elapseds(KINFO *, VARENT *); -void emulname(KINFO *, VARENT *); +char *elapsed(KINFO *, VARENT *); +char *elapseds(KINFO *, VARENT *); +char *emulname(KINFO *, VARENT *); VARENT *find_varentry(VAR *); const char *fmt_argv(char **, char *, size_t); double getpcpu(const KINFO *); -void kvar(KINFO *, VARENT *); -void label(KINFO *, VARENT *); -void loginclass(KINFO *, VARENT *); -void logname(KINFO *, VARENT *); -void longtname(KINFO *, VARENT *); -void lstarted(KINFO *, VARENT *); -void maxrss(KINFO *, VARENT *); -void lockname(KINFO *, VARENT *); -void mwchan(KINFO *, VARENT *); -void nwchan(KINFO *, VARENT *); -void pagein(KINFO *, VARENT *); +char *kvar(KINFO *, VARENT *); +char *label(KINFO *, VARENT *); +char *loginclass(KINFO *, VARENT *); +char *logname(KINFO *, VARENT *); +char *longtname(KINFO *, VARENT *); +char *lstarted(KINFO *, VARENT *); +char *maxrss(KINFO *, VARENT *); +char *lockname(KINFO *, VARENT *); +char *mwchan(KINFO *, VARENT *); +char *nwchan(KINFO *, VARENT *); +char *pagein(KINFO *, VARENT *); void parsefmt(const char *, int); -void pcpu(KINFO *, VARENT *); -void pmem(KINFO *, VARENT *); -void pri(KINFO *, VARENT *); +char *pcpu(KINFO *, VARENT *); +char *pmem(KINFO *, VARENT *); +char *pri(KINFO *, VARENT *); void printheader(void); -void priorityr(KINFO *, VARENT *); -void egroupname(KINFO *, VARENT *); -void rgroupname(KINFO *, VARENT *); -void runame(KINFO *, VARENT *); -void rvar(KINFO *, VARENT *); -int s_comm(KINFO *); -int s_cputime(KINFO *); -int s_label(KINFO *); -int s_loginclass(KINFO *); -int s_logname(KINFO *); -int s_egroupname(KINFO *); -int s_rgroupname(KINFO *); -int s_runame(KINFO *); -int s_systime(KINFO *); -int s_uname(KINFO *); -int s_usertime(KINFO *); +char *priorityr(KINFO *, VARENT *); +char *egroupname(KINFO *, VARENT *); +char *rgroupname(KINFO *, VARENT *); +char *runame(KINFO *, VARENT *); +char *rvar(KINFO *, VARENT *); void showkey(void); -void started(KINFO *, VARENT *); -void state(KINFO *, VARENT *); -void systime(KINFO *, VARENT *); -void tdev(KINFO *, VARENT *); -void tdnam(KINFO *, VARENT *); -void tname(KINFO *, VARENT *); -void ucomm(KINFO *, VARENT *); -void uname(KINFO *, VARENT *); -void upr(KINFO *, VARENT *); -void usertime(KINFO *, VARENT *); -void vsize(KINFO *, VARENT *); -void wchan(KINFO *, VARENT *); +char *started(KINFO *, VARENT *); +char *state(KINFO *, VARENT *); +char *systime(KINFO *, VARENT *); +char *tdev(KINFO *, VARENT *); +char *tdnam(KINFO *, VARENT *); +char *tname(KINFO *, VARENT *); +char *ucomm(KINFO *, VARENT *); +char *uname(KINFO *, VARENT *); +char *upr(KINFO *, VARENT *); +char *usertime(KINFO *, VARENT *); +char *vsize(KINFO *, VARENT *); +char *wchan(KINFO *, VARENT *); __END_DECLS Modified: stable/9/bin/ps/keyword.c ============================================================================== --- stable/9/bin/ps/keyword.c Thu May 24 10:02:42 2012 (r235890) +++ stable/9/bin/ps/keyword.c Thu May 24 10:20:23 2012 (r235891) @@ -57,178 +57,116 @@ static int vcmp(const void *, const voi #define KOFF(x) offsetof(struct kinfo_proc, x) #define ROFF(x) offsetof(struct rusage, x) -#define EMULLEN 13 /* enough for "FreeBSD ELF32" */ #define LWPFMT "d" -#define LWPLEN 6 #define NLWPFMT "d" -#define NLWPLEN 4 #define UIDFMT "u" -#define UIDLEN 5 #define PIDFMT "d" -#define PIDLEN 5 -#define USERLEN (MAXLOGNAME - 1) /* PLEASE KEEP THE TABLE BELOW SORTED ALPHABETICALLY!!! */ static VAR var[] = { - {"%cpu", "%CPU", NULL, 0, pcpu, NULL, 5, 0, CHAR, NULL, 0}, - {"%mem", "%MEM", NULL, 0, pmem, NULL, 4, 0, CHAR, NULL, 0}, - {"acflag", "ACFLG", NULL, 0, kvar, NULL, 3, KOFF(ki_acflag), USHORT, - "x", 0}, - {"acflg", "", "acflag", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"args", "COMMAND", NULL, COMM|LJUST|USER, arguments, NULL, 16, 0, + {"%cpu", "%CPU", NULL, 0, pcpu, 0, CHAR, NULL, 0}, + {"%mem", "%MEM", NULL, 0, pmem, 0, CHAR, NULL, 0}, + {"acflag", "ACFLG", NULL, 0, kvar, KOFF(ki_acflag), USHORT, "x", 0}, + {"acflg", "", "acflag", 0, NULL, 0, CHAR, NULL, 0}, + {"args", "COMMAND", NULL, COMM|LJUST|USER, arguments, 0, CHAR, NULL, 0}, - {"blocked", "", "sigmask", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"caught", "", "sigcatch", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"class", "CLASS", NULL, LJUST, loginclass, s_loginclass, - MAXLOGNAME-1, 0, CHAR, NULL, 0}, - {"comm", "COMMAND", NULL, LJUST, ucomm, s_comm, - COMMLEN + TDNAMLEN + 1, 0, CHAR, NULL, 0}, - {"command", "COMMAND", NULL, COMM|LJUST|USER, command, NULL, 16, 0, + {"blocked", "", "sigmask", 0, NULL, 0, CHAR, NULL, 0}, + {"caught", "", "sigcatch", 0, NULL, 0, CHAR, NULL, 0}, + {"class", "CLASS", NULL, LJUST, loginclass, 0, CHAR, NULL, 0}, + {"comm", "COMMAND", NULL, LJUST, ucomm, 0, CHAR, NULL, 0}, + {"command", "COMMAND", NULL, COMM|LJUST|USER, command, 0, CHAR, NULL, 0}, - {"cpu", "CPU", NULL, 0, kvar, NULL, 3, KOFF(ki_estcpu), UINT, "d", - 0}, - {"cputime", "", "time", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"egid", "", "gid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"egroup", "", "group", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"emul", "EMUL", NULL, LJUST, emulname, NULL, EMULLEN, 0, CHAR, - NULL, 0}, - {"etime", "ELAPSED", NULL, USER, elapsed, NULL, 12, 0, CHAR, NULL, 0}, - {"etimes", "ELAPSED", NULL, USER, elapseds, NULL, 12, 0, CHAR, NULL, 0}, - {"euid", "", "uid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"f", "F", NULL, 0, kvar, NULL, 8, KOFF(ki_flag), INT, "x", 0}, - {"flags", "", "f", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"gid", "GID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_groups), - UINT, UIDFMT, 0}, - {"group", "GROUP", NULL, LJUST, egroupname, s_egroupname, - USERLEN, 0, CHAR, NULL, 0}, - {"ignored", "", "sigignore", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"inblk", "INBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_inblock), LONG, - "ld", 0}, - {"inblock", "", "inblk", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"jid", "JID", NULL, 0, kvar, NULL, 6, KOFF(ki_jid), INT, "d", 0}, - {"jobc", "JOBC", NULL, 0, kvar, NULL, 4, KOFF(ki_jobc), SHORT, "d", - 0}, - {"ktrace", "KTRACE", NULL, 0, kvar, NULL, 8, KOFF(ki_traceflag), INT, - "x", 0}, - {"label", "LABEL", NULL, LJUST, label, s_label, SHRT_MAX, 0, CHAR, - NULL, 0}, - {"lim", "LIM", NULL, 0, maxrss, NULL, 5, 0, CHAR, NULL, 0}, - {"lockname", "LOCK", NULL, LJUST, lockname, NULL, 6, 0, CHAR, NULL, - 0}, - {"login", "LOGIN", NULL, LJUST, logname, s_logname, MAXLOGNAME-1, - 0, CHAR, NULL, 0}, - {"logname", "", "login", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"lstart", "STARTED", NULL, LJUST|USER, lstarted, NULL, 28, 0, CHAR, - NULL, 0}, - {"lwp", "LWP", NULL, 0, kvar, NULL, LWPLEN, KOFF(ki_tid), UINT, - LWPFMT, 0}, - {"majflt", "MAJFLT", NULL, USER, rvar, NULL, 4, ROFF(ru_majflt), - LONG, "ld", 0}, - {"minflt", "MINFLT", NULL, USER, rvar, NULL, 4, ROFF(ru_minflt), - LONG, "ld", 0}, - {"msgrcv", "MSGRCV", NULL, USER, rvar, NULL, 4, ROFF(ru_msgrcv), - LONG, "ld", 0}, - {"msgsnd", "MSGSND", NULL, USER, rvar, NULL, 4, ROFF(ru_msgsnd), - LONG, "ld", 0}, - {"mwchan", "MWCHAN", NULL, LJUST, mwchan, NULL, 6, 0, CHAR, NULL, 0}, - {"ni", "", "nice", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"nice", "NI", NULL, 0, kvar, NULL, 2, KOFF(ki_nice), CHAR, "d", - 0}, - {"nivcsw", "NIVCSW", NULL, USER, rvar, NULL, 5, ROFF(ru_nivcsw), - LONG, "ld", 0}, - {"nlwp", "NLWP", NULL, 0, kvar, NULL, NLWPLEN, KOFF(ki_numthreads), - UINT, NLWPFMT, 0}, - {"nsignals", "", "nsigs", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"nsigs", "NSIGS", NULL, USER, rvar, NULL, 4, ROFF(ru_nsignals), - LONG, "ld", 0}, - {"nswap", "NSWAP", NULL, USER, rvar, NULL, 4, ROFF(ru_nswap), - LONG, "ld", 0}, - {"nvcsw", "NVCSW", NULL, USER, rvar, NULL, 5, ROFF(ru_nvcsw), - LONG, "ld", 0}, - {"nwchan", "NWCHAN", NULL, LJUST, nwchan, NULL, sizeof(void *) * 2, 0, - CHAR, NULL, 0}, - {"oublk", "OUBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_oublock), - LONG, "ld", 0}, - {"oublock", "", "oublk", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"paddr", "PADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2, - KOFF(ki_paddr), KPTR, "lx", 0}, - {"pagein", "PAGEIN", NULL, USER, pagein, NULL, 6, 0, CHAR, NULL, 0}, - {"pcpu", "", "%cpu", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"pending", "", "sig", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"pgid", "PGID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_pgid), UINT, - PIDFMT, 0}, - {"pid", "PID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_pid), UINT, - PIDFMT, 0}, - {"pmem", "", "%mem", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"ppid", "PPID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_ppid), UINT, - PIDFMT, 0}, - {"pri", "PRI", NULL, 0, pri, NULL, 3, 0, CHAR, NULL, 0}, - {"re", "RE", NULL, INF127, kvar, NULL, 3, KOFF(ki_swtime), UINT, "d", - 0}, - {"rgid", "RGID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_rgid), - UINT, UIDFMT, 0}, - {"rgroup", "RGROUP", NULL, LJUST, rgroupname, s_rgroupname, - USERLEN, 0, CHAR, NULL, 0}, - {"rss", "RSS", NULL, 0, kvar, NULL, 6, KOFF(ki_rssize), PGTOK, "ld", 0}, - {"rtprio", "RTPRIO", NULL, 0, priorityr, NULL, 7, KOFF(ki_pri), CHAR, - NULL, 0}, - {"ruid", "RUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_ruid), - UINT, UIDFMT, 0}, - {"ruser", "RUSER", NULL, LJUST, runame, s_runame, USERLEN, - 0, CHAR, NULL, 0}, - {"sid", "SID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_sid), UINT, - PIDFMT, 0}, - {"sig", "PENDING", NULL, 0, kvar, NULL, 8, KOFF(ki_siglist), INT, - "x", 0}, - {"sigcatch", "CAUGHT", NULL, 0, kvar, NULL, 8, KOFF(ki_sigcatch), - UINT, "x", 0}, - {"sigignore", "IGNORED", NULL, 0, kvar, NULL, 8, KOFF(ki_sigignore), + {"cpu", "CPU", NULL, 0, kvar, KOFF(ki_estcpu), UINT, "d", 0}, + {"cputime", "", "time", 0, NULL, 0, CHAR, NULL, 0}, + {"egid", "", "gid", 0, NULL, 0, CHAR, NULL, 0}, + {"egroup", "", "group", 0, NULL, 0, CHAR, NULL, 0}, + {"emul", "EMUL", NULL, LJUST, emulname, 0, CHAR, NULL, 0}, + {"etime", "ELAPSED", NULL, USER, elapsed, 0, CHAR, NULL, 0}, + {"etimes", "ELAPSED", NULL, USER, elapseds, 0, CHAR, NULL, 0}, + {"euid", "", "uid", 0, NULL, 0, CHAR, NULL, 0}, + {"f", "F", NULL, 0, kvar, KOFF(ki_flag), INT, "x", 0}, + {"flags", "", "f", 0, NULL, 0, CHAR, NULL, 0}, + {"gid", "GID", NULL, 0, kvar, KOFF(ki_groups), UINT, UIDFMT, 0}, + {"group", "GROUP", NULL, LJUST, egroupname, 0, CHAR, NULL, 0}, + {"ignored", "", "sigignore", 0, NULL, 0, CHAR, NULL, 0}, + {"inblk", "INBLK", NULL, USER, rvar, ROFF(ru_inblock), LONG, "ld", 0}, + {"inblock", "", "inblk", 0, NULL, 0, CHAR, NULL, 0}, + {"jid", "JID", NULL, 0, kvar, KOFF(ki_jid), INT, "d", 0}, + {"jobc", "JOBC", NULL, 0, kvar, KOFF(ki_jobc), SHORT, "d", 0}, + {"ktrace", "KTRACE", NULL, 0, kvar, KOFF(ki_traceflag), INT, "x", 0}, + {"label", "LABEL", NULL, LJUST, label, 0, CHAR, NULL, 0}, + {"lim", "LIM", NULL, 0, maxrss, 0, CHAR, NULL, 0}, + {"lockname", "LOCK", NULL, LJUST, lockname, 0, CHAR, NULL, 0}, + {"login", "LOGIN", NULL, LJUST, logname, 0, CHAR, NULL, 0}, + {"logname", "", "login", 0, NULL, 0, CHAR, NULL, 0}, + {"lstart", "STARTED", NULL, LJUST|USER, lstarted, 0, CHAR, NULL, 0}, + {"lwp", "LWP", NULL, 0, kvar, KOFF(ki_tid), UINT, LWPFMT, 0}, + {"majflt", "MAJFLT", NULL, USER, rvar, ROFF(ru_majflt), LONG, "ld", 0}, + {"minflt", "MINFLT", NULL, USER, rvar, ROFF(ru_minflt), LONG, "ld", 0}, + {"msgrcv", "MSGRCV", NULL, USER, rvar, ROFF(ru_msgrcv), LONG, "ld", 0}, + {"msgsnd", "MSGSND", NULL, USER, rvar, ROFF(ru_msgsnd), LONG, "ld", 0}, + {"mwchan", "MWCHAN", NULL, LJUST, mwchan, 0, CHAR, NULL, 0}, + {"ni", "", "nice", 0, NULL, 0, CHAR, NULL, 0}, + {"nice", "NI", NULL, 0, kvar, KOFF(ki_nice), CHAR, "d", 0}, + {"nivcsw", "NIVCSW", NULL, USER, rvar, ROFF(ru_nivcsw), LONG, "ld", 0}, + {"nlwp", "NLWP", NULL, 0, kvar, KOFF(ki_numthreads), UINT, NLWPFMT, 0}, + {"nsignals", "", "nsigs", 0, NULL, 0, CHAR, NULL, 0}, + {"nsigs", "NSIGS", NULL, USER, rvar, ROFF(ru_nsignals), LONG, "ld", 0}, + {"nswap", "NSWAP", NULL, USER, rvar, ROFF(ru_nswap), LONG, "ld", 0}, + {"nvcsw", "NVCSW", NULL, USER, rvar, ROFF(ru_nvcsw), LONG, "ld", 0}, + {"nwchan", "NWCHAN", NULL, LJUST, nwchan, 0, CHAR, NULL, 0}, + {"oublk", "OUBLK", NULL, USER, rvar, ROFF(ru_oublock), LONG, "ld", 0}, + {"oublock", "", "oublk", 0, NULL, 0, CHAR, NULL, 0}, + {"paddr", "PADDR", NULL, 0, kvar, KOFF(ki_paddr), KPTR, "lx", 0}, + {"pagein", "PAGEIN", NULL, USER, pagein, 0, CHAR, NULL, 0}, + {"pcpu", "", "%cpu", 0, NULL, 0, CHAR, NULL, 0}, + {"pending", "", "sig", 0, NULL, 0, CHAR, NULL, 0}, + {"pgid", "PGID", NULL, 0, kvar, KOFF(ki_pgid), UINT, PIDFMT, 0}, + {"pid", "PID", NULL, 0, kvar, KOFF(ki_pid), UINT, PIDFMT, 0}, + {"pmem", "", "%mem", 0, NULL, 0, CHAR, NULL, 0}, + {"ppid", "PPID", NULL, 0, kvar, KOFF(ki_ppid), UINT, PIDFMT, 0}, + {"pri", "PRI", NULL, 0, pri, 0, CHAR, NULL, 0}, + {"re", "RE", NULL, INF127, kvar, KOFF(ki_swtime), UINT, "d", 0}, + {"rgid", "RGID", NULL, 0, kvar, KOFF(ki_rgid), UINT, UIDFMT, 0}, + {"rgroup", "RGROUP", NULL, LJUST, rgroupname, 0, CHAR, NULL, 0}, + {"rss", "RSS", NULL, 0, kvar, KOFF(ki_rssize), PGTOK, "ld", 0}, + {"rtprio", "RTPRIO", NULL, 0, priorityr, KOFF(ki_pri), CHAR, NULL, 0}, + {"ruid", "RUID", NULL, 0, kvar, KOFF(ki_ruid), UINT, UIDFMT, 0}, + {"ruser", "RUSER", NULL, LJUST, runame, 0, CHAR, NULL, 0}, + {"sid", "SID", NULL, 0, kvar, KOFF(ki_sid), UINT, PIDFMT, 0}, + {"sig", "PENDING", NULL, 0, kvar, KOFF(ki_siglist), INT, "x", 0}, + {"sigcatch", "CAUGHT", NULL, 0, kvar, KOFF(ki_sigcatch), UINT, "x", 0}, + {"sigignore", "IGNORED", NULL, 0, kvar, KOFF(ki_sigignore), UINT, "x", 0}, - {"sigmask", "BLOCKED", NULL, 0, kvar, NULL, 8, KOFF(ki_sigmask), - UINT, "x", 0}, - {"sl", "SL", NULL, INF127, kvar, NULL, 3, KOFF(ki_slptime), UINT, "d", - 0}, - {"start", "STARTED", NULL, LJUST|USER, started, NULL, 7, 0, CHAR, NULL, - 0}, - {"stat", "", "state", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"state", "STAT", NULL, 0, state, NULL, 4, 0, CHAR, NULL, 0}, - {"svgid", "SVGID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svgid), - UINT, UIDFMT, 0}, - {"svuid", "SVUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svuid), - UINT, UIDFMT, 0}, - {"systime", "SYSTIME", NULL, USER, systime, s_systime, 15, 0, CHAR, - NULL, 0}, - {"tdaddr", "TDADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2, - KOFF(ki_tdaddr), KPTR, "lx", 0}, - {"tdev", "TDEV", NULL, 0, tdev, NULL, 5, 0, CHAR, NULL, 0}, - {"tdnam", "TDNAM", NULL, LJUST, tdnam, NULL, COMMLEN, 0, CHAR, NULL, 0}, - {"time", "TIME", NULL, USER, cputime, s_cputime, 15, 0, CHAR, - NULL, 0}, - {"tpgid", "TPGID", NULL, 0, kvar, NULL, 4, KOFF(ki_tpgid), UINT, - PIDFMT, 0}, - {"tsid", "TSID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_tsid), UINT, - PIDFMT, 0}, - {"tsiz", "TSIZ", NULL, 0, kvar, NULL, 4, KOFF(ki_tsize), PGTOK, "ld", 0}, - {"tt", "TT ", NULL, 0, tname, NULL, 4, 0, CHAR, NULL, 0}, - {"tty", "TTY", NULL, LJUST, longtname, NULL, 8, 0, CHAR, NULL, 0}, - {"ucomm", "UCOMM", NULL, LJUST, ucomm, s_comm, - COMMLEN + TDNAMLEN + 1, 0, CHAR, NULL, 0}, - {"uid", "UID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_uid), UINT, - UIDFMT, 0}, - {"upr", "UPR", NULL, 0, upr, NULL, 3, 0, CHAR, NULL, 0}, - {"uprocp", "UPROCP", NULL, 0, kvar, NULL, sizeof(void *) * 2, - KOFF(ki_paddr), KPTR, "lx", 0}, - {"user", "USER", NULL, LJUST, uname, s_uname, USERLEN, 0, CHAR, - NULL, 0}, - {"usertime", "USERTIME", NULL, USER, usertime, s_usertime, 15, 0, - CHAR, NULL, 0}, - {"usrpri", "", "upr", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"vsize", "", "vsz", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"vsz", "VSZ", NULL, 0, vsize, NULL, 6, 0, CHAR, NULL, 0}, - {"wchan", "WCHAN", NULL, LJUST, wchan, NULL, 6, 0, CHAR, NULL, 0}, - {"xstat", "XSTAT", NULL, 0, kvar, NULL, 4, KOFF(ki_xstat), USHORT, - "x", 0}, - {"", NULL, NULL, 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, + {"sigmask", "BLOCKED", NULL, 0, kvar, KOFF(ki_sigmask), UINT, "x", 0}, + {"sl", "SL", NULL, INF127, kvar, KOFF(ki_slptime), UINT, "d", 0}, + {"start", "STARTED", NULL, LJUST|USER, started, 0, CHAR, NULL, 0}, + {"stat", "", "state", 0, NULL, 0, CHAR, NULL, 0}, + {"state", "STAT", NULL, LJUST, state, 0, CHAR, NULL, 0}, + {"svgid", "SVGID", NULL, 0, kvar, KOFF(ki_svgid), UINT, UIDFMT, 0}, + {"svuid", "SVUID", NULL, 0, kvar, KOFF(ki_svuid), UINT, UIDFMT, 0}, + {"systime", "SYSTIME", NULL, USER, systime, 0, CHAR, NULL, 0}, + {"tdaddr", "TDADDR", NULL, 0, kvar, KOFF(ki_tdaddr), KPTR, "lx", 0}, + {"tdev", "TDEV", NULL, 0, tdev, 0, CHAR, NULL, 0}, + {"tdnam", "TDNAM", NULL, LJUST, tdnam, 0, CHAR, NULL, 0}, + {"time", "TIME", NULL, USER, cputime, 0, CHAR, NULL, 0}, + {"tpgid", "TPGID", NULL, 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0}, + {"tsid", "TSID", NULL, 0, kvar, KOFF(ki_tsid), UINT, PIDFMT, 0}, + {"tsiz", "TSIZ", NULL, 0, kvar, KOFF(ki_tsize), PGTOK, "ld", 0}, + {"tt", "TT ", NULL, 0, tname, 0, CHAR, NULL, 0}, + {"tty", "TTY", NULL, LJUST, longtname, 0, CHAR, NULL, 0}, + {"ucomm", "UCOMM", NULL, LJUST, ucomm, 0, CHAR, NULL, 0}, + {"uid", "UID", NULL, 0, kvar, KOFF(ki_uid), UINT, UIDFMT, 0}, + {"upr", "UPR", NULL, 0, upr, 0, CHAR, NULL, 0}, + {"uprocp", "UPROCP", NULL, 0, kvar, KOFF(ki_paddr), KPTR, "lx", 0}, + {"user", "USER", NULL, LJUST, uname, 0, CHAR, NULL, 0}, + {"usertime", "USERTIME", NULL, USER, usertime, 0, CHAR, NULL, 0}, + {"usrpri", "", "upr", 0, NULL, 0, CHAR, NULL, 0}, + {"vsize", "", "vsz", 0, NULL, 0, CHAR, NULL, 0}, + {"vsz", "VSZ", NULL, 0, vsize, 0, CHAR, NULL, 0}, + {"wchan", "WCHAN", NULL, LJUST, wchan, 0, CHAR, NULL, 0}, + {"xstat", "XSTAT", NULL, 0, kvar, KOFF(ki_xstat), USHORT, "x", 0}, + {"", NULL, NULL, 0, NULL, 0, CHAR, NULL, 0}, }; void Modified: stable/9/bin/ps/print.c ============================================================================== --- stable/9/bin/ps/print.c Thu May 24 10:02:42 2012 (r235890) +++ stable/9/bin/ps/print.c Thu May 24 10:20:23 2012 (r235891) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #include "ps.h" +#define COMMAND_WIDTH 16 +#define ARGUMENTS_WIDTH 16 + #define ps_pgtok(a) (((a) * getpagesize()) / 1024) void @@ -93,53 +96,42 @@ printheader(void) (void)putchar('\n'); } -void +char * arguments(KINFO *k, VARENT *ve) { VAR *v; - int left; - char *cp, *vis_args; + char *vis_args; v = ve->var; if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL) errx(1, "malloc failed"); strvis(vis_args, k->ki_args, VIS_TAB | VIS_NL | VIS_NOSLASH); - if (STAILQ_NEXT(ve, next_ve) == NULL) { - /* last field */ - if (termwidth == UNLIMITED) { - (void)printf("%s", vis_args); - } else { - left = termwidth - (totwidth - v->width); - if (left < 1) /* already wrapped, just use std width */ - left = v->width; - for (cp = vis_args; --left >= 0 && *cp != '\0';) - (void)putchar(*cp++); - } - } else { - (void)printf("%-*.*s", v->width, v->width, vis_args); - } - free(vis_args); + + if (STAILQ_NEXT(ve, next_ve) != NULL && strlen(vis_args) > ARGUMENTS_WIDTH) + vis_args[ARGUMENTS_WIDTH] = '\0'; + + return (vis_args); } -void +char * command(KINFO *k, VARENT *ve) { VAR *v; - int left; - char *cp, *vis_env, *vis_args; + char *vis_args, *vis_env, *str; v = ve->var; if (cflag) { /* If it is the last field, then don't pad */ if (STAILQ_NEXT(ve, next_ve) == NULL) { - if (k->ki_d.prefix) - (void)printf("%s", k->ki_d.prefix); - (void)printf("%s", k->ki_p->ki_comm); - if (showthreads && k->ki_p->ki_numthreads > 1) - (void)printf("/%s", k->ki_p->ki_tdname); + asprintf(&str, "%s%s%s%s", + k->ki_d.prefix ? k->ki_d.prefix : "", + k->ki_p->ki_comm, + (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "", + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : ""); } else - (void)printf("%-*s", v->width, k->ki_p->ki_comm); - return; + str = strdup(k->ki_p->ki_comm); + + return (str); } if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL) errx(1, "malloc failed"); @@ -157,89 +149,84 @@ command(KINFO *k, VARENT *ve) } else vis_env = NULL; - if (termwidth == UNLIMITED) { - if (k->ki_d.prefix) - (void)printf("%s", k->ki_d.prefix); - if (vis_env) - (void)printf("%s ", vis_env); - (void)printf("%s", vis_args); - } else { - left = termwidth - (totwidth - v->width); - if (left < 1) /* already wrapped, just use std width */ - left = v->width; - if ((cp = k->ki_d.prefix) != NULL) - while (--left >= 0 && *cp) - (void)putchar(*cp++); - if ((cp = vis_env) != NULL) { - while (--left >= 0 && *cp) - (void)putchar(*cp++); - if (--left >= 0) - putchar(' '); - } - for (cp = vis_args; --left >= 0 && *cp != '\0';) - (void)putchar(*cp++); - } + asprintf(&str, "%s%s%s%s", + k->ki_d.prefix ? k->ki_d.prefix : "", + vis_env ? vis_env : "", + vis_env ? " " : "", + vis_args); + if (vis_env != NULL) free(vis_env); - } else + free(vis_args); + } else { /* ki_d.prefix & ki_env aren't shown for interim fields */ - (void)printf("%-*.*s", v->width, v->width, vis_args); - free(vis_args); + str = vis_args; + + if (strlen(str) > COMMAND_WIDTH) + str[COMMAND_WIDTH] = '\0'; + } + + return (str); } -void +char * ucomm(KINFO *k, VARENT *ve) { - char tmpbuff[COMMLEN + TDNAMLEN + 2]; VAR *v; + char *str; v = ve->var; if (STAILQ_NEXT(ve, next_ve) == NULL) { /* last field, don't pad */ - if (k->ki_d.prefix) - (void)printf("%s", k->ki_d.prefix); - (void)printf("%s", k->ki_p->ki_comm); - if (showthreads && k->ki_p->ki_numthreads > 1) - printf("/%s", k->ki_p->ki_tdname); + asprintf(&str, "%s%s%s%s", + k->ki_d.prefix ? k->ki_d.prefix : "", + k->ki_p->ki_comm, + (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "", + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : ""); } else { - bzero(tmpbuff, sizeof(tmpbuff)); if (showthreads && k->ki_p->ki_numthreads > 1) - sprintf(tmpbuff, "%s/%s", k->ki_p->ki_comm, - k->ki_p->ki_tdname); + asprintf(&str, "%s/%s", k->ki_p->ki_comm, k->ki_p->ki_tdname); else - sprintf(tmpbuff, "%s", k->ki_p->ki_comm); - (void)printf("%-*s", v->width, tmpbuff); + str = strdup(k->ki_p->ki_comm); } + return (str); } -void +char * tdnam(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; if (showthreads && k->ki_p->ki_numthreads > 1) - (void)printf("%-*s", v->width, k->ki_p->ki_tdname); + str = strdup(k->ki_p->ki_tdname); else - (void)printf("%-*s", v->width, " "); + str = strdup(" "); + + return (str); } -void +char * logname(KINFO *k, VARENT *ve) { VAR *v; - char *s; v = ve->var; - (void)printf("%-*s", v->width, (s = k->ki_p->ki_login, *s) ? s : "-"); + if (*k->ki_p->ki_login == '\0') + return (NULL); + return (strdup(k->ki_p->ki_login)); } -void +char * state(KINFO *k, VARENT *ve) { int flag, tdflags; - char *cp; + char *cp, *buf; VAR *v; - char buf[16]; + + buf = malloc(16); + if (buf == NULL) + errx(1, "malloc failed"); v = ve->var; flag = k->ki_p->ki_flag; @@ -301,278 +288,270 @@ state(KINFO *k, VARENT *ve) if (flag & P_JAILED) *cp++ = 'J'; *cp = '\0'; - (void)printf("%-*s", v->width, buf); + return (buf); } #define scalepri(x) ((x) - PZERO) -void +char * pri(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; - (void)printf("%*d", v->width, scalepri(k->ki_p->ki_pri.pri_level)); + asprintf(&str, "%d", scalepri(k->ki_p->ki_pri.pri_level)); + return (str); } -void +char * upr(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; - (void)printf("%*d", v->width, scalepri(k->ki_p->ki_pri.pri_user)); + asprintf(&str, "%d", scalepri(k->ki_p->ki_pri.pri_user)); + return (str); } #undef scalepri -void +char * uname(KINFO *k, VARENT *ve) { VAR *v; v = ve->var; - (void)printf("%-*s", v->width, user_from_uid(k->ki_p->ki_uid, 0)); -} - -int -s_uname(KINFO *k) -{ - return (strlen(user_from_uid(k->ki_p->ki_uid, 0))); + return (strdup(user_from_uid(k->ki_p->ki_uid, 0))); } -void +char * egroupname(KINFO *k, VARENT *ve) { VAR *v; v = ve->var; - (void)printf("%-*s", v->width, - group_from_gid(k->ki_p->ki_groups[0], 0)); -} - -int -s_egroupname(KINFO *k) -{ - return (strlen(group_from_gid(k->ki_p->ki_groups[0], 0))); + return (strdup(group_from_gid(k->ki_p->ki_groups[0], 0))); } -void +char * rgroupname(KINFO *k, VARENT *ve) { VAR *v; v = ve->var; - (void)printf("%-*s", v->width, group_from_gid(k->ki_p->ki_rgid, 0)); -} - -int -s_rgroupname(KINFO *k) -{ - return (strlen(group_from_gid(k->ki_p->ki_rgid, 0))); + return (strdup(group_from_gid(k->ki_p->ki_rgid, 0))); } -void +char * runame(KINFO *k, VARENT *ve) { VAR *v; v = ve->var; - (void)printf("%-*s", v->width, user_from_uid(k->ki_p->ki_ruid, 0)); + return (strdup(user_from_uid(k->ki_p->ki_ruid, 0))); } -int -s_runame(KINFO *k) -{ - return (strlen(user_from_uid(k->ki_p->ki_ruid, 0))); -} - - -void +char * tdev(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; - char buff[16]; + char *str; v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV) - (void)printf("%*s", v->width, "??"); - else { - (void)snprintf(buff, sizeof(buff), - "%d/%d", major(dev), minor(dev)); - (void)printf("%*s", v->width, buff); - } + str = strdup("??"); + else + asprintf(&str, "%d/%d", major(dev), minor(dev)); + + return (str); } -void +char * tname(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; - char *ttname; + char *ttname, *str; v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) - (void)printf("%*s ", v->width - 1, "??"); + str = strdup("?? "); else { if (strncmp(ttname, "tty", 3) == 0 || strncmp(ttname, "cua", 3) == 0) ttname += 3; if (strncmp(ttname, "pts/", 4) == 0) ttname += 4; - (void)printf("%*.*s%c", v->width - 1, v->width - 1, ttname, + asprintf(&str, "%s%c", ttname, k->ki_p->ki_kiflag & KI_CTTY ? ' ' : '-'); } + + return (str); } -void +char * longtname(KINFO *k, VARENT *ve) { VAR *v; dev_t dev; - char *ttname; + const char *ttname; v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) - (void)printf("%-*s", v->width, "??"); - else - (void)printf("%-*s", v->width, ttname); + ttname = "??"; + + return (strdup(ttname)); } -void +char * started(KINFO *k, VARENT *ve) { VAR *v; time_t then; struct tm *tp; static int use_ampm = -1; - char buf[100]; + size_t buflen = 100; + char *buf; + + buf = malloc(buflen); + if (buf == NULL) + errx(1, "malloc failed"); v = ve->var; - if (!k->ki_valid) { - (void)printf("%-*s", v->width, "-"); - return; - } + if (!k->ki_valid) + return (NULL); if (use_ampm < 0) use_ampm = (*nl_langinfo(T_FMT_AMPM) != '\0'); then = k->ki_p->ki_start.tv_sec; tp = localtime(&then); if (now - k->ki_p->ki_start.tv_sec < 24 * 3600) { - (void)strftime(buf, sizeof(buf), + (void)strftime(buf, buflen, use_ampm ? "%l:%M%p" : "%k:%M ", tp); } else if (now - k->ki_p->ki_start.tv_sec < 7 * 86400) { - (void)strftime(buf, sizeof(buf), + (void)strftime(buf, buflen, use_ampm ? "%a%I%p" : "%a%H ", tp); } else - (void)strftime(buf, sizeof(buf), "%e%b%y", tp); - (void)printf("%-*s", v->width, buf); + (void)strftime(buf, buflen, "%e%b%y", tp); + return (buf); } -void +char * lstarted(KINFO *k, VARENT *ve) { VAR *v; time_t then; - char buf[100]; + char *buf; + size_t buflen = 100; + + buf = malloc(buflen); + if (buf == NULL) + errx(1, "malloc failed"); v = ve->var; - if (!k->ki_valid) { - (void)printf("%-*s", v->width, "-"); - return; - } + if (!k->ki_valid) + return (NULL); then = k->ki_p->ki_start.tv_sec; - (void)strftime(buf, sizeof(buf), "%c", localtime(&then)); - (void)printf("%-*s", v->width, buf); + (void)strftime(buf, buflen, "%c", localtime(&then)); + return (buf); } -void +char * lockname(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; if (k->ki_p->ki_kiflag & KI_LOCKBLOCK) { if (k->ki_p->ki_lockname[0] != 0) - (void)printf("%-*.*s", v->width, v->width, - k->ki_p->ki_lockname); + str = strdup(k->ki_p->ki_lockname); else - (void)printf("%-*s", v->width, "???"); + str = strdup("???"); } else - (void)printf("%-*s", v->width, "-"); + str = NULL; + + return (str); } -void +char * wchan(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; if (k->ki_p->ki_wchan) { if (k->ki_p->ki_wmesg[0] != 0) - (void)printf("%-*.*s", v->width, v->width, - k->ki_p->ki_wmesg); + str = strdup(k->ki_p->ki_wmesg); else - (void)printf("%-*lx", v->width, - (long)k->ki_p->ki_wchan); + asprintf(&str, "%lx", (long)k->ki_p->ki_wchan); } else - (void)printf("%-*s", v->width, "-"); + str = NULL; + + return (str); } -void +char * nwchan(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; - if (k->ki_p->ki_wchan) { - (void)printf("%0*lx", v->width, - (long)k->ki_p->ki_wchan); - } else - (void)printf("%-*s", v->width, "-"); + if (k->ki_p->ki_wchan) + asprintf(&str, "%0lx", (long)k->ki_p->ki_wchan); + else + str = NULL; + + return (str); } -void +char * mwchan(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; if (k->ki_p->ki_wchan) { if (k->ki_p->ki_wmesg[0] != 0) - (void)printf("%-*.*s", v->width, v->width, - k->ki_p->ki_wmesg); + str = strdup(k->ki_p->ki_wmesg); else - (void)printf("%-*lx", v->width, - (long)k->ki_p->ki_wchan); + asprintf(&str, "%lx", (long)k->ki_p->ki_wchan); } else if (k->ki_p->ki_kiflag & KI_LOCKBLOCK) { if (k->ki_p->ki_lockname[0]) { - (void)printf("%-*.*s", v->width, v->width, - k->ki_p->ki_lockname); + str = strdup(k->ki_p->ki_lockname); } else - (void)printf("%-*s", v->width, "???"); + str = strdup("???"); } else - (void)printf("%-*s", v->width, "-"); + str = NULL; + + return (str); } -void +char * vsize(KINFO *k, VARENT *ve) { VAR *v; + char *str; v = ve->var; - (void)printf("%*lu", v->width, (u_long)(k->ki_p->ki_size / 1024)); + asprintf(&str, "%lu", (u_long)(k->ki_p->ki_size / 1024)); + return (str); } -static void +static char * printtime(KINFO *k, VARENT *ve, long secs, long psecs) /* psecs is "parts" of a second. first micro, then centi */ { VAR *v; - char obuff[128]; static char decimal_point; + char *str; if (decimal_point == '\0') decimal_point = localeconv()->decimal_point[0]; @@ -586,21 +565,12 @@ printtime(KINFO *k, VARENT *ve, long sec secs += psecs / 100; psecs = psecs % 100; } - (void)snprintf(obuff, sizeof(obuff), "%ld:%02ld%c%02ld", + asprintf(&str, "%ld:%02ld%c%02ld", secs / 60, secs % 60, decimal_point, psecs); - (void)printf("%*s", v->width, obuff); + return (str); } -static int -sizetime(long secs) -{ - - if (secs < 60) - return (7); - return (log10(secs / 60) + 7); -} - -void +char * cputime(KINFO *k, VARENT *ve) { long secs, psecs; @@ -616,10 +586,10 @@ cputime(KINFO *k, VARENT *ve) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 24 10:31:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3DAC1065670; Thu, 24 May 2012 10:31:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD8248FC12; Thu, 24 May 2012 10:31: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 q4OAVHwZ032440; Thu, 24 May 2012 10:31:17 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OAVHA3032438; Thu, 24 May 2012 10:31:17 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205241031.q4OAVHA3032438@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 May 2012 10:31:17 +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: r235893 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 10:31:18 -0000 Author: trasz Date: Thu May 24 10:31:17 2012 New Revision: 235893 URL: http://svn.freebsd.org/changeset/base/235893 Log: MFC r232782: Remove useless thread_{lock,unlock}() in raccd. Modified: stable/9/sys/kern/kern_racct.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_racct.c ============================================================================== --- stable/9/sys/kern/kern_racct.c Thu May 24 10:30:13 2012 (r235892) +++ stable/9/sys/kern/kern_racct.c Thu May 24 10:31:17 2012 (r235893) @@ -718,11 +718,8 @@ racctd(void) timevalsub(&wallclock, &p->p_stats->p_start); PROC_LOCK(p); PROC_SLOCK(p); - FOREACH_THREAD_IN_PROC(p, td) { + FOREACH_THREAD_IN_PROC(p, td) ruxagg(p, td); - thread_lock(td); - thread_unlock(td); - } runtime = cputick2usec(p->p_rux.rux_runtime); PROC_SUNLOCK(p); #ifdef notyet From owner-svn-src-all@FreeBSD.ORG Thu May 24 10:47:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C083106564A; Thu, 24 May 2012 10:47:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) by mx1.freebsd.org (Postfix) with ESMTP id F039A8FC0A; Thu, 24 May 2012 10:47:21 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1SXVZp-000HKC-BZ; Thu, 24 May 2012 14:47:29 +0400 Message-ID: <4FBE1120.8020704@FreeBSD.org> Date: Thu, 24 May 2012 14:44:48 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120121 Thunderbird/9.0 MIME-Version: 1.0 To: Jung-uk Kim References: <201205212219.q4LMJKR9076035@svn.freebsd.org> <4FBD7E65.1060205@FreeBSD.org> In-Reply-To: <4FBD7E65.1060205@FreeBSD.org> Content-Type: multipart/mixed; boundary="------------010906000107090302010705" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235746 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 10:47:22 -0000 This is a multi-part message in MIME format. --------------010906000107090302010705 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 24.05.2012 04:18, Jung-uk Kim wrote: ... >> @@ -1664,7 +1668,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro >> struct bpf_insn *fcode, *old; u_int wfilter, flen, size; #ifdef >> BPF_JITTER - bpf_jit_filter *ofunc; + bpf_jit_filter *ofunc, >> *jfunc; #endif int need_upgrade; #ifdef COMPAT_FREEBSD32 @@ -1695,6 >> +1699,13 @@ bpf_setf(struct bpf_d *d, struct bpf_pro else fcode = >> NULL; /* Make compiler happy */ >> >> +#ifdef BPF_JITTER + if (fp->bf_insns != NULL) + jfunc = >> bpf_jitter(fcode, flen); + else + jfunc = NULL; /* Make compiler >> happy */ +#endif + BPF_LOCK(); >> >> if (cmd == BIOCSETWF) { > ... > > This is completely wrong. First, fcode has not been initialized with Ups. Does the attached patch look ok to you? --------------010906000107090302010705 Content-Type: text/plain; name="bpf_jitter.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bpf_jitter.diff" SW5kZXg6IHN5cy9uZXQvYnBmLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL25ldC9icGYuYwko cmV2aXNpb24gMjM1NzUwKQorKysgc3lzL25ldC9icGYuYwkod29ya2luZyBjb3B5KQpAQCAt MTczNyw5ICsxNzM3LDE2IEBAIGJwZl9zZXRmKHN0cnVjdCBicGZfZCAqZCwgc3RydWN0IGJw Zl9wcm9ncmFtICpmcCwKIAogCW5lZWRfdXBncmFkZSA9IDA7CiAJc2l6ZSA9IGZsZW4gKiBz aXplb2YoKmZwLT5iZl9pbnNucyk7Ci0JaWYgKHNpemUgPiAwKQorCWlmIChzaXplID4gMCkg eworCQkvKiBXZSdyZSBzZXR0aW5nIHVwIG5ldyBmaWx0ZXIuIENvcHkgYW5kIGNoZWNrIGFj dHVhbCBkYXRhICovCiAJCWZjb2RlID0gKHN0cnVjdCBicGZfaW5zbiAqKW1hbGxvYyhzaXpl LCBNX0JQRiwgTV9XQUlUT0spOwotCWVsc2UKKwkJaWYgKGNvcHlpbigoY2FkZHJfdClmcC0+ YmZfaW5zbnMsIChjYWRkcl90KWZjb2RlLCBzaXplKSAhPSAwIHx8CisJCSAgICAoYnBmX3Zh bGlkYXRlKGZjb2RlLCAoaW50KWZsZW4pID09IDApKSB7CisJCQlmcmVlKGZjb2RlLCBNX0JQ Rik7CisJCQlyZXR1cm4gKEVJTlZBTCk7CisJCX0KKwkJLyogRmlsdGVyIGlzIGNvcGllZCBp bnNpZGUgZmNvZGUgYW5kIGlzIHBlcmZlY3RseSB2YWxpZCAqLworCX0gZWxzZQogCQlmY29k ZSA9IE5VTEw7IC8qIE1ha2UgY29tcGlsZXIgaGFwcHkgKi8KIAogI2lmZGVmIEJQRl9KSVRU RVIKQEAgLTE3OTUsNTUgKzE4MDIsNTAgQEAgYnBmX3NldGYoc3RydWN0IGJwZl9kICpkLCBz dHJ1Y3QgYnBmX3Byb2dyYW0gKmZwLAogCQlyZXR1cm4gKDApOwogCX0KIAotCWlmIChjb3B5 aW4oKGNhZGRyX3QpZnAtPmJmX2luc25zLCAoY2FkZHJfdClmY29kZSwgc2l6ZSkgPT0gMCAm JgotCSAgICBicGZfdmFsaWRhdGUoZmNvZGUsIChpbnQpZmxlbikpIHsKLQkJLyogCi0JCSAq IFByb3RlY3QgZmlsdGVyIGNoYW5nZSBieSBpbnRlcmZhY2UgbG9jawotCQkgKiBBZGRpdGlv bmFsbHksIHdlIGFyZSBwcm90ZWN0ZWQgYnkgZ2xvYmFsIGxvY2sgaGVyZS4KLQkJICovCi0J CWlmIChkLT5iZF9iaWYgIT0gTlVMTCkKLQkJCUJQRklGX1dMT0NLKGQtPmJkX2JpZik7Ci0J CUJQRkRfTE9DSyhkKTsKLQkJaWYgKHdmaWx0ZXIpCi0JCQlkLT5iZF93ZmlsdGVyID0gZmNv ZGU7Ci0JCWVsc2UgewotCQkJZC0+YmRfcmZpbHRlciA9IGZjb2RlOworCS8qIAorCSAqIFNl dCB1cCBuZXcgZmlsdGVyLgorCSAqIFByb3RlY3QgZmlsdGVyIGNoYW5nZSBieSBpbnRlcmZh Y2UgbG9jaworCSAqIEFkZGl0aW9uYWxseSwgd2UgYXJlIHByb3RlY3RlZCBieSBnbG9iYWwg bG9jayBoZXJlLgorCSAqLworCWlmIChkLT5iZF9iaWYgIT0gTlVMTCkKKwkJQlBGSUZfV0xP Q0soZC0+YmRfYmlmKTsKKwlCUEZEX0xPQ0soZCk7CisJaWYgKHdmaWx0ZXIpCisJCWQtPmJk X3dmaWx0ZXIgPSBmY29kZTsKKwllbHNlIHsKKwkJZC0+YmRfcmZpbHRlciA9IGZjb2RlOwog I2lmZGVmIEJQRl9KSVRURVIKLQkJCWQtPmJkX2JmaWx0ZXIgPSBqZnVuYzsKKwkJZC0+YmRf YmZpbHRlciA9IGpmdW5jOwogI2VuZGlmCi0JCQlpZiAoY21kID09IEJJT0NTRVRGKQotCQkJ CXJlc2V0X2QoZCk7CisJCWlmIChjbWQgPT0gQklPQ1NFVEYpCisJCQlyZXNldF9kKGQpOwog Ci0JCQkvKgotCQkJICogRG8gbm90IHJlcXVpcmUgdXBncmFkZSBieSBmaXJzdCBCSU9DU0VU RgotCQkJICogKHVzZWQgdG8gc2V0IHNuYXBsZW4pIGJ5IHBjYXBfb3Blbl9saXZlKCkKLQkJ CSAqLwotCQkJaWYgKChkLT5iZF93cml0ZXIgIT0gMCkgJiYgKC0tZC0+YmRfd3JpdGVyID09 IDApKQotCQkJCW5lZWRfdXBncmFkZSA9IDE7Ci0JCQlDVFI0KEtUUl9ORVQsICIlczogZmls dGVyIGZ1bmN0aW9uIHNldCBieSBwaWQgJWQsICIKLQkJCSAgICAiYmRfd3JpdGVyIGNvdW50 ZXIgJWQsIG5lZWRfdXBncmFkZSAlZCIsCi0JCQkgICAgX19mdW5jX18sIGQtPmJkX3BpZCwg ZC0+YmRfd3JpdGVyLCBuZWVkX3VwZ3JhZGUpOwotCQl9Ci0JCUJQRkRfVU5MT0NLKGQpOwot CQlpZiAoZC0+YmRfYmlmICE9IE5VTEwpCi0JCQlCUEZJRl9XVU5MT0NLKGQtPmJkX2JpZik7 Ci0JCWlmIChvbGQgIT0gTlVMTCkKLQkJCWZyZWUoKGNhZGRyX3Qpb2xkLCBNX0JQRik7CisJ CS8qCisJCSAqIERvIG5vdCByZXF1aXJlIHVwZ3JhZGUgYnkgZmlyc3QgQklPQ1NFVEYKKwkJ ICogKHVzZWQgdG8gc2V0IHNuYXBsZW4pIGJ5IHBjYXBfb3Blbl9saXZlKCkKKwkJICovCisJ CWlmICgoZC0+YmRfd3JpdGVyICE9IDApICYmICgtLWQtPmJkX3dyaXRlciA9PSAwKSkKKwkJ CW5lZWRfdXBncmFkZSA9IDE7CisJCUNUUjQoS1RSX05FVCwgIiVzOiBmaWx0ZXIgZnVuY3Rp b24gc2V0IGJ5IHBpZCAlZCwgIgorCQkgICAgImJkX3dyaXRlciBjb3VudGVyICVkLCBuZWVk X3VwZ3JhZGUgJWQiLAorCQkgICAgX19mdW5jX18sIGQtPmJkX3BpZCwgZC0+YmRfd3JpdGVy LCBuZWVkX3VwZ3JhZGUpOworCX0KKwlCUEZEX1VOTE9DSyhkKTsKKwlpZiAoZC0+YmRfYmlm ICE9IE5VTEwpCisJCUJQRklGX1dVTkxPQ0soZC0+YmRfYmlmKTsKKwlpZiAob2xkICE9IE5V TEwpCisJCWZyZWUoKGNhZGRyX3Qpb2xkLCBNX0JQRik7CiAjaWZkZWYgQlBGX0pJVFRFUgot CQlpZiAob2Z1bmMgIT0gTlVMTCkKLQkJCWJwZl9kZXN0cm95X2ppdF9maWx0ZXIob2Z1bmMp OworCWlmIChvZnVuYyAhPSBOVUxMKQorCQlicGZfZGVzdHJveV9qaXRfZmlsdGVyKG9mdW5j KTsKICNlbmRpZgogCi0JCS8qIE1vdmUgZCB0byBhY3RpdmUgcmVhZGVycyBsaXN0ICovCi0J CWlmIChuZWVkX3VwZ3JhZGUgIT0gMCkKLQkJCWJwZl91cGdyYWRlZChkKTsKKwkvKiBNb3Zl IGQgdG8gYWN0aXZlIHJlYWRlcnMgbGlzdCAqLworCWlmIChuZWVkX3VwZ3JhZGUgIT0gMCkK KwkJYnBmX3VwZ3JhZGVkKGQpOwogCi0JCUJQRl9VTkxPQ0soKTsKLQkJcmV0dXJuICgwKTsK LQl9Ci0JZnJlZSgoY2FkZHJfdClmY29kZSwgTV9CUEYpOwogCUJQRl9VTkxPQ0soKTsKLQly ZXR1cm4gKEVJTlZBTCk7CisJcmV0dXJuICgwKTsKIH0KIAogLyoKSW5kZXg6IHN5cy9uZXQv YnBmX2ppdHRlci5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9uZXQvYnBmX2ppdHRlci5jCShy ZXZpc2lvbiAyMzU3NTApCisrKyBzeXMvbmV0L2JwZl9qaXR0ZXIuYwkod29ya2luZyBjb3B5 KQpAQCAtNzEsNyArNzEsNyBAQCBicGZfaml0dGVyKHN0cnVjdCBicGZfaW5zbiAqZnAsIGlu dCBuaW5zKQogCS8qIEFsbG9jYXRlIHRoZSBmaWx0ZXIgc3RydWN0dXJlLiAqLwogI2lmZGVm IF9LRVJORUwKIAlmaWx0ZXIgPSAoc3RydWN0IGJwZl9qaXRfZmlsdGVyICopbWFsbG9jKHNp emVvZigqZmlsdGVyKSwKLQkgICAgTV9CUEZKSVQsIE1fTk9XQUlUKTsKKwkgICAgTV9CUEZK SVQsIE1fV0FJVE9LKTsKICNlbHNlCiAJZmlsdGVyID0gKHN0cnVjdCBicGZfaml0X2ZpbHRl ciAqKW1hbGxvYyhzaXplb2YoKmZpbHRlcikpOwogI2VuZGlmCg== --------------010906000107090302010705-- From owner-svn-src-all@FreeBSD.ORG Thu May 24 11:07:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9751106564A; Thu, 24 May 2012 11:07:39 +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 B16D68FC08; Thu, 24 May 2012 11:07:39 +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 q4OB7dZf034292; Thu, 24 May 2012 11:07:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OB7d41034281; Thu, 24 May 2012 11:07:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205241107.q4OB7d41034281@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 11:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235897 - in head: sbin/camcontrol sys/cam sys/cam/ata sys/cam/scsi sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 11:07:39 -0000 Author: mav Date: Thu May 24 11:07:39 2012 New Revision: 235897 URL: http://svn.freebsd.org/changeset/base/235897 Log: MFprojects/zfsd: - Add low-level support for SATA Enclosure Management Bridge (SEMB) devices -- SATA equivalents of the SCSI SES/SAF-TE devices. - Add some utility functions for SCSI SAF-TE devices access. Sponsored by: iXsystems, Inc. Modified: head/sbin/camcontrol/camcontrol.c head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_all.h head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/sys/ata.h Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu May 24 11:03:03 2012 (r235896) +++ head/sbin/camcontrol/camcontrol.c Thu May 24 11:07:39 2012 (r235897) @@ -456,7 +456,7 @@ getdevtree(void) case DEV_MATCH_DEVICE: { struct device_match_result *dev_result; char vendor[16], product[48], revision[16]; - char tmpstr[256]; + char fw[5], tmpstr[256]; dev_result = &ccb.cdm.matches[i].result.device_result; @@ -495,6 +495,25 @@ getdevtree(void) sizeof(revision)); sprintf(tmpstr, "<%s %s>", product, revision); + } else if (dev_result->protocol == PROTO_SEMB) { + struct sep_identify_data *sid; + + sid = (struct sep_identify_data *) + &dev_result->ident_data; + cam_strvis(vendor, sid->vendor_id, + sizeof(sid->vendor_id), + sizeof(vendor)); + cam_strvis(product, sid->product_id, + sizeof(sid->product_id), + sizeof(product)); + cam_strvis(revision, sid->product_rev, + sizeof(sid->product_rev), + sizeof(revision)); + cam_strvis(fw, sid->firmware_rev, + sizeof(sid->firmware_rev), + sizeof(fw)); + sprintf(tmpstr, "<%s %s %s %s>", + vendor, product, revision, fw); } else { sprintf(tmpstr, "<>"); } Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/ata/ata_all.c Thu May 24 11:07:39 2012 (r235897) @@ -108,6 +108,16 @@ ata_op_string(struct ata_cmd *cmd) case 0x51: return ("CONFIGURE_STREAM"); case 0x60: return ("READ_FPDMA_QUEUED"); case 0x61: return ("WRITE_FPDMA_QUEUED"); + case 0x67: + if (cmd->features == 0xec) + return ("SEP_ATTN IDENTIFY"); + switch (cmd->lba_low) { + case 0x00: return ("SEP_ATTN READ BUFFER"); + case 0x02: return ("SEP_ATTN RECEIVE DIAGNOSTIC RESULTS"); + case 0x80: return ("SEP_ATTN WRITE BUFFER"); + case 0x82: return ("SEP_ATTN SEND DIAGNOSTIC"); + } + return ("SEP_ATTN"); case 0x70: return ("SEEK"); case 0x87: return ("CFA_TRANSLATE_SECTOR"); case 0x90: return ("EXECUTE_DEVICE_DIAGNOSTIC"); @@ -286,6 +296,21 @@ ata_print_ident(struct ata_params *ident printf(" device\n"); } +void +semb_print_ident(struct sep_identify_data *ident_data) +{ + char vendor[9], product[17], revision[5], fw[5], in[7], ins[5]; + + cam_strvis(vendor, ident_data->vendor_id, 8, sizeof(vendor)); + cam_strvis(product, ident_data->product_id, 16, sizeof(product)); + cam_strvis(revision, ident_data->product_rev, 4, sizeof(revision)); + cam_strvis(fw, ident_data->firmware_rev, 4, sizeof(fw)); + cam_strvis(in, ident_data->interface_id, 6, sizeof(in)); + cam_strvis(ins, ident_data->interface_rev, 4, sizeof(ins)); + printf("<%s %s %s %s> SEMB %s %s device\n", + vendor, product, revision, fw, in, ins); +} + uint32_t ata_logical_sector_size(struct ata_params *ident_data) { @@ -695,3 +720,86 @@ ata_static_identify_match(caddr_t identb } return (-1); } + +void +semb_receive_diagnostic_results(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int pcv, uint8_t page_code, + uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + pcv ? page_code : 0, 0x02, length / 4); +} + +void +semb_send_diagnostic(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/length ? CAM_DIR_OUT : CAM_DIR_NONE, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + length > 0 ? data_ptr[0] : 0, 0x82, length / 4); +} + +void +semb_read_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, uint8_t page_code, + uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + page_code, 0x00, length / 4); +} + +void +semb_write_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/length ? CAM_DIR_OUT : CAM_DIR_NONE, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + length > 0 ? data_ptr[0] : 0, 0x80, length / 4); +} + Modified: head/sys/cam/ata/ata_all.h ============================================================================== --- head/sys/cam/ata/ata_all.h Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/ata/ata_all.h Thu May 24 11:07:39 2012 (r235897) @@ -83,6 +83,20 @@ struct ata_res { u_int8_t sector_count_exp; }; +struct sep_identify_data { + uint8_t length; /* Enclosure descriptor length */ + uint8_t subenc_id; /* Sub-enclosure identifier */ + uint8_t logical_id[8]; /* Enclosure logical identifier (WWN) */ + uint8_t vendor_id[8]; /* Vendor identification string */ + uint8_t product_id[16]; /* Product identification string */ + uint8_t product_rev[4]; /* Product revision string */ + uint8_t channel_id; /* Channel identifier */ + uint8_t firmware_rev[4];/* Firmware revision */ + uint8_t interface_id[6];/* Interface spec ("S-E-S "/"SAF-TE")*/ + uint8_t interface_rev[4];/* Interface spec revision */ + uint8_t vend_spec[11]; /* Vendor specific information */ +}; + int ata_version(int ver); char * ata_op_string(struct ata_cmd *cmd); @@ -126,4 +140,26 @@ int ata_speed2revision(u_int speed); int ata_identify_match(caddr_t identbuffer, caddr_t table_entry); int ata_static_identify_match(caddr_t identbuffer, caddr_t table_entry); +void semb_print_ident(struct sep_identify_data *ident_data); + +void semb_receive_diagnostic_results(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int pcv, uint8_t page_code, + uint8_t *data_ptr, uint16_t allocation_length, uint32_t timeout); + +void semb_send_diagnostic(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t param_list_length, + uint32_t timeout); + +void semb_read_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, uint8_t page_code, + uint8_t *data_ptr, uint16_t allocation_length, uint32_t timeout); + +void semb_write_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t param_list_length, + uint32_t timeout); + #endif Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/ata/ata_da.c Thu May 24 11:07:39 2012 (r235897) @@ -776,6 +776,20 @@ adaasync(void *callback_arg, u_int32_t c "due to status 0x%x\n", status); break; } + case AC_ADVINFO_CHANGED: + { + uintptr_t buftype; + + buftype = (uintptr_t)arg; + if (buftype == CDAI_TYPE_PHYS_PATH) { + struct ada_softc *softc; + + softc = periph->softc; + disk_attr_changed(softc->disk, "GEOM::physpath", + M_NOWAIT); + } + break; + } case AC_SENT_BDR: case AC_BUS_RESET: { @@ -1088,8 +1102,8 @@ adaregister(struct cam_periph *periph, v * them and the only alternative would be to * not attach the device on failure. */ - xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE, - adaasync, periph, periph->path); + xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE | + AC_ADVINFO_CHANGED, adaasync, periph, periph->path); /* * Schedule a periodic event to occasionally send an Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/ata/ata_xpt.c Thu May 24 11:07:39 2012 (r235897) @@ -93,6 +93,8 @@ typedef enum { PROBE_FULL_INQUIRY, PROBE_PM_PID, PROBE_PM_PRV, + PROBE_IDENTIFY_SES, + PROBE_IDENTIFY_SAFTE, PROBE_INVALID } probe_action; @@ -110,6 +112,8 @@ static char *probe_action_text[] = { "PROBE_FULL_INQUIRY", "PROBE_PM_PID", "PROBE_PM_PRV", + "PROBE_IDENTIFY_SES", + "PROBE_IDENTIFY_SAFTE", "PROBE_INVALID" }; @@ -266,7 +270,8 @@ probeschedule(struct cam_periph *periph) ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs); if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) || - periph->path->device->protocol == PROTO_SATAPM) + periph->path->device->protocol == PROTO_SATAPM || + periph->path->device->protocol == PROTO_SEMB) PROBE_SET_ACTION(softc, PROBE_RESET); else PROBE_SET_ACTION(softc, PROBE_IDENTIFY); @@ -300,7 +305,8 @@ probestart(struct cam_periph *periph, un if (softc->restart) { softc->restart = 0; if ((path->device->flags & CAM_DEV_UNCONFIGURED) || - path->device->protocol == PROTO_SATAPM) + path->device->protocol == PROTO_SATAPM || + path->device->protocol == PROTO_SEMB) softc->action = PROBE_RESET; else softc->action = PROBE_IDENTIFY; @@ -622,6 +628,30 @@ negotiate: 10 * 1000); ata_pm_read_cmd(ataio, 1, 15); break; + case PROBE_IDENTIFY_SES: + cam_fill_ataio(ataio, + 1, + probedone, + /*flags*/CAM_DIR_IN, + 0, + /*data_ptr*/(u_int8_t *)&softc->ident_data, + /*dxfer_len*/sizeof(softc->ident_data), + 30 * 1000); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, 0xEC, 0x02, + sizeof(softc->ident_data) / 4); + break; + case PROBE_IDENTIFY_SAFTE: + cam_fill_ataio(ataio, + 1, + probedone, + /*flags*/CAM_DIR_IN, + 0, + /*data_ptr*/(u_int8_t *)&softc->ident_data, + /*dxfer_len*/sizeof(softc->ident_data), + 30 * 1000); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, 0xEC, 0x00, + sizeof(softc->ident_data) / 4); + break; case PROBE_INVALID: CAM_DEBUG(path, CAM_DEBUG_INFO, ("probestart: invalid action state\n")); @@ -758,12 +788,16 @@ probedone(struct cam_periph *periph, uni { struct ccb_trans_settings cts; struct ata_params *ident_buf; + struct scsi_inquiry_data *inq_buf; probe_softc *softc; struct cam_path *path; cam_status status; u_int32_t priority; u_int caps; - int found = 1; + int changed = 1, found = 1; + static const uint8_t fake_device_id_hdr[8] = + {0, SVPD_DEVICE_ID, 0, 12, + SVPD_ID_CODESET_BINARY, SVPD_ID_TYPE_NAA, 0, 8}; CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probedone\n")); @@ -771,6 +805,7 @@ probedone(struct cam_periph *periph, uni path = done_ccb->ccb_h.path; priority = done_ccb->ccb_h.pinfo.priority; ident_buf = &path->device->ident_data; + inq_buf = &path->device->inq_data; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (softc->restart) { @@ -819,6 +854,18 @@ probedone(struct cam_periph *periph, uni } else if (softc->action == PROBE_SETDMAAA && status == CAM_ATA_STATUS_ERROR) { goto noerror; + + /* + * SES and SAF-TE SEPs have different IDENTIFY commands, + * but SATA specification doesn't tell how to identify them. + * Until better way found, just try another if first fail. + */ + } else if (softc->action == PROBE_IDENTIFY_SES && + status == CAM_ATA_STATUS_ERROR) { + PROBE_SET_ACTION(softc, PROBE_IDENTIFY_SAFTE); + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; } /* @@ -862,6 +909,10 @@ noerror: xpt_action((union ccb *)&cts); path->device->protocol = PROTO_SATAPM; PROBE_SET_ACTION(softc, PROBE_PM_PID); + } else if (sign == 0xc33c && + done_ccb->ccb_h.target_id != 15) { + path->device->protocol = PROTO_SEMB; + PROBE_SET_ACTION(softc, PROBE_IDENTIFY_SES); } else if (sign == 0xeb14 && done_ccb->ccb_h.target_id != 15) { path->device->protocol = PROTO_SCSI; @@ -881,7 +932,6 @@ noerror: { struct ccb_pathinq cpi; int16_t *ptr; - int changed = 1; ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; @@ -936,6 +986,11 @@ noerror: path->device->serial_num = NULL; path->device->serial_num_len = 0; } + if (path->device->device_id != NULL) { + free(path->device->device_id, M_CAMXPT); + path->device->device_id = NULL; + path->device->device_id_len = 0; + } path->device->serial_num = (u_int8_t *)malloc((sizeof(ident_buf->serial) + 1), M_CAMXPT, M_NOWAIT); @@ -948,6 +1003,18 @@ noerror: path->device->serial_num_len = strlen(path->device->serial_num); } + if (ident_buf->enabled.extension & + ATA_SUPPORT_64BITWWN) { + path->device->device_id = + malloc(16, M_CAMXPT, M_NOWAIT); + if (path->device->device_id != NULL) { + path->device->device_id_len = 16; + bcopy(&fake_device_id_hdr, + path->device->device_id, 8); + bcopy(ident_buf->wwn, + path->device->device_id + 8, 8); + } + } path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; } @@ -1092,11 +1159,9 @@ notsata: case PROBE_INQUIRY: case PROBE_FULL_INQUIRY: { - struct scsi_inquiry_data *inq_buf; u_int8_t periph_qual, len; path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID; - inq_buf = &path->device->inq_data; periph_qual = SID_QUAL(inq_buf); @@ -1200,6 +1265,48 @@ notsata: xpt_async(AC_SCSI_AEN, done_ccb->ccb_h.path, done_ccb); } break; + case PROBE_IDENTIFY_SES: + case PROBE_IDENTIFY_SAFTE: + if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { + /* Check that it is the same device. */ + if (bcmp(&softc->ident_data, ident_buf, 53)) { + /* Device changed. */ + xpt_async(AC_LOST_DEVICE, path, NULL); + } else { + bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + changed = 0; + } + } + if (changed) { + bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + /* Clean up from previous instance of this device */ + if (path->device->device_id != NULL) { + free(path->device->device_id, M_CAMXPT); + path->device->device_id = NULL; + path->device->device_id_len = 0; + } + path->device->device_id = + malloc(16, M_CAMXPT, M_NOWAIT); + if (path->device->device_id != NULL) { + path->device->device_id_len = 16; + bcopy(&fake_device_id_hdr, + path->device->device_id, 8); + bcopy(((uint8_t*)ident_buf) + 2, + path->device->device_id + 8, 8); + } + + path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; + } + + if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { + path->device->flags &= ~CAM_DEV_UNCONFIGURED; + xpt_acquire_device(path->device); + done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action(done_ccb); + xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, + done_ccb); + } + break; case PROBE_INVALID: CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, ("probedone: invalid action state\n")); @@ -1624,10 +1731,20 @@ ata_dev_advinfo(union ccb *start_ccb) device = start_ccb->ccb_h.path->device; cdai = &start_ccb->cdai; switch(cdai->buftype) { - case CDAI_TYPE_SERIAL_NUM: + case CDAI_TYPE_SCSI_DEVID: if (cdai->flags & CDAI_FLAG_STORE) + return; + cdai->provsiz = device->device_id_len; + if (device->device_id_len == 0) break; - start_ccb->ccb_h.status = CAM_REQ_CMP; + amt = device->device_id_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->device_id, amt); + break; + case CDAI_TYPE_SERIAL_NUM: + if (cdai->flags & CDAI_FLAG_STORE) + return; cdai->provsiz = device->serial_num_len; if (device->serial_num_len == 0) break; @@ -1636,8 +1753,45 @@ ata_dev_advinfo(union ccb *start_ccb) amt = cdai->bufsiz; memcpy(cdai->buf, device->serial_num, amt); break; - default: + case CDAI_TYPE_PHYS_PATH: + if (cdai->flags & CDAI_FLAG_STORE) { + if (device->physpath != NULL) + free(device->physpath, M_CAMXPT); + device->physpath_len = cdai->bufsiz; + /* Clear existing buffer if zero length */ + if (cdai->bufsiz == 0) + break; + device->physpath = malloc(cdai->bufsiz, M_CAMXPT, M_NOWAIT); + if (device->physpath == NULL) { + start_ccb->ccb_h.status = CAM_REQ_ABORTED; + return; + } + memcpy(device->physpath, cdai->buf, cdai->bufsiz); + } else { + cdai->provsiz = device->physpath_len; + if (device->physpath_len == 0) + break; + amt = device->physpath_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->physpath, amt); + } break; + default: + return; + } + start_ccb->ccb_h.status = CAM_REQ_CMP; + + if (cdai->flags & CDAI_FLAG_STORE) { + int owned; + + owned = mtx_owned(start_ccb->ccb_h.path->bus->sim->mtx); + if (owned == 0) + mtx_lock(start_ccb->ccb_h.path->bus->sim->mtx); + xpt_async(AC_ADVINFO_CHANGED, start_ccb->ccb_h.path, + (void *)(uintptr_t)cdai->buftype); + if (owned == 0) + mtx_unlock(start_ccb->ccb_h.path->bus->sim->mtx); } } Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/cam_ccb.h Thu May 24 11:07:39 2012 (r235897) @@ -242,6 +242,7 @@ typedef enum { PROTO_ATA, /* AT Attachment */ PROTO_ATAPI, /* AT Attachment Packetized Interface */ PROTO_SATAPM, /* SATA Port Multiplier */ + PROTO_SEMB, /* SATA Enclosure Management Bridge */ } cam_proto; typedef enum { Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/cam_xpt.c Thu May 24 11:07:39 2012 (r235897) @@ -1080,6 +1080,9 @@ xpt_announce_periph(struct cam_periph *p else if (path->device->protocol == PROTO_ATA || path->device->protocol == PROTO_SATAPM) ata_print_ident(&path->device->ident_data); + else if (path->device->protocol == PROTO_SEMB) + semb_print_ident( + (struct sep_identify_data *)&path->device->ident_data); else printf("Unknown protocol device\n"); if (bootverbose && path->device->serial_num_len > 0) { @@ -4859,7 +4862,8 @@ xpt_finishconfig_task(void *context, int * attached. For any devices like that, announce the * passthrough driver so the user will see something. */ - xpt_for_all_devices(xptpassannouncefunc, NULL); + if (!bootverbose) + xpt_for_all_devices(xptpassannouncefunc, NULL); /* Release our hook so that the boot can continue. */ config_intrhook_disestablish(xsoftc.xpt_config_hook); Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/scsi/scsi_all.c Thu May 24 11:07:39 2012 (r235897) @@ -5740,6 +5740,66 @@ scsi_send_diagnostic(struct ccb_scsiio * timeout); } +void +scsi_read_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t allocation_length, + uint8_t sense_len, uint32_t timeout) +{ + struct scsi_read_buffer *scsi_cmd; + + scsi_cmd = (struct scsi_read_buffer *)&csio->cdb_io.cdb_bytes; + memset(scsi_cmd, 0, sizeof(*scsi_cmd)); + scsi_cmd->opcode = READ_BUFFER; + scsi_cmd->byte2 = mode; + scsi_cmd->buffer_id = buffer_id; + scsi_ulto3b(offset, scsi_cmd->offset); + scsi_ulto3b(allocation_length, scsi_cmd->length); + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + data_ptr, + allocation_length, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + +void +scsi_write_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t param_list_length, + uint8_t sense_len, uint32_t timeout) +{ + struct scsi_write_buffer *scsi_cmd; + + scsi_cmd = (struct scsi_write_buffer *)&csio->cdb_io.cdb_bytes; + memset(scsi_cmd, 0, sizeof(*scsi_cmd)); + scsi_cmd->opcode = WRITE_BUFFER; + scsi_cmd->byte2 = mode; + scsi_cmd->buffer_id = buffer_id; + scsi_ulto3b(offset, scsi_cmd->offset); + scsi_ulto3b(param_list_length, scsi_cmd->length); + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/param_list_length ? CAM_DIR_OUT : CAM_DIR_NONE, + tag_action, + data_ptr, + param_list_length, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + void scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/scsi/scsi_all.h Thu May 24 11:07:39 2012 (r235897) @@ -1267,6 +1267,8 @@ struct scsi_vpd_id_descriptor #define SCSI_PROTO_RDMA 0x04 #define SCSI_PROTO_iSCSI 0x05 #define SCSI_PROTO_SAS 0x06 +#define SCSI_PROTO_ADT 0x07 +#define SCSI_PROTO_ATA 0x08 #define SVPD_ID_PROTO_SHIFT 4 #define SVPD_ID_CODESET_BINARY 0x01 #define SVPD_ID_CODESET_ASCII 0x02 @@ -1400,6 +1402,13 @@ struct scsi_service_action_in uint8_t control; }; +struct scsi_diag_page { + uint8_t page_code; + uint8_t page_specific_flags; + uint8_t length[2]; + uint8_t params[0]; +}; + struct scsi_read_capacity { u_int8_t opcode; @@ -2352,6 +2361,20 @@ void scsi_send_diagnostic(struct ccb_scs uint16_t param_list_length, uint8_t sense_len, uint32_t timeout); +void scsi_read_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t allocation_length, + uint8_t sense_len, uint32_t timeout); + +void scsi_write_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t param_list_length, + uint8_t sense_len, uint32_t timeout); + void scsi_read_write(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int readop, u_int8_t byte2, Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Thu May 24 11:03:03 2012 (r235896) +++ head/sys/sys/ata.h Thu May 24 11:07:39 2012 (r235897) @@ -318,6 +318,7 @@ struct ata_params { #define ATA_READ_VERIFY48 0x42 #define ATA_READ_FPDMA_QUEUED 0x60 /* read DMA NCQ */ #define ATA_WRITE_FPDMA_QUEUED 0x61 /* write DMA NCQ */ +#define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ #define ATA_PACKET_CMD 0xa0 /* packet command */ #define ATA_ATAPI_IDENTIFY 0xa1 /* get ATAPI params*/ From owner-svn-src-all@FreeBSD.ORG Thu May 24 11:20:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D86AE1065670; Thu, 24 May 2012 11:20:51 +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 B92E28FC0C; Thu, 24 May 2012 11:20: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 q4OBKprp034874; Thu, 24 May 2012 11:20:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OBKpcg034868; Thu, 24 May 2012 11:20:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205241120.q4OBKpcg034868@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 11:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235898 - in head/sys: arm/conf conf mips/conf pc98/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 11:20:51 -0000 Author: mav Date: Thu May 24 11:20:51 2012 New Revision: 235898 URL: http://svn.freebsd.org/changeset/base/235898 Log: MFprojects/zfsd: Generalize and unify ses device description. Modified: head/sys/arm/conf/ETHERNUT5 head/sys/conf/NOTES head/sys/mips/conf/OCTEON1 head/sys/pc98/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Thu May 24 11:07:39 2012 (r235897) +++ head/sys/arm/conf/ETHERNUT5 Thu May 24 11:20:51 2012 (r235898) @@ -141,7 +141,7 @@ device ether # Ethernet support #device sa # Sequential Access (tape etc) #device cd # CD #device pass # Passthrough device (direct ATA/SCSI access) -#device ses # SCSI Environmental Services (and SAF-TE) +#device ses # Enclosure Services (SES and SAF-TE) #device ctl # CAM Target Layer # Serial (COM) ports Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu May 24 11:07:39 2012 (r235897) +++ head/sys/conf/NOTES Thu May 24 11:20:51 2012 (r235898) @@ -1295,7 +1295,7 @@ device ch #SCSI media changers device da #SCSI direct access devices (aka disks) device sa #SCSI tapes device cd #SCSI CD-ROMs -device ses #SCSI Environmental Services (and SAF-TE) +device ses #Enclosure Services (SES and SAF-TE) device pt #SCSI processor device targ #SCSI Target Mode Code device targbh #SCSI Target Mode Blackhole Device Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Thu May 24 11:07:39 2012 (r235897) +++ head/sys/mips/conf/OCTEON1 Thu May 24 11:20:51 2012 (r235898) @@ -135,7 +135,7 @@ device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) -device ses # SCSI Environmental Services (and SAF-TE) +device ses # Enclosure Services (SES and SAF-TE) # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Thu May 24 11:07:39 2012 (r235897) +++ head/sys/pc98/conf/GENERIC Thu May 24 11:20:51 2012 (r235898) @@ -110,7 +110,7 @@ device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) -device ses # SCSI Environmental Services (and SAF-TE) +device ses # Enclosure Services (SES and SAF-TE) # keyboard driver device pckbd # PC98 keyboard Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Thu May 24 11:07:39 2012 (r235897) +++ head/sys/sparc64/conf/GENERIC Thu May 24 11:20:51 2012 (r235898) @@ -118,7 +118,7 @@ device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) -device ses # SCSI Environmental Services (and SAF-TE) +device ses # Enclosure Services (SES and SAF-TE) device ctl # CAM Target Layer # RAID controllers From owner-svn-src-all@FreeBSD.ORG Thu May 24 11:24:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 669981065673; Thu, 24 May 2012 11:24:45 +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 51E3A8FC0A; Thu, 24 May 2012 11:24: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 q4OBOjQA035074; Thu, 24 May 2012 11:24:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OBOj1A035072; Thu, 24 May 2012 11:24:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205241124.q4OBOj1A035072@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 11:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235899 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 11:24:45 -0000 Author: mav Date: Thu May 24 11:24:44 2012 New Revision: 235899 URL: http://svn.freebsd.org/changeset/base/235899 Log: MFprojects/zfsd: Hide warning behind bootverbose. Average user has nothing to do about it. Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Thu May 24 11:20:51 2012 (r235898) +++ head/sys/kern/kern_conf.c Thu May 24 11:24:44 2012 (r235899) @@ -993,9 +993,10 @@ make_dev_physpath_alias(int flags, struc max_parentpath_len = SPECNAMELEN - physpath_len - /*/*/1; parentpath_len = strlen(pdev->si_name); if (max_parentpath_len < parentpath_len) { - printf("make_dev_physpath_alias: WARNING - Unable to alias %s " - "to %s/%s - path too long\n", - pdev->si_name, physpath, pdev->si_name); + if (bootverbose) + printf("WARNING: Unable to alias %s " + "to %s/%s - path too long\n", + pdev->si_name, physpath, pdev->si_name); ret = ENAMETOOLONG; goto out; } From owner-svn-src-all@FreeBSD.ORG Thu May 24 11:43:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DA88106566B; Thu, 24 May 2012 11:43:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC4008FC14; Thu, 24 May 2012 11:43:33 +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 q4OBhXZk035903; Thu, 24 May 2012 11:43:33 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OBhXih035901; Thu, 24 May 2012 11:43:33 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205241143.q4OBhXih035901@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 May 2012 11:43:33 +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: r235900 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 11:43:34 -0000 Author: trasz Date: Thu May 24 11:43:33 2012 New Revision: 235900 URL: http://svn.freebsd.org/changeset/base/235900 Log: MFC r234381: Fix panic, triggered like this: "int main() { thr_exit(); }" Modified: stable/9/sys/kern/kern_thr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_thr.c ============================================================================== --- stable/9/sys/kern/kern_thr.c Thu May 24 11:24:44 2012 (r235899) +++ stable/9/sys/kern/kern_thr.c Thu May 24 11:43:33 2012 (r235900) @@ -316,13 +316,13 @@ sys_thr_exit(struct thread *td, struct t rw_wlock(&tidhash_lock); PROC_LOCK(p); - racct_sub(p, RACCT_NTHR, 1); /* * Shutting down last thread in the proc. This will actually * call exit() in the trampoline when it returns. */ if (p->p_numthreads != 1) { + racct_sub(p, RACCT_NTHR, 1); LIST_REMOVE(td, td_hash); rw_wunlock(&tidhash_lock); tdsigcleanup(td); From owner-svn-src-all@FreeBSD.ORG Thu May 24 11:46:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E4E31065675; Thu, 24 May 2012 11:46:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9F0D8FC20; Thu, 24 May 2012 11:46:39 +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 q4OBkdjP036103; Thu, 24 May 2012 11:46:39 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OBkdBS036101; Thu, 24 May 2012 11:46:39 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205241146.q4OBkdBS036101@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 May 2012 11:46:39 +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: r235901 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 11:46:40 -0000 Author: trasz Date: Thu May 24 11:46:39 2012 New Revision: 235901 URL: http://svn.freebsd.org/changeset/base/235901 Log: MFC r234380: Enforce upper bound on the input buffer length. Modified: stable/9/sys/kern/kern_rctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_rctl.c ============================================================================== --- stable/9/sys/kern/kern_rctl.c Thu May 24 11:43:33 2012 (r235900) +++ stable/9/sys/kern/kern_rctl.c Thu May 24 11:46:39 2012 (r235901) @@ -73,6 +73,7 @@ FEATURE(rctl, "Resource Limits"); /* Default buffer size for rctl_get_rules(2). */ #define RCTL_DEFAULT_BUFSIZE 4096 +#define RCTL_MAX_INBUFLEN 4096 #define RCTL_LOG_BUFSIZE 128 /* @@ -1191,6 +1192,8 @@ rctl_read_inbuf(char **inputstr, const c if (inbuflen <= 0) return (EINVAL); + if (inbuflen > RCTL_MAX_INBUFLEN) + return (E2BIG); str = malloc(inbuflen + 1, M_RCTL, M_WAITOK); error = copyinstr(inbufp, str, inbuflen, NULL); From owner-svn-src-all@FreeBSD.ORG Thu May 24 11:50:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AC471065670; Thu, 24 May 2012 11:50:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03B018FC1E; Thu, 24 May 2012 11:50: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 q4OBoEit036298; Thu, 24 May 2012 11:50:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OBoELP036296; Thu, 24 May 2012 11:50:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205241150.q4OBoELP036296@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 May 2012 11:50: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: r235902 - stable/9/sys/fs/unionfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 11:50:15 -0000 Author: trasz Date: Thu May 24 11:50:14 2012 New Revision: 235902 URL: http://svn.freebsd.org/changeset/base/235902 Log: MFC r226234: Make unionfs also clear VAPPEND when clearing VWRITE, since VAPPEND is just a modifier for VWRITE. Modified: stable/9/sys/fs/unionfs/union_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/unionfs/union_vnops.c ============================================================================== --- stable/9/sys/fs/unionfs/union_vnops.c Thu May 24 11:46:39 2012 (r235901) +++ stable/9/sys/fs/unionfs/union_vnops.c Thu May 24 11:50:14 2012 (r235902) @@ -736,7 +736,7 @@ unionfs_access(struct vop_access_args *a return (error); } } - accmode &= ~VWRITE; + accmode &= ~(VWRITE | VAPPEND); accmode |= VREAD; /* will copy to upper */ } error = VOP_ACCESS(lvp, accmode, ap->a_cred, td); From owner-svn-src-all@FreeBSD.ORG Thu May 24 11:52:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68BA1065673; Thu, 24 May 2012 11:52:57 +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 D1D488FC1D; Thu, 24 May 2012 11:52: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 q4OBqvev036454; Thu, 24 May 2012 11:52:57 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OBqvUi036452; Thu, 24 May 2012 11:52:57 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205241152.q4OBqvUi036452@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 May 2012 11:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235903 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 11:52:58 -0000 Author: tuexen Date: Thu May 24 11:52:57 2012 New Revision: 235903 URL: http://svn.freebsd.org/changeset/base/235903 Log: Add sn_send_failed_event to sctp_notification. MFC after: 3 days Modified: head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu May 24 11:50:14 2012 (r235902) +++ head/sys/netinet/sctp_uio.h Thu May 24 11:52:57 2012 (r235903) @@ -523,10 +523,10 @@ union sctp_notification { struct sctp_pdapi_event sn_pdapi_event; struct sctp_authkey_event sn_auth_event; struct sctp_sender_dry_event sn_sender_dry_event; + struct sctp_send_failed_event sn_send_failed_event; struct sctp_stream_reset_event sn_strreset_event; struct sctp_assoc_reset_event sn_assocreset_event; struct sctp_stream_change_event sn_strchange_event; - }; /* notification types */ From owner-svn-src-all@FreeBSD.ORG Thu May 24 12:28:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C8E71065673; Thu, 24 May 2012 12:28:12 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CCFC8FC19; Thu, 24 May 2012 12:28:12 +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 q4OCSCrC038068; Thu, 24 May 2012 12:28:12 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OCSCZP038066; Thu, 24 May 2012 12:28:12 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201205241228.q4OCSCZP038066@svn.freebsd.org> From: Rick Macklem Date: Thu, 24 May 2012 12:28:12 +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: r235906 - stable/9/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 12:28:12 -0000 Author: rmacklem Date: Thu May 24 12:28:11 2012 New Revision: 235906 URL: http://svn.freebsd.org/changeset/base/235906 Log: MFC: r235568 A problem with the NFSv4 server was reported by Andrew Leonard to freebsd-fs@, where the setfacl of an NFSv4 acl would fail. This was caused by the VOP_ACLCHECK() call for ZFS replying EOPNOTSUPP. After discussion with rwatson@, it was determined that a call to VOP_ACLCHECK() before doing VOP_SETACL() is not required. This patch fixes the problem by deleting the VOP_ACLCHECK() call. Modified: stable/9/sys/fs/nfs/nfs_commonacl.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonacl.c Thu May 24 12:27:27 2012 (r235905) +++ stable/9/sys/fs/nfs/nfs_commonacl.c Thu May 24 12:28:11 2012 (r235906) @@ -468,9 +468,7 @@ nfsrv_setacl(vnode_t vp, NFSACL_T *aclp, error = NFSERR_ATTRNOTSUPP; goto out; } - error = VOP_ACLCHECK(vp, ACL_TYPE_NFS4, aclp, cred, p); - if (!error) - error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); + error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); out: NFSEXITCODE(error); From owner-svn-src-all@FreeBSD.ORG Thu May 24 12:38:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E15651065679; Thu, 24 May 2012 12:38:24 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBDE08FC18; Thu, 24 May 2012 12:38:24 +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 q4OCcOkS038495; Thu, 24 May 2012 12:38:24 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OCcOqR038493; Thu, 24 May 2012 12:38:24 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205241238.q4OCcOqR038493@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 24 May 2012 12:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235907 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 12:38:25 -0000 Author: gber Date: Thu May 24 12:38:24 2012 New Revision: 235907 URL: http://svn.freebsd.org/changeset/base/235907 Log: ARMs don't have motherboards. Obtained from: Semihalf Modified: head/sys/arm/arm/nexus.c Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Thu May 24 12:28:11 2012 (r235906) +++ head/sys/arm/arm/nexus.c Thu May 24 12:38:24 2012 (r235907) @@ -160,7 +160,7 @@ nexus_print_child(device_t bus, device_t int retval = 0; retval += bus_print_child_header(bus, child); - retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */ + retval += printf("\n"); return (retval); } From owner-svn-src-all@FreeBSD.ORG Thu May 24 12:41:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FF9D106566C; Thu, 24 May 2012 12:41:57 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A2948FC0A; Thu, 24 May 2012 12:41: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 q4OCfvch038661; Thu, 24 May 2012 12:41:57 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OCfvKa038659; Thu, 24 May 2012 12:41:57 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205241241.q4OCfvKa038659@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 24 May 2012 12:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235908 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 12:41:57 -0000 Author: gber Date: Thu May 24 12:41:57 2012 New Revision: 235908 URL: http://svn.freebsd.org/changeset/base/235908 Log: Return Supervisor SP and LR registers instead of User ones while in KDB thread. Obtained from: Semihalf Modified: head/sys/arm/arm/gdb_machdep.c Modified: head/sys/arm/arm/gdb_machdep.c ============================================================================== --- head/sys/arm/arm/gdb_machdep.c Thu May 24 12:38:24 2012 (r235907) +++ head/sys/arm/arm/gdb_machdep.c Thu May 24 12:41:57 2012 (r235908) @@ -54,8 +54,12 @@ gdb_cpu_getreg(int regnum, size_t *regsz *regsz = gdb_cpu_regsz(regnum); if (kdb_thread == curthread) { - if (regnum < 15) + if (regnum < 13) return (&kdb_frame->tf_r0 + regnum); + if (regnum == 13) + return (&kdb_frame->tf_svc_sp); + if (regnum == 14) + return (&kdb_frame->tf_svc_lr); if (regnum == 15) return (&kdb_frame->tf_pc); if (regnum == 25) From owner-svn-src-all@FreeBSD.ORG Thu May 24 13:15:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1266E106566B; Thu, 24 May 2012 13:15:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF3208FC16; Thu, 24 May 2012 13:15: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 q4ODFFVZ040123; Thu, 24 May 2012 13:15:15 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ODFFbN040121; Thu, 24 May 2012 13:15:15 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201205241315.q4ODFFbN040121@svn.freebsd.org> From: Rick Macklem Date: Thu, 24 May 2012 13:15: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: r235910 - stable/8/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 13:15:16 -0000 Author: rmacklem Date: Thu May 24 13:15:15 2012 New Revision: 235910 URL: http://svn.freebsd.org/changeset/base/235910 Log: MFC: r235568 A problem with the NFSv4 server was reported by Andrew Leonard to freebsd-fs@, where the setfacl of an NFSv4 acl would fail. This was caused by the VOP_ACLCHECK() call for ZFS replying EOPNOTSUPP. After discussion with rwatson@, it was determined that a call to VOP_ACLCHECK() before doing VOP_SETACL() is not required. This patch fixes the problem by deleting the VOP_ACLCHECK() call. Modified: stable/8/sys/fs/nfs/nfs_commonacl.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) Modified: stable/8/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonacl.c Thu May 24 12:45:01 2012 (r235909) +++ stable/8/sys/fs/nfs/nfs_commonacl.c Thu May 24 13:15:15 2012 (r235910) @@ -468,9 +468,7 @@ nfsrv_setacl(vnode_t vp, NFSACL_T *aclp, error = NFSERR_ATTRNOTSUPP; goto out; } - error = VOP_ACLCHECK(vp, ACL_TYPE_NFS4, aclp, cred, p); - if (!error) - error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); + error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); out: NFSEXITCODE(error); From owner-svn-src-all@FreeBSD.ORG Thu May 24 14:07:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B21891065799; Thu, 24 May 2012 14:07:44 +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 98FFF8FC12; Thu, 24 May 2012 14:07: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 q4OE7iJI042327; Thu, 24 May 2012 14:07:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OE7i47042313; Thu, 24 May 2012 14:07:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205241407.q4OE7i47042313@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 14:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235911 - in head: share/examples/ses share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 14:07:44 -0000 Author: mav Date: Thu May 24 14:07:44 2012 New Revision: 235911 URL: http://svn.freebsd.org/changeset/base/235911 Log: MFprojects/zfsd: Revamp the CAM enclosure services driver. This updated driver uses an in-kernel daemon to track state changes and publishes physical path location information\for disk elements into the CAM device database. Sponsored by: Spectra Logic Corporation Sponsored by: iXsystems, Inc. Submitted by: gibbs, will, mav Added: head/sys/cam/scsi/scsi_enc.c (contents, props changed) head/sys/cam/scsi/scsi_enc.h (contents, props changed) head/sys/cam/scsi/scsi_enc_internal.h (contents, props changed) head/sys/cam/scsi/scsi_enc_safte.c (contents, props changed) head/sys/cam/scsi/scsi_enc_ses.c (contents, props changed) Deleted: head/sys/cam/scsi/scsi_ses.c Modified: head/share/examples/ses/Makefile.inc head/share/examples/ses/srcs/eltsub.c head/share/examples/ses/srcs/getencstat.c head/share/examples/ses/srcs/getnobj.c head/share/examples/ses/srcs/getobjmap.c head/share/examples/ses/srcs/getobjstat.c head/share/examples/ses/srcs/inienc.c head/share/examples/ses/srcs/sesd.c head/share/examples/ses/srcs/setencstat.c head/share/examples/ses/srcs/setobjstat.c head/sys/cam/scsi/scsi_ses.h head/sys/conf/files head/sys/fs/devfs/devfs_vnops.c head/sys/modules/cam/Makefile head/usr.bin/kdump/mkioctls Modified: head/share/examples/ses/Makefile.inc ============================================================================== --- head/share/examples/ses/Makefile.inc Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/Makefile.inc Thu May 24 14:07:44 2012 (r235911) @@ -32,7 +32,6 @@ # mjacob@feral.com # -CFLAGS+= -I/usr/include/cam/scsi -DSESINC="" BINDIR?= /usr/sbin CLEANFILES+= ${MAN} Modified: head/share/examples/ses/srcs/eltsub.c ============================================================================== --- head/share/examples/ses/srcs/eltsub.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/eltsub.c Thu May 24 14:07:44 2012 (r235911) @@ -33,10 +33,13 @@ */ #include +#include +#include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" @@ -46,79 +49,82 @@ geteltnm(int type) static char rbuf[132]; switch (type) { - case SESTYP_UNSPECIFIED: + case ELMTYP_UNSPECIFIED: sprintf(rbuf, "Unspecified"); break; - case SESTYP_DEVICE: - sprintf(rbuf, "Device"); + case ELMTYP_DEVICE: + sprintf(rbuf, "Device Slot"); break; - case SESTYP_POWER: - sprintf(rbuf, "Power supply"); + case ELMTYP_POWER: + sprintf(rbuf, "Power Supply"); break; - case SESTYP_FAN: - sprintf(rbuf, "Cooling element"); + case ELMTYP_FAN: + sprintf(rbuf, "Cooling"); break; - case SESTYP_THERM: - sprintf(rbuf, "Temperature sensors"); + case ELMTYP_THERM: + sprintf(rbuf, "Temperature Sensors"); break; - case SESTYP_DOORLOCK: + case ELMTYP_DOORLOCK: sprintf(rbuf, "Door Lock"); break; - case SESTYP_ALARM: + case ELMTYP_ALARM: sprintf(rbuf, "Audible alarm"); break; - case SESTYP_ESCC: - sprintf(rbuf, "Enclosure services controller electronics"); + case ELMTYP_ESCC: + sprintf(rbuf, "Enclosure Eervices Controller Electronics"); break; - case SESTYP_SCC: - sprintf(rbuf, "SCC controller electronics"); + case ELMTYP_SCC: + sprintf(rbuf, "SCC Controller Electronics"); break; - case SESTYP_NVRAM: - sprintf(rbuf, "Nonvolatile cache"); + case ELMTYP_NVRAM: + sprintf(rbuf, "Nonvolatile Cache"); break; - case SESTYP_UPS: - sprintf(rbuf, "Uninterruptible power supply"); + case ELMTYP_INV_OP_REASON: + sprintf(rbuf, "Invalid Operation Reason"); break; - case SESTYP_DISPLAY: + case ELMTYP_UPS: + sprintf(rbuf, "Uninterruptible Power Supply"); + break; + case ELMTYP_DISPLAY: sprintf(rbuf, "Display"); break; - case SESTYP_KEYPAD: - sprintf(rbuf, "Key pad entry device"); + case ELMTYP_KEYPAD: + sprintf(rbuf, "Key Pad Entry"); break; - case SESTYP_ENCLOSURE: + case ELMTYP_ENCLOSURE: sprintf(rbuf, "Enclosure"); break; - case SESTYP_SCSIXVR: - sprintf(rbuf, "SCSI port/transceiver"); + case ELMTYP_SCSIXVR: + sprintf(rbuf, "SCSI Port/Transceiver"); break; - case SESTYP_LANGUAGE: + case ELMTYP_LANGUAGE: sprintf(rbuf, "Language"); break; - case SESTYP_COMPORT: + case ELMTYP_COMPORT: sprintf(rbuf, "Communication Port"); break; - case SESTYP_VOM: + case ELMTYP_VOM: sprintf(rbuf, "Voltage Sensor"); break; - case SESTYP_AMMETER: + case ELMTYP_AMMETER: sprintf(rbuf, "Current Sensor"); break; - case SESTYP_SCSI_TGT: - sprintf(rbuf, "SCSI target port"); + case ELMTYP_SCSI_TGT: + sprintf(rbuf, "SCSI Target Port"); break; - case SESTYP_SCSI_INI: - sprintf(rbuf, "SCSI initiator port"); + case ELMTYP_SCSI_INI: + sprintf(rbuf, "SCSI Initiator Port"); break; - case SESTYP_SUBENC: - sprintf(rbuf, "Simple sub-enclosure"); + case ELMTYP_SUBENC: + sprintf(rbuf, "Simple Subenclosure"); break; - case SESTYP_ARRAY: - sprintf(rbuf, "Array device"); + case ELMTYP_ARRAY_DEV: + sprintf(rbuf, "Array Device Slot"); break; - case SESTYP_SASEXPANDER: + case ELMTYP_SAS_EXP: sprintf(rbuf, "SAS Expander"); break; - case SESTYP_SASCONNECTOR: + case ELMTYP_SAS_CONN: sprintf(rbuf, "SAS Connector"); break; default: @@ -134,31 +140,34 @@ scode2ascii(u_char code) static char rbuf[32]; switch (code & 0xf) { case SES_OBJSTAT_UNSUPPORTED: - sprintf(rbuf, "status not supported"); + sprintf(rbuf, "Unsupported"); break; case SES_OBJSTAT_OK: - sprintf(rbuf, "ok"); + sprintf(rbuf, "OK"); break; case SES_OBJSTAT_CRIT: - sprintf(rbuf, "critical"); + sprintf(rbuf, "Critical"); break; case SES_OBJSTAT_NONCRIT: - sprintf(rbuf, "non-critical"); + sprintf(rbuf, "Noncritical"); break; case SES_OBJSTAT_UNRECOV: - sprintf(rbuf, "unrecoverable"); + sprintf(rbuf, "Unrecoverable"); break; case SES_OBJSTAT_NOTINSTALLED: - sprintf(rbuf, "not installed"); + sprintf(rbuf, "Not Installed"); break; case SES_OBJSTAT_UNKNOWN: - sprintf(rbuf, "unknown status"); + sprintf(rbuf, "Unknown"); break; case SES_OBJSTAT_NOTAVAIL: - sprintf(rbuf, "status not available"); + sprintf(rbuf, "Not Available"); + break; + case SES_OBJSTAT_NOACCESS: + sprintf(rbuf, "No Access Allowed"); break; default: - sprintf(rbuf, "unknown status code %x", code & 0xf); + sprintf(rbuf, "", code & 0xf); break; } return (rbuf); @@ -171,7 +180,7 @@ stat2ascii(int eletype __unused, u_char static char ebuf[256], *scode; scode = scode2ascii(cstat[0]); - sprintf(ebuf, "Status=%s (bytes=0x%02x 0x%02x 0x%02x 0x%02x)", + sprintf(ebuf, "status: %s (0x%02x 0x%02x 0x%02x 0x%02x)", scode, cstat[0], cstat[1], cstat[2], cstat[3]); return (ebuf); } Modified: head/share/examples/ses/srcs/getencstat.c ============================================================================== --- head/share/examples/ses/srcs/getencstat.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/getencstat.c Thu May 24 14:07:44 2012 (r235911) @@ -33,20 +33,25 @@ */ #include +#include +#include #include #include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" int main(int a, char **v) { - ses_object *objp; - ses_objstat ob; + encioc_element_t *objp; + encioc_elm_status_t ob; + encioc_elm_desc_t objd; + encioc_elm_devnames_t objdn; int fd, nobj, f, i, verbose, quiet, errors; u_char estat; @@ -73,13 +78,13 @@ main(int a, char **v) perror(*v); continue; } - if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) { - perror("SESIOC_GETNOBJ"); + if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) { + perror("ENCIOC_GETNELM"); (void) close(fd); continue; } - if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &estat) < 0) { - perror("SESIOC_GETENCSTAT"); + if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &estat) < 0) { + perror("ENCIOC_GETENCSTAT"); (void) close(fd); continue; } @@ -113,38 +118,64 @@ main(int a, char **v) } } fprintf(stdout, ">\n"); - objp = calloc(nobj, sizeof (ses_object)); + objp = calloc(nobj, sizeof (encioc_element_t)); if (objp == NULL) { perror("calloc"); (void) close(fd); continue; } - if (ioctl(fd, SESIOC_GETOBJMAP, (caddr_t) objp) < 0) { - perror("SESIOC_GETOBJMAP"); + if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) objp) < 0) { + perror("ENCIOC_GETELMMAP"); (void) close(fd); continue; } for (i = 0; i < nobj; i++) { - ob.obj_id = objp[i].obj_id; - if (ioctl(fd, SESIOC_GETOBJSTAT, (caddr_t) &ob) < 0) { - perror("SESIOC_GETOBJSTAT"); + ob.elm_idx = objp[i].elm_idx; + if (ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t) &ob) < 0) { + perror("ENCIOC_GETELMSTAT"); (void) close(fd); break; } - if ((ob.cstat[0] & 0xf) == SES_OBJSTAT_OK) { - if (verbose) { - fprintf(stdout, - "Element 0x%x: %s OK (%s)\n", - ob.obj_id, - geteltnm(objp[i].object_type), - stat2ascii(objp[i].object_type, - ob.cstat)); - } + bzero(&objd, sizeof(objd)); + objd.elm_idx = objp[i].elm_idx; + objd.elm_desc_len = UINT16_MAX; + objd.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); + if (objd.elm_desc_str == NULL) { + perror("calloc"); + (void) close(fd); continue; } - fprintf(stdout, "Element 0x%x: %s, %s\n", - ob.obj_id, geteltnm(objp[i].object_type), - stat2ascii(objp[i].object_type, ob.cstat)); + if (ioctl(fd, ENCIOC_GETELMDESC, (caddr_t)&objd) < 0) { + perror("ENCIOC_GETELMDESC"); + (void) close(fd); + break; + } + bzero(&objdn, sizeof(objdn)); + objdn.elm_idx = objp[i].elm_idx; + objdn.elm_names_size = 128; + objdn.elm_devnames = calloc(128, sizeof(char)); + if (objdn.elm_devnames == NULL) { + perror("calloc"); + (void) close(fd); + break; + } + /* + * This ioctl isn't critical and has a good chance + * of returning -1. + */ + (void)ioctl(fd, ENCIOC_GETELMDEVNAMES, (caddr_t)&objdn); + fprintf(stdout, "Element 0x%x: %s", ob.elm_idx, + geteltnm(objp[i].elm_type)); + fprintf(stdout, ", %s", + stat2ascii(objp[i].elm_type, ob.cstat)); + if (objd.elm_desc_len > 0) + fprintf(stdout, ", descriptor: '%s'", + objd.elm_desc_str); + if (objdn.elm_names_len > 0) + fprintf(stdout, ", dev: '%s'", + objdn.elm_devnames); + fprintf(stdout, "\n"); + free(objdn.elm_devnames); } free(objp); (void) close(fd); Modified: head/share/examples/ses/srcs/getnobj.c ============================================================================== --- head/share/examples/ses/srcs/getnobj.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/getnobj.c Thu May 24 14:07:44 2012 (r235911) @@ -33,12 +33,15 @@ */ #include +#include +#include #include #include #include #include #include -#include SESINC +#include +#include int main(int argc, char **argv) Modified: head/share/examples/ses/srcs/getobjmap.c ============================================================================== --- head/share/examples/ses/srcs/getobjmap.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/getobjmap.c Thu May 24 14:07:44 2012 (r235911) @@ -33,11 +33,14 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" Modified: head/share/examples/ses/srcs/getobjstat.c ============================================================================== --- head/share/examples/ses/srcs/getobjstat.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/getobjstat.c Thu May 24 14:07:44 2012 (r235911) @@ -32,11 +32,14 @@ * mjacob@feral.com */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) Modified: head/share/examples/ses/srcs/inienc.c ============================================================================== --- head/share/examples/ses/srcs/inienc.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/inienc.c Thu May 24 14:07:44 2012 (r235911) @@ -33,11 +33,14 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) Modified: head/share/examples/ses/srcs/sesd.c ============================================================================== --- head/share/examples/ses/srcs/sesd.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/sesd.c Thu May 24 14:07:44 2012 (r235911) @@ -32,6 +32,8 @@ * mjacob@feral.com */ #include +#include +#include #include #include #include @@ -39,7 +41,8 @@ #include #include #include -#include SESINC +#include +#include #define ALLSTAT (SES_ENCSTAT_UNRECOV | SES_ENCSTAT_CRITICAL | \ SES_ENCSTAT_NONCRITICAL | SES_ENCSTAT_INFO) @@ -54,7 +57,7 @@ main(int a, char **v) static const char *usage = "usage: %s [ -d ] [ -t pollinterval ] device [ device ]\n"; int fd, polltime, dev, devbase, nodaemon; - ses_encstat stat, *carray; + encioc_enc_status_t stat, *carray; if (a < 2) { fprintf(stderr, usage, *v); @@ -83,7 +86,7 @@ main(int a, char **v) return (1); } for (dev = devbase; dev < a; dev++) - carray[dev] = (ses_encstat) -1; + carray[dev] = (encioc_enc_status_t) -1; /* * Check to make sure we can open all devices @@ -94,8 +97,8 @@ main(int a, char **v) perror(v[dev]); return (1); } - if (ioctl(fd, SESIOC_INIT, NULL) < 0) { - fprintf(stderr, "%s: SESIOC_INIT fails- %s\n", + if (ioctl(fd, ENCIOC_INIT, NULL) < 0) { + fprintf(stderr, "%s: ENCIOC_INIT fails- %s\n", v[dev], strerror(errno)); return (1); } @@ -122,9 +125,9 @@ main(int a, char **v) /* * Get the actual current enclosure status. */ - if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &stat) < 0) { + if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &stat) < 0) { syslog(LOG_ERR, - "%s: SESIOC_GETENCSTAT- %m", v[dev]); + "%s: ENCIOC_GETENCSTAT- %m", v[dev]); (void) close(fd); continue; } Modified: head/share/examples/ses/srcs/setencstat.c ============================================================================== --- head/share/examples/ses/srcs/setencstat.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/setencstat.c Thu May 24 14:07:44 2012 (r235911) @@ -33,18 +33,21 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) { int fd; long val; - ses_encstat stat; + encioc_enc_status_t stat; if (a != 3) { fprintf(stderr, "usage: %s device enclosure_status\n", *v); @@ -57,9 +60,9 @@ main(int a, char **v) } val = strtol(v[2], NULL, 0); - stat = (ses_encstat) val; - if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) { - perror("SESIOC_SETENCSTAT"); + stat = (encioc_enc_status_t)val; + if (ioctl(fd, ENCIOC_SETENCSTAT, (caddr_t) &stat) < 0) { + perror("ENCIOC_SETENCSTAT"); } (void) close(fd); return (0); Modified: head/share/examples/ses/srcs/setobjstat.c ============================================================================== --- head/share/examples/ses/srcs/setobjstat.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/setobjstat.c Thu May 24 14:07:44 2012 (r235911) @@ -33,18 +33,21 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) { int fd; int i; - ses_objstat obj; + encioc_elm_status_t obj; long cvt; char *x; @@ -64,7 +67,7 @@ usage: if (x == v[2]) { goto usage; } - obj.obj_id = cvt; + obj.elm_idx = cvt; for (i = 0; i < 4; i++) { x = v[3 + i]; cvt = strtol(v[3 + i], &x, 0); @@ -73,8 +76,8 @@ usage: } obj.cstat[i] = cvt; } - if (ioctl(fd, SESIOC_SETOBJSTAT, (caddr_t) &obj) < 0) { - perror("SESIOC_SETOBJSTAT"); + if (ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t) &obj) < 0) { + perror("ENCIOC_SETELMSTAT"); } (void) close(fd); return (0); Added: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cam/scsi/scsi_enc.c Thu May 24 14:07:44 2012 (r235911) @@ -0,0 +1,1011 @@ +/*- + * Copyright (c) 2000 Matthew Jacob + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +MALLOC_DEFINE(M_SCSIENC, "SCSI ENC", "SCSI ENC buffers"); + +/* Enclosure type independent driver */ + +#define SEN_ID "UNISYS SUN_SEN" +#define SEN_ID_LEN 24 + +static d_open_t enc_open; +static d_close_t enc_close; +static d_ioctl_t enc_ioctl; +static periph_init_t enc_init; +static periph_ctor_t enc_ctor; +static periph_oninv_t enc_oninvalidate; +static periph_dtor_t enc_dtor; +static periph_start_t enc_start; + +static void enc_async(void *, uint32_t, struct cam_path *, void *); +static enctyp enc_type(struct ccb_getdev *); + +SYSCTL_NODE(_kern_cam, OID_AUTO, enc, CTLFLAG_RD, 0, + "CAM Enclosure Services driver"); + +static struct periph_driver encdriver = { + enc_init, "ses", + TAILQ_HEAD_INITIALIZER(encdriver.units), /* generation */ 0 +}; + +PERIPHDRIVER_DECLARE(enc, encdriver); + +static struct cdevsw enc_cdevsw = { + .d_version = D_VERSION, + .d_open = enc_open, + .d_close = enc_close, + .d_ioctl = enc_ioctl, + .d_name = "ses", + .d_flags = 0, +}; + +static void +enc_init(void) +{ + cam_status status; + + /* + * Install a global async callback. This callback will + * receive async callbacks like "new device found". + */ + status = xpt_register_async(AC_FOUND_DEVICE, enc_async, NULL, NULL); + + if (status != CAM_REQ_CMP) { + printf("enc: Failed to attach master async callback " + "due to status 0x%x!\n", status); + } +} + +static void +enc_oninvalidate(struct cam_periph *periph) +{ + struct enc_softc *enc; + + enc = periph->softc; + + enc->enc_flags |= ENC_FLAG_INVALID; + + /* If the sub-driver has an invalidate routine, call it */ + if (enc->enc_vec.softc_invalidate != NULL) + enc->enc_vec.softc_invalidate(enc); + + /* + * Unregister any async callbacks. + */ + xpt_register_async(0, enc_async, periph, periph->path); + + /* + * Shutdown our daemon. + */ + enc->enc_flags |= ENC_FLAG_SHUTDOWN; + if (enc->enc_daemon != NULL) { + /* Signal and wait for the ses daemon to terminate. */ + wakeup(enc->enc_daemon); + /* + * We're called with the SIM mutex held, but we're dropping + * the update mutex here on sleep. So we have to manually + * drop the SIM mutex. + */ + cam_periph_sleep(enc->periph, enc->enc_daemon, + PUSER, "thtrm", 0); + } + callout_drain(&enc->status_updater); + + xpt_print(periph->path, "lost device\n"); +} + +static void +enc_dtor(struct cam_periph *periph) +{ + struct enc_softc *enc; + + enc = periph->softc; + + xpt_print(periph->path, "removing device entry\n"); + cam_periph_unlock(periph); + destroy_dev(enc->enc_dev); + cam_periph_lock(periph); + + /* If the sub-driver has a cleanup routine, call it */ + if (enc->enc_vec.softc_cleanup != NULL) + enc->enc_vec.softc_cleanup(enc); + + if (enc->enc_boot_hold_ch.ich_func != NULL) { + config_intrhook_disestablish(&enc->enc_boot_hold_ch); + enc->enc_boot_hold_ch.ich_func = NULL; + } + + ENC_FREE(enc); +} + +static void +enc_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) +{ + struct cam_periph *periph; + + periph = (struct cam_periph *)callback_arg; + + switch(code) { + case AC_FOUND_DEVICE: + { + struct ccb_getdev *cgd; + cam_status status; + path_id_t path_id; + + cgd = (struct ccb_getdev *)arg; + if (arg == NULL) { + break; + } + + if (enc_type(cgd) == ENC_NONE) { + /* + * Schedule announcement of the ENC bindings for + * this device if it is managed by a SEP. + */ + path_id = xpt_path_path_id(path); + xpt_lock_buses(); + TAILQ_FOREACH(periph, &encdriver.units, unit_links) { + struct enc_softc *softc; + + softc = (struct enc_softc *)periph->softc; + if (xpt_path_path_id(periph->path) != path_id + || softc == NULL + || (softc->enc_flags & ENC_FLAG_INITIALIZED) + == 0 + || softc->enc_vec.device_found == NULL) + continue; + + softc->enc_vec.device_found(softc); + } + xpt_unlock_buses(); + return; + } + + status = cam_periph_alloc(enc_ctor, enc_oninvalidate, + enc_dtor, enc_start, "ses", CAM_PERIPH_BIO, + cgd->ccb_h.path, enc_async, AC_FOUND_DEVICE, cgd); + + if (status != CAM_REQ_CMP && status != CAM_REQ_INPROG) { + printf("enc_async: Unable to probe new device due to " + "status 0x%x\n", status); + } + break; + } + default: + cam_periph_async(periph, code, path, arg); + break; + } +} + +static int +enc_open(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + struct cam_periph *periph; + struct enc_softc *softc; + int error = 0; + + periph = (struct cam_periph *)dev->si_drv1; + if (periph == NULL) { + return (ENXIO); + } + + if (cam_periph_acquire(periph) != CAM_REQ_CMP) + return (ENXIO); + + cam_periph_lock(periph); + + softc = (struct enc_softc *)periph->softc; + + if ((softc->enc_flags & ENC_FLAG_INITIALIZED) == 0) { + error = ENXIO; + goto out; + } + if (softc->enc_flags & ENC_FLAG_INVALID) { + error = ENXIO; + goto out; + } + +out: + cam_periph_unlock(periph); + if (error) { + cam_periph_release(periph); + } + return (error); +} + +static int +enc_close(struct cdev *dev, int flag, int fmt, struct thread *td) +{ + struct cam_periph *periph; + struct enc_softc *softc; + + periph = (struct cam_periph *)dev->si_drv1; + if (periph == NULL) + return (ENXIO); + + cam_periph_lock(periph); + + softc = (struct enc_softc *)periph->softc; + + cam_periph_unlock(periph); + cam_periph_release(periph); + + return (0); +} + +static void +enc_start(struct cam_periph *p, union ccb *sccb) +{ + struct enc_softc *enc; + + enc = p->softc; + ENC_DLOG(enc, "%s enter imm=%d prio=%d\n", + __func__, p->immediate_priority, p->pinfo.priority); + if (p->immediate_priority <= p->pinfo.priority) { + SLIST_INSERT_HEAD(&p->ccb_list, &sccb->ccb_h, periph_links.sle); + p->immediate_priority = CAM_PRIORITY_NONE; + wakeup(&p->ccb_list); + } else + xpt_release_ccb(sccb); + ENC_DLOG(enc, "%s exit\n", __func__); +} + +void +enc_done(struct cam_periph *periph, union ccb *dccb) +{ + wakeup(&dccb->ccb_h.cbfcnp); +} + +int +enc_error(union ccb *ccb, uint32_t cflags, uint32_t sflags) +{ + struct enc_softc *softc; + struct cam_periph *periph; + + periph = xpt_path_periph(ccb->ccb_h.path); + softc = (struct enc_softc *)periph->softc; + + return (cam_periph_error(ccb, cflags, sflags, &softc->saved_ccb)); +} + +static int +enc_ioctl(struct cdev *dev, u_long cmd, caddr_t arg_addr, int flag, + struct thread *td) +{ + struct cam_periph *periph; + encioc_enc_status_t tmp; + encioc_string_t sstr; + encioc_elm_status_t elms; + encioc_elm_desc_t elmd; + encioc_elm_devnames_t elmdn; + encioc_element_t *uelm; + enc_softc_t *enc; + enc_cache_t *cache; + void *addr; + int error, i; + + + if (arg_addr) + addr = *((caddr_t *) arg_addr); + else + addr = NULL; + + periph = (struct cam_periph *)dev->si_drv1; + if (periph == NULL) + return (ENXIO); + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering encioctl\n")); + + cam_periph_lock(periph); + enc = (struct enc_softc *)periph->softc; + cache = &enc->enc_cache; + + /* + * Now check to see whether we're initialized or not. + * This actually should never fail as we're not supposed + * to get past enc_open w/o successfully initializing + * things. + */ + if ((enc->enc_flags & ENC_FLAG_INITIALIZED) == 0) { + cam_periph_unlock(periph); + return (ENXIO); + } + cam_periph_unlock(periph); + + error = 0; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("trying to do ioctl %#lx\n", cmd)); + + /* + * If this command can change the device's state, + * we must have the device open for writing. + * + * For commands that get information about the + * device- we don't need to lock the peripheral + * if we aren't running a command. The periph + * also can't go away while a user process has + * it open. + */ + switch (cmd) { + case ENCIOC_GETNELM: + case ENCIOC_GETELMMAP: + case ENCIOC_GETENCSTAT: + case ENCIOC_GETELMSTAT: + case ENCIOC_GETELMDESC: + case ENCIOC_GETELMDEVNAMES: + break; + default: + if ((flag & FWRITE) == 0) { + return (EBADF); + } + } + + /* + * XXX The values read here are only valid for the current + * configuration generation. We need these ioctls + * to also pass in/out a generation number. + */ + sx_slock(&enc->enc_cache_lock); + switch (cmd) { + case ENCIOC_GETNELM: + error = copyout(&cache->nelms, addr, sizeof (cache->nelms)); + break; + + case ENCIOC_GETELMMAP: + for (uelm = addr, i = 0; i != cache->nelms; i++) { + encioc_element_t kelm; + kelm.elm_idx = i; + kelm.elm_subenc_id = cache->elm_map[i].subenclosure; + kelm.elm_type = cache->elm_map[i].enctype; + error = copyout(&kelm, &uelm[i], sizeof(kelm)); + if (error) + break; + } + break; + + case ENCIOC_GETENCSTAT: + cam_periph_lock(periph); + error = enc->enc_vec.get_enc_status(enc, 1); + if (error) { + cam_periph_unlock(periph); + break; + } + tmp = cache->enc_status; + cam_periph_unlock(periph); + error = copyout(&tmp, addr, sizeof(tmp)); + cache->enc_status = tmp; + break; + + case ENCIOC_SETENCSTAT: + error = copyin(addr, &tmp, sizeof(tmp)); + if (error) + break; + cam_periph_lock(periph); + error = enc->enc_vec.set_enc_status(enc, tmp, 1); + cam_periph_unlock(periph); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 24 14:32:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 201AB106566B; Thu, 24 May 2012 14:32:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id ACB228FC08; Thu, 24 May 2012 14:32:40 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4OEWXZ8016088; Thu, 24 May 2012 17:32:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4OEWWC3065727; Thu, 24 May 2012 17:32:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4OEWWIu065726; Thu, 24 May 2012 17:32:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 May 2012 17:32:32 +0300 From: Konstantin Belousov To: Alexander Motin Message-ID: <20120524143232.GM2358@deviant.kiev.zoral.com.ua> References: <201205241407.q4OE7i47042313@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3ALZ8E19BIoSIFJn" Content-Disposition: inline In-Reply-To: <201205241407.q4OE7i47042313@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235911 - in head: share/examples/ses share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 14:32:41 -0000 --3ALZ8E19BIoSIFJn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 24, 2012 at 02:07:44PM +0000, Alexander Motin wrote: > Author: mav > Date: Thu May 24 14:07:44 2012 > New Revision: 235911 > URL: http://svn.freebsd.org/changeset/base/235911 >=20 > Log: > MFprojects/zfsd: > Revamp the CAM enclosure services driver. > This updated driver uses an in-kernel daemon to track state changes and > publishes physical path location information\for disk elements into the > CAM device database. > =20 > Sponsored by: Spectra Logic Corporation > Sponsored by: iXsystems, Inc. > Submitted by: gibbs, will, mav >=20 > Added: > head/sys/cam/scsi/scsi_enc.c (contents, props changed) > head/sys/cam/scsi/scsi_enc.h (contents, props changed) > head/sys/cam/scsi/scsi_enc_internal.h (contents, props changed) > head/sys/cam/scsi/scsi_enc_safte.c (contents, props changed) > head/sys/cam/scsi/scsi_enc_ses.c (contents, props changed) > Deleted: > head/sys/cam/scsi/scsi_ses.c > Modified: > head/share/examples/ses/Makefile.inc > head/share/examples/ses/srcs/eltsub.c > head/share/examples/ses/srcs/getencstat.c > head/share/examples/ses/srcs/getnobj.c > head/share/examples/ses/srcs/getobjmap.c > head/share/examples/ses/srcs/getobjstat.c > head/share/examples/ses/srcs/inienc.c > head/share/examples/ses/srcs/sesd.c > head/share/examples/ses/srcs/setencstat.c > head/share/examples/ses/srcs/setobjstat.c > head/sys/cam/scsi/scsi_ses.h > head/sys/conf/files > head/sys/fs/devfs/devfs_vnops.c > head/sys/modules/cam/Makefile > head/usr.bin/kdump/mkioctls The devfs change should have been committed separately. Also, I do not see why devfs should do this to aliases at all. Also, your change only handles jails and not chroots, why ? Index: devfs_vnops.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- devfs_vnops.c (revision 235910) +++ devfs_vnops.c (revision 235911) @@ -1266,8 +1266,53 @@ static int devfs_readlink(struct vop_readlink_args *ap) { struct devfs_dirent *de; + struct cdev_priv *cdp; =20 de =3D ap->a_vp->v_data; + cdp =3D de->de_cdp; + + if (cdp !=3D NULL && (cdp->cdp_c.si_flags & SI_ALIAS) !=3D 0) { + struct devfs_mount *dmp; + struct prison *pr; + char *mp; + int mp_len; + int pr_path_len; + int err; The declarations should be placed at the start of the function, not at the start of the block. + + /* + * For device aliases, construct an absolute symlink (to + * shorten its length and avoid the ugliness of a relative + * link) by prepending the fully qualified path to the root + * of this devfs. For a non-jailed process, the devfs root + * is our mount point. For a jailed process, we must remove + * any jail prefix in our mount point so that our response + * matches the user process's world view. + */ + dmp =3D VFSTODEVFS(ap->a_vp->v_mount); + mp =3D dmp->dm_mount->mnt_stat.f_mntonname; + mp_len =3D strlen(mp); + + pr =3D ap->a_cred->cr_prison; + pr_path_len =3D strlen(pr->pr_path); + + if (strncmp(pr->pr_path, mp, pr_path_len) =3D=3D 0 + && mp[pr_path_len] =3D=3D '/') { Style prefers to put '&&' on the first line, and not on the continuation line. I suspect that you may access mp past the end of its memory there, no ? + mp +=3D pr_path_len; + mp_len -=3D pr_path_len; + } + + err =3D uiomove(mp, mp_len, ap->a_uio); + if (err !=3D 0) + return (err); + + /* + * Devfs cannot be the root file system, so its + * mount point must always be terminated by a '/'. + */ + err =3D uiomove("/", 1, ap->a_uio); + if (err !=3D 0) + return (err); + } return (uiomove(de->de_symlink, strlen(de->de_symlink), ap->a_uio)); } =20 --3ALZ8E19BIoSIFJn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk++RoAACgkQC3+MBN1Mb4gqeQCaA6EWcqa8XjZJ1CXvzcJ5eTcC nKkAn1Spf4091kLGqz3FKcUCpSsg3krT =UtQq -----END PGP SIGNATURE----- --3ALZ8E19BIoSIFJn-- From owner-svn-src-all@FreeBSD.ORG Thu May 24 15:25:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54A451065673; Thu, 24 May 2012 15:25:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25BA88FC16; Thu, 24 May 2012 15:25: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 q4OFPagU045570; Thu, 24 May 2012 15:25:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OFPZes045568; Thu, 24 May 2012 15:25:35 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205241525.q4OFPZes045568@svn.freebsd.org> From: Alan Cox Date: Thu, 24 May 2012 15:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235912 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 15:25:36 -0000 Author: alc Date: Thu May 24 15:25:35 2012 New Revision: 235912 URL: http://svn.freebsd.org/changeset/base/235912 Log: MF amd64 r233097, r233122 With the changes over the past year to how accesses to the page's dirty field are synchronized, there is no need for pmap_protect() to acquire the page queues lock unless it is going to access the pv lists or PMAP1/PADDR1. Style fix to pmap_protect(). Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu May 24 14:07:44 2012 (r235911) +++ head/sys/i386/i386/pmap.c Thu May 24 15:25:35 2012 (r235912) @@ -3050,7 +3050,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv vm_offset_t pdnxt; pd_entry_t ptpaddr; pt_entry_t *pte; - int anychanged; + boolean_t anychanged, pv_lists_locked; if ((prot & VM_PROT_READ) == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); @@ -3066,10 +3066,16 @@ pmap_protect(pmap_t pmap, vm_offset_t sv return; #endif - anychanged = 0; + if (pmap_is_current(pmap)) + pv_lists_locked = FALSE; + else { + pv_lists_locked = TRUE; +resume: + vm_page_lock_queues(); + sched_pin(); + } + anychanged = FALSE; - vm_page_lock_queues(); - sched_pin(); PMAP_LOCK(pmap); for (; sva < eva; sva = pdnxt) { pt_entry_t obits, pbits; @@ -3104,12 +3110,27 @@ pmap_protect(pmap_t pmap, vm_offset_t sv */ if (pmap_protect_pde(pmap, &pmap->pm_pdir[pdirindex], sva, prot)) - anychanged = 1; - continue; - } else if (!pmap_demote_pde(pmap, - &pmap->pm_pdir[pdirindex], sva)) { - /* The large page mapping was destroyed. */ + anychanged = TRUE; continue; + } else { + if (!pv_lists_locked) { + pv_lists_locked = TRUE; + if (!mtx_trylock(&vm_page_queue_mtx)) { + if (anychanged) + pmap_invalidate_all( + pmap); + PMAP_UNLOCK(pmap); + goto resume; + } + } + if (!pmap_demote_pde(pmap, + &pmap->pm_pdir[pdirindex], sva)) { + /* + * The large page mapping was + * destroyed. + */ + continue; + } } } @@ -3155,14 +3176,16 @@ retry: if (obits & PG_G) pmap_invalidate_page(pmap, sva); else - anychanged = 1; + anychanged = TRUE; } } } - sched_unpin(); if (anychanged) pmap_invalidate_all(pmap); - vm_page_unlock_queues(); + if (pv_lists_locked) { + sched_unpin(); + vm_page_unlock_queues(); + } PMAP_UNLOCK(pmap); } From owner-svn-src-all@FreeBSD.ORG Thu May 24 15:55:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE4B91065673; Thu, 24 May 2012 15:55:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3E1F8FC1B; Thu, 24 May 2012 15:55: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 q4OFtgWO046812; Thu, 24 May 2012 15:55:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OFtgTb046809; Thu, 24 May 2012 15:55:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205241555.q4OFtgTb046809@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 May 2012 15:55:42 +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: r235913 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 15:55:43 -0000 Author: trasz Date: Thu May 24 15:55:41 2012 New Revision: 235913 URL: http://svn.freebsd.org/changeset/base/235913 Log: MFC r234383: Stop treating system processes as special. This fixes panics like the one triggered by this: # kldload geom_vinum # pwait `pgrep -S gv_worker` & # kldunload geom_vinum or this: GEOM_JOURNAL: Shutting down geom gjournal 3464572051. panic: destroying non-empty racct: 1 allocated for resource 6 which were tracked by jh@ to be caused by checking p->p_flag, while it wasn't initialised yet. Basically, during fork, the code checked p_flag, concluded the process isn't marked as P_SYSTEM, incremented the counter, and later on, when exiting, checked that the process was marked as P_SYSTEM, and thus didn't decrement it. Also, I believe there wasn't any good reason for checking P_SYSTEM in the first place. Modified: stable/9/sys/kern/kern_racct.c stable/9/sys/kern/kern_rctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_racct.c ============================================================================== --- stable/9/sys/kern/kern_racct.c Thu May 24 15:25:35 2012 (r235912) +++ stable/9/sys/kern/kern_racct.c Thu May 24 15:55:41 2012 (r235913) @@ -267,9 +267,6 @@ racct_add_locked(struct proc *p, int res int error; #endif - if (p->p_flag & P_SYSTEM) - return (0); - SDT_PROBE(racct, kernel, rusage, add, p, resource, amount, 0, 0); /* @@ -344,9 +341,6 @@ void racct_add_force(struct proc *p, int resource, uint64_t amount) { - if (p->p_flag & P_SYSTEM) - return; - SDT_PROBE(racct, kernel, rusage, add_force, p, resource, amount, 0, 0); /* @@ -368,9 +362,6 @@ racct_set_locked(struct proc *p, int res int error; #endif - if (p->p_flag & P_SYSTEM) - return (0); - SDT_PROBE(racct, kernel, rusage, set, p, resource, amount, 0, 0); /* @@ -426,9 +417,6 @@ racct_set_force(struct proc *p, int reso { int64_t diff; - if (p->p_flag & P_SYSTEM) - return; - SDT_PROBE(racct, kernel, rusage, set, p, resource, amount, 0, 0); /* @@ -487,9 +475,6 @@ void racct_sub(struct proc *p, int resource, uint64_t amount) { - if (p->p_flag & P_SYSTEM) - return; - SDT_PROBE(racct, kernel, rusage, sub, p, resource, amount, 0, 0); /* @@ -556,12 +541,6 @@ racct_proc_fork(struct proc *parent, str */ racct_create(&child->p_racct); - /* - * No resource accounting for kernel processes. - */ - if (child->p_flag & P_SYSTEM) - return (0); - PROC_LOCK(parent); PROC_LOCK(child); mtx_lock(&racct_lock); @@ -711,8 +690,6 @@ racctd(void) FOREACH_PROC_IN_SYSTEM(p) { if (p->p_state != PRS_NORMAL) continue; - if (p->p_flag & P_SYSTEM) - continue; microuptime(&wallclock); timevalsub(&wallclock, &p->p_stats->p_start); Modified: stable/9/sys/kern/kern_rctl.c ============================================================================== --- stable/9/sys/kern/kern_rctl.c Thu May 24 15:25:35 2012 (r235912) +++ stable/9/sys/kern/kern_rctl.c Thu May 24 15:55:41 2012 (r235913) @@ -994,11 +994,6 @@ rctl_rule_add(struct rctl_rule *rule) case RCTL_SUBJECT_TYPE_PROCESS: p = rule->rr_subject.rs_proc; KASSERT(p != NULL, ("rctl_rule_add: NULL proc")); - /* - * No resource limits for system processes. - */ - if (p->p_flag & P_SYSTEM) - return (EPERM); rctl_racct_add_rule(p->p_racct, rule); /* @@ -1036,8 +1031,6 @@ rctl_rule_add(struct rctl_rule *rule) */ sx_assert(&allproc_lock, SA_LOCKED); FOREACH_PROC_IN_SYSTEM(p) { - if (p->p_flag & P_SYSTEM) - continue; cred = p->p_ucred; switch (rule->rr_subject_type) { case RCTL_SUBJECT_TYPE_USER: @@ -1284,10 +1277,6 @@ sys_rctl_get_racct(struct thread *td, st error = EINVAL; goto out; } - if (p->p_flag & P_SYSTEM) { - error = EINVAL; - goto out; - } outputsbuf = rctl_racct_to_sbuf(p->p_racct, 0); break; case RCTL_SUBJECT_TYPE_USER: @@ -1719,20 +1708,7 @@ rctl_proc_fork(struct proc *parent, stru LIST_INIT(&child->p_racct->r_rule_links); - /* - * No limits for kernel processes. - */ - if (child->p_flag & P_SYSTEM) - return (0); - - /* - * Nothing to inherit from P_SYSTEM parents. - */ - if (parent->p_racct == NULL) { - KASSERT(parent->p_flag & P_SYSTEM, - ("non-system process without racct; p = %p", parent)); - return (0); - } + KASSERT(parent->p_racct != NULL, ("process without racct; p = %p", parent)); rw_wlock(&rctl_lock); From owner-svn-src-all@FreeBSD.ORG Thu May 24 16:11:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5142D106566B; Thu, 24 May 2012 16:11:14 +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 3ADF38FC16; Thu, 24 May 2012 16:11: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 q4OGBE6q047493; Thu, 24 May 2012 16:11:14 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OGBEiW047491; Thu, 24 May 2012 16:11:14 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201205241611.q4OGBEiW047491@svn.freebsd.org> From: Sean Bruno Date: Thu, 24 May 2012 16:11: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: r235914 - stable/9/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:11:14 -0000 Author: sbruno Date: Thu May 24 16:11:13 2012 New Revision: 235914 URL: http://svn.freebsd.org/changeset/base/235914 Log: MFC r235634 Decode new battery status indications. Modified: stable/9/usr.sbin/mfiutil/mfi_show.c Directory Properties: stable/9/usr.sbin/mfiutil/ (props changed) Modified: stable/9/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_show.c Thu May 24 15:55:41 2012 (r235913) +++ stable/9/usr.sbin/mfiutil/mfi_show.c Thu May 24 16:11:13 2012 (r235914) @@ -224,7 +224,29 @@ show_battery(int ac, char **av) } if (stat.fw_status & MFI_BBU_STATE_DISCHARGE_ACTIVE) { printf("%s DISCHARGING", comma ? "," : ""); + comma = 1; } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_REQ) { + printf("%s LEARN_CYCLE_REQUESTED", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_ACTIVE) { + printf("%s LEARN_CYCLE_ACTIVE", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_FAIL) { + printf("%s LEARN_CYCLE_FAIL", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_TIMEOUT) { + printf("%s LEARN_CYCLE_TIMEOUT", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_I2C_ERR_DETECT) { + printf("%s I2C_ERROR_DETECT", comma ? "," : ""); + comma = 1; + } + if (!comma) printf(" normal"); printf("\n"); From owner-svn-src-all@FreeBSD.ORG Thu May 24 16:11:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DA9C106568C; Thu, 24 May 2012 16:11:52 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1238FC15; Thu, 24 May 2012 16:11:52 +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 q4OGBqOE047553; Thu, 24 May 2012 16:11:52 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OGBqDn047551; Thu, 24 May 2012 16:11:52 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201205241611.q4OGBqDn047551@svn.freebsd.org> From: Josh Paetzel Date: Thu, 24 May 2012 16:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235915 - head/usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:11:52 -0000 Author: jpaetzel Date: Thu May 24 16:11:51 2012 New Revision: 235915 URL: http://svn.freebsd.org/changeset/base/235915 Log: Hook up mkulzma to the build. MFC after: 3 days Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu May 24 16:11:13 2012 (r235914) +++ head/usr.bin/Makefile Thu May 24 16:11:51 2012 (r235915) @@ -105,6 +105,7 @@ SUBDIR= alias \ mkfifo \ mklocale \ mktemp \ + mkulzma \ mkuzip \ mt \ ncal \ From owner-svn-src-all@FreeBSD.ORG Thu May 24 16:30:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB2A8106566B; Thu, 24 May 2012 16:30:14 +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 B60F28FC12; Thu, 24 May 2012 16:30: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 q4OGUEVe048363; Thu, 24 May 2012 16:30:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OGUEnd048360; Thu, 24 May 2012 16:30:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205241630.q4OGUEnd048360@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 16:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235916 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:30:14 -0000 Author: bz Date: Thu May 24 16:30:13 2012 New Revision: 235916 URL: http://svn.freebsd.org/changeset/base/235916 Log: MFp4 bz_ipv6_fast: Introduce in6_getscope() to allow more effective checksum computations without the need to copy the address to clear the scope. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/scope6.c head/sys/netinet6/scope6_var.h Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Thu May 24 16:11:51 2012 (r235915) +++ head/sys/netinet6/scope6.c Thu May 24 16:30:13 2012 (r235916) @@ -494,3 +494,16 @@ in6_clearscope(struct in6_addr *in6) return (modified); } + +/* + * Return the scope identifier or zero. + */ +uint16_t +in6_getscope(struct in6_addr *in6) +{ + + if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6)) + return (in6->s6_addr16[1]); + + return (0); +} Modified: head/sys/netinet6/scope6_var.h ============================================================================== --- head/sys/netinet6/scope6_var.h Thu May 24 16:11:51 2012 (r235915) +++ head/sys/netinet6/scope6_var.h Thu May 24 16:30:13 2012 (r235916) @@ -54,6 +54,7 @@ int sa6_embedscope __P((struct sockaddr_ int sa6_recoverscope __P((struct sockaddr_in6 *)); int in6_setscope __P((struct in6_addr *, struct ifnet *, u_int32_t *)); int in6_clearscope __P((struct in6_addr *)); +uint16_t in6_getscope(struct in6_addr *); #endif /* _KERNEL */ #endif /* _NETINET6_SCOPE6_VAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu May 24 16:38:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27F1C106575A; Thu, 24 May 2012 16:38:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9C22B8FC0A; Thu, 24 May 2012 16:38:25 +0000 (UTC) Message-ID: <4FBE6401.1010009@FreeBSD.org> Date: Thu, 24 May 2012 12:38:25 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0.1 MIME-Version: 1.0 To: "Alexander V. Chernikov" References: <201205212219.q4LMJKR9076035@svn.freebsd.org> <4FBD7E65.1060205@FreeBSD.org> <4FBE1120.8020704@FreeBSD.org> In-Reply-To: <4FBE1120.8020704@FreeBSD.org> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235746 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:38:26 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-05-24 06:44:48 -0400, Alexander V. Chernikov wrote: > Does the attached patch look ok to you? Generally looks good. Few nits: - --- bpf.c --- 1713: #ifdef BPF_JITTER 1714: bpf_jit_filter *ofunc, *jfunc; 1715: #endif Please add jfunc before ofunc, i.e., style(9). 1743: if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) != 0 || 1744: (bpf_validate(fcode, (int)flen) == 0)) { 1745: free(fcode, M_BPF); 1746: return (EINVAL); 1747: } Excessive parens @ L1744. 1752: #ifdef BPF_JITTER 1753: if (fp->bf_insns != NULL) 1754: jfunc = bpf_jitter(fcode, flen); 1755: else 1756: jfunc = NULL; /* Make compiler happy */ 1757: #endif Please test 'fcode' instead of 'fp->bf_insns' for consistency. - --- bpf_jitter.c --- 72: #ifdef _KERNEL 73: filter = (struct bpf_jit_filter *)malloc(sizeof(*filter), 74: M_BPFJIT, M_WAITOK); 75: #else This change is bogus because bpf_jit_compile() does more malloc(9) calls with M_NOWAIT, bpf_jitter() failures are not fatal (i.e., all consumers fall back to bpf_filter(9)), all consumers (e.g., ng_bpf.c) assume M_NOWAIT, etc, etc... Please note I haven't looked at other locking changes. Thanks, Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk++ZAAACgkQmlay1b9qnVObOgCfZmKOtPC8BhsnUK4I9LC5fW53 ePwAnipYRZFYNSi/5KFs2J3+L62zUMId =CASZ -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Thu May 24 16:41:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C84DE1065670; Thu, 24 May 2012 16:41:26 +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 B1E6E8FC17; Thu, 24 May 2012 16:41: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 q4OGfQb8048838; Thu, 24 May 2012 16:41:26 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OGfQQp048836; Thu, 24 May 2012 16:41:26 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201205241641.q4OGfQQp048836@svn.freebsd.org> From: Sean Bruno Date: Thu, 24 May 2012 16:41:26 +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: r235917 - stable/8/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:41:26 -0000 Author: sbruno Date: Thu May 24 16:41:26 2012 New Revision: 235917 URL: http://svn.freebsd.org/changeset/base/235917 Log: MFC r235634 Decode new battery status indications. Modified: stable/8/usr.sbin/mfiutil/mfi_show.c Directory Properties: stable/8/usr.sbin/mfiutil/ (props changed) Modified: stable/8/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_show.c Thu May 24 16:30:13 2012 (r235916) +++ stable/8/usr.sbin/mfiutil/mfi_show.c Thu May 24 16:41:26 2012 (r235917) @@ -224,7 +224,29 @@ show_battery(int ac, char **av) } if (stat.fw_status & MFI_BBU_STATE_DISCHARGE_ACTIVE) { printf("%s DISCHARGING", comma ? "," : ""); + comma = 1; } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_REQ) { + printf("%s LEARN_CYCLE_REQUESTED", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_ACTIVE) { + printf("%s LEARN_CYCLE_ACTIVE", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_FAIL) { + printf("%s LEARN_CYCLE_FAIL", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_TIMEOUT) { + printf("%s LEARN_CYCLE_TIMEOUT", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_I2C_ERR_DETECT) { + printf("%s I2C_ERROR_DETECT", comma ? "," : ""); + comma = 1; + } + if (!comma) printf(" normal"); printf("\n"); From owner-svn-src-all@FreeBSD.ORG Thu May 24 16:48:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED9B2106564A; Thu, 24 May 2012 16:48:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8C488FC14; Thu, 24 May 2012 16:48:33 +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 q4OGmXjA049189; Thu, 24 May 2012 16:48:33 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OGmXha049187; Thu, 24 May 2012 16:48:33 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205241648.q4OGmXha049187@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 May 2012 16:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235918 - head/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:48:34 -0000 Author: trasz Date: Thu May 24 16:48:33 2012 New Revision: 235918 URL: http://svn.freebsd.org/changeset/base/235918 Log: Make g_label(4) ignore provider size when looking for UFS labels. Without it, it fails to create labels for filesystems resized by growfs(8). PR: kern/165962 Submitted by: Olivier Cochard-Labbe Modified: head/sys/geom/label/g_label_ufs.c Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Thu May 24 16:41:26 2012 (r235917) +++ head/sys/geom/label/g_label_ufs.c Thu May 24 16:48:33 2012 (r235918) @@ -81,12 +81,10 @@ g_label_ufs_taste_common(struct g_consum fs = (struct fs *)g_read_data(cp, superblock, SBLOCKSIZE, NULL); if (fs == NULL) continue; - /* Check for magic and make sure things are the right size */ - if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0 && - pp->mediasize / fs->fs_fsize == fs->fs_old_size) { + /* Check for magic */ + if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0) { /* Valid UFS1. */ - } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 && - pp->mediasize / fs->fs_fsize == fs->fs_size) { + } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0) { /* Valid UFS2. */ } else { g_free(fs); From owner-svn-src-all@FreeBSD.ORG Thu May 24 17:10:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 353C71065672; Thu, 24 May 2012 17:10:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F0248FC0A; Thu, 24 May 2012 17:10: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 q4OHAs74050160; Thu, 24 May 2012 17:10:54 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OHAsRb050158; Thu, 24 May 2012 17:10:54 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205241710.q4OHAsRb050158@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 24 May 2012 17:10: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: r235919 - stable/9/usr.sbin/pkg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 17:10:55 -0000 Author: bapt Date: Thu May 24 17:10:54 2012 New Revision: 235919 URL: http://svn.freebsd.org/changeset/base/235919 Log: Add missing \n when generating pkg.conf Reported by: beat Approved by: des (mentor) Modified: stable/9/usr.sbin/pkg/pkg.c Directory Properties: stable/9/usr.sbin/ (props changed) Modified: stable/9/usr.sbin/pkg/pkg.c ============================================================================== --- stable/9/usr.sbin/pkg/pkg.c Thu May 24 16:48:33 2012 (r235918) +++ stable/9/usr.sbin/pkg/pkg.c Thu May 24 17:10:54 2012 (r235919) @@ -371,7 +371,7 @@ bootstrap_pkg(void) config = fopen(conf, "w+"); if (config == NULL) goto cleanup; - fprintf(config, "packagesite: %s", url); + fprintf(config, "packagesite: %s\n", url); fclose(config); } From owner-svn-src-all@FreeBSD.ORG Thu May 24 17:39:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD261106564A; Thu, 24 May 2012 17:39:54 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C84D18FC0A; Thu, 24 May 2012 17:39: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 q4OHdsRd051351; Thu, 24 May 2012 17:39:54 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OHdsS8051349; Thu, 24 May 2012 17:39:54 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201205241739.q4OHdsS8051349@svn.freebsd.org> From: Jack F Vogel Date: Thu, 24 May 2012 17:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235920 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 17:39:55 -0000 Author: jfv Date: Thu May 24 17:39:54 2012 New Revision: 235920 URL: http://svn.freebsd.org/changeset/base/235920 Log: Fix to kern/168294 - add flow director support into the static kernel build of ixgbe. Thanks Sergey for pointing this out. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 24 17:10:54 2012 (r235919) +++ head/sys/conf/files Thu May 24 17:39:54 2012 (r235920) @@ -1522,7 +1522,7 @@ dev/ixgb/if_ixgb.c optional ixgb dev/ixgb/ixgb_ee.c optional ixgb dev/ixgb/ixgb_hw.c optional ixgb dev/ixgbe/ixgbe.c optional ixgbe inet \ - compile-with "${NORMAL_C} -I$S/dev/ixgbe" + compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP -DIXGBE_FDIR" dev/ixgbe/ixv.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_phy.c optional ixgbe inet \ From owner-svn-src-all@FreeBSD.ORG Thu May 24 18:05:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60473106564A; Thu, 24 May 2012 18:05:11 +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 4A48C8FC0A; Thu, 24 May 2012 18:05: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 q4OI5BhU052409; Thu, 24 May 2012 18:05:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OI5B2R052407; Thu, 24 May 2012 18:05:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205241805.q4OI5B2R052407@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 18:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235921 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 18:05:11 -0000 Author: bz Date: Thu May 24 18:05:10 2012 New Revision: 235921 URL: http://svn.freebsd.org/changeset/base/235921 Log: MFp4 bz_ipv6_fast: Optimize in6_cksum(), re-ordering work and limiting variable initialization, removing a bzero() for mostly re-initialized struct values, making use of the newly introduced in6_getscope(), as well as converting an if/panic to a KASSERT(). Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/in6_cksum.c Modified: head/sys/netinet6/in6_cksum.c ============================================================================== --- head/sys/netinet6/in6_cksum.c Thu May 24 17:39:54 2012 (r235920) +++ head/sys/netinet6/in6_cksum.c Thu May 24 18:05:10 2012 (r235921) @@ -89,12 +89,10 @@ __FBSDID("$FreeBSD$"); int in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len) { - u_int16_t *w; - int sum = 0; - int mlen = 0; - int byte_swapped = 0; struct ip6_hdr *ip6; - struct in6_addr in6; + u_int16_t *w, scope; + int byte_swapped, mlen; + int sum; union { u_int16_t phs[4]; struct { @@ -112,42 +110,38 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t l; } l_util; - /* sanity check */ - if (m->m_pkthdr.len < off + len) { - panic("in6_cksum: mbuf len (%d) < off+len (%d+%d)", - m->m_pkthdr.len, off, len); - } - - bzero(&uph, sizeof(uph)); + /* Sanity check. */ + KASSERT(m->m_pkthdr.len >= off + len, ("%s: mbuf len (%d) < off(%d)+" + "len(%d)", __func__, m->m_pkthdr.len, off, len)); /* * First create IP6 pseudo header and calculate a summary. */ - ip6 = mtod(m, struct ip6_hdr *); uph.ph.ph_len = htonl(len); + uph.ph.ph_zero[0] = uph.ph.ph_zero[1] = uph.ph.ph_zero[2] = 0; uph.ph.ph_nxt = nxt; - /* - * IPv6 source address. - * XXX: we'd like to avoid copying the address, but we can't due to - * the possibly embedded scope zone ID. - */ - in6 = ip6->ip6_src; - in6_clearscope(&in6); - w = (u_int16_t *)&in6; + /* Payload length and upper layer identifier. */ + sum = uph.phs[0]; sum += uph.phs[1]; + sum += uph.phs[2]; sum += uph.phs[3]; + + ip6 = mtod(m, struct ip6_hdr *); + + /* IPv6 source address. */ + scope = in6_getscope(&ip6->ip6_src); + w = (u_int16_t *)&ip6->ip6_src; sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; + if (scope != 0) + sum -= scope; - /* IPv6 destination address */ - in6 = ip6->ip6_dst; - in6_clearscope(&in6); - w = (u_int16_t *)&in6; + /* IPv6 destination address. */ + scope = in6_getscope(&ip6->ip6_dst); + w = (u_int16_t *)&ip6->ip6_dst; sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; - - /* Payload length and upper layer identifier */ - sum += uph.phs[0]; sum += uph.phs[1]; - sum += uph.phs[2]; sum += uph.phs[3]; + if (scope != 0) + sum -= scope; /* * Secondly calculate a summary of the first mbuf excluding offset. @@ -167,14 +161,16 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, /* * Force to even boundary. */ - if ((1 & (long) w) && (mlen > 0)) { + if ((1 & (long)w) && (mlen > 0)) { REDUCE; sum <<= 8; s_util.c[0] = *(u_char *)w; w = (u_int16_t *)((char *)w + 1); mlen--; byte_swapped = 1; - } + } else + byte_swapped = 0; + /* * Unroll the loop to make overhead from * branches &c small. From owner-svn-src-all@FreeBSD.ORG Thu May 24 18:19:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32AEC106566C; Thu, 24 May 2012 18:19:24 +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 1C1B48FC08; Thu, 24 May 2012 18:19:24 +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 q4OIJNV0053093; Thu, 24 May 2012 18:19:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OIJNJu053091; Thu, 24 May 2012 18:19:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205241819.q4OIJNJu053091@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 18:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235922 - head/sys/fs/devfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 18:19:24 -0000 Author: mav Date: Thu May 24 18:19:23 2012 New Revision: 235922 URL: http://svn.freebsd.org/changeset/base/235922 Log: Revert devfs part of r235911. I was unaware about old but unfinished discussion between kib@ and gibbs@ about it. Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Thu May 24 18:05:10 2012 (r235921) +++ head/sys/fs/devfs/devfs_vnops.c Thu May 24 18:19:23 2012 (r235922) @@ -1266,53 +1266,8 @@ static int devfs_readlink(struct vop_readlink_args *ap) { struct devfs_dirent *de; - struct cdev_priv *cdp; de = ap->a_vp->v_data; - cdp = de->de_cdp; - - if (cdp != NULL && (cdp->cdp_c.si_flags & SI_ALIAS) != 0) { - struct devfs_mount *dmp; - struct prison *pr; - char *mp; - int mp_len; - int pr_path_len; - int err; - - /* - * For device aliases, construct an absolute symlink (to - * shorten its length and avoid the ugliness of a relative - * link) by prepending the fully qualified path to the root - * of this devfs. For a non-jailed process, the devfs root - * is our mount point. For a jailed process, we must remove - * any jail prefix in our mount point so that our response - * matches the user process's world view. - */ - dmp = VFSTODEVFS(ap->a_vp->v_mount); - mp = dmp->dm_mount->mnt_stat.f_mntonname; - mp_len = strlen(mp); - - pr = ap->a_cred->cr_prison; - pr_path_len = strlen(pr->pr_path); - - if (strncmp(pr->pr_path, mp, pr_path_len) == 0 - && mp[pr_path_len] == '/') { - mp += pr_path_len; - mp_len -= pr_path_len; - } - - err = uiomove(mp, mp_len, ap->a_uio); - if (err != 0) - return (err); - - /* - * Devfs cannot be the root file system, so its - * mount point must always be terminated by a '/'. - */ - err = uiomove("/", 1, ap->a_uio); - if (err != 0) - return (err); - } return (uiomove(de->de_symlink, strlen(de->de_symlink), ap->a_uio)); } From owner-svn-src-all@FreeBSD.ORG Thu May 24 18:22:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AF46106566B; Thu, 24 May 2012 18:22: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 7B5EA8FC0A; Thu, 24 May 2012 18:22: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 q4OIMwBq053273; Thu, 24 May 2012 18:22:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OIMwZU053270; Thu, 24 May 2012 18:22:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201205241822.q4OIMwZU053270@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 24 May 2012 18:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235923 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 18:22:58 -0000 Author: glebius Date: Thu May 24 18:22:57 2012 New Revision: 235923 URL: http://svn.freebsd.org/changeset/base/235923 Log: Revert r220768 for ng_ksocket. This node is special and when it is cloning, its constructor method may be called in a context that isn't allowed to sleep. Noticed by: Vadim Goncharov Modified: head/sys/netgraph/ng_ksocket.c head/sys/netgraph/ng_mppc.c Modified: head/sys/netgraph/ng_ksocket.c ============================================================================== --- head/sys/netgraph/ng_ksocket.c Thu May 24 18:19:23 2012 (r235922) +++ head/sys/netgraph/ng_ksocket.c Thu May 24 18:22:57 2012 (r235923) @@ -524,7 +524,9 @@ ng_ksocket_constructor(node_p node) priv_p priv; /* Allocate private structure */ - priv = malloc(sizeof(*priv), M_NETGRAPH_KSOCKET, M_WAITOK | M_ZERO); + priv = malloc(sizeof(*priv), M_NETGRAPH_KSOCKET, M_NOWAIT | M_ZERO); + if (priv == NULL) + return (ENOMEM); LIST_INIT(&priv->embryos); /* cross link them */ Modified: head/sys/netgraph/ng_mppc.c ============================================================================== --- head/sys/netgraph/ng_mppc.c Thu May 24 18:19:23 2012 (r235922) +++ head/sys/netgraph/ng_mppc.c Thu May 24 18:22:57 2012 (r235923) @@ -98,15 +98,6 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, "n /* Key length */ #define KEYLEN(b) (((b) & MPPE_128) ? 16 : 8) -/* - * When packets are lost with MPPE, we may have to re-key arbitrarily - * many times to 'catch up' to the new jumped-ahead sequence number. - * Since this can be expensive, we pose a limit on how many re-keyings - * we will do at one time to avoid a possible D.O.S. vulnerability. - * This should instead be a configurable parameter. - */ -#define MPPE_MAX_REKEY 1000 - /* MPPC packet header bits */ #define MPPC_FLAG_FLUSHED 0x8000 /* xmitter reset state */ #define MPPC_FLAG_RESTART 0x4000 /* compress history restart */ @@ -641,20 +632,22 @@ ng_mppc_decompress(node_p node, struct m #endif #ifdef NETGRAPH_MPPC_ENCRYPTION if ((d->cfg.bits & MPPE_BITS) != 0) { - u_int rekey; - - /* How many times are we going to have to re-key? */ - rekey = ((d->cfg.bits & MPPE_STATELESS) != 0) ? - numLost : (numLost / (MPPE_UPDATE_MASK + 1)); - if (rekey > MPPE_MAX_REKEY) { - log(LOG_ERR, "%s: too many (%d) packets" - " dropped, disabling node %p!", - __func__, numLost, node); - priv->recv.cfg.enable = 0; - goto failed; - } - - /* Re-key as necessary to catch up to peer */ + u_int rekey; + + /* How many times are we going to have to re-key? */ + rekey = ((d->cfg.bits & MPPE_STATELESS) != 0) ? + numLost : (numLost / (MPPE_UPDATE_MASK + 1)); + if (rekey > 1000) + log(LOG_ERR, "%s: %d packets dropped, " + "node [%x]\n", __func__, numLost, + node->nd_ID); + + /* + * When packets are lost or re-ordered with MPPE, + * we may have to re-key up to 0xfff times to 'catch + * up' to the new jumped-ahead sequence number. Yep, + * this is heavy, but what else can we do? + */ while (d->cc != cc) { if ((d->cfg.bits & MPPE_STATELESS) != 0 || (d->cc & MPPE_UPDATE_MASK) From owner-svn-src-all@FreeBSD.ORG Thu May 24 18:25:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29F311065678; Thu, 24 May 2012 18:25:10 +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 0AD108FC19; Thu, 24 May 2012 18:25: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 q4OIP9Gu053397; Thu, 24 May 2012 18:25:09 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OIP9RN053394; Thu, 24 May 2012 18:25:09 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205241825.q4OIP9RN053394@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 18:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235924 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 18:25:10 -0000 Author: bz Date: Thu May 24 18:25:09 2012 New Revision: 235924 URL: http://svn.freebsd.org/changeset/base/235924 Log: MFp4 bz_ipv6_fast: Introduce a (for now copied stripped down) in6_cksum_pseudo() function. We should be able to use this from in6_cksum() but we should also ponder possible MD specific improvements. It takes an extra csum argument to allow for easy checks as will be done by the upper layer protocol input paths. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/in6.h head/sys/netinet6/in6_cksum.c Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Thu May 24 18:22:57 2012 (r235923) +++ head/sys/netinet6/in6.h Thu May 24 18:25:09 2012 (r235924) @@ -632,7 +632,9 @@ struct ip6_mtuinfo { #ifdef _KERNEL struct cmsghdr; +struct ip6_hdr; +int in6_cksum_pseudo(struct ip6_hdr *, uint32_t, uint8_t, uint16_t); int in6_cksum __P((struct mbuf *, u_int8_t, u_int32_t, u_int32_t)); int in6_localaddr __P((struct in6_addr *)); int in6_localip(struct in6_addr *); Modified: head/sys/netinet6/in6_cksum.c ============================================================================== --- head/sys/netinet6/in6_cksum.c Thu May 24 18:22:57 2012 (r235923) +++ head/sys/netinet6/in6_cksum.c Thu May 24 18:25:09 2012 (r235924) @@ -80,6 +80,66 @@ __FBSDID("$FreeBSD$"); #define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) #define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; (void)ADDCARRY(sum);} +static int +_in6_cksum_pseudo(struct ip6_hdr *ip6, uint32_t len, uint8_t nxt, uint16_t csum) +{ + int sum; + uint16_t scope, *w; + union { + u_int16_t phs[4]; + struct { + u_int32_t ph_len; + u_int8_t ph_zero[3]; + u_int8_t ph_nxt; + } __packed ph; + } uph; + + sum = csum; + + /* + * First create IP6 pseudo header and calculate a summary. + */ + uph.ph.ph_len = htonl(len); + uph.ph.ph_zero[0] = uph.ph.ph_zero[1] = uph.ph.ph_zero[2] = 0; + uph.ph.ph_nxt = nxt; + + /* Payload length and upper layer identifier. */ + sum += uph.phs[0]; sum += uph.phs[1]; + sum += uph.phs[2]; sum += uph.phs[3]; + + /* IPv6 source address. */ + scope = in6_getscope(&ip6->ip6_src); + w = (u_int16_t *)&ip6->ip6_src; + sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; + sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; + if (scope != 0) + sum -= scope; + + /* IPv6 destination address. */ + scope = in6_getscope(&ip6->ip6_dst); + w = (u_int16_t *)&ip6->ip6_dst; + sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; + sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; + if (scope != 0) + sum -= scope; + + return (sum); +} + +int +in6_cksum_pseudo(struct ip6_hdr *ip6, uint32_t len, uint8_t nxt, uint16_t csum) +{ + int sum; + union { + u_int16_t s[2]; + u_int32_t l; + } l_util; + + sum = _in6_cksum_pseudo(ip6, len, nxt, csum); + REDUCE; + return (sum); +} + /* * m MUST contain a contiguous IP6 header. * off is an offset where TCP/UDP/ICMP6 header starts. From owner-svn-src-all@FreeBSD.ORG Thu May 24 19:13:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6F861065676; Thu, 24 May 2012 19:13:54 +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 B20888FC1D; Thu, 24 May 2012 19:13: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 q4OJDs6f055415; Thu, 24 May 2012 19:13:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OJDsXg055413; Thu, 24 May 2012 19:13:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205241913.q4OJDsXg055413@svn.freebsd.org> From: Dimitry Andric Date: Thu, 24 May 2012 19:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235925 - head/sys/dev/drm2/i915 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 19:13:54 -0000 Author: dim Date: Thu May 24 19:13:54 2012 New Revision: 235925 URL: http://svn.freebsd.org/changeset/base/235925 Log: Fix the following clang warning in drm2: sys/dev/drm2/i915/intel_display.c:8861:3: error: expression result unused [-Werror,-Wunused-value] _intel_wait_for(dev, ^~~~~~~~~~~~~~~~~~~~ @/dev/drm2/i915/intel_drv.h:55:2: note: expanded from macro '_intel_wait_for' ret; \ ^~~ Reviewed by: kib MFC after: 1 week Modified: head/sys/dev/drm2/i915/intel_display.c Modified: head/sys/dev/drm2/i915/intel_display.c ============================================================================== --- head/sys/dev/drm2/i915/intel_display.c Thu May 24 18:25:09 2012 (r235924) +++ head/sys/dev/drm2/i915/intel_display.c Thu May 24 19:13:54 2012 (r235925) @@ -8858,7 +8858,7 @@ static void ironlake_disable_rc6(struct if (I915_READ(PWRCTXA)) { /* Wake the GPU, prevent RC6, then restore RSTDBYCTL */ I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) | RCX_SW_EXIT); - _intel_wait_for(dev, + (void)_intel_wait_for(dev, ((I915_READ(RSTDBYCTL) & RSX_STATUS_MASK) == RSX_STATUS_ON), 50, 1, "915pro"); From owner-svn-src-all@FreeBSD.ORG Thu May 24 19:24:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A362106566B; Thu, 24 May 2012 19:24:33 +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 51B6F8FC12; Thu, 24 May 2012 19:24:33 +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 q4OJOX5h055905; Thu, 24 May 2012 19:24:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OJOWRl055896; Thu, 24 May 2012 19:24:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205241924.q4OJOWRl055896@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 19:24:32 +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: r235926 - in stable/9: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/wbwd sys/i386/conf sys/modules sys/modules/wbwd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 19:24:33 -0000 Author: bz Date: Thu May 24 19:24:31 2012 New Revision: 235926 URL: http://svn.freebsd.org/changeset/base/235926 Log: MFC r232614: Provide wbwd(4), a driver for the watchdog timer found on various Winbond Super I/O chips. Added: stable/9/share/man/man4/wbwd.4 - copied unchanged from r232614, head/share/man/man4/wbwd.4 stable/9/sys/dev/wbwd/ - copied from r232614, head/sys/dev/wbwd/ stable/9/sys/modules/wbwd/ - copied from r232614, head/sys/modules/wbwd/ Modified: stable/9/sys/amd64/conf/GENERIC.hints stable/9/sys/amd64/conf/NOTES stable/9/sys/boot/forth/loader.conf stable/9/sys/conf/files.amd64 stable/9/sys/conf/files.i386 stable/9/sys/i386/conf/GENERIC.hints stable/9/sys/i386/conf/NOTES stable/9/sys/modules/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Copied: stable/9/share/man/man4/wbwd.4 (from r232614, head/share/man/man4/wbwd.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/wbwd.4 Thu May 24 19:24:31 2012 (r235926, copy of r232614, head/share/man/man4/wbwd.4) @@ -0,0 +1,117 @@ +.\"- +.\" Copyright (c) 2012 Bjoern A. Zeeb +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 6, 2012 +.Dt wbwd 4 +.Os +.Sh NAME +.Nm wbwd +.Nd device driver for watchdog timer found on Winbond Super I/O chips +.Sh SYNOPSIS +To compile this driver into the kernel, place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device wbwd" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the following +line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +wbwd_load="YES" +.Ed +.Pp +In +.Pa /boot/device.hints : +.Cd hint.wbwd.0.at="isa" +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr watchdog 4 +support for the watchdog interrupt timer present on at least the following +Winbond Super I/O chips: +.Pp +.Bl -bullet -compact +.It +83627HF/F/HG/G Rev. G +.It +83627HF/F/HG/G Rev. J +.It +83627HF/F/HG/G Rev. UD-A +.It +83627DHG IC ver. 5 +.El +.Sh SYSCTL VARIABLES +The +.Nm +driver provides the following options as +.Xr sysctl 8 +variables. +.Bl -tag -width "xxxxxx" +.It Va dev.wbwd.0.timeout_override +This variable allows to program the timer to a value independent on the one +provided by the +.Xr watchdog 4 +framework while still relying on the regular updates from e.g. +.Xr watchdogd 8 . +This is particularly useful if your system provides multiple watchdogs and +you want them to fire in a special sequence to trigger an NMI after a shorter +period than the reset timeout for example. +The value set must not be lower than the sleep time of +.Xr watchdogd 8 . +A value of 0 disables this feature and the timeout value provided by +.Xr watchdog 4 +will be used. +.It Va dev.wbwd.0.debug_verbose +If set this sysctl will tell the driver to log its current state before and +after the timer reset on each invocation from +.Xr watchdog 9 +to the kernel message buffer for debugging. +.It Va dev.wbwd.0.debug +This read-only value gives the state of some registers on last update. +.El +.Pp +The +.Nm +driver also provides further sysctl options that are hidden by default. +See the source code for more information. +.Sh SEE ALSO +.Xr watchdog 4 , +.Xr device.hints 5 , +.Xr watchdog 8 , +.Xr watchdogd 8 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Bjoern A. Zeeb Aq bz@FreeBSD.org . Modified: stable/9/sys/amd64/conf/GENERIC.hints ============================================================================== --- stable/9/sys/amd64/conf/GENERIC.hints Thu May 24 19:13:54 2012 (r235925) +++ stable/9/sys/amd64/conf/GENERIC.hints Thu May 24 19:24:31 2012 (r235926) @@ -30,3 +30,4 @@ hint.atrtc.0.irq="8" hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" +hint.wbwd.0.at="isa" Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Thu May 24 19:13:54 2012 (r235925) +++ stable/9/sys/amd64/conf/NOTES Thu May 24 19:24:31 2012 (r235926) @@ -464,10 +464,12 @@ device tpm # # ichwd: Intel ICH watchdog timer # amdsbwd: AMD SB7xx watchdog timer +# wbwd: Winbond watchdog timer # device ichwd device amdsbwd device viawd +device wbwd # # Temperature sensors: Modified: stable/9/sys/boot/forth/loader.conf ============================================================================== --- stable/9/sys/boot/forth/loader.conf Thu May 24 19:13:54 2012 (r235925) +++ stable/9/sys/boot/forth/loader.conf Thu May 24 19:24:31 2012 (r235926) @@ -488,6 +488,7 @@ vpd_load="NO" # Vital Product Data ker vpo_load="NO" # Parallel to SCSI interface driver amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor tpm_load="NO" # Trusted Platform Module +wbwd_load="NO" # Winbond watchdog ############################################################## ### ACPI settings ########################################## Modified: stable/9/sys/conf/files.amd64 ============================================================================== --- stable/9/sys/conf/files.amd64 Thu May 24 19:13:54 2012 (r235925) +++ stable/9/sys/conf/files.amd64 Thu May 24 19:24:31 2012 (r235926) @@ -269,6 +269,7 @@ dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_amd64.c optional uart dev/viawd/viawd.c optional viawd +dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi dev/isci/isci.c optional isci dev/isci/isci_controller.c optional isci Modified: stable/9/sys/conf/files.i386 ============================================================================== --- stable/9/sys/conf/files.i386 Thu May 24 19:13:54 2012 (r235925) +++ stable/9/sys/conf/files.i386 Thu May 24 19:24:31 2012 (r235926) @@ -247,6 +247,7 @@ dev/uart/uart_cpu_i386.c optional uart dev/viawd/viawd.c optional viawd dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard +dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi dev/isci/isci.c optional isci dev/isci/isci_controller.c optional isci Modified: stable/9/sys/i386/conf/GENERIC.hints ============================================================================== --- stable/9/sys/i386/conf/GENERIC.hints Thu May 24 19:13:54 2012 (r235925) +++ stable/9/sys/i386/conf/GENERIC.hints Thu May 24 19:24:31 2012 (r235926) @@ -38,3 +38,4 @@ hint.atrtc.0.irq="8" hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" +hint.wbwd.0.at="isa" Modified: stable/9/sys/i386/conf/NOTES ============================================================================== --- stable/9/sys/i386/conf/NOTES Thu May 24 19:13:54 2012 (r235925) +++ stable/9/sys/i386/conf/NOTES Thu May 24 19:24:31 2012 (r235926) @@ -837,10 +837,12 @@ hint.pcf.0.irq="5" # # ichwd: Intel ICH watchdog timer # amdsbwd: AMD SB7xx watchdog timer +# wbwd: Winbond watchdog timer # device ichwd device amdsbwd device viawd +device wbwd # # Temperature sensors: Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Thu May 24 19:13:54 2012 (r235925) +++ stable/9/sys/modules/Makefile Thu May 24 19:24:31 2012 (r235926) @@ -332,6 +332,7 @@ SUBDIR= ${_3dfx} \ vx \ ${_vxge} \ wb \ + ${_wbwd} \ ${_wi} \ wlan \ wlan_acl \ @@ -509,6 +510,7 @@ _stg= stg _streams= streams _svr4= svr4 _vxge= vxge +_wbwd= wbwd _wi= wi _xe= xe .if ${MK_ZFS} != "no" || defined(ALL_MODULES) @@ -700,6 +702,7 @@ _vesa= vesa _viawd= viawd _vxge= vxge _x86bios= x86bios +_wbwd= wbwd _wi= wi _wpi= wpi .if ${MK_SOURCELESS_UCODE} != "no" From owner-svn-src-all@FreeBSD.ORG Thu May 24 19:48:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 255A61065670; Thu, 24 May 2012 19:48:16 +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 EC0058FC08; Thu, 24 May 2012 19:48: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 q4OJmFh6056932; Thu, 24 May 2012 19:48:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OJmFlY056929; Thu, 24 May 2012 19:48:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205241948.q4OJmFlY056929@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 19:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235927 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 19:48:16 -0000 Author: marcel Date: Thu May 24 19:48:15 2012 New Revision: 235927 URL: http://svn.freebsd.org/changeset/base/235927 Log: Work better with how make/bmake works: 1. Avoid a cd back into ${.CURDIR} to run mkbuiltins when we know make will first cd into ${.OBJDIR}. Keep the cwd to what make sets it to. 2. Don't tell mkbuiltins where to write to (= ${.OBJDIR}), but where to get sources from (= ${.CURDIR}). This to compensate for point 1. This fixes a problem with bmake's mk files that optimize ${.OBJDIR} to expand to "." after changing cwd, not taking into account that the target is pretty much undoing that and not getting the full path to the object tree anymore. Modified: head/bin/sh/Makefile head/bin/sh/mkbuiltins Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Thu May 24 19:24:31 2012 (r235926) +++ head/bin/sh/Makefile Thu May 24 19:48:15 2012 (r235927) @@ -38,7 +38,7 @@ build-tools: mkinit mknodes mksyntax .ORDER: builtins.c builtins.h builtins.c builtins.h: mkbuiltins builtins.def - cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR} + sh ${.CURDIR}/mkbuiltins ${.CURDIR} init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \ redir.c trap.c var.c Modified: head/bin/sh/mkbuiltins ============================================================================== --- head/bin/sh/mkbuiltins Thu May 24 19:24:31 2012 (r235926) +++ head/bin/sh/mkbuiltins Thu May 24 19:48:15 2012 (r235927) @@ -35,17 +35,17 @@ # $FreeBSD$ temp=`/usr/bin/mktemp -t ka` -havejobs=0 -if grep '^#define[ ]*JOBS[ ]*1' shell.h > /dev/null -then havejobs=1 -fi havehist=1 if [ "X$1" = "X-h" ]; then havehist=0 shift fi -objdir=$1 -exec > ${objdir}/builtins.c +srcdir=$1 +havejobs=0 +if grep '^#define[ ]*JOBS[ ]*1' $srcdir/shell.h > /dev/null +then havejobs=1 +fi +exec > builtins.c cat <<\! /* * This file was generated by the mkbuiltins program. @@ -57,7 +57,7 @@ cat <<\! ! awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \ - print $0}' builtins.def | sed 's/-[hj]//' > $temp + print $0}' $srcdir/builtins.def | sed 's/-[hj]//' > $temp echo 'int (*const builtinfunc[])(int, char **) = {' awk '/^[^#]/ { printf "\t%s,\n", $1}' $temp echo '}; @@ -74,7 +74,7 @@ awk '{ for (i = 2 ; i <= NF ; i++) { echo ' { NULL, 0, 0 } };' -exec > ${objdir}/builtins.h +exec > builtins.h cat <<\! /* * This file was generated by the mkbuiltins program. From owner-svn-src-all@FreeBSD.ORG Thu May 24 20:00:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F1631065672; Thu, 24 May 2012 20:00:59 +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 7733F8FC14; Thu, 24 May 2012 20:00:59 +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 q4OK0xSJ057483; Thu, 24 May 2012 20:00:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OK0xLu057481; Thu, 24 May 2012 20:00:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242000.q4OK0xLu057481@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 20:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235928 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:00:59 -0000 Author: marcel Date: Thu May 24 20:00:58 2012 New Revision: 235928 URL: http://svn.freebsd.org/changeset/base/235928 Log: Fix an inconsistency I just ran into for LDADD and DPADD. The description for both of them use different, and presumably wrong, variables in the example. They set LDFILES and SRCLIB respectively. I guess that's what DPADD and LDADD were called first ... Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Thu May 24 19:48:15 2012 (r235927) +++ head/share/mk/bsd.README Thu May 24 20:00:58 2012 (r235928) @@ -228,7 +228,7 @@ LDADD Additional loader objects. Usual For example, to load with the compatibility and utility libraries, use: - LDFILES=-lutil -lcompat + LDADD=-lutil -lcompat LDFLAGS Additional loader flags. @@ -261,7 +261,7 @@ DPADD Additional dependencies for the p libraries. For example, to depend on the compatibility and utility libraries use: - SRCLIB=${LIBCOMPAT} ${LIBUTIL} + DPADD=${LIBCOMPAT} ${LIBUTIL} There is a predefined identifier for each (non-profiled, non-shared) library and object. Library file names are From owner-svn-src-all@FreeBSD.ORG Thu May 24 20:12:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 267641065674; Thu, 24 May 2012 20:12:47 +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 078988FC0A; Thu, 24 May 2012 20:12: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 q4OKCkb0057989; Thu, 24 May 2012 20:12:46 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OKCkv9057985; Thu, 24 May 2012 20:12:46 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242012.q4OKCkv9057985@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 20:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235929 - in head/lib/libc/powerpc: . gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:12:47 -0000 Author: marcel Date: Thu May 24 20:12:46 2012 New Revision: 235929 URL: http://svn.freebsd.org/changeset/base/235929 Log: Allow building for the PowerPC EABI by providing a dummy __eabi() function. The purpose of the __eabi() function is to set up the runtime and is called first thing by main(). The runtime is already set up for us prior to caling main, so there's nothing to do for us in the EABI case. Added: head/lib/libc/powerpc/gen/eabi.S (contents, props changed) Modified: head/lib/libc/powerpc/Symbol.map head/lib/libc/powerpc/gen/Makefile.inc Modified: head/lib/libc/powerpc/Symbol.map ============================================================================== --- head/lib/libc/powerpc/Symbol.map Thu May 24 20:00:58 2012 (r235928) +++ head/lib/libc/powerpc/Symbol.map Thu May 24 20:12:46 2012 (r235929) @@ -11,6 +11,7 @@ FBSD_1.0 { /* PSEUDO syscalls */ _exit; + __eabi; _mcount; _setjmp; _longjmp; Modified: head/lib/libc/powerpc/gen/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/gen/Makefile.inc Thu May 24 20:00:58 2012 (r235928) +++ head/lib/libc/powerpc/gen/Makefile.inc Thu May 24 20:12:46 2012 (r235929) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ +SRCS += _ctx_start.S eabi.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ fpgetsticky.c fpsetmask.c fpsetround.c getcontextx.c \ infinity.c ldexp.c makecontext.c _setjmp.S \ setjmp.S sigsetjmp.S signalcontext.c syncicache.c \ Added: head/lib/libc/powerpc/gen/eabi.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc/gen/eabi.S Thu May 24 20:12:46 2012 (r235929) @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2011 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +ENTRY(__eabi) + blr + + .section .note.GNU-stack,"",%progbits From owner-svn-src-all@FreeBSD.ORG Thu May 24 20:24:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5BD5C106566B; Thu, 24 May 2012 20:24:50 +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 46C098FC19; Thu, 24 May 2012 20:24: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 q4OKOoDs058474; Thu, 24 May 2012 20:24:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OKOoFQ058472; Thu, 24 May 2012 20:24:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242024.q4OKOoFQ058472@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 20:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235930 - head/sys/dev/fdt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:24:50 -0000 Author: marcel Date: Thu May 24 20:24:49 2012 New Revision: 235930 URL: http://svn.freebsd.org/changeset/base/235930 Log: Preset (clear) the ranges we're supposed to fill from the FDT. If a particular range (either I/O memory or I/O port) is not defined in the FDT, we're not handing uninitialized structures back to our caller. Modified: head/sys/dev/fdt/fdt_pci.c Modified: head/sys/dev/fdt/fdt_pci.c ============================================================================== --- head/sys/dev/fdt/fdt_pci.c Thu May 24 20:12:46 2012 (r235929) +++ head/sys/dev/fdt/fdt_pci.c Thu May 24 20:24:49 2012 (r235930) @@ -100,6 +100,14 @@ fdt_pci_ranges_decode(phandle_t node, st size_cells); tuples = len / tuple_size; + /* + * Initialize the ranges so that we don't have to worry about + * having them all defined in the FDT. In particular, it is + * perfectly fine not to want I/O space on PCI busses. + */ + bzero(io_space, sizeof(*io_space)); + bzero(mem_space, sizeof(*mem_space)); + rangesptr = &ranges[0]; offset_cells = 0; for (i = 0; i < tuples; i++) { From owner-svn-src-all@FreeBSD.ORG Thu May 24 20:45:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA018106564A; Thu, 24 May 2012 20:45:44 +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 9B35C8FC14; Thu, 24 May 2012 20:45: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 q4OKji9H059400; Thu, 24 May 2012 20:45:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OKjipb059398; Thu, 24 May 2012 20:45:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242045.q4OKjipb059398@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 20:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:45:44 -0000 Author: marcel Date: Thu May 24 20:45:44 2012 New Revision: 235931 URL: http://svn.freebsd.org/changeset/base/235931 Log: Fix the memory barriers for CPUs that do not like lwsync and wedge or cause exceptions early enough during boot that the kernel will do ithe same. Use lwsync only when compiling for LP64 and revert to the more proven isync when compiling for ILP32. Note that in the end (i.e. between revision 222198 and this change) ILP32 changed from using sync to using isync. As per Nathan the isync is needed to make sure I/O accesses are properly serialized with locks and isync tends to be more effecient than sync. While here, undefine __ATOMIC_ACQ and __ATOMIC_REL at the end of the file so as not to leak their definitions. Discussed with: nwhitehorn Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Thu May 24 20:24:49 2012 (r235930) +++ head/sys/powerpc/include/atomic.h Thu May 24 20:45:44 2012 (r235931) @@ -36,23 +36,30 @@ #error this file needs sys/cdefs.h as a prerequisite #endif -/* NOTE: lwsync is equivalent to sync on systems without lwsync */ -#define mb() __asm __volatile("lwsync" : : : "memory") -#ifdef __powerpc64__ -#define rmb() __asm __volatile("lwsync" : : : "memory") -#define wmb() __asm __volatile("lwsync" : : : "memory") -#else -#define rmb() __asm __volatile("lwsync" : : : "memory") -#define wmb() __asm __volatile("eieio" : : : "memory") -#endif - /* * The __ATOMIC_REL/ACQ() macros provide memory barriers only in conjunction - * with the atomic lXarx/stXcx. sequences below. See Appendix B.2 of Book II - * of the architecture manual. + * with the atomic lXarx/stXcx. sequences below. They are not exposed outside + * of this file. See also Appendix B.2 of Book II of the architecture manual. + * + * Note that not all Book-E processors accept the light-weight sync variant. + * In particular, early models of E500 cores are known to wedge. Bank on all + * 64-bit capable CPUs to accept lwsync properly and pressimize 32-bit CPUs + * to use the heavier-weight sync. */ + +#ifdef __powerpc64__ +#define mb() __asm __volatile("lwsync" : : : "memory") +#define rmb() __asm __volatile("lwsync" : : : "memory") +#define wmb() __asm __volatile("lwsync" : : : "memory") #define __ATOMIC_REL() __asm __volatile("lwsync" : : : "memory") +#define __ATOMIC_ACQ() __asm __volatile("lwsync" : : : "memory") +#else +#define mb() __asm __volatile("isync" : : : "memory") +#define rmb() __asm __volatile("isync" : : : "memory") +#define wmb() __asm __volatile("isync" : : : "memory") +#define __ATOMIC_REL() __asm __volatile("isync" : : : "memory") #define __ATOMIC_ACQ() __asm __volatile("isync" : : : "memory") +#endif /* * atomic_add(p, v) @@ -683,4 +690,7 @@ atomic_fetchadd_long(volatile u_long *p, #define atomic_fetchadd_64 atomic_fetchadd_long #endif +#undef __ATOMIC_REL +#undef __ATOMIC_ACQ + #endif /* ! _MACHINE_ATOMIC_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu May 24 20:58:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80E06106566C; Thu, 24 May 2012 20:58:41 +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 6A7B58FC08; Thu, 24 May 2012 20:58: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 q4OKwfff059928; Thu, 24 May 2012 20:58:41 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OKwfmE059924; Thu, 24 May 2012 20:58:41 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242058.q4OKwfmE059924@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 20:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235932 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:58:41 -0000 Author: marcel Date: Thu May 24 20:58:40 2012 New Revision: 235932 URL: http://svn.freebsd.org/changeset/base/235932 Log: o Rename kernload_ap to bp_kernelload. This to introduce a common prefix for variables that live in the boot page. o Add bp_trace (yes, it's in the boot page) that gets zeroed before we try to wake a core and to which the core being woken can write markers so that we know where the core was in case it doesn't wake up. The boot code does not yet write markers (too follow). o Disable the boot page translation to allow the last 4K page to be used for whatever we please. It would get mapped otherwise. o Fix kernstart in the case of SMP. The start argument is typically page aligned due to the alignment requirements that come with having a boot page. The point of using trunc_page is that we get the actual load address given that the entry point is immediately following the ELF headers. In the SMP case this ended up exactly 4K after the load address. Hence subtracting 1 from start. Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/platform_bare.c head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Thu May 24 20:45:44 2012 (r235931) +++ head/sys/powerpc/booke/locore.S Thu May 24 20:58:40 2012 (r235932) @@ -242,14 +242,20 @@ done_mapping: __boot_page: bl 1f - .globl kernload_ap -kernload_ap: + .globl bp_trace +bp_trace: + .long 0 + + .globl bp_kernload +bp_kernload: .long 0 /* * Initial configuration */ 1: + mflr %r31 /* r31 hold the address of bp_trace */ + /* Set HIDs */ lis %r3, HID0_E500_DEFAULT_SET@h ori %r3, %r3, HID0_E500_DEFAULT_SET@l @@ -318,15 +324,15 @@ kernload_ap: mtspr SPR_MAS2, %r3 isync - /* Retrieve kernel load [physical] address from kernload_ap */ + /* Retrieve kernel load [physical] address from bp_kernload */ bl 4f 4: mflr %r3 rlwinm %r3, %r3, 0, 0, 19 - lis %r4, kernload_ap@h - ori %r4, %r4, kernload_ap@l + lis %r4, bp_kernload@h + ori %r4, %r4, bp_kernload@l lis %r5, __boot_page@h ori %r5, %r5, __boot_page@l - sub %r4, %r4, %r5 /* offset of kernload_ap within __boot_page */ + sub %r4, %r4, %r5 /* offset of bp_kernload within __boot_page */ lwzx %r3, %r4, %r3 /* Set RPN and protection */ Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Thu May 24 20:45:44 2012 (r235931) +++ head/sys/powerpc/booke/platform_bare.c Thu May 24 20:58:40 2012 (r235932) @@ -56,7 +56,8 @@ __FBSDID("$FreeBSD$"); #ifdef SMP extern void *ap_pcpu; extern uint8_t __boot_page[]; /* Boot page body */ -extern uint32_t kernload_ap; /* Kernel physical load address */ +extern uint32_t bp_kernload; /* Kernel physical load address */ +extern uint32_t bp_trace; /* AP boot trace field */ #endif extern uint32_t *bootinfo; @@ -262,8 +263,8 @@ bare_smp_start_cpu(platform_t plat, stru eebpcr = ccsr_read4(OCP85XX_EEBPCR); if ((eebpcr & (1 << (pc->pc_cpuid + 24))) != 0) { - printf("%s: CPU=%d already out of hold-off state!\n", - __func__, pc->pc_cpuid); + printf("SMP: CPU %d already out of hold-off state!\n", + pc->pc_cpuid); return (ENXIO); } @@ -273,12 +274,13 @@ bare_smp_start_cpu(platform_t plat, stru /* * Set BPTR to the physical address of the boot page */ - bptr = ((uint32_t)__boot_page - KERNBASE) + kernload_ap; + bptr = ((uint32_t)__boot_page - KERNBASE) + bp_kernload; ccsr_write4(OCP85XX_BPTR, (bptr >> 12) | 0x80000000); /* * Release AP from hold-off state */ + bp_trace = 0; eebpcr |= (1 << (pc->pc_cpuid + 24)); ccsr_write4(OCP85XX_EEBPCR, eebpcr); __asm __volatile("isync; msync"); @@ -287,6 +289,16 @@ bare_smp_start_cpu(platform_t plat, stru while (!pc->pc_awake && timeout--) DELAY(1000); /* wait 1ms */ + /* + * Disable boot page translation so that the 4K page at the default + * address (= 0xfffff000) isn't permanently remapped and thus not + * usable otherwise. + */ + ccsr_write4(OCP85XX_BPTR, 0); + + if (!pc->pc_awake) + printf("SMP: CPU %d didn't wake up (trace code %#x).\n", + pc->pc_awake, bp_trace); return ((pc->pc_awake) ? 0 : EBUSY); #else /* No SMP support */ Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu May 24 20:45:44 2012 (r235931) +++ head/sys/powerpc/booke/pmap.c Thu May 24 20:58:40 2012 (r235932) @@ -115,7 +115,7 @@ extern unsigned char _end[]; extern uint32_t *bootinfo; #ifdef SMP -extern uint32_t kernload_ap; +extern uint32_t bp_kernload; #endif vm_paddr_t kernload; @@ -967,10 +967,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf("mmu_booke_bootstrap: entered\n"); #ifdef SMP - kernload_ap = kernload; + bp_kernload = kernload; #endif - /* Initialize invalidation mutex */ mtx_init(&tlbivax_mutex, "tlbivax", NULL, MTX_SPIN); @@ -981,8 +980,13 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset * Align kernel start and end address (kernel image). * Note that kernel end does not necessarily relate to kernsize. * kernsize is the size of the kernel that is actually mapped. + * Also note that "start - 1" is deliberate. With SMP, the + * entry point is exactly a page from the actual load address. + * As such, trunc_page() has no effect and we're off by a page. + * Since we always have the ELF header between the load address + * and the entry point, we can safely subtract 1 to compensate. */ - kernstart = trunc_page(start); + kernstart = trunc_page(start - 1); data_start = round_page(kernelend); data_end = data_start; @@ -1233,9 +1237,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset * entries, but for pte_vatopa() to work correctly with kernel area * addresses. */ - for (va = KERNBASE; va < data_end; va += PAGE_SIZE) { + for (va = kernstart; va < data_end; va += PAGE_SIZE) { pte = &(kernel_pmap->pm_pdir[PDIR_IDX(va)][PTBL_IDX(va)]); - pte->rpn = kernload + (va - KERNBASE); + pte->rpn = kernload + (va - kernstart); pte->flags = PTE_M | PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; } @@ -1397,9 +1401,7 @@ mmu_booke_kenter(mmu_t mmu, vm_offset_t KASSERT(((va >= VM_MIN_KERNEL_ADDRESS) && (va <= VM_MAX_KERNEL_ADDRESS)), ("mmu_booke_kenter: invalid va")); - flags = 0; - flags |= (PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID); - flags |= PTE_M; + flags = PTE_M | PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; pte = &(kernel_pmap->pm_pdir[pdir_idx][ptbl_idx]); From owner-svn-src-all@FreeBSD.ORG Thu May 24 20:59:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B234F1065675; Thu, 24 May 2012 20:59:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 37BE18FC17; Thu, 24 May 2012 20:59:59 +0000 (UTC) Message-ID: <4FBEA14E.2060802@FreeBSD.org> Date: Thu, 24 May 2012 16:59:58 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0.1 MIME-Version: 1.0 To: Edward Tomasz Napierala References: <201205241648.q4OGmXha049187@svn.freebsd.org> In-Reply-To: <201205241648.q4OGmXha049187@svn.freebsd.org> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235918 - head/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:59:59 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-05-24 12:48:33 -0400, Edward Tomasz Napierala wrote: > Author: trasz Date: Thu May 24 16:48:33 2012 New Revision: 235918 > URL: http://svn.freebsd.org/changeset/base/235918 > > Log: Make g_label(4) ignore provider size when looking for UFS > labels. Without it, it fails to create labels for filesystems > resized by growfs(8). > > PR: kern/165962 Submitted by: Olivier Cochard-Labbe cochard dot me> > > Modified: head/sys/geom/label/g_label_ufs.c This commit broke my fstab based on ufsid. I have something like this in my fstab: /dev/ufsid/44b3df81873011b5 / ufs rw,noatime 1 1 /dev/ufsid/463b935456452bbd /tmp ufs rw,noatime 2 2 /dev/ufsid/44b3dfc4bfcc4c30 /usr ufs rw,noatime 2 2 /dev/ufsid/463b934b955f63ff /var ufs rw,noatime 2 2 Mounting / as read-only went fine and I had /dev/ada0s1a, /dev/ada0s1d, etc. Strangely, I also had matching ufsid's under /dev/ufsid, e.g., /dev/ufsid/a, /dev/ufsid/d, etc. However, once I do 'mount -u -w /', everything disappears except for root's ufsid. Reverting this commit fixed the problem for me. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk++oU4ACgkQmlay1b9qnVO2dQCfUT8+Z3pKORnH+htSgMUB7+un TK8AnRvL5Oc4vOic1yvceJpyTD5YQOFK =HEVp -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Thu May 24 21:01:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8704106564A; Thu, 24 May 2012 21:01:35 +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 B39528FC19; Thu, 24 May 2012 21:01: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 q4OL1ZFj060101; Thu, 24 May 2012 21:01:35 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OL1ZNs060098; Thu, 24 May 2012 21:01:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242101.q4OL1ZNs060098@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 21:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235933 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:01:35 -0000 Author: marcel Date: Thu May 24 21:01:35 2012 New Revision: 235933 URL: http://svn.freebsd.org/changeset/base/235933 Log: Either the I/O port range or the memory mapped I/O range may not be defined in the FDT. The range will have a zero size in that case. Modified: head/sys/powerpc/mpc85xx/pci_fdt.c Modified: head/sys/powerpc/mpc85xx/pci_fdt.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_fdt.c Thu May 24 20:58:40 2012 (r235932) +++ head/sys/powerpc/mpc85xx/pci_fdt.c Thu May 24 21:01:35 2012 (r235933) @@ -816,8 +816,13 @@ fsl_pcib_set_range(struct fsl_pcib_softc } *allocp = pci_start + alloc; - *vap = (uintptr_t)pmap_mapdev(start, size); - fsl_pcib_outbound(sc, wnd, type, start, size, pci_start); + if (size > 0) { + *vap = (uintptr_t)pmap_mapdev(start, size); + fsl_pcib_outbound(sc, wnd, type, start, size, pci_start); + } else { + *vap = 0; + fsl_pcib_outbound(sc, wnd, -1, 0, 0, 0); + } return (0); } From owner-svn-src-all@FreeBSD.ORG Thu May 24 21:07:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A5D6106564A; Thu, 24 May 2012 21:07:11 +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 8537C8FC19; Thu, 24 May 2012 21:07: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 q4OL7BmL060356; Thu, 24 May 2012 21:07:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OL7B7p060354; Thu, 24 May 2012 21:07:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242107.q4OL7B7p060354@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 21:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235934 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:07:11 -0000 Author: marcel Date: Thu May 24 21:07:10 2012 New Revision: 235934 URL: http://svn.freebsd.org/changeset/base/235934 Log: Just return if the size of the window is 0. This can happen when the FDT does not define all ranges possible for a particular node (e.g. PCI). While here, only update the trgt_mem and trgt_io pointers if there's no error. This avoids that we knowingly write an invalid target (= -1). Modified: head/sys/powerpc/mpc85xx/mpc85xx.c Modified: head/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.c Thu May 24 21:01:35 2012 (r235933) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Thu May 24 21:07:10 2012 (r235934) @@ -88,6 +88,9 @@ law_enable(int trgt, u_long addr, u_long uint32_t bar, sr; int i, law_max; + if (size == 0) + return (0); + law_max = law_getmax(); bar = _LAW_BAR(addr); sr = _LAW_SR(trgt, size); @@ -168,7 +171,10 @@ law_pci_target(struct resource *res, int default: rv = ENXIO; } - *trgt_mem = *trgt_io = trgt; + if (rv == 0) { + *trgt_mem = trgt; + *trgt_io = trgt; + } return (rv); } From owner-svn-src-all@FreeBSD.ORG Thu May 24 21:09:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C42F2106566B; Thu, 24 May 2012 21:09:38 +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 AF6948FC08; Thu, 24 May 2012 21:09: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 q4OL9cS9060486; Thu, 24 May 2012 21:09:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OL9cxI060484; Thu, 24 May 2012 21:09:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242109.q4OL9cxI060484@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 21:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235935 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:09:38 -0000 Author: marcel Date: Thu May 24 21:09:38 2012 New Revision: 235935 URL: http://svn.freebsd.org/changeset/base/235935 Log: Remove Semihakf-ism. DEBUG is a kernel configuration option. It should not be defined in source files. Modified: head/sys/powerpc/mpc85xx/i2c.c Modified: head/sys/powerpc/mpc85xx/i2c.c ============================================================================== --- head/sys/powerpc/mpc85xx/i2c.c Thu May 24 21:07:10 2012 (r235934) +++ head/sys/powerpc/mpc85xx/i2c.c Thu May 24 21:09:38 2012 (r235935) @@ -72,9 +72,6 @@ __FBSDID("$FreeBSD$"); #define I2C_BAUD_RATE_DEF 0x3F #define I2C_DFSSR_DIV 0x10 -#define DEBUG -#undef DEBUG - #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt,##args); } while (0) #else From owner-svn-src-all@FreeBSD.ORG Thu May 24 21:13:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37CD4106564A; Thu, 24 May 2012 21:13:25 +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 208F78FC08; Thu, 24 May 2012 21:13:25 +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 q4OLDOeL060687; Thu, 24 May 2012 21:13:24 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OLDOWO060681; Thu, 24 May 2012 21:13:24 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205242113.q4OLDOWO060681@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 24 May 2012 21:13:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235936 - in head/sys/powerpc: aim booke include powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:13:25 -0000 Author: raj Date: Thu May 24 21:13:24 2012 New Revision: 235936 URL: http://svn.freebsd.org/changeset/base/235936 Log: Fix physical address type to vm_paddr_t. Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/platform.c head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/aim/mmu_oea.c Thu May 24 21:13:24 2012 (r235936) @@ -289,7 +289,7 @@ boolean_t moea_is_modified(mmu_t, vm_pag boolean_t moea_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea_is_referenced(mmu_t, vm_page_t); boolean_t moea_ts_referenced(mmu_t, vm_page_t); -vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int); +vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea_page_exists_quick(mmu_t, pmap_t, vm_page_t); int moea_page_wired_mappings(mmu_t, vm_page_t); void moea_pinit(mmu_t, pmap_t); @@ -308,14 +308,14 @@ void moea_activate(mmu_t, struct thread void moea_deactivate(mmu_t, struct thread *); void moea_cpu_bootstrap(mmu_t, int); void moea_bootstrap(mmu_t, vm_offset_t, vm_offset_t); -void *moea_mapdev(mmu_t, vm_offset_t, vm_size_t); +void *moea_mapdev(mmu_t, vm_paddr_t, vm_size_t); void *moea_mapdev_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t); void moea_unmapdev(mmu_t, vm_offset_t, vm_size_t); -vm_offset_t moea_kextract(mmu_t, vm_offset_t); +vm_paddr_t moea_kextract(mmu_t, vm_offset_t); void moea_kenter_attr(mmu_t, vm_offset_t, vm_offset_t, vm_memattr_t); -void moea_kenter(mmu_t, vm_offset_t, vm_offset_t); +void moea_kenter(mmu_t, vm_offset_t, vm_paddr_t); void moea_page_set_memattr(mmu_t mmu, vm_page_t m, vm_memattr_t ma); -boolean_t moea_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); +boolean_t moea_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); static void moea_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); static mmu_method_t moea_methods[] = { @@ -1436,7 +1436,7 @@ moea_page_set_memattr(mmu_t mmu, vm_page * Map a wired page into kernel virtual address space. */ void -moea_kenter(mmu_t mmu, vm_offset_t va, vm_offset_t pa) +moea_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa) { moea_kenter_attr(mmu, va, pa, VM_MEMATTR_DEFAULT); @@ -1471,7 +1471,7 @@ moea_kenter_attr(mmu_t mmu, vm_offset_t * Extract the physical page address associated with the given kernel virtual * address. */ -vm_offset_t +vm_paddr_t moea_kextract(mmu_t mmu, vm_offset_t va) { struct pvo_entry *pvo; @@ -1512,8 +1512,8 @@ moea_kremove(mmu_t mmu, vm_offset_t va) * first usable address after the mapped region. */ vm_offset_t -moea_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start, - vm_offset_t pa_end, int prot) +moea_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa_start, + vm_paddr_t pa_end, int prot) { vm_offset_t sva, va; @@ -2408,7 +2408,7 @@ moea_bat_mapped(int idx, vm_offset_t pa, } boolean_t -moea_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { int i; @@ -2431,7 +2431,7 @@ moea_dev_direct_mapped(mmu_t mmu, vm_off * NOT real memory. */ void * -moea_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { return (moea_mapdev_attr(mmu, pa, size, VM_MEMATTR_DEFAULT)); Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/booke/pmap.c Thu May 24 21:13:24 2012 (r235936) @@ -291,7 +291,7 @@ static boolean_t mmu_booke_is_modified(m static boolean_t mmu_booke_is_prefaultable(mmu_t, pmap_t, vm_offset_t); static boolean_t mmu_booke_is_referenced(mmu_t, vm_page_t); static boolean_t mmu_booke_ts_referenced(mmu_t, vm_page_t); -static vm_offset_t mmu_booke_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, +static vm_offset_t mmu_booke_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); static int mmu_booke_mincore(mmu_t, pmap_t, vm_offset_t, vm_paddr_t *); @@ -316,12 +316,12 @@ static void mmu_booke_zero_page_idle(mm static void mmu_booke_activate(mmu_t, struct thread *); static void mmu_booke_deactivate(mmu_t, struct thread *); static void mmu_booke_bootstrap(mmu_t, vm_offset_t, vm_offset_t); -static void *mmu_booke_mapdev(mmu_t, vm_offset_t, vm_size_t); +static void *mmu_booke_mapdev(mmu_t, vm_paddr_t, vm_size_t); static void mmu_booke_unmapdev(mmu_t, vm_offset_t, vm_size_t); -static vm_offset_t mmu_booke_kextract(mmu_t, vm_offset_t); -static void mmu_booke_kenter(mmu_t, vm_offset_t, vm_offset_t); +static vm_paddr_t mmu_booke_kextract(mmu_t, vm_offset_t); +static void mmu_booke_kenter(mmu_t, vm_offset_t, vm_paddr_t); static void mmu_booke_kremove(mmu_t, vm_offset_t); -static boolean_t mmu_booke_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); +static boolean_t mmu_booke_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); static void mmu_booke_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); static vm_offset_t mmu_booke_dumpsys_map(mmu_t, struct pmap_md *, @@ -1391,7 +1391,7 @@ mmu_booke_qremove(mmu_t mmu, vm_offset_t * Map a wired page into kernel virtual address space. */ static void -mmu_booke_kenter(mmu_t mmu, vm_offset_t va, vm_offset_t pa) +mmu_booke_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa) { unsigned int pdir_idx = PDIR_IDX(va); unsigned int ptbl_idx = PTBL_IDX(va); @@ -1814,8 +1814,8 @@ mmu_booke_remove_all(mmu_t mmu, vm_page_ * Map a range of physical addresses into kernel virtual address space. */ static vm_offset_t -mmu_booke_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start, - vm_offset_t pa_end, int prot) +mmu_booke_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa_start, + vm_paddr_t pa_end, int prot) { vm_offset_t sva = *virt; vm_offset_t va = sva; @@ -2441,7 +2441,7 @@ mmu_booke_page_wired_mappings(mmu_t mmu, } static int -mmu_booke_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) +mmu_booke_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { int i; vm_offset_t va; @@ -2599,7 +2599,7 @@ mmu_booke_scan_md(mmu_t mmu, struct pmap * for mapping device memory, NOT real memory. */ static void * -mmu_booke_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size) +mmu_booke_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { void *res; uintptr_t va; Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/include/pmap.h Thu May 24 21:13:24 2012 (r235936) @@ -224,16 +224,16 @@ extern struct pmap kernel_pmap_store; #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) void pmap_bootstrap(vm_offset_t, vm_offset_t); -void pmap_kenter(vm_offset_t va, vm_offset_t pa); +void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kenter_attr(vm_offset_t va, vm_offset_t pa, vm_memattr_t); void pmap_kremove(vm_offset_t); -void *pmap_mapdev(vm_offset_t, vm_size_t); +void *pmap_mapdev(vm_paddr_t, vm_size_t); void *pmap_mapdev_attr(vm_offset_t, vm_size_t, vm_memattr_t); void pmap_unmapdev(vm_offset_t, vm_size_t); void pmap_page_set_memattr(vm_page_t, vm_memattr_t); void pmap_deactivate(struct thread *); -vm_offset_t pmap_kextract(vm_offset_t); -int pmap_dev_direct_mapped(vm_offset_t, vm_size_t); +vm_paddr_t pmap_kextract(vm_offset_t); +int pmap_dev_direct_mapped(vm_paddr_t, vm_size_t); boolean_t pmap_mmu_install(char *name, int prio); #define vtophys(va) pmap_kextract((vm_offset_t)(va)) Modified: head/sys/powerpc/powerpc/platform.c ============================================================================== --- head/sys/powerpc/powerpc/platform.c Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/powerpc/platform.c Thu May 24 21:13:24 2012 (r235936) @@ -92,7 +92,7 @@ mem_valid(vm_offset_t addr, int len) &aregions, &naregions); for (i = 0; i < npregions; i++) - if ((addr >= pregions[i].mr_start) + if ((addr >= pregions[i].mr_start) && (addr + len <= pregions[i].mr_start + pregions[i].mr_size)) return (0); @@ -116,7 +116,7 @@ platform_timebase_freq(struct cpuref *cp { return (PLATFORM_TIMEBASE_FREQ(plat_obj, cpu)); } - + int platform_smp_first_cpu(struct cpuref *cpu) { Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Thu May 24 21:13:24 2012 (r235936) @@ -440,7 +440,7 @@ pmap_cpu_bootstrap(int ap) } void * -pmap_mapdev(vm_offset_t pa, vm_size_t size) +pmap_mapdev(vm_paddr_t pa, vm_size_t size) { CTR3(KTR_PMAP, "%s(%#x, %#x)", __func__, pa, size); @@ -471,7 +471,7 @@ pmap_unmapdev(vm_offset_t va, vm_size_t MMU_UNMAPDEV(mmu_obj, va, size); } -vm_offset_t +vm_paddr_t pmap_kextract(vm_offset_t va) { @@ -480,7 +480,7 @@ pmap_kextract(vm_offset_t va) } void -pmap_kenter(vm_offset_t va, vm_offset_t pa) +pmap_kenter(vm_offset_t va, vm_paddr_t pa) { CTR3(KTR_PMAP, "%s(%#x, %#x)", __func__, va, pa); @@ -496,7 +496,7 @@ pmap_kenter_attr(vm_offset_t va, vm_offs } boolean_t -pmap_dev_direct_mapped(vm_offset_t pa, vm_size_t size) +pmap_dev_direct_mapped(vm_paddr_t pa, vm_size_t size) { CTR3(KTR_PMAP, "%s(%#x, %#x)", __func__, pa, size); From owner-svn-src-all@FreeBSD.ORG Thu May 24 21:13:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33521106564A; Thu, 24 May 2012 21:13:58 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id F3F4F8FC14; Thu, 24 May 2012 21:13:57 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M4J00500PN87P00@smtpauth3.wiscmail.wisc.edu>; Thu, 24 May 2012 16:13:57 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-user-nat.icecube.wisc.edu [128.104.255.12]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M4J00GRIPN7QS30@smtpauth3.wiscmail.wisc.edu>; Thu, 24 May 2012 16:13:56 -0500 (CDT) Date: Thu, 24 May 2012 16:13:55 -0500 From: Nathan Whitehorn In-reply-to: <201205242045.q4OKjipb059398@svn.freebsd.org> To: Marcel Moolenaar Message-id: <4FBEA493.4020702@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.255.12 X-Spam-PmxInfo: Server=avs-14, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.24.210315, SenderIP=128.104.255.12 References: <201205242045.q4OKjipb059398@svn.freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:13:58 -0000 On 05/24/12 15:45, Marcel Moolenaar wrote: > Author: marcel > Date: Thu May 24 20:45:44 2012 > New Revision: 235931 > URL: http://svn.freebsd.org/changeset/base/235931 > > Log: > Fix the memory barriers for CPUs that do not like lwsync and wedge or cause > exceptions early enough during boot that the kernel will do ithe same. > Use lwsync only when compiling for LP64 and revert to the more proven isync > when compiling for ILP32. Note that in the end (i.e. between revision 222198 > and this change) ILP32 changed from using sync to using isync. As per Nathan > the isync is needed to make sure I/O accesses are properly serialized with > locks and isync tends to be more effecient than sync. > This badly breaks the synchronization primitives. The functions mb()/wmb()/rmb() need to be sync or lwsync on ILP32, not isync. As the comment notes, isync only provides a barrier in conjunction with the atomic operations and atomic retry loop -- this is why there is a distinction between *mb() and __ATOMIC_*(). Moreover, __ATOMIC_ACQ() *must* be isync, not lwsync, on PPC64 without changes to the bus_space accessors. Using lwsync causes bus space operations to leak across mutex acquisition which causes the expected severe problems on at least my machine. Summary: 1. *mb() must be lwsync or sync on all machines, except for wmb() which could be eieio 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with bus_space changes) 3. __ATOMIC_REL() must be lwsync or sync -Nathan From owner-svn-src-all@FreeBSD.ORG Thu May 24 21:23:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7C2C106564A; Thu, 24 May 2012 21:23:13 +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 A15FB8FC0A; Thu, 24 May 2012 21:23: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 q4OLNDPU061111; Thu, 24 May 2012 21:23:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OLNDv7061108; Thu, 24 May 2012 21:23:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242123.q4OLNDv7061108@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 21:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235937 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:23:13 -0000 Author: marcel Date: Thu May 24 21:23:13 2012 New Revision: 235937 URL: http://svn.freebsd.org/changeset/base/235937 Log: A few improvements: 1. Define all registers. These definitions are needed to support the FCM driver for direct-connect NAND. 2. Repurpose lbc_read_reg() and lbc_write_reg() for use by localbus attached device drivers. Use bus_space functions directly in the lbc driver itself. 3. Be smarter about programming LAWs and mapping memory. The ranges defined in the FDT are per bank (= chip select) and since we can have up to 8 banks, we could easily use more than 8 LAWs or TLB enrties when per-bank memory ranges need multiple LAWs or TLBs due to alignment or size constraints. We now combine all memory ranges into the fewest possible set of contiguous regions and program the hardware for that. Thus, a cleverly written FDT with 8 devices may still only need 1 LAW or 1 TLB entry. Note that the memory ranges can be assigned randomly to the banks. We sort as we build to handle that. 4. Support the FCM when programming the OR register. This is mostly for documention purposes as we do not have a way to define the mode for a bank. 5. Remove Semihalf-ism: do not define DEBUG (only to undefine it again). Modified: head/sys/powerpc/mpc85xx/lbc.c head/sys/powerpc/mpc85xx/lbc.h Modified: head/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.c Thu May 24 21:13:24 2012 (r235936) +++ head/sys/powerpc/mpc85xx/lbc.c Thu May 24 21:23:13 2012 (r235937) @@ -56,9 +56,6 @@ __FBSDID("$FreeBSD$"); #include "ofw_bus_if.h" #include "lbc.h" -#define DEBUG -#undef DEBUG - #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) @@ -66,20 +63,6 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif -static __inline void -lbc_write_reg(struct lbc_softc *sc, bus_size_t off, uint32_t val) -{ - - bus_space_write_4(sc->sc_bst, sc->sc_bsh, off, val); -} - -static __inline uint32_t -lbc_read_reg(struct lbc_softc *sc, bus_size_t off) -{ - - return (bus_space_read_4(sc->sc_bst, sc->sc_bsh, off)); -} - static MALLOC_DEFINE(M_LBC, "localbus", "localbus devices information"); static int lbc_probe(device_t); @@ -161,46 +144,123 @@ lbc_address_mask(uint32_t size) static void lbc_banks_unmap(struct lbc_softc *sc) { - int i; - - for (i = 0; i < LBC_DEV_MAX; i++) { - if (sc->sc_banks[i].size == 0) - continue; + int r; - law_disable(OCP85XX_TGTIF_LBC, sc->sc_banks[i].pa, - sc->sc_banks[i].size); - pmap_unmapdev(sc->sc_banks[i].va, sc->sc_banks[i].size); + r = 0; + while (r < LBC_DEV_MAX) { + if (sc->sc_range[r].size == 0) + return; + + pmap_unmapdev(sc->sc_range[r].kva, sc->sc_range[r].size); + law_disable(OCP85XX_TGTIF_LBC, sc->sc_range[r].addr, + sc->sc_range[r].size); + r++; } } static int lbc_banks_map(struct lbc_softc *sc) { - u_long start, size; - int error, i; + vm_paddr_t end, start; + vm_size_t size; + u_int i, r, ranges, s; + int error; + bzero(sc->sc_range, sizeof(sc->sc_range)); + + /* + * Determine number of discontiguous address ranges to program. + */ + ranges = 0; for (i = 0; i < LBC_DEV_MAX; i++) { - if (sc->sc_banks[i].size == 0) + size = sc->sc_banks[i].size; + if (size == 0) continue; - /* Physical address start/size. */ - start = sc->sc_banks[i].pa; - size = sc->sc_banks[i].size; + start = sc->sc_banks[i].addr; + for (r = 0; r < ranges; r++) { + /* Avoid wrap-around bugs. */ + end = sc->sc_range[r].addr - 1 + sc->sc_range[r].size; + if (start > 0 && end == start - 1) { + sc->sc_range[r].size += size; + break; + } + /* Avoid wrap-around bugs. */ + end = start - 1 + size; + if (sc->sc_range[r].addr > 0 && + end == sc->sc_range[r].addr - 1) { + sc->sc_range[r].addr = start; + sc->sc_range[r].size += size; + break; + } + } + if (r == ranges) { + /* New range; add using insertion sort */ + r = 0; + while (r < ranges && sc->sc_range[r].addr < start) + r++; + for (s = ranges; s > r; s--) + sc->sc_range[s] = sc->sc_range[s-1]; + sc->sc_range[r].addr = start; + sc->sc_range[r].size = size; + ranges++; + } + } - /* - * Configure LAW for this LBC bank (CS) and map its physical - * memory region into KVA. - */ + /* + * Ranges are sorted so quickly go over the list to merge ranges + * that grew toward each other while building the ranges. + */ + r = 0; + while (r < ranges - 1) { + end = sc->sc_range[r].addr + sc->sc_range[r].size; + if (end != sc->sc_range[r+1].addr) { + r++; + continue; + } + sc->sc_range[r].size += sc->sc_range[r+1].size; + for (s = r + 1; s < ranges - 1; s++) + sc->sc_range[s] = sc->sc_range[s+1]; + bzero(&sc->sc_range[s], sizeof(sc->sc_range[s])); + ranges--; + } + + /* + * Configure LAW for the LBC ranges and map the physical memory + * range into KVA. + */ + for (r = 0; r < ranges; r++) { + start = sc->sc_range[r].addr; + size = sc->sc_range[r].size; error = law_enable(OCP85XX_TGTIF_LBC, start, size); if (error) return (error); + sc->sc_range[r].kva = (vm_offset_t)pmap_mapdev(start, size); + } + + /* XXX: need something better here? */ + if (ranges == 0) + return (EINVAL); + + /* Assign KVA to banks based on the enclosing range. */ + for (i = 0; i < LBC_DEV_MAX; i++) { + size = sc->sc_banks[i].size; + if (size == 0) + continue; - sc->sc_banks[i].va = (vm_offset_t)pmap_mapdev(start, size); - if (sc->sc_banks[i].va == 0) { - lbc_banks_unmap(sc); - return (ENOSPC); + start = sc->sc_banks[i].addr; + for (r = 0; r < ranges; r++) { + end = sc->sc_range[r].addr - 1 + sc->sc_range[r].size; + if (start >= sc->sc_range[r].addr && + start - 1 + size <= end) + break; + } + if (r < ranges) { + sc->sc_banks[i].kva = sc->sc_range[r].kva + + (start - sc->sc_range[r].addr); } } + return (0); } @@ -213,14 +273,18 @@ lbc_banks_enable(struct lbc_softc *sc) for (i = 0; i < LBC_DEV_MAX; i++) { size = sc->sc_banks[i].size; - if (size == 0) + if (size == 0) { + bus_space_write_4(sc->sc_bst, sc->sc_bsh, + LBC85XX_BR(i), 0); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, + LBC85XX_OR(i), 0); continue; + } + /* * Compute and program BR value. */ - regval = 0; - regval |= sc->sc_banks[i].pa; - + regval = sc->sc_banks[i].addr; switch (sc->sc_banks[i].width) { case 8: regval |= (1 << 11); @@ -240,24 +304,22 @@ lbc_banks_enable(struct lbc_softc *sc) regval |= (sc->sc_banks[i].msel << 5); regval |= (sc->sc_banks[i].atom << 2); regval |= 1; - - lbc_write_reg(sc, LBC85XX_BR(i), regval); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, + LBC85XX_BR(i), regval); /* * Compute and program OR value. */ - regval = 0; - regval |= lbc_address_mask(size); - + regval = lbc_address_mask(size); switch (sc->sc_banks[i].msel) { case LBCRES_MSEL_GPCM: /* TODO Add flag support for option registers */ - regval |= 0x00000ff7; + regval |= 0x0ff7; break; case LBCRES_MSEL_FCM: - printf("FCM mode not supported yet!"); - error = ENOSYS; - goto fail; + /* TODO Add flag support for options register */ + regval |= 0x0796; + break; case LBCRES_MSEL_UPMA: case LBCRES_MSEL_UPMB: case LBCRES_MSEL_UPMC: @@ -265,7 +327,8 @@ lbc_banks_enable(struct lbc_softc *sc) error = ENOSYS; goto fail; } - lbc_write_reg(sc, LBC85XX_OR(i), regval); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, + LBC85XX_OR(i), regval); } /* @@ -276,7 +339,7 @@ lbc_banks_enable(struct lbc_softc *sc) * - set ECC parity type * - set bus monitor timing and timer prescale */ - lbc_write_reg(sc, LBC85XX_LBCR, 0); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LBCR, 0); /* * Initialize clock ratio register: @@ -284,8 +347,7 @@ lbc_banks_enable(struct lbc_softc *sc) * - configure LCLK delay cycles for the assertion of LALE * - set system clock divider */ - lbc_write_reg(sc, LBC85XX_LCRR, 0x00030008); - + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LCRR, 0x00030008); return (0); fail: @@ -348,7 +410,7 @@ fdt_lbc_reg_decode(phandle_t node, struc reg += addr_cells - 1 + size_cells; /* Calculate address range relative to VA base. */ - start = sc->sc_banks[bank].va + start; + start = sc->sc_banks[bank].kva + start; end = start + count - 1; debugf("reg addr bank = %d, start = %lx, end = %lx, " @@ -479,7 +541,7 @@ lbc_attach(device_t dev) debugf("bank = %d, start = %lx, size = %lx\n", bank, start, size); - sc->sc_banks[bank].pa = start + offset; + sc->sc_banks[bank].addr = start + offset; sc->sc_banks[bank].size = size; /* @@ -676,3 +738,21 @@ lbc_get_devinfo(device_t bus, device_t c di = device_get_ivars(child); return (&di->di_ofw); } + +void +lbc_write_reg(device_t child, u_int off, uint32_t val) +{ + struct lbc_softc *sc; + + sc = device_get_softc(device_get_parent(child)); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, off, val); +} + +uint32_t +lbc_read_reg(device_t child, u_int off) +{ + struct lbc_softc *sc; + + sc = device_get_softc(device_get_parent(child)); + return (bus_space_read_4(sc->sc_bst, sc->sc_bsh, off)); +} Modified: head/sys/powerpc/mpc85xx/lbc.h ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.h Thu May 24 21:13:24 2012 (r235936) +++ head/sys/powerpc/mpc85xx/lbc.h Thu May 24 21:23:13 2012 (r235937) @@ -33,10 +33,35 @@ #define LBC_DEV_MAX 8 /* Local access registers */ -#define LBC85XX_BR(n) (8 * n) -#define LBC85XX_OR(n) (4 + (8 * n)) -#define LBC85XX_LBCR (0xd0) -#define LBC85XX_LCRR (0xd4) +#define LBC85XX_BR(n) (0x0 + (8 * n)) /* Base register 0-7 */ +#define LBC85XX_OR(n) (0x4 + (8 * n)) /* Options register 0-7 */ +#define LBC85XX_MAR 0x068 /* UPM address register */ +#define LBC85XX_MAMR 0x070 /* UPMA mode register */ +#define LBC85XX_MBMR 0x074 /* UPMB mode register */ +#define LBC85XX_MCMR 0x078 /* UPMC mode register */ +#define LBC85XX_MRTPR 0x084 /* Memory refresh timer prescaler */ +#define LBC85XX_MDR 0x088 /* UPM data register */ +#define LBC85XX_LSOR 0x090 /* Special operation initiation */ +#define LBC85XX_LURT 0x0a0 /* UPM refresh timer */ +#define LBC85XX_LSRT 0x0a4 /* SDRAM refresh timer */ +#define LBC85XX_LTESR 0x0b0 /* Transfer error status register */ +#define LBC85XX_LTEDR 0x0b4 /* Transfer error disable register */ +#define LBC85XX_LTEIR 0x0b8 /* Transfer error interrupt register */ +#define LBC85XX_LTEATR 0x0bc /* Transfer error attributes register */ +#define LBC85XX_LTEAR 0x0c0 /* Transfer error address register */ +#define LBC85XX_LTECCR 0x0c4 /* Transfer error ECC register */ +#define LBC85XX_LBCR 0x0d0 /* Configuration register */ +#define LBC85XX_LCRR 0x0d4 /* Clock ratio register */ +#define LBC85XX_FMR 0x0e0 /* Flash mode register */ +#define LBC85XX_FIR 0x0e4 /* Flash instruction register */ +#define LBC85XX_FCR 0x0e8 /* Flash command register */ +#define LBC85XX_FBAR 0x0ec /* Flash block address register */ +#define LBC85XX_FPAR 0x0f0 /* Flash page address register */ +#define LBC85XX_FBCR 0x0f4 /* Flash byte count register */ +#define LBC85XX_FECC0 0x100 /* Flash ECC block 0 register */ +#define LBC85XX_FECC1 0x104 /* Flash ECC block 0 register */ +#define LBC85XX_FECC2 0x108 /* Flash ECC block 0 register */ +#define LBC85XX_FECC3 0x10c /* Flash ECC block 0 register */ /* LBC machine select */ #define LBCRES_MSEL_GPCM 0 @@ -55,10 +80,16 @@ #define LBCRES_ATOM_RAWA 1 #define LBCRES_ATOM_WARA 2 +struct lbc_memrange { + vm_paddr_t addr; + vm_size_t size; + vm_offset_t kva; +}; + struct lbc_bank { - u_long pa; /* physical addr of the bank */ - u_long size; /* bank size */ - vm_offset_t va; /* VA of the bank */ + vm_paddr_t addr; /* physical addr of the bank */ + vm_size_t size; /* bank size */ + vm_offset_t kva; /* VA of the bank */ /* * XXX the following bank attributes do not have properties specified @@ -84,6 +115,7 @@ struct lbc_softc { int sc_addr_cells; int sc_size_cells; + struct lbc_memrange sc_range[LBC_DEV_MAX]; struct lbc_bank sc_banks[LBC_DEV_MAX]; }; @@ -93,4 +125,7 @@ struct lbc_devinfo { int di_bank; }; +uint32_t lbc_read_reg(device_t child, u_int off); +void lbc_write_reg(device_t child, u_int off, uint32_t val); + #endif /* _MACHINE_LBC_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu May 24 21:24:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74D18106564A; Thu, 24 May 2012 21:24:24 +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 601FB8FC16; Thu, 24 May 2012 21:24:24 +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 q4OLOOSS061194; Thu, 24 May 2012 21:24:24 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OLOOM8061191; Thu, 24 May 2012 21:24:24 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205242124.q4OLOOM8061191@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 24 May 2012 21:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235938 - head/sys/dev/sec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:24:24 -0000 Author: raj Date: Thu May 24 21:24:23 2012 New Revision: 235938 URL: http://svn.freebsd.org/changeset/base/235938 Log: Recognize version 3.1 of the SEC crypto engine. Modified: head/sys/dev/sec/sec.c head/sys/dev/sec/sec.h Modified: head/sys/dev/sec/sec.c ============================================================================== --- head/sys/dev/sec/sec.c Thu May 24 21:23:13 2012 (r235937) +++ head/sys/dev/sec/sec.c Thu May 24 21:24:23 2012 (r235938) @@ -227,6 +227,10 @@ sec_probe(device_t dev) device_set_desc(dev, "Freescale Security Engine 3.0"); sc->sc_version = 3; break; + case SEC_31_ID: + device_set_desc(dev, "Freescale Security Engine 3.1"); + sc->sc_version = 3; + break; default: device_printf(dev, "unknown SEC ID 0x%016llx!\n", id); return (ENXIO); Modified: head/sys/dev/sec/sec.h ============================================================================== --- head/sys/dev/sec/sec.h Thu May 24 21:23:13 2012 (r235937) +++ head/sys/dev/sec/sec.h Thu May 24 21:24:23 2012 (r235938) @@ -46,6 +46,7 @@ /* SEC information */ #define SEC_20_ID 0x0000000000000040ULL #define SEC_30_ID 0x0030030000000000ULL +#define SEC_31_ID 0x0030030100000000ULL #define SEC_CHANNELS 4 #define SEC_POINTERS 7 #define SEC_MAX_DMA_BLOCK_SIZE 0xFFFF From owner-svn-src-all@FreeBSD.ORG Thu May 24 21:44:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 820B81065673; Thu, 24 May 2012 21:44:47 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 622ED8FC24; Thu, 24 May 2012 21: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 q4OLilBu062099; Thu, 24 May 2012 21:44:47 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OLilHY062093; Thu, 24 May 2012 21:44:47 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201205242144.q4OLilHY062093@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 24 May 2012 21:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235939 - in head: lib/libstand sys/x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:44:47 -0000 Author: obrien Date: Thu May 24 21:44:46 2012 New Revision: 235939 URL: http://svn.freebsd.org/changeset/base/235939 Log: Consitently use "__LP64__". [there are 33 __LP64__'s in the kernel (minus cddl/ and contrib/), and 11 _LP64's] Modified: head/lib/libstand/bswap.c head/sys/x86/include/_limits.h head/sys/x86/include/_stdint.h head/sys/x86/include/_types.h head/sys/x86/include/float.h Modified: head/lib/libstand/bswap.c ============================================================================== --- head/lib/libstand/bswap.c Thu May 24 21:24:23 2012 (r235938) +++ head/lib/libstand/bswap.c Thu May 24 21:44:46 2012 (r235939) @@ -31,7 +31,7 @@ bswap32(u_int32_t x) u_int64_t bswap64(u_int64_t x) { -#ifdef _LP64 +#ifdef __LP64__ /* * Assume we have wide enough registers to do it without touching * memory. Modified: head/sys/x86/include/_limits.h ============================================================================== --- head/sys/x86/include/_limits.h Thu May 24 21:24:23 2012 (r235938) +++ head/sys/x86/include/_limits.h Thu May 24 21:44:46 2012 (r235939) @@ -57,7 +57,7 @@ #define __INT_MAX 0x7fffffff /* max value for an int */ #define __INT_MIN (-0x7fffffff - 1) /* min value for an int */ -#ifdef _LP64 +#ifdef __LP64__ #define __ULONG_MAX 0xffffffffffffffff /* max for an unsigned long */ #define __LONG_MAX 0x7fffffffffffffff /* max for a long */ #define __LONG_MIN (-0x7fffffffffffffff - 1) /* min for a long */ @@ -72,7 +72,7 @@ #define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ #define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ -#ifdef _LP64 +#ifdef __LP64__ #define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */ #define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */ #define __OFF_MAX __LONG_MAX /* max value for an off_t */ Modified: head/sys/x86/include/_stdint.h ============================================================================== --- head/sys/x86/include/_stdint.h Thu May 24 21:24:23 2012 (r235938) +++ head/sys/x86/include/_stdint.h Thu May 24 21:44:46 2012 (r235939) @@ -50,7 +50,7 @@ #define UINT16_C(c) (c) #define UINT32_C(c) (c ## U) -#ifdef _LP64 +#ifdef __LP64__ #define INT64_C(c) (c ## L) #define UINT64_C(c) (c ## UL) #else @@ -81,7 +81,7 @@ #define UINT16_MAX 0xffff #define UINT32_MAX 0xffffffffU -#ifdef _LP64 +#ifdef __LP64__ #define INT64_MIN (-0x7fffffffffffffff-1) #define INT64_MAX 0x7fffffffffffffff #define UINT64_MAX 0xffffffffffffffff @@ -139,7 +139,7 @@ * ISO/IEC 9899:1999 * 7.18.2.4 Limits of integer types capable of holding object pointers */ -#ifdef _LP64 +#ifdef __LP64__ #define INTPTR_MIN INT64_MIN #define INTPTR_MAX INT64_MAX #define UINTPTR_MAX UINT64_MAX @@ -161,7 +161,7 @@ * ISO/IEC 9899:1999 * 7.18.3 Limits of other integer types */ -#ifdef _LP64 +#ifdef __LP64__ /* Limits of ptrdiff_t. */ #define PTRDIFF_MIN INT64_MIN #define PTRDIFF_MAX INT64_MAX Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Thu May 24 21:24:23 2012 (r235938) +++ head/sys/x86/include/_types.h Thu May 24 21:44:46 2012 (r235939) @@ -54,7 +54,7 @@ typedef short __int16_t; typedef unsigned short __uint16_t; typedef int __int32_t; typedef unsigned int __uint32_t; -#ifdef _LP64 +#ifdef __LP64__ typedef long __int64_t; typedef unsigned long __uint64_t; #else @@ -73,7 +73,7 @@ typedef unsigned long long __uint64_t; /* * Standard type definitions. */ -#ifdef _LP64 +#ifdef __LP64__ typedef __int32_t __clock_t; /* clock()... */ typedef __int64_t __critical_t; typedef double __double_t; @@ -97,7 +97,7 @@ typedef __int8_t __int_least8_t; typedef __int16_t __int_least16_t; typedef __int32_t __int_least32_t; typedef __int64_t __int_least64_t; -#ifdef _LP64 +#ifdef __LP64__ typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ typedef __int64_t __register_t; typedef __int64_t __segsz_t; /* segment size (in pages) */ @@ -125,7 +125,7 @@ typedef __uint8_t __uint_least8_t; typedef __uint16_t __uint_least16_t; typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; -#ifdef _LP64 +#ifdef __LP64__ typedef __uint64_t __u_register_t; typedef __uint64_t __vm_offset_t; typedef __uint64_t __vm_paddr_t; Modified: head/sys/x86/include/float.h ============================================================================== --- head/sys/x86/include/float.h Thu May 24 21:24:23 2012 (r235938) +++ head/sys/x86/include/float.h Thu May 24 21:44:46 2012 (r235939) @@ -42,7 +42,7 @@ __END_DECLS #define FLT_RADIX 2 /* b */ #define FLT_ROUNDS __flt_rounds() #if __ISO_C_VISIBLE >= 1999 -#ifdef _LP64 +#ifdef __LP64__ #define FLT_EVAL_METHOD 0 /* no promotions */ #else #define FLT_EVAL_METHOD (-1) /* i387 semantics are...interesting */ From owner-svn-src-all@FreeBSD.ORG Thu May 24 22:00:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0FAB106564A; Thu, 24 May 2012 22:00:49 +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 898BC8FC15; Thu, 24 May 2012 22:00: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 q4OM0nlk062859; Thu, 24 May 2012 22:00:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OM0nAa062851; Thu, 24 May 2012 22:00:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205242200.q4OM0nAa062851@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 22:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235941 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:00:49 -0000 Author: bz Date: Thu May 24 22:00:48 2012 New Revision: 235941 URL: http://svn.freebsd.org/changeset/base/235941 Log: MFp4 bz_ipv6_fast: in_cksum.h required ip.h to be included for struct ip. To be able to use some general checksum functions like in_addword() in a non-IPv4 context, limit the (also exported to user space) IPv4 specific functions to the times, when the ip.h header is present and IPVERSION is defined (to 4). We should consider more general checksum (updating) functions to also allow easier incremental checksum updates in the L3/4 stack and firewalls, as well as ponder further requirements by certain NIC drivers needing slightly different pseudo values in offloading cases. Thinking in terms of a better "library". Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/amd64/include/in_cksum.h head/sys/arm/include/in_cksum.h head/sys/i386/include/in_cksum.h head/sys/ia64/include/in_cksum.h head/sys/mips/include/in_cksum.h head/sys/powerpc/include/in_cksum.h head/sys/sparc64/include/in_cksum.h Modified: head/sys/amd64/include/in_cksum.h ============================================================================== --- head/sys/amd64/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/amd64/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -43,6 +43,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -69,9 +70,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: head/sys/arm/include/in_cksum.h ============================================================================== --- head/sys/arm/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/arm/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -46,7 +46,9 @@ u_short in_cksum(struct mbuf *m, int len u_short in_addword(u_short sum, u_short b); u_short in_cksum_skip(struct mbuf *m, int len, int skip); u_int do_cksum(const void *, int); +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *); +#endif static __inline u_short in_pseudo(u_int sum, u_int b, u_int c) Modified: head/sys/i386/include/in_cksum.h ============================================================================== --- head/sys/i386/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/i386/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -54,6 +54,7 @@ * therefore always exactly five 32-bit words. */ #if defined(__GNUCLIKE_ASM) && !defined(__INTEL_COMPILER) +#if defined(IPVERSION) && (IPVERSION == 4) static __inline u_int in_cksum_hdr(const struct ip *ip) { @@ -88,6 +89,7 @@ in_cksum_update(struct ip *ip) __tmpsum = (int)ntohs(ip->ip_sum) + 256; ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); } +#endif static __inline u_short in_addword(u_short sum, u_short b) @@ -121,6 +123,7 @@ in_pseudo(u_int sum, u_int b, u_int c) } #else +#if defined(IPVERSION) && (IPVERSION == 4) #define in_cksum_update(ip) \ do { \ int __tmpsum; \ @@ -129,10 +132,13 @@ in_pseudo(u_int sum, u_int b, u_int c) } while(0) #endif +#endif #ifdef _KERNEL #if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER) +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); #endif Modified: head/sys/ia64/include/in_cksum.h ============================================================================== --- head/sys/ia64/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/ia64/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -39,6 +39,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -65,9 +66,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: head/sys/mips/include/in_cksum.h ============================================================================== --- head/sys/mips/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/mips/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -40,6 +40,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -66,9 +67,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: head/sys/powerpc/include/in_cksum.h ============================================================================== --- head/sys/powerpc/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/powerpc/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -39,6 +39,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -65,9 +66,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: head/sys/sparc64/include/in_cksum.h ============================================================================== --- head/sys/sparc64/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/sparc64/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -65,6 +65,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) static __inline void in_cksum_update(struct ip *ip) { @@ -73,6 +74,7 @@ in_cksum_update(struct ip *ip) __tmp = (int)ip->ip_sum + 1; ip->ip_sum = __tmp + (__tmp >> 16); } +#endif static __inline u_short in_addword(u_short sum, u_short b) @@ -106,6 +108,7 @@ in_pseudo(u_int sum, u_int b, u_int c) return (sum); } +#if defined(IPVERSION) && (IPVERSION == 4) static __inline u_int in_cksum_hdr(struct ip *ip) { @@ -163,6 +166,7 @@ in_cksum_hdr(struct ip *ip) #undef __LD_ADD return (__ret); } +#endif #ifdef _KERNEL u_short in_cksum_skip(struct mbuf *m, int len, int skip); From owner-svn-src-all@FreeBSD.ORG Thu May 24 22:06:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2FBB1065672; Thu, 24 May 2012 22:06:00 +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 ADEF18FC0A; Thu, 24 May 2012 22:06: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 q4OM60eJ063120; Thu, 24 May 2012 22:06:00 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OM60Nl063117; Thu, 24 May 2012 22:06:00 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242206.q4OM60Nl063117@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 22:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235942 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:06:00 -0000 Author: marcel Date: Thu May 24 22:06:00 2012 New Revision: 235942 URL: http://svn.freebsd.org/changeset/base/235942 Log: Revert isync for ILP32 to sync as per my original change that I discussed with Nathan. Leave __ATOMIC_ACQ as an isync as per Nathan. Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Thu May 24 22:00:48 2012 (r235941) +++ head/sys/powerpc/include/atomic.h Thu May 24 22:06:00 2012 (r235942) @@ -54,10 +54,10 @@ #define __ATOMIC_REL() __asm __volatile("lwsync" : : : "memory") #define __ATOMIC_ACQ() __asm __volatile("lwsync" : : : "memory") #else -#define mb() __asm __volatile("isync" : : : "memory") -#define rmb() __asm __volatile("isync" : : : "memory") -#define wmb() __asm __volatile("isync" : : : "memory") -#define __ATOMIC_REL() __asm __volatile("isync" : : : "memory") +#define mb() __asm __volatile("sync" : : : "memory") +#define rmb() __asm __volatile("sync" : : : "memory") +#define wmb() __asm __volatile("sync : : : "memory") +#define __ATOMIC_REL() __asm __volatile("sync" : : : "memory") #define __ATOMIC_ACQ() __asm __volatile("isync" : : : "memory") #endif From owner-svn-src-all@FreeBSD.ORG Thu May 24 22:07:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 623851065780; Thu, 24 May 2012 22:07:20 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 29C0E8FC15; Thu, 24 May 2012 22:07:20 +0000 (UTC) Received: from marcelm-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q4OM78iQ075353 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 24 May 2012 15:07:13 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4FBEA493.4020702@freebsd.org> Date: Thu, 24 May 2012 15:07:03 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:07:20 -0000 On May 24, 2012, at 2:13 PM, Nathan Whitehorn wrote: > On 05/24/12 15:45, Marcel Moolenaar wrote: >> Author: marcel >> Date: Thu May 24 20:45:44 2012 >> New Revision: 235931 >> URL: http://svn.freebsd.org/changeset/base/235931 >>=20 >> Log: >> Fix the memory barriers for CPUs that do not like lwsync and wedge = or cause >> exceptions early enough during boot that the kernel will do ithe = same. >> Use lwsync only when compiling for LP64 and revert to the more = proven isync >> when compiling for ILP32. Note that in the end (i.e. between = revision 222198 >> and this change) ILP32 changed from using sync to using isync. As = per Nathan >> the isync is needed to make sure I/O accesses are properly = serialized with >> locks and isync tends to be more effecient than sync. >>=20 >=20 > This badly breaks the synchronization primitives. The functions = mb()/wmb()/rmb() need to be sync or lwsync on ILP32, not isync. I guess I misinterpreted your email in which you stated that isync is = better. > Summary: > 1. *mb() must be lwsync or sync on all machines, except for wmb() = which could be eieio > 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync = with bus_space changes) > 3. __ATOMIC_REL() must be lwsync or sync This is absolutely not what I concluded from our discussions. I have no = idea how we could end up so out of sync... --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Thu May 24 22:14:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7E57106564A; Thu, 24 May 2012 22:14:39 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2A348FC0C; Thu, 24 May 2012 22:14:39 +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 q4OMEd55063524; Thu, 24 May 2012 22:14:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OMEdY2063522; Thu, 24 May 2012 22:14:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201205242214.q4OMEdY2063522@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 24 May 2012 22:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235943 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:14:39 -0000 Author: nwhitehorn Date: Thu May 24 22:14:39 2012 New Revision: 235943 URL: http://svn.freebsd.org/changeset/base/235943 Log: Atomic operation acquire barriers also need to be isync on 64-bit systems. Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Thu May 24 22:06:00 2012 (r235942) +++ head/sys/powerpc/include/atomic.h Thu May 24 22:14:39 2012 (r235943) @@ -52,7 +52,7 @@ #define rmb() __asm __volatile("lwsync" : : : "memory") #define wmb() __asm __volatile("lwsync" : : : "memory") #define __ATOMIC_REL() __asm __volatile("lwsync" : : : "memory") -#define __ATOMIC_ACQ() __asm __volatile("lwsync" : : : "memory") +#define __ATOMIC_ACQ() __asm __volatile("isync" : : : "memory") #else #define mb() __asm __volatile("sync" : : : "memory") #define rmb() __asm __volatile("sync" : : : "memory") From owner-svn-src-all@FreeBSD.ORG Thu May 24 22:15:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A57710656D0; Thu, 24 May 2012 22:15:17 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 658948FC16; Thu, 24 May 2012 22:15:17 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M4J00A00SHGYI00@smtpauth3.wiscmail.wisc.edu>; Thu, 24 May 2012 17:15:16 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-user-nat.icecube.wisc.edu [128.104.255.12]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M4J006N6SHFFY10@smtpauth3.wiscmail.wisc.edu>; Thu, 24 May 2012 17:15:16 -0500 (CDT) Date: Thu, 24 May 2012 17:15:15 -0500 From: Nathan Whitehorn In-reply-to: To: Marcel Moolenaar Message-id: <4FBEB2F3.4060405@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.255.12 X-Spam-PmxInfo: Server=avs-14, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.24.220630, SenderIP=128.104.255.12 References: <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:15:17 -0000 On 05/24/12 17:07, Marcel Moolenaar wrote: > > On May 24, 2012, at 2:13 PM, Nathan Whitehorn wrote: > >> On 05/24/12 15:45, Marcel Moolenaar wrote: >>> Author: marcel >>> Date: Thu May 24 20:45:44 2012 >>> New Revision: 235931 >>> URL: http://svn.freebsd.org/changeset/base/235931 >>> >>> Log: >>> Fix the memory barriers for CPUs that do not like lwsync and wedge or cause >>> exceptions early enough during boot that the kernel will do ithe same. >>> Use lwsync only when compiling for LP64 and revert to the more proven isync >>> when compiling for ILP32. Note that in the end (i.e. between revision 222198 >>> and this change) ILP32 changed from using sync to using isync. As per Nathan >>> the isync is needed to make sure I/O accesses are properly serialized with >>> locks and isync tends to be more effecient than sync. >>> >> >> This badly breaks the synchronization primitives. The functions mb()/wmb()/rmb() need to be sync or lwsync on ILP32, not isync. > > I guess I misinterpreted your email in which you stated that isync is better. It's just in this one single case. Otherwise, it's still faster but doesn't work :) >> Summary: >> 1. *mb() must be lwsync or sync on all machines, except for wmb() which could be eieio >> 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with bus_space changes) >> 3. __ATOMIC_REL() must be lwsync or sync > > This is absolutely not what I concluded from our discussions. I have no idea > how we could end up so out of sync... > Thanks for the quick change. No idea how we got out of sync. I find all of this synchronization stuff a little mind-bending, so sorry for any miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, so I've fixed that up. Things should be good now. -Nathan From owner-svn-src-all@FreeBSD.ORG Thu May 24 22:17:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7D48106566B; Thu, 24 May 2012 22:17:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 47E7D8FC21; Thu, 24 May 2012 22:17:43 +0000 (UTC) Message-ID: <4FBEB386.7000503@FreeBSD.org> Date: Thu, 24 May 2012 18:17:42 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0.1 MIME-Version: 1.0 To: Edward Tomasz Napierala References: <201205241648.q4OGmXha049187@svn.freebsd.org> <4FBEA14E.2060802@FreeBSD.org> In-Reply-To: <4FBEA14E.2060802@FreeBSD.org> X-Enigmail-Version: 1.5pre Content-Type: multipart/mixed; boundary="------------030401010906040706090801" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235918 - head/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:17:43 -0000 This is a multi-part message in MIME format. --------------030401010906040706090801 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-05-24 16:59:58 -0400, Jung-uk Kim wrote: > On 2012-05-24 12:48:33 -0400, Edward Tomasz Napierala wrote: >> Author: trasz Date: Thu May 24 16:48:33 2012 New Revision: 235918 >> URL: http://svn.freebsd.org/changeset/base/235918 >> >> Log: Make g_label(4) ignore provider size when looking for UFS >> labels. Without it, it fails to create labels for filesystems >> resized by growfs(8). >> >> PR: kern/165962 Submitted by: Olivier Cochard-Labbe > cochard dot me> >> >> Modified: head/sys/geom/label/g_label_ufs.c > > This commit broke my fstab based on ufsid. I have something like > this in my fstab: > > /dev/ufsid/44b3df81873011b5 / ufs rw,noatime 1 1 > /dev/ufsid/463b935456452bbd /tmp ufs rw,noatime 2 2 > /dev/ufsid/44b3dfc4bfcc4c30 /usr ufs rw,noatime 2 2 > /dev/ufsid/463b934b955f63ff /var ufs rw,noatime 2 2 > > Mounting / as read-only went fine and I had /dev/ada0s1a, > /dev/ada0s1d, etc. Strangely, I also had matching ufsid's under > /dev/ufsid, e.g., /dev/ufsid/a, > /dev/ufsid/d, etc. However, once I do 'mount -u -w /', > everything disappears except for root's ufsid. > > Reverting this commit fixed the problem for me. The attached patch fixed my problem and kern/165962. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk++s4YACgkQmlay1b9qnVO5uACglaXhj9ZXwpUiroMUxqkbHF/v Qm0An0lHidiRMenHsDLTaiC0Wqz0cYB6 =k1Ff -----END PGP SIGNATURE----- --------------030401010906040706090801 Content-Type: text/plain; charset=UTF-8; name="ufsid.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ufsid.diff" SW5kZXg6IHN5cy9nZW9tL2xhYmVsL2dfbGFiZWxfdWZzLmMKPT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0g c3lzL2dlb20vbGFiZWwvZ19sYWJlbF91ZnMuYwkocmV2aXNpb24gMjM1OTQxKQorKysgc3lz L2dlb20vbGFiZWwvZ19sYWJlbF91ZnMuYwkod29ya2luZyBjb3B5KQpAQCAtNTEsOCArNTEs OSBAQCBzdGF0aWMgdm9pZAogZ19sYWJlbF91ZnNfdGFzdGVfY29tbW9uKHN0cnVjdCBnX2Nv bnN1bWVyICpjcCwgY2hhciAqbGFiZWwsIHNpemVfdCBzaXplLCBpbnQgd2hhdCkKIHsKIAlz dHJ1Y3QgZ19wcm92aWRlciAqcHA7CisJc3RydWN0IGZzICpmczsKKwlvZmZfdCBmc19zaXpl OwogCWludCBzYiwgc3VwZXJibG9jazsKLQlzdHJ1Y3QgZnMgKmZzOwogCiAJZ190b3BvbG9n eV9hc3NlcnRfbm90KCk7CiAJcHAgPSBjcC0+cHJvdmlkZXI7CkBAIC04MiwxMSArODMsMTkg QEAgZ19sYWJlbF91ZnNfdGFzdGVfY29tbW9uKHN0cnVjdCBnX2NvbnN1bWVyICpjcCwgY2gK IAkJaWYgKGZzID09IE5VTEwpCiAJCQljb250aW51ZTsKIAkJLyogQ2hlY2sgZm9yIG1hZ2lj ICovCi0JCWlmIChmcy0+ZnNfbWFnaWMgPT0gRlNfVUZTMV9NQUdJQyAmJiBmcy0+ZnNfZnNp emUgPiAwKSB7Ci0JCSAgICAJLyogVmFsaWQgVUZTMS4gKi8KLQkJfSBlbHNlIGlmIChmcy0+ ZnNfbWFnaWMgPT0gRlNfVUZTMl9NQUdJQyAmJiBmcy0+ZnNfZnNpemUgPiAwKSB7Ci0JCSAg ICAJLyogVmFsaWQgVUZTMi4gKi8KLQkJfSBlbHNlIHsKKwkJc3dpdGNoIChmcy0+ZnNfbWFn aWMpIHsKKwkJY2FzZSBGU19VRlMxX01BR0lDOgorCQljYXNlIEZTX1VGUzJfTUFHSUM6CisJ CQlpZiAoZnMtPmZzX2ZzaXplID4gMCkgeworCQkJCWlmICh3aGF0ID09IEdfTEFCRUxfVUZT X1ZPTFVNRSkKKwkJCQkJYnJlYWs7CisJCQkJZnNfc2l6ZSA9IChmcy0+ZnNfbWFnaWMgPT0g RlNfVUZTMV9NQUdJQykgPworCQkJCSAgICBmcy0+ZnNfb2xkX3NpemUgOiBmcy0+ZnNfc2l6 ZTsKKwkJCQlpZiAocHAtPm1lZGlhc2l6ZSAvIGZzLT5mc19mc2l6ZSA9PSBmc19zaXplKQor CQkJCQlicmVhazsKKwkJCX0KKwkJCS8qIEZBTExUSFJPVUdIICovCisJCWRlZmF1bHQ6CiAJ CQlnX2ZyZWUoZnMpOwogCQkJY29udGludWU7CiAJCX0K --------------030401010906040706090801-- From owner-svn-src-all@FreeBSD.ORG Thu May 24 22:22:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4C9F1065670; Thu, 24 May 2012 22:22:22 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 9C5898FC12; Thu, 24 May 2012 22:22:22 +0000 (UTC) Received: from marcelm-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q4OMMEFg075478 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 24 May 2012 15:22:21 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4FBEB2F3.4060405@freebsd.org> Date: Thu, 24 May 2012 15:22:09 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <358A54BA-6B8E-4685-8CDD-CCAC305ACA2B@xcllnt.net> References: <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> <4FBEB2F3.4060405@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:22:22 -0000 On May 24, 2012, at 3:15 PM, Nathan Whitehorn wrote: >>> Summary: >>> 1. *mb() must be lwsync or sync on all machines, except for wmb() = which could be eieio >>> 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync = with bus_space changes) >>> 3. __ATOMIC_REL() must be lwsync or sync >>=20 >> This is absolutely not what I concluded from our discussions. I have = no idea >> how we could end up so out of sync... >>=20 >=20 > Thanks for the quick change. No idea how we got out of sync. I find = all of this synchronization stuff a little mind-bending, so sorry for = any miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, = so I've fixed that up. Things should be good now. Ok. I didn't change wmb() to eieio as I wanted to avoid a pendulum = effect. I'll reread our emails and make sure wmb() is what we think it is and if so I'll do a followup commit. FYI, --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Thu May 24 22:46:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 958D9106564A; Thu, 24 May 2012 22:46:15 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 602068FC0A; Thu, 24 May 2012 22:46:15 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M4J00100TWXSV00@smtpauth1.wiscmail.wisc.edu>; Thu, 24 May 2012 17:46:09 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-user-nat.icecube.wisc.edu [128.104.255.12]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M4J00C29TWW1J30@smtpauth1.wiscmail.wisc.edu>; Thu, 24 May 2012 17:46:09 -0500 (CDT) Date: Thu, 24 May 2012 17:46:08 -0500 From: Nathan Whitehorn In-reply-to: <358A54BA-6B8E-4685-8CDD-CCAC305ACA2B@xcllnt.net> To: Marcel Moolenaar Message-id: <4FBEBA30.6050901@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.255.12 X-Spam-PmxInfo: Server=avs-16, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.24.223633, SenderIP=128.104.255.12 References: <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> <4FBEB2F3.4060405@freebsd.org> <358A54BA-6B8E-4685-8CDD-CCAC305ACA2B@xcllnt.net> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:46:15 -0000 On 05/24/12 17:22, Marcel Moolenaar wrote: > > On May 24, 2012, at 3:15 PM, Nathan Whitehorn wrote: > >>>> Summary: >>>> 1. *mb() must be lwsync or sync on all machines, except for wmb() which could be eieio >>>> 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with bus_space changes) >>>> 3. __ATOMIC_REL() must be lwsync or sync >>> >>> This is absolutely not what I concluded from our discussions. I have no idea >>> how we could end up so out of sync... >>> >> >> Thanks for the quick change. No idea how we got out of sync. I find all of this synchronization stuff a little mind-bending, so sorry for any miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, so I've fixed that up. Things should be good now. > > Ok. I didn't change wmb() to eieio as I wanted to avoid a pendulum effect. > I'll reread our emails and make sure wmb() is what we think it is and if > so I'll do a followup commit. > FYI, > I don't think it really makes a difference. Basically nothing uses wmb(), and those things that do mostly use it wrong and need sync. So it should probably stay as [lw]sync. -Nathan From owner-svn-src-all@FreeBSD.ORG Thu May 24 23:03:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE32C106566B; Thu, 24 May 2012 23:03:24 +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 C77858FC18; Thu, 24 May 2012 23:03:24 +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 q4ON3OeV065610; Thu, 24 May 2012 23:03:24 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ON3OpM065605; Thu, 24 May 2012 23:03:24 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205242303.q4ON3OpM065605@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 23:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235944 - in head/sys: dev/cxgb dev/cxgbe netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 23:03:25 -0000 Author: bz Date: Thu May 24 23:03:23 2012 New Revision: 235944 URL: http://svn.freebsd.org/changeset/base/235944 Log: MFp4 bz_ipv6_fast: Significantly update tcp_lro for mostly two things: 1) introduce basic support for IPv6 without extension headers. 2) try hard to also get the incremental checksum updates right, especially also in the IPv4 case for the IP and TCP header. Move variables around for better locality, factor things out into functions, allow checksum updates to be compiled out, ... Leave a few comments on further things to look at in the future, though that is not the full list. Update drivers with appropriate #includes as needed for IPv6 data type in LRO. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgbe/adapter.h head/sys/netinet/tcp_lro.c head/sys/netinet/tcp_lro.h Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Thu May 24 22:14:39 2012 (r235943) +++ head/sys/dev/cxgb/cxgb_adapter.h Thu May 24 23:03:23 2012 (r235944) @@ -46,6 +46,7 @@ $FreeBSD$ #include #include #include +#include #include #include Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu May 24 22:14:39 2012 (r235943) +++ head/sys/dev/cxgbe/adapter.h Thu May 24 23:03:23 2012 (r235944) @@ -44,6 +44,7 @@ #include #include #include +#include #include #include "offload.h" Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Thu May 24 22:14:39 2012 (r235943) +++ head/sys/netinet/tcp_lro.c Thu May 24 23:03:23 2012 (r235944) @@ -1,8 +1,12 @@ /*- * Copyright (c) 2007, Myricom Inc. * Copyright (c) 2008, Intel Corporation. + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Bjoern Zeeb + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,365 +31,565 @@ * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include -#include #include #include #include #include +#include #include -#include #include #include +#include #include #include #include -#include #include +#ifndef LRO_ENTRIES +#define LRO_ENTRIES 8 /* # of LRO entries per RX queue. */ +#endif + +#define TCP_LRO_UPDATE_CSUM 1 +#ifndef TCP_LRO_UPDATE_CSUM +#define TCP_LRO_INVALID_CSUM 0x0000 +#endif -static uint16_t do_csum_data(uint16_t *raw, int len) -{ - uint32_t csum; - csum = 0; - while (len > 0) { - csum += *raw; - raw++; - csum += *raw; - raw++; - len -= 4; - } - csum = (csum >> 16) + (csum & 0xffff); - csum = (csum >> 16) + (csum & 0xffff); - return (uint16_t)csum; -} - -/* - * Allocate and init the LRO data structures - */ int -tcp_lro_init(struct lro_ctrl *cntl) +tcp_lro_init(struct lro_ctrl *lc) { - struct lro_entry *lro; - int i, error = 0; - - SLIST_INIT(&cntl->lro_free); - SLIST_INIT(&cntl->lro_active); + struct lro_entry *le; + int error, i; - cntl->lro_bad_csum = 0; - cntl->lro_queued = 0; - cntl->lro_flushed = 0; + lc->lro_bad_csum = 0; + lc->lro_queued = 0; + lc->lro_flushed = 0; + lc->lro_cnt = 0; + SLIST_INIT(&lc->lro_free); + SLIST_INIT(&lc->lro_active); + error = 0; for (i = 0; i < LRO_ENTRIES; i++) { - lro = (struct lro_entry *) malloc(sizeof (struct lro_entry), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (lro == NULL) { + le = (struct lro_entry *)malloc(sizeof(*le), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (le == NULL) { if (i == 0) error = ENOMEM; break; } - cntl->lro_cnt = i; - SLIST_INSERT_HEAD(&cntl->lro_free, lro, next); + lc->lro_cnt = i + 1; + SLIST_INSERT_HEAD(&lc->lro_free, le, next); } return (error); } void -tcp_lro_free(struct lro_ctrl *cntl) +tcp_lro_free(struct lro_ctrl *lc) { - struct lro_entry *entry; + struct lro_entry *le; + + while (!SLIST_EMPTY(&lc->lro_free)) { + le = SLIST_FIRST(&lc->lro_free); + SLIST_REMOVE_HEAD(&lc->lro_free, next); + free(le, M_DEVBUF); + } +} - while (!SLIST_EMPTY(&cntl->lro_free)) { - entry = SLIST_FIRST(&cntl->lro_free); - SLIST_REMOVE_HEAD(&cntl->lro_free, next); - free(entry, M_DEVBUF); +#ifdef TCP_LRO_UPDATE_CSUM +static uint16_t +tcp_lro_csum_th(struct tcphdr *th) +{ + uint32_t ch; + uint16_t *p, l; + + ch = th->th_sum = 0x0000; + l = th->th_off; + p = (uint16_t *)th; + while (l > 0) { + ch += *p; + p++; + ch += *p; + p++; + l--; + } + while (ch > 0xffff) + ch = (ch >> 16) + (ch & 0xffff); + + return (ch & 0xffff); +} + +static uint16_t +tcp_lro_rx_csum_fixup(struct lro_entry *le, void *l3hdr, struct tcphdr *th, + uint16_t tcp_data_len, uint16_t csum) +{ + uint32_t c; + uint16_t cs; + + c = csum; + + /* Remove length from checksum. */ + switch (le->eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + { + struct ip6_hdr *ip6; + + ip6 = (struct ip6_hdr *)l3hdr; + if (le->append_cnt == 0) + cs = ip6->ip6_plen; + else { + uint32_t cx; + + cx = ntohs(ip6->ip6_plen); + cs = in6_cksum_pseudo(ip6, cx, ip6->ip6_nxt, 0); + } + break; + } +#endif +#ifdef INET + case ETHERTYPE_IP: + { + struct ip *ip4; + + ip4 = (struct ip *)l3hdr; + if (le->append_cnt == 0) + cs = ip4->ip_len; + else { + cs = in_addword(ntohs(ip4->ip_len) - sizeof(*ip4), + IPPROTO_TCP); + cs = in_pseudo(ip4->ip_src.s_addr, ip4->ip_dst.s_addr, + htons(cs)); + } + break; + } +#endif + default: + cs = 0; /* Keep compiler happy. */ } + + cs = ~cs; + c += cs; + + /* Remove TCP header csum. */ + cs = ~tcp_lro_csum_th(th); + c += cs; + while (c > 0xffff) + c = (c >> 16) + (c & 0xffff); + + return (c & 0xffff); } +#endif void -tcp_lro_flush(struct lro_ctrl *cntl, struct lro_entry *lro) +tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le) { - struct ifnet *ifp; - struct ip *ip; - struct tcphdr *tcp; - uint32_t *ts_ptr; - uint32_t tcplen, tcp_csum; + if (le->append_cnt > 0) { + struct tcphdr *th; + uint16_t p_len; + + p_len = htons(le->p_len); + switch (le->eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + { + struct ip6_hdr *ip6; + + ip6 = le->le_ip6; + ip6->ip6_plen = p_len; + th = (struct tcphdr *)(ip6 + 1); + le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + le->p_len += ETHER_HDR_LEN + sizeof(*ip6); + break; + } +#endif +#ifdef INET + case ETHERTYPE_IP: + { + struct ip *ip4; +#ifdef TCP_LRO_UPDATE_CSUM + uint32_t cl; + uint16_t c; +#endif + + ip4 = le->le_ip4; +#ifdef TCP_LRO_UPDATE_CSUM + /* Fix IP header checksum for new length. */ + c = ~ip4->ip_sum; + cl = c; + c = ~ip4->ip_len; + cl += c + p_len; + while (cl > 0xffff) + cl = (cl >> 16) + (cl & 0xffff); + c = cl; + ip4->ip_sum = ~c; +#else + ip4->ip_sum = TCP_LRO_INVALID_CSUM; +#endif + ip4->ip_len = p_len; + th = (struct tcphdr *)(ip4 + 1); + le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | + CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; + le->p_len += ETHER_HDR_LEN; + break; + } +#endif + default: + th = NULL; /* Keep compiler happy. */ + } + le->m_head->m_pkthdr.csum_data = 0xffff; + le->m_head->m_pkthdr.len = le->p_len; - if (lro->append_cnt) { - /* incorporate the new len into the ip header and - * re-calculate the checksum */ - ip = lro->ip; - ip->ip_len = htons(lro->len - ETHER_HDR_LEN); - ip->ip_sum = 0; - ip->ip_sum = 0xffff ^ - do_csum_data((uint16_t*)ip, - sizeof (*ip)); - - lro->m_head->m_pkthdr.csum_flags = CSUM_IP_CHECKED | - CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR; - lro->m_head->m_pkthdr.csum_data = 0xffff; - lro->m_head->m_pkthdr.len = lro->len; - - /* incorporate the latest ack into the tcp header */ - tcp = (struct tcphdr *) (ip + 1); - tcp->th_ack = lro->ack_seq; - tcp->th_win = lro->window; - /* incorporate latest timestamp into the tcp header */ - if (lro->timestamp) { - ts_ptr = (uint32_t *)(tcp + 1); - ts_ptr[1] = htonl(lro->tsval); - ts_ptr[2] = lro->tsecr; - } - /* - * update checksum in tcp header by re-calculating the - * tcp pseudoheader checksum, and adding it to the checksum - * of the tcp payload data - */ - tcp->th_sum = 0; - tcplen = lro->len - sizeof(*ip) - ETHER_HDR_LEN; - tcp_csum = lro->data_csum; - tcp_csum += in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htons(tcplen + IPPROTO_TCP)); - tcp_csum += do_csum_data((uint16_t*)tcp, - tcp->th_off << 2); - tcp_csum = (tcp_csum & 0xffff) + (tcp_csum >> 16); - tcp_csum = (tcp_csum & 0xffff) + (tcp_csum >> 16); - tcp->th_sum = 0xffff ^ tcp_csum; - } - ifp = cntl->ifp; - (*ifp->if_input)(cntl->ifp, lro->m_head); - cntl->lro_queued += lro->append_cnt + 1; - cntl->lro_flushed++; - lro->m_head = NULL; - lro->timestamp = 0; - lro->append_cnt = 0; - SLIST_INSERT_HEAD(&cntl->lro_free, lro, next); + /* Incorporate the latest ACK into the TCP header. */ + th->th_ack = le->ack_seq; + th->th_win = le->window; + /* Incorporate latest timestamp into the TCP header. */ + if (le->timestamp != 0) { + uint32_t *ts_ptr; + + ts_ptr = (uint32_t *)(th + 1); + ts_ptr[1] = htonl(le->tsval); + ts_ptr[2] = le->tsecr; + } +#ifdef TCP_LRO_UPDATE_CSUM + /* Update the TCP header checksum. */ + le->ulp_csum += p_len; + le->ulp_csum += tcp_lro_csum_th(th); + while (le->ulp_csum > 0xffff) + le->ulp_csum = (le->ulp_csum >> 16) + + (le->ulp_csum & 0xffff); + th->th_sum = (le->ulp_csum & 0xffff); + th->th_sum = ~th->th_sum; +#else + th->th_sum = TCP_LRO_INVALID_CSUM; +#endif + } + + (*lc->ifp->if_input)(lc->ifp, le->m_head); + lc->lro_queued += le->append_cnt + 1; + lc->lro_flushed++; + bzero(le, sizeof(*le)); + SLIST_INSERT_HEAD(&lc->lro_free, le, next); } -int -tcp_lro_rx(struct lro_ctrl *cntl, struct mbuf *m_head, uint32_t csum) +#ifdef INET6 +static int +tcp_lro_rx_ipv6(struct lro_ctrl *lc, struct mbuf *m, struct ip6_hdr *ip6, + struct tcphdr **th) { - struct ether_header *eh; - struct ip *ip; - struct tcphdr *tcp; - uint32_t *ts_ptr; - struct mbuf *m_nxt, *m_tail; - struct lro_entry *lro; - int hlen, ip_len, tcp_hdr_len, tcp_data_len, tot_len; - int opt_bytes, trim, csum_flags; - uint32_t seq, tmp_csum, device_mtu; - - - eh = mtod(m_head, struct ether_header *); - if (eh->ether_type != htons(ETHERTYPE_IP)) - return 1; - ip = (struct ip *) (eh + 1); - if (ip->ip_p != IPPROTO_TCP) - return 1; - - /* ensure there are no options */ - if ((ip->ip_hl << 2) != sizeof (*ip)) - return -1; - - /* .. and the packet is not fragmented */ - if (ip->ip_off & htons(IP_MF|IP_OFFMASK)) - return -1; - /* verify that the IP header checksum is correct */ - csum_flags = m_head->m_pkthdr.csum_flags; + /* XXX-BZ we should check the flow-label. */ + + /* XXX-BZ We do not yet support ext. hdrs. */ + if (ip6->ip6_nxt != IPPROTO_TCP) + return (TCP_LRO_NOT_SUPPORTED); + + /* Find the TCP header. */ + *th = (struct tcphdr *)(ip6 + 1); + + return (0); +} +#endif + +#ifdef INET +static int +tcp_lro_rx_ipv4(struct lro_ctrl *lc, struct mbuf *m, struct ip *ip4, + struct tcphdr **th) +{ + int csum_flags; + uint16_t csum; + + if (ip4->ip_p != IPPROTO_TCP) + return (TCP_LRO_NOT_SUPPORTED); + + /* Ensure there are no options. */ + if ((ip4->ip_hl << 2) != sizeof (*ip4)) + return (TCP_LRO_CANNOT); + + /* .. and the packet is not fragmented. */ + if (ip4->ip_off & htons(IP_MF|IP_OFFMASK)) + return (TCP_LRO_CANNOT); + + /* Legacy IP has a header checksum that needs to be correct. */ + csum_flags = m->m_pkthdr.csum_flags; if (csum_flags & CSUM_IP_CHECKED) { if (__predict_false((csum_flags & CSUM_IP_VALID) == 0)) { - cntl->lro_bad_csum++; - return -1; + lc->lro_bad_csum++; + return (TCP_LRO_CANNOT); } } else { - tmp_csum = do_csum_data((uint16_t *)ip, sizeof (*ip)); - if (__predict_false((tmp_csum ^ 0xffff) != 0)) { - cntl->lro_bad_csum++; - return -1; - } - } - - /* find the TCP header */ - tcp = (struct tcphdr *) (ip + 1); - - /* Get the TCP checksum if we dont have it */ - if (!csum) - csum = tcp->th_sum; - - /* ensure no bits set besides ack or psh */ - if ((tcp->th_flags & ~(TH_ACK | TH_PUSH)) != 0) - return -1; - - /* check for timestamps. Since the only option we handle are - timestamps, we only have to handle the simple case of - aligned timestamps */ - - opt_bytes = (tcp->th_off << 2) - sizeof (*tcp); - tcp_hdr_len = sizeof (*tcp) + opt_bytes; - ts_ptr = (uint32_t *)(tcp + 1); - if (opt_bytes != 0) { - if (__predict_false(opt_bytes != TCPOLEN_TSTAMP_APPA) || - (*ts_ptr != ntohl(TCPOPT_NOP<<24|TCPOPT_NOP<<16| - TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP))) - return -1; - } - - ip_len = ntohs(ip->ip_len); - tcp_data_len = ip_len - (tcp->th_off << 2) - sizeof (*ip); - - - /* - * If frame is padded beyond the end of the IP packet, - * then we must trim the extra bytes off the end. + csum = in_cksum_hdr(ip4); + if (__predict_false((csum ^ 0xffff) != 0)) { + lc->lro_bad_csum++; + return (TCP_LRO_CANNOT); + } + } + + /* Find the TCP header (we assured there are no IP options). */ + *th = (struct tcphdr *)(ip4 + 1); + + return (0); +} +#endif + +int +tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) +{ + struct lro_entry *le; + struct ether_header *eh; +#ifdef INET6 + struct ip6_hdr *ip6 = NULL; /* Keep compiler happy. */ +#endif +#ifdef INET + struct ip *ip4 = NULL; /* Keep compiler happy. */ +#endif + struct tcphdr *th; + void *l3hdr = NULL; /* Keep compiler happy. */ + uint32_t *ts_ptr; + tcp_seq seq; + int error, ip_len, l; + uint16_t eh_type, tcp_data_len; + + /* We expect a contiguous header [eh, ip, tcp]. */ + + eh = mtod(m, struct ether_header *); + eh_type = ntohs(eh->ether_type); + switch (eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + l3hdr = ip6 = (struct ip6_hdr *)(eh + 1); + error = tcp_lro_rx_ipv6(lc, m, ip6, &th); + if (error != 0) + return (error); + tcp_data_len = ntohs(ip6->ip6_plen); + ip_len = sizeof(*ip6) + tcp_data_len; + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + l3hdr = ip4 = (struct ip *)(eh + 1); + error = tcp_lro_rx_ipv4(lc, m, ip4, &th); + if (error != 0) + return (error); + ip_len = ntohs(ip4->ip_len); + tcp_data_len = ip_len - sizeof(*ip4); + break; +#endif + /* XXX-BZ what happens in case of VLAN(s)? */ + default: + return (TCP_LRO_NOT_SUPPORTED); + } + + /* + * If the frame is padded beyond the end of the IP packet, then we must + * trim the extra bytes off. + */ + l = m->m_pkthdr.len - (ETHER_HDR_LEN + ip_len); + if (l != 0) { + if (l < 0) + /* Truncated packet. */ + return (TCP_LRO_CANNOT); + + m_adj(m, -l); + } + + /* + * Check TCP header constraints. */ - tot_len = m_head->m_pkthdr.len; - trim = tot_len - (ip_len + ETHER_HDR_LEN); - if (trim != 0) { - if (trim < 0) { - /* truncated packet */ - return -1; - } - m_adj(m_head, -trim); - tot_len = m_head->m_pkthdr.len; - } - - m_nxt = m_head; - m_tail = NULL; /* -Wuninitialized */ - while (m_nxt != NULL) { - m_tail = m_nxt; - m_nxt = m_tail->m_next; - } - - hlen = ip_len + ETHER_HDR_LEN - tcp_data_len; - seq = ntohl(tcp->th_seq); - - SLIST_FOREACH(lro, &cntl->lro_active, next) { - if (lro->source_port == tcp->th_sport && - lro->dest_port == tcp->th_dport && - lro->source_ip == ip->ip_src.s_addr && - lro->dest_ip == ip->ip_dst.s_addr) { - /* Flush now if appending will result in overflow. */ - if (lro->len > (65535 - tcp_data_len)) { - SLIST_REMOVE(&cntl->lro_active, lro, - lro_entry, next); - tcp_lro_flush(cntl, lro); - break; - } - - /* Try to append it */ - - if (__predict_false(seq != lro->next_seq || - (tcp_data_len == 0 && - lro->ack_seq == tcp->th_ack))) { - /* out of order packet or dup ack */ - SLIST_REMOVE(&cntl->lro_active, lro, - lro_entry, next); - tcp_lro_flush(cntl, lro); - return -1; - } - - if (opt_bytes) { - uint32_t tsval = ntohl(*(ts_ptr + 1)); - /* make sure timestamp values are increasing */ - if (__predict_false(lro->tsval > tsval || - *(ts_ptr + 2) == 0)) { - return -1; - } - lro->tsval = tsval; - lro->tsecr = *(ts_ptr + 2); - } - - lro->next_seq += tcp_data_len; - lro->ack_seq = tcp->th_ack; - lro->window = tcp->th_win; - lro->append_cnt++; - if (tcp_data_len == 0) { - m_freem(m_head); - return 0; - } - /* subtract off the checksum of the tcp header - * from the hardware checksum, and add it to the - * stored tcp data checksum. Byteswap the checksum - * if the total length so far is odd - */ - tmp_csum = do_csum_data((uint16_t*)tcp, - tcp_hdr_len); - csum = csum + (tmp_csum ^ 0xffff); - csum = (csum & 0xffff) + (csum >> 16); - csum = (csum & 0xffff) + (csum >> 16); - if (lro->len & 0x1) { - /* Odd number of bytes so far, flip bytes */ - csum = ((csum << 8) | (csum >> 8)) & 0xffff; - } - csum = csum + lro->data_csum; - csum = (csum & 0xffff) + (csum >> 16); - csum = (csum & 0xffff) + (csum >> 16); - lro->data_csum = csum; - - lro->len += tcp_data_len; - - /* adjust mbuf so that m->m_data points to - the first byte of the payload */ - m_adj(m_head, hlen); - /* append mbuf chain */ - lro->m_tail->m_next = m_head; - /* advance the last pointer */ - lro->m_tail = m_tail; - /* flush packet if required */ - device_mtu = cntl->ifp->if_mtu; - if (lro->len > (65535 - device_mtu)) { - SLIST_REMOVE(&cntl->lro_active, lro, - lro_entry, next); - tcp_lro_flush(cntl, lro); - } - return 0; - } - } - - if (SLIST_EMPTY(&cntl->lro_free)) - return -1; - - /* start a new chain */ - lro = SLIST_FIRST(&cntl->lro_free); - SLIST_REMOVE_HEAD(&cntl->lro_free, next); - SLIST_INSERT_HEAD(&cntl->lro_active, lro, next); - lro->source_port = tcp->th_sport; - lro->dest_port = tcp->th_dport; - lro->source_ip = ip->ip_src.s_addr; - lro->dest_ip = ip->ip_dst.s_addr; - lro->next_seq = seq + tcp_data_len; - lro->mss = tcp_data_len; - lro->ack_seq = tcp->th_ack; - lro->window = tcp->th_win; - - /* save the checksum of just the TCP payload by - * subtracting off the checksum of the TCP header from - * the entire hardware checksum - * Since IP header checksum is correct, checksum over - * the IP header is -0. Substracting -0 is unnecessary. + /* Ensure no bits set besides ACK or PSH. */ + if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0) + return (TCP_LRO_CANNOT); + + /* XXX-BZ We lose a AKC|PUSH flag concatinating multiple segments. */ + /* XXX-BZ Ideally we'd flush on PUSH? */ + + /* + * Check for timestamps. + * Since the only option we handle are timestamps, we only have to + * handle the simple case of aligned timestamps. + */ + l = (th->th_off << 2); + tcp_data_len -= l; + l -= sizeof(*th); + ts_ptr = (uint32_t *)(th + 1); + if (l != 0 && (__predict_false(l != TCPOLEN_TSTAMP_APPA) || + (*ts_ptr != ntohl(TCPOPT_NOP<<24|TCPOPT_NOP<<16| + TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)))) + return (TCP_LRO_CANNOT); + + /* If the driver did not pass in the checksum, set it now. */ + if (csum == 0x0000) + csum = th->th_sum; + + seq = ntohl(th->th_seq); + + /* Try to find a matching previous segment. */ + SLIST_FOREACH(le, &lc->lro_active, next) { + if (le->eh_type != eh_type) + continue; + if (le->source_port != th->th_sport || + le->dest_port != th->th_dport) + continue; + switch (eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + if (bcmp(&le->source_ip6, &ip6->ip6_src, + sizeof(struct in6_addr)) != 0 || + bcmp(&le->dest_ip6, &ip6->ip6_dst, + sizeof(struct in6_addr)) != 0) + continue; + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + if (le->source_ip4 != ip4->ip_src.s_addr || + le->dest_ip4 != ip4->ip_dst.s_addr) + continue; + break; +#endif + } + + /* Flush now if appending will result in overflow. */ + if (le->p_len > (65535 - tcp_data_len)) { + SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + tcp_lro_flush(lc, le); + break; + } + + /* Try to append the new segment. */ + if (__predict_false(seq != le->next_seq || + (tcp_data_len == 0 && le->ack_seq == th->th_ack))) { + /* Out of order packet or duplicate ACK. */ + SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + tcp_lro_flush(lc, le); + return (TCP_LRO_CANNOT); + } + + if (l != 0) { + uint32_t tsval = ntohl(*(ts_ptr + 1)); + /* Make sure timestamp values are increasing. */ + /* XXX-BZ flip and use TSTMP_GEQ macro for this? */ + if (__predict_false(le->tsval > tsval || + *(ts_ptr + 2) == 0)) + return (TCP_LRO_CANNOT); + le->tsval = tsval; + le->tsecr = *(ts_ptr + 2); + } + + le->next_seq += tcp_data_len; + le->ack_seq = th->th_ack; + le->window = th->th_win; + le->append_cnt++; + +#ifdef TCP_LRO_UPDATE_CSUM + le->ulp_csum += tcp_lro_rx_csum_fixup(le, l3hdr, th, + tcp_data_len, ~csum); +#endif + + if (tcp_data_len == 0) { + m_freem(m); + return (0); + } + + le->p_len += tcp_data_len; + + /* + * Adjust the mbuf so that m_data points to the first byte of + * the ULP payload. Adjust the mbuf to avoid complications and + * append new segment to existing mbuf chain. + */ + m_adj(m, m->m_pkthdr.len - tcp_data_len); + m->m_flags &= ~M_PKTHDR; + + le->m_tail->m_next = m; + le->m_tail = m_last(m); + + /* + * If a possible next full length packet would cause an + * overflow, pro-actively flush now. + */ + if (le->p_len > (65535 - lc->ifp->if_mtu)) { + SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + tcp_lro_flush(lc, le); + } + + return (0); + } + + /* Try to find an empty slot. */ + if (SLIST_EMPTY(&lc->lro_free)) + return (TCP_LRO_CANNOT); + + /* Start a new segment chain. */ + le = SLIST_FIRST(&lc->lro_free); + SLIST_REMOVE_HEAD(&lc->lro_free, next); + SLIST_INSERT_HEAD(&lc->lro_active, le, next); + + /* Start filling in details. */ + switch (eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + le->le_ip6 = ip6; + le->source_ip6 = ip6->ip6_src; + le->dest_ip6 = ip6->ip6_dst; + le->eh_type = eh_type; + le->p_len = m->m_pkthdr.len - ETHER_HDR_LEN - sizeof(*ip6); + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + le->le_ip4 = ip4; + le->source_ip4 = ip4->ip_src.s_addr; + le->dest_ip4 = ip4->ip_dst.s_addr; + le->eh_type = eh_type; + le->p_len = m->m_pkthdr.len - ETHER_HDR_LEN; + break; +#endif + } + le->source_port = th->th_sport; + le->dest_port = th->th_dport; + + le->next_seq = seq + tcp_data_len; + le->ack_seq = th->th_ack; + le->window = th->th_win; + if (l != 0) { + le->timestamp = 1; + le->tsval = ntohl(*(ts_ptr + 1)); + le->tsecr = *(ts_ptr + 2); + } + +#ifdef TCP_LRO_UPDATE_CSUM + /* + * Do not touch the csum of the first packet. However save the + * "adjusted" checksum of just the source and destination addresses, + * the next header and the TCP payload. The length and TCP header + * parts may change, so we remove those from the saved checksum and + * re-add with final values on tcp_lro_flush() if needed. */ - tmp_csum = do_csum_data((uint16_t*)tcp, tcp_hdr_len); - csum = csum + (tmp_csum ^ 0xffff); - csum = (csum & 0xffff) + (csum >> 16); - csum = (csum & 0xffff) + (csum >> 16); - lro->data_csum = csum; - - lro->ip = ip; - /* record timestamp if it is present */ - if (opt_bytes) { - lro->timestamp = 1; - lro->tsval = ntohl(*(ts_ptr + 1)); - lro->tsecr = *(ts_ptr + 2); - } - lro->len = tot_len; - lro->m_head = m_head; - lro->m_tail = m_tail; - return 0; + KASSERT(le->ulp_csum == 0, ("%s: le=%p le->ulp_csum=0x%04x\n", + __func__, le, le->ulp_csum)); + + le->ulp_csum = tcp_lro_rx_csum_fixup(le, l3hdr, th, tcp_data_len, + ~csum); + th->th_sum = csum; /* Restore checksum on first packet. */ +#endif + + le->m_head = m; + le->m_tail = m_last(m); + + return (0); } + +/* end */ Modified: head/sys/netinet/tcp_lro.h ============================================================================== --- head/sys/netinet/tcp_lro.h Thu May 24 22:14:39 2012 (r235943) +++ head/sys/netinet/tcp_lro.h Thu May 24 23:03:23 2012 (r235944) @@ -30,31 +30,46 @@ #ifndef _TCP_LRO_H_ #define _TCP_LRO_H_ -struct lro_entry; struct lro_entry { - SLIST_ENTRY(lro_entry) next; - struct mbuf *m_head; - struct mbuf *m_tail; - int timestamp; - struct ip *ip; - uint32_t tsval; - uint32_t tsecr; - uint32_t source_ip; - uint32_t dest_ip; - uint32_t next_seq; - uint32_t ack_seq; - uint32_t len; - uint32_t data_csum; - uint16_t window; - uint16_t source_port; - uint16_t dest_port; - uint16_t append_cnt; - uint16_t mss; - + SLIST_ENTRY(lro_entry) next; + struct mbuf *m_head; + struct mbuf *m_tail; + union { + struct ip *ip4; + struct ip6_hdr *ip6; + } leip; + union { + in_addr_t s_ip4; + struct in6_addr s_ip6; + } lesource; + union { + in_addr_t d_ip4; + struct in6_addr d_ip6; + } ledest; + uint16_t source_port; + uint16_t dest_port; + uint16_t eh_type; /* EthernetHeader type. */ + uint16_t append_cnt; + uint32_t p_len; /* IP header payload length. */ + uint32_t ulp_csum; /* TCP, etc. checksum. */ + uint32_t next_seq; /* tcp_seq */ + uint32_t ack_seq; /* tcp_seq */ + uint32_t tsval; + uint32_t tsecr; + uint16_t window; + uint16_t timestamp; /* flag, not a TCP hdr field. */ }; SLIST_HEAD(lro_head, lro_entry); +#define le_ip4 leip.ip4 +#define le_ip6 leip.ip6 +#define source_ip4 lesource.s_ip4 +#define dest_ip4 ledest.d_ip4 +#define source_ip6 lesource.s_ip6 +#define dest_ip6 ledest.d_ip6 + +/* NB: This is part of driver structs. */ struct lro_ctrl { struct ifnet *ifp; int lro_queued; @@ -66,13 +81,12 @@ struct lro_ctrl { struct lro_head lro_free; }; - int tcp_lro_init(struct lro_ctrl *); void tcp_lro_free(struct lro_ctrl *); void tcp_lro_flush(struct lro_ctrl *, struct lro_entry *); int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t); -/* Number of LRO entries - these are per rx queue */ -#define LRO_ENTRIES 8 +#define TCP_LRO_CANNOT -1 +#define TCP_LRO_NOT_SUPPORTED 1 #endif /* _TCP_LRO_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu May 24 23:12:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 562251065678; Thu, 24 May 2012 23:12:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D29E8FC1C; Thu, 24 May 2012 23:12: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 q4ONCV4X066052; Thu, 24 May 2012 23:12:31 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ONCUXr066028; Thu, 24 May 2012 23:12:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201205242312.q4ONCUXr066028@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 24 May 2012 23:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235945 - in head/sys: contrib/dev/acpica contrib/dev/acpica/common contrib/dev/acpica/compiler contrib/dev/acpica/components/debugger contrib/dev/acpica/components/dispatcher contrib/d... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 23:12:31 -0000 Author: jkim Date: Thu May 24 23:12:30 2012 New Revision: 235945 URL: http://svn.freebsd.org/changeset/base/235945 Log: Merge ACPICA 20120518. Modified: head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslcompiler.y head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/debugger/dbfileio.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/events/evxface.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c head/sys/dev/acpica/Osd/OsdSchedule.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/dispatcher/ (props changed) head/sys/contrib/dev/acpica/components/events/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) head/sys/contrib/dev/acpica/os_specific/ (props changed) Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Thu May 24 23:12:30 2012 (r235945) @@ -10,8 +10,8 @@ if [ ! $# -eq 1 ]; then fi src=$1 -wrk=`realpath ./_acpi_ca_unpack` -dst=`realpath ./acpi_ca_destination` +wrk="$(realpath .)/_acpi_ca_unpack" +dst="$(realpath .)/acpi_ca_destination" # files that should keep their full directory path fulldirs="common compiler components include os_specific" @@ -67,7 +67,8 @@ for H in ${src_headers}; do xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done for H in ${comp_headers}; do - find ${dst}/common ${dst}/compiler -name "*.[chly]" -type f | \ + find ${dst}/common ${dst}/compiler ${dst}/components \ + -name "*.[chly]" -type f | \ xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done for H in ${platform_headers}; do Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/changes.txt Thu May 24 23:12:30 2012 (r235945) @@ -1,8 +1,70 @@ ---------------------------------------- +18 May 2012. Summary of changes for version 20120518: + + +1) ACPICA Core Subsystem: + +Added a new OSL interface, AcpiOsWaitEventsComplete. This interface is defined +to block until asynchronous events such as notifies and GPEs have completed. +Within ACPICA, it is only called before a notify or GPE handler is +removed/uninstalled. It also may be useful for the host OS within related +drivers such as the Embedded Controller driver. See the ACPICA reference for +additional information. ACPICA BZ 868. + +ACPI Tables: Added a new error message for a possible overflow failure during +the conversion of FADT 32-bit legacy register addresses to internal common 64- +bit GAS structure representation. The GAS has a one-byte "bit length" field, +thus limiting the register length to 255 bits. ACPICA BZ 953. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug +version of the code includes the debug output trace mechanism and has a much +larger code and data size. + + Previous Release: + Non-Debug Version: 92.9K Code, 25.0K Data, 117.9K Total + Debug Version: 172.6K Code, 73.4K Data, 246.0K Total + Current Release: + Non-Debug Version: 93.0K Code, 25.1K Data, 118.1K Total + Debug Version: 172.7K Code, 73.6K Data, 246.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Added the ACPI 5.0 "PCC" keyword for use in the Register() ASL macro. +This keyword was added late in the ACPI 5.0 release cycle and was not +implemented until now. + +Disassembler: Added support for Operation Region externals. Adds missing +support for operation regions that are defined in another table, and +referenced locally via a Field or BankField ASL operator. Now generates the +correct External statement. + +Disassembler: Several additional fixes for the External() statement generation +related to some ASL operators. Also, order the External() statements +alphabetically in the disassembler output. Fixes the External() generation for +the Create* field, Alias, and Scope operators: + 1) Create* buffer field operators - fix type mismatch warning on disassembly + 2) Alias - implement missing External support + 3) Scope - fix to make sure all necessary externals are emitted. + +iASL: Improved pathname support. For include files, merge the prefix pathname +with the file pathname and eliminate unnecessary components. Convert +backslashes in all pathnames to forward slashes, for readability. Include file +pathname changes affect both #include and Include() type operators. + +iASL/DTC/Preprocessor: Gracefully handle early EOF. Handle an EOF at the end +of a valid line by inserting a newline and then returning the EOF during the +next call to GetNextLine. Prevents the line from being ignored due to EOF +condition. + +iASL: Implemented some changes to enhance the IDE support (-vi option.) Error +and Warning messages are now correctly recognized for both the source code +browser and the global error and warning counts. + +---------------------------------------- 20 April 2012. Summary of changes for version 20120420: -This release is available at www.acpica.org/downloads. -The ACPI 5.0 specification is available at www.acpi.info. 1) ACPICA Core Subsystem: @@ -68,8 +130,6 @@ several extraneous "unrecognized operato ---------------------------------------- 20 March 2012. Summary of changes for version 20120320: -This release is available at www.acpica.org/downloads. -The ACPI 5.0 specification is available at www.acpi.info. 1) ACPICA Core Subsystem: @@ -160,8 +220,6 @@ Versions supported: ---------------------------------------- 15 February 2012. Summary of changes for version 20120215: -This release is available at www.acpica.org/downloads. -The ACPI 5.0 specification is available at www.acpi.info. 1) ACPICA Core Subsystem: @@ -252,8 +310,6 @@ specification. ---------------------------------------- 11 January 2012. Summary of changes for version 20120111: -This release is available at www.acpica.org/downloads. -The ACPI 5.0 specification is available at www.acpi.info. 1) ACPICA Core Subsystem: Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/common/adfile.c Thu May 24 23:12:30 2012 (r235945) @@ -298,20 +298,24 @@ FlSplitInputPathname ( return (AE_NO_MEMORY); } - Substring = strrchr (DirectoryPath, '\\'); + /* Convert backslashes to slashes in the entire path */ + + UtConvertBackslashes (DirectoryPath); + + /* Backup to last slash or colon */ + + Substring = strrchr (DirectoryPath, '/'); if (!Substring) { - Substring = strrchr (DirectoryPath, '/'); - if (!Substring) - { - Substring = strrchr (DirectoryPath, ':'); - } + Substring = strrchr (DirectoryPath, ':'); } + /* Extract the simple filename */ + if (!Substring) { + Filename = FlStrdup (DirectoryPath); DirectoryPath[0] = 0; - Filename = FlStrdup (InputPath); } else { @@ -326,7 +330,6 @@ FlSplitInputPathname ( *OutDirectoryPath = DirectoryPath; *OutFilename = Filename; - return (AE_OK); } Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/common/adwalk.c Thu May 24 23:12:30 2012 (r235945) @@ -521,6 +521,7 @@ AcpiDmFindOrphanDescending ( if ((OpInfo->Class != AML_CLASS_EXECUTE) && (OpInfo->Class != AML_CLASS_CREATE) && + (OpInfo->ObjectType != ACPI_TYPE_LOCAL_ALIAS) && (ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) && !Op->Common.Node) { @@ -743,13 +744,23 @@ AcpiDmXrefDescendingOp ( if (OpInfo->Flags & AML_NAMED) { - if ((Op->Common.AmlOpcode == AML_ALIAS_OP) || - (Op->Common.AmlOpcode == AML_SCOPE_OP)) + /* + * Only these two operators (Alias, Scope) refer to an existing + * name, it is the first argument + */ + if (Op->Common.AmlOpcode == AML_ALIAS_OP) + { + ObjectType = ACPI_TYPE_ANY; + + NextOp = Op->Common.Value.Arg; + NextOp = NextOp->Common.Value.Arg; + if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) + { + Path = NextOp->Common.Value.String; + } + } + else if (Op->Common.AmlOpcode == AML_SCOPE_OP) { - /* - * Only these two operators refer to an existing name, - * first argument - */ Path = (char *) Op->Named.Path; } } @@ -757,6 +768,8 @@ AcpiDmXrefDescendingOp ( { /* Referenced Buffer Name is the first child */ + ObjectType = ACPI_TYPE_BUFFER; /* Change from TYPE_BUFFER_FIELD */ + NextOp = Op->Common.Value.Arg; if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) { @@ -783,6 +796,11 @@ AcpiDmXrefDescendingOp ( Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, WalkState, &Node); + if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL)) + { + Status = AE_NOT_FOUND; + } + if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/common/dmextern.c Thu May 24 23:12:30 2012 (r235945) @@ -454,12 +454,12 @@ AcpiDmAddToExternalList ( NewExternal->InternalPath = Path; - /* Link the new descriptor into the global list, ordered by string length */ + /* Link the new descriptor into the global list, alphabetically ordered */ NextExternal = AcpiGbl_ExternalList; while (NextExternal) { - if (NewExternal->Length <= NextExternal->Length) + if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0) { if (PrevExternal) { @@ -508,7 +508,7 @@ AcpiDmAddExternalsToNamespace ( { ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; - ACPI_OPERAND_OBJECT *MethodDesc; + ACPI_OPERAND_OBJECT *ObjDesc; ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; @@ -527,13 +527,29 @@ AcpiDmAddExternalsToNamespace ( "while adding external to namespace [%s]", External->Path)); } - else if (External->Type == ACPI_TYPE_METHOD) + + else switch (External->Type) { + case ACPI_TYPE_METHOD: + /* For methods, we need to save the argument count */ - MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); - MethodDesc->Method.ParamCount = (UINT8) External->Value; - Node->Object = MethodDesc; + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); + ObjDesc->Method.ParamCount = (UINT8) External->Value; + Node->Object = ObjDesc; + break; + + case ACPI_TYPE_REGION: + + /* Regions require a region sub-object */ + + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); + ObjDesc->Region.Node = Node; + Node->Object = ObjDesc; + break; + + default: + break; } External = External->Next; Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu May 24 23:12:30 2012 (r235945) @@ -59,12 +59,12 @@ CmFlushSourceCode ( static void FlConsumeAnsiComment ( - ASL_FILE_INFO *FileInfo, + FILE *Handle, ASL_FILE_STATUS *Status); static void FlConsumeNewComment ( - ASL_FILE_INFO *FileInfo, + FILE *Handle, ASL_FILE_STATUS *Status); @@ -253,7 +253,8 @@ CmFlushSourceCode ( * * FUNCTION: FlConsume* * - * PARAMETERS: FileInfo - Points to an open input file + * PARAMETERS: Handle - Open input file + * Status - File current status struct * * RETURN: Number of lines consumed * @@ -263,14 +264,14 @@ CmFlushSourceCode ( static void FlConsumeAnsiComment ( - ASL_FILE_INFO *FileInfo, + FILE *Handle, ASL_FILE_STATUS *Status) { UINT8 Byte; BOOLEAN ClosingComment = FALSE; - while (fread (&Byte, 1, 1, FileInfo->Handle)) + while (fread (&Byte, 1, 1, Handle)) { /* Scan until comment close is found */ @@ -307,13 +308,13 @@ FlConsumeAnsiComment ( static void FlConsumeNewComment ( - ASL_FILE_INFO *FileInfo, + FILE *Handle, ASL_FILE_STATUS *Status) { UINT8 Byte; - while (fread (&Byte, 1, 1, FileInfo->Handle)) + while (fread (&Byte, 1, 1, Handle)) { Status->Offset++; @@ -332,7 +333,9 @@ FlConsumeNewComment ( * * FUNCTION: FlCheckForAscii * - * PARAMETERS: FileInfo - Points to an open input file + * PARAMETERS: Handle - Open input file + * Filename - Input filename + * DisplayErrors - TRUE if error messages desired * * RETURN: Status * @@ -347,7 +350,9 @@ FlConsumeNewComment ( ACPI_STATUS FlCheckForAscii ( - ASL_FILE_INFO *FileInfo) + FILE *Handle, + char *Filename, + BOOLEAN DisplayErrors) { UINT8 Byte; ACPI_SIZE BadBytes = 0; @@ -360,7 +365,7 @@ FlCheckForAscii ( /* Read the entire file */ - while (fread (&Byte, 1, 1, FileInfo->Handle)) + while (fread (&Byte, 1, 1, Handle)) { /* Ignore comment fields (allow non-ascii within) */ @@ -370,12 +375,12 @@ FlCheckForAscii ( if (Byte == '*') { - FlConsumeAnsiComment (FileInfo, &Status); + FlConsumeAnsiComment (Handle, &Status); } if (Byte == '/') { - FlConsumeNewComment (FileInfo, &Status); + FlConsumeNewComment (Handle, &Status); } /* Reset */ @@ -391,7 +396,7 @@ FlCheckForAscii ( if (!ACPI_IS_ASCII (Byte)) { - if (BadBytes < 10) + if ((BadBytes < 10) && (DisplayErrors)) { AcpiOsPrintf ( "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n", @@ -413,20 +418,24 @@ FlCheckForAscii ( /* Seek back to the beginning of the source file */ - fseek (FileInfo->Handle, 0, SEEK_SET); + fseek (Handle, 0, SEEK_SET); /* Were there any non-ASCII characters in the file? */ if (BadBytes) { - AcpiOsPrintf ( - "%u non-ASCII characters found in input source text, could be a binary file\n", - BadBytes); - AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, FileInfo->Filename); + if (DisplayErrors) + { + AcpiOsPrintf ( + "%u non-ASCII characters found in input source text, could be a binary file\n", + BadBytes); + AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename); + } + return (AE_BAD_CHARACTER); } - /* File is OK */ + /* File is OK (100% ASCII) */ return (AE_OK); } Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu May 24 23:12:30 2012 (r235945) @@ -166,7 +166,9 @@ CmCleanupAndExit ( ACPI_STATUS FlCheckForAscii ( - ASL_FILE_INFO *FileInfo); + FILE *Handle, + char *Filename, + BOOLEAN DisplayErrors); /* @@ -608,6 +610,11 @@ void FlAddIncludeDirectory ( char *Dir); +char * +FlMergePathnames ( + char *PrefixDir, + char *FilePathname); + void FlOpenIncludeFile ( ACPI_PARSE_OBJECT *Op); Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.l Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l Thu May 24 23:12:30 2012 (r235945) @@ -523,6 +523,7 @@ NamePathTail [.]{NameSeg} "IPMI" { count (0); return (PARSEOP_REGIONSPACE_IPMI); } "GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */ "GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */ +"PCC" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */ "FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); } /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */ Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.y Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.y Thu May 24 23:12:30 2012 (r235945) @@ -363,6 +363,7 @@ void * AslLocalAllo %token PARSEOP_REGIONSPACE_IO %token PARSEOP_REGIONSPACE_IPMI %token PARSEOP_REGIONSPACE_MEM +%token PARSEOP_REGIONSPACE_PCC %token PARSEOP_REGIONSPACE_PCI %token PARSEOP_REGIONSPACE_PCIBAR %token PARSEOP_REGIONSPACE_SMBUS @@ -2359,6 +2360,7 @@ RegionSpaceKeyword | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} + | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} ; Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Thu May 24 23:12:30 2012 (r235945) @@ -315,12 +315,16 @@ AePrintException ( } else { + /* + * Less verbose version of the error message, enabled via the + * -vi switch. The format is compatible with MS Visual Studio. + */ fprintf (OutputFile, "%s", Enode->Filename); if (Enode->LineNumber) { - fprintf (OutputFile, "(%u) i:%6u : ", - Enode->LineNumber, Enode->LineNumber); + fprintf (OutputFile, "(%u) : ", + Enode->LineNumber); } } } @@ -335,9 +339,18 @@ AePrintException ( { /* Decode the message ID */ - fprintf (OutputFile, "%s %4.4d - ", - AslErrorLevel[Enode->Level], - Enode->MessageId + ((Enode->Level+1) * 1000)); + if (Gbl_VerboseErrors) + { + fprintf (OutputFile, "%s %4.4d - ", + AslErrorLevel[Enode->Level], + Enode->MessageId + ((Enode->Level+1) * 1000)); + } + else /* IDE case */ + { + fprintf (OutputFile, "%s %4.4d:", + AslErrorLevelIde[Enode->Level], + Enode->MessageId + ((Enode->Level+1) * 1000)); + } MainMessage = AslMessages[Enode->MessageId]; ExtraMessage = Enode->Message; Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu May 24 23:12:30 2012 (r235945) @@ -492,6 +492,107 @@ FlAddIncludeDirectory ( /******************************************************************************* * + * FUNCTION: FlMergePathnames + * + * PARAMETERS: PrefixDir - Prefix directory pathname. Can be NULL or + * a zero length string. + * FilePathname - The include filename from the source ASL. + * + * RETURN: Merged pathname string + * + * DESCRIPTION: Merge two pathnames that (probably) have common elements, to + * arrive at a minimal length string. Merge can occur if the + * FilePathname is relative to the PrefixDir. + * + ******************************************************************************/ + +char * +FlMergePathnames ( + char *PrefixDir, + char *FilePathname) +{ + char *CommonPath; + char *Pathname; + char *LastElement; + + + DbgPrint (ASL_PARSE_OUTPUT, "Include: Prefix path - \"%s\"\n" + "Include: FilePathname - \"%s\"\n", + PrefixDir, FilePathname); + + /* + * If there is no prefix directory or if the file pathname is absolute, + * just return the original file pathname + */ + if (!PrefixDir || (!*PrefixDir) || + (*FilePathname == '/') || + (FilePathname[1] == ':')) + { + Pathname = ACPI_ALLOCATE (strlen (FilePathname) + 1); + strcpy (Pathname, FilePathname); + goto ConvertBackslashes; + } + + /* Need a local copy of the prefix directory path */ + + CommonPath = ACPI_ALLOCATE (strlen (PrefixDir) + 1); + strcpy (CommonPath, PrefixDir); + + /* + * Walk forward through the file path, and simultaneously backward + * through the prefix directory path until there are no more + * relative references at the start of the file path. + */ + while (*FilePathname && (!strncmp (FilePathname, "../", 3))) + { + /* Remove last element of the prefix directory path */ + + LastElement = strrchr (CommonPath, '/'); + if (!LastElement) + { + goto ConcatenatePaths; + } + + *LastElement = 0; /* Terminate CommonPath string */ + FilePathname += 3; /* Point to next path element */ + } + + /* + * Remove the last element of the prefix directory path (it is the same as + * the first element of the file pathname), and build the final merged + * pathname. + */ + LastElement = strrchr (CommonPath, '/'); + if (LastElement) + { + *LastElement = 0; + } + + /* Build the final merged pathname */ + +ConcatenatePaths: + Pathname = ACPI_ALLOCATE_ZEROED (strlen (CommonPath) + strlen (FilePathname) + 2); + if (LastElement && *CommonPath) + { + strcpy (Pathname, CommonPath); + strcat (Pathname, "/"); + } + strcat (Pathname, FilePathname); + ACPI_FREE (CommonPath); + + /* Convert all backslashes to normal slashes */ + +ConvertBackslashes: + UtConvertBackslashes (Pathname); + + DbgPrint (ASL_PARSE_OUTPUT, "Include: Merged Pathname - \"%s\"\n", + Pathname); + return (Pathname); +} + + +/******************************************************************************* + * * FUNCTION: FlOpenIncludeWithPrefix * * PARAMETERS: PrefixDir - Prefix directory pathname. Can be a zero @@ -515,12 +616,9 @@ FlOpenIncludeWithPrefix ( /* Build the full pathname to the file */ - Pathname = ACPI_ALLOCATE (strlen (PrefixDir) + strlen (Filename) + 1); - - strcpy (Pathname, PrefixDir); - strcat (Pathname, Filename); + Pathname = FlMergePathnames (PrefixDir, Filename); - DbgPrint (ASL_PARSE_OUTPUT, "\nAttempt to open include file: path %s\n\n", + DbgPrint (ASL_PARSE_OUTPUT, "Include: Opening file - \"%s\"\n\n", Pathname); /* Attempt to open the file, push if successful */ Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Thu May 24 23:12:30 2012 (r235945) @@ -765,9 +765,18 @@ AslDoOptions ( break; case 'i': - /* Less verbose error messages */ - + /* + * Support for integrated development environment(s). + * + * 1) No compiler signon + * 2) Send stderr messages to stdout + * 3) Less verbose error messages (single line only for each) + * 4) Error/warning messages are formatted appropriately to + * be recognized by MS Visual Studio + */ Gbl_VerboseErrors = FALSE; + Gbl_DoSignon = FALSE; + Gbl_Files[ASL_FILE_STDERR].Handle = stdout; break; case 'o': Modified: head/sys/contrib/dev/acpica/compiler/aslmap.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmap.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslmap.c Thu May 24 23:12:30 2012 (r235945) @@ -367,6 +367,7 @@ const ASL_MAPPING_ENTRY AslKeywordMa /* REGIONSPACE_IO */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SYSTEM_IO, 0, 0), /* REGIONSPACE_IPMI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_IPMI, 0, 0), /* REGIONSPACE_MEM */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SYSTEM_MEMORY, 0, 0), +/* REGIONSPACE_PCC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PLATFORM_COMM, 0, 0), /* REGIONSPACE_PCI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_CONFIG, 0, 0), /* REGIONSPACE_PCIBAR */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_BAR_TARGET, 0, 0), /* REGIONSPACE_SMBUS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SMBUS, 0, 0), Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Thu May 24 23:12:30 2012 (r235945) @@ -402,7 +402,7 @@ char *AslMessages }; -char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = { +const char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = { "Warning ", "Warning ", "Warning ", @@ -411,6 +411,15 @@ char *AslErrorLevel [ "Optimize" }; +const char *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = { + "warning ", + "warning ", + "warning ", + "error ", + "remark ", + "optimize" +}; + #define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */ #endif /* ASL_EXCEPTIONS */ Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Thu May 24 23:12:30 2012 (r235945) @@ -227,7 +227,7 @@ AslDetectSourceFileType ( /* Check for 100% ASCII source file (comments are ignored) */ - Status = FlCheckForAscii (Info); + Status = FlCheckForAscii (Info->Handle, Info->Filename, TRUE); if (ACPI_FAILURE (Status)) { printf ("Non-ascii input file - %s\n", Info->Filename); Modified: head/sys/contrib/dev/acpica/compiler/dtio.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtio.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/dtio.c Thu May 24 23:12:30 2012 (r235945) @@ -427,7 +427,6 @@ DtGetNextLine ( { case DT_START_QUOTED_STRING: case DT_SLASH_ASTERISK_COMMENT: - case DT_SLASH_SLASH_COMMENT: AcpiOsPrintf ("**** EOF within comment/string %u\n", State); break; @@ -436,7 +435,22 @@ DtGetNextLine ( break; } - return (ASL_EOF); + /* Standalone EOF is OK */ + + if (i == 0) + { + return (ASL_EOF); + } + + /* + * Received an EOF in the middle of a line. Terminate the + * line with a newline. The next call to this function will + * return a standalone EOF. Thus, the upper parsing software + * never has to deal with an EOF within a valid line (or + * the last line does not get tossed on the floor.) + */ + c = '\n'; + State = DT_NORMAL_TEXT; } switch (State) Modified: head/sys/contrib/dev/acpica/compiler/prscan.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/prscan.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/prscan.c Thu May 24 23:12:30 2012 (r235945) @@ -654,7 +654,7 @@ PrDoDirective ( } DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID - "Start #include file %s\n", Gbl_CurrentLineNumber, + "Start #include file \"%s\"\n", Gbl_CurrentLineNumber, Token, Gbl_CurrentLineNumber); PrOpenIncludeFile (Token); Modified: head/sys/contrib/dev/acpica/compiler/prutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/prutils.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/prutils.c Thu May 24 23:12:30 2012 (r235945) @@ -246,13 +246,11 @@ PrOpenIncludeFile ( ASL_INCLUDE_DIR *NextDir; - /* - * start the actual include file on the next line - */ + /* Start the actual include file on the next line */ + Gbl_CurrentLineOffset++; /* Attempt to open the include file */ - /* If the file specifies an absolute path, just open it */ if ((Filename[0] == '/') || @@ -330,13 +328,10 @@ PrOpenIncludeWithPrefix ( /* Build the full pathname to the file */ - Pathname = ACPI_ALLOCATE (strlen (PrefixDir) + strlen (Filename) + 1); + Pathname = FlMergePathnames (PrefixDir, Filename); - strcpy (Pathname, PrefixDir); - strcat (Pathname, Filename); - - DbgPrint (ASL_PARSE_OUTPUT, "\n" PR_PREFIX_ID - "Opening include file: path %s\n", + DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID + "Include: Opening file - \"%s\"\n", Gbl_CurrentLineNumber, Pathname); /* Attempt to open the file, push if successful */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbfileio.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/components/debugger/dbfileio.c Thu May 24 23:12:30 2012 (r235945) @@ -51,6 +51,10 @@ #include #endif +#ifdef ACPI_ASL_COMPILER +#include +#endif + #if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER) #define _COMPONENT ACPI_CA_DEBUGGER @@ -309,6 +313,15 @@ AcpiDbReadTable ( AcpiOsPrintf ( "TableHeader length [0x%X] greater than the input file size [0x%X]\n", TableHeader.Length, FileSize); + +#ifdef ACPI_ASL_COMPILER + Status = FlCheckForAscii (fp, NULL, FALSE); + if (ACPI_SUCCESS (Status)) + { + AcpiOsPrintf ("File appears to be ASCII only, must be binary\n", + TableHeader.Length, FileSize); + } +#endif return (AE_BAD_HEADER); } Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Thu May 24 23:12:30 2012 (r235945) @@ -57,6 +57,18 @@ /* Local prototypes */ +#ifdef ACPI_ASL_COMPILER +#include + +static ACPI_STATUS +AcpiDsCreateExternalRegion ( + ACPI_STATUS LookupStatus, + ACPI_PARSE_OBJECT *Op, + char *Path, + ACPI_WALK_STATE *WalkState, + ACPI_NAMESPACE_NODE **Node); +#endif + static ACPI_STATUS AcpiDsGetFieldNames ( ACPI_CREATE_FIELD_INFO *Info, @@ -64,6 +76,69 @@ AcpiDsGetFieldNames ( ACPI_PARSE_OBJECT *Arg); +#ifdef ACPI_ASL_COMPILER +/******************************************************************************* + * + * FUNCTION: AcpiDsCreateExternalRegion (iASL Disassembler only) + * + * PARAMETERS: LookupStatus - Status from NsLookup operation + * Op - Op containing the Field definition and args + * Path - Pathname of the region + * ` WalkState - Current method state + * Node - Where the new region node is returned + * + * RETURN: Status + * + * DESCRIPTION: Add region to the external list if NOT_FOUND. Create a new + * region node/object. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDsCreateExternalRegion ( + ACPI_STATUS LookupStatus, + ACPI_PARSE_OBJECT *Op, + char *Path, + ACPI_WALK_STATE *WalkState, + ACPI_NAMESPACE_NODE **Node) +{ + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *ObjDesc; + + + if (LookupStatus != AE_NOT_FOUND) + { + return (LookupStatus); + } + + /* + * Table disassembly: + * OperationRegion not found. Generate an External for it, and + * insert the name into the namespace. + */ + AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_REGION, 0); + Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION, + ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Must create and install a region object for the new node */ + + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); + if (!ObjDesc) + { + return (AE_NO_MEMORY); + } + + ObjDesc->Region.Node = *Node; + Status = AcpiNsAttachObject (*Node, ObjDesc, ACPI_TYPE_REGION); + return (Status); +} +#endif + + /******************************************************************************* * * FUNCTION: AcpiDsCreateBufferField @@ -438,11 +513,16 @@ AcpiDsCreateField ( /* First arg is the name of the parent OpRegion (must already exist) */ Arg = Op->Common.Value.Arg; + if (!RegionNode) { Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name, ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode); +#ifdef ACPI_ASL_COMPILER + Status = AcpiDsCreateExternalRegion (Status, Arg, + Arg->Common.Value.Name, WalkState, &RegionNode); +#endif if (ACPI_FAILURE (Status)) { ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); @@ -628,6 +708,10 @@ AcpiDsCreateBankField ( Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name, ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode); +#ifdef ACPI_ASL_COMPILER + Status = AcpiDsCreateExternalRegion (Status, Arg, + Arg->Common.Value.Name, WalkState, &RegionNode); +#endif if (ACPI_FAILURE (Status)) { ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); Modified: head/sys/contrib/dev/acpica/components/events/evxface.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evxface.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/components/events/evxface.c Thu May 24 23:12:30 2012 (r235945) @@ -280,11 +280,9 @@ AcpiRemoveNotifyHandler ( return_ACPI_STATUS (AE_BAD_PARAMETER); } -#ifdef _UNDER_DEVELOPMENT - /* Make sure all deferred tasks are completed */ + /* Make sure all deferred notify tasks are completed */ - AcpiOsWaitEventsComplete (NULL); -#endif + AcpiOsWaitEventsComplete (); Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) @@ -802,6 +800,10 @@ AcpiRemoveGpeHandler ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* Make sure all deferred GPE tasks are completed */ + + AcpiOsWaitEventsComplete (); + Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); if (ACPI_FAILURE (Status)) { Modified: head/sys/contrib/dev/acpica/components/tables/tbfadt.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbfadt.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/components/tables/tbfadt.c Thu May 24 23:12:30 2012 (r235945) @@ -52,12 +52,13 @@ /* Local prototypes */ -static ACPI_INLINE void +static void AcpiTbInitGenericAddress ( ACPI_GENERIC_ADDRESS *GenericAddress, UINT8 SpaceId, UINT8 ByteWidth, - UINT64 Address); + UINT64 Address, + char *RegisterName); static void AcpiTbConvertFadt ( @@ -202,13 +203,30 @@ static ACPI_FADT_PM_INFO FadtPmInfoTa *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 24 23:46:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED497106566B; Thu, 24 May 2012 23:46:17 +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 D92A68FC15; Thu, 24 May 2012 23:46: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 q4ONkHaj067474; Thu, 24 May 2012 23:46:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ONkHDi067472; Thu, 24 May 2012 23:46:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205242346.q4ONkHDi067472@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 23:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235946 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 23:46:18 -0000 Author: bz Date: Thu May 24 23:46:17 2012 New Revision: 235946 URL: http://svn.freebsd.org/changeset/base/235946 Log: Add a missing " to get closer to compiling. Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Thu May 24 23:12:30 2012 (r235945) +++ head/sys/powerpc/include/atomic.h Thu May 24 23:46:17 2012 (r235946) @@ -56,7 +56,7 @@ #else #define mb() __asm __volatile("sync" : : : "memory") #define rmb() __asm __volatile("sync" : : : "memory") -#define wmb() __asm __volatile("sync : : : "memory") +#define wmb() __asm __volatile("sync" : : : "memory") #define __ATOMIC_REL() __asm __volatile("sync" : : : "memory") #define __ATOMIC_ACQ() __asm __volatile("isync" : : : "memory") #endif From owner-svn-src-all@FreeBSD.ORG Thu May 24 23:55:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E16C81065670; Thu, 24 May 2012 23:55:08 +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 C29B38FC0A; Thu, 24 May 2012 23:55: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 q4ONt8Hd067866; Thu, 24 May 2012 23:55:08 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ONt8JJ067857; Thu, 24 May 2012 23:55:08 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205242355.q4ONt8JJ067857@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 23:55: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: r235947 - in stable/8: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/wbwd sys/i386/conf sys/modules sys/modules/wbwd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 23:55:09 -0000 Author: bz Date: Thu May 24 23:55:08 2012 New Revision: 235947 URL: http://svn.freebsd.org/changeset/base/235947 Log: MFC r232614: Provide wbwd(4), a driver for the watchdog timer found on various Winbond Super I/O chips. Added: stable/8/share/man/man4/wbwd.4 - copied unchanged from r232614, head/share/man/man4/wbwd.4 stable/8/sys/dev/wbwd/ - copied from r232614, head/sys/dev/wbwd/ stable/8/sys/modules/wbwd/ - copied from r232614, head/sys/modules/wbwd/ Modified: stable/8/sys/amd64/conf/GENERIC.hints stable/8/sys/amd64/conf/NOTES stable/8/sys/boot/forth/loader.conf stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/i386/conf/GENERIC.hints stable/8/sys/i386/conf/NOTES stable/8/sys/modules/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Copied: stable/8/share/man/man4/wbwd.4 (from r232614, head/share/man/man4/wbwd.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/wbwd.4 Thu May 24 23:55:08 2012 (r235947, copy of r232614, head/share/man/man4/wbwd.4) @@ -0,0 +1,117 @@ +.\"- +.\" Copyright (c) 2012 Bjoern A. Zeeb +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 6, 2012 +.Dt wbwd 4 +.Os +.Sh NAME +.Nm wbwd +.Nd device driver for watchdog timer found on Winbond Super I/O chips +.Sh SYNOPSIS +To compile this driver into the kernel, place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device wbwd" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the following +line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +wbwd_load="YES" +.Ed +.Pp +In +.Pa /boot/device.hints : +.Cd hint.wbwd.0.at="isa" +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr watchdog 4 +support for the watchdog interrupt timer present on at least the following +Winbond Super I/O chips: +.Pp +.Bl -bullet -compact +.It +83627HF/F/HG/G Rev. G +.It +83627HF/F/HG/G Rev. J +.It +83627HF/F/HG/G Rev. UD-A +.It +83627DHG IC ver. 5 +.El +.Sh SYSCTL VARIABLES +The +.Nm +driver provides the following options as +.Xr sysctl 8 +variables. +.Bl -tag -width "xxxxxx" +.It Va dev.wbwd.0.timeout_override +This variable allows to program the timer to a value independent on the one +provided by the +.Xr watchdog 4 +framework while still relying on the regular updates from e.g. +.Xr watchdogd 8 . +This is particularly useful if your system provides multiple watchdogs and +you want them to fire in a special sequence to trigger an NMI after a shorter +period than the reset timeout for example. +The value set must not be lower than the sleep time of +.Xr watchdogd 8 . +A value of 0 disables this feature and the timeout value provided by +.Xr watchdog 4 +will be used. +.It Va dev.wbwd.0.debug_verbose +If set this sysctl will tell the driver to log its current state before and +after the timer reset on each invocation from +.Xr watchdog 9 +to the kernel message buffer for debugging. +.It Va dev.wbwd.0.debug +This read-only value gives the state of some registers on last update. +.El +.Pp +The +.Nm +driver also provides further sysctl options that are hidden by default. +See the source code for more information. +.Sh SEE ALSO +.Xr watchdog 4 , +.Xr device.hints 5 , +.Xr watchdog 8 , +.Xr watchdogd 8 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Bjoern A. Zeeb Aq bz@FreeBSD.org . Modified: stable/8/sys/amd64/conf/GENERIC.hints ============================================================================== --- stable/8/sys/amd64/conf/GENERIC.hints Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/amd64/conf/GENERIC.hints Thu May 24 23:55:08 2012 (r235947) @@ -27,3 +27,4 @@ hint.ppc.0.irq="7" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" +hint.wbwd.0.at="isa" Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/amd64/conf/NOTES Thu May 24 23:55:08 2012 (r235947) @@ -465,10 +465,12 @@ device tpm # # ichwd: Intel ICH watchdog timer # amdsbwd: AMD SB7xx watchdog timer +# wbwd: Winbond watchdog timer # device ichwd device amdsbwd device viawd +device wbwd # # Temperature sensors: Modified: stable/8/sys/boot/forth/loader.conf ============================================================================== --- stable/8/sys/boot/forth/loader.conf Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/boot/forth/loader.conf Thu May 24 23:55:08 2012 (r235947) @@ -477,6 +477,7 @@ vpd_load="NO" # Vital Product Data ker vpo_load="NO" # Parallel to SCSI interface driver amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor tpm_load="NO" # Trusted Platform Module +wbwd_load="NO" # Winbond watchdog ############################################################## ### ACPI settings ########################################## Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/conf/files.amd64 Thu May 24 23:55:08 2012 (r235947) @@ -239,6 +239,7 @@ dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_amd64.c optional uart dev/viawd/viawd.c optional viawd +dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi dev/isci/isci.c optional isci dev/isci/isci_controller.c optional isci Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/conf/files.i386 Thu May 24 23:55:08 2012 (r235947) @@ -246,6 +246,7 @@ dev/uart/uart_cpu_i386.c optional uart dev/viawd/viawd.c optional viawd dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard +dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi dev/isci/isci.c optional isci dev/isci/isci_controller.c optional isci Modified: stable/8/sys/i386/conf/GENERIC.hints ============================================================================== --- stable/8/sys/i386/conf/GENERIC.hints Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/i386/conf/GENERIC.hints Thu May 24 23:55:08 2012 (r235947) @@ -35,3 +35,4 @@ hint.ppc.0.irq="7" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" +hint.wbwd.0.at="isa" Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/i386/conf/NOTES Thu May 24 23:55:08 2012 (r235947) @@ -850,10 +850,12 @@ hint.pcf.0.irq="5" # # ichwd: Intel ICH watchdog timer # amdsbwd: AMD SB7xx watchdog timer +# wbwd: Winbond watchdog timer # device ichwd device amdsbwd device viawd +device wbwd # # Temperature sensors: Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Thu May 24 23:46:17 2012 (r235946) +++ stable/8/sys/modules/Makefile Thu May 24 23:55:08 2012 (r235947) @@ -316,6 +316,7 @@ SUBDIR= ${_3dfx} \ vte \ vx \ wb \ + ${_wbwd} \ ${_wi} \ wlan \ wlan_acl \ @@ -460,6 +461,7 @@ _stg= stg _streams= streams _svr4= svr4 _tmpfs= tmpfs +_wbwd= wbwd _wi= wi _xe= xe .if ${MK_ZFS} != "no" || defined(ALL_MODULES) @@ -613,6 +615,7 @@ _twa= twa _vesa= vesa _viawd= viawd _x86bios= x86bios +_wbwd= wbwd _wi= wi _wpi= wpi _wpifw= wpifw From owner-svn-src-all@FreeBSD.ORG Fri May 25 00:04:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06B74106566B; Fri, 25 May 2012 00:04:57 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id C02738FC18; Fri, 25 May 2012 00:04:51 +0000 (UTC) Received: from marcelm-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q4P04c1g075837 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 24 May 2012 17:04:44 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4FBEBA30.6050901@freebsd.org> Date: Thu, 24 May 2012 17:04:33 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> <4FBEB2F3.4060405@freebsd.org> <358A54BA-6B8E-4685-8CDD-CCAC305ACA2B@xcllnt.net> <4FBEBA30.6050901@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 00:04:57 -0000 On May 24, 2012, at 3:46 PM, Nathan Whitehorn wrote: > On 05/24/12 17:22, Marcel Moolenaar wrote: >>=20 >> On May 24, 2012, at 3:15 PM, Nathan Whitehorn wrote: >>=20 >>>>> Summary: >>>>> 1. *mb() must be lwsync or sync on all machines, except for wmb() = which could be eieio >>>>> 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync = with bus_space changes) >>>>> 3. __ATOMIC_REL() must be lwsync or sync >>>>=20 >>>> This is absolutely not what I concluded from our discussions. I = have no idea >>>> how we could end up so out of sync... >>>>=20 >>>=20 >>> Thanks for the quick change. No idea how we got out of sync. I find = all of this synchronization stuff a little mind-bending, so sorry for = any miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, = so I've fixed that up. Things should be good now. >>=20 >> Ok. I didn't change wmb() to eieio as I wanted to avoid a pendulum = effect. >> I'll reread our emails and make sure wmb() is what we think it is and = if >> so I'll do a followup commit. >> FYI, >>=20 >=20 > I don't think it really makes a difference. Basically nothing uses = wmb(), and those things that do mostly use it wrong and need sync. So it = should probably stay as [lw]sync. Works for me. Thanks! --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Fri May 25 00:18:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3AD02106566B; Fri, 25 May 2012 00:18:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2631D8FC14; Fri, 25 May 2012 00:18:20 +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 q4P0IKAZ068913; Fri, 25 May 2012 00:18:20 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P0IJeJ068911; Fri, 25 May 2012 00:18:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201205250018.q4P0IJeJ068911@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 25 May 2012 00:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235948 - head/usr.sbin/acpi/acpidump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 00:18:20 -0000 Author: jkim Date: Fri May 25 00:18:19 2012 New Revision: 235948 URL: http://svn.freebsd.org/changeset/base/235948 Log: Catch up with realpath(3) changes (r235266) and unbreak acpidump(8). Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Thu May 24 23:55:08 2012 (r235947) +++ head/usr.sbin/acpi/acpidump/acpi.c Fri May 25 00:18:19 2012 (r235948) @@ -1196,13 +1196,13 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt, if (tmpdir == NULL) tmpdir = _PATH_TMP; strncpy(tmpstr, tmpdir, sizeof(tmpstr)); - strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(tmpdir)); if (realpath(tmpstr, buf) == NULL) { - perror("realpath tmp file"); + perror("realpath tmp dir"); return; } strncpy(tmpstr, buf, sizeof(tmpstr)); - len = strlen(buf); + strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(buf)); + len = strlen(tmpstr); tmpext = tmpstr + len; strncpy(tmpext, "XXXXXX", sizeof(tmpstr) - len); fd = mkstemp(tmpstr); From owner-svn-src-all@FreeBSD.ORG Fri May 25 00:38:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0BC1D106566C; Fri, 25 May 2012 00:38:07 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EADBD8FC0A; Fri, 25 May 2012 00:38: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 q4P0c63E069706; Fri, 25 May 2012 00:38:06 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P0c62j069704; Fri, 25 May 2012 00:38:06 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201205250038.q4P0c62j069704@svn.freebsd.org> From: Jamie Gritton Date: Fri, 25 May 2012 00:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235949 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 00:38:07 -0000 Author: jamie Date: Fri May 25 00:38:06 2012 New Revision: 235949 URL: http://svn.freebsd.org/changeset/base/235949 Log: Don't try to set a null TERM environment. Submitted by: Mateusz Guzik Modified: head/usr.sbin/jail/command.c Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Fri May 25 00:18:19 2012 (r235948) +++ head/usr.sbin/jail/command.c Fri May 25 00:38:06 2012 (r235949) @@ -584,7 +584,8 @@ run_command(struct cfjail *j) term = getenv("TERM"); environ = &cleanenv; setenv("PATH", "/bin:/usr/bin", 0); - setenv("TERM", term, 1); + if (term != NULL) + setenv("TERM", term, 1); } if (setusercontext(lcap, pwd, pwd->pw_uid, username ? LOGIN_SETALL & ~LOGIN_SETGROUP & ~LOGIN_SETLOGIN From owner-svn-src-all@FreeBSD.ORG Fri May 25 01:13:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAEE31065680; Fri, 25 May 2012 01:13:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 960F48FC16; Fri, 25 May 2012 01:13:39 +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 q4P1Dd5B071211; Fri, 25 May 2012 01:13:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1DdI9071209; Fri, 25 May 2012 01:13:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250113.q4P1DdI9071209@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 01:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235950 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:13:39 -0000 Author: bz Date: Fri May 25 01:13:39 2012 New Revision: 235950 URL: http://svn.freebsd.org/changeset/base/235950 Log: MFp4 bz_ipv6_fast: Factor out the tcp_hc_getmtu() call. As the comments say it applies to both v4 and v6, so only write it once making it easier to read the protocol family specifc code. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri May 25 00:38:06 2012 (r235949) +++ head/sys/netinet/tcp_input.c Fri May 25 01:13:39 2012 (r235950) @@ -3542,7 +3542,6 @@ tcp_mssopt(struct in_conninfo *inc) if (inc->inc_flags & INC_ISIPV6) { mss = V_tcp_v6mssdflt; maxmtu = tcp_maxmtu6(inc, NULL); - thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ min_protoh = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); } #endif @@ -3553,10 +3552,13 @@ tcp_mssopt(struct in_conninfo *inc) { mss = V_tcp_mssdflt; maxmtu = tcp_maxmtu(inc, NULL); - thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ min_protoh = sizeof(struct tcpiphdr); } #endif +#if defined(INET6) || defined(INET) + thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ +#endif + if (maxmtu && thcmtu) mss = min(maxmtu, thcmtu) - min_protoh; else if (maxmtu || thcmtu) From owner-svn-src-all@FreeBSD.ORG Fri May 25 01:19:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33255106566C; Fri, 25 May 2012 01:19:29 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184A88FC19; Fri, 25 May 2012 01:19: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 q4P1JTfZ071490; Fri, 25 May 2012 01:19:29 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1JSP5071477; Fri, 25 May 2012 01:19:28 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201205250119.q4P1JSP5071477@svn.freebsd.org> From: Martin Matuska Date: Fri, 25 May 2012 01:19: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: r235951 - in stable/9: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/comm... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:19:29 -0000 Author: mm Date: Fri May 25 01:19:28 2012 New Revision: 235951 URL: http://svn.freebsd.org/changeset/base/235951 Log: MFC r235222: Import illumos changeset 13686:4bc0783f6064 2703 add mechanism to report ZFS send progress If the zfs send command is used with the -v flag, the amount of bytes transmitted is reported in per second updates. References: https://www.illumos.org/issues/2703 Obtained from: illumos (issue #2703) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri May 25 01:13:39 2012 (r235950) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri May 25 01:19:28 2012 (r235951) @@ -20,6 +20,7 @@ .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright (c) 2012 by Delphix. All rights reserved. .\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved. +.\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" .\" $FreeBSD$ @@ -2272,6 +2273,7 @@ flags to determine what data will be sen Print machine-parsable verbose information about the stream package generated. .It Fl v Print verbose information about the stream package generated. +This information includes a per-second report of how much data has been sent. .El .Pp The format of the stream is committed. You will be able to receive your streams Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri May 25 01:13:39 2012 (r235950) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri May 25 01:19:28 2012 (r235951) @@ -24,6 +24,7 @@ * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. @@ -3579,6 +3580,7 @@ zfs_do_send(int argc, char **argv) if (flags.verbose) extraverbose = B_TRUE; flags.verbose = B_TRUE; + flags.progress = B_TRUE; break; case 'D': flags.dedup = B_TRUE; Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri May 25 01:13:39 2012 (r235950) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri May 25 01:19:28 2012 (r235951) @@ -25,7 +25,7 @@ * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. - * All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. */ @@ -573,6 +573,9 @@ typedef struct sendflags { /* parsable verbose output (ie. -P) */ boolean_t parsable; + + /* show progress (ie. -v) */ + boolean_t progress; } sendflags_t; typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri May 25 01:13:39 2012 (r235950) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri May 25 01:19:28 2012 (r235951) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. */ @@ -40,6 +41,7 @@ #include #include #include +#include #include @@ -67,6 +69,12 @@ typedef struct dedup_arg { libzfs_handle_t *dedup_hdl; } dedup_arg_t; +typedef struct progress_arg { + zfs_handle_t *pa_zhp; + int pa_fd; + boolean_t pa_parsable; +} progress_arg_t; + typedef struct dataref { uint64_t ref_guid; uint64_t ref_object; @@ -786,7 +794,7 @@ typedef struct send_dump_data { char prevsnap[ZFS_MAXNAMELEN]; uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; - boolean_t verbose, dryrun, parsable; + boolean_t verbose, dryrun, parsable, progress; int outfd; boolean_t err; nvlist_t *fss; @@ -979,10 +987,60 @@ hold_for_send(zfs_handle_t *zhp, send_du return (error); } +static void * +send_progress_thread(void *arg) +{ + progress_arg_t *pa = arg; + + zfs_cmd_t zc = { 0 }; + zfs_handle_t *zhp = pa->pa_zhp; + libzfs_handle_t *hdl = zhp->zfs_hdl; + unsigned long long bytes; + char buf[16]; + + time_t t; + struct tm *tm; + + assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); + (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); + + if (!pa->pa_parsable) + (void) fprintf(stderr, "TIME SENT SNAPSHOT\n"); + + /* + * Print the progress from ZFS_IOC_SEND_PROGRESS every second. + */ + for (;;) { + (void) sleep(1); + + zc.zc_cookie = pa->pa_fd; + if (zfs_ioctl(hdl, ZFS_IOC_SEND_PROGRESS, &zc) != 0) + return ((void *)-1); + + (void) time(&t); + tm = localtime(&t); + bytes = zc.zc_cookie; + + if (pa->pa_parsable) { + (void) fprintf(stderr, "%02d:%02d:%02d\t%llu\t%s\n", + tm->tm_hour, tm->tm_min, tm->tm_sec, + bytes, zhp->zfs_name); + } else { + zfs_nicenum(bytes, buf, sizeof (buf)); + (void) fprintf(stderr, "%02d:%02d:%02d %5s %s\n", + tm->tm_hour, tm->tm_min, tm->tm_sec, + buf, zhp->zfs_name); + } + } +} + static int dump_snapshot(zfs_handle_t *zhp, void *arg) { send_dump_data_t *sdd = arg; + progress_arg_t pa = { 0 }; + pthread_t tid; + char *thissnap; int err; boolean_t isfromsnap, istosnap, fromorigin; @@ -1100,8 +1158,29 @@ dump_snapshot(zfs_handle_t *zhp, void *a } if (!sdd->dryrun) { + /* + * If progress reporting is requested, spawn a new thread to + * poll ZFS_IOC_SEND_PROGRESS at a regular interval. + */ + if (sdd->progress) { + pa.pa_zhp = zhp; + pa.pa_fd = sdd->outfd; + pa.pa_parsable = sdd->parsable; + + if (err = pthread_create(&tid, NULL, + send_progress_thread, &pa)) { + zfs_close(zhp); + return (err); + } + } + err = dump_ioctl(zhp, sdd->prevsnap, sdd->prevsnap_obj, fromorigin, sdd->outfd, sdd->debugnv); + + if (sdd->progress) { + (void) pthread_cancel(tid); + (void) pthread_join(tid, NULL); + } } (void) strcpy(sdd->prevsnap, thissnap); @@ -1451,12 +1530,13 @@ zfs_send(zfs_handle_t *zhp, const char * sdd.fsavl = fsavl; sdd.verbose = flags->verbose; sdd.parsable = flags->parsable; + sdd.progress = flags->progress; sdd.dryrun = flags->dryrun; sdd.filter_cb = filter_func; sdd.filter_cb_arg = cb_arg; if (debugnvp) sdd.debugnv = *debugnvp; - if (holdsnaps) { + if (holdsnaps || flags->progress) { ++holdseq; (void) snprintf(sdd.holdtag, sizeof (sdd.holdtag), ".send-%d-%llu", getpid(), (u_longlong_t)holdseq); Modified: stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri May 25 01:13:39 2012 (r235950) +++ stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri May 25 01:19:28 2012 (r235951) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #ifndef _SYS_ZFS_CONTEXT_H @@ -228,6 +229,7 @@ struct proc { }; extern struct proc p0; +#define curproc (&p0) #define PS_NONE -1 Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri May 25 01:13:39 2012 (r235950) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri May 25 01:19:28 2012 (r235951) @@ -25,6 +25,8 @@ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2012, Martin Matuska . All rights reserved. */ #include @@ -54,38 +56,15 @@ int zfs_send_corrupt_data = B_FALSE; static char *dmu_recv_tag = "dmu_recv_tag"; -/* - * The list of data whose inclusion in a send stream can be pending from - * one call to backup_cb to another. Multiple calls to dump_free() and - * dump_freeobjects() can be aggregated into a single DRR_FREE or - * DRR_FREEOBJECTS replay record. - */ -typedef enum { - PENDING_NONE, - PENDING_FREE, - PENDING_FREEOBJECTS -} pendop_t; - -struct backuparg { - dmu_replay_record_t *drr; - kthread_t *td; - struct file *fp; - offset_t *off; - objset_t *os; - zio_cksum_t zc; - uint64_t toguid; - int err; - pendop_t pending_op; -}; - static int -dump_bytes(struct backuparg *ba, void *buf, int len) +dump_bytes(dmu_sendarg_t *dsp, void *buf, int len) { + dsl_dataset_t *ds = dsp->dsa_os->os_dsl_dataset; struct uio auio; struct iovec aiov; ASSERT3U(len % 8, ==, 0); - fletcher_4_incremental_native(buf, len, &ba->zc); + fletcher_4_incremental_native(buf, len, &dsp->dsa_zc); aiov.iov_base = buf; aiov.iov_len = len; auio.uio_iov = &aiov; @@ -94,24 +73,28 @@ dump_bytes(struct backuparg *ba, void *b auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; auio.uio_offset = (off_t)-1; - auio.uio_td = ba->td; + auio.uio_td = dsp->dsa_td; #ifdef _KERNEL - if (ba->fp->f_type == DTYPE_VNODE) + if (dsp->dsa_fp->f_type == DTYPE_VNODE) bwillwrite(); - ba->err = fo_write(ba->fp, &auio, ba->td->td_ucred, 0, ba->td); + dsp->dsa_err = fo_write(dsp->dsa_fp, &auio, dsp->dsa_td->td_ucred, 0, + dsp->dsa_td); #else fprintf(stderr, "%s: returning EOPNOTSUPP\n", __func__); - ba->err = EOPNOTSUPP; + dsp->dsa_err = EOPNOTSUPP; #endif - *ba->off += len; - return (ba->err); + mutex_enter(&ds->ds_sendstream_lock); + *dsp->dsa_off += len; + mutex_exit(&ds->ds_sendstream_lock); + + return (dsp->dsa_err); } static int -dump_free(struct backuparg *ba, uint64_t object, uint64_t offset, +dump_free(dmu_sendarg_t *dsp, uint64_t object, uint64_t offset, uint64_t length) { - struct drr_free *drrf = &(ba->drr->drr_u.drr_free); + struct drr_free *drrf = &(dsp->dsa_drr->drr_u.drr_free); /* * If there is a pending op, but it's not PENDING_FREE, push it out, @@ -120,13 +103,15 @@ dump_free(struct backuparg *ba, uint64_t * other DRR_FREE records. DRR_FREEOBJECTS records can only be * aggregated with other DRR_FREEOBJECTS records. */ - if (ba->pending_op != PENDING_NONE && ba->pending_op != PENDING_FREE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE && + dsp->dsa_pending_op != PENDING_FREE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } - if (ba->pending_op == PENDING_FREE) { + if (dsp->dsa_pending_op == PENDING_FREE) { /* * There should never be a PENDING_FREE if length is -1 * (because dump_dnode is the only place where this @@ -144,34 +129,35 @@ dump_free(struct backuparg *ba, uint64_t return (0); } else { /* not a continuation. Push out pending record */ - if (dump_bytes(ba, ba->drr, + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } } /* create a FREE record and make it pending */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_FREE; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_FREE; drrf->drr_object = object; drrf->drr_offset = offset; drrf->drr_length = length; - drrf->drr_toguid = ba->toguid; + drrf->drr_toguid = dsp->dsa_toguid; if (length == -1ULL) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); } else { - ba->pending_op = PENDING_FREE; + dsp->dsa_pending_op = PENDING_FREE; } return (0); } static int -dump_data(struct backuparg *ba, dmu_object_type_t type, +dump_data(dmu_sendarg_t *dsp, dmu_object_type_t type, uint64_t object, uint64_t offset, int blksz, const blkptr_t *bp, void *data) { - struct drr_write *drrw = &(ba->drr->drr_u.drr_write); + struct drr_write *drrw = &(dsp->dsa_drr->drr_u.drr_write); /* @@ -180,19 +166,20 @@ dump_data(struct backuparg *ba, dmu_obje * the stream, since aggregation can't be done across operations * of different types. */ - if (ba->pending_op != PENDING_NONE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } /* write a DATA record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_WRITE; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_WRITE; drrw->drr_object = object; drrw->drr_type = type; drrw->drr_offset = offset; drrw->drr_length = blksz; - drrw->drr_toguid = ba->toguid; + drrw->drr_toguid = dsp->dsa_toguid; drrw->drr_checksumtype = BP_GET_CHECKSUM(bp); if (zio_checksum_table[drrw->drr_checksumtype].ci_dedup) drrw->drr_checksumflags |= DRR_CHECKSUM_DEDUP; @@ -201,42 +188,43 @@ dump_data(struct backuparg *ba, dmu_obje DDK_SET_COMPRESS(&drrw->drr_key, BP_GET_COMPRESS(bp)); drrw->drr_key.ddk_cksum = bp->blk_cksum; - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - if (dump_bytes(ba, data, blksz) != 0) + if (dump_bytes(dsp, data, blksz) != 0) return (EINTR); return (0); } static int -dump_spill(struct backuparg *ba, uint64_t object, int blksz, void *data) +dump_spill(dmu_sendarg_t *dsp, uint64_t object, int blksz, void *data) { - struct drr_spill *drrs = &(ba->drr->drr_u.drr_spill); + struct drr_spill *drrs = &(dsp->dsa_drr->drr_u.drr_spill); - if (ba->pending_op != PENDING_NONE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } /* write a SPILL record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_SPILL; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_SPILL; drrs->drr_object = object; drrs->drr_length = blksz; - drrs->drr_toguid = ba->toguid; + drrs->drr_toguid = dsp->dsa_toguid; - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t))) + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t))) return (EINTR); - if (dump_bytes(ba, data, blksz)) + if (dump_bytes(dsp, data, blksz)) return (EINTR); return (0); } static int -dump_freeobjects(struct backuparg *ba, uint64_t firstobj, uint64_t numobjs) +dump_freeobjects(dmu_sendarg_t *dsp, uint64_t firstobj, uint64_t numobjs) { - struct drr_freeobjects *drrfo = &(ba->drr->drr_u.drr_freeobjects); + struct drr_freeobjects *drrfo = &(dsp->dsa_drr->drr_u.drr_freeobjects); /* * If there is a pending op, but it's not PENDING_FREEOBJECTS, @@ -245,13 +233,14 @@ dump_freeobjects(struct backuparg *ba, u * aggregated with other DRR_FREE records. DRR_FREEOBJECTS records * can only be aggregated with other DRR_FREEOBJECTS records. */ - if (ba->pending_op != PENDING_NONE && - ba->pending_op != PENDING_FREEOBJECTS) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE && + dsp->dsa_pending_op != PENDING_FREEOBJECTS) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } - if (ba->pending_op == PENDING_FREEOBJECTS) { + if (dsp->dsa_pending_op == PENDING_FREEOBJECTS) { /* * See whether this free object array can be aggregated * with pending one @@ -261,42 +250,43 @@ dump_freeobjects(struct backuparg *ba, u return (0); } else { /* can't be aggregated. Push out pending record */ - if (dump_bytes(ba, ba->drr, + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } } /* write a FREEOBJECTS record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_FREEOBJECTS; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_FREEOBJECTS; drrfo->drr_firstobj = firstobj; drrfo->drr_numobjs = numobjs; - drrfo->drr_toguid = ba->toguid; + drrfo->drr_toguid = dsp->dsa_toguid; - ba->pending_op = PENDING_FREEOBJECTS; + dsp->dsa_pending_op = PENDING_FREEOBJECTS; return (0); } static int -dump_dnode(struct backuparg *ba, uint64_t object, dnode_phys_t *dnp) +dump_dnode(dmu_sendarg_t *dsp, uint64_t object, dnode_phys_t *dnp) { - struct drr_object *drro = &(ba->drr->drr_u.drr_object); + struct drr_object *drro = &(dsp->dsa_drr->drr_u.drr_object); if (dnp == NULL || dnp->dn_type == DMU_OT_NONE) - return (dump_freeobjects(ba, object, 1)); + return (dump_freeobjects(dsp, object, 1)); - if (ba->pending_op != PENDING_NONE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } /* write an OBJECT record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_OBJECT; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_OBJECT; drro->drr_object = object; drro->drr_type = dnp->dn_type; drro->drr_bonustype = dnp->dn_bonustype; @@ -304,19 +294,19 @@ dump_dnode(struct backuparg *ba, uint64_ drro->drr_bonuslen = dnp->dn_bonuslen; drro->drr_checksumtype = dnp->dn_checksum; drro->drr_compress = dnp->dn_compress; - drro->drr_toguid = ba->toguid; + drro->drr_toguid = dsp->dsa_toguid; - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - if (dump_bytes(ba, DN_BONUS(dnp), P2ROUNDUP(dnp->dn_bonuslen, 8)) != 0) + if (dump_bytes(dsp, DN_BONUS(dnp), P2ROUNDUP(dnp->dn_bonuslen, 8)) != 0) return (EINTR); /* free anything past the end of the file */ - if (dump_free(ba, object, (dnp->dn_maxblkid + 1) * + if (dump_free(dsp, object, (dnp->dn_maxblkid + 1) * (dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT), -1ULL)) return (EINTR); - if (ba->err) + if (dsp->dsa_err) return (EINTR); return (0); } @@ -330,7 +320,7 @@ static int backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { - struct backuparg *ba = arg; + dmu_sendarg_t *dsp = arg; dmu_object_type_t type = bp ? BP_GET_TYPE(bp) : DMU_OT_NONE; int err = 0; @@ -343,10 +333,10 @@ backup_cb(spa_t *spa, zilog_t *zilog, co } else if (bp == NULL && zb->zb_object == DMU_META_DNODE_OBJECT) { uint64_t span = BP_SPAN(dnp, zb->zb_level); uint64_t dnobj = (zb->zb_blkid * span) >> DNODE_SHIFT; - err = dump_freeobjects(ba, dnobj, span >> DNODE_SHIFT); + err = dump_freeobjects(dsp, dnobj, span >> DNODE_SHIFT); } else if (bp == NULL) { uint64_t span = BP_SPAN(dnp, zb->zb_level); - err = dump_free(ba, zb->zb_object, zb->zb_blkid * span, span); + err = dump_free(dsp, zb->zb_object, zb->zb_blkid * span, span); } else if (zb->zb_level > 0 || type == DMU_OT_OBJSET) { return (0); } else if (type == DMU_OT_DNODE) { @@ -365,7 +355,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co for (i = 0; i < blksz >> DNODE_SHIFT; i++) { uint64_t dnobj = (zb->zb_blkid << (DNODE_BLOCK_SHIFT - DNODE_SHIFT)) + i; - err = dump_dnode(ba, dnobj, blk+i); + err = dump_dnode(dsp, dnobj, blk+i); if (err) break; } @@ -380,7 +370,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co ZIO_FLAG_CANFAIL, &aflags, zb) != 0) return (EIO); - err = dump_spill(ba, zb->zb_object, blksz, abuf->b_data); + err = dump_spill(dsp, zb->zb_object, blksz, abuf->b_data); (void) arc_buf_remove_ref(abuf, &abuf); } else { /* it's a level-0 block of a regular object */ uint32_t aflags = ARC_WAIT; @@ -404,7 +394,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co } } - err = dump_data(ba, type, zb->zb_object, zb->zb_blkid * blksz, + err = dump_data(dsp, type, zb->zb_object, zb->zb_blkid * blksz, blksz, bp, abuf->b_data); (void) arc_buf_remove_ref(abuf, &abuf); } @@ -414,13 +404,13 @@ backup_cb(spa_t *spa, zilog_t *zilog, co } int -dmu_sendbackup(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, - struct file *fp, offset_t *off) +dmu_send(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, + int outfd, struct file *fp, offset_t *off) { dsl_dataset_t *ds = tosnap->os_dsl_dataset; dsl_dataset_t *fromds = fromsnap ? fromsnap->os_dsl_dataset : NULL; dmu_replay_record_t *drr; - struct backuparg ba; + dmu_sendarg_t *dsp; int err; uint64_t fromtxg = 0; @@ -461,8 +451,10 @@ dmu_sendbackup(objset_t *tosnap, objset_ #ifdef _KERNEL if (dmu_objset_type(tosnap) == DMU_OST_ZFS) { uint64_t version; - if (zfs_get_zplprop(tosnap, ZFS_PROP_VERSION, &version) != 0) + if (zfs_get_zplprop(tosnap, ZFS_PROP_VERSION, &version) != 0) { + kmem_free(drr, sizeof (dmu_replay_record_t)); return (EINVAL); + } if (version == ZPL_VERSION_SA) { DMU_SET_FEATUREFLAGS( drr->drr_u.drr_begin.drr_versioninfo, @@ -489,47 +481,60 @@ dmu_sendbackup(objset_t *tosnap, objset_ if (fromorigin) dsl_dataset_rele(fromds, FTAG); - ba.drr = drr; - ba.td = curthread; - ba.fp = fp; - ba.os = tosnap; - ba.off = off; - ba.toguid = ds->ds_phys->ds_guid; - ZIO_SET_CHECKSUM(&ba.zc, 0, 0, 0, 0); - ba.pending_op = PENDING_NONE; + dsp = kmem_zalloc(sizeof (dmu_sendarg_t), KM_SLEEP); - if (dump_bytes(&ba, drr, sizeof (dmu_replay_record_t)) != 0) { - kmem_free(drr, sizeof (dmu_replay_record_t)); - return (ba.err); + dsp->dsa_drr = drr; + dsp->dsa_outfd = outfd; + dsp->dsa_proc = curproc; + dsp->dsa_td = curthread; + dsp->dsa_fp = fp; + dsp->dsa_os = tosnap; + dsp->dsa_off = off; + dsp->dsa_toguid = ds->ds_phys->ds_guid; + ZIO_SET_CHECKSUM(&dsp->dsa_zc, 0, 0, 0, 0); + dsp->dsa_pending_op = PENDING_NONE; + + mutex_enter(&ds->ds_sendstream_lock); + list_insert_head(&ds->ds_sendstreams, dsp); + mutex_exit(&ds->ds_sendstream_lock); + + if (dump_bytes(dsp, drr, sizeof (dmu_replay_record_t)) != 0) { + err = dsp->dsa_err; + goto out; } err = traverse_dataset(ds, fromtxg, TRAVERSE_PRE | TRAVERSE_PREFETCH, - backup_cb, &ba); + backup_cb, dsp); - if (ba.pending_op != PENDING_NONE) - if (dump_bytes(&ba, drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) + if (dump_bytes(dsp, drr, sizeof (dmu_replay_record_t)) != 0) err = EINTR; if (err) { - if (err == EINTR && ba.err) - err = ba.err; - kmem_free(drr, sizeof (dmu_replay_record_t)); - return (err); + if (err == EINTR && dsp->dsa_err) + err = dsp->dsa_err; + goto out; } bzero(drr, sizeof (dmu_replay_record_t)); drr->drr_type = DRR_END; - drr->drr_u.drr_end.drr_checksum = ba.zc; - drr->drr_u.drr_end.drr_toguid = ba.toguid; + drr->drr_u.drr_end.drr_checksum = dsp->dsa_zc; + drr->drr_u.drr_end.drr_toguid = dsp->dsa_toguid; - if (dump_bytes(&ba, drr, sizeof (dmu_replay_record_t)) != 0) { - kmem_free(drr, sizeof (dmu_replay_record_t)); - return (ba.err); + if (dump_bytes(dsp, drr, sizeof (dmu_replay_record_t)) != 0) { + err = dsp->dsa_err; + goto out; } +out: + mutex_enter(&ds->ds_sendstream_lock); + list_remove(&ds->ds_sendstreams, dsp); + mutex_exit(&ds->ds_sendstream_lock); + kmem_free(drr, sizeof (dmu_replay_record_t)); + kmem_free(dsp, sizeof (dmu_sendarg_t)); - return (0); + return (err); } int Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 25 01:13:39 2012 (r235950) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 25 01:19:28 2012 (r235951) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Portions Copyright (c) 2011 Martin Matuska @@ -32,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -401,6 +403,8 @@ dsl_dataset_get_ref(dsl_pool_t *dp, uint mutex_init(&ds->ds_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&ds->ds_recvlock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&ds->ds_opening_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&ds->ds_sendstream_lock, NULL, MUTEX_DEFAULT, NULL); + rw_init(&ds->ds_rwlock, 0, 0, 0); cv_init(&ds->ds_exclusive_cv, NULL, CV_DEFAULT, NULL); @@ -408,6 +412,9 @@ dsl_dataset_get_ref(dsl_pool_t *dp, uint dsl_deadlist_open(&ds->ds_deadlist, mos, ds->ds_phys->ds_deadlist_obj); + list_create(&ds->ds_sendstreams, sizeof (dmu_sendarg_t), + offsetof(dmu_sendarg_t, dsa_link)); + if (err == 0) { err = dsl_dir_open_obj(dp, ds->ds_phys->ds_dir_obj, NULL, ds, &ds->ds_dir); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri May 25 01:13:39 2012 (r235950) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri May 25 01:19:28 2012 (r235951) @@ -24,6 +24,7 @@ */ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -706,8 +707,8 @@ typedef void (*dmu_traverse_cb_t)(objset void dmu_traverse_objset(objset_t *os, uint64_t txg_start, dmu_traverse_cb_t cb, void *arg); -int dmu_sendbackup(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, - struct file *fp, offset_t *off); +int dmu_send(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, + int outfd, struct file *fp, offset_t *off); int dmu_send_estimate(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, uint64_t *sizep); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Fri May 25 01:13:39 2012 (r235950) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Fri May 25 01:19:28 2012 (r235951) @@ -21,6 +21,8 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2012, Martin Matuska . All rights reserved. */ #ifndef _SYS_DMU_IMPL_H @@ -31,6 +33,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -265,6 +268,33 @@ static xuio_stats_t xuio_stats = { atomic_add_64(&xuio_stats.stat.value.ui64, (val)) #define XUIOSTAT_BUMP(stat) XUIOSTAT_INCR(stat, 1) +/* + * The list of data whose inclusion in a send stream can be pending from + * one call to backup_cb to another. Multiple calls to dump_free() and + * dump_freeobjects() can be aggregated into a single DRR_FREE or + * DRR_FREEOBJECTS replay record. + */ +typedef enum { + PENDING_NONE, + PENDING_FREE, + PENDING_FREEOBJECTS +} dmu_pendop_t; + +typedef struct dmu_sendarg { + list_node_t dsa_link; + dmu_replay_record_t *dsa_drr; + kthread_t *dsa_td; + struct file *dsa_fp; + int dsa_outfd; + struct proc *dsa_proc; + offset_t *dsa_off; + objset_t *dsa_os; + zio_cksum_t dsa_zc; + uint64_t dsa_toguid; + int dsa_err; + dmu_pendop_t dsa_pending_op; +} dmu_sendarg_t; + #ifdef __cplusplus } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Fri May 25 01:13:39 2012 (r235950) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Fri May 25 01:19:28 2012 (r235951) @@ -23,6 +23,7 @@ * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #ifndef _SYS_DSL_DATASET_H @@ -152,6 +153,9 @@ typedef struct dsl_dataset { uint64_t ds_reserved; /* cached refreservation */ uint64_t ds_quota; /* cached refquota */ + kmutex_t ds_sendstream_lock; + list_t ds_sendstreams; + /* Protected by ds_lock; keep at end of struct for better locality */ char ds_snapname[MAXNAMELEN]; } dsl_dataset_t; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 25 01:13:39 2012 (r235950) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 25 01:19:28 2012 (r235951) @@ -25,6 +25,7 @@ * Portions Copyright 2011 Martin Matuska * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #include @@ -57,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -3933,7 +3935,8 @@ zfs_ioc_send(zfs_cmd_t *zc) } off = fp->f_offset; - error = dmu_sendbackup(tosnap, fromsnap, zc->zc_obj, fp, &off); + error = dmu_send(tosnap, fromsnap, zc->zc_obj, + zc->zc_cookie, fp, &off); if (off >= 0 && off <= MAXOFFSET_T) fp->f_offset = off; @@ -3945,6 +3948,49 @@ zfs_ioc_send(zfs_cmd_t *zc) return (error); } +/* + * inputs: + * zc_name name of snapshot on which to report progress + * zc_cookie file descriptor of send stream + * + * outputs: + * zc_cookie number of bytes written in send stream thus far + */ +static int +zfs_ioc_send_progress(zfs_cmd_t *zc) +{ + dsl_dataset_t *ds; + dmu_sendarg_t *dsp = NULL; + int error; + + if ((error = dsl_dataset_hold(zc->zc_name, FTAG, &ds)) != 0) + return (error); + + mutex_enter(&ds->ds_sendstream_lock); + + /* + * Iterate over all the send streams currently active on this dataset. + * If there's one which matches the specified file descriptor _and_ the + * stream was started by the current process, return the progress of + * that stream. + */ + for (dsp = list_head(&ds->ds_sendstreams); dsp != NULL; + dsp = list_next(&ds->ds_sendstreams, dsp)) { + if (dsp->dsa_outfd == zc->zc_cookie && + dsp->dsa_proc == curproc) + break; + } + + if (dsp != NULL) + zc->zc_cookie = *(dsp->dsa_off); + else + error = ENOENT; + + mutex_exit(&ds->ds_sendstream_lock); + dsl_dataset_rele(ds, FTAG); + return (error); +} + static int zfs_ioc_inject_fault(zfs_cmd_t *zc) { @@ -4946,7 +4992,9 @@ static zfs_ioc_vec_t zfs_ioc_vec[] = { { zfs_ioc_space_written, zfs_secpolicy_read, DATASET_NAME, B_FALSE, B_TRUE }, { zfs_ioc_space_snaps, zfs_secpolicy_read, DATASET_NAME, B_FALSE, - B_TRUE } + B_TRUE }, + { zfs_ioc_send_progress, zfs_secpolicy_read, DATASET_NAME, B_FALSE, + B_FALSE } }; int Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Fri May 25 01:13:39 2012 (r235950) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Fri May 25 01:19:28 2012 (r235951) @@ -23,6 +23,8 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2012, Martin Matuska . All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -794,6 +796,7 @@ typedef unsigned long zfs_ioc_t; #define ZFS_IOC_POOL_REGUID _IOWR('Z', 60, struct zfs_cmd) #define ZFS_IOC_SPACE_WRITTEN _IOWR('Z', 61, struct zfs_cmd) #define ZFS_IOC_SPACE_SNAPS _IOWR('Z', 62, struct zfs_cmd) +#define ZFS_IOC_SEND_PROGRESS _IOWR('Z', 63, struct zfs_cmd) /* * Internal SPA load state. Used by FMA diagnosis engine. From owner-svn-src-all@FreeBSD.ORG Fri May 25 01:21:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67527106566B; Fri, 25 May 2012 01:21:18 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DC638FC19; Fri, 25 May 2012 01:21: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 q4P1LIF6071627; Fri, 25 May 2012 01:21:18 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1LHXA071614; Fri, 25 May 2012 01:21:17 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201205250121.q4P1LHXA071614@svn.freebsd.org> From: Martin Matuska Date: Fri, 25 May 2012 01:21:17 +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: r235952 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/comm... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:21:18 -0000 Author: mm Date: Fri May 25 01:21:17 2012 New Revision: 235952 URL: http://svn.freebsd.org/changeset/base/235952 Log: MFC r235222: Import illumos changeset 13686:4bc0783f6064 2703 add mechanism to report ZFS send progress If the zfs send command is used with the -v flag, the amount of bytes transmitted is reported in per second updates. References: https://www.illumos.org/issues/2703 Obtained from: illumos (issue #2703) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri May 25 01:19:28 2012 (r235951) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri May 25 01:21:17 2012 (r235952) @@ -20,6 +20,7 @@ .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright (c) 2012 by Delphix. All rights reserved. .\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved. +.\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" .\" $FreeBSD$ @@ -2272,6 +2273,7 @@ flags to determine what data will be sen Print machine-parsable verbose information about the stream package generated. .It Fl v Print verbose information about the stream package generated. +This information includes a per-second report of how much data has been sent. .El .Pp The format of the stream is committed. You will be able to receive your streams Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri May 25 01:19:28 2012 (r235951) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri May 25 01:21:17 2012 (r235952) @@ -24,6 +24,7 @@ * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. @@ -3579,6 +3580,7 @@ zfs_do_send(int argc, char **argv) if (flags.verbose) extraverbose = B_TRUE; flags.verbose = B_TRUE; + flags.progress = B_TRUE; break; case 'D': flags.dedup = B_TRUE; Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri May 25 01:21:17 2012 (r235952) @@ -25,7 +25,7 @@ * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. - * All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. */ @@ -573,6 +573,9 @@ typedef struct sendflags { /* parsable verbose output (ie. -P) */ boolean_t parsable; + + /* show progress (ie. -v) */ + boolean_t progress; } sendflags_t; typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri May 25 01:19:28 2012 (r235951) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri May 25 01:21:17 2012 (r235952) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. */ @@ -40,6 +41,7 @@ #include #include #include +#include #include @@ -67,6 +69,12 @@ typedef struct dedup_arg { libzfs_handle_t *dedup_hdl; } dedup_arg_t; +typedef struct progress_arg { + zfs_handle_t *pa_zhp; + int pa_fd; + boolean_t pa_parsable; +} progress_arg_t; + typedef struct dataref { uint64_t ref_guid; uint64_t ref_object; @@ -786,7 +794,7 @@ typedef struct send_dump_data { char prevsnap[ZFS_MAXNAMELEN]; uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; - boolean_t verbose, dryrun, parsable; + boolean_t verbose, dryrun, parsable, progress; int outfd; boolean_t err; nvlist_t *fss; @@ -979,10 +987,60 @@ hold_for_send(zfs_handle_t *zhp, send_du return (error); } +static void * +send_progress_thread(void *arg) +{ + progress_arg_t *pa = arg; + + zfs_cmd_t zc = { 0 }; + zfs_handle_t *zhp = pa->pa_zhp; + libzfs_handle_t *hdl = zhp->zfs_hdl; + unsigned long long bytes; + char buf[16]; + + time_t t; + struct tm *tm; + + assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); + (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); + + if (!pa->pa_parsable) + (void) fprintf(stderr, "TIME SENT SNAPSHOT\n"); + + /* + * Print the progress from ZFS_IOC_SEND_PROGRESS every second. + */ + for (;;) { + (void) sleep(1); + + zc.zc_cookie = pa->pa_fd; + if (zfs_ioctl(hdl, ZFS_IOC_SEND_PROGRESS, &zc) != 0) + return ((void *)-1); + + (void) time(&t); + tm = localtime(&t); + bytes = zc.zc_cookie; + + if (pa->pa_parsable) { + (void) fprintf(stderr, "%02d:%02d:%02d\t%llu\t%s\n", + tm->tm_hour, tm->tm_min, tm->tm_sec, + bytes, zhp->zfs_name); + } else { + zfs_nicenum(bytes, buf, sizeof (buf)); + (void) fprintf(stderr, "%02d:%02d:%02d %5s %s\n", + tm->tm_hour, tm->tm_min, tm->tm_sec, + buf, zhp->zfs_name); + } + } +} + static int dump_snapshot(zfs_handle_t *zhp, void *arg) { send_dump_data_t *sdd = arg; + progress_arg_t pa = { 0 }; + pthread_t tid; + char *thissnap; int err; boolean_t isfromsnap, istosnap, fromorigin; @@ -1100,8 +1158,29 @@ dump_snapshot(zfs_handle_t *zhp, void *a } if (!sdd->dryrun) { + /* + * If progress reporting is requested, spawn a new thread to + * poll ZFS_IOC_SEND_PROGRESS at a regular interval. + */ + if (sdd->progress) { + pa.pa_zhp = zhp; + pa.pa_fd = sdd->outfd; + pa.pa_parsable = sdd->parsable; + + if (err = pthread_create(&tid, NULL, + send_progress_thread, &pa)) { + zfs_close(zhp); + return (err); + } + } + err = dump_ioctl(zhp, sdd->prevsnap, sdd->prevsnap_obj, fromorigin, sdd->outfd, sdd->debugnv); + + if (sdd->progress) { + (void) pthread_cancel(tid); + (void) pthread_join(tid, NULL); + } } (void) strcpy(sdd->prevsnap, thissnap); @@ -1451,12 +1530,13 @@ zfs_send(zfs_handle_t *zhp, const char * sdd.fsavl = fsavl; sdd.verbose = flags->verbose; sdd.parsable = flags->parsable; + sdd.progress = flags->progress; sdd.dryrun = flags->dryrun; sdd.filter_cb = filter_func; sdd.filter_cb_arg = cb_arg; if (debugnvp) sdd.debugnv = *debugnvp; - if (holdsnaps) { + if (holdsnaps || flags->progress) { ++holdseq; (void) snprintf(sdd.holdtag, sizeof (sdd.holdtag), ".send-%d-%llu", getpid(), (u_longlong_t)holdseq); Modified: stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri May 25 01:21:17 2012 (r235952) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #ifndef _SYS_ZFS_CONTEXT_H @@ -228,6 +229,7 @@ struct proc { }; extern struct proc p0; +#define curproc (&p0) #define PS_NONE -1 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri May 25 01:21:17 2012 (r235952) @@ -25,6 +25,8 @@ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2012, Martin Matuska . All rights reserved. */ #include @@ -54,38 +56,15 @@ int zfs_send_corrupt_data = B_FALSE; static char *dmu_recv_tag = "dmu_recv_tag"; -/* - * The list of data whose inclusion in a send stream can be pending from - * one call to backup_cb to another. Multiple calls to dump_free() and - * dump_freeobjects() can be aggregated into a single DRR_FREE or - * DRR_FREEOBJECTS replay record. - */ -typedef enum { - PENDING_NONE, - PENDING_FREE, - PENDING_FREEOBJECTS -} pendop_t; - -struct backuparg { - dmu_replay_record_t *drr; - kthread_t *td; - struct file *fp; - offset_t *off; - objset_t *os; - zio_cksum_t zc; - uint64_t toguid; - int err; - pendop_t pending_op; -}; - static int -dump_bytes(struct backuparg *ba, void *buf, int len) +dump_bytes(dmu_sendarg_t *dsp, void *buf, int len) { + dsl_dataset_t *ds = dsp->dsa_os->os_dsl_dataset; struct uio auio; struct iovec aiov; ASSERT3U(len % 8, ==, 0); - fletcher_4_incremental_native(buf, len, &ba->zc); + fletcher_4_incremental_native(buf, len, &dsp->dsa_zc); aiov.iov_base = buf; aiov.iov_len = len; auio.uio_iov = &aiov; @@ -94,24 +73,28 @@ dump_bytes(struct backuparg *ba, void *b auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; auio.uio_offset = (off_t)-1; - auio.uio_td = ba->td; + auio.uio_td = dsp->dsa_td; #ifdef _KERNEL - if (ba->fp->f_type == DTYPE_VNODE) + if (dsp->dsa_fp->f_type == DTYPE_VNODE) bwillwrite(); - ba->err = fo_write(ba->fp, &auio, ba->td->td_ucred, 0, ba->td); + dsp->dsa_err = fo_write(dsp->dsa_fp, &auio, dsp->dsa_td->td_ucred, 0, + dsp->dsa_td); #else fprintf(stderr, "%s: returning EOPNOTSUPP\n", __func__); - ba->err = EOPNOTSUPP; + dsp->dsa_err = EOPNOTSUPP; #endif - *ba->off += len; - return (ba->err); + mutex_enter(&ds->ds_sendstream_lock); + *dsp->dsa_off += len; + mutex_exit(&ds->ds_sendstream_lock); + + return (dsp->dsa_err); } static int -dump_free(struct backuparg *ba, uint64_t object, uint64_t offset, +dump_free(dmu_sendarg_t *dsp, uint64_t object, uint64_t offset, uint64_t length) { - struct drr_free *drrf = &(ba->drr->drr_u.drr_free); + struct drr_free *drrf = &(dsp->dsa_drr->drr_u.drr_free); /* * If there is a pending op, but it's not PENDING_FREE, push it out, @@ -120,13 +103,15 @@ dump_free(struct backuparg *ba, uint64_t * other DRR_FREE records. DRR_FREEOBJECTS records can only be * aggregated with other DRR_FREEOBJECTS records. */ - if (ba->pending_op != PENDING_NONE && ba->pending_op != PENDING_FREE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE && + dsp->dsa_pending_op != PENDING_FREE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } - if (ba->pending_op == PENDING_FREE) { + if (dsp->dsa_pending_op == PENDING_FREE) { /* * There should never be a PENDING_FREE if length is -1 * (because dump_dnode is the only place where this @@ -144,34 +129,35 @@ dump_free(struct backuparg *ba, uint64_t return (0); } else { /* not a continuation. Push out pending record */ - if (dump_bytes(ba, ba->drr, + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } } /* create a FREE record and make it pending */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_FREE; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_FREE; drrf->drr_object = object; drrf->drr_offset = offset; drrf->drr_length = length; - drrf->drr_toguid = ba->toguid; + drrf->drr_toguid = dsp->dsa_toguid; if (length == -1ULL) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); } else { - ba->pending_op = PENDING_FREE; + dsp->dsa_pending_op = PENDING_FREE; } return (0); } static int -dump_data(struct backuparg *ba, dmu_object_type_t type, +dump_data(dmu_sendarg_t *dsp, dmu_object_type_t type, uint64_t object, uint64_t offset, int blksz, const blkptr_t *bp, void *data) { - struct drr_write *drrw = &(ba->drr->drr_u.drr_write); + struct drr_write *drrw = &(dsp->dsa_drr->drr_u.drr_write); /* @@ -180,19 +166,20 @@ dump_data(struct backuparg *ba, dmu_obje * the stream, since aggregation can't be done across operations * of different types. */ - if (ba->pending_op != PENDING_NONE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } /* write a DATA record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_WRITE; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_WRITE; drrw->drr_object = object; drrw->drr_type = type; drrw->drr_offset = offset; drrw->drr_length = blksz; - drrw->drr_toguid = ba->toguid; + drrw->drr_toguid = dsp->dsa_toguid; drrw->drr_checksumtype = BP_GET_CHECKSUM(bp); if (zio_checksum_table[drrw->drr_checksumtype].ci_dedup) drrw->drr_checksumflags |= DRR_CHECKSUM_DEDUP; @@ -201,42 +188,43 @@ dump_data(struct backuparg *ba, dmu_obje DDK_SET_COMPRESS(&drrw->drr_key, BP_GET_COMPRESS(bp)); drrw->drr_key.ddk_cksum = bp->blk_cksum; - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - if (dump_bytes(ba, data, blksz) != 0) + if (dump_bytes(dsp, data, blksz) != 0) return (EINTR); return (0); } static int -dump_spill(struct backuparg *ba, uint64_t object, int blksz, void *data) +dump_spill(dmu_sendarg_t *dsp, uint64_t object, int blksz, void *data) { - struct drr_spill *drrs = &(ba->drr->drr_u.drr_spill); + struct drr_spill *drrs = &(dsp->dsa_drr->drr_u.drr_spill); - if (ba->pending_op != PENDING_NONE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } /* write a SPILL record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_SPILL; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_SPILL; drrs->drr_object = object; drrs->drr_length = blksz; - drrs->drr_toguid = ba->toguid; + drrs->drr_toguid = dsp->dsa_toguid; - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t))) + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t))) return (EINTR); - if (dump_bytes(ba, data, blksz)) + if (dump_bytes(dsp, data, blksz)) return (EINTR); return (0); } static int -dump_freeobjects(struct backuparg *ba, uint64_t firstobj, uint64_t numobjs) +dump_freeobjects(dmu_sendarg_t *dsp, uint64_t firstobj, uint64_t numobjs) { - struct drr_freeobjects *drrfo = &(ba->drr->drr_u.drr_freeobjects); + struct drr_freeobjects *drrfo = &(dsp->dsa_drr->drr_u.drr_freeobjects); /* * If there is a pending op, but it's not PENDING_FREEOBJECTS, @@ -245,13 +233,14 @@ dump_freeobjects(struct backuparg *ba, u * aggregated with other DRR_FREE records. DRR_FREEOBJECTS records * can only be aggregated with other DRR_FREEOBJECTS records. */ - if (ba->pending_op != PENDING_NONE && - ba->pending_op != PENDING_FREEOBJECTS) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE && + dsp->dsa_pending_op != PENDING_FREEOBJECTS) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } - if (ba->pending_op == PENDING_FREEOBJECTS) { + if (dsp->dsa_pending_op == PENDING_FREEOBJECTS) { /* * See whether this free object array can be aggregated * with pending one @@ -261,42 +250,43 @@ dump_freeobjects(struct backuparg *ba, u return (0); } else { /* can't be aggregated. Push out pending record */ - if (dump_bytes(ba, ba->drr, + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } } /* write a FREEOBJECTS record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_FREEOBJECTS; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_FREEOBJECTS; drrfo->drr_firstobj = firstobj; drrfo->drr_numobjs = numobjs; - drrfo->drr_toguid = ba->toguid; + drrfo->drr_toguid = dsp->dsa_toguid; - ba->pending_op = PENDING_FREEOBJECTS; + dsp->dsa_pending_op = PENDING_FREEOBJECTS; return (0); } static int -dump_dnode(struct backuparg *ba, uint64_t object, dnode_phys_t *dnp) +dump_dnode(dmu_sendarg_t *dsp, uint64_t object, dnode_phys_t *dnp) { - struct drr_object *drro = &(ba->drr->drr_u.drr_object); + struct drr_object *drro = &(dsp->dsa_drr->drr_u.drr_object); if (dnp == NULL || dnp->dn_type == DMU_OT_NONE) - return (dump_freeobjects(ba, object, 1)); + return (dump_freeobjects(dsp, object, 1)); - if (ba->pending_op != PENDING_NONE) { - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) { + if (dump_bytes(dsp, dsp->dsa_drr, + sizeof (dmu_replay_record_t)) != 0) return (EINTR); - ba->pending_op = PENDING_NONE; + dsp->dsa_pending_op = PENDING_NONE; } /* write an OBJECT record */ - bzero(ba->drr, sizeof (dmu_replay_record_t)); - ba->drr->drr_type = DRR_OBJECT; + bzero(dsp->dsa_drr, sizeof (dmu_replay_record_t)); + dsp->dsa_drr->drr_type = DRR_OBJECT; drro->drr_object = object; drro->drr_type = dnp->dn_type; drro->drr_bonustype = dnp->dn_bonustype; @@ -304,19 +294,19 @@ dump_dnode(struct backuparg *ba, uint64_ drro->drr_bonuslen = dnp->dn_bonuslen; drro->drr_checksumtype = dnp->dn_checksum; drro->drr_compress = dnp->dn_compress; - drro->drr_toguid = ba->toguid; + drro->drr_toguid = dsp->dsa_toguid; - if (dump_bytes(ba, ba->drr, sizeof (dmu_replay_record_t)) != 0) + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (EINTR); - if (dump_bytes(ba, DN_BONUS(dnp), P2ROUNDUP(dnp->dn_bonuslen, 8)) != 0) + if (dump_bytes(dsp, DN_BONUS(dnp), P2ROUNDUP(dnp->dn_bonuslen, 8)) != 0) return (EINTR); /* free anything past the end of the file */ - if (dump_free(ba, object, (dnp->dn_maxblkid + 1) * + if (dump_free(dsp, object, (dnp->dn_maxblkid + 1) * (dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT), -1ULL)) return (EINTR); - if (ba->err) + if (dsp->dsa_err) return (EINTR); return (0); } @@ -330,7 +320,7 @@ static int backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { - struct backuparg *ba = arg; + dmu_sendarg_t *dsp = arg; dmu_object_type_t type = bp ? BP_GET_TYPE(bp) : DMU_OT_NONE; int err = 0; @@ -343,10 +333,10 @@ backup_cb(spa_t *spa, zilog_t *zilog, co } else if (bp == NULL && zb->zb_object == DMU_META_DNODE_OBJECT) { uint64_t span = BP_SPAN(dnp, zb->zb_level); uint64_t dnobj = (zb->zb_blkid * span) >> DNODE_SHIFT; - err = dump_freeobjects(ba, dnobj, span >> DNODE_SHIFT); + err = dump_freeobjects(dsp, dnobj, span >> DNODE_SHIFT); } else if (bp == NULL) { uint64_t span = BP_SPAN(dnp, zb->zb_level); - err = dump_free(ba, zb->zb_object, zb->zb_blkid * span, span); + err = dump_free(dsp, zb->zb_object, zb->zb_blkid * span, span); } else if (zb->zb_level > 0 || type == DMU_OT_OBJSET) { return (0); } else if (type == DMU_OT_DNODE) { @@ -365,7 +355,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co for (i = 0; i < blksz >> DNODE_SHIFT; i++) { uint64_t dnobj = (zb->zb_blkid << (DNODE_BLOCK_SHIFT - DNODE_SHIFT)) + i; - err = dump_dnode(ba, dnobj, blk+i); + err = dump_dnode(dsp, dnobj, blk+i); if (err) break; } @@ -380,7 +370,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co ZIO_FLAG_CANFAIL, &aflags, zb) != 0) return (EIO); - err = dump_spill(ba, zb->zb_object, blksz, abuf->b_data); + err = dump_spill(dsp, zb->zb_object, blksz, abuf->b_data); (void) arc_buf_remove_ref(abuf, &abuf); } else { /* it's a level-0 block of a regular object */ uint32_t aflags = ARC_WAIT; @@ -404,7 +394,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co } } - err = dump_data(ba, type, zb->zb_object, zb->zb_blkid * blksz, + err = dump_data(dsp, type, zb->zb_object, zb->zb_blkid * blksz, blksz, bp, abuf->b_data); (void) arc_buf_remove_ref(abuf, &abuf); } @@ -414,13 +404,13 @@ backup_cb(spa_t *spa, zilog_t *zilog, co } int -dmu_sendbackup(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, - struct file *fp, offset_t *off) +dmu_send(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, + int outfd, struct file *fp, offset_t *off) { dsl_dataset_t *ds = tosnap->os_dsl_dataset; dsl_dataset_t *fromds = fromsnap ? fromsnap->os_dsl_dataset : NULL; dmu_replay_record_t *drr; - struct backuparg ba; + dmu_sendarg_t *dsp; int err; uint64_t fromtxg = 0; @@ -461,8 +451,10 @@ dmu_sendbackup(objset_t *tosnap, objset_ #ifdef _KERNEL if (dmu_objset_type(tosnap) == DMU_OST_ZFS) { uint64_t version; - if (zfs_get_zplprop(tosnap, ZFS_PROP_VERSION, &version) != 0) + if (zfs_get_zplprop(tosnap, ZFS_PROP_VERSION, &version) != 0) { + kmem_free(drr, sizeof (dmu_replay_record_t)); return (EINVAL); + } if (version == ZPL_VERSION_SA) { DMU_SET_FEATUREFLAGS( drr->drr_u.drr_begin.drr_versioninfo, @@ -489,47 +481,60 @@ dmu_sendbackup(objset_t *tosnap, objset_ if (fromorigin) dsl_dataset_rele(fromds, FTAG); - ba.drr = drr; - ba.td = curthread; - ba.fp = fp; - ba.os = tosnap; - ba.off = off; - ba.toguid = ds->ds_phys->ds_guid; - ZIO_SET_CHECKSUM(&ba.zc, 0, 0, 0, 0); - ba.pending_op = PENDING_NONE; + dsp = kmem_zalloc(sizeof (dmu_sendarg_t), KM_SLEEP); - if (dump_bytes(&ba, drr, sizeof (dmu_replay_record_t)) != 0) { - kmem_free(drr, sizeof (dmu_replay_record_t)); - return (ba.err); + dsp->dsa_drr = drr; + dsp->dsa_outfd = outfd; + dsp->dsa_proc = curproc; + dsp->dsa_td = curthread; + dsp->dsa_fp = fp; + dsp->dsa_os = tosnap; + dsp->dsa_off = off; + dsp->dsa_toguid = ds->ds_phys->ds_guid; + ZIO_SET_CHECKSUM(&dsp->dsa_zc, 0, 0, 0, 0); + dsp->dsa_pending_op = PENDING_NONE; + + mutex_enter(&ds->ds_sendstream_lock); + list_insert_head(&ds->ds_sendstreams, dsp); + mutex_exit(&ds->ds_sendstream_lock); + + if (dump_bytes(dsp, drr, sizeof (dmu_replay_record_t)) != 0) { + err = dsp->dsa_err; + goto out; } err = traverse_dataset(ds, fromtxg, TRAVERSE_PRE | TRAVERSE_PREFETCH, - backup_cb, &ba); + backup_cb, dsp); - if (ba.pending_op != PENDING_NONE) - if (dump_bytes(&ba, drr, sizeof (dmu_replay_record_t)) != 0) + if (dsp->dsa_pending_op != PENDING_NONE) + if (dump_bytes(dsp, drr, sizeof (dmu_replay_record_t)) != 0) err = EINTR; if (err) { - if (err == EINTR && ba.err) - err = ba.err; - kmem_free(drr, sizeof (dmu_replay_record_t)); - return (err); + if (err == EINTR && dsp->dsa_err) + err = dsp->dsa_err; + goto out; } bzero(drr, sizeof (dmu_replay_record_t)); drr->drr_type = DRR_END; - drr->drr_u.drr_end.drr_checksum = ba.zc; - drr->drr_u.drr_end.drr_toguid = ba.toguid; + drr->drr_u.drr_end.drr_checksum = dsp->dsa_zc; + drr->drr_u.drr_end.drr_toguid = dsp->dsa_toguid; - if (dump_bytes(&ba, drr, sizeof (dmu_replay_record_t)) != 0) { - kmem_free(drr, sizeof (dmu_replay_record_t)); - return (ba.err); + if (dump_bytes(dsp, drr, sizeof (dmu_replay_record_t)) != 0) { + err = dsp->dsa_err; + goto out; } +out: + mutex_enter(&ds->ds_sendstream_lock); + list_remove(&ds->ds_sendstreams, dsp); + mutex_exit(&ds->ds_sendstream_lock); + kmem_free(drr, sizeof (dmu_replay_record_t)); + kmem_free(dsp, sizeof (dmu_sendarg_t)); - return (0); + return (err); } int Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 25 01:21:17 2012 (r235952) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Portions Copyright (c) 2011 Martin Matuska @@ -32,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -401,6 +403,8 @@ dsl_dataset_get_ref(dsl_pool_t *dp, uint mutex_init(&ds->ds_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&ds->ds_recvlock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&ds->ds_opening_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&ds->ds_sendstream_lock, NULL, MUTEX_DEFAULT, NULL); + rw_init(&ds->ds_rwlock, 0, 0, 0); cv_init(&ds->ds_exclusive_cv, NULL, CV_DEFAULT, NULL); @@ -408,6 +412,9 @@ dsl_dataset_get_ref(dsl_pool_t *dp, uint dsl_deadlist_open(&ds->ds_deadlist, mos, ds->ds_phys->ds_deadlist_obj); + list_create(&ds->ds_sendstreams, sizeof (dmu_sendarg_t), + offsetof(dmu_sendarg_t, dsa_link)); + if (err == 0) { err = dsl_dir_open_obj(dp, ds->ds_phys->ds_dir_obj, NULL, ds, &ds->ds_dir); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri May 25 01:21:17 2012 (r235952) @@ -24,6 +24,7 @@ */ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -706,8 +707,8 @@ typedef void (*dmu_traverse_cb_t)(objset void dmu_traverse_objset(objset_t *os, uint64_t txg_start, dmu_traverse_cb_t cb, void *arg); -int dmu_sendbackup(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, - struct file *fp, offset_t *off); +int dmu_send(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, + int outfd, struct file *fp, offset_t *off); int dmu_send_estimate(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, uint64_t *sizep); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Fri May 25 01:21:17 2012 (r235952) @@ -21,6 +21,8 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2012, Martin Matuska . All rights reserved. */ #ifndef _SYS_DMU_IMPL_H @@ -31,6 +33,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -265,6 +268,33 @@ static xuio_stats_t xuio_stats = { atomic_add_64(&xuio_stats.stat.value.ui64, (val)) #define XUIOSTAT_BUMP(stat) XUIOSTAT_INCR(stat, 1) +/* + * The list of data whose inclusion in a send stream can be pending from + * one call to backup_cb to another. Multiple calls to dump_free() and + * dump_freeobjects() can be aggregated into a single DRR_FREE or + * DRR_FREEOBJECTS replay record. + */ +typedef enum { + PENDING_NONE, + PENDING_FREE, + PENDING_FREEOBJECTS +} dmu_pendop_t; + +typedef struct dmu_sendarg { + list_node_t dsa_link; + dmu_replay_record_t *dsa_drr; + kthread_t *dsa_td; + struct file *dsa_fp; + int dsa_outfd; + struct proc *dsa_proc; + offset_t *dsa_off; + objset_t *dsa_os; + zio_cksum_t dsa_zc; + uint64_t dsa_toguid; + int dsa_err; + dmu_pendop_t dsa_pending_op; +} dmu_sendarg_t; + #ifdef __cplusplus } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Fri May 25 01:21:17 2012 (r235952) @@ -23,6 +23,7 @@ * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #ifndef _SYS_DSL_DATASET_H @@ -152,6 +153,9 @@ typedef struct dsl_dataset { uint64_t ds_reserved; /* cached refreservation */ uint64_t ds_quota; /* cached refquota */ + kmutex_t ds_sendstream_lock; + list_t ds_sendstreams; + /* Protected by ds_lock; keep at end of struct for better locality */ char ds_snapname[MAXNAMELEN]; } dsl_dataset_t; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 25 01:21:17 2012 (r235952) @@ -25,6 +25,7 @@ * Portions Copyright 2011 Martin Matuska * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #include @@ -57,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -3933,7 +3935,8 @@ zfs_ioc_send(zfs_cmd_t *zc) } off = fp->f_offset; - error = dmu_sendbackup(tosnap, fromsnap, zc->zc_obj, fp, &off); + error = dmu_send(tosnap, fromsnap, zc->zc_obj, + zc->zc_cookie, fp, &off); if (off >= 0 && off <= MAXOFFSET_T) fp->f_offset = off; @@ -3945,6 +3948,49 @@ zfs_ioc_send(zfs_cmd_t *zc) return (error); } +/* + * inputs: + * zc_name name of snapshot on which to report progress + * zc_cookie file descriptor of send stream + * + * outputs: + * zc_cookie number of bytes written in send stream thus far + */ +static int +zfs_ioc_send_progress(zfs_cmd_t *zc) +{ + dsl_dataset_t *ds; + dmu_sendarg_t *dsp = NULL; + int error; + + if ((error = dsl_dataset_hold(zc->zc_name, FTAG, &ds)) != 0) + return (error); + + mutex_enter(&ds->ds_sendstream_lock); + + /* + * Iterate over all the send streams currently active on this dataset. + * If there's one which matches the specified file descriptor _and_ the + * stream was started by the current process, return the progress of + * that stream. + */ + for (dsp = list_head(&ds->ds_sendstreams); dsp != NULL; + dsp = list_next(&ds->ds_sendstreams, dsp)) { + if (dsp->dsa_outfd == zc->zc_cookie && + dsp->dsa_proc == curproc) + break; + } + + if (dsp != NULL) + zc->zc_cookie = *(dsp->dsa_off); + else + error = ENOENT; + + mutex_exit(&ds->ds_sendstream_lock); + dsl_dataset_rele(ds, FTAG); + return (error); +} + static int zfs_ioc_inject_fault(zfs_cmd_t *zc) { @@ -4946,7 +4992,9 @@ static zfs_ioc_vec_t zfs_ioc_vec[] = { { zfs_ioc_space_written, zfs_secpolicy_read, DATASET_NAME, B_FALSE, B_TRUE }, { zfs_ioc_space_snaps, zfs_secpolicy_read, DATASET_NAME, B_FALSE, - B_TRUE } + B_TRUE }, + { zfs_ioc_send_progress, zfs_secpolicy_read, DATASET_NAME, B_FALSE, + B_FALSE } }; int Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Fri May 25 01:19:28 2012 (r235951) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Fri May 25 01:21:17 2012 (r235952) @@ -23,6 +23,8 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2012, Martin Matuska . All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -794,6 +796,7 @@ typedef unsigned long zfs_ioc_t; #define ZFS_IOC_POOL_REGUID _IOWR('Z', 60, struct zfs_cmd) #define ZFS_IOC_SPACE_WRITTEN _IOWR('Z', 61, struct zfs_cmd) #define ZFS_IOC_SPACE_SNAPS _IOWR('Z', 62, struct zfs_cmd) +#define ZFS_IOC_SEND_PROGRESS _IOWR('Z', 63, struct zfs_cmd) /* * Internal SPA load state. Used by FMA diagnosis engine. From owner-svn-src-all@FreeBSD.ORG Fri May 25 01:42:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E9DC106566B; Fri, 25 May 2012 01:42:49 +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 594BF8FC0A; Fri, 25 May 2012 01:42: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 q4P1gn7x072505; Fri, 25 May 2012 01:42:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1gnNG072503; Fri, 25 May 2012 01:42:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250142.q4P1gnNG072503@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 01:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235953 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:42:49 -0000 Author: bz Date: Fri May 25 01:42:48 2012 New Revision: 235953 URL: http://svn.freebsd.org/changeset/base/235953 Log: MFp4 bz_ipv6_fast: No need to hold the (expensive) rt lock over (expensive) logging. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Fri May 25 01:21:17 2012 (r235952) +++ head/sys/netinet6/icmp6.c Fri May 25 01:42:48 2012 (r235953) @@ -2418,23 +2418,23 @@ icmp6_redirect_input(struct mbuf *m, int if (rt) { if (rt->rt_gateway == NULL || rt->rt_gateway->sa_family != AF_INET6) { + RTFREE_LOCKED(rt); nd6log((LOG_ERR, "ICMP6 redirect rejected; no route " "with inet6 gateway found for redirect dst: %s\n", icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); - RTFREE_LOCKED(rt); goto bad; } gw6 = &(((struct sockaddr_in6 *)rt->rt_gateway)->sin6_addr); if (bcmp(&src6, gw6, sizeof(struct in6_addr)) != 0) { + RTFREE_LOCKED(rt); nd6log((LOG_ERR, "ICMP6 redirect rejected; " "not equal to gw-for-src=%s (must be same): " "%s\n", ip6_sprintf(ip6buf, gw6), icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); - RTFREE_LOCKED(rt); goto bad; } } else { From owner-svn-src-all@FreeBSD.ORG Fri May 25 01:43:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41C2B1065680; Fri, 25 May 2012 01:43:53 +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 2D9B88FC0A; Fri, 25 May 2012 01:43:53 +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 q4P1hrY9072578; Fri, 25 May 2012 01:43:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1hqMl072576; Fri, 25 May 2012 01:43:52 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250143.q4P1hqMl072576@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 01:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235954 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:43:53 -0000 Author: bz Date: Fri May 25 01:43:52 2012 New Revision: 235954 URL: http://svn.freebsd.org/changeset/base/235954 Log: MFp4 bz_ipv6_fast: We currently nowhere set IP6A_SWAP making the entire check useless with the current code. Keep around but do not compile in. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/route6.c Modified: head/sys/netinet6/route6.c ============================================================================== --- head/sys/netinet6/route6.c Fri May 25 01:42:48 2012 (r235953) +++ head/sys/netinet6/route6.c Fri May 25 01:43:52 2012 (r235954) @@ -62,6 +62,7 @@ route6_input(struct mbuf **mp, int *offp struct mbuf *m = *mp; struct ip6_rthdr *rh; int off = *offp, rhlen; +#ifdef __notyet__ struct ip6aux *ip6a; ip6a = ip6_findaux(m); @@ -73,6 +74,7 @@ route6_input(struct mbuf **mp, int *offp return IPPROTO_DONE; } } +#endif #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, sizeof(*rh), IPPROTO_DONE); From owner-svn-src-all@FreeBSD.ORG Fri May 25 01:45:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DC85106564A; Fri, 25 May 2012 01:45:06 +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 ED6848FC0A; Fri, 25 May 2012 01:45: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 q4P1j56g072686; Fri, 25 May 2012 01:45:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1j5nN072684; Fri, 25 May 2012 01:45:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250145.q4P1j5nN072684@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 01:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235955 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:45:06 -0000 Author: bz Date: Fri May 25 01:45:05 2012 New Revision: 235955 URL: http://svn.freebsd.org/changeset/base/235955 Log: MFp4 bz_ipv6_fast: Simplify the code removing a return from an earlier else case, not differing from the default function return called now. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Fri May 25 01:43:52 2012 (r235954) +++ head/sys/netinet6/in6_src.c Fri May 25 01:45:05 2012 (r235955) @@ -873,8 +873,7 @@ in6_selecthlim(struct inpcb *in6p, struc RTFREE(ro6.ro_rt); if (lifp) return (ND_IFINFO(lifp)->chlim); - } else - return (V_ip6_defhlim); + } } return (V_ip6_defhlim); } From owner-svn-src-all@FreeBSD.ORG Fri May 25 01:48:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 198401065678; Fri, 25 May 2012 01:48:16 +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 DFE6A8FC17; Fri, 25 May 2012 01:48: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 q4P1mFp5072846; Fri, 25 May 2012 01:48:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1mFei072843; Fri, 25 May 2012 01:48:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250148.q4P1mFei072843@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 01:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235956 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:48:16 -0000 Author: bz Date: Fri May 25 01:48:15 2012 New Revision: 235956 URL: http://svn.freebsd.org/changeset/base/235956 Log: MFp4 bz_ipv6_fast: Hide the ip6aux functions. The only one referenced outside ip6_input.c is not compiled in yet (__notyet__) in route6.c (r235954). We do have accessor functions that should be used. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days X-MFC: KPI? Modified: head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Fri May 25 01:45:05 2012 (r235955) +++ head/sys/netinet6/ip6_input.c Fri May 25 01:48:15 2012 (r235956) @@ -146,6 +146,9 @@ RW_SYSINIT(in6_ifaddr_lock, &in6_ifaddr_ static void ip6_init2(void *); static struct ip6aux *ip6_setdstifaddr(struct mbuf *, struct in6_ifaddr *); +static struct ip6aux *ip6_addaux(struct mbuf *); +static struct ip6aux *ip6_findaux(struct mbuf *m); +static void ip6_delaux (struct mbuf *); static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *); #ifdef PULLDOWN_TEST static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int); @@ -1772,7 +1775,7 @@ ip6_lasthdr(struct mbuf *m, int off, int } } -struct ip6aux * +static struct ip6aux * ip6_addaux(struct mbuf *m) { struct m_tag *mtag; @@ -1789,7 +1792,7 @@ ip6_addaux(struct mbuf *m) return mtag ? (struct ip6aux *)(mtag + 1) : NULL; } -struct ip6aux * +static struct ip6aux * ip6_findaux(struct mbuf *m) { struct m_tag *mtag; @@ -1798,7 +1801,7 @@ ip6_findaux(struct mbuf *m) return mtag ? (struct ip6aux *)(mtag + 1) : NULL; } -void +static void ip6_delaux(struct mbuf *m) { struct m_tag *mtag; Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Fri May 25 01:45:05 2012 (r235955) +++ head/sys/netinet6/ip6_var.h Fri May 25 01:48:15 2012 (r235956) @@ -388,9 +388,9 @@ char * ip6_get_prevhdr __P((struct mbuf int ip6_nexthdr __P((struct mbuf *, int, int, int *)); int ip6_lasthdr __P((struct mbuf *, int, int, int *)); -struct ip6aux *ip6_addaux __P((struct mbuf *)); +#ifdef __notyet__ struct ip6aux *ip6_findaux __P((struct mbuf *)); -void ip6_delaux __P((struct mbuf *)); +#endif extern int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *, struct mbuf *); From owner-svn-src-all@FreeBSD.ORG Fri May 25 02:08:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 961B1106566B; Fri, 25 May 2012 02:08:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F8678FC0A; Fri, 25 May 2012 02:08: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 q4P2802S073676; Fri, 25 May 2012 02:08:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2801i073669; Fri, 25 May 2012 02:08:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205250208.q4P2801i073669@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 May 2012 02:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235957 - in head/sys/dev/ath: . ath_hal/ar5416 ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:08:00 -0000 Author: adrian Date: Fri May 25 02:07:59 2012 New Revision: 235957 URL: http://svn.freebsd.org/changeset/base/235957 Log: Prepare for improved (read: pcie) suspend/resume support. * Flesh out the pcie disable method for 11n chips, as they were defaulting to the AR5212 (empty) PCIe disable method. * Add accessor macros for the HAL PCIe enable/disable calls. * Call disable on ath_suspend() * Call enable on ath_resume() NOTE: * This has nothing to do with the NIC sleep/run state - the NIC still will stay in network-run state rather than supporting network-sleep state. This is preparation work for supporting correct suspend/resume WARs for the 11n PCIe NICs. TODO: * It may be feasible at this point to keep the chip powered down during initial probe/attach and only power it up upon the first configure/reset pass. This however would require correct (for values of "correct") tracking of the NIC power configuration state from the driver and that just isn't attempted at the moment. Tested: * AR9280 on my Lenovo T60, but with no suspend/resume pass (yet). Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 02:07:59 2012 (r235957) @@ -31,6 +31,7 @@ #include "ar5416/ar5416.ini" static void ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5416DisablePCIE(struct ath_hal *ah); static void ar5416WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan); static void ar5416SpurMitigate(struct ath_hal *ah, @@ -99,6 +100,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_phyDisable = ar5416PhyDisable; ah->ah_disable = ar5416Disable; ah->ah_configPCIE = ar5416ConfigPCIE; + ah->ah_disablePCIE = ar5416DisablePCIE; ah->ah_perCalibration = ar5416PerCalibration; ah->ah_perCalibrationN = ar5416PerCalibrationN, ah->ah_resetCalValid = ar5416ResetCalValid, @@ -474,6 +476,12 @@ ar5416ConfigPCIE(struct ath_hal *ah, HAL } static void +ar5416DisablePCIE(struct ath_hal *ah) +{ + /* XXX TODO */ +} + +static void ar5416WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan) { u_int modesIndex, freqIndex; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri May 25 02:07:59 2012 (r235957) @@ -62,6 +62,7 @@ static const HAL_PERCAL_DATA ar9280_adc_ }; static void ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9280DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9280FillCapabilityInfo(struct ath_hal *ah); static void ar9280WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan); @@ -187,6 +188,7 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s ah->ah_setAntennaSwitch = ar9280SetAntennaSwitch; ah->ah_configPCIE = ar9280ConfigPCIE; + ah->ah_disablePCIE = ar9280DisablePCIE; AH5416(ah)->ah_cal.iqCalData.calData = &ar9280_iq_cal; AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9280_adc_gain_cal; @@ -426,6 +428,12 @@ ar9280ConfigPCIE(struct ath_hal *ah, HAL } static void +ar9280DisablePCIE(struct ath_hal *ah) +{ + /* XXX TODO */ +} + +static void ar9280WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan) { u_int modesIndex, freqIndex; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri May 25 02:07:59 2012 (r235957) @@ -67,6 +67,7 @@ static const HAL_PERCAL_DATA ar9280_adc_ }; static void ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9285DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9285FillCapabilityInfo(struct ath_hal *ah); static void ar9285WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan); @@ -152,6 +153,7 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s ah->ah_setAntennaSwitch = ar9285SetAntennaSwitch; ah->ah_configPCIE = ar9285ConfigPCIE; + ah->ah_disablePCIE = ar9285DisablePCIE; ah->ah_setTxPower = ar9285SetTransmitPower; ah->ah_setBoardValues = ar9285SetBoardValues; @@ -373,6 +375,12 @@ ar9285ConfigPCIE(struct ath_hal *ah, HAL } static void +ar9285DisablePCIE(struct ath_hal *ah) +{ + /* XXX TODO */ +} + +static void ar9285WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan) { u_int modesIndex, freqIndex; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Fri May 25 02:07:59 2012 (r235957) @@ -66,6 +66,7 @@ static const HAL_PERCAL_DATA ar9287_adc_ }; static void ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9287DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9287FillCapabilityInfo(struct ath_hal *ah); static void ar9287WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan); @@ -141,6 +142,7 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s ah->ah_setAntennaSwitch = ar9287SetAntennaSwitch; ah->ah_configPCIE = ar9287ConfigPCIE; + ah->ah_disablePCIE = ar9287DisablePCIE; AH5416(ah)->ah_cal.iqCalData.calData = &ar9287_iq_cal; AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9287_adc_gain_cal; @@ -368,6 +370,12 @@ ar9287ConfigPCIE(struct ath_hal *ah, HAL } static void +ar9287DisablePCIE(struct ath_hal *ah) +{ + /* XXX TODO */ +} + +static void ar9287WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan) { u_int modesIndex, freqIndex; Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/if_ath.c Fri May 25 02:07:59 2012 (r235957) @@ -1318,6 +1318,9 @@ ath_suspend(struct ath_softc *sc) * mode; pci will power off our socket on suspend and * CardBus detaches the device. */ + + /* For PCIe, this matters */ + ath_hal_disablepcie(sc->sc_ah); } /* @@ -1350,6 +1353,9 @@ ath_resume(struct ath_softc *sc) DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", __func__, ifp->if_flags); + /* Re-enable PCIe, re-enable the PCIe bus */ + ath_hal_enablepcie(ah, 1); + /* * Must reset the chip before we reload the * keycache as we were powered down on suspend. Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/if_athvar.h Fri May 25 02:07:59 2012 (r235957) @@ -996,6 +996,14 @@ void ath_intr(void *); ((*(_ah)->ah_gpioSetIntr)((_ah), (_gpio), (_b))) /* + * PCIe suspend/resume/poweron/poweroff related macros + */ +#define ath_hal_enablepcie(_ah, _restore) \ + ((*(_ah)->ah_configPCIE)((_ah), (_restore))) +#define ath_hal_disablepcie(_ah) \ + ((*(_ah)->ah_disablePCIE)((_ah))) + +/* * This is badly-named; you need to set the correct parameters * to begin to receive useful radar events; and even then * it doesn't "enable" DFS. See the ath_dfs/null/ module for From owner-svn-src-all@FreeBSD.ORG Fri May 25 02:17:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 68BC4106577F; Fri, 25 May 2012 02:17:17 +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 490588FC16; Fri, 25 May 2012 02:17: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 q4P2HHTY074072; Fri, 25 May 2012 02:17:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2HHiG074069; Fri, 25 May 2012 02:17:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250217.q4P2HHiG074069@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 02:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235958 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:17:17 -0000 Author: bz Date: Fri May 25 02:17:16 2012 New Revision: 235958 URL: http://svn.freebsd.org/changeset/base/235958 Log: MFp4 bz_ipv6_fast: Add support for delayed checksum calculations in the IPv6 output path. We currently cannot offload to the card if we add extension headers (which incl. fragmentation). Fix two SCTP offload support copy&paste bugs: calculate checksums if fragmenting and no need to flag IPv4 header checksums in the IPv6 forwarding path. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Fri May 25 02:07:59 2012 (r235957) +++ head/sys/netinet6/ip6_forward.c Fri May 25 02:17:16 2012 (r235958) @@ -586,8 +586,6 @@ skip_routing: CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } - m->m_pkthdr.csum_flags |= - CSUM_IP_CHECKED | CSUM_IP_VALID; #ifdef SCTP if (m->m_pkthdr.csum_flags & CSUM_SCTP) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri May 25 02:07:59 2012 (r235957) +++ head/sys/netinet6/ip6_output.c Fri May 25 02:17:16 2012 (r235958) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -182,6 +184,29 @@ static int copypktopts(struct ip6_pktopt }\ } while (/*CONSTCOND*/ 0) +static void +in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset) +{ + u_short csum; + + csum = in_cksum_skip(m, ntohl(plen), offset); + if (m->m_pkthdr.csum_flags & CSUM_UDP && csum == 0) + csum = 0xffff; + offset += m->m_pkthdr.csum_data; /* checksum offset */ + + if (offset + sizeof(u_short) > m->m_len) { + printf("%s: delayed m_pullup, m->len: %d off: %d\n", + __func__, m->m_len, offset); + /* + * XXX this should not happen, but if it does, the correct + * behavior may be to insert the checksum in the appropriate + * next mbuf in the chain. + */ + return; + } + *(u_short *)(m->m_data + offset) = csum; +} + /* * IP6 output. The packet in mbuf chain m contains a skeletal IP6 * header (with pri, len, nxt, hlim, src, dst). @@ -221,9 +246,7 @@ ip6_output(struct mbuf *m0, struct ip6_p int flevalid = 0; int hdrsplit = 0; int needipsec = 0; -#ifdef SCTP - int sw_csum; -#endif + int sw_csum, tso; #ifdef IPSEC struct ipsec_output_state state; struct ip6_rthdr *rh = NULL; @@ -867,8 +890,6 @@ again: CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } - m->m_pkthdr.csum_flags |= - CSUM_IP_CHECKED | CSUM_IP_VALID; #ifdef SCTP if (m->m_pkthdr.csum_flags & CSUM_SCTP) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; @@ -891,7 +912,7 @@ again: } #ifdef SCTP if (m->m_pkthdr.csum_flags & CSUM_SCTP) - m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; + m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; #endif error = netisr_queue(NETISR_IPV6, m); goto done; @@ -927,16 +948,32 @@ passout: * 4: if dontfrag == 1 && alwaysfrag == 1 * error, as we cannot handle this conflicting request */ + sw_csum = m->m_pkthdr.csum_flags; + if (!hdrsplit) { + tso = ((sw_csum & ifp->if_hwassist & CSUM_TSO) != 0) ? 1 : 0; + sw_csum &= ~ifp->if_hwassist; + } else + tso = 0; + /* + * If we added extension headers, we will not do TSO and calculate the + * checksums ourselves for now. + * XXX-BZ Need a framework to know when the NIC can handle it, even + * with ext. hdrs. + */ + if (sw_csum & CSUM_DELAY_DATA) { + sw_csum &= ~CSUM_DELAY_DATA; + in6_delayed_cksum(m, ip6->ip6_plen, sizeof(struct ip6_hdr)); + } #ifdef SCTP - sw_csum = m->m_pkthdr.csum_flags & ~ifp->if_hwassist; if (sw_csum & CSUM_SCTP) { - sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); sw_csum &= ~CSUM_SCTP; + sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); } #endif + m->m_pkthdr.csum_flags &= ifp->if_hwassist; tlen = m->m_pkthdr.len; - if (opt && (opt->ip6po_flags & IP6PO_DONTFRAG)) + if ((opt && (opt->ip6po_flags & IP6PO_DONTFRAG)) || tso) dontfrag = 1; else dontfrag = 0; @@ -945,7 +982,7 @@ passout: error = EMSGSIZE; goto bad; } - if (dontfrag && tlen > IN6_LINKMTU(ifp)) { /* case 2-b */ + if (dontfrag && tlen > IN6_LINKMTU(ifp) && !tso) { /* case 2-b */ /* * Even if the DONTFRAG option is specified, we cannot send the * packet when the data length is larger than the MTU of the @@ -1033,6 +1070,22 @@ passout: goto bad; } + + /* + * If the interface will not calculate checksums on + * fragmented packets, then do it here. + * XXX-BZ handle the hw offloading case. Need flags. + */ + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + in6_delayed_cksum(m, ip6->ip6_plen, sizeof(*ip6)); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; + } +#ifdef SCTP + if (m->m_pkthdr.csum_flags & CSUM_SCTP) { + sctp_delayed_cksum(m, hlen); + m->m_pkthdr.csum_flags &= ~CSUM_SCTP; + } +#endif mnext = &m->m_nextpkt; /* From owner-svn-src-all@FreeBSD.ORG Fri May 25 02:19:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EB871106564A; Fri, 25 May 2012 02:19:17 +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 D73CB8FC19; Fri, 25 May 2012 02:19: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 q4P2JH4x074201; Fri, 25 May 2012 02:19:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2JH00074198; Fri, 25 May 2012 02:19:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250219.q4P2JH00074198@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 02:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235959 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:19:18 -0000 Author: bz Date: Fri May 25 02:19:17 2012 New Revision: 235959 URL: http://svn.freebsd.org/changeset/base/235959 Log: MFp4 bz_ipv6_fast: Defer checksum calulations on UDP6 output and respect the mbuf flags set by NICs having done checksum validation for us already, thus saving the computing time in the input path as well. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Fri May 25 02:17:16 2012 (r235958) +++ head/sys/netinet6/udp6_usrreq.c Fri May 25 02:19:17 2012 (r235959) @@ -185,6 +185,7 @@ udp6_input(struct mbuf **mp, int *offp, #ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; #endif + uint16_t uh_sum; ifp = m->m_pkthdr.rcvif; ip6 = mtod(m, struct ip6_hdr *); @@ -228,7 +229,18 @@ udp6_input(struct mbuf **mp, int *offp, UDPSTAT_INC(udps_nosum); goto badunlocked; } - if (in6_cksum(m, IPPROTO_UDP, off, ulen) != 0) { + + if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) + uh_sum = m->m_pkthdr.csum_data; + else + uh_sum = in6_cksum_pseudo(ip6, ulen, + IPPROTO_UDP, m->m_pkthdr.csum_data); + uh_sum ^= 0xffff; + } else + uh_sum = in6_cksum(m, IPPROTO_UDP, off, ulen); + + if (uh_sum != 0) { UDPSTAT_INC(udps_badsum); goto badunlocked; } @@ -771,10 +783,9 @@ udp6_output(struct inpcb *inp, struct mb ip6->ip6_src = *laddr; ip6->ip6_dst = *faddr; - if ((udp6->uh_sum = in6_cksum(m, IPPROTO_UDP, - sizeof(struct ip6_hdr), plen)) == 0) { - udp6->uh_sum = 0xffff; - } + udp6->uh_sum = in6_cksum_pseudo(ip6, plen, IPPROTO_UDP, 0); + m->m_pkthdr.csum_flags = CSUM_UDP; + m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); flags = 0; From owner-svn-src-all@FreeBSD.ORG Fri May 25 02:21:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6118C1065670; Fri, 25 May 2012 02:21: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 4DA168FC12; Fri, 25 May 2012 02:21: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 q4P2LIvb074328; Fri, 25 May 2012 02:21:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2LIVn074326; Fri, 25 May 2012 02:21:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250221.q4P2LIVn074326@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 02:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235960 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:21:18 -0000 Author: bz Date: Fri May 25 02:21:17 2012 New Revision: 235960 URL: http://svn.freebsd.org/changeset/base/235960 Log: MFp4 bz_ipv6_fast: Simple yet effective change enabling checksum "offload" on loopback for IPv6 to avoid expensive computations. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/net/if_loop.c Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Fri May 25 02:19:17 2012 (r235959) +++ head/sys/net/if_loop.c Fri May 25 02:21:17 2012 (r235960) @@ -247,12 +247,12 @@ looutput(struct ifnet *ifp, struct mbuf #if 1 /* XXX */ switch (dst->sa_family) { case AF_INET: + case AF_INET6: if (ifp->if_capenable & IFCAP_RXCSUM) { m->m_pkthdr.csum_data = 0xffff; m->m_pkthdr.csum_flags = LO_CSUM_SET; } m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES; - case AF_INET6: case AF_IPX: case AF_APPLETALK: break; From owner-svn-src-all@FreeBSD.ORG Fri May 25 02:23:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8CEC61065670; Fri, 25 May 2012 02:23:27 +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 779FE8FC0A; Fri, 25 May 2012 02:23:27 +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 q4P2NRBF074457; Fri, 25 May 2012 02:23:27 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2NRqV074451; Fri, 25 May 2012 02:23:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250223.q4P2NRqV074451@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 02:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235961 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:23:27 -0000 Author: bz Date: Fri May 25 02:23:26 2012 New Revision: 235961 URL: http://svn.freebsd.org/changeset/base/235961 Log: MFp4 bz_ipv6_fast: Add code to handle pre-checked TCP checksums as indicated by mbuf flags to save the entire computation for validation if not needed. In the IPv6 TCP output path only compute the pseudo-header checksum, set the checksum offset in the mbuf field along the appropriate flag as done in IPv4. In tcp_respond() just initialize the IPv6 payload length to 0 as ip6_output() will properly set it. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri May 25 02:21:17 2012 (r235960) +++ head/sys/netinet/tcp_input.c Fri May 25 02:23:26 2012 (r235961) @@ -577,13 +577,31 @@ tcp_input(struct mbuf *m, int off0) #ifdef INET6 if (isipv6) { /* IP6_EXTHDR_CHECK() is already done at tcp6_input(). */ + + if (m->m_len < (sizeof(*ip6) + sizeof(*th))) { + m = m_pullup(m, sizeof(*ip6) + sizeof(*th)); + if (m == NULL) { + TCPSTAT_INC(tcps_rcvshort); + return; + } + } + ip6 = mtod(m, struct ip6_hdr *); + th = (struct tcphdr *)((caddr_t)ip6 + off0); tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; - if (in6_cksum(m, IPPROTO_TCP, off0, tlen)) { + if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) + th->th_sum = m->m_pkthdr.csum_data; + else + th->th_sum = in6_cksum_pseudo(ip6, tlen, + IPPROTO_TCP, m->m_pkthdr.csum_data); + th->th_sum ^= 0xffff; + } else + th->th_sum = in6_cksum(m, IPPROTO_TCP, off0, tlen); + if (th->th_sum) { TCPSTAT_INC(tcps_rcvbadsum); goto drop; } - th = (struct tcphdr *)((caddr_t)ip6 + off0); /* * Be proactive about unspecified IPv6 address in source. Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Fri May 25 02:21:17 2012 (r235960) +++ head/sys/netinet/tcp_output.c Fri May 25 02:23:26 2012 (r235961) @@ -1047,19 +1047,23 @@ send: * checksum extended header and data. */ m->m_pkthdr.len = hdrlen + len; /* in6_cksum() need this */ + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 - if (isipv6) + if (isipv6) { /* * ip6_plen is not need to be filled now, and will be filled * in ip6_output. */ - th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(struct ip6_hdr), - sizeof(struct tcphdr) + optlen + len); + th->th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) + + optlen + len, IPPROTO_TCP, 0); + } +#endif +#if defined(INET6) && defined(INET) else -#endif /* INET6 */ +#endif +#ifdef INET { - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + optlen)); @@ -1067,6 +1071,7 @@ send: KASSERT(ip->ip_v == IPVERSION, ("%s: IP version incorrect: %d", __func__, ip->ip_v)); } +#endif /* * Enable TSO and specify the size of the segments. Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri May 25 02:21:17 2012 (r235960) +++ head/sys/netinet/tcp_subr.c Fri May 25 02:23:26 2012 (r235961) @@ -573,8 +573,7 @@ tcp_respond(struct tcpcb *tp, void *ipge ip6->ip6_flow = 0; ip6->ip6_vfc = IPV6_VERSION; ip6->ip6_nxt = IPPROTO_TCP; - ip6->ip6_plen = htons((u_short)(sizeof (struct tcphdr) + - tlen)); + ip6->ip6_plen = 0; /* Set in ip6_output(). */ tlen += sizeof (struct ip6_hdr) + sizeof (struct tcphdr); } #endif @@ -619,12 +618,13 @@ tcp_respond(struct tcpcb *tp, void *ipge else nth->th_win = htons((u_short)win); nth->th_urp = 0; + + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (isipv6) { - nth->th_sum = 0; - nth->th_sum = in6_cksum(m, IPPROTO_TCP, - sizeof(struct ip6_hdr), - tlen - sizeof(struct ip6_hdr)); + nth->th_sum = in6_cksum_pseudo(ip6, + tlen - sizeof(struct ip6_hdr), IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(tp != NULL ? tp->t_inpcb : NULL, NULL); } @@ -636,8 +636,6 @@ tcp_respond(struct tcpcb *tp, void *ipge { nth->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons((u_short)(tlen - sizeof(struct ip) + ip->ip_p))); - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); } #endif /* INET */ #ifdef TCPDEBUG Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Fri May 25 02:21:17 2012 (r235960) +++ head/sys/netinet/tcp_syncache.c Fri May 25 02:23:26 2012 (r235961) @@ -1473,11 +1473,12 @@ syncache_respond(struct syncache *sc) optlen = 0; M_SETFIB(m, sc->sc_inc.inc_fibnum); + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { - th->th_sum = 0; - th->th_sum = in6_cksum(m, IPPROTO_TCP, hlen, - tlen + optlen - hlen); + th->th_sum = in6_cksum_pseudo(ip6, tlen + optlen - hlen, + IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(NULL, NULL); error = ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); } @@ -1489,8 +1490,6 @@ syncache_respond(struct syncache *sc) { th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(tlen + optlen - hlen + IPPROTO_TCP)); - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); error = ip_output(m, sc->sc_ipopts, NULL, 0, NULL, NULL); } #endif Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Fri May 25 02:21:17 2012 (r235960) +++ head/sys/netinet/tcp_timewait.c Fri May 25 02:23:26 2012 (r235961) @@ -574,10 +574,12 @@ tcp_twrespond(struct tcptw *tw, int flag th->th_flags = flags; th->th_win = htons(tw->last_win); + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (isipv6) { - th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(struct ip6_hdr), - sizeof(struct tcphdr) + optlen); + th->th_sum = in6_cksum_pseudo(ip6, + sizeof(struct tcphdr) + optlen, IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(inp, NULL); error = ip6_output(m, inp->in6p_outputopts, NULL, (tw->tw_so_options & SO_DONTROUTE), NULL, NULL, inp); @@ -590,8 +592,6 @@ tcp_twrespond(struct tcptw *tw, int flag { th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + optlen + IPPROTO_TCP)); - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); ip->ip_len = m->m_pkthdr.len; if (V_path_mtu_discovery) ip->ip_off |= IP_DF; From owner-svn-src-all@FreeBSD.ORG Fri May 25 02:25:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A29B106566C; Fri, 25 May 2012 02:25:36 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id 193F08FC0C; Fri, 25 May 2012 02:25:36 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id C7A6125D3A96; Fri, 25 May 2012 02:25:34 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id F364EBE7AA6; Fri, 25 May 2012 02:25:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 71JMtj3aJTaG; Fri, 25 May 2012 02:25:33 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 2E535BE7AA4; Fri, 25 May 2012 02:25:33 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201205250221.q4P2LIVn074326@svn.freebsd.org> Date: Fri, 25 May 2012 02:25:32 +0000 Content-Transfer-Encoding: 7bit Message-Id: <65E90ABF-7AB0-42C8-8882-89232FEDB52B@FreeBSD.org> References: <201205250221.q4P2LIVn074326@svn.freebsd.org> To: src-committers@freebsd.org X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235960 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:25:36 -0000 On 25. May 2012, at 02:21 , Bjoern A. Zeeb wrote: > Author: bz > Date: Fri May 25 02:21:17 2012 > New Revision: 235960 > URL: http://svn.freebsd.org/changeset/base/235960 > > Log: > MFp4 bz_ipv6_fast: > > Simple yet effective change enabling checksum "offload" on loopback > for IPv6 to avoid expensive computations. While not particularly related but a good example: if we would provide a better library KPI we could possibly even defer (pseudo-header) checksum calculations to drivers, which expect different calculations already anyway, and even save these cycles on loop as well. Something more to ponder along with other factoring out of drivers etc. /bz -- Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Fri May 25 02:58:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07125106564A; Fri, 25 May 2012 02:58:22 +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 DBBA68FC0A; Fri, 25 May 2012 02:58: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 q4P2wLVo075938; Fri, 25 May 2012 02:58:21 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2wLYF075936; Fri, 25 May 2012 02:58:21 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250258.q4P2wLYF075936@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 02:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235962 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:58:23 -0000 Author: bz Date: Fri May 25 02:58:21 2012 New Revision: 235962 URL: http://svn.freebsd.org/changeset/base/235962 Log: MFp4 bz_ipv6_fast: Factor out Hop-By-Hop option processing. It's still not heavily used, it reduces the footprint of ip6_input() and makes ip6_input() more readable. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/ip6_input.c Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Fri May 25 02:23:26 2012 (r235961) +++ head/sys/netinet6/ip6_input.c Fri May 25 02:58:21 2012 (r235962) @@ -331,6 +331,83 @@ ip6_init2(void *dummy) /* This must be after route_init(), which is now SI_ORDER_THIRD */ SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL); +static int +ip6_input_hbh(struct mbuf *m, uint32_t *plen, uint32_t *rtalert, int *off, + int *nxt, int *ours) +{ + struct ip6_hdr *ip6; + struct ip6_hbh *hbh; + + if (ip6_hopopts_input(plen, rtalert, &m, off)) { +#if 0 /*touches NULL pointer*/ + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); +#endif + goto out; /* m have already been freed */ + } + + /* adjust pointer */ + ip6 = mtod(m, struct ip6_hdr *); + + /* + * if the payload length field is 0 and the next header field + * indicates Hop-by-Hop Options header, then a Jumbo Payload + * option MUST be included. + */ + if (ip6->ip6_plen == 0 && *plen == 0) { + /* + * Note that if a valid jumbo payload option is + * contained, ip6_hopopts_input() must set a valid + * (non-zero) payload length to the variable plen. + */ + V_ip6stat.ip6s_badoptions++; + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr); + icmp6_error(m, ICMP6_PARAM_PROB, + ICMP6_PARAMPROB_HEADER, + (caddr_t)&ip6->ip6_plen - (caddr_t)ip6); + goto out; + } +#ifndef PULLDOWN_TEST + /* ip6_hopopts_input() ensures that mbuf is contiguous */ + hbh = (struct ip6_hbh *)(ip6 + 1); +#else + IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), + sizeof(struct ip6_hbh)); + if (hbh == NULL) { + V_ip6stat.ip6s_tooshort++; + goto out; + } +#endif + *nxt = hbh->ip6h_nxt; + + /* + * If we are acting as a router and the packet contains a + * router alert option, see if we know the option value. + * Currently, we only support the option value for MLD, in which + * case we should pass the packet to the multicast routing + * daemon. + */ + if (*rtalert != ~0) { + switch (*rtalert) { + case IP6OPT_RTALERT_MLD: + if (V_ip6_forwarding) + *ours = 1; + break; + default: + /* + * RFC2711 requires unrecognized values must be + * silently ignored. + */ + break; + } + } + + return (0); + +out: + return (1); +} + void ip6_input(struct mbuf *m) { @@ -825,71 +902,11 @@ passin: */ plen = (u_int32_t)ntohs(ip6->ip6_plen); if (ip6->ip6_nxt == IPPROTO_HOPOPTS) { - struct ip6_hbh *hbh; + int error; - if (ip6_hopopts_input(&plen, &rtalert, &m, &off)) { -#if 0 /*touches NULL pointer*/ - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); -#endif - goto out; /* m have already been freed */ - } - - /* adjust pointer */ - ip6 = mtod(m, struct ip6_hdr *); - - /* - * if the payload length field is 0 and the next header field - * indicates Hop-by-Hop Options header, then a Jumbo Payload - * option MUST be included. - */ - if (ip6->ip6_plen == 0 && plen == 0) { - /* - * Note that if a valid jumbo payload option is - * contained, ip6_hopopts_input() must set a valid - * (non-zero) payload length to the variable plen. - */ - V_ip6stat.ip6s_badoptions++; - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr); - icmp6_error(m, ICMP6_PARAM_PROB, - ICMP6_PARAMPROB_HEADER, - (caddr_t)&ip6->ip6_plen - (caddr_t)ip6); + error = ip6_input_hbh(m, &plen, &rtalert, &off, &nxt, &ours); + if (error != 0) goto out; - } -#ifndef PULLDOWN_TEST - /* ip6_hopopts_input() ensures that mbuf is contiguous */ - hbh = (struct ip6_hbh *)(ip6 + 1); -#else - IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), - sizeof(struct ip6_hbh)); - if (hbh == NULL) { - V_ip6stat.ip6s_tooshort++; - goto out; - } -#endif - nxt = hbh->ip6h_nxt; - - /* - * If we are acting as a router and the packet contains a - * router alert option, see if we know the option value. - * Currently, we only support the option value for MLD, in which - * case we should pass the packet to the multicast routing - * daemon. - */ - if (rtalert != ~0) { - switch (rtalert) { - case IP6OPT_RTALERT_MLD: - if (V_ip6_forwarding) - ours = 1; - break; - default: - /* - * RFC2711 requires unrecognized values must be - * silently ignored. - */ - break; - } - } } else nxt = ip6->ip6_nxt; From owner-svn-src-all@FreeBSD.ORG Fri May 25 03:00:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5220106564A; Fri, 25 May 2012 03:00:34 +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 BFC6F8FC08; Fri, 25 May 2012 03:00: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 q4P30YdO076086; Fri, 25 May 2012 03:00:34 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P30Y2G076083; Fri, 25 May 2012 03:00:34 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250300.q4P30Y2G076083@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 03:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235963 - in head/sys: dev/cxgb modules/cxgb/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 03:00:34 -0000 Author: bz Date: Fri May 25 03:00:34 2012 New Revision: 235963 URL: http://svn.freebsd.org/changeset/base/235963 Log: MFp4 bz_ipv6_fast: Allow LRO to work on IPv6 as well. Fix the module Makefile to at least properly inlcude opt_inet6.h and allow builds without INET or INET6. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/modules/cxgb/cxgb/Makefile Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Fri May 25 02:58:21 2012 (r235962) +++ head/sys/dev/cxgb/cxgb_sge.c Fri May 25 03:00:34 2012 (r235963) @@ -30,6 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); +#include "opt_inet6.h" #include "opt_inet.h" #include @@ -2085,7 +2086,7 @@ t3_free_qset(adapter_t *sc, struct sge_q MTX_DESTROY(&q->rspq.lock); } -#ifdef INET +#if defined(INET6) || defined(INET) tcp_lro_free(&q->lro.ctrl); #endif @@ -2668,7 +2669,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i /* Allocate and setup the lro_ctrl structure */ q->lro.enabled = !!(pi->ifp->if_capenable & IFCAP_LRO); -#ifdef INET +#if defined(INET6) || defined(INET) ret = tcp_lro_init(&q->lro.ctrl); if (ret) { printf("error %d from tcp_lro_init\n", ret); @@ -2961,9 +2962,11 @@ process_responses(adapter_t *adap, struc struct rsp_desc *r = &rspq->desc[rspq->cidx]; int budget_left = budget; unsigned int sleeping = 0; +#if defined(INET6) || defined(INET) int lro_enabled = qs->lro.enabled; int skip_lro; struct lro_ctrl *lro_ctrl = &qs->lro.ctrl; +#endif struct mbuf *offload_mbufs[RX_BUNDLE_SIZE]; int ngathered = 0; struct t3_mbuf_hdr *mh = &rspq->rspq_mh; @@ -3082,15 +3085,16 @@ process_responses(adapter_t *adap, struc * The mbuf's rcvif was derived from the cpl header and * is accurate. Skip LRO and just use that. */ +#if defined(INET6) || defined(INET) skip_lro = __predict_false(qs->port->ifp != m->m_pkthdr.rcvif); if (lro_enabled && lro_ctrl->lro_cnt && !skip_lro -#ifdef INET && (tcp_lro_rx(lro_ctrl, m, 0) == 0) -#endif ) { /* successfully queue'd for LRO */ - } else { + } else +#endif + { /* * LRO not enabled, packet unsuitable for LRO, * or unable to queue. Pass it up right now in @@ -3109,7 +3113,7 @@ process_responses(adapter_t *adap, struc deliver_partial_bundle(&adap->tdev, rspq, offload_mbufs, ngathered); -#ifdef INET +#if defined(INET6) || defined(INET) /* Flush LRO */ while (!SLIST_EMPTY(&lro_ctrl->lro_active)) { struct lro_entry *queued = SLIST_FIRST(&lro_ctrl->lro_active); Modified: head/sys/modules/cxgb/cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/cxgb/Makefile Fri May 25 02:58:21 2012 (r235962) +++ head/sys/modules/cxgb/cxgb/Makefile Fri May 25 03:00:34 2012 (r235963) @@ -8,9 +8,21 @@ SRCS= cxgb_mc5.c cxgb_vsc8211.c cxgb_ael SRCS+= cxgb_xgmac.c cxgb_vsc7323.c cxgb_t3_hw.c cxgb_main.c cxgb_aq100x.c SRCS+= cxgb_sge.c cxgb_offload.c cxgb_tn1010.c SRCS+= device_if.h bus_if.h pci_if.h -SRCS+= opt_inet.h opt_zero.h opt_sched.h +SRCS+= opt_inet.h opt_inet6.h opt_zero.h opt_sched.h SRCS+= uipc_mvec.c CFLAGS+= -g -DDEFAULT_JUMBO -I${CXGB} +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif + .include From owner-svn-src-all@FreeBSD.ORG Fri May 25 03:02:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 049CD106566C; Fri, 25 May 2012 03:02:57 +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 E2A178FC19; Fri, 25 May 2012 03:02:56 +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 q4P32ukw076350; Fri, 25 May 2012 03:02:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P32u1b076347; Fri, 25 May 2012 03:02:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250302.q4P32u1b076347@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 03:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235964 - in head/sys: dev/ixgbe modules/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 03:02:57 -0000 Author: bz Date: Fri May 25 03:02:56 2012 New Revision: 235964 URL: http://svn.freebsd.org/changeset/base/235964 Log: MFp4 bz_ipv6_fast: Add TSO6 and LRO/IPv6 support. Fix the module Makefile to at least properly inlcude opt_inet6.h and allow builds without INET or INET6. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/modules/ixgbe/Makefile Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri May 25 03:00:34 2012 (r235963) +++ head/sys/dev/ixgbe/ixgbe.c Fri May 25 03:02:56 2012 (r235964) @@ -162,7 +162,7 @@ static void ixgbe_dma_free(struct ad static void ixgbe_add_rx_process_limit(struct adapter *, const char *, const char *, int *, int); static bool ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); -static bool ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *); +static bool ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); static void ixgbe_set_ivar(struct adapter *, u8, u8, s8); static void ixgbe_configure_ivars(struct adapter *); static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *); @@ -997,6 +997,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_capenable ^= IFCAP_HWCSUM; if (mask & IFCAP_TSO4) ifp->if_capenable ^= IFCAP_TSO4; + if (mask & IFCAP_TSO6) + ifp->if_capenable ^= IFCAP_TSO6; if (mask & IFCAP_LRO) ifp->if_capenable ^= IFCAP_LRO; if (mask & IFCAP_VLAN_HWTAGGING) @@ -1061,7 +1063,7 @@ ixgbe_init_locked(struct adapter *adapte /* Set the various hardware offload abilities */ ifp->if_hwassist = 0; - if (ifp->if_capenable & IFCAP_TSO4) + if (ifp->if_capenable & IFCAP_TSO) ifp->if_hwassist |= CSUM_TSO; if (ifp->if_capenable & IFCAP_TXCSUM) { ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); @@ -1767,9 +1769,8 @@ ixgbe_xmit(struct tx_ring *txr, struct m ** a packet. */ if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { - if (ixgbe_tso_setup(txr, m_head, &paylen)) { + if (ixgbe_tso_setup(txr, m_head, &paylen, &olinfo_status)) { cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; - olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT; ++adapter->tso_tx; @@ -2562,7 +2563,7 @@ ixgbe_setup_interface(device_t dev, stru */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM; + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO | IFCAP_VLAN_HWCSUM; ifp->if_capabilities |= IFCAP_JUMBO_MTU; ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO @@ -3234,6 +3235,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, case ETHERTYPE_IPV6: ip6 = (struct ip6_hdr *)(mp->m_data + ehdrlen); ip_hlen = sizeof(struct ip6_hdr); + /* XXX-BZ this will go badly in case of ext hdrs. */ ipproto = ip6->ip6_nxt; type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; break; @@ -3292,17 +3294,23 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, * **********************************************************************/ static bool -ixgbe_tso_setup(struct tx_ring *txr, struct mbuf *mp, u32 *paylen) +ixgbe_tso_setup(struct tx_ring *txr, struct mbuf *mp, u32 *paylen, + u32 *olinfo_status) { struct adapter *adapter = txr->adapter; struct ixgbe_adv_tx_context_desc *TXD; struct ixgbe_tx_buf *tx_buffer; u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; - u32 mss_l4len_idx = 0; - u16 vtag = 0; - int ctxd, ehdrlen, hdrlen, ip_hlen, tcp_hlen; + u32 mss_l4len_idx = 0, len; + u16 vtag = 0, eh_type; + int ctxd, ehdrlen, ip_hlen, tcp_hlen; struct ether_vlan_header *eh; +#ifdef INET6 + struct ip6_hdr *ip6; +#endif +#ifdef INET struct ip *ip; +#endif struct tcphdr *th; @@ -3311,32 +3319,62 @@ ixgbe_tso_setup(struct tx_ring *txr, str * Jump over vlan headers if already present */ eh = mtod(mp, struct ether_vlan_header *); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - else + eh_type = eh->evl_proto; + } else { ehdrlen = ETHER_HDR_LEN; + eh_type = eh->evl_encap_proto; + } /* Ensure we have at least the IP+TCP header in the first mbuf. */ - if (mp->m_len < ehdrlen + sizeof(struct ip) + sizeof(struct tcphdr)) - return FALSE; + len = ehdrlen + sizeof(struct tcphdr); + switch (ntohs(eh_type)) { +#ifdef INET6 + case ETHERTYPE_IPV6: + if (mp->m_len < len + sizeof(struct ip6_hdr)) + return FALSE; + ip6 = (struct ip6_hdr *)(mp->m_data + ehdrlen); + /* XXX-BZ For now we do not pretend to support ext. hdrs. */ + if (ip6->ip6_nxt != IPPROTO_TCP) + return FALSE; + ip_hlen = sizeof(struct ip6_hdr); + th = (struct tcphdr *)((caddr_t)ip6 + ip_hlen); + th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); + type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + if (mp->m_len < len + sizeof(struct ip)) + return FALSE; + ip = (struct ip *)(mp->m_data + ehdrlen); + if (ip->ip_p != IPPROTO_TCP) + return FALSE; + ip->ip_sum = 0; + ip_hlen = ip->ip_hl << 2; + th = (struct tcphdr *)((caddr_t)ip + ip_hlen); + th->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; + /* Tell transmit desc to also do IPv4 checksum. */ + *olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; + break; +#endif + default: + panic("%s: CSUM_TSO but no supported IP version (0x%04x)", + __func__, ntohs(eh_type)); + break; + } ctxd = txr->next_avail_desc; tx_buffer = &txr->tx_buffers[ctxd]; TXD = (struct ixgbe_adv_tx_context_desc *) &txr->tx_base[ctxd]; - ip = (struct ip *)(mp->m_data + ehdrlen); - if (ip->ip_p != IPPROTO_TCP) - return FALSE; /* 0 */ - ip->ip_sum = 0; - ip_hlen = ip->ip_hl << 2; - th = (struct tcphdr *)((caddr_t)ip + ip_hlen); - th->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); tcp_hlen = th->th_off << 2; - hdrlen = ehdrlen + ip_hlen + tcp_hlen; /* This is used in the transmit desc in encap */ - *paylen = mp->m_pkthdr.len - hdrlen; + *paylen = mp->m_pkthdr.len - ehdrlen - ip_hlen - tcp_hlen; /* VLAN MACLEN IPLEN */ if (mp->m_flags & M_VLANTAG) { @@ -3351,10 +3389,8 @@ ixgbe_tso_setup(struct tx_ring *txr, str /* ADV DTYPE TUCMD */ type_tucmd_mlhl |= IXGBE_ADVTXD_DCMD_DEXT | IXGBE_ADVTXD_DTYP_CTXT; type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; - type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; TXD->type_tucmd_mlhl |= htole32(type_tucmd_mlhl); - /* MSS L4LEN IDX */ mss_l4len_idx |= (mp->m_pkthdr.tso_segsz << IXGBE_ADVTXD_MSS_SHIFT); mss_l4len_idx |= (tcp_hlen << IXGBE_ADVTXD_L4LEN_SHIFT); @@ -4295,15 +4331,17 @@ ixgbe_rx_input(struct rx_ring *rxr, stru { /* - * ATM LRO is only for IPv4/TCP packets and TCP checksum of the packet + * ATM LRO is only for IP/TCP packets and TCP checksum of the packet * should be computed by hardware. Also it should not have VLAN tag in - * ethernet header. + * ethernet header. In case of IPv6 we do not yet support ext. hdrs. */ if (rxr->lro_enabled && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0 && (ptype & IXGBE_RXDADV_PKTTYPE_ETQF) == 0 && - (ptype & (IXGBE_RXDADV_PKTTYPE_IPV4 | IXGBE_RXDADV_PKTTYPE_TCP)) == - (IXGBE_RXDADV_PKTTYPE_IPV4 | IXGBE_RXDADV_PKTTYPE_TCP) && + ((ptype & (IXGBE_RXDADV_PKTTYPE_IPV4 | IXGBE_RXDADV_PKTTYPE_TCP)) == + (IXGBE_RXDADV_PKTTYPE_IPV4 | IXGBE_RXDADV_PKTTYPE_TCP) || + (ptype & (IXGBE_RXDADV_PKTTYPE_IPV6 | IXGBE_RXDADV_PKTTYPE_TCP)) == + (IXGBE_RXDADV_PKTTYPE_IPV6 | IXGBE_RXDADV_PKTTYPE_TCP)) && (m->m_pkthdr.csum_flags & (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) == (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) { /* Modified: head/sys/modules/ixgbe/Makefile ============================================================================== --- head/sys/modules/ixgbe/Makefile Fri May 25 03:00:34 2012 (r235963) +++ head/sys/modules/ixgbe/Makefile Fri May 25 03:02:56 2012 (r235964) @@ -2,10 +2,23 @@ .PATH: ${.CURDIR}/../../dev/ixgbe KMOD = ixgbe SRCS = device_if.h bus_if.h pci_if.h +SRCS += opt_inet.h opt_inet6.h SRCS += ixgbe.c ixv.c # Shared source SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c SRCS += ixgbe_82599.c ixgbe_82598.c ixgbe_x540.c CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP -DIXGBE_FDIR +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif + .include From owner-svn-src-all@FreeBSD.ORG Fri May 25 03:04:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3BC70106566B; Fri, 25 May 2012 03:04:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id B945B8FC14; Fri, 25 May 2012 03:04:33 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id AB07D25D388E; Fri, 25 May 2012 03:04:32 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 262F7BE7AC3; Fri, 25 May 2012 03:04:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id vXXQeJHcKZZN; Fri, 25 May 2012 03:04:31 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 22F90BE7AC6; Fri, 25 May 2012 03:04:31 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201205250300.q4P30Y2G076083@svn.freebsd.org> Date: Fri, 25 May 2012 03:04:30 +0000 Content-Transfer-Encoding: 7bit Message-Id: <083C2C87-F613-485C-B37F-64A46689BD9E@FreeBSD.org> References: <201205250300.q4P30Y2G076083@svn.freebsd.org> To: src-committers@freebsd.org X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235963 - in head/sys: dev/cxgb modules/cxgb/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 03:04:34 -0000 On 25. May 2012, at 03:00 , Bjoern A. Zeeb wrote: > Author: bz > Date: Fri May 25 03:00:34 2012 > New Revision: 235963 > URL: http://svn.freebsd.org/changeset/base/235963 > > Log: > MFp4 bz_ipv6_fast: > > Allow LRO to work on IPv6 as well. Note that TSO6 support had been present in cxgb(4) since r231317. /bz -- Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Fri May 25 03:07:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5319106564A; Fri, 25 May 2012 03:07:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD23E8FC08; Fri, 25 May 2012 03:07: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 q4P37LvL076590; Fri, 25 May 2012 03:07:21 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P37LZr076579; Fri, 25 May 2012 03:07:21 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201205250307.q4P37LZr076579@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 25 May 2012 03:07:21 +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: r235965 - in stable/9/contrib/gcc: . config/rs6000 config/sparc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 03:07:21 -0000 Author: pfg Date: Fri May 25 03:07:20 2012 New Revision: 235965 URL: http://svn.freebsd.org/changeset/base/235965 Log: MFC: r235623 Bring in a subset of gcc fixes that were back ported to the GCC 4.1 branch and are available under GPLv2. Reviewed by: mm Approved by: jhb (mentor) Modified: stable/9/contrib/gcc/config/rs6000/rs6000.md stable/9/contrib/gcc/config/sparc/sparc.md stable/9/contrib/gcc/cse.c stable/9/contrib/gcc/expr.c stable/9/contrib/gcc/fold-const.c stable/9/contrib/gcc/ipa-pure-const.c stable/9/contrib/gcc/ipa-utils.c stable/9/contrib/gcc/rtl.h stable/9/contrib/gcc/var-tracking.c stable/9/contrib/gcc/varasm.c Directory Properties: stable/9/contrib/gcc/ (props changed) Modified: stable/9/contrib/gcc/config/rs6000/rs6000.md ============================================================================== --- stable/9/contrib/gcc/config/rs6000/rs6000.md Fri May 25 03:02:56 2012 (r235964) +++ stable/9/contrib/gcc/config/rs6000/rs6000.md Fri May 25 03:07:20 2012 (r235965) @@ -10075,6 +10075,7 @@ "" " { + operands[1] = force_reg (Pmode, operands[1]); operands[2] = gen_reg_rtx (Pmode); operands[3] = gen_frame_mem (Pmode, operands[0]); operands[4] = gen_frame_mem (Pmode, operands[1]); Modified: stable/9/contrib/gcc/config/sparc/sparc.md ============================================================================== --- stable/9/contrib/gcc/config/sparc/sparc.md Fri May 25 03:02:56 2012 (r235964) +++ stable/9/contrib/gcc/config/sparc/sparc.md Fri May 25 03:07:20 2012 (r235965) @@ -5071,14 +5071,11 @@ [(set_attr "type" "multi") (set_attr "length" "2")]) -;; The V8 architecture specifies that there must be 3 instructions between -;; a Y register write and a use of it for correct results. - (define_expand "divsi3" - [(parallel [(set (match_operand:SI 0 "register_operand" "=r,r") - (div:SI (match_operand:SI 1 "register_operand" "r,r") - (match_operand:SI 2 "input_operand" "rI,m"))) - (clobber (match_scratch:SI 3 "=&r,&r"))])] + [(parallel [(set (match_operand:SI 0 "register_operand" "") + (div:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "input_operand" ""))) + (clobber (match_scratch:SI 3 ""))])] "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { if (TARGET_ARCH64) @@ -5091,24 +5088,40 @@ } }) +;; The V8 architecture specifies that there must be at least 3 instructions +;; between a write to the Y register and a use of it for correct results. +;; We try to fill one of them with a simple constant or a memory load. + (define_insn "divsi3_sp32" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (div:SI (match_operand:SI 1 "register_operand" "r,r") - (match_operand:SI 2 "input_operand" "rI,m"))) - (clobber (match_scratch:SI 3 "=&r,&r"))] - "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) - && TARGET_ARCH32" -{ - if (which_alternative == 0) - if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tsdiv\t%1, %2, %0"; - else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tnop\n\tnop\n\tnop\n\tsdiv\t%1, %2, %0"; - else - if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tld\t%2, %3\n\tsdiv\t%1, %3, %0"; - else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tld\t%2, %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + [(set (match_operand:SI 0 "register_operand" "=r,r,r") + (div:SI (match_operand:SI 1 "register_operand" "r,r,r") + (match_operand:SI 2 "input_operand" "rI,K,m"))) + (clobber (match_scratch:SI 3 "=&r,&r,&r"))] + "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) && TARGET_ARCH32" +{ + output_asm_insn ("sra\t%1, 31, %3", operands); + output_asm_insn ("wr\t%3, 0, %%y", operands); + + switch (which_alternative) + { + case 0: + if (TARGET_V9) + return "sdiv\t%1, %2, %0"; + else + return "nop\n\tnop\n\tnop\n\tsdiv\t%1, %2, %0"; + case 1: + if (TARGET_V9) + return "sethi\t%%hi(%a2), %3\n\tsdiv\t%1, %3, %0"; + else + return "sethi\t%%hi(%a2), %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + case 2: + if (TARGET_V9) + return "ld\t%2, %3\n\tsdiv\t%1, %3, %0"; + else + return "ld\t%2, %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + default: + gcc_unreachable (); + } } [(set_attr "type" "multi") (set (attr "length") @@ -5143,10 +5156,13 @@ (clobber (match_scratch:SI 3 "=&r"))] "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { + output_asm_insn ("sra\t%1, 31, %3", operands); + output_asm_insn ("wr\t%3, 0, %%y", operands); + if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tsdivcc\t%1, %2, %0"; + return "sdivcc\t%1, %2, %0"; else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tnop\n\tnop\n\tnop\n\tsdivcc\t%1, %2, %0"; + return "nop\n\tnop\n\tnop\n\tsdivcc\t%1, %2, %0"; } [(set_attr "type" "multi") (set (attr "length") @@ -5161,29 +5177,48 @@ "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" "") -;; The V8 architecture specifies that there must be 3 instructions between -;; a Y register write and a use of it for correct results. +;; The V8 architecture specifies that there must be at least 3 instructions +;; between a write to the Y register and a use of it for correct results. +;; We try to fill one of them with a simple constant or a memory load. (define_insn "udivsi3_sp32" - [(set (match_operand:SI 0 "register_operand" "=r,&r,&r") - (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r,r,m") - (match_operand:SI 2 "input_operand" "rI,m,r")))] - "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) - && TARGET_ARCH32" + [(set (match_operand:SI 0 "register_operand" "=r,&r,&r,&r") + (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r,r,r,m") + (match_operand:SI 2 "input_operand" "rI,K,m,r")))] + "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) && TARGET_ARCH32" { - output_asm_insn ("wr\t%%g0, %%g0, %%y", operands); + output_asm_insn ("wr\t%%g0, 0, %%y", operands); + switch (which_alternative) { - default: - return "nop\n\tnop\n\tnop\n\tudiv\t%1, %2, %0"; + case 0: + if (TARGET_V9) + return "udiv\t%1, %2, %0"; + else + return "nop\n\tnop\n\tnop\n\tudiv\t%1, %2, %0"; case 1: - return "ld\t%2, %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; + if (TARGET_V9) + return "sethi\t%%hi(%a2), %0\n\tudiv\t%1, %0, %0"; + else + return "sethi\t%%hi(%a2), %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; case 2: - return "ld\t%1, %0\n\tnop\n\tnop\n\tudiv\t%0, %2, %0"; + if (TARGET_V9) + return "ld\t%2, %0\n\tudiv\t%1, %0, %0"; + else + return "ld\t%2, %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; + case 3: + if (TARGET_V9) + return "ld\t%1, %0\n\tudiv\t%0, %2, %0"; + else + return "ld\t%1, %0\n\tnop\n\tnop\n\tudiv\t%0, %2, %0"; + default: + gcc_unreachable (); } } [(set_attr "type" "multi") - (set_attr "length" "5")]) + (set (attr "length") + (if_then_else (eq_attr "isa" "v9") + (const_int 3) (const_int 5)))]) (define_insn "udivsi3_sp64" [(set (match_operand:SI 0 "register_operand" "=r") @@ -5209,13 +5244,14 @@ (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") (udiv:SI (match_dup 1) (match_dup 2)))] - "TARGET_V8 - || TARGET_DEPRECATED_V8_INSNS" + "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { + output_asm_insn ("wr\t%%g0, 0, %%y", operands); + if (TARGET_V9) - return "wr\t%%g0, %%g0, %%y\n\tudivcc\t%1, %2, %0"; + return "udivcc\t%1, %2, %0"; else - return "wr\t%%g0, %%g0, %%y\n\tnop\n\tnop\n\tnop\n\tudivcc\t%1, %2, %0"; + return "nop\n\tnop\n\tnop\n\tudivcc\t%1, %2, %0"; } [(set_attr "type" "multi") (set (attr "length") Modified: stable/9/contrib/gcc/cse.c ============================================================================== --- stable/9/contrib/gcc/cse.c Fri May 25 03:02:56 2012 (r235964) +++ stable/9/contrib/gcc/cse.c Fri May 25 03:07:20 2012 (r235965) @@ -583,7 +583,8 @@ static void delete_reg_equiv (unsigned i static int mention_regs (rtx); static int insert_regs (rtx, struct table_elt *, int); static void remove_from_table (struct table_elt *, unsigned); -static struct table_elt *lookup (rtx, unsigned, enum machine_mode); +static void remove_pseudo_from_table (rtx, unsigned); +static struct table_elt *lookup (rtx, unsigned, enum machine_mode); static struct table_elt *lookup_for_remove (rtx, unsigned, enum machine_mode); static rtx lookup_as_function (rtx, enum rtx_code); static struct table_elt *insert (rtx, struct table_elt *, unsigned, @@ -1381,6 +1382,19 @@ remove_from_table (struct table_elt *elt table_size--; } +/* Same as above, but X is a pseudo-register. */ + +static void +remove_pseudo_from_table (rtx x, unsigned int hash) +{ + struct table_elt *elt; + + /* Because a pseudo-register can be referenced in more than one + mode, we might have to remove more than one table entry. */ + while ((elt = lookup_for_remove (x, hash, VOIDmode))) + remove_from_table (elt, hash); +} + /* Look up X in the hash table and return its table element, or 0 if X is not in the table. @@ -1707,7 +1721,10 @@ merge_equiv_classes (struct table_elt *c delete_reg_equiv (REGNO (exp)); } - remove_from_table (elt, hash); + if (REG_P (exp) && REGNO (exp) >= FIRST_PSEUDO_REGISTER) + remove_pseudo_from_table (exp, hash); + else + remove_from_table (elt, hash); if (insert_regs (exp, class1, 0) || need_rehash) { @@ -1803,14 +1820,7 @@ invalidate (rtx x, enum machine_mode ful SUBREG_TICKED (regno) = -1; if (regno >= FIRST_PSEUDO_REGISTER) - { - /* Because a register can be referenced in more than one mode, - we might have to remove more than one table entry. */ - struct table_elt *elt; - - while ((elt = lookup_for_remove (x, hash, GET_MODE (x)))) - remove_from_table (elt, hash); - } + remove_pseudo_from_table (x, hash); else { HOST_WIDE_INT in_table Modified: stable/9/contrib/gcc/expr.c ============================================================================== --- stable/9/contrib/gcc/expr.c Fri May 25 03:02:56 2012 (r235964) +++ stable/9/contrib/gcc/expr.c Fri May 25 03:07:20 2012 (r235965) @@ -4750,14 +4750,7 @@ count_type_elements (tree type, bool all case UNION_TYPE: case QUAL_UNION_TYPE: - { - /* Ho hum. How in the world do we guess here? Clearly it isn't - right to count the fields. Guess based on the number of words. */ - HOST_WIDE_INT n = int_size_in_bytes (type); - if (n < 0) - return -1; - return n / UNITS_PER_WORD; - } + return -1; case COMPLEX_TYPE: return 2; Modified: stable/9/contrib/gcc/fold-const.c ============================================================================== --- stable/9/contrib/gcc/fold-const.c Fri May 25 03:02:56 2012 (r235964) +++ stable/9/contrib/gcc/fold-const.c Fri May 25 03:07:20 2012 (r235965) @@ -6657,12 +6657,14 @@ fold_widened_comparison (enum tree_code if (TYPE_PRECISION (TREE_TYPE (arg0)) <= TYPE_PRECISION (shorter_type)) return NULL_TREE; - arg1_unw = get_unwidened (arg1, shorter_type); + arg1_unw = get_unwidened (arg1, NULL_TREE); /* If possible, express the comparison in the shorter mode. */ if ((code == EQ_EXPR || code == NE_EXPR || TYPE_UNSIGNED (TREE_TYPE (arg0)) == TYPE_UNSIGNED (shorter_type)) && (TREE_TYPE (arg1_unw) == shorter_type + || (TYPE_PRECISION (shorter_type) + >= TYPE_PRECISION (TREE_TYPE (arg1_unw))) || (TREE_CODE (arg1_unw) == INTEGER_CST && (TREE_CODE (shorter_type) == INTEGER_TYPE || TREE_CODE (shorter_type) == BOOLEAN_TYPE) @@ -10647,24 +10649,24 @@ fold_binary (enum tree_code code, tree t tree arg01 = TREE_OPERAND (arg0, 1); if (TREE_CODE (arg00) == LSHIFT_EXPR && integer_onep (TREE_OPERAND (arg00, 0))) - return - fold_build2 (code, type, - build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - build2 (RSHIFT_EXPR, TREE_TYPE (arg00), - arg01, TREE_OPERAND (arg00, 1)), - fold_convert (TREE_TYPE (arg0), - integer_one_node)), - arg1); - else if (TREE_CODE (TREE_OPERAND (arg0, 1)) == LSHIFT_EXPR - && integer_onep (TREE_OPERAND (TREE_OPERAND (arg0, 1), 0))) - return - fold_build2 (code, type, - build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - build2 (RSHIFT_EXPR, TREE_TYPE (arg01), - arg00, TREE_OPERAND (arg01, 1)), - fold_convert (TREE_TYPE (arg0), - integer_one_node)), - arg1); + { + tree tem = fold_build2 (RSHIFT_EXPR, TREE_TYPE (arg00), + arg01, TREE_OPERAND (arg00, 1)); + tem = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0), tem, + build_int_cst (TREE_TYPE (arg0), 1)); + return fold_build2 (code, type, + fold_convert (TREE_TYPE (arg1), tem), arg1); + } + else if (TREE_CODE (arg01) == LSHIFT_EXPR + && integer_onep (TREE_OPERAND (arg01, 0))) + { + tree tem = fold_build2 (RSHIFT_EXPR, TREE_TYPE (arg01), + arg00, TREE_OPERAND (arg01, 1)); + tem = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0), tem, + build_int_cst (TREE_TYPE (arg0), 1)); + return fold_build2 (code, type, + fold_convert (TREE_TYPE (arg1), tem), arg1); + } } /* If this is an NE or EQ comparison of zero against the result of a Modified: stable/9/contrib/gcc/ipa-pure-const.c ============================================================================== --- stable/9/contrib/gcc/ipa-pure-const.c Fri May 25 03:02:56 2012 (r235964) +++ stable/9/contrib/gcc/ipa-pure-const.c Fri May 25 03:07:20 2012 (r235965) @@ -639,6 +639,7 @@ static_execute (void) for (i = 0; i < order_pos; i++ ) { enum pure_const_state_e pure_const_state = IPA_CONST; + int count = 0; node = order[i]; /* Find the worst state for any node in the cycle. */ @@ -655,11 +656,40 @@ static_execute (void) if (!w_l->state_set_in_source) { struct cgraph_edge *e; + count++; + + /* FIXME!!! Because of pr33826, we cannot have either + immediate or transitive recursive functions marked as + pure or const because dce can delete a function that + is in reality an infinite loop. A better solution + than just outlawing them is to add another bit the + functions to distinguish recursive from non recursive + pure and const function. This would allow the + recursive ones to be cse'd but not dce'd. In this + same vein, we could allow functions with loops to + also be cse'd but not dce'd. + + Unfortunately we are late in stage 3, and the fix + described above is is not appropriate. */ + if (count > 1) + { + pure_const_state = IPA_NEITHER; + break; + } + for (e = w->callees; e; e = e->next_callee) { struct cgraph_node *y = e->callee; /* Only look at the master nodes and skip external nodes. */ y = cgraph_master_clone (y); + + /* Check for immediate recursive functions. See the + FIXME above. */ + if (w == y) + { + pure_const_state = IPA_NEITHER; + break; + } if (y) { funct_state y_l = get_function_state (y); Modified: stable/9/contrib/gcc/ipa-utils.c ============================================================================== --- stable/9/contrib/gcc/ipa-utils.c Fri May 25 03:02:56 2012 (r235964) +++ stable/9/contrib/gcc/ipa-utils.c Fri May 25 03:07:20 2012 (r235965) @@ -78,7 +78,7 @@ struct searchc_env { has been customized for cgraph_nodes. The env parameter is because it is recursive and there are no nested functions here. This function should only be called from itself or - cgraph_reduced_inorder. ENV is a stack env and would be + ipa_utils_reduced_inorder. ENV is a stack env and would be unnecessary if C had nested functions. V is the node to start searching from. */ Modified: stable/9/contrib/gcc/rtl.h ============================================================================== --- stable/9/contrib/gcc/rtl.h Fri May 25 03:02:56 2012 (r235964) +++ stable/9/contrib/gcc/rtl.h Fri May 25 03:07:20 2012 (r235965) @@ -1189,8 +1189,8 @@ do { \ refer to part of a DECL. */ #define REG_EXPR(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->decl) -/* For a MEM rtx, the offset from the start of MEM_DECL, if known, as a - RTX that is always a CONST_INT. */ +/* For a REG rtx, the offset from the start of REG_EXPR, if known, as an + HOST_WIDE_INT. */ #define REG_OFFSET(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->offset) /* Copy the attributes that apply to memory locations from RHS to LHS. */ Modified: stable/9/contrib/gcc/var-tracking.c ============================================================================== --- stable/9/contrib/gcc/var-tracking.c Fri May 25 03:02:56 2012 (r235964) +++ stable/9/contrib/gcc/var-tracking.c Fri May 25 03:07:20 2012 (r235965) @@ -259,6 +259,9 @@ typedef struct variable_def /* Pointer to the BB's information specific to variable tracking pass. */ #define VTI(BB) ((variable_tracking_info) (BB)->aux) +/* Macro to access MEM_OFFSET as an HOST_WIDE_INT. Evaluates MEM twice. */ +#define INT_MEM_OFFSET(mem) (MEM_OFFSET (mem) ? INTVAL (MEM_OFFSET (mem)) : 0) + /* Alloc pool for struct attrs_def. */ static alloc_pool attrs_pool; @@ -927,7 +930,7 @@ static void var_mem_set (dataflow_set *set, rtx loc) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); @@ -945,7 +948,7 @@ static void var_mem_delete_and_set (dataflow_set *set, rtx loc, bool modify) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); @@ -962,7 +965,7 @@ static void var_mem_delete (dataflow_set *set, rtx loc, bool clobber) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); if (clobber) @@ -1540,6 +1543,18 @@ track_expr_p (tree expr) return 1; } +/* Return true if OFFSET is a valid offset for a register or memory + access we want to track. This is used to reject out-of-bounds + accesses that can cause assertions to fail later. Note that we + don't reject negative offsets because they can be generated for + paradoxical subregs on big-endian architectures. */ + +static inline bool +offset_valid_for_tracked_p (HOST_WIDE_INT offset) +{ + return (-MAX_VAR_PARTS < offset) && (offset < MAX_VAR_PARTS); +} + /* Determine whether a given LOC refers to the same variable part as EXPR+OFFSET. */ @@ -1560,7 +1575,7 @@ same_variable_part_p (rtx loc, tree expr else if (MEM_P (loc)) { expr2 = MEM_EXPR (loc); - offset2 = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + offset2 = INT_MEM_OFFSET (loc); } else return false; @@ -1590,7 +1605,8 @@ count_uses (rtx *loc, void *insn) } else if (MEM_P (*loc) && MEM_EXPR (*loc) - && track_expr_p (MEM_EXPR (*loc))) + && track_expr_p (MEM_EXPR (*loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (*loc))) { VTI (bb)->n_mos++; } @@ -1626,14 +1642,19 @@ add_uses (rtx *loc, void *insn) basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; - mo->type = ((REG_EXPR (*loc) && track_expr_p (REG_EXPR (*loc))) - ? MO_USE : MO_USE_NO_VAR); + if (REG_EXPR (*loc) + && track_expr_p (REG_EXPR (*loc)) + && offset_valid_for_tracked_p (REG_OFFSET (*loc))) + mo->type = MO_USE; + else + mo->type = MO_USE_NO_VAR; mo->u.loc = *loc; mo->insn = (rtx) insn; } else if (MEM_P (*loc) && MEM_EXPR (*loc) - && track_expr_p (MEM_EXPR (*loc))) + && track_expr_p (MEM_EXPR (*loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (*loc))) { basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; @@ -1667,8 +1688,9 @@ add_stores (rtx loc, rtx expr, void *ins micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; if (GET_CODE (expr) == CLOBBER - || ! REG_EXPR (loc) - || ! track_expr_p (REG_EXPR (loc))) + || !(REG_EXPR (loc) + && track_expr_p (REG_EXPR (loc)) + && offset_valid_for_tracked_p (REG_OFFSET (loc)))) mo->type = MO_CLOBBER; else if (GET_CODE (expr) == SET && SET_DEST (expr) == loc @@ -1683,7 +1705,8 @@ add_stores (rtx loc, rtx expr, void *ins } else if (MEM_P (loc) && MEM_EXPR (loc) - && track_expr_p (MEM_EXPR (loc))) + && track_expr_p (MEM_EXPR (loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (loc))) { basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; @@ -1694,8 +1717,7 @@ add_stores (rtx loc, rtx expr, void *ins && SET_DEST (expr) == loc && same_variable_part_p (SET_SRC (expr), MEM_EXPR (loc), - MEM_OFFSET (loc) - ? INTVAL (MEM_OFFSET (loc)) : 0)) + INT_MEM_OFFSET (loc))) mo->type = MO_COPY; else mo->type = MO_SET; @@ -2726,7 +2748,7 @@ vt_get_decl_and_offset (rtx rtl, tree *d if (MEM_ATTRS (rtl)) { *declp = MEM_EXPR (rtl); - *offsetp = MEM_OFFSET (rtl) ? INTVAL (MEM_OFFSET (rtl)) : 0; + *offsetp = INT_MEM_OFFSET (rtl); return true; } } Modified: stable/9/contrib/gcc/varasm.c ============================================================================== --- stable/9/contrib/gcc/varasm.c Fri May 25 03:02:56 2012 (r235964) +++ stable/9/contrib/gcc/varasm.c Fri May 25 03:07:20 2012 (r235965) @@ -5876,9 +5876,10 @@ default_binds_local_p_1 (tree exp, int s else if (DECL_WEAK (exp)) local_p = false; /* If PIC, then assume that any global name can be overridden by - symbols resolved from other modules. */ + symbols resolved from other modules, unless we are compiling with + -fwhole-program, which assumes that names are local. */ else if (shlib) - local_p = false; + local_p = flag_whole_program; /* Uninitialized COMMON variable may be unified with symbols resolved from other modules. */ else if (DECL_COMMON (exp) From owner-svn-src-all@FreeBSD.ORG Fri May 25 03:08:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FB751065672; Fri, 25 May 2012 03:08:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 275248FC0C; Fri, 25 May 2012 03:08: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 q4P38lik076730; Fri, 25 May 2012 03:08:47 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P38kN8076719; Fri, 25 May 2012 03:08:46 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201205250308.q4P38kN8076719@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 25 May 2012 03:08:46 +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: r235966 - in stable/8/contrib/gcc: . config/rs6000 config/sparc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 03:08:47 -0000 Author: pfg Date: Fri May 25 03:08:46 2012 New Revision: 235966 URL: http://svn.freebsd.org/changeset/base/235966 Log: MFC: r235623 Bring in a subset of gcc fixes that were backported to the GCC 4.1 branch and are available under GPLv2. Reviewed by: mm Approved by: jhb (mentor) Modified: stable/8/contrib/gcc/config/rs6000/rs6000.md stable/8/contrib/gcc/config/sparc/sparc.md stable/8/contrib/gcc/cse.c stable/8/contrib/gcc/expr.c stable/8/contrib/gcc/fold-const.c stable/8/contrib/gcc/ipa-pure-const.c stable/8/contrib/gcc/ipa-utils.c stable/8/contrib/gcc/rtl.h stable/8/contrib/gcc/var-tracking.c stable/8/contrib/gcc/varasm.c Directory Properties: stable/8/contrib/gcc/ (props changed) Modified: stable/8/contrib/gcc/config/rs6000/rs6000.md ============================================================================== --- stable/8/contrib/gcc/config/rs6000/rs6000.md Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/config/rs6000/rs6000.md Fri May 25 03:08:46 2012 (r235966) @@ -10075,6 +10075,7 @@ "" " { + operands[1] = force_reg (Pmode, operands[1]); operands[2] = gen_reg_rtx (Pmode); operands[3] = gen_frame_mem (Pmode, operands[0]); operands[4] = gen_frame_mem (Pmode, operands[1]); Modified: stable/8/contrib/gcc/config/sparc/sparc.md ============================================================================== --- stable/8/contrib/gcc/config/sparc/sparc.md Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/config/sparc/sparc.md Fri May 25 03:08:46 2012 (r235966) @@ -5071,14 +5071,11 @@ [(set_attr "type" "multi") (set_attr "length" "2")]) -;; The V8 architecture specifies that there must be 3 instructions between -;; a Y register write and a use of it for correct results. - (define_expand "divsi3" - [(parallel [(set (match_operand:SI 0 "register_operand" "=r,r") - (div:SI (match_operand:SI 1 "register_operand" "r,r") - (match_operand:SI 2 "input_operand" "rI,m"))) - (clobber (match_scratch:SI 3 "=&r,&r"))])] + [(parallel [(set (match_operand:SI 0 "register_operand" "") + (div:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "input_operand" ""))) + (clobber (match_scratch:SI 3 ""))])] "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { if (TARGET_ARCH64) @@ -5091,24 +5088,40 @@ } }) +;; The V8 architecture specifies that there must be at least 3 instructions +;; between a write to the Y register and a use of it for correct results. +;; We try to fill one of them with a simple constant or a memory load. + (define_insn "divsi3_sp32" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (div:SI (match_operand:SI 1 "register_operand" "r,r") - (match_operand:SI 2 "input_operand" "rI,m"))) - (clobber (match_scratch:SI 3 "=&r,&r"))] - "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) - && TARGET_ARCH32" -{ - if (which_alternative == 0) - if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tsdiv\t%1, %2, %0"; - else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tnop\n\tnop\n\tnop\n\tsdiv\t%1, %2, %0"; - else - if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tld\t%2, %3\n\tsdiv\t%1, %3, %0"; - else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tld\t%2, %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + [(set (match_operand:SI 0 "register_operand" "=r,r,r") + (div:SI (match_operand:SI 1 "register_operand" "r,r,r") + (match_operand:SI 2 "input_operand" "rI,K,m"))) + (clobber (match_scratch:SI 3 "=&r,&r,&r"))] + "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) && TARGET_ARCH32" +{ + output_asm_insn ("sra\t%1, 31, %3", operands); + output_asm_insn ("wr\t%3, 0, %%y", operands); + + switch (which_alternative) + { + case 0: + if (TARGET_V9) + return "sdiv\t%1, %2, %0"; + else + return "nop\n\tnop\n\tnop\n\tsdiv\t%1, %2, %0"; + case 1: + if (TARGET_V9) + return "sethi\t%%hi(%a2), %3\n\tsdiv\t%1, %3, %0"; + else + return "sethi\t%%hi(%a2), %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + case 2: + if (TARGET_V9) + return "ld\t%2, %3\n\tsdiv\t%1, %3, %0"; + else + return "ld\t%2, %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + default: + gcc_unreachable (); + } } [(set_attr "type" "multi") (set (attr "length") @@ -5143,10 +5156,13 @@ (clobber (match_scratch:SI 3 "=&r"))] "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { + output_asm_insn ("sra\t%1, 31, %3", operands); + output_asm_insn ("wr\t%3, 0, %%y", operands); + if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tsdivcc\t%1, %2, %0"; + return "sdivcc\t%1, %2, %0"; else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tnop\n\tnop\n\tnop\n\tsdivcc\t%1, %2, %0"; + return "nop\n\tnop\n\tnop\n\tsdivcc\t%1, %2, %0"; } [(set_attr "type" "multi") (set (attr "length") @@ -5161,29 +5177,48 @@ "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" "") -;; The V8 architecture specifies that there must be 3 instructions between -;; a Y register write and a use of it for correct results. +;; The V8 architecture specifies that there must be at least 3 instructions +;; between a write to the Y register and a use of it for correct results. +;; We try to fill one of them with a simple constant or a memory load. (define_insn "udivsi3_sp32" - [(set (match_operand:SI 0 "register_operand" "=r,&r,&r") - (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r,r,m") - (match_operand:SI 2 "input_operand" "rI,m,r")))] - "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) - && TARGET_ARCH32" + [(set (match_operand:SI 0 "register_operand" "=r,&r,&r,&r") + (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r,r,r,m") + (match_operand:SI 2 "input_operand" "rI,K,m,r")))] + "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) && TARGET_ARCH32" { - output_asm_insn ("wr\t%%g0, %%g0, %%y", operands); + output_asm_insn ("wr\t%%g0, 0, %%y", operands); + switch (which_alternative) { - default: - return "nop\n\tnop\n\tnop\n\tudiv\t%1, %2, %0"; + case 0: + if (TARGET_V9) + return "udiv\t%1, %2, %0"; + else + return "nop\n\tnop\n\tnop\n\tudiv\t%1, %2, %0"; case 1: - return "ld\t%2, %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; + if (TARGET_V9) + return "sethi\t%%hi(%a2), %0\n\tudiv\t%1, %0, %0"; + else + return "sethi\t%%hi(%a2), %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; case 2: - return "ld\t%1, %0\n\tnop\n\tnop\n\tudiv\t%0, %2, %0"; + if (TARGET_V9) + return "ld\t%2, %0\n\tudiv\t%1, %0, %0"; + else + return "ld\t%2, %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; + case 3: + if (TARGET_V9) + return "ld\t%1, %0\n\tudiv\t%0, %2, %0"; + else + return "ld\t%1, %0\n\tnop\n\tnop\n\tudiv\t%0, %2, %0"; + default: + gcc_unreachable (); } } [(set_attr "type" "multi") - (set_attr "length" "5")]) + (set (attr "length") + (if_then_else (eq_attr "isa" "v9") + (const_int 3) (const_int 5)))]) (define_insn "udivsi3_sp64" [(set (match_operand:SI 0 "register_operand" "=r") @@ -5209,13 +5244,14 @@ (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") (udiv:SI (match_dup 1) (match_dup 2)))] - "TARGET_V8 - || TARGET_DEPRECATED_V8_INSNS" + "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { + output_asm_insn ("wr\t%%g0, 0, %%y", operands); + if (TARGET_V9) - return "wr\t%%g0, %%g0, %%y\n\tudivcc\t%1, %2, %0"; + return "udivcc\t%1, %2, %0"; else - return "wr\t%%g0, %%g0, %%y\n\tnop\n\tnop\n\tnop\n\tudivcc\t%1, %2, %0"; + return "nop\n\tnop\n\tnop\n\tudivcc\t%1, %2, %0"; } [(set_attr "type" "multi") (set (attr "length") Modified: stable/8/contrib/gcc/cse.c ============================================================================== --- stable/8/contrib/gcc/cse.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/cse.c Fri May 25 03:08:46 2012 (r235966) @@ -583,7 +583,8 @@ static void delete_reg_equiv (unsigned i static int mention_regs (rtx); static int insert_regs (rtx, struct table_elt *, int); static void remove_from_table (struct table_elt *, unsigned); -static struct table_elt *lookup (rtx, unsigned, enum machine_mode); +static void remove_pseudo_from_table (rtx, unsigned); +static struct table_elt *lookup (rtx, unsigned, enum machine_mode); static struct table_elt *lookup_for_remove (rtx, unsigned, enum machine_mode); static rtx lookup_as_function (rtx, enum rtx_code); static struct table_elt *insert (rtx, struct table_elt *, unsigned, @@ -1381,6 +1382,19 @@ remove_from_table (struct table_elt *elt table_size--; } +/* Same as above, but X is a pseudo-register. */ + +static void +remove_pseudo_from_table (rtx x, unsigned int hash) +{ + struct table_elt *elt; + + /* Because a pseudo-register can be referenced in more than one + mode, we might have to remove more than one table entry. */ + while ((elt = lookup_for_remove (x, hash, VOIDmode))) + remove_from_table (elt, hash); +} + /* Look up X in the hash table and return its table element, or 0 if X is not in the table. @@ -1707,7 +1721,10 @@ merge_equiv_classes (struct table_elt *c delete_reg_equiv (REGNO (exp)); } - remove_from_table (elt, hash); + if (REG_P (exp) && REGNO (exp) >= FIRST_PSEUDO_REGISTER) + remove_pseudo_from_table (exp, hash); + else + remove_from_table (elt, hash); if (insert_regs (exp, class1, 0) || need_rehash) { @@ -1803,14 +1820,7 @@ invalidate (rtx x, enum machine_mode ful SUBREG_TICKED (regno) = -1; if (regno >= FIRST_PSEUDO_REGISTER) - { - /* Because a register can be referenced in more than one mode, - we might have to remove more than one table entry. */ - struct table_elt *elt; - - while ((elt = lookup_for_remove (x, hash, GET_MODE (x)))) - remove_from_table (elt, hash); - } + remove_pseudo_from_table (x, hash); else { HOST_WIDE_INT in_table Modified: stable/8/contrib/gcc/expr.c ============================================================================== --- stable/8/contrib/gcc/expr.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/expr.c Fri May 25 03:08:46 2012 (r235966) @@ -4750,14 +4750,7 @@ count_type_elements (tree type, bool all case UNION_TYPE: case QUAL_UNION_TYPE: - { - /* Ho hum. How in the world do we guess here? Clearly it isn't - right to count the fields. Guess based on the number of words. */ - HOST_WIDE_INT n = int_size_in_bytes (type); - if (n < 0) - return -1; - return n / UNITS_PER_WORD; - } + return -1; case COMPLEX_TYPE: return 2; Modified: stable/8/contrib/gcc/fold-const.c ============================================================================== --- stable/8/contrib/gcc/fold-const.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/fold-const.c Fri May 25 03:08:46 2012 (r235966) @@ -6657,12 +6657,14 @@ fold_widened_comparison (enum tree_code if (TYPE_PRECISION (TREE_TYPE (arg0)) <= TYPE_PRECISION (shorter_type)) return NULL_TREE; - arg1_unw = get_unwidened (arg1, shorter_type); + arg1_unw = get_unwidened (arg1, NULL_TREE); /* If possible, express the comparison in the shorter mode. */ if ((code == EQ_EXPR || code == NE_EXPR || TYPE_UNSIGNED (TREE_TYPE (arg0)) == TYPE_UNSIGNED (shorter_type)) && (TREE_TYPE (arg1_unw) == shorter_type + || (TYPE_PRECISION (shorter_type) + >= TYPE_PRECISION (TREE_TYPE (arg1_unw))) || (TREE_CODE (arg1_unw) == INTEGER_CST && (TREE_CODE (shorter_type) == INTEGER_TYPE || TREE_CODE (shorter_type) == BOOLEAN_TYPE) @@ -10647,24 +10649,24 @@ fold_binary (enum tree_code code, tree t tree arg01 = TREE_OPERAND (arg0, 1); if (TREE_CODE (arg00) == LSHIFT_EXPR && integer_onep (TREE_OPERAND (arg00, 0))) - return - fold_build2 (code, type, - build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - build2 (RSHIFT_EXPR, TREE_TYPE (arg00), - arg01, TREE_OPERAND (arg00, 1)), - fold_convert (TREE_TYPE (arg0), - integer_one_node)), - arg1); - else if (TREE_CODE (TREE_OPERAND (arg0, 1)) == LSHIFT_EXPR - && integer_onep (TREE_OPERAND (TREE_OPERAND (arg0, 1), 0))) - return - fold_build2 (code, type, - build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - build2 (RSHIFT_EXPR, TREE_TYPE (arg01), - arg00, TREE_OPERAND (arg01, 1)), - fold_convert (TREE_TYPE (arg0), - integer_one_node)), - arg1); + { + tree tem = fold_build2 (RSHIFT_EXPR, TREE_TYPE (arg00), + arg01, TREE_OPERAND (arg00, 1)); + tem = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0), tem, + build_int_cst (TREE_TYPE (arg0), 1)); + return fold_build2 (code, type, + fold_convert (TREE_TYPE (arg1), tem), arg1); + } + else if (TREE_CODE (arg01) == LSHIFT_EXPR + && integer_onep (TREE_OPERAND (arg01, 0))) + { + tree tem = fold_build2 (RSHIFT_EXPR, TREE_TYPE (arg01), + arg00, TREE_OPERAND (arg01, 1)); + tem = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0), tem, + build_int_cst (TREE_TYPE (arg0), 1)); + return fold_build2 (code, type, + fold_convert (TREE_TYPE (arg1), tem), arg1); + } } /* If this is an NE or EQ comparison of zero against the result of a Modified: stable/8/contrib/gcc/ipa-pure-const.c ============================================================================== --- stable/8/contrib/gcc/ipa-pure-const.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/ipa-pure-const.c Fri May 25 03:08:46 2012 (r235966) @@ -639,6 +639,7 @@ static_execute (void) for (i = 0; i < order_pos; i++ ) { enum pure_const_state_e pure_const_state = IPA_CONST; + int count = 0; node = order[i]; /* Find the worst state for any node in the cycle. */ @@ -655,11 +656,40 @@ static_execute (void) if (!w_l->state_set_in_source) { struct cgraph_edge *e; + count++; + + /* FIXME!!! Because of pr33826, we cannot have either + immediate or transitive recursive functions marked as + pure or const because dce can delete a function that + is in reality an infinite loop. A better solution + than just outlawing them is to add another bit the + functions to distinguish recursive from non recursive + pure and const function. This would allow the + recursive ones to be cse'd but not dce'd. In this + same vein, we could allow functions with loops to + also be cse'd but not dce'd. + + Unfortunately we are late in stage 3, and the fix + described above is is not appropriate. */ + if (count > 1) + { + pure_const_state = IPA_NEITHER; + break; + } + for (e = w->callees; e; e = e->next_callee) { struct cgraph_node *y = e->callee; /* Only look at the master nodes and skip external nodes. */ y = cgraph_master_clone (y); + + /* Check for immediate recursive functions. See the + FIXME above. */ + if (w == y) + { + pure_const_state = IPA_NEITHER; + break; + } if (y) { funct_state y_l = get_function_state (y); Modified: stable/8/contrib/gcc/ipa-utils.c ============================================================================== --- stable/8/contrib/gcc/ipa-utils.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/ipa-utils.c Fri May 25 03:08:46 2012 (r235966) @@ -78,7 +78,7 @@ struct searchc_env { has been customized for cgraph_nodes. The env parameter is because it is recursive and there are no nested functions here. This function should only be called from itself or - cgraph_reduced_inorder. ENV is a stack env and would be + ipa_utils_reduced_inorder. ENV is a stack env and would be unnecessary if C had nested functions. V is the node to start searching from. */ Modified: stable/8/contrib/gcc/rtl.h ============================================================================== --- stable/8/contrib/gcc/rtl.h Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/rtl.h Fri May 25 03:08:46 2012 (r235966) @@ -1184,8 +1184,8 @@ do { \ refer to part of a DECL. */ #define REG_EXPR(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->decl) -/* For a MEM rtx, the offset from the start of MEM_DECL, if known, as a - RTX that is always a CONST_INT. */ +/* For a REG rtx, the offset from the start of REG_EXPR, if known, as an + HOST_WIDE_INT. */ #define REG_OFFSET(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->offset) /* Copy the attributes that apply to memory locations from RHS to LHS. */ Modified: stable/8/contrib/gcc/var-tracking.c ============================================================================== --- stable/8/contrib/gcc/var-tracking.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/var-tracking.c Fri May 25 03:08:46 2012 (r235966) @@ -259,6 +259,9 @@ typedef struct variable_def /* Pointer to the BB's information specific to variable tracking pass. */ #define VTI(BB) ((variable_tracking_info) (BB)->aux) +/* Macro to access MEM_OFFSET as an HOST_WIDE_INT. Evaluates MEM twice. */ +#define INT_MEM_OFFSET(mem) (MEM_OFFSET (mem) ? INTVAL (MEM_OFFSET (mem)) : 0) + /* Alloc pool for struct attrs_def. */ static alloc_pool attrs_pool; @@ -927,7 +930,7 @@ static void var_mem_set (dataflow_set *set, rtx loc) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); @@ -945,7 +948,7 @@ static void var_mem_delete_and_set (dataflow_set *set, rtx loc, bool modify) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); @@ -962,7 +965,7 @@ static void var_mem_delete (dataflow_set *set, rtx loc, bool clobber) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); if (clobber) @@ -1540,6 +1543,18 @@ track_expr_p (tree expr) return 1; } +/* Return true if OFFSET is a valid offset for a register or memory + access we want to track. This is used to reject out-of-bounds + accesses that can cause assertions to fail later. Note that we + don't reject negative offsets because they can be generated for + paradoxical subregs on big-endian architectures. */ + +static inline bool +offset_valid_for_tracked_p (HOST_WIDE_INT offset) +{ + return (-MAX_VAR_PARTS < offset) && (offset < MAX_VAR_PARTS); +} + /* Determine whether a given LOC refers to the same variable part as EXPR+OFFSET. */ @@ -1560,7 +1575,7 @@ same_variable_part_p (rtx loc, tree expr else if (MEM_P (loc)) { expr2 = MEM_EXPR (loc); - offset2 = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + offset2 = INT_MEM_OFFSET (loc); } else return false; @@ -1590,7 +1605,8 @@ count_uses (rtx *loc, void *insn) } else if (MEM_P (*loc) && MEM_EXPR (*loc) - && track_expr_p (MEM_EXPR (*loc))) + && track_expr_p (MEM_EXPR (*loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (*loc))) { VTI (bb)->n_mos++; } @@ -1626,14 +1642,19 @@ add_uses (rtx *loc, void *insn) basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; - mo->type = ((REG_EXPR (*loc) && track_expr_p (REG_EXPR (*loc))) - ? MO_USE : MO_USE_NO_VAR); + if (REG_EXPR (*loc) + && track_expr_p (REG_EXPR (*loc)) + && offset_valid_for_tracked_p (REG_OFFSET (*loc))) + mo->type = MO_USE; + else + mo->type = MO_USE_NO_VAR; mo->u.loc = *loc; mo->insn = (rtx) insn; } else if (MEM_P (*loc) && MEM_EXPR (*loc) - && track_expr_p (MEM_EXPR (*loc))) + && track_expr_p (MEM_EXPR (*loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (*loc))) { basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; @@ -1667,8 +1688,9 @@ add_stores (rtx loc, rtx expr, void *ins micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; if (GET_CODE (expr) == CLOBBER - || ! REG_EXPR (loc) - || ! track_expr_p (REG_EXPR (loc))) + || !(REG_EXPR (loc) + && track_expr_p (REG_EXPR (loc)) + && offset_valid_for_tracked_p (REG_OFFSET (loc)))) mo->type = MO_CLOBBER; else if (GET_CODE (expr) == SET && SET_DEST (expr) == loc @@ -1683,7 +1705,8 @@ add_stores (rtx loc, rtx expr, void *ins } else if (MEM_P (loc) && MEM_EXPR (loc) - && track_expr_p (MEM_EXPR (loc))) + && track_expr_p (MEM_EXPR (loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (loc))) { basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; @@ -1694,8 +1717,7 @@ add_stores (rtx loc, rtx expr, void *ins && SET_DEST (expr) == loc && same_variable_part_p (SET_SRC (expr), MEM_EXPR (loc), - MEM_OFFSET (loc) - ? INTVAL (MEM_OFFSET (loc)) : 0)) + INT_MEM_OFFSET (loc))) mo->type = MO_COPY; else mo->type = MO_SET; @@ -2726,7 +2748,7 @@ vt_get_decl_and_offset (rtx rtl, tree *d if (MEM_ATTRS (rtl)) { *declp = MEM_EXPR (rtl); - *offsetp = MEM_OFFSET (rtl) ? INTVAL (MEM_OFFSET (rtl)) : 0; + *offsetp = INT_MEM_OFFSET (rtl); return true; } } Modified: stable/8/contrib/gcc/varasm.c ============================================================================== --- stable/8/contrib/gcc/varasm.c Fri May 25 03:07:20 2012 (r235965) +++ stable/8/contrib/gcc/varasm.c Fri May 25 03:08:46 2012 (r235966) @@ -5873,9 +5873,10 @@ default_binds_local_p_1 (tree exp, int s else if (DECL_WEAK (exp)) local_p = false; /* If PIC, then assume that any global name can be overridden by - symbols resolved from other modules. */ + symbols resolved from other modules, unless we are compiling with + -fwhole-program, which assumes that names are local. */ else if (shlib) - local_p = false; + local_p = flag_whole_program; /* Uninitialized COMMON variable may be unified with symbols resolved from other modules. */ else if (DECL_COMMON (exp) From owner-svn-src-all@FreeBSD.ORG Fri May 25 03:46:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C464F106566B; Fri, 25 May 2012 03:46:56 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B01028FC18; Fri, 25 May 2012 03:46:56 +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 q4P3kuP5078430; Fri, 25 May 2012 03:46:56 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P3ku6w078428; Fri, 25 May 2012 03:46:56 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201205250346.q4P3ku6w078428@svn.freebsd.org> From: Warren Block Date: Fri, 25 May 2012 03:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235967 - head/usr.sbin/utx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 03:46:56 -0000 Author: wblock (doc committer) Date: Fri May 25 03:46:56 2012 New Revision: 235967 URL: http://svn.freebsd.org/changeset/base/235967 Log: Fixes to man8 groff mandoc style, usage mistakes, or typos. PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb MFC after: 3 days Modified: head/usr.sbin/utx/utx.8 Modified: head/usr.sbin/utx/utx.8 ============================================================================== --- head/usr.sbin/utx/utx.8 Fri May 25 03:08:46 2012 (r235966) +++ head/usr.sbin/utx/utx.8 Fri May 25 03:46:56 2012 (r235967) @@ -94,7 +94,7 @@ database, its use is limited to the supe .Sh SEE ALSO .Xr getent 1 , .Xr w 1 , -.Xr pututxline 3 . +.Xr pututxline 3 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Fri May 25 04:10:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE34F1065674; Fri, 25 May 2012 04:10:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mail-new.kirov.so-ups.ru (mail-new.kirov.so-ups.ru [178.74.170.12]) by mx1.freebsd.org (Postfix) with ESMTP id 9D0A68FC1A; Fri, 25 May 2012 04:10:29 +0000 (UTC) Received: from kirov.so-ups.ru (unknown [172.21.81.1]) by mail-new.kirov.so-ups.ru (Postfix) with ESMTP id BBB3CA1E3C; Fri, 25 May 2012 08:10:26 +0400 (MSK) Received: by ns.kirov.so-ups.ru (Postfix, from userid 1010) id 472B2B9FCA; Fri, 25 May 2012 08:10:22 +0400 (MSK) Received: from [127.0.0.1] (unknown [10.118.3.52]) by ns.kirov.so-ups.ru (Postfix) with ESMTP id 0978CB9FC0; Fri, 25 May 2012 08:10:22 +0400 (MSK) Message-ID: <4FBF062D.10607@FreeBSD.org> Date: Fri, 25 May 2012 08:10:21 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Edward Tomasz Napierala References: <201205241648.q4OGmXha049187@svn.freebsd.org> In-Reply-To: <201205241648.q4OGmXha049187@svn.freebsd.org> X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235918 - head/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 04:10:30 -0000 On 24.05.2012 20:48, Edward Tomasz Napierala wrote: > Log: > Make g_label(4) ignore provider size when looking for UFS labels. > Without it, it fails to create labels for filesystems resized by > growfs(8). > > PR: kern/165962 I think it should be fixed in the growfs(8), not here. It seems to me that growfs(8) incorrectly calculates some values. -- WBR, Andrey V. Elsukov From owner-svn-src-all@FreeBSD.ORG Fri May 25 04:26:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C92F6106564A; Fri, 25 May 2012 04:26:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3B748FC0A; Fri, 25 May 2012 04:26: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 q4P4QEZ6080057; Fri, 25 May 2012 04:26:14 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P4QE97080053; Fri, 25 May 2012 04:26:14 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201205250426.q4P4QE97080053@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 25 May 2012 04:26: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: r235968 - stable/9/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 04:26:15 -0000 Author: ae Date: Fri May 25 04:26:14 2012 New Revision: 235968 URL: http://svn.freebsd.org/changeset/base/235968 Log: MFC r235599: Introduce new device flag G_MIRROR_DEVICE_FLAG_TASTING. It should protect geom from destroying while it is tasting. MFC r235600: Prevent removing of the last active component from a mirror. PR: kern/154860 Reviewed by: pjd Tested by: Eugene Grosbein Modified: stable/9/sys/geom/mirror/g_mirror.c stable/9/sys/geom/mirror/g_mirror.h stable/9/sys/geom/mirror/g_mirror_ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.c Fri May 25 03:46:56 2012 (r235967) +++ stable/9/sys/geom/mirror/g_mirror.c Fri May 25 04:26:14 2012 (r235968) @@ -1692,6 +1692,8 @@ g_mirror_can_destroy(struct g_mirror_sof gp = sc->sc_geom; if (gp->softc == NULL) return (1); + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_TASTING) != 0) + return (0); LIST_FOREACH(cp, &gp->consumer, consumer) { if (g_mirror_is_busy(sc, cp)) return (0); @@ -3053,6 +3055,7 @@ g_mirror_taste(struct g_class *mp, struc G_MIRROR_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); g_topology_unlock(); sx_xlock(&sc->sc_lock); + sc->sc_flags |= G_MIRROR_DEVICE_FLAG_TASTING; error = g_mirror_add_disk(sc, pp, &md); if (error != 0) { G_MIRROR_DEBUG(0, "Cannot add disk %s to %s (error=%d).", @@ -3065,6 +3068,12 @@ g_mirror_taste(struct g_class *mp, struc } gp = NULL; } + sc->sc_flags &= ~G_MIRROR_DEVICE_FLAG_TASTING; + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { + g_mirror_destroy(sc, G_MIRROR_DESTROY_HARD); + g_topology_lock(); + return (NULL); + } sx_xunlock(&sc->sc_lock); g_topology_lock(); return (gp); Modified: stable/9/sys/geom/mirror/g_mirror.h ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.h Fri May 25 03:46:56 2012 (r235967) +++ stable/9/sys/geom/mirror/g_mirror.h Fri May 25 04:26:14 2012 (r235968) @@ -157,6 +157,7 @@ struct g_mirror_event { #define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL #define G_MIRROR_DEVICE_FLAG_WAIT 0x0200000000000000ULL #define G_MIRROR_DEVICE_FLAG_DESTROYING 0x0400000000000000ULL +#define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL #define G_MIRROR_DEVICE_STATE_STARTING 0 #define G_MIRROR_DEVICE_STATE_RUNNING 1 Modified: stable/9/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror_ctl.c Fri May 25 03:46:56 2012 (r235967) +++ stable/9/sys/geom/mirror/g_mirror_ctl.c Fri May 25 04:26:14 2012 (r235968) @@ -560,7 +560,7 @@ g_mirror_ctl_remove(struct gctl_req *req const char *name; char param[16]; int *nargs; - u_int i; + u_int i, active; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -587,6 +587,7 @@ g_mirror_ctl_remove(struct gctl_req *req "first."); return; } + active = g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE); for (i = 1; i < (u_int)*nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); name = gctl_get_asciiparam(req, param); @@ -599,6 +600,16 @@ g_mirror_ctl_remove(struct gctl_req *req gctl_error(req, "No such provider: %s.", name); continue; } + if (disk->d_state == G_MIRROR_DISK_STATE_ACTIVE) { + if (active > 1) + active--; + else { + gctl_error(req, "%s: Can't remove the last " + "ACTIVE component %s.", sc->sc_geom->name, + name); + continue; + } + } g_mirror_event_send(disk, G_MIRROR_DISK_STATE_DESTROY, G_MIRROR_EVENT_DONTWAIT); } From owner-svn-src-all@FreeBSD.ORG Fri May 25 04:26:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A84471065670; Fri, 25 May 2012 04:26:44 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92C028FC08; Fri, 25 May 2012 04:26: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 q4P4Qi7s080113; Fri, 25 May 2012 04:26:44 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P4Qivm080109; Fri, 25 May 2012 04:26:44 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201205250426.q4P4Qivm080109@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 25 May 2012 04:26: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: r235969 - stable/8/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 04:26:44 -0000 Author: ae Date: Fri May 25 04:26:44 2012 New Revision: 235969 URL: http://svn.freebsd.org/changeset/base/235969 Log: MFC r235599: Introduce new device flag G_MIRROR_DEVICE_FLAG_TASTING. It should protect geom from destroying while it is tasting. MFC r235600: Prevent removing of the last active component from a mirror. PR: kern/154860 Reviewed by: pjd Tested by: Eugene Grosbein Modified: stable/8/sys/geom/mirror/g_mirror.c stable/8/sys/geom/mirror/g_mirror.h stable/8/sys/geom/mirror/g_mirror_ctl.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/8/sys/geom/mirror/g_mirror.c Fri May 25 04:26:14 2012 (r235968) +++ stable/8/sys/geom/mirror/g_mirror.c Fri May 25 04:26:44 2012 (r235969) @@ -1690,6 +1690,8 @@ g_mirror_can_destroy(struct g_mirror_sof gp = sc->sc_geom; if (gp->softc == NULL) return (1); + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_TASTING) != 0) + return (0); LIST_FOREACH(cp, &gp->consumer, consumer) { if (g_mirror_is_busy(sc, cp)) return (0); @@ -3051,6 +3053,7 @@ g_mirror_taste(struct g_class *mp, struc G_MIRROR_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); g_topology_unlock(); sx_xlock(&sc->sc_lock); + sc->sc_flags |= G_MIRROR_DEVICE_FLAG_TASTING; error = g_mirror_add_disk(sc, pp, &md); if (error != 0) { G_MIRROR_DEBUG(0, "Cannot add disk %s to %s (error=%d).", @@ -3063,6 +3066,12 @@ g_mirror_taste(struct g_class *mp, struc } gp = NULL; } + sc->sc_flags &= ~G_MIRROR_DEVICE_FLAG_TASTING; + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { + g_mirror_destroy(sc, G_MIRROR_DESTROY_HARD); + g_topology_lock(); + return (NULL); + } sx_xunlock(&sc->sc_lock); g_topology_lock(); return (gp); Modified: stable/8/sys/geom/mirror/g_mirror.h ============================================================================== --- stable/8/sys/geom/mirror/g_mirror.h Fri May 25 04:26:14 2012 (r235968) +++ stable/8/sys/geom/mirror/g_mirror.h Fri May 25 04:26:44 2012 (r235969) @@ -157,6 +157,7 @@ struct g_mirror_event { #define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL #define G_MIRROR_DEVICE_FLAG_WAIT 0x0200000000000000ULL #define G_MIRROR_DEVICE_FLAG_DESTROYING 0x0400000000000000ULL +#define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL #define G_MIRROR_DEVICE_STATE_STARTING 0 #define G_MIRROR_DEVICE_STATE_RUNNING 1 Modified: stable/8/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- stable/8/sys/geom/mirror/g_mirror_ctl.c Fri May 25 04:26:14 2012 (r235968) +++ stable/8/sys/geom/mirror/g_mirror_ctl.c Fri May 25 04:26:44 2012 (r235969) @@ -560,7 +560,7 @@ g_mirror_ctl_remove(struct gctl_req *req const char *name; char param[16]; int *nargs; - u_int i; + u_int i, active; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -587,6 +587,7 @@ g_mirror_ctl_remove(struct gctl_req *req "first."); return; } + active = g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE); for (i = 1; i < (u_int)*nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); name = gctl_get_asciiparam(req, param); @@ -599,6 +600,16 @@ g_mirror_ctl_remove(struct gctl_req *req gctl_error(req, "No such provider: %s.", name); continue; } + if (disk->d_state == G_MIRROR_DISK_STATE_ACTIVE) { + if (active > 1) + active--; + else { + gctl_error(req, "%s: Can't remove the last " + "ACTIVE component %s.", sc->sc_geom->name, + name); + continue; + } + } g_mirror_event_send(disk, G_MIRROR_DISK_STATE_DESTROY, G_MIRROR_EVENT_DONTWAIT); } From owner-svn-src-all@FreeBSD.ORG Fri May 25 04:27:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0854A1065746; Fri, 25 May 2012 04:27:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6E2A8FC0A; Fri, 25 May 2012 04:27: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 q4P4R8Tc080168; Fri, 25 May 2012 04:27:08 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P4R8dU080164; Fri, 25 May 2012 04:27:08 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201205250427.q4P4R8dU080164@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 25 May 2012 04:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235970 - stable/7/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 04:27:09 -0000 Author: ae Date: Fri May 25 04:27:08 2012 New Revision: 235970 URL: http://svn.freebsd.org/changeset/base/235970 Log: MFC r235599: Introduce new device flag G_MIRROR_DEVICE_FLAG_TASTING. It should protect geom from destroying while it is tasting. MFC r235600: Prevent removing of the last active component from a mirror. PR: kern/154860 Reviewed by: pjd Tested by: Eugene Grosbein Modified: stable/7/sys/geom/mirror/g_mirror.c stable/7/sys/geom/mirror/g_mirror.h stable/7/sys/geom/mirror/g_mirror_ctl.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/7/sys/geom/mirror/g_mirror.c Fri May 25 04:26:44 2012 (r235969) +++ stable/7/sys/geom/mirror/g_mirror.c Fri May 25 04:27:08 2012 (r235970) @@ -1690,6 +1690,8 @@ g_mirror_can_destroy(struct g_mirror_sof gp = sc->sc_geom; if (gp->softc == NULL) return (1); + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_TASTING) != 0) + return (0); LIST_FOREACH(cp, &gp->consumer, consumer) { if (g_mirror_is_busy(sc, cp)) return (0); @@ -3041,6 +3043,7 @@ g_mirror_taste(struct g_class *mp, struc G_MIRROR_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); g_topology_unlock(); sx_xlock(&sc->sc_lock); + sc->sc_flags |= G_MIRROR_DEVICE_FLAG_TASTING; error = g_mirror_add_disk(sc, pp, &md); if (error != 0) { G_MIRROR_DEBUG(0, "Cannot add disk %s to %s (error=%d).", @@ -3053,6 +3056,12 @@ g_mirror_taste(struct g_class *mp, struc } gp = NULL; } + sc->sc_flags &= ~G_MIRROR_DEVICE_FLAG_TASTING; + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { + g_mirror_destroy(sc, G_MIRROR_DESTROY_HARD); + g_topology_lock(); + return (NULL); + } sx_xunlock(&sc->sc_lock); g_topology_lock(); return (gp); Modified: stable/7/sys/geom/mirror/g_mirror.h ============================================================================== --- stable/7/sys/geom/mirror/g_mirror.h Fri May 25 04:26:44 2012 (r235969) +++ stable/7/sys/geom/mirror/g_mirror.h Fri May 25 04:27:08 2012 (r235970) @@ -157,6 +157,7 @@ struct g_mirror_event { #define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL #define G_MIRROR_DEVICE_FLAG_WAIT 0x0200000000000000ULL #define G_MIRROR_DEVICE_FLAG_DESTROYING 0x0400000000000000ULL +#define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL #define G_MIRROR_DEVICE_STATE_STARTING 0 #define G_MIRROR_DEVICE_STATE_RUNNING 1 Modified: stable/7/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- stable/7/sys/geom/mirror/g_mirror_ctl.c Fri May 25 04:26:44 2012 (r235969) +++ stable/7/sys/geom/mirror/g_mirror_ctl.c Fri May 25 04:27:08 2012 (r235970) @@ -560,7 +560,7 @@ g_mirror_ctl_remove(struct gctl_req *req const char *name; char param[16]; int *nargs; - u_int i; + u_int i, active; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -587,6 +587,7 @@ g_mirror_ctl_remove(struct gctl_req *req "first."); return; } + active = g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE); for (i = 1; i < (u_int)*nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); name = gctl_get_asciiparam(req, param); @@ -599,6 +600,16 @@ g_mirror_ctl_remove(struct gctl_req *req gctl_error(req, "No such provider: %s.", name); continue; } + if (disk->d_state == G_MIRROR_DISK_STATE_ACTIVE) { + if (active > 1) + active--; + else { + gctl_error(req, "%s: Can't remove the last " + "ACTIVE component %s.", sc->sc_geom->name, + name); + continue; + } + } g_mirror_event_send(disk, G_MIRROR_DISK_STATE_DESTROY, G_MIRROR_EVENT_DONTWAIT); } From owner-svn-src-all@FreeBSD.ORG Fri May 25 04:42:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80FE6106566B; Fri, 25 May 2012 04:42:19 +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 6A0A58FC15; Fri, 25 May 2012 04:42:19 +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 q4P4gJvh080847; Fri, 25 May 2012 04:42:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P4gJuM080843; Fri, 25 May 2012 04:42:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205250442.q4P4gJuM080843@svn.freebsd.org> From: Xin LI Date: Fri, 25 May 2012 04:42:19 +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: r235971 - stable/9/contrib/netcat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 04:42:19 -0000 Author: delphij Date: Fri May 25 04:42:18 2012 New Revision: 235971 URL: http://svn.freebsd.org/changeset/base/235971 Log: MFC: netcat from OpenBSD 5.1. Modified: stable/9/contrib/netcat/FREEBSD-vendor stable/9/contrib/netcat/nc.1 stable/9/contrib/netcat/netcat.c Directory Properties: stable/9/contrib/netcat/ (props changed) Modified: stable/9/contrib/netcat/FREEBSD-vendor ============================================================================== --- stable/9/contrib/netcat/FREEBSD-vendor Fri May 25 04:27:08 2012 (r235970) +++ stable/9/contrib/netcat/FREEBSD-vendor Fri May 25 04:42:18 2012 (r235971) @@ -1,5 +1,5 @@ # $FreeBSD$ Project: netcat (aka src/usr.bin/nc in OpenBSD) ProjectURL: http://www.openbsd.org/ -Version: 4.7 +Version: 5.1 License: BSD Modified: stable/9/contrib/netcat/nc.1 ============================================================================== --- stable/9/contrib/netcat/nc.1 Fri May 25 04:27:08 2012 (r235970) +++ stable/9/contrib/netcat/nc.1 Fri May 25 04:42:18 2012 (r235971) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.57 2011/01/09 22:16:46 jeremy Exp $ +.\" $OpenBSD: nc.1,v 1.60 2012/02/07 12:11:43 lum Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2011 +.Dd October 4, 2011 .Dt NC 1 .Os .Sh NAME @@ -45,7 +45,7 @@ .Op Fl P Ar proxy_username .Op Fl p Ar source_port .Op Fl s Ar source -.Op Fl T Ar ToS +.Op Fl T Ar toskeyword .Op Fl V Ar rtable .Op Fl w Ar timeout .Op Fl X Ar proxy_protocol @@ -186,14 +186,21 @@ to create and use so that datagrams can It is an error to use this option in conjunction with the .Fl l option. -.It Fl T Ar ToS -Specifies IP Type of Service (ToS) for the connection. -Valid values are the tokens -.Dq lowdelay , -.Dq throughput , -.Dq reliability , -or an 8-bit hexadecimal value preceded by -.Dq 0x . +.It Fl T Ar toskeyword +Change IPv4 TOS value. +.Ar toskeyword +may be one of +.Ar critical , +.Ar inetcontrol , +.Ar lowdelay , +.Ar netcontrol , +.Ar throughput , +.Ar reliability , +or one of the DiffServ Code Points: +.Ar ef , +.Ar af11 ... af43 , +.Ar cs0 ... cs7 ; +or a number in either hex or decimal. .It Fl t Causes .Nm @@ -227,9 +234,9 @@ Have .Nm give more verbose output. .It Fl w Ar timeout -If a connection and stdin are idle for more than +Connections which cannot be established or are idle timeout after .Ar timeout -seconds, then the connection is silently closed. +seconds. The .Fl w flag has no effect on the @@ -480,8 +487,15 @@ Original implementation by *Hobbit* Rewritten with IPv6 support by .An Eric Jackson Aq ericj@monkey.org . .Sh CAVEATS -UDP port scans will always succeed -(i.e. report the port as open), -rendering the +UDP port scans using the .Fl uz -combination of flags relatively useless. +combination of flags will always report success irrespective of +the target machine's state. +However, +in conjunction with a traffic sniffer either on the target machine +or an intermediary device, +the +.Fl uz +combination could be useful for communications diagnostics. +Note that the amount of UDP traffic generated may be limited either +due to hardware resources and/or configuration settings. Modified: stable/9/contrib/netcat/netcat.c ============================================================================== --- stable/9/contrib/netcat/netcat.c Fri May 25 04:27:08 2012 (r235970) +++ stable/9/contrib/netcat/netcat.c Fri May 25 04:42:18 2012 (r235971) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.100 2011/01/09 22:16:46 jeremy Exp $ */ +/* $OpenBSD: netcat.c,v 1.105 2012/02/09 06:25:35 lum Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -107,6 +107,7 @@ void help(void); int local_listen(char *, char *, struct addrinfo); void readwrite(int); int remote_connect(const char *, const char *, struct addrinfo); +int timeout_connect(int, const struct sockaddr *, socklen_t); int socks_connect(const char *, const char *, struct addrinfo, const char *, const char *, struct addrinfo, int, const char *); int udptest(int); @@ -114,7 +115,7 @@ int unix_bind(char *); int unix_connect(char *); int unix_listen(char *); void set_common_sockopts(int); -int parse_iptos(char *); +int map_tos(char *, int *); void usage(int); #ifdef IPSEC @@ -281,7 +282,18 @@ main(int argc, char *argv[]) Sflag = 1; break; case 'T': - Tflag = parse_iptos(optarg); + errstr = NULL; + errno = 0; + if (map_tos(optarg, &Tflag)) + break; + if (strlen(optarg) > 1 && optarg[0] == '0' && + optarg[1] == 'x') + Tflag = (int)strtol(optarg, NULL, 16); + else + Tflag = (int)strtonum(optarg, 0, 255, + &errstr); + if (Tflag < 0 || Tflag > 255 || errstr || errno) + errx(1, "illegal tos value %s", optarg); break; default: usage(1); @@ -633,7 +645,7 @@ remote_connect(const char *host, const c set_common_sockopts(s); - if (connect(s, res0->ai_addr, res0->ai_addrlen) == 0) + if (timeout_connect(s, res0->ai_addr, res0->ai_addrlen) == 0) break; else if (vflag) warn("connect to %s port %s (%s) failed", host, port, @@ -648,6 +660,43 @@ remote_connect(const char *host, const c return (s); } +int +timeout_connect(int s, const struct sockaddr *name, socklen_t namelen) +{ + struct pollfd pfd; + socklen_t optlen; + int flags, optval; + int ret; + + if (timeout != -1) { + flags = fcntl(s, F_GETFL, 0); + if (fcntl(s, F_SETFL, flags | O_NONBLOCK) == -1) + err(1, "set non-blocking mode"); + } + + if ((ret = connect(s, name, namelen)) != 0 && errno == EINPROGRESS) { + pfd.fd = s; + pfd.events = POLLOUT; + if ((ret = poll(&pfd, 1, timeout)) == 1) { + optlen = sizeof(optval); + if ((ret = getsockopt(s, SOL_SOCKET, SO_ERROR, + &optval, &optlen)) == 0) { + errno = optval; + ret = optval == 0 ? 0 : -1; + } + } else if (ret == 0) { + errno = ETIMEDOUT; + ret = -1; + } else + err(1, "poll failed"); + } + + if (timeout != -1 && fcntl(s, F_SETFL, flags) == -1) + err(1, "restoring flags"); + + return (ret); +} + /* * local_listen() * Returns a socket listening on a local port, binds to specified source @@ -818,7 +867,7 @@ atelnet(int nfd, unsigned char *buf, uns /* * build_ports() - * Build an array or ports in portlist[], listing each port + * Build an array of ports in portlist[], listing each port * that we should try to connect to. */ void @@ -830,9 +879,6 @@ build_ports(char *p) int x = 0; if ((n = strchr(p, '-')) != NULL) { - if (lflag) - errx(1, "Cannot use -l with multiple ports!"); - *n = '\0'; n++; @@ -884,8 +930,7 @@ build_ports(char *p) /* * udptest() * Do a few writes to see if the UDP port is there. - * XXX - Better way of doing this? Doesn't work for IPv6. - * Also fails after around 100 ports checked. + * Fails once PF state table is full. */ int udptest(int s) @@ -946,20 +991,51 @@ set_common_sockopts(int s) } int -parse_iptos(char *s) +map_tos(char *s, int *val) { - int tos = -1; + /* DiffServ Codepoints and other TOS mappings */ + const struct toskeywords { + const char *keyword; + int val; + } *t, toskeywords[] = { + { "af11", IPTOS_DSCP_AF11 }, + { "af12", IPTOS_DSCP_AF12 }, + { "af13", IPTOS_DSCP_AF13 }, + { "af21", IPTOS_DSCP_AF21 }, + { "af22", IPTOS_DSCP_AF22 }, + { "af23", IPTOS_DSCP_AF23 }, + { "af31", IPTOS_DSCP_AF31 }, + { "af32", IPTOS_DSCP_AF32 }, + { "af33", IPTOS_DSCP_AF33 }, + { "af41", IPTOS_DSCP_AF41 }, + { "af42", IPTOS_DSCP_AF42 }, + { "af43", IPTOS_DSCP_AF43 }, + { "critical", IPTOS_PREC_CRITIC_ECP }, + { "cs0", IPTOS_DSCP_CS0 }, + { "cs1", IPTOS_DSCP_CS1 }, + { "cs2", IPTOS_DSCP_CS2 }, + { "cs3", IPTOS_DSCP_CS3 }, + { "cs4", IPTOS_DSCP_CS4 }, + { "cs5", IPTOS_DSCP_CS5 }, + { "cs6", IPTOS_DSCP_CS6 }, + { "cs7", IPTOS_DSCP_CS7 }, + { "ef", IPTOS_DSCP_EF }, + { "inetcontrol", IPTOS_PREC_INTERNETCONTROL }, + { "lowdelay", IPTOS_LOWDELAY }, + { "netcontrol", IPTOS_PREC_NETCONTROL }, + { "reliability", IPTOS_RELIABILITY }, + { "throughput", IPTOS_THROUGHPUT }, + { NULL, -1 }, + }; + + for (t = toskeywords; t->keyword != NULL; t++) { + if (strcmp(s, t->keyword) == 0) { + *val = t->val; + return (1); + } + } - if (strcmp(s, "lowdelay") == 0) - return (IPTOS_LOWDELAY); - if (strcmp(s, "throughput") == 0) - return (IPTOS_THROUGHPUT); - if (strcmp(s, "reliability") == 0) - return (IPTOS_RELIABILITY); - - if (sscanf(s, "0x%x", &tos) != 1 || tos < 0 || tos > 0xff) - errx(1, "invalid IP Type of Service"); - return (tos); + return (0); } void @@ -990,7 +1066,7 @@ help(void) \t-r Randomize remote ports\n\ \t-S Enable the TCP MD5 signature option\n\ \t-s addr\t Local source address\n\ - \t-T ToS\t Set IP Type of Service\n\ + \t-T toskeyword\tSet IP Type of Service\n\ \t-t Answer TELNET negotiation\n\ \t-U Use UNIX domain socket\n\ \t-u UDP mode\n\ From owner-svn-src-all@FreeBSD.ORG Fri May 25 05:01:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A1631065670; Fri, 25 May 2012 05:01:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22ACC8FC0A; Fri, 25 May 2012 05:01: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 q4P51RBP081656; Fri, 25 May 2012 05:01:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P51R1u081644; Fri, 25 May 2012 05:01:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205250501.q4P51R1u081644@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 May 2012 05:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235972 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5416 ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 05:01:28 -0000 Author: adrian Date: Fri May 25 05:01:27 2012 New Revision: 235972 URL: http://svn.freebsd.org/changeset/base/235972 Log: oops - ath_hal_disablepcie is actually destined for another purpose, not to disable the PCIe PHY in prepration for reset. Extend the enablepci method to have a "poweroff" flag, which if equal to true means the hardware is about to go to sleep. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ah.h Fri May 25 05:01:27 2012 (r235972) @@ -832,7 +832,8 @@ struct ath_hal { HAL_BOOL bChannelChange, HAL_STATUS *status); HAL_BOOL __ahdecl(*ah_phyDisable)(struct ath_hal *); HAL_BOOL __ahdecl(*ah_disable)(struct ath_hal *); - void __ahdecl(*ah_configPCIE)(struct ath_hal *, HAL_BOOL restore); + void __ahdecl(*ah_configPCIE)(struct ath_hal *, HAL_BOOL restore, + HAL_BOOL power_off); void __ahdecl(*ah_disablePCIE)(struct ath_hal *); void __ahdecl(*ah_setPCUConfig)(struct ath_hal *); HAL_BOOL __ahdecl(*ah_perCalibration)(struct ath_hal*, Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ah_internal.h Fri May 25 05:01:27 2012 (r235972) @@ -355,8 +355,8 @@ struct ath_hal_private { AH_PRIVATE(_ah)->ah_getNfAdjust(_ah, _c) #define ath_hal_getNoiseFloor(_ah, _nfArray) \ AH_PRIVATE(_ah)->ah_getNoiseFloor(_ah, _nfArray) -#define ath_hal_configPCIE(_ah, _reset) \ - (_ah)->ah_configPCIE(_ah, _reset) +#define ath_hal_configPCIE(_ah, _reset, _poweroff) \ + (_ah)->ah_configPCIE(_ah, _reset, _poweroff) #define ath_hal_disablePCIE(_ah) \ (_ah)->ah_disablePCIE(_ah) #define ath_hal_setInterrupts(_ah, _mask) \ Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -33,7 +33,8 @@ static HAL_BOOL ar5210GetChannelEdges(st static HAL_BOOL ar5210GetChipPowerLimits(struct ath_hal *ah, struct ieee80211_channel *chan); -static void ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_on); static void ar5210DisablePCIE(struct ath_hal *ah); static const struct ath_hal_private ar5210hal = {{ @@ -332,7 +333,7 @@ ar5210GetChipPowerLimits(struct ath_hal } static void -ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { } Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -33,7 +33,8 @@ static HAL_BOOL ar5211GetChannelEdges(st static HAL_BOOL ar5211GetChipPowerLimits(struct ath_hal *ah, struct ieee80211_channel *chan); -static void ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar5211DisablePCIE(struct ath_hal *ah); static const struct ath_hal_private ar5211hal = {{ @@ -455,7 +456,7 @@ ar5211GetChipPowerLimits(struct ath_hal } static void -ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { } Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -29,7 +29,8 @@ #define AH_5212_COMMON #include "ar5212/ar5212.ini" -static void ar5212ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5212ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar5212DisablePCIE(struct ath_hal *ah); static const struct ath_hal_private ar5212hal = {{ @@ -370,7 +371,7 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s if (AH_PRIVATE(ah)->ah_ispcie) { /* XXX: build flag to disable this? */ - ath_hal_configPCIE(ah, AH_FALSE); + ath_hal_configPCIE(ah, AH_FALSE, AH_FALSE); } if (!ar5212ChipTest(ah)) { @@ -666,7 +667,7 @@ ar5212GetChannelEdges(struct ath_hal *ah * XXX Clean up the magic numbers. */ static void -ar5212ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar5212ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00); OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -30,7 +30,8 @@ #include "ar5416/ar5416.ini" -static void ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar5416DisablePCIE(struct ath_hal *ah); static void ar5416WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan); @@ -459,13 +460,13 @@ void ar5416AttachPCIE(struct ath_hal *ah) { if (AH_PRIVATE(ah)->ah_ispcie) - ath_hal_configPCIE(ah, AH_FALSE); + ath_hal_configPCIE(ah, AH_FALSE, AH_FALSE); else ath_hal_disablePCIE(ah); } static void -ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { if (AH_PRIVATE(ah)->ah_ispcie && !restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -61,7 +61,8 @@ static const HAL_PERCAL_DATA ar9280_adc_ .calPostProc = ar5416AdcDcCalibration }; -static void ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar9280DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9280FillCapabilityInfo(struct ath_hal *ah); static void ar9280WriteIni(struct ath_hal *ah, @@ -417,7 +418,7 @@ bad: } static void -ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { if (AH_PRIVATE(ah)->ah_ispcie && !restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -66,7 +66,8 @@ static const HAL_PERCAL_DATA ar9280_adc_ .calPostProc = ar5416AdcDcCalibration }; -static void ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar9285DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9285FillCapabilityInfo(struct ath_hal *ah); static void ar9285WriteIni(struct ath_hal *ah, @@ -364,7 +365,7 @@ bad: } static void -ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { if (AH_PRIVATE(ah)->ah_ispcie && !restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -65,7 +65,8 @@ static const HAL_PERCAL_DATA ar9287_adc_ .calPostProc = ar5416AdcDcCalibration }; -static void ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar9287DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9287FillCapabilityInfo(struct ath_hal *ah); static void ar9287WriteIni(struct ath_hal *ah, @@ -359,13 +360,14 @@ bad: } static void -ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { if (AH_PRIVATE(ah)->ah_ispcie && !restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); OS_DELAY(1000); OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); - OS_REG_WRITE(ah, AR_WA, AR9285_WA_DEFAULT); /* Yes, Kiwi uses the Kite PCIe PHY WA */ + /* Yes, Kiwi uses the Kite PCIe PHY WA */ + OS_REG_WRITE(ah, AR_WA, AR9285_WA_DEFAULT); } } Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/if_ath.c Fri May 25 05:01:27 2012 (r235972) @@ -1319,8 +1319,14 @@ ath_suspend(struct ath_softc *sc) * CardBus detaches the device. */ - /* For PCIe, this matters */ - ath_hal_disablepcie(sc->sc_ah); + /* + * XXX ensure none of the taskqueues are running + * XXX ensure sc_invalid is 1 + * XXX ensure the calibration callout is disabled + */ + + /* Disable the PCIe PHY, complete with workarounds */ + ath_hal_enablepcie(sc->sc_ah, 1, 1); } /* @@ -1354,7 +1360,7 @@ ath_resume(struct ath_softc *sc) __func__, ifp->if_flags); /* Re-enable PCIe, re-enable the PCIe bus */ - ath_hal_enablepcie(ah, 1); + ath_hal_enablepcie(ah, 0, 0); /* * Must reset the chip before we reload the Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/if_athvar.h Fri May 25 05:01:27 2012 (r235972) @@ -998,8 +998,8 @@ void ath_intr(void *); /* * PCIe suspend/resume/poweron/poweroff related macros */ -#define ath_hal_enablepcie(_ah, _restore) \ - ((*(_ah)->ah_configPCIE)((_ah), (_restore))) +#define ath_hal_enablepcie(_ah, _restore, _poweroff) \ + ((*(_ah)->ah_configPCIE)((_ah), (_restore), (_poweroff))) #define ath_hal_disablepcie(_ah) \ ((*(_ah)->ah_disablePCIE)((_ah))) From owner-svn-src-all@FreeBSD.ORG Fri May 25 05:28:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97EBD106566B; Fri, 25 May 2012 05:28:14 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83B558FC14; Fri, 25 May 2012 05:28: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 q4P5SEp6082739; Fri, 25 May 2012 05:28:14 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P5SEGl082737; Fri, 25 May 2012 05:28:14 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205250528.q4P5SEGl082737@svn.freebsd.org> From: Alan Cox Date: Fri, 25 May 2012 05:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235973 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 05:28:14 -0000 Author: alc Date: Fri May 25 05:28:14 2012 New Revision: 235973 URL: http://svn.freebsd.org/changeset/base/235973 Log: Correct an error in pmap_pv_reclaim(). In a rare case, when it should have returned NULL, it might instead return a pointer to a page that it had just unmapped. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri May 25 05:01:27 2012 (r235972) +++ head/sys/amd64/amd64/pmap.c Fri May 25 05:28:14 2012 (r235973) @@ -2058,14 +2058,14 @@ pmap_pv_reclaim(pmap_t locked_pmap) pt_entry_t *pte, tpte; pv_entry_t pv; vm_offset_t va; - vm_page_t free, m; + vm_page_t free, m, m_pc; uint64_t inuse, freemask; int bit, field, freed; rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); pmap = NULL; - free = m = NULL; + free = m_pc = NULL; TAILQ_INIT(&newtail); while ((pc = TAILQ_FIRST(&pv_chunks)) != NULL && free == NULL) { TAILQ_REMOVE(&pv_chunks, pc, pc_lru); @@ -2141,8 +2141,8 @@ pmap_pv_reclaim(pmap_t locked_pmap) PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); /* Entire chunk is free; return it. */ - m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); - dump_drop_page(m->phys_addr); + m_pc = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); + dump_drop_page(m_pc->phys_addr); break; } TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); @@ -2157,15 +2157,15 @@ pmap_pv_reclaim(pmap_t locked_pmap) if (pmap != locked_pmap) PMAP_UNLOCK(pmap); } - if (m == NULL && free != NULL) { - m = free; - free = m->right; + if (m_pc == NULL && free != NULL) { + m_pc = free; + free = m_pc->right; /* Recycle a freed page table page. */ - m->wire_count = 1; + m_pc->wire_count = 1; atomic_add_int(&cnt.v_wire_count, 1); } pmap_free_zero_pages(free); - return (m); + return (m_pc); } /* From owner-svn-src-all@FreeBSD.ORG Fri May 25 06:41:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E930E106566C; Fri, 25 May 2012 06:41:08 +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 D3D948FC0C; Fri, 25 May 2012 06:41: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 q4P6f8JO085663; Fri, 25 May 2012 06:41:08 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P6f8xm085661; Fri, 25 May 2012 06:41:08 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205250641.q4P6f8xm085661@svn.freebsd.org> From: Dimitry Andric Date: Fri, 25 May 2012 06:41:08 +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: r235974 - stable/9/contrib/ncurses/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 06:41:09 -0000 Author: dim Date: Fri May 25 06:41:08 2012 New Revision: 235974 URL: http://svn.freebsd.org/changeset/base/235974 Log: MFC r235773: Correct use_screen() and use_window() prototypes in curs_threads(3x). Submitted by: Yanhui Shen Modified: stable/9/contrib/ncurses/man/curs_threads.3x Directory Properties: stable/9/contrib/ncurses/ (props changed) Modified: stable/9/contrib/ncurses/man/curs_threads.3x ============================================================================== --- stable/9/contrib/ncurses/man/curs_threads.3x Fri May 25 05:28:14 2012 (r235973) +++ stable/9/contrib/ncurses/man/curs_threads.3x Fri May 25 06:41:08 2012 (r235974) @@ -45,9 +45,9 @@ .br \fBint set_tabsize(int size);\fR .br -\fBint use_screen(SCREEN *scr, NCURSES_WINDOW_CB func, void *data);\fR +\fBint use_screen(SCREEN *scr, NCURSES_SCREEN_CB func, void *data);\fR .br -\fBint use_window(WINDOW *win, NCURSES_SCREEN_CB func, void *data);\fR +\fBint use_window(WINDOW *win, NCURSES_WINDOW_CB func, void *data);\fR .br .SH DESCRIPTION This implementation can be configured to provide rudimentary support From owner-svn-src-all@FreeBSD.ORG Fri May 25 06:48:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 678A7106566B; Fri, 25 May 2012 06:48:43 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 525DB8FC0C; Fri, 25 May 2012 06:48: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 q4P6mhM0086074; Fri, 25 May 2012 06:48:43 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P6mhPP086072; Fri, 25 May 2012 06:48:43 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205250648.q4P6mhPP086072@svn.freebsd.org> From: Grzegorz Bernacki Date: Fri, 25 May 2012 06:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235975 - head/usr.bin/gprof X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 06:48:43 -0000 Author: gber Date: Fri May 25 06:48:42 2012 New Revision: 235975 URL: http://svn.freebsd.org/changeset/base/235975 Log: Fix resolving symbol names on ARM. On ARM, binutils are adding '$a' symbols in the symbol table for every function (in addition to normal symbol). When gprof(1) looks up symbol name, it often reads '$a' instead of proper function name, because it find it first. With this fix, when read symbol name begins with '$' and previous symbol has the same address, it will use previous symbol name (which is proper function name). Obtained from: Semihalf Modified: head/usr.bin/gprof/lookup.c Modified: head/usr.bin/gprof/lookup.c ============================================================================== --- head/usr.bin/gprof/lookup.c Fri May 25 06:41:08 2012 (r235974) +++ head/usr.bin/gprof/lookup.c Fri May 25 06:48:42 2012 (r235975) @@ -66,6 +66,12 @@ nllookup( address ) printf( "[nllookup] %d (%d) probes\n" , probes , nname-1 ); } # endif /* DEBUG */ +#if defined(__arm__) + if (nl[middle].name[0] == '$' && + nl[middle-1].value == nl[middle].value) + middle--; +#endif + return &nl[ middle ]; } if ( nl[ middle ].value > address ) { From owner-svn-src-all@FreeBSD.ORG Fri May 25 07:23:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71F3D106566B; Fri, 25 May 2012 07:23:25 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A6458FC08; Fri, 25 May 2012 07:23:25 +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 q4P7NPsK087555; Fri, 25 May 2012 07:23:25 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P7NPoM087552; Fri, 25 May 2012 07:23:25 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201205250723.q4P7NPoM087552@svn.freebsd.org> From: Fabien Thomas Date: Fri, 25 May 2012 07:23:25 +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: r235976 - stable/8/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 07:23:25 -0000 Author: fabient Date: Fri May 25 07:23:24 2012 New Revision: 235976 URL: http://svn.freebsd.org/changeset/base/235976 Log: MFC r233611: - Support inlined location in calltree output. In case of multiple level of inlining all the locations are flattened. Require recent binutils/addr2line (head works or binutils from ports with the right $PATH order). - Multiple fixes in the calltree output (recursion case, ...) - Fix the calltree top view that previously hide some shared nodes. Tested with Kcachegrind(kdesdk4)/qcachegrind(head). Sponsored by: NETASQ Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c stable/8/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Fri May 25 06:48:42 2012 (r235975) +++ stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Fri May 25 07:23:24 2012 (r235976) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009, Fabien Thomas + * Copyright (c) 2012, Fabien Thomas * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,20 +59,18 @@ __FBSDID("$FreeBSD$"); #include "pmcstat_top.h" #include "pmcpl_calltree.h" -#define PMCPL_CT_GROWSIZE 4 - -static pmcstat_interned_string pmcpl_ct_prevfn; +#define PMCPL_CT_GROWSIZE 4 static int pmcstat_skiplink = 0; struct pmcpl_ct_node; /* Get the sample value for PMC a. */ -#define PMCPL_CT_SAMPLE(a, b) \ +#define PMCPL_CT_SAMPLE(a, b) \ ((a) < (b)->npmcs ? (b)->sb[a] : 0) /* Get the sample value in percent related to rsamples. */ -#define PMCPL_CT_SAMPLEP(a, b) \ +#define PMCPL_CT_SAMPLEP(a, b) \ (PMCPL_CT_SAMPLE(a, b) * 100.0 / rsamples->sb[a]) struct pmcpl_ct_sample { @@ -96,10 +94,13 @@ struct pmcpl_ct_instr { * Each calltree node is tracked by a pmcpl_ct_node struct. */ struct pmcpl_ct_node { -#define PMCPL_PCT_TAG 0x00000001 /* Loop detection. */ - uint32_t pct_flags; struct pmcstat_image *pct_image; uintfptr_t pct_func; + + struct pmcstat_symbol *pct_sym; + pmcstat_interned_string pct_ifl; + pmcstat_interned_string pct_ifn; + struct pmcpl_ct_sample pct_samples; int pct_narc; @@ -110,17 +111,25 @@ struct pmcpl_ct_node { int pct_ninstr; int pct_instr_c; struct pmcpl_ct_instr *pct_instr; + +#define PMCPL_PCT_ADDR 0 +#define PMCPL_PCT_NAME 1 + char pct_type; +#define PMCPL_PCT_WHITE 0 +#define PMCPL_PCT_GREY 1 +#define PMCPL_PCT_BLACK 2 + char pct_color; }; struct pmcpl_ct_node_hash { struct pmcpl_ct_node *pch_ctnode; - LIST_ENTRY(pmcpl_ct_node_hash) pch_next; + STAILQ_ENTRY(pmcpl_ct_node_hash) pch_next; }; struct pmcpl_ct_sample pmcpl_ct_callid; -#define PMCPL_CT_MAXCOL PMC_CALLCHAIN_DEPTH_MAX -#define PMCPL_CT_MAXLINE 1024 /* TODO: dynamic. */ +#define PMCPL_CT_MAXCOL PMC_CALLCHAIN_DEPTH_MAX +#define PMCPL_CT_MAXLINE 1024 /* TODO: dynamic. */ struct pmcpl_ct_line { unsigned ln_sum; @@ -128,12 +137,13 @@ struct pmcpl_ct_line { }; struct pmcpl_ct_line pmcpl_ct_topmax[PMCPL_CT_MAXLINE+1]; -struct pmcpl_ct_node *pmcpl_ct_topscreen[PMCPL_CT_MAXCOL+1][PMCPL_CT_MAXLINE+1]; +struct pmcpl_ct_node + *pmcpl_ct_topscreen[PMCPL_CT_MAXCOL+1][PMCPL_CT_MAXLINE+1]; /* * All nodes indexed by function/image name are placed in a hash table. */ -static LIST_HEAD(,pmcpl_ct_node_hash) pmcpl_ct_node_hash[PMCSTAT_NHASH]; +static STAILQ_HEAD(,pmcpl_ct_node_hash) pmcpl_ct_node_hash[PMCSTAT_NHASH]; /* * Root node for the graph. @@ -257,7 +267,8 @@ pmcpl_ct_instr_grow(int cursize, int *ma */ static void -pmcpl_ct_instr_add(struct pmcpl_ct_node *ct, int pmcin, uintfptr_t pc) +pmcpl_ct_instr_add(struct pmcpl_ct_node *ct, int pmcin, + uintfptr_t pc, unsigned v) { int i; struct pmcpl_ct_instr *in; @@ -266,7 +277,7 @@ pmcpl_ct_instr_add(struct pmcpl_ct_node if (ct->pct_instr[i].pctf_func == pc) { in = &ct->pct_instr[i]; pmcpl_ct_samples_grow(&in->pctf_samples); - in->pctf_samples.sb[pmcin]++; + in->pctf_samples.sb[pmcin] += v; return; } } @@ -276,7 +287,7 @@ pmcpl_ct_instr_add(struct pmcpl_ct_node in->pctf_func = pc; pmcpl_ct_samples_init(&in->pctf_samples); pmcpl_ct_samples_grow(&in->pctf_samples); - in->pctf_samples.sb[pmcin] = 1; + in->pctf_samples.sb[pmcin] = v; ct->pct_ninstr++; } @@ -285,19 +296,19 @@ pmcpl_ct_instr_add(struct pmcpl_ct_node */ static struct pmcpl_ct_node * -pmcpl_ct_node_allocate(struct pmcstat_image *image, uintfptr_t pc) +pmcpl_ct_node_allocate(void) { struct pmcpl_ct_node *ct; if ((ct = malloc(sizeof(*ct))) == NULL) err(EX_OSERR, "ERROR: Cannot allocate callgraph node"); - ct->pct_flags = 0; - ct->pct_image = image; - ct->pct_func = pc; - pmcpl_ct_samples_init(&ct->pct_samples); + ct->pct_sym = NULL; + ct->pct_image = NULL; + ct->pct_func = 0; + ct->pct_narc = 0; ct->pct_arc_c = 0; ct->pct_arc = NULL; @@ -306,6 +317,8 @@ pmcpl_ct_node_allocate(struct pmcstat_im ct->pct_instr_c = 0; ct->pct_instr = NULL; + ct->pct_color = PMCPL_PCT_WHITE; + return (ct); } @@ -339,10 +352,10 @@ pmcpl_ct_node_cleartag(void) struct pmcpl_ct_node_hash *pch; for (i = 0; i < PMCSTAT_NHASH; i++) - LIST_FOREACH(pch, &pmcpl_ct_node_hash[i], pch_next) - pch->pch_ctnode->pct_flags &= ~PMCPL_PCT_TAG; + STAILQ_FOREACH(pch, &pmcpl_ct_node_hash[i], pch_next) + pch->pch_ctnode->pct_color = PMCPL_PCT_WHITE; - pmcpl_ct_root->pct_flags &= ~PMCPL_PCT_TAG; + pmcpl_ct_root->pct_color = PMCPL_PCT_WHITE; } /* @@ -356,11 +369,9 @@ pmcpl_ct_node_dumptop(int pmcin, struct int i, terminal; struct pmcpl_ct_arc *arc; - if (ct->pct_flags & PMCPL_PCT_TAG) + if (ct->pct_color == PMCPL_PCT_GREY) return 0; - ct->pct_flags |= PMCPL_PCT_TAG; - if (x >= PMCPL_CT_MAXCOL) { pmcpl_ct_topscreen[x][*y] = NULL; return 1; @@ -375,11 +386,11 @@ pmcpl_ct_node_dumptop(int pmcin, struct terminal = 1; for (i = 0; i < ct->pct_narc; i++) { arc = &ct->pct_arc[i]; - if (PMCPL_CT_SAMPLE(pmcin, + if (arc->pcta_child->pct_color != PMCPL_PCT_GREY && + PMCPL_CT_SAMPLE(pmcin, &arc->pcta_samples) != 0 && PMCPL_CT_SAMPLEP(pmcin, - &arc->pcta_samples) > pmcstat_threshold && - (arc->pcta_child->pct_flags & PMCPL_PCT_TAG) == 0) { + &arc->pcta_samples) > pmcstat_threshold) { terminal = 0; break; } @@ -396,6 +407,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct return 0; } + ct->pct_color = PMCPL_PCT_GREY; for (i = 0; i < ct->pct_narc; i++) { if (PMCPL_CT_SAMPLE(pmcin, &ct->pct_arc[i].pcta_samples) == 0) @@ -404,10 +416,13 @@ pmcpl_ct_node_dumptop(int pmcin, struct &ct->pct_arc[i].pcta_samples) > pmcstat_threshold) { if (pmcpl_ct_node_dumptop(pmcin, ct->pct_arc[i].pcta_child, - rsamples, x+1, y)) + rsamples, x+1, y)) { + ct->pct_color = PMCPL_PCT_BLACK; return 1; + } } } + ct->pct_color = PMCPL_PCT_BLACK; return 0; } @@ -447,7 +462,6 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s float v; char ns[30], vs[10], is[20]; struct pmcpl_ct_node *ct; - struct pmcstat_symbol *sym; const char *space = " "; /* @@ -504,10 +518,9 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s strlcpy(ns, ".", sizeof(ns)); ns_len = 1; } else { - sym = pmcstat_symbol_search(ct->pct_image, ct->pct_func); - if (sym != NULL) { + if (ct->pct_sym != NULL) { ns_len = snprintf(ns, sizeof(ns), "%s", - pmcstat_string_unintern(sym->ps_name)); + pmcstat_string_unintern(ct->pct_sym->ps_name)); } else ns_len = snprintf(ns, sizeof(ns), "%p", (void *)ct->pct_func); @@ -548,7 +561,6 @@ pmcpl_ct_topdisplay(void) rsamples = &r; pmcpl_ct_samples_root(rsamples); - pmcpl_ct_node_cleartag(); PMCSTAT_PRINTW("%5.5s %s\n", "%SAMP", "CALLTREE"); @@ -589,81 +601,92 @@ pmcpl_ct_topkeypress(int c, WINDOW *w) * `ppm'. */ -static struct pmcpl_ct_node * -pmcpl_ct_node_hash_lookup_pc(struct pmcpl_ct_node *parent, - struct pmcstat_pcmap *ppm, uintfptr_t pc, int pmcin) +static void +pmcpl_ct_node_update(struct pmcpl_ct_node *parent, + struct pmcpl_ct_node *child, int pmcin, unsigned v, int cd) { - struct pmcstat_symbol *sym; - struct pmcstat_image *image; - struct pmcpl_ct_node *ct; - struct pmcpl_ct_node_hash *h; struct pmcpl_ct_arc *arc; - uintfptr_t loadaddress; int i; - unsigned int hash; assert(parent != NULL); - image = ppm->ppm_image; - - loadaddress = ppm->ppm_lowpc + image->pi_vaddr - image->pi_start; - pc -= loadaddress; /* Convert to an offset in the image. */ + /* + * Find related arc in parent node and + * increment the sample count. + */ + for (i = 0; i < parent->pct_narc; i++) { + if (parent->pct_arc[i].pcta_child == child) { + arc = &parent->pct_arc[i]; + pmcpl_ct_samples_grow(&arc->pcta_samples); + arc->pcta_samples.sb[pmcin] += v; + /* Estimate call count. */ + if (cd) { + pmcpl_ct_samples_grow(&arc->pcta_callid); + if (pmcpl_ct_callid.sb[pmcin] - + arc->pcta_callid.sb[pmcin] > 1) + arc->pcta_call++; + arc->pcta_callid.sb[pmcin] = + pmcpl_ct_callid.sb[pmcin]; + } + return; + } + } /* - * Try determine the function at this offset. If we can't - * find a function round leave the `pc' value alone. + * No arc found for us, add ourself to the parent. */ - if ((sym = pmcstat_symbol_search(image, pc)) != NULL) - pc = sym->ps_start; - else - pmcstat_stats.ps_samples_unknown_function++; + pmcpl_ct_arc_grow(parent->pct_narc, + &parent->pct_arc_c, &parent->pct_arc); + arc = &parent->pct_arc[parent->pct_narc]; + pmcpl_ct_samples_grow(&arc->pcta_samples); + arc->pcta_samples.sb[pmcin] = v; + arc->pcta_call = 1; + if (cd) { + pmcpl_ct_samples_grow(&arc->pcta_callid); + arc->pcta_callid.sb[pmcin] = pmcpl_ct_callid.sb[pmcin]; + } + arc->pcta_child = child; + parent->pct_narc++; +} + +/* + * Lookup by image/pc. + */ + +static struct pmcpl_ct_node * +pmcpl_ct_node_hash_lookup(struct pmcstat_image *image, uintfptr_t pc, + struct pmcstat_symbol *sym, char *fl, char *fn) +{ + int i; + unsigned int hash; + struct pmcpl_ct_node *ct; + struct pmcpl_ct_node_hash *h; + pmcstat_interned_string ifl, ifn; + + if (fn != NULL) { + ifl = pmcstat_string_intern(fl); + ifn = pmcstat_string_intern(fn); + } else { + ifl = 0; + ifn = 0; + } for (hash = i = 0; i < (int)sizeof(uintfptr_t); i++) hash += (pc >> i) & 0xFF; hash &= PMCSTAT_HASH_MASK; - ct = NULL; - LIST_FOREACH(h, &pmcpl_ct_node_hash[hash], pch_next) { + STAILQ_FOREACH(h, &pmcpl_ct_node_hash[hash], pch_next) { ct = h->pch_ctnode; assert(ct != NULL); if (ct->pct_image == image && ct->pct_func == pc) { - /* - * Find related arc in parent node and - * increment the sample count. - */ - for (i = 0; i < parent->pct_narc; i++) { - if (parent->pct_arc[i].pcta_child == ct) { - arc = &parent->pct_arc[i]; - pmcpl_ct_samples_grow(&arc->pcta_samples); - arc->pcta_samples.sb[pmcin]++; - /* Estimate call count. */ - pmcpl_ct_samples_grow(&arc->pcta_callid); - if (pmcpl_ct_callid.sb[pmcin] - - arc->pcta_callid.sb[pmcin] > 1) - arc->pcta_call++; - arc->pcta_callid.sb[pmcin] = - pmcpl_ct_callid.sb[pmcin]; - return (ct); - } - } - - /* - * No arc found for us, add ourself to the parent. - */ - pmcpl_ct_arc_grow(parent->pct_narc, - &parent->pct_arc_c, &parent->pct_arc); - arc = &parent->pct_arc[parent->pct_narc]; - pmcpl_ct_samples_grow(&arc->pcta_samples); - arc->pcta_samples.sb[pmcin] = 1; - arc->pcta_call = 1; - pmcpl_ct_samples_grow(&arc->pcta_callid); - arc->pcta_callid.sb[pmcin] = pmcpl_ct_callid.sb[pmcin]; - arc->pcta_child = ct; - parent->pct_narc++; - return (ct); + if (fn == NULL) + return (ct); + if (ct->pct_type == PMCPL_PCT_NAME && + ct->pct_ifl == ifl && ct->pct_ifn == ifn) + return (ct); } } @@ -671,23 +694,22 @@ pmcpl_ct_node_hash_lookup_pc(struct pmcp * We haven't seen this (pmcid, pc) tuple yet, so allocate a * new callgraph node and a new hash table entry for it. */ - ct = pmcpl_ct_node_allocate(image, pc); + ct = pmcpl_ct_node_allocate(); if ((h = malloc(sizeof(*h))) == NULL) err(EX_OSERR, "ERROR: Could not allocate callgraph node"); - h->pch_ctnode = ct; - LIST_INSERT_HEAD(&pmcpl_ct_node_hash[hash], h, pch_next); + if (fn != NULL) { + ct->pct_type = PMCPL_PCT_NAME; + ct->pct_ifl = ifl; + ct->pct_ifn = ifn; + } else + ct->pct_type = PMCPL_PCT_ADDR; + ct->pct_image = image; + ct->pct_func = pc; + ct->pct_sym = sym; - pmcpl_ct_arc_grow(parent->pct_narc, - &parent->pct_arc_c, &parent->pct_arc); - arc = &parent->pct_arc[parent->pct_narc]; - pmcpl_ct_samples_grow(&arc->pcta_samples); - arc->pcta_samples.sb[pmcin] = 1; - arc->pcta_call = 1; - pmcpl_ct_samples_grow(&arc->pcta_callid); - arc->pcta_callid.sb[pmcin] = pmcpl_ct_callid.sb[pmcin]; - arc->pcta_child = ct; - parent->pct_narc++; + h->pch_ctnode = ct; + STAILQ_INSERT_HEAD(&pmcpl_ct_node_hash[hash], h, pch_next); return (ct); } @@ -699,10 +721,14 @@ void pmcpl_ct_process(struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr, uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu) { - int n, pmcin; + int i, n, pmcin; + uintfptr_t pc, loadaddress; + struct pmcstat_image *image; + struct pmcstat_symbol *sym; struct pmcstat_pcmap *ppm[PMC_CALLCHAIN_DEPTH_MAX]; struct pmcstat_process *km; - struct pmcpl_ct_node *parent, *child; + struct pmcpl_ct_node *ct; + struct pmcpl_ct_node *ctl[PMC_CALLCHAIN_DEPTH_MAX+1]; (void) cpu; @@ -741,30 +767,114 @@ pmcpl_ct_process(struct pmcstat_process pmcpl_ct_callid.sb[pmcin]++; /* - * Iterate remaining addresses. + * Build node list. */ - for (parent = pmcpl_ct_root, child = NULL; n >= 0; n--) { - child = pmcpl_ct_node_hash_lookup_pc(parent, ppm[n], cc[n], - pmcin); - if (child == NULL) { + ctl[0] = pmcpl_ct_root; + for (i = 1; n >= 0; n--) { + image = ppm[n]->ppm_image; + loadaddress = ppm[n]->ppm_lowpc + + image->pi_vaddr - image->pi_start; + /* Convert to an offset in the image. */ + pc = cc[n] - loadaddress; + /* + * Try determine the function at this offset. If we can't + * find a function round leave the `pc' value alone. + */ + if ((sym = pmcstat_symbol_search(image, pc)) != NULL) + pc = sym->ps_start; + else + pmcstat_stats.ps_samples_unknown_function++; + + ct = pmcpl_ct_node_hash_lookup(image, pc, sym, NULL, NULL); + if (ct == NULL) { pmcstat_stats.ps_callchain_dubious_frames++; continue; } - parent = child; + ctl[i++] = ct; } + /* No valid node found. */ + if (i == 1) + return; + n = i; + + ct = ctl[0]; + for (i = 1; i < n; i++) + pmcpl_ct_node_update(ctl[i-1], ctl[i], pmcin, 1, 1); /* * Increment the sample count for this PMC. */ - if (child != NULL) { - pmcpl_ct_samples_grow(&child->pct_samples); - child->pct_samples.sb[pmcin]++; - - /* Update per instruction sample if required. */ - if (args.pa_ctdumpinstr) - pmcpl_ct_instr_add(child, pmcin, cc[0] - - (ppm[0]->ppm_lowpc + ppm[0]->ppm_image->pi_vaddr - - ppm[0]->ppm_image->pi_start)); + pmcpl_ct_samples_grow(&ctl[n-1]->pct_samples); + ctl[n-1]->pct_samples.sb[pmcin]++; + + /* Update per instruction sample if required. */ + if (args.pa_ctdumpinstr) + pmcpl_ct_instr_add(ctl[n-1], pmcin, cc[0] - + (ppm[0]->ppm_lowpc + ppm[0]->ppm_image->pi_vaddr - + ppm[0]->ppm_image->pi_start), 1); +} + +/* + * Print node child cost. + */ + +static void +pmcpl_ct_node_printchild(struct pmcpl_ct_node *ct, uintfptr_t paddr, + int pline) +{ + int i, j, line; + uintfptr_t addr; + struct pmcpl_ct_node *child; + char sourcefile[PATH_MAX]; + char funcname[PATH_MAX]; + + /* + * Child cost. + * TODO: attach child cost to the real position in the funtion. + * TODO: cfn= / call addr() / addr(call ) + */ + for (i=0 ; ipct_narc; i++) { + child = ct->pct_arc[i].pcta_child; + /* Object binary. */ + fprintf(args.pa_graphfile, "cob=%s\n", + pmcstat_string_unintern(child->pct_image->pi_fullpath)); + /* Child function name. */ + addr = child->pct_image->pi_vaddr + child->pct_func; + line = 0; + /* Child function source file. */ + if (child->pct_type == PMCPL_PCT_NAME) { + fprintf(args.pa_graphfile, "cfi=%s\ncfn=%s\n", + pmcstat_string_unintern(child->pct_ifl), + pmcstat_string_unintern(child->pct_ifn)); + } else if (pmcstat_image_addr2line(child->pct_image, addr, + sourcefile, sizeof(sourcefile), &line, + funcname, sizeof(funcname))) { + fprintf(args.pa_graphfile, "cfi=%s\ncfn=%s\n", + sourcefile, funcname); + } else { + if (child->pct_sym != NULL) + fprintf(args.pa_graphfile, + "cfi=???\ncfn=%s\n", + pmcstat_string_unintern( + child->pct_sym->ps_name)); + else + fprintf(args.pa_graphfile, + "cfi=???\ncfn=%p\n", (void *)addr); + } + + /* Child function address, line and call count. */ + fprintf(args.pa_graphfile, "calls=%u %p %u\n", + ct->pct_arc[i].pcta_call, (void *)addr, line); + + /* + * Call address, line, sample. + * TODO: Associate call address to the right location. + */ + fprintf(args.pa_graphfile, "%p %u", (void *)paddr, pline); + for (j = 0; jpct_arc[i].pcta_samples)); + fprintf(args.pa_graphfile, "\n"); } } @@ -775,40 +885,37 @@ pmcpl_ct_process(struct pmcstat_process static void pmcpl_ct_node_printself(struct pmcpl_ct_node *ct) { - int i, j, line; - uintptr_t addr; - struct pmcstat_symbol *sym; + int i, j, fline, line; + uintfptr_t faddr, addr; char sourcefile[PATH_MAX]; char funcname[PATH_MAX]; /* * Object binary. */ -#ifdef PMCPL_CT_OPTIMIZEFN - if (pmcpl_ct_prevfn != ct->pct_image->pi_fullpath) { -#endif - pmcpl_ct_prevfn = ct->pct_image->pi_fullpath; - fprintf(args.pa_graphfile, "ob=%s\n", - pmcstat_string_unintern(pmcpl_ct_prevfn)); -#ifdef PMCPL_CT_OPTIMIZEFN - } -#endif + fprintf(args.pa_graphfile, "ob=%s\n", + pmcstat_string_unintern(ct->pct_image->pi_fullpath)); /* * Function name. */ - if (pmcstat_image_addr2line(ct->pct_image, ct->pct_func, - sourcefile, sizeof(sourcefile), &line, + faddr = ct->pct_image->pi_vaddr + ct->pct_func; + fline = 0; + if (ct->pct_type == PMCPL_PCT_NAME) { + fprintf(args.pa_graphfile, "fl=%s\nfn=%s\n", + pmcstat_string_unintern(ct->pct_ifl), + pmcstat_string_unintern(ct->pct_ifn)); + } else if (pmcstat_image_addr2line(ct->pct_image, faddr, + sourcefile, sizeof(sourcefile), &fline, funcname, sizeof(funcname))) { - fprintf(args.pa_graphfile, "fn=%s\n", - funcname); + fprintf(args.pa_graphfile, "fl=%s\nfn=%s\n", + sourcefile, funcname); } else { - sym = pmcstat_symbol_search(ct->pct_image, ct->pct_func); - if (sym != NULL) - fprintf(args.pa_graphfile, "fn=%s\n", - pmcstat_string_unintern(sym->ps_name)); + if (ct->pct_sym != NULL) + fprintf(args.pa_graphfile, "fl=???\nfn=%s\n", + pmcstat_string_unintern(ct->pct_sym->ps_name)); else - fprintf(args.pa_graphfile, "fn=%p\n", + fprintf(args.pa_graphfile, "fl=???\nfn=%p\n", (void *)(ct->pct_image->pi_vaddr + ct->pct_func)); } @@ -816,15 +923,18 @@ pmcpl_ct_node_printself(struct pmcpl_ct_ * Self cost. */ if (ct->pct_ninstr > 0) { + /* + * Per location cost. + */ for (i = 0; i < ct->pct_ninstr; i++) { addr = ct->pct_image->pi_vaddr + ct->pct_instr[i].pctf_func; line = 0; - if (pmcstat_image_addr2line(ct->pct_image, addr, + pmcstat_image_addr2line(ct->pct_image, addr, sourcefile, sizeof(sourcefile), &line, - funcname, sizeof(funcname))) - fprintf(args.pa_graphfile, "fl=%s\n", sourcefile); - fprintf(args.pa_graphfile, "%p %u", (void *)addr, line); + funcname, sizeof(funcname)); + fprintf(args.pa_graphfile, "%p %u", + (void *)addr, line); for (j = 0; jpct_image->pi_vaddr + ct->pct_func; - line = 0; - if (pmcstat_image_addr2line(ct->pct_image, addr, - sourcefile, sizeof(sourcefile), &line, - funcname, sizeof(funcname))) - fprintf(args.pa_graphfile, "fl=%s\n", sourcefile); - fprintf(args.pa_graphfile, "* *"); + /* Global cost function cost. */ + fprintf(args.pa_graphfile, "%p %u", (void *)faddr, fline); for (i = 0; ipct_samples)); fprintf(args.pa_graphfile, "\n"); } + + pmcpl_ct_node_printchild(ct, faddr, fline); +} + +static void +pmcpl_ct_printnode(struct pmcpl_ct_node *ct) +{ + int i; + + if (ct == pmcpl_ct_root) { + fprintf(args.pa_graphfile, "fn=root\n"); + fprintf(args.pa_graphfile, "0x0 1"); + for (i = 0; ipch_ctnode = ct; + STAILQ_INSERT_TAIL(&q, pch, pch_next); + ct->pct_color = PMCPL_PCT_BLACK; + + while (!STAILQ_EMPTY(&q)) { + pch = STAILQ_FIRST(&q); + STAILQ_REMOVE_HEAD(&q, pch_next); + pmcpl_ct_printnode(pch->pch_ctnode); + for (i = 0; ipch_ctnode->pct_narc; i++) { + child = pch->pch_ctnode->pct_arc[i].pcta_child; + if (child->pct_color == PMCPL_PCT_WHITE) { + child->pct_color = PMCPL_PCT_BLACK; + if ((pchc = malloc(sizeof(*pchc))) == NULL) + err(EX_OSERR, + "ERROR: Cannot allocate queue"); + pchc->pch_ctnode = child; + STAILQ_INSERT_TAIL(&q, pchc, pch_next); + } + } + free(pch); + } +} + +/* + * Detect and fix inlined location. + */ + +static void +_pmcpl_ct_expand_inline(struct pmcpl_ct_node *ct) +{ + int i, j; + unsigned fline, line, v; + uintfptr_t faddr, addr, pc; char sourcefile[PATH_MAX]; - char funcname[PATH_MAX]; + char ffuncname[PATH_MAX], funcname[PATH_MAX]; + char buffer[PATH_MAX]; + struct pmcpl_ct_node *child; /* * Child cost. * TODO: attach child cost to the real position in the funtion. * TODO: cfn= / call addr() / addr(call ) + * Resolve parent and compare to each instr location. */ - for (i=0 ; ipct_narc; i++) { - child = ct->pct_arc[i].pcta_child; + faddr = ct->pct_image->pi_vaddr + ct->pct_func; + fline = 0; + if (!pmcstat_image_addr2line(ct->pct_image, faddr, + sourcefile, sizeof(sourcefile), &fline, + ffuncname, sizeof(ffuncname))) + return; - /* Object binary. */ -#ifdef PMCPL_CT_OPTIMIZEFN - if (pmcpl_ct_prevfn != child->pct_image->pi_fullpath) { -#endif - pmcpl_ct_prevfn = child->pct_image->pi_fullpath; - fprintf(args.pa_graphfile, "cob=%s\n", - pmcstat_string_unintern(pmcpl_ct_prevfn)); -#if PMCPL_CT_OPTIMIZEFN - } -#endif - /* Child function name. */ - addr = child->pct_image->pi_vaddr + child->pct_func; - /* Child function source file. */ - if (pmcstat_image_addr2line(child->pct_image, addr, + for (i = 0; i < ct->pct_ninstr; i++) { + addr = ct->pct_image->pi_vaddr + + ct->pct_instr[i].pctf_func; + line = 0; + if (!pmcstat_image_addr2line(ct->pct_image, addr, sourcefile, sizeof(sourcefile), &line, - funcname, sizeof(funcname))) { - fprintf(args.pa_graphfile, "cfn=%s\n", funcname); - fprintf(args.pa_graphfile, "cfl=%s\n", sourcefile); - } else { - sym = pmcstat_symbol_search(child->pct_image, - child->pct_func); - if (sym != NULL) - fprintf(args.pa_graphfile, "cfn=%s\n", - pmcstat_string_unintern(sym->ps_name)); - else - fprintf(args.pa_graphfile, "cfn=%p\n", (void *)addr); - } + funcname, sizeof(funcname))) + continue; - /* Child function address, line and call count. */ - fprintf(args.pa_graphfile, "calls=%u %p %u\n", - ct->pct_arc[i].pcta_call, (void *)addr, line); + if (strcmp(funcname, ffuncname) == 0) + continue; - if (ct->pct_image != NULL) { - /* Call address, line, sample. */ - addr = ct->pct_image->pi_vaddr + ct->pct_func; - line = 0; - if (pmcstat_image_addr2line(ct->pct_image, addr, sourcefile, - sizeof(sourcefile), &line, - funcname, sizeof(funcname))) - fprintf(args.pa_graphfile, "%p %u", (void *)addr, line); - else - fprintf(args.pa_graphfile, "* *"); + /* + * - Lookup/create inline node by function name. + * - Move instr PMCs to the inline node. + * - Link nodes. + * The lookup create a specific node per image/pc. + */ + if (args.pa_verbosity >= 2) + fprintf(args.pa_printfile, + "WARNING: inlined function at %p %s in %s\n", + (void *)addr, funcname, ffuncname); + + snprintf(buffer, sizeof(buffer), "%s@%s", + funcname, ffuncname); + child = pmcpl_ct_node_hash_lookup(ct->pct_image, + ct->pct_func, ct->pct_sym, sourcefile, buffer); + assert(child != NULL); + pc = ct->pct_instr[i].pctf_func; + for (j = 0; jpct_instr[i].pctf_samples); + if (v == 0) + continue; + pmcpl_ct_instr_add(child, j, pc, v); + pmcpl_ct_node_update(ct, child, j, v, 0); + if (j < ct->pct_samples.npmcs) + ct->pct_samples.sb[j] -= + ct->pct_instr[i].pctf_samples.sb[j]; + ct->pct_instr[i].pctf_samples.sb[j] = 0; } - else - fprintf(args.pa_graphfile, "* *"); - for (j = 0; jpct_arc[i].pcta_samples)); - fprintf(args.pa_graphfile, "\n"); } } +static void +pmcpl_ct_expand_inline(void) +{ + int i; + struct pmcpl_ct_node_hash *pch; + + if (!args.pa_ctdumpinstr) + return; + + for (i = 0; i < PMCSTAT_NHASH; i++) + STAILQ_FOREACH(pch, &pmcpl_ct_node_hash[i], pch_next) + if (pch->pch_ctnode->pct_type == PMCPL_PCT_ADDR) + _pmcpl_ct_expand_inline(pch->pch_ctnode); +} + /* * Clean the PMC name for Kcachegrind formula */ @@ -941,13 +1115,12 @@ pmcpl_ct_fixup_pmcname(char *s) static void pmcpl_ct_print(void) { - int n, i; - struct pmcpl_ct_node_hash *pch; - struct pmcpl_ct_sample rsamples; + int i; char name[40]; + struct pmcpl_ct_sample rsamples; pmcpl_ct_samples_root(&rsamples); - pmcpl_ct_prevfn = NULL; + pmcpl_ct_expand_inline(); fprintf(args.pa_graphfile, "version: 1\n" @@ -964,25 +1137,8 @@ pmcpl_ct_print(void) for (i=0; ipch_ctnode); - pmcpl_ct_node_printchild(pch->pch_ctnode); - } - + pmcpl_ct_bfs(pmcpl_ct_root); pmcpl_ct_samples_free(&rsamples); } @@ -1003,11 +1159,10 @@ pmcpl_ct_init(void) { int i; - pmcpl_ct_prevfn = NULL; - pmcpl_ct_root = pmcpl_ct_node_allocate(NULL, 0); + pmcpl_ct_root = pmcpl_ct_node_allocate(); for (i = 0; i < PMCSTAT_NHASH; i++) - LIST_INIT(&pmcpl_ct_node_hash[i]); + STAILQ_INIT(&pmcpl_ct_node_hash[i]); pmcpl_ct_samples_init(&pmcpl_ct_callid); @@ -1030,7 +1185,7 @@ pmcpl_ct_shutdown(FILE *mf) */ for (i = 0; i < PMCSTAT_NHASH; i++) { - LIST_FOREACH_SAFE(pch, &pmcpl_ct_node_hash[i], pch_next, + STAILQ_FOREACH_SAFE(pch, &pmcpl_ct_node_hash[i], pch_next, pchtmp) { pmcpl_ct_node_free(pch->pch_ctnode); free(pch); Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat_log.c Fri May 25 06:48:42 2012 (r235975) +++ stable/8/usr.sbin/pmcstat/pmcstat_log.c Fri May 25 07:23:24 2012 (r235976) @@ -428,7 +428,9 @@ pmcstat_image_get_aout_params(struct pmc if ((fd = open(buffer, O_RDONLY, 0)) < 0 || (nbytes = read(fd, &ex, sizeof(ex))) < 0) { - warn("WARNING: Cannot determine type of \"%s\"", path); + if (args.pa_verbosity >= 2) + warn("WARNING: Cannot determine type of \"%s\"", + path); image->pi_type = PMCSTAT_IMAGE_INDETERMINABLE; if (fd != -1) (void) close(fd); @@ -638,8 +640,9 @@ pmcstat_image_get_elf_params(struct pmcs if ((fd = open(buffer, O_RDONLY, 0)) < 0 || (e = elf_begin(fd, ELF_C_READ, NULL)) == NULL || (elf_kind(e) != ELF_K_ELF)) { - warnx("WARNING: Cannot determine the type of \"%s\".", - buffer); + if (args.pa_verbosity >= 2) + warnx("WARNING: Cannot determine the type of \"%s\".", + buffer); goto done; } @@ -942,6 +945,7 @@ pmcstat_image_addr2line(struct pmcstat_i char *funcname, size_t funcname_len) { static int addr2line_warn = 0; + unsigned l; char *sep, cmdline[PATH_MAX], imagepath[PATH_MAX]; int fd; @@ -957,6 +961,11 @@ pmcstat_image_addr2line(struct pmcstat_i pmcstat_string_unintern(image->pi_fullpath)); } else close(fd); + /* + * New addr2line support recursive inline function with -i + * but the format does not add a marker when no more entries + * are available. + */ snprintf(cmdline, sizeof(cmdline), "addr2line -Cfe \"%s\"", imagepath); image->pi_addr2line = popen(cmdline, "r+"); @@ -997,10 +1006,10 @@ pmcstat_image_addr2line(struct pmcstat_i return (0); } *sep = '\0'; - *sourceline = atoi(sep+1); - if (*sourceline == 0) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 25 07:25:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41A711065676; Fri, 25 May 2012 07:25:31 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B48C8FC0C; Fri, 25 May 2012 07:25: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 q4P7PVAR087693; Fri, 25 May 2012 07:25:31 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P7PVGh087690; Fri, 25 May 2012 07:25:31 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201205250725.q4P7PVGh087690@svn.freebsd.org> From: Fabien Thomas Date: Fri, 25 May 2012 07:25: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: r235977 - stable/9/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 07:25:31 -0000 Author: fabient Date: Fri May 25 07:25:30 2012 New Revision: 235977 URL: http://svn.freebsd.org/changeset/base/235977 Log: MFC r233611: - Support inlined location in calltree output. In case of multiple level of inlining all the locations are flattened. Require recent binutils/addr2line (head works or binutils from ports with the right $PATH order). - Multiple fixes in the calltree output (recursion case, ...) - Fix the calltree top view that previously hide some shared nodes. Tested with Kcachegrind(kdesdk4)/qcachegrind(head). Sponsored by: NETASQ Modified: stable/9/usr.sbin/pmcstat/pmcpl_calltree.c stable/9/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/9/usr.sbin/pmcstat/ (props changed) Modified: stable/9/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- stable/9/usr.sbin/pmcstat/pmcpl_calltree.c Fri May 25 07:23:24 2012 (r235976) +++ stable/9/usr.sbin/pmcstat/pmcpl_calltree.c Fri May 25 07:25:30 2012 (r235977) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009, Fabien Thomas + * Copyright (c) 2012, Fabien Thomas * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,20 +58,18 @@ __FBSDID("$FreeBSD$"); #include "pmcstat_top.h" #include "pmcpl_calltree.h" -#define PMCPL_CT_GROWSIZE 4 - -static pmcstat_interned_string pmcpl_ct_prevfn; +#define PMCPL_CT_GROWSIZE 4 static int pmcstat_skiplink = 0; struct pmcpl_ct_node; /* Get the sample value for PMC a. */ -#define PMCPL_CT_SAMPLE(a, b) \ +#define PMCPL_CT_SAMPLE(a, b) \ ((a) < (b)->npmcs ? (b)->sb[a] : 0) /* Get the sample value in percent related to rsamples. */ -#define PMCPL_CT_SAMPLEP(a, b) \ +#define PMCPL_CT_SAMPLEP(a, b) \ (PMCPL_CT_SAMPLE(a, b) * 100.0 / rsamples->sb[a]) struct pmcpl_ct_sample { @@ -95,10 +93,13 @@ struct pmcpl_ct_instr { * Each calltree node is tracked by a pmcpl_ct_node struct. */ struct pmcpl_ct_node { -#define PMCPL_PCT_TAG 0x00000001 /* Loop detection. */ - uint32_t pct_flags; struct pmcstat_image *pct_image; uintfptr_t pct_func; + + struct pmcstat_symbol *pct_sym; + pmcstat_interned_string pct_ifl; + pmcstat_interned_string pct_ifn; + struct pmcpl_ct_sample pct_samples; int pct_narc; @@ -109,17 +110,25 @@ struct pmcpl_ct_node { int pct_ninstr; int pct_instr_c; struct pmcpl_ct_instr *pct_instr; + +#define PMCPL_PCT_ADDR 0 +#define PMCPL_PCT_NAME 1 + char pct_type; +#define PMCPL_PCT_WHITE 0 +#define PMCPL_PCT_GREY 1 +#define PMCPL_PCT_BLACK 2 + char pct_color; }; struct pmcpl_ct_node_hash { struct pmcpl_ct_node *pch_ctnode; - LIST_ENTRY(pmcpl_ct_node_hash) pch_next; + STAILQ_ENTRY(pmcpl_ct_node_hash) pch_next; }; struct pmcpl_ct_sample pmcpl_ct_callid; -#define PMCPL_CT_MAXCOL PMC_CALLCHAIN_DEPTH_MAX -#define PMCPL_CT_MAXLINE 1024 /* TODO: dynamic. */ +#define PMCPL_CT_MAXCOL PMC_CALLCHAIN_DEPTH_MAX +#define PMCPL_CT_MAXLINE 1024 /* TODO: dynamic. */ struct pmcpl_ct_line { unsigned ln_sum; @@ -127,12 +136,13 @@ struct pmcpl_ct_line { }; struct pmcpl_ct_line pmcpl_ct_topmax[PMCPL_CT_MAXLINE+1]; -struct pmcpl_ct_node *pmcpl_ct_topscreen[PMCPL_CT_MAXCOL+1][PMCPL_CT_MAXLINE+1]; +struct pmcpl_ct_node + *pmcpl_ct_topscreen[PMCPL_CT_MAXCOL+1][PMCPL_CT_MAXLINE+1]; /* * All nodes indexed by function/image name are placed in a hash table. */ -static LIST_HEAD(,pmcpl_ct_node_hash) pmcpl_ct_node_hash[PMCSTAT_NHASH]; +static STAILQ_HEAD(,pmcpl_ct_node_hash) pmcpl_ct_node_hash[PMCSTAT_NHASH]; /* * Root node for the graph. @@ -256,7 +266,8 @@ pmcpl_ct_instr_grow(int cursize, int *ma */ static void -pmcpl_ct_instr_add(struct pmcpl_ct_node *ct, int pmcin, uintfptr_t pc) +pmcpl_ct_instr_add(struct pmcpl_ct_node *ct, int pmcin, + uintfptr_t pc, unsigned v) { int i; struct pmcpl_ct_instr *in; @@ -265,7 +276,7 @@ pmcpl_ct_instr_add(struct pmcpl_ct_node if (ct->pct_instr[i].pctf_func == pc) { in = &ct->pct_instr[i]; pmcpl_ct_samples_grow(&in->pctf_samples); - in->pctf_samples.sb[pmcin]++; + in->pctf_samples.sb[pmcin] += v; return; } } @@ -275,7 +286,7 @@ pmcpl_ct_instr_add(struct pmcpl_ct_node in->pctf_func = pc; pmcpl_ct_samples_init(&in->pctf_samples); pmcpl_ct_samples_grow(&in->pctf_samples); - in->pctf_samples.sb[pmcin] = 1; + in->pctf_samples.sb[pmcin] = v; ct->pct_ninstr++; } @@ -284,19 +295,19 @@ pmcpl_ct_instr_add(struct pmcpl_ct_node */ static struct pmcpl_ct_node * -pmcpl_ct_node_allocate(struct pmcstat_image *image, uintfptr_t pc) +pmcpl_ct_node_allocate(void) { struct pmcpl_ct_node *ct; if ((ct = malloc(sizeof(*ct))) == NULL) err(EX_OSERR, "ERROR: Cannot allocate callgraph node"); - ct->pct_flags = 0; - ct->pct_image = image; - ct->pct_func = pc; - pmcpl_ct_samples_init(&ct->pct_samples); + ct->pct_sym = NULL; + ct->pct_image = NULL; + ct->pct_func = 0; + ct->pct_narc = 0; ct->pct_arc_c = 0; ct->pct_arc = NULL; @@ -305,6 +316,8 @@ pmcpl_ct_node_allocate(struct pmcstat_im ct->pct_instr_c = 0; ct->pct_instr = NULL; + ct->pct_color = PMCPL_PCT_WHITE; + return (ct); } @@ -338,10 +351,10 @@ pmcpl_ct_node_cleartag(void) struct pmcpl_ct_node_hash *pch; for (i = 0; i < PMCSTAT_NHASH; i++) - LIST_FOREACH(pch, &pmcpl_ct_node_hash[i], pch_next) - pch->pch_ctnode->pct_flags &= ~PMCPL_PCT_TAG; + STAILQ_FOREACH(pch, &pmcpl_ct_node_hash[i], pch_next) + pch->pch_ctnode->pct_color = PMCPL_PCT_WHITE; - pmcpl_ct_root->pct_flags &= ~PMCPL_PCT_TAG; + pmcpl_ct_root->pct_color = PMCPL_PCT_WHITE; } /* @@ -355,11 +368,9 @@ pmcpl_ct_node_dumptop(int pmcin, struct int i, terminal; struct pmcpl_ct_arc *arc; - if (ct->pct_flags & PMCPL_PCT_TAG) + if (ct->pct_color == PMCPL_PCT_GREY) return 0; - ct->pct_flags |= PMCPL_PCT_TAG; - if (x >= PMCPL_CT_MAXCOL) { pmcpl_ct_topscreen[x][*y] = NULL; return 1; @@ -374,11 +385,11 @@ pmcpl_ct_node_dumptop(int pmcin, struct terminal = 1; for (i = 0; i < ct->pct_narc; i++) { arc = &ct->pct_arc[i]; - if (PMCPL_CT_SAMPLE(pmcin, + if (arc->pcta_child->pct_color != PMCPL_PCT_GREY && + PMCPL_CT_SAMPLE(pmcin, &arc->pcta_samples) != 0 && PMCPL_CT_SAMPLEP(pmcin, - &arc->pcta_samples) > pmcstat_threshold && - (arc->pcta_child->pct_flags & PMCPL_PCT_TAG) == 0) { + &arc->pcta_samples) > pmcstat_threshold) { terminal = 0; break; } @@ -395,6 +406,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct return 0; } + ct->pct_color = PMCPL_PCT_GREY; for (i = 0; i < ct->pct_narc; i++) { if (PMCPL_CT_SAMPLE(pmcin, &ct->pct_arc[i].pcta_samples) == 0) @@ -403,10 +415,13 @@ pmcpl_ct_node_dumptop(int pmcin, struct &ct->pct_arc[i].pcta_samples) > pmcstat_threshold) { if (pmcpl_ct_node_dumptop(pmcin, ct->pct_arc[i].pcta_child, - rsamples, x+1, y)) + rsamples, x+1, y)) { + ct->pct_color = PMCPL_PCT_BLACK; return 1; + } } } + ct->pct_color = PMCPL_PCT_BLACK; return 0; } @@ -446,7 +461,6 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s float v; char ns[30], vs[10], is[20]; struct pmcpl_ct_node *ct; - struct pmcstat_symbol *sym; const char *space = " "; /* @@ -503,10 +517,9 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s strlcpy(ns, ".", sizeof(ns)); ns_len = 1; } else { - sym = pmcstat_symbol_search(ct->pct_image, ct->pct_func); - if (sym != NULL) { + if (ct->pct_sym != NULL) { ns_len = snprintf(ns, sizeof(ns), "%s", - pmcstat_string_unintern(sym->ps_name)); + pmcstat_string_unintern(ct->pct_sym->ps_name)); } else ns_len = snprintf(ns, sizeof(ns), "%p", (void *)ct->pct_func); @@ -547,7 +560,6 @@ pmcpl_ct_topdisplay(void) rsamples = &r; pmcpl_ct_samples_root(rsamples); - pmcpl_ct_node_cleartag(); PMCSTAT_PRINTW("%5.5s %s\n", "%SAMP", "CALLTREE"); @@ -588,81 +600,92 @@ pmcpl_ct_topkeypress(int c, WINDOW *w) * `ppm'. */ -static struct pmcpl_ct_node * -pmcpl_ct_node_hash_lookup_pc(struct pmcpl_ct_node *parent, - struct pmcstat_pcmap *ppm, uintfptr_t pc, int pmcin) +static void +pmcpl_ct_node_update(struct pmcpl_ct_node *parent, + struct pmcpl_ct_node *child, int pmcin, unsigned v, int cd) { - struct pmcstat_symbol *sym; - struct pmcstat_image *image; - struct pmcpl_ct_node *ct; - struct pmcpl_ct_node_hash *h; struct pmcpl_ct_arc *arc; - uintfptr_t loadaddress; int i; - unsigned int hash; assert(parent != NULL); - image = ppm->ppm_image; - - loadaddress = ppm->ppm_lowpc + image->pi_vaddr - image->pi_start; - pc -= loadaddress; /* Convert to an offset in the image. */ + /* + * Find related arc in parent node and + * increment the sample count. + */ + for (i = 0; i < parent->pct_narc; i++) { + if (parent->pct_arc[i].pcta_child == child) { + arc = &parent->pct_arc[i]; + pmcpl_ct_samples_grow(&arc->pcta_samples); + arc->pcta_samples.sb[pmcin] += v; + /* Estimate call count. */ + if (cd) { + pmcpl_ct_samples_grow(&arc->pcta_callid); + if (pmcpl_ct_callid.sb[pmcin] - + arc->pcta_callid.sb[pmcin] > 1) + arc->pcta_call++; + arc->pcta_callid.sb[pmcin] = + pmcpl_ct_callid.sb[pmcin]; + } + return; + } + } /* - * Try determine the function at this offset. If we can't - * find a function round leave the `pc' value alone. + * No arc found for us, add ourself to the parent. */ - if ((sym = pmcstat_symbol_search(image, pc)) != NULL) - pc = sym->ps_start; - else - pmcstat_stats.ps_samples_unknown_function++; + pmcpl_ct_arc_grow(parent->pct_narc, + &parent->pct_arc_c, &parent->pct_arc); + arc = &parent->pct_arc[parent->pct_narc]; + pmcpl_ct_samples_grow(&arc->pcta_samples); + arc->pcta_samples.sb[pmcin] = v; + arc->pcta_call = 1; + if (cd) { + pmcpl_ct_samples_grow(&arc->pcta_callid); + arc->pcta_callid.sb[pmcin] = pmcpl_ct_callid.sb[pmcin]; + } + arc->pcta_child = child; + parent->pct_narc++; +} + +/* + * Lookup by image/pc. + */ + +static struct pmcpl_ct_node * +pmcpl_ct_node_hash_lookup(struct pmcstat_image *image, uintfptr_t pc, + struct pmcstat_symbol *sym, char *fl, char *fn) +{ + int i; + unsigned int hash; + struct pmcpl_ct_node *ct; + struct pmcpl_ct_node_hash *h; + pmcstat_interned_string ifl, ifn; + + if (fn != NULL) { + ifl = pmcstat_string_intern(fl); + ifn = pmcstat_string_intern(fn); + } else { + ifl = 0; + ifn = 0; + } for (hash = i = 0; i < (int)sizeof(uintfptr_t); i++) hash += (pc >> i) & 0xFF; hash &= PMCSTAT_HASH_MASK; - ct = NULL; - LIST_FOREACH(h, &pmcpl_ct_node_hash[hash], pch_next) { + STAILQ_FOREACH(h, &pmcpl_ct_node_hash[hash], pch_next) { ct = h->pch_ctnode; assert(ct != NULL); if (ct->pct_image == image && ct->pct_func == pc) { - /* - * Find related arc in parent node and - * increment the sample count. - */ - for (i = 0; i < parent->pct_narc; i++) { - if (parent->pct_arc[i].pcta_child == ct) { - arc = &parent->pct_arc[i]; - pmcpl_ct_samples_grow(&arc->pcta_samples); - arc->pcta_samples.sb[pmcin]++; - /* Estimate call count. */ - pmcpl_ct_samples_grow(&arc->pcta_callid); - if (pmcpl_ct_callid.sb[pmcin] - - arc->pcta_callid.sb[pmcin] > 1) - arc->pcta_call++; - arc->pcta_callid.sb[pmcin] = - pmcpl_ct_callid.sb[pmcin]; - return (ct); - } - } - - /* - * No arc found for us, add ourself to the parent. - */ - pmcpl_ct_arc_grow(parent->pct_narc, - &parent->pct_arc_c, &parent->pct_arc); - arc = &parent->pct_arc[parent->pct_narc]; - pmcpl_ct_samples_grow(&arc->pcta_samples); - arc->pcta_samples.sb[pmcin] = 1; - arc->pcta_call = 1; - pmcpl_ct_samples_grow(&arc->pcta_callid); - arc->pcta_callid.sb[pmcin] = pmcpl_ct_callid.sb[pmcin]; - arc->pcta_child = ct; - parent->pct_narc++; - return (ct); + if (fn == NULL) + return (ct); + if (ct->pct_type == PMCPL_PCT_NAME && + ct->pct_ifl == ifl && ct->pct_ifn == ifn) + return (ct); } } @@ -670,23 +693,22 @@ pmcpl_ct_node_hash_lookup_pc(struct pmcp * We haven't seen this (pmcid, pc) tuple yet, so allocate a * new callgraph node and a new hash table entry for it. */ - ct = pmcpl_ct_node_allocate(image, pc); + ct = pmcpl_ct_node_allocate(); if ((h = malloc(sizeof(*h))) == NULL) err(EX_OSERR, "ERROR: Could not allocate callgraph node"); - h->pch_ctnode = ct; - LIST_INSERT_HEAD(&pmcpl_ct_node_hash[hash], h, pch_next); + if (fn != NULL) { + ct->pct_type = PMCPL_PCT_NAME; + ct->pct_ifl = ifl; + ct->pct_ifn = ifn; + } else + ct->pct_type = PMCPL_PCT_ADDR; + ct->pct_image = image; + ct->pct_func = pc; + ct->pct_sym = sym; - pmcpl_ct_arc_grow(parent->pct_narc, - &parent->pct_arc_c, &parent->pct_arc); - arc = &parent->pct_arc[parent->pct_narc]; - pmcpl_ct_samples_grow(&arc->pcta_samples); - arc->pcta_samples.sb[pmcin] = 1; - arc->pcta_call = 1; - pmcpl_ct_samples_grow(&arc->pcta_callid); - arc->pcta_callid.sb[pmcin] = pmcpl_ct_callid.sb[pmcin]; - arc->pcta_child = ct; - parent->pct_narc++; + h->pch_ctnode = ct; + STAILQ_INSERT_HEAD(&pmcpl_ct_node_hash[hash], h, pch_next); return (ct); } @@ -698,10 +720,14 @@ void pmcpl_ct_process(struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr, uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu) { - int n, pmcin; + int i, n, pmcin; + uintfptr_t pc, loadaddress; + struct pmcstat_image *image; + struct pmcstat_symbol *sym; struct pmcstat_pcmap *ppm[PMC_CALLCHAIN_DEPTH_MAX]; struct pmcstat_process *km; - struct pmcpl_ct_node *parent, *child; + struct pmcpl_ct_node *ct; + struct pmcpl_ct_node *ctl[PMC_CALLCHAIN_DEPTH_MAX+1]; (void) cpu; @@ -740,30 +766,114 @@ pmcpl_ct_process(struct pmcstat_process pmcpl_ct_callid.sb[pmcin]++; /* - * Iterate remaining addresses. + * Build node list. */ - for (parent = pmcpl_ct_root, child = NULL; n >= 0; n--) { - child = pmcpl_ct_node_hash_lookup_pc(parent, ppm[n], cc[n], - pmcin); - if (child == NULL) { + ctl[0] = pmcpl_ct_root; + for (i = 1; n >= 0; n--) { + image = ppm[n]->ppm_image; + loadaddress = ppm[n]->ppm_lowpc + + image->pi_vaddr - image->pi_start; + /* Convert to an offset in the image. */ + pc = cc[n] - loadaddress; + /* + * Try determine the function at this offset. If we can't + * find a function round leave the `pc' value alone. + */ + if ((sym = pmcstat_symbol_search(image, pc)) != NULL) + pc = sym->ps_start; + else + pmcstat_stats.ps_samples_unknown_function++; + + ct = pmcpl_ct_node_hash_lookup(image, pc, sym, NULL, NULL); + if (ct == NULL) { pmcstat_stats.ps_callchain_dubious_frames++; continue; } - parent = child; + ctl[i++] = ct; } + /* No valid node found. */ + if (i == 1) + return; + n = i; + + ct = ctl[0]; + for (i = 1; i < n; i++) + pmcpl_ct_node_update(ctl[i-1], ctl[i], pmcin, 1, 1); /* * Increment the sample count for this PMC. */ - if (child != NULL) { - pmcpl_ct_samples_grow(&child->pct_samples); - child->pct_samples.sb[pmcin]++; - - /* Update per instruction sample if required. */ - if (args.pa_ctdumpinstr) - pmcpl_ct_instr_add(child, pmcin, cc[0] - - (ppm[0]->ppm_lowpc + ppm[0]->ppm_image->pi_vaddr - - ppm[0]->ppm_image->pi_start)); + pmcpl_ct_samples_grow(&ctl[n-1]->pct_samples); + ctl[n-1]->pct_samples.sb[pmcin]++; + + /* Update per instruction sample if required. */ + if (args.pa_ctdumpinstr) + pmcpl_ct_instr_add(ctl[n-1], pmcin, cc[0] - + (ppm[0]->ppm_lowpc + ppm[0]->ppm_image->pi_vaddr - + ppm[0]->ppm_image->pi_start), 1); +} + +/* + * Print node child cost. + */ + +static void +pmcpl_ct_node_printchild(struct pmcpl_ct_node *ct, uintfptr_t paddr, + int pline) +{ + int i, j, line; + uintfptr_t addr; + struct pmcpl_ct_node *child; + char sourcefile[PATH_MAX]; + char funcname[PATH_MAX]; + + /* + * Child cost. + * TODO: attach child cost to the real position in the funtion. + * TODO: cfn= / call addr() / addr(call ) + */ + for (i=0 ; ipct_narc; i++) { + child = ct->pct_arc[i].pcta_child; + /* Object binary. */ + fprintf(args.pa_graphfile, "cob=%s\n", + pmcstat_string_unintern(child->pct_image->pi_fullpath)); + /* Child function name. */ + addr = child->pct_image->pi_vaddr + child->pct_func; + line = 0; + /* Child function source file. */ + if (child->pct_type == PMCPL_PCT_NAME) { + fprintf(args.pa_graphfile, "cfi=%s\ncfn=%s\n", + pmcstat_string_unintern(child->pct_ifl), + pmcstat_string_unintern(child->pct_ifn)); + } else if (pmcstat_image_addr2line(child->pct_image, addr, + sourcefile, sizeof(sourcefile), &line, + funcname, sizeof(funcname))) { + fprintf(args.pa_graphfile, "cfi=%s\ncfn=%s\n", + sourcefile, funcname); + } else { + if (child->pct_sym != NULL) + fprintf(args.pa_graphfile, + "cfi=???\ncfn=%s\n", + pmcstat_string_unintern( + child->pct_sym->ps_name)); + else + fprintf(args.pa_graphfile, + "cfi=???\ncfn=%p\n", (void *)addr); + } + + /* Child function address, line and call count. */ + fprintf(args.pa_graphfile, "calls=%u %p %u\n", + ct->pct_arc[i].pcta_call, (void *)addr, line); + + /* + * Call address, line, sample. + * TODO: Associate call address to the right location. + */ + fprintf(args.pa_graphfile, "%p %u", (void *)paddr, pline); + for (j = 0; jpct_arc[i].pcta_samples)); + fprintf(args.pa_graphfile, "\n"); } } @@ -774,40 +884,37 @@ pmcpl_ct_process(struct pmcstat_process static void pmcpl_ct_node_printself(struct pmcpl_ct_node *ct) { - int i, j, line; - uintptr_t addr; - struct pmcstat_symbol *sym; + int i, j, fline, line; + uintfptr_t faddr, addr; char sourcefile[PATH_MAX]; char funcname[PATH_MAX]; /* * Object binary. */ -#ifdef PMCPL_CT_OPTIMIZEFN - if (pmcpl_ct_prevfn != ct->pct_image->pi_fullpath) { -#endif - pmcpl_ct_prevfn = ct->pct_image->pi_fullpath; - fprintf(args.pa_graphfile, "ob=%s\n", - pmcstat_string_unintern(pmcpl_ct_prevfn)); -#ifdef PMCPL_CT_OPTIMIZEFN - } -#endif + fprintf(args.pa_graphfile, "ob=%s\n", + pmcstat_string_unintern(ct->pct_image->pi_fullpath)); /* * Function name. */ - if (pmcstat_image_addr2line(ct->pct_image, ct->pct_func, - sourcefile, sizeof(sourcefile), &line, + faddr = ct->pct_image->pi_vaddr + ct->pct_func; + fline = 0; + if (ct->pct_type == PMCPL_PCT_NAME) { + fprintf(args.pa_graphfile, "fl=%s\nfn=%s\n", + pmcstat_string_unintern(ct->pct_ifl), + pmcstat_string_unintern(ct->pct_ifn)); + } else if (pmcstat_image_addr2line(ct->pct_image, faddr, + sourcefile, sizeof(sourcefile), &fline, funcname, sizeof(funcname))) { - fprintf(args.pa_graphfile, "fn=%s\n", - funcname); + fprintf(args.pa_graphfile, "fl=%s\nfn=%s\n", + sourcefile, funcname); } else { - sym = pmcstat_symbol_search(ct->pct_image, ct->pct_func); - if (sym != NULL) - fprintf(args.pa_graphfile, "fn=%s\n", - pmcstat_string_unintern(sym->ps_name)); + if (ct->pct_sym != NULL) + fprintf(args.pa_graphfile, "fl=???\nfn=%s\n", + pmcstat_string_unintern(ct->pct_sym->ps_name)); else - fprintf(args.pa_graphfile, "fn=%p\n", + fprintf(args.pa_graphfile, "fl=???\nfn=%p\n", (void *)(ct->pct_image->pi_vaddr + ct->pct_func)); } @@ -815,15 +922,18 @@ pmcpl_ct_node_printself(struct pmcpl_ct_ * Self cost. */ if (ct->pct_ninstr > 0) { + /* + * Per location cost. + */ for (i = 0; i < ct->pct_ninstr; i++) { addr = ct->pct_image->pi_vaddr + ct->pct_instr[i].pctf_func; line = 0; - if (pmcstat_image_addr2line(ct->pct_image, addr, + pmcstat_image_addr2line(ct->pct_image, addr, sourcefile, sizeof(sourcefile), &line, - funcname, sizeof(funcname))) - fprintf(args.pa_graphfile, "fl=%s\n", sourcefile); - fprintf(args.pa_graphfile, "%p %u", (void *)addr, line); + funcname, sizeof(funcname)); + fprintf(args.pa_graphfile, "%p %u", + (void *)addr, line); for (j = 0; jpct_image->pi_vaddr + ct->pct_func; - line = 0; - if (pmcstat_image_addr2line(ct->pct_image, addr, - sourcefile, sizeof(sourcefile), &line, - funcname, sizeof(funcname))) - fprintf(args.pa_graphfile, "fl=%s\n", sourcefile); - fprintf(args.pa_graphfile, "* *"); + /* Global cost function cost. */ + fprintf(args.pa_graphfile, "%p %u", (void *)faddr, fline); for (i = 0; ipct_samples)); fprintf(args.pa_graphfile, "\n"); } + + pmcpl_ct_node_printchild(ct, faddr, fline); +} + +static void +pmcpl_ct_printnode(struct pmcpl_ct_node *ct) +{ + int i; + + if (ct == pmcpl_ct_root) { + fprintf(args.pa_graphfile, "fn=root\n"); + fprintf(args.pa_graphfile, "0x0 1"); + for (i = 0; ipch_ctnode = ct; + STAILQ_INSERT_TAIL(&q, pch, pch_next); + ct->pct_color = PMCPL_PCT_BLACK; + + while (!STAILQ_EMPTY(&q)) { + pch = STAILQ_FIRST(&q); + STAILQ_REMOVE_HEAD(&q, pch_next); + pmcpl_ct_printnode(pch->pch_ctnode); + for (i = 0; ipch_ctnode->pct_narc; i++) { + child = pch->pch_ctnode->pct_arc[i].pcta_child; + if (child->pct_color == PMCPL_PCT_WHITE) { + child->pct_color = PMCPL_PCT_BLACK; + if ((pchc = malloc(sizeof(*pchc))) == NULL) + err(EX_OSERR, + "ERROR: Cannot allocate queue"); + pchc->pch_ctnode = child; + STAILQ_INSERT_TAIL(&q, pchc, pch_next); + } + } + free(pch); + } +} + +/* + * Detect and fix inlined location. + */ + +static void +_pmcpl_ct_expand_inline(struct pmcpl_ct_node *ct) +{ + int i, j; + unsigned fline, line, v; + uintfptr_t faddr, addr, pc; char sourcefile[PATH_MAX]; - char funcname[PATH_MAX]; + char ffuncname[PATH_MAX], funcname[PATH_MAX]; + char buffer[PATH_MAX]; + struct pmcpl_ct_node *child; /* * Child cost. * TODO: attach child cost to the real position in the funtion. * TODO: cfn= / call addr() / addr(call ) + * Resolve parent and compare to each instr location. */ - for (i=0 ; ipct_narc; i++) { - child = ct->pct_arc[i].pcta_child; + faddr = ct->pct_image->pi_vaddr + ct->pct_func; + fline = 0; + if (!pmcstat_image_addr2line(ct->pct_image, faddr, + sourcefile, sizeof(sourcefile), &fline, + ffuncname, sizeof(ffuncname))) + return; - /* Object binary. */ -#ifdef PMCPL_CT_OPTIMIZEFN - if (pmcpl_ct_prevfn != child->pct_image->pi_fullpath) { -#endif - pmcpl_ct_prevfn = child->pct_image->pi_fullpath; - fprintf(args.pa_graphfile, "cob=%s\n", - pmcstat_string_unintern(pmcpl_ct_prevfn)); -#if PMCPL_CT_OPTIMIZEFN - } -#endif - /* Child function name. */ - addr = child->pct_image->pi_vaddr + child->pct_func; - /* Child function source file. */ - if (pmcstat_image_addr2line(child->pct_image, addr, + for (i = 0; i < ct->pct_ninstr; i++) { + addr = ct->pct_image->pi_vaddr + + ct->pct_instr[i].pctf_func; + line = 0; + if (!pmcstat_image_addr2line(ct->pct_image, addr, sourcefile, sizeof(sourcefile), &line, - funcname, sizeof(funcname))) { - fprintf(args.pa_graphfile, "cfn=%s\n", funcname); - fprintf(args.pa_graphfile, "cfl=%s\n", sourcefile); - } else { - sym = pmcstat_symbol_search(child->pct_image, - child->pct_func); - if (sym != NULL) - fprintf(args.pa_graphfile, "cfn=%s\n", - pmcstat_string_unintern(sym->ps_name)); - else - fprintf(args.pa_graphfile, "cfn=%p\n", (void *)addr); - } + funcname, sizeof(funcname))) + continue; - /* Child function address, line and call count. */ - fprintf(args.pa_graphfile, "calls=%u %p %u\n", - ct->pct_arc[i].pcta_call, (void *)addr, line); + if (strcmp(funcname, ffuncname) == 0) + continue; - if (ct->pct_image != NULL) { - /* Call address, line, sample. */ - addr = ct->pct_image->pi_vaddr + ct->pct_func; - line = 0; - if (pmcstat_image_addr2line(ct->pct_image, addr, sourcefile, - sizeof(sourcefile), &line, - funcname, sizeof(funcname))) - fprintf(args.pa_graphfile, "%p %u", (void *)addr, line); - else - fprintf(args.pa_graphfile, "* *"); + /* + * - Lookup/create inline node by function name. + * - Move instr PMCs to the inline node. + * - Link nodes. + * The lookup create a specific node per image/pc. + */ + if (args.pa_verbosity >= 2) + fprintf(args.pa_printfile, + "WARNING: inlined function at %p %s in %s\n", + (void *)addr, funcname, ffuncname); + + snprintf(buffer, sizeof(buffer), "%s@%s", + funcname, ffuncname); + child = pmcpl_ct_node_hash_lookup(ct->pct_image, + ct->pct_func, ct->pct_sym, sourcefile, buffer); + assert(child != NULL); + pc = ct->pct_instr[i].pctf_func; + for (j = 0; jpct_instr[i].pctf_samples); + if (v == 0) + continue; + pmcpl_ct_instr_add(child, j, pc, v); + pmcpl_ct_node_update(ct, child, j, v, 0); + if (j < ct->pct_samples.npmcs) + ct->pct_samples.sb[j] -= + ct->pct_instr[i].pctf_samples.sb[j]; + ct->pct_instr[i].pctf_samples.sb[j] = 0; } - else - fprintf(args.pa_graphfile, "* *"); - for (j = 0; jpct_arc[i].pcta_samples)); - fprintf(args.pa_graphfile, "\n"); } } +static void +pmcpl_ct_expand_inline(void) +{ + int i; + struct pmcpl_ct_node_hash *pch; + + if (!args.pa_ctdumpinstr) + return; + + for (i = 0; i < PMCSTAT_NHASH; i++) + STAILQ_FOREACH(pch, &pmcpl_ct_node_hash[i], pch_next) + if (pch->pch_ctnode->pct_type == PMCPL_PCT_ADDR) + _pmcpl_ct_expand_inline(pch->pch_ctnode); +} + /* * Clean the PMC name for Kcachegrind formula */ @@ -940,13 +1114,12 @@ pmcpl_ct_fixup_pmcname(char *s) static void pmcpl_ct_print(void) { - int n, i; - struct pmcpl_ct_node_hash *pch; - struct pmcpl_ct_sample rsamples; + int i; char name[40]; + struct pmcpl_ct_sample rsamples; pmcpl_ct_samples_root(&rsamples); - pmcpl_ct_prevfn = NULL; + pmcpl_ct_expand_inline(); fprintf(args.pa_graphfile, "version: 1\n" @@ -963,25 +1136,8 @@ pmcpl_ct_print(void) for (i=0; ipch_ctnode); - pmcpl_ct_node_printchild(pch->pch_ctnode); - } - + pmcpl_ct_bfs(pmcpl_ct_root); pmcpl_ct_samples_free(&rsamples); } @@ -1002,11 +1158,10 @@ pmcpl_ct_init(void) { int i; - pmcpl_ct_prevfn = NULL; - pmcpl_ct_root = pmcpl_ct_node_allocate(NULL, 0); + pmcpl_ct_root = pmcpl_ct_node_allocate(); for (i = 0; i < PMCSTAT_NHASH; i++) - LIST_INIT(&pmcpl_ct_node_hash[i]); + STAILQ_INIT(&pmcpl_ct_node_hash[i]); pmcpl_ct_samples_init(&pmcpl_ct_callid); @@ -1029,7 +1184,7 @@ pmcpl_ct_shutdown(FILE *mf) */ for (i = 0; i < PMCSTAT_NHASH; i++) { - LIST_FOREACH_SAFE(pch, &pmcpl_ct_node_hash[i], pch_next, + STAILQ_FOREACH_SAFE(pch, &pmcpl_ct_node_hash[i], pch_next, pchtmp) { pmcpl_ct_node_free(pch->pch_ctnode); free(pch); Modified: stable/9/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/9/usr.sbin/pmcstat/pmcstat_log.c Fri May 25 07:23:24 2012 (r235976) +++ stable/9/usr.sbin/pmcstat/pmcstat_log.c Fri May 25 07:25:30 2012 (r235977) @@ -429,7 +429,9 @@ pmcstat_image_get_aout_params(struct pmc if ((fd = open(buffer, O_RDONLY, 0)) < 0 || (nbytes = read(fd, &ex, sizeof(ex))) < 0) { - warn("WARNING: Cannot determine type of \"%s\"", path); + if (args.pa_verbosity >= 2) + warn("WARNING: Cannot determine type of \"%s\"", + path); image->pi_type = PMCSTAT_IMAGE_INDETERMINABLE; if (fd != -1) (void) close(fd); @@ -639,8 +641,9 @@ pmcstat_image_get_elf_params(struct pmcs if ((fd = open(buffer, O_RDONLY, 0)) < 0 || (e = elf_begin(fd, ELF_C_READ, NULL)) == NULL || (elf_kind(e) != ELF_K_ELF)) { - warnx("WARNING: Cannot determine the type of \"%s\".", - buffer); + if (args.pa_verbosity >= 2) + warnx("WARNING: Cannot determine the type of \"%s\".", + buffer); goto done; } @@ -943,6 +946,7 @@ pmcstat_image_addr2line(struct pmcstat_i char *funcname, size_t funcname_len) { static int addr2line_warn = 0; + unsigned l; char *sep, cmdline[PATH_MAX], imagepath[PATH_MAX]; int fd; @@ -958,6 +962,11 @@ pmcstat_image_addr2line(struct pmcstat_i pmcstat_string_unintern(image->pi_fullpath)); } else close(fd); + /* + * New addr2line support recursive inline function with -i + * but the format does not add a marker when no more entries + * are available. + */ snprintf(cmdline, sizeof(cmdline), "addr2line -Cfe \"%s\"", imagepath); image->pi_addr2line = popen(cmdline, "r+"); @@ -998,10 +1007,10 @@ pmcstat_image_addr2line(struct pmcstat_i return (0); } *sep = '\0'; - *sourceline = atoi(sep+1); - if (*sourceline == 0) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 25 07:32:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6CC6D106566B; Fri, 25 May 2012 07:32:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 574A18FC0A; Fri, 25 May 2012 07:32:27 +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 q4P7WRnS088002; Fri, 25 May 2012 07:32:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P7WRE2088000; Fri, 25 May 2012 07:32:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205250732.q4P7WRE2088000@svn.freebsd.org> From: Andriy Gapon Date: Fri, 25 May 2012 07:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235978 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 07:32:27 -0000 Author: avg Date: Fri May 25 07:32:26 2012 New Revision: 235978 URL: http://svn.freebsd.org/changeset/base/235978 Log: device_add_child: protect against child device with no driver but fixed unit number This combination doesn't make sense, unit numbers should be hardwired only in context of a known driver. The wildcard devices should have wildcard unit numbers. Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri May 25 07:25:30 2012 (r235977) +++ head/sys/kern/subr_bus.c Fri May 25 07:32:26 2012 (r235978) @@ -1810,6 +1810,8 @@ device_add_child_ordered(device_t dev, u PDEBUG(("%s at %s with order %u as unit %d", name, DEVICENAME(dev), order, unit)); + KASSERT(name != NULL || unit == -1, + ("child device with wildcard name and specific unit number")); child = make_device(dev, name, unit); if (child == NULL) From owner-svn-src-all@FreeBSD.ORG Fri May 25 07:46:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5C91106564A; Fri, 25 May 2012 07:46:24 +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 975C08FC0C; Fri, 25 May 2012 07:46:24 +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 q4P7kOtJ088667; Fri, 25 May 2012 07:46:24 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P7kODU088665; Fri, 25 May 2012 07:46:24 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201205250746.q4P7kODU088665@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 25 May 2012 07:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235979 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 07:46:24 -0000 Author: glebius Date: Fri May 25 07:46:24 2012 New Revision: 235979 URL: http://svn.freebsd.org/changeset/base/235979 Log: Revert my local not yet properly tested changes, that leaked in with r235923. Modified: head/sys/netgraph/ng_mppc.c Modified: head/sys/netgraph/ng_mppc.c ============================================================================== --- head/sys/netgraph/ng_mppc.c Fri May 25 07:32:26 2012 (r235978) +++ head/sys/netgraph/ng_mppc.c Fri May 25 07:46:24 2012 (r235979) @@ -98,6 +98,15 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, "n /* Key length */ #define KEYLEN(b) (((b) & MPPE_128) ? 16 : 8) +/* + * When packets are lost with MPPE, we may have to re-key arbitrarily + * many times to 'catch up' to the new jumped-ahead sequence number. + * Since this can be expensive, we pose a limit on how many re-keyings + * we will do at one time to avoid a possible D.O.S. vulnerability. + * This should instead be a configurable parameter. + */ +#define MPPE_MAX_REKEY 1000 + /* MPPC packet header bits */ #define MPPC_FLAG_FLUSHED 0x8000 /* xmitter reset state */ #define MPPC_FLAG_RESTART 0x4000 /* compress history restart */ @@ -632,22 +641,20 @@ ng_mppc_decompress(node_p node, struct m #endif #ifdef NETGRAPH_MPPC_ENCRYPTION if ((d->cfg.bits & MPPE_BITS) != 0) { - u_int rekey; - - /* How many times are we going to have to re-key? */ - rekey = ((d->cfg.bits & MPPE_STATELESS) != 0) ? - numLost : (numLost / (MPPE_UPDATE_MASK + 1)); - if (rekey > 1000) - log(LOG_ERR, "%s: %d packets dropped, " - "node [%x]\n", __func__, numLost, - node->nd_ID); - - /* - * When packets are lost or re-ordered with MPPE, - * we may have to re-key up to 0xfff times to 'catch - * up' to the new jumped-ahead sequence number. Yep, - * this is heavy, but what else can we do? - */ + u_int rekey; + + /* How many times are we going to have to re-key? */ + rekey = ((d->cfg.bits & MPPE_STATELESS) != 0) ? + numLost : (numLost / (MPPE_UPDATE_MASK + 1)); + if (rekey > MPPE_MAX_REKEY) { + log(LOG_ERR, "%s: too many (%d) packets" + " dropped, disabling node %p!", + __func__, numLost, node); + priv->recv.cfg.enable = 0; + goto failed; + } + + /* Re-key as necessary to catch up to peer */ while (d->cc != cc) { if ((d->cfg.bits & MPPE_STATELESS) != 0 || (d->cc & MPPE_UPDATE_MASK) From owner-svn-src-all@FreeBSD.ORG Fri May 25 07:57:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6410F106564A; Fri, 25 May 2012 07:57:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35CE18FC0C; Fri, 25 May 2012 07:57: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 q4P7vINb089170; Fri, 25 May 2012 07:57:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P7vIC0089168; Fri, 25 May 2012 07:57:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205250757.q4P7vIC0089168@svn.freebsd.org> From: Alexander Motin Date: Fri, 25 May 2012 07:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235980 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 07:57:18 -0000 Author: mav Date: Fri May 25 07:57:17 2012 New Revision: 235980 URL: http://svn.freebsd.org/changeset/base/235980 Log: Remove sleep() from invalidate call in ses driver, waiting for daemon process exit. Instead use CAM's standard reference counting to prevent periph going away until process won't complete. I think that sleep in single CAM SWI thread is not a good idea and may lead to deadlocks if daemon process waits for some command completion. Combined with recent patch avoiding use of CAM SWI for ATA it just causes panics because of sleeps prohibited in interrupt thread context. Modified: head/sys/cam/scsi/scsi_enc.c Modified: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Fri May 25 07:46:24 2012 (r235979) +++ head/sys/cam/scsi/scsi_enc.c Fri May 25 07:57:17 2012 (r235980) @@ -136,15 +136,8 @@ enc_oninvalidate(struct cam_periph *peri */ enc->enc_flags |= ENC_FLAG_SHUTDOWN; if (enc->enc_daemon != NULL) { - /* Signal and wait for the ses daemon to terminate. */ + /* Signal the ses daemon to terminate. */ wakeup(enc->enc_daemon); - /* - * We're called with the SIM mutex held, but we're dropping - * the update mutex here on sleep. So we have to manually - * drop the SIM mutex. - */ - cam_periph_sleep(enc->periph, enc->enc_daemon, - PUSER, "thtrm", 0); } callout_drain(&enc->status_updater); @@ -839,6 +832,7 @@ enc_daemon(void *arg) } enc->enc_daemon = NULL; cam_periph_unlock(enc->periph); + cam_periph_release(enc->periph); kproc_exit(0); } @@ -849,6 +843,9 @@ enc_kproc_init(enc_softc_t *enc) callout_init_mtx(&enc->status_updater, enc->periph->sim->mtx, 0); + if (cam_periph_acquire(enc->periph) != CAM_REQ_CMP) + return (ENXIO); + result = kproc_create(enc_daemon, enc, &enc->enc_daemon, /*flags*/0, /*stackpgs*/0, "enc_daemon%d", enc->periph->unit_number); @@ -857,7 +854,8 @@ enc_kproc_init(enc_softc_t *enc) cam_periph_lock(enc->periph); enc->enc_vec.poll_status(enc); cam_periph_unlock(enc->periph); - } + } else + cam_periph_release(enc->periph); return (result); } @@ -955,7 +953,7 @@ enc_ctor(struct cam_periph *periph, void err = enc_kproc_init(enc); if (err) { xpt_print(periph->path, - "error %d string enc_daemon\n", err); + "error %d starting enc_daemon\n", err); goto out; } } From owner-svn-src-all@FreeBSD.ORG Fri May 25 08:18:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21B9F106566B; Fri, 25 May 2012 08:18:00 +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 0CCAD8FC16; Fri, 25 May 2012 08:18: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 q4P8Hxlr090053; Fri, 25 May 2012 08:17:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P8Hxl1090051; Fri, 25 May 2012 08:17:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250817.q4P8Hxl1090051@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 08:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235981 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 08:18:00 -0000 Author: bz Date: Fri May 25 08:17:59 2012 New Revision: 235981 URL: http://svn.freebsd.org/changeset/base/235981 Log: In case forwarding is turned on for a given address family, refuse to queue the packet for LRO and tell the driver to directly pass it on. This avoids re-assembly and later re-fragmentation problems when forwarding. It's not the best solution but the simplest and most effective for the moment. Should have been done: ages ago Discussed with and by: many MFC after: 3 days Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Fri May 25 07:57:17 2012 (r235980) +++ head/sys/netinet/tcp_lro.c Fri May 25 08:17:59 2012 (r235981) @@ -51,9 +51,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include + #include #ifndef LRO_ENTRIES @@ -369,6 +372,10 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m switch (eh_type) { #ifdef INET6 case ETHERTYPE_IPV6: + if (V_ip6_forwarding != 0) { + /* XXX-BZ stats but changing lro_ctrl is a problem. */ + return (TCP_LRO_CANNOT); + } l3hdr = ip6 = (struct ip6_hdr *)(eh + 1); error = tcp_lro_rx_ipv6(lc, m, ip6, &th); if (error != 0) @@ -379,6 +386,10 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m #endif #ifdef INET case ETHERTYPE_IP: + if (V_ipforwarding != 0) { + /* XXX-BZ stats but changing lro_ctrl is a problem. */ + return (TCP_LRO_CANNOT); + } l3hdr = ip4 = (struct ip *)(eh + 1); error = tcp_lro_rx_ipv4(lc, m, ip4, &th); if (error != 0) From owner-svn-src-all@FreeBSD.ORG Fri May 25 08:27:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D12B1065670; Fri, 25 May 2012 08:27:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0038FC08; Fri, 25 May 2012 08:27:41 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4P8RNKJ085807; Fri, 25 May 2012 11:27:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4P8RMNA071192; Fri, 25 May 2012 11:27:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4P8RMmi071191; Fri, 25 May 2012 11:27:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 25 May 2012 11:27:22 +0300 From: Konstantin Belousov To: Marcel Moolenaar Message-ID: <20120525082722.GO2358@deviant.kiev.zoral.com.ua> References: <201205242012.q4OKCkv9057985@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qi0WovVLX58BkhBU" Content-Disposition: inline In-Reply-To: <201205242012.q4OKCkv9057985@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235929 - in head/lib/libc/powerpc: . gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 08:27:42 -0000 --qi0WovVLX58BkhBU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 24, 2012 at 08:12:46PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Thu May 24 20:12:46 2012 > New Revision: 235929 > URL: http://svn.freebsd.org/changeset/base/235929 >=20 > Log: > Allow building for the PowerPC EABI by providing a dummy __eabi() > function. The purpose of the __eabi() function is to set up the > runtime and is called first thing by main(). The runtime is already > set up for us prior to caling main, so there's nothing to do for > us in the EABI case. >=20 > Added: > head/lib/libc/powerpc/gen/eabi.S (contents, props changed) > Modified: > head/lib/libc/powerpc/Symbol.map > head/lib/libc/powerpc/gen/Makefile.inc >=20 > Modified: head/lib/libc/powerpc/Symbol.map > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/powerpc/Symbol.map Thu May 24 20:00:58 2012 (r235928) > +++ head/lib/libc/powerpc/Symbol.map Thu May 24 20:12:46 2012 (r235929) > @@ -11,6 +11,7 @@ FBSD_1.0 { > /* PSEUDO syscalls */ > _exit; > =20 > + __eabi; > _mcount; > _setjmp; > _longjmp; I think the symbol should have been added to FBSD_1.3 version. --qi0WovVLX58BkhBU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+/QmoACgkQC3+MBN1Mb4h3nQCg6YRaxd/1odJrtKt9Go9dAcfs IVcAn3FpClBZEifN+gTvXdadmlMhpCOh =lnbr -----END PGP SIGNATURE----- --qi0WovVLX58BkhBU-- From owner-svn-src-all@FreeBSD.ORG Fri May 25 08:30:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6262B1065676; Fri, 25 May 2012 08:30:10 +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 4DABA8FC1A; Fri, 25 May 2012 08:30: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 q4P8UA9V090639; Fri, 25 May 2012 08:30:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P8UAwV090637; Fri, 25 May 2012 08:30:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205250830.q4P8UAwV090637@svn.freebsd.org> From: Alexander Motin Date: Fri, 25 May 2012 08:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235982 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 08:30:10 -0000 Author: mav Date: Fri May 25 08:30:09 2012 New Revision: 235982 URL: http://svn.freebsd.org/changeset/base/235982 Log: Add tunable/sysctl kern.cam.pmp.hide_special, controlling whether special PMP ports such as PMP configuration or SEMB should be exposed or hidden. These ports were always hidden before as useless and sometimes promatic. But with updated ses driver supporting SEMB it is no longer so straight. Keep ports hidden by default to avoid probe request ttimeouts if SEP is not connected to PMP's SEMB via I2C, that is very often situation. Modified: head/sys/cam/ata/ata_pmp.c Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Fri May 25 08:17:59 2012 (r235981) +++ head/sys/cam/ata/ata_pmp.c Fri May 25 08:30:09 2012 (r235982) @@ -126,8 +126,13 @@ static void pmpdone(struct cam_periph * #define PMP_DEFAULT_RETRY 1 #endif +#ifndef PMP_DEFAULT_HIDE_SPECIAL +#define PMP_DEFAULT_HIDE_SPECIAL 1 +#endif + static int pmp_retry_count = PMP_DEFAULT_RETRY; static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT; +static int pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL; static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -137,6 +142,9 @@ TUNABLE_INT("kern.cam.pmp.retry_count", SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RW, &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)"); TUNABLE_INT("kern.cam.pmp.default_timeout", &pmp_default_timeout); +SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RW, + &pmp_hide_special, 0, "Hide extra ports"); +TUNABLE_INT("kern.cam.pmp.hide_special", &pmp_hide_special); static struct periph_driver pmpdriver = { @@ -583,23 +591,33 @@ pmpdone(struct cam_periph *periph, union (ataio->res.lba_mid << 16) + (ataio->res.lba_low << 8) + ataio->res.sector_count; - /* This PMP declares 6 ports, while only 5 of them are real. - * Port 5 is enclosure management bridge port, which has implementation - * problems, causing probe faults. Hide it for now. */ - if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) - softc->pm_ports = 5; - /* This PMP declares 7 ports, while only 5 of them are real. - * Port 5 is some fake "Config Disk" with 640 sectors size, - * port 6 is enclosure management bridge port. - * Both fake ports has implementation problems, causing - * probe faults. Hide them for now. */ - if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7) - softc->pm_ports = 5; - /* These PMPs declare one more port then actually have, - * for configuration purposes. Hide it for now. */ - if (softc->pm_pid == 0x57231095 || softc->pm_pid == 0x57331095 || - softc->pm_pid == 0x57341095 || softc->pm_pid == 0x57441095) - softc->pm_ports--; + if (pmp_hide_special) { + /* + * This PMP declares 6 ports, while only 5 of them + * are real. Port 5 is a SEMB port, probing which + * causes timeouts if external SEP is not connected + * to PMP over I2C. + */ + if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) + softc->pm_ports = 5; + + /* + * This PMP declares 7 ports, while only 5 of them + * are real. Port 5 is a fake "Config Disk" with + * 640 sectors size. Port 6 is a SEMB port. + */ + if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7) + softc->pm_ports = 5; + + /* + * These PMPs have extra configuration port. + */ + if (softc->pm_pid == 0x57231095 || + softc->pm_pid == 0x57331095 || + softc->pm_pid == 0x57341095 || + softc->pm_pid == 0x57441095) + softc->pm_ports--; + } printf("%s%d: %d fan-out ports\n", periph->periph_name, periph->unit_number, softc->pm_ports); From owner-svn-src-all@FreeBSD.ORG Fri May 25 08:32:28 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 106BE106564A; Fri, 25 May 2012 08:32:28 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 7D3558FC16; Fri, 25 May 2012 08:32:27 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 7EF044003E; Fri, 25 May 2012 10:32:26 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 73FC540030; Fri, 25 May 2012 10:32:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 2C6CF40022; Fri, 25 May 2012 10:32:26 +0200 (CEST) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3VzLLK5Zh2z8ggx; Fri, 25 May 2012 10:32:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id VfaP2KCqs8WC; Fri, 25 May 2012 10:32:20 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3VzLLD1qzMz8ggv; Fri, 25 May 2012 10:32:20 +0200 (CEST) Received: from [IPv6:2001:470:dca9:1::4] (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 3VzLLD1LQ6z9CvV; Fri, 25 May 2012 10:32:20 +0200 (CEST) Message-ID: <4FBF438C.5080805@daemonic.se> Date: Fri, 25 May 2012 10:32:12 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Konstantin Belousov References: <201205232107.q4NL71dw095460@svn.freebsd.org> <4FBD5899.9000808@daemonic.se> <20120524092649.GH2358@deviant.kiev.zoral.com.ua> <4FBE0086.1050801@daemonic.se> In-Reply-To: <4FBE0086.1050801@daemonic.se> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 08:32:28 -0000 On 2012-05-24 11:33, Niclas Zeising wrote: > On 2012-05-24 11:26, Konstantin Belousov wrote: >> On Wed, May 23, 2012 at 11:37:29PM +0200, Niclas Zeising wrote: >>> On 05/23/12 23:07, Konstantin Belousov wrote: >>>> Author: kib >>>> Date: Wed May 23 21:07:01 2012 >>>> New Revision: 235859 >>>> URL: http://svn.freebsd.org/changeset/base/235859 >>>> >>>> Log: >>>> Enable drm2 modules build. >>>> >>>> Sponsored by: The FreeBSD Foundation >>>> MFC after: 1 month >>>> >>>> Modified: >>>> head/sys/i386/conf/XEN >>>> head/sys/modules/Makefile >>>> >>> >>> Hi! >>> Thank you very much for all your work! >>> With this commit, is there any need for any patches from you, or have >>> they all been incorporated by now? Perhaps a note in UPDATING would be >>> good, at least to make people more aware of the fact that GEM/KMS >>> finally has come to FreeBSD as well. An update to the wiki might be >>> good as well. I can help you with patches and updating the wiki, just >>> let me know. >>> Once again, a big thank you! >> >> ATM no more patches are needed to run new driver. >> >> I do not see a need in any UPDATING entry, since nothing should have >> been changed for users who did not used my patch before. >> >> Wiki ought to get complete rewrite, I might get time to do it at the end >> of week. > > Hi! > Thank you for the clarifications! > > Regards! Hi! Would it be possible to bump the FreeBSD version to reflect this commit? It would be helpful when working with the xorg ports, amongst other things. Thanks! Regards! -- Niclas Zeising From owner-svn-src-all@FreeBSD.ORG Fri May 25 08:56:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2759B106564A; Fri, 25 May 2012 08:56:00 +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 112148FC17; Fri, 25 May 2012 08:56: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 q4P8txBv091946; Fri, 25 May 2012 08:55:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P8txLe091944; Fri, 25 May 2012 08:55:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205250855.q4P8txLe091944@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 25 May 2012 08:55:59 +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: r235983 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 08:56:00 -0000 Author: kib Date: Fri May 25 08:55:59 2012 New Revision: 235983 URL: http://svn.freebsd.org/changeset/base/235983 Log: MFC r235603: Do not double-reference the found vm object in cdev_pager_lookup(). vm_pager_object_lookup() already referenced the object. Modified: stable/9/sys/vm/device_pager.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/device_pager.c ============================================================================== --- stable/9/sys/vm/device_pager.c Fri May 25 08:30:09 2012 (r235982) +++ stable/9/sys/vm/device_pager.c Fri May 25 08:55:59 2012 (r235983) @@ -102,7 +102,6 @@ cdev_pager_lookup(void *handle) mtx_lock(&dev_pager_mtx); object = vm_pager_object_lookup(&dev_pager_object_list, handle); - vm_object_reference(object); mtx_unlock(&dev_pager_mtx); return (object); } From owner-svn-src-all@FreeBSD.ORG Fri May 25 09:16:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D68001065673; Fri, 25 May 2012 09:16:59 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8A828FC15; Fri, 25 May 2012 09:16:59 +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 q4P9GxHR092844; Fri, 25 May 2012 09:16:59 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P9GxQv092841; Fri, 25 May 2012 09:16:59 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205250916.q4P9GxQv092841@svn.freebsd.org> From: Gleb Kurtsou Date: Fri, 25 May 2012 09:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235984 - in head/sys/fs: hpfs ntfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:16:59 -0000 Author: gleb Date: Fri May 25 09:16:59 2012 New Revision: 235984 URL: http://svn.freebsd.org/changeset/base/235984 Log: Use C99-style initialization for struct dirent in preparation for changing the structure. Sponsored by: Google Summer of Code 2011 Modified: head/sys/fs/hpfs/hpfs_vnops.c head/sys/fs/ntfs/ntfs_vnops.c Modified: head/sys/fs/hpfs/hpfs_vnops.c ============================================================================== --- head/sys/fs/hpfs/hpfs_vnops.c Fri May 25 08:55:59 2012 (r235983) +++ head/sys/fs/hpfs/hpfs_vnops.c Fri May 25 09:16:59 2012 (r235984) @@ -797,10 +797,21 @@ hpfs_de_uiomove ( } -static struct dirent hpfs_de_dot = - { 0, sizeof(struct dirent), DT_DIR, 1, "." }; -static struct dirent hpfs_de_dotdot = - { 0, sizeof(struct dirent), DT_DIR, 2, ".." }; +static struct dirent hpfs_de_dot = { + .d_fileno = 0, + .d_reclen = sizeof(struct dirent), + .d_type = DT_DIR, + .d_namlen = 1, + .d_name = "." +}; +static struct dirent hpfs_de_dotdot = { + .d_fileno = 0, + .d_reclen = sizeof(struct dirent), + .d_type = DT_DIR, + .d_namlen = 2, + .d_name = ".." +}; + int hpfs_readdir(ap) struct vop_readdir_args /* { Modified: head/sys/fs/ntfs/ntfs_vnops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vnops.c Fri May 25 08:55:59 2012 (r235983) +++ head/sys/fs/ntfs/ntfs_vnops.c Fri May 25 09:16:59 2012 (r235984) @@ -493,8 +493,13 @@ ntfs_readdir(ap) /* Simulate . in every dir except ROOT */ if( ip->i_number != NTFS_ROOTINO ) { - struct dirent dot = { NTFS_ROOTINO, - sizeof(struct dirent), DT_DIR, 1, "." }; + struct dirent dot = { + .d_fileno = NTFS_ROOTINO, + .d_reclen = sizeof(struct dirent), + .d_type = DT_DIR, + .d_namlen = 1, + .d_name = "." + }; if( uio->uio_offset < sizeof(struct dirent) ) { dot.d_fileno = ip->i_number; @@ -508,8 +513,13 @@ ntfs_readdir(ap) /* Simulate .. in every dir including ROOT */ if( uio->uio_offset < 2 * sizeof(struct dirent) ) { - struct dirent dotdot = { NTFS_ROOTINO, - sizeof(struct dirent), DT_DIR, 2, ".." }; + struct dirent dotdot = { + .d_fileno = NTFS_ROOTINO, + .d_reclen = sizeof(struct dirent), + .d_type = DT_DIR, + .d_namlen = 2, + .d_name = ".." + }; error = uiomove((char *)&dotdot,sizeof(struct dirent),uio); if(error) From owner-svn-src-all@FreeBSD.ORG Fri May 25 09:24:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B780A1065672; Fri, 25 May 2012 09:24:45 +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 A2B868FC15; Fri, 25 May 2012 09:24: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 q4P9Oj0N093193; Fri, 25 May 2012 09:24:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P9OjIP093191; Fri, 25 May 2012 09:24:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250924.q4P9OjIP093191@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 09:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235985 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:24:45 -0000 Author: bz Date: Fri May 25 09:24:45 2012 New Revision: 235985 URL: http://svn.freebsd.org/changeset/base/235985 Log: MFp4 bz_ipv6_fast: Properly protect the inp read access when handling the control code. In the past this was expensive but given the rlock it's not so much anymore. Spotted while: optimizing udp6 Discussed with: rwatson (a few months ago) Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Fri May 25 09:16:59 2012 (r235984) +++ head/sys/netinet/udp_usrreq.c Fri May 25 09:24:45 2012 (r235985) @@ -971,12 +971,14 @@ udp_output(struct inpcb *inp, struct mbu } src.sin_family = 0; + INP_RLOCK(inp); if (control != NULL) { /* * XXX: Currently, we assume all the optional information is * stored in a single mbuf. */ if (control->m_next) { + INP_RUNLOCK(inp); m_freem(control); m_freem(m); return (EINVAL); @@ -1018,6 +1020,7 @@ udp_output(struct inpcb *inp, struct mbu m_freem(control); } if (error) { + INP_RUNLOCK(inp); m_freem(m); return (error); } @@ -1039,7 +1042,6 @@ udp_output(struct inpcb *inp, struct mbu * XXXRW: Check that hash locking update here is correct. */ sin = (struct sockaddr_in *)addr; - INP_RLOCK(inp); if (sin != NULL && (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { INP_RUNLOCK(inp); From owner-svn-src-all@FreeBSD.ORG Fri May 25 09:27:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79B051065672; Fri, 25 May 2012 09:27:17 +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 64A718FC0A; Fri, 25 May 2012 09:27: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 q4P9RH9Z093331; Fri, 25 May 2012 09:27:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P9RH0i093329; Fri, 25 May 2012 09:27:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250927.q4P9RH0i093329@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 09:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235986 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:27:17 -0000 Author: bz Date: Fri May 25 09:27:16 2012 New Revision: 235986 URL: http://svn.freebsd.org/changeset/base/235986 Log: MFp4 bz_ipv6_fast: Use M_ZERO with malloc rather than calling bzero() ourselves. Change if () panic() checks to KASSERT()s as they are only catching invariants in code flow but not dependent on network input/output. Move initial assigments indirecting pointers after the lock has been aquired. Passing layer boundries, reset M_PROTOFLAGS. Remove a NULL assignment before free. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri May 25 09:24:45 2012 (r235985) +++ head/sys/netinet6/nd6.c Fri May 25 09:27:16 2012 (r235986) @@ -174,9 +174,7 @@ nd6_ifattach(struct ifnet *ifp) { struct nd_ifinfo *nd; - nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK); - bzero(nd, sizeof(*nd)); - + nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK|M_ZERO); nd->initialized = 1; nd->chlim = IPV6_DEFHLIM; @@ -284,10 +282,9 @@ nd6_option(union nd_opts *ndopts) struct nd_opt_hdr *nd_opt; int olen; - if (ndopts == NULL) - panic("ndopts == NULL in nd6_option"); - if (ndopts->nd_opts_last == NULL) - panic("uninitialized ndopts in nd6_option"); + KASSERT(ndopts != NULL, ("%s: ndopts == NULL", __func__)); + KASSERT(ndopts->nd_opts_last != NULL, ("%s: uninitialized ndopts", + __func__)); if (ndopts->nd_opts_search == NULL) return NULL; if (ndopts->nd_opts_done) @@ -335,10 +332,9 @@ nd6_options(union nd_opts *ndopts) struct nd_opt_hdr *nd_opt; int i = 0; - if (ndopts == NULL) - panic("ndopts == NULL in nd6_options"); - if (ndopts->nd_opts_last == NULL) - panic("uninitialized ndopts in nd6_options"); + KASSERT(ndopts != NULL, ("%s: ndopts == NULL", __func__)); + KASSERT(ndopts->nd_opts_last != NULL, ("%s: uninitialized ndopts", + __func__)); if (ndopts->nd_opts_search == NULL) return 0; @@ -1174,11 +1170,13 @@ done: void nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) { - struct sockaddr_in6 *gateway = (struct sockaddr_in6 *)rt->rt_gateway; + struct sockaddr_in6 *gateway; struct nd_defrouter *dr; - struct ifnet *ifp = rt->rt_ifp; + struct ifnet *ifp; RT_LOCK_ASSERT(rt); + gateway = (struct sockaddr_in6 *)rt->rt_gateway; + ifp = rt->rt_ifp; switch (req) { case RTM_ADD: @@ -1547,10 +1545,8 @@ nd6_cache_lladdr(struct ifnet *ifp, stru IF_AFDATA_UNLOCK_ASSERT(ifp); - if (ifp == NULL) - panic("ifp == NULL in nd6_cache_lladdr"); - if (from == NULL) - panic("from == NULL in nd6_cache_lladdr"); + KASSERT(ifp != NULL, ("%s: ifp == NULL", __func__)); + KASSERT(from != NULL, ("%s: from == NULL", __func__)); /* nothing must be updated for unspecified address */ if (IN6_IS_ADDR_UNSPECIFIED(from)) @@ -2074,6 +2070,8 @@ nd6_output_lle(struct ifnet *ifp, struct } return (error); } + /* Reset layer specific mbuf flags to avoid confusing lower layers. */ + m->m_flags &= ~(M_PROTOFLAGS); if ((ifp->if_flags & IFF_LOOPBACK) != 0) { return ((*ifp->if_output)(origifp, m, (struct sockaddr *)dst, NULL)); @@ -2239,7 +2237,6 @@ clear_llinfo_pqueue(struct llentry *ln) for (m_hold = ln->la_hold; m_hold; m_hold = m_hold_next) { m_hold_next = m_hold->m_nextpkt; - m_hold->m_nextpkt = NULL; m_freem(m_hold); } From owner-svn-src-all@FreeBSD.ORG Fri May 25 09:30:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DBC3106566B; Fri, 25 May 2012 09:30:17 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 790318FC16; Fri, 25 May 2012 09:30: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 q4P9UHSh093526; Fri, 25 May 2012 09:30:17 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P9UHk2093518; Fri, 25 May 2012 09:30:17 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201205250930.q4P9UHk2093518@svn.freebsd.org> From: Gabor Kovesdan Date: Fri, 25 May 2012 09:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235987 - head/usr.bin/sort X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:30:17 -0000 Author: gabor Date: Fri May 25 09:30:16 2012 New Revision: 235987 URL: http://svn.freebsd.org/changeset/base/235987 Log: - Only use multi-threading for large files - Do not use mmap() by default; it can be enabled by --mmap - Add some minor optimizations for -u - Update manual page according to the changes Submitted by: Oleg Moskalenko Modified: head/usr.bin/sort/bwstring.c head/usr.bin/sort/file.c head/usr.bin/sort/file.h head/usr.bin/sort/radixsort.c head/usr.bin/sort/sort.1.in head/usr.bin/sort/sort.c head/usr.bin/sort/sort.h Modified: head/usr.bin/sort/bwstring.c ============================================================================== --- head/usr.bin/sort/bwstring.c Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/bwstring.c Fri May 25 09:30:16 2012 (r235987) @@ -499,6 +499,22 @@ bwsfgetln(FILE *f, size_t *len, bool zer } return (bwssbdup(ret, *len)); + } else if (!zero_ended && (MB_CUR_MAX == 1)) { + char *ret; + + ret = fgetln(f, len); + + if (ret == NULL) { + if (!feof(f)) + err(2, NULL); + return (NULL); + } + if (*len > 0) { + if (ret[*len - 1] == '\n') + --(*len); + } + return (bwscsbdup(ret, *len)); + } else { wchar_t c = 0; Modified: head/usr.bin/sort/file.c ============================================================================== --- head/usr.bin/sort/file.c Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/file.c Fri May 25 09:30:16 2012 (r235987) @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); unsigned long long free_memory = 1000000; unsigned long long available_free_memory = 1000000; +bool use_mmap; + const char *tmpdir = "/var/tmp"; const char *compress_program; @@ -404,23 +406,21 @@ sort_list_dump(struct sort_list *l, cons err(2, NULL); if (l->list) { - struct sort_list_item *last_printed_item; size_t i; - - last_printed_item = NULL; - - for (i = 0; i < l->count; i++) { - struct sort_list_item *item; - - item = l->list[i]; - - if (!(sort_opts_vals.uflag) || - (last_printed_item == NULL) || - list_coll(&last_printed_item, &item)) { - bwsfwrite(item->str, f, + if (!(sort_opts_vals.uflag)) { + for (i = 0; i < l->count; ++i) + bwsfwrite(l->list[i]->str, f, sort_opts_vals.zflag); - if (sort_opts_vals.uflag) + } else { + struct sort_list_item *last_printed_item = NULL; + struct sort_list_item *item; + for (i = 0; i < l->count; ++i) { + item = l->list[i]; + if ((last_printed_item == NULL) || + list_coll(&last_printed_item, &item)) { + bwsfwrite(item->str, f, sort_opts_vals.zflag); last_printed_item = item; + } } } } @@ -657,7 +657,7 @@ file_reader_init(const char *fsrc) ret->fname = sort_strdup(fsrc); - if (strcmp(fsrc, "-") && (compress_program == NULL)) { + if (strcmp(fsrc, "-") && (compress_program == NULL) && use_mmap) { do { struct stat stat_buf; @@ -1539,7 +1539,9 @@ mt_sort(struct sort_list *list, const char* fn) { #if defined(SORT_THREADS) - if (nthreads < 2 || list->count < nthreads) { + if (nthreads < 2 || list->count < MT_SORT_THRESHOLD) { + size_t nthreads_save = nthreads; + nthreads = 1; #endif /* if single thread or small data, do simple sort */ sort_func(list->list, list->count, @@ -1547,6 +1549,7 @@ mt_sort(struct sort_list *list, (int(*)(const void *, const void *)) list_coll); sort_list_dump(list, fn); #if defined(SORT_THREADS) + nthreads = nthreads_save; } else { /* multi-threaded sort */ struct sort_list **parts; @@ -1590,7 +1593,18 @@ mt_sort(struct sort_list *list, pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_DETACHED); - pthread_create(&pth, &attr, mt_sort_thread, parts[i]); + for (;;) { + int res = pthread_create(&pth, &attr, + mt_sort_thread, parts[i]); + + if (res >= 0) + break; + if (errno == EAGAIN) { + pthread_yield(); + continue; + } + err(2, NULL); + } pthread_attr_destroy(&attr); } Modified: head/usr.bin/sort/file.h ============================================================================== --- head/usr.bin/sort/file.h Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/file.h Fri May 25 09:30:16 2012 (r235987) @@ -84,6 +84,9 @@ struct file0_reader extern unsigned long long free_memory; extern unsigned long long available_free_memory; +/* Are we using mmap ? */ +extern bool use_mmap; + /* temporary file dir */ extern const char *tmpdir; Modified: head/usr.bin/sort/radixsort.c ============================================================================== --- head/usr.bin/sort/radixsort.c Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/radixsort.c Fri May 25 09:30:16 2012 (r235987) @@ -609,7 +609,17 @@ run_top_sort_level(struct sort_level *sl pthread_attr_setdetachstate(&attr, PTHREAD_DETACHED); - pthread_create(&pth, &attr, sort_thread, NULL); + for (;;) { + int res = pthread_create(&pth, &attr, + sort_thread, NULL); + if (res >= 0) + break; + if (errno == EAGAIN) { + pthread_yield(); + continue; + } + err(2, NULL); + } pthread_attr_destroy(&attr); } @@ -626,6 +636,10 @@ run_sort(struct sort_list_item **base, s struct sort_level *sl; #if defined(SORT_THREADS) + size_t nthreads_save = nthreads; + if (nmemb < MT_SORT_THRESHOLD) + nthreads = 1; + if (nthreads > 1) { pthread_mutexattr_t mattr; @@ -663,6 +677,7 @@ run_sort(struct sort_list_item **base, s pthread_mutex_destroy(&g_ls_mutex); pthread_mutex_destroy(&sort_left_mutex); } + nthreads = nthreads_save; #endif } Modified: head/usr.bin/sort/sort.1.in ============================================================================== --- head/usr.bin/sort/sort.1.in Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/sort.1.in Fri May 25 09:30:16 2012 (r235987) @@ -33,7 +33,7 @@ .\" .\" @(#)sort.1 8.1 (Berkeley) 6/6/93 .\" -.Dd May 6, 2012 +.Dd May 25, 2012 .Dt SORT 1 .Os .Sh NAME @@ -358,6 +358,9 @@ This sort algorithm cannot be used with .Fl u and .Fl s . +.It Fl Fl mmap +Try to use file memory mapping system call. +It may increase speed in some cases. .El .Pp The following operands are available: Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/sort.c Fri May 25 09:30:16 2012 (r235987) @@ -89,6 +89,7 @@ const char *nlsstr[] = { "", "[+POS1 [-POS2]] [-S memsize] [-T tmpdir] [-t separator] " "[-o outfile] [--batch-size size] [--files0-from file] " "[--heapsort] [--mergesort] [--radixsort] [--qsort] " + "[--mmap] " #if defined(SORT_THREADS) "[--nthreads thread_no] " #endif @@ -138,7 +139,8 @@ enum QSORT_OPT, MERGESORT_OPT, HEAPSORT_OPT, - RADIXSORT_OPT + RADIXSORT_OPT, + MMAP_OPT }; #define NUMBER_OF_MUTUALLY_EXCLUSIVE_FLAGS 6 @@ -164,6 +166,7 @@ struct option long_options[] = { { "key", required_argument, NULL, 'k' }, { "merge", no_argument, NULL, 'm' }, { "mergesort", no_argument, NULL, MERGESORT_OPT }, + { "mmap", no_argument, NULL, MMAP_OPT }, { "month-sort", no_argument, NULL, 'M' }, { "numeric-sort", no_argument, NULL, 'n' }, { "output", required_argument, NULL, 'o' }, @@ -1063,12 +1066,16 @@ main(int argc, char **argv) tmpdir = sort_strdup(optarg); break; case 't': - if (strlen(optarg) > 1) { - if (strcmp(optarg, "\\0")) { + while (strlen(optarg) > 1) { + if (optarg[0] != '\\') { errx(2, "%s: %s\n", strerror(EINVAL), optarg); } - *optarg = 0; + optarg += 1; + if (*optarg == '0') { + *optarg = 0; + break; + } } sort_opts_vals.tflag = true; sort_opts_vals.field_sep = btowc(optarg[0]); @@ -1126,6 +1133,9 @@ main(int argc, char **argv) case MERGESORT_OPT: sort_opts_vals.sort_method = SORT_MERGESORT; break; + case MMAP_OPT: + use_mmap = true; + break; case HEAPSORT_OPT: sort_opts_vals.sort_method = SORT_HEAPSORT; break; @@ -1258,6 +1268,11 @@ main(int argc, char **argv) } } +#if defined(SORT_THREADS) + if ((argc < 1) || (strcmp(outfile, "-") == 0) || (*outfile == 0)) + nthreads = 1; +#endif + if (!sort_opts_vals.cflag && !sort_opts_vals.mflag) { struct file_list fl; struct sort_list list; Modified: head/usr.bin/sort/sort.h ============================================================================== --- head/usr.bin/sort/sort.h Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/sort.h Fri May 25 09:30:16 2012 (r235987) @@ -55,6 +55,7 @@ extern nl_catd catalog; extern const char *nlsstr[]; #if defined(SORT_THREADS) +#define MT_SORT_THRESHOLD (10000) extern size_t ncpu; extern size_t nthreads; #endif From owner-svn-src-all@FreeBSD.ORG Fri May 25 09:35:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A8F5106566B; Fri, 25 May 2012 09:35:50 +0000 (UTC) (envelope-from etnapierala@googlemail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 283268FC16; Fri, 25 May 2012 09:35:48 +0000 (UTC) Received: by bkvi18 with SMTP id i18so707135bkv.13 for ; Fri, 25 May 2012 02:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=bC7KAYj64ksg0PsBT+SEWAxIYJxBnTFYCy7g5mIxcQk=; b=RkJAjaeQAe/nSLw/VQQs9ikA3K58Vwwp2w8fgU3d4QnIWOZI2fFXlnMKKWUFkK2eFA zvuzQtb9v4p0n8aeN4vuXHBZbBeoW+yI6fQv8+/PM9ZfOWGjj3DT6VPRj2zJBiVILcyo RChm1XIOLp/TeP0NEb7UYThsW9RCpAoVBkQh06Qs92UzyNe1QbUPw9M5Xc/8E/REykoV w8yZFvKgnDICOcMXO+hBPJAt6bP3F8+rcGotWxAEswruR7fpbclHQicwhdZ2c+zK1jHw HjJxr5/9znLClKPrTYRQvioSN/b93NktmRPvkzlUTAJnrRgtMx6NIx8VWVcT7UKucN2U w6Kg== Received: by 10.204.10.70 with SMTP id o6mr1147187bko.70.1337938548183; Fri, 25 May 2012 02:35:48 -0700 (PDT) Received: from [192.168.1.104] (45.81.datacomsa.pl. [195.34.81.45]) by mx.google.com with ESMTPS id h18sm5666438bkh.8.2012.05.25.02.35.42 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 May 2012 02:35:46 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <4FBF32B7.8080902@FreeBSD.org> Date: Fri, 25 May 2012 11:35:38 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <4B789EE7-1833-4964-9AC7-3983257AD207@FreeBSD.org> References: <201205241648.q4OGmXha049187@svn.freebsd.org> <4FBF32B7.8080902@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235918 - head/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:35:50 -0000 Wiadomo=B6=E6 napisana przez Andriy Gapon w dniu 25 maj 2012, o godz. = 09:20: > on 24/05/2012 19:48 Edward Tomasz Napierala said the following: >> Author: trasz >> Date: Thu May 24 16:48:33 2012 >> New Revision: 235918 >> URL: http://svn.freebsd.org/changeset/base/235918 >>=20 >> Log: >> Make g_label(4) ignore provider size when looking for UFS labels. >> Without it, it fails to create labels for filesystems resized by >> growfs(8). >>=20 >> PR: kern/165962 >> Submitted by: Olivier Cochard-Labbe >=20 > Was this change discussed somewhere? Reviewed even? >=20 > I was once curious why the size check was there and there was a very = valid > reason to have it: > http://lists.freebsd.org/pipermail/freebsd-geom/2009-April/003473.html > Has anything changed? Nope, I just didn't investigate it enough. I'm testing a fix by Jung-uk = Kim; if it works, I'll commit it, otherwise I'll revert it. In any case, = I'll add a comment describing why it's there. Sorry for the breakage. --=20 If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-all@FreeBSD.ORG Fri May 25 09:36:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C97FE10656D1; Fri, 25 May 2012 09:36:39 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B227D8FC12; Fri, 25 May 2012 09:36:39 +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 q4P9adqq093823; Fri, 25 May 2012 09:36:39 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P9adck093814; Fri, 25 May 2012 09:36:39 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205250936.q4P9adck093814@svn.freebsd.org> From: Gleb Kurtsou Date: Fri, 25 May 2012 09:36:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235988 - in head/sys/boot: arm/at91/boot2 arm/ixp425/boot2 common i386/boot2 i386/gptboot pc98/boot2 powerpc/boot1.chrp sparc64/boot1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:36:39 -0000 Author: gleb Date: Fri May 25 09:36:39 2012 New Revision: 235988 URL: http://svn.freebsd.org/changeset/base/235988 Log: Use 32-bit ufs_ino_t instead of ino_t to keep boot2 small and prevent unnecessary 64-bit math on 32-bit machines. Sponsored by: Google Summer of Code 2011 Modified: head/sys/boot/arm/at91/boot2/boot2.c head/sys/boot/arm/ixp425/boot2/boot2.c head/sys/boot/common/ufsread.c head/sys/boot/i386/boot2/boot2.c head/sys/boot/i386/gptboot/gptboot.c head/sys/boot/pc98/boot2/boot2.c head/sys/boot/powerpc/boot1.chrp/boot1.c head/sys/boot/sparc64/boot1/boot1.c Modified: head/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- head/sys/boot/arm/at91/boot2/boot2.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/arm/at91/boot2/boot2.c Fri May 25 09:36:39 2012 (r235988) @@ -95,7 +95,6 @@ static uint8_t dsk_meta; static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); #ifdef FIXUP_BOOT_DRV static void fixup_boot_drv(caddr_t, int, int, int); @@ -111,7 +110,7 @@ static void fixup_boot_drv(caddr_t, int, #endif static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) return -1; @@ -154,7 +153,7 @@ int main(void) { int autoboot, c = 0; - ino_t ino; + ufs_ino_t ino; dmadat = (void *)(0x20000000 + (16 << 20)); board_init(); @@ -199,7 +198,7 @@ load(void) Elf32_Ehdr eh; static Elf32_Phdr ep[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; #ifdef FIXUP_BOOT_DRV Modified: head/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- head/sys/boot/arm/ixp425/boot2/boot2.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/arm/ixp425/boot2/boot2.c Fri May 25 09:36:39 2012 (r235988) @@ -98,7 +98,6 @@ static int disk_layout; static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static int drvread(void *, unsigned, unsigned); #ifdef FIXUP_BOOT_DRV @@ -114,7 +113,7 @@ static void fixup_boot_drv(caddr_t, int, #endif static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) return -1; @@ -158,7 +157,7 @@ main(void) { const char *bt; int autoboot, c = 0; - ino_t ino; + ufs_ino_t ino; dmadat = (void *)(0x1c0000); p_memset((char *)dmadat, 0, 32 * 1024); @@ -207,7 +206,7 @@ load(void) Elf32_Ehdr eh; static Elf32_Phdr ep[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; #ifdef FIXUP_BOOT_DRV Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/common/ufsread.c Fri May 25 09:36:39 2012 (r235988) @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #define cgbase(fs, c) ((ufs2_daddr_t)((fs)->fs_fpg * (c))) #endif +typedef uint32_t ufs_ino_t; + /* * We use 4k `virtual' blocks for filesystem data, whatever the actual * filesystem block size. FFS blocks are always a multiple of 4k. @@ -85,14 +87,14 @@ struct dmadat { }; static struct dmadat *dmadat; -static ino_t lookup(const char *); -static ssize_t fsread(ino_t, void *, size_t); +static ufs_ino_t lookup(const char *); +static ssize_t fsread(ufs_ino_t, void *, size_t); static uint8_t ls, dsk_meta; static uint32_t fs_off; static __inline uint8_t -fsfind(const char *name, ino_t * ino) +fsfind(const char *name, ufs_ino_t * ino) { static char buf[DEV_BSIZE]; struct direct *d; @@ -116,12 +118,12 @@ fsfind(const char *name, ino_t * ino) return 0; } -static ino_t +static ufs_ino_t lookup(const char *path) { static char name[MAXNAMLEN + 1]; const char *s; - ino_t ino; + ufs_ino_t ino; ssize_t n; uint8_t dt; @@ -163,7 +165,7 @@ static int sblock_try[] = SBLOCKSEARCH; #endif static ssize_t -fsread(ino_t inode, void *buf, size_t nbyte) +fsread(ufs_ino_t inode, void *buf, size_t nbyte) { #ifndef UFS2_ONLY static struct ufs1_dinode dp1; @@ -173,7 +175,7 @@ fsread(ino_t inode, void *buf, size_t nb static struct ufs2_dinode dp2; #endif static struct fs fs; - static ino_t inomap; + static ufs_ino_t inomap; char *blkbuf; void *indbuf; char *s; Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/i386/boot2/boot2.c Fri May 25 09:36:39 2012 (r235988) @@ -138,7 +138,6 @@ static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); @@ -170,7 +169,7 @@ strcmp(const char *s1, const char *s2) #include "ufsread.c" static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) { printf("Invalid %s\n", "format"); @@ -222,7 +221,7 @@ int main(void) { uint8_t autoboot; - ino_t ino; + ufs_ino_t ino; size_t nbyte; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -307,7 +306,7 @@ load(void) static Elf32_Phdr ep[2]; static Elf32_Shdr es[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; Modified: head/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/i386/gptboot/gptboot.c Fri May 25 09:36:39 2012 (r235988) @@ -90,14 +90,13 @@ static struct bootinfo bootinfo; void exit(int); static void load(void); static int parse(char *, int *); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, daddr_t, unsigned); static uint32_t memsize(void); #include "ufsread.c" static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) { @@ -138,7 +137,7 @@ main(void) { char cmd[512], cmdtmp[512]; int autoboot, dskupdated; - ino_t ino; + ufs_ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; @@ -247,7 +246,7 @@ load(void) static Elf32_Phdr ep[2]; static Elf32_Shdr es[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr, x; int fmt, i, j; Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/pc98/boot2/boot2.c Fri May 25 09:36:39 2012 (r235988) @@ -140,7 +140,6 @@ static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); @@ -172,7 +171,7 @@ strcmp(const char *s1, const char *s2) #include "ufsread.c" static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) { printf("Invalid %s\n", "format"); @@ -351,7 +350,7 @@ main(void) int i; #endif uint8_t autoboot; - ino_t ino; + ufs_ino_t ino; size_t nbyte; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -446,7 +445,7 @@ load(void) static Elf32_Phdr ep[2]; static Elf32_Shdr es[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; Modified: head/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/boot1.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/powerpc/boot1.chrp/boot1.c Fri May 25 09:36:39 2012 (r235988) @@ -45,7 +45,6 @@ static char bootargs[128]; static ofwh_t bootdev; static struct fs fs; -static ino_t inomap; static char blkbuf[BSIZEMAX]; static unsigned int fsblks; @@ -492,7 +491,7 @@ load(const char *fname) Elf32_Ehdr eh; Elf32_Phdr ph; caddr_t p; - ino_t ino; + ufs_ino_t ino; int i; if ((ino = lookup(fname)) == 0) { Modified: head/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- head/sys/boot/sparc64/boot1/boot1.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/sparc64/boot1/boot1.c Fri May 25 09:36:39 2012 (r235988) @@ -415,7 +415,6 @@ loadzfs(void) Elf64_Ehdr eh; Elf64_Phdr ph; caddr_t p; - ino_t ino; int i; if (zbread((char *)&eh, 0, sizeof(eh)) != sizeof(eh)) { @@ -459,7 +458,7 @@ load(const char *fname) Elf64_Ehdr eh; Elf64_Phdr ph; caddr_t p; - ino_t ino; + ufs_ino_t ino; int i; if ((ino = lookup(fname)) == 0) { From owner-svn-src-all@FreeBSD.ORG Fri May 25 10:08:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D61E9106566C; Fri, 25 May 2012 10:08:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C14428FC0C; Fri, 25 May 2012 10:08:48 +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 q4PA8mrx004488; Fri, 25 May 2012 10:08:48 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PA8mKD004486; Fri, 25 May 2012 10:08:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205251008.q4PA8mKD004486@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 25 May 2012 10:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235989 - head/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 10:08:48 -0000 Author: trasz Date: Fri May 25 10:08:48 2012 New Revision: 235989 URL: http://svn.freebsd.org/changeset/base/235989 Log: Revert r235918 for now and add comment explaining the reason for the size check. Modified: head/sys/geom/label/g_label_ufs.c Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Fri May 25 09:36:39 2012 (r235988) +++ head/sys/geom/label/g_label_ufs.c Fri May 25 10:08:48 2012 (r235989) @@ -81,10 +81,16 @@ g_label_ufs_taste_common(struct g_consum fs = (struct fs *)g_read_data(cp, superblock, SBLOCKSIZE, NULL); if (fs == NULL) continue; - /* Check for magic */ - if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0) { + /* Check for magic. We also need to check if file system size is equal + * to providers size, because sysinstall(8) used to bogusly put first + * partition at offset 0 instead of 16, and glabel/ufs would find file + * system on slice instead of partition. + */ + if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0 && + pp->mediasize / fs->fs_fsize == fs->fs_old_size) { /* Valid UFS1. */ - } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0) { + } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 && + pp->mediasize / fs->fs_fsize == fs->fs_size) { /* Valid UFS2. */ } else { g_free(fs); From owner-svn-src-all@FreeBSD.ORG Fri May 25 10:32:36 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EEBA106564A; Fri, 25 May 2012 10:32:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id EBE878FC15; Fri, 25 May 2012 10:32:35 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4PAW3rN012310; Fri, 25 May 2012 13:32:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4PAW2KE074022; Fri, 25 May 2012 13:32:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4PAW24a074021; Fri, 25 May 2012 13:32:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 25 May 2012 13:32:02 +0300 From: Konstantin Belousov To: Niclas Zeising Message-ID: <20120525103202.GR2358@deviant.kiev.zoral.com.ua> References: <201205232107.q4NL71dw095460@svn.freebsd.org> <4FBD5899.9000808@daemonic.se> <20120524092649.GH2358@deviant.kiev.zoral.com.ua> <4FBE0086.1050801@daemonic.se> <4FBF438C.5080805@daemonic.se> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E5Kv0g4zpMKTBL4W" Content-Disposition: inline In-Reply-To: <4FBF438C.5080805@daemonic.se> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 10:32:36 -0000 --E5Kv0g4zpMKTBL4W Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 25, 2012 at 10:32:12AM +0200, Niclas Zeising wrote: > Hi! > Would it be possible to bump the FreeBSD version to reflect this commit? > It would be helpful when working with the xorg ports, amongst other thin= gs. > Thanks! > Regards! > --=20 There is absolutely no use for version bump. Port builds (libdrm, mesa and ddx) do not depend on any base system headers or libraries. They come with private copies of the ABI headers. --E5Kv0g4zpMKTBL4W Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+/X6IACgkQC3+MBN1Mb4gB5wCg0GTGqIn49u15YWd0PLww6LdS Y/MAnAgzQ/kBfM7LiA2Svw1vLl2Bt1ay =yqdD -----END PGP SIGNATURE----- --E5Kv0g4zpMKTBL4W-- From owner-svn-src-all@FreeBSD.ORG Fri May 25 11:14:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7C25106564A; Fri, 25 May 2012 11:14:08 +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 A2C0E8FC0C; Fri, 25 May 2012 11:14: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 q4PBE8do007143; Fri, 25 May 2012 11:14:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PBE8FC007141; Fri, 25 May 2012 11:14:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205251114.q4PBE8FC007141@svn.freebsd.org> From: Michael Tuexen Date: Fri, 25 May 2012 11:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235990 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 11:14:08 -0000 Author: tuexen Date: Fri May 25 11:14:08 2012 New Revision: 235990 URL: http://svn.freebsd.org/changeset/base/235990 Log: Undefine SCTP_PACKED before including sctp_uio.h, which doesn't use it. Spotted by Irene Ruengeler. MFC after: 3 days Modified: head/sys/netinet/sctp.h Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Fri May 25 10:08:48 2012 (r235989) +++ head/sys/netinet/sctp.h Fri May 25 11:14:08 2012 (r235990) @@ -556,6 +556,8 @@ struct sctp_error_unrecognized_chunk { #define SCTP_SMALLEST_PMTU 512 /* smallest pmtu allowed when disabling PMTU * discovery */ +#undef SCTP_PACKED + #include /* This dictates the size of the packet @@ -607,7 +609,4 @@ struct sctp_error_unrecognized_chunk { #define SCTP_LOG_AT_SEND_2_OUTQ 0x08000000 #define SCTP_LOG_TRY_ADVANCE 0x10000000 - -#undef SCTP_PACKED - #endif /* !_NETINET_SCTP_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri May 25 14:40:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 304FE1065670; Fri, 25 May 2012 14:40:57 +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 0313F8FC1C; Fri, 25 May 2012 14:40: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 q4PEeuOa015726; Fri, 25 May 2012 14:40:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PEeuq8015717; Fri, 25 May 2012 14:40:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251440.q4PEeuq8015717@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 14:40:56 +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: r235992 - stable/9/sys/sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 14:40:57 -0000 Author: marius Date: Fri May 25 14:40:56 2012 New Revision: 235992 URL: http://svn.freebsd.org/changeset/base/235992 Log: MFC: r234348 Turn on PREEMPTION by default. After fixing several bugs over time, the last show-stopper keeping PREEMPTION from being usable on sparc64 should have been dealt with in r230662 (MFC'ed to stable/9 in r230662). At least on 2-way systems, PREEMPTION causes a little bit of a degradation in worldstone performance. However, FreeBSD seems to have started building up regressions in !PREEMPTION cases so sparc64 better should not be an oddball in this regard. Modified: stable/9/sys/sparc64/conf/GENERIC 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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/sparc64/conf/GENERIC ============================================================================== --- stable/9/sys/sparc64/conf/GENERIC Fri May 25 14:11:02 2012 (r235991) +++ stable/9/sys/sparc64/conf/GENERIC Fri May 25 14:40:56 2012 (r235992) @@ -27,7 +27,7 @@ makeoptions DEBUG=-g # Build kernel wit # At this time all platforms are supported, as-is. options SCHED_ULE # ULE scheduler -#options PREEMPTION # Enable kernel thread preemption +options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols options SCTP # Stream Control Transmission Protocol From owner-svn-src-all@FreeBSD.ORG Fri May 25 14:52:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A817106566B; Fri, 25 May 2012 14:52:06 +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 D03248FC14; Fri, 25 May 2012 14:52: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 q4PEq5ZY016247; Fri, 25 May 2012 14:52:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PEq5Cb016245; Fri, 25 May 2012 14:52:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251452.q4PEq5Cb016245@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 14:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235994 - head/sys/sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 14:52:06 -0000 Author: marius Date: Fri May 25 14:52:05 2012 New Revision: 235994 URL: http://svn.freebsd.org/changeset/base/235994 Log: Merge from x86: r232521 Exclude USB drivers (except umass and ukbd) from main kernel image. Modified: head/sys/sparc64/conf/GENERIC Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri May 25 14:49:51 2012 (r235993) +++ head/sys/sparc64/conf/GENERIC Fri May 25 14:52:05 2012 (r235994) @@ -234,35 +234,8 @@ device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) device usb # USB Bus (required) -#device udbp # USB Double Bulk Pipe devices (needs netgraph) -device uhid # "Human Interface Devices" device ukbd # Keyboard -device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da -device ums # Mouse -device urio # Diamond Rio 500 MP3 player -# USB Serial devices -device uark # Technologies ARK3116 based serial adapters -device ubsa # Belkin F5U103 and compatible serial adapters -device uftdi # For FTDI usb serial adapters -device uipaq # Some WinCE based devices -device uplcom # Prolific PL-2303 serial adapters -device uslcom # SI Labs CP2101/CP2102 serial adapters -device uvisor # Visor and Palm devices -device uvscom # USB serial support for DDI pocket's PHS -# USB Ethernet, requires miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet -device udav # Davicom DM9601E USB -# USB Wireless -device rum # Ralink Technology RT2501USB wireless NICs -device uath # Atheros AR5523 wireless NICs -device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support device firewire # FireWire bus code @@ -278,4 +251,3 @@ device sound # Generic sound driver (r device snd_audiocs # Crystal Semiconductor CS4231 device snd_es137x # Ensoniq AudioPCI ES137x device snd_t4dwave # Acer Labs M5451 -device snd_uaudio # USB Audio From owner-svn-src-all@FreeBSD.ORG Fri May 25 14:54:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B057106566B; Fri, 25 May 2012 14:54:13 +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 5564C8FC0C; Fri, 25 May 2012 14:54: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 q4PEsDhs016401; Fri, 25 May 2012 14:54:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PEsDm7016399; Fri, 25 May 2012 14:54:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251454.q4PEsDm7016399@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 14:54: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: r235995 - stable/9/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 14:54:13 -0000 Author: marius Date: Fri May 25 14:54:12 2012 New Revision: 235995 URL: http://svn.freebsd.org/changeset/base/235995 Log: MFC: r234789 Add multiple inclusion protection. PR: 165025 Submitted by: Gavin Mu Modified: stable/9/sys/boot/common/bootstrap.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/common/bootstrap.h ============================================================================== --- stable/9/sys/boot/common/bootstrap.h Fri May 25 14:52:05 2012 (r235994) +++ stable/9/sys/boot/common/bootstrap.h Fri May 25 14:54:12 2012 (r235995) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef _BOOTSTRAP_H_ +#define _BOOTSTRAP_H_ + #include #include #include @@ -323,3 +326,5 @@ void delay(int delay); void dev_cleanup(void); time_t time(time_t *tloc); + +#endif /* !_BOOTSTRAP_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri May 25 14:54:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8F761065674; Fri, 25 May 2012 14:54:18 +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 938D68FC16; Fri, 25 May 2012 14: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 q4PEsI8s016439; Fri, 25 May 2012 14:54:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PEsIaY016437; Fri, 25 May 2012 14:54:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251454.q4PEsIaY016437@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 14:54: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: r235996 - stable/8/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 14:54:18 -0000 Author: marius Date: Fri May 25 14:54:18 2012 New Revision: 235996 URL: http://svn.freebsd.org/changeset/base/235996 Log: MFC: r234789 Add multiple inclusion protection. PR: 165025 Submitted by: Gavin Mu Modified: stable/8/sys/boot/common/bootstrap.h 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) Modified: stable/8/sys/boot/common/bootstrap.h ============================================================================== --- stable/8/sys/boot/common/bootstrap.h Fri May 25 14:54:12 2012 (r235995) +++ stable/8/sys/boot/common/bootstrap.h Fri May 25 14:54:18 2012 (r235996) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef _BOOTSTRAP_H_ +#define _BOOTSTRAP_H_ + #include #include #include @@ -307,3 +310,5 @@ void delay(int delay); void dev_cleanup(void); time_t time(time_t *tloc); + +#endif /* !_BOOTSTRAP_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri May 25 14:57:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E8CC1065672; Fri, 25 May 2012 14:57:02 +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 487508FC0A; Fri, 25 May 2012 14:57: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 q4PEv2p4016646; Fri, 25 May 2012 14:57:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PEv2qe016644; Fri, 25 May 2012 14:57:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251457.q4PEv2qe016644@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 14:57: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: r235997 - stable/9/sys/boot/sparc64/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 14:57:02 -0000 Author: marius Date: Fri May 25 14:57:01 2012 New Revision: 235997 URL: http://svn.freebsd.org/changeset/base/235997 Log: MFC: r234897 Add a command for showing the heap usage. PR: 165025 Submitted by: Gavin Mu Modified: stable/9/sys/boot/sparc64/loader/main.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/9/sys/boot/sparc64/loader/main.c Fri May 25 14:54:18 2012 (r235996) +++ stable/9/sys/boot/sparc64/loader/main.c Fri May 25 14:57:01 2012 (r235997) @@ -800,6 +800,18 @@ main(int (*openfirm)(void *)) return (1); } +COMMAND_SET(heap, "heap", "show heap usage", command_heap); + +static int +command_heap(int argc, char *argv[]) +{ + + mallocstats(); + printf("heap base at %p, top at %p, upper limit at %p\n", heapva, + sbrk(0), heapva + HEAPSZ); + return(CMD_OK); +} + COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); static int From owner-svn-src-all@FreeBSD.ORG Fri May 25 14:57:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF00F1065673; Fri, 25 May 2012 14:57:02 +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 88F3C8FC0C; Fri, 25 May 2012 14:57: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 q4PEv2fc016660; Fri, 25 May 2012 14:57:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PEv2rh016658; Fri, 25 May 2012 14:57:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251457.q4PEv2rh016658@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 14:57: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: r235998 - stable/8/sys/boot/sparc64/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 14:57:03 -0000 Author: marius Date: Fri May 25 14:57:02 2012 New Revision: 235998 URL: http://svn.freebsd.org/changeset/base/235998 Log: MFC: r234897 Add a command for showing the heap usage. PR: 165025 Submitted by: Gavin Mu Modified: stable/8/sys/boot/sparc64/loader/main.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) Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Fri May 25 14:57:01 2012 (r235997) +++ stable/8/sys/boot/sparc64/loader/main.c Fri May 25 14:57:02 2012 (r235998) @@ -915,6 +915,18 @@ main(int (*openfirm)(void *)) return (1); } +COMMAND_SET(heap, "heap", "show heap usage", command_heap); + +static int +command_heap(int argc, char *argv[]) +{ + + mallocstats(); + printf("heap base at %p, top at %p, upper limit at %p\n", heapva, + sbrk(0), heapva + HEAPSZ); + return(CMD_OK); +} + COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); static int From owner-svn-src-all@FreeBSD.ORG Fri May 25 15:05:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4EF5106564A; Fri, 25 May 2012 15:05:18 +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 84B988FC0C; Fri, 25 May 2012 15:05: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 q4PF5IKK017065; Fri, 25 May 2012 15:05:18 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PF5IrG017062; Fri, 25 May 2012 15:05:18 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205251505.q4PF5IrG017062@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 25 May 2012 15:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235999 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 15:05:18 -0000 Author: raj Date: Fri May 25 15:05:17 2012 New Revision: 235999 URL: http://svn.freebsd.org/changeset/base/235999 Log: More Cicada/Vitesse PHY ids. Obtained from: Semihalf Modified: head/sys/dev/mii/ciphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/ciphy.c ============================================================================== --- head/sys/dev/mii/ciphy.c Fri May 25 14:57:02 2012 (r235998) +++ head/sys/dev/mii/ciphy.c Fri May 25 15:05:17 2012 (r235999) @@ -91,8 +91,10 @@ static const struct mii_phydesc ciphys[] MII_PHY_DESC(xxCICADA, CS8201B), MII_PHY_DESC(xxCICADA, CS8204), MII_PHY_DESC(xxCICADA, VSC8211), + MII_PHY_DESC(xxCICADA, VSC8221), MII_PHY_DESC(xxCICADA, CS8244), MII_PHY_DESC(xxVITESSE, VSC8601), + MII_PHY_DESC(xxVITESSE, VSC8641), MII_PHY_END }; @@ -368,8 +370,10 @@ ciphy_fixup(struct mii_softc *sc) break; case MII_MODEL_xxCICADA_VSC8211: + case MII_MODEL_xxCICADA_VSC8221: case MII_MODEL_xxCICADA_CS8244: case MII_MODEL_xxVITESSE_VSC8601: + case MII_MODEL_xxVITESSE_VSC8641: break; default: device_printf(sc->mii_dev, "unknown CICADA PHY model %x\n", Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Fri May 25 14:57:02 2012 (r235998) +++ head/sys/dev/mii/miidevs Fri May 25 15:05:17 2012 (r235999) @@ -52,7 +52,7 @@ oui AMD 0x00001a Advanced Micro Devic oui BROADCOM 0x001018 Broadcom Corporation oui BROADCOM2 0x000af7 Broadcom Corporation oui BROADCOM3 0x001be9 Broadcom Corporation -oui CICADA 0x0003F1 Cicada Semiconductor +oui CICADA 0x0003f1 Cicada Semiconductor oui DAVICOM 0x00606e Davicom Semiconductor oui ENABLESEMI 0x0010dd Enable Semiconductor oui ICPLUS 0x0090c3 IC Plus Corp. @@ -71,6 +71,7 @@ oui SEEQ 0x00a07d Seeq Technology oui SIS 0x00e006 Silicon Integrated Systems oui TI 0x080028 Texas Instruments oui TSC 0x00c039 TDK Semiconductor +oui VITESSE 0x0001c1 Vitesse Semiconductor oui XAQTI 0x00e0ae XaQti Corp. /* Some Intel 82553's use an alternative OUI. */ @@ -190,6 +191,7 @@ model xxBROADCOM_ALT1 BCM5906 0x0004 BCM model xxCICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8204 0x0004 Cicada CS8204 10/100/1000TX PHY model xxCICADA VSC8211 0x000b Cicada VSC8211 10/100/1000TX PHY +model xxCICADA VSC8221 0x0015 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8244 0x002c Cicada CS8244 10/100/1000TX PHY @@ -318,5 +320,8 @@ model TI TNETE2101 0x0003 TNETE2101 med model xxTSC 78Q2120 0x0014 78Q2120 10/100 media interface model xxTSC 78Q2121 0x0015 78Q2121 100BASE-TX media interface +/* Vitesse Semiconductor */ +model xxVITESSE VSC8641 0x0003 Vitesse VSC8641 10/100/1000TX PHY + /* XaQti Corp. PHYs */ model xxXAQTI XMACII 0x0000 XaQti Corp. XMAC II gigabit interface From owner-svn-src-all@FreeBSD.ORG Fri May 25 15:13:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4201E1065688; Fri, 25 May 2012 15:13:56 +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 2CD3E8FC1D; Fri, 25 May 2012 15:13:56 +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 q4PFDugA017461; Fri, 25 May 2012 15:13:56 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PFDtrU017459; Fri, 25 May 2012 15:13:55 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205251513.q4PFDtrU017459@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 25 May 2012 15:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236000 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 15:13:56 -0000 Author: raj Date: Fri May 25 15:13:55 2012 New Revision: 236000 URL: http://svn.freebsd.org/changeset/base/236000 Log: Missing vm_paddr_t bits which should have been part of r235936. Modified: head/sys/powerpc/powerpc/mmu_if.m Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Fri May 25 15:05:17 2012 (r235999) +++ head/sys/powerpc/powerpc/mmu_if.m Fri May 25 15:13:55 2012 (r236000) @@ -761,7 +761,7 @@ METHOD void cpu_bootstrap { */ METHOD void * mapdev { mmu_t _mmu; - vm_offset_t _pa; + vm_paddr_t _pa; vm_size_t _size; }; @@ -818,7 +818,7 @@ METHOD void unmapdev { * * @retval pa physical address corresponding to mapping */ -METHOD vm_offset_t kextract { +METHOD vm_paddr_t kextract { mmu_t _mmu; vm_offset_t _va; }; @@ -833,7 +833,7 @@ METHOD vm_offset_t kextract { METHOD void kenter { mmu_t _mmu; vm_offset_t _va; - vm_offset_t _pa; + vm_paddr_t _pa; }; /** @@ -860,7 +860,7 @@ METHOD void kenter_attr { */ METHOD boolean_t dev_direct_mapped { mmu_t _mmu; - vm_offset_t _pa; + vm_paddr_t _pa; vm_size_t _size; }; From owner-svn-src-all@FreeBSD.ORG Fri May 25 15:14:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A8C21065680; Fri, 25 May 2012 15:14:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 242098FC12; Fri, 25 May 2012 15:14:23 +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 q4PFEMks017517; Fri, 25 May 2012 15:14:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PFEMG0017516; Fri, 25 May 2012 15:14:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251514.q4PFEMG0017516@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 15:14: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: r236001 - stable/9/contrib/compiler-rt/lib/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 15:14:23 -0000 Author: marius Date: Fri May 25 15:14:22 2012 New Revision: 236001 URL: http://svn.freebsd.org/changeset/base/236001 Log: MFC: r230025 Add SPARC64 version of div/mod written in assembly. This version is similar to the code shipped with libgcc. It is based on the code from the SPARC64 architecture manual, provided without any restrictions. Tested by: flo@ Added: stable/9/contrib/compiler-rt/lib/sparc64/ - copied from r230025, head/contrib/compiler-rt/lib/sparc64/ Modified: Directory Properties: stable/9/contrib/compiler-rt/ (props changed) From owner-svn-src-all@FreeBSD.ORG Fri May 25 15:15:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FA9C106566C; Fri, 25 May 2012 15:15:26 +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 4F8A38FC14; Fri, 25 May 2012 15:15: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 q4PFFQSC017612; Fri, 25 May 2012 15:15:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PFFQDN017610; Fri, 25 May 2012 15:15:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251515.q4PFFQDN017610@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 15:15: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: r236002 - stable/9/contrib/compiler-rt/lib/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 15:15:26 -0000 Author: marius Date: Fri May 25 15:15:25 2012 New Revision: 236002 URL: http://svn.freebsd.org/changeset/base/236002 Log: MFC: r235388 - Get rid of debugging support in order to get rid of the V8-specific C compiler frame size used there so this whole thing is V8/V9-agnostic. - Use 32-bit function alignment as GCC does when using UltraSPARC I or higher optimizations. - Don't waste delay slots when possible. Modified: stable/9/contrib/compiler-rt/lib/sparc64/divmod.m4 Directory Properties: stable/9/contrib/compiler-rt/ (props changed) Modified: stable/9/contrib/compiler-rt/lib/sparc64/divmod.m4 ============================================================================== --- stable/9/contrib/compiler-rt/lib/sparc64/divmod.m4 Fri May 25 15:14:22 2012 (r236001) +++ stable/9/contrib/compiler-rt/lib/sparc64/divmod.m4 Fri May 25 15:15:25 2012 (r236002) @@ -59,9 +59,6 @@ define(SC,`%g2') #include "../assembly.h" -.text - .align 4 - define(DEVELOP_QUOTIENT_BITS, ` !depth $1, accumulated bits $2 bl L.$1.eval(TWOSUPN+$2) @@ -84,12 +81,14 @@ L.$1.eval(TWOSUPN+$2): ifelse( $1, 1, `9:') ') ifelse( ANSWER, `quotient', ` +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__udivsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,SIGN ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__divsi3) - save %sp,-64,%sp ! do this for debugging orcc divisor,dividend,%g0 ! are either dividend or divisor negative bge divide ! if not, skip this junk xor divisor,dividend,SIGN ! record sign of result in sign of SIGN @@ -104,12 +103,14 @@ DEFINE_COMPILERRT_FUNCTION(__divsi3) neg dividend ! FALL THROUGH ',` +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__umodsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,SIGN ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__modsi3) - save %sp,-64,%sp ! do this for debugging orcc divisor,dividend,%g0 ! are either dividend or divisor negative bge divide ! if not, skip this junk mov dividend,SIGN ! record sign of result in sign of SIGN @@ -184,8 +185,8 @@ do_single_div: nop sub R,V,R mov 1,Q - b end_single_divloop - nop + b,a end_single_divloop + ! EMPTY single_divloop: sll Q,1,Q bl 1f @@ -202,8 +203,8 @@ single_divloop: deccc SC bge single_divloop tst R - b end_regular_divide - nop + b,a end_regular_divide + ! EMPTY not_really_big: 1: @@ -224,9 +225,8 @@ end_regular_divide: deccc ITER bge divloop tst R - bge got_result - nop - ! non-restoring fixup here + bl,a got_result + ! non-restoring fixup if remainder < 0, otherwise annulled ifelse( ANSWER, `quotient', ` dec Q ',` add R,divisor,R @@ -234,13 +234,11 @@ ifelse( ANSWER, `quotient', got_result: tst SIGN - bge 1f - restore - ! answer < 0 - retl ! leaf-routine return + bl,a 1f + ! negate for answer < 0, otherwise annulled ifelse( ANSWER, `quotient', -` neg %o2,%o0 ! quotient <- -Q -',` neg %o3,%o0 ! remainder <- -R +` neg %o2,%o2 ! Q <- -Q +',` neg %o3,%o3 ! R <- -R ') 1: retl ! leaf-routine return From owner-svn-src-all@FreeBSD.ORG Fri May 25 15:16:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 48050106566C; Fri, 25 May 2012 15:16:41 +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 32D438FC0C; Fri, 25 May 2012 15:16: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 q4PFGfMN017713; Fri, 25 May 2012 15:16:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PFGf6P017710; Fri, 25 May 2012 15:16:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251516.q4PFGf6P017710@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 15:16: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: r236003 - stable/9/contrib/compiler-rt/lib/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 15:16:41 -0000 Author: marius Date: Fri May 25 15:16:40 2012 New Revision: 236003 URL: http://svn.freebsd.org/changeset/base/236003 Log: MFC: r235389 Regenerate after r235388 (MFC'ed to stable/9 in r236002). Modified: stable/9/contrib/compiler-rt/lib/sparc64/divsi3.S stable/9/contrib/compiler-rt/lib/sparc64/modsi3.S Directory Properties: stable/9/contrib/compiler-rt/ (props changed) Modified: stable/9/contrib/compiler-rt/lib/sparc64/divsi3.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/sparc64/divsi3.S Fri May 25 15:15:25 2012 (r236002) +++ stable/9/contrib/compiler-rt/lib/sparc64/divsi3.S Fri May 25 15:16:40 2012 (r236003) @@ -47,13 +47,13 @@ */ #include "../assembly.h" .text - .align 4 + .align 32 DEFINE_COMPILERRT_FUNCTION(__udivsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,%g3 ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__divsi3) - save %sp,-64,%sp ! do this for debugging orcc %o1,%o0,%g0 ! are either %o0 or %o1 negative bge divide ! if not, skip this junk xor %o1,%o0,%g3 ! record sign of result in sign of %g3 @@ -126,8 +126,8 @@ do_single_div: nop sub %o3,%o5,%o3 mov 1,%o2 - b end_single_divloop - nop + b,a end_single_divloop + ! EMPTY single_divloop: sll %o2,1,%o2 bl 1f @@ -144,8 +144,8 @@ single_divloop: deccc %g2 bge single_divloop tst %o3 - b end_regular_divide - nop + b,a end_regular_divide + ! EMPTY not_really_big: 1: sll %o5,4,%o5 @@ -317,17 +317,14 @@ end_regular_divide: deccc %o4 bge divloop tst %o3 - bge got_result - nop - ! non-restoring fixup here + bl,a got_result + ! non-restoring fixup if remainder < 0, otherwise annulled dec %o2 got_result: tst %g3 - bge 1f - restore - ! answer < 0 - retl ! leaf-routine return - neg %o2,%o0 ! quotient <- -%o2 + bl,a 1f + ! negate for answer < 0, otherwise annulled + neg %o2,%o2 ! %o2 <- -%o2 1: retl ! leaf-routine return mov %o2,%o0 ! quotient <- %o2 Modified: stable/9/contrib/compiler-rt/lib/sparc64/modsi3.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/sparc64/modsi3.S Fri May 25 15:15:25 2012 (r236002) +++ stable/9/contrib/compiler-rt/lib/sparc64/modsi3.S Fri May 25 15:16:40 2012 (r236003) @@ -47,13 +47,13 @@ */ #include "../assembly.h" .text - .align 4 + .align 32 DEFINE_COMPILERRT_FUNCTION(__umodsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,%g3 ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__modsi3) - save %sp,-64,%sp ! do this for debugging orcc %o1,%o0,%g0 ! are either %o0 or %o1 negative bge divide ! if not, skip this junk mov %o0,%g3 ! record sign of result in sign of %g3 @@ -126,8 +126,8 @@ do_single_div: nop sub %o3,%o5,%o3 mov 1,%o2 - b end_single_divloop - nop + b,a end_single_divloop + ! EMPTY single_divloop: sll %o2,1,%o2 bl 1f @@ -144,8 +144,8 @@ single_divloop: deccc %g2 bge single_divloop tst %o3 - b end_regular_divide - nop + b,a end_regular_divide + ! EMPTY not_really_big: 1: sll %o5,4,%o5 @@ -317,17 +317,14 @@ end_regular_divide: deccc %o4 bge divloop tst %o3 - bge got_result - nop - ! non-restoring fixup here + bl,a got_result + ! non-restoring fixup if remainder < 0, otherwise annulled add %o3,%o1,%o3 got_result: tst %g3 - bge 1f - restore - ! answer < 0 - retl ! leaf-routine return - neg %o3,%o0 ! remainder <- -%o3 + bl,a 1f + ! negate for answer < 0, otherwise annulled + neg %o3,%o3 ! %o3 <- -%o3 1: retl ! leaf-routine return mov %o3,%o0 ! remainder <- %o3 From owner-svn-src-all@FreeBSD.ORG Fri May 25 16:07:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC15106566B; Fri, 25 May 2012 16:07:39 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92E328FC12; Fri, 25 May 2012 16:07:39 +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 q4PG7dvL019850; Fri, 25 May 2012 16:07:39 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PG7dVR019846; Fri, 25 May 2012 16:07:39 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205251607.q4PG7dVR019846@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 25 May 2012 16:07:39 +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: r236004 - in stable/9/sys: conf contrib/dev/ral dev/ral modules/ral modules/ralfw modules/ralfw/rt2860 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:07:39 -0000 Author: bschmidt Date: Fri May 25 16:07:39 2012 New Revision: 236004 URL: http://svn.freebsd.org/changeset/base/236004 Log: MFC r232946,232958,235233: r232946: Update the rt2860's firmware and add a Makefile for the module. While here remove the ucode header file which was used to generate the fw files but by now is outdated. r232958: Import the latest microcode.h which was used to generate the current firmware files and adjust the Makefile. r235233: Add support for Ralink RT2800/RT3000 chipsets. Added: stable/9/sys/contrib/dev/ral/microcode.h - copied unchanged from r232958, head/sys/contrib/dev/ral/microcode.h stable/9/sys/dev/ral/rt2860.c - copied unchanged from r235233, head/sys/dev/ral/rt2860.c stable/9/sys/dev/ral/rt2860reg.h - copied unchanged from r235233, head/sys/dev/ral/rt2860reg.h stable/9/sys/dev/ral/rt2860var.h - copied unchanged from r235233, head/sys/dev/ral/rt2860var.h stable/9/sys/modules/ralfw/rt2860/ - copied from r232946, head/sys/modules/ralfw/rt2860/ Deleted: stable/9/sys/contrib/dev/ral/rt2661_ucode.h Modified: stable/9/sys/conf/files stable/9/sys/contrib/dev/ral/Makefile stable/9/sys/contrib/dev/ral/rt2860.fw.uu stable/9/sys/dev/ral/if_ral_pci.c stable/9/sys/modules/ral/Makefile stable/9/sys/modules/ralfw/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Fri May 25 15:16:40 2012 (r236003) +++ stable/9/sys/conf/files Fri May 25 16:07:39 2012 (r236004) @@ -1616,6 +1616,7 @@ dev/puc/pucdata.c optional puc pci dev/quicc/quicc_core.c optional quicc dev/ral/rt2560.c optional ral dev/ral/rt2661.c optional ral +dev/ral/rt2860.c optional ral dev/ral/if_ral_pci.c optional ral pci rt2561fw.c optional rt2561fw | ralfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk rt2561.fw:rt2561fw -mrt2561 -c${.TARGET}" \ Modified: stable/9/sys/contrib/dev/ral/Makefile ============================================================================== --- stable/9/sys/contrib/dev/ral/Makefile Fri May 25 15:16:40 2012 (r236003) +++ stable/9/sys/contrib/dev/ral/Makefile Fri May 25 16:07:39 2012 (r236004) @@ -2,31 +2,35 @@ FILES= rt2561s.fw.uu rt2561.fw.uu rt2661.fw.uu rt2860.fw.uu -rt2561s.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2561s.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2561s_ucode, sizeof(rt2561s_ucode)); return 0; \ + write(1, rt2561s, sizeof(rt2561s)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2561s.fw) > ${.TARGET} -rt2561.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2561.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2561_ucode, sizeof(rt2561_ucode)); return 0; \ + write(1, rt2561, sizeof(rt2561)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2561.fw) > ${.TARGET} -rt2661.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2661.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2661_ucode, sizeof(rt2661_ucode)); return 0; \ + write(1, rt2661, sizeof(rt2661)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2661.fw) > ${.TARGET} -rt2860.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2860.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2860_ucode, sizeof(rt2860_ucode)); return 0; \ + write(1, rt2860, sizeof(rt2860)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2860.fw) > ${.TARGET} Copied: stable/9/sys/contrib/dev/ral/microcode.h (from r232958, head/sys/contrib/dev/ral/microcode.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/contrib/dev/ral/microcode.h Fri May 25 16:07:39 2012 (r236004, copy of r232958, head/sys/contrib/dev/ral/microcode.h) @@ -0,0 +1,3016 @@ +/* $FreeBSD$ */ +/* $OpenBSD: microcode.h,v 1.7 2010/04/05 14:14:02 damien Exp $ */ + +/*- + * Copyright (c) 2005-2010, Ralink Technology, Corp. + * Paul Lin + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file contains the loadable 8051 microcodes for the Ralink RT2561, + * RT2561S, RT2661 and RT2860 chipsets. + */ + +static const uint8_t rt2561[] = { + 0x02, 0x1c, 0x12, 0x02, 0x13, 0xcb, 0xc2, 0x8c, 0x22, 0x22, 0x00, + 0x02, 0x16, 0x0f, 0xc2, 0xaf, 0xc2, 0x8d, 0x75, 0x8c, 0x94, 0x75, + 0x8a, 0x93, 0xd2, 0xaf, 0x22, 0x02, 0x18, 0xda, 0x12, 0x1b, 0xe8, + 0x40, 0x03, 0x02, 0x02, 0x1e, 0x90, 0x21, 0x02, 0xe0, 0xf5, 0x2d, + 0x90, 0x00, 0x03, 0xe0, 0x12, 0x08, 0x25, 0x00, 0xb0, 0x00, 0x00, + 0xce, 0x01, 0x00, 0x5e, 0x10, 0x00, 0x6f, 0x11, 0x00, 0xf2, 0x20, + 0x01, 0x4d, 0x21, 0x01, 0x70, 0x22, 0x01, 0x84, 0x30, 0x01, 0x8f, + 0x31, 0x01, 0xd5, 0x50, 0x01, 0x9f, 0x51, 0x01, 0xf2, 0x52, 0x02, + 0x06, 0x60, 0x00, 0x00, 0x02, 0x14, 0x90, 0x00, 0x0a, 0xe0, 0x20, + 0xe5, 0x03, 0x30, 0x07, 0x03, 0xd2, 0x08, 0x22, 0x12, 0x17, 0xa5, + 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x11, 0xe5, 0x11, 0xc4, 0x33, + 0x54, 0xe0, 0x24, 0x21, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, + 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x11, 0xc4, 0x33, 0x54, 0xe0, 0x24, + 0x2c, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xe5, 0x11, 0xf0, + 0xc4, 0x33, 0x54, 0xe0, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x34, 0x21, + 0xf5, 0x83, 0xe5, 0x2d, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, + 0x12, 0x11, 0x31, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x31, 0x60, 0x05, + 0x12, 0x1b, 0x8a, 0x80, 0x03, 0x12, 0x1b, 0x3d, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, 0x22, 0x75, 0x31, 0xff, + 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, 0x01, 0x01, 0xe0, + 0x54, 0xfe, 0xf0, 0x54, 0x3e, 0xf0, 0xe4, 0x90, 0x00, 0x0b, 0xf0, + 0xf0, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, 0x22, + 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, 0x12, 0x04, 0x0e, 0x90, 0x34, + 0xcd, 0xe0, 0x20, 0xe3, 0xf9, 0x90, 0x21, 0x14, 0x12, 0x08, 0x01, + 0x90, 0x34, 0xc0, 0x12, 0x08, 0x0d, 0x90, 0x21, 0x18, 0x12, 0x08, + 0x01, 0x90, 0x34, 0xc8, 0x12, 0x08, 0x0d, 0x90, 0x21, 0x1c, 0x12, + 0x08, 0x01, 0x90, 0x34, 0xc4, 0x12, 0x08, 0x0d, 0x90, 0x34, 0xcc, + 0x74, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x04, 0xf0, 0x90, 0x01, 0x01, + 0xe0, 0x44, 0x01, 0xf0, 0x44, 0x40, 0xf0, 0x90, 0x00, 0x0b, 0xe0, + 0x44, 0x10, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, + 0x01, 0x01, 0xe0, 0x54, 0xfe, 0xf0, 0x54, 0xbf, 0xf0, 0x90, 0x00, + 0x0b, 0xe0, 0x54, 0xef, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, + 0x2d, 0x12, 0x1c, 0x62, 0x22, 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, + 0x12, 0x04, 0x0e, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0xd2, 0x05, 0x85, 0x2d, 0x23, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0x22, 0x12, 0x1a, 0x74, 0xc2, 0x00, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, 0x22, 0x85, 0x2d, 0x25, + 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfb, 0xff, 0xf0, 0xe4, 0x90, 0x00, + 0x07, 0xf0, 0x90, 0x00, 0x0a, 0x74, 0x04, 0xf0, 0xe4, 0x90, 0x00, + 0x08, 0xf0, 0x90, 0x21, 0x00, 0xe0, 0x90, 0x00, 0x09, 0xf0, 0x90, + 0x00, 0x07, 0x74, 0x71, 0xf0, 0xef, 0x44, 0x04, 0x90, 0x00, 0x0b, + 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, 0x90, 0x21, 0x00, 0xe0, + 0xff, 0x54, 0x1f, 0xf5, 0x30, 0xa3, 0xe0, 0xf5, 0x27, 0x8f, 0x26, + 0x12, 0x08, 0x90, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x2c, 0x12, 0x18, + 0x13, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, + 0x22, 0x12, 0x19, 0x53, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x1c, 0x62, 0x22, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x1c, 0x62, 0x22, 0x8e, 0x15, 0x8f, 0x16, 0xca, 0xed, 0xca, + 0xc9, 0xeb, 0xc9, 0x30, 0x0a, 0x04, 0x7f, 0x4a, 0x80, 0x02, 0x7f, + 0x42, 0xcb, 0xef, 0xcb, 0xea, 0xc3, 0x94, 0x04, 0x50, 0x02, 0x80, + 0x01, 0xc3, 0x40, 0x04, 0xcb, 0x44, 0x20, 0xcb, 0x85, 0x16, 0x82, + 0x85, 0x15, 0x83, 0xeb, 0xf0, 0xa3, 0xe4, 0xf0, 0x85, 0x16, 0x82, + 0x85, 0x15, 0x83, 0xa3, 0xa3, 0xe5, 0x1a, 0xf0, 0xe5, 0x19, 0x85, + 0x16, 0x82, 0x85, 0x15, 0x83, 0xa3, 0xa3, 0xa3, 0xf0, 0xe5, 0x16, + 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0x74, 0x0f, + 0xf0, 0xe5, 0x16, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, + 0x83, 0xe4, 0xf0, 0xe5, 0x16, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x35, + 0x15, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x16, 0x24, 0x07, 0xf5, 0x82, + 0xe4, 0x35, 0x15, 0xf5, 0x83, 0x74, 0x10, 0xf0, 0xea, 0x90, 0x1a, + 0x9c, 0x93, 0xfb, 0xea, 0x64, 0x01, 0x60, 0x08, 0xea, 0x64, 0x02, + 0x60, 0x03, 0xba, 0x03, 0x04, 0xcb, 0x44, 0x08, 0xcb, 0xe5, 0x16, + 0x24, 0x08, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0xeb, 0xf0, + 0xe5, 0x16, 0x24, 0x15, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, + 0x74, 0xff, 0xf0, 0xe5, 0x16, 0x24, 0x16, 0xf5, 0x82, 0xe4, 0x35, + 0x15, 0xf5, 0x83, 0xe9, 0xf0, 0xe5, 0x16, 0x24, 0x09, 0xf5, 0x82, + 0xe4, 0x35, 0x15, 0xf5, 0x83, 0x74, 0x04, 0xf0, 0x25, 0x1a, 0xf5, + 0x1a, 0xe4, 0x35, 0x19, 0xf5, 0x19, 0xea, 0xc3, 0x94, 0x04, 0x40, + 0x03, 0x02, 0x03, 0xd6, 0xea, 0x60, 0x03, 0xba, 0x01, 0x1f, 0xea, + 0x24, 0x01, 0xfd, 0xe4, 0x33, 0xfc, 0xe5, 0x1a, 0xae, 0x19, 0x78, + 0x03, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0xff, 0x12, 0x07, + 0x96, 0x8e, 0x19, 0x8f, 0x1a, 0x02, 0x03, 0xb6, 0xea, 0x24, 0xff, + 0xfd, 0xe4, 0x34, 0xff, 0xfc, 0x7e, 0x00, 0x7f, 0x0b, 0x12, 0x07, + 0x84, 0xcc, 0xee, 0xcc, 0xcd, 0xef, 0xcd, 0xe5, 0x1a, 0xc4, 0xf8, + 0x54, 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x19, 0xc4, 0x54, 0xf0, 0x48, + 0xfe, 0x12, 0x07, 0x96, 0x8c, 0x1b, 0x8d, 0x1c, 0xea, 0x24, 0xff, + 0xfd, 0xe4, 0x34, 0xff, 0xfc, 0x7e, 0x00, 0x7f, 0x0b, 0x12, 0x07, + 0x84, 0xcc, 0xee, 0xcc, 0xcd, 0xef, 0xcd, 0xe5, 0x1a, 0xc4, 0xf8, + 0x54, 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x19, 0xc4, 0x54, 0xf0, 0x48, + 0xfe, 0x12, 0x07, 0x96, 0x8e, 0x19, 0x8f, 0x1a, 0xe5, 0x1c, 0x45, + 0x1b, 0x60, 0x08, 0x05, 0x1a, 0xe5, 0x1a, 0x70, 0x02, 0x05, 0x19, + 0xea, 0x24, 0xff, 0xfd, 0xe4, 0x34, 0xff, 0xfc, 0x7e, 0x00, 0x7f, + 0x03, 0x12, 0x07, 0x84, 0xd3, 0xe5, 0x1c, 0x9f, 0xe5, 0x1b, 0x9e, + 0x50, 0x18, 0xe5, 0x1c, 0x45, 0x1b, 0x60, 0x12, 0xba, 0x03, 0x0f, + 0xe5, 0x16, 0x24, 0x09, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, + 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x16, 0x24, 0x0a, 0xf5, 0x82, 0xe4, + 0x35, 0x15, 0xf5, 0x83, 0xe5, 0x1a, 0xf0, 0xe5, 0x19, 0xff, 0xe5, + 0x16, 0x24, 0x0b, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0xef, + 0xf0, 0x80, 0x2d, 0xe5, 0x1a, 0x54, 0x3f, 0xff, 0xe5, 0x16, 0x24, + 0x0a, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0xef, 0xf0, 0xe5, + 0x1a, 0xae, 0x19, 0x78, 0x06, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, + 0xf9, 0xff, 0xe5, 0x16, 0x24, 0x0b, 0xf5, 0x82, 0xe4, 0x35, 0x15, + 0xf5, 0x83, 0xef, 0xf0, 0x85, 0x16, 0x82, 0x85, 0x15, 0x83, 0xe0, + 0x44, 0x01, 0xf0, 0x22, 0x8e, 0x12, 0x8f, 0x13, 0x8d, 0x14, 0xe5, + 0x14, 0xa2, 0xe1, 0x92, 0x09, 0xe5, 0x34, 0x24, 0x19, 0xf5, 0x82, + 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfd, 0xe5, 0x34, 0x24, 0x1a, + 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfb, 0xa2, 0x09, + 0x92, 0x0a, 0x75, 0x19, 0x00, 0x75, 0x1a, 0x1a, 0x12, 0x02, 0x1f, + 0x30, 0x09, 0x04, 0x7f, 0xc8, 0x80, 0x02, 0x7f, 0xe8, 0xe5, 0x13, + 0x24, 0x18, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, 0xf0, + 0xe5, 0x31, 0x60, 0x04, 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x01, 0xe5, + 0x13, 0x24, 0x19, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, + 0xf0, 0xe5, 0x34, 0x24, 0x19, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, + 0x83, 0xe0, 0xff, 0x7d, 0x1a, 0x7c, 0x00, 0x12, 0x0e, 0x64, 0xe5, + 0x13, 0x24, 0x1a, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, + 0xf0, 0xe5, 0x13, 0x24, 0x1b, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, + 0x83, 0xee, 0xf0, 0xe5, 0x31, 0x60, 0x60, 0xe5, 0x13, 0x24, 0x1c, + 0xff, 0xe4, 0x35, 0x12, 0xfe, 0xe5, 0x34, 0x24, 0x12, 0xfd, 0xe4, + 0x35, 0x33, 0xfc, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, + 0xe5, 0x13, 0x24, 0x22, 0xff, 0xe4, 0x35, 0x12, 0xfe, 0x7c, 0x30, + 0x7d, 0x10, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, 0xe5, + 0x13, 0x24, 0x28, 0xff, 0xe4, 0x35, 0x12, 0xfe, 0x7c, 0x30, 0x7d, + 0x08, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, 0xe5, 0x34, + 0x24, 0x18, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xff, + 0xe5, 0x13, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, + 0xef, 0xf0, 0x80, 0x3f, 0xe5, 0x13, 0x24, 0x1c, 0xff, 0xe4, 0x35, + 0x12, 0xfe, 0x7c, 0x30, 0x7d, 0x10, 0x75, 0x1b, 0x11, 0x7b, 0x06, + 0x12, 0x14, 0xab, 0xe5, 0x13, 0x24, 0x22, 0xff, 0xe4, 0x35, 0x12, + 0xfe, 0x7c, 0x30, 0x7d, 0x08, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, + 0x14, 0xab, 0xe5, 0x13, 0x24, 0x28, 0xff, 0xe4, 0x35, 0x12, 0xfe, + 0x7c, 0x30, 0x7d, 0x10, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, + 0xab, 0xe5, 0x13, 0x24, 0x2e, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, + 0x83, 0xe4, 0xf0, 0xe5, 0x13, 0x24, 0x2f, 0xf5, 0x82, 0xe4, 0x35, + 0x12, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x34, 0x24, 0x11, 0xf5, 0x82, + 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xff, 0xc3, 0x13, 0xff, 0xe5, + 0x13, 0x24, 0x30, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, + 0xf0, 0x30, 0x09, 0x41, 0xe5, 0x13, 0x24, 0x30, 0xf5, 0x82, 0xe4, + 0x35, 0x12, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x31, 0x60, 0x04, 0x7e, + 0x00, 0x80, 0x02, 0x7e, 0x10, 0xef, 0x4e, 0xf0, 0xe5, 0x31, 0x60, + 0x06, 0x7e, 0x00, 0x7f, 0x00, 0x80, 0x0f, 0xe5, 0x14, 0x30, 0xe0, + 0x06, 0x7e, 0x00, 0x7f, 0xff, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x00, + 0xe5, 0x13, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, + 0xef, 0xf0, 0x22, 0xe5, 0x13, 0x24, 0x30, 0xf5, 0x82, 0xe4, 0x35, + 0x12, 0xf5, 0x83, 0xe0, 0x44, 0x40, 0xf0, 0xe5, 0x14, 0x30, 0xe0, + 0x0f, 0xe5, 0x34, 0x24, 0x10, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, + 0x83, 0xe0, 0xff, 0x80, 0x02, 0x7f, 0x00, 0xe5, 0x13, 0x24, 0x31, + 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, 0xf0, 0x22, 0xe5, + 0x34, 0x24, 0x11, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, + 0x30, 0xe7, 0x3b, 0xe5, 0x34, 0x24, 0x1c, 0xf5, 0x82, 0xe4, 0x35, + 0x33, 0xf5, 0x83, 0xe0, 0x65, 0x2b, 0x70, 0x03, 0x75, 0x2b, 0xff, + 0xe5, 0x34, 0x24, 0x1d, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, + 0xe0, 0xff, 0x12, 0x1c, 0x62, 0x7e, 0x22, 0x7f, 0x10, 0x12, 0x18, + 0x7c, 0x8e, 0x33, 0x8f, 0x34, 0x90, 0x22, 0x2e, 0xe0, 0xfe, 0xa3, + 0xe0, 0x8e, 0x33, 0xf5, 0x34, 0xc3, 0x22, 0xd2, 0x0a, 0xe5, 0x34, + 0x24, 0x1b, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0x70, + 0x3a, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, + 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, + 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0xef, 0x9d, 0xff, + 0xee, 0x9c, 0xfe, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0xa3, 0xef, 0xf0, + 0xd3, 0x94, 0x00, 0xee, 0x64, 0x80, 0x94, 0x80, 0x50, 0x03, 0x02, + 0x07, 0x27, 0x80, 0xc6, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xe0, + 0xfe, 0xa3, 0xe0, 0xc3, 0xee, 0x64, 0x80, 0x94, 0x80, 0x50, 0x03, + 0x02, 0x07, 0x27, 0x12, 0x1c, 0x41, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0x9f, 0xee, 0x64, 0x80, + 0xf8, 0xec, 0x64, 0x80, 0x98, 0x40, 0x20, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xa3, 0xa3, 0xe0, 0xfe, 0xa3, + 0xe0, 0xff, 0xed, 0x9f, 0xff, 0xec, 0x9e, 0xd0, 0x82, 0xd0, 0x83, + 0xf0, 0xa3, 0xef, 0xf0, 0xc2, 0x0a, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xe5, 0x34, 0x24, 0x10, 0xf5, + 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfd, 0xc3, 0xef, 0x9d, + 0xfd, 0xee, 0x94, 0x00, 0xfc, 0x12, 0x16, 0x5a, 0x50, 0x2c, 0x85, + 0x34, 0x82, 0x85, 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfe, + 0xa3, 0xe0, 0xff, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xa3, 0xa3, + 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0xef, 0x9d, 0xff, 0xee, 0x9c, + 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0xa3, 0xef, 0xf0, 0xc2, 0x0a, 0x20, + 0x0a, 0x03, 0x02, 0x06, 0x37, 0x7e, 0x22, 0x7f, 0x10, 0x12, 0x18, + 0x7c, 0x8e, 0x33, 0x8f, 0x34, 0x8f, 0x82, 0x8e, 0x83, 0xe0, 0xfe, + 0xa3, 0xe0, 0xd3, 0x94, 0x00, 0xee, 0x64, 0x80, 0x94, 0x80, 0x40, + 0x0d, 0x7e, 0x22, 0x7f, 0x10, 0xad, 0x34, 0xac, 0x33, 0x12, 0x15, + 0x0e, 0x80, 0x1a, 0x12, 0x1b, 0xab, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0xee, 0x8f, 0xf0, 0x12, 0x07, 0xeb, 0x7e, 0x22, 0x7f, 0x30, + 0xad, 0x34, 0xac, 0x33, 0x12, 0x15, 0x0e, 0x90, 0x22, 0x2e, 0xe0, + 0xfe, 0xa3, 0xe0, 0xff, 0x65, 0x34, 0x70, 0x03, 0xee, 0x65, 0x33, + 0x70, 0x02, 0xd3, 0x22, 0x8e, 0x33, 0x8f, 0x34, 0xc3, 0x22, 0xef, + 0x8d, 0xf0, 0xa4, 0xa8, 0xf0, 0xcf, 0x8c, 0xf0, 0xa4, 0x28, 0xce, + 0x8d, 0xf0, 0xa4, 0x2e, 0xfe, 0x22, 0xbc, 0x00, 0x0b, 0xbe, 0x00, + 0x29, 0xef, 0x8d, 0xf0, 0x84, 0xff, 0xad, 0xf0, 0x22, 0xe4, 0xcc, + 0xf8, 0x75, 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, 0xec, + 0x33, 0xfc, 0xee, 0x9d, 0xec, 0x98, 0x40, 0x05, 0xfc, 0xee, 0x9d, + 0xfe, 0x0f, 0xd5, 0xf0, 0xe9, 0xe4, 0xce, 0xfd, 0x22, 0xed, 0xf8, + 0xf5, 0xf0, 0xee, 0x84, 0x20, 0xd2, 0x1c, 0xfe, 0xad, 0xf0, 0x75, + 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xed, 0x33, 0xfd, 0x40, 0x07, 0x98, + 0x50, 0x06, 0xd5, 0xf0, 0xf2, 0x22, 0xc3, 0x98, 0xfd, 0x0f, 0xd5, + 0xf0, 0xea, 0x22, 0xc5, 0xf0, 0xf8, 0xa3, 0xe0, 0x28, 0xf0, 0xc5, + 0xf0, 0xf8, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xe0, + 0x38, 0xf0, 0x22, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe, + 0xa3, 0xe0, 0xff, 0x22, 0xec, 0xf0, 0xa3, 0xed, 0xf0, 0xa3, 0xee, + 0xf0, 0xa3, 0xef, 0xf0, 0x22, 0xa4, 0x25, 0x82, 0xf5, 0x82, 0xe5, + 0xf0, 0x35, 0x83, 0xf5, 0x83, 0x22, 0xd0, 0x83, 0xd0, 0x82, 0xf8, + 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, + 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, + 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, 0xa3, 0x80, 0xdf, + 0x8a, 0x83, 0x89, 0x82, 0xe4, 0x73, 0xe4, 0xff, 0x90, 0x30, 0x8c, + 0xe4, 0xf0, 0xef, 0x90, 0x1b, 0x51, 0x93, 0x44, 0x80, 0x90, 0x30, + 0x8d, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x90, 0x30, + 0x8c, 0xe0, 0xfe, 0x74, 0x36, 0x2f, 0xf8, 0xc6, 0xee, 0xc6, 0xa3, + 0xe0, 0xfe, 0xef, 0x90, 0x1b, 0x51, 0x93, 0x44, 0x80, 0x6e, 0x60, + 0x01, 0x1f, 0x0f, 0xef, 0xc3, 0x94, 0x09, 0x40, 0xc8, 0x22, 0x00, + 0x00, 0x00, 0x00, 0xe5, 0x30, 0x12, 0x08, 0x25, 0x08, 0xb1, 0x00, + 0x09, 0x1f, 0x01, 0x09, 0x87, 0x02, 0x0a, 0x1b, 0x03, 0x0a, 0x6f, + 0x04, 0x0a, 0xb6, 0x05, 0x0b, 0x29, 0x06, 0x0b, 0x98, 0x07, 0x00, + 0x00, 0x0b, 0xd0, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, + 0xe0, 0xf5, 0x12, 0xe5, 0x26, 0x20, 0xe5, 0x08, 0x90, 0x34, 0x98, + 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x30, 0xe6, 0x0f, 0xe5, 0x27, 0x30, 0xe6, 0x05, + 0x53, 0x12, 0xfd, 0x80, 0x12, 0x43, 0x12, 0x02, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, + 0xfd, 0xe5, 0x26, 0x30, 0xe7, 0x0f, 0xe5, 0x27, 0x30, 0xe7, 0x05, + 0x53, 0x12, 0xf7, 0x80, 0x12, 0x43, 0x12, 0x08, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, 0x12, + 0xf7, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, 0x90, 0x30, 0x3a, 0xe5, + 0x12, 0xf0, 0x22, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, + 0xe0, 0xf5, 0x12, 0xe5, 0x26, 0x20, 0xe5, 0x08, 0x90, 0x34, 0x98, + 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x1c, 0xe5, 0x27, 0x30, 0xe6, + 0x05, 0x53, 0x12, 0xfd, 0x80, 0x03, 0x43, 0x12, 0x02, 0xe5, 0x27, + 0x30, 0xe7, 0x05, 0x53, 0x12, 0xf7, 0x80, 0x1f, 0x43, 0x12, 0x08, + 0x80, 0x1a, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, + 0x03, 0x53, 0x12, 0xfd, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, + 0x08, 0x80, 0x03, 0x53, 0x12, 0xf7, 0x43, 0x12, 0x01, 0x43, 0x12, + 0x04, 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, 0x22, 0xc2, 0x01, 0x12, + 0x00, 0x06, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0x43, 0x12, 0x01, + 0x43, 0x12, 0x04, 0xe5, 0x26, 0x30, 0xe5, 0x5c, 0x90, 0x34, 0x98, + 0xe0, 0x44, 0x01, 0xf0, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x1c, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x53, 0x12, 0xfd, 0x80, 0x03, 0x43, 0x12, + 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, 0x12, 0xf7, 0x80, 0x30, + 0x43, 0x12, 0x08, 0x80, 0x2b, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x43, + 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, 0xfd, 0xe5, 0x27, 0x30, 0xe7, + 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, 0x12, 0xf7, 0xe5, 0x27, + 0xf4, 0x54, 0x1f, 0xff, 0x90, 0x30, 0x34, 0xe0, 0x54, 0xe0, 0x4f, + 0xf0, 0xe4, 0xf5, 0x2c, 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, 0x80, + 0x15, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfe, 0xf0, 0xe5, 0x27, 0xf4, + 0x54, 0x1f, 0xff, 0x90, 0x30, 0x34, 0xe0, 0x54, 0xe0, 0x4f, 0xf0, + 0x90, 0x30, 0x35, 0xe0, 0xf5, 0x12, 0x53, 0x12, 0xe0, 0xe5, 0x12, + 0xf0, 0x22, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, 0xe0, + 0xf5, 0x12, 0xe5, 0x26, 0x30, 0xe5, 0x3c, 0x90, 0x34, 0x98, 0xe0, + 0x44, 0x01, 0xf0, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x53, 0x12, 0xfd, + 0x80, 0x03, 0x43, 0x12, 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, + 0x12, 0xf7, 0x80, 0x03, 0x43, 0x12, 0x08, 0xe5, 0x26, 0x54, 0xc0, + 0x60, 0x08, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, 0x80, 0x06, 0x53, + 0x12, 0xfe, 0x43, 0x12, 0x04, 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, + 0x22, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0xc2, 0x01, + 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0xe5, 0x27, + 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, 0xfd, + 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, + 0x12, 0xf7, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x08, 0x53, 0x12, 0xfe, + 0x53, 0x12, 0xfb, 0x80, 0x06, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, + 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x30, 0x3a, 0xe5, + 0x12, 0xf0, 0x22, 0x20, 0x02, 0x13, 0x12, 0x1c, 0x1e, 0xaf, 0x29, + 0x7e, 0x00, 0x12, 0x1c, 0x74, 0xaf, 0x35, 0x7e, 0x00, 0x12, 0x1c, + 0x7b, 0xd2, 0x02, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0xe5, 0x26, + 0x20, 0xe5, 0x0d, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x34, 0x98, + 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x2c, 0xc2, 0x01, 0x12, 0x00, + 0x06, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x53, 0x12, 0xfd, 0x80, 0x03, + 0x43, 0x12, 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, 0x12, 0xf7, + 0x80, 0x03, 0x43, 0x12, 0x08, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, + 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, 0x22, 0x30, 0x01, 0x03, 0x02, + 0x0b, 0xd0, 0x12, 0x15, 0xc0, 0xd2, 0x01, 0x22, 0xc2, 0x01, 0x12, + 0x00, 0x06, 0xe5, 0x26, 0x20, 0xe5, 0x09, 0x90, 0x34, 0x98, 0xe0, + 0x54, 0xfe, 0xf0, 0x80, 0x55, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x30, 0xe6, 0x0f, 0xe5, 0x27, 0x30, 0xe6, 0x05, + 0x53, 0x12, 0xfd, 0x80, 0x12, 0x43, 0x12, 0x02, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, + 0xfd, 0xe5, 0x26, 0x30, 0xe7, 0x0f, 0xe5, 0x27, 0x30, 0xe7, 0x05, + 0x53, 0x12, 0xf7, 0x80, 0x12, 0x43, 0x12, 0x08, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, 0x12, + 0xf7, 0x43, 0x12, 0x01, 0x53, 0x12, 0xfb, 0x90, 0x30, 0x3a, 0xe5, + 0x12, 0xf0, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0x22, 0xe5, 0x26, + 0x30, 0xe5, 0x2c, 0x20, 0x03, 0x21, 0xd2, 0x03, 0x12, 0x1c, 0x1e, + 0x75, 0x35, 0x06, 0x75, 0x29, 0x09, 0xaf, 0x29, 0x7e, 0x00, 0x12, + 0x1c, 0x74, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0x53, 0x12, 0xfe, + 0x43, 0x12, 0x04, 0xe5, 0x12, 0xf0, 0x90, 0x34, 0x98, 0xe0, 0x44, + 0x01, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfe, 0xf0, 0x22, + 0xe5, 0x31, 0x64, 0x01, 0x70, 0x41, 0x12, 0x1a, 0xd4, 0x40, 0x03, + 0x02, 0x0d, 0x4f, 0x12, 0x1b, 0x65, 0x50, 0x20, 0x7e, 0x2b, 0x7f, + 0x80, 0x7d, 0x03, 0x12, 0x04, 0x0e, 0x7f, 0x01, 0x12, 0x19, 0x78, + 0x40, 0x09, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, 0x22, + 0x12, 0x0d, 0x50, 0x75, 0x2f, 0x01, 0x22, 0x7f, 0x01, 0x12, 0x19, + 0x78, 0x50, 0x04, 0x75, 0x2f, 0x02, 0x22, 0xd2, 0x09, 0x12, 0x0f, + 0xee, 0xe4, 0xf5, 0x2f, 0x22, 0x12, 0x1a, 0x1d, 0x50, 0x51, 0x12, + 0x1b, 0xcb, 0x90, 0x30, 0xf4, 0xe0, 0xf5, 0x2a, 0x7e, 0x30, 0x7f, + 0xec, 0xa3, 0xe0, 0xfd, 0xe4, 0xfb, 0x12, 0x19, 0x2b, 0xe4, 0xff, + 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0a, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0b, 0xe0, 0x44, 0x02, 0xff, 0xf0, 0xfd, 0x90, 0x01, 0x05, + 0x74, 0x20, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x44, 0x20, 0xf0, 0xed, + 0x54, 0xbf, 0x90, 0x00, 0x0b, 0xf0, 0x90, 0x34, 0xcc, 0xe0, 0x44, + 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, + 0xf0, 0xd2, 0x04, 0x12, 0x1a, 0x3a, 0x50, 0x43, 0x12, 0x1a, 0x57, + 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x30, 0x7d, 0xec, 0x75, 0x1b, 0x11, + 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, 0x30, 0xf5, 0xe0, 0x75, 0xf0, + 0x20, 0xa4, 0xff, 0xae, 0xf0, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, + 0xe0, 0x54, 0xfd, 0xff, 0xf0, 0xfd, 0xe4, 0x90, 0x00, 0x04, 0xf0, + 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0x90, 0x00, 0x0a, 0x74, + 0x40, 0xf0, 0x4d, 0x90, 0x00, 0x0b, 0xf0, 0xc2, 0x04, 0x12, 0x1a, + 0xfe, 0x50, 0x38, 0x12, 0x1a, 0x57, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, + 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, + 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, + 0xff, 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, + 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x54, + 0xdf, 0xf0, 0xc2, 0x04, 0x12, 0x1b, 0x28, 0x50, 0x25, 0x12, 0x1a, + 0x57, 0x7f, 0x02, 0x12, 0x19, 0x78, 0x90, 0x01, 0x04, 0xe0, 0x54, + 0x7f, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xff, 0xf0, 0xe4, + 0x90, 0x00, 0x04, 0xf0, 0xef, 0x54, 0xbf, 0x90, 0x00, 0x0b, 0xf0, + 0xc2, 0x04, 0x12, 0x1a, 0xd4, 0x50, 0x2d, 0x12, 0x1a, 0x57, 0x7e, + 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, + 0x06, 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0a, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0x90, + 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0xc2, 0x04, 0x22, 0x90, 0x34, + 0xcd, 0xe0, 0xf9, 0x20, 0xe3, 0xf8, 0xe5, 0x2b, 0xf4, 0x60, 0x66, + 0x90, 0x34, 0xc0, 0x12, 0x08, 0x01, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0x75, 0xf0, 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, 0x82, + 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, + 0x0d, 0x90, 0x34, 0xc8, 0x12, 0x08, 0x01, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0x75, 0xf0, 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, + 0x82, 0x24, 0x08, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, + 0x08, 0x0d, 0x90, 0x34, 0xd0, 0x12, 0x08, 0x01, 0x85, 0x34, 0x82, + 0x85, 0x33, 0x83, 0x75, 0xf0, 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, + 0xe5, 0x82, 0x24, 0x0c, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, + 0x12, 0x08, 0x0d, 0xe5, 0x34, 0x24, 0xf0, 0xff, 0xe5, 0x33, 0x34, + 0xde, 0xfe, 0xef, 0x78, 0x05, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, + 0xf9, 0xf5, 0x2b, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0x75, 0xf0, + 0x20, 0x12, 0x08, 0x19, 0xe5, 0x82, 0x24, 0x04, 0xf5, 0x82, 0xe4, + 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, 0x01, 0x90, 0x34, 0xc0, 0x12, + 0x08, 0x0d, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0x75, 0xf0, 0x20, + 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, 0x82, 0x24, 0x08, 0xf5, 0x82, + 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, 0x01, 0x90, 0x34, 0xc8, + 0x12, 0x08, 0x0d, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0x75, 0xf0, + 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, 0x82, 0x24, 0x0c, 0xf5, + 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, 0x01, 0x90, 0x34, + 0xc4, 0x12, 0x08, 0x0d, 0x90, 0x01, 0x01, 0xe0, 0x44, 0x40, 0xf0, + 0x90, 0x01, 0x00, 0xe0, 0x44, 0x08, 0xf0, 0xe9, 0x44, 0x04, 0x90, + 0x34, 0xcd, 0xf0, 0x90, 0x34, 0xcc, 0xe0, 0x44, 0x01, 0xf0, 0xa3, + 0xe0, 0x44, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, 0xf0, 0x22, 0x8f, + 0x15, 0x8c, 0x16, 0x8d, 0x17, 0xe5, 0x15, 0xc3, 0x94, 0x04, 0x50, + 0x56, 0xe5, 0x15, 0x94, 0x00, 0x40, 0x06, 0x7a, 0x00, 0x7b, 0x60, + 0x80, 0x04, 0x7a, 0x00, 0x7b, 0xc0, 0xe5, 0x17, 0xc4, 0xf8, 0x54, + 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x16, 0xc4, 0x54, 0xf0, 0x48, 0xfe, + 0xe5, 0x15, 0x90, 0x1a, 0x8e, 0x93, 0xfd, 0x7c, 0x00, 0x12, 0x07, + 0x96, 0xef, 0x2b, 0xfb, 0xee, 0x3a, 0xfa, 0xe5, 0x17, 0xc4, 0xf8, + 0x54, 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x16, 0xc4, 0x54, 0xf0, 0x48, + 0xfe, 0xe5, 0x15, 0x93, 0xfd, 0x7c, 0x00, 0x12, 0x07, 0x96, 0xed, + 0x4c, 0x60, 0x63, 0x0b, 0xbb, 0x00, 0x01, 0x0a, 0x80, 0x5c, 0x7a, + 0x00, 0x7b, 0x1a, 0xe5, 0x17, 0xae, 0x16, 0x78, 0x02, 0xc3, 0x33, + 0xce, 0x33, 0xce, 0xd8, 0xf9, 0x24, 0x0b, 0xff, 0xe4, 0x3e, 0xfe, + 0xe5, 0x15, 0x90, 0x1a, 0x8e, 0x93, 0xfd, 0x7c, 0x00, 0x12, 0x07, + 0x96, 0xef, 0x78, 0x02, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, + 0x2b, 0xfb, 0xee, 0x3a, 0xfa, 0xe5, 0x17, 0xae, 0x16, 0x78, 0x02, + 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0x24, 0x0b, 0xff, 0xe4, + 0x3e, 0xfe, 0xe5, 0x15, 0x90, 0x1a, 0x8e, 0x93, 0xfd, 0x7c, 0x00, + 0x12, 0x07, 0x96, 0xed, 0x4c, 0x60, 0x07, 0x74, 0x04, 0x2b, 0xfb, + 0xe4, 0x3a, 0xfa, 0xcf, 0xeb, 0xcf, 0xce, 0xea, 0xce, 0x22, 0xe5, + 0x2e, 0x14, 0x60, 0x1d, 0x14, 0x60, 0x3d, 0x14, 0x60, 0x5d, 0x14, + 0x70, 0x03, 0x02, 0x0f, 0xd7, 0x24, 0x04, 0x60, 0x03, 0x02, 0x0f, + 0xed, 0x20, 0x0d, 0x03, 0x02, 0x0f, 0xed, 0x75, 0x2e, 0x01, 0x22, + 0x90, 0x00, 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x03, 0x44, 0x20, 0xf0, + 0xe5, 0x40, 0x45, 0x3f, 0x60, 0x03, 0x02, 0x0f, 0xed, 0x75, 0x2e, + 0x02, 0x12, 0x19, 0x9b, 0x12, 0x1b, 0x78, 0xaf, 0x28, 0x12, 0x1a, + 0xa8, 0x22, 0x90, 0x01, 0x03, 0xe0, 0xff, 0x30, 0xe7, 0x76, 0xef, + 0x44, 0x80, 0x90, 0x01, 0x03, 0xf0, 0x12, 0x08, 0x51, 0x12, 0x19, + 0xde, 0x12, 0x1b, 0xbb, 0x75, 0x2e, 0x03, 0xaf, 0x22, 0x7e, 0x00, + 0x12, 0x1c, 0x2a, 0x22, 0xe5, 0x40, 0x45, 0x3f, 0x70, 0x21, 0x12, + 0x14, 0x41, 0x12, 0x1b, 0x78, 0x12, 0x19, 0xbe, 0x12, 0x1b, 0xbb, + 0x12, 0x1c, 0x04, 0x30, 0x0d, 0x0b, 0x75, 0x2e, 0x01, 0xaf, 0x32, + 0x7e, 0x00, 0x12, 0x1c, 0x2a, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x90, + 0x00, 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x2c, 0x44, 0x20, 0xf0, 0x12, + 0x14, 0x41, 0x12, 0x1b, 0x78, 0x12, 0x19, 0xbe, 0x12, 0x1b, 0xbb, + 0x12, 0x1c, 0x04, 0x75, 0x2e, 0x04, 0x22, 0xe5, 0x40, 0x45, 0x3f, + 0x70, 0x10, 0x30, 0x0d, 0x0a, 0x75, 0x2e, 0x01, 0xaf, 0x32, 0xfe, + 0x12, 0x1c, 0x2a, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x90, 0x00, 0x04, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0x30, 0x09, 0x32, 0xe5, + 0x34, 0x45, 0x33, 0x70, 0x02, 0xc3, 0x22, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, + 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, + 0xe0, 0xfd, 0xc3, 0xef, 0x9d, 0xff, 0xee, 0x9c, 0xd0, 0x82, 0xd0, + 0x83, 0xf0, 0xa3, 0xef, 0xf0, 0xe5, 0x34, 0x45, 0x33, 0x70, 0x02, + 0xc3, 0x22, 0x12, 0x05, 0xed, 0x50, 0xf3, 0x90, 0x00, 0x0a, 0xe0, + 0x20, 0xe5, 0x03, 0x30, 0x07, 0x41, 0xe5, 0x34, 0x45, 0x33, 0x70, + 0x02, 0xc3, 0x22, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xc0, 0x83, + 0xc0, 0x82, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0xef, + 0x9d, 0xff, 0xee, 0x9c, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0xa3, 0xef, + 0xf0, 0xe5, 0x34, 0x45, 0x33, 0x70, 0x02, 0xc3, 0x22, 0x12, 0x05, + 0xed, 0x50, 0xf3, 0x80, 0xb5, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, + 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x12, 0x16, 0xea, 0xd3, 0x22, 0x12, + 0x1a, 0xfe, 0x40, 0x05, 0x12, 0x1a, 0xd4, 0x50, 0x44, 0x7e, 0x30, + 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, + 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, + 0x0a, 0xf0, 0xe4, 0xff, 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, + 0xe0, 0x54, 0xbf, 0xf0, 0x54, 0x7f, 0xff, 0xf0, 0xe4, 0x90, 0x30, + 0xe9, 0xf0, 0xef, 0x54, 0xfd, 0x90, 0x00, 0x0b, 0xf0, 0xe4, 0x90, + 0x00, 0x04, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, + 0x12, 0x1b, 0x13, 0x50, 0x48, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, + 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, + 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, 0xff, + 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, + 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0xff, 0x12, 0x19, + 0x78, 0x50, 0x04, 0x75, 0x2f, 0x07, 0x22, 0x90, 0x01, 0x04, 0xe0, + 0x54, 0x7f, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, + 0x22, 0xc2, 0xaf, 0xe4, 0xf5, 0x2f, 0xf5, 0x88, 0x75, 0xa8, 0x0f, + 0x75, 0x89, 0x11, 0xf5, 0xb8, 0xf5, 0xe8, 0x75, 0x90, 0x0f, 0x75, + 0x31, 0xff, 0x75, 0x2b, 0xff, 0x90, 0x22, 0x2e, 0xf0, 0xa3, 0xf0, + 0x90, 0x22, 0x4e, 0xf0, 0xa3, 0xf0, 0xc2, 0x05, 0xc2, 0x08, 0xc2, + 0x00, 0xc2, 0x07, 0xc2, 0x04, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, + 0x90, 0x00, 0x0b, 0x74, 0x01, 0xf0, 0x90, 0x01, 0x03, 0x74, 0xff, + 0xf0, 0xe4, 0x90, 0x01, 0x04, 0xf0, 0x90, 0x01, 0x05, 0x74, 0xff, + 0xf0, 0xe4, 0x90, 0x01, 0x06, 0xf0, 0x90, 0x00, 0x04, 0xf0, 0x90, + 0x30, 0xe8, 0x74, 0x10, 0xf0, 0x90, 0x01, 0x07, 0xf0, 0x90, 0x01, + 0x08, 0x04, 0xf0, 0x90, 0x01, 0x09, 0x74, 0x48, 0xf0, 0x90, 0x01, + 0x0a, 0x74, 0x7f, 0xf0, 0x90, 0x01, 0x02, 0x74, 0x1f, 0xf0, 0x90, + 0x01, 0x00, 0x74, 0x14, 0xf0, 0x90, 0x01, 0x01, 0x74, 0x20, 0xf0, + 0x90, 0x00, 0x00, 0xe0, 0x44, 0x80, 0xf0, 0x75, 0x49, 0x00, 0x75, + 0x4a, 0x01, 0xc2, 0x01, 0xd2, 0xaf, 0x22, 0x12, 0x1a, 0xd4, 0x50, + 0x2d, 0x12, 0x18, 0x48, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, + 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, + 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, + 0x90, 0x00, 0x0a, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, + 0x2f, 0x22, 0x12, 0x1b, 0x28, 0x50, 0x50, 0x12, 0x18, 0x48, 0x90, + 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, + 0x90, 0x01, 0x03, 0x74, 0x80, 0xf0, 0x90, 0x01, 0x04, 0xe0, 0x44, + 0x80, 0xf0, 0x7f, 0x02, 0x12, 0x19, 0x78, 0x50, 0x04, 0x75, 0x2f, + 0x05, 0x22, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, + 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, + 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, + 0x90, 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, 0xe4, 0xf5, 0x2f, 0x22, + 0x90, 0x30, 0x30, 0x74, 0x02, 0xf0, 0x75, 0x11, 0x07, 0x75, 0x12, + 0xd0, 0x90, 0x30, 0x30, 0xe0, 0x30, 0xe0, 0x0e, 0xe5, 0x12, 0x15, + 0x12, 0x70, 0x02, 0x15, 0x11, 0xe5, 0x12, 0x45, 0x11, 0x70, 0xeb, + 0xe5, 0x12, 0x45, 0x11, 0x70, 0x12, 0x12, 0x1a, 0x74, 0x90, 0x21, + 0x00, 0xe0, 0x60, 0x07, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x04, 0xf0, + 0xc3, 0x22, 0xe4, 0x90, 0x34, 0x58, 0xf0, 0x90, 0x34, 0x32, 0x74, + 0x1f, 0xf0, 0x75, 0x11, 0x07, 0x75, 0x12, 0xd0, 0x90, 0x34, 0x81, + 0xe0, 0x64, 0x03, 0x60, 0x0e, 0xe5, 0x12, 0x15, 0x12, 0x70, 0x02, + 0x15, 0x11, 0xe5, 0x12, 0x45, 0x11, 0x70, 0xea, 0xe5, 0x12, 0x45, + 0x11, 0x70, 0x12, 0x12, 0x1a, 0x74, 0x90, 0x21, 0x00, 0xe0, 0x60, + 0x07, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x04, 0xf0, 0xc3, 0x22, 0x90, + 0x34, 0x98, 0xe0, 0x44, 0x04, 0xf0, 0xe4, 0x90, 0x00, 0x01, 0xf0, + 0xd3, 0x22, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x10, 0x12, 0x1c, 0x57, + 0x50, 0x26, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x53, 0x10, 0xfd, 0x80, + 0x03, 0x43, 0x10, 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, 0x10, + 0xf7, 0x80, 0x03, 0x43, 0x10, 0x08, 0x53, 0x10, 0xfe, 0x43, 0x10, + 0x04, 0x90, 0x30, 0x3a, 0xe5, 0x10, 0xf0, 0x12, 0x1c, 0x4c, 0x50, + 0x48, 0x90, 0x01, 0x03, 0xe0, 0xf5, 0x10, 0x54, 0x1c, 0x60, 0x3e, + 0xe5, 0x10, 0x54, 0xe3, 0xf0, 0xa3, 0xe0, 0xf5, 0x10, 0xf0, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x43, 0x10, 0x02, 0x80, 0x03, 0x53, 0x10, + 0xfd, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x43, 0x10, 0x08, 0x80, 0x03, + 0x53, 0x10, 0xf7, 0x53, 0x10, 0xfe, 0x43, 0x10, 0x04, 0x90, 0x30, + 0x3a, 0xe5, 0x10, 0xf0, 0xaf, 0x29, 0x7e, 0x00, 0x12, 0x1c, 0x74, + 0xaf, 0x35, 0x7e, 0x00, 0x12, 0x1c, 0x7b, 0x22, 0x12, 0x1a, 0xbf, + 0x50, 0x72, 0x12, 0x1c, 0x41, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, + 0xe0, 0xfc, 0xa3, 0xe0, 0xc3, 0x9f, 0xf5, 0x12, 0xec, 0x9e, 0xf5, + 0x11, 0xd3, 0xe5, 0x12, 0x94, 0x00, 0xe5, 0x11, 0x64, 0x80, 0x94, + 0x80, 0x40, 0x06, 0xae, 0x11, 0xaf, 0x12, 0x80, 0x04, 0x7e, 0x00, + 0x7f, 0x00, 0x8e, 0x11, 0x8f, 0x12, 0xe5, 0x34, 0x24, 0x10, 0xf5, + 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xc3, 0x95, 0x12, 0xf5, + 0x12, 0xe4, 0x95, 0x11, 0xf5, 0x11, 0xc3, 0x64, 0x80, 0x94, 0x80, + 0x50, 0x05, 0xe4, 0xf5, 0x11, 0xf5, 0x12, 0xe5, 0x34, 0x24, 0x12, + 0xff, 0xe4, 0x35, 0x33, 0xfe, 0xad, 0x12, 0x7b, 0x01, 0x12, 0x19, + 0x2b, 0x90, 0x01, 0x05, 0x74, 0x20, 0xf0, 0x90, 0x01, 0x06, 0xe0, + 0x44, 0x20, 0xf0, 0x75, 0x2f, 0x03, 0x22, 0xc0, 0xe0, 0xc0, 0xf0, + 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x08, 0xc2, 0xaf, + 0x90, 0x22, 0x2e, 0xe0, 0xfe, 0xa3, 0xe0, 0x8e, 0x33, 0xf5, 0x34, + 0xe5, 0x2f, 0x25, 0xe0, 0x24, 0x9b, 0xf5, 0x82, 0xe4, 0x34, 0x1b, + 0xf5, 0x83, 0xe4, 0x93, 0xfe, 0x74, 0x01, 0x93, 0xca, 0xee, 0xca, + 0xf9, 0x12, 0x08, 0x4b, 0x12, 0x1b, 0xf6, 0x50, 0x02, 0xd2, 0x07, + 0x12, 0x17, 0x2c, 0x12, 0x00, 0x1e, 0x12, 0x1a, 0xe9, 0x50, 0x05, + 0xaf, 0x25, 0x12, 0x1c, 0x62, 0x30, 0x05, 0x1b, 0xe5, 0x2f, 0x70, + 0x17, 0x20, 0x04, 0x14, 0x12, 0x12, 0x4e, 0x92, 0x00, 0xc2, 0x05, + 0xd2, 0x0b, 0xa2, 0x00, 0xe4, 0x33, 0xf5, 0x14, 0xaf, 0x23, 0x12, + 0x16, 0xa2, 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, + 0xf0, 0xd0, 0xe0, 0x32, 0x90, 0x29, 0xa0, 0xe0, 0x70, 0x63, 0x90, + 0x30, 0x8c, 0xe4, 0xf0, 0xa3, 0x74, 0xc2, 0xf0, 0xa3, 0x74, 0x01, + 0xf0, 0xa3, 0xe4, 0xf0, 0x90, 0x30, 0x8c, 0xe0, 0xff, 0x90, 0x29, + 0xa0, 0xf0, 0x90, 0x30, 0x8c, 0xe4, 0xf0, 0xa3, 0x74, 0xc5, 0xf0, + 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x90, 0x30, 0x8c, 0xe0, + 0xff, 0x90, 0x29, 0xa1, 0xf0, 0x90, 0x30, 0x8c, 0xe4, 0xf0, 0xa3, + 0x74, 0xc4, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x90, + 0x30, 0x8c, 0xe0, 0xff, 0x90, 0x29, 0xa2, 0xf0, 0x90, 0x30, 0x8c, + 0xe4, 0xf0, 0xa3, 0x74, 0xc3, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, + 0xe4, 0xf0, 0x90, 0x30, 0x8c, 0xe0, 0x90, 0x29, 0xa3, 0xf0, 0x22, + 0x8e, 0x16, 0x8f, 0x17, 0x8c, 0x18, 0x8d, 0x19, 0xe4, 0xff, 0xef, + 0xc3, 0x9b, 0x50, 0x53, 0xe5, 0x1b, 0x30, 0xe0, 0x12, 0xef, 0x7c, + 0x00, 0x25, 0x19, 0xfd, 0xec, 0x35, 0x18, 0x8d, 0x82, 0xf5, 0x83, + 0xe0, 0xf5, 0x1c, 0x80, 0x1f, 0xe5, 0x1b, 0x30, 0xe1, 0x13, 0xef, + 0x7c, 0x00, 0x25, 0x19, 0xfd, 0xec, 0x35, 0x18, 0x8d, 0x82, 0xf5, + 0x83, 0xe4, 0x93, 0xf5, 0x1c, 0x80, 0x07, 0xe5, 0x19, 0x2f, 0xf8, + 0xe6, 0xf5, 0x1c, 0xe5, 0x1b, 0x30, 0xe4, 0x0f, 0xe5, 0x17, 0x2f, + 0xf5, 0x82, 0xe4, 0x35, 0x16, 0xf5, 0x83, 0xe5, 0x1c, 0xf0, 0x80, + 0x06, 0xe5, 0x17, 0x2f, 0xf8, 0xa6, 0x1c, 0x0f, 0x80, 0xa8, 0x22, + 0x8c, 0x13, 0x8d, 0x14, 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3e, + 0xf5, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0x4c, 0x60, 0x41, 0xef, 0x24, + 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, + 0xf5, 0x82, 0x8c, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0x85, 0x14, + 0x82, 0x85, 0x13, 0x83, 0xe0, 0xfa, 0xa3, 0xe0, 0xfb, 0xd3, 0xed, + 0x9b, 0xea, 0x64, 0x80, 0xf8, 0xec, 0x64, 0x80, 0x98, 0x40, 0x13, + 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfc, + 0xa3, 0xe0, 0xce, 0xec, 0xce, 0xff, 0x80, 0xaf, 0xad, 0x14, 0xac, + 0x13, 0x12, 0x18, 0xaf, 0x22, 0x12, 0x1a, 0xbf, 0x50, 0x4f, 0xe5, + 0x34, 0x24, 0x12, 0xff, 0xe4, 0x35, 0x33, 0xfe, 0xe5, 0x34, 0x24, + 0x10, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfd, 0xe4, + 0xfb, 0x12, 0x19, 0x2b, 0xe5, 0x34, 0x24, 0x10, 0xf5, 0x82, 0xe4, + 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xff, 0x7e, 0x00, 0x12, 0x1c, 0x36, + 0x90, 0x00, 0x0a, 0x74, 0x40, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x44, + 0x40, 0xff, 0xf0, 0x90, 0x00, 0x0a, 0x74, 0x80, 0xf0, 0x4f, 0x90, + 0x00, 0x0b, 0xf0, 0x90, 0x30, 0xe9, 0x74, 0x01, 0xf0, 0x75, 0x2f, + 0x06, 0x22, 0x90, 0x30, 0x3a, 0xe0, 0xff, 0xe5, 0x27, 0x30, 0xe6, + 0x12, 0x30, 0x0c, 0x06, 0xef, 0x54, 0xf5, 0xfe, 0x80, 0x04, 0xef, + 0x44, 0x0a, 0xfe, 0xcf, 0xee, 0xcf, 0x80, 0x10, 0x30, 0x0c, 0x06, + 0xef, 0x44, 0x0a, 0xfe, 0x80, 0x04, 0xef, 0x54, 0xf5, 0xfe, 0xcf, + 0xee, 0xcf, 0xcf, 0x54, 0xfe, 0xcf, 0xcf, 0x44, 0x04, 0xcf, 0x90, + 0x30, 0x3a, 0xef, 0xf0, 0x30, 0x0c, 0x09, 0x7f, 0x08, 0x7e, 0x00, + 0x12, 0x1c, 0x74, 0x80, 0x07, 0x7f, 0x22, 0x7e, 0x01, 0x12, 0x1c, + 0x74, 0xb2, 0x0c, 0x22, 0xc0, 0xe0, 0xc0, 0xf0, 0xc0, 0x83, 0xc0, + 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x08, 0xc2, 0xaf, 0xc2, 0x8c, 0xc2, + 0x8d, 0xd3, 0xe5, 0x4a, 0x94, 0x00, 0xe5, 0x49, 0x94, 0x00, 0x40, + 0x08, 0xe5, 0x4a, 0x15, 0x4a, 0x70, 0x02, 0x15, 0x49, 0xd3, 0xe5, + 0x4c, 0x94, 0x00, 0xe5, 0x4b, 0x94, 0x00, 0x40, 0x08, 0xe5, 0x4c, + 0x15, 0x4c, 0x70, 0x02, 0x15, 0x4b, 0x12, 0x00, 0x0e, 0xd2, 0x8c, + 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xf0, 0xd0, + 0xe0, 0x32, 0xc3, 0xef, 0x94, 0x04, 0xee, 0x64, 0x80, 0x94, 0x80, + 0x40, 0x0c, 0xd3, 0xed, 0x94, 0x04, 0xec, 0x64, 0x80, 0x94, 0x80, + 0x50, 0x01, 0x22, 0xc3, 0xef, 0x94, 0xfc, 0xee, 0x64, 0x80, 0x94, + 0x7f, 0x40, 0x0c, 0xd3, 0xed, 0x94, 0xfc, 0xec, 0x64, 0x80, 0x94, + 0x7f, 0x50, 0x01, 0x22, 0xd3, 0xef, 0x94, 0x04, 0xee, 0x64, 0x80, + 0x94, 0x80, 0x50, 0x0d, 0xc3, 0xed, 0x94, 0xfc, 0xec, 0x64, 0x80, + 0x94, 0x7f, 0x40, 0x02, 0xd3, 0x22, 0xc3, 0x22, 0xe4, 0xfe, 0xef, + 0xf4, 0x60, 0x41, 0x74, 0x04, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x21, + 0xf5, 0x83, 0xe0, 0xb4, 0xff, 0x23, 0x74, 0x04, 0x2e, 0xf5, 0x82, + 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xef, 0xf0, 0x30, 0x0b, 0x0d, 0x74, + 0x08, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xe5, 0x14, + 0xf0, 0x90, 0x00, 0x02, 0x74, 0x01, 0xf0, 0x22, 0xbe, 0x03, 0x0a, + 0x90, 0x00, 0x02, 0x74, 0x01, 0xf0, 0xe4, 0xfe, 0x80, 0xc2, 0x0e, + 0x80, 0xbf, 0x22, 0x8e, 0x13, 0x8f, 0x14, 0x12, 0x1c, 0x41, 0xc3, + 0xef, 0x95, 0x14, 0xff, 0xee, 0x95, 0x13, 0xcd, 0xef, 0xcd, 0xfc, + 0xd3, 0xed, 0x94, 0x00, 0xec, 0x64, 0x80, 0x94, 0x80, 0x40, 0x05, + 0xce, 0xec, 0xce, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x01, 0xcc, 0xee, + 0xcc, 0xec, 0x90, 0x00, 0x05, 0xf0, 0x90, 0x00, 0x06, 0xef, 0xf0, + 0x90, 0x00, 0x04, 0x74, 0x51, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x44, + 0x02, 0xf0, 0x22, 0x30, 0x07, 0x3c, 0xe5, 0x2f, 0x70, 0x38, 0xc2, + 0x07, 0x90, 0x22, 0x2e, 0xe0, 0xfe, 0xa3, 0xe0, 0x8e, 0x11, 0xf5, + 0x12, 0x90, 0x22, 0x4e, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x90, 0x22, + 0x2e, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x90, 0x22, 0x4e, 0xe5, 0x11, + 0xf0, 0xa3, 0xe5, 0x12, 0xf0, 0x8e, 0x33, 0x8f, 0x34, 0x30, 0x08, + 0x05, 0x12, 0x17, 0xa5, 0xc2, 0x08, 0xc2, 0x09, 0x12, 0x0f, 0xee, + 0x22, 0x7f, 0x80, 0x7e, 0x29, 0xe4, 0xfd, 0xfc, 0x8f, 0x82, 0x8e, + 0x83, 0xe0, 0xfb, 0x74, 0x45, 0x2d, 0xf8, 0xc6, 0xeb, 0xc6, 0x74, + 0x04, 0x2f, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfb, 0x74, + 0x41, 0x2d, 0xf8, 0xc6, 0xeb, 0xc6, 0x74, 0x08, 0x2f, 0xff, 0xe4, + 0x3e, 0xfe, 0x0d, 0xbd, 0x00, 0x01, 0x0c, 0xed, 0x64, 0x04, 0x4c, + 0x70, 0xcf, 0x22, 0x90, 0x21, 0x00, 0xe0, 0xc4, 0x33, 0x54, 0xe0, + 0x24, 0x10, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xab, 0x82, 0xfa, 0x12, + 0x1b, 0xab, 0x8b, 0x82, 0x8a, 0x83, 0xee, 0x8f, 0xf0, 0x12, 0x07, + 0xeb, 0x7e, 0x22, 0x7f, 0x30, 0xcd, 0xeb, 0xcd, 0xcc, 0xea, 0xcc, + 0x12, 0x15, 0x0e, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0x90, 0x00, 0x00, 0x74, 0x0e, 0xf0, 0x00, 0x00, + 0x00, 0xe4, 0xf0, 0x12, 0x11, 0x31, 0x12, 0x1c, 0x88, 0x90, 0x34, + 0x98, 0xe0, 0x44, 0x01, 0xf0, 0xe5, 0x30, 0xb4, 0x05, 0x0a, 0x12, + 0x1c, 0x4c, 0x50, 0x0d, 0x12, 0x15, 0xc0, 0x80, 0x08, 0xe5, 0x30, + 0xb4, 0x07, 0x03, 0x12, 0x12, 0xd4, 0x12, 0x0f, 0x2a, 0x80, 0xe4, + 0x80, 0xfe, 0x22, 0xe4, 0xff, 0xe5, 0x30, 0x24, 0xfe, 0x70, 0x2c, + 0xe4, 0xfe, 0xee, 0xc3, 0x95, 0x2c, 0x50, 0x12, 0x74, 0x01, 0xc8, + 0xee, 0xc8, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xcf, 0x4f, + 0xcf, 0x0e, 0x80, 0xe8, 0x90, 0x30, 0x34, 0xe0, 0x54, 0xe0, 0xfe, + 0xe5, 0x27, 0x54, 0x1f, 0x6f, 0xf4, 0xce, 0x4e, 0xce, 0xee, 0xf0, + 0x22, 0x90, 0x34, 0xce, 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x34, 0xcd, + 0xe0, 0x54, 0xfe, 0xf0, 0x90, 0x34, 0xcd, 0xe0, 0x20, 0xe3, 0xf9, + 0x90, 0x01, 0x11, 0xe0, 0x54, 0x22, 0xff, 0xbf, 0x22, 0x03, 0xd3, + 0x80, 0x01, 0xc3, 0x50, 0xf0, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, + 0xf0, 0x90, 0x01, 0x01, 0xe0, 0x54, 0xbf, 0xf0, 0x22, 0xef, 0x24, + 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, + 0xfb, 0xca, 0xec, 0xca, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, + 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xef, 0x24, 0x1e, 0xf5, 0x82, + 0xe4, 0x3e, 0xf5, 0x83, 0xec, 0xf0, 0xa3, 0xed, 0xf0, 0xce, 0xea, + 0xce, 0xcf, 0xeb, 0xcf, 0x22, 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, + 0x3e, 0xf5, 0x83, 0xe0, 0xfa, 0xa3, 0xe0, 0xfb, 0xed, 0x24, 0x1e, + 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0xea, 0xf0, 0xa3, 0xeb, 0xf0, + 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xec, 0xf0, + 0xa3, 0xed, 0xf0, 0x22, 0xc0, 0xe0, 0xc0, 0xd0, 0xc2, 0xaf, 0xc2, + 0x8e, 0xc2, 0x8f, 0xd3, 0xe5, 0x40, 0x94, 0x00, 0xe5, 0x3f, 0x94, + 0x00, 0x40, 0x0d, 0xe5, 0x40, 0x15, 0x40, 0x70, 0x02, 0x15, 0x3f, + 0x12, 0x1c, 0x6b, 0xd2, 0x8e, 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, 0xe0, + 0x32, 0x12, 0x1a, 0xbf, 0x50, 0x22, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, + 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, + 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xd2, + 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, 0x22, 0x8e, 0x13, 0x8f, + 0x14, 0x8d, 0x15, 0xeb, 0x60, 0x09, 0x14, 0x70, 0x1b, 0xaf, 0x15, + 0x12, 0x19, 0xfe, 0x22, 0x7e, 0x30, 0x7f, 0xe0, 0xac, 0x13, 0xad, + 0x14, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, 0xaf, 0x15, + 0x12, 0x19, 0xfe, 0x22, 0x12, 0x17, 0x6c, 0x90, 0x21, 0x01, 0xe0, + 0xf5, 0x28, 0x74, 0x41, 0x25, 0x28, 0xf8, 0xe6, 0xf5, 0x32, 0x74, + 0x45, 0x25, 0x28, 0xf8, 0xe6, 0xf5, 0x22, 0x90, 0x21, 0x00, 0xe0, + 0x60, 0x03, 0xd2, 0x0d, 0x22, 0xc2, 0x0d, 0x22, 0xcd, 0xef, 0xcd, + 0x90, 0x01, 0x02, 0xe0, 0x30, 0xe7, 0x02, 0xc3, 0x22, 0x7e, 0x2a, + 0x7f, 0x00, 0x12, 0x04, 0x0e, 0x90, 0x01, 0x04, 0xe0, 0x44, 0x80, + 0xf0, 0x90, 0x01, 0x02, 0xe0, 0x44, 0x80, 0xf0, 0xd3, 0x22, 0x90, + 0x34, 0x30, 0xe4, 0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x1f, 0xf0, 0xa3, + 0xe4, 0xf0, 0x90, 0x01, 0x10, 0xe0, 0x20, 0xe1, 0x03, 0x00, 0x80, + 0xf6, 0x90, 0x01, 0x12, 0xe0, 0x20, 0xe1, 0x03, 0x00, 0x80, 0xf6, + 0x22, 0xe4, 0xff, 0x74, 0x36, 0x2f, 0xf8, 0xe6, 0x90, 0x30, 0x8c, + 0xf0, 0xef, 0x90, 0x1b, 0x51, 0x93, 0x90, 0x30, 0x8d, 0xf0, 0xa3, + 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x0f, 0xbf, 0x09, 0xe3, 0x22, + 0xe4, 0xff, 0xef, 0x90, 0x1b, 0x5b, 0x93, 0x90, 0x30, 0x8c, 0xf0, + 0xef, 0x90, 0x1b, 0x51, 0x93, 0x90, 0x30, 0x8d, 0xf0, 0xa3, 0x74, + 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x0f, 0xbf, 0x09, 0xe3, 0x22, 0xe4, + 0x90, 0x00, 0x05, 0xf0, 0xef, 0x60, 0x02, 0x80, 0x02, 0x7f, 0x01, + 0x90, 0x00, 0x06, 0xef, 0xf0, 0x90, 0x00, 0x04, 0x74, 0x51, 0xf0, + 0x90, 0x00, 0x0b, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0x90, 0x30, 0xf0, + 0xe0, 0xf5, 0x2a, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe4, 0x0e, 0x90, + 0x30, 0xf2, 0xe0, 0x60, 0x08, 0x90, 0x00, 0x0a, 0x74, 0x10, 0xf0, + 0xd3, 0x22, 0xc3, 0x22, 0x90, 0x30, 0xf0, 0xe0, 0xf5, 0x2a, 0x90, + 0x00, 0x0a, 0xe0, 0x30, 0xe4, 0x0e, 0x90, 0x30, 0xf2, 0xe0, 0x70, + 0x08, 0x90, 0x00, 0x0a, 0x74, 0x10, 0xf0, 0xd3, 0x22, 0xc3, 0x22, + 0x90, 0x34, 0xce, 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x34, 0xcd, 0xe0, + 0x54, 0xfe, 0xf0, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, + 0x01, 0x01, 0xe0, 0x54, 0xbf, 0xf0, 0x22, 0x90, 0x00, 0x01, 0x74, + 0x0e, 0xf0, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfb, 0xf0, 0x90, 0x34, + 0x58, 0x74, 0x01, 0xf0, 0x90, 0x30, 0x30, 0x74, 0x04, 0xf0, 0x22, + 0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x6c, 0x90, 0xc8, 0x00, 0x01, 0x02, 0x03, 0x0b, 0x0f, 0x0a, 0x0e, + 0x09, 0x0d, 0x08, 0x0c, 0xef, 0xc4, 0x33, 0x33, 0x54, 0xc0, 0xff, + 0x90, 0x01, 0x00, 0xe0, 0x54, 0x3f, 0x4f, 0xf0, 0x90, 0x01, 0x02, + 0xe0, 0x44, 0x80, 0xf0, 0x22, 0x90, 0x01, 0x03, 0xe0, 0x30, 0xe7, + 0x0c, 0x74, 0x80, 0xf0, 0x90, 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, + 0xd3, 0x22, 0xc3, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe1, 0x0c, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xf0, 0xd3, + 0x22, 0xc3, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe2, 0x0c, 0x74, + 0x04, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfb, 0xf0, 0xd3, 0x22, + 0xc3, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe6, 0x0c, 0x74, 0x40, + 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0xd3, 0x22, 0xc3, + 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe7, 0x0c, 0x74, 0x80, 0xf0, + 0x90, 0x00, 0x0b, 0xe0, 0x54, 0x7f, 0xf0, 0xd3, 0x22, 0xc3, 0x22, + 0x90, 0x01, 0x05, 0xe0, 0x30, 0xe5, 0x0c, 0x74, 0x20, 0xf0, 0x90, + 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0xd3, 0x22, 0xc3, 0x22, 0xe4, + 0xf5, 0x31, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, 0x90, 0x22, 0x2e, + 0x74, 0x21, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0x22, 0x52, 0x53, 0x54, + 0x12, 0x15, 0x16, 0x10, 0x11, 0x40, 0x00, 0x20, 0x00, 0x40, 0xff, + 0x3f, 0x3f, 0xbd, 0x28, 0x21, 0x00, 0xe5, 0x34, 0x24, 0x11, 0xf5, + 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0x30, 0xe6, 0x02, 0xd3, + 0x22, 0xc3, 0x22, 0x90, 0x30, 0x40, 0x74, 0x32, 0xf0, 0xa3, 0x74, + 0xb0, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x22, 0x75, + 0x31, 0x01, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, 0x90, 0x00, 0x0b, + 0xe0, 0x44, 0x20, 0xf0, 0x22, 0x0b, 0xd1, 0x13, 0x53, 0x15, 0x6b, + 0x11, 0xc6, 0x00, 0x09, 0x19, 0x03, 0x10, 0x95, 0x1b, 0xda, 0x90, + 0x30, 0x64, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe, 0xed, 0x25, 0xe0, 0xff, + 0xee, 0x33, 0xfe, 0x22, 0x90, 0x30, 0x40, 0x74, 0x32, 0xf0, 0xa3, + 0x74, 0xb0, 0xf0, 0xa3, 0xe4, 0xf0, 0xa3, 0xf0, 0x22, 0x90, 0x01, + 0x00, 0xe0, 0x44, 0x08, 0xf0, 0x90, 0x01, 0x01, 0xe0, 0x44, 0x40, + 0xf0, 0x22, 0x12, 0x1a, 0xbf, 0x50, 0x08, 0xd2, 0x09, 0x12, 0x0f, + 0xee, 0xe4, 0xf5, 0x2f, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe0, + 0x05, 0x74, 0x01, 0xf0, 0xd3, 0x22, 0xc3, 0x22, 0x90, 0x00, 0x0a, + 0xe0, 0x30, 0xe5, 0x05, 0x74, 0x20, 0xf0, 0xd3, 0x22, 0xc3, 0x22, + 0x90, 0x34, 0x30, 0x74, 0x1f, 0xf0, 0xa3, 0xe4, 0xf0, 0xa3, 0xf0, + 0xa3, 0xf0, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, + 0x4c, 0x02, 0x17, 0xdc, 0xc2, 0xaf, 0xc2, 0x8c, 0xc2, 0x8d, 0x12, + 0x00, 0x0e, 0xd2, 0xaf, 0x22, 0xc2, 0x8e, 0x8e, 0x3f, 0x8f, 0x40, + 0x12, 0x1c, 0x6b, 0xd2, 0x8e, 0x22, 0x90, 0x30, 0x3c, 0xef, 0xf0, + 0xee, 0x44, 0x80, 0xa3, 0xf0, 0x22, 0x90, 0x30, 0x78, 0xe0, 0xfd, + 0xa3, 0xe0, 0xfe, 0xed, 0xff, 0x22, 0xe5, 0x4a, 0x45, 0x49, 0x70, + 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x22, 0xe5, 0x4c, 0x45, 0x4b, 0x70, + 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x22, 0xc2, 0x0b, 0xe4, 0xf5, 0x14, + 0x12, 0x16, 0xa2, 0x22, 0xc2, 0x8f, 0x75, 0x8d, 0xf5, 0x75, 0x8b, + 0x41, 0x22, 0x8e, 0x49, 0x8f, 0x4a, 0xd2, 0x8c, 0x22, 0x8e, 0x4b, + 0x8f, 0x4c, 0xd2, 0x8c, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc2, 0x0d, 0xe4, 0xf5, 0x2e, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xac, 0x30 +}; + +static const uint8_t rt2561s[] = { + 0x02, 0x1c, 0x2d, 0x02, 0x07, 0xdf, 0xc2, 0x8c, 0x22, 0x22, 0x00, + 0x02, 0x19, 0x43, 0xc2, 0xaf, 0xc2, 0x8d, 0x75, 0x8c, 0x94, 0x75, + 0x8a, 0x93, 0xd2, 0xaf, 0x22, 0x02, 0x1a, 0x9c, 0x12, 0x08, 0xdf, + 0x40, 0x03, 0x02, 0x02, 0x1e, 0x90, 0x21, 0x02, 0xe0, 0xf5, 0x2d, + 0x90, 0x00, 0x03, 0xe0, 0x12, 0x04, 0x3f, 0x00, 0xb0, 0x00, 0x00, + 0xce, 0x01, 0x00, 0x5e, 0x10, 0x00, 0x6f, 0x11, 0x00, 0xf2, 0x20, + 0x01, 0x4d, 0x21, 0x01, 0x70, 0x22, 0x01, 0x84, 0x30, 0x01, 0x8f, + 0x31, 0x01, 0xd5, 0x50, 0x01, 0x9f, 0x51, 0x01, 0xf2, 0x52, 0x02, + 0x06, 0x60, 0x00, 0x00, 0x02, 0x14, 0x90, 0x00, 0x0a, 0xe0, 0x20, + 0xe5, 0x03, 0x30, 0x07, 0x03, 0xd2, 0x08, 0x22, 0x12, 0x14, 0x2b, + 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x11, 0xe5, 0x11, 0xc4, 0x33, + 0x54, 0xe0, 0x24, 0x21, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, + 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x11, 0xc4, 0x33, 0x54, 0xe0, 0x24, + 0x2c, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xe5, 0x11, 0xf0, + 0xc4, 0x33, 0x54, 0xe0, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x34, 0x21, + 0xf5, 0x83, 0xe5, 0x2d, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, + 0x12, 0x05, 0xcb, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x31, 0x60, 0x05, + 0x12, 0x1b, 0xe0, 0x80, 0x03, 0x12, 0x1b, 0xa6, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, 0x22, 0x75, 0x31, 0xff, + 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, 0x01, 0x01, 0xe0, + 0x54, 0xfe, 0xf0, 0x54, 0x3e, 0xf0, 0xe4, 0x90, 0x00, 0x0b, 0xf0, + 0xf0, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, 0x22, + 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, 0x12, 0x0a, 0xfb, 0x90, 0x34, + 0xcd, 0xe0, 0x20, 0xe3, 0xf9, 0x90, 0x21, 0x14, 0x12, 0x04, 0x1b, + 0x90, 0x34, 0xc0, 0x12, 0x04, 0x27, 0x90, 0x21, 0x18, 0x12, 0x04, + 0x1b, 0x90, 0x34, 0xc8, 0x12, 0x04, 0x27, 0x90, 0x21, 0x1c, 0x12, + 0x04, 0x1b, 0x90, 0x34, 0xc4, 0x12, 0x04, 0x27, 0x90, 0x34, 0xcc, + 0x74, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x04, 0xf0, 0x90, 0x01, 0x01, + 0xe0, 0x44, 0x01, 0xf0, 0x44, 0x40, 0xf0, 0x90, 0x00, 0x0b, 0xe0, + 0x44, 0x10, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x10, 0xe8, 0x22, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, + 0x01, 0x01, 0xe0, 0x54, 0xfe, 0xf0, 0x54, 0xbf, 0xf0, 0x90, 0x00, + 0x0b, 0xe0, 0x54, 0xef, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, + 0x2d, 0x12, 0x10, 0xe8, 0x22, 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, + 0x12, 0x0a, 0xfb, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x10, 0xe8, 0x22, 0xd2, 0x05, 0x85, 0x2d, 0x23, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0x22, 0x12, 0x13, 0xae, 0xc2, 0x00, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, 0x22, 0x85, 0x2d, 0x25, + 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfb, 0xff, 0xf0, 0xe4, 0x90, 0x00, + 0x07, 0xf0, 0x90, 0x00, 0x0a, 0x74, 0x04, 0xf0, 0xe4, 0x90, 0x00, + 0x08, 0xf0, 0x90, 0x21, 0x00, 0xe0, 0x90, 0x00, 0x09, 0xf0, 0x90, + 0x00, 0x07, 0x74, 0x71, 0xf0, 0xef, 0x44, 0x04, 0x90, 0x00, 0x0b, + 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, 0x90, 0x21, 0x00, 0xe0, + 0xff, 0x54, 0x1f, 0xf5, 0x30, 0xa3, 0xe0, 0xf5, 0x27, 0x8f, 0x26, + 0x12, 0x14, 0x62, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x10, 0xe8, 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x2c, 0x12, 0x17, + 0xa3, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, + 0x22, 0x12, 0x1a, 0xed, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x10, 0xe8, 0x22, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x10, 0xe8, 0x22, 0xe5, 0x31, 0x64, 0x01, 0x70, 0x41, 0x12, + 0x08, 0xed, 0x40, 0x03, 0x02, 0x03, 0x9d, 0x12, 0x0e, 0x34, 0x50, + 0x20, 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, 0x12, 0x0a, 0xfb, 0x7f, + 0x01, 0x12, 0x0a, 0xd8, 0x40, 0x09, 0xd2, 0x09, 0x12, 0x0e, 0x47, + 0xe4, 0xf5, 0x2f, 0x22, 0x12, 0x09, 0x64, 0x75, 0x2f, 0x01, 0x22, + 0x7f, 0x01, 0x12, 0x0a, 0xd8, 0x50, 0x04, 0x75, 0x2f, 0x02, 0x22, + 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x22, 0x12, 0x08, + 0x90, 0x50, 0x51, 0x12, 0x0a, 0xac, 0x90, 0x30, 0xf4, 0xe0, 0xf5, + 0x2a, 0x7e, 0x30, 0x7f, 0xec, 0xa3, 0xe0, 0xfd, 0xe4, 0xfb, 0x12, + 0x0d, 0xa0, 0xe4, 0xff, 0xfe, 0x12, 0x0e, 0x29, 0x90, 0x00, 0x0a, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x44, 0x02, 0xff, 0xf0, + 0xfd, 0x90, 0x01, 0x05, 0x74, 0x20, 0xf0, 0x90, 0x01, 0x06, 0xe0, + 0x44, 0x20, 0xf0, 0xed, 0x54, 0xbf, 0x90, 0x00, 0x0b, 0xf0, 0x90, + 0x34, 0xcc, 0xe0, 0x44, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, 0xf0, + 0xa3, 0xe0, 0x44, 0x01, 0xf0, 0xd2, 0x04, 0x12, 0x08, 0xad, 0x50, + 0x43, 0x12, 0x0a, 0xbb, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x30, 0x7d, + 0xec, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x13, 0xc8, 0x90, 0x30, + 0xf5, 0xe0, 0x75, 0xf0, 0x20, 0xa4, 0xff, 0xae, 0xf0, 0x12, 0x0e, + 0x29, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xff, 0xf0, 0xfd, 0xe4, + 0x90, 0x00, 0x04, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, + 0x90, 0x00, 0x0a, 0x74, 0x40, 0xf0, 0x4d, 0x90, 0x00, 0x0b, 0xf0, + 0xc2, 0x04, 0x12, 0x09, 0x25, 0x50, 0x38, 0x12, 0x0a, 0xbb, 0x7e, + 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, + 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0a, 0xf0, 0xe4, 0xff, 0xfe, 0x12, 0x0e, 0x29, 0x90, 0x00, + 0x0b, 0xe0, 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0x90, + 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0xc2, 0x04, 0x12, 0x09, 0x4f, + 0x50, 0x25, 0x12, 0x0a, 0xbb, 0x7f, 0x02, 0x12, 0x0a, 0xd8, 0x90, + 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, + 0xfd, 0xff, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0xef, 0x54, 0xbf, + 0x90, 0x00, 0x0b, 0xf0, 0xc2, 0x04, 0x12, 0x08, 0xed, 0x50, 0x2d, + 0x12, 0x0a, 0xbb, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, + 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0x90, 0x01, 0x06, 0xe0, + 0x54, 0xdf, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0xc2, + 0x04, 0x22, 0xef, 0x8d, 0xf0, 0xa4, 0xa8, 0xf0, 0xcf, 0x8c, 0xf0, + 0xa4, 0x28, 0xce, 0x8d, 0xf0, 0xa4, 0x2e, 0xfe, 0x22, 0xbc, 0x00, + 0x0b, 0xbe, 0x00, 0x29, 0xef, 0x8d, 0xf0, 0x84, 0xff, 0xad, 0xf0, + 0x22, 0xe4, 0xcc, 0xf8, 0x75, 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xee, + 0x33, 0xfe, 0xec, 0x33, 0xfc, 0xee, 0x9d, 0xec, 0x98, 0x40, 0x05, + 0xfc, 0xee, 0x9d, 0xfe, 0x0f, 0xd5, 0xf0, 0xe9, 0xe4, 0xce, 0xfd, + 0x22, 0xed, 0xf8, 0xf5, 0xf0, 0xee, 0x84, 0x20, 0xd2, 0x1c, 0xfe, + 0xad, 0xf0, 0x75, 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xed, 0x33, 0xfd, + 0x40, 0x07, 0x98, 0x50, 0x06, 0xd5, 0xf0, 0xf2, 0x22, 0xc3, 0x98, + 0xfd, 0x0f, 0xd5, 0xf0, 0xea, 0x22, 0xc5, 0xf0, 0xf8, 0xa3, 0xe0, + 0x28, 0xf0, 0xc5, 0xf0, 0xf8, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02, + 0x15, 0x83, 0xe0, 0x38, 0xf0, 0x22, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, + 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x22, 0xec, 0xf0, 0xa3, 0xed, + 0xf0, 0xa3, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x22, 0xa4, 0x25, 0x82, + 0xf5, 0x82, 0xe5, 0xf0, 0x35, 0x83, 0xf5, 0x83, 0x22, 0xd0, 0x83, + 0xd0, 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, + 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, + 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, + 0xa3, 0x80, 0xdf, 0x8a, 0x83, 0x89, 0x82, 0xe4, 0x73, 0xe5, 0x2e, + 0x14, 0x60, 0x1d, 0x14, 0x60, 0x3d, 0x14, 0x60, 0x5d, 0x14, 0x70, + 0x03, 0x02, 0x05, 0x18, 0x24, 0x04, 0x60, 0x03, 0x02, 0x05, 0x2e, + 0x20, 0x0d, 0x03, 0x02, 0x05, 0x2e, 0x75, 0x2e, 0x01, 0x22, 0x90, + 0x00, 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x03, 0x44, 0x20, 0xf0, 0xe5, + 0x40, 0x45, 0x3f, 0x60, 0x03, 0x02, 0x05, 0x2e, 0x75, 0x2e, 0x02, + 0x12, 0x1b, 0x12, 0x12, 0x1b, 0xce, 0xaf, 0x28, 0x12, 0x1b, 0x8f, + 0x22, 0x90, 0x01, 0x03, 0xe0, 0xff, 0x30, 0xe7, 0x76, 0xef, 0x44, + 0x80, 0x90, 0x01, 0x03, 0xf0, 0x12, 0x08, 0x55, 0x12, 0x1b, 0x55, + 0x12, 0x1c, 0x01, 0x75, 0x2e, 0x03, 0xaf, 0x22, 0x7e, 0x00, 0x12, + 0x1c, 0x45, 0x22, 0xe5, 0x40, 0x45, 0x3f, 0x70, 0x21, 0x12, 0x17, + 0xd8, 0x12, 0x1b, 0xce, 0x12, 0x1b, 0x35, 0x12, 0x1c, 0x01, 0x12, + 0x1c, 0x1f, 0x30, 0x0d, 0x0b, 0x75, 0x2e, 0x01, 0xaf, 0x32, 0x7e, + 0x00, 0x12, 0x1c, 0x45, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x90, 0x00, + 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x2c, 0x44, 0x20, 0xf0, 0x12, 0x17, + 0xd8, 0x12, 0x1b, 0xce, 0x12, 0x1b, 0x35, 0x12, 0x1c, 0x01, 0x12, + 0x1c, 0x1f, 0x75, 0x2e, 0x04, 0x22, 0xe5, 0x40, 0x45, 0x3f, 0x70, + 0x10, 0x30, 0x0d, 0x0a, 0x75, 0x2e, 0x01, 0xaf, 0x32, 0xfe, 0x12, + 0x1c, 0x45, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x12, 0x09, 0x25, 0x40, + 0x05, 0x12, 0x08, 0xed, 0x50, 0x44, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, + 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x13, 0xc8, + 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, + 0xff, 0xfe, 0x12, 0x0e, 0x29, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, + 0xf0, 0x54, 0x7f, 0xff, 0xf0, 0xe4, 0x90, 0x30, 0xe9, 0xf0, 0xef, + 0x54, 0xfd, 0x90, 0x00, 0x0b, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, + 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x12, 0x09, 0x3a, + 0x50, 0x48, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, + 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, + 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, 0xff, 0xfe, 0x12, 0x0e, + 0x29, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0x54, 0xfd, 0xf0, + 0xe4, 0x90, 0x00, 0x04, 0xf0, 0xff, 0x12, 0x0a, 0xd8, 0x50, 0x04, + 0x75, 0x2f, 0x07, 0x22, 0x90, 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, + 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x22, 0xc2, 0xaf, + 0xe4, 0xf5, 0x2f, 0xf5, 0x88, 0x75, 0xa8, 0x0f, 0x75, 0x89, 0x11, + 0xf5, 0xb8, 0xf5, 0xe8, 0x75, 0x90, 0x0f, 0x75, 0x31, 0xff, 0x75, + 0x2b, 0xff, 0x90, 0x22, 0x2e, 0xf0, 0xa3, 0xf0, 0x90, 0x22, 0x4e, + 0xf0, 0xa3, 0xf0, 0xc2, 0x05, 0xc2, 0x08, 0xc2, 0x00, 0xc2, 0x07, + 0xc2, 0x04, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, 0x90, 0x00, 0x0b, + 0x74, 0x01, 0xf0, 0x90, 0x01, 0x03, 0x74, 0xff, 0xf0, 0xe4, 0x90, + 0x01, 0x04, 0xf0, 0x90, 0x01, 0x05, 0x74, 0xff, 0xf0, 0xe4, 0x90, + 0x01, 0x06, 0xf0, 0x90, 0x00, 0x04, 0xf0, 0x90, 0x30, 0xe8, 0x74, + 0x10, 0xf0, 0x90, 0x01, 0x07, 0xf0, 0x90, 0x01, 0x08, 0x04, 0xf0, + 0x90, 0x01, 0x09, 0x74, 0x48, 0xf0, 0x90, 0x01, 0x0a, 0x74, 0x7f, + 0xf0, 0x90, 0x01, 0x02, 0x74, 0x1f, 0xf0, 0x90, 0x01, 0x00, 0x74, + 0x14, 0xf0, 0x90, 0x01, 0x01, 0x74, 0x20, 0xf0, 0x90, 0x00, 0x00, + 0xe0, 0x44, 0x80, 0xf0, 0x75, 0x49, 0x00, 0x75, 0x4a, 0x01, 0xc2, + 0x01, 0xd2, 0xaf, 0x22, 0x12, 0x08, 0xed, 0x50, 0x2d, 0x12, 0x0a, + 0x78, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0x7e, 0x30, 0x7f, + 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, + 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, + 0xf0, 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x22, 0x12, + 0x09, 0x4f, 0x50, 0x50, 0x12, 0x0a, 0x78, 0x90, 0x00, 0x0b, 0xe0, + 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0x90, 0x01, 0x03, + 0x74, 0x80, 0xf0, 0x90, 0x01, 0x04, 0xe0, 0x44, 0x80, 0xf0, 0x7f, + 0x02, 0x12, 0x0a, 0xd8, 0x50, 0x04, 0x75, 0x2f, 0x05, 0x22, 0x7e, + 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, + 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0a, 0xf0, 0xd2, 0x09, 0x12, 0x0e, 0x47, 0x90, 0x01, 0x04, + 0xe0, 0x54, 0x7f, 0xf0, 0xe4, 0xf5, 0x2f, 0x22, 0x90, 0x30, 0x3a, + 0xe0, 0xf5, 0x10, 0x12, 0x1c, 0x5c, 0x50, 0x26, 0xe5, 0x27, 0x30, + 0xe6, 0x05, 0x53, 0x10, 0xfd, 0x80, 0x03, 0x43, 0x10, 0x02, 0xe5, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 25 16:09:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D3C71065672; Fri, 25 May 2012 16:09:07 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0742A8FC18; Fri, 25 May 2012 16:09: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 q4PG96He019943; Fri, 25 May 2012 16:09:06 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PG96Sk019941; Fri, 25 May 2012 16:09:06 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205251609.q4PG96Sk019941@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 25 May 2012 16:09: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: r236005 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:09:07 -0000 Author: bschmidt Date: Fri May 25 16:09:06 2012 New Revision: 236005 URL: http://svn.freebsd.org/changeset/base/236005 Log: MFC r235235-235237: Update man page due to import of RT2800/RT3000 support. Modified: stable/9/share/man/man4/ral.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ral.4 ============================================================================== --- stable/9/share/man/man4/ral.4 Fri May 25 16:07:39 2012 (r236004) +++ stable/9/share/man/man4/ral.4 Fri May 25 16:09:06 2012 (r236005) @@ -1,5 +1,4 @@ -.\" Copyright (c) 2005, 2006 -.\" Damien Bergamini +.\" Copyright (c) 2005-2010 Damien Bergamini .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -15,12 +14,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2009 +.Dd May 10, 2012 .Dt RAL 4 .Os .Sh NAME .Nm ral -.Nd "Ralink Technology IEEE 802.11 wireless network driver" +.Nd "Ralink Technology IEEE 802.11a/g/n wireless network device" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -42,31 +41,43 @@ if_ral_load="YES" .Sh DESCRIPTION The .Nm -driver supports PCI/CardBus wireless adapters based on the Ralink Technology -RT2500, RT2501, and RT2600 chipsets. +driver supports PCI/PCIe/CardBus wireless adapters based on the Ralink RT2500, +RT2501, RT2600, RT2700, RT2800 and RT3090 chipsets. .Pp The RT2500 chipset is the first generation of 802.11b/g adapters from Ralink. -It consists of two integrated chips, a RT2560 MAC/BBP and a RT2525 radio +It consists of two integrated chips, an RT2560 MAC/BBP and an RT2525 radio transceiver. .Pp -The RT2501 chipset is the second generation of 802.11b/g adapters from Ralink. -It consists of two integrated chips, a RT2561 MAC/BBP and a RT2527 radio +The RT2501 chipset is the second generation of 802.11a/b/g adapters from +Ralink. +It consists of two integrated chips, an RT2561 MAC/BBP and an RT2527 radio transceiver. This chipset provides support for the IEEE 802.11e standard with multiple hardware transmission queues and allows scatter/gather for efficient DMA operations. .Pp -The RT2600 chipset consists of two integrated chips, a RT2661 MAC/BBP and a +The RT2600 chipset consists of two integrated chips, an RT2661 MAC/BBP and an RT2529 radio transceiver. This chipset uses the MIMO (multiple-input multiple-output) technology with -multiple antennas to extend the operating range of the adapter and to achieve -higher throughput. -MIMO is the basis of the forthcoming IEEE 802.11n standard. -.Pp -The transmit speed is user-selectable or can be adapted automatically by the -driver depending on the received signal strength and on the number of hardware -transmission retries. +multiple radio transceivers to extend the operating range of the adapter and +to achieve higher throughput. +However, the RT2600 chipset does not support any of the 802.11n features. +.Pp +The RT2700 chipset is a low-cost version of the RT2800 chipset. +It supports a single transmit path and two receiver paths (1T2R). +It consists of two integrated chips, an RT2760 or RT2790 (PCIe) MAC/BBP and +an RT2720 (2.4GHz) or RT2750 (2.4GHz/5GHz) radio transceiver. +.Pp +The RT2800 chipset is the first generation of 802.11n adapters from Ralink. +It consists of two integrated chips, an RT2860 or RT2890 (PCIe) MAC/BBP and +an RT2820 (2.4GHz) or RT2850 (2.4GHz/5GHz) radio transceiver. +The RT2800 chipset supports two transmit paths and up to three receiver +paths (2T2R/2T3R). +It can achieve speeds up to 144Mbps (20MHz bandwidth) and 300Mbps (40MHz +bandwidth.) .Pp +The RT3090 chipset is the first generation of single-chip 802.11n adapters +from Ralink. .Nm supports .Cm station , @@ -92,13 +103,16 @@ Multiple interfaces may be operated together with a .Cm hostap interface to construct a wireless repeater device. +.Pp +The transmit speed is user-selectable or can be adapted automatically by the +driver depending on the number of hardware transmission retries. For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm -driver supports PCI/CardBus wireless adapters based on the Ralink Technology -RT2500, RT2501, and RT2600 chipsets, including: +driver supports PCI/PCIe/CardBus wireless adapters based on Ralink Technology +chipsets, including: .Pp .Bl -column -compact ".Li Atlantis Land A02-PCM-W54" "RT2561S" "CardBus" .It Em Card Ta Em MAC/BBP Ta Em Bus @@ -188,9 +202,6 @@ RT2500, RT2501, and RT2600 chipsets, inc .It "Zonet ZEW1500" Ta RT2560 Ta CardBus .It "Zonet ZEW1600" Ta RT2560 Ta PCI .El -.Pp -An up to date list can be found at -.Pa http://damien.bergamini.free.fr/ral/list.html . .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): .Pp @@ -238,7 +249,7 @@ This should not happen. .Xr wlan_xauth 4 , .Xr hostapd 8 , .Xr ifconfig 8 , -.Xr wpa_supplicant 8 . +.Xr wpa_supplicant 8 .Rs .%T "Ralink Technology" .%U http://www.ralinktech.com/ @@ -248,12 +259,37 @@ The .Nm driver first appeared in .Ox 3.7 . +Support for the RT2501 and RT2600 chipsets was added in +.Ox 3.9 . +Support for the RT2800 chipset was added in +.Ox 4.3 . +Support for the RT2700 chipset was added in +.Ox 4.4 . +Support for the RT3090 chipset was added in +.Ox 4.9 . .Sh AUTHORS The original .Nm driver was written by -.An Damien Bergamini Aq damien@FreeBSD.org . -.Sh BUGS -Host AP mode doesn't support client power save. -Clients using power save mode will experience +.An Damien Bergamini Aq damien@openbsd.org . +.Sh CAVEATS +The +.Nm +driver does not make use of the hardware cryptographic engine. +.Pp +The +.Nm +driver does not support any of the 802.11n capabilities offered by +the RT2700 and RT2800 chipsets. +Additional work is required in before those features can be supported. +.Pp +Host AP mode doesn't support power saving. +Clients attempting to use power saving mode may experience significant packet loss (disabling power saving on the client will fix this). +.Pp +Some PCI +.Nm +adapters seem to strictly require a system supporting PCI 2.2 or greater and +will likely not work in systems based on older revisions of the PCI +specification. +Check the board's PCI version before purchasing the card. From owner-svn-src-all@FreeBSD.ORG Fri May 25 16:28:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3E311065675; Fri, 25 May 2012 16:28:31 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id A19BE8FC0C; Fri, 25 May 2012 16:28:31 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M4L001024BC4300@smtpauth2.wiscmail.wisc.edu>; Fri, 25 May 2012 10:28:25 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-user-nat.icecube.wisc.edu [128.104.255.12]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M4L00BR24BBGN20@smtpauth2.wiscmail.wisc.edu>; Fri, 25 May 2012 10:28:24 -0500 (CDT) Date: Fri, 25 May 2012 10:28:23 -0500 From: Nathan Whitehorn In-reply-to: <201205251513.q4PFDtrU017459@svn.freebsd.org> To: Rafal Jaworowski Message-id: <4FBFA517.8080601@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.255.12 X-Spam-PmxInfo: Server=avs-15, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.25.151816, SenderIP=128.104.255.12 References: <201205251513.q4PFDtrU017459@svn.freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236000 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:28:31 -0000 On 05/25/12 10:13, Rafal Jaworowski wrote: > Author: raj > Date: Fri May 25 15:13:55 2012 > New Revision: 236000 > URL: http://svn.freebsd.org/changeset/base/236000 > > Log: > Missing vm_paddr_t bits which should have been part of r235936. I think you also need equivalent changes to aim/mmu_oea64.c. -Nathan > Modified: > head/sys/powerpc/powerpc/mmu_if.m > > Modified: head/sys/powerpc/powerpc/mmu_if.m > ============================================================================== > --- head/sys/powerpc/powerpc/mmu_if.m Fri May 25 15:05:17 2012 (r235999) > +++ head/sys/powerpc/powerpc/mmu_if.m Fri May 25 15:13:55 2012 (r236000) > @@ -761,7 +761,7 @@ METHOD void cpu_bootstrap { > */ > METHOD void * mapdev { > mmu_t _mmu; > - vm_offset_t _pa; > + vm_paddr_t _pa; > vm_size_t _size; > }; > > @@ -818,7 +818,7 @@ METHOD void unmapdev { > * > * @retval pa physical address corresponding to mapping > */ > -METHOD vm_offset_t kextract { > +METHOD vm_paddr_t kextract { > mmu_t _mmu; > vm_offset_t _va; > }; > @@ -833,7 +833,7 @@ METHOD vm_offset_t kextract { > METHOD void kenter { > mmu_t _mmu; > vm_offset_t _va; > - vm_offset_t _pa; > + vm_paddr_t _pa; > }; > > /** > @@ -860,7 +860,7 @@ METHOD void kenter_attr { > */ > METHOD boolean_t dev_direct_mapped { > mmu_t _mmu; > - vm_offset_t _pa; > + vm_paddr_t _pa; > vm_size_t _size; > }; > From owner-svn-src-all@FreeBSD.ORG Fri May 25 16:30:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 703F11065679; Fri, 25 May 2012 16:30:43 +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 5A0098FC0A; Fri, 25 May 2012 16:30: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 q4PGUhHg020879; Fri, 25 May 2012 16:30:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PGUhOH020877; Fri, 25 May 2012 16:30:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205251630.q4PGUhOH020877@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 25 May 2012 16:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236006 - head/lib/libc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:30:43 -0000 Author: marcel Date: Fri May 25 16:30:42 2012 New Revision: 236006 URL: http://svn.freebsd.org/changeset/base/236006 Log: Doh... Don't add __eabi to an old version tag (i.e. FBSD_1.0). Add it to the current one (= FBSD_1.3). Pointed out by: kib Modified: head/lib/libc/powerpc/Symbol.map Modified: head/lib/libc/powerpc/Symbol.map ============================================================================== --- head/lib/libc/powerpc/Symbol.map Fri May 25 16:09:06 2012 (r236005) +++ head/lib/libc/powerpc/Symbol.map Fri May 25 16:30:42 2012 (r236006) @@ -11,7 +11,6 @@ FBSD_1.0 { /* PSEUDO syscalls */ _exit; - __eabi; _mcount; _setjmp; _longjmp; @@ -39,6 +38,10 @@ FBSD_1.0 { vfork; }; +FBSD_1.3 { + __eabi; +}; + FBSDprivate_1.0 { /* PSEUDO syscalls */ __sys_getlogin; From owner-svn-src-all@FreeBSD.ORG Fri May 25 16:39:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AF6C1065674; Fri, 25 May 2012 16:39:57 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1101C8FC0C; Fri, 25 May 2012 16: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 q4PGdv1d021282; Fri, 25 May 2012 16:39:57 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PGduTt021277; Fri, 25 May 2012 16:39:56 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205251639.q4PGduTt021277@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 25 May 2012 16:39:56 +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: r236007 - in stable/8/sys: conf contrib/dev/ral dev/ral modules/ral modules/ralfw modules/ralfw/rt2860 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:39:57 -0000 Author: bschmidt Date: Fri May 25 16:39:56 2012 New Revision: 236007 URL: http://svn.freebsd.org/changeset/base/236007 Log: MFC r232946,232958,235233: r232946: Update the rt2860's firmware and add a Makefile for the module. While here remove the ucode header file which was used to generate the fw files but by now is outdated. r232958: Import the latest microcode.h which was used to generate the current firmware files and adjust the Makefile. r235233: Add support for Ralink RT2800/RT3000 chipsets. Added: stable/8/sys/contrib/dev/ral/microcode.h - copied unchanged from r232958, head/sys/contrib/dev/ral/microcode.h stable/8/sys/dev/ral/rt2860.c - copied, changed from r235233, head/sys/dev/ral/rt2860.c stable/8/sys/dev/ral/rt2860reg.h - copied unchanged from r235233, head/sys/dev/ral/rt2860reg.h stable/8/sys/dev/ral/rt2860var.h - copied unchanged from r235233, head/sys/dev/ral/rt2860var.h stable/8/sys/modules/ralfw/rt2860/ - copied from r232946, head/sys/modules/ralfw/rt2860/ Deleted: stable/8/sys/contrib/dev/ral/rt2661_ucode.h Modified: stable/8/sys/conf/files stable/8/sys/contrib/dev/ral/Makefile stable/8/sys/contrib/dev/ral/rt2860.fw.uu stable/8/sys/dev/ral/if_ral_pci.c stable/8/sys/modules/ral/Makefile stable/8/sys/modules/ralfw/Makefile Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Fri May 25 16:30:42 2012 (r236006) +++ stable/8/sys/conf/files Fri May 25 16:39:56 2012 (r236007) @@ -1474,6 +1474,7 @@ dev/puc/pucdata.c optional puc pci dev/quicc/quicc_core.c optional quicc dev/ral/rt2560.c optional ral dev/ral/rt2661.c optional ral +dev/ral/rt2860.c optional ral dev/ral/if_ral_pci.c optional ral pci rt2561fw.c optional rt2561fw | ralfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk rt2561.fw:rt2561fw -mrt2561 -c${.TARGET}" \ Modified: stable/8/sys/contrib/dev/ral/Makefile ============================================================================== --- stable/8/sys/contrib/dev/ral/Makefile Fri May 25 16:30:42 2012 (r236006) +++ stable/8/sys/contrib/dev/ral/Makefile Fri May 25 16:39:56 2012 (r236007) @@ -2,31 +2,35 @@ FILES= rt2561s.fw.uu rt2561.fw.uu rt2661.fw.uu rt2860.fw.uu -rt2561s.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2561s.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2561s_ucode, sizeof(rt2561s_ucode)); return 0; \ + write(1, rt2561s, sizeof(rt2561s)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2561s.fw) > ${.TARGET} -rt2561.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2561.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2561_ucode, sizeof(rt2561_ucode)); return 0; \ + write(1, rt2561, sizeof(rt2561)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2561.fw) > ${.TARGET} -rt2661.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2661.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2661_ucode, sizeof(rt2661_ucode)); return 0; \ + write(1, rt2661, sizeof(rt2661)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2661.fw) > ${.TARGET} -rt2860.fw.uu: rt2661_ucode.h LICENSE - (cat rt2661_ucode.h; \ +rt2860.fw.uu: microcode.h LICENSE + (echo '#include '; \ + cat microcode.h; \ echo 'int main(void) { \ - write(1, rt2860_ucode, sizeof(rt2860_ucode)); return 0; \ + write(1, rt2860, sizeof(rt2860)); return 0; \ }') | ${CC} -o build -x c - (sed 's/^/# /' LICENSE; ./build | uuencode rt2860.fw) > ${.TARGET} Copied: stable/8/sys/contrib/dev/ral/microcode.h (from r232958, head/sys/contrib/dev/ral/microcode.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/contrib/dev/ral/microcode.h Fri May 25 16:39:56 2012 (r236007, copy of r232958, head/sys/contrib/dev/ral/microcode.h) @@ -0,0 +1,3016 @@ +/* $FreeBSD$ */ +/* $OpenBSD: microcode.h,v 1.7 2010/04/05 14:14:02 damien Exp $ */ + +/*- + * Copyright (c) 2005-2010, Ralink Technology, Corp. + * Paul Lin + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file contains the loadable 8051 microcodes for the Ralink RT2561, + * RT2561S, RT2661 and RT2860 chipsets. + */ + +static const uint8_t rt2561[] = { + 0x02, 0x1c, 0x12, 0x02, 0x13, 0xcb, 0xc2, 0x8c, 0x22, 0x22, 0x00, + 0x02, 0x16, 0x0f, 0xc2, 0xaf, 0xc2, 0x8d, 0x75, 0x8c, 0x94, 0x75, + 0x8a, 0x93, 0xd2, 0xaf, 0x22, 0x02, 0x18, 0xda, 0x12, 0x1b, 0xe8, + 0x40, 0x03, 0x02, 0x02, 0x1e, 0x90, 0x21, 0x02, 0xe0, 0xf5, 0x2d, + 0x90, 0x00, 0x03, 0xe0, 0x12, 0x08, 0x25, 0x00, 0xb0, 0x00, 0x00, + 0xce, 0x01, 0x00, 0x5e, 0x10, 0x00, 0x6f, 0x11, 0x00, 0xf2, 0x20, + 0x01, 0x4d, 0x21, 0x01, 0x70, 0x22, 0x01, 0x84, 0x30, 0x01, 0x8f, + 0x31, 0x01, 0xd5, 0x50, 0x01, 0x9f, 0x51, 0x01, 0xf2, 0x52, 0x02, + 0x06, 0x60, 0x00, 0x00, 0x02, 0x14, 0x90, 0x00, 0x0a, 0xe0, 0x20, + 0xe5, 0x03, 0x30, 0x07, 0x03, 0xd2, 0x08, 0x22, 0x12, 0x17, 0xa5, + 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x11, 0xe5, 0x11, 0xc4, 0x33, + 0x54, 0xe0, 0x24, 0x21, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, + 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x11, 0xc4, 0x33, 0x54, 0xe0, 0x24, + 0x2c, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xe5, 0x11, 0xf0, + 0xc4, 0x33, 0x54, 0xe0, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x34, 0x21, + 0xf5, 0x83, 0xe5, 0x2d, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, + 0x12, 0x11, 0x31, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x31, 0x60, 0x05, + 0x12, 0x1b, 0x8a, 0x80, 0x03, 0x12, 0x1b, 0x3d, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, 0x22, 0x75, 0x31, 0xff, + 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, 0x01, 0x01, 0xe0, + 0x54, 0xfe, 0xf0, 0x54, 0x3e, 0xf0, 0xe4, 0x90, 0x00, 0x0b, 0xf0, + 0xf0, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, 0x22, + 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, 0x12, 0x04, 0x0e, 0x90, 0x34, + 0xcd, 0xe0, 0x20, 0xe3, 0xf9, 0x90, 0x21, 0x14, 0x12, 0x08, 0x01, + 0x90, 0x34, 0xc0, 0x12, 0x08, 0x0d, 0x90, 0x21, 0x18, 0x12, 0x08, + 0x01, 0x90, 0x34, 0xc8, 0x12, 0x08, 0x0d, 0x90, 0x21, 0x1c, 0x12, + 0x08, 0x01, 0x90, 0x34, 0xc4, 0x12, 0x08, 0x0d, 0x90, 0x34, 0xcc, + 0x74, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x04, 0xf0, 0x90, 0x01, 0x01, + 0xe0, 0x44, 0x01, 0xf0, 0x44, 0x40, 0xf0, 0x90, 0x00, 0x0b, 0xe0, + 0x44, 0x10, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, + 0x01, 0x01, 0xe0, 0x54, 0xfe, 0xf0, 0x54, 0xbf, 0xf0, 0x90, 0x00, + 0x0b, 0xe0, 0x54, 0xef, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, + 0x2d, 0x12, 0x1c, 0x62, 0x22, 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, + 0x12, 0x04, 0x0e, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0xd2, 0x05, 0x85, 0x2d, 0x23, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0x22, 0x12, 0x1a, 0x74, 0xc2, 0x00, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, 0x22, 0x85, 0x2d, 0x25, + 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfb, 0xff, 0xf0, 0xe4, 0x90, 0x00, + 0x07, 0xf0, 0x90, 0x00, 0x0a, 0x74, 0x04, 0xf0, 0xe4, 0x90, 0x00, + 0x08, 0xf0, 0x90, 0x21, 0x00, 0xe0, 0x90, 0x00, 0x09, 0xf0, 0x90, + 0x00, 0x07, 0x74, 0x71, 0xf0, 0xef, 0x44, 0x04, 0x90, 0x00, 0x0b, + 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, 0x90, 0x21, 0x00, 0xe0, + 0xff, 0x54, 0x1f, 0xf5, 0x30, 0xa3, 0xe0, 0xf5, 0x27, 0x8f, 0x26, + 0x12, 0x08, 0x90, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x2c, 0x12, 0x18, + 0x13, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x1c, 0x62, + 0x22, 0x12, 0x19, 0x53, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x1c, 0x62, 0x22, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x1c, 0x62, 0x22, 0x8e, 0x15, 0x8f, 0x16, 0xca, 0xed, 0xca, + 0xc9, 0xeb, 0xc9, 0x30, 0x0a, 0x04, 0x7f, 0x4a, 0x80, 0x02, 0x7f, + 0x42, 0xcb, 0xef, 0xcb, 0xea, 0xc3, 0x94, 0x04, 0x50, 0x02, 0x80, + 0x01, 0xc3, 0x40, 0x04, 0xcb, 0x44, 0x20, 0xcb, 0x85, 0x16, 0x82, + 0x85, 0x15, 0x83, 0xeb, 0xf0, 0xa3, 0xe4, 0xf0, 0x85, 0x16, 0x82, + 0x85, 0x15, 0x83, 0xa3, 0xa3, 0xe5, 0x1a, 0xf0, 0xe5, 0x19, 0x85, + 0x16, 0x82, 0x85, 0x15, 0x83, 0xa3, 0xa3, 0xa3, 0xf0, 0xe5, 0x16, + 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0x74, 0x0f, + 0xf0, 0xe5, 0x16, 0x24, 0x05, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, + 0x83, 0xe4, 0xf0, 0xe5, 0x16, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x35, + 0x15, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x16, 0x24, 0x07, 0xf5, 0x82, + 0xe4, 0x35, 0x15, 0xf5, 0x83, 0x74, 0x10, 0xf0, 0xea, 0x90, 0x1a, + 0x9c, 0x93, 0xfb, 0xea, 0x64, 0x01, 0x60, 0x08, 0xea, 0x64, 0x02, + 0x60, 0x03, 0xba, 0x03, 0x04, 0xcb, 0x44, 0x08, 0xcb, 0xe5, 0x16, + 0x24, 0x08, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0xeb, 0xf0, + 0xe5, 0x16, 0x24, 0x15, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, + 0x74, 0xff, 0xf0, 0xe5, 0x16, 0x24, 0x16, 0xf5, 0x82, 0xe4, 0x35, + 0x15, 0xf5, 0x83, 0xe9, 0xf0, 0xe5, 0x16, 0x24, 0x09, 0xf5, 0x82, + 0xe4, 0x35, 0x15, 0xf5, 0x83, 0x74, 0x04, 0xf0, 0x25, 0x1a, 0xf5, + 0x1a, 0xe4, 0x35, 0x19, 0xf5, 0x19, 0xea, 0xc3, 0x94, 0x04, 0x40, + 0x03, 0x02, 0x03, 0xd6, 0xea, 0x60, 0x03, 0xba, 0x01, 0x1f, 0xea, + 0x24, 0x01, 0xfd, 0xe4, 0x33, 0xfc, 0xe5, 0x1a, 0xae, 0x19, 0x78, + 0x03, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0xff, 0x12, 0x07, + 0x96, 0x8e, 0x19, 0x8f, 0x1a, 0x02, 0x03, 0xb6, 0xea, 0x24, 0xff, + 0xfd, 0xe4, 0x34, 0xff, 0xfc, 0x7e, 0x00, 0x7f, 0x0b, 0x12, 0x07, + 0x84, 0xcc, 0xee, 0xcc, 0xcd, 0xef, 0xcd, 0xe5, 0x1a, 0xc4, 0xf8, + 0x54, 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x19, 0xc4, 0x54, 0xf0, 0x48, + 0xfe, 0x12, 0x07, 0x96, 0x8c, 0x1b, 0x8d, 0x1c, 0xea, 0x24, 0xff, + 0xfd, 0xe4, 0x34, 0xff, 0xfc, 0x7e, 0x00, 0x7f, 0x0b, 0x12, 0x07, + 0x84, 0xcc, 0xee, 0xcc, 0xcd, 0xef, 0xcd, 0xe5, 0x1a, 0xc4, 0xf8, + 0x54, 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x19, 0xc4, 0x54, 0xf0, 0x48, + 0xfe, 0x12, 0x07, 0x96, 0x8e, 0x19, 0x8f, 0x1a, 0xe5, 0x1c, 0x45, + 0x1b, 0x60, 0x08, 0x05, 0x1a, 0xe5, 0x1a, 0x70, 0x02, 0x05, 0x19, + 0xea, 0x24, 0xff, 0xfd, 0xe4, 0x34, 0xff, 0xfc, 0x7e, 0x00, 0x7f, + 0x03, 0x12, 0x07, 0x84, 0xd3, 0xe5, 0x1c, 0x9f, 0xe5, 0x1b, 0x9e, + 0x50, 0x18, 0xe5, 0x1c, 0x45, 0x1b, 0x60, 0x12, 0xba, 0x03, 0x0f, + 0xe5, 0x16, 0x24, 0x09, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, + 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x16, 0x24, 0x0a, 0xf5, 0x82, 0xe4, + 0x35, 0x15, 0xf5, 0x83, 0xe5, 0x1a, 0xf0, 0xe5, 0x19, 0xff, 0xe5, + 0x16, 0x24, 0x0b, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0xef, + 0xf0, 0x80, 0x2d, 0xe5, 0x1a, 0x54, 0x3f, 0xff, 0xe5, 0x16, 0x24, + 0x0a, 0xf5, 0x82, 0xe4, 0x35, 0x15, 0xf5, 0x83, 0xef, 0xf0, 0xe5, + 0x1a, 0xae, 0x19, 0x78, 0x06, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, + 0xf9, 0xff, 0xe5, 0x16, 0x24, 0x0b, 0xf5, 0x82, 0xe4, 0x35, 0x15, + 0xf5, 0x83, 0xef, 0xf0, 0x85, 0x16, 0x82, 0x85, 0x15, 0x83, 0xe0, + 0x44, 0x01, 0xf0, 0x22, 0x8e, 0x12, 0x8f, 0x13, 0x8d, 0x14, 0xe5, + 0x14, 0xa2, 0xe1, 0x92, 0x09, 0xe5, 0x34, 0x24, 0x19, 0xf5, 0x82, + 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfd, 0xe5, 0x34, 0x24, 0x1a, + 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfb, 0xa2, 0x09, + 0x92, 0x0a, 0x75, 0x19, 0x00, 0x75, 0x1a, 0x1a, 0x12, 0x02, 0x1f, + 0x30, 0x09, 0x04, 0x7f, 0xc8, 0x80, 0x02, 0x7f, 0xe8, 0xe5, 0x13, + 0x24, 0x18, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, 0xf0, + 0xe5, 0x31, 0x60, 0x04, 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x01, 0xe5, + 0x13, 0x24, 0x19, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, + 0xf0, 0xe5, 0x34, 0x24, 0x19, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, + 0x83, 0xe0, 0xff, 0x7d, 0x1a, 0x7c, 0x00, 0x12, 0x0e, 0x64, 0xe5, + 0x13, 0x24, 0x1a, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, + 0xf0, 0xe5, 0x13, 0x24, 0x1b, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, + 0x83, 0xee, 0xf0, 0xe5, 0x31, 0x60, 0x60, 0xe5, 0x13, 0x24, 0x1c, + 0xff, 0xe4, 0x35, 0x12, 0xfe, 0xe5, 0x34, 0x24, 0x12, 0xfd, 0xe4, + 0x35, 0x33, 0xfc, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, + 0xe5, 0x13, 0x24, 0x22, 0xff, 0xe4, 0x35, 0x12, 0xfe, 0x7c, 0x30, + 0x7d, 0x10, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, 0xe5, + 0x13, 0x24, 0x28, 0xff, 0xe4, 0x35, 0x12, 0xfe, 0x7c, 0x30, 0x7d, + 0x08, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, 0xe5, 0x34, + 0x24, 0x18, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xff, + 0xe5, 0x13, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, + 0xef, 0xf0, 0x80, 0x3f, 0xe5, 0x13, 0x24, 0x1c, 0xff, 0xe4, 0x35, + 0x12, 0xfe, 0x7c, 0x30, 0x7d, 0x10, 0x75, 0x1b, 0x11, 0x7b, 0x06, + 0x12, 0x14, 0xab, 0xe5, 0x13, 0x24, 0x22, 0xff, 0xe4, 0x35, 0x12, + 0xfe, 0x7c, 0x30, 0x7d, 0x08, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, + 0x14, 0xab, 0xe5, 0x13, 0x24, 0x28, 0xff, 0xe4, 0x35, 0x12, 0xfe, + 0x7c, 0x30, 0x7d, 0x10, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, + 0xab, 0xe5, 0x13, 0x24, 0x2e, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, + 0x83, 0xe4, 0xf0, 0xe5, 0x13, 0x24, 0x2f, 0xf5, 0x82, 0xe4, 0x35, + 0x12, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x34, 0x24, 0x11, 0xf5, 0x82, + 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xff, 0xc3, 0x13, 0xff, 0xe5, + 0x13, 0x24, 0x30, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, + 0xf0, 0x30, 0x09, 0x41, 0xe5, 0x13, 0x24, 0x30, 0xf5, 0x82, 0xe4, + 0x35, 0x12, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x31, 0x60, 0x04, 0x7e, + 0x00, 0x80, 0x02, 0x7e, 0x10, 0xef, 0x4e, 0xf0, 0xe5, 0x31, 0x60, + 0x06, 0x7e, 0x00, 0x7f, 0x00, 0x80, 0x0f, 0xe5, 0x14, 0x30, 0xe0, + 0x06, 0x7e, 0x00, 0x7f, 0xff, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x00, + 0xe5, 0x13, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, + 0xef, 0xf0, 0x22, 0xe5, 0x13, 0x24, 0x30, 0xf5, 0x82, 0xe4, 0x35, + 0x12, 0xf5, 0x83, 0xe0, 0x44, 0x40, 0xf0, 0xe5, 0x14, 0x30, 0xe0, + 0x0f, 0xe5, 0x34, 0x24, 0x10, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, + 0x83, 0xe0, 0xff, 0x80, 0x02, 0x7f, 0x00, 0xe5, 0x13, 0x24, 0x31, + 0xf5, 0x82, 0xe4, 0x35, 0x12, 0xf5, 0x83, 0xef, 0xf0, 0x22, 0xe5, + 0x34, 0x24, 0x11, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, + 0x30, 0xe7, 0x3b, 0xe5, 0x34, 0x24, 0x1c, 0xf5, 0x82, 0xe4, 0x35, + 0x33, 0xf5, 0x83, 0xe0, 0x65, 0x2b, 0x70, 0x03, 0x75, 0x2b, 0xff, + 0xe5, 0x34, 0x24, 0x1d, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, + 0xe0, 0xff, 0x12, 0x1c, 0x62, 0x7e, 0x22, 0x7f, 0x10, 0x12, 0x18, + 0x7c, 0x8e, 0x33, 0x8f, 0x34, 0x90, 0x22, 0x2e, 0xe0, 0xfe, 0xa3, + 0xe0, 0x8e, 0x33, 0xf5, 0x34, 0xc3, 0x22, 0xd2, 0x0a, 0xe5, 0x34, + 0x24, 0x1b, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0x70, + 0x3a, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, + 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, + 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0xef, 0x9d, 0xff, + 0xee, 0x9c, 0xfe, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0xa3, 0xef, 0xf0, + 0xd3, 0x94, 0x00, 0xee, 0x64, 0x80, 0x94, 0x80, 0x50, 0x03, 0x02, + 0x07, 0x27, 0x80, 0xc6, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xe0, + 0xfe, 0xa3, 0xe0, 0xc3, 0xee, 0x64, 0x80, 0x94, 0x80, 0x50, 0x03, + 0x02, 0x07, 0x27, 0x12, 0x1c, 0x41, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0x9f, 0xee, 0x64, 0x80, + 0xf8, 0xec, 0x64, 0x80, 0x98, 0x40, 0x20, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xa3, 0xa3, 0xe0, 0xfe, 0xa3, + 0xe0, 0xff, 0xed, 0x9f, 0xff, 0xec, 0x9e, 0xd0, 0x82, 0xd0, 0x83, + 0xf0, 0xa3, 0xef, 0xf0, 0xc2, 0x0a, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xe5, 0x34, 0x24, 0x10, 0xf5, + 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfd, 0xc3, 0xef, 0x9d, + 0xfd, 0xee, 0x94, 0x00, 0xfc, 0x12, 0x16, 0x5a, 0x50, 0x2c, 0x85, + 0x34, 0x82, 0x85, 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfe, + 0xa3, 0xe0, 0xff, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xa3, 0xa3, + 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0xef, 0x9d, 0xff, 0xee, 0x9c, + 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0xa3, 0xef, 0xf0, 0xc2, 0x0a, 0x20, + 0x0a, 0x03, 0x02, 0x06, 0x37, 0x7e, 0x22, 0x7f, 0x10, 0x12, 0x18, + 0x7c, 0x8e, 0x33, 0x8f, 0x34, 0x8f, 0x82, 0x8e, 0x83, 0xe0, 0xfe, + 0xa3, 0xe0, 0xd3, 0x94, 0x00, 0xee, 0x64, 0x80, 0x94, 0x80, 0x40, + 0x0d, 0x7e, 0x22, 0x7f, 0x10, 0xad, 0x34, 0xac, 0x33, 0x12, 0x15, + 0x0e, 0x80, 0x1a, 0x12, 0x1b, 0xab, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0xee, 0x8f, 0xf0, 0x12, 0x07, 0xeb, 0x7e, 0x22, 0x7f, 0x30, + 0xad, 0x34, 0xac, 0x33, 0x12, 0x15, 0x0e, 0x90, 0x22, 0x2e, 0xe0, + 0xfe, 0xa3, 0xe0, 0xff, 0x65, 0x34, 0x70, 0x03, 0xee, 0x65, 0x33, + 0x70, 0x02, 0xd3, 0x22, 0x8e, 0x33, 0x8f, 0x34, 0xc3, 0x22, 0xef, + 0x8d, 0xf0, 0xa4, 0xa8, 0xf0, 0xcf, 0x8c, 0xf0, 0xa4, 0x28, 0xce, + 0x8d, 0xf0, 0xa4, 0x2e, 0xfe, 0x22, 0xbc, 0x00, 0x0b, 0xbe, 0x00, + 0x29, 0xef, 0x8d, 0xf0, 0x84, 0xff, 0xad, 0xf0, 0x22, 0xe4, 0xcc, + 0xf8, 0x75, 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, 0xec, + 0x33, 0xfc, 0xee, 0x9d, 0xec, 0x98, 0x40, 0x05, 0xfc, 0xee, 0x9d, + 0xfe, 0x0f, 0xd5, 0xf0, 0xe9, 0xe4, 0xce, 0xfd, 0x22, 0xed, 0xf8, + 0xf5, 0xf0, 0xee, 0x84, 0x20, 0xd2, 0x1c, 0xfe, 0xad, 0xf0, 0x75, + 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xed, 0x33, 0xfd, 0x40, 0x07, 0x98, + 0x50, 0x06, 0xd5, 0xf0, 0xf2, 0x22, 0xc3, 0x98, 0xfd, 0x0f, 0xd5, + 0xf0, 0xea, 0x22, 0xc5, 0xf0, 0xf8, 0xa3, 0xe0, 0x28, 0xf0, 0xc5, + 0xf0, 0xf8, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xe0, + 0x38, 0xf0, 0x22, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe, + 0xa3, 0xe0, 0xff, 0x22, 0xec, 0xf0, 0xa3, 0xed, 0xf0, 0xa3, 0xee, + 0xf0, 0xa3, 0xef, 0xf0, 0x22, 0xa4, 0x25, 0x82, 0xf5, 0x82, 0xe5, + 0xf0, 0x35, 0x83, 0xf5, 0x83, 0x22, 0xd0, 0x83, 0xd0, 0x82, 0xf8, + 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, + 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, + 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, 0xa3, 0x80, 0xdf, + 0x8a, 0x83, 0x89, 0x82, 0xe4, 0x73, 0xe4, 0xff, 0x90, 0x30, 0x8c, + 0xe4, 0xf0, 0xef, 0x90, 0x1b, 0x51, 0x93, 0x44, 0x80, 0x90, 0x30, + 0x8d, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x90, 0x30, + 0x8c, 0xe0, 0xfe, 0x74, 0x36, 0x2f, 0xf8, 0xc6, 0xee, 0xc6, 0xa3, + 0xe0, 0xfe, 0xef, 0x90, 0x1b, 0x51, 0x93, 0x44, 0x80, 0x6e, 0x60, + 0x01, 0x1f, 0x0f, 0xef, 0xc3, 0x94, 0x09, 0x40, 0xc8, 0x22, 0x00, + 0x00, 0x00, 0x00, 0xe5, 0x30, 0x12, 0x08, 0x25, 0x08, 0xb1, 0x00, + 0x09, 0x1f, 0x01, 0x09, 0x87, 0x02, 0x0a, 0x1b, 0x03, 0x0a, 0x6f, + 0x04, 0x0a, 0xb6, 0x05, 0x0b, 0x29, 0x06, 0x0b, 0x98, 0x07, 0x00, + 0x00, 0x0b, 0xd0, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, + 0xe0, 0xf5, 0x12, 0xe5, 0x26, 0x20, 0xe5, 0x08, 0x90, 0x34, 0x98, + 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x30, 0xe6, 0x0f, 0xe5, 0x27, 0x30, 0xe6, 0x05, + 0x53, 0x12, 0xfd, 0x80, 0x12, 0x43, 0x12, 0x02, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, + 0xfd, 0xe5, 0x26, 0x30, 0xe7, 0x0f, 0xe5, 0x27, 0x30, 0xe7, 0x05, + 0x53, 0x12, 0xf7, 0x80, 0x12, 0x43, 0x12, 0x08, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, 0x12, + 0xf7, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, 0x90, 0x30, 0x3a, 0xe5, + 0x12, 0xf0, 0x22, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, + 0xe0, 0xf5, 0x12, 0xe5, 0x26, 0x20, 0xe5, 0x08, 0x90, 0x34, 0x98, + 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x1c, 0xe5, 0x27, 0x30, 0xe6, + 0x05, 0x53, 0x12, 0xfd, 0x80, 0x03, 0x43, 0x12, 0x02, 0xe5, 0x27, + 0x30, 0xe7, 0x05, 0x53, 0x12, 0xf7, 0x80, 0x1f, 0x43, 0x12, 0x08, + 0x80, 0x1a, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, + 0x03, 0x53, 0x12, 0xfd, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, + 0x08, 0x80, 0x03, 0x53, 0x12, 0xf7, 0x43, 0x12, 0x01, 0x43, 0x12, + 0x04, 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, 0x22, 0xc2, 0x01, 0x12, + 0x00, 0x06, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0x43, 0x12, 0x01, + 0x43, 0x12, 0x04, 0xe5, 0x26, 0x30, 0xe5, 0x5c, 0x90, 0x34, 0x98, + 0xe0, 0x44, 0x01, 0xf0, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x1c, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x53, 0x12, 0xfd, 0x80, 0x03, 0x43, 0x12, + 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, 0x12, 0xf7, 0x80, 0x30, + 0x43, 0x12, 0x08, 0x80, 0x2b, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x43, + 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, 0xfd, 0xe5, 0x27, 0x30, 0xe7, + 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, 0x12, 0xf7, 0xe5, 0x27, + 0xf4, 0x54, 0x1f, 0xff, 0x90, 0x30, 0x34, 0xe0, 0x54, 0xe0, 0x4f, + 0xf0, 0xe4, 0xf5, 0x2c, 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, 0x80, + 0x15, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfe, 0xf0, 0xe5, 0x27, 0xf4, + 0x54, 0x1f, 0xff, 0x90, 0x30, 0x34, 0xe0, 0x54, 0xe0, 0x4f, 0xf0, + 0x90, 0x30, 0x35, 0xe0, 0xf5, 0x12, 0x53, 0x12, 0xe0, 0xe5, 0x12, + 0xf0, 0x22, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, 0xe0, + 0xf5, 0x12, 0xe5, 0x26, 0x30, 0xe5, 0x3c, 0x90, 0x34, 0x98, 0xe0, + 0x44, 0x01, 0xf0, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x53, 0x12, 0xfd, + 0x80, 0x03, 0x43, 0x12, 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, + 0x12, 0xf7, 0x80, 0x03, 0x43, 0x12, 0x08, 0xe5, 0x26, 0x54, 0xc0, + 0x60, 0x08, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, 0x80, 0x06, 0x53, + 0x12, 0xfe, 0x43, 0x12, 0x04, 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, + 0x22, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0xc2, 0x01, + 0x12, 0x00, 0x06, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0xe5, 0x27, + 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, 0xfd, + 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, + 0x12, 0xf7, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x08, 0x53, 0x12, 0xfe, + 0x53, 0x12, 0xfb, 0x80, 0x06, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, + 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x30, 0x3a, 0xe5, + 0x12, 0xf0, 0x22, 0x20, 0x02, 0x13, 0x12, 0x1c, 0x1e, 0xaf, 0x29, + 0x7e, 0x00, 0x12, 0x1c, 0x74, 0xaf, 0x35, 0x7e, 0x00, 0x12, 0x1c, + 0x7b, 0xd2, 0x02, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0xe5, 0x26, + 0x20, 0xe5, 0x0d, 0xc2, 0x01, 0x12, 0x00, 0x06, 0x90, 0x34, 0x98, + 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x54, 0xc0, 0x60, 0x2c, 0xc2, 0x01, 0x12, 0x00, + 0x06, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x53, 0x12, 0xfd, 0x80, 0x03, + 0x43, 0x12, 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, 0x12, 0xf7, + 0x80, 0x03, 0x43, 0x12, 0x08, 0x43, 0x12, 0x01, 0x43, 0x12, 0x04, + 0x90, 0x30, 0x3a, 0xe5, 0x12, 0xf0, 0x22, 0x30, 0x01, 0x03, 0x02, + 0x0b, 0xd0, 0x12, 0x15, 0xc0, 0xd2, 0x01, 0x22, 0xc2, 0x01, 0x12, + 0x00, 0x06, 0xe5, 0x26, 0x20, 0xe5, 0x09, 0x90, 0x34, 0x98, 0xe0, + 0x54, 0xfe, 0xf0, 0x80, 0x55, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x01, + 0xf0, 0xe5, 0x26, 0x30, 0xe6, 0x0f, 0xe5, 0x27, 0x30, 0xe6, 0x05, + 0x53, 0x12, 0xfd, 0x80, 0x12, 0x43, 0x12, 0x02, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x43, 0x12, 0x02, 0x80, 0x03, 0x53, 0x12, + 0xfd, 0xe5, 0x26, 0x30, 0xe7, 0x0f, 0xe5, 0x27, 0x30, 0xe7, 0x05, + 0x53, 0x12, 0xf7, 0x80, 0x12, 0x43, 0x12, 0x08, 0x80, 0x0d, 0xe5, + 0x27, 0x30, 0xe7, 0x05, 0x43, 0x12, 0x08, 0x80, 0x03, 0x53, 0x12, + 0xf7, 0x43, 0x12, 0x01, 0x53, 0x12, 0xfb, 0x90, 0x30, 0x3a, 0xe5, + 0x12, 0xf0, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0x22, 0xe5, 0x26, + 0x30, 0xe5, 0x2c, 0x20, 0x03, 0x21, 0xd2, 0x03, 0x12, 0x1c, 0x1e, + 0x75, 0x35, 0x06, 0x75, 0x29, 0x09, 0xaf, 0x29, 0x7e, 0x00, 0x12, + 0x1c, 0x74, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x12, 0x53, 0x12, 0xfe, + 0x43, 0x12, 0x04, 0xe5, 0x12, 0xf0, 0x90, 0x34, 0x98, 0xe0, 0x44, + 0x01, 0xf0, 0x22, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfe, 0xf0, 0x22, + 0xe5, 0x31, 0x64, 0x01, 0x70, 0x41, 0x12, 0x1a, 0xd4, 0x40, 0x03, + 0x02, 0x0d, 0x4f, 0x12, 0x1b, 0x65, 0x50, 0x20, 0x7e, 0x2b, 0x7f, + 0x80, 0x7d, 0x03, 0x12, 0x04, 0x0e, 0x7f, 0x01, 0x12, 0x19, 0x78, + 0x40, 0x09, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, 0x22, + 0x12, 0x0d, 0x50, 0x75, 0x2f, 0x01, 0x22, 0x7f, 0x01, 0x12, 0x19, + 0x78, 0x50, 0x04, 0x75, 0x2f, 0x02, 0x22, 0xd2, 0x09, 0x12, 0x0f, + 0xee, 0xe4, 0xf5, 0x2f, 0x22, 0x12, 0x1a, 0x1d, 0x50, 0x51, 0x12, + 0x1b, 0xcb, 0x90, 0x30, 0xf4, 0xe0, 0xf5, 0x2a, 0x7e, 0x30, 0x7f, + 0xec, 0xa3, 0xe0, 0xfd, 0xe4, 0xfb, 0x12, 0x19, 0x2b, 0xe4, 0xff, + 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0a, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0b, 0xe0, 0x44, 0x02, 0xff, 0xf0, 0xfd, 0x90, 0x01, 0x05, + 0x74, 0x20, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x44, 0x20, 0xf0, 0xed, + 0x54, 0xbf, 0x90, 0x00, 0x0b, 0xf0, 0x90, 0x34, 0xcc, 0xe0, 0x44, + 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, + 0xf0, 0xd2, 0x04, 0x12, 0x1a, 0x3a, 0x50, 0x43, 0x12, 0x1a, 0x57, + 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x30, 0x7d, 0xec, 0x75, 0x1b, 0x11, + 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, 0x30, 0xf5, 0xe0, 0x75, 0xf0, + 0x20, 0xa4, 0xff, 0xae, 0xf0, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, + 0xe0, 0x54, 0xfd, 0xff, 0xf0, 0xfd, 0xe4, 0x90, 0x00, 0x04, 0xf0, + 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0x90, 0x00, 0x0a, 0x74, + 0x40, 0xf0, 0x4d, 0x90, 0x00, 0x0b, 0xf0, 0xc2, 0x04, 0x12, 0x1a, + 0xfe, 0x50, 0x38, 0x12, 0x1a, 0x57, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, + 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, + 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, + 0xff, 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, + 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x54, + 0xdf, 0xf0, 0xc2, 0x04, 0x12, 0x1b, 0x28, 0x50, 0x25, 0x12, 0x1a, + 0x57, 0x7f, 0x02, 0x12, 0x19, 0x78, 0x90, 0x01, 0x04, 0xe0, 0x54, + 0x7f, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xff, 0xf0, 0xe4, + 0x90, 0x00, 0x04, 0xf0, 0xef, 0x54, 0xbf, 0x90, 0x00, 0x0b, 0xf0, + 0xc2, 0x04, 0x12, 0x1a, 0xd4, 0x50, 0x2d, 0x12, 0x1a, 0x57, 0x7e, + 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, + 0x06, 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0a, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0x90, + 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0xc2, 0x04, 0x22, 0x90, 0x34, + 0xcd, 0xe0, 0xf9, 0x20, 0xe3, 0xf8, 0xe5, 0x2b, 0xf4, 0x60, 0x66, + 0x90, 0x34, 0xc0, 0x12, 0x08, 0x01, 0x85, 0x34, 0x82, 0x85, 0x33, + 0x83, 0x75, 0xf0, 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, 0x82, + 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, + 0x0d, 0x90, 0x34, 0xc8, 0x12, 0x08, 0x01, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0x75, 0xf0, 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, + 0x82, 0x24, 0x08, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, + 0x08, 0x0d, 0x90, 0x34, 0xd0, 0x12, 0x08, 0x01, 0x85, 0x34, 0x82, + 0x85, 0x33, 0x83, 0x75, 0xf0, 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, + 0xe5, 0x82, 0x24, 0x0c, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, + 0x12, 0x08, 0x0d, 0xe5, 0x34, 0x24, 0xf0, 0xff, 0xe5, 0x33, 0x34, + 0xde, 0xfe, 0xef, 0x78, 0x05, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, + 0xf9, 0xf5, 0x2b, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0x75, 0xf0, + 0x20, 0x12, 0x08, 0x19, 0xe5, 0x82, 0x24, 0x04, 0xf5, 0x82, 0xe4, + 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, 0x01, 0x90, 0x34, 0xc0, 0x12, + 0x08, 0x0d, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0x75, 0xf0, 0x20, + 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, 0x82, 0x24, 0x08, 0xf5, 0x82, + 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, 0x01, 0x90, 0x34, 0xc8, + 0x12, 0x08, 0x0d, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0x75, 0xf0, + 0x20, 0xe5, 0x2b, 0x12, 0x08, 0x19, 0xe5, 0x82, 0x24, 0x0c, 0xf5, + 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0x12, 0x08, 0x01, 0x90, 0x34, + 0xc4, 0x12, 0x08, 0x0d, 0x90, 0x01, 0x01, 0xe0, 0x44, 0x40, 0xf0, + 0x90, 0x01, 0x00, 0xe0, 0x44, 0x08, 0xf0, 0xe9, 0x44, 0x04, 0x90, + 0x34, 0xcd, 0xf0, 0x90, 0x34, 0xcc, 0xe0, 0x44, 0x01, 0xf0, 0xa3, + 0xe0, 0x44, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, 0xf0, 0x22, 0x8f, + 0x15, 0x8c, 0x16, 0x8d, 0x17, 0xe5, 0x15, 0xc3, 0x94, 0x04, 0x50, + 0x56, 0xe5, 0x15, 0x94, 0x00, 0x40, 0x06, 0x7a, 0x00, 0x7b, 0x60, + 0x80, 0x04, 0x7a, 0x00, 0x7b, 0xc0, 0xe5, 0x17, 0xc4, 0xf8, 0x54, + 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x16, 0xc4, 0x54, 0xf0, 0x48, 0xfe, + 0xe5, 0x15, 0x90, 0x1a, 0x8e, 0x93, 0xfd, 0x7c, 0x00, 0x12, 0x07, + 0x96, 0xef, 0x2b, 0xfb, 0xee, 0x3a, 0xfa, 0xe5, 0x17, 0xc4, 0xf8, + 0x54, 0x0f, 0xc8, 0x68, 0xff, 0xe5, 0x16, 0xc4, 0x54, 0xf0, 0x48, + 0xfe, 0xe5, 0x15, 0x93, 0xfd, 0x7c, 0x00, 0x12, 0x07, 0x96, 0xed, + 0x4c, 0x60, 0x63, 0x0b, 0xbb, 0x00, 0x01, 0x0a, 0x80, 0x5c, 0x7a, + 0x00, 0x7b, 0x1a, 0xe5, 0x17, 0xae, 0x16, 0x78, 0x02, 0xc3, 0x33, + 0xce, 0x33, 0xce, 0xd8, 0xf9, 0x24, 0x0b, 0xff, 0xe4, 0x3e, 0xfe, + 0xe5, 0x15, 0x90, 0x1a, 0x8e, 0x93, 0xfd, 0x7c, 0x00, 0x12, 0x07, + 0x96, 0xef, 0x78, 0x02, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, + 0x2b, 0xfb, 0xee, 0x3a, 0xfa, 0xe5, 0x17, 0xae, 0x16, 0x78, 0x02, + 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0x24, 0x0b, 0xff, 0xe4, + 0x3e, 0xfe, 0xe5, 0x15, 0x90, 0x1a, 0x8e, 0x93, 0xfd, 0x7c, 0x00, + 0x12, 0x07, 0x96, 0xed, 0x4c, 0x60, 0x07, 0x74, 0x04, 0x2b, 0xfb, + 0xe4, 0x3a, 0xfa, 0xcf, 0xeb, 0xcf, 0xce, 0xea, 0xce, 0x22, 0xe5, + 0x2e, 0x14, 0x60, 0x1d, 0x14, 0x60, 0x3d, 0x14, 0x60, 0x5d, 0x14, + 0x70, 0x03, 0x02, 0x0f, 0xd7, 0x24, 0x04, 0x60, 0x03, 0x02, 0x0f, + 0xed, 0x20, 0x0d, 0x03, 0x02, 0x0f, 0xed, 0x75, 0x2e, 0x01, 0x22, + 0x90, 0x00, 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x03, 0x44, 0x20, 0xf0, + 0xe5, 0x40, 0x45, 0x3f, 0x60, 0x03, 0x02, 0x0f, 0xed, 0x75, 0x2e, + 0x02, 0x12, 0x19, 0x9b, 0x12, 0x1b, 0x78, 0xaf, 0x28, 0x12, 0x1a, + 0xa8, 0x22, 0x90, 0x01, 0x03, 0xe0, 0xff, 0x30, 0xe7, 0x76, 0xef, + 0x44, 0x80, 0x90, 0x01, 0x03, 0xf0, 0x12, 0x08, 0x51, 0x12, 0x19, + 0xde, 0x12, 0x1b, 0xbb, 0x75, 0x2e, 0x03, 0xaf, 0x22, 0x7e, 0x00, + 0x12, 0x1c, 0x2a, 0x22, 0xe5, 0x40, 0x45, 0x3f, 0x70, 0x21, 0x12, + 0x14, 0x41, 0x12, 0x1b, 0x78, 0x12, 0x19, 0xbe, 0x12, 0x1b, 0xbb, + 0x12, 0x1c, 0x04, 0x30, 0x0d, 0x0b, 0x75, 0x2e, 0x01, 0xaf, 0x32, + 0x7e, 0x00, 0x12, 0x1c, 0x2a, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x90, + 0x00, 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x2c, 0x44, 0x20, 0xf0, 0x12, + 0x14, 0x41, 0x12, 0x1b, 0x78, 0x12, 0x19, 0xbe, 0x12, 0x1b, 0xbb, + 0x12, 0x1c, 0x04, 0x75, 0x2e, 0x04, 0x22, 0xe5, 0x40, 0x45, 0x3f, + 0x70, 0x10, 0x30, 0x0d, 0x0a, 0x75, 0x2e, 0x01, 0xaf, 0x32, 0xfe, + 0x12, 0x1c, 0x2a, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x90, 0x00, 0x04, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0x30, 0x09, 0x32, 0xe5, + 0x34, 0x45, 0x33, 0x70, 0x02, 0xc3, 0x22, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, + 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, + 0xe0, 0xfd, 0xc3, 0xef, 0x9d, 0xff, 0xee, 0x9c, 0xd0, 0x82, 0xd0, + 0x83, 0xf0, 0xa3, 0xef, 0xf0, 0xe5, 0x34, 0x45, 0x33, 0x70, 0x02, + 0xc3, 0x22, 0x12, 0x05, 0xed, 0x50, 0xf3, 0x90, 0x00, 0x0a, 0xe0, + 0x20, 0xe5, 0x03, 0x30, 0x07, 0x41, 0xe5, 0x34, 0x45, 0x33, 0x70, + 0x02, 0xc3, 0x22, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xc0, 0x83, + 0xc0, 0x82, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x85, 0x34, 0x82, 0x85, + 0x33, 0x83, 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xc3, 0xef, + 0x9d, 0xff, 0xee, 0x9c, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0xa3, 0xef, + 0xf0, 0xe5, 0x34, 0x45, 0x33, 0x70, 0x02, 0xc3, 0x22, 0x12, 0x05, + 0xed, 0x50, 0xf3, 0x80, 0xb5, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, + 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x12, 0x16, 0xea, 0xd3, 0x22, 0x12, + 0x1a, 0xfe, 0x40, 0x05, 0x12, 0x1a, 0xd4, 0x50, 0x44, 0x7e, 0x30, + 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, + 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, + 0x0a, 0xf0, 0xe4, 0xff, 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, + 0xe0, 0x54, 0xbf, 0xf0, 0x54, 0x7f, 0xff, 0xf0, 0xe4, 0x90, 0x30, + 0xe9, 0xf0, 0xef, 0x54, 0xfd, 0x90, 0x00, 0x0b, 0xf0, 0xe4, 0x90, + 0x00, 0x04, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, + 0x12, 0x1b, 0x13, 0x50, 0x48, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, + 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, + 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, 0xff, + 0xfe, 0x12, 0x1c, 0x36, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, + 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0xff, 0x12, 0x19, + 0x78, 0x50, 0x04, 0x75, 0x2f, 0x07, 0x22, 0x90, 0x01, 0x04, 0xe0, + 0x54, 0x7f, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, + 0x22, 0xc2, 0xaf, 0xe4, 0xf5, 0x2f, 0xf5, 0x88, 0x75, 0xa8, 0x0f, + 0x75, 0x89, 0x11, 0xf5, 0xb8, 0xf5, 0xe8, 0x75, 0x90, 0x0f, 0x75, + 0x31, 0xff, 0x75, 0x2b, 0xff, 0x90, 0x22, 0x2e, 0xf0, 0xa3, 0xf0, + 0x90, 0x22, 0x4e, 0xf0, 0xa3, 0xf0, 0xc2, 0x05, 0xc2, 0x08, 0xc2, + 0x00, 0xc2, 0x07, 0xc2, 0x04, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, + 0x90, 0x00, 0x0b, 0x74, 0x01, 0xf0, 0x90, 0x01, 0x03, 0x74, 0xff, + 0xf0, 0xe4, 0x90, 0x01, 0x04, 0xf0, 0x90, 0x01, 0x05, 0x74, 0xff, + 0xf0, 0xe4, 0x90, 0x01, 0x06, 0xf0, 0x90, 0x00, 0x04, 0xf0, 0x90, + 0x30, 0xe8, 0x74, 0x10, 0xf0, 0x90, 0x01, 0x07, 0xf0, 0x90, 0x01, + 0x08, 0x04, 0xf0, 0x90, 0x01, 0x09, 0x74, 0x48, 0xf0, 0x90, 0x01, + 0x0a, 0x74, 0x7f, 0xf0, 0x90, 0x01, 0x02, 0x74, 0x1f, 0xf0, 0x90, + 0x01, 0x00, 0x74, 0x14, 0xf0, 0x90, 0x01, 0x01, 0x74, 0x20, 0xf0, + 0x90, 0x00, 0x00, 0xe0, 0x44, 0x80, 0xf0, 0x75, 0x49, 0x00, 0x75, + 0x4a, 0x01, 0xc2, 0x01, 0xd2, 0xaf, 0x22, 0x12, 0x1a, 0xd4, 0x50, + 0x2d, 0x12, 0x18, 0x48, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, + 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, + 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, + 0x90, 0x00, 0x0a, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, + 0x2f, 0x22, 0x12, 0x1b, 0x28, 0x50, 0x50, 0x12, 0x18, 0x48, 0x90, + 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, + 0x90, 0x01, 0x03, 0x74, 0x80, 0xf0, 0x90, 0x01, 0x04, 0xe0, 0x44, + 0x80, 0xf0, 0x7f, 0x02, 0x12, 0x19, 0x78, 0x50, 0x04, 0x75, 0x2f, + 0x05, 0x22, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x82, 0x75, + 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, 0x90, 0x00, 0x04, 0x74, + 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xd2, 0x09, 0x12, 0x0f, 0xee, + 0x90, 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, 0xe4, 0xf5, 0x2f, 0x22, + 0x90, 0x30, 0x30, 0x74, 0x02, 0xf0, 0x75, 0x11, 0x07, 0x75, 0x12, + 0xd0, 0x90, 0x30, 0x30, 0xe0, 0x30, 0xe0, 0x0e, 0xe5, 0x12, 0x15, + 0x12, 0x70, 0x02, 0x15, 0x11, 0xe5, 0x12, 0x45, 0x11, 0x70, 0xeb, + 0xe5, 0x12, 0x45, 0x11, 0x70, 0x12, 0x12, 0x1a, 0x74, 0x90, 0x21, + 0x00, 0xe0, 0x60, 0x07, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x04, 0xf0, + 0xc3, 0x22, 0xe4, 0x90, 0x34, 0x58, 0xf0, 0x90, 0x34, 0x32, 0x74, + 0x1f, 0xf0, 0x75, 0x11, 0x07, 0x75, 0x12, 0xd0, 0x90, 0x34, 0x81, + 0xe0, 0x64, 0x03, 0x60, 0x0e, 0xe5, 0x12, 0x15, 0x12, 0x70, 0x02, + 0x15, 0x11, 0xe5, 0x12, 0x45, 0x11, 0x70, 0xea, 0xe5, 0x12, 0x45, + 0x11, 0x70, 0x12, 0x12, 0x1a, 0x74, 0x90, 0x21, 0x00, 0xe0, 0x60, + 0x07, 0x90, 0x34, 0x98, 0xe0, 0x44, 0x04, 0xf0, 0xc3, 0x22, 0x90, + 0x34, 0x98, 0xe0, 0x44, 0x04, 0xf0, 0xe4, 0x90, 0x00, 0x01, 0xf0, + 0xd3, 0x22, 0x90, 0x30, 0x3a, 0xe0, 0xf5, 0x10, 0x12, 0x1c, 0x57, + 0x50, 0x26, 0xe5, 0x27, 0x30, 0xe6, 0x05, 0x53, 0x10, 0xfd, 0x80, + 0x03, 0x43, 0x10, 0x02, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x53, 0x10, + 0xf7, 0x80, 0x03, 0x43, 0x10, 0x08, 0x53, 0x10, 0xfe, 0x43, 0x10, + 0x04, 0x90, 0x30, 0x3a, 0xe5, 0x10, 0xf0, 0x12, 0x1c, 0x4c, 0x50, + 0x48, 0x90, 0x01, 0x03, 0xe0, 0xf5, 0x10, 0x54, 0x1c, 0x60, 0x3e, + 0xe5, 0x10, 0x54, 0xe3, 0xf0, 0xa3, 0xe0, 0xf5, 0x10, 0xf0, 0xe5, + 0x27, 0x30, 0xe6, 0x05, 0x43, 0x10, 0x02, 0x80, 0x03, 0x53, 0x10, + 0xfd, 0xe5, 0x27, 0x30, 0xe7, 0x05, 0x43, 0x10, 0x08, 0x80, 0x03, + 0x53, 0x10, 0xf7, 0x53, 0x10, 0xfe, 0x43, 0x10, 0x04, 0x90, 0x30, + 0x3a, 0xe5, 0x10, 0xf0, 0xaf, 0x29, 0x7e, 0x00, 0x12, 0x1c, 0x74, + 0xaf, 0x35, 0x7e, 0x00, 0x12, 0x1c, 0x7b, 0x22, 0x12, 0x1a, 0xbf, + 0x50, 0x72, 0x12, 0x1c, 0x41, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, + 0xe0, 0xfc, 0xa3, 0xe0, 0xc3, 0x9f, 0xf5, 0x12, 0xec, 0x9e, 0xf5, + 0x11, 0xd3, 0xe5, 0x12, 0x94, 0x00, 0xe5, 0x11, 0x64, 0x80, 0x94, + 0x80, 0x40, 0x06, 0xae, 0x11, 0xaf, 0x12, 0x80, 0x04, 0x7e, 0x00, + 0x7f, 0x00, 0x8e, 0x11, 0x8f, 0x12, 0xe5, 0x34, 0x24, 0x10, 0xf5, + 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xc3, 0x95, 0x12, 0xf5, + 0x12, 0xe4, 0x95, 0x11, 0xf5, 0x11, 0xc3, 0x64, 0x80, 0x94, 0x80, + 0x50, 0x05, 0xe4, 0xf5, 0x11, 0xf5, 0x12, 0xe5, 0x34, 0x24, 0x12, + 0xff, 0xe4, 0x35, 0x33, 0xfe, 0xad, 0x12, 0x7b, 0x01, 0x12, 0x19, + 0x2b, 0x90, 0x01, 0x05, 0x74, 0x20, 0xf0, 0x90, 0x01, 0x06, 0xe0, + 0x44, 0x20, 0xf0, 0x75, 0x2f, 0x03, 0x22, 0xc0, 0xe0, 0xc0, 0xf0, + 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x08, 0xc2, 0xaf, + 0x90, 0x22, 0x2e, 0xe0, 0xfe, 0xa3, 0xe0, 0x8e, 0x33, 0xf5, 0x34, + 0xe5, 0x2f, 0x25, 0xe0, 0x24, 0x9b, 0xf5, 0x82, 0xe4, 0x34, 0x1b, + 0xf5, 0x83, 0xe4, 0x93, 0xfe, 0x74, 0x01, 0x93, 0xca, 0xee, 0xca, + 0xf9, 0x12, 0x08, 0x4b, 0x12, 0x1b, 0xf6, 0x50, 0x02, 0xd2, 0x07, + 0x12, 0x17, 0x2c, 0x12, 0x00, 0x1e, 0x12, 0x1a, 0xe9, 0x50, 0x05, + 0xaf, 0x25, 0x12, 0x1c, 0x62, 0x30, 0x05, 0x1b, 0xe5, 0x2f, 0x70, + 0x17, 0x20, 0x04, 0x14, 0x12, 0x12, 0x4e, 0x92, 0x00, 0xc2, 0x05, + 0xd2, 0x0b, 0xa2, 0x00, 0xe4, 0x33, 0xf5, 0x14, 0xaf, 0x23, 0x12, + 0x16, 0xa2, 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, + 0xf0, 0xd0, 0xe0, 0x32, 0x90, 0x29, 0xa0, 0xe0, 0x70, 0x63, 0x90, + 0x30, 0x8c, 0xe4, 0xf0, 0xa3, 0x74, 0xc2, 0xf0, 0xa3, 0x74, 0x01, + 0xf0, 0xa3, 0xe4, 0xf0, 0x90, 0x30, 0x8c, 0xe0, 0xff, 0x90, 0x29, + 0xa0, 0xf0, 0x90, 0x30, 0x8c, 0xe4, 0xf0, 0xa3, 0x74, 0xc5, 0xf0, + 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x90, 0x30, 0x8c, 0xe0, + 0xff, 0x90, 0x29, 0xa1, 0xf0, 0x90, 0x30, 0x8c, 0xe4, 0xf0, 0xa3, + 0x74, 0xc4, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x90, + 0x30, 0x8c, 0xe0, 0xff, 0x90, 0x29, 0xa2, 0xf0, 0x90, 0x30, 0x8c, + 0xe4, 0xf0, 0xa3, 0x74, 0xc3, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, + 0xe4, 0xf0, 0x90, 0x30, 0x8c, 0xe0, 0x90, 0x29, 0xa3, 0xf0, 0x22, + 0x8e, 0x16, 0x8f, 0x17, 0x8c, 0x18, 0x8d, 0x19, 0xe4, 0xff, 0xef, + 0xc3, 0x9b, 0x50, 0x53, 0xe5, 0x1b, 0x30, 0xe0, 0x12, 0xef, 0x7c, + 0x00, 0x25, 0x19, 0xfd, 0xec, 0x35, 0x18, 0x8d, 0x82, 0xf5, 0x83, + 0xe0, 0xf5, 0x1c, 0x80, 0x1f, 0xe5, 0x1b, 0x30, 0xe1, 0x13, 0xef, + 0x7c, 0x00, 0x25, 0x19, 0xfd, 0xec, 0x35, 0x18, 0x8d, 0x82, 0xf5, + 0x83, 0xe4, 0x93, 0xf5, 0x1c, 0x80, 0x07, 0xe5, 0x19, 0x2f, 0xf8, + 0xe6, 0xf5, 0x1c, 0xe5, 0x1b, 0x30, 0xe4, 0x0f, 0xe5, 0x17, 0x2f, + 0xf5, 0x82, 0xe4, 0x35, 0x16, 0xf5, 0x83, 0xe5, 0x1c, 0xf0, 0x80, + 0x06, 0xe5, 0x17, 0x2f, 0xf8, 0xa6, 0x1c, 0x0f, 0x80, 0xa8, 0x22, + 0x8c, 0x13, 0x8d, 0x14, 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3e, + 0xf5, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0x4c, 0x60, 0x41, 0xef, 0x24, + 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, + 0xf5, 0x82, 0x8c, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0x85, 0x14, + 0x82, 0x85, 0x13, 0x83, 0xe0, 0xfa, 0xa3, 0xe0, 0xfb, 0xd3, 0xed, + 0x9b, 0xea, 0x64, 0x80, 0xf8, 0xec, 0x64, 0x80, 0x98, 0x40, 0x13, + 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfc, + 0xa3, 0xe0, 0xce, 0xec, 0xce, 0xff, 0x80, 0xaf, 0xad, 0x14, 0xac, + 0x13, 0x12, 0x18, 0xaf, 0x22, 0x12, 0x1a, 0xbf, 0x50, 0x4f, 0xe5, + 0x34, 0x24, 0x12, 0xff, 0xe4, 0x35, 0x33, 0xfe, 0xe5, 0x34, 0x24, + 0x10, 0xf5, 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xfd, 0xe4, + 0xfb, 0x12, 0x19, 0x2b, 0xe5, 0x34, 0x24, 0x10, 0xf5, 0x82, 0xe4, + 0x35, 0x33, 0xf5, 0x83, 0xe0, 0xff, 0x7e, 0x00, 0x12, 0x1c, 0x36, + 0x90, 0x00, 0x0a, 0x74, 0x40, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x44, + 0x40, 0xff, 0xf0, 0x90, 0x00, 0x0a, 0x74, 0x80, 0xf0, 0x4f, 0x90, + 0x00, 0x0b, 0xf0, 0x90, 0x30, 0xe9, 0x74, 0x01, 0xf0, 0x75, 0x2f, + 0x06, 0x22, 0x90, 0x30, 0x3a, 0xe0, 0xff, 0xe5, 0x27, 0x30, 0xe6, + 0x12, 0x30, 0x0c, 0x06, 0xef, 0x54, 0xf5, 0xfe, 0x80, 0x04, 0xef, + 0x44, 0x0a, 0xfe, 0xcf, 0xee, 0xcf, 0x80, 0x10, 0x30, 0x0c, 0x06, + 0xef, 0x44, 0x0a, 0xfe, 0x80, 0x04, 0xef, 0x54, 0xf5, 0xfe, 0xcf, + 0xee, 0xcf, 0xcf, 0x54, 0xfe, 0xcf, 0xcf, 0x44, 0x04, 0xcf, 0x90, + 0x30, 0x3a, 0xef, 0xf0, 0x30, 0x0c, 0x09, 0x7f, 0x08, 0x7e, 0x00, + 0x12, 0x1c, 0x74, 0x80, 0x07, 0x7f, 0x22, 0x7e, 0x01, 0x12, 0x1c, + 0x74, 0xb2, 0x0c, 0x22, 0xc0, 0xe0, 0xc0, 0xf0, 0xc0, 0x83, 0xc0, + 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x08, 0xc2, 0xaf, 0xc2, 0x8c, 0xc2, + 0x8d, 0xd3, 0xe5, 0x4a, 0x94, 0x00, 0xe5, 0x49, 0x94, 0x00, 0x40, + 0x08, 0xe5, 0x4a, 0x15, 0x4a, 0x70, 0x02, 0x15, 0x49, 0xd3, 0xe5, + 0x4c, 0x94, 0x00, 0xe5, 0x4b, 0x94, 0x00, 0x40, 0x08, 0xe5, 0x4c, + 0x15, 0x4c, 0x70, 0x02, 0x15, 0x4b, 0x12, 0x00, 0x0e, 0xd2, 0x8c, + 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xf0, 0xd0, + 0xe0, 0x32, 0xc3, 0xef, 0x94, 0x04, 0xee, 0x64, 0x80, 0x94, 0x80, + 0x40, 0x0c, 0xd3, 0xed, 0x94, 0x04, 0xec, 0x64, 0x80, 0x94, 0x80, + 0x50, 0x01, 0x22, 0xc3, 0xef, 0x94, 0xfc, 0xee, 0x64, 0x80, 0x94, + 0x7f, 0x40, 0x0c, 0xd3, 0xed, 0x94, 0xfc, 0xec, 0x64, 0x80, 0x94, + 0x7f, 0x50, 0x01, 0x22, 0xd3, 0xef, 0x94, 0x04, 0xee, 0x64, 0x80, + 0x94, 0x80, 0x50, 0x0d, 0xc3, 0xed, 0x94, 0xfc, 0xec, 0x64, 0x80, + 0x94, 0x7f, 0x40, 0x02, 0xd3, 0x22, 0xc3, 0x22, 0xe4, 0xfe, 0xef, + 0xf4, 0x60, 0x41, 0x74, 0x04, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x21, + 0xf5, 0x83, 0xe0, 0xb4, 0xff, 0x23, 0x74, 0x04, 0x2e, 0xf5, 0x82, + 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xef, 0xf0, 0x30, 0x0b, 0x0d, 0x74, + 0x08, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xe5, 0x14, + 0xf0, 0x90, 0x00, 0x02, 0x74, 0x01, 0xf0, 0x22, 0xbe, 0x03, 0x0a, + 0x90, 0x00, 0x02, 0x74, 0x01, 0xf0, 0xe4, 0xfe, 0x80, 0xc2, 0x0e, + 0x80, 0xbf, 0x22, 0x8e, 0x13, 0x8f, 0x14, 0x12, 0x1c, 0x41, 0xc3, + 0xef, 0x95, 0x14, 0xff, 0xee, 0x95, 0x13, 0xcd, 0xef, 0xcd, 0xfc, + 0xd3, 0xed, 0x94, 0x00, 0xec, 0x64, 0x80, 0x94, 0x80, 0x40, 0x05, + 0xce, 0xec, 0xce, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x01, 0xcc, 0xee, + 0xcc, 0xec, 0x90, 0x00, 0x05, 0xf0, 0x90, 0x00, 0x06, 0xef, 0xf0, + 0x90, 0x00, 0x04, 0x74, 0x51, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x44, + 0x02, 0xf0, 0x22, 0x30, 0x07, 0x3c, 0xe5, 0x2f, 0x70, 0x38, 0xc2, + 0x07, 0x90, 0x22, 0x2e, 0xe0, 0xfe, 0xa3, 0xe0, 0x8e, 0x11, 0xf5, + 0x12, 0x90, 0x22, 0x4e, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x90, 0x22, + 0x2e, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x90, 0x22, 0x4e, 0xe5, 0x11, + 0xf0, 0xa3, 0xe5, 0x12, 0xf0, 0x8e, 0x33, 0x8f, 0x34, 0x30, 0x08, + 0x05, 0x12, 0x17, 0xa5, 0xc2, 0x08, 0xc2, 0x09, 0x12, 0x0f, 0xee, + 0x22, 0x7f, 0x80, 0x7e, 0x29, 0xe4, 0xfd, 0xfc, 0x8f, 0x82, 0x8e, + 0x83, 0xe0, 0xfb, 0x74, 0x45, 0x2d, 0xf8, 0xc6, 0xeb, 0xc6, 0x74, + 0x04, 0x2f, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfb, 0x74, + 0x41, 0x2d, 0xf8, 0xc6, 0xeb, 0xc6, 0x74, 0x08, 0x2f, 0xff, 0xe4, + 0x3e, 0xfe, 0x0d, 0xbd, 0x00, 0x01, 0x0c, 0xed, 0x64, 0x04, 0x4c, + 0x70, 0xcf, 0x22, 0x90, 0x21, 0x00, 0xe0, 0xc4, 0x33, 0x54, 0xe0, + 0x24, 0x10, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xab, 0x82, 0xfa, 0x12, + 0x1b, 0xab, 0x8b, 0x82, 0x8a, 0x83, 0xee, 0x8f, 0xf0, 0x12, 0x07, + 0xeb, 0x7e, 0x22, 0x7f, 0x30, 0xcd, 0xeb, 0xcd, 0xcc, 0xea, 0xcc, + 0x12, 0x15, 0x0e, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x1c, 0x62, 0x22, 0x90, 0x00, 0x00, 0x74, 0x0e, 0xf0, 0x00, 0x00, + 0x00, 0xe4, 0xf0, 0x12, 0x11, 0x31, 0x12, 0x1c, 0x88, 0x90, 0x34, + 0x98, 0xe0, 0x44, 0x01, 0xf0, 0xe5, 0x30, 0xb4, 0x05, 0x0a, 0x12, + 0x1c, 0x4c, 0x50, 0x0d, 0x12, 0x15, 0xc0, 0x80, 0x08, 0xe5, 0x30, + 0xb4, 0x07, 0x03, 0x12, 0x12, 0xd4, 0x12, 0x0f, 0x2a, 0x80, 0xe4, + 0x80, 0xfe, 0x22, 0xe4, 0xff, 0xe5, 0x30, 0x24, 0xfe, 0x70, 0x2c, + 0xe4, 0xfe, 0xee, 0xc3, 0x95, 0x2c, 0x50, 0x12, 0x74, 0x01, 0xc8, + 0xee, 0xc8, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xcf, 0x4f, + 0xcf, 0x0e, 0x80, 0xe8, 0x90, 0x30, 0x34, 0xe0, 0x54, 0xe0, 0xfe, + 0xe5, 0x27, 0x54, 0x1f, 0x6f, 0xf4, 0xce, 0x4e, 0xce, 0xee, 0xf0, + 0x22, 0x90, 0x34, 0xce, 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x34, 0xcd, + 0xe0, 0x54, 0xfe, 0xf0, 0x90, 0x34, 0xcd, 0xe0, 0x20, 0xe3, 0xf9, + 0x90, 0x01, 0x11, 0xe0, 0x54, 0x22, 0xff, 0xbf, 0x22, 0x03, 0xd3, + 0x80, 0x01, 0xc3, 0x50, 0xf0, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, + 0xf0, 0x90, 0x01, 0x01, 0xe0, 0x54, 0xbf, 0xf0, 0x22, 0xef, 0x24, + 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xe0, 0xfc, 0xa3, 0xe0, + 0xfb, 0xca, 0xec, 0xca, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, + 0x83, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xef, 0x24, 0x1e, 0xf5, 0x82, + 0xe4, 0x3e, 0xf5, 0x83, 0xec, 0xf0, 0xa3, 0xed, 0xf0, 0xce, 0xea, + 0xce, 0xcf, 0xeb, 0xcf, 0x22, 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, + 0x3e, 0xf5, 0x83, 0xe0, 0xfa, 0xa3, 0xe0, 0xfb, 0xed, 0x24, 0x1e, + 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0xea, 0xf0, 0xa3, 0xeb, 0xf0, + 0xef, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x3e, 0xf5, 0x83, 0xec, 0xf0, + 0xa3, 0xed, 0xf0, 0x22, 0xc0, 0xe0, 0xc0, 0xd0, 0xc2, 0xaf, 0xc2, + 0x8e, 0xc2, 0x8f, 0xd3, 0xe5, 0x40, 0x94, 0x00, 0xe5, 0x3f, 0x94, + 0x00, 0x40, 0x0d, 0xe5, 0x40, 0x15, 0x40, 0x70, 0x02, 0x15, 0x3f, + 0x12, 0x1c, 0x6b, 0xd2, 0x8e, 0xd2, 0xaf, 0xd0, 0xd0, 0xd0, 0xe0, + 0x32, 0x12, 0x1a, 0xbf, 0x50, 0x22, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, + 0x1c, 0x7d, 0x82, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x14, 0xab, + 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xd2, + 0x09, 0x12, 0x0f, 0xee, 0xe4, 0xf5, 0x2f, 0x22, 0x8e, 0x13, 0x8f, + 0x14, 0x8d, 0x15, 0xeb, 0x60, 0x09, 0x14, 0x70, 0x1b, 0xaf, 0x15, + 0x12, 0x19, 0xfe, 0x22, 0x7e, 0x30, 0x7f, 0xe0, 0xac, 0x13, 0xad, + 0x14, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x14, 0xab, 0xaf, 0x15, + 0x12, 0x19, 0xfe, 0x22, 0x12, 0x17, 0x6c, 0x90, 0x21, 0x01, 0xe0, + 0xf5, 0x28, 0x74, 0x41, 0x25, 0x28, 0xf8, 0xe6, 0xf5, 0x32, 0x74, + 0x45, 0x25, 0x28, 0xf8, 0xe6, 0xf5, 0x22, 0x90, 0x21, 0x00, 0xe0, + 0x60, 0x03, 0xd2, 0x0d, 0x22, 0xc2, 0x0d, 0x22, 0xcd, 0xef, 0xcd, + 0x90, 0x01, 0x02, 0xe0, 0x30, 0xe7, 0x02, 0xc3, 0x22, 0x7e, 0x2a, + 0x7f, 0x00, 0x12, 0x04, 0x0e, 0x90, 0x01, 0x04, 0xe0, 0x44, 0x80, + 0xf0, 0x90, 0x01, 0x02, 0xe0, 0x44, 0x80, 0xf0, 0xd3, 0x22, 0x90, + 0x34, 0x30, 0xe4, 0xf0, 0xa3, 0xf0, 0xa3, 0x74, 0x1f, 0xf0, 0xa3, + 0xe4, 0xf0, 0x90, 0x01, 0x10, 0xe0, 0x20, 0xe1, 0x03, 0x00, 0x80, + 0xf6, 0x90, 0x01, 0x12, 0xe0, 0x20, 0xe1, 0x03, 0x00, 0x80, 0xf6, + 0x22, 0xe4, 0xff, 0x74, 0x36, 0x2f, 0xf8, 0xe6, 0x90, 0x30, 0x8c, + 0xf0, 0xef, 0x90, 0x1b, 0x51, 0x93, 0x90, 0x30, 0x8d, 0xf0, 0xa3, + 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x0f, 0xbf, 0x09, 0xe3, 0x22, + 0xe4, 0xff, 0xef, 0x90, 0x1b, 0x5b, 0x93, 0x90, 0x30, 0x8c, 0xf0, + 0xef, 0x90, 0x1b, 0x51, 0x93, 0x90, 0x30, 0x8d, 0xf0, 0xa3, 0x74, + 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x0f, 0xbf, 0x09, 0xe3, 0x22, 0xe4, + 0x90, 0x00, 0x05, 0xf0, 0xef, 0x60, 0x02, 0x80, 0x02, 0x7f, 0x01, + 0x90, 0x00, 0x06, 0xef, 0xf0, 0x90, 0x00, 0x04, 0x74, 0x51, 0xf0, + 0x90, 0x00, 0x0b, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0x90, 0x30, 0xf0, + 0xe0, 0xf5, 0x2a, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe4, 0x0e, 0x90, + 0x30, 0xf2, 0xe0, 0x60, 0x08, 0x90, 0x00, 0x0a, 0x74, 0x10, 0xf0, + 0xd3, 0x22, 0xc3, 0x22, 0x90, 0x30, 0xf0, 0xe0, 0xf5, 0x2a, 0x90, + 0x00, 0x0a, 0xe0, 0x30, 0xe4, 0x0e, 0x90, 0x30, 0xf2, 0xe0, 0x70, + 0x08, 0x90, 0x00, 0x0a, 0x74, 0x10, 0xf0, 0xd3, 0x22, 0xc3, 0x22, + 0x90, 0x34, 0xce, 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x34, 0xcd, 0xe0, + 0x54, 0xfe, 0xf0, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, + 0x01, 0x01, 0xe0, 0x54, 0xbf, 0xf0, 0x22, 0x90, 0x00, 0x01, 0x74, + 0x0e, 0xf0, 0x90, 0x34, 0x98, 0xe0, 0x54, 0xfb, 0xf0, 0x90, 0x34, + 0x58, 0x74, 0x01, 0xf0, 0x90, 0x30, 0x30, 0x74, 0x04, 0xf0, 0x22, + 0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x6c, 0x90, 0xc8, 0x00, 0x01, 0x02, 0x03, 0x0b, 0x0f, 0x0a, 0x0e, + 0x09, 0x0d, 0x08, 0x0c, 0xef, 0xc4, 0x33, 0x33, 0x54, 0xc0, 0xff, + 0x90, 0x01, 0x00, 0xe0, 0x54, 0x3f, 0x4f, 0xf0, 0x90, 0x01, 0x02, + 0xe0, 0x44, 0x80, 0xf0, 0x22, 0x90, 0x01, 0x03, 0xe0, 0x30, 0xe7, + 0x0c, 0x74, 0x80, 0xf0, 0x90, 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, + 0xd3, 0x22, 0xc3, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe1, 0x0c, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xf0, 0xd3, + 0x22, 0xc3, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe2, 0x0c, 0x74, + 0x04, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfb, 0xf0, 0xd3, 0x22, + 0xc3, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe6, 0x0c, 0x74, 0x40, + 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0xd3, 0x22, 0xc3, + 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe7, 0x0c, 0x74, 0x80, 0xf0, + 0x90, 0x00, 0x0b, 0xe0, 0x54, 0x7f, 0xf0, 0xd3, 0x22, 0xc3, 0x22, + 0x90, 0x01, 0x05, 0xe0, 0x30, 0xe5, 0x0c, 0x74, 0x20, 0xf0, 0x90, + 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0xd3, 0x22, 0xc3, 0x22, 0xe4, + 0xf5, 0x31, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, 0x90, 0x22, 0x2e, + 0x74, 0x21, 0xf0, 0xa3, 0x74, 0x10, 0xf0, 0x22, 0x52, 0x53, 0x54, + 0x12, 0x15, 0x16, 0x10, 0x11, 0x40, 0x00, 0x20, 0x00, 0x40, 0xff, + 0x3f, 0x3f, 0xbd, 0x28, 0x21, 0x00, 0xe5, 0x34, 0x24, 0x11, 0xf5, + 0x82, 0xe4, 0x35, 0x33, 0xf5, 0x83, 0xe0, 0x30, 0xe6, 0x02, 0xd3, + 0x22, 0xc3, 0x22, 0x90, 0x30, 0x40, 0x74, 0x32, 0xf0, 0xa3, 0x74, + 0xb0, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0xa3, 0xe4, 0xf0, 0x22, 0x75, + 0x31, 0x01, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, 0x90, 0x00, 0x0b, + 0xe0, 0x44, 0x20, 0xf0, 0x22, 0x0b, 0xd1, 0x13, 0x53, 0x15, 0x6b, + 0x11, 0xc6, 0x00, 0x09, 0x19, 0x03, 0x10, 0x95, 0x1b, 0xda, 0x90, + 0x30, 0x64, 0xe0, 0xfd, 0xa3, 0xe0, 0xfe, 0xed, 0x25, 0xe0, 0xff, + 0xee, 0x33, 0xfe, 0x22, 0x90, 0x30, 0x40, 0x74, 0x32, 0xf0, 0xa3, + 0x74, 0xb0, 0xf0, 0xa3, 0xe4, 0xf0, 0xa3, 0xf0, 0x22, 0x90, 0x01, + 0x00, 0xe0, 0x44, 0x08, 0xf0, 0x90, 0x01, 0x01, 0xe0, 0x44, 0x40, + 0xf0, 0x22, 0x12, 0x1a, 0xbf, 0x50, 0x08, 0xd2, 0x09, 0x12, 0x0f, + 0xee, 0xe4, 0xf5, 0x2f, 0x22, 0x90, 0x00, 0x0a, 0xe0, 0x30, 0xe0, + 0x05, 0x74, 0x01, 0xf0, 0xd3, 0x22, 0xc3, 0x22, 0x90, 0x00, 0x0a, + 0xe0, 0x30, 0xe5, 0x05, 0x74, 0x20, 0xf0, 0xd3, 0x22, 0xc3, 0x22, + 0x90, 0x34, 0x30, 0x74, 0x1f, 0xf0, 0xa3, 0xe4, 0xf0, 0xa3, 0xf0, + 0xa3, 0xf0, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, + 0x4c, 0x02, 0x17, 0xdc, 0xc2, 0xaf, 0xc2, 0x8c, 0xc2, 0x8d, 0x12, + 0x00, 0x0e, 0xd2, 0xaf, 0x22, 0xc2, 0x8e, 0x8e, 0x3f, 0x8f, 0x40, + 0x12, 0x1c, 0x6b, 0xd2, 0x8e, 0x22, 0x90, 0x30, 0x3c, 0xef, 0xf0, + 0xee, 0x44, 0x80, 0xa3, 0xf0, 0x22, 0x90, 0x30, 0x78, 0xe0, 0xfd, + 0xa3, 0xe0, 0xfe, 0xed, 0xff, 0x22, 0xe5, 0x4a, 0x45, 0x49, 0x70, + 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x22, 0xe5, 0x4c, 0x45, 0x4b, 0x70, + 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x22, 0xc2, 0x0b, 0xe4, 0xf5, 0x14, + 0x12, 0x16, 0xa2, 0x22, 0xc2, 0x8f, 0x75, 0x8d, 0xf5, 0x75, 0x8b, + 0x41, 0x22, 0x8e, 0x49, 0x8f, 0x4a, 0xd2, 0x8c, 0x22, 0x8e, 0x4b, + 0x8f, 0x4c, 0xd2, 0x8c, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc2, 0x0d, 0xe4, 0xf5, 0x2e, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xac, 0x30 +}; + +static const uint8_t rt2561s[] = { + 0x02, 0x1c, 0x2d, 0x02, 0x07, 0xdf, 0xc2, 0x8c, 0x22, 0x22, 0x00, + 0x02, 0x19, 0x43, 0xc2, 0xaf, 0xc2, 0x8d, 0x75, 0x8c, 0x94, 0x75, + 0x8a, 0x93, 0xd2, 0xaf, 0x22, 0x02, 0x1a, 0x9c, 0x12, 0x08, 0xdf, + 0x40, 0x03, 0x02, 0x02, 0x1e, 0x90, 0x21, 0x02, 0xe0, 0xf5, 0x2d, + 0x90, 0x00, 0x03, 0xe0, 0x12, 0x04, 0x3f, 0x00, 0xb0, 0x00, 0x00, + 0xce, 0x01, 0x00, 0x5e, 0x10, 0x00, 0x6f, 0x11, 0x00, 0xf2, 0x20, + 0x01, 0x4d, 0x21, 0x01, 0x70, 0x22, 0x01, 0x84, 0x30, 0x01, 0x8f, + 0x31, 0x01, 0xd5, 0x50, 0x01, 0x9f, 0x51, 0x01, 0xf2, 0x52, 0x02, + 0x06, 0x60, 0x00, 0x00, 0x02, 0x14, 0x90, 0x00, 0x0a, 0xe0, 0x20, + 0xe5, 0x03, 0x30, 0x07, 0x03, 0xd2, 0x08, 0x22, 0x12, 0x14, 0x2b, + 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x11, 0xe5, 0x11, 0xc4, 0x33, + 0x54, 0xe0, 0x24, 0x21, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, + 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x11, 0xc4, 0x33, 0x54, 0xe0, 0x24, + 0x2c, 0xf5, 0x82, 0xe4, 0x34, 0x21, 0xf5, 0x83, 0xe5, 0x11, 0xf0, + 0xc4, 0x33, 0x54, 0xe0, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x34, 0x21, + 0xf5, 0x83, 0xe5, 0x2d, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, + 0x12, 0x05, 0xcb, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x31, 0x60, 0x05, + 0x12, 0x1b, 0xe0, 0x80, 0x03, 0x12, 0x1b, 0xa6, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, 0x22, 0x75, 0x31, 0xff, + 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, 0x01, 0x01, 0xe0, + 0x54, 0xfe, 0xf0, 0x54, 0x3e, 0xf0, 0xe4, 0x90, 0x00, 0x0b, 0xf0, + 0xf0, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, 0x22, + 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, 0x12, 0x0a, 0xfb, 0x90, 0x34, + 0xcd, 0xe0, 0x20, 0xe3, 0xf9, 0x90, 0x21, 0x14, 0x12, 0x04, 0x1b, + 0x90, 0x34, 0xc0, 0x12, 0x04, 0x27, 0x90, 0x21, 0x18, 0x12, 0x04, + 0x1b, 0x90, 0x34, 0xc8, 0x12, 0x04, 0x27, 0x90, 0x21, 0x1c, 0x12, + 0x04, 0x1b, 0x90, 0x34, 0xc4, 0x12, 0x04, 0x27, 0x90, 0x34, 0xcc, + 0x74, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x04, 0xf0, 0x90, 0x01, 0x01, + 0xe0, 0x44, 0x01, 0xf0, 0x44, 0x40, 0xf0, 0x90, 0x00, 0x0b, 0xe0, + 0x44, 0x10, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x10, 0xe8, 0x22, 0x90, 0x01, 0x00, 0xe0, 0x54, 0xf7, 0xf0, 0x90, + 0x01, 0x01, 0xe0, 0x54, 0xfe, 0xf0, 0x54, 0xbf, 0xf0, 0x90, 0x00, + 0x0b, 0xe0, 0x54, 0xef, 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, + 0x2d, 0x12, 0x10, 0xe8, 0x22, 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, + 0x12, 0x0a, 0xfb, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x10, 0xe8, 0x22, 0xd2, 0x05, 0x85, 0x2d, 0x23, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0x22, 0x12, 0x13, 0xae, 0xc2, 0x00, 0xe4, 0x90, 0x21, + 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, 0x22, 0x85, 0x2d, 0x25, + 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfb, 0xff, 0xf0, 0xe4, 0x90, 0x00, + 0x07, 0xf0, 0x90, 0x00, 0x0a, 0x74, 0x04, 0xf0, 0xe4, 0x90, 0x00, + 0x08, 0xf0, 0x90, 0x21, 0x00, 0xe0, 0x90, 0x00, 0x09, 0xf0, 0x90, + 0x00, 0x07, 0x74, 0x71, 0xf0, 0xef, 0x44, 0x04, 0x90, 0x00, 0x0b, + 0xf0, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0x22, 0x90, 0x21, 0x00, 0xe0, + 0xff, 0x54, 0x1f, 0xf5, 0x30, 0xa3, 0xe0, 0xf5, 0x27, 0x8f, 0x26, + 0x12, 0x14, 0x62, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, + 0x10, 0xe8, 0x22, 0x90, 0x21, 0x00, 0xe0, 0xf5, 0x2c, 0x12, 0x17, + 0xa3, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, 0x12, 0x10, 0xe8, + 0x22, 0x12, 0x1a, 0xed, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x10, 0xe8, 0x22, 0xe4, 0x90, 0x21, 0x03, 0xf0, 0xaf, 0x2d, + 0x12, 0x10, 0xe8, 0x22, 0xe5, 0x31, 0x64, 0x01, 0x70, 0x41, 0x12, + 0x08, 0xed, 0x40, 0x03, 0x02, 0x03, 0x9d, 0x12, 0x0e, 0x34, 0x50, + 0x20, 0x7e, 0x2b, 0x7f, 0x80, 0x7d, 0x03, 0x12, 0x0a, 0xfb, 0x7f, + 0x01, 0x12, 0x0a, 0xd8, 0x40, 0x09, 0xd2, 0x09, 0x12, 0x0e, 0x47, + 0xe4, 0xf5, 0x2f, 0x22, 0x12, 0x09, 0x64, 0x75, 0x2f, 0x01, 0x22, + 0x7f, 0x01, 0x12, 0x0a, 0xd8, 0x50, 0x04, 0x75, 0x2f, 0x02, 0x22, + 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x22, 0x12, 0x08, + 0x90, 0x50, 0x51, 0x12, 0x0a, 0xac, 0x90, 0x30, 0xf4, 0xe0, 0xf5, + 0x2a, 0x7e, 0x30, 0x7f, 0xec, 0xa3, 0xe0, 0xfd, 0xe4, 0xfb, 0x12, + 0x0d, 0xa0, 0xe4, 0xff, 0xfe, 0x12, 0x0e, 0x29, 0x90, 0x00, 0x0a, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x44, 0x02, 0xff, 0xf0, + 0xfd, 0x90, 0x01, 0x05, 0x74, 0x20, 0xf0, 0x90, 0x01, 0x06, 0xe0, + 0x44, 0x20, 0xf0, 0xed, 0x54, 0xbf, 0x90, 0x00, 0x0b, 0xf0, 0x90, + 0x34, 0xcc, 0xe0, 0x44, 0x01, 0xf0, 0xa3, 0xe0, 0x44, 0x01, 0xf0, + 0xa3, 0xe0, 0x44, 0x01, 0xf0, 0xd2, 0x04, 0x12, 0x08, 0xad, 0x50, + 0x43, 0x12, 0x0a, 0xbb, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x30, 0x7d, + 0xec, 0x75, 0x1b, 0x11, 0x7b, 0x06, 0x12, 0x13, 0xc8, 0x90, 0x30, + 0xf5, 0xe0, 0x75, 0xf0, 0x20, 0xa4, 0xff, 0xae, 0xf0, 0x12, 0x0e, + 0x29, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xfd, 0xff, 0xf0, 0xfd, 0xe4, + 0x90, 0x00, 0x04, 0xf0, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, + 0x90, 0x00, 0x0a, 0x74, 0x40, 0xf0, 0x4d, 0x90, 0x00, 0x0b, 0xf0, + 0xc2, 0x04, 0x12, 0x09, 0x25, 0x50, 0x38, 0x12, 0x0a, 0xbb, 0x7e, + 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, + 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0a, 0xf0, 0xe4, 0xff, 0xfe, 0x12, 0x0e, 0x29, 0x90, 0x00, + 0x0b, 0xe0, 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0x90, + 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0xc2, 0x04, 0x12, 0x09, 0x4f, + 0x50, 0x25, 0x12, 0x0a, 0xbb, 0x7f, 0x02, 0x12, 0x0a, 0xd8, 0x90, + 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, + 0xfd, 0xff, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0xef, 0x54, 0xbf, + 0x90, 0x00, 0x0b, 0xf0, 0xc2, 0x04, 0x12, 0x08, 0xed, 0x50, 0x2d, + 0x12, 0x0a, 0xbb, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, + 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, + 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0x90, 0x01, 0x06, 0xe0, + 0x54, 0xdf, 0xf0, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0xc2, + 0x04, 0x22, 0xef, 0x8d, 0xf0, 0xa4, 0xa8, 0xf0, 0xcf, 0x8c, 0xf0, + 0xa4, 0x28, 0xce, 0x8d, 0xf0, 0xa4, 0x2e, 0xfe, 0x22, 0xbc, 0x00, + 0x0b, 0xbe, 0x00, 0x29, 0xef, 0x8d, 0xf0, 0x84, 0xff, 0xad, 0xf0, + 0x22, 0xe4, 0xcc, 0xf8, 0x75, 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xee, + 0x33, 0xfe, 0xec, 0x33, 0xfc, 0xee, 0x9d, 0xec, 0x98, 0x40, 0x05, + 0xfc, 0xee, 0x9d, 0xfe, 0x0f, 0xd5, 0xf0, 0xe9, 0xe4, 0xce, 0xfd, + 0x22, 0xed, 0xf8, 0xf5, 0xf0, 0xee, 0x84, 0x20, 0xd2, 0x1c, 0xfe, + 0xad, 0xf0, 0x75, 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xed, 0x33, 0xfd, + 0x40, 0x07, 0x98, 0x50, 0x06, 0xd5, 0xf0, 0xf2, 0x22, 0xc3, 0x98, + 0xfd, 0x0f, 0xd5, 0xf0, 0xea, 0x22, 0xc5, 0xf0, 0xf8, 0xa3, 0xe0, + 0x28, 0xf0, 0xc5, 0xf0, 0xf8, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02, + 0x15, 0x83, 0xe0, 0x38, 0xf0, 0x22, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, + 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x22, 0xec, 0xf0, 0xa3, 0xed, + 0xf0, 0xa3, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x22, 0xa4, 0x25, 0x82, + 0xf5, 0x82, 0xe5, 0xf0, 0x35, 0x83, 0xf5, 0x83, 0x22, 0xd0, 0x83, + 0xd0, 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, + 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, + 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, + 0xa3, 0x80, 0xdf, 0x8a, 0x83, 0x89, 0x82, 0xe4, 0x73, 0xe5, 0x2e, + 0x14, 0x60, 0x1d, 0x14, 0x60, 0x3d, 0x14, 0x60, 0x5d, 0x14, 0x70, + 0x03, 0x02, 0x05, 0x18, 0x24, 0x04, 0x60, 0x03, 0x02, 0x05, 0x2e, + 0x20, 0x0d, 0x03, 0x02, 0x05, 0x2e, 0x75, 0x2e, 0x01, 0x22, 0x90, + 0x00, 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x03, 0x44, 0x20, 0xf0, 0xe5, + 0x40, 0x45, 0x3f, 0x60, 0x03, 0x02, 0x05, 0x2e, 0x75, 0x2e, 0x02, + 0x12, 0x1b, 0x12, 0x12, 0x1b, 0xce, 0xaf, 0x28, 0x12, 0x1b, 0x8f, + 0x22, 0x90, 0x01, 0x03, 0xe0, 0xff, 0x30, 0xe7, 0x76, 0xef, 0x44, + 0x80, 0x90, 0x01, 0x03, 0xf0, 0x12, 0x08, 0x55, 0x12, 0x1b, 0x55, + 0x12, 0x1c, 0x01, 0x75, 0x2e, 0x03, 0xaf, 0x22, 0x7e, 0x00, 0x12, + 0x1c, 0x45, 0x22, 0xe5, 0x40, 0x45, 0x3f, 0x70, 0x21, 0x12, 0x17, + 0xd8, 0x12, 0x1b, 0xce, 0x12, 0x1b, 0x35, 0x12, 0x1c, 0x01, 0x12, + 0x1c, 0x1f, 0x30, 0x0d, 0x0b, 0x75, 0x2e, 0x01, 0xaf, 0x32, 0x7e, + 0x00, 0x12, 0x1c, 0x45, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x90, 0x00, + 0x0a, 0xe0, 0xff, 0x30, 0xe5, 0x2c, 0x44, 0x20, 0xf0, 0x12, 0x17, + 0xd8, 0x12, 0x1b, 0xce, 0x12, 0x1b, 0x35, 0x12, 0x1c, 0x01, 0x12, + 0x1c, 0x1f, 0x75, 0x2e, 0x04, 0x22, 0xe5, 0x40, 0x45, 0x3f, 0x70, + 0x10, 0x30, 0x0d, 0x0a, 0x75, 0x2e, 0x01, 0xaf, 0x32, 0xfe, 0x12, + 0x1c, 0x45, 0x22, 0xe4, 0xf5, 0x2e, 0x22, 0x12, 0x09, 0x25, 0x40, + 0x05, 0x12, 0x08, 0xed, 0x50, 0x44, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, + 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x13, 0xc8, + 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, + 0xff, 0xfe, 0x12, 0x0e, 0x29, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, + 0xf0, 0x54, 0x7f, 0xff, 0xf0, 0xe4, 0x90, 0x30, 0xe9, 0xf0, 0xef, + 0x54, 0xfd, 0x90, 0x00, 0x0b, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, + 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x12, 0x09, 0x3a, + 0x50, 0x48, 0x7e, 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, + 0x1b, 0x12, 0x7b, 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, + 0x02, 0xf0, 0x90, 0x00, 0x0a, 0xf0, 0xe4, 0xff, 0xfe, 0x12, 0x0e, + 0x29, 0x90, 0x00, 0x0b, 0xe0, 0x54, 0xbf, 0xf0, 0x54, 0xfd, 0xf0, + 0xe4, 0x90, 0x00, 0x04, 0xf0, 0xff, 0x12, 0x0a, 0xd8, 0x50, 0x04, + 0x75, 0x2f, 0x07, 0x22, 0x90, 0x01, 0x04, 0xe0, 0x54, 0x7f, 0xf0, + 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x22, 0xc2, 0xaf, + 0xe4, 0xf5, 0x2f, 0xf5, 0x88, 0x75, 0xa8, 0x0f, 0x75, 0x89, 0x11, + 0xf5, 0xb8, 0xf5, 0xe8, 0x75, 0x90, 0x0f, 0x75, 0x31, 0xff, 0x75, + 0x2b, 0xff, 0x90, 0x22, 0x2e, 0xf0, 0xa3, 0xf0, 0x90, 0x22, 0x4e, + 0xf0, 0xa3, 0xf0, 0xc2, 0x05, 0xc2, 0x08, 0xc2, 0x00, 0xc2, 0x07, + 0xc2, 0x04, 0x90, 0x00, 0x0a, 0x74, 0xff, 0xf0, 0x90, 0x00, 0x0b, + 0x74, 0x01, 0xf0, 0x90, 0x01, 0x03, 0x74, 0xff, 0xf0, 0xe4, 0x90, + 0x01, 0x04, 0xf0, 0x90, 0x01, 0x05, 0x74, 0xff, 0xf0, 0xe4, 0x90, + 0x01, 0x06, 0xf0, 0x90, 0x00, 0x04, 0xf0, 0x90, 0x30, 0xe8, 0x74, + 0x10, 0xf0, 0x90, 0x01, 0x07, 0xf0, 0x90, 0x01, 0x08, 0x04, 0xf0, + 0x90, 0x01, 0x09, 0x74, 0x48, 0xf0, 0x90, 0x01, 0x0a, 0x74, 0x7f, + 0xf0, 0x90, 0x01, 0x02, 0x74, 0x1f, 0xf0, 0x90, 0x01, 0x00, 0x74, + 0x14, 0xf0, 0x90, 0x01, 0x01, 0x74, 0x20, 0xf0, 0x90, 0x00, 0x00, + 0xe0, 0x44, 0x80, 0xf0, 0x75, 0x49, 0x00, 0x75, 0x4a, 0x01, 0xc2, + 0x01, 0xd2, 0xaf, 0x22, 0x12, 0x08, 0xed, 0x50, 0x2d, 0x12, 0x0a, + 0x78, 0x90, 0x01, 0x06, 0xe0, 0x54, 0xdf, 0xf0, 0x7e, 0x30, 0x7f, + 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, 0x06, 0x12, + 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, 0x00, 0x0a, + 0xf0, 0xd2, 0x09, 0x12, 0x0e, 0x47, 0xe4, 0xf5, 0x2f, 0x22, 0x12, + 0x09, 0x4f, 0x50, 0x50, 0x12, 0x0a, 0x78, 0x90, 0x00, 0x0b, 0xe0, + 0x54, 0xfd, 0xf0, 0xe4, 0x90, 0x00, 0x04, 0xf0, 0x90, 0x01, 0x03, + 0x74, 0x80, 0xf0, 0x90, 0x01, 0x04, 0xe0, 0x44, 0x80, 0xf0, 0x7f, + 0x02, 0x12, 0x0a, 0xd8, 0x50, 0x04, 0x75, 0x2f, 0x05, 0x22, 0x7e, + 0x30, 0x7f, 0xe0, 0x7c, 0x1c, 0x7d, 0x7e, 0x75, 0x1b, 0x12, 0x7b, + 0x06, 0x12, 0x13, 0xc8, 0x90, 0x00, 0x04, 0x74, 0x02, 0xf0, 0x90, + 0x00, 0x0a, 0xf0, 0xd2, 0x09, 0x12, 0x0e, 0x47, 0x90, 0x01, 0x04, + 0xe0, 0x54, 0x7f, 0xf0, 0xe4, 0xf5, 0x2f, 0x22, 0x90, 0x30, 0x3a, + 0xe0, 0xf5, 0x10, 0x12, 0x1c, 0x5c, 0x50, 0x26, 0xe5, 0x27, 0x30, + 0xe6, 0x05, 0x53, 0x10, 0xfd, 0x80, 0x03, 0x43, 0x10, 0x02, 0xe5, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 25 16:40:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4F6310657C6; Fri, 25 May 2012 16:40:31 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E1498FC0C; Fri, 25 May 2012 16:40: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 q4PGeVfH021344; Fri, 25 May 2012 16:40:31 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PGeVPK021342; Fri, 25 May 2012 16:40:31 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205251640.q4PGeVPK021342@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 25 May 2012 16:40:31 +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: r236008 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:40:31 -0000 Author: bschmidt Date: Fri May 25 16:40:31 2012 New Revision: 236008 URL: http://svn.freebsd.org/changeset/base/236008 Log: MFC r235235-235237: Update man page due to import of RT2800/RT3000 support. Modified: stable/8/share/man/man4/ral.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ral.4 ============================================================================== --- stable/8/share/man/man4/ral.4 Fri May 25 16:39:56 2012 (r236007) +++ stable/8/share/man/man4/ral.4 Fri May 25 16:40:31 2012 (r236008) @@ -1,5 +1,4 @@ -.\" Copyright (c) 2005, 2006 -.\" Damien Bergamini +.\" Copyright (c) 2005-2010 Damien Bergamini .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -15,12 +14,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2009 +.Dd May 10, 2012 .Dt RAL 4 .Os .Sh NAME .Nm ral -.Nd "Ralink Technology IEEE 802.11 wireless network driver" +.Nd "Ralink Technology IEEE 802.11a/g/n wireless network device" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -42,31 +41,43 @@ if_ral_load="YES" .Sh DESCRIPTION The .Nm -driver supports PCI/CardBus wireless adapters based on the Ralink Technology -RT2500, RT2501, and RT2600 chipsets. +driver supports PCI/PCIe/CardBus wireless adapters based on the Ralink RT2500, +RT2501, RT2600, RT2700, RT2800 and RT3090 chipsets. .Pp The RT2500 chipset is the first generation of 802.11b/g adapters from Ralink. -It consists of two integrated chips, a RT2560 MAC/BBP and a RT2525 radio +It consists of two integrated chips, an RT2560 MAC/BBP and an RT2525 radio transceiver. .Pp -The RT2501 chipset is the second generation of 802.11b/g adapters from Ralink. -It consists of two integrated chips, a RT2561 MAC/BBP and a RT2527 radio +The RT2501 chipset is the second generation of 802.11a/b/g adapters from +Ralink. +It consists of two integrated chips, an RT2561 MAC/BBP and an RT2527 radio transceiver. This chipset provides support for the IEEE 802.11e standard with multiple hardware transmission queues and allows scatter/gather for efficient DMA operations. .Pp -The RT2600 chipset consists of two integrated chips, a RT2661 MAC/BBP and a +The RT2600 chipset consists of two integrated chips, an RT2661 MAC/BBP and an RT2529 radio transceiver. This chipset uses the MIMO (multiple-input multiple-output) technology with -multiple antennas to extend the operating range of the adapter and to achieve -higher throughput. -MIMO is the basis of the forthcoming IEEE 802.11n standard. -.Pp -The transmit speed is user-selectable or can be adapted automatically by the -driver depending on the received signal strength and on the number of hardware -transmission retries. +multiple radio transceivers to extend the operating range of the adapter and +to achieve higher throughput. +However, the RT2600 chipset does not support any of the 802.11n features. +.Pp +The RT2700 chipset is a low-cost version of the RT2800 chipset. +It supports a single transmit path and two receiver paths (1T2R). +It consists of two integrated chips, an RT2760 or RT2790 (PCIe) MAC/BBP and +an RT2720 (2.4GHz) or RT2750 (2.4GHz/5GHz) radio transceiver. +.Pp +The RT2800 chipset is the first generation of 802.11n adapters from Ralink. +It consists of two integrated chips, an RT2860 or RT2890 (PCIe) MAC/BBP and +an RT2820 (2.4GHz) or RT2850 (2.4GHz/5GHz) radio transceiver. +The RT2800 chipset supports two transmit paths and up to three receiver +paths (2T2R/2T3R). +It can achieve speeds up to 144Mbps (20MHz bandwidth) and 300Mbps (40MHz +bandwidth.) .Pp +The RT3090 chipset is the first generation of single-chip 802.11n adapters +from Ralink. .Nm supports .Cm station , @@ -92,13 +103,16 @@ Multiple interfaces may be operated together with a .Cm hostap interface to construct a wireless repeater device. +.Pp +The transmit speed is user-selectable or can be adapted automatically by the +driver depending on the number of hardware transmission retries. For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm -driver supports PCI/CardBus wireless adapters based on the Ralink Technology -RT2500, RT2501, and RT2600 chipsets, including: +driver supports PCI/PCIe/CardBus wireless adapters based on Ralink Technology +chipsets, including: .Pp .Bl -column -compact ".Li Atlantis Land A02-PCM-W54" "RT2561S" "CardBus" .It Em Card Ta Em MAC/BBP Ta Em Bus @@ -188,9 +202,6 @@ RT2500, RT2501, and RT2600 chipsets, inc .It "Zonet ZEW1500" Ta RT2560 Ta CardBus .It "Zonet ZEW1600" Ta RT2560 Ta PCI .El -.Pp -An up to date list can be found at -.Pa http://damien.bergamini.free.fr/ral/list.html . .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): .Pp @@ -239,7 +250,7 @@ This should not happen. .Xr wlan_xauth 4 , .Xr hostapd 8 , .Xr ifconfig 8 , -.Xr wpa_supplicant 8 . +.Xr wpa_supplicant 8 .Rs .%T "Ralink Technology" .%U http://www.ralinktech.com/ @@ -249,12 +260,37 @@ The .Nm driver first appeared in .Ox 3.7 . +Support for the RT2501 and RT2600 chipsets was added in +.Ox 3.9 . +Support for the RT2800 chipset was added in +.Ox 4.3 . +Support for the RT2700 chipset was added in +.Ox 4.4 . +Support for the RT3090 chipset was added in +.Ox 4.9 . .Sh AUTHORS The original .Nm driver was written by -.An Damien Bergamini Aq damien@FreeBSD.org . -.Sh BUGS -Host AP mode doesn't support client power save. -Clients using power save mode will experience +.An Damien Bergamini Aq damien@openbsd.org . +.Sh CAVEATS +The +.Nm +driver does not make use of the hardware cryptographic engine. +.Pp +The +.Nm +driver does not support any of the 802.11n capabilities offered by +the RT2700 and RT2800 chipsets. +Additional work is required in before those features can be supported. +.Pp +Host AP mode doesn't support power saving. +Clients attempting to use power saving mode may experience significant packet loss (disabling power saving on the client will fix this). +.Pp +Some PCI +.Nm +adapters seem to strictly require a system supporting PCI 2.2 or greater and +will likely not work in systems based on older revisions of the PCI +specification. +Check the board's PCI version before purchasing the card. From owner-svn-src-all@FreeBSD.ORG Fri May 25 16:45:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C1EF1065674; Fri, 25 May 2012 16:45:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 770F98FC0C; Fri, 25 May 2012 16:45: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 q4PGjvd7021689; Fri, 25 May 2012 16:45:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PGjvYQ021687; Fri, 25 May 2012 16:45:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205251645.q4PGjvYQ021687@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 May 2012 16:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236009 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:45:57 -0000 Author: adrian Date: Fri May 25 16:45:56 2012 New Revision: 236009 URL: http://svn.freebsd.org/changeset/base/236009 Log: * According to the reference code, AR_WA_D3_L1_DISBABLE is bit 14. * Add some other WAR bits (very usefully described too) in preparation for porting over some suspend/resume fixes from ath9k/Atheros. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Fri May 25 16:40:31 2012 (r236008) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Fri May 25 16:45:56 2012 (r236009) @@ -253,11 +253,15 @@ #define AR_MAC_LED_ASSOC_PEND 0x2 /* STA is trying to associate */ #define AR_MAC_LED_ASSOC_S 10 +#define AR_WA_BIT6 0x00000040 +#define AR_WA_BIT7 0x00000080 +#define AR_WA_D3_L1_DISABLE 0x00004000 /* */ #define AR_WA_UNTIE_RESET_EN 0x00008000 /* ena PCI reset to POR */ #define AR_WA_RESET_EN 0x00040000 /* ena AR_WA_UNTIE_RESET_EN */ #define AR_WA_ANALOG_SHIFT 0x00100000 #define AR_WA_POR_SHORT 0x00200000 /* PCIE phy reset control */ -#define AR_WA_D3_L1_DISABLE 0x00800000 /* bit 23 */ +#define AR_WA_BIT22 0x00400000 +#define AR_WA_BIT23 0x00800000 #define AR_WA_DEFAULT 0x0000073f #define AR9280_WA_DEFAULT 0x0040073b /* disable bit 2, see commit */ From owner-svn-src-all@FreeBSD.ORG Fri May 25 16:52:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B38C1065686; Fri, 25 May 2012 16:52:01 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05AEA8FC0C; Fri, 25 May 2012 16:52:01 +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 q4PGq0sk021990; Fri, 25 May 2012 16:52:00 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PGq0AW021987; Fri, 25 May 2012 16:52:00 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205251652.q4PGq0AW021987@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 25 May 2012 16:52:00 +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: r236010 - stable/8/sys/dev/ral X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:52:01 -0000 Author: bschmidt Date: Fri May 25 16:52:00 2012 New Revision: 236010 URL: http://svn.freebsd.org/changeset/base/236010 Log: MFC r220502: Don't hardcode assumptions about basic rates, similar to what the rt2661 support code does. While here remove an unnecessary loop. Modified: stable/8/sys/dev/ral/rt2560.c stable/8/sys/dev/ral/rt2661.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/ral/rt2560.c ============================================================================== --- stable/8/sys/dev/ral/rt2560.c Fri May 25 16:45:56 2012 (r236009) +++ stable/8/sys/dev/ral/rt2560.c Fri May 25 16:52:00 2012 (r236010) @@ -144,7 +144,8 @@ static void rt2560_enable_tsf_sync(stru static void rt2560_enable_tsf(struct rt2560_softc *); static void rt2560_update_plcp(struct rt2560_softc *); static void rt2560_update_slot(struct ifnet *); -static void rt2560_set_basicrates(struct rt2560_softc *); +static void rt2560_set_basicrates(struct rt2560_softc *, + const struct ieee80211_rateset *); static void rt2560_update_led(struct rt2560_softc *, int, int); static void rt2560_set_bssid(struct rt2560_softc *, const uint8_t *); static void rt2560_set_macaddr(struct rt2560_softc *, uint8_t *); @@ -779,7 +780,7 @@ rt2560_newstate(struct ieee80211vap *vap if (vap->iv_opmode != IEEE80211_M_MONITOR) { rt2560_update_plcp(sc); - rt2560_set_basicrates(sc); + rt2560_set_basicrates(sc, &ni->ni_rates); rt2560_set_bssid(sc, ni->ni_bssid); } @@ -2353,22 +2354,29 @@ rt2560_update_slot(struct ifnet *ifp) } static void -rt2560_set_basicrates(struct rt2560_softc *sc) +rt2560_set_basicrates(struct rt2560_softc *sc, + const struct ieee80211_rateset *rs) { +#define RV(r) ((r) & IEEE80211_RATE_VAL) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + uint32_t mask = 0; + uint8_t rate; + int i; - /* update basic rate set */ - if (ic->ic_curmode == IEEE80211_MODE_11B) { - /* 11b basic rates: 1, 2Mbps */ - RAL_WRITE(sc, RT2560_ARSP_PLCP_1, 0x3); - } else if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) { - /* 11a basic rates: 6, 12, 24Mbps */ - RAL_WRITE(sc, RT2560_ARSP_PLCP_1, 0x150); - } else { - /* 11g basic rates: 1, 2, 5.5, 11, 6, 12, 24Mbps */ - RAL_WRITE(sc, RT2560_ARSP_PLCP_1, 0x15f); + for (i = 0; i < rs->rs_nrates; i++) { + rate = rs->rs_rates[i]; + + if (!(rate & IEEE80211_RATE_BASIC)) + continue; + + mask |= 1 << ic->ic_rt->rateCodeToIndex[RV(rate)]; } + + RAL_WRITE(sc, RT2560_ARSP_PLCP_1, mask); + + DPRINTF(sc, "Setting basic rate mask to 0x%x\n", mask); +#undef RV } static void Modified: stable/8/sys/dev/ral/rt2661.c ============================================================================== --- stable/8/sys/dev/ral/rt2661.c Fri May 25 16:45:56 2012 (r236009) +++ stable/8/sys/dev/ral/rt2661.c Fri May 25 16:52:00 2012 (r236010) @@ -1915,7 +1915,7 @@ rt2661_set_basicrates(struct rt2661_soft struct ieee80211com *ic = ifp->if_l2com; uint32_t mask = 0; uint8_t rate; - int i, j; + int i; for (i = 0; i < rs->rs_nrates; i++) { rate = rs->rs_rates[i]; @@ -1923,13 +1923,7 @@ rt2661_set_basicrates(struct rt2661_soft if (!(rate & IEEE80211_RATE_BASIC)) continue; - /* - * Find h/w rate index. We know it exists because the rate - * set has already been negotiated. - */ - for (j = 0; ic->ic_sup_rates[IEEE80211_MODE_11G].rs_rates[j] != RV(rate); j++); - - mask |= 1 << j; + mask |= 1 << ic->ic_rt->rateCodeToIndex[RV(rate)]; } RAL_WRITE(sc, RT2661_TXRX_CSR5, mask); From owner-svn-src-all@FreeBSD.ORG Fri May 25 17:06:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D01941065692; Fri, 25 May 2012 17:06:44 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 7DFD98FC0A; Fri, 25 May 2012 17:06:44 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 72C20C3845; Fri, 25 May 2012 19:06:33 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id 4yCUp36jnfsv; Fri, 25 May 2012 19:06:32 +0200 (CEST) Received: from [10.0.0.112] (nat3-133.ghnet.pl [91.150.222.133]) by smtp.semihalf.com (Postfix) with ESMTPSA id CCBEAC3833; Fri, 25 May 2012 19:06:32 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <4FBFA517.8080601@freebsd.org> Date: Fri, 25 May 2012 19:06:42 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205251513.q4PFDtrU017459@svn.freebsd.org> <4FBFA517.8080601@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236000 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:06:44 -0000 On 2012-05-25, at 17:28, Nathan Whitehorn wrote: > On 05/25/12 10:13, Rafal Jaworowski wrote: >> Author: raj >> Date: Fri May 25 15:13:55 2012 >> New Revision: 236000 >> URL: http://svn.freebsd.org/changeset/base/236000 >>=20 >> Log: >> Missing vm_paddr_t bits which should have been part of r235936. >=20 > I think you also need equivalent changes to aim/mmu_oea64.c. Yes, but the GENERIC64 build appears currently broken, so I could not = compile test it. Rafal From owner-svn-src-all@FreeBSD.ORG Fri May 25 17:14:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 141181065676; Fri, 25 May 2012 17:14:49 +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 EAEBE8FC25; Fri, 25 May 2012 17:14:48 +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 q4PHEmvP023129; Fri, 25 May 2012 17:14:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PHEmgO023068; Fri, 25 May 2012 17:14:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251714.q4PHEmgO023068@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 17:14:48 +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: r236011 - in stable/9/contrib/compiler-rt: . lib lib/arm lib/ppc lib/x86_64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:14:49 -0000 Author: marius Date: Fri May 25 17:14:47 2012 New Revision: 236011 URL: http://svn.freebsd.org/changeset/base/236011 Log: MFC: r222656 Upgrade libcompiler_rt from revision 117047 to 132478. It seems there have only been a small amount to the compiler-rt source code in the mean time. I'd rather have the code in sync as much as possible by the time we release 9.0. Changes: - The libcompiler_rt library is now dual licensed under both the University of Illinois "BSD-Like" license and the MIT license. - Our local modifications for using .hidden instead of .private_extern have been upstreamed, meaning our changes to lib/assembly.h can now be reverted. - A possible endless recursion in __modsi3() has been fixed. - Support for ARM EABI has been added, but it has no effect on FreeBSD (yet). - The functions __udivmodsi4 and __divmodsi4 have been added. Requested by: many, including bf@ and Pedro Giffuni Added: stable/9/contrib/compiler-rt/lib/int_endianness.h - copied unchanged from r229135, head/contrib/compiler-rt/lib/int_endianness.h stable/9/contrib/compiler-rt/lib/int_math.h - copied unchanged from r229135, head/contrib/compiler-rt/lib/int_math.h stable/9/contrib/compiler-rt/lib/int_types.h - copied unchanged from r229135, head/contrib/compiler-rt/lib/int_types.h stable/9/contrib/compiler-rt/lib/int_util.c - copied unchanged from r229135, head/contrib/compiler-rt/lib/int_util.c stable/9/contrib/compiler-rt/lib/int_util.h - copied unchanged from r229135, head/contrib/compiler-rt/lib/int_util.h stable/9/contrib/compiler-rt/lib/mulodi4.c - copied unchanged from r229135, head/contrib/compiler-rt/lib/mulodi4.c stable/9/contrib/compiler-rt/lib/mulosi4.c - copied unchanged from r229135, head/contrib/compiler-rt/lib/mulosi4.c stable/9/contrib/compiler-rt/lib/muloti4.c - copied unchanged from r229135, head/contrib/compiler-rt/lib/muloti4.c Deleted: stable/9/contrib/compiler-rt/lib/abi.h stable/9/contrib/compiler-rt/lib/apple_versioning.c stable/9/contrib/compiler-rt/lib/endianness.h Modified: stable/9/contrib/compiler-rt/LICENSE.TXT stable/9/contrib/compiler-rt/README.txt stable/9/contrib/compiler-rt/lib/absvdi2.c stable/9/contrib/compiler-rt/lib/absvsi2.c stable/9/contrib/compiler-rt/lib/absvti2.c stable/9/contrib/compiler-rt/lib/adddf3.c stable/9/contrib/compiler-rt/lib/addsf3.c stable/9/contrib/compiler-rt/lib/addvdi3.c stable/9/contrib/compiler-rt/lib/addvsi3.c stable/9/contrib/compiler-rt/lib/addvti3.c stable/9/contrib/compiler-rt/lib/arm/adddf3vfp.S stable/9/contrib/compiler-rt/lib/arm/addsf3vfp.S stable/9/contrib/compiler-rt/lib/arm/divdf3vfp.S stable/9/contrib/compiler-rt/lib/arm/divsf3vfp.S stable/9/contrib/compiler-rt/lib/arm/eqdf2vfp.S stable/9/contrib/compiler-rt/lib/arm/eqsf2vfp.S stable/9/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S stable/9/contrib/compiler-rt/lib/arm/fixdfsivfp.S stable/9/contrib/compiler-rt/lib/arm/fixsfsivfp.S stable/9/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S stable/9/contrib/compiler-rt/lib/arm/fixunssfsivfp.S stable/9/contrib/compiler-rt/lib/arm/floatsidfvfp.S stable/9/contrib/compiler-rt/lib/arm/floatsisfvfp.S stable/9/contrib/compiler-rt/lib/arm/floatunssidfvfp.S stable/9/contrib/compiler-rt/lib/arm/floatunssisfvfp.S stable/9/contrib/compiler-rt/lib/arm/gedf2vfp.S stable/9/contrib/compiler-rt/lib/arm/gesf2vfp.S stable/9/contrib/compiler-rt/lib/arm/gtdf2vfp.S stable/9/contrib/compiler-rt/lib/arm/gtsf2vfp.S stable/9/contrib/compiler-rt/lib/arm/ledf2vfp.S stable/9/contrib/compiler-rt/lib/arm/lesf2vfp.S stable/9/contrib/compiler-rt/lib/arm/ltdf2vfp.S stable/9/contrib/compiler-rt/lib/arm/ltsf2vfp.S stable/9/contrib/compiler-rt/lib/arm/muldf3vfp.S stable/9/contrib/compiler-rt/lib/arm/mulsf3vfp.S stable/9/contrib/compiler-rt/lib/arm/nedf2vfp.S stable/9/contrib/compiler-rt/lib/arm/negdf2vfp.S stable/9/contrib/compiler-rt/lib/arm/negsf2vfp.S stable/9/contrib/compiler-rt/lib/arm/nesf2vfp.S stable/9/contrib/compiler-rt/lib/arm/subdf3vfp.S stable/9/contrib/compiler-rt/lib/arm/subsf3vfp.S stable/9/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S stable/9/contrib/compiler-rt/lib/arm/unorddf2vfp.S stable/9/contrib/compiler-rt/lib/arm/unordsf2vfp.S stable/9/contrib/compiler-rt/lib/ashldi3.c stable/9/contrib/compiler-rt/lib/ashrdi3.c stable/9/contrib/compiler-rt/lib/assembly.h stable/9/contrib/compiler-rt/lib/clear_cache.c stable/9/contrib/compiler-rt/lib/clzdi2.c stable/9/contrib/compiler-rt/lib/clzsi2.c stable/9/contrib/compiler-rt/lib/cmpdi2.c stable/9/contrib/compiler-rt/lib/ctzdi2.c stable/9/contrib/compiler-rt/lib/ctzsi2.c stable/9/contrib/compiler-rt/lib/divdc3.c stable/9/contrib/compiler-rt/lib/divdf3.c stable/9/contrib/compiler-rt/lib/divdi3.c stable/9/contrib/compiler-rt/lib/divmoddi4.c stable/9/contrib/compiler-rt/lib/divmodsi4.c stable/9/contrib/compiler-rt/lib/divsc3.c stable/9/contrib/compiler-rt/lib/divsf3.c stable/9/contrib/compiler-rt/lib/divsi3.c stable/9/contrib/compiler-rt/lib/divxc3.c stable/9/contrib/compiler-rt/lib/enable_execute_stack.c stable/9/contrib/compiler-rt/lib/eprintf.c stable/9/contrib/compiler-rt/lib/extendsfdf2.c stable/9/contrib/compiler-rt/lib/ffsdi2.c stable/9/contrib/compiler-rt/lib/fixdfdi.c stable/9/contrib/compiler-rt/lib/fixdfsi.c stable/9/contrib/compiler-rt/lib/fixsfdi.c stable/9/contrib/compiler-rt/lib/fixsfsi.c stable/9/contrib/compiler-rt/lib/fixunsdfdi.c stable/9/contrib/compiler-rt/lib/fixunsdfsi.c stable/9/contrib/compiler-rt/lib/fixunssfdi.c stable/9/contrib/compiler-rt/lib/fixunssfsi.c stable/9/contrib/compiler-rt/lib/floatdidf.c stable/9/contrib/compiler-rt/lib/floatdisf.c stable/9/contrib/compiler-rt/lib/floatsidf.c stable/9/contrib/compiler-rt/lib/floatsisf.c stable/9/contrib/compiler-rt/lib/floattidf.c stable/9/contrib/compiler-rt/lib/floattisf.c stable/9/contrib/compiler-rt/lib/floattixf.c stable/9/contrib/compiler-rt/lib/floatundidf.c stable/9/contrib/compiler-rt/lib/floatundisf.c stable/9/contrib/compiler-rt/lib/floatunsidf.c stable/9/contrib/compiler-rt/lib/floatunsisf.c stable/9/contrib/compiler-rt/lib/floatuntidf.c stable/9/contrib/compiler-rt/lib/floatuntisf.c stable/9/contrib/compiler-rt/lib/floatuntixf.c stable/9/contrib/compiler-rt/lib/fp_lib.h stable/9/contrib/compiler-rt/lib/gcc_personality_v0.c stable/9/contrib/compiler-rt/lib/int_lib.h stable/9/contrib/compiler-rt/lib/lshrdi3.c stable/9/contrib/compiler-rt/lib/moddi3.c stable/9/contrib/compiler-rt/lib/modsi3.c stable/9/contrib/compiler-rt/lib/muldc3.c stable/9/contrib/compiler-rt/lib/muldf3.c stable/9/contrib/compiler-rt/lib/muldi3.c stable/9/contrib/compiler-rt/lib/mulsc3.c stable/9/contrib/compiler-rt/lib/mulsf3.c stable/9/contrib/compiler-rt/lib/mulvdi3.c stable/9/contrib/compiler-rt/lib/mulvsi3.c stable/9/contrib/compiler-rt/lib/mulvti3.c stable/9/contrib/compiler-rt/lib/mulxc3.c stable/9/contrib/compiler-rt/lib/negdf2.c stable/9/contrib/compiler-rt/lib/negsf2.c stable/9/contrib/compiler-rt/lib/negvdi2.c stable/9/contrib/compiler-rt/lib/negvsi2.c stable/9/contrib/compiler-rt/lib/negvti2.c stable/9/contrib/compiler-rt/lib/paritydi2.c stable/9/contrib/compiler-rt/lib/paritysi2.c stable/9/contrib/compiler-rt/lib/popcountdi2.c stable/9/contrib/compiler-rt/lib/popcountsi2.c stable/9/contrib/compiler-rt/lib/powidf2.c stable/9/contrib/compiler-rt/lib/powisf2.c stable/9/contrib/compiler-rt/lib/ppc/DD.h stable/9/contrib/compiler-rt/lib/ppc/divtc3.c stable/9/contrib/compiler-rt/lib/ppc/fixtfdi.c stable/9/contrib/compiler-rt/lib/ppc/fixunstfdi.c stable/9/contrib/compiler-rt/lib/ppc/floatditf.c stable/9/contrib/compiler-rt/lib/ppc/floatunditf.c stable/9/contrib/compiler-rt/lib/ppc/multc3.c stable/9/contrib/compiler-rt/lib/subdf3.c stable/9/contrib/compiler-rt/lib/subsf3.c stable/9/contrib/compiler-rt/lib/subvdi3.c stable/9/contrib/compiler-rt/lib/subvsi3.c stable/9/contrib/compiler-rt/lib/subvti3.c stable/9/contrib/compiler-rt/lib/trampoline_setup.c stable/9/contrib/compiler-rt/lib/truncdfsf2.c stable/9/contrib/compiler-rt/lib/ucmpdi2.c stable/9/contrib/compiler-rt/lib/udivdi3.c stable/9/contrib/compiler-rt/lib/udivmoddi4.c stable/9/contrib/compiler-rt/lib/udivmodsi4.c stable/9/contrib/compiler-rt/lib/udivmodti4.c stable/9/contrib/compiler-rt/lib/udivsi3.c stable/9/contrib/compiler-rt/lib/umoddi3.c stable/9/contrib/compiler-rt/lib/umodsi3.c stable/9/contrib/compiler-rt/lib/x86_64/floatdidf.c stable/9/contrib/compiler-rt/lib/x86_64/floatdisf.c stable/9/contrib/compiler-rt/lib/x86_64/floatdixf.c Directory Properties: stable/9/contrib/compiler-rt/ (props changed) Modified: stable/9/contrib/compiler-rt/LICENSE.TXT ============================================================================== --- stable/9/contrib/compiler-rt/LICENSE.TXT Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/LICENSE.TXT Fri May 25 17:14:47 2012 (r236011) @@ -74,3 +74,25 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE F LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +============================================================================== +Copyrights and Licenses for Third Party Software Distributed with LLVM: +============================================================================== +The LLVM software contains code written by third parties. Such software will +have its own individual LICENSE.TXT file in the directory in which it appears. +This file will describe the copyrights, license, and restrictions which apply +to that code. + +The disclaimer of warranty in the University of Illinois Open Source License +applies to all code in the LLVM Distribution, and nothing in any of the +other licenses gives permission to use the names of the LLVM Team or the +University of Illinois to endorse or promote products derived from this +Software. + +The following pieces of software have additional or alternate copyrights, +licenses, and/or restrictions: + +Program Directory +------- --------- +sysinfo lib/asan/sysinfo +mach_override lib/asan/mach_override Modified: stable/9/contrib/compiler-rt/README.txt ============================================================================== --- stable/9/contrib/compiler-rt/README.txt Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/README.txt Fri May 25 17:14:47 2012 (r236011) @@ -106,6 +106,15 @@ si_int __mulvsi3(si_int a, si_int b); / di_int __mulvdi3(di_int a, di_int b); // a * b ti_int __mulvti3(ti_int a, ti_int b); // a * b + +// Integral arithmetic which returns if overflow + +si_int __mulosi4(si_int a, si_int b, int* overflow); // a * b, overflow set to one if result not in signed range +di_int __mulodi4(di_int a, di_int b, int* overflow); // a * b, overflow set to one if result not in signed range +ti_int __muloti4(ti_int a, ti_int b, int* overflow); // a * b, overflow set to + one if result not in signed range + + // Integral comparison: a < b -> 0 // a == b -> 1 // a > b -> 2 Modified: stable/9/contrib/compiler-rt/lib/absvdi2.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/absvdi2.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/absvdi2.c Fri May 25 17:14:47 2012 (r236011) @@ -11,10 +11,8 @@ * *===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" -#include /* Returns: absolute value */ Modified: stable/9/contrib/compiler-rt/lib/absvsi2.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/absvsi2.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/absvsi2.c Fri May 25 17:14:47 2012 (r236011) @@ -11,10 +11,8 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" -#include /* Returns: absolute value */ Modified: stable/9/contrib/compiler-rt/lib/absvti2.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/absvti2.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/absvti2.c Fri May 25 17:14:47 2012 (r236011) @@ -15,7 +15,6 @@ #if __x86_64 #include "int_lib.h" -#include /* Returns: absolute value */ Modified: stable/9/contrib/compiler-rt/lib/adddf3.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/adddf3.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/adddf3.c Fri May 25 17:14:47 2012 (r236011) @@ -12,8 +12,6 @@ // //===----------------------------------------------------------------------===// -#include "abi.h" - #define DOUBLE_PRECISION #include "fp_lib.h" Modified: stable/9/contrib/compiler-rt/lib/addsf3.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/addsf3.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/addsf3.c Fri May 25 17:14:47 2012 (r236011) @@ -12,8 +12,6 @@ // //===----------------------------------------------------------------------===// -#include "abi.h" - #define SINGLE_PRECISION #include "fp_lib.h" Modified: stable/9/contrib/compiler-rt/lib/addvdi3.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/addvdi3.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/addvdi3.c Fri May 25 17:14:47 2012 (r236011) @@ -11,10 +11,8 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" -#include /* Returns: a + b */ Modified: stable/9/contrib/compiler-rt/lib/addvsi3.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/addvsi3.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/addvsi3.c Fri May 25 17:14:47 2012 (r236011) @@ -11,10 +11,8 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" -#include /* Returns: a + b */ Modified: stable/9/contrib/compiler-rt/lib/addvti3.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/addvti3.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/addvti3.c Fri May 25 17:14:47 2012 (r236011) @@ -15,7 +15,6 @@ #if __x86_64 #include "int_lib.h" -#include /* Returns: a + b */ Modified: stable/9/contrib/compiler-rt/lib/arm/adddf3vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/adddf3vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/adddf3vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -15,10 +15,11 @@ // Adds two double precision floating point numbers using the Darwin // calling convention where double arguments are passsed in GPR pairs // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__adddf3vfp) - fmdrr d6, r0, r1 // move first param from r0/r1 pair into d6 - fmdrr d7, r2, r3 // move second param from r2/r3 pair into d7 - faddd d6, d6, d7 - fmrrd r0, r1, d6 // move result back to r0/r1 pair + vmov d6, r0, r1 // move first param from r0/r1 pair into d6 + vmov d7, r2, r3 // move second param from r2/r3 pair into d7 + vadd.f64 d6, d6, d7 + vmov r0, r1, d6 // move result back to r0/r1 pair bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/addsf3vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/addsf3vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/addsf3vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -15,10 +15,11 @@ // Adds two single precision floating point numbers using the Darwin // calling convention where single arguments are passsed in GPRs // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__addsf3vfp) - fmsr s14, r0 // move first param from r0 into float register - fmsr s15, r1 // move second param from r1 into float register - fadds s14, s14, s15 - fmrs r0, s14 // move result back to r0 + vmov s14, r0 // move first param from r0 into float register + vmov s15, r1 // move second param from r1 into float register + vadd.f32 s14, s14, s15 + vmov r0, s14 // move result back to r0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/divdf3vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/divdf3vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/divdf3vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -15,10 +15,11 @@ // Divides two double precision floating point numbers using the Darwin // calling convention where double arguments are passsed in GPR pairs // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__divdf3vfp) - fmdrr d6, r0, r1 // move first param from r0/r1 pair into d6 - fmdrr d7, r2, r3 // move second param from r2/r3 pair into d7 - fdivd d5, d6, d7 - fmrrd r0, r1, d5 // move result back to r0/r1 pair + vmov d6, r0, r1 // move first param from r0/r1 pair into d6 + vmov d7, r2, r3 // move second param from r2/r3 pair into d7 + vdiv.f64 d5, d6, d7 + vmov r0, r1, d5 // move result back to r0/r1 pair bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/divsf3vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/divsf3vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/divsf3vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -15,10 +15,11 @@ // Divides two single precision floating point numbers using the Darwin // calling convention where single arguments are passsed like 32-bit ints. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__divsf3vfp) - fmsr s14, r0 // move first param from r0 into float register - fmsr s15, r1 // move second param from r1 into float register - fdivs s13, s14, s15 - fmrs r0, s13 // move result back to r0 + vmov s14, r0 // move first param from r0 into float register + vmov s15, r1 // move second param from r1 into float register + vdiv.f32 s13, s14, s15 + vmov r0, s13 // move result back to r0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/eqdf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/eqdf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/eqdf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where double precision arguments are passsed // like in GPR pairs. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__eqdf2vfp) - fmdrr d6, r0, r1 // load r0/r1 pair in double register - fmdrr d7, r2, r3 // load r2/r3 pair in double register - fcmpd d6, d7 - fmstat + vmov d6, r0, r1 // load r0/r1 pair in double register + vmov d7, r2, r3 // load r2/r3 pair in double register + vcmp.f64 d6, d7 + vmrs apsr_nzcv, fpscr moveq r0, #1 // set result register to 1 if equal movne r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/eqsf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/eqsf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/eqsf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where single precision arguments are passsed // like 32-bit ints // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__eqsf2vfp) - fmsr s14, r0 // move from GPR 0 to float register - fmsr s15, r1 // move from GPR 1 to float register - fcmps s14, s15 - fmstat + vmov s14, r0 // move from GPR 0 to float register + vmov s15, r1 // move from GPR 1 to float register + vcmp.f32 s14, s15 + vmrs apsr_nzcv, fpscr moveq r0, #1 // set result register to 1 if equal movne r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a single precision parameter is // passed in a GPR and a double precision result is returned in R0/R1 pair. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__extendsfdf2vfp) - fmsr s15, r0 // load float register from R0 - fcvtds d7, s15 // convert single to double - fmrrd r0, r1, d7 // return result in r0/r1 pair + vmov s15, r0 // load float register from R0 + vcvt.f64.f32 d7, s15 // convert single to double + vmov r0, r1, d7 // return result in r0/r1 pair bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/fixdfsivfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/fixdfsivfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/fixdfsivfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a double precision parameter is // passed in GPR register pair. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__fixdfsivfp) - fmdrr d7, r0, r1 // load double register from R0/R1 - ftosizd s15, d7 // convert double to 32-bit int into s15 - fmrs r0, s15 // move s15 to result register + vmov d7, r0, r1 // load double register from R0/R1 + vcvt.s32.f64 s15, d7 // convert double to 32-bit int into s15 + vmov r0, s15 // move s15 to result register bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/fixsfsivfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/fixsfsivfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/fixsfsivfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a single precision parameter is // passed in a GPR.. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__fixsfsivfp) - fmsr s15, r0 // load float register from R0 - ftosizs s15, s15 // convert single to 32-bit int into s15 - fmrs r0, s15 // move s15 to result register + vmov s15, r0 // load float register from R0 + vcvt.s32.f32 s15, s15 // convert single to 32-bit int into s15 + vmov r0, s15 // move s15 to result register bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S Fri May 25 17:14:47 2012 (r236011) @@ -17,9 +17,10 @@ // Uses Darwin calling convention where a double precision parameter is // passed in GPR register pair. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__fixunsdfsivfp) - fmdrr d7, r0, r1 // load double register from R0/R1 - ftouizd s15, d7 // convert double to 32-bit int into s15 - fmrs r0, s15 // move s15 to result register + vmov d7, r0, r1 // load double register from R0/R1 + vcvt.u32.f64 s15, d7 // convert double to 32-bit int into s15 + vmov r0, s15 // move s15 to result register bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/fixunssfsivfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/fixunssfsivfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/fixunssfsivfp.S Fri May 25 17:14:47 2012 (r236011) @@ -17,9 +17,10 @@ // Uses Darwin calling convention where a single precision parameter is // passed in a GPR.. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__fixunssfsivfp) - fmsr s15, r0 // load float register from R0 - ftouizs s15, s15 // convert single to 32-bit unsigned into s15 - fmrs r0, s15 // move s15 to result register + vmov s15, r0 // load float register from R0 + vcvt.u32.f32 s15, s15 // convert single to 32-bit unsigned into s15 + vmov r0, s15 // move s15 to result register bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/floatsidfvfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/floatsidfvfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/floatsidfvfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a double precision result is // return in GPR register pair. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__floatsidfvfp) - fmsr s15, r0 // move int to float register s15 - fsitod d7, s15 // convert 32-bit int in s15 to double in d7 - fmrrd r0, r1, d7 // move d7 to result register pair r0/r1 + vmov s15, r0 // move int to float register s15 + vcvt.f64.s32 d7, s15 // convert 32-bit int in s15 to double in d7 + vmov r0, r1, d7 // move d7 to result register pair r0/r1 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/floatsisfvfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/floatsisfvfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/floatsisfvfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a single precision result is // return in a GPR.. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__floatsisfvfp) - fmsr s15, r0 // move int to float register s15 - fsitos s15, s15 // convert 32-bit int in s15 to float in s15 - fmrs r0, s15 // move s15 to result register + vmov s15, r0 // move int to float register s15 + vcvt.f32.s32 s15, s15 // convert 32-bit int in s15 to float in s15 + vmov r0, s15 // move s15 to result register bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/floatunssidfvfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/floatunssidfvfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/floatunssidfvfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a double precision result is // return in GPR register pair. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__floatunssidfvfp) - fmsr s15, r0 // move int to float register s15 - fuitod d7, s15 // convert 32-bit int in s15 to double in d7 - fmrrd r0, r1, d7 // move d7 to result register pair r0/r1 + vmov s15, r0 // move int to float register s15 + vcvt.f64.u32 d7, s15 // convert 32-bit int in s15 to double in d7 + vmov r0, r1, d7 // move d7 to result register pair r0/r1 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/floatunssisfvfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/floatunssisfvfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/floatunssisfvfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a single precision result is // return in a GPR.. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__floatunssisfvfp) - fmsr s15, r0 // move int to float register s15 - fuitos s15, s15 // convert 32-bit int in s15 to float in s15 - fmrs r0, s15 // move s15 to result register + vmov s15, r0 // move int to float register s15 + vcvt.f32.u32 s15, s15 // convert 32-bit int in s15 to float in s15 + vmov r0, s15 // move s15 to result register bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/gedf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/gedf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/gedf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where double precision arguments are passsed // like in GPR pairs. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__gedf2vfp) - fmdrr d6, r0, r1 // load r0/r1 pair in double register - fmdrr d7, r2, r3 // load r2/r3 pair in double register - fcmpd d6, d7 - fmstat + vmov d6, r0, r1 // load r0/r1 pair in double register + vmov d7, r2, r3 // load r2/r3 pair in double register + vcmp.f64 d6, d7 + vmrs apsr_nzcv, fpscr movge r0, #1 // set result register to 1 if greater than or equal movlt r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/gesf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/gesf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/gesf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where single precision arguments are passsed // like 32-bit ints // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__gesf2vfp) - fmsr s14, r0 // move from GPR 0 to float register - fmsr s15, r1 // move from GPR 1 to float register - fcmps s14, s15 - fmstat + vmov s14, r0 // move from GPR 0 to float register + vmov s15, r1 // move from GPR 1 to float register + vcmp.f32 s14, s15 + vmrs apsr_nzcv, fpscr movge r0, #1 // set result register to 1 if greater than or equal movlt r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/gtdf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/gtdf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/gtdf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where double precision arguments are passsed // like in GPR pairs. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__gtdf2vfp) - fmdrr d6, r0, r1 // load r0/r1 pair in double register - fmdrr d7, r2, r3 // load r2/r3 pair in double register - fcmpd d6, d7 - fmstat + vmov d6, r0, r1 // load r0/r1 pair in double register + vmov d7, r2, r3 // load r2/r3 pair in double register + vcmp.f64 d6, d7 + vmrs apsr_nzcv, fpscr movgt r0, #1 // set result register to 1 if equal movle r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/gtsf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/gtsf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/gtsf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where single precision arguments are passsed // like 32-bit ints // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__gtsf2vfp) - fmsr s14, r0 // move from GPR 0 to float register - fmsr s15, r1 // move from GPR 1 to float register - fcmps s14, s15 - fmstat + vmov s14, r0 // move from GPR 0 to float register + vmov s15, r1 // move from GPR 1 to float register + vcmp.f32 s14, s15 + vmrs apsr_nzcv, fpscr movgt r0, #1 // set result register to 1 if equal movle r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/ledf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/ledf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/ledf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where double precision arguments are passsed // like in GPR pairs. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__ledf2vfp) - fmdrr d6, r0, r1 // load r0/r1 pair in double register - fmdrr d7, r2, r3 // load r2/r3 pair in double register - fcmpd d6, d7 - fmstat + vmov d6, r0, r1 // load r0/r1 pair in double register + vmov d7, r2, r3 // load r2/r3 pair in double register + vcmp.f64 d6, d7 + vmrs apsr_nzcv, fpscr movls r0, #1 // set result register to 1 if equal movhi r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/lesf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/lesf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/lesf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where single precision arguments are passsed // like 32-bit ints // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__lesf2vfp) - fmsr s14, r0 // move from GPR 0 to float register - fmsr s15, r1 // move from GPR 1 to float register - fcmps s14, s15 - fmstat + vmov s14, r0 // move from GPR 0 to float register + vmov s15, r1 // move from GPR 1 to float register + vcmp.f32 s14, s15 + vmrs apsr_nzcv, fpscr movls r0, #1 // set result register to 1 if equal movhi r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/ltdf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/ltdf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/ltdf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where double precision arguments are passsed // like in GPR pairs. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__ltdf2vfp) - fmdrr d6, r0, r1 // load r0/r1 pair in double register - fmdrr d7, r2, r3 // load r2/r3 pair in double register - fcmpd d6, d7 - fmstat + vmov d6, r0, r1 // load r0/r1 pair in double register + vmov d7, r2, r3 // load r2/r3 pair in double register + vcmp.f64 d6, d7 + vmrs apsr_nzcv, fpscr movmi r0, #1 // set result register to 1 if equal movpl r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/ltsf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/ltsf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/ltsf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where single precision arguments are passsed // like 32-bit ints // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__ltsf2vfp) - fmsr s14, r0 // move from GPR 0 to float register - fmsr s15, r1 // move from GPR 1 to float register - fcmps s14, s15 - fmstat + vmov s14, r0 // move from GPR 0 to float register + vmov s15, r1 // move from GPR 1 to float register + vcmp.f32 s14, s15 + vmrs apsr_nzcv, fpscr movmi r0, #1 // set result register to 1 if equal movpl r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/muldf3vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/muldf3vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/muldf3vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -15,10 +15,11 @@ // Multiplies two double precision floating point numbers using the Darwin // calling convention where double arguments are passsed in GPR pairs // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__muldf3vfp) - fmdrr d6, r0, r1 // move first param from r0/r1 pair into d6 - fmdrr d7, r2, r3 // move second param from r2/r3 pair into d7 - fmuld d6, d6, d7 - fmrrd r0, r1, d6 // move result back to r0/r1 pair + vmov d6, r0, r1 // move first param from r0/r1 pair into d6 + vmov d7, r2, r3 // move second param from r2/r3 pair into d7 + vmul.f64 d6, d6, d7 + vmov r0, r1, d6 // move result back to r0/r1 pair bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/mulsf3vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/mulsf3vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/mulsf3vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -15,10 +15,11 @@ // Multiplies two single precision floating point numbers using the Darwin // calling convention where single arguments are passsed like 32-bit ints. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__mulsf3vfp) - fmsr s14, r0 // move first param from r0 into float register - fmsr s15, r1 // move second param from r1 into float register - fmuls s13, s14, s15 - fmrs r0, s13 // move result back to r0 + vmov s14, r0 // move first param from r0 into float register + vmov s15, r1 // move second param from r1 into float register + vmul.f32 s13, s14, s15 + vmov r0, s13 // move result back to r0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/nedf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/nedf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/nedf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where double precision arguments are passsed // like in GPR pairs. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__nedf2vfp) - fmdrr d6, r0, r1 // load r0/r1 pair in double register - fmdrr d7, r2, r3 // load r2/r3 pair in double register - fcmpd d6, d7 - fmstat + vmov d6, r0, r1 // load r0/r1 pair in double register + vmov d7, r2, r3 // load r2/r3 pair in double register + vcmp.f64 d6, d7 + vmrs apsr_nzcv, fpscr movne r0, #1 // set result register to 0 if unequal moveq r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/negdf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/negdf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/negdf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -15,6 +15,7 @@ // Returns the negation a double precision floating point numbers using the // Darwin calling convention where double arguments are passsed in GPR pairs. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__negdf2vfp) eor r1, r1, #-2147483648 // flip sign bit on double in r0/r1 pair Modified: stable/9/contrib/compiler-rt/lib/arm/negsf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/negsf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/negsf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -15,6 +15,7 @@ // Returns the negation of a single precision floating point numbers using the // Darwin calling convention where single arguments are passsed like 32-bit ints // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__negsf2vfp) eor r0, r0, #-2147483648 // flip sign bit on float in r0 Modified: stable/9/contrib/compiler-rt/lib/arm/nesf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/nesf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/nesf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where single precision arguments are passsed // like 32-bit ints // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__nesf2vfp) - fmsr s14, r0 // move from GPR 0 to float register - fmsr s15, r1 // move from GPR 1 to float register - fcmps s14, s15 - fmstat + vmov s14, r0 // move from GPR 0 to float register + vmov s15, r1 // move from GPR 1 to float register + vcmp.f32 s14, s15 + vmrs apsr_nzcv, fpscr movne r0, #1 // set result register to 1 if unequal moveq r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/subdf3vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/subdf3vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/subdf3vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -15,10 +15,11 @@ // Returns difference between two double precision floating point numbers using // the Darwin calling convention where double arguments are passsed in GPR pairs // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__subdf3vfp) - fmdrr d6, r0, r1 // move first param from r0/r1 pair into d6 - fmdrr d7, r2, r3 // move second param from r2/r3 pair into d7 - fsubd d6, d6, d7 - fmrrd r0, r1, d6 // move result back to r0/r1 pair + vmov d6, r0, r1 // move first param from r0/r1 pair into d6 + vmov d7, r2, r3 // move second param from r2/r3 pair into d7 + vsub.f64 d6, d6, d7 + vmov r0, r1, d6 // move result back to r0/r1 pair bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/subsf3vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/subsf3vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/subsf3vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,10 +16,11 @@ // using the Darwin calling convention where single arguments are passsed // like 32-bit ints. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__subsf3vfp) - fmsr s14, r0 // move first param from r0 into float register - fmsr s15, r1 // move second param from r1 into float register - fsubs s14, s14, s15 - fmrs r0, s14 // move result back to r0 + vmov s14, r0 // move first param from r0 into float register + vmov s15, r1 // move second param from r1 into float register + vsub.f32 s14, s14, s15 + vmov r0, s14 // move result back to r0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,9 +16,10 @@ // Uses Darwin calling convention where a double precision parameter is // passed in a R0/R1 pair and a signle precision result is returned in R0. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__truncdfsf2vfp) - fmdrr d7, r0, r1 // load double from r0/r1 pair - fcvtsd s15, d7 // convert double to single (trucate precision) - fmrs r0, s15 // return result in r0 + vmov d7, r0, r1 // load double from r0/r1 pair + vcvt.f32.f64 s15, d7 // convert double to single (trucate precision) + vmov r0, s15 // return result in r0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/unorddf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/unorddf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/unorddf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where double precision arguments are passsed // like in GPR pairs. // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__unorddf2vfp) - fmdrr d6, r0, r1 // load r0/r1 pair in double register - fmdrr d7, r2, r3 // load r2/r3 pair in double register - fcmpd d6, d7 - fmstat + vmov d6, r0, r1 // load r0/r1 pair in double register + vmov d7, r2, r3 // load r2/r3 pair in double register + vcmp.f64 d6, d7 + vmrs apsr_nzcv, fpscr movvs r0, #1 // set result register to 1 if "overflow" (any NaNs) movvc r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/arm/unordsf2vfp.S ============================================================================== --- stable/9/contrib/compiler-rt/lib/arm/unordsf2vfp.S Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/arm/unordsf2vfp.S Fri May 25 17:14:47 2012 (r236011) @@ -16,12 +16,13 @@ // Uses Darwin calling convention where single precision arguments are passsed // like 32-bit ints // + .syntax unified .align 2 DEFINE_COMPILERRT_FUNCTION(__unordsf2vfp) - fmsr s14, r0 // move from GPR 0 to float register - fmsr s15, r1 // move from GPR 1 to float register - fcmps s14, s15 - fmstat + vmov s14, r0 // move from GPR 0 to float register + vmov s15, r1 // move from GPR 1 to float register + vcmp.f32 s14, s15 + vmrs apsr_nzcv, fpscr movvs r0, #1 // set result register to 1 if "overflow" (any NaNs) movvc r0, #0 bx lr Modified: stable/9/contrib/compiler-rt/lib/ashldi3.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/ashldi3.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/ashldi3.c Fri May 25 17:14:47 2012 (r236011) @@ -11,7 +11,6 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" Modified: stable/9/contrib/compiler-rt/lib/ashrdi3.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/ashrdi3.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/ashrdi3.c Fri May 25 17:14:47 2012 (r236011) @@ -11,7 +11,6 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" Modified: stable/9/contrib/compiler-rt/lib/assembly.h ============================================================================== --- stable/9/contrib/compiler-rt/lib/assembly.h Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/assembly.h Fri May 25 17:14:47 2012 (r236011) @@ -35,15 +35,16 @@ #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) #ifdef VISIBILITY_HIDDEN -#define DEFINE_COMPILERRT_FUNCTION(name) \ - .globl SYMBOL_NAME(name) SEPARATOR \ - HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \ - SYMBOL_NAME(name): +#define DECLARE_SYMBOL_VISIBILITY(name) \ + HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR #else +#define DECLARE_SYMBOL_VISIBILITY(name) +#endif + #define DEFINE_COMPILERRT_FUNCTION(name) \ .globl SYMBOL_NAME(name) SEPARATOR \ + DECLARE_SYMBOL_VISIBILITY(name) \ SYMBOL_NAME(name): -#endif #define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \ .globl SYMBOL_NAME(name) SEPARATOR \ Modified: stable/9/contrib/compiler-rt/lib/clear_cache.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/clear_cache.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/clear_cache.c Fri May 25 17:14:47 2012 (r236011) @@ -9,7 +9,6 @@ */ #include "int_lib.h" -#include #if __APPLE__ #include Modified: stable/9/contrib/compiler-rt/lib/clzdi2.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/clzdi2.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/clzdi2.c Fri May 25 17:14:47 2012 (r236011) @@ -11,7 +11,6 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" Modified: stable/9/contrib/compiler-rt/lib/clzsi2.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/clzsi2.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/clzsi2.c Fri May 25 17:14:47 2012 (r236011) @@ -11,7 +11,6 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" Modified: stable/9/contrib/compiler-rt/lib/cmpdi2.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/cmpdi2.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/cmpdi2.c Fri May 25 17:14:47 2012 (r236011) @@ -11,7 +11,6 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" Modified: stable/9/contrib/compiler-rt/lib/ctzdi2.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/ctzdi2.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/ctzdi2.c Fri May 25 17:14:47 2012 (r236011) @@ -11,7 +11,6 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" Modified: stable/9/contrib/compiler-rt/lib/ctzsi2.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/ctzsi2.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/ctzsi2.c Fri May 25 17:14:47 2012 (r236011) @@ -11,7 +11,6 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" Modified: stable/9/contrib/compiler-rt/lib/divdc3.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/divdc3.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/divdc3.c Fri May 25 17:14:47 2012 (r236011) @@ -13,8 +13,7 @@ */ #include "int_lib.h" -#include -#include +#include "int_math.h" /* Returns: the quotient of (a + ib) / (c + id) */ @@ -22,35 +21,37 @@ double _Complex __divdc3(double __a, double __b, double __c, double __d) { int __ilogbw = 0; - double __logbw = logb(fmax(fabs(__c), fabs(__d))); - if (isfinite(__logbw)) + double __logbw = crt_logb(crt_fmax(crt_fabs(__c), crt_fabs(__d))); + if (crt_isfinite(__logbw)) { __ilogbw = (int)__logbw; - __c = scalbn(__c, -__ilogbw); - __d = scalbn(__d, -__ilogbw); + __c = crt_scalbn(__c, -__ilogbw); + __d = crt_scalbn(__d, -__ilogbw); } double __denom = __c * __c + __d * __d; double _Complex z; - __real__ z = scalbn((__a * __c + __b * __d) / __denom, -__ilogbw); - __imag__ z = scalbn((__b * __c - __a * __d) / __denom, -__ilogbw); - if (isnan(__real__ z) && isnan(__imag__ z)) + __real__ z = crt_scalbn((__a * __c + __b * __d) / __denom, -__ilogbw); + __imag__ z = crt_scalbn((__b * __c - __a * __d) / __denom, -__ilogbw); + if (crt_isnan(__real__ z) && crt_isnan(__imag__ z)) { - if ((__denom == 0.0) && (!isnan(__a) || !isnan(__b))) + if ((__denom == 0.0) && (!crt_isnan(__a) || !crt_isnan(__b))) { - __real__ z = copysign(INFINITY, __c) * __a; - __imag__ z = copysign(INFINITY, __c) * __b; + __real__ z = crt_copysign(CRT_INFINITY, __c) * __a; + __imag__ z = crt_copysign(CRT_INFINITY, __c) * __b; } - else if ((isinf(__a) || isinf(__b)) && isfinite(__c) && isfinite(__d)) + else if ((crt_isinf(__a) || crt_isinf(__b)) && + crt_isfinite(__c) && crt_isfinite(__d)) { - __a = copysign(isinf(__a) ? 1.0 : 0.0, __a); - __b = copysign(isinf(__b) ? 1.0 : 0.0, __b); - __real__ z = INFINITY * (__a * __c + __b * __d); - __imag__ z = INFINITY * (__b * __c - __a * __d); + __a = crt_copysign(crt_isinf(__a) ? 1.0 : 0.0, __a); + __b = crt_copysign(crt_isinf(__b) ? 1.0 : 0.0, __b); + __real__ z = CRT_INFINITY * (__a * __c + __b * __d); + __imag__ z = CRT_INFINITY * (__b * __c - __a * __d); } - else if (isinf(__logbw) && __logbw > 0.0 && isfinite(__a) && isfinite(__b)) + else if (crt_isinf(__logbw) && __logbw > 0.0 && + crt_isfinite(__a) && crt_isfinite(__b)) { - __c = copysign(isinf(__c) ? 1.0 : 0.0, __c); - __d = copysign(isinf(__d) ? 1.0 : 0.0, __d); + __c = crt_copysign(crt_isinf(__c) ? 1.0 : 0.0, __c); + __d = crt_copysign(crt_isinf(__d) ? 1.0 : 0.0, __d); __real__ z = 0.0 * (__a * __c + __b * __d); __imag__ z = 0.0 * (__b * __c - __a * __d); } Modified: stable/9/contrib/compiler-rt/lib/divdf3.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/divdf3.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/divdf3.c Fri May 25 17:14:47 2012 (r236011) @@ -15,7 +15,6 @@ // underflow with correct rounding. // //===----------------------------------------------------------------------===// -#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" Modified: stable/9/contrib/compiler-rt/lib/divdi3.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/divdi3.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/divdi3.c Fri May 25 17:14:47 2012 (r236011) @@ -11,7 +11,6 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" Modified: stable/9/contrib/compiler-rt/lib/divmoddi4.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/divmoddi4.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/divmoddi4.c Fri May 25 17:14:47 2012 (r236011) @@ -11,7 +11,6 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" Modified: stable/9/contrib/compiler-rt/lib/divmodsi4.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/divmodsi4.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/divmodsi4.c Fri May 25 17:14:47 2012 (r236011) @@ -11,7 +11,6 @@ * * ===----------------------------------------------------------------------=== */ -#include "abi.h" #include "int_lib.h" Modified: stable/9/contrib/compiler-rt/lib/divsc3.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/divsc3.c Fri May 25 16:52:00 2012 (r236010) +++ stable/9/contrib/compiler-rt/lib/divsc3.c Fri May 25 17:14:47 2012 (r236011) @@ -13,8 +13,7 @@ */ #include "int_lib.h" -#include -#include +#include "int_math.h" /* Returns: the quotient of (a + ib) / (c + id) */ @@ -22,35 +21,37 @@ float _Complex __divsc3(float __a, float __b, float __c, float __d) { int __ilogbw = 0; - float __logbw = logbf(fmaxf(fabsf(__c), fabsf(__d))); - if (isfinite(__logbw)) + float __logbw = crt_logbf(crt_fmaxf(crt_fabsf(__c), crt_fabsf(__d))); + if (crt_isfinite(__logbw)) { __ilogbw = (int)__logbw; - __c = scalbnf(__c, -__ilogbw); - __d = scalbnf(__d, -__ilogbw); + __c = crt_scalbnf(__c, -__ilogbw); + __d = crt_scalbnf(__d, -__ilogbw); } float __denom = __c * __c + __d * __d; float _Complex z; - __real__ z = scalbnf((__a * __c + __b * __d) / __denom, -__ilogbw); - __imag__ z = scalbnf((__b * __c - __a * __d) / __denom, -__ilogbw); - if (isnan(__real__ z) && isnan(__imag__ z)) + __real__ z = crt_scalbnf((__a * __c + __b * __d) / __denom, -__ilogbw); + __imag__ z = crt_scalbnf((__b * __c - __a * __d) / __denom, -__ilogbw); + if (crt_isnan(__real__ z) && crt_isnan(__imag__ z)) { - if ((__denom == 0) && (!isnan(__a) || !isnan(__b))) + if ((__denom == 0) && (!crt_isnan(__a) || !crt_isnan(__b))) { - __real__ z = copysignf(INFINITY, __c) * __a; - __imag__ z = copysignf(INFINITY, __c) * __b; + __real__ z = crt_copysignf(CRT_INFINITY, __c) * __a; + __imag__ z = crt_copysignf(CRT_INFINITY, __c) * __b; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 25 17:15:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BECED1065674; Fri, 25 May 2012 17:15:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FA348FC21; Fri, 25 May 2012 17:15:53 +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 q4PHFrmg023225; Fri, 25 May 2012 17:15:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PHFrlo023223; Fri, 25 May 2012 17:15:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251715.q4PHFrlo023223@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 17:15: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: r236012 - stable/9/contrib/compiler-rt/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:15:53 -0000 Author: marius Date: Fri May 25 17:15:53 2012 New Revision: 236012 URL: http://svn.freebsd.org/changeset/base/236012 Log: MFC: r230021 Add a workaround to prevent endless recursion in compiler-rt. SPARC and MIPS CPUs don't have special instructions to count leading/trailing zeroes. The compiler-rt library provides fallback rountines for these. The 64-bit routines, __clzdi2 and __ctzdi2, are implemented as simple wrappers around the compiler built-in __builtin_clz(), assuming these will expand to either 32-bit CPU instructions or calls to __clzsi2 and __ctzsi2. Unfortunately, our GCC 4.2 probably thinks that because the operand is stored in a 64-bit register, it might just be a better idea to invoke its 64-bit equivalent, simply resulting into endless recursion. Fix this by defining __builtin_clz and __builtin_ctz to __clzsi2 and __ctzsi2 explicitly. Modified: stable/9/contrib/compiler-rt/lib/int_lib.h Directory Properties: stable/9/contrib/compiler-rt/ (props changed) Modified: stable/9/contrib/compiler-rt/lib/int_lib.h ============================================================================== --- stable/9/contrib/compiler-rt/lib/int_lib.h Fri May 25 17:14:47 2012 (r236011) +++ stable/9/contrib/compiler-rt/lib/int_lib.h Fri May 25 17:15:53 2012 (r236012) @@ -43,4 +43,24 @@ /* Include internal utility function declarations. */ #include "int_util.h" +/* + * Workaround for LLVM bug 11663. Prevent endless recursion in + * __c?zdi2(), where calls to __builtin_c?z() are expanded to + * __c?zdi2() instead of __c?zsi2(). + * + * Instead of placing this workaround in c?zdi2.c, put it in this + * global header to prevent other C files from making the detour + * through __c?zdi2() as well. + * + * This problem has only been observed on FreeBSD for sparc64 and + * mips64 with GCC 4.2.1. + */ +#if defined(__FreeBSD__) && (defined(__sparc64__) || \ + defined(__mips_n64) || defined(__mips_o64)) +si_int __clzsi2(si_int); +si_int __ctzsi2(si_int); +#define __builtin_clz __clzsi2 +#define __builtin_ctz __ctzsi2 +#endif + #endif /* INT_LIB_H */ From owner-svn-src-all@FreeBSD.ORG Fri May 25 17:19:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9806B106564A; Fri, 25 May 2012 17:19:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 832388FC18; Fri, 25 May 2012 17:19:30 +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 q4PHJUNT023441; Fri, 25 May 2012 17:19:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PHJUAl023439; Fri, 25 May 2012 17:19:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201205251719.q4PHJUAl023439@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 25 May 2012 17:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236013 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:19:30 -0000 Author: pjd Date: Fri May 25 17:19:30 2012 New Revision: 236013 URL: http://svn.freebsd.org/changeset/base/236013 Log: Correct error message. MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri May 25 17:15:53 2012 (r236012) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri May 25 17:19:30 2012 (r236013) @@ -3168,7 +3168,7 @@ zfs_do_rename(int argc, char **argv) } if (flags.nounmount && parents) { - (void) fprintf(stderr, gettext("-u and -r options are mutually " + (void) fprintf(stderr, gettext("-u and -p options are mutually " "exclusive\n")); usage(B_FALSE); } From owner-svn-src-all@FreeBSD.ORG Fri May 25 17:20:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CC9C1065672; Fri, 25 May 2012 17:20:01 +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 869168FC12; Fri, 25 May 2012 17:20:01 +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 q4PHK1oH023505; Fri, 25 May 2012 17:20:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PHK1AG023503; Fri, 25 May 2012 17:20:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251720.q4PHK1AG023503@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 17:20:01 +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: r236014 - in stable/9: gnu/lib/libgcc lib/libcompiler_rt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:20:01 -0000 Author: marius Date: Fri May 25 17:20:00 2012 New Revision: 236014 URL: http://svn.freebsd.org/changeset/base/236014 Log: MFC: r235487 Switch sparc64 to using libcompiler_rt; since r230021 (MFC'ed to stable/9 in r236012) we have a workaround in place allowing it to be used there and since r235388 (MFC'ed to stable/9 in r236002) we also have usable div/mod optimizations like libgcc has. Modified: stable/9/gnu/lib/libgcc/Makefile stable/9/lib/libcompiler_rt/Makefile Directory Properties: stable/9/gnu/lib/libgcc/ (props changed) stable/9/lib/libcompiler_rt/ (props changed) Modified: stable/9/gnu/lib/libgcc/Makefile ============================================================================== --- stable/9/gnu/lib/libgcc/Makefile Fri May 25 17:19:30 2012 (r236013) +++ stable/9/gnu/lib/libgcc/Makefile Fri May 25 17:20:00 2012 (r236014) @@ -15,7 +15,7 @@ MK_SSP= no .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" -.if ${TARGET_CPUARCH} == "sparc64" || ${TARGET_CPUARCH} == "mips" +.if ${TARGET_CPUARCH} == "mips" LIB= gcc .endif Modified: stable/9/lib/libcompiler_rt/Makefile ============================================================================== --- stable/9/lib/libcompiler_rt/Makefile Fri May 25 17:19:30 2012 (r236013) +++ stable/9/lib/libcompiler_rt/Makefile Fri May 25 17:20:00 2012 (r236014) @@ -152,7 +152,7 @@ SRCS+= ${file}.c . endif .endfor -.if ${MACHINE_CPUARCH} != "sparc64" && ${MACHINE_CPUARCH} != "mips" +.if ${MACHINE_CPUARCH} != "mips" . if ${MK_INSTALLLIB} != "no" SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a . endif From owner-svn-src-all@FreeBSD.ORG Fri May 25 17:47:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39AA9106566B; Fri, 25 May 2012 17:47:17 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id BFA1E8FC15; Fri, 25 May 2012 17:47:16 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q4PHlFtq030300; Fri, 25 May 2012 19:47:15 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q4PHlFHF030299; Fri, 25 May 2012 19:47:15 +0200 (CEST) (envelope-from marius) Date: Fri, 25 May 2012 19:47:15 +0200 From: Marius Strobl To: Marius Strobl Message-ID: <20120525174715.GB12138@alchemy.franken.de> References: <201205251714.q4PHEmgO023068@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201205251714.q4PHEmgO023068@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r236011 - in stable/9/contrib/compiler-rt: . lib lib/arm lib/ppc lib/x86_64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:47:17 -0000 On Fri, May 25, 2012 at 05:14:48PM +0000, Marius Strobl wrote: > Author: marius > Date: Fri May 25 17:14:47 2012 > New Revision: 236011 > URL: http://svn.freebsd.org/changeset/base/236011 > > Log: > MFC: r222656 > > Upgrade libcompiler_rt from revision 117047 to 132478. > > It seems there have only been a small amount to the compiler-rt source > code in the mean time. I'd rather have the code in sync as much as > possible by the time we release 9.0. Changes: > > - The libcompiler_rt library is now dual licensed under both the > University of Illinois "BSD-Like" license and the MIT license. > > - Our local modifications for using .hidden instead of .private_extern > have been upstreamed, meaning our changes to lib/assembly.h can now be > reverted. > > - A possible endless recursion in __modsi3() has been fixed. > > - Support for ARM EABI has been added, but it has no effect on FreeBSD > (yet). > > - The functions __udivmodsi4 and __divmodsi4 have been added. > > Requested by: many, including bf@ and Pedro Giffuni > Oops, this should have read: MFC: r229135 Upgrade libcompiler_rt to upstream revision 147390. This version of libcompiler_rt adds support for __mulo[sdt]i4(), which computes a multiply and its overflow flag. There are also a lot of cleanup fixes to headers that don't really affect us. Updating to this revision should make it a bit easier to contribute changes back to the LLVM developers. Marius From owner-svn-src-all@FreeBSD.ORG Fri May 25 17:48:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 815431065674; Fri, 25 May 2012 17:48:46 +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 6B9D58FC18; Fri, 25 May 2012 17:48: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 q4PHmk3L024768; Fri, 25 May 2012 17:48:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PHmk2P024766; Fri, 25 May 2012 17:48:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251748.q4PHmk2P024766@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 17:48:46 +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: r236015 - stable/9/lib/libcompiler_rt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:48:46 -0000 Author: marius Date: Fri May 25 17:48:45 2012 New Revision: 236015 URL: http://svn.freebsd.org/changeset/base/236015 Log: MFC: r229135 Upgrade libcompiler_rt to upstream revision 147390. This version of libcompiler_rt adds support for __mulo[sdt]i4(), which computes a multiply and its overflow flag. There are also a lot of cleanup fixes to headers that don't really affect us. Updating to this revision should make it a bit easier to contribute changes back to the LLVM developers. Modified: stable/9/lib/libcompiler_rt/Makefile Directory Properties: stable/9/lib/libcompiler_rt/ (props changed) Modified: stable/9/lib/libcompiler_rt/Makefile ============================================================================== --- stable/9/lib/libcompiler_rt/Makefile Fri May 25 17:20:00 2012 (r236014) +++ stable/9/lib/libcompiler_rt/Makefile Fri May 25 17:48:45 2012 (r236015) @@ -79,12 +79,16 @@ SRCF= absvdi2 \ floatuntidf \ floatuntisf \ floatuntixf \ + int_util \ lshrdi3 \ lshrti3 \ moddi3 \ modti3 \ muldc3 \ muldi3 \ + mulodi4 \ + mulosi4 \ + muloti4 \ mulsc3 \ multi3 \ mulvdi3 \ From owner-svn-src-all@FreeBSD.ORG Fri May 25 17:50:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F665106566C; Fri, 25 May 2012 17:50:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 657FB8FC0C; Fri, 25 May 2012 17:50: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 q4PHopFx024910; Fri, 25 May 2012 17:50:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PHop6g024892; Fri, 25 May 2012 17:50:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251750.q4PHop6g024892@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 17:50:51 +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: r236016 - stable/9/lib/libcompiler_rt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:50:51 -0000 Author: marius Date: Fri May 25 17:50:50 2012 New Revision: 236016 URL: http://svn.freebsd.org/changeset/base/236016 Log: MFC: r228919 Add locally implemented atomic intrinsics to libcompiler_rt. The built-in atomic operations are not implemented in our version of GCC 4.2 for the ARM and MIPS architectures. Instead of emitting locked instructions, they generate calls to functions that can be implemented in the C runtime. Only implement the atomic operations that are used by for datatype sizes that are supported by atomic(9). This means that on these architectures, we can only use atomic operations on 32-bits and 64-bits variables, which is typically sufficient. This makes work on all architectures except MIPS, since MIPS still uses libgcc. Added: stable/9/lib/libcompiler_rt/__sync_fetch_and_add_4.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_fetch_and_add_4.c stable/9/lib/libcompiler_rt/__sync_fetch_and_add_8.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_fetch_and_add_8.c stable/9/lib/libcompiler_rt/__sync_fetch_and_and_4.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_fetch_and_and_4.c stable/9/lib/libcompiler_rt/__sync_fetch_and_and_8.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_fetch_and_and_8.c stable/9/lib/libcompiler_rt/__sync_fetch_and_op_n.h - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_fetch_and_op_n.h stable/9/lib/libcompiler_rt/__sync_fetch_and_or_4.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_fetch_and_or_4.c stable/9/lib/libcompiler_rt/__sync_fetch_and_or_8.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_fetch_and_or_8.c stable/9/lib/libcompiler_rt/__sync_fetch_and_sub_4.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_fetch_and_sub_4.c stable/9/lib/libcompiler_rt/__sync_fetch_and_sub_8.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_fetch_and_sub_8.c stable/9/lib/libcompiler_rt/__sync_fetch_and_xor_4.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_fetch_and_xor_4.c stable/9/lib/libcompiler_rt/__sync_fetch_and_xor_8.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_fetch_and_xor_8.c stable/9/lib/libcompiler_rt/__sync_lock_test_and_set_4.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_lock_test_and_set_4.c stable/9/lib/libcompiler_rt/__sync_lock_test_and_set_8.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_lock_test_and_set_8.c stable/9/lib/libcompiler_rt/__sync_val_compare_and_swap_4.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_val_compare_and_swap_4.c stable/9/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c stable/9/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h - copied unchanged from r228919, head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h Modified: stable/9/lib/libcompiler_rt/Makefile Directory Properties: stable/9/lib/libcompiler_rt/ (props changed) Modified: stable/9/lib/libcompiler_rt/Makefile ============================================================================== --- stable/9/lib/libcompiler_rt/Makefile Fri May 25 17:48:45 2012 (r236015) +++ stable/9/lib/libcompiler_rt/Makefile Fri May 25 17:50:50 2012 (r236016) @@ -148,6 +148,26 @@ SRCF+= adddf3 \ umodsi3 .endif +# FreeBSD-specific atomic intrinsics. +.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" +SRCF+= __sync_fetch_and_add_4 \ + __sync_fetch_and_and_4 \ + __sync_fetch_and_or_4 \ + __sync_fetch_and_sub_4 \ + __sync_fetch_and_xor_4 \ + __sync_lock_test_and_set_4 \ + __sync_val_compare_and_swap_4 +.endif +.if ${MACHINE_ARCH:Mmips64*} != "" +SRCF+= __sync_fetch_and_add_8 \ + __sync_fetch_and_and_8 \ + __sync_fetch_and_or_8 \ + __sync_fetch_and_sub_8 \ + __sync_fetch_and_xor_8 \ + __sync_lock_test_and_set_8 \ + __sync_val_compare_and_swap_8 +.endif + .for file in ${SRCF} . if ${MACHINE_CPUARCH} != "arm" && exists(${CRTSRC}/${CRTARCH}/${file}.S) SRCS+= ${file}.S Copied: stable/9/lib/libcompiler_rt/__sync_fetch_and_add_4.c (from r228919, head/lib/libcompiler_rt/__sync_fetch_and_add_4.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_fetch_and_add_4.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_fetch_and_add_4.c) @@ -0,0 +1,6 @@ +/* $FreeBSD$ */ +#define NAME __sync_fetch_and_add_4 +#define TYPE uint32_t +#define FETCHADD(x, y) atomic_fetchadd_32(x, y) + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_fetch_and_add_8.c (from r228919, head/lib/libcompiler_rt/__sync_fetch_and_add_8.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_fetch_and_add_8.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_fetch_and_add_8.c) @@ -0,0 +1,6 @@ +/* $FreeBSD$ */ +#define NAME __sync_fetch_and_add_8 +#define TYPE uint64_t +#define FETCHADD(x, y) atomic_fetchadd_64(x, y) + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_fetch_and_and_4.c (from r228919, head/lib/libcompiler_rt/__sync_fetch_and_and_4.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_fetch_and_and_4.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_fetch_and_and_4.c) @@ -0,0 +1,7 @@ +/* $FreeBSD$ */ +#define NAME __sync_fetch_and_and_4 +#define TYPE uint32_t +#define CMPSET atomic_cmpset_32 +#define EXPRESSION t & value + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_fetch_and_and_8.c (from r228919, head/lib/libcompiler_rt/__sync_fetch_and_and_8.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_fetch_and_and_8.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_fetch_and_and_8.c) @@ -0,0 +1,7 @@ +/* $FreeBSD$ */ +#define NAME __sync_fetch_and_and_8 +#define TYPE uint64_t +#define CMPSET atomic_cmpset_64 +#define EXPRESSION t & value + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_fetch_and_op_n.h (from r228919, head/lib/libcompiler_rt/__sync_fetch_and_op_n.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_fetch_and_op_n.h Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_fetch_and_op_n.h) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2011 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +TYPE +NAME(volatile TYPE *ptr, TYPE value) +{ + TYPE t; + +#ifdef FETCHADD + t = FETCHADD(ptr, value); +#else + do { + t = *ptr; + } while (!CMPSET(ptr, t, EXPRESSION)); +#endif + + return (t); +} Copied: stable/9/lib/libcompiler_rt/__sync_fetch_and_or_4.c (from r228919, head/lib/libcompiler_rt/__sync_fetch_and_or_4.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_fetch_and_or_4.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_fetch_and_or_4.c) @@ -0,0 +1,7 @@ +/* $FreeBSD$ */ +#define NAME __sync_fetch_and_or_4 +#define TYPE uint32_t +#define CMPSET atomic_cmpset_32 +#define EXPRESSION t | value + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_fetch_and_or_8.c (from r228919, head/lib/libcompiler_rt/__sync_fetch_and_or_8.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_fetch_and_or_8.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_fetch_and_or_8.c) @@ -0,0 +1,7 @@ +/* $FreeBSD$ */ +#define NAME __sync_fetch_and_or_8 +#define TYPE uint64_t +#define CMPSET atomic_cmpset_64 +#define EXPRESSION t | value + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_fetch_and_sub_4.c (from r228919, head/lib/libcompiler_rt/__sync_fetch_and_sub_4.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_fetch_and_sub_4.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_fetch_and_sub_4.c) @@ -0,0 +1,6 @@ +/* $FreeBSD$ */ +#define NAME __sync_fetch_and_sub_4 +#define TYPE uint32_t +#define FETCHADD(x, y) atomic_fetchadd_32(x, -(y)) + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_fetch_and_sub_8.c (from r228919, head/lib/libcompiler_rt/__sync_fetch_and_sub_8.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_fetch_and_sub_8.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_fetch_and_sub_8.c) @@ -0,0 +1,6 @@ +/* $FreeBSD$ */ +#define NAME __sync_fetch_and_sub_8 +#define TYPE uint64_t +#define FETCHADD(x, y) atomic_fetchadd_64(x, -(y)) + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_fetch_and_xor_4.c (from r228919, head/lib/libcompiler_rt/__sync_fetch_and_xor_4.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_fetch_and_xor_4.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_fetch_and_xor_4.c) @@ -0,0 +1,7 @@ +/* $FreeBSD$ */ +#define NAME __sync_fetch_and_xor_4 +#define TYPE uint32_t +#define CMPSET atomic_cmpset_32 +#define EXPRESSION t ^ value + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_fetch_and_xor_8.c (from r228919, head/lib/libcompiler_rt/__sync_fetch_and_xor_8.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_fetch_and_xor_8.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_fetch_and_xor_8.c) @@ -0,0 +1,7 @@ +/* $FreeBSD$ */ +#define NAME __sync_fetch_and_xor_8 +#define TYPE uint64_t +#define CMPSET atomic_cmpset_64 +#define EXPRESSION t ^ value + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_lock_test_and_set_4.c (from r228919, head/lib/libcompiler_rt/__sync_lock_test_and_set_4.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_lock_test_and_set_4.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_lock_test_and_set_4.c) @@ -0,0 +1,7 @@ +/* $FreeBSD$ */ +#define NAME __sync_lock_test_and_set_4 +#define TYPE uint32_t +#define CMPSET atomic_cmpset_32 +#define EXPRESSION value + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_lock_test_and_set_8.c (from r228919, head/lib/libcompiler_rt/__sync_lock_test_and_set_8.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_lock_test_and_set_8.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_lock_test_and_set_8.c) @@ -0,0 +1,7 @@ +/* $FreeBSD$ */ +#define NAME __sync_lock_test_and_set_8 +#define TYPE uint64_t +#define CMPSET atomic_cmpset_64 +#define EXPRESSION value + +#include "__sync_fetch_and_op_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_val_compare_and_swap_4.c (from r228919, head/lib/libcompiler_rt/__sync_val_compare_and_swap_4.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_val_compare_and_swap_4.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_val_compare_and_swap_4.c) @@ -0,0 +1,6 @@ +/* $FreeBSD$ */ +#define NAME __sync_val_compare_and_swap_4 +#define TYPE uint32_t +#define CMPSET atomic_cmpset_32 + +#include "__sync_val_compare_and_swap_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c (from r228919, head/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_val_compare_and_swap_8.c) @@ -0,0 +1,6 @@ +/* $FreeBSD$ */ +#define NAME __sync_val_compare_and_swap_8 +#define TYPE uint64_t +#define CMPSET atomic_cmpset_64 + +#include "__sync_val_compare_and_swap_n.h" Copied: stable/9/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h (from r228919, head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h Fri May 25 17:50:50 2012 (r236016, copy of r228919, head/lib/libcompiler_rt/__sync_val_compare_and_swap_n.h) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2011 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +TYPE +NAME(volatile TYPE *ptr, TYPE oldval, TYPE newval) +{ + TYPE t; + + while (!CMPSET(ptr, oldval, newval)) { + t = *ptr; + if (t != oldval) + return (t); + } + + return (oldval); +} From owner-svn-src-all@FreeBSD.ORG Fri May 25 17:53:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77B82106566C; Fri, 25 May 2012 17:53:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 627048FC08; Fri, 25 May 2012 17:53: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 q4PHrwsk025082; Fri, 25 May 2012 17:53:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PHrw0O025080; Fri, 25 May 2012 17:53:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205251753.q4PHrw0O025080@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 May 2012 17:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236017 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:53:58 -0000 Author: adrian Date: Fri May 25 17:53:57 2012 New Revision: 236017 URL: http://svn.freebsd.org/changeset/base/236017 Log: Add some AR5416/AR5418 WAR's for power-on and suspend/resume: * Now that ah_configPCIE is called for both power on and suspend/resume, make sure the right bit(s) are cleared and set when suspending and resuming. Specifically: + force disable/enable the PCIe PHY upon suspend/resume; + reprogram the PCIe WAR register when resuming and upon power-on. * Add a recipe which powers down any PCIe PHY hardware inside the AR5416 (which is the PCI variant) to save on power. I have (currently) no way to test exactly how much power is saved, if any. Tested on: * AR5416 cardbus - although unfortunately pccard/cbb/cardbus currently detaches the NIC upon suspend, I don't think it's a proper test case. * AR5418 PCIe attached to expresscard - since we're not doing PCIe APSM, it's also not likely a full/good test case. In both instances I went through a handful of suspend/resume cycles and ensured that the STA vap reassociated correctly. TODO: * Setup a laptop to simply sit in a suspend/resume loop, making sure that the NIC always correctly comes back; * Start doing suspend/resume tests with actual traffic going on in the background, as I bet this process is all quite racy at the present; * Test adhoc/hostap mode, just to be completely sure it's working correctly; * See if I can jury rig an external power source to an AR5416 to test out whether ah_disablePCIE() works. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 17:50:50 2012 (r236016) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 17:53:57 2012 (r236017) @@ -468,18 +468,63 @@ ar5416AttachPCIE(struct ath_hal *ah) static void ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { - if (AH_PRIVATE(ah)->ah_ispcie && !restore) { + + /* This is only applicable for AR5418 (AR5416 PCIe) */ + if (! AH_PRIVATE(ah)->ah_ispcie) + return; + + if (! restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); OS_DELAY(1000); - OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); + } + + if (power_off) { /* Power-off */ + /* clear bit 19 to disable L1 */ + OS_REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); + } else { /* Power-on */ + /* Set default WAR values for Owl */ OS_REG_WRITE(ah, AR_WA, AR_WA_DEFAULT); + + /* set bit 19 to allow forcing of pcie core into L1 state */ + OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); } } +/* + * Disable PCIe PHY if PCIe isn't used. + */ static void ar5416DisablePCIE(struct ath_hal *ah) { - /* XXX TODO */ + + /* PCIe? Don't */ + if (AH_PRIVATE(ah)->ah_ispcie) + return; + + /* .. Only applicable for AR5416v2 or later */ + if (! (AR_SREV_OWL(ah) && AR_SREV_OWL_20_OR_LATER(ah))) + return; + + OS_REG_WRITE_BUFFER_ENABLE(ah); + + /* + * Disable the PCIe PHY. + */ + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x28000029); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x57160824); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x25980579); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x00000000); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x1aaabe40); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0xbe105554); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x000e1007); + + /* Load the new settings */ + OS_REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000); + + OS_REG_WRITE_BUFFER_FLUSH(ah); + OS_REG_WRITE_BUFFER_DISABLE(ah); } static void From owner-svn-src-all@FreeBSD.ORG Fri May 25 17:56:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7F31106566B; Fri, 25 May 2012 17:56:27 +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 C236E8FC0C; Fri, 25 May 2012 17:56:27 +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 q4PHuRp5025225; Fri, 25 May 2012 17:56:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PHuRYX025222; Fri, 25 May 2012 17:56:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251756.q4PHuRYX025222@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 17:56:27 +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: r236018 - in stable/9/contrib/compiler-rt: . lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:56:27 -0000 Author: marius Date: Fri May 25 17:56:27 2012 New Revision: 236018 URL: http://svn.freebsd.org/changeset/base/236018 Log: MFC: r229413 Import compiler-rt r147467. Modified: stable/9/contrib/compiler-rt/LICENSE.TXT stable/9/contrib/compiler-rt/lib/trampoline_setup.c Directory Properties: stable/9/contrib/compiler-rt/ (props changed) Modified: stable/9/contrib/compiler-rt/LICENSE.TXT ============================================================================== --- stable/9/contrib/compiler-rt/LICENSE.TXT Fri May 25 17:53:57 2012 (r236017) +++ stable/9/contrib/compiler-rt/LICENSE.TXT Fri May 25 17:56:27 2012 (r236018) @@ -14,7 +14,7 @@ Full text of the relevant licenses is in University of Illinois/NCSA Open Source License -Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT All rights reserved. @@ -55,7 +55,7 @@ SOFTWARE. ============================================================================== -Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal Modified: stable/9/contrib/compiler-rt/lib/trampoline_setup.c ============================================================================== --- stable/9/contrib/compiler-rt/lib/trampoline_setup.c Fri May 25 17:53:57 2012 (r236017) +++ stable/9/contrib/compiler-rt/lib/trampoline_setup.c Fri May 25 17:56:27 2012 (r236018) @@ -44,4 +44,4 @@ void __trampoline_setup(uint32_t* trampO /* clear instruction cache */ __clear_cache(trampOnStack, &trampOnStack[10]); } -#endif /* __ppc__ */ +#endif /* __ppc__ && !defined(__powerpc64__) */ From owner-svn-src-all@FreeBSD.ORG Fri May 25 18:14:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA7AE106566B; Fri, 25 May 2012 18:14:39 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 59C5D8FC0A; Fri, 25 May 2012 18:14:39 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 8558CC3845; Fri, 25 May 2012 20:14:27 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id zdGc9qDg+nQ3; Fri, 25 May 2012 20:14:27 +0200 (CEST) Received: from [10.0.0.112] (nat3-133.ghnet.pl [91.150.222.133]) by smtp.semihalf.com (Postfix) with ESMTPSA id CCDB9C3833; Fri, 25 May 2012 20:14:26 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: Date: Fri, 25 May 2012 20:14:36 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205251513.q4PFDtrU017459@svn.freebsd.org> <4FBFA517.8080601@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236000 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 18:14:39 -0000 On 2012-05-25, at 19:06, Rafal Jaworowski wrote: >=20 > On 2012-05-25, at 17:28, Nathan Whitehorn wrote: >=20 >> On 05/25/12 10:13, Rafal Jaworowski wrote: >>> Author: raj >>> Date: Fri May 25 15:13:55 2012 >>> New Revision: 236000 >>> URL: http://svn.freebsd.org/changeset/base/236000 >>>=20 >>> Log: >>> Missing vm_paddr_t bits which should have been part of r235936. >>=20 >> I think you also need equivalent changes to aim/mmu_oea64.c. >=20 > Yes, but the GENERIC64 build appears currently broken, so I could not = compile test it. Sorry for the noise, I had some old powerpc64 build env locally, the = build is fine. I'll commit the vm_paddr_t fix shortly. Rafal From owner-svn-src-all@FreeBSD.ORG Fri May 25 18:17:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E11C41065670; Fri, 25 May 2012 18:17: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 C93358FC18; Fri, 25 May 2012 18:17: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 q4PIHQQS026085; Fri, 25 May 2012 18:17:26 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PIHQDJ026083; Fri, 25 May 2012 18:17:26 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205251817.q4PIHQDJ026083@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 25 May 2012 18:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236019 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 18:17:27 -0000 Author: raj Date: Fri May 25 18:17:26 2012 New Revision: 236019 URL: http://svn.freebsd.org/changeset/base/236019 Log: Fix physical address type to vm_paddr_t also for powerpc64. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri May 25 17:56:27 2012 (r236018) +++ head/sys/powerpc/aim/mmu_oea64.c Fri May 25 18:17:26 2012 (r236019) @@ -306,7 +306,7 @@ boolean_t moea64_is_modified(mmu_t, vm_p boolean_t moea64_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea64_is_referenced(mmu_t, vm_page_t); boolean_t moea64_ts_referenced(mmu_t, vm_page_t); -vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int); +vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea64_page_exists_quick(mmu_t, pmap_t, vm_page_t); int moea64_page_wired_mappings(mmu_t, vm_page_t); void moea64_pinit(mmu_t, pmap_t); @@ -324,14 +324,14 @@ void moea64_zero_page_area(mmu_t, vm_pag void moea64_zero_page_idle(mmu_t, vm_page_t); void moea64_activate(mmu_t, struct thread *); void moea64_deactivate(mmu_t, struct thread *); -void *moea64_mapdev(mmu_t, vm_offset_t, vm_size_t); +void *moea64_mapdev(mmu_t, vm_paddr_t, vm_size_t); void *moea64_mapdev_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t); void moea64_unmapdev(mmu_t, vm_offset_t, vm_size_t); -vm_offset_t moea64_kextract(mmu_t, vm_offset_t); +vm_paddr_t moea64_kextract(mmu_t, vm_offset_t); void moea64_page_set_memattr(mmu_t, vm_page_t m, vm_memattr_t ma); void moea64_kenter_attr(mmu_t, vm_offset_t, vm_offset_t, vm_memattr_t ma); -void moea64_kenter(mmu_t, vm_offset_t, vm_offset_t); -boolean_t moea64_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); +void moea64_kenter(mmu_t, vm_offset_t, vm_paddr_t); +boolean_t moea64_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); static void moea64_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); static mmu_method_t moea64_methods[] = { @@ -1641,7 +1641,7 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_ } void -moea64_kenter(mmu_t mmu, vm_offset_t va, vm_offset_t pa) +moea64_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa) { moea64_kenter_attr(mmu, va, pa, VM_MEMATTR_DEFAULT); @@ -1651,7 +1651,7 @@ moea64_kenter(mmu_t mmu, vm_offset_t va, * Extract the physical page address associated with the given kernel virtual * address. */ -vm_offset_t +vm_paddr_t moea64_kextract(mmu_t mmu, vm_offset_t va) { struct pvo_entry *pvo; @@ -1692,8 +1692,8 @@ moea64_kremove(mmu_t mmu, vm_offset_t va * first usable address after the mapped region. */ vm_offset_t -moea64_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start, - vm_offset_t pa_end, int prot) +moea64_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa_start, + vm_paddr_t pa_end, int prot) { vm_offset_t sva, va; @@ -2440,7 +2440,7 @@ moea64_clear_bit(mmu_t mmu, vm_page_t m, } boolean_t -moea64_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea64_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { struct pvo_entry *pvo, key; vm_offset_t ppa; @@ -2493,7 +2493,7 @@ moea64_mapdev_attr(mmu_t mmu, vm_offset_ } void * -moea64_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea64_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { return moea64_mapdev_attr(mmu, pa, size, VM_MEMATTR_DEFAULT); From owner-svn-src-all@FreeBSD.ORG Fri May 25 19:36:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17111106564A; Fri, 25 May 2012 19:36:31 +0000 (UTC) (envelope-from Cy.Schubert@komquats.com) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id B692E8FC14; Fri, 25 May 2012 19:36:30 +0000 (UTC) Received: from pd2ml1so-ssvc.prod.shaw.ca ([10.0.141.139]) by pd2mo1so-svcs.prod.shaw.ca with ESMTP; 25 May 2012 13:36:30 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=2TvZ7eE48NdEYeaL5Xf58dNzJU178UzT+2lxUZ5Mhss= c=1 sm=1 a=jlShZm689jMA:10 a=QrugwKR0C_UA:10 a=wAGQQ9Az6v0A:10 a=BLceEmwcHowA:10 a=ICAaq7hcmGcA:10 a=kj9zAlcOel0A:10 a=IbtKDeXwb2+SRU442/pi3A==:17 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=7MS6cYxJ5hD-Fg6uabkA:9 a=CjuIK1q_8ugA:10 a=V7tsTZBp22UA:10 a=SV7veod9ZcQA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO spqr.komquats.com) ([96.50.7.119]) by pd2ml1so-dmz.prod.shaw.ca with ESMTP; 25 May 2012 13:36:30 -0600 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTP id D5D57D0; Fri, 25 May 2012 12:36:29 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.14.5/8.14.5) with ESMTP id q4PJaT6a004609; Fri, 25 May 2012 12:36:29 -0700 (PDT) (envelope-from Cy.Schubert@komquats.com) Message-Id: <201205251936.q4PJaT6a004609@slippy.cwsent.com> X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.3 From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.komquats.com/ To: Konstantin Belousov In-Reply-To: Message from Konstantin Belousov of "Wed, 23 May 2012 17:10:23 -0000." <201205231710.q4NHAN9s085383@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 25 May 2012 12:36:29 -0700 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235847 - in head/sys/modules/drm2: . drm2 i915kms X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Cy Schubert List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 19:36:31 -0000 In message <201205231710.q4NHAN9s085383@svn.freebsd.org>, Konstantin Belousov w rites: > Author: kib > Date: Wed May 23 17:10:22 2012 > New Revision: 235847 > URL: http://svn.freebsd.org/changeset/base/235847 > > Log: > The drm2 modules makefiles commit. > Still not attached to the build. > > Sponsored by: The FreeBSD Foundation > MFC after: 1 month > Thank you. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@FreeBSD.ORG Fri May 25 19:45:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3DF6106566B; Fri, 25 May 2012 19:45:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEE8A8FC0A; Fri, 25 May 2012 19:45:01 +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 q4PJj13Y029638; Fri, 25 May 2012 19:45:01 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PJj1o6029637; Fri, 25 May 2012 19:45:01 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201205251945.q4PJj1o6029637@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 25 May 2012 19:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236020 - head/sbin/init X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 19:45:01 -0000 Author: jilles Date: Fri May 25 19:45:01 2012 New Revision: 236020 URL: http://svn.freebsd.org/changeset/base/236020 Log: init: Remove unnecessary 2-second delay before calling reboot(2). Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Fri May 25 18:17:26 2012 (r236019) +++ head/sbin/init/init.c Fri May 25 19:45:01 2012 (r236020) @@ -646,8 +646,6 @@ single_user(void) if (Reboot) { /* Instead of going single user, let's reboot the machine */ sync(); - alarm(2); - pause(); reboot(howto); _exit(0); } From owner-svn-src-all@FreeBSD.ORG Fri May 25 19:56:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1918106566B; Fri, 25 May 2012 19:56:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBCDE8FC0C; Fri, 25 May 2012 19:56: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 q4PJueq5030166; Fri, 25 May 2012 19:56:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PJue87030164; Fri, 25 May 2012 19:56:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251956.q4PJue87030164@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 19:56: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: r236021 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 19:56:41 -0000 Author: marius Date: Fri May 25 19:56:40 2012 New Revision: 236021 URL: http://svn.freebsd.org/changeset/base/236021 Log: MFC: r235681 Rewrite nd6_sysctl_{d,p}rlist() to avoid misaligned accesses to char arrays casted to structs by getting rid of these buffers entirely. In r169832, it was tried to paper over this issue by 32-bit aligning the buffers. Depending on compiler optimizations that still was insufficient for 64-bit architectures with strong alignment requirements though. While at it, add comments regarding the total lack of locking in this area. Tested by: bz Reviewed by: bz (slightly earlier version), yongari (earlier version) Modified: stable/9/sys/netinet6/nd6.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/netinet6/nd6.c ============================================================================== --- stable/9/sys/netinet6/nd6.c Fri May 25 19:45:01 2012 (r236020) +++ stable/9/sys/netinet6/nd6.c Fri May 25 19:56:40 2012 (r236021) @@ -2275,128 +2275,101 @@ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6 static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) { - int error; - char buf[1024] __aligned(4); - struct in6_defrouter *d, *de; + struct in6_defrouter d; struct nd_defrouter *dr; + int error; if (req->newptr) - return EPERM; - error = 0; + return (EPERM); + bzero(&d, sizeof(d)); + d.rtaddr.sin6_family = AF_INET6; + d.rtaddr.sin6_len = sizeof(d.rtaddr); + + /* + * XXX locking + */ TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { - d = (struct in6_defrouter *)buf; - de = (struct in6_defrouter *)(buf + sizeof(buf)); - - if (d + 1 <= de) { - bzero(d, sizeof(*d)); - d->rtaddr.sin6_family = AF_INET6; - d->rtaddr.sin6_len = sizeof(d->rtaddr); - d->rtaddr.sin6_addr = dr->rtaddr; - error = sa6_recoverscope(&d->rtaddr); - if (error != 0) - return (error); - d->flags = dr->flags; - d->rtlifetime = dr->rtlifetime; - d->expire = dr->expire; - d->if_index = dr->ifp->if_index; - } else - panic("buffer too short"); - - error = SYSCTL_OUT(req, buf, sizeof(*d)); - if (error) - break; + d.rtaddr.sin6_addr = dr->rtaddr; + error = sa6_recoverscope(&d.rtaddr); + if (error != 0) + return (error); + d.flags = dr->flags; + d.rtlifetime = dr->rtlifetime; + d.expire = dr->expire; + d.if_index = dr->ifp->if_index; + error = SYSCTL_OUT(req, &d, sizeof(d)); + if (error != 0) + return (error); } - - return (error); + return (0); } static int nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) { - int error; - char buf[1024] __aligned(4); - struct in6_prefix *p, *pe; + struct in6_prefix p; + struct sockaddr_in6 s6; struct nd_prefix *pr; + struct nd_pfxrouter *pfr; + time_t maxexpire; + int error; char ip6buf[INET6_ADDRSTRLEN]; if (req->newptr) - return EPERM; - error = 0; + return (EPERM); + bzero(&p, sizeof(p)); + p.origin = PR_ORIG_RA; + bzero(&s6, sizeof(s6)); + s6.sin6_family = AF_INET6; + s6.sin6_len = sizeof(s6); + + /* + * XXX locking + */ LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { - u_short advrtrs; - size_t advance; - struct sockaddr_in6 *sin6, *s6; - struct nd_pfxrouter *pfr; - - p = (struct in6_prefix *)buf; - pe = (struct in6_prefix *)(buf + sizeof(buf)); - - if (p + 1 <= pe) { - bzero(p, sizeof(*p)); - sin6 = (struct sockaddr_in6 *)(p + 1); - - p->prefix = pr->ndpr_prefix; - if (sa6_recoverscope(&p->prefix)) { + p.prefix = pr->ndpr_prefix; + if (sa6_recoverscope(&p.prefix)) { + log(LOG_ERR, "scope error in prefix list (%s)\n", + ip6_sprintf(ip6buf, &p.prefix.sin6_addr)); + /* XXX: press on... */ + } + p.raflags = pr->ndpr_raf; + p.prefixlen = pr->ndpr_plen; + p.vltime = pr->ndpr_vltime; + p.pltime = pr->ndpr_pltime; + p.if_index = pr->ndpr_ifp->if_index; + if (pr->ndpr_vltime == ND6_INFINITE_LIFETIME) + p.expire = 0; + else { + /* XXX: we assume time_t is signed. */ + maxexpire = (-1) & + ~((time_t)1 << ((sizeof(maxexpire) * 8) - 1)); + if (pr->ndpr_vltime < maxexpire - pr->ndpr_lastupdate) + p.expire = pr->ndpr_lastupdate + + pr->ndpr_vltime; + else + p.expire = maxexpire; + } + p.refcnt = pr->ndpr_refcnt; + p.flags = pr->ndpr_stateflags; + p.advrtrs = 0; + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) + p.advrtrs++; + error = SYSCTL_OUT(req, &p, sizeof(p)); + if (error != 0) + return (error); + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { + s6.sin6_addr = pfr->router->rtaddr; + if (sa6_recoverscope(&s6)) log(LOG_ERR, "scope error in prefix list (%s)\n", - ip6_sprintf(ip6buf, &p->prefix.sin6_addr)); - /* XXX: press on... */ - } - p->raflags = pr->ndpr_raf; - p->prefixlen = pr->ndpr_plen; - p->vltime = pr->ndpr_vltime; - p->pltime = pr->ndpr_pltime; - p->if_index = pr->ndpr_ifp->if_index; - if (pr->ndpr_vltime == ND6_INFINITE_LIFETIME) - p->expire = 0; - else { - time_t maxexpire; - - /* XXX: we assume time_t is signed. */ - maxexpire = (-1) & - ~((time_t)1 << - ((sizeof(maxexpire) * 8) - 1)); - if (pr->ndpr_vltime < - maxexpire - pr->ndpr_lastupdate) { - p->expire = pr->ndpr_lastupdate + - pr->ndpr_vltime; - } else - p->expire = maxexpire; - } - p->refcnt = pr->ndpr_refcnt; - p->flags = pr->ndpr_stateflags; - p->origin = PR_ORIG_RA; - advrtrs = 0; - LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { - if ((void *)&sin6[advrtrs + 1] > (void *)pe) { - advrtrs++; - continue; - } - s6 = &sin6[advrtrs]; - bzero(s6, sizeof(*s6)); - s6->sin6_family = AF_INET6; - s6->sin6_len = sizeof(*sin6); - s6->sin6_addr = pfr->router->rtaddr; - if (sa6_recoverscope(s6)) { - log(LOG_ERR, - "scope error in " - "prefix list (%s)\n", - ip6_sprintf(ip6buf, - &pfr->router->rtaddr)); - } - advrtrs++; - } - p->advrtrs = advrtrs; - } else - panic("buffer too short"); - - advance = sizeof(*p) + sizeof(*sin6) * advrtrs; - error = SYSCTL_OUT(req, buf, advance); - if (error) - break; + ip6_sprintf(ip6buf, &pfr->router->rtaddr)); + error = SYSCTL_OUT(req, &s6, sizeof(s6)); + if (error != 0) + return (error); + } } - - return (error); + return (0); } From owner-svn-src-all@FreeBSD.ORG Fri May 25 19:57:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33DAD106568D; Fri, 25 May 2012 19:57:02 +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 1DA9F8FC0A; Fri, 25 May 2012 19:57: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 q4PJv122030216; Fri, 25 May 2012 19:57:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PJv1T8030213; Fri, 25 May 2012 19:57:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251957.q4PJv1T8030213@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 19:57:01 +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: r236022 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 19:57:02 -0000 Author: marius Date: Fri May 25 19:57:01 2012 New Revision: 236022 URL: http://svn.freebsd.org/changeset/base/236022 Log: MFC: r235681 Rewrite nd6_sysctl_{d,p}rlist() to avoid misaligned accesses to char arrays casted to structs by getting rid of these buffers entirely. In r169832, it was tried to paper over this issue by 32-bit aligning the buffers. Depending on compiler optimizations that still was insufficient for 64-bit architectures with strong alignment requirements though. While at it, add comments regarding the total lack of locking in this area. Tested by: bz Reviewed by: bz (slightly earlier version), yongari (earlier version) Modified: stable/8/sys/netinet6/nd6.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) Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Fri May 25 19:56:40 2012 (r236021) +++ stable/8/sys/netinet6/nd6.c Fri May 25 19:57:01 2012 (r236022) @@ -2146,128 +2146,101 @@ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6 static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) { - int error; - char buf[1024] __aligned(4); - struct in6_defrouter *d, *de; + struct in6_defrouter d; struct nd_defrouter *dr; + int error; if (req->newptr) - return EPERM; - error = 0; + return (EPERM); + bzero(&d, sizeof(d)); + d.rtaddr.sin6_family = AF_INET6; + d.rtaddr.sin6_len = sizeof(d.rtaddr); + + /* + * XXX locking + */ TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { - d = (struct in6_defrouter *)buf; - de = (struct in6_defrouter *)(buf + sizeof(buf)); - - if (d + 1 <= de) { - bzero(d, sizeof(*d)); - d->rtaddr.sin6_family = AF_INET6; - d->rtaddr.sin6_len = sizeof(d->rtaddr); - d->rtaddr.sin6_addr = dr->rtaddr; - error = sa6_recoverscope(&d->rtaddr); - if (error != 0) - return (error); - d->flags = dr->flags; - d->rtlifetime = dr->rtlifetime; - d->expire = dr->expire; - d->if_index = dr->ifp->if_index; - } else - panic("buffer too short"); - - error = SYSCTL_OUT(req, buf, sizeof(*d)); - if (error) - break; + d.rtaddr.sin6_addr = dr->rtaddr; + error = sa6_recoverscope(&d.rtaddr); + if (error != 0) + return (error); + d.flags = dr->flags; + d.rtlifetime = dr->rtlifetime; + d.expire = dr->expire; + d.if_index = dr->ifp->if_index; + error = SYSCTL_OUT(req, &d, sizeof(d)); + if (error != 0) + return (error); } - - return (error); + return (0); } static int nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) { - int error; - char buf[1024] __aligned(4); - struct in6_prefix *p, *pe; + struct in6_prefix p; + struct sockaddr_in6 s6; struct nd_prefix *pr; + struct nd_pfxrouter *pfr; + time_t maxexpire; + int error; char ip6buf[INET6_ADDRSTRLEN]; if (req->newptr) - return EPERM; - error = 0; + return (EPERM); + bzero(&p, sizeof(p)); + p.origin = PR_ORIG_RA; + bzero(&s6, sizeof(s6)); + s6.sin6_family = AF_INET6; + s6.sin6_len = sizeof(s6); + + /* + * XXX locking + */ LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { - u_short advrtrs; - size_t advance; - struct sockaddr_in6 *sin6, *s6; - struct nd_pfxrouter *pfr; - - p = (struct in6_prefix *)buf; - pe = (struct in6_prefix *)(buf + sizeof(buf)); - - if (p + 1 <= pe) { - bzero(p, sizeof(*p)); - sin6 = (struct sockaddr_in6 *)(p + 1); - - p->prefix = pr->ndpr_prefix; - if (sa6_recoverscope(&p->prefix)) { + p.prefix = pr->ndpr_prefix; + if (sa6_recoverscope(&p.prefix)) { + log(LOG_ERR, "scope error in prefix list (%s)\n", + ip6_sprintf(ip6buf, &p.prefix.sin6_addr)); + /* XXX: press on... */ + } + p.raflags = pr->ndpr_raf; + p.prefixlen = pr->ndpr_plen; + p.vltime = pr->ndpr_vltime; + p.pltime = pr->ndpr_pltime; + p.if_index = pr->ndpr_ifp->if_index; + if (pr->ndpr_vltime == ND6_INFINITE_LIFETIME) + p.expire = 0; + else { + /* XXX: we assume time_t is signed. */ + maxexpire = (-1) & + ~((time_t)1 << ((sizeof(maxexpire) * 8) - 1)); + if (pr->ndpr_vltime < maxexpire - pr->ndpr_lastupdate) + p.expire = pr->ndpr_lastupdate + + pr->ndpr_vltime; + else + p.expire = maxexpire; + } + p.refcnt = pr->ndpr_refcnt; + p.flags = pr->ndpr_stateflags; + p.advrtrs = 0; + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) + p.advrtrs++; + error = SYSCTL_OUT(req, &p, sizeof(p)); + if (error != 0) + return (error); + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { + s6.sin6_addr = pfr->router->rtaddr; + if (sa6_recoverscope(&s6)) log(LOG_ERR, "scope error in prefix list (%s)\n", - ip6_sprintf(ip6buf, &p->prefix.sin6_addr)); - /* XXX: press on... */ - } - p->raflags = pr->ndpr_raf; - p->prefixlen = pr->ndpr_plen; - p->vltime = pr->ndpr_vltime; - p->pltime = pr->ndpr_pltime; - p->if_index = pr->ndpr_ifp->if_index; - if (pr->ndpr_vltime == ND6_INFINITE_LIFETIME) - p->expire = 0; - else { - time_t maxexpire; - - /* XXX: we assume time_t is signed. */ - maxexpire = (-1) & - ~((time_t)1 << - ((sizeof(maxexpire) * 8) - 1)); - if (pr->ndpr_vltime < - maxexpire - pr->ndpr_lastupdate) { - p->expire = pr->ndpr_lastupdate + - pr->ndpr_vltime; - } else - p->expire = maxexpire; - } - p->refcnt = pr->ndpr_refcnt; - p->flags = pr->ndpr_stateflags; - p->origin = PR_ORIG_RA; - advrtrs = 0; - LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { - if ((void *)&sin6[advrtrs + 1] > (void *)pe) { - advrtrs++; - continue; - } - s6 = &sin6[advrtrs]; - bzero(s6, sizeof(*s6)); - s6->sin6_family = AF_INET6; - s6->sin6_len = sizeof(*sin6); - s6->sin6_addr = pfr->router->rtaddr; - if (sa6_recoverscope(s6)) { - log(LOG_ERR, - "scope error in " - "prefix list (%s)\n", - ip6_sprintf(ip6buf, - &pfr->router->rtaddr)); - } - advrtrs++; - } - p->advrtrs = advrtrs; - } else - panic("buffer too short"); - - advance = sizeof(*p) + sizeof(*sin6) * advrtrs; - error = SYSCTL_OUT(req, buf, advance); - if (error) - break; + ip6_sprintf(ip6buf, &pfr->router->rtaddr)); + error = SYSCTL_OUT(req, &s6, sizeof(s6)); + if (error != 0) + return (error); + } } - - return (error); + return (0); } From owner-svn-src-all@FreeBSD.ORG Fri May 25 20:33:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C978106566C; Fri, 25 May 2012 20:33:35 +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 76D788FC1C; Fri, 25 May 2012 20:33: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 q4PKXZXK031825; Fri, 25 May 2012 20:33:35 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PKXZqG031813; Fri, 25 May 2012 20:33:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205252033.q4PKXZqG031813@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 25 May 2012 20:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236023 - in head/sys: geom/part sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 20:33:35 -0000 Author: marcel Date: Fri May 25 20:33:34 2012 New Revision: 236023 URL: http://svn.freebsd.org/changeset/base/236023 Log: Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes. The gpart alias for these partition types is "freebsd-nandfs". Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_apm.c head/sys/geom/part/g_part_bsd.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_vtoc8.c head/sys/sys/apm.h head/sys/sys/disklabel.h head/sys/sys/gpt.h head/sys/sys/vtoc.h Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part.c Fri May 25 20:33:34 2012 (r236023) @@ -83,6 +83,7 @@ struct g_part_alias_list { { "fat32", G_PART_ALIAS_MS_FAT32 }, { "freebsd", G_PART_ALIAS_FREEBSD }, { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT }, + { "freebsd-nandfs", G_PART_ALIAS_FREEBSD_NANDFS }, { "freebsd-swap", G_PART_ALIAS_FREEBSD_SWAP }, { "freebsd-ufs", G_PART_ALIAS_FREEBSD_UFS }, { "freebsd-vinum", G_PART_ALIAS_FREEBSD_VINUM }, Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part.h Fri May 25 20:33:34 2012 (r236023) @@ -46,6 +46,7 @@ enum g_part_alias { G_PART_ALIAS_EFI, /* A EFI system partition entry. */ G_PART_ALIAS_FREEBSD, /* A BSD labeled partition entry. */ G_PART_ALIAS_FREEBSD_BOOT, /* A FreeBSD boot partition entry. */ + G_PART_ALIAS_FREEBSD_NANDFS, /* A FreeBSD nandfs partition entry. */ G_PART_ALIAS_FREEBSD_SWAP, /* A swap partition entry. */ G_PART_ALIAS_FREEBSD_UFS, /* A UFS/UFS2 file system entry. */ G_PART_ALIAS_FREEBSD_VINUM, /* A Vinum partition entry. */ Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_apm.c Fri May 25 20:33:34 2012 (r236023) @@ -159,6 +159,11 @@ apm_parse_type(const char *type, char *b strcpy(buf, APM_ENT_TYPE_FREEBSD); return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + strcpy(buf, APM_ENT_TYPE_FREEBSD_NANDFS); + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { strcpy(buf, APM_ENT_TYPE_FREEBSD_SWAP); @@ -485,6 +490,8 @@ g_part_apm_type(struct g_part_table *bas return (g_part_alias_name(G_PART_ALIAS_APPLE_UFS)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); + if (!strcmp(type, APM_ENT_TYPE_FREEBSD_NANDFS)) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD_SWAP)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD_UFS)) Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_bsd.c Fri May 25 20:33:34 2012 (r236023) @@ -126,6 +126,11 @@ bsd_parse_type(const char *type, uint8_t *fstype = (u_int)lt; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + *fstype = FS_NANDFS; + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { *fstype = FS_SWAP; @@ -450,6 +455,8 @@ g_part_bsd_type(struct g_part_table *bas entry = (struct g_part_bsd_entry *)baseentry; type = entry->part.p_fstype; + if (type == FS_NANDFS) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (type == FS_SWAP) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (type == FS_BSDFFS) Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_gpt.c Fri May 25 20:33:34 2012 (r236023) @@ -155,6 +155,7 @@ static struct uuid gpt_uuid_bios_boot = static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI; static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static struct uuid gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; +static struct uuid gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; static struct uuid gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; static struct uuid gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; static struct uuid gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; @@ -195,6 +196,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_efi, G_PART_ALIAS_EFI, 0xee }, { &gpt_uuid_freebsd, G_PART_ALIAS_FREEBSD, 0xa5 }, { &gpt_uuid_freebsd_boot, G_PART_ALIAS_FREEBSD_BOOT, 0 }, + { &gpt_uuid_freebsd_nandfs, G_PART_ALIAS_FREEBSD_NANDFS, 0 }, { &gpt_uuid_freebsd_swap, G_PART_ALIAS_FREEBSD_SWAP, 0 }, { &gpt_uuid_freebsd_ufs, G_PART_ALIAS_FREEBSD_UFS, 0 }, { &gpt_uuid_freebsd_vinum, G_PART_ALIAS_FREEBSD_VINUM, 0 }, Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_vtoc8.c Fri May 25 20:33:34 2012 (r236023) @@ -114,6 +114,11 @@ vtoc8_parse_type(const char *type, uint1 *tag = (uint16_t)lt; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + *tag = VTOC_TAG_FREEBSD_NANDFS; + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { *tag = VTOC_TAG_FREEBSD_SWAP; @@ -487,6 +492,8 @@ g_part_vtoc8_type(struct g_part_table *b table = (struct g_part_vtoc8_table *)basetable; tag = be16dec(&table->vtoc.part[entry->gpe_index - 1].tag); + if (tag == VTOC_TAG_FREEBSD_NANDFS) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (tag == VTOC_TAG_FREEBSD_SWAP) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (tag == VTOC_TAG_FREEBSD_UFS) Modified: head/sys/sys/apm.h ============================================================================== --- head/sys/sys/apm.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/apm.h Fri May 25 20:33:34 2012 (r236023) @@ -56,6 +56,7 @@ struct apm_ent { #define APM_ENT_TYPE_UNUSED "Apple_Free" #define APM_ENT_TYPE_FREEBSD "FreeBSD" +#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" #define APM_ENT_TYPE_FREEBSD_SWAP "FreeBSD-swap" #define APM_ENT_TYPE_FREEBSD_UFS "FreeBSD-UFS" #define APM_ENT_TYPE_FREEBSD_VINUM "FreeBSD-Vinum" Modified: head/sys/sys/disklabel.h ============================================================================== --- head/sys/sys/disklabel.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/disklabel.h Fri May 25 20:33:34 2012 (r236023) @@ -232,6 +232,7 @@ static const char *dktypenames[] = { #define FS_UDF 24 /* UDF */ #define FS_EFS 26 /* SGI's Extent File system */ #define FS_ZFS 27 /* Sun's ZFS */ +#define FS_NANDFS 30 /* FreeBSD nandfs (NiLFS derived) */ #ifdef FSTYPENAMES static const char *fstypenames[] = { @@ -263,6 +264,9 @@ static const char *fstypenames[] = { "?", "EFS", "ZFS", + "?", + "?", + "nandfs", NULL }; #define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/gpt.h Fri May 25 20:33:34 2012 (r236023) @@ -79,6 +79,10 @@ struct gpt_ent { {0x024dee41,0x33e7,0x11d3,0x9d,0x69,{0x00,0x08,0xc7,0x81,0xf3,0x9f}} #define GPT_ENT_TYPE_FREEBSD \ {0x516e7cb4,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_FREEBSD_BOOT \ + {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} +#define GPT_ENT_TYPE_FREEBSD_NANDFS \ + {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} #define GPT_ENT_TYPE_FREEBSD_SWAP \ {0x516e7cb5,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_UFS \ @@ -87,8 +91,6 @@ struct gpt_ent { {0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_ZFS \ {0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} -#define GPT_ENT_TYPE_FREEBSD_BOOT \ - {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} /* * The following are unused but documented here to avoid reuse. Modified: head/sys/sys/vtoc.h ============================================================================== --- head/sys/sys/vtoc.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/vtoc.h Fri May 25 20:33:34 2012 (r236023) @@ -51,6 +51,7 @@ #define VTOC_TAG_FREEBSD_UFS 0x0902 #define VTOC_TAG_FREEBSD_VINUM 0x0903 #define VTOC_TAG_FREEBSD_ZFS 0x0904 +#define VTOC_TAG_FREEBSD_NANDFS 0x0905 #define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */ #define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ From owner-svn-src-all@FreeBSD.ORG Fri May 25 20:43:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F696106564A; Fri, 25 May 2012 20:43:39 +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 49ADF8FC08; Fri, 25 May 2012 20:43:39 +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 q4PKhd10032253; Fri, 25 May 2012 20:43:39 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PKhdpQ032250; Fri, 25 May 2012 20:43:39 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205252043.q4PKhdpQ032250@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 25 May 2012 20:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236024 - head/sys/boot/fdt/dts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 20:43:39 -0000 Author: raj Date: Fri May 25 20:43:38 2012 New Revision: 236024 URL: http://svn.freebsd.org/changeset/base/236024 Log: Import DTS files for the upcoming DPAA QorIQ (PowerPC) support. - P2041RDB - P3041DS - P5020DS Obtained from: Freescale Added: head/sys/boot/fdt/dts/p2041rdb.dts (contents, props changed) head/sys/boot/fdt/dts/p2041si.dtsi (contents, props changed) head/sys/boot/fdt/dts/p3041si.dtsi (contents, props changed) head/sys/boot/fdt/dts/p5020ds.dts (contents, props changed) head/sys/boot/fdt/dts/p5020si.dtsi (contents, props changed) Modified: head/sys/boot/fdt/dts/p3041ds.dts Added: head/sys/boot/fdt/dts/p2041rdb.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/p2041rdb.dts Fri May 25 20:43:38 2012 (r236024) @@ -0,0 +1,490 @@ +/* + * P2041RDB Device Tree Source + * + * Copyright 2011 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* $FreeBSD$ */ + +/include/ "p2041si.dtsi" + +/ { + model = "fsl,P2041RDB"; + compatible = "fsl,P2041RDB"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&mpic>; + + aliases { + phy_rgmii_0 = &phy_rgmii_0; + phy_rgmii_1 = &phy_rgmii_1; + phy_sgmii_2 = &phy_sgmii_2; + phy_sgmii_3 = &phy_sgmii_3; + phy_sgmii_4 = &phy_sgmii_4; + phy_sgmii_1c = &phy_sgmii_1c; + phy_sgmii_1d = &phy_sgmii_1d; + phy_sgmii_1e = &phy_sgmii_1e; + phy_sgmii_1f = &phy_sgmii_1f; + phy_xgmii_2 = &phy_xgmii_2; + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x00000000 0x00000000 0x80000000>; + }; + + dcsr: dcsr@f00000000 { + ranges = <0x00000000 0xf 0x00000000 0x01008000>; + }; + + bman-portals@ff4000000 { + bman-portal@0 { + cpu-handle = <&cpu0>; + }; + bman-portal@4000 { + cpu-handle = <&cpu1>; + }; + bman-portal@8000 { + cpu-handle = <&cpu2>; + }; + bman-portal@c000 { + cpu-handle = <&cpu3>; + }; + bman-portal@10000 { + }; + bman-portal@14000 { + }; + bman-portal@18000 { + }; + bman-portal@1c000 { + }; + bman-portal@20000 { + }; + bman-portal@24000 { + }; + + buffer-pool@0 { + compatible = "fsl,p2041-bpool", "fsl,bpool"; + fsl,bpid = <0>; + fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; + }; + }; + + qman-portals@ff4200000 { + qportal0: qman-portal@0 { + cpu-handle = <&cpu0>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal1: qman-portal@4000 { + cpu-handle = <&cpu1>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal2: qman-portal@8000 { + cpu-handle = <&cpu2>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal3: qman-portal@c000 { + cpu-handle = <&cpu3>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal4: qman-portal@10000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal5: qman-portal@14000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal6: qman-portal@18000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal7: qman-portal@1c000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal8: qman-portal@20000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal9: qman-portal@24000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + }; + + soc: soc@ffe000000 { + spi@110000 { + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spansion,s25sl12801"; + reg = <0>; + spi-max-frequency = <40000000>; /* input clock */ + partition@u-boot { + label = "u-boot"; + reg = <0x00000000 0x00100000>; + read-only; + }; + partition@kernel { + label = "kernel"; + reg = <0x00100000 0x00500000>; + read-only; + }; + partition@dtb { + label = "dtb"; + reg = <0x00600000 0x00100000>; + read-only; + }; + partition@fs { + label = "file system"; + reg = <0x00700000 0x00900000>; + }; + }; + }; + + i2c@118000 { + lm75b@48 { + compatible = "nxp,lm75a"; + reg = <0x48>; + }; + eeprom@50 { + compatible = "at24,24c256"; + reg = <0x50>; + }; + rtc@68 { + compatible = "pericom,pt7c4338"; + reg = <0x68>; + }; + }; + + i2c@118100 { + eeprom@50 { + compatible = "at24,24c256"; + reg = <0x50>; + }; + }; + + usb1: usb@211000 { + dr_mode = "host"; + }; + + pme: pme@316000 { + /* Commented out, use default allocation */ + /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ + /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ + }; + + qman: qman@318000 { + /* Commented out, use default allocation */ + /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ + /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ + }; + + bman: bman@31a000 { + /* Same as fsl,qman-*, use default allocation */ + /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ + }; + + fman0: fman@400000 { + enet0: ethernet@e0000 { + tbi-handle = <&tbi0>; + phy-handle = <&phy_sgmii_2>; + phy-connection-type = "sgmii"; + }; + + mdio0: mdio@e1120 { + tbi0: tbi-phy@8 { + reg = <0x8>; + device_type = "tbi-phy"; + }; + + phy_rgmii_0: ethernet-phy@0 { + reg = <0x0>; + }; + phy_rgmii_1: ethernet-phy@1 { + reg = <0x1>; + }; + phy_sgmii_2: ethernet-phy@2 { + reg = <0x2>; + }; + phy_sgmii_3: ethernet-phy@3 { + reg = <0x3>; + }; + phy_sgmii_4: ethernet-phy@4 { + reg = <0x4>; + }; + phy_sgmii_1c: ethernet-phy@1c { + reg = <0x1c>; + }; + phy_sgmii_1d: ethernet-phy@1d { + reg = <0x1d>; + }; + phy_sgmii_1e: ethernet-phy@1e { + reg = <0x1e>; + }; + phy_sgmii_1f: ethernet-phy@1f { + reg = <0x1f>; + }; + }; + + enet1: ethernet@e2000 { + tbi-handle = <&tbi1>; + phy-handle = <&phy_sgmii_3>; + phy-connection-type = "sgmii"; + }; + + mdio@e3120 { + tbi1: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet2: ethernet@e4000 { + tbi-handle = <&tbi2>; + phy-handle = <&phy_sgmii_4>; + phy-connection-type = "sgmii"; + }; + + mdio@e5120 { + tbi2: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet3: ethernet@e6000 { + tbi-handle = <&tbi3>; + phy-handle = <&phy_rgmii_1>; + phy-connection-type = "rgmii"; + }; + + mdio@e7120 { + tbi3: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet4: ethernet@e8000 { + tbi-handle = <&tbi4>; + phy-handle = <&phy_rgmii_0>; + phy-connection-type = "rgmii"; + }; + + mdio@e9120 { + tbi4: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet5: ethernet@f0000 { + /* + * phy-handle will be updated by U-Boot to + * reflect the actual slot the XAUI card is in. + */ + phy-handle = <&phy_xgmii_2>; + phy-connection-type = "xgmii"; + }; + + mdio@f1000 { + /* XAUI card in slot 2 */ + phy_xgmii_2: ethernet-phy@0 { + reg = <0x0>; + }; + }; + }; + }; + + rapidio@ffe0c0000 { + reg = <0xf 0xfe0c0000 0 0x11000>; + + port1 { + ranges = <0 0 0xc 0x20000000 0 0x10000000>; + }; + port2 { + ranges = <0 0 0xc 0x30000000 0 0x10000000>; + }; + }; + + localbus@ffe124000 { + reg = <0xf 0xfe124000 0 0x1000>; + ranges = <0 0 0xf 0xb8000000 0x04000000>; + + flash@0,0 { + compatible = "cfi-flash"; + /* + * Map 64Mb of 128MB NOR flash memory. Since highest + * line of address of NOR flash memory are set by + * FPGA, memory are divided into two pages equal to + * 64MB. One of the pages can be accessed at once. + */ + reg = <0 0 0x04000000>; + bank-width = <2>; + device-width = <2>; + }; + }; + + pci0: pcie@ffe200000 { + reg = <0xf 0xfe200000 0 0x1000>; + ranges = <0x02000000 0 0x80000000 0x0 0x80000000 0x0 0x10000000 + 0x01000000 0 0x00000000 0x0 0xff000000 0x0 0x00010000>; + pcie@0 { + ranges = <0x02000000 0 0x80000000 + 0x02000000 0 0x80000000 + 0 0x10000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0xff000000 + 0 0x00010000>; + }; + }; + + pci1: pcie@ffe201000 { + reg = <0xf 0xfe201000 0 0x1000>; + ranges = <0x02000000 0x0 0x90000000 0x0 0x90000000 0x0 0x10000000 + 0x01000000 0x0 0x00000000 0x0 0xff010000 0x0 0x00010000>; + pcie@0 { + ranges = <0x02000000 0 0x90000000 + 0x02000000 0 0x90000000 + 0 0x10000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0xff010000 + 0 0x00010000>; + }; + }; + + pci2: pcie@ffe202000 { + reg = <0xf 0xfe202000 0 0x1000>; + ranges = <0x02000000 0 0xa0000000 0x0 0xa0000000 0 0x10000000 + 0x01000000 0 0x00000000 0x0 0xff020000 0 0x00010000>; + pcie@0 { + ranges = <0x02000000 0 0xa0000000 + 0x02000000 0 0xa0000000 + 0 0x10000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0xff020000 + 0 0x00010000>; + }; + }; + + fsl,dpaa { + compatible = "fsl,p2041-dpaa", "fsl,dpaa"; + + ethernet@0 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet0>; + status = "okay"; + }; + ethernet@1 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet1>; + status = "okay"; + }; + ethernet@2 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet2>; + status = "okay"; + }; + ethernet@3 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet3>; + status = "okay"; + }; + ethernet@4 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet4>; + status = "okay"; + }; + ethernet@5 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet5>; + status = "okay"; + }; + }; + + chosen { + stdin = "serial0"; + stdout = "serial0"; + }; +}; Added: head/sys/boot/fdt/dts/p2041si.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/p2041si.dtsi Fri May 25 20:43:38 2012 (r236024) @@ -0,0 +1,1296 @@ +/* + * P2041 Silicon Device Tree Source + * + * Copyright 2011 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* $FreeBSD$ */ + +/dts-v1/; + +/ { + compatible = "fsl,P2041"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&mpic>; + + aliases { + ccsr = &soc; + dcsr = &dcsr; + + ethernet0 = &enet0; + ethernet1 = &enet1; + ethernet2 = &enet2; + ethernet3 = &enet3; + ethernet4 = &enet4; + ethernet5 = &enet5; + serial0 = &serial0; + serial1 = &serial1; + serial2 = &serial2; + serial3 = &serial3; + pci0 = &pci0; + pci1 = &pci1; + pci2 = &pci2; + usb0 = &usb0; + usb1 = &usb1; + dma0 = &dma0; + dma1 = &dma1; + bman = &bman; + qman = &qman; + pme = &pme; + rman = &rman; + sdhc = &sdhc; + msi0 = &msi0; + msi1 = &msi1; + msi2 = &msi2; + + crypto = &crypto; + sec_jr0 = &sec_jr0; + sec_jr1 = &sec_jr1; + sec_jr2 = &sec_jr2; + sec_jr3 = &sec_jr3; + rtic_a = &rtic_a; + rtic_b = &rtic_b; + rtic_c = &rtic_c; + rtic_d = &rtic_d; + sec_mon = &sec_mon; + + fman0 = &fman0; + fman0_oh0 = &fman0_oh0; + fman0_oh1 = &fman0_oh1; + fman0_oh2 = &fman0_oh2; + fman0_oh3 = &fman0_oh3; + fman0_oh4 = &fman0_oh4; + fman0_oh5 = &fman0_oh5; + fman0_oh6 = &fman0_oh6; + fman0_rx0 = &fman0_rx0; + fman0_rx1 = &fman0_rx1; + fman0_rx2 = &fman0_rx2; + fman0_rx3 = &fman0_rx3; + fman0_rx4 = &fman0_rx4; + fman0_rx5 = &fman0_rx5; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu0: PowerPC,e500mc@0 { + device_type = "cpu"; + reg = <0>; + bus-frequency = <749999996>; + next-level-cache = <&L2_0>; + L2_0: l2-cache { + next-level-cache = <&cpc>; + }; + }; + cpu1: PowerPC,e500mc@1 { + device_type = "cpu"; + reg = <1>; + next-level-cache = <&L2_1>; + L2_1: l2-cache { + next-level-cache = <&cpc>; + }; + }; + cpu2: PowerPC,e500mc@2 { + device_type = "cpu"; + reg = <2>; + next-level-cache = <&L2_2>; + L2_2: l2-cache { + next-level-cache = <&cpc>; + }; + }; + cpu3: PowerPC,e500mc@3 { + device_type = "cpu"; + reg = <3>; + next-level-cache = <&L2_3>; + L2_3: l2-cache { + next-level-cache = <&cpc>; + }; + }; + }; + + dcsr: dcsr@f00000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,dcsr", "simple-bus"; + + dcsr-epu@0 { + compatible = "fsl,dcsr-epu"; + interrupts = <52 2 0 0 + 84 2 0 0 + 85 2 0 0>; + interrupt-parent = <&mpic>; + reg = <0x0 0x1000>; + }; + dcsr-npc { + compatible = "fsl,dcsr-npc"; + reg = <0x1000 0x1000 0x1000000 0x8000>; + }; + dcsr-nxc@2000 { + compatible = "fsl,dcsr-nxc"; + reg = <0x2000 0x1000>; + }; + dcsr-corenet { + compatible = "fsl,dcsr-corenet"; + reg = <0x8000 0x1000 0xB0000 0x1000>; + }; + dcsr-dpaa@9000 { + compatible = "fsl,p2041-dcsr-dpaa", "fsl,dcsr-dpaa"; + reg = <0x9000 0x1000>; + }; + dcsr-ocn@11000 { + compatible = "fsl,p2041-dcsr-ocn", "fsl,dcsr-ocn"; + reg = <0x11000 0x1000>; + }; + dcsr-ddr@12000 { + compatible = "fsl,dcsr-ddr"; + dev-handle = <&ddr>; + reg = <0x12000 0x1000>; + }; + dcsr-nal@18000 { + compatible = "fsl,p2041-dcsr-nal", "fsl,dcsr-nal"; + reg = <0x18000 0x1000>; + }; + dcsr-rcpm@22000 { + compatible = "fsl,p2041-dcsr-rcpm", "fsl,dcsr-rcpm"; + reg = <0x22000 0x1000>; + }; + dcsr-cpu-sb-proxy@40000 { + compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; + cpu-handle = <&cpu0>; + reg = <0x40000 0x1000>; + }; + dcsr-cpu-sb-proxy@41000 { + compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; + cpu-handle = <&cpu1>; + reg = <0x41000 0x1000>; + }; + dcsr-cpu-sb-proxy@42000 { + compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; + cpu-handle = <&cpu2>; + reg = <0x42000 0x1000>; + }; + dcsr-cpu-sb-proxy@43000 { + compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; + cpu-handle = <&cpu3>; + reg = <0x43000 0x1000>; + }; + }; + + bman-portals@ff4000000 { + #address-cells = <0x1>; + #size-cells = <0x1>; + compatible = "bman-portals"; + ranges = <0x0 0xf 0xfde00000 0x200000>; + bman-portal@0 { + cell-index = <0x0>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x0 0x4000 0x100000 0x1000>; + interrupts = <105 2 0 0>; + }; + bman-portal@4000 { + cell-index = <0x1>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x4000 0x4000 0x101000 0x1000>; + interrupts = <107 2 0 0>; + }; + bman-portal@8000 { + cell-index = <2>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x8000 0x4000 0x102000 0x1000>; + interrupts = <109 2 0 0>; + }; + bman-portal@c000 { + cell-index = <0x3>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0xc000 0x4000 0x103000 0x1000>; + interrupts = <111 2 0 0>; + }; + bman-portal@10000 { + cell-index = <0x4>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x10000 0x4000 0x104000 0x1000>; + interrupts = <113 2 0 0>; + }; + bman-portal@14000 { + cell-index = <0x5>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x14000 0x4000 0x105000 0x1000>; + interrupts = <115 2 0 0>; + }; + bman-portal@18000 { + cell-index = <0x6>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x18000 0x4000 0x106000 0x1000>; + interrupts = <117 2 0 0>; + }; + bman-portal@1c000 { + cell-index = <0x7>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x1c000 0x4000 0x107000 0x1000>; + interrupts = <119 2 0 0>; + }; + bman-portal@20000 { + cell-index = <0x8>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x20000 0x4000 0x108000 0x1000>; + interrupts = <121 2 0 0>; + }; + bman-portal@24000 { + cell-index = <0x9>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x24000 0x4000 0x109000 0x1000>; + interrupts = <123 2 0 0>; + }; + + buffer-pool@0 { + compatible = "fsl,p2041-bpool", "fsl,bpool"; + fsl,bpid = <0>; + fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; + }; + }; + + qman-portals@ff4200000 { + #address-cells = <0x1>; + #size-cells = <0x1>; + compatible = "qman-portals"; + ranges = <0x0 0xf 0xfdc00000 0x200000>; + qportal0: qman-portal@0 { + cell-index = <0x0>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x0 0x4000 0x100000 0x1000>; + interrupts = <104 0x2 0 0>; + fsl,qman-channel-id = <0x0>; + }; + + qportal1: qman-portal@4000 { + cell-index = <0x1>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x4000 0x4000 0x101000 0x1000>; + interrupts = <106 0x2 0 0>; + fsl,qman-channel-id = <0x1>; + }; + + qportal2: qman-portal@8000 { + cell-index = <0x2>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x8000 0x4000 0x102000 0x1000>; + interrupts = <108 0x2 0 0>; + fsl,qman-channel-id = <0x2>; + }; + + qportal3: qman-portal@c000 { + cell-index = <0x3>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0xc000 0x4000 0x103000 0x1000>; + interrupts = <110 0x2 0 0>; + fsl,qman-channel-id = <0x3>; + }; + + qportal4: qman-portal@10000 { + cell-index = <0x4>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x10000 0x4000 0x104000 0x1000>; + interrupts = <112 0x2 0 0>; + fsl,qman-channel-id = <0x4>; + }; + + qportal5: qman-portal@14000 { + cell-index = <0x5>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x14000 0x4000 0x105000 0x1000>; + interrupts = <114 0x2 0 0>; + fsl,qman-channel-id = <0x5>; + }; + + qportal6: qman-portal@18000 { + cell-index = <0x6>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x18000 0x4000 0x106000 0x1000>; + interrupts = <116 0x2 0 0>; + fsl,qman-channel-id = <0x6>; + }; + + qportal7: qman-portal@1c000 { + cell-index = <0x7>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x1c000 0x4000 0x107000 0x1000>; + interrupts = <118 0x2 0 0>; + fsl,qman-channel-id = <0x7>; + }; + + qportal8: qman-portal@20000 { + cell-index = <0x8>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x20000 0x4000 0x108000 0x1000>; + interrupts = <120 0x2 0 0>; + fsl,qman-channel-id = <0x8>; + }; + + qportal9: qman-portal@24000 { + cell-index = <0x9>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x24000 0x4000 0x109000 0x1000>; + interrupts = <122 0x2 0 0>; + fsl,qman-channel-id = <0x9>; + }; + + qpool1: qman-pool@1 { + cell-index = <1>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x21>; + }; + + qpool2: qman-pool@2 { + cell-index = <2>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x22>; + }; + + qpool3: qman-pool@3 { + cell-index = <3>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x23>; + }; + + qpool4: qman-pool@4 { + cell-index = <4>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x24>; + }; + + qpool5: qman-pool@5 { + cell-index = <5>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x25>; + }; + + qpool6: qman-pool@6 { + cell-index = <6>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x26>; + }; + + qpool7: qman-pool@7 { + cell-index = <7>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x27>; + }; + + qpool8: qman-pool@8 { + cell-index = <8>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x28>; + }; + + qpool9: qman-pool@9 { + cell-index = <9>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x29>; + }; + + qpool10: qman-pool@10 { + cell-index = <10>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2a>; + }; + + qpool11: qman-pool@11 { + cell-index = <11>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2b>; + }; + + qpool12: qman-pool@12 { + cell-index = <12>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2c>; + }; + + qpool13: qman-pool@13 { + cell-index = <13>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2d>; + }; + + qpool14: qman-pool@14 { + cell-index = <14>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2e>; + }; + + qpool15: qman-pool@15 { + cell-index = <15>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2f>; + }; + }; + + soc: soc@ffe000000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + compatible = "simple-bus"; + + bus-frequency = <0>; // Filled out by kernel. + + ranges = <0x00000000 0xf 0xfe000000 0x1000000>; + reg = <0xf 0xfe000000 0 0x00001000>; + + soc-sram-error { + compatible = "fsl,soc-sram-error"; + interrupts = <16 2 1 29>; + }; + + corenet-law@0 { + compatible = "fsl,corenet-law"; + reg = <0x0 0x1000>; + fsl,num-laws = <32>; + }; + + ddr: memory-controller@8000 { + compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller"; + reg = <0x8000 0x1000>; + interrupts = <16 2 1 23>; + }; + + cpc: l3-cache-controller@10000 { + compatible = "fsl,p2041-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache"; + reg = <0x10000 0x1000>; + interrupts = <16 2 1 27>; + }; + + corenet-cf@18000 { + compatible = "fsl,corenet-cf"; + reg = <0x18000 0x1000>; + interrupts = <16 2 1 31>; + fsl,ccf-num-csdids = <32>; + fsl,ccf-num-snoopids = <32>; + }; + + iommu@20000 { + compatible = "fsl,pamu-v1.0", "fsl,pamu"; + reg = <0x20000 0x4000>; + interrupts = < + 24 2 0 0 + 16 2 1 30>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 25 21:12:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8456F106566C; Fri, 25 May 2012 21:12:25 +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 55C3B8FC17; Fri, 25 May 2012 21:12:25 +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 q4PLCPr6033435; Fri, 25 May 2012 21:12:25 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PLCPV5033433; Fri, 25 May 2012 21:12:25 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205252112.q4PLCPV5033433@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 25 May 2012 21:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236025 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 21:12:25 -0000 Author: raj Date: Fri May 25 21:12:24 2012 New Revision: 236025 URL: http://svn.freebsd.org/changeset/base/236025 Log: Update HID defines for E500mc and E5500 CPU cores. Obtained from: Freescale, Semihalf Modified: head/sys/powerpc/include/hid.h Modified: head/sys/powerpc/include/hid.h ============================================================================== --- head/sys/powerpc/include/hid.h Fri May 25 20:43:38 2012 (r236024) +++ head/sys/powerpc/include/hid.h Fri May 25 21:12:24 2012 (r236025) @@ -78,6 +78,8 @@ #define HID0_E500_SEL_TBCLK 0x00002000 /* Select Time Base clock */ #define HID0_E500_MAS7UPDEN 0x00000080 /* Enable MAS7 update (e500v2) */ +#define HID0_E500MC_L2MMU_MHD 0x40000000 /* L2MMU Multiple Hit Detection */ + #define HID0_BITMASK \ "\20" \ "\040EMCP\037DBP\036EBA\035EBD\034BCLK\033EICE\032ECLK\031PAR" \ @@ -105,6 +107,20 @@ "\027NAP\025DPM\023TG\022HANGDETECT\021NHR\020INORDER" \ "\016TBCTRL\015TBEN\012CIABREN\011HDICEEN\001ENATTN" +#define HID0_E500MC_BITMASK \ + "\20" \ + "\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7" \ + "\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15" \ + "\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23" \ + "\010EN_MAS7_UPDATE\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI" + +#define HID0_E5500_BITMASK \ + "\20" \ + "\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7" \ + "\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15" \ + "\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23" \ + "\010b24\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI" + /* * HID0 bit definitions per cpu model * @@ -142,6 +158,40 @@ * 30 - - - NOPDST NOPDST NOPDST NOPDST - * 31 NOOPTI - NOOPTI NOPTI NOPTI NOPTI NOPTI NOPTI * + * bit e500mc e5500 + * 0 EMCP EMCP + * 1 EN_L2MMU_MHD EN_L2MMU_MHD + * 2 - - + * 3 - - + * 4 - - + * 5 - - + * 6 - - + * 7 - - + * 8 - - + * 9 - - + * 10 - - + * 11 - - + * 12 - - + * 13 - - + * 14 - - + * 15 - - + * 16 - - + * 17 - - + * 18 - - + * 19 - - + * 20 - - + * 21 - - + * 22 - - + * 23 - - + * 24 EN_MAS7_UPDATE - + * 25 DCFA DCFA + * 26 - - + * 27 CIGLSO CIGLSO + * 28 - - + * 29 - - + * 30 - - + * 31 NOPTI NOPTI + * * 604: ECP = Enable cache parity checking * 604: SIE = Serial instruction execution disable * 7450: TBEN = Time Base Enable @@ -160,6 +210,9 @@ #define HID0_E500_DEFAULT_SET (HID0_EMCP | HID0_E500_TBEN) #define HID1_E500_DEFAULT_SET (HID1_E500_ABE | HID1_E500_ASTME) +#define HID0_E500MC_DEFAULT_SET (HID0_EMCP | HID0_E500MC_L2MMU_MHD | \ + HID0_E500_MAS7UPDEN) +#define HID0_E5500_DEFAULT_SET (HID0_EMCP | HID0_E500MC_L2MMU_MHD) #define HID5_970_DCBZ_SIZE_HI 0x00000080UL /* dcbz does a 32-byte store */ #define HID4_970_DISABLE_LG_PG 0x00000004ULL /* disables large pages */ From owner-svn-src-all@FreeBSD.ORG Fri May 25 21:50:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4EAC8106566B; Fri, 25 May 2012 21:50:49 +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 37E9C8FC08; Fri, 25 May 2012 21:50: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 q4PLon0o035068; Fri, 25 May 2012 21:50:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PLomFk035064; Fri, 25 May 2012 21:50:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201205252150.q4PLomFk035064@svn.freebsd.org> From: Ed Schouten Date: Fri, 25 May 2012 21:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 21:50:49 -0000 Author: ed Date: Fri May 25 21:50:48 2012 New Revision: 236026 URL: http://svn.freebsd.org/changeset/base/236026 Log: Remove use of non-ISO-C integer types from system call tables. These files already use ISO-C-style integer types, so make them less inconsistent by preferring the standard types. Modified: head/sys/amd64/linux32/syscalls.master head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Fri May 25 21:12:24 2012 (r236025) +++ head/sys/amd64/linux32/syscalls.master Fri May 25 21:50:48 2012 (r236026) @@ -54,8 +54,8 @@ l_int mode); } 9 AUE_LINK STD { int linux_link(char *path, char *to); } 10 AUE_UNLINK STD { int linux_unlink(char *path); } -11 AUE_EXECVE STD { int linux_execve(char *path, u_int32_t *argp, \ - u_int32_t *envp); } +11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t *argp, \ + uint32_t *envp); } 12 AUE_CHDIR STD { int linux_chdir(char *path); } 13 AUE_NULL STD { int linux_time(l_time_t *tm); } 14 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \ Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Fri May 25 21:12:24 2012 (r236025) +++ head/sys/compat/freebsd32/syscalls.master Fri May 25 21:50:48 2012 (r236026) @@ -104,9 +104,9 @@ int flags); } 28 AUE_SENDMSG STD { int freebsd32_sendmsg(int s, struct msghdr32 *msg, \ int flags); } -29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, u_int32_t buf, \ - u_int32_t len, int flags, u_int32_t from, \ - u_int32_t fromlenaddr); } +29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, uint32_t buf, \ + uint32_t len, int flags, uint32_t from, \ + uint32_t fromlenaddr); } 30 AUE_ACCEPT NOPROTO { int accept(int s, caddr_t name, \ int *anamelen); } 31 AUE_GETPEERNAME NOPROTO { int getpeername(int fdes, caddr_t asa, \ @@ -152,7 +152,7 @@ 58 AUE_READLINK NOPROTO { ssize_t readlink(char *path, char *buf, \ size_t count); } 59 AUE_EXECVE STD { int freebsd32_execve(char *fname, \ - u_int32_t *argv, u_int32_t *envv); } + uint32_t *argv, uint32_t *envv); } 60 AUE_UMASK NOPROTO { int umask(int newmask); } umask \ umask_args int 61 AUE_CHROOT NOPROTO { int chroot(char *path); } @@ -325,10 +325,10 @@ 172 AUE_NULL UNIMPL nosys 173 AUE_PREAD COMPAT6 { ssize_t freebsd32_pread(int fd, void *buf, \ size_t nbyte, int pad, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 174 AUE_PWRITE COMPAT6 { ssize_t freebsd32_pwrite(int fd, \ const void *buf, size_t nbyte, int pad, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 175 AUE_NULL UNIMPL nosys 176 AUE_NTP_ADJTIME NOPROTO { int ntp_adjtime(struct timex *tp); } 177 AUE_NULL UNIMPL sfork (BSD/OS 2.x) @@ -363,21 +363,21 @@ char *buf, u_int count, int32_t *basep); } 197 AUE_MMAP COMPAT6 { caddr_t freebsd32_mmap(caddr_t addr, \ size_t len, int prot, int flags, int fd, \ - int pad, u_int32_t pos1, u_int32_t pos2); } + int pad, uint32_t pos1, uint32_t pos2); } 198 AUE_NULL NOPROTO { int nosys(void); } __syscall \ __syscall_args int 199 AUE_LSEEK COMPAT6 { off_t freebsd32_lseek(int fd, int pad, \ - u_int32_t offset1, u_int32_t offset2, \ + uint32_t offset1, uint32_t offset2, \ int whence); } 200 AUE_TRUNCATE COMPAT6 { int freebsd32_truncate(char *path, \ - int pad, u_int32_t length1, \ - u_int32_t length2); } + int pad, uint32_t length1, \ + uint32_t length2); } 201 AUE_FTRUNCATE COMPAT6 { int freebsd32_ftruncate(int fd, int pad, \ - u_int32_t length1, u_int32_t length2); } + uint32_t length1, uint32_t length2); } 202 AUE_SYSCTL STD { int freebsd32_sysctl(int *name, \ u_int namelen, void *old, \ - u_int32_t *oldlenp, void *new, \ - u_int32_t newlen); } + uint32_t *oldlenp, void *new, \ + uint32_t newlen); } 203 AUE_MLOCK NOPROTO { int mlock(const void *addr, \ size_t len); } 204 AUE_MUNLOCK NOPROTO { int munlock(const void *addr, \ @@ -513,11 +513,11 @@ 289 AUE_PREADV STD { ssize_t freebsd32_preadv(int fd, \ struct iovec32 *iovp, \ u_int iovcnt, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 290 AUE_PWRITEV STD { ssize_t freebsd32_pwritev(int fd, \ struct iovec32 *iovp, \ u_int iovcnt, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 291 AUE_NULL UNIMPL nosys 292 AUE_NULL UNIMPL nosys 293 AUE_NULL UNIMPL nosys @@ -591,7 +591,7 @@ struct timespec *interval); } 335 AUE_NULL NOPROTO { int utrace(const void *addr, size_t len); } 336 AUE_SENDFILE COMPAT4 { int freebsd32_sendfile(int fd, int s, \ - u_int32_t offset1, u_int32_t offset2, \ + uint32_t offset1, uint32_t offset2, \ size_t nbytes, struct sf_hdtr32 *hdtr, \ off_t *sbytes, int flags); } 337 AUE_NULL NOPROTO { int kldsym(int fileid, int cmd, \ @@ -694,7 +694,7 @@ 392 AUE_NULL NOPROTO { int uuidgen(struct uuid *store, \ int count); } 393 AUE_SENDFILE STD { int freebsd32_sendfile(int fd, int s, \ - u_int32_t offset1, u_int32_t offset2, \ + uint32_t offset1, uint32_t offset2, \ size_t nbytes, struct sf_hdtr32 *hdtr, \ off_t *sbytes, int flags); } 394 AUE_NULL UNIMPL mac_syscall @@ -847,42 +847,42 @@ 475 AUE_PREAD STD { ssize_t freebsd32_pread(int fd, \ void *buf,size_t nbyte, \ int pad, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 476 AUE_PWRITE STD { ssize_t freebsd32_pwrite(int fd, \ const void *buf, size_t nbyte, \ int pad, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 477 AUE_MMAP STD { caddr_t freebsd32_mmap(caddr_t addr, \ size_t len, int prot, int flags, int fd, \ int pad, \ - u_int32_t pos1, u_int32_t pos2); } + uint32_t pos1, uint32_t pos2); } 478 AUE_LSEEK STD { off_t freebsd32_lseek(int fd, \ int pad, \ - u_int32_t offset1, u_int32_t offset2, \ + uint32_t offset1, uint32_t offset2, \ int whence); } 479 AUE_TRUNCATE STD { int freebsd32_truncate(char *path, \ int pad, \ - u_int32_t length1, u_int32_t length2); } + uint32_t length1, uint32_t length2); } 480 AUE_FTRUNCATE STD { int freebsd32_ftruncate(int fd, \ int pad, \ - u_int32_t length1, u_int32_t length2); } + uint32_t length1, uint32_t length2); } #else 475 AUE_PREAD STD { ssize_t freebsd32_pread(int fd, \ void *buf,size_t nbyte, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 476 AUE_PWRITE STD { ssize_t freebsd32_pwrite(int fd, \ const void *buf, size_t nbyte, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 477 AUE_MMAP STD { caddr_t freebsd32_mmap(caddr_t addr, \ size_t len, int prot, int flags, int fd, \ - u_int32_t pos1, u_int32_t pos2); } + uint32_t pos1, uint32_t pos2); } 478 AUE_LSEEK STD { off_t freebsd32_lseek(int fd, \ - u_int32_t offset1, u_int32_t offset2, \ + uint32_t offset1, uint32_t offset2, \ int whence); } 479 AUE_TRUNCATE STD { int freebsd32_truncate(char *path, \ - u_int32_t length1, u_int32_t length2); } + uint32_t length1, uint32_t length2); } 480 AUE_FTRUNCATE STD { int freebsd32_ftruncate(int fd, \ - u_int32_t length1, u_int32_t length2); } + uint32_t length1, uint32_t length2); } #endif 481 AUE_KILL NOPROTO { int thr_kill2(pid_t pid, long id, int sig); } 482 AUE_SHMOPEN NOPROTO { int shm_open(const char *path, int flags, \ @@ -892,25 +892,25 @@ #ifdef PAD64_REQUIRED 485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t which, \ int pad, \ - u_int32_t id1, u_int32_t id2, \ + uint32_t id1, uint32_t id2, \ cpusetid_t setid); } #else 485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t which, \ - u_int32_t id1, u_int32_t id2, \ + uint32_t id1, uint32_t id2, \ cpusetid_t setid); } #endif 486 AUE_NULL STD { int freebsd32_cpuset_getid(cpulevel_t level, \ cpuwhich_t which, \ - u_int32_t id1, u_int32_t id2, \ + uint32_t id1, uint32_t id2, \ cpusetid_t *setid); } 487 AUE_NULL STD { int freebsd32_cpuset_getaffinity( \ cpulevel_t level, cpuwhich_t which, \ - u_int32_t id1, u_int32_t id2, \ + uint32_t id1, uint32_t id2, \ size_t cpusetsize, \ cpuset_t *mask); } 488 AUE_NULL STD { int freebsd32_cpuset_setaffinity( \ cpulevel_t level, cpuwhich_t which, \ - u_int32_t id1, u_int32_t id2, \ + uint32_t id1, uint32_t id2, \ size_t cpusetsize, \ const cpuset_t *mask); } 489 AUE_FACCESSAT NOPROTO { int faccessat(int fd, char *path, int amode, \ @@ -920,7 +920,7 @@ 491 AUE_FCHOWNAT NOPROTO { int fchownat(int fd, char *path, uid_t uid, \ gid_t gid, int flag); } 492 AUE_FEXECVE STD { int freebsd32_fexecve(int fd, \ - u_int32_t *argv, u_int32_t *envv); } + uint32_t *argv, uint32_t *envv); } 493 AUE_FSTATAT STD { int freebsd32_fstatat(int fd, char *path, \ struct stat *buf, int flag); } 494 AUE_FUTIMESAT STD { int freebsd32_futimesat(int fd, char *path, \ @@ -959,9 +959,9 @@ 512 AUE_SHMCTL NOSTD { int freebsd32_shmctl(int shmid, int cmd, \ struct shmid_ds32 *buf); } 513 AUE_LPATHCONF NOPROTO { int lpathconf(char *path, int name); } -514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, u_int64_t rights); } +514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, uint64_t rights); } 515 AUE_CAP_GETRIGHTS NOPROTO { int cap_getrights(int fd, \ - u_int64_t *rightsp); } + uint64_t *rightsp); } 516 AUE_CAP_ENTER NOPROTO { int cap_enter(void); } 517 AUE_CAP_GETMODE NOPROTO { int cap_getmode(u_int *modep); } 518 AUE_PDFORK UNIMPL pdfork Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Fri May 25 21:12:24 2012 (r236025) +++ head/sys/kern/syscalls.master Fri May 25 21:50:48 2012 (r236026) @@ -916,9 +916,9 @@ 512 AUE_SHMCTL NOSTD { int shmctl(int shmid, int cmd, \ struct shmid_ds *buf); } 513 AUE_LPATHCONF STD { int lpathconf(char *path, int name); } -514 AUE_CAP_NEW STD { int cap_new(int fd, u_int64_t rights); } +514 AUE_CAP_NEW STD { int cap_new(int fd, uint64_t rights); } 515 AUE_CAP_GETRIGHTS STD { int cap_getrights(int fd, \ - u_int64_t *rightsp); } + uint64_t *rightsp); } 516 AUE_CAP_ENTER STD { int cap_enter(void); } 517 AUE_CAP_GETMODE STD { int cap_getmode(u_int *modep); } 518 AUE_PDFORK STD { int pdfork(int *fdp, int flags); } From owner-svn-src-all@FreeBSD.ORG Fri May 25 21:52:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAD9E106564A; Fri, 25 May 2012 21:52:57 +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 B48BC8FC1C; Fri, 25 May 2012 21:52: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 q4PLqv7C035201; Fri, 25 May 2012 21:52:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PLqvaW035189; Fri, 25 May 2012 21:52:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201205252152.q4PLqvaW035189@svn.freebsd.org> From: Ed Schouten Date: Fri, 25 May 2012 21:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236027 - in head/sys: amd64/linux32 compat/freebsd32 kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 21:52:57 -0000 Author: ed Date: Fri May 25 21:52:57 2012 New Revision: 236027 URL: http://svn.freebsd.org/changeset/base/236027 Log: Regenerate system call tables. Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Fri May 25 21:50:48 2012 (r236026) +++ head/sys/amd64/linux32/linux32_proto.h Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 2012-04-16 23:16:18Z jkim + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #ifndef _LINUX_SYSPROTO_H_ @@ -60,8 +60,8 @@ struct linux_unlink_args { }; struct linux_execve_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char argp_l_[PADL_(u_int32_t *)]; u_int32_t * argp; char argp_r_[PADR_(u_int32_t *)]; - char envp_l_[PADL_(u_int32_t *)]; u_int32_t * envp; char envp_r_[PADR_(u_int32_t *)]; + char argp_l_[PADL_(uint32_t *)]; uint32_t * argp; char argp_r_[PADR_(uint32_t *)]; + char envp_l_[PADL_(uint32_t *)]; uint32_t * envp; char envp_r_[PADR_(uint32_t *)]; }; struct linux_chdir_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Fri May 25 21:50:48 2012 (r236026) +++ head/sys/amd64/linux32/linux32_syscall.h Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 2012-04-16 23:16:18Z jkim + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #define LINUX_SYS_exit 1 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/amd64/linux32/linux32_syscalls.c Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 2012-04-16 23:16:18Z jkim + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ const char *linux_syscallnames[] = { Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/amd64/linux32/linux32_sysent.c Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 2012-04-16 23:16:18Z jkim + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #include "opt_compat.h" Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/amd64/linux32/linux32_systrace_args.c Fri May 25 21:52:57 2012 (r236027) @@ -94,8 +94,8 @@ systrace_args(int sysnum, void *params, case 11: { struct linux_execve_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - uarg[1] = (intptr_t) p->argp; /* u_int32_t * */ - uarg[2] = (intptr_t) p->envp; /* u_int32_t * */ + uarg[1] = (intptr_t) p->argp; /* uint32_t * */ + uarg[2] = (intptr_t) p->envp; /* uint32_t * */ *n_args = 3; break; } @@ -2401,10 +2401,10 @@ systrace_entry_setargdesc(int sysnum, in p = "char *"; break; case 1: - p = "u_int32_t *"; + p = "uint32_t *"; break; case 2: - p = "u_int32_t *"; + p = "uint32_t *"; break; default: break; Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Fri May 25 21:50:48 2012 (r236026) +++ head/sys/compat/freebsd32/freebsd32_proto.h Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227776 2011-11-21 01:26:10Z lstewart + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -54,11 +54,11 @@ struct freebsd32_sendmsg_args { }; struct freebsd32_recvfrom_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char buf_l_[PADL_(u_int32_t)]; u_int32_t buf; char buf_r_[PADR_(u_int32_t)]; - char len_l_[PADL_(u_int32_t)]; u_int32_t len; char len_r_[PADR_(u_int32_t)]; + char buf_l_[PADL_(uint32_t)]; uint32_t buf; char buf_r_[PADR_(uint32_t)]; + char len_l_[PADL_(uint32_t)]; uint32_t len; char len_r_[PADR_(uint32_t)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; - char from_l_[PADL_(u_int32_t)]; u_int32_t from; char from_r_[PADR_(u_int32_t)]; - char fromlenaddr_l_[PADL_(u_int32_t)]; u_int32_t fromlenaddr; char fromlenaddr_r_[PADR_(u_int32_t)]; + char from_l_[PADL_(uint32_t)]; uint32_t from; char from_r_[PADR_(uint32_t)]; + char fromlenaddr_l_[PADL_(uint32_t)]; uint32_t fromlenaddr; char fromlenaddr_r_[PADR_(uint32_t)]; }; struct ofreebsd32_sigpending_args { register_t dummy; @@ -74,8 +74,8 @@ struct freebsd32_ioctl_args { }; struct freebsd32_execve_args { char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; - char argv_l_[PADL_(u_int32_t *)]; u_int32_t * argv; char argv_r_[PADR_(u_int32_t *)]; - char envv_l_[PADL_(u_int32_t *)]; u_int32_t * envv; char envv_r_[PADR_(u_int32_t *)]; + char argv_l_[PADL_(uint32_t *)]; uint32_t * argv; char argv_r_[PADR_(uint32_t *)]; + char envv_l_[PADL_(uint32_t *)]; uint32_t * envv; char envv_r_[PADR_(uint32_t *)]; }; struct freebsd32_mprotect_args { char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; @@ -175,9 +175,9 @@ struct freebsd32_sysctl_args { char name_l_[PADL_(int *)]; int * name; char name_r_[PADR_(int *)]; char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; - char oldlenp_l_[PADL_(u_int32_t *)]; u_int32_t * oldlenp; char oldlenp_r_[PADR_(u_int32_t *)]; + char oldlenp_l_[PADL_(uint32_t *)]; uint32_t * oldlenp; char oldlenp_r_[PADR_(uint32_t *)]; char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; - char newlen_l_[PADL_(u_int32_t)]; u_int32_t newlen; char newlen_r_[PADR_(u_int32_t)]; + char newlen_l_[PADL_(uint32_t)]; uint32_t newlen; char newlen_r_[PADR_(uint32_t)]; }; struct freebsd32_futimes_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; @@ -232,15 +232,15 @@ struct freebsd32_preadv_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char iovp_r_[PADR_(struct iovec32 *)]; char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_pwritev_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char iovp_r_[PADR_(struct iovec32 *)]; char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_modstat_args { char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)]; @@ -309,8 +309,8 @@ struct freebsd32_nmount_args { struct freebsd32_sendfile_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; char hdtr_l_[PADL_(struct sf_hdtr32 *)]; struct sf_hdtr32 * hdtr; char hdtr_r_[PADR_(struct sf_hdtr32 *)]; char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char sbytes_r_[PADR_(off_t *)]; @@ -404,16 +404,16 @@ struct freebsd32_pread_args { char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_pwrite_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_mmap_args { char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; @@ -422,42 +422,42 @@ struct freebsd32_mmap_args { char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char pos1_r_[PADR_(u_int32_t)]; - char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char pos2_r_[PADR_(u_int32_t)]; + char pos1_l_[PADL_(uint32_t)]; uint32_t pos1; char pos1_r_[PADR_(uint32_t)]; + char pos2_l_[PADL_(uint32_t)]; uint32_t pos2; char pos2_r_[PADR_(uint32_t)]; }; struct freebsd32_lseek_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct freebsd32_truncate_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; struct freebsd32_ftruncate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; #else struct freebsd32_pread_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_pwrite_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_mmap_args { char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; @@ -465,69 +465,69 @@ struct freebsd32_mmap_args { char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char pos1_r_[PADR_(u_int32_t)]; - char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char pos2_r_[PADR_(u_int32_t)]; + char pos1_l_[PADL_(uint32_t)]; uint32_t pos1; char pos1_r_[PADR_(uint32_t)]; + char pos2_l_[PADL_(uint32_t)]; uint32_t pos2; char pos2_r_[PADR_(uint32_t)]; }; struct freebsd32_lseek_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct freebsd32_truncate_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; struct freebsd32_ftruncate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; #endif #ifdef PAD64_REQUIRED struct freebsd32_cpuset_setid_args { char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)]; - char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char setid_l_[PADL_(cpusetid_t)]; cpusetid_t setid; char setid_r_[PADR_(cpusetid_t)]; }; #else struct freebsd32_cpuset_setid_args { char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; - char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)]; - char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char setid_l_[PADL_(cpusetid_t)]; cpusetid_t setid; char setid_r_[PADR_(cpusetid_t)]; }; #endif struct freebsd32_cpuset_getid_args { char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)]; char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; - char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)]; - char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char setid_l_[PADL_(cpusetid_t *)]; cpusetid_t * setid; char setid_r_[PADR_(cpusetid_t *)]; }; struct freebsd32_cpuset_getaffinity_args { char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)]; char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; - char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)]; - char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char cpusetsize_l_[PADL_(size_t)]; size_t cpusetsize; char cpusetsize_r_[PADR_(size_t)]; char mask_l_[PADL_(cpuset_t *)]; cpuset_t * mask; char mask_r_[PADR_(cpuset_t *)]; }; struct freebsd32_cpuset_setaffinity_args { char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)]; char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; - char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)]; - char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char cpusetsize_l_[PADL_(size_t)]; size_t cpusetsize; char cpusetsize_r_[PADR_(size_t)]; char mask_l_[PADL_(const cpuset_t *)]; const cpuset_t * mask; char mask_r_[PADR_(const cpuset_t *)]; }; struct freebsd32_fexecve_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char argv_l_[PADL_(u_int32_t *)]; u_int32_t * argv; char argv_r_[PADR_(u_int32_t *)]; - char envv_l_[PADL_(u_int32_t *)]; u_int32_t * envv; char envv_r_[PADR_(u_int32_t *)]; + char argv_l_[PADL_(uint32_t *)]; uint32_t * argv; char argv_r_[PADR_(uint32_t *)]; + char envv_l_[PADL_(uint32_t *)]; uint32_t * envv; char envv_r_[PADR_(uint32_t *)]; }; struct freebsd32_fstatat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; @@ -812,8 +812,8 @@ struct freebsd4_freebsd32_fhstatfs_args struct freebsd4_freebsd32_sendfile_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; char hdtr_l_[PADL_(struct sf_hdtr32 *)]; struct sf_hdtr32 * hdtr; char hdtr_r_[PADR_(struct sf_hdtr32 *)]; char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char sbytes_r_[PADR_(off_t *)]; @@ -854,16 +854,16 @@ struct freebsd6_freebsd32_pread_args { char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd6_freebsd32_pwrite_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd6_freebsd32_mmap_args { char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; @@ -872,27 +872,27 @@ struct freebsd6_freebsd32_mmap_args { char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char pos1_r_[PADR_(u_int32_t)]; - char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char pos2_r_[PADR_(u_int32_t)]; + char pos1_l_[PADL_(uint32_t)]; uint32_t pos1; char pos1_r_[PADR_(uint32_t)]; + char pos2_l_[PADL_(uint32_t)]; uint32_t pos2; char pos2_r_[PADR_(uint32_t)]; }; struct freebsd6_freebsd32_lseek_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct freebsd6_freebsd32_truncate_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; struct freebsd6_freebsd32_ftruncate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; #ifdef PAD64_REQUIRED #else Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Fri May 25 21:50:48 2012 (r236026) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227776 2011-11-21 01:26:10Z lstewart + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #define FREEBSD32_SYS_syscall 0 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227776 2011-11-21 01:26:10Z lstewart + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ const char *freebsd32_syscallnames[] = { Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227776 2011-11-21 01:26:10Z lstewart + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #include "opt_compat.h" Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri May 25 21:52:57 2012 (r236027) @@ -209,11 +209,11 @@ systrace_args(int sysnum, void *params, case 29: { struct freebsd32_recvfrom_args *p = params; iarg[0] = p->s; /* int */ - uarg[1] = p->buf; /* u_int32_t */ - uarg[2] = p->len; /* u_int32_t */ + uarg[1] = p->buf; /* uint32_t */ + uarg[2] = p->len; /* uint32_t */ iarg[3] = p->flags; /* int */ - uarg[4] = p->from; /* u_int32_t */ - uarg[5] = p->fromlenaddr; /* u_int32_t */ + uarg[4] = p->from; /* uint32_t */ + uarg[5] = p->fromlenaddr; /* uint32_t */ *n_args = 6; break; } @@ -402,8 +402,8 @@ systrace_args(int sysnum, void *params, case 59: { struct freebsd32_execve_args *p = params; uarg[0] = (intptr_t) p->fname; /* char * */ - uarg[1] = (intptr_t) p->argv; /* u_int32_t * */ - uarg[2] = (intptr_t) p->envv; /* u_int32_t * */ + uarg[1] = (intptr_t) p->argv; /* uint32_t * */ + uarg[2] = (intptr_t) p->envv; /* uint32_t * */ *n_args = 3; break; } @@ -996,9 +996,9 @@ systrace_args(int sysnum, void *params, uarg[0] = (intptr_t) p->name; /* int * */ uarg[1] = p->namelen; /* u_int */ uarg[2] = (intptr_t) p->old; /* void * */ - uarg[3] = (intptr_t) p->oldlenp; /* u_int32_t * */ + uarg[3] = (intptr_t) p->oldlenp; /* uint32_t * */ uarg[4] = (intptr_t) p->new; /* void * */ - uarg[5] = p->newlen; /* u_int32_t */ + uarg[5] = p->newlen; /* uint32_t */ *n_args = 6; break; } @@ -1360,8 +1360,8 @@ systrace_args(int sysnum, void *params, iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->iovp; /* struct iovec32 * */ uarg[2] = p->iovcnt; /* u_int */ - uarg[3] = p->offset1; /* u_int32_t */ - uarg[4] = p->offset2; /* u_int32_t */ + uarg[3] = p->offset1; /* uint32_t */ + uarg[4] = p->offset2; /* uint32_t */ *n_args = 5; break; } @@ -1371,8 +1371,8 @@ systrace_args(int sysnum, void *params, iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->iovp; /* struct iovec32 * */ uarg[2] = p->iovcnt; /* u_int */ - uarg[3] = p->offset1; /* u_int32_t */ - uarg[4] = p->offset2; /* u_int32_t */ + uarg[3] = p->offset1; /* uint32_t */ + uarg[4] = p->offset2; /* uint32_t */ *n_args = 5; break; } @@ -1933,8 +1933,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_sendfile_args *p = params; iarg[0] = p->fd; /* int */ iarg[1] = p->s; /* int */ - uarg[2] = p->offset1; /* u_int32_t */ - uarg[3] = p->offset2; /* u_int32_t */ + uarg[2] = p->offset1; /* uint32_t */ + uarg[3] = p->offset2; /* uint32_t */ uarg[4] = p->nbytes; /* size_t */ uarg[5] = (intptr_t) p->hdtr; /* struct sf_hdtr32 * */ uarg[6] = (intptr_t) p->sbytes; /* off_t * */ @@ -2500,8 +2500,8 @@ systrace_args(int sysnum, void *params, uarg[1] = (intptr_t) p->buf; /* void * */ uarg[2] = p->nbyte; /* size_t */ iarg[3] = p->pad; /* int */ - uarg[4] = p->offset1; /* u_int32_t */ - uarg[5] = p->offset2; /* u_int32_t */ + uarg[4] = p->offset1; /* uint32_t */ + uarg[5] = p->offset2; /* uint32_t */ *n_args = 6; break; } @@ -2512,8 +2512,8 @@ systrace_args(int sysnum, void *params, uarg[1] = (intptr_t) p->buf; /* const void * */ uarg[2] = p->nbyte; /* size_t */ iarg[3] = p->pad; /* int */ - uarg[4] = p->offset1; /* u_int32_t */ - uarg[5] = p->offset2; /* u_int32_t */ + uarg[4] = p->offset1; /* uint32_t */ + uarg[5] = p->offset2; /* uint32_t */ *n_args = 6; break; } @@ -2526,8 +2526,8 @@ systrace_args(int sysnum, void *params, iarg[3] = p->flags; /* int */ iarg[4] = p->fd; /* int */ iarg[5] = p->pad; /* int */ - uarg[6] = p->pos1; /* u_int32_t */ - uarg[7] = p->pos2; /* u_int32_t */ + uarg[6] = p->pos1; /* uint32_t */ + uarg[7] = p->pos2; /* uint32_t */ *n_args = 8; break; } @@ -2536,8 +2536,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_lseek_args *p = params; iarg[0] = p->fd; /* int */ iarg[1] = p->pad; /* int */ - uarg[2] = p->offset1; /* u_int32_t */ - uarg[3] = p->offset2; /* u_int32_t */ + uarg[2] = p->offset1; /* uint32_t */ + uarg[3] = p->offset2; /* uint32_t */ iarg[4] = p->whence; /* int */ *n_args = 5; break; @@ -2547,8 +2547,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_truncate_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ iarg[1] = p->pad; /* int */ - uarg[2] = p->length1; /* u_int32_t */ - uarg[3] = p->length2; /* u_int32_t */ + uarg[2] = p->length1; /* uint32_t */ + uarg[3] = p->length2; /* uint32_t */ *n_args = 4; break; } @@ -2557,8 +2557,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_ftruncate_args *p = params; iarg[0] = p->fd; /* int */ iarg[1] = p->pad; /* int */ - uarg[2] = p->length1; /* u_int32_t */ - uarg[3] = p->length2; /* u_int32_t */ + uarg[2] = p->length1; /* uint32_t */ + uarg[3] = p->length2; /* uint32_t */ *n_args = 4; break; } @@ -2569,8 +2569,8 @@ systrace_args(int sysnum, void *params, iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->buf; /* void * */ uarg[2] = p->nbyte; /* size_t */ - uarg[3] = p->offset1; /* u_int32_t */ - uarg[4] = p->offset2; /* u_int32_t */ + uarg[3] = p->offset1; /* uint32_t */ + uarg[4] = p->offset2; /* uint32_t */ *n_args = 5; break; } @@ -2580,8 +2580,8 @@ systrace_args(int sysnum, void *params, iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->buf; /* const void * */ uarg[2] = p->nbyte; /* size_t */ - uarg[3] = p->offset1; /* u_int32_t */ - uarg[4] = p->offset2; /* u_int32_t */ + uarg[3] = p->offset1; /* uint32_t */ + uarg[4] = p->offset2; /* uint32_t */ *n_args = 5; break; } @@ -2593,8 +2593,8 @@ systrace_args(int sysnum, void *params, iarg[2] = p->prot; /* int */ iarg[3] = p->flags; /* int */ iarg[4] = p->fd; /* int */ - uarg[5] = p->pos1; /* u_int32_t */ - uarg[6] = p->pos2; /* u_int32_t */ + uarg[5] = p->pos1; /* uint32_t */ + uarg[6] = p->pos2; /* uint32_t */ *n_args = 7; break; } @@ -2602,8 +2602,8 @@ systrace_args(int sysnum, void *params, case 478: { struct freebsd32_lseek_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = p->offset1; /* u_int32_t */ - uarg[2] = p->offset2; /* u_int32_t */ + uarg[1] = p->offset1; /* uint32_t */ + uarg[2] = p->offset2; /* uint32_t */ iarg[3] = p->whence; /* int */ *n_args = 4; break; @@ -2612,8 +2612,8 @@ systrace_args(int sysnum, void *params, case 479: { struct freebsd32_truncate_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - uarg[1] = p->length1; /* u_int32_t */ - uarg[2] = p->length2; /* u_int32_t */ + uarg[1] = p->length1; /* uint32_t */ + uarg[2] = p->length2; /* uint32_t */ *n_args = 3; break; } @@ -2621,8 +2621,8 @@ systrace_args(int sysnum, void *params, case 480: { struct freebsd32_ftruncate_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = p->length1; /* u_int32_t */ - uarg[2] = p->length2; /* u_int32_t */ + uarg[1] = p->length1; /* uint32_t */ + uarg[2] = p->length2; /* uint32_t */ *n_args = 3; break; } @@ -2665,8 +2665,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_cpuset_setid_args *p = params; iarg[0] = p->which; /* cpuwhich_t */ iarg[1] = p->pad; /* int */ - uarg[2] = p->id1; /* u_int32_t */ - uarg[3] = p->id2; /* u_int32_t */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ iarg[4] = p->setid; /* cpusetid_t */ *n_args = 5; break; @@ -2676,8 +2676,8 @@ systrace_args(int sysnum, void *params, case 485: { struct freebsd32_cpuset_setid_args *p = params; iarg[0] = p->which; /* cpuwhich_t */ - uarg[1] = p->id1; /* u_int32_t */ - uarg[2] = p->id2; /* u_int32_t */ + uarg[1] = p->id1; /* uint32_t */ + uarg[2] = p->id2; /* uint32_t */ iarg[3] = p->setid; /* cpusetid_t */ *n_args = 4; break; @@ -2688,8 +2688,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_cpuset_getid_args *p = params; iarg[0] = p->level; /* cpulevel_t */ iarg[1] = p->which; /* cpuwhich_t */ - uarg[2] = p->id1; /* u_int32_t */ - uarg[3] = p->id2; /* u_int32_t */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ uarg[4] = (intptr_t) p->setid; /* cpusetid_t * */ *n_args = 5; break; @@ -2699,8 +2699,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_cpuset_getaffinity_args *p = params; iarg[0] = p->level; /* cpulevel_t */ iarg[1] = p->which; /* cpuwhich_t */ - uarg[2] = p->id1; /* u_int32_t */ - uarg[3] = p->id2; /* u_int32_t */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ uarg[4] = p->cpusetsize; /* size_t */ uarg[5] = (intptr_t) p->mask; /* cpuset_t * */ *n_args = 6; @@ -2711,8 +2711,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_cpuset_setaffinity_args *p = params; iarg[0] = p->level; /* cpulevel_t */ iarg[1] = p->which; /* cpuwhich_t */ - uarg[2] = p->id1; /* u_int32_t */ - uarg[3] = p->id2; /* u_int32_t */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ uarg[4] = p->cpusetsize; /* size_t */ uarg[5] = (intptr_t) p->mask; /* const cpuset_t * */ *n_args = 6; @@ -2753,8 +2753,8 @@ systrace_args(int sysnum, void *params, case 492: { struct freebsd32_fexecve_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->argv; /* u_int32_t * */ - uarg[2] = (intptr_t) p->envv; /* u_int32_t * */ + uarg[1] = (intptr_t) p->argv; /* uint32_t * */ + uarg[2] = (intptr_t) p->envv; /* uint32_t * */ *n_args = 3; break; } @@ -2943,7 +2943,7 @@ systrace_args(int sysnum, void *params, case 514: { struct cap_new_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = p->rights; /* u_int64_t */ + uarg[1] = p->rights; /* uint64_t */ *n_args = 2; break; } @@ -2951,7 +2951,7 @@ systrace_args(int sysnum, void *params, case 515: { struct cap_getrights_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->rightsp; /* u_int64_t * */ + uarg[1] = (intptr_t) p->rightsp; /* uint64_t * */ *n_args = 2; break; } @@ -3380,19 +3380,19 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 1: - p = "u_int32_t"; + p = "uint32_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: p = "int"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; case 5: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -3679,10 +3679,10 @@ systrace_entry_setargdesc(int sysnum, in p = "char *"; break; case 1: - p = "u_int32_t *"; + p = "uint32_t *"; break; case 2: - p = "u_int32_t *"; + p = "uint32_t *"; break; default: break; @@ -4664,13 +4664,13 @@ systrace_entry_setargdesc(int sysnum, in p = "void *"; break; case 3: - p = "u_int32_t *"; + p = "uint32_t *"; break; case 4: p = "void *"; break; case 5: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -5217,10 +5217,10 @@ systrace_entry_setargdesc(int sysnum, in p = "u_int"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -5239,10 +5239,10 @@ systrace_entry_setargdesc(int sysnum, in p = "u_int"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -6162,10 +6162,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: p = "size_t"; @@ -7135,10 +7135,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; case 5: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7160,10 +7160,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; case 5: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7191,10 +7191,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 6: - p = "u_int32_t"; + p = "uint32_t"; break; case 7: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7210,10 +7210,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: p = "int"; @@ -7232,10 +7232,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7251,10 +7251,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7274,10 +7274,10 @@ systrace_entry_setargdesc(int sysnum, in p = "size_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7296,10 +7296,10 @@ systrace_entry_setargdesc(int sysnum, in p = "size_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7324,10 +7324,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 5: - p = "u_int32_t"; + p = "uint32_t"; break; case 6: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7340,10 +7340,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 1: - p = "u_int32_t"; + p = "uint32_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: p = "int"; @@ -7359,10 +7359,10 @@ systrace_entry_setargdesc(int sysnum, in p = "char *"; break; case 1: - p = "u_int32_t"; + p = "uint32_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7375,10 +7375,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 1: - p = "u_int32_t"; + p = "uint32_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7448,10 +7448,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: p = "cpusetid_t"; @@ -7468,10 +7468,10 @@ systrace_entry_setargdesc(int sysnum, in p = "cpuwhich_t"; break; case 1: - p = "u_int32_t"; + p = "uint32_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: p = "cpusetid_t"; @@ -7491,10 +7491,10 @@ systrace_entry_setargdesc(int sysnum, in p = "cpuwhich_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 25 22:07:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC281106566C; Fri, 25 May 2012 22:07:13 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C838B8FC0A; Fri, 25 May 2012 22:07: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 q4PM7DZH035812; Fri, 25 May 2012 22:07:13 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PM7DPD035808; Fri, 25 May 2012 22:07:13 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201205252207.q4PM7DPD035808@svn.freebsd.org> From: Gabor Kovesdan Date: Fri, 25 May 2012 22:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236028 - head/lib/libkiconv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 22:07:14 -0000 Author: gabor Date: Fri May 25 22:07:13 2012 New Revision: 236028 URL: http://svn.freebsd.org/changeset/base/236028 Log: - Add support for BSD iconv when it is build into libc PR: bin/162670 Submitted by: Jan Beich MFC after: 2 weeks Modified: head/lib/libkiconv/Makefile head/lib/libkiconv/xlat16_iconv.c Modified: head/lib/libkiconv/Makefile ============================================================================== --- head/lib/libkiconv/Makefile Fri May 25 21:52:57 2012 (r236027) +++ head/lib/libkiconv/Makefile Fri May 25 22:07:13 2012 (r236028) @@ -17,4 +17,8 @@ CFLAGS+= -I${.CURDIR}/../../sys WARNS?= 1 +.if !defined(MK_ICONV) +CFLAGS+= -DICONV_DLOPEN +.endif + .include Modified: head/lib/libkiconv/xlat16_iconv.c ============================================================================== --- head/lib/libkiconv/xlat16_iconv.c Fri May 25 21:52:57 2012 (r236027) +++ head/lib/libkiconv/xlat16_iconv.c Fri May 25 22:07:13 2012 (r236028) @@ -60,10 +60,18 @@ struct xlat16_table { static struct xlat16_table kiconv_xlat16_open(const char *, const char *, int); static int chklocale(int, const char *); +#ifdef ICONV_DLOPEN static int my_iconv_init(void); static iconv_t (*my_iconv_open)(const char *, const char *); static size_t (*my_iconv)(iconv_t, const char **, size_t *, char **, size_t *); static int (*my_iconv_close)(iconv_t); +#else +#include +#define my_iconv_init() 0 +#define my_iconv_open iconv_open +#define my_iconv iconv +#define my_iconv_close iconv_close +#endif static size_t my_iconv_char(iconv_t, const u_char **, size_t *, u_char **, size_t *); int @@ -310,6 +318,7 @@ chklocale(int category, const char *code return (error); } +#ifdef ICONV_DLOPEN static int my_iconv_init(void) { @@ -327,6 +336,7 @@ my_iconv_init(void) return (0); } +#endif static size_t my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf, From owner-svn-src-all@FreeBSD.ORG Fri May 25 22:42:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32D5F106564A; Fri, 25 May 2012 22:42:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CDFB8FC0C; Fri, 25 May 2012 22:42: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 q4PMgLli037366; Fri, 25 May 2012 22:42:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PMgLH3037364; Fri, 25 May 2012 22:42:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205252242.q4PMgLH3037364@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 22:42:21 +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: r236029 - stable/8/sys/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 22:42:22 -0000 Author: marius Date: Fri May 25 22:42:21 2012 New Revision: 236029 URL: http://svn.freebsd.org/changeset/base/236029 Log: MFC: r212804 Remove magic value. Modified: stable/8/sys/boot/zfs/zfs.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) Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Fri May 25 22:07:13 2012 (r236028) +++ stable/8/sys/boot/zfs/zfs.c Fri May 25 22:42:21 2012 (r236029) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include "zfsimpl.c" +#define MAXBDDEV 31 + static int zfs_open(const char *path, struct open_file *f); static int zfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); static int zfs_close(struct open_file *f); @@ -410,7 +412,7 @@ zfs_dev_init(void) * diskN, diskNpM or diskNsM. */ zfs_init(); - for (unit = 0; unit < 32 /* XXX */; unit++) { + for (unit = 0; unit < MAXBDDEV; unit++) { sprintf(devname, "disk%d:", unit); fd = open(devname, O_RDONLY); if (fd == -1) From owner-svn-src-all@FreeBSD.ORG Fri May 25 23:24:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 644EA106564A; Fri, 25 May 2012 23:24:17 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D3DD8FC0C; Fri, 25 May 2012 23: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 q4PNOHve039125; Fri, 25 May 2012 23:24:17 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PNOHSw039123; Fri, 25 May 2012 23:24:17 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201205252324.q4PNOHSw039123@svn.freebsd.org> From: Ryan Stone Date: Fri, 25 May 2012 23:24:17 +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: r236030 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 23:24:17 -0000 Author: rstone Date: Fri May 25 23:24:16 2012 New Revision: 236030 URL: http://svn.freebsd.org/changeset/base/236030 Log: MFC r227342 The in-kernel CTF parser caches the result of its first attempt to parse CTF data from a module. On subsequent attempts to retrieve CTF data for a module, return an error if there no CTF data. This fixes a panic if you try to enable fbt probes on a module without CTF data twice. Submitted by: Paul Ambrose (ambrosehua AT gmail DOT com) Modified: stable/8/sys/kern/kern_ctf.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/kern_ctf.c ============================================================================== --- stable/8/sys/kern/kern_ctf.c Fri May 25 22:42:21 2012 (r236029) +++ stable/8/sys/kern/kern_ctf.c Fri May 25 23:24:16 2012 (r236030) @@ -90,7 +90,7 @@ link_elf_ctf_get(linker_file_t lf, linke * ctfcnt to -1. See below. */ if (ef->ctfcnt < 0) - return (0); + return (EFTYPE); /* Now check if we've already loaded the CTF data.. */ if (ef->ctfcnt > 0) { From owner-svn-src-all@FreeBSD.ORG Sat May 26 01:34:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29C70106564A; Sat, 26 May 2012 01:34:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDCB78FC0C; Sat, 26 May 2012 01:34: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 q4Q1YaTd044716; Sat, 26 May 2012 01:34:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q1Yamx044714; Sat, 26 May 2012 01:34:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205260134.q4Q1Yamx044714@svn.freebsd.org> From: Adrian Chadd Date: Sat, 26 May 2012 01:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236036 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 01:34:37 -0000 Author: adrian Date: Sat May 26 01:34:36 2012 New Revision: 236036 URL: http://svn.freebsd.org/changeset/base/236036 Log: Remove an unneeded field from ath_buf. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat May 26 01:33:07 2012 (r236035) +++ head/sys/dev/ath/if_athvar.h Sat May 26 01:34:36 2012 (r236036) @@ -238,7 +238,6 @@ struct ath_buf { int bfs_txpower; /* tx power */ int bfs_txantenna; /* TX antenna config */ enum ieee80211_protmode bfs_protmode; - HAL_11N_RATE_SERIES bfs_rc11n[ATH_RC_NUM]; /* 11n TX series */ int bfs_ctsrate; /* CTS rate */ int bfs_ctsduration; /* CTS duration (pre-11n NICs) */ struct ath_rc_series bfs_rc[ATH_RC_NUM]; /* non-11n TX series */ From owner-svn-src-all@FreeBSD.ORG Sat May 26 01:35:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A69F106566C; Sat, 26 May 2012 01:35:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 464FA8FC15; Sat, 26 May 2012 01:35:12 +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 q4Q1ZCXJ044813; Sat, 26 May 2012 01:35:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q1ZCNh044811; Sat, 26 May 2012 01:35:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205260135.q4Q1ZCNh044811@svn.freebsd.org> From: Adrian Chadd Date: Sat, 26 May 2012 01:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236038 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 01:35:12 -0000 Author: adrian Date: Sat May 26 01:35:11 2012 New Revision: 236038 URL: http://svn.freebsd.org/changeset/base/236038 Log: Avoid using hard-coded numbers here. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat May 26 01:35:09 2012 (r236037) +++ head/sys/dev/ath/if_ath_tx.c Sat May 26 01:35:11 2012 (r236038) @@ -3580,7 +3580,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * int nframes = 0, nbad = 0, nf; int pktlen; /* XXX there's too much on the stack? */ - struct ath_rc_series rc[4]; + struct ath_rc_series rc[ATH_RC_NUM]; int txseq; DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: called; hwq_depth=%d\n", From owner-svn-src-all@FreeBSD.ORG Sat May 26 01:36:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 408901065670; Sat, 26 May 2012 01:36:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11C688FC15; Sat, 26 May 2012 01:36: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 q4Q1aPCu044900; Sat, 26 May 2012 01:36:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q1aPj3044898; Sat, 26 May 2012 01:36:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205260136.q4Q1aPj3044898@svn.freebsd.org> From: Adrian Chadd Date: Sat, 26 May 2012 01:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236039 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 01:36:26 -0000 Author: adrian Date: Sat May 26 01:36:25 2012 New Revision: 236039 URL: http://svn.freebsd.org/changeset/base/236039 Log: Add the AR9280 workarounds for PCIe suspend/resume. These aren't strictly needed at the moment as we're not doing APSM and forcing the NIC in and out of network sleep. But, they don't hurt. Tested: * AR9280 (mini-PCIe) Obtained from: Qualcomm Atheros, Linux ath9k Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat May 26 01:35:11 2012 (r236038) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat May 26 01:36:25 2012 (r236039) @@ -420,18 +420,68 @@ bad: static void ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { + uint32_t val; + if (AH_PRIVATE(ah)->ah_ispcie && !restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); OS_DELAY(1000); + } + + + /* + * Set PCIe workaround bits + * + * NOTE: + * + * In Merlin and Kite, bit 14 in WA register (disable L1) should only + * be set when device enters D3 and be cleared when device comes back + * to D0. + */ + if (power_off) { /* Power-off */ + OS_REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); + + val = OS_REG_READ(ah, AR_WA); + + /* + * Disable bit 6 and 7 before entering D3 to prevent + * system hang. + */ + val &= ~(AR_WA_BIT6 | AR_WA_BIT7); + + /* + * XXX Not sure, is specified in the reference HAL. + */ + val |= AR_WA_BIT22; + + /* + * See above: set AR_WA_D3_L1_DISABLE when entering D3 state. + * + * XXX The reference HAL does it this way - it only sets + * AR_WA_D3_L1_DISABLE if it's set in AR9280_WA_DEFAULT, + * which it (currently) isn't. So the following statement + * is currently a NOP. + */ + if (AR9280_WA_DEFAULT & AR_WA_D3_L1_DISABLE) + val |= AR_WA_D3_L1_DISABLE; + + OS_REG_WRITE(ah, AR_WA, val); + } else { /* Power-on */ + val = AR9280_WA_DEFAULT; + + /* + * See note above: make sure L1_DISABLE is not set. + */ + val &= (~AR_WA_D3_L1_DISABLE); + OS_REG_WRITE(ah, AR_WA, val); + + /* set bit 19 to allow forcing of pcie core into L1 state */ OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); - OS_REG_WRITE(ah, AR_WA, AR9280_WA_DEFAULT); } } static void ar9280DisablePCIE(struct ath_hal *ah) { - /* XXX TODO */ } static void From owner-svn-src-all@FreeBSD.ORG Sat May 26 05:25:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35CA8106566B; Sat, 26 May 2012 05:25:56 +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 207F58FC0A; Sat, 26 May 2012 05:25:56 +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 q4Q5Pt55054311; Sat, 26 May 2012 05:25:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q5Pt4V054309; Sat, 26 May 2012 05:25:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205260525.q4Q5Pt4V054309@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 26 May 2012 05:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236042 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 05:25:56 -0000 Author: kib Date: Sat May 26 05:25:55 2012 New Revision: 236042 URL: http://svn.freebsd.org/changeset/base/236042 Log: Clarify the SEEK_HOLE description, it repositions the file pointer. MFC after: 3 days Modified: head/lib/libc/sys/lseek.2 Modified: head/lib/libc/sys/lseek.2 ============================================================================== --- head/lib/libc/sys/lseek.2 Sat May 26 01:55:51 2012 (r236041) +++ head/lib/libc/sys/lseek.2 Sat May 26 05:25:55 2012 (r236042) @@ -28,7 +28,7 @@ .\" @(#)lseek.2 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 5, 2007 +.Dd May 26, 2012 .Dt LSEEK 2 .Os .Sh NAME @@ -92,9 +92,9 @@ If .Fa whence is .Dv SEEK_HOLE , -the offset of the start of the next hole greater than or equal to the supplied -.Fa offset -is returned. +the offset is set to the start of the next hole greater than or equal +to the supplied +.Fa offset . The definition of a hole is provided below. .It If From owner-svn-src-all@FreeBSD.ORG Sat May 26 05:28:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CF341065672; Sat, 26 May 2012 05:28:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E5A58FC12; Sat, 26 May 2012 05:28:48 +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 q4Q5Smif054460; Sat, 26 May 2012 05:28:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q5Smcv054457; Sat, 26 May 2012 05:28:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205260528.q4Q5Smcv054457@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 26 May 2012 05:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236043 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 05:28:48 -0000 Author: kib Date: Sat May 26 05:28:47 2012 New Revision: 236043 URL: http://svn.freebsd.org/changeset/base/236043 Log: Add a vn_bmap_seekhole(9) vnode helper which can be used by any filesystem which supports VOP_BMAP(9) to implement SEEK_HOLE/SEEK_DATA commands for lseek(2). MFC after: 2 weeks Modified: head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat May 26 05:25:55 2012 (r236042) +++ head/sys/kern/vfs_vnops.c Sat May 26 05:28:47 2012 (r236043) @@ -1466,3 +1466,56 @@ vn_pages_remove(struct vnode *vp, vm_pin vm_object_page_remove(object, start, end, 0); VM_OBJECT_UNLOCK(object); } + +int +vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) +{ + struct vattr va; + daddr_t bn, bnp; + uint64_t bsize; + off_t noff; + int error; + + KASSERT(cmd == FIOSEEKHOLE || cmd == FIOSEEKDATA, + ("Wrong command %lu", cmd)); + + if (vn_lock(vp, LK_SHARED) != 0) + return (EBADF); + if (vp->v_type != VREG) { + error = ENOTTY; + goto unlock; + } + error = VOP_GETATTR(vp, &va, cred); + if (error != 0) + goto unlock; + noff = *off; + if (noff >= va.va_size) { + error = ENXIO; + goto unlock; + } + bsize = vp->v_mount->mnt_stat.f_iosize; + for (bn = noff / bsize; noff < va.va_size; bn++, noff += bsize) { + error = VOP_BMAP(vp, bn, NULL, &bnp, NULL, NULL); + if (error == EOPNOTSUPP) { + error = ENOTTY; + goto unlock; + } + if ((bnp == -1 && cmd == FIOSEEKHOLE) || + (bnp != -1 && cmd == FIOSEEKDATA)) { + noff = bn * bsize; + if (noff < *off) + noff = *off; + goto unlock; + } + } + if (noff > va.va_size) + noff = va.va_size; + /* noff == va.va_size. There is an implicit hole at the end of file. */ + if (cmd == FIOSEEKDATA) + error = ENXIO; +unlock: + VOP_UNLOCK(vp, 0); + if (error == 0) + *off = noff; + return (error); +} Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat May 26 05:25:55 2012 (r236042) +++ head/sys/sys/vnode.h Sat May 26 05:28:47 2012 (r236043) @@ -640,6 +640,8 @@ void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); #define vprint(label, vp) vn_printf((vp), "%s\n", (label)) int vrecycle(struct vnode *vp); +int vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, + struct ucred *cred); int vn_close(struct vnode *vp, int flags, struct ucred *file_cred, struct thread *td); void vn_finished_write(struct mount *mp); From owner-svn-src-all@FreeBSD.ORG Sat May 26 05:29:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 556E81065673; Sat, 26 May 2012 05:29: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 27CDC8FC19; Sat, 26 May 2012 05:29: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 q4Q5TsMx054533; Sat, 26 May 2012 05:29:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q5TrAU054531; Sat, 26 May 2012 05:29:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205260529.q4Q5TrAU054531@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 26 May 2012 05:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236044 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 05:29:54 -0000 Author: kib Date: Sat May 26 05:29:53 2012 New Revision: 236044 URL: http://svn.freebsd.org/changeset/base/236044 Log: Implement SEEK_HOLE/SEEK_DATA for UFS. MFC after: 2 weeks Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Sat May 26 05:28:47 2012 (r236043) +++ head/sys/ufs/ufs/ufs_vnops.c Sat May 26 05:29:53 2012 (r236044) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -102,6 +103,7 @@ static int ufs_chown(struct vnode *, uid static vop_close_t ufs_close; static vop_create_t ufs_create; static vop_getattr_t ufs_getattr; +static vop_ioctl_t ufs_ioctl; static vop_link_t ufs_link; static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *); static vop_markatime_t ufs_markatime; @@ -2504,6 +2506,9 @@ ufs_pathconf(ap) *ap->a_retval = 0; #endif break; + case _PC_MIN_HOLE_SIZE: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; + break; case _PC_ASYNC_IO: /* _PC_ASYNC_IO should have been handled by upper layers. */ KASSERT(0, ("_PC_ASYNC_IO should not get here")); @@ -2737,6 +2742,20 @@ bad: return (error); } +static int +ufs_ioctl(struct vop_ioctl_args *ap) +{ + + switch (ap->a_command) { + case FIOSEEKDATA: + case FIOSEEKHOLE: + return (vn_bmap_seekhole(ap->a_vp, ap->a_command, + (off_t *)ap->a_data, ap->a_cred)); + default: + return (ENOTTY); + } +} + /* Global vfs data structures for ufs. */ struct vop_vector ufs_vnodeops = { .vop_default = &default_vnodeops, @@ -2751,6 +2770,7 @@ struct vop_vector ufs_vnodeops = { .vop_create = ufs_create, .vop_getattr = ufs_getattr, .vop_inactive = ufs_inactive, + .vop_ioctl = ufs_ioctl, .vop_link = ufs_link, .vop_lookup = vfs_cache_lookup, .vop_markatime = ufs_markatime, From owner-svn-src-all@FreeBSD.ORG Sat May 26 06:10:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B53EC106566B; Sat, 26 May 2012 06:10:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F53C8FC08; Sat, 26 May 2012 06:10:25 +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 q4Q6APVX056151; Sat, 26 May 2012 06:10:25 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q6APad056148; Sat, 26 May 2012 06:10:25 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205260610.q4Q6APad056148@svn.freebsd.org> From: Alan Cox Date: Sat, 26 May 2012 06:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236045 - in head/sys/i386: i386 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 06:10:25 -0000 Author: alc Date: Sat May 26 06:10:25 2012 New Revision: 236045 URL: http://svn.freebsd.org/changeset/base/236045 Log: Rename pmap_collect() to pmap_pv_reclaim() and rewrite it such that it no longer uses the active and inactive paging queues. Instead, the pmap now maintains an LRU-ordered list of pv entry pages, and pmap_pv_reclaim() uses this list to select pv entries for reclamation. Note: The old pmap_collect() tried to avoid reclaiming mappings for pages that have either a hold_count or a busy field that is non-zero. However, this isn't necessary for correctness, and the locking in pmap_collect() was insufficient to guarantee that such mappings weren't reclaimed. The new pmap_pv_reclaim() doesn't even try. MFC after: 5 weeks Modified: head/sys/i386/i386/pmap.c head/sys/i386/include/pmap.h Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat May 26 05:29:53 2012 (r236044) +++ head/sys/i386/i386/pmap.c Sat May 26 06:10:25 2012 (r236045) @@ -233,6 +233,7 @@ static int pat_index[PAT_INDEX_SIZE]; /* /* * Data for the pv entry allocation mechanism */ +static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0; static struct md_page *pv_table; static int shpgperproc = PMAP_SHPGPERPROC; @@ -2187,69 +2188,144 @@ SYSCTL_LONG(_vm_pmap, OID_AUTO, pv_entry "Current number of pv entry allocs"); SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_spare, CTLFLAG_RD, &pv_entry_spare, 0, "Current number of spare pv entries"); - -static int pmap_collect_inactive, pmap_collect_active; - -SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_collect_inactive, CTLFLAG_RD, &pmap_collect_inactive, 0, - "Current number times pmap_collect called on inactive queue"); -SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_collect_active, CTLFLAG_RD, &pmap_collect_active, 0, - "Current number times pmap_collect called on active queue"); #endif /* * We are in a serious low memory condition. Resort to * drastic measures to free some pages so we can allocate - * another pv entry chunk. This is normally called to - * unmap inactive pages, and if necessary, active pages. + * another pv entry chunk. */ -static void -pmap_collect(pmap_t locked_pmap, struct vpgqueues *vpq) +static vm_page_t +pmap_pv_reclaim(pmap_t locked_pmap) { + struct pch newtail; + struct pv_chunk *pc; + struct md_page *pvh; pd_entry_t *pde; pmap_t pmap; pt_entry_t *pte, tpte; - pv_entry_t next_pv, pv; + pv_entry_t pv; vm_offset_t va; - vm_page_t m, free; - + vm_page_t free, m, m_pc; + uint32_t inuse, freemask; + int bit, field, freed; + + PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); + pmap = NULL; + free = m_pc = NULL; + TAILQ_INIT(&newtail); sched_pin(); - TAILQ_FOREACH(m, &vpq->pl, pageq) { - if ((m->flags & PG_MARKER) != 0 || m->hold_count || m->busy) - continue; - TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) { - va = pv->pv_va; - pmap = PV_PMAP(pv); + while ((pc = TAILQ_FIRST(&pv_chunks)) != NULL && (pv_vafree == 0 || + free == NULL)) { + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + if (pmap != pc->pc_pmap) { + if (pmap != NULL) { + pmap_invalidate_all(pmap); + if (pmap != locked_pmap) + PMAP_UNLOCK(pmap); + } + pmap = pc->pc_pmap; /* Avoid deadlock and lock recursion. */ if (pmap > locked_pmap) PMAP_LOCK(pmap); - else if (pmap != locked_pmap && !PMAP_TRYLOCK(pmap)) + else if (pmap != locked_pmap && !PMAP_TRYLOCK(pmap)) { + pmap = NULL; + TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); continue; - pmap->pm_stats.resident_count--; - pde = pmap_pde(pmap, va); - KASSERT((*pde & PG_PS) == 0, ("pmap_collect: found" - " a 4mpage in page %p's pv list", m)); - pte = pmap_pte_quick(pmap, va); - tpte = pte_load_clear(pte); - KASSERT((tpte & PG_W) == 0, - ("pmap_collect: wired pte %#jx", (uintmax_t)tpte)); - if (tpte & PG_A) - vm_page_aflag_set(m, PGA_REFERENCED); - if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) - vm_page_dirty(m); - free = NULL; - pmap_unuse_pt(pmap, va, &free); - pmap_invalidate_page(pmap, va); - pmap_free_zero_pages(free); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); - free_pv_entry(pmap, pv); - if (pmap != locked_pmap) - PMAP_UNLOCK(pmap); + } + } + + /* + * Destroy every non-wired, 4 KB page mapping in the chunk. + */ + freed = 0; + for (field = 0; field < _NPCM; field++) { + freemask = 0; + for (inuse = ~pc->pc_map[field] & pc_freemask[field]; + inuse != 0; inuse &= ~(1UL << bit)) { + bit = bsfl(inuse); + pv = &pc->pc_pventry[field * 32 + bit]; + va = pv->pv_va; + pde = pmap_pde(pmap, va); + if ((*pde & PG_PS) != 0) + continue; + pte = pmap_pte_quick(pmap, va); + if ((*pte & PG_W) != 0) + continue; + tpte = pte_load_clear(pte); + if ((tpte & PG_G) != 0) + pmap_invalidate_page(pmap, va); + m = PHYS_TO_VM_PAGE(tpte & PG_FRAME); + if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) + vm_page_dirty(m); + if ((tpte & PG_A) != 0) + vm_page_aflag_set(m, PGA_REFERENCED); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + if (TAILQ_EMPTY(&pvh->pv_list)) { + vm_page_aflag_clear(m, + PGA_WRITEABLE); + } + } + pmap_unuse_pt(pmap, va, &free); + freemask |= 1UL << bit; + freed++; + } + pc->pc_map[field] |= freemask; + } + if (freed == 0) { + TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); + continue; + } + pmap->pm_stats.resident_count -= freed; + PV_STAT(pv_entry_frees += freed); + PV_STAT(pv_entry_spare += freed); + pv_entry_count -= freed; + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + for (field = 0; field < _NPCM; field++) + if (pc->pc_map[field] != pc_freemask[field]) { + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, + pc_list); + TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); + + /* + * One freed pv entry in locked_pmap is + * sufficient. + */ + if (pmap == locked_pmap) + goto out; + break; + } + if (field == _NPCM) { + PV_STAT(pv_entry_spare -= _NPCPV); + PV_STAT(pc_chunk_count--); + PV_STAT(pc_chunk_frees++); + /* Entire chunk is free; return it. */ + m_pc = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); + pmap_qremove((vm_offset_t)pc, 1); + pmap_ptelist_free(&pv_vafree, (vm_offset_t)pc); + break; } - if (TAILQ_EMPTY(&m->md.pv_list) && - TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)) - vm_page_aflag_clear(m, PGA_WRITEABLE); } +out: sched_unpin(); + TAILQ_CONCAT(&pv_chunks, &newtail, pc_lru); + if (pmap != NULL) { + pmap_invalidate_all(pmap); + if (pmap != locked_pmap) + PMAP_UNLOCK(pmap); + } + if (m_pc == NULL && pv_vafree != 0 && free != NULL) { + m_pc = free; + free = m_pc->right; + /* Recycle a freed page table page. */ + m_pc->wire_count = 1; + atomic_add_int(&cnt.v_wire_count, 1); + } + pmap_free_zero_pages(free); + return (m_pc); } @@ -2280,6 +2356,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); return; } + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); PV_STAT(pv_entry_spare -= _NPCPV); PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); @@ -2300,7 +2377,6 @@ get_pv_entry(pmap_t pmap, int try) { static const struct timeval printinterval = { 60, 0 }; static struct timeval lastprint; - struct vpgqueues *pq; int bit, field; pv_entry_t pv; struct pv_chunk *pc; @@ -2315,7 +2391,6 @@ get_pv_entry(pmap_t pmap, int try) printf("Approaching the limit on PV entries, consider " "increasing either the vm.pmap.shpgperproc or the " "vm.pmap.pv_entry_max tunable.\n"); - pq = NULL; retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); if (pc != NULL) { @@ -2336,6 +2411,10 @@ retry: } TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); + if (pc != TAILQ_LAST(&pv_chunks, pch)) { + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + TAILQ_INSERT_TAIL(&pv_chunks, pc, pc_lru); + } PV_STAT(pv_entry_spare--); return (pv); } @@ -2345,29 +2424,16 @@ retry: * queues lock. If "pv_vafree" is currently non-empty, it will * remain non-empty until pmap_ptelist_alloc() completes. */ - if (pv_vafree == 0 || (m = vm_page_alloc(NULL, 0, (pq == - &vm_page_queues[PQ_ACTIVE] ? VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL) | + if (pv_vafree == 0 || (m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { if (try) { pv_entry_count--; PV_STAT(pc_chunk_tryfail++); return (NULL); } - /* - * Reclaim pv entries: At first, destroy mappings to - * inactive pages. After that, if a pv chunk entry - * is still needed, destroy mappings to active pages. - */ - if (pq == NULL) { - PV_STAT(pmap_collect_inactive++); - pq = &vm_page_queues[PQ_INACTIVE]; - } else if (pq == &vm_page_queues[PQ_INACTIVE]) { - PV_STAT(pmap_collect_active++); - pq = &vm_page_queues[PQ_ACTIVE]; - } else - panic("get_pv_entry: increase vm.pmap.shpgperproc"); - pmap_collect(pmap, pq); - goto retry; + m = pmap_pv_reclaim(pmap); + if (m == NULL) + goto retry; } PV_STAT(pc_chunk_count++); PV_STAT(pc_chunk_allocs++); @@ -2377,6 +2443,7 @@ retry: pc->pc_map[0] = pc_freemask[0] & ~1ul; /* preallocated bit 0 */ for (field = 1; field < _NPCM; field++) pc->pc_map[field] = pc_freemask[field]; + TAILQ_INSERT_TAIL(&pv_chunks, pc, pc_lru); pv = &pc->pc_pventry[0]; TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); PV_STAT(pv_entry_spare += _NPCPV - 1); @@ -4374,6 +4441,7 @@ pmap_remove_pages(pmap_t pmap) PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); pmap_qremove((vm_offset_t)pc, 1); vm_page_unwire(m, 0); Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Sat May 26 05:29:53 2012 (r236044) +++ head/sys/i386/include/pmap.h Sat May 26 06:10:25 2012 (r236045) @@ -481,7 +481,7 @@ struct pv_chunk { pmap_t pc_pmap; TAILQ_ENTRY(pv_chunk) pc_list; uint32_t pc_map[_NPCM]; /* bitmap; 1 = free */ - uint32_t pc_spare[2]; + TAILQ_ENTRY(pv_chunk) pc_lru; struct pv_entry pc_pventry[_NPCPV]; }; From owner-svn-src-all@FreeBSD.ORG Sat May 26 06:31:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1EA4106566B; Sat, 26 May 2012 06:31:54 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD48C8FC08; Sat, 26 May 2012 06:31: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 q4Q6VsY7057010; Sat, 26 May 2012 06:31:54 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q6VsCj057008; Sat, 26 May 2012 06:31:54 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205260631.q4Q6VsCj057008@svn.freebsd.org> From: Joel Dahl Date: Sat, 26 May 2012 06:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236046 - head/usr.bin/sort X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 06:31:55 -0000 Author: joel (doc committer) Date: Sat May 26 06:31:54 2012 New Revision: 236046 URL: http://svn.freebsd.org/changeset/base/236046 Log: mdoc: sort sections into conventional order. Modified: head/usr.bin/sort/sort.1.in Modified: head/usr.bin/sort/sort.1.in ============================================================================== --- head/usr.bin/sort/sort.1.in Sat May 26 06:10:25 2012 (r236045) +++ head/usr.bin/sort/sort.1.in Sat May 26 06:31:54 2012 (r236046) @@ -501,27 +501,6 @@ option is still supported, except for which has no .Fl k equivalent. -.Sh EXIT STATUS -The -.Nm -utility shall exit with one of the following values: -.Pp -.Bl -tag -width flag -compact -.It 0 -Successfully sorted the input files or if used with -.Fl c -or -.Fl C , -the input file already met the sorting criteria. -.It 1 -On disorder (or non-uniqueness) with the -.Fl c -or -.Fl C -options. -.It 2 -An error occurred. -.El .Sh ENVIRONMENT .Bl -tag -width Fl .It Ev LC_COLLATE @@ -578,6 +557,27 @@ Temporary files. .It Pa /dev/random Default seed file for the random sort. .El +.Sh EXIT STATUS +The +.Nm +utility shall exit with one of the following values: +.Pp +.Bl -tag -width flag -compact +.It 0 +Successfully sorted the input files or if used with +.Fl c +or +.Fl C , +the input file already met the sorting criteria. +.It 1 +On disorder (or non-uniqueness) with the +.Fl c +or +.Fl C +options. +.It 2 +An error occurred. +.El .Sh SEE ALSO .Xr comm 1 , .Xr join 1 , From owner-svn-src-all@FreeBSD.ORG Sat May 26 07:34:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B66E9106566C; Sat, 26 May 2012 07:34:46 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 969538FC12; Sat, 26 May 2012 07:34: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 q4Q7YkF5059577; Sat, 26 May 2012 07:34:46 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7YkAU059573; Sat, 26 May 2012 07:34:46 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260734.q4Q7YkAU059573@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:34:46 +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: r236047 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:34:46 -0000 Author: thompsa Date: Sat May 26 07:34:46 2012 New Revision: 236047 URL: http://svn.freebsd.org/changeset/base/236047 Log: MFC r232014,r232030,r232070 - bstp_input() always consumes the packet so remove the mbuf handling dance around it. - Now that network interfaces advertise if they support linkstate notifications we do not need to perform a media ioctl every 15 seconds. - Indicate this function decrements the timer as well as testing for expiry. Modified: stable/9/sys/net/bridgestp.c stable/9/sys/net/bridgestp.h 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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/net/bridgestp.c ============================================================================== --- stable/9/sys/net/bridgestp.c Sat May 26 06:31:54 2012 (r236046) +++ stable/9/sys/net/bridgestp.c Sat May 26 07:34:46 2012 (r236047) @@ -134,7 +134,7 @@ static void bstp_tick(void *); static void bstp_timer_start(struct bstp_timer *, uint16_t); static void bstp_timer_stop(struct bstp_timer *); static void bstp_timer_latch(struct bstp_timer *); -static int bstp_timer_expired(struct bstp_timer *); +static int bstp_timer_dectest(struct bstp_timer *); static void bstp_hello_timer_expiry(struct bstp_state *, struct bstp_port *); static void bstp_message_age_expiry(struct bstp_state *, @@ -446,7 +446,7 @@ bstp_pdu_flags(struct bstp_port *bp) return (flags); } -struct mbuf * +void bstp_input(struct bstp_port *bp, struct ifnet *ifp, struct mbuf *m) { struct bstp_state *bs = bp->bp_bs; @@ -456,7 +456,7 @@ bstp_input(struct bstp_port *bp, struct if (bp->bp_active == 0) { m_freem(m); - return (NULL); + return; } BSTP_LOCK(bs); @@ -521,7 +521,6 @@ out: BSTP_UNLOCK(bs); if (m) m_freem(m); - return (NULL); } static void @@ -1862,30 +1861,32 @@ bstp_tick(void *arg) CURVNET_SET(bs->bs_vnet); - /* slow timer to catch missed link events */ - if (bstp_timer_expired(&bs->bs_link_timer)) { - LIST_FOREACH(bp, &bs->bs_bplist, bp_next) - bstp_ifupdstatus(bs, bp); + /* poll link events on interfaces that do not support linkstate */ + if (bstp_timer_dectest(&bs->bs_link_timer)) { + LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { + if (!(bp->bp_ifp->if_capabilities & IFCAP_LINKSTATE)) + bstp_ifupdstatus(bs, bp); + } bstp_timer_start(&bs->bs_link_timer, BSTP_LINK_TIMER); } LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { /* no events need to happen for these */ - bstp_timer_expired(&bp->bp_tc_timer); - bstp_timer_expired(&bp->bp_recent_root_timer); - bstp_timer_expired(&bp->bp_forward_delay_timer); - bstp_timer_expired(&bp->bp_recent_backup_timer); + bstp_timer_dectest(&bp->bp_tc_timer); + bstp_timer_dectest(&bp->bp_recent_root_timer); + bstp_timer_dectest(&bp->bp_forward_delay_timer); + bstp_timer_dectest(&bp->bp_recent_backup_timer); - if (bstp_timer_expired(&bp->bp_hello_timer)) + if (bstp_timer_dectest(&bp->bp_hello_timer)) bstp_hello_timer_expiry(bs, bp); - if (bstp_timer_expired(&bp->bp_message_age_timer)) + if (bstp_timer_dectest(&bp->bp_message_age_timer)) bstp_message_age_expiry(bs, bp); - if (bstp_timer_expired(&bp->bp_migrate_delay_timer)) + if (bstp_timer_dectest(&bp->bp_migrate_delay_timer)) bstp_migrate_delay_expiry(bs, bp); - if (bstp_timer_expired(&bp->bp_edge_delay_timer)) + if (bstp_timer_dectest(&bp->bp_edge_delay_timer)) bstp_edge_delay_expiry(bs, bp); /* update the various state machines for the port */ @@ -1924,7 +1925,7 @@ bstp_timer_latch(struct bstp_timer *t) } static int -bstp_timer_expired(struct bstp_timer *t) +bstp_timer_dectest(struct bstp_timer *t) { if (t->active == 0 || t->latched) return (0); Modified: stable/9/sys/net/bridgestp.h ============================================================================== --- stable/9/sys/net/bridgestp.h Sat May 26 06:31:54 2012 (r236046) +++ stable/9/sys/net/bridgestp.h Sat May 26 07:34:46 2012 (r236047) @@ -392,6 +392,6 @@ int bstp_set_edge(struct bstp_port *, in int bstp_set_autoedge(struct bstp_port *, int); int bstp_set_ptp(struct bstp_port *, int); int bstp_set_autoptp(struct bstp_port *, int); -struct mbuf *bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *); +void bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *); #endif /* _KERNEL */ Modified: stable/9/sys/net/if_bridge.c ============================================================================== --- stable/9/sys/net/if_bridge.c Sat May 26 06:31:54 2012 (r236046) +++ stable/9/sys/net/if_bridge.c Sat May 26 07:34:46 2012 (r236047) @@ -2208,11 +2208,9 @@ bridge_input(struct ifnet *ifp, struct m /* Tap off 802.1D packets; they do not get forwarded. */ if (memcmp(eh->ether_dhost, bstp_etheraddr, ETHER_ADDR_LEN) == 0) { - m = bstp_input(&bif->bif_stp, ifp, m); - if (m == NULL) { - BRIDGE_UNLOCK(sc); - return (NULL); - } + bstp_input(&bif->bif_stp, ifp, m); /* consumes mbuf */ + BRIDGE_UNLOCK(sc); + return (NULL); } if ((bif->bif_flags & IFBIF_STP) && From owner-svn-src-all@FreeBSD.ORG Sat May 26 07:35:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51881106564A; Sat, 26 May 2012 07:35:45 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BCEC8FC17; Sat, 26 May 2012 07:35: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 q4Q7ZjJR059652; Sat, 26 May 2012 07:35:45 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7ZjtV059650; Sat, 26 May 2012 07:35:45 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260735.q4Q7ZjtV059650@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:35:45 +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: r236048 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:35:45 -0000 Author: thompsa Date: Sat May 26 07:35:44 2012 New Revision: 236048 URL: http://svn.freebsd.org/changeset/base/236048 Log: MFC r232118 Only look for a usable MAC address for the bridge ID from ports within our bridge, this allows us to have more than one independent bridge in the same STP domain. PR: kern/164369 Submitted by: Nikos Vassiliadis (earlier version) Modified: stable/9/sys/net/bridgestp.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/net/bridgestp.c ============================================================================== --- stable/9/sys/net/bridgestp.c Sat May 26 07:34:46 2012 (r236047) +++ stable/9/sys/net/bridgestp.c Sat May 26 07:35:44 2012 (r236048) @@ -2013,24 +2013,33 @@ bstp_reinit(struct bstp_state *bs) struct bstp_port *bp; struct ifnet *ifp, *mif; u_char *e_addr; + void *bridgeptr; static const u_char llzero[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ BSTP_LOCK_ASSERT(bs); + if (LIST_EMPTY(&bs->bs_bplist)) + goto disablestp; + mif = NULL; + bridgeptr = LIST_FIRST(&bs->bs_bplist)->bp_ifp->if_bridge; + KASSERT(bridgeptr != NULL, ("Invalid bridge pointer")); /* * Search through the Ethernet adapters and find the one with the - * lowest value. The adapter which we take the MAC address from does - * not need to be part of the bridge, it just needs to be a unique - * value. + * lowest value. Make sure the adapter which we take the MAC address + * from is part of this bridge, so we can have more than one independent + * bridges in the same STP domain. */ IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (ifp->if_type != IFT_ETHER) - continue; + continue; /* Not Ethernet */ + + if (ifp->if_bridge != bridgeptr) + continue; /* Not part of our bridge */ if (bstp_addr_cmp(IF_LLADDR(ifp), llzero) == 0) - continue; + continue; /* No mac address set */ if (mif == NULL) { mif = ifp; @@ -2042,21 +2051,8 @@ bstp_reinit(struct bstp_state *bs) } } IFNET_RUNLOCK_NOSLEEP(); - - if (LIST_EMPTY(&bs->bs_bplist) || mif == NULL) { - /* Set the bridge and root id (lower bits) to zero */ - bs->bs_bridge_pv.pv_dbridge_id = - ((uint64_t)bs->bs_bridge_priority) << 48; - bs->bs_bridge_pv.pv_root_id = bs->bs_bridge_pv.pv_dbridge_id; - bs->bs_root_pv = bs->bs_bridge_pv; - /* Disable any remaining ports, they will have no MAC address */ - LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { - bp->bp_infois = BSTP_INFO_DISABLED; - bstp_set_port_role(bp, BSTP_ROLE_DISABLED); - } - callout_stop(&bs->bs_bstpcallout); - return; - } + if (mif == NULL) + goto disablestp; e_addr = IF_LLADDR(mif); bs->bs_bridge_pv.pv_dbridge_id = @@ -2084,6 +2080,20 @@ bstp_reinit(struct bstp_state *bs) bstp_assign_roles(bs); bstp_timer_start(&bs->bs_link_timer, BSTP_LINK_TIMER); + return; + +disablestp: + /* Set the bridge and root id (lower bits) to zero */ + bs->bs_bridge_pv.pv_dbridge_id = + ((uint64_t)bs->bs_bridge_priority) << 48; + bs->bs_bridge_pv.pv_root_id = bs->bs_bridge_pv.pv_dbridge_id; + bs->bs_root_pv = bs->bs_bridge_pv; + /* Disable any remaining ports, they will have no MAC address */ + LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { + bp->bp_infois = BSTP_INFO_DISABLED; + bstp_set_port_role(bp, BSTP_ROLE_DISABLED); + } + callout_stop(&bs->bs_bstpcallout); } static int From owner-svn-src-all@FreeBSD.ORG Sat May 26 07:39:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F5F7106564A; Sat, 26 May 2012 07:39:53 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7899A8FC08; Sat, 26 May 2012 07:39:53 +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 q4Q7drrJ059856; Sat, 26 May 2012 07:39:53 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7drYM059850; Sat, 26 May 2012 07:39:53 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260739.q4Q7drYM059850@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:39: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: r236049 - in stable/9: sbin/ifconfig sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:39:53 -0000 Author: thompsa Date: Sat May 26 07:39:52 2012 New Revision: 236049 URL: http://svn.freebsd.org/changeset/base/236049 Log: MFC r232629,r232640 Add the ability to set which packet layers are used for the load balance hash calculation. Modified: stable/9/sbin/ifconfig/ifconfig.8 stable/9/sbin/ifconfig/iflagg.c stable/9/sys/net/ieee8023ad_lacp.c stable/9/sys/net/if_lagg.c stable/9/sys/net/if_lagg.h Directory Properties: stable/9/sbin/ifconfig/ (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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/9/sbin/ifconfig/ifconfig.8 Sat May 26 07:35:44 2012 (r236048) +++ stable/9/sbin/ifconfig/ifconfig.8 Sat May 26 07:39:52 2012 (r236049) @@ -2277,6 +2277,21 @@ Set the aggregation protocol. The default is failover. The available options are failover, fec, lacp, loadbalance, roundrobin and none. +.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc +Set the packet layers to hash for aggregation protocols which load balance. +The default is +.Dq l2,l3,l4 . +The options can be combined using commas. +.Pp +.Bl -tag -width ".Cm l2" -compact +.It Cm l2 +src/dst mac address and optional vlan number. +.It Cm l3 +src/dst address for IPv4 or IPv6. +.It Cm l4 +src/dst port for TCP/UCP/SCTP. +.El +.Pp .El .Pp The following parameters are specific to IP tunnel interfaces, Modified: stable/9/sbin/ifconfig/iflagg.c ============================================================================== --- stable/9/sbin/ifconfig/iflagg.c Sat May 26 07:35:44 2012 (r236048) +++ stable/9/sbin/ifconfig/iflagg.c Sat May 26 07:39:52 2012 (r236049) @@ -81,6 +81,36 @@ setlaggproto(const char *val, int d, int err(1, "SIOCSLAGG"); } +static void +setlagghash(const char *val, int d, int s, const struct afswtch *afp) +{ + struct lagg_reqflags rf; + char *str, *tmp, *tok; + + + rf.rf_flags = 0; + str = tmp = strdup(val); + while ((tok = strsep(&tmp, ",")) != NULL) { + if (strcmp(tok, "l2") == 0) + rf.rf_flags |= LAGG_F_HASHL2; + else if (strcmp(tok, "l3") == 0) + rf.rf_flags |= LAGG_F_HASHL3; + else if (strcmp(tok, "l4") == 0) + rf.rf_flags |= LAGG_F_HASHL4; + else { + free(str); + errx(1, "Invalid lagghash option: %s", tok); + } + } + free(str); + if (rf.rf_flags == 0) + errx(1, "No lagghash options supplied"); + + strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); + if (ioctl(s, SIOCSLAGGHASH, &rf)) + err(1, "SIOCSLAGGHASH"); +} + static char * lacp_format_mac(const uint8_t *mac, char *buf, size_t buflen) { @@ -115,6 +145,7 @@ lagg_status(int s) struct lagg_protos lpr[] = LAGG_PROTOS; struct lagg_reqport rp, rpbuf[LAGG_MAX_PORTS]; struct lagg_reqall ra; + struct lagg_reqflags rf; struct lacp_opreq *lp; const char *proto = ""; int i, isport = 0; @@ -132,6 +163,10 @@ lagg_status(int s) ra.ra_size = sizeof(rpbuf); ra.ra_port = rpbuf; + strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); + if (ioctl(s, SIOCGLAGGFLAGS, &rf) != 0) + rf.rf_flags = 0; + if (ioctl(s, SIOCGLAGG, &ra) == 0) { lp = (struct lacp_opreq *)&ra.ra_lacpreq; @@ -143,6 +178,23 @@ lagg_status(int s) } printf("\tlaggproto %s", proto); + if (rf.rf_flags & LAGG_F_HASHMASK) { + const char *sep = ""; + + printf(" lagghash "); + if (rf.rf_flags & LAGG_F_HASHL2) { + printf("%sl2", sep); + sep = ","; + } + if (rf.rf_flags & LAGG_F_HASHL3) { + printf("%sl3", sep); + sep = ","; + } + if (rf.rf_flags & LAGG_F_HASHL4) { + printf("%sl4", sep); + sep = ","; + } + } if (isport) printf(" laggdev %s", rp.rp_ifname); putchar('\n'); @@ -174,6 +226,7 @@ static struct cmd lagg_cmds[] = { DEF_CMD_ARG("laggport", setlaggport), DEF_CMD_ARG("-laggport", unsetlaggport), DEF_CMD_ARG("laggproto", setlaggproto), + DEF_CMD_ARG("lagghash", setlagghash), }; static struct afswtch af_lagg = { .af_name = "af_lagg", Modified: stable/9/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/9/sys/net/ieee8023ad_lacp.c Sat May 26 07:35:44 2012 (r236048) +++ stable/9/sys/net/ieee8023ad_lacp.c Sat May 26 07:39:52 2012 (r236049) @@ -815,7 +815,7 @@ lacp_select_tx_port(struct lagg_softc *s if (sc->use_flowid && (m->m_flags & M_FLOWID)) hash = m->m_pkthdr.flowid; else - hash = lagg_hashmbuf(m, lsc->lsc_hashkey); + hash = lagg_hashmbuf(sc, m, lsc->lsc_hashkey); hash %= pm->pm_count; lp = pm->pm_map[hash]; Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Sat May 26 07:35:44 2012 (r236048) +++ stable/9/sys/net/if_lagg.c Sat May 26 07:39:52 2012 (r236049) @@ -284,6 +284,8 @@ lagg_clone_create(struct if_clone *ifc, SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flowid, "Use flow id for load sharing"); + /* Hash all layers by default */ + sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; sc->sc_proto = LAGG_PROTO_NONE; for (i = 0; lagg_protos[i].ti_proto != LAGG_PROTO_NONE; i++) { @@ -895,6 +897,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; struct lagg_reqall *ra = (struct lagg_reqall *)data; struct lagg_reqport *rp = (struct lagg_reqport *)data, rpbuf; + struct lagg_reqflags *rf = (struct lagg_reqflags *)data; struct ifreq *ifr = (struct ifreq *)data; struct lagg_port *lp; struct ifnet *tpif; @@ -984,6 +987,22 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd } error = EPROTONOSUPPORT; break; + case SIOCGLAGGFLAGS: + rf->rf_flags = sc->sc_flags; + break; + case SIOCSLAGGHASH: + error = priv_check(td, PRIV_NET_LAGG); + if (error) + break; + if ((rf->rf_flags & LAGG_F_HASHMASK) == 0) { + error = EINVAL; + break; + } + LAGG_WLOCK(sc); + sc->sc_flags &= ~LAGG_F_HASHMASK; + sc->sc_flags |= rf->rf_flags & LAGG_F_HASHMASK; + LAGG_WUNLOCK(sc); + break; case SIOCGLAGGPORT: if (rp->rp_portname[0] == '\0' || (tpif = ifunit(rp->rp_portname)) == NULL) { @@ -1413,42 +1432,55 @@ lagg_gethdr(struct mbuf *m, u_int off, u } uint32_t -lagg_hashmbuf(struct mbuf *m, uint32_t key) +lagg_hashmbuf(struct lagg_softc *sc, struct mbuf *m, uint32_t key) { uint16_t etype; - uint32_t p = 0; + uint32_t p = key; int off; struct ether_header *eh; - struct ether_vlan_header vlanbuf; const struct ether_vlan_header *vlan; #ifdef INET const struct ip *ip; - struct ip ipbuf; + const uint32_t *ports; + int iphlen; #endif #ifdef INET6 const struct ip6_hdr *ip6; - struct ip6_hdr ip6buf; uint32_t flow; #endif + union { +#ifdef INET + struct ip ip; +#endif +#ifdef INET6 + struct ip6_hdr ip6; +#endif + struct ether_vlan_header vlan; + uint32_t port; + } buf; + off = sizeof(*eh); if (m->m_len < off) goto out; eh = mtod(m, struct ether_header *); etype = ntohs(eh->ether_type); - p = hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, key); - p = hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + if (sc->sc_flags & LAGG_F_HASHL2) { + p = hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); + p = hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + } /* Special handling for encapsulating VLAN frames */ - if (m->m_flags & M_VLANTAG) { + if ((m->m_flags & M_VLANTAG) && (sc->sc_flags & LAGG_F_HASHL2)) { p = hash32_buf(&m->m_pkthdr.ether_vtag, sizeof(m->m_pkthdr.ether_vtag), p); } else if (etype == ETHERTYPE_VLAN) { - vlan = lagg_gethdr(m, off, sizeof(*vlan), &vlanbuf); + vlan = lagg_gethdr(m, off, sizeof(*vlan), &buf); if (vlan == NULL) goto out; - p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); + if (sc->sc_flags & LAGG_F_HASHL2) + p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); etype = ntohs(vlan->evl_proto); off += sizeof(*vlan) - sizeof(*eh); } @@ -1456,17 +1488,37 @@ lagg_hashmbuf(struct mbuf *m, uint32_t k switch (etype) { #ifdef INET case ETHERTYPE_IP: - ip = lagg_gethdr(m, off, sizeof(*ip), &ipbuf); + ip = lagg_gethdr(m, off, sizeof(*ip), &buf); if (ip == NULL) goto out; - p = hash32_buf(&ip->ip_src, sizeof(struct in_addr), p); - p = hash32_buf(&ip->ip_dst, sizeof(struct in_addr), p); + if (sc->sc_flags & LAGG_F_HASHL3) { + p = hash32_buf(&ip->ip_src, sizeof(struct in_addr), p); + p = hash32_buf(&ip->ip_dst, sizeof(struct in_addr), p); + } + if (!(sc->sc_flags & LAGG_F_HASHL4)) + break; + switch (ip->ip_p) { + case IPPROTO_TCP: + case IPPROTO_UDP: + case IPPROTO_SCTP: + iphlen = ip->ip_hl << 2; + if (iphlen < sizeof(*ip)) + break; + off += iphlen; + ports = lagg_gethdr(m, off, sizeof(*ports), &buf); + if (ports == NULL) + break; + p = hash32_buf(ports, sizeof(*ports), p); + break; + } break; #endif #ifdef INET6 case ETHERTYPE_IPV6: - ip6 = lagg_gethdr(m, off, sizeof(*ip6), &ip6buf); + if (!(sc->sc_flags & LAGG_F_HASHL3)) + break; + ip6 = lagg_gethdr(m, off, sizeof(*ip6), &buf); if (ip6 == NULL) goto out; @@ -1696,7 +1748,7 @@ lagg_lb_start(struct lagg_softc *sc, str if (sc->use_flowid && (m->m_flags & M_FLOWID)) p = m->m_pkthdr.flowid; else - p = lagg_hashmbuf(m, lb->lb_key); + p = lagg_hashmbuf(sc, m, lb->lb_key); p %= sc->sc_count; lp = lb->lb_ports[p]; Modified: stable/9/sys/net/if_lagg.h ============================================================================== --- stable/9/sys/net/if_lagg.h Sat May 26 07:35:44 2012 (r236048) +++ stable/9/sys/net/if_lagg.h Sat May 26 07:39:52 2012 (r236049) @@ -31,6 +31,12 @@ #define LAGG_MAX_NAMESIZE 32 /* name of a protocol */ #define LAGG_MAX_STACKING 4 /* maximum number of stacked laggs */ +/* Lagg flags */ +#define LAGG_F_HASHL2 0x00000001 /* hash layer 2 */ +#define LAGG_F_HASHL3 0x00000002 /* hash layer 3 */ +#define LAGG_F_HASHL4 0x00000004 /* hash layer 4 */ +#define LAGG_F_HASHMASK 0x00000007 + /* Port flags */ #define LAGG_PORT_SLAVE 0x00000000 /* normal enslaved port */ #define LAGG_PORT_MASTER 0x00000001 /* primary port */ @@ -122,6 +128,14 @@ struct lagg_reqall { #define SIOCGLAGG _IOWR('i', 143, struct lagg_reqall) #define SIOCSLAGG _IOW('i', 144, struct lagg_reqall) +struct lagg_reqflags { + char rf_ifname[IFNAMSIZ]; /* name of the lagg */ + uint32_t rf_flags; /* lagg protocol */ +}; + +#define SIOCGLAGGFLAGS _IOWR('i', 145, struct lagg_reqflags) +#define SIOCSLAGGHASH _IOW('i', 146, struct lagg_reqflags) + #ifdef _KERNEL /* * Internal kernel part @@ -179,6 +193,7 @@ struct lagg_softc { struct ifmedia sc_media; /* media config */ caddr_t sc_psc; /* protocol data */ uint32_t sc_seq; /* sequence counter */ + uint32_t sc_flags; SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */ SLIST_ENTRY(lagg_softc) sc_entries; @@ -244,7 +259,7 @@ extern struct mbuf *(*lagg_input_p)(stru extern void (*lagg_linkstate_p)(struct ifnet *, int ); int lagg_enqueue(struct ifnet *, struct mbuf *); -uint32_t lagg_hashmbuf(struct mbuf *, uint32_t); +uint32_t lagg_hashmbuf(struct lagg_softc *, struct mbuf *, uint32_t); #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Sat May 26 07:41:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D62C106564A; Sat, 26 May 2012 07:41:06 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DABA8FC1A; Sat, 26 May 2012 07:41: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 q4Q7f61v059946; Sat, 26 May 2012 07:41:06 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7f6JP059944; Sat, 26 May 2012 07:41:06 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260741.q4Q7f6JP059944@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:41: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: r236050 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:41:06 -0000 Author: thompsa Date: Sat May 26 07:41:05 2012 New Revision: 236050 URL: http://svn.freebsd.org/changeset/base/236050 Log: MFC r234163 Set the proto to LAGG_PROTO_NONE before calling the detach routine so packets are discarded, this is an issue because lacp drops the lock which may allow network threads to access freed memory. Expand the lock coverage so the detach/attach happen atomically. Submitted by: Andrew Boyer (earlier version) Modified: stable/9/sys/net/if_lagg.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Sat May 26 07:39:52 2012 (r236049) +++ stable/9/sys/net/if_lagg.c Sat May 26 07:41:05 2012 (r236050) @@ -950,11 +950,11 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd error = EPROTONOSUPPORT; break; } + LAGG_WLOCK(sc); if (sc->sc_proto != LAGG_PROTO_NONE) { - LAGG_WLOCK(sc); - error = sc->sc_detach(sc); - /* Reset protocol and pointers */ + /* Reset protocol first in case detach unlocks */ sc->sc_proto = LAGG_PROTO_NONE; + error = sc->sc_detach(sc); sc->sc_detach = NULL; sc->sc_start = NULL; sc->sc_input = NULL; @@ -966,10 +966,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd sc->sc_lladdr = NULL; sc->sc_req = NULL; sc->sc_portreq = NULL; - LAGG_WUNLOCK(sc); + } else if (sc->sc_input != NULL) { + /* Still detaching */ + error = EBUSY; } - if (error != 0) + if (error != 0) { + LAGG_WUNLOCK(sc); break; + } for (int i = 0; i < (sizeof(lagg_protos) / sizeof(lagg_protos[0])); i++) { if (lagg_protos[i].ti_proto == ra->ra_proto) { @@ -977,7 +981,6 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd printf("%s: using proto %u\n", sc->sc_ifname, lagg_protos[i].ti_proto); - LAGG_WLOCK(sc); sc->sc_proto = lagg_protos[i].ti_proto; if (sc->sc_proto != LAGG_PROTO_NONE) error = lagg_protos[i].ti_attach(sc); @@ -985,6 +988,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd return (error); } } + LAGG_WUNLOCK(sc); error = EPROTONOSUPPORT; break; case SIOCGLAGGFLAGS: From owner-svn-src-all@FreeBSD.ORG Sat May 26 07:42:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 582F9106566C; Sat, 26 May 2012 07:42:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 427438FC0A; Sat, 26 May 2012 07:42:33 +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 q4Q7gXCY060047; Sat, 26 May 2012 07:42:33 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7gXCr060042; Sat, 26 May 2012 07:42:33 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260742.q4Q7gXCr060042@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:42:32 +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: r236051 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:42:33 -0000 Author: thompsa Date: Sat May 26 07:42:32 2012 New Revision: 236051 URL: http://svn.freebsd.org/changeset/base/236051 Log: MFC r234487 Add linkstate to bridge(4), set the link to up when at least one underlying interface is up, otherwise the link is down. This, among other things, allows carp to work on a bridge. Modified: stable/9/sys/net/bridgestp.c stable/9/sys/net/bridgestp.h stable/9/sys/net/if.c 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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/net/bridgestp.c ============================================================================== --- stable/9/sys/net/bridgestp.c Sat May 26 07:41:05 2012 (r236050) +++ stable/9/sys/net/bridgestp.c Sat May 26 07:42:32 2012 (r236051) @@ -1767,28 +1767,16 @@ bstp_notify_rtage(void *arg, int pending } void -bstp_linkstate(struct ifnet *ifp, int state) +bstp_linkstate(struct bstp_port *bp) { - struct bstp_state *bs; - struct bstp_port *bp; + struct bstp_state *bs = bp->bp_bs; - /* search for the stp port */ - mtx_lock(&bstp_list_mtx); - LIST_FOREACH(bs, &bstp_list, bs_list) { - BSTP_LOCK(bs); - LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { - if (bp->bp_ifp == ifp) { - bstp_ifupdstatus(bs, bp); - bstp_update_state(bs, bp); - /* it only exists once so return */ - BSTP_UNLOCK(bs); - mtx_unlock(&bstp_list_mtx); - return; - } - } - BSTP_UNLOCK(bs); + BSTP_LOCK(bs); + if (bp->bp_active) { + bstp_ifupdstatus(bs, bp); + bstp_update_state(bs, bp); } - mtx_unlock(&bstp_list_mtx); + BSTP_UNLOCK(bs); } static void @@ -2103,10 +2091,8 @@ bstp_modevent(module_t mod, int type, vo case MOD_LOAD: mtx_init(&bstp_list_mtx, "bridgestp list", NULL, MTX_DEF); LIST_INIT(&bstp_list); - bstp_linkstate_p = bstp_linkstate; break; case MOD_UNLOAD: - bstp_linkstate_p = NULL; mtx_destroy(&bstp_list_mtx); break; default: Modified: stable/9/sys/net/bridgestp.h ============================================================================== --- stable/9/sys/net/bridgestp.h Sat May 26 07:41:05 2012 (r236050) +++ stable/9/sys/net/bridgestp.h Sat May 26 07:42:32 2012 (r236051) @@ -369,8 +369,6 @@ struct bstp_state { extern const uint8_t bstp_etheraddr[]; -extern void (*bstp_linkstate_p)(struct ifnet *ifp, int state); - void bstp_attach(struct bstp_state *, struct bstp_cb_ops *); void bstp_detach(struct bstp_state *); void bstp_init(struct bstp_state *); @@ -379,7 +377,7 @@ int bstp_create(struct bstp_state *, str int bstp_enable(struct bstp_port *); void bstp_disable(struct bstp_port *); void bstp_destroy(struct bstp_port *); -void bstp_linkstate(struct ifnet *, int); +void bstp_linkstate(struct bstp_port *); int bstp_set_htime(struct bstp_state *, int); int bstp_set_fdelay(struct bstp_state *, int); int bstp_set_maxage(struct bstp_state *, int); Modified: stable/9/sys/net/if.c ============================================================================== --- stable/9/sys/net/if.c Sat May 26 07:41:05 2012 (r236050) +++ stable/9/sys/net/if.c Sat May 26 07:42:32 2012 (r236051) @@ -124,7 +124,7 @@ MALLOC_DEFINE(M_IFDESCR, "ifdescr", "ifn static struct sx ifdescr_sx; SX_SYSINIT(ifdescr_sx, &ifdescr_sx, "ifnet descr"); -void (*bstp_linkstate_p)(struct ifnet *ifp, int state); +void (*bridge_linkstate_p)(struct ifnet *ifp); void (*ng_ether_link_state_p)(struct ifnet *ifp, int state); void (*lagg_linkstate_p)(struct ifnet *ifp, int state); /* These are external hooks for CARP. */ @@ -1925,14 +1925,10 @@ do_link_state_change(void *arg, int pend (*ng_ether_link_state_p)(ifp, link_state); if (ifp->if_carp) (*carp_linkstate_p)(ifp); - if (ifp->if_bridge) { - KASSERT(bstp_linkstate_p != NULL,("if_bridge bstp not loaded!")); - (*bstp_linkstate_p)(ifp, link_state); - } - if (ifp->if_lagg) { - KASSERT(lagg_linkstate_p != NULL,("if_lagg not loaded!")); + if (ifp->if_bridge) + (*bridge_linkstate_p)(ifp); + if (ifp->if_lagg) (*lagg_linkstate_p)(ifp, link_state); - } if (IS_DEFAULT_VNET(curvnet)) devctl_notify("IFNET", ifp->if_xname, Modified: stable/9/sys/net/if_bridge.c ============================================================================== --- stable/9/sys/net/if_bridge.c Sat May 26 07:41:05 2012 (r236050) +++ stable/9/sys/net/if_bridge.c Sat May 26 07:42:32 2012 (r236051) @@ -333,6 +333,9 @@ static int bridge_ip6_checkbasic(struct #endif /* INET6 */ static int bridge_fragment(struct ifnet *, struct mbuf *, struct ether_header *, int, struct llc *); +static void bridge_linkstate(struct ifnet *ifp); + +extern void (*bridge_linkstate_p)(struct ifnet *ifp); /* The default bridge vlan is 1 (IEEE 802.1Q-2003 Table 9-2) */ #define VLANTAGOF(_m) \ @@ -489,6 +492,7 @@ bridge_modevent(module_t mod, int type, bridge_input_p = bridge_input; bridge_output_p = bridge_output; bridge_dn_p = bridge_dummynet; + bridge_linkstate_p = bridge_linkstate; bridge_detach_cookie = EVENTHANDLER_REGISTER( ifnet_departure_event, bridge_ifdetach, NULL, EVENTHANDLER_PRI_ANY); @@ -501,6 +505,7 @@ bridge_modevent(module_t mod, int type, bridge_input_p = NULL; bridge_output_p = NULL; bridge_dn_p = NULL; + bridge_linkstate_p = NULL; mtx_destroy(&bridge_list_mtx); break; default: @@ -981,6 +986,7 @@ bridge_delete_member(struct bridge_softc bridge_set_ifcap(sc, bif, bif->bif_savedcaps); } bstp_destroy(&bif->bif_stp); /* prepare to free */ + bridge_linkstate(ifs); BRIDGE_LOCK(sc); free(bif, M_DEVBUF); } @@ -1080,17 +1086,17 @@ bridge_ioctl_add(struct bridge_softc *sc /* Set interface capabilities to the intersection set of all members */ bridge_mutecaps(sc); + BRIDGE_UNLOCK(sc); + /* Update the linkstate for the bridge */ + bridge_linkstate(ifs); + /* Place the interface into promiscuous mode */ switch (ifs->if_type) { - case IFT_ETHER: - case IFT_L2VLAN: - /* - * Place the interface into promiscuous mode. - */ - BRIDGE_UNLOCK(sc); - error = ifpromisc(ifs, 1); - BRIDGE_LOCK(sc); - break; + case IFT_ETHER: + case IFT_L2VLAN: + error = ifpromisc(ifs, 1); + break; } + BRIDGE_LOCK(sc); if (error) bridge_delete_member(sc, bif, 0); out: @@ -3468,3 +3474,38 @@ out: m_freem(m); return (error); } + +static void +bridge_linkstate(struct ifnet *ifp) +{ + struct bridge_softc *sc = ifp->if_bridge; + struct bridge_iflist *bif, *bif2; + int new_link, hasls; + + BRIDGE_LOCK(sc); + bif = bridge_lookup_member_if(sc, ifp); + if (bif == NULL) { + BRIDGE_UNLOCK(sc); + return; + } + new_link = LINK_STATE_DOWN; + hasls = 0; + /* Our link is considered up if at least one of our ports is active */ + LIST_FOREACH(bif2, &sc->sc_iflist, bif_next) { + if (bif2->bif_ifp->if_capabilities & IFCAP_LINKSTATE) + hasls++; + if (bif2->bif_ifp->if_link_state == LINK_STATE_UP) { + new_link = LINK_STATE_UP; + break; + } + } + if (!LIST_EMPTY(&sc->sc_iflist) && !hasls) { + /* If no interfaces support link-state then we default to up */ + new_link = LINK_STATE_UP; + } + if_link_state_change(sc->sc_ifp, new_link); + BRIDGE_UNLOCK(sc); + + bstp_linkstate(&bif->bif_stp); +} + From owner-svn-src-all@FreeBSD.ORG Sat May 26 07:43:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B275F1065670; Sat, 26 May 2012 07:43:17 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5568FC1F; Sat, 26 May 2012 07:43: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 q4Q7hHsA060112; Sat, 26 May 2012 07:43:17 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7hHqn060109; Sat, 26 May 2012 07:43:17 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260743.q4Q7hHqn060109@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:43:17 +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: r236052 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:43:17 -0000 Author: thompsa Date: Sat May 26 07:43:17 2012 New Revision: 236052 URL: http://svn.freebsd.org/changeset/base/236052 Log: MFC r234488 Move the interface media check to a taskqueue, some interfaces (usb) sleep during SIOCGIFMEDIA and we were holding locks. Modified: stable/9/sys/net/bridgestp.c stable/9/sys/net/bridgestp.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/net/bridgestp.c ============================================================================== --- stable/9/sys/net/bridgestp.c Sat May 26 07:42:32 2012 (r236051) +++ stable/9/sys/net/bridgestp.c Sat May 26 07:43:17 2012 (r236052) @@ -127,7 +127,7 @@ static int bstp_rerooted(struct bstp_sta static uint32_t bstp_calc_path_cost(struct bstp_port *); static void bstp_notify_state(void *, int); static void bstp_notify_rtage(void *, int); -static void bstp_ifupdstatus(struct bstp_state *, struct bstp_port *); +static void bstp_ifupdstatus(void *, int); static void bstp_enable_port(struct bstp_state *, struct bstp_port *); static void bstp_disable_port(struct bstp_state *, struct bstp_port *); static void bstp_tick(void *); @@ -1677,7 +1677,7 @@ bstp_set_autoptp(struct bstp_port *bp, i if (set) { bp->bp_flags |= BSTP_PORT_AUTOPTP; if (bp->bp_role != BSTP_ROLE_DISABLED) - bstp_ifupdstatus(bs, bp); + taskqueue_enqueue(taskqueue_swi, &bp->bp_mediatask); } else bp->bp_flags &= ~BSTP_PORT_AUTOPTP; BSTP_UNLOCK(bs); @@ -1771,69 +1771,89 @@ bstp_linkstate(struct bstp_port *bp) { struct bstp_state *bs = bp->bp_bs; + if (!bp->bp_active) + return; + + bstp_ifupdstatus(bp, 0); BSTP_LOCK(bs); - if (bp->bp_active) { - bstp_ifupdstatus(bs, bp); - bstp_update_state(bs, bp); - } + bstp_update_state(bs, bp); BSTP_UNLOCK(bs); } static void -bstp_ifupdstatus(struct bstp_state *bs, struct bstp_port *bp) +bstp_ifupdstatus(void *arg, int pending) { + struct bstp_port *bp = (struct bstp_port *)arg; + struct bstp_state *bs = bp->bp_bs; struct ifnet *ifp = bp->bp_ifp; struct ifmediareq ifmr; - int error = 0; + int error, changed; - BSTP_LOCK_ASSERT(bs); + if (!bp->bp_active) + return; bzero((char *)&ifmr, sizeof(ifmr)); error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + BSTP_LOCK(bs); + changed = 0; if ((error == 0) && (ifp->if_flags & IFF_UP)) { if (ifmr.ifm_status & IFM_ACTIVE) { /* A full-duplex link is assumed to be point to point */ if (bp->bp_flags & BSTP_PORT_AUTOPTP) { - bp->bp_ptp_link = - ifmr.ifm_active & IFM_FDX ? 1 : 0; + int fdx; + + fdx = ifmr.ifm_active & IFM_FDX ? 1 : 0; + if (bp->bp_ptp_link ^ fdx) { + bp->bp_ptp_link = fdx; + changed = 1; + } } /* Calc the cost if the link was down previously */ if (bp->bp_flags & BSTP_PORT_PNDCOST) { - bp->bp_path_cost = bstp_calc_path_cost(bp); + uint32_t cost; + + cost = bstp_calc_path_cost(bp); + if (bp->bp_path_cost != cost) { + bp->bp_path_cost = cost; + changed = 1; + } bp->bp_flags &= ~BSTP_PORT_PNDCOST; } - if (bp->bp_role == BSTP_ROLE_DISABLED) + if (bp->bp_role == BSTP_ROLE_DISABLED) { bstp_enable_port(bs, bp); + changed = 1; + } } else { if (bp->bp_role != BSTP_ROLE_DISABLED) { bstp_disable_port(bs, bp); + changed = 1; if ((bp->bp_flags & BSTP_PORT_ADMEDGE) && bp->bp_protover == BSTP_PROTO_RSTP) bp->bp_operedge = 1; } } - return; - } - - if (bp->bp_infois != BSTP_INFO_DISABLED) + } else if (bp->bp_infois != BSTP_INFO_DISABLED) { bstp_disable_port(bs, bp); + changed = 1; + } + if (changed) + bstp_assign_roles(bs); + BSTP_UNLOCK(bs); } static void bstp_enable_port(struct bstp_state *bs, struct bstp_port *bp) { bp->bp_infois = BSTP_INFO_AGED; - bstp_assign_roles(bs); } static void bstp_disable_port(struct bstp_state *bs, struct bstp_port *bp) { bp->bp_infois = BSTP_INFO_DISABLED; - bstp_assign_roles(bs); } static void @@ -1853,7 +1873,7 @@ bstp_tick(void *arg) if (bstp_timer_dectest(&bs->bs_link_timer)) { LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { if (!(bp->bp_ifp->if_capabilities & IFCAP_LINKSTATE)) - bstp_ifupdstatus(bs, bp); + taskqueue_enqueue(taskqueue_swi, &bp->bp_mediatask); } bstp_timer_start(&bs->bs_link_timer, BSTP_LINK_TIMER); } @@ -2063,7 +2083,7 @@ bstp_reinit(struct bstp_state *bs) LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { bp->bp_port_id = (bp->bp_priority << 8) | (bp->bp_ifp->if_index & 0xfff); - bstp_ifupdstatus(bs, bp); + taskqueue_enqueue(taskqueue_swi, &bp->bp_mediatask); } bstp_assign_roles(bs); @@ -2184,6 +2204,7 @@ bstp_create(struct bstp_state *bs, struc bp->bp_priority = BSTP_DEFAULT_PORT_PRIORITY; TASK_INIT(&bp->bp_statetask, 0, bstp_notify_state, bp); TASK_INIT(&bp->bp_rtagetask, 0, bstp_notify_rtage, bp); + TASK_INIT(&bp->bp_mediatask, 0, bstp_ifupdstatus, bp); /* Init state */ bp->bp_infois = BSTP_INFO_DISABLED; @@ -2247,4 +2268,5 @@ bstp_destroy(struct bstp_port *bp) KASSERT(bp->bp_active == 0, ("port is still attached")); taskqueue_drain(taskqueue_swi, &bp->bp_statetask); taskqueue_drain(taskqueue_swi, &bp->bp_rtagetask); + taskqueue_drain(taskqueue_swi, &bp->bp_mediatask); } Modified: stable/9/sys/net/bridgestp.h ============================================================================== --- stable/9/sys/net/bridgestp.h Sat May 26 07:42:32 2012 (r236051) +++ stable/9/sys/net/bridgestp.h Sat May 26 07:43:17 2012 (r236052) @@ -326,6 +326,7 @@ struct bstp_port { uint8_t bp_txcount; struct task bp_statetask; struct task bp_rtagetask; + struct task bp_mediatask; }; /* From owner-svn-src-all@FreeBSD.ORG Sat May 26 07:44:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB83B1065678; Sat, 26 May 2012 07:44:00 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 998E08FC12; Sat, 26 May 2012 07:44: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 q4Q7i099060176; Sat, 26 May 2012 07:44:00 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7i0FT060174; Sat, 26 May 2012 07:44:00 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260744.q4Q7i0FT060174@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:44: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: r236053 - stable/9/sys/dev/tsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:44:01 -0000 Author: thompsa Date: Sat May 26 07:44:00 2012 New Revision: 236053 URL: http://svn.freebsd.org/changeset/base/236053 Log: MFC r235144 The DEVICE_POLLING dereference of sc->tsec_ifp needs to be checked for null first or this will panic. Condense three blocks that check sc->tsec_ifp into one while I am here. Modified: stable/9/sys/dev/tsec/if_tsec.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/tsec/if_tsec.c ============================================================================== --- stable/9/sys/dev/tsec/if_tsec.c Sat May 26 07:43:17 2012 (r236052) +++ stable/9/sys/dev/tsec/if_tsec.c Sat May 26 07:44:00 2012 (r236053) @@ -290,17 +290,17 @@ int tsec_detach(struct tsec_softc *sc) { + if (sc->tsec_ifp != NULL) { #ifdef DEVICE_POLLING - if (sc->tsec_ifp->if_capenable & IFCAP_POLLING) - ether_poll_deregister(sc->tsec_ifp); + if (sc->tsec_ifp->if_capenable & IFCAP_POLLING) + ether_poll_deregister(sc->tsec_ifp); #endif - /* Stop TSEC controller and free TX queue */ - if (sc->sc_rres && sc->tsec_ifp) - tsec_shutdown(sc->dev); + /* Stop TSEC controller and free TX queue */ + if (sc->sc_rres) + tsec_shutdown(sc->dev); - /* Detach network interface */ - if (sc->tsec_ifp) { + /* Detach network interface */ ether_ifdetach(sc->tsec_ifp); if_free(sc->tsec_ifp); sc->tsec_ifp = NULL; From owner-svn-src-all@FreeBSD.ORG Sat May 26 07:44:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83A861065675; Sat, 26 May 2012 07:44:36 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24D768FC1D; Sat, 26 May 2012 07:44: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 q4Q7iZXh060247; Sat, 26 May 2012 07:44:35 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7iZF4060245; Sat, 26 May 2012 07:44:35 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260744.q4Q7iZF4060245@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:44:35 +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: r236054 - stable/9/sys/dev/tsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:44:36 -0000 Author: thompsa Date: Sat May 26 07:44:35 2012 New Revision: 236054 URL: http://svn.freebsd.org/changeset/base/236054 Log: MFC r235147 Do not reinitialise the interface if it is already running, this prevents the bootp+nfs code from working as it calls init on each dhcp send and rx fails to start in time. Modified: stable/9/sys/dev/tsec/if_tsec.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/tsec/if_tsec.c ============================================================================== --- stable/9/sys/dev/tsec/if_tsec.c Sat May 26 07:44:00 2012 (r236053) +++ stable/9/sys/dev/tsec/if_tsec.c Sat May 26 07:44:35 2012 (r236054) @@ -359,6 +359,9 @@ tsec_init_locked(struct tsec_softc *sc) struct ifnet *ifp = sc->tsec_ifp; uint32_t timeout, val, i; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + return; + TSEC_GLOBAL_LOCK_ASSERT(sc); tsec_stop(sc); From owner-svn-src-all@FreeBSD.ORG Sat May 26 07:58:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A83E21065673; Sat, 26 May 2012 07:58:13 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88B1B8FC17; Sat, 26 May 2012 07:58: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 q4Q7wDRk060828; Sat, 26 May 2012 07:58:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7wDP8060824; Sat, 26 May 2012 07:58:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260758.q4Q7wDP8060824@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:58:13 +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: r236055 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:58:13 -0000 Author: thompsa Date: Sat May 26 07:58:12 2012 New Revision: 236055 URL: http://svn.freebsd.org/changeset/base/236055 Log: MFC r232014,r232030,r232070 - bstp_input() always consumes the packet so remove the mbuf handling dance around it. - Now that network interfaces advertise if they support linkstate notifications we do not need to perform a media ioctl every 15 seconds. - Indicate this function decrements the timer as well as testing for expiry. Modified: stable/8/sys/net/bridgestp.c stable/8/sys/net/bridgestp.h 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) Modified: stable/8/sys/net/bridgestp.c ============================================================================== --- stable/8/sys/net/bridgestp.c Sat May 26 07:44:35 2012 (r236054) +++ stable/8/sys/net/bridgestp.c Sat May 26 07:58:12 2012 (r236055) @@ -134,7 +134,7 @@ static void bstp_tick(void *); static void bstp_timer_start(struct bstp_timer *, uint16_t); static void bstp_timer_stop(struct bstp_timer *); static void bstp_timer_latch(struct bstp_timer *); -static int bstp_timer_expired(struct bstp_timer *); +static int bstp_timer_dectest(struct bstp_timer *); static void bstp_hello_timer_expiry(struct bstp_state *, struct bstp_port *); static void bstp_message_age_expiry(struct bstp_state *, @@ -446,7 +446,7 @@ bstp_pdu_flags(struct bstp_port *bp) return (flags); } -struct mbuf * +void bstp_input(struct bstp_port *bp, struct ifnet *ifp, struct mbuf *m) { struct bstp_state *bs = bp->bp_bs; @@ -456,7 +456,7 @@ bstp_input(struct bstp_port *bp, struct if (bp->bp_active == 0) { m_freem(m); - return (NULL); + return; } BSTP_LOCK(bs); @@ -521,7 +521,6 @@ out: BSTP_UNLOCK(bs); if (m) m_freem(m); - return (NULL); } static void @@ -1862,30 +1861,32 @@ bstp_tick(void *arg) CURVNET_SET(bs->bs_vnet); - /* slow timer to catch missed link events */ - if (bstp_timer_expired(&bs->bs_link_timer)) { - LIST_FOREACH(bp, &bs->bs_bplist, bp_next) - bstp_ifupdstatus(bs, bp); + /* poll link events on interfaces that do not support linkstate */ + if (bstp_timer_dectest(&bs->bs_link_timer)) { + LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { + if (!(bp->bp_ifp->if_capabilities & IFCAP_LINKSTATE)) + bstp_ifupdstatus(bs, bp); + } bstp_timer_start(&bs->bs_link_timer, BSTP_LINK_TIMER); } LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { /* no events need to happen for these */ - bstp_timer_expired(&bp->bp_tc_timer); - bstp_timer_expired(&bp->bp_recent_root_timer); - bstp_timer_expired(&bp->bp_forward_delay_timer); - bstp_timer_expired(&bp->bp_recent_backup_timer); + bstp_timer_dectest(&bp->bp_tc_timer); + bstp_timer_dectest(&bp->bp_recent_root_timer); + bstp_timer_dectest(&bp->bp_forward_delay_timer); + bstp_timer_dectest(&bp->bp_recent_backup_timer); - if (bstp_timer_expired(&bp->bp_hello_timer)) + if (bstp_timer_dectest(&bp->bp_hello_timer)) bstp_hello_timer_expiry(bs, bp); - if (bstp_timer_expired(&bp->bp_message_age_timer)) + if (bstp_timer_dectest(&bp->bp_message_age_timer)) bstp_message_age_expiry(bs, bp); - if (bstp_timer_expired(&bp->bp_migrate_delay_timer)) + if (bstp_timer_dectest(&bp->bp_migrate_delay_timer)) bstp_migrate_delay_expiry(bs, bp); - if (bstp_timer_expired(&bp->bp_edge_delay_timer)) + if (bstp_timer_dectest(&bp->bp_edge_delay_timer)) bstp_edge_delay_expiry(bs, bp); /* update the various state machines for the port */ @@ -1924,7 +1925,7 @@ bstp_timer_latch(struct bstp_timer *t) } static int -bstp_timer_expired(struct bstp_timer *t) +bstp_timer_dectest(struct bstp_timer *t) { if (t->active == 0 || t->latched) return (0); Modified: stable/8/sys/net/bridgestp.h ============================================================================== --- stable/8/sys/net/bridgestp.h Sat May 26 07:44:35 2012 (r236054) +++ stable/8/sys/net/bridgestp.h Sat May 26 07:58:12 2012 (r236055) @@ -392,6 +392,6 @@ int bstp_set_edge(struct bstp_port *, in int bstp_set_autoedge(struct bstp_port *, int); int bstp_set_ptp(struct bstp_port *, int); int bstp_set_autoptp(struct bstp_port *, int); -struct mbuf *bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *); +void bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *); #endif /* _KERNEL */ Modified: stable/8/sys/net/if_bridge.c ============================================================================== --- stable/8/sys/net/if_bridge.c Sat May 26 07:44:35 2012 (r236054) +++ stable/8/sys/net/if_bridge.c Sat May 26 07:58:12 2012 (r236055) @@ -2208,11 +2208,9 @@ bridge_input(struct ifnet *ifp, struct m /* Tap off 802.1D packets; they do not get forwarded. */ if (memcmp(eh->ether_dhost, bstp_etheraddr, ETHER_ADDR_LEN) == 0) { - m = bstp_input(&bif->bif_stp, ifp, m); - if (m == NULL) { - BRIDGE_UNLOCK(sc); - return (NULL); - } + bstp_input(&bif->bif_stp, ifp, m); /* consumes mbuf */ + BRIDGE_UNLOCK(sc); + return (NULL); } if ((bif->bif_flags & IFBIF_STP) && From owner-svn-src-all@FreeBSD.ORG Sat May 26 07:58:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EAC361065673; Sat, 26 May 2012 07:58:58 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5BAB8FC17; Sat, 26 May 2012 07:58: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 q4Q7wwiX060892; Sat, 26 May 2012 07:58:58 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7wwUo060890; Sat, 26 May 2012 07:58:58 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260758.q4Q7wwUo060890@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:58: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: r236056 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:58:59 -0000 Author: thompsa Date: Sat May 26 07:58:58 2012 New Revision: 236056 URL: http://svn.freebsd.org/changeset/base/236056 Log: MFC r232118 Only look for a usable MAC address for the bridge ID from ports within our bridge, this allows us to have more than one independent bridge in the same STP domain. PR: kern/164369 Submitted by: Nikos Vassiliadis (earlier version) Modified: stable/8/sys/net/bridgestp.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) Modified: stable/8/sys/net/bridgestp.c ============================================================================== --- stable/8/sys/net/bridgestp.c Sat May 26 07:58:12 2012 (r236055) +++ stable/8/sys/net/bridgestp.c Sat May 26 07:58:58 2012 (r236056) @@ -2013,24 +2013,33 @@ bstp_reinit(struct bstp_state *bs) struct bstp_port *bp; struct ifnet *ifp, *mif; u_char *e_addr; + void *bridgeptr; static const u_char llzero[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ BSTP_LOCK_ASSERT(bs); + if (LIST_EMPTY(&bs->bs_bplist)) + goto disablestp; + mif = NULL; + bridgeptr = LIST_FIRST(&bs->bs_bplist)->bp_ifp->if_bridge; + KASSERT(bridgeptr != NULL, ("Invalid bridge pointer")); /* * Search through the Ethernet adapters and find the one with the - * lowest value. The adapter which we take the MAC address from does - * not need to be part of the bridge, it just needs to be a unique - * value. + * lowest value. Make sure the adapter which we take the MAC address + * from is part of this bridge, so we can have more than one independent + * bridges in the same STP domain. */ IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (ifp->if_type != IFT_ETHER) - continue; + continue; /* Not Ethernet */ + + if (ifp->if_bridge != bridgeptr) + continue; /* Not part of our bridge */ if (bstp_addr_cmp(IF_LLADDR(ifp), llzero) == 0) - continue; + continue; /* No mac address set */ if (mif == NULL) { mif = ifp; @@ -2042,21 +2051,8 @@ bstp_reinit(struct bstp_state *bs) } } IFNET_RUNLOCK_NOSLEEP(); - - if (LIST_EMPTY(&bs->bs_bplist) || mif == NULL) { - /* Set the bridge and root id (lower bits) to zero */ - bs->bs_bridge_pv.pv_dbridge_id = - ((uint64_t)bs->bs_bridge_priority) << 48; - bs->bs_bridge_pv.pv_root_id = bs->bs_bridge_pv.pv_dbridge_id; - bs->bs_root_pv = bs->bs_bridge_pv; - /* Disable any remaining ports, they will have no MAC address */ - LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { - bp->bp_infois = BSTP_INFO_DISABLED; - bstp_set_port_role(bp, BSTP_ROLE_DISABLED); - } - callout_stop(&bs->bs_bstpcallout); - return; - } + if (mif == NULL) + goto disablestp; e_addr = IF_LLADDR(mif); bs->bs_bridge_pv.pv_dbridge_id = @@ -2084,6 +2080,20 @@ bstp_reinit(struct bstp_state *bs) bstp_assign_roles(bs); bstp_timer_start(&bs->bs_link_timer, BSTP_LINK_TIMER); + return; + +disablestp: + /* Set the bridge and root id (lower bits) to zero */ + bs->bs_bridge_pv.pv_dbridge_id = + ((uint64_t)bs->bs_bridge_priority) << 48; + bs->bs_bridge_pv.pv_root_id = bs->bs_bridge_pv.pv_dbridge_id; + bs->bs_root_pv = bs->bs_bridge_pv; + /* Disable any remaining ports, they will have no MAC address */ + LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { + bp->bp_infois = BSTP_INFO_DISABLED; + bstp_set_port_role(bp, BSTP_ROLE_DISABLED); + } + callout_stop(&bs->bs_bstpcallout); } static int From owner-svn-src-all@FreeBSD.ORG Sat May 26 07:59:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2197106566B; Sat, 26 May 2012 07:59:56 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B19B8FC12; Sat, 26 May 2012 07:59:56 +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 q4Q7xuHF060971; Sat, 26 May 2012 07:59:56 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q7xupG060965; Sat, 26 May 2012 07:59:56 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260759.q4Q7xupG060965@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 07:59:56 +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: r236057 - in stable/8: sbin/ifconfig sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 07:59:56 -0000 Author: thompsa Date: Sat May 26 07:59:56 2012 New Revision: 236057 URL: http://svn.freebsd.org/changeset/base/236057 Log: MFC r232629,r232640 Add the ability to set which packet layers are used for the load balance hash calculation. Modified: stable/8/sbin/ifconfig/ifconfig.8 stable/8/sbin/ifconfig/iflagg.c stable/8/sys/net/ieee8023ad_lacp.c stable/8/sys/net/if_lagg.c stable/8/sys/net/if_lagg.h Directory Properties: stable/8/sbin/ifconfig/ (props changed) 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) Modified: stable/8/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.8 Sat May 26 07:58:58 2012 (r236056) +++ stable/8/sbin/ifconfig/ifconfig.8 Sat May 26 07:59:56 2012 (r236057) @@ -2234,6 +2234,21 @@ Set the aggregation protocol. The default is failover. The available options are failover, fec, lacp, loadbalance, roundrobin and none. +.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc +Set the packet layers to hash for aggregation protocols which load balance. +The default is +.Dq l2,l3,l4 . +The options can be combined using commas. +.Pp +.Bl -tag -width ".Cm l2" -compact +.It Cm l2 +src/dst mac address and optional vlan number. +.It Cm l3 +src/dst address for IPv4 or IPv6. +.It Cm l4 +src/dst port for TCP/UCP/SCTP. +.El +.Pp .El .Pp The following parameters are specific to IP tunnel interfaces, Modified: stable/8/sbin/ifconfig/iflagg.c ============================================================================== --- stable/8/sbin/ifconfig/iflagg.c Sat May 26 07:58:58 2012 (r236056) +++ stable/8/sbin/ifconfig/iflagg.c Sat May 26 07:59:56 2012 (r236057) @@ -81,6 +81,36 @@ setlaggproto(const char *val, int d, int err(1, "SIOCSLAGG"); } +static void +setlagghash(const char *val, int d, int s, const struct afswtch *afp) +{ + struct lagg_reqflags rf; + char *str, *tmp, *tok; + + + rf.rf_flags = 0; + str = tmp = strdup(val); + while ((tok = strsep(&tmp, ",")) != NULL) { + if (strcmp(tok, "l2") == 0) + rf.rf_flags |= LAGG_F_HASHL2; + else if (strcmp(tok, "l3") == 0) + rf.rf_flags |= LAGG_F_HASHL3; + else if (strcmp(tok, "l4") == 0) + rf.rf_flags |= LAGG_F_HASHL4; + else { + free(str); + errx(1, "Invalid lagghash option: %s", tok); + } + } + free(str); + if (rf.rf_flags == 0) + errx(1, "No lagghash options supplied"); + + strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); + if (ioctl(s, SIOCSLAGGHASH, &rf)) + err(1, "SIOCSLAGGHASH"); +} + static char * lacp_format_mac(const uint8_t *mac, char *buf, size_t buflen) { @@ -115,6 +145,7 @@ lagg_status(int s) struct lagg_protos lpr[] = LAGG_PROTOS; struct lagg_reqport rp, rpbuf[LAGG_MAX_PORTS]; struct lagg_reqall ra; + struct lagg_reqflags rf; struct lacp_opreq *lp; const char *proto = ""; int i, isport = 0; @@ -132,6 +163,10 @@ lagg_status(int s) ra.ra_size = sizeof(rpbuf); ra.ra_port = rpbuf; + strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); + if (ioctl(s, SIOCGLAGGFLAGS, &rf) != 0) + rf.rf_flags = 0; + if (ioctl(s, SIOCGLAGG, &ra) == 0) { lp = (struct lacp_opreq *)&ra.ra_lacpreq; @@ -143,6 +178,23 @@ lagg_status(int s) } printf("\tlaggproto %s", proto); + if (rf.rf_flags & LAGG_F_HASHMASK) { + const char *sep = ""; + + printf(" lagghash "); + if (rf.rf_flags & LAGG_F_HASHL2) { + printf("%sl2", sep); + sep = ","; + } + if (rf.rf_flags & LAGG_F_HASHL3) { + printf("%sl3", sep); + sep = ","; + } + if (rf.rf_flags & LAGG_F_HASHL4) { + printf("%sl4", sep); + sep = ","; + } + } if (isport) printf(" laggdev %s", rp.rp_ifname); putchar('\n'); @@ -174,6 +226,7 @@ static struct cmd lagg_cmds[] = { DEF_CMD_ARG("laggport", setlaggport), DEF_CMD_ARG("-laggport", unsetlaggport), DEF_CMD_ARG("laggproto", setlaggproto), + DEF_CMD_ARG("lagghash", setlagghash), }; static struct afswtch af_lagg = { .af_name = "af_lagg", Modified: stable/8/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/8/sys/net/ieee8023ad_lacp.c Sat May 26 07:58:58 2012 (r236056) +++ stable/8/sys/net/ieee8023ad_lacp.c Sat May 26 07:59:56 2012 (r236057) @@ -815,7 +815,7 @@ lacp_select_tx_port(struct lagg_softc *s if (sc->use_flowid && (m->m_flags & M_FLOWID)) hash = m->m_pkthdr.flowid; else - hash = lagg_hashmbuf(m, lsc->lsc_hashkey); + hash = lagg_hashmbuf(sc, m, lsc->lsc_hashkey); hash %= pm->pm_count; lp = pm->pm_map[hash]; Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Sat May 26 07:58:58 2012 (r236056) +++ stable/8/sys/net/if_lagg.c Sat May 26 07:59:56 2012 (r236057) @@ -280,6 +280,8 @@ lagg_clone_create(struct if_clone *ifc, SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flowid, "Use flow id for load sharing"); + /* Hash all layers by default */ + sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; sc->sc_proto = LAGG_PROTO_NONE; for (i = 0; lagg_protos[i].ti_proto != LAGG_PROTO_NONE; i++) { @@ -887,6 +889,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; struct lagg_reqall *ra = (struct lagg_reqall *)data; struct lagg_reqport *rp = (struct lagg_reqport *)data, rpbuf; + struct lagg_reqflags *rf = (struct lagg_reqflags *)data; struct ifreq *ifr = (struct ifreq *)data; struct lagg_port *lp; struct ifnet *tpif; @@ -976,6 +979,22 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd } error = EPROTONOSUPPORT; break; + case SIOCGLAGGFLAGS: + rf->rf_flags = sc->sc_flags; + break; + case SIOCSLAGGHASH: + error = priv_check(td, PRIV_NET_LAGG); + if (error) + break; + if ((rf->rf_flags & LAGG_F_HASHMASK) == 0) { + error = EINVAL; + break; + } + LAGG_WLOCK(sc); + sc->sc_flags &= ~LAGG_F_HASHMASK; + sc->sc_flags |= rf->rf_flags & LAGG_F_HASHMASK; + LAGG_WUNLOCK(sc); + break; case SIOCGLAGGPORT: if (rp->rp_portname[0] == '\0' || (tpif = ifunit(rp->rp_portname)) == NULL) { @@ -1405,42 +1424,55 @@ lagg_gethdr(struct mbuf *m, u_int off, u } uint32_t -lagg_hashmbuf(struct mbuf *m, uint32_t key) +lagg_hashmbuf(struct lagg_softc *sc, struct mbuf *m, uint32_t key) { uint16_t etype; - uint32_t p = 0; + uint32_t p = key; int off; struct ether_header *eh; - struct ether_vlan_header vlanbuf; const struct ether_vlan_header *vlan; #ifdef INET const struct ip *ip; - struct ip ipbuf; + const uint32_t *ports; + int iphlen; #endif #ifdef INET6 const struct ip6_hdr *ip6; - struct ip6_hdr ip6buf; uint32_t flow; #endif + union { +#ifdef INET + struct ip ip; +#endif +#ifdef INET6 + struct ip6_hdr ip6; +#endif + struct ether_vlan_header vlan; + uint32_t port; + } buf; + off = sizeof(*eh); if (m->m_len < off) goto out; eh = mtod(m, struct ether_header *); etype = ntohs(eh->ether_type); - p = hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, key); - p = hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + if (sc->sc_flags & LAGG_F_HASHL2) { + p = hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); + p = hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + } /* Special handling for encapsulating VLAN frames */ - if (m->m_flags & M_VLANTAG) { + if ((m->m_flags & M_VLANTAG) && (sc->sc_flags & LAGG_F_HASHL2)) { p = hash32_buf(&m->m_pkthdr.ether_vtag, sizeof(m->m_pkthdr.ether_vtag), p); } else if (etype == ETHERTYPE_VLAN) { - vlan = lagg_gethdr(m, off, sizeof(*vlan), &vlanbuf); + vlan = lagg_gethdr(m, off, sizeof(*vlan), &buf); if (vlan == NULL) goto out; - p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); + if (sc->sc_flags & LAGG_F_HASHL2) + p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); etype = ntohs(vlan->evl_proto); off += sizeof(*vlan) - sizeof(*eh); } @@ -1448,17 +1480,37 @@ lagg_hashmbuf(struct mbuf *m, uint32_t k switch (etype) { #ifdef INET case ETHERTYPE_IP: - ip = lagg_gethdr(m, off, sizeof(*ip), &ipbuf); + ip = lagg_gethdr(m, off, sizeof(*ip), &buf); if (ip == NULL) goto out; - p = hash32_buf(&ip->ip_src, sizeof(struct in_addr), p); - p = hash32_buf(&ip->ip_dst, sizeof(struct in_addr), p); + if (sc->sc_flags & LAGG_F_HASHL3) { + p = hash32_buf(&ip->ip_src, sizeof(struct in_addr), p); + p = hash32_buf(&ip->ip_dst, sizeof(struct in_addr), p); + } + if (!(sc->sc_flags & LAGG_F_HASHL4)) + break; + switch (ip->ip_p) { + case IPPROTO_TCP: + case IPPROTO_UDP: + case IPPROTO_SCTP: + iphlen = ip->ip_hl << 2; + if (iphlen < sizeof(*ip)) + break; + off += iphlen; + ports = lagg_gethdr(m, off, sizeof(*ports), &buf); + if (ports == NULL) + break; + p = hash32_buf(ports, sizeof(*ports), p); + break; + } break; #endif #ifdef INET6 case ETHERTYPE_IPV6: - ip6 = lagg_gethdr(m, off, sizeof(*ip6), &ip6buf); + if (!(sc->sc_flags & LAGG_F_HASHL3)) + break; + ip6 = lagg_gethdr(m, off, sizeof(*ip6), &buf); if (ip6 == NULL) goto out; @@ -1688,7 +1740,7 @@ lagg_lb_start(struct lagg_softc *sc, str if (sc->use_flowid && (m->m_flags & M_FLOWID)) p = m->m_pkthdr.flowid; else - p = lagg_hashmbuf(m, lb->lb_key); + p = lagg_hashmbuf(sc, m, lb->lb_key); p %= sc->sc_count; lp = lb->lb_ports[p]; Modified: stable/8/sys/net/if_lagg.h ============================================================================== --- stable/8/sys/net/if_lagg.h Sat May 26 07:58:58 2012 (r236056) +++ stable/8/sys/net/if_lagg.h Sat May 26 07:59:56 2012 (r236057) @@ -31,6 +31,12 @@ #define LAGG_MAX_NAMESIZE 32 /* name of a protocol */ #define LAGG_MAX_STACKING 4 /* maximum number of stacked laggs */ +/* Lagg flags */ +#define LAGG_F_HASHL2 0x00000001 /* hash layer 2 */ +#define LAGG_F_HASHL3 0x00000002 /* hash layer 3 */ +#define LAGG_F_HASHL4 0x00000004 /* hash layer 4 */ +#define LAGG_F_HASHMASK 0x00000007 + /* Port flags */ #define LAGG_PORT_SLAVE 0x00000000 /* normal enslaved port */ #define LAGG_PORT_MASTER 0x00000001 /* primary port */ @@ -122,6 +128,14 @@ struct lagg_reqall { #define SIOCGLAGG _IOWR('i', 143, struct lagg_reqall) #define SIOCSLAGG _IOW('i', 144, struct lagg_reqall) +struct lagg_reqflags { + char rf_ifname[IFNAMSIZ]; /* name of the lagg */ + uint32_t rf_flags; /* lagg protocol */ +}; + +#define SIOCGLAGGFLAGS _IOWR('i', 145, struct lagg_reqflags) +#define SIOCSLAGGHASH _IOW('i', 146, struct lagg_reqflags) + #ifdef _KERNEL /* * Internal kernel part @@ -179,6 +193,7 @@ struct lagg_softc { struct ifmedia sc_media; /* media config */ caddr_t sc_psc; /* protocol data */ uint32_t sc_seq; /* sequence counter */ + uint32_t sc_flags; SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */ SLIST_ENTRY(lagg_softc) sc_entries; @@ -244,7 +259,7 @@ extern struct mbuf *(*lagg_input_p)(stru extern void (*lagg_linkstate_p)(struct ifnet *, int ); int lagg_enqueue(struct ifnet *, struct mbuf *); -uint32_t lagg_hashmbuf(struct mbuf *, uint32_t); +uint32_t lagg_hashmbuf(struct lagg_softc *, struct mbuf *, uint32_t); #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:00:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9049106571F; Sat, 26 May 2012 08:00:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECAA08FC1D; Sat, 26 May 2012 08:00: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 q4Q80Yia061053; Sat, 26 May 2012 08:00:34 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q80YNO061052; Sat, 26 May 2012 08:00:34 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260800.q4Q80YNO061052@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:00: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: r236058 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:00:40 -0000 Author: thompsa Date: Sat May 26 08:00:34 2012 New Revision: 236058 URL: http://svn.freebsd.org/changeset/base/236058 Log: MFC r234163 Set the proto to LAGG_PROTO_NONE before calling the detach routine so packets are discarded, this is an issue because lacp drops the lock which may allow network threads to access freed memory. Expand the lock coverage so the detach/attach happen atomically. Submitted by: Andrew Boyer (earlier version) Modified: stable/8/sys/net/if_lagg.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) Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Sat May 26 07:59:56 2012 (r236057) +++ stable/8/sys/net/if_lagg.c Sat May 26 08:00:34 2012 (r236058) @@ -942,11 +942,11 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd error = EPROTONOSUPPORT; break; } + LAGG_WLOCK(sc); if (sc->sc_proto != LAGG_PROTO_NONE) { - LAGG_WLOCK(sc); - error = sc->sc_detach(sc); - /* Reset protocol and pointers */ + /* Reset protocol first in case detach unlocks */ sc->sc_proto = LAGG_PROTO_NONE; + error = sc->sc_detach(sc); sc->sc_detach = NULL; sc->sc_start = NULL; sc->sc_input = NULL; @@ -958,10 +958,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd sc->sc_lladdr = NULL; sc->sc_req = NULL; sc->sc_portreq = NULL; - LAGG_WUNLOCK(sc); + } else if (sc->sc_input != NULL) { + /* Still detaching */ + error = EBUSY; } - if (error != 0) + if (error != 0) { + LAGG_WUNLOCK(sc); break; + } for (int i = 0; i < (sizeof(lagg_protos) / sizeof(lagg_protos[0])); i++) { if (lagg_protos[i].ti_proto == ra->ra_proto) { @@ -969,7 +973,6 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd printf("%s: using proto %u\n", sc->sc_ifname, lagg_protos[i].ti_proto); - LAGG_WLOCK(sc); sc->sc_proto = lagg_protos[i].ti_proto; if (sc->sc_proto != LAGG_PROTO_NONE) error = lagg_protos[i].ti_attach(sc); @@ -977,6 +980,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd return (error); } } + LAGG_WUNLOCK(sc); error = EPROTONOSUPPORT; break; case SIOCGLAGGFLAGS: From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:02:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00BB6106564A; Sat, 26 May 2012 08:02:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF9148FC15; Sat, 26 May 2012 08:02: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 q4Q82DNU061164; Sat, 26 May 2012 08:02:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q82DUH061159; Sat, 26 May 2012 08:02:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260802.q4Q82DUH061159@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:02:13 +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: r236059 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:02:14 -0000 Author: thompsa Date: Sat May 26 08:02:13 2012 New Revision: 236059 URL: http://svn.freebsd.org/changeset/base/236059 Log: MFC r234487 Add linkstate to bridge(4), set the link to up when at least one underlying interface is up, otherwise the link is down. This, among other things, allows carp to work on a bridge. Modified: stable/8/sys/net/bridgestp.c stable/8/sys/net/bridgestp.h stable/8/sys/net/if.c 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) Modified: stable/8/sys/net/bridgestp.c ============================================================================== --- stable/8/sys/net/bridgestp.c Sat May 26 08:00:34 2012 (r236058) +++ stable/8/sys/net/bridgestp.c Sat May 26 08:02:13 2012 (r236059) @@ -1767,28 +1767,16 @@ bstp_notify_rtage(void *arg, int pending } void -bstp_linkstate(struct ifnet *ifp, int state) +bstp_linkstate(struct bstp_port *bp) { - struct bstp_state *bs; - struct bstp_port *bp; + struct bstp_state *bs = bp->bp_bs; - /* search for the stp port */ - mtx_lock(&bstp_list_mtx); - LIST_FOREACH(bs, &bstp_list, bs_list) { - BSTP_LOCK(bs); - LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { - if (bp->bp_ifp == ifp) { - bstp_ifupdstatus(bs, bp); - bstp_update_state(bs, bp); - /* it only exists once so return */ - BSTP_UNLOCK(bs); - mtx_unlock(&bstp_list_mtx); - return; - } - } - BSTP_UNLOCK(bs); + BSTP_LOCK(bs); + if (bp->bp_active) { + bstp_ifupdstatus(bs, bp); + bstp_update_state(bs, bp); } - mtx_unlock(&bstp_list_mtx); + BSTP_UNLOCK(bs); } static void @@ -2103,10 +2091,8 @@ bstp_modevent(module_t mod, int type, vo case MOD_LOAD: mtx_init(&bstp_list_mtx, "bridgestp list", NULL, MTX_DEF); LIST_INIT(&bstp_list); - bstp_linkstate_p = bstp_linkstate; break; case MOD_UNLOAD: - bstp_linkstate_p = NULL; mtx_destroy(&bstp_list_mtx); break; default: Modified: stable/8/sys/net/bridgestp.h ============================================================================== --- stable/8/sys/net/bridgestp.h Sat May 26 08:00:34 2012 (r236058) +++ stable/8/sys/net/bridgestp.h Sat May 26 08:02:13 2012 (r236059) @@ -369,8 +369,6 @@ struct bstp_state { extern const uint8_t bstp_etheraddr[]; -extern void (*bstp_linkstate_p)(struct ifnet *ifp, int state); - void bstp_attach(struct bstp_state *, struct bstp_cb_ops *); void bstp_detach(struct bstp_state *); void bstp_init(struct bstp_state *); @@ -379,7 +377,7 @@ int bstp_create(struct bstp_state *, str int bstp_enable(struct bstp_port *); void bstp_disable(struct bstp_port *); void bstp_destroy(struct bstp_port *); -void bstp_linkstate(struct ifnet *, int); +void bstp_linkstate(struct bstp_port *); int bstp_set_htime(struct bstp_state *, int); int bstp_set_fdelay(struct bstp_state *, int); int bstp_set_maxage(struct bstp_state *, int); Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Sat May 26 08:00:34 2012 (r236058) +++ stable/8/sys/net/if.c Sat May 26 08:02:13 2012 (r236059) @@ -126,7 +126,7 @@ MALLOC_DEFINE(M_IFDESCR, "ifdescr", "ifn static struct sx ifdescr_sx; SX_SYSINIT(ifdescr_sx, &ifdescr_sx, "ifnet descr"); -void (*bstp_linkstate_p)(struct ifnet *ifp, int state); +void (*bridge_linkstate_p)(struct ifnet *ifp); void (*ng_ether_link_state_p)(struct ifnet *ifp, int state); void (*lagg_linkstate_p)(struct ifnet *ifp, int state); /* These are external hooks for CARP. */ @@ -1953,14 +1953,10 @@ do_link_state_change(void *arg, int pend (*ng_ether_link_state_p)(ifp, link_state); if (ifp->if_carp) (*carp_linkstate_p)(ifp); - if (ifp->if_bridge) { - KASSERT(bstp_linkstate_p != NULL,("if_bridge bstp not loaded!")); - (*bstp_linkstate_p)(ifp, link_state); - } - if (ifp->if_lagg) { - KASSERT(lagg_linkstate_p != NULL,("if_lagg not loaded!")); + if (ifp->if_bridge) + (*bridge_linkstate_p)(ifp); + if (ifp->if_lagg) (*lagg_linkstate_p)(ifp, link_state); - } if (IS_DEFAULT_VNET(curvnet)) devctl_notify("IFNET", ifp->if_xname, Modified: stable/8/sys/net/if_bridge.c ============================================================================== --- stable/8/sys/net/if_bridge.c Sat May 26 08:00:34 2012 (r236058) +++ stable/8/sys/net/if_bridge.c Sat May 26 08:02:13 2012 (r236059) @@ -333,6 +333,9 @@ static int bridge_ip6_checkbasic(struct #endif /* INET6 */ static int bridge_fragment(struct ifnet *, struct mbuf *, struct ether_header *, int, struct llc *); +static void bridge_linkstate(struct ifnet *ifp); + +extern void (*bridge_linkstate_p)(struct ifnet *ifp); /* The default bridge vlan is 1 (IEEE 802.1Q-2003 Table 9-2) */ #define VLANTAGOF(_m) \ @@ -489,6 +492,7 @@ bridge_modevent(module_t mod, int type, bridge_input_p = bridge_input; bridge_output_p = bridge_output; bridge_dn_p = bridge_dummynet; + bridge_linkstate_p = bridge_linkstate; bridge_detach_cookie = EVENTHANDLER_REGISTER( ifnet_departure_event, bridge_ifdetach, NULL, EVENTHANDLER_PRI_ANY); @@ -501,6 +505,7 @@ bridge_modevent(module_t mod, int type, bridge_input_p = NULL; bridge_output_p = NULL; bridge_dn_p = NULL; + bridge_linkstate_p = NULL; mtx_destroy(&bridge_list_mtx); break; default: @@ -981,6 +986,7 @@ bridge_delete_member(struct bridge_softc bridge_set_ifcap(sc, bif, bif->bif_savedcaps); } bstp_destroy(&bif->bif_stp); /* prepare to free */ + bridge_linkstate(ifs); BRIDGE_LOCK(sc); free(bif, M_DEVBUF); } @@ -1080,17 +1086,17 @@ bridge_ioctl_add(struct bridge_softc *sc /* Set interface capabilities to the intersection set of all members */ bridge_mutecaps(sc); + BRIDGE_UNLOCK(sc); + /* Update the linkstate for the bridge */ + bridge_linkstate(ifs); + /* Place the interface into promiscuous mode */ switch (ifs->if_type) { - case IFT_ETHER: - case IFT_L2VLAN: - /* - * Place the interface into promiscuous mode. - */ - BRIDGE_UNLOCK(sc); - error = ifpromisc(ifs, 1); - BRIDGE_LOCK(sc); - break; + case IFT_ETHER: + case IFT_L2VLAN: + error = ifpromisc(ifs, 1); + break; } + BRIDGE_LOCK(sc); if (error) bridge_delete_member(sc, bif, 0); out: @@ -3467,3 +3473,38 @@ out: m_freem(m); return (error); } + +static void +bridge_linkstate(struct ifnet *ifp) +{ + struct bridge_softc *sc = ifp->if_bridge; + struct bridge_iflist *bif, *bif2; + int new_link, hasls; + + BRIDGE_LOCK(sc); + bif = bridge_lookup_member_if(sc, ifp); + if (bif == NULL) { + BRIDGE_UNLOCK(sc); + return; + } + new_link = LINK_STATE_DOWN; + hasls = 0; + /* Our link is considered up if at least one of our ports is active */ + LIST_FOREACH(bif2, &sc->sc_iflist, bif_next) { + if (bif2->bif_ifp->if_capabilities & IFCAP_LINKSTATE) + hasls++; + if (bif2->bif_ifp->if_link_state == LINK_STATE_UP) { + new_link = LINK_STATE_UP; + break; + } + } + if (!LIST_EMPTY(&sc->sc_iflist) && !hasls) { + /* If no interfaces support link-state then we default to up */ + new_link = LINK_STATE_UP; + } + if_link_state_change(sc->sc_ifp, new_link); + BRIDGE_UNLOCK(sc); + + bstp_linkstate(&bif->bif_stp); +} + From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:02:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AFCA31065670; Sat, 26 May 2012 08:02:45 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9133E8FC12; Sat, 26 May 2012 08:02: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 q4Q82j4L061219; Sat, 26 May 2012 08:02:45 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q82jN4061216; Sat, 26 May 2012 08:02:45 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260802.q4Q82jN4061216@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:02:45 +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: r236060 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:02:45 -0000 Author: thompsa Date: Sat May 26 08:02:45 2012 New Revision: 236060 URL: http://svn.freebsd.org/changeset/base/236060 Log: MFC r234488 Move the interface media check to a taskqueue, some interfaces (usb) sleep during SIOCGIFMEDIA and we were holding locks. Modified: stable/8/sys/net/bridgestp.c stable/8/sys/net/bridgestp.h 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) Modified: stable/8/sys/net/bridgestp.c ============================================================================== --- stable/8/sys/net/bridgestp.c Sat May 26 08:02:13 2012 (r236059) +++ stable/8/sys/net/bridgestp.c Sat May 26 08:02:45 2012 (r236060) @@ -127,7 +127,7 @@ static int bstp_rerooted(struct bstp_sta static uint32_t bstp_calc_path_cost(struct bstp_port *); static void bstp_notify_state(void *, int); static void bstp_notify_rtage(void *, int); -static void bstp_ifupdstatus(struct bstp_state *, struct bstp_port *); +static void bstp_ifupdstatus(void *, int); static void bstp_enable_port(struct bstp_state *, struct bstp_port *); static void bstp_disable_port(struct bstp_state *, struct bstp_port *); static void bstp_tick(void *); @@ -1677,7 +1677,7 @@ bstp_set_autoptp(struct bstp_port *bp, i if (set) { bp->bp_flags |= BSTP_PORT_AUTOPTP; if (bp->bp_role != BSTP_ROLE_DISABLED) - bstp_ifupdstatus(bs, bp); + taskqueue_enqueue(taskqueue_swi, &bp->bp_mediatask); } else bp->bp_flags &= ~BSTP_PORT_AUTOPTP; BSTP_UNLOCK(bs); @@ -1771,69 +1771,89 @@ bstp_linkstate(struct bstp_port *bp) { struct bstp_state *bs = bp->bp_bs; + if (!bp->bp_active) + return; + + bstp_ifupdstatus(bp, 0); BSTP_LOCK(bs); - if (bp->bp_active) { - bstp_ifupdstatus(bs, bp); - bstp_update_state(bs, bp); - } + bstp_update_state(bs, bp); BSTP_UNLOCK(bs); } static void -bstp_ifupdstatus(struct bstp_state *bs, struct bstp_port *bp) +bstp_ifupdstatus(void *arg, int pending) { + struct bstp_port *bp = (struct bstp_port *)arg; + struct bstp_state *bs = bp->bp_bs; struct ifnet *ifp = bp->bp_ifp; struct ifmediareq ifmr; - int error = 0; + int error, changed; - BSTP_LOCK_ASSERT(bs); + if (!bp->bp_active) + return; bzero((char *)&ifmr, sizeof(ifmr)); error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + BSTP_LOCK(bs); + changed = 0; if ((error == 0) && (ifp->if_flags & IFF_UP)) { if (ifmr.ifm_status & IFM_ACTIVE) { /* A full-duplex link is assumed to be point to point */ if (bp->bp_flags & BSTP_PORT_AUTOPTP) { - bp->bp_ptp_link = - ifmr.ifm_active & IFM_FDX ? 1 : 0; + int fdx; + + fdx = ifmr.ifm_active & IFM_FDX ? 1 : 0; + if (bp->bp_ptp_link ^ fdx) { + bp->bp_ptp_link = fdx; + changed = 1; + } } /* Calc the cost if the link was down previously */ if (bp->bp_flags & BSTP_PORT_PNDCOST) { - bp->bp_path_cost = bstp_calc_path_cost(bp); + uint32_t cost; + + cost = bstp_calc_path_cost(bp); + if (bp->bp_path_cost != cost) { + bp->bp_path_cost = cost; + changed = 1; + } bp->bp_flags &= ~BSTP_PORT_PNDCOST; } - if (bp->bp_role == BSTP_ROLE_DISABLED) + if (bp->bp_role == BSTP_ROLE_DISABLED) { bstp_enable_port(bs, bp); + changed = 1; + } } else { if (bp->bp_role != BSTP_ROLE_DISABLED) { bstp_disable_port(bs, bp); + changed = 1; if ((bp->bp_flags & BSTP_PORT_ADMEDGE) && bp->bp_protover == BSTP_PROTO_RSTP) bp->bp_operedge = 1; } } - return; - } - - if (bp->bp_infois != BSTP_INFO_DISABLED) + } else if (bp->bp_infois != BSTP_INFO_DISABLED) { bstp_disable_port(bs, bp); + changed = 1; + } + if (changed) + bstp_assign_roles(bs); + BSTP_UNLOCK(bs); } static void bstp_enable_port(struct bstp_state *bs, struct bstp_port *bp) { bp->bp_infois = BSTP_INFO_AGED; - bstp_assign_roles(bs); } static void bstp_disable_port(struct bstp_state *bs, struct bstp_port *bp) { bp->bp_infois = BSTP_INFO_DISABLED; - bstp_assign_roles(bs); } static void @@ -1853,7 +1873,7 @@ bstp_tick(void *arg) if (bstp_timer_dectest(&bs->bs_link_timer)) { LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { if (!(bp->bp_ifp->if_capabilities & IFCAP_LINKSTATE)) - bstp_ifupdstatus(bs, bp); + taskqueue_enqueue(taskqueue_swi, &bp->bp_mediatask); } bstp_timer_start(&bs->bs_link_timer, BSTP_LINK_TIMER); } @@ -2063,7 +2083,7 @@ bstp_reinit(struct bstp_state *bs) LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { bp->bp_port_id = (bp->bp_priority << 8) | (bp->bp_ifp->if_index & 0xfff); - bstp_ifupdstatus(bs, bp); + taskqueue_enqueue(taskqueue_swi, &bp->bp_mediatask); } bstp_assign_roles(bs); @@ -2184,6 +2204,7 @@ bstp_create(struct bstp_state *bs, struc bp->bp_priority = BSTP_DEFAULT_PORT_PRIORITY; TASK_INIT(&bp->bp_statetask, 0, bstp_notify_state, bp); TASK_INIT(&bp->bp_rtagetask, 0, bstp_notify_rtage, bp); + TASK_INIT(&bp->bp_mediatask, 0, bstp_ifupdstatus, bp); /* Init state */ bp->bp_infois = BSTP_INFO_DISABLED; @@ -2247,4 +2268,5 @@ bstp_destroy(struct bstp_port *bp) KASSERT(bp->bp_active == 0, ("port is still attached")); taskqueue_drain(taskqueue_swi, &bp->bp_statetask); taskqueue_drain(taskqueue_swi, &bp->bp_rtagetask); + taskqueue_drain(taskqueue_swi, &bp->bp_mediatask); } Modified: stable/8/sys/net/bridgestp.h ============================================================================== --- stable/8/sys/net/bridgestp.h Sat May 26 08:02:13 2012 (r236059) +++ stable/8/sys/net/bridgestp.h Sat May 26 08:02:45 2012 (r236060) @@ -326,6 +326,7 @@ struct bstp_port { uint8_t bp_txcount; struct task bp_statetask; struct task bp_rtagetask; + struct task bp_mediatask; }; /* From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:03:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 741CF106564A; Sat, 26 May 2012 08:03: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 5F16C8FC12; Sat, 26 May 2012 08:03: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 q4Q83hHC061301; Sat, 26 May 2012 08:03:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q83h0G061298; Sat, 26 May 2012 08:03:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260803.q4Q83h0G061298@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236061 - head/sys/dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:03:43 -0000 Author: marius Date: Sat May 26 08:03:42 2012 New Revision: 236061 URL: http://svn.freebsd.org/changeset/base/236061 Log: - When creating the DMA tag for user data, don't ask for more segments than required for handling MAXPHYS and report the resulting maximum I/O size to CAM instead of implicitly limiting it to DFLTPHYS. - Move the variables of sym_action2() out of nested scope as required by style(9) and remove extraneous curly braces. - Replace a magic value for PCIR_COMMAND with the appropriate macro. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Tested with a HBA donated by wilko. MFC after: 3 days Modified: head/sys/dev/sym/sym_conf.h head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_conf.h ============================================================================== --- head/sys/dev/sym/sym_conf.h Sat May 26 08:02:45 2012 (r236060) +++ head/sys/dev/sym/sym_conf.h Sat May 26 08:03:42 2012 (r236061) @@ -83,6 +83,13 @@ #define SYM_CONF_MAX_TAG_ORDER (6) /* + * DMA boundary + * We need to ensure 16 MB boundaries not to be crossed during DMA of + * each segment, due to some chips being flawed. + */ +#define SYM_CONF_DMA_BOUNDARY (1UL << 24) + +/* * Max number of scatter/gather entries for en IO. * Each entry costs 8 bytes in the internal CCB data structure. * For now 65 should suffice given the BSD O/Ses capabilities. Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Sat May 26 08:02:45 2012 (r236060) +++ head/sys/dev/sym/sym_hipd.c Sat May 26 08:03:42 2012 (r236061) @@ -1623,6 +1623,7 @@ struct sym_hcb { u_int features; /* Chip features map */ u_char myaddr; /* SCSI id of the adapter */ u_char maxburst; /* log base 2 of dwords burst */ + u_char maxsegcnt; /* Max DMA S/G segments */ u_char maxwide; /* Maximum transfer width */ u_char minsync; /* Min sync period factor (ST) */ u_char maxsync; /* Max sync period factor (ST) */ @@ -7988,10 +7989,7 @@ sym_fast_scatter_sg_physical(hcb_p np, c /* * Scatter a SG list with physical addresses into bus addressable chunks. - * We need to ensure 16MB boundaries not to be crossed during DMA of - * each segment, due to some chips being flawed. */ -#define BOUND_MASK ((1UL<<24)-1) static int sym_scatter_sg_physical(hcb_p np, ccb_p cp, bus_dma_segment_t *psegs, int nsegs) { @@ -8007,7 +8005,7 @@ sym_scatter_sg_physical(hcb_p np, ccb_p pe = ps + psegs[t].ds_len; while (s >= 0) { - pn = (pe - 1) & ~BOUND_MASK; + pn = (pe - 1) & ~(SYM_CONF_DMA_BOUNDARY - 1); if (pn <= ps) pn = ps; k = pe - pn; @@ -8032,17 +8030,21 @@ sym_scatter_sg_physical(hcb_p np, ccb_p return t >= 0 ? -1 : 0; } -#undef BOUND_MASK /* * SIM action for non performance critical stuff. */ static void sym_action2(struct cam_sim *sim, union ccb *ccb) { + union ccb *abort_ccb; + struct ccb_hdr *ccb_h; + struct ccb_pathinq *cpi; + struct ccb_trans_settings *cts; + struct sym_trans *tip; hcb_p np; tcb_p tp; lcb_p lp; - struct ccb_hdr *ccb_h; + u_char dflags; /* * Retrieve our controller data structure. @@ -8055,9 +8057,6 @@ static void sym_action2(struct cam_sim * switch (ccb_h->func_code) { case XPT_SET_TRAN_SETTINGS: - { - struct ccb_trans_settings *cts; - cts = &ccb->cts; tp = &np->target[ccb_h->target_id]; @@ -8079,13 +8078,7 @@ static void sym_action2(struct cam_sim * sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; - } case XPT_GET_TRAN_SETTINGS: - { - struct ccb_trans_settings *cts; - struct sym_trans *tip; - u_char dflags; - cts = &ccb->cts; tp = &np->target[ccb_h->target_id]; lp = sym_lp(np, tp, ccb_h->target_lun); @@ -8129,16 +8122,12 @@ static void sym_action2(struct cam_sim * #undef cts__scsi sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; - } case XPT_CALC_GEOMETRY: - { cam_calc_geometry(&ccb->ccg, /*extended*/1); sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; - } case XPT_PATH_INQ: - { - struct ccb_pathinq *cpi = &ccb->cpi; + cpi = &ccb->cpi; cpi->version_num = 1; cpi->hba_inquiry = PI_MDP_ABLE|PI_SDTR_ABLE|PI_TAG_ABLE; if ((np->features & FE_WIDE) != 0) @@ -8173,12 +8162,11 @@ static void sym_action2(struct cam_sim * cpi->xport_specific.spi.ppr_options = SID_SPI_CLOCK_DT_ST; } + cpi->maxio = np->maxsegcnt * SYM_CONF_DMA_BOUNDARY; sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; - } case XPT_ABORT: - { - union ccb *abort_ccb = ccb->cab.abort_ccb; + abort_ccb = ccb->cab.abort_ccb; switch(abort_ccb->ccb_h.func_code) { case XPT_SCSI_IO: if (sym_abort_scsiio(np, abort_ccb, 0) == 0) { @@ -8190,14 +8178,10 @@ static void sym_action2(struct cam_sim * break; } break; - } case XPT_RESET_DEV: - { sym_reset_dev(np, ccb); break; - } case XPT_RESET_BUS: - { sym_reset_scsi_bus(np, 0); if (sym_verbose) { xpt_print_path(np->path); @@ -8206,7 +8190,6 @@ static void sym_action2(struct cam_sim * sym_init (np, 1); sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; - } case XPT_ACCEPT_TARGET_IO: case XPT_CONT_TARGET_IO: case XPT_EN_LUN: @@ -8362,7 +8345,7 @@ sym_update_dflags(hcb_p np, u_char *flag static device_method_t sym_pci_methods[] = { DEVMETHOD(device_probe, sym_pci_probe), DEVMETHOD(device_attach, sym_pci_attach), - { 0, 0 } + DEVMETHOD_END }; static driver_t sym_pci_driver = { @@ -8373,7 +8356,7 @@ static driver_t sym_pci_driver = { static devclass_t sym_devclass; -DRIVER_MODULE(sym, pci, sym_pci_driver, sym_devclass, 0, 0); +DRIVER_MODULE(sym, pci, sym_pci_driver, sym_devclass, NULL, NULL); MODULE_DEPEND(sym, cam, 1, 1, 1); MODULE_DEPEND(sym, pci, 1, 1, 1); @@ -8586,15 +8569,16 @@ sym_pci_attach(device_t dev) /* * Allocate a tag for the DMA of user data. */ - if (bus_dma_tag_create(np->bus_dmat, 1, (1<<24), - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, - NULL, NULL, - BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, - (1<<24), 0, busdma_lock_mutex, &np->mtx, - &np->data_dmat)) { + np->maxsegcnt = MIN(SYM_CONF_MAX_SG, + (MAXPHYS / SYM_CONF_DMA_BOUNDARY) + 1); + if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE, np->maxsegcnt, SYM_CONF_DMA_BOUNDARY, + BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) { device_printf(dev, "failed to create DMA tag.\n"); goto attach_failed; } + /* * Read and apply some fix-ups to the PCI COMMAND * register. We want the chip to be enabled for: @@ -8603,9 +8587,8 @@ sym_pci_attach(device_t dev) * - Write And Invalidate. */ command = pci_read_config(dev, PCIR_COMMAND, 2); - command |= PCIM_CMD_BUSMASTEREN; - command |= PCIM_CMD_PERRESPEN; - command |= /* PCIM_CMD_MWIEN */ 0x0010; + command |= PCIM_CMD_BUSMASTEREN | PCIM_CMD_PERRESPEN | + PCIM_CMD_MWRICEN; pci_write_config(dev, PCIR_COMMAND, command, 2); /* From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:09:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88463106564A; Sat, 26 May 2012 08:09:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72CDD8FC08; Sat, 26 May 2012 08:09: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 q4Q892hj061534; Sat, 26 May 2012 08:09:02 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q892RD061532; Sat, 26 May 2012 08:09:02 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260809.q4Q892RD061532@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236062 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:09:02 -0000 Author: thompsa Date: Sat May 26 08:09:01 2012 New Revision: 236062 URL: http://svn.freebsd.org/changeset/base/236062 Log: Turn LACP debugging from a compile time option to a sysctl, it is very handy to be able to turn it on when negotiation to a switch misbehaves. Submitted by: Andrew Boyer MFC after: 3 days Modified: head/sys/net/ieee8023ad_lacp.c Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Sat May 26 08:03:42 2012 (r236061) +++ head/sys/net/ieee8023ad_lacp.c Sat May 26 08:09:01 2012 (r236062) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include /* hz */ #include /* for net/if.h */ #include +#include #include #include #include @@ -168,7 +169,8 @@ static void lacp_enable_distributing(str static int lacp_xmit_lacpdu(struct lacp_port *); static int lacp_xmit_marker(struct lacp_port *); -#if defined(LACP_DEBUG) +/* Debugging */ + static void lacp_dump_lacpdu(const struct lacpdu *); static const char *lacp_format_partner(const struct lacp_peerinfo *, char *, size_t); @@ -184,10 +186,14 @@ static const char *lacp_format_portid(co size_t); static void lacp_dprintf(const struct lacp_port *, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); -#define LACP_DPRINTF(a) lacp_dprintf a -#else -#define LACP_DPRINTF(a) /* nothing */ -#endif + +static int lacp_debug = 0; +SYSCTL_INT(_net, OID_AUTO, lacp_debug, CTLFLAG_RW | CTLFLAG_TUN, + &lacp_debug, 0, "Enable LACP debug logging (1=debug, 2=trace)"); +TUNABLE_INT("net.lacp_debug", &lacp_debug); + +#define LACP_DPRINTF(a) if (lacp_debug > 0) { lacp_dprintf a ; } +#define LACP_TRACE(a) if (lacp_debug > 1) { lacp_dprintf(a,"%s\n",__func__); } /* * partner administration variables. @@ -290,10 +296,10 @@ lacp_pdu_input(struct lacp_port *lp, str goto bad; } -#if defined(LACP_DEBUG) - LACP_DPRINTF((lp, "lacpdu receive\n")); - lacp_dump_lacpdu(du); -#endif /* defined(LACP_DEBUG) */ + if (lacp_debug > 0) { + lacp_dprintf(lp, "lacpdu receive\n"); + lacp_dump_lacpdu(du); + } LACP_LOCK(lsc); lacp_sm_rx(lp, du); @@ -370,10 +376,10 @@ lacp_xmit_lacpdu(struct lacp_port *lp) sizeof(du->ldu_collector)); du->ldu_collector.lci_maxdelay = 0; -#if defined(LACP_DEBUG) - LACP_DPRINTF((lp, "lacpdu transmit\n")); - lacp_dump_lacpdu(du); -#endif /* defined(LACP_DEBUG) */ + if (lacp_debug > 0) { + lacp_dprintf(lp, "lacpdu transmit\n"); + lacp_dump_lacpdu(du); + } m->m_flags |= M_MCAST; @@ -647,9 +653,7 @@ lacp_disable_distributing(struct lacp_po { struct lacp_aggregator *la = lp->lp_aggregator; struct lacp_softc *lsc = lp->lp_lsc; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif /* defined(LACP_DEBUG) */ LACP_LOCK_ASSERT(lsc); @@ -684,9 +688,7 @@ lacp_enable_distributing(struct lacp_por { struct lacp_aggregator *la = lp->lp_aggregator; struct lacp_softc *lsc = lp->lp_lsc; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif /* defined(LACP_DEBUG) */ LACP_LOCK_ASSERT(lsc); @@ -720,7 +722,8 @@ lacp_transit_expire(void *vp) LACP_LOCK_ASSERT(lsc); - LACP_DPRINTF((NULL, "%s\n", __func__)); + LACP_TRACE(NULL); + lsc->lsc_suppress_distributing = FALSE; } @@ -838,7 +841,8 @@ lacp_suppress_distributing(struct lacp_s return; } - LACP_DPRINTF((NULL, "%s\n", __func__)); + LACP_TRACE(NULL); + lsc->lsc_suppress_distributing = TRUE; /* send a marker frame down each port to verify the queues are empty */ @@ -908,11 +912,9 @@ lacp_select_active_aggregator(struct lac struct lacp_aggregator *la; struct lacp_aggregator *best_la = NULL; uint64_t best_speed = 0; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif /* defined(LACP_DEBUG) */ - LACP_DPRINTF((NULL, "%s:\n", __func__)); + LACP_TRACE(NULL); TAILQ_FOREACH(la, &lsc->lsc_aggregators, la_q) { uint64_t speed; @@ -946,7 +948,6 @@ lacp_select_active_aggregator(struct lac KASSERT(best_la == NULL || !TAILQ_EMPTY(&best_la->la_ports), ("invalid aggregator list")); -#if defined(LACP_DEBUG) if (lsc->lsc_active_aggregator != best_la) { LACP_DPRINTF((NULL, "active aggregator changed\n")); LACP_DPRINTF((NULL, "old %s\n", @@ -957,7 +958,6 @@ lacp_select_active_aggregator(struct lac } LACP_DPRINTF((NULL, "new %s\n", lacp_format_lagid_aggregator(best_la, buf, sizeof(buf)))); -#endif /* defined(LACP_DEBUG) */ if (lsc->lsc_active_aggregator != best_la) { sc->sc_ifp->if_baudrate = best_speed; @@ -1040,9 +1040,7 @@ lacp_compose_key(struct lacp_port *lp) static void lacp_aggregator_addref(struct lacp_softc *lsc, struct lacp_aggregator *la) { -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif LACP_DPRINTF((NULL, "%s: lagid=%s, refcnt %d -> %d\n", __func__, @@ -1058,9 +1056,7 @@ lacp_aggregator_addref(struct lacp_softc static void lacp_aggregator_delref(struct lacp_softc *lsc, struct lacp_aggregator *la) { -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif LACP_DPRINTF((NULL, "%s: lagid=%s, refcnt %d -> %d\n", __func__, @@ -1195,9 +1191,7 @@ lacp_select(struct lacp_port *lp) { struct lacp_softc *lsc = lp->lp_lsc; struct lacp_aggregator *la; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif if (lp->lp_aggregator) { return; @@ -1278,7 +1272,8 @@ lacp_sm_mux(struct lacp_port *lp) enum lacp_selected selected = lp->lp_selected; struct lacp_aggregator *la; - /* LACP_DPRINTF((lp, "%s: state %d\n", __func__, lp->lp_mux_state)); */ + if (lacp_debug > 1) + lacp_dprintf(lp, "%s: state %d\n", __func__, lp->lp_mux_state); re_eval: la = lp->lp_aggregator; @@ -1387,9 +1382,7 @@ static void lacp_sm_mux_timer(struct lacp_port *lp) { struct lacp_aggregator *la = lp->lp_aggregator; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif KASSERT(la->la_pending > 0, ("no pending event")); @@ -1537,11 +1530,9 @@ lacp_sm_rx_record_pdu(struct lacp_port * { boolean_t active; uint8_t oldpstate; -#if defined(LACP_DEBUG) char buf[LACP_STATESTR_MAX+1]; -#endif - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + LACP_TRACE(lp); oldpstate = lp->lp_partner.lip_state; @@ -1576,7 +1567,8 @@ lacp_sm_rx_record_pdu(struct lacp_port * static void lacp_sm_rx_update_ntt(struct lacp_port *lp, const struct lacpdu *du) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); if (lacp_compare_peerinfo(&lp->lp_actor, &du->ldu_partner) || !LACP_STATE_EQ(lp->lp_state, du->ldu_partner.lip_state, @@ -1591,7 +1583,7 @@ lacp_sm_rx_record_default(struct lacp_po { uint8_t oldpstate; - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + LACP_TRACE(lp); oldpstate = lp->lp_partner.lip_state; lp->lp_partner = lacp_partner_admin; @@ -1603,7 +1595,8 @@ static void lacp_sm_rx_update_selected_from_peerinfo(struct lacp_port *lp, const struct lacp_peerinfo *info) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); if (lacp_compare_peerinfo(&lp->lp_partner, info) || !LACP_STATE_EQ(lp->lp_partner.lip_state, info->lip_state, @@ -1616,7 +1609,8 @@ lacp_sm_rx_update_selected_from_peerinfo static void lacp_sm_rx_update_selected(struct lacp_port *lp, const struct lacpdu *du) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); lacp_sm_rx_update_selected_from_peerinfo(lp, &du->ldu_actor); } @@ -1624,7 +1618,8 @@ lacp_sm_rx_update_selected(struct lacp_p static void lacp_sm_rx_update_default_selected(struct lacp_port *lp) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); lacp_sm_rx_update_selected_from_peerinfo(lp, &lacp_partner_admin); } @@ -1812,7 +1807,7 @@ tlv_check(const void *p, size_t size, co return (0); } -#if defined(LACP_DEBUG) +/* Debugging */ const char * lacp_format_mac(const uint8_t *mac, char *buf, size_t buflen) { @@ -1942,4 +1937,3 @@ lacp_dprintf(const struct lacp_port *lp, vprintf(fmt, va); va_end(va); } -#endif From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:17:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8162F106564A; Sat, 26 May 2012 08:17:31 +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 6C2C08FC08; Sat, 26 May 2012 08:17: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 q4Q8HVgs061912; Sat, 26 May 2012 08:17:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8HVnD061910; Sat, 26 May 2012 08:17:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260817.q4Q8HVnD061910@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236063 - head/sys/dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:17:31 -0000 Author: marius Date: Sat May 26 08:17:30 2012 New Revision: 236063 URL: http://svn.freebsd.org/changeset/base/236063 Log: Remove extraneous empty lines. MFC after: 3 day Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Sat May 26 08:09:01 2012 (r236062) +++ head/sys/dev/sym/sym_hipd.c Sat May 26 08:17:30 2012 (r236063) @@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$"); #include "opt_sym.h" #include - #include #include #include @@ -128,7 +127,6 @@ typedef u_int32_t u32; * requires memory barriers (and also IO barriers when they * make sense) to be used. */ - #if defined __i386__ || defined __amd64__ #define MEMORY_BARRIER() do { ; } while(0) #elif defined __powerpc__ @@ -144,7 +142,6 @@ typedef u_int32_t u32; /* * A la VMS/CAM-3 queue management. */ - typedef struct sym_quehead { struct sym_quehead *flink; /* Forward pointer */ struct sym_quehead *blink; /* Backward pointer */ @@ -206,7 +203,6 @@ static __inline void sym_que_splice(stru #define sym_que_entry(ptr, type, member) \ ((type *)((char *)(ptr)-(size_t)(&((type *)0)->member))) - #define sym_insque(new, pos) __sym_que_add(new, pos, (pos)->flink) #define sym_remque(el) __sym_que_del((el)->blink, (el)->flink) @@ -373,7 +369,6 @@ static void MDELAY(int ms) { while (ms-- * pages of memory that will be useful if we ever need to deal * with IO MMUs for PCI. */ - #define MEMO_SHIFT 4 /* 16 bytes minimum memory chunk */ #define MEMO_PAGE_ORDER 0 /* 1 PAGE maximum */ #if 0 @@ -567,7 +562,6 @@ static m_pool_s mp0 = {0, 0, ___mp0_getp static m_pool_s mp0 = {0, 0, ___mp0_getp}; #endif - /* * Actual memory allocation routine for non-DMAed memory. */ @@ -768,7 +762,6 @@ static m_addr_t __vtobus(bus_dma_tag_t d return vp ? vp->baddr + (((m_addr_t) m) - a) : 0; } - /* * Verbs for DMAable memory handling. * The _uvptv_ macro avoids a nasty warning about pointer to volatile @@ -783,7 +776,6 @@ static m_addr_t __vtobus(bus_dma_tag_t d #define _vtobus(np, p) __vtobus(np->bus_dmat, _uvptv_(p)) #define vtobus(p) _vtobus(np, p) - /* * Print a buffer in hexadecimal format. */ @@ -858,14 +850,12 @@ struct sym_nvram { * Symbios chips (never seen, by the way). * For now, this stuff does not deserve any comments. :) */ - #define sym_offb(o) (o) #define sym_offw(o) (o) /* * Some provision for support for BIG ENDIAN CPU. */ - #define cpu_to_scr(dw) htole32(dw) #define scr_to_cpu(dw) le32toh(dw) @@ -874,8 +864,6 @@ struct sym_nvram { * We use the `bus space' interface under FreeBSD-4 and * later kernel versions. */ - - #if defined(SYM_CONF_IOMAPPED) #define INB_OFF(o) bus_read_1(np->io_res, (o)) @@ -901,7 +889,6 @@ struct sym_nvram { #define OUTRAM_OFF(o, a, l) \ bus_write_region_1(np->ram_res, (o), (a), (l)) - /* * Common definitions for both bus space and legacy IO methods. */ @@ -1333,7 +1320,6 @@ struct sym_pmc { * For SYMBIOS chips that support LOAD/STORE this copy is * not needed and thus not performed. */ - struct sym_ccbh { /* * Start and restart SCRIPTS addresses (must be at 0). @@ -1749,7 +1735,6 @@ static __inline const char *sym_name(hcb #define PADDR_A(label) SYM_GEN_PADDR_A(struct SYM_FWA_SCR, label) #define PADDR_B(label) SYM_GEN_PADDR_B(struct SYM_FWB_SCR, label) - #ifdef SYM_CONF_GENERIC_SUPPORT /* * Allocate firmware #1 script area. @@ -2453,7 +2438,6 @@ static __inline void sym_init_burst(hcb_ } } - /* * Print out the list of targets that have some flag disabled by user. */ @@ -2848,7 +2832,6 @@ static int sym_prepare_setting(hcb_p np, * negotiation and the nego_status field of the CCB. * Returns the size of the message in bytes. */ - static int sym_prepare_nego(hcb_p np, ccb_p cp, int nego, u_char *msgptr) { tcb_p tp = &np->target[cp->target]; @@ -2966,7 +2949,6 @@ static void sym_put_start_queue(hcb_p np OUTB (nc_istat, SIGP|np->istat_sem); } - /* * Soft reset the chip. * @@ -3842,7 +3824,6 @@ static void sym_log_hard_error(hcb_p np, * ask me for any guarantee that it will never fail. :-) * Use at your own decision and risk. */ - static void sym_intr1 (hcb_p np) { u_char istat, istatc; @@ -4004,7 +3985,6 @@ static void sym_poll(struct cam_sim *sim sym_intr1(cam_sim_softc(sim)); } - /* * generic recovery from scsi interrupt * @@ -5292,7 +5272,6 @@ static void sym_sir_task_recovery(hcb_p * offset (basically from the MDP message) and returns * the corresponding values of dp_sg and dp_ofs. */ - static int sym_evaluate_dp(hcb_p np, ccb_p cp, u32 scr, int *ofs) { u32 dp_scr; @@ -5410,7 +5389,6 @@ out_err: * Btw, we assume in that situation that such a message * is equivalent to a MODIFY DATA POINTER (offset=-1). */ - static void sym_modify_dp(hcb_p np, tcb_p tp, ccb_p cp, int ofs) { int dp_ofs = ofs; @@ -5494,7 +5472,6 @@ out_reject: OUTL_DSP (SCRIPTB_BA (np, msg_bad)); } - /* * chip calculation of the data residual. * @@ -5509,7 +5486,6 @@ out_reject: * any software that considers this data residual as * a relevant information. :) */ - static int sym_compute_residual(hcb_p np, ccb_p cp) { int dp_sg, dp_sgmin, resid = 0; @@ -5575,7 +5551,6 @@ static int sym_compute_residual(hcb_p np /* * Print out the content of a SCSI message. */ - static int sym_show_msg (u_char * msg) { u_char i; @@ -7771,7 +7746,6 @@ sym_setup_data_pointers(hcb_p np, ccb_p cp->startp = cp->phys.head.savep; } - /* * Call back routine for the DMA map service. * If bounce buffers are used (why ?), we may sleep and then @@ -7986,7 +7960,6 @@ sym_fast_scatter_sg_physical(hcb_p np, c return 0; } - /* * Scatter a SG list with physical addresses into bus addressable chunks. */ @@ -8338,10 +8311,8 @@ sym_update_dflags(hcb_p np, u_char *flag #undef cts__scsi } - /*============= DRIVER INITIALISATION ==================*/ - static device_method_t sym_pci_methods[] = { DEVMETHOD(device_probe, sym_pci_probe), DEVMETHOD(device_attach, sym_pci_attach), @@ -8360,7 +8331,6 @@ DRIVER_MODULE(sym, pci, sym_pci_driver, MODULE_DEPEND(sym, cam, 1, 1, 1); MODULE_DEPEND(sym, pci, 1, 1, 1); - static const struct sym_pci_chip sym_pci_dev_table[] = { {PCI_ID_SYM53C810, 0x0f, "810", 4, 8, 4, 64, FE_ERL} @@ -9260,7 +9230,6 @@ static void sym_display_Tekram_nvram(hcb #endif /* SYM_CONF_DEBUG_NVRAM */ #endif /* SYM_CONF_NVRAM_SUPPORT */ - /* * Try reading Symbios or Tekram NVRAM */ @@ -9298,7 +9267,6 @@ static int sym_read_nvram(hcb_p np, stru return nvp->type; } - #ifdef SYM_CONF_NVRAM_SUPPORT /* * 24C16 EEPROM reading. From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:18:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F30CD106566B; Sat, 26 May 2012 08:18:46 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE5498FC1C; Sat, 26 May 2012 08:18: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 q4Q8IkWh061995; Sat, 26 May 2012 08:18:46 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8Ikvp061993; Sat, 26 May 2012 08:18:46 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260818.q4Q8Ikvp061993@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:18:46 +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: r236064 - stable/9/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:18:47 -0000 Author: thompsa Date: Sat May 26 08:18:46 2012 New Revision: 236064 URL: http://svn.freebsd.org/changeset/base/236064 Log: MFC r232638 Fix typo in lagg options. 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 May 26 08:17:30 2012 (r236063) +++ stable/9/sbin/ifconfig/ifconfig.8 Sat May 26 08:18:46 2012 (r236064) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd March 4, 2012 +.Dd March 7, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2289,7 +2289,7 @@ src/dst mac address and optional vlan nu .It Cm l3 src/dst address for IPv4 or IPv6. .It Cm l4 -src/dst port for TCP/UCP/SCTP. +src/dst port for TCP/UDP/SCTP. .El .Pp .El From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:21:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F09E7106566C; Sat, 26 May 2012 08:21:11 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBAC78FC0C; Sat, 26 May 2012 08:21: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 q4Q8LBSw062120; Sat, 26 May 2012 08:21:11 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8LBe8062118; Sat, 26 May 2012 08:21:11 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260821.q4Q8LBe8062118@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:21:11 +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: r236065 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:21:12 -0000 Author: thompsa Date: Sat May 26 08:21:11 2012 New Revision: 236065 URL: http://svn.freebsd.org/changeset/base/236065 Log: MFC r232009 Make it clear that fec is just an alias Modified: stable/9/share/man/man4/lagg.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/lagg.4 ============================================================================== --- stable/9/share/man/man4/lagg.4 Sat May 26 08:18:46 2012 (r236064) +++ stable/9/share/man/man4/lagg.4 Sat May 26 08:21:11 2012 (r236065) @@ -88,8 +88,9 @@ variable to a nonzero value, which is useful for certain bridged network setups. .It Ic fec Supports Cisco EtherChannel. -This is a static setup and does not negotiate aggregation with the peer or -exchange frames to monitor the link. +This is an alias for +.Ic loadbalance +mode. .It Ic lacp Supports the IEEE 802.3ad Link Aggregation Control Protocol (LACP) and the Marker Protocol. From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:23:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4591F106566C; Sat, 26 May 2012 08:23:27 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 302228FC08; Sat, 26 May 2012 08:23:27 +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 q4Q8NRGD062251; Sat, 26 May 2012 08:23:27 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8NQDZ062249; Sat, 26 May 2012 08:23:26 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260823.q4Q8NQDZ062249@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:23:26 +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: r236066 - stable/8/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:23:27 -0000 Author: thompsa Date: Sat May 26 08:23:26 2012 New Revision: 236066 URL: http://svn.freebsd.org/changeset/base/236066 Log: MFC r232638 Fix typo in lagg options. 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 May 26 08:21:11 2012 (r236065) +++ stable/8/sbin/ifconfig/ifconfig.8 Sat May 26 08:23:26 2012 (r236066) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd February 29, 2012 +.Dd March 7, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2246,7 +2246,7 @@ src/dst mac address and optional vlan nu .It Cm l3 src/dst address for IPv4 or IPv6. .It Cm l4 -src/dst port for TCP/UCP/SCTP. +src/dst port for TCP/UDP/SCTP. .El .Pp .El From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:25:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EEBE11065674; Sat, 26 May 2012 08:25:25 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9C838FC08; Sat, 26 May 2012 08:25:25 +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 q4Q8PPje062362; Sat, 26 May 2012 08:25:25 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8PPTL062360; Sat, 26 May 2012 08:25:25 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260825.q4Q8PPTL062360@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:25:25 +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: r236067 - stable/9/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:25:26 -0000 Author: thompsa Date: Sat May 26 08:25:25 2012 New Revision: 236067 URL: http://svn.freebsd.org/changeset/base/236067 Log: MFC r232321 Correct the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a system tunable has never been implemented. This flag is only used by sysctl(8) to provide a helpful error message. Modified: stable/9/share/man/man9/sysctl.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/sysctl.9 ============================================================================== --- stable/9/share/man/man9/sysctl.9 Sat May 26 08:23:26 2012 (r236066) +++ stable/9/share/man/man9/sysctl.9 Sat May 26 08:25:25 2012 (r236067) @@ -138,9 +138,9 @@ This sysctl can be written to by process .It Dv CTLFLAG_SKIP When iterating the sysctl name space, do not list this sysctl. .It Dv CTLFLAG_TUN -Also declare a system tunable with the same name to initialize this variable. +Advisory flag that a system tunable also exists for this variable. .It Dv CTLFLAG_RDTUN -Also declare a system tunable with the same name to initialize this variable; +Advisory flag that a system tunable also exists for this variable; however, the run-time variable is read-only. .El .Pp From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:25:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43EFF106566C; Sat, 26 May 2012 08:25:42 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ED918FC15; Sat, 26 May 2012 08:25: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 q4Q8Pg2s062407; Sat, 26 May 2012 08:25:42 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8PfXg062405; Sat, 26 May 2012 08:25:41 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260825.q4Q8PfXg062405@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:25: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: r236068 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:25:42 -0000 Author: thompsa Date: Sat May 26 08:25:41 2012 New Revision: 236068 URL: http://svn.freebsd.org/changeset/base/236068 Log: MFC r232321 Correct the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a system tunable has never been implemented. This flag is only used by sysctl(8) to provide a helpful error message. Modified: stable/8/share/man/man9/sysctl.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/sysctl.9 ============================================================================== --- stable/8/share/man/man9/sysctl.9 Sat May 26 08:25:25 2012 (r236067) +++ stable/8/share/man/man9/sysctl.9 Sat May 26 08:25:41 2012 (r236068) @@ -142,9 +142,9 @@ This sysctl can be written to by process .It Dv CTLFLAG_SKIP When iterating the sysctl name space, do not list this sysctl. .It Dv CTLFLAG_TUN -Also declare a system tunable with the same name to initialize this variable. +Advisory flag that a system tunable also exists for this variable. .It Dv CTLFLAG_RDTUN -Also declare a system tunable with the same name to initialize this variable; +Advisory flag that a system tunable also exists for this variable; however, the run-time variable is read-only. .El .Pp From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:31:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0312106564A; Sat, 26 May 2012 08:31:12 +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 CBA6F8FC08; Sat, 26 May 2012 08:31:12 +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 q4Q8VCik062664; Sat, 26 May 2012 08:31:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8VCs2062662; Sat, 26 May 2012 08:31:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260831.q4Q8VCs2062662@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236069 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:31:13 -0000 Author: marius Date: Sat May 26 08:31:12 2012 New Revision: 236069 URL: http://svn.freebsd.org/changeset/base/236069 Log: Make the VIA workaround actually do its intended job. MFC after: 3 days Modified: head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Sat May 26 08:25:41 2012 (r236068) +++ head/sys/dev/usb/controller/ehci_pci.c Sat May 26 08:31:12 2012 (r236069) @@ -243,7 +243,7 @@ ehci_pci_via_quirk(device_t self) val = pci_read_config(self, 0x4b, 1); if (val & 0x20) return; - pci_write_config(self, 0x4b, val, 1); + pci_write_config(self, 0x4b, val | 0x20, 1); device_printf(self, "VIA-quirk applied\n"); } } From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:33:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AAF691065670; Sat, 26 May 2012 08:33:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 978548FC14; Sat, 26 May 2012 08:33:53 +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 q4Q8XrYk062809; Sat, 26 May 2012 08:33:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8Xr1l062807; Sat, 26 May 2012 08:33:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260833.q4Q8Xr1l062807@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236070 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:33:53 -0000 Author: marius Date: Sat May 26 08:33:53 2012 New Revision: 236070 URL: http://svn.freebsd.org/changeset/base/236070 Log: Consistently use USB_PAGE_SIZE. Currently, this is cosmetic. MFC after: 3 days Modified: head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Sat May 26 08:31:12 2012 (r236069) +++ head/sys/dev/usb/usb_transfer.c Sat May 26 08:33:53 2012 (r236070) @@ -217,12 +217,12 @@ usbd_transfer_setup_sub_malloc(struct us * Try multi-allocation chunks to reduce the number of DMA * allocations, hence DMA allocations are slow. */ - if (size >= PAGE_SIZE) { + if (size >= USB_PAGE_SIZE) { n_dma_pc = count; n_obj = 1; } else { /* compute number of objects per page */ - n_obj = (PAGE_SIZE / size); + n_obj = (USB_PAGE_SIZE / size); /* * Compute number of DMA chunks, rounded up * to nearest one: From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:41:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A208B106564A; Sat, 26 May 2012 08:41:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83F9F8FC12; Sat, 26 May 2012 08:41: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 q4Q8fIqn063135; Sat, 26 May 2012 08:41:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8fHul063133; Sat, 26 May 2012 08:41:17 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260841.q4Q8fHul063133@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:41:17 +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: r236071 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:41:18 -0000 Author: thompsa Date: Sat May 26 08:41:17 2012 New Revision: 236071 URL: http://svn.freebsd.org/changeset/base/236071 Log: MFC r231130 (pjd) Allow to set if_bridge(4) sysctls from /boot/loader.conf. 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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/net/if_bridge.c ============================================================================== --- stable/9/sys/net/if_bridge.c Sat May 26 08:33:53 2012 (r236070) +++ stable/9/sys/net/if_bridge.c Sat May 26 08:41:17 2012 (r236071) @@ -358,19 +358,26 @@ static int pfil_local_phys = 0; /* run p locally destined packets */ static int log_stp = 0; /* log STP state changes */ static int bridge_inherit_mac = 0; /* share MAC with first bridge member */ +TUNABLE_INT("net.link.bridge.pfil_onlyip", &pfil_onlyip); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RW, &pfil_onlyip, 0, "Only pass IP packets when pfil is enabled"); +TUNABLE_INT("net.link.bridge.ipfw_arp", &pfil_ipfw_arp); SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RW, &pfil_ipfw_arp, 0, "Filter ARP packets through IPFW layer2"); +TUNABLE_INT("net.link.bridge.pfil_bridge", &pfil_bridge); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, CTLFLAG_RW, &pfil_bridge, 0, "Packet filter on the bridge interface"); +TUNABLE_INT("net.link.bridge.pfil_member", &pfil_member); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, CTLFLAG_RW, &pfil_member, 0, "Packet filter on the member interface"); +TUNABLE_INT("net.link.bridge.pfil_local_phys", &pfil_local_phys); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, CTLFLAG_RW, &pfil_local_phys, 0, "Packet filter on the physical interface for locally destined packets"); +TUNABLE_INT("net.link.bridge.log_stp", &log_stp); SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RW, &log_stp, 0, "Log STP state changes"); +TUNABLE_INT("net.link.bridge.inherit_mac", &bridge_inherit_mac); SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RW, &bridge_inherit_mac, 0, "Inherit MAC address from the first bridge member"); From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:41:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E9F4106566C; Sat, 26 May 2012 08:41:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E45528FC14; Sat, 26 May 2012 08:41:48 +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 q4Q8fmUm063187; Sat, 26 May 2012 08:41:48 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8fmdF063185; Sat, 26 May 2012 08:41:48 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260841.q4Q8fmdF063185@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:41:48 +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: r236072 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:41:49 -0000 Author: thompsa Date: Sat May 26 08:41:48 2012 New Revision: 236072 URL: http://svn.freebsd.org/changeset/base/236072 Log: MFC r231130 (pjd) Allow to set if_bridge(4) sysctls from /boot/loader.conf. 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) Modified: stable/8/sys/net/if_bridge.c ============================================================================== --- stable/8/sys/net/if_bridge.c Sat May 26 08:41:17 2012 (r236071) +++ stable/8/sys/net/if_bridge.c Sat May 26 08:41:48 2012 (r236072) @@ -358,19 +358,26 @@ static int pfil_local_phys = 0; /* run p locally destined packets */ static int log_stp = 0; /* log STP state changes */ static int bridge_inherit_mac = 0; /* share MAC with first bridge member */ +TUNABLE_INT("net.link.bridge.pfil_onlyip", &pfil_onlyip); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RW, &pfil_onlyip, 0, "Only pass IP packets when pfil is enabled"); +TUNABLE_INT("net.link.bridge.ipfw_arp", &pfil_ipfw_arp); SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RW, &pfil_ipfw_arp, 0, "Filter ARP packets through IPFW layer2"); +TUNABLE_INT("net.link.bridge.pfil_bridge", &pfil_bridge); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, CTLFLAG_RW, &pfil_bridge, 0, "Packet filter on the bridge interface"); +TUNABLE_INT("net.link.bridge.pfil_member", &pfil_member); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, CTLFLAG_RW, &pfil_member, 0, "Packet filter on the member interface"); +TUNABLE_INT("net.link.bridge.pfil_local_phys", &pfil_local_phys); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, CTLFLAG_RW, &pfil_local_phys, 0, "Packet filter on the physical interface for locally destined packets"); +TUNABLE_INT("net.link.bridge.log_stp", &log_stp); SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RW, &log_stp, 0, "Log STP state changes"); +TUNABLE_INT("net.link.bridge.inherit_mac", &bridge_inherit_mac); SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RW, &bridge_inherit_mac, 0, "Inherit MAC address from the first bridge member"); From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:43:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9336106566B; Sat, 26 May 2012 08:43:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B48B38FC0C; Sat, 26 May 2012 08:43: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 q4Q8hpPh063309; Sat, 26 May 2012 08:43:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8hppm063307; Sat, 26 May 2012 08:43:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260843.q4Q8hppm063307@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236073 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:43:51 -0000 Author: marius Date: Sat May 26 08:43:51 2012 New Revision: 236073 URL: http://svn.freebsd.org/changeset/base/236073 Log: Make the VIA workaround application somewhat more consistent with the ATI one. Modified: head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Sat May 26 08:41:48 2012 (r236072) +++ head/sys/dev/usb/controller/ehci_pci.c Sat May 26 08:43:51 2012 (r236073) @@ -243,7 +243,8 @@ ehci_pci_via_quirk(device_t self) val = pci_read_config(self, 0x4b, 1); if (val & 0x20) return; - pci_write_config(self, 0x4b, val | 0x20, 1); + val |= 0x20; + pci_write_config(self, 0x4b, val, 1); device_printf(self, "VIA-quirk applied\n"); } } From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:44:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E2C5106564A; Sat, 26 May 2012 08:44:27 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F38A98FC08; Sat, 26 May 2012 08:44: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 q4Q8iQNM063380; Sat, 26 May 2012 08:44:26 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8iQqY063378; Sat, 26 May 2012 08:44:26 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260844.q4Q8iQqY063378@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:44: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: r236074 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:44:27 -0000 Author: thompsa Date: Sat May 26 08:44:26 2012 New Revision: 236074 URL: http://svn.freebsd.org/changeset/base/236074 Log: MFC r234936 (emaste) Relax restriction on direct tx to child ports Lagg(4) restricts the type of packet that may be sent directly to a child port, to avoid undesired output from accidental misconfiguration. Previously only ETHERTYPE_PAE was permitted. BPF writes to a lagg(4) child port are presumably intentional, so just allow them, while still blocking other packets that should take the aggregation path. PR: kern/138620 Modified: stable/9/sys/net/if_lagg.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Sat May 26 08:43:51 2012 (r236073) +++ stable/9/sys/net/if_lagg.c Sat May 26 08:44:26 2012 (r236074) @@ -764,28 +764,18 @@ fallback: return (EINVAL); } +/* + * For direct output to child ports. + */ static int lagg_port_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct route *ro) { struct lagg_port *lp = ifp->if_lagg; - struct ether_header *eh; - short type = 0; switch (dst->sa_family) { case pseudo_AF_HDRCMPLT: case AF_UNSPEC: - eh = (struct ether_header *)dst->sa_data; - type = eh->ether_type; - break; - } - - /* - * Only allow ethernet types required to initiate or maintain the link, - * aggregated frames take a different path. - */ - switch (ntohs(type)) { - case ETHERTYPE_PAE: /* EAPOL PAE/802.1x */ return ((*lp->lp_output)(ifp, m, dst, ro)); } From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:44:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E50910656E8; Sat, 26 May 2012 08:44:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48FCF8FC0A; Sat, 26 May 2012 08:44: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 q4Q8ipde063430; Sat, 26 May 2012 08:44:51 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8ipaS063428; Sat, 26 May 2012 08:44:51 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260844.q4Q8ipaS063428@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:44:51 +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: r236075 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:44:51 -0000 Author: thompsa Date: Sat May 26 08:44:50 2012 New Revision: 236075 URL: http://svn.freebsd.org/changeset/base/236075 Log: MFC r234936 (emaste) Relax restriction on direct tx to child ports Lagg(4) restricts the type of packet that may be sent directly to a child port, to avoid undesired output from accidental misconfiguration. Previously only ETHERTYPE_PAE was permitted. BPF writes to a lagg(4) child port are presumably intentional, so just allow them, while still blocking other packets that should take the aggregation path. PR: kern/138620 Modified: stable/8/sys/net/if_lagg.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) Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Sat May 26 08:44:26 2012 (r236074) +++ stable/8/sys/net/if_lagg.c Sat May 26 08:44:50 2012 (r236075) @@ -756,28 +756,18 @@ fallback: return (EINVAL); } +/* + * For direct output to child ports. + */ static int lagg_port_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct route *ro) { struct lagg_port *lp = ifp->if_lagg; - struct ether_header *eh; - short type = 0; switch (dst->sa_family) { case pseudo_AF_HDRCMPLT: case AF_UNSPEC: - eh = (struct ether_header *)dst->sa_data; - type = eh->ether_type; - break; - } - - /* - * Only allow ethernet types required to initiate or maintain the link, - * aggregated frames take a different path. - */ - switch (ntohs(type)) { - case ETHERTYPE_PAE: /* EAPOL PAE/802.1x */ return ((*lp->lp_output)(ifp, m, dst, ro)); } From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:54:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19F97106564A; Sat, 26 May 2012 08:54:27 +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 01AE88FC15; Sat, 26 May 2012 08:54:27 +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 q4Q8sQvH063914; Sat, 26 May 2012 08:54:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8sQjW063905; Sat, 26 May 2012 08:54:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260854.q4Q8sQjW063905@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:54: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: r236076 - in stable/9/sys/boot: ofw/libofw sparc64 sparc64/boot1 sparc64/loader sparc64/zfsboot sparc64/zfsloader zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:54:27 -0000 Author: marius Date: Sat May 26 08:54:26 2012 New Revision: 236076 URL: http://svn.freebsd.org/changeset/base/236076 Log: MFC: r234898, r235207 Add initial support for booting from ZFS on sparc64. At least on Sun Fire V100, the firmware is known to be broken and not allowing to simultaneously open disk devices, causing attempts to boot from a mirror or RAIDZ to cause a crash. This will be worked around later. The firmwares of newer sun4u models don't seem to exhibit this problem though. PR: 165025 Submitted by: Gavin Mu Added: stable/9/sys/boot/sparc64/zfsboot/ - copied from r234898, head/sys/boot/sparc64/zfsboot/ stable/9/sys/boot/sparc64/zfsloader/ - copied from r234898, head/sys/boot/sparc64/zfsloader/ Modified: stable/9/sys/boot/ofw/libofw/devicename.c stable/9/sys/boot/sparc64/Makefile stable/9/sys/boot/sparc64/boot1/Makefile stable/9/sys/boot/sparc64/boot1/boot1.c stable/9/sys/boot/sparc64/loader/Makefile stable/9/sys/boot/sparc64/loader/main.c stable/9/sys/boot/sparc64/zfsboot/Makefile stable/9/sys/boot/zfs/zfs.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/ofw/libofw/devicename.c ============================================================================== --- stable/9/sys/boot/ofw/libofw/devicename.c Sat May 26 08:44:50 2012 (r236075) +++ stable/9/sys/boot/ofw/libofw/devicename.c Sat May 26 08:54:26 2012 (r236076) @@ -28,6 +28,8 @@ __FBSDID("$FreeBSD$"); #include + +#include "bootstrap.h" #include "libofw.h" static int ofw_parsedev(struct ofw_devdesc **, const char *, const char **); @@ -76,6 +78,7 @@ ofw_parsedev(struct ofw_devdesc **dev, c phandle_t handle; const char *p; const char *s; + char *ep; char name[256]; char type[64]; int len; @@ -87,9 +90,10 @@ ofw_parsedev(struct ofw_devdesc **dev, c len = s - devspec; bcopy(devspec, name, len); name[len] = '\0'; - if ((handle = OF_finddevice(name)) == -1) - break; - if (OF_getprop(handle, "device_type", type, sizeof(type)) == -1) + if ((handle = OF_finddevice(name)) == -1) { + bcopy(name, type, len); + type[len] = '\0'; + } else if (OF_getprop(handle, "device_type", type, sizeof(type)) == -1) continue; for (i = 0; (dv = devsw[i]) != NULL; i++) { if (strncmp(dv->dv_name, type, strlen(dv->dv_name)) == 0) @@ -109,6 +113,18 @@ found: strcpy(idev->d_path, name); idev->d_dev = dv; idev->d_type = dv->dv_type; + if (idev->d_type == DEVT_ZFS) { + idev->d_unit = 0; + p = name + strlen(dv->dv_name); + if (*p && (*p != ':')) { + idev->d_unit = strtol(p, &ep, 0); + if (ep == p) { + free(idev); + return (EUNIT); + } + } + } + if (dev == NULL) { free(idev); } else { Modified: stable/9/sys/boot/sparc64/Makefile ============================================================================== --- stable/9/sys/boot/sparc64/Makefile Sat May 26 08:44:50 2012 (r236075) +++ stable/9/sys/boot/sparc64/Makefile Sat May 26 08:54:26 2012 (r236076) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= boot1 loader +SUBDIR= boot1 loader zfsboot zfsloader .include Modified: stable/9/sys/boot/sparc64/boot1/Makefile ============================================================================== --- stable/9/sys/boot/sparc64/boot1/Makefile Sat May 26 08:44:50 2012 (r236075) +++ stable/9/sys/boot/sparc64/boot1/Makefile Sat May 26 08:54:26 2012 (r236076) @@ -3,22 +3,23 @@ PROG= boot1.elf INTERNALPROG= NO_MAN= -FILES= boot1 +FILES?= boot1 SRCS= _start.s boot1.c +CLEANFILES=${FILES} boot1.aout BOOTBLOCKBASE= 0x4000 -CFLAGS= -mcmodel=medlow -Os -I${.CURDIR}/../../common +CFLAGS+=-mcmodel=medlow -Os -I${.CURDIR}/../../common LDFLAGS=-Ttext ${BOOTBLOCKBASE} -Wl,-N # Construct boot1. sunlabel expects it to contain zeroed-out space for the # label, and to be of the correct size. -boot1: boot1.aout +${FILES}: boot1.aout + @set -- `ls -l boot1.aout`; x=$$((7680-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 dd if=/dev/zero of=${.TARGET} bs=512 count=16 dd if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc -CLEANFILES= boot1.aout - boot1.aout: boot1.elf elf2aout -o ${.TARGET} ${.ALLSRC} Modified: stable/9/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/9/sys/boot/sparc64/boot1/boot1.c Sat May 26 08:44:50 2012 (r236075) +++ stable/9/sys/boot/sparc64/boot1/boot1.c Sat May 26 08:54:26 2012 (r236076) @@ -20,11 +20,13 @@ __FBSDID("$FreeBSD$"); #include #include + #include #include -#define _PATH_LOADER "/boot/loader" -#define _PATH_KERNEL "/boot/kernel/kernel" +#define _PATH_LOADER "/boot/loader" +#define _PATH_KERNEL "/boot/kernel/kernel" +#define READ_BUF_SIZE 8192 typedef int putc_func_t(char c, void *arg); typedef int32_t ofwh_t; @@ -45,17 +47,21 @@ static ofwh_t bootdev; static uint32_t fs_off; int main(int ac, char **av); - static void exit(int) __dead2; -static void load(const char *); -static int dskread(void *, u_int64_t, int); - static void usage(void); +#ifdef ZFSBOOT +static void loadzfs(void); +static int zbread(char *buf, off_t off, size_t bytes); +#else +static void load(const char *); +#endif + static void bcopy(const void *src, void *dst, size_t len); static void bzero(void *b, size_t len); static int mount(const char *device); +static int dskread(void *buf, u_int64_t lba, int nblk); static void panic(const char *fmt, ...) __dead2; static int printf(const char *fmt, ...); @@ -312,8 +318,6 @@ strcmp(const char *s1, const char *s2) return ((u_char)*s1 - (u_char)*s2); } -#include "ufsread.c" - int main(int ac, char **av) { @@ -335,14 +339,22 @@ main(int ac, char **av) } } - printf(" \n>> FreeBSD/sparc64 boot block\n" - " Boot path: %s\n" - " Boot loader: %s\n", bootpath, path); +#ifdef ZFSBOOT + printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", + bootpath); +#else + printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" + " Boot loader: %s\n", "", bootpath, path); +#endif if (mount(bootpath) == -1) panic("mount"); +#ifdef ZFSBOOT + loadzfs(); +#else load(path); +#endif return (1); } @@ -361,24 +373,86 @@ exit(int code) ofw_exit(); } -static struct dmadat __dmadat; +#ifdef ZFSBOOT + +#define VDEV_BOOT_OFFSET (2 * 256 * 1024) +static char zbuf[READ_BUF_SIZE]; static int -mount(const char *device) +zbread(char *buf, off_t off, size_t bytes) { + size_t len; + off_t poff; + off_t soff; + char *p; + unsigned int nb; + unsigned int lb; - dmadat = &__dmadat; - if ((bootdev = ofw_open(device)) == -1) { - printf("mount: can't open device\n"); - return (-1); + p = buf; + soff = VDEV_BOOT_OFFSET + off; + lb = (soff + bytes + DEV_BSIZE - 1) / DEV_BSIZE; + poff = soff; + while (poff < soff + bytes) { + nb = lb - poff / DEV_BSIZE; + if (nb > READ_BUF_SIZE / DEV_BSIZE) + nb = READ_BUF_SIZE / DEV_BSIZE; + if (dskread(zbuf, poff / DEV_BSIZE, nb)) + break; + if ((poff / DEV_BSIZE + nb) * DEV_BSIZE > soff + bytes) + len = soff + bytes - poff; + else + len = (poff / DEV_BSIZE + nb) * DEV_BSIZE - poff; + memcpy(p, zbuf + poff % DEV_BSIZE, len); + p += len; + poff += len; } - if (fsread(0, NULL, 0)) { - printf("mount: can't read superblock\n"); - return (-1); + return (poff - soff); +} + +static void +loadzfs(void) +{ + Elf64_Ehdr eh; + Elf64_Phdr ph; + caddr_t p; + ino_t ino; + int i; + + if (zbread((char *)&eh, 0, sizeof(eh)) != sizeof(eh)) { + printf("Can't read elf header\n"); + return; } - return (0); + if (!IS_ELF(eh)) { + printf("Not an ELF file\n"); + return; + } + for (i = 0; i < eh.e_phnum; i++) { + fs_off = eh.e_phoff + i * eh.e_phentsize; + if (zbread((char *)&ph, fs_off, sizeof(ph)) != sizeof(ph)) { + printf("Can't read program header %d\n", i); + return; + } + if (ph.p_type != PT_LOAD) + continue; + fs_off = ph.p_offset; + p = (caddr_t)ph.p_vaddr; + if (zbread(p, fs_off, ph.p_filesz) != ph.p_filesz) { + printf("Can't read content of section %d\n", i); + return; + } + if (ph.p_filesz != ph.p_memsz) + bzero(p + ph.p_filesz, ph.p_memsz - ph.p_filesz); + } + ofw_close(bootdev); + (*(void (*)(int, int, int, int, ofwfp_t))eh.e_entry)(0, 0, 0, 0, ofw); } +#else + +#include "ufsread.c" + +static struct dmadat __dmadat; + static void load(const char *fname) { @@ -421,6 +495,26 @@ load(const char *fname) (*(void (*)(int, int, int, int, ofwfp_t))eh.e_entry)(0, 0, 0, 0, ofw); } +#endif /* ZFSBOOT */ + +static int +mount(const char *device) +{ + + if ((bootdev = ofw_open(device)) == -1) { + printf("mount: can't open device\n"); + return (-1); + } +#ifndef ZFSBOOT + dmadat = &__dmadat; + if (fsread(0, NULL, 0)) { + printf("mount: can't read superblock\n"); + return (-1); + } +#endif + return (0); +} + static int dskread(void *buf, u_int64_t lba, int nblk) { Modified: stable/9/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/9/sys/boot/sparc64/loader/Makefile Sat May 26 08:44:50 2012 (r236075) +++ stable/9/sys/boot/sparc64/loader/Makefile Sat May 26 08:54:26 2012 (r236076) @@ -3,8 +3,8 @@ .include MK_SSP= no -PROG= loader -NEWVERSWHAT= "bootstrap loader" sparc64 +PROG?= loader +NEWVERSWHAT?= "bootstrap loader" sparc64 INSTALLFLAGS= -b # Architecture-specific loader code @@ -13,12 +13,17 @@ SRCS= locore.S main.c metadata.c vers.c LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes +LOADER_ZFS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no +LOADER_DEBUG?= no +.if ${LOADER_DEBUG} == "yes" +CFLAGS+= -DLOADER_DEBUG +.endif .if ${LOADER_DISK_SUPPORT} == "yes" CFLAGS+= -DLOADER_DISK_SUPPORT .endif @@ -28,6 +33,11 @@ CFLAGS+= -DLOADER_UFS_SUPPORT .if ${LOADER_CD9660_SUPPORT} == "yes" CFLAGS+= -DLOADER_CD9660_SUPPORT .endif +.if ${LOADER_ZFS_SUPPORT} == "yes" +CFLAGS+= -DLOADER_ZFS_SUPPORT +CFLAGS+= -I${.CURDIR}/../../zfs +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +.endif .if ${LOADER_GZIP_SUPPORT} == "yes" CFLAGS+= -DLOADER_GZIP_SUPPORT .endif @@ -47,7 +57,8 @@ CFLAGS+= -DLOADER_TFTP_SUPPORT .if ${MK_FORTH} != "no" # Enable BootForth BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/sparc64 +CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl +CFLAGS+= -I${.CURDIR}/../../ficl/sparc64 LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif @@ -75,8 +86,9 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} -lstand -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} +vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version + sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ + ${NEWVERSWHAT} loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ Modified: stable/9/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/9/sys/boot/sparc64/loader/main.c Sat May 26 08:44:50 2012 (r236075) +++ stable/9/sys/boot/sparc64/loader/main.c Sat May 26 08:54:26 2012 (r236076) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef LOADER_ZFS_SUPPORT +#include +#endif #include #include @@ -143,6 +146,11 @@ static vm_offset_t heapva; static phandle_t root; +#ifdef LOADER_ZFS_SUPPORT +static int zfs_dev_init(void); +#include "zfs.c" +#endif + /* * Machine dependent structures that the machine independent * loader part uses. @@ -154,6 +162,9 @@ struct devsw *devsw[] = { #ifdef LOADER_NET_SUPPORT &netdev, #endif +#ifdef LOADER_ZFS_SUPPORT + &zfs_dev, +#endif 0 }; struct arch_switch archsw; @@ -166,6 +177,7 @@ struct file_format *file_formats[] = { &sparc64_elf, 0 }; + struct fs_ops *file_system[] = { #ifdef LOADER_UFS_SUPPORT &ufs_fsops, @@ -173,6 +185,9 @@ struct fs_ops *file_system[] = { #ifdef LOADER_CD9660_SUPPORT &cd9660_fsops, #endif +#ifdef LOADER_ZFS_SUPPORT + &zfs_fsops, +#endif #ifdef LOADER_ZIP_SUPPORT &zipfs_fsops, #endif @@ -721,6 +736,82 @@ tlb_init_sun4u(void) panic("%s: can't allocate TLB store", __func__); } +#ifdef LOADER_ZFS_SUPPORT + +static int +zfs_dev_init(void) +{ + struct vtoc8 vtoc; + char devname[512]; + spa_t *spa; + vdev_t *vdev; + uint64_t guid; + int fd, part, unit; + + zfs_init(); + + guid = 0; + /* Get the GUID of the ZFS pool on the boot device. */ + fd = open(getenv("currdev"), O_RDONLY); + if (fd != -1) { + if (vdev_probe(vdev_read, (void *)(uintptr_t) fd, &spa) == 0) + guid = spa->spa_guid; + close(fd); + } + + /* Clean up the environment to let ZFS work. */ + while ((vdev = STAILQ_FIRST(&zfs_vdevs)) != NULL) { + STAILQ_REMOVE_HEAD(&zfs_vdevs, v_alllink); + free(vdev); + } + while ((spa = STAILQ_FIRST(&zfs_pools)) != NULL) { + STAILQ_REMOVE_HEAD(&zfs_pools, spa_link); + free(spa); + } + + for (unit = 0; unit < MAXBDDEV; unit++) { + /* Find freebsd-zfs slices in the VTOC. */ + sprintf(devname, "disk%d:", unit); + fd = open(devname, O_RDONLY); + if (fd == -1) + continue; + lseek(fd, 0, SEEK_SET); + if (read(fd, &vtoc, sizeof(vtoc)) != sizeof(vtoc)) { + close(fd); + continue; + } + close(fd); + + for (part = 0; part < 8; part++) { + if (part == 2 || vtoc.part[part].tag != + VTOC_TAG_FREEBSD_ZFS) + continue; + sprintf(devname, "disk%d:%c", unit, part + 'a'); + fd = open(devname, O_RDONLY); + if (fd == -1) + break; + + if (vdev_probe(vdev_read, (void*)(uintptr_t) fd, 0)) + close(fd); + } + } + + if (guid != 0) { + unit = zfs_guid_to_unit(guid); + if (unit >= 0) { + /* Update the environment for ZFS. */ + sprintf(devname, "zfs%d", unit); + env_setenv("currdev", EV_VOLATILE, devname, + ofw_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, devname, + env_noset, env_nounset); + } + } + return (0); +} + +#endif /* LOADER_ZFS_SUPPORT */ + int main(int (*openfirm)(void *)) { @@ -756,14 +847,6 @@ main(int (*openfirm)(void *)) mmu_ops->tlb_init(); /* - * Initialize devices. - */ - for (dp = devsw; *dp != 0; dp++) { - if ((*dp)->dv_init != 0) - (*dp)->dv_init(); - } - - /* * Set up the current device. */ OF_getprop(chosen, "bootpath", bootpath, sizeof(bootpath)); @@ -780,7 +863,8 @@ main(int (*openfirm)(void *)) * needs to be altered. */ if (bootpath[strlen(bootpath) - 2] == ':' && - bootpath[strlen(bootpath) - 1] == 'f') { + bootpath[strlen(bootpath) - 1] == 'f' && + strstr(bootpath, "cdrom")) { bootpath[strlen(bootpath) - 1] = 'a'; printf("Boot path set to %s\n", bootpath); } @@ -790,6 +874,13 @@ main(int (*openfirm)(void *)) env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset, env_nounset); + /* + * Initialize devices. + */ + for (dp = devsw; *dp != 0; dp++) + if ((*dp)->dv_init != 0) + (*dp)->dv_init(); + printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); Modified: stable/9/sys/boot/sparc64/zfsboot/Makefile ============================================================================== --- head/sys/boot/sparc64/zfsboot/Makefile Tue May 1 17:16:01 2012 (r234898) +++ stable/9/sys/boot/sparc64/zfsboot/Makefile Sat May 26 08:54:26 2012 (r236076) @@ -5,9 +5,5 @@ PROGNAME= zfsboot CFLAGS+= -DZFSBOOT FILES= zfsboot -CLEANFILES+= zfsboot - -zfsboot: boot1 - ln -s ${.ALLSRC} ${.TARGET} .include "${.CURDIR}/../boot1/Makefile" Modified: stable/9/sys/boot/zfs/zfs.c ============================================================================== --- stable/9/sys/boot/zfs/zfs.c Sat May 26 08:44:50 2012 (r236075) +++ stable/9/sys/boot/zfs/zfs.c Sat May 26 08:54:26 2012 (r236076) @@ -399,6 +399,7 @@ zfs_guid_to_unit(uint64_t guid) return (-1); } +#if defined(__amd64__) || defined(__i386__) static int zfs_dev_init(void) { @@ -441,6 +442,7 @@ zfs_dev_init(void) return (0); } +#endif /* * Print information about ZFS pools From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:54:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 972AB106568D; Sat, 26 May 2012 08:54:45 +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 7F7348FC0C; Sat, 26 May 2012 08:54: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 q4Q8sjvT063968; Sat, 26 May 2012 08:54:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8sjGS063959; Sat, 26 May 2012 08:54:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260854.q4Q8sjGS063959@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:54:45 +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: r236077 - in stable/8/sys/boot: ofw/libofw sparc64 sparc64/boot1 sparc64/loader sparc64/zfsboot sparc64/zfsloader zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:54:45 -0000 Author: marius Date: Sat May 26 08:54:44 2012 New Revision: 236077 URL: http://svn.freebsd.org/changeset/base/236077 Log: MFC: r234898, r235207 Add initial support for booting from ZFS on sparc64. At least on Sun Fire V100, the firmware is known to be broken and not allowing to simultaneously open disk devices, causing attempts to boot from a mirror or RAIDZ to cause a crash. This will be worked around later. The firmwares of newer sun4u models don't seem to exhibit this problem though. PR: 165025 Submitted by: Gavin Mu Added: stable/8/sys/boot/sparc64/zfsboot/ - copied from r234898, head/sys/boot/sparc64/zfsboot/ stable/8/sys/boot/sparc64/zfsloader/ - copied from r234898, head/sys/boot/sparc64/zfsloader/ Modified: stable/8/sys/boot/ofw/libofw/devicename.c stable/8/sys/boot/sparc64/Makefile stable/8/sys/boot/sparc64/boot1/Makefile stable/8/sys/boot/sparc64/boot1/boot1.c stable/8/sys/boot/sparc64/loader/Makefile stable/8/sys/boot/sparc64/loader/main.c stable/8/sys/boot/sparc64/zfsboot/Makefile stable/8/sys/boot/zfs/zfs.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) Modified: stable/8/sys/boot/ofw/libofw/devicename.c ============================================================================== --- stable/8/sys/boot/ofw/libofw/devicename.c Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/ofw/libofw/devicename.c Sat May 26 08:54:44 2012 (r236077) @@ -28,6 +28,8 @@ __FBSDID("$FreeBSD$"); #include + +#include "bootstrap.h" #include "libofw.h" static int ofw_parsedev(struct ofw_devdesc **, const char *, const char **); @@ -76,6 +78,7 @@ ofw_parsedev(struct ofw_devdesc **dev, c phandle_t handle; const char *p; const char *s; + char *ep; char name[256]; char type[64]; int len; @@ -87,9 +90,10 @@ ofw_parsedev(struct ofw_devdesc **dev, c len = s - devspec; bcopy(devspec, name, len); name[len] = '\0'; - if ((handle = OF_finddevice(name)) == -1) - break; - if (OF_getprop(handle, "device_type", type, sizeof(type)) == -1) + if ((handle = OF_finddevice(name)) == -1) { + bcopy(name, type, len); + type[len] = '\0'; + } else if (OF_getprop(handle, "device_type", type, sizeof(type)) == -1) continue; for (i = 0; (dv = devsw[i]) != NULL; i++) { if (strncmp(dv->dv_name, type, strlen(dv->dv_name)) == 0) @@ -109,6 +113,18 @@ found: strcpy(idev->d_path, name); idev->d_dev = dv; idev->d_type = dv->dv_type; + if (idev->d_type == DEVT_ZFS) { + idev->d_unit = 0; + p = name + strlen(dv->dv_name); + if (*p && (*p != ':')) { + idev->d_unit = strtol(p, &ep, 0); + if (ep == p) { + free(idev); + return (EUNIT); + } + } + } + if (dev == NULL) { free(idev); } else { Modified: stable/8/sys/boot/sparc64/Makefile ============================================================================== --- stable/8/sys/boot/sparc64/Makefile Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/sparc64/Makefile Sat May 26 08:54:44 2012 (r236077) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= boot1 loader +SUBDIR= boot1 loader zfsboot zfsloader .include Modified: stable/8/sys/boot/sparc64/boot1/Makefile ============================================================================== --- stable/8/sys/boot/sparc64/boot1/Makefile Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/sparc64/boot1/Makefile Sat May 26 08:54:44 2012 (r236077) @@ -3,22 +3,23 @@ PROG= boot1.elf INTERNALPROG= NO_MAN= -FILES= boot1 +FILES?= boot1 SRCS= _start.s boot1.c +CLEANFILES=${FILES} boot1.aout BOOTBLOCKBASE= 0x4000 -CFLAGS= -mcmodel=medlow -Os -I${.CURDIR}/../../common +CFLAGS+=-mcmodel=medlow -Os -I${.CURDIR}/../../common LDFLAGS=-N -Ttext ${BOOTBLOCKBASE} # Construct boot1. sunlabel expects it to contain zeroed-out space for the # label, and to be of the correct size. -boot1: boot1.aout +${FILES}: boot1.aout + @set -- `ls -l boot1.aout`; x=$$((7680-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 dd if=/dev/zero of=${.TARGET} bs=512 count=16 dd if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc -CLEANFILES= boot1.aout - boot1.aout: boot1.elf elf2aout -o ${.TARGET} ${.ALLSRC} Modified: stable/8/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/8/sys/boot/sparc64/boot1/boot1.c Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/sparc64/boot1/boot1.c Sat May 26 08:54:44 2012 (r236077) @@ -20,11 +20,13 @@ __FBSDID("$FreeBSD$"); #include #include + #include #include -#define _PATH_LOADER "/boot/loader" -#define _PATH_KERNEL "/boot/kernel/kernel" +#define _PATH_LOADER "/boot/loader" +#define _PATH_KERNEL "/boot/kernel/kernel" +#define READ_BUF_SIZE 8192 typedef int putc_func_t(char c, void *arg); typedef int32_t ofwh_t; @@ -45,17 +47,21 @@ static ofwh_t bootdev; static uint32_t fs_off; int main(int ac, char **av); - static void exit(int) __dead2; -static void load(const char *); -static int dskread(void *, u_int64_t, int); - static void usage(void); +#ifdef ZFSBOOT +static void loadzfs(void); +static int zbread(char *buf, off_t off, size_t bytes); +#else +static void load(const char *); +#endif + static void bcopy(const void *src, void *dst, size_t len); static void bzero(void *b, size_t len); static int mount(const char *device); +static int dskread(void *buf, u_int64_t lba, int nblk); static void panic(const char *fmt, ...) __dead2; static int printf(const char *fmt, ...); @@ -312,8 +318,6 @@ strcmp(const char *s1, const char *s2) return ((u_char)*s1 - (u_char)*s2); } -#include "ufsread.c" - int main(int ac, char **av) { @@ -335,14 +339,22 @@ main(int ac, char **av) } } - printf(" \n>> FreeBSD/sparc64 boot block\n" - " Boot path: %s\n" - " Boot loader: %s\n", bootpath, path); +#ifdef ZFSBOOT + printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", + bootpath); +#else + printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" + " Boot loader: %s\n", "", bootpath, path); +#endif if (mount(bootpath) == -1) panic("mount"); +#ifdef ZFSBOOT + loadzfs(); +#else load(path); +#endif return (1); } @@ -361,24 +373,86 @@ exit(int code) ofw_exit(); } -static struct dmadat __dmadat; +#ifdef ZFSBOOT + +#define VDEV_BOOT_OFFSET (2 * 256 * 1024) +static char zbuf[READ_BUF_SIZE]; static int -mount(const char *device) +zbread(char *buf, off_t off, size_t bytes) { + size_t len; + off_t poff; + off_t soff; + char *p; + unsigned int nb; + unsigned int lb; - dmadat = &__dmadat; - if ((bootdev = ofw_open(device)) == -1) { - printf("mount: can't open device\n"); - return (-1); + p = buf; + soff = VDEV_BOOT_OFFSET + off; + lb = (soff + bytes + DEV_BSIZE - 1) / DEV_BSIZE; + poff = soff; + while (poff < soff + bytes) { + nb = lb - poff / DEV_BSIZE; + if (nb > READ_BUF_SIZE / DEV_BSIZE) + nb = READ_BUF_SIZE / DEV_BSIZE; + if (dskread(zbuf, poff / DEV_BSIZE, nb)) + break; + if ((poff / DEV_BSIZE + nb) * DEV_BSIZE > soff + bytes) + len = soff + bytes - poff; + else + len = (poff / DEV_BSIZE + nb) * DEV_BSIZE - poff; + memcpy(p, zbuf + poff % DEV_BSIZE, len); + p += len; + poff += len; } - if (fsread(0, NULL, 0)) { - printf("mount: can't read superblock\n"); - return (-1); + return (poff - soff); +} + +static void +loadzfs(void) +{ + Elf64_Ehdr eh; + Elf64_Phdr ph; + caddr_t p; + ino_t ino; + int i; + + if (zbread((char *)&eh, 0, sizeof(eh)) != sizeof(eh)) { + printf("Can't read elf header\n"); + return; } - return (0); + if (!IS_ELF(eh)) { + printf("Not an ELF file\n"); + return; + } + for (i = 0; i < eh.e_phnum; i++) { + fs_off = eh.e_phoff + i * eh.e_phentsize; + if (zbread((char *)&ph, fs_off, sizeof(ph)) != sizeof(ph)) { + printf("Can't read program header %d\n", i); + return; + } + if (ph.p_type != PT_LOAD) + continue; + fs_off = ph.p_offset; + p = (caddr_t)ph.p_vaddr; + if (zbread(p, fs_off, ph.p_filesz) != ph.p_filesz) { + printf("Can't read content of section %d\n", i); + return; + } + if (ph.p_filesz != ph.p_memsz) + bzero(p + ph.p_filesz, ph.p_memsz - ph.p_filesz); + } + ofw_close(bootdev); + (*(void (*)(int, int, int, int, ofwfp_t))eh.e_entry)(0, 0, 0, 0, ofw); } +#else + +#include "ufsread.c" + +static struct dmadat __dmadat; + static void load(const char *fname) { @@ -421,6 +495,26 @@ load(const char *fname) (*(void (*)(int, int, int, int, ofwfp_t))eh.e_entry)(0, 0, 0, 0, ofw); } +#endif /* ZFSBOOT */ + +static int +mount(const char *device) +{ + + if ((bootdev = ofw_open(device)) == -1) { + printf("mount: can't open device\n"); + return (-1); + } +#ifndef ZFSBOOT + dmadat = &__dmadat; + if (fsread(0, NULL, 0)) { + printf("mount: can't read superblock\n"); + return (-1); + } +#endif + return (0); +} + static int dskread(void *buf, u_int64_t lba, int nblk) { Modified: stable/8/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/8/sys/boot/sparc64/loader/Makefile Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/sparc64/loader/Makefile Sat May 26 08:54:44 2012 (r236077) @@ -3,8 +3,8 @@ .include MK_SSP= no -PROG= loader -NEWVERSWHAT= "bootstrap loader" sparc64 +PROG?= loader +NEWVERSWHAT?= "bootstrap loader" sparc64 INSTALLFLAGS= -b # Architecture-specific loader code @@ -13,12 +13,17 @@ SRCS= locore.S main.c metadata.c vers.c LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes +LOADER_ZFS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no +LOADER_DEBUG?= no +.if ${LOADER_DEBUG} == "yes" +CFLAGS+= -DLOADER_DEBUG +.endif .if ${LOADER_DISK_SUPPORT} == "yes" CFLAGS+= -DLOADER_DISK_SUPPORT .endif @@ -28,6 +33,11 @@ CFLAGS+= -DLOADER_UFS_SUPPORT .if ${LOADER_CD9660_SUPPORT} == "yes" CFLAGS+= -DLOADER_CD9660_SUPPORT .endif +.if ${LOADER_ZFS_SUPPORT} == "yes" +CFLAGS+= -DLOADER_ZFS_SUPPORT +CFLAGS+= -I${.CURDIR}/../../zfs +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +.endif .if ${LOADER_GZIP_SUPPORT} == "yes" CFLAGS+= -DLOADER_GZIP_SUPPORT .endif @@ -47,7 +57,8 @@ CFLAGS+= -DLOADER_TFTP_SUPPORT .if ${MK_FORTH} != "no" # Enable BootForth BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/sparc64 +CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl +CFLAGS+= -I${.CURDIR}/../../ficl/sparc64 LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif @@ -75,8 +86,9 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} -lstand -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} +vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version + sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ + ${NEWVERSWHAT} loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/sparc64/loader/main.c Sat May 26 08:54:44 2012 (r236077) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef LOADER_ZFS_SUPPORT +#include +#endif #include #include @@ -157,6 +160,11 @@ static vm_offset_t heapva; static phandle_t root; +#ifdef LOADER_ZFS_SUPPORT +static int zfs_dev_init(void); +#include "zfs.c" +#endif + /* * Machine dependent structures that the machine independent * loader part uses. @@ -168,6 +176,9 @@ struct devsw *devsw[] = { #ifdef LOADER_NET_SUPPORT &netdev, #endif +#ifdef LOADER_ZFS_SUPPORT + &zfs_dev, +#endif 0 }; struct arch_switch archsw; @@ -180,6 +191,7 @@ struct file_format *file_formats[] = { &sparc64_elf, 0 }; + struct fs_ops *file_system[] = { #ifdef LOADER_UFS_SUPPORT &ufs_fsops, @@ -187,6 +199,9 @@ struct fs_ops *file_system[] = { #ifdef LOADER_CD9660_SUPPORT &cd9660_fsops, #endif +#ifdef LOADER_ZFS_SUPPORT + &zfs_fsops, +#endif #ifdef LOADER_ZIP_SUPPORT &zipfs_fsops, #endif @@ -828,6 +843,82 @@ tlb_init_sun4v(void) memset(tlb_store, 0xFF, SUN4V_TLB_SLOT_MAX * sizeof(*tlb_store)); } +#ifdef LOADER_ZFS_SUPPORT + +static int +zfs_dev_init(void) +{ + struct vtoc8 vtoc; + char devname[512]; + spa_t *spa; + vdev_t *vdev; + uint64_t guid; + int fd, part, unit; + + zfs_init(); + + guid = 0; + /* Get the GUID of the ZFS pool on the boot device. */ + fd = open(getenv("currdev"), O_RDONLY); + if (fd != -1) { + if (vdev_probe(vdev_read, (void *)(uintptr_t) fd, &spa) == 0) + guid = spa->spa_guid; + close(fd); + } + + /* Clean up the environment to let ZFS work. */ + while ((vdev = STAILQ_FIRST(&zfs_vdevs)) != NULL) { + STAILQ_REMOVE_HEAD(&zfs_vdevs, v_alllink); + free(vdev); + } + while ((spa = STAILQ_FIRST(&zfs_pools)) != NULL) { + STAILQ_REMOVE_HEAD(&zfs_pools, spa_link); + free(spa); + } + + for (unit = 0; unit < MAXBDDEV; unit++) { + /* Find freebsd-zfs slices in the VTOC. */ + sprintf(devname, "disk%d:", unit); + fd = open(devname, O_RDONLY); + if (fd == -1) + continue; + lseek(fd, 0, SEEK_SET); + if (read(fd, &vtoc, sizeof(vtoc)) != sizeof(vtoc)) { + close(fd); + continue; + } + close(fd); + + for (part = 0; part < 8; part++) { + if (part == 2 || vtoc.part[part].tag != + VTOC_TAG_FREEBSD_ZFS) + continue; + sprintf(devname, "disk%d:%c", unit, part + 'a'); + fd = open(devname, O_RDONLY); + if (fd == -1) + break; + + if (vdev_probe(vdev_read, (void*)(uintptr_t) fd, 0)) + close(fd); + } + } + + if (guid != 0) { + unit = zfs_guid_to_unit(guid); + if (unit >= 0) { + /* Update the environment for ZFS. */ + sprintf(devname, "zfs%d", unit); + env_setenv("currdev", EV_VOLATILE, devname, + ofw_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, devname, + env_noset, env_nounset); + } + } + return (0); +} + +#endif /* LOADER_ZFS_SUPPORT */ + int main(int (*openfirm)(void *)) { @@ -871,14 +962,6 @@ main(int (*openfirm)(void *)) mmu_ops->tlb_init(); /* - * Initialize devices. - */ - for (dp = devsw; *dp != 0; dp++) { - if ((*dp)->dv_init != 0) - (*dp)->dv_init(); - } - - /* * Set up the current device. */ OF_getprop(chosen, "bootpath", bootpath, sizeof(bootpath)); @@ -895,7 +978,8 @@ main(int (*openfirm)(void *)) * needs to be altered. */ if (bootpath[strlen(bootpath) - 2] == ':' && - bootpath[strlen(bootpath) - 1] == 'f') { + bootpath[strlen(bootpath) - 1] == 'f' && + strstr(bootpath, "cdrom")) { bootpath[strlen(bootpath) - 1] = 'a'; printf("Boot path set to %s\n", bootpath); } @@ -905,6 +989,13 @@ main(int (*openfirm)(void *)) env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset, env_nounset); + /* + * Initialize devices. + */ + for (dp = devsw; *dp != 0; dp++) + if ((*dp)->dv_init != 0) + (*dp)->dv_init(); + printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); Modified: stable/8/sys/boot/sparc64/zfsboot/Makefile ============================================================================== --- head/sys/boot/sparc64/zfsboot/Makefile Tue May 1 17:16:01 2012 (r234898) +++ stable/8/sys/boot/sparc64/zfsboot/Makefile Sat May 26 08:54:44 2012 (r236077) @@ -5,9 +5,5 @@ PROGNAME= zfsboot CFLAGS+= -DZFSBOOT FILES= zfsboot -CLEANFILES+= zfsboot - -zfsboot: boot1 - ln -s ${.ALLSRC} ${.TARGET} .include "${.CURDIR}/../boot1/Makefile" Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Sat May 26 08:54:26 2012 (r236076) +++ stable/8/sys/boot/zfs/zfs.c Sat May 26 08:54:44 2012 (r236077) @@ -399,6 +399,7 @@ zfs_guid_to_unit(uint64_t guid) return (-1); } +#if defined(__amd64__) || defined(__i386__) static int zfs_dev_init(void) { @@ -441,6 +442,7 @@ zfs_dev_init(void) return (0); } +#endif /* * Print information about ZFS pools From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:58:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21AFC106564A; Sat, 26 May 2012 08:58:28 +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 0ABC28FC0C; Sat, 26 May 2012 08:58: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 q4Q8wReb064191; Sat, 26 May 2012 08:58:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8wRNS064187; Sat, 26 May 2012 08:58:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260858.q4Q8wRNS064187@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:58:27 +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: r236078 - in stable/9/sys: conf dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:58:28 -0000 Author: marius Date: Sat May 26 08:58:27 2012 New Revision: 236078 URL: http://svn.freebsd.org/changeset/base/236078 Log: MFC: r234248 Add a driver for the NXP (Philips) PCF8563 RTC. Obtained from: NetBSD (pcf8563reg.h) Added: stable/9/sys/dev/iicbus/pcf8563.c - copied unchanged from r234248, head/sys/dev/iicbus/pcf8563.c stable/9/sys/dev/iicbus/pcf8563reg.h - copied unchanged from r234248, head/sys/dev/iicbus/pcf8563reg.h Modified: stable/9/sys/conf/files 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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Sat May 26 08:54:44 2012 (r236077) +++ stable/9/sys/conf/files Sat May 26 08:58:27 2012 (r236078) @@ -1146,6 +1146,7 @@ dev/iicbus/iicbus_if.m optional iicbus dev/iicbus/iiconf.c optional iicbus dev/iicbus/iicsmb.c optional iicsmb \ dependency "iicbus_if.h" +dev/iicbus/pcf8563.c optional pcf8563 dev/iir/iir.c optional iir dev/iir/iir_ctrl.c optional iir dev/iir/iir_pci.c optional iir pci Copied: stable/9/sys/dev/iicbus/pcf8563.c (from r234248, head/sys/dev/iicbus/pcf8563.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/iicbus/pcf8563.c Sat May 26 08:58:27 2012 (r236078, copy of r234248, head/sys/dev/iicbus/pcf8563.c) @@ -0,0 +1,202 @@ +/*- + * Copyright (c) 2012 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for NXP PCF8563 real-time clock/calendar + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "clock_if.h" +#include "iicbus_if.h" + +#define PCF8563_NCLOCKREGS (PCF8563_R_YEAR - PCF8563_R_CS1 + 1) + +struct pcf8563_softc { + uint32_t sc_flags; +#define PCF8563_CPOL (1 << 0) /* PCF8563_R_MONTH_C means 19xx */ + uint16_t sc_addr; /* PCF8563 slave address */ + uint16_t sc_year0; /* TOD clock year 0 */ +}; + +static device_attach_t pcf8563_attach; +static device_probe_t pcf8563_probe; +static clock_gettime_t pcf8563_gettime; +static clock_settime_t pcf8563_settime; + +static int +pcf8563_probe(device_t dev) +{ + + device_set_desc(dev, "NXP PCF8563 RTC"); + return (BUS_PROBE_NOWILDCARD); +} + +static int +pcf8563_attach(device_t dev) +{ + uint8_t reg = PCF8563_R_SECOND, val; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, sizeof(reg), ® }, + { 0, IIC_M_RD, sizeof(val), &val } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->sc_addr = iicbus_get_addr(dev); + if (sc->sc_addr == 0) + sc->sc_addr = PCF8563_ADDR; + + msgs[0].slave = msgs[1].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) { + device_printf(dev, "%s: cannot read RTC\n", __func__); + return (error); + } + if ((val & PCF8563_R_SECOND_VL) != 0) { + device_printf(dev, "%s: battery low\n", __func__); + return (ENXIO); + } + + sc->sc_year0 = 1900; + clock_register(dev, 1000000); /* 1 second resolution */ + return (0); +} + +static int +pcf8563_gettime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + uint8_t reg = PCF8563_R_SECOND, val[PCF8563_NCLOCKREGS]; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, sizeof(reg), ® }, + { 0, IIC_M_RD, PCF8563_NCLOCKREGS, &val[PCF8563_R_SECOND] } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + msgs[0].slave = msgs[1].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) { + device_printf(dev, "%s: cannot read RTC\n", __func__); + return (error); + } + + ct.nsec = 0; + ct.sec = FROMBCD(val[PCF8563_R_SECOND] & PCF8563_M_SECOND); + ct.min = FROMBCD(val[PCF8563_R_MINUTE] & PCF8563_M_MINUTE); + ct.hour = FROMBCD(val[PCF8563_R_HOUR] & PCF8563_M_HOUR); + ct.day = FROMBCD(val[PCF8563_R_DAY] & PCF8563_M_DAY); + ct.dow = val[PCF8563_R_WEEKDAY] & PCF8563_M_WEEKDAY; + ct.mon = FROMBCD(val[PCF8563_R_MONTH] & PCF8563_M_MONTH); + ct.year = FROMBCD(val[PCF8563_R_YEAR] & PCF8563_M_YEAR); + ct.year += sc->sc_year0; + if (ct.year < POSIX_BASE_YEAR) + ct.year += 100; /* assume [1970, 2069] */ + if ((val[PCF8563_R_MONTH] & PCF8563_R_MONTH_C) != 0) { + if (ct.year >= 100 + sc->sc_year0) + sc->sc_flags |= PCF8563_CPOL; + } else if (ct.year < 100 + sc->sc_year0) + sc->sc_flags |= PCF8563_CPOL; + return (clock_ct_to_ts(&ct, ts)); +} + +static int +pcf8563_settime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + uint8_t val[PCF8563_NCLOCKREGS]; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, PCF8563_NCLOCKREGS - 1, &val[PCF8563_R_CS2] } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + val[PCF8563_R_CS2] = PCF8563_R_SECOND; /* abuse */ + /* Accuracy is only one second. */ + if (ts->tv_nsec >= 500000000) + ts->tv_sec++; + ts->tv_nsec = 0; + clock_ts_to_ct(ts, &ct); + val[PCF8563_R_SECOND] = TOBCD(ct.sec); + val[PCF8563_R_MINUTE] = TOBCD(ct.min); + val[PCF8563_R_HOUR] = TOBCD(ct.hour); + val[PCF8563_R_DAY] = TOBCD(ct.day); + val[PCF8563_R_WEEKDAY] = ct.dow; + val[PCF8563_R_MONTH] = TOBCD(ct.mon); + val[PCF8563_R_YEAR] = TOBCD(ct.year % 100); + if ((sc->sc_flags & PCF8563_CPOL) != 0) { + if (ct.year >= 100 + sc->sc_year0) + val[PCF8563_R_MONTH] |= PCF8563_R_MONTH_C; + } else if (ct.year < 100 + sc->sc_year0) + val[PCF8563_R_MONTH] |= PCF8563_R_MONTH_C; + + msgs[0].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) + device_printf(dev, "%s: cannot write RTC\n", __func__); + return (error); +} + +static device_method_t pcf8563_methods[] = { + DEVMETHOD(device_probe, pcf8563_probe), + DEVMETHOD(device_attach, pcf8563_attach), + + DEVMETHOD(clock_gettime, pcf8563_gettime), + DEVMETHOD(clock_settime, pcf8563_settime), + + DEVMETHOD_END +}; + +static driver_t pcf8563_driver = { + "pcf8563_rtc", + pcf8563_methods, + sizeof(struct pcf8563_softc), +}; + +static devclass_t pcf8563_devclass; + +DRIVER_MODULE(pcf8563, iicbus, pcf8563_driver, pcf8563_devclass, NULL, NULL); +MODULE_VERSION(pcf8563, 1); +MODULE_DEPEND(pcf8563, iicbus, 1, 1, 1); Copied: stable/9/sys/dev/iicbus/pcf8563reg.h (from r234248, head/sys/dev/iicbus/pcf8563reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/iicbus/pcf8563reg.h Sat May 26 08:58:27 2012 (r236078, copy of r234248, head/sys/dev/iicbus/pcf8563reg.h) @@ -0,0 +1,58 @@ +/* $NetBSD: pcf8563reg.h,v 1.1 2011/01/21 19:11:47 jakllsch Exp $ */ + +/*- + * Jonathan Kollasch, 2011 + * + * This file is in the public domain. + * + * $FreeBSD$ + */ + +/* + * NXP (Philips) PCF8563 RTC registers + */ + +/* We only have clock mode registers here. */ + +#ifndef _PCF8563REG_H_ +#define _PCF8563REG_H_ + +/* + * PCF8563 RTC I2C address: + * + * 101 0001 + */ +#define PCF8563_ADDR 0xa2 + +#define PCF8563_R_CS1 0x00 +#define PCF8563_R_CS2 0x01 +#define PCF8563_R_SECOND 0x02 +#define PCF8563_R_MINUTE 0x03 +#define PCF8563_R_HOUR 0x04 +#define PCF8563_R_DAY 0x05 +#define PCF8563_R_WEEKDAY 0x06 +#define PCF8563_R_MONTH 0x07 +#define PCF8563_R_YEAR 0x08 +#define PCF8563_R_MINUTE_ALARM 0x09 +#define PCF8563_R_HOUR_ALARM 0x0a +#define PCF8563_R_DAY_ALARM 0x0b +#define PCF8563_R_WEEKDAY_ALARM 0x0c +#define PCF8563_R_CLKOUT_CNTRL 0x0d +#define PCF8563_R_TIMER_CNTRL 0x0e +#define PCF8563_R_TIMER 0x0f + +#define PCF8563_R_SECOND_VL 0x80 +#define PCF8563_R_MONTH_C 0x80 + +#define PCF8563_NREGS 0x10 + +#define PCF8563_M_SECOND 0x7f +#define PCF8563_M_MINUTE 0x7f +#define PCF8563_M_HOUR 0x3f +#define PCF8563_M_DAY 0x3f +#define PCF8563_M_WEEKDAY 0x07 +#define PCF8563_M_MONTH 0x1f +#define PCF8563_M_CENTURY 0x80 +#define PCF8563_M_YEAR 0xff + +#endif /* _PCF8563REG_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat May 26 08:58:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC7881065674; Sat, 26 May 2012 08:58:29 +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 B5A8A8FC08; Sat, 26 May 2012 08:58: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 q4Q8wT2a064226; Sat, 26 May 2012 08:58:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8wTlx064222; Sat, 26 May 2012 08:58:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260858.q4Q8wTlx064222@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:58: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: r236079 - in stable/8/sys: conf dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:58:29 -0000 Author: marius Date: Sat May 26 08:58:29 2012 New Revision: 236079 URL: http://svn.freebsd.org/changeset/base/236079 Log: MFC: r234248 Add a driver for the NXP (Philips) PCF8563 RTC. Obtained from: NetBSD (pcf8563reg.h) Added: stable/8/sys/dev/iicbus/pcf8563.c - copied unchanged from r234248, head/sys/dev/iicbus/pcf8563.c stable/8/sys/dev/iicbus/pcf8563reg.h - copied unchanged from r234248, head/sys/dev/iicbus/pcf8563reg.h Modified: stable/8/sys/conf/files 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) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Sat May 26 08:58:27 2012 (r236078) +++ stable/8/sys/conf/files Sat May 26 08:58:29 2012 (r236079) @@ -1007,6 +1007,7 @@ dev/iicbus/iicbus_if.m optional iicbus dev/iicbus/iiconf.c optional iicbus dev/iicbus/iicsmb.c optional iicsmb \ dependency "iicbus_if.h" +dev/iicbus/pcf8563.c optional pcf8563 dev/iir/iir.c optional iir dev/iir/iir_ctrl.c optional iir dev/iir/iir_pci.c optional iir pci Copied: stable/8/sys/dev/iicbus/pcf8563.c (from r234248, head/sys/dev/iicbus/pcf8563.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/iicbus/pcf8563.c Sat May 26 08:58:29 2012 (r236079, copy of r234248, head/sys/dev/iicbus/pcf8563.c) @@ -0,0 +1,202 @@ +/*- + * Copyright (c) 2012 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for NXP PCF8563 real-time clock/calendar + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "clock_if.h" +#include "iicbus_if.h" + +#define PCF8563_NCLOCKREGS (PCF8563_R_YEAR - PCF8563_R_CS1 + 1) + +struct pcf8563_softc { + uint32_t sc_flags; +#define PCF8563_CPOL (1 << 0) /* PCF8563_R_MONTH_C means 19xx */ + uint16_t sc_addr; /* PCF8563 slave address */ + uint16_t sc_year0; /* TOD clock year 0 */ +}; + +static device_attach_t pcf8563_attach; +static device_probe_t pcf8563_probe; +static clock_gettime_t pcf8563_gettime; +static clock_settime_t pcf8563_settime; + +static int +pcf8563_probe(device_t dev) +{ + + device_set_desc(dev, "NXP PCF8563 RTC"); + return (BUS_PROBE_NOWILDCARD); +} + +static int +pcf8563_attach(device_t dev) +{ + uint8_t reg = PCF8563_R_SECOND, val; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, sizeof(reg), ® }, + { 0, IIC_M_RD, sizeof(val), &val } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->sc_addr = iicbus_get_addr(dev); + if (sc->sc_addr == 0) + sc->sc_addr = PCF8563_ADDR; + + msgs[0].slave = msgs[1].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) { + device_printf(dev, "%s: cannot read RTC\n", __func__); + return (error); + } + if ((val & PCF8563_R_SECOND_VL) != 0) { + device_printf(dev, "%s: battery low\n", __func__); + return (ENXIO); + } + + sc->sc_year0 = 1900; + clock_register(dev, 1000000); /* 1 second resolution */ + return (0); +} + +static int +pcf8563_gettime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + uint8_t reg = PCF8563_R_SECOND, val[PCF8563_NCLOCKREGS]; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, sizeof(reg), ® }, + { 0, IIC_M_RD, PCF8563_NCLOCKREGS, &val[PCF8563_R_SECOND] } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + msgs[0].slave = msgs[1].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) { + device_printf(dev, "%s: cannot read RTC\n", __func__); + return (error); + } + + ct.nsec = 0; + ct.sec = FROMBCD(val[PCF8563_R_SECOND] & PCF8563_M_SECOND); + ct.min = FROMBCD(val[PCF8563_R_MINUTE] & PCF8563_M_MINUTE); + ct.hour = FROMBCD(val[PCF8563_R_HOUR] & PCF8563_M_HOUR); + ct.day = FROMBCD(val[PCF8563_R_DAY] & PCF8563_M_DAY); + ct.dow = val[PCF8563_R_WEEKDAY] & PCF8563_M_WEEKDAY; + ct.mon = FROMBCD(val[PCF8563_R_MONTH] & PCF8563_M_MONTH); + ct.year = FROMBCD(val[PCF8563_R_YEAR] & PCF8563_M_YEAR); + ct.year += sc->sc_year0; + if (ct.year < POSIX_BASE_YEAR) + ct.year += 100; /* assume [1970, 2069] */ + if ((val[PCF8563_R_MONTH] & PCF8563_R_MONTH_C) != 0) { + if (ct.year >= 100 + sc->sc_year0) + sc->sc_flags |= PCF8563_CPOL; + } else if (ct.year < 100 + sc->sc_year0) + sc->sc_flags |= PCF8563_CPOL; + return (clock_ct_to_ts(&ct, ts)); +} + +static int +pcf8563_settime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + uint8_t val[PCF8563_NCLOCKREGS]; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, PCF8563_NCLOCKREGS - 1, &val[PCF8563_R_CS2] } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + val[PCF8563_R_CS2] = PCF8563_R_SECOND; /* abuse */ + /* Accuracy is only one second. */ + if (ts->tv_nsec >= 500000000) + ts->tv_sec++; + ts->tv_nsec = 0; + clock_ts_to_ct(ts, &ct); + val[PCF8563_R_SECOND] = TOBCD(ct.sec); + val[PCF8563_R_MINUTE] = TOBCD(ct.min); + val[PCF8563_R_HOUR] = TOBCD(ct.hour); + val[PCF8563_R_DAY] = TOBCD(ct.day); + val[PCF8563_R_WEEKDAY] = ct.dow; + val[PCF8563_R_MONTH] = TOBCD(ct.mon); + val[PCF8563_R_YEAR] = TOBCD(ct.year % 100); + if ((sc->sc_flags & PCF8563_CPOL) != 0) { + if (ct.year >= 100 + sc->sc_year0) + val[PCF8563_R_MONTH] |= PCF8563_R_MONTH_C; + } else if (ct.year < 100 + sc->sc_year0) + val[PCF8563_R_MONTH] |= PCF8563_R_MONTH_C; + + msgs[0].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) + device_printf(dev, "%s: cannot write RTC\n", __func__); + return (error); +} + +static device_method_t pcf8563_methods[] = { + DEVMETHOD(device_probe, pcf8563_probe), + DEVMETHOD(device_attach, pcf8563_attach), + + DEVMETHOD(clock_gettime, pcf8563_gettime), + DEVMETHOD(clock_settime, pcf8563_settime), + + DEVMETHOD_END +}; + +static driver_t pcf8563_driver = { + "pcf8563_rtc", + pcf8563_methods, + sizeof(struct pcf8563_softc), +}; + +static devclass_t pcf8563_devclass; + +DRIVER_MODULE(pcf8563, iicbus, pcf8563_driver, pcf8563_devclass, NULL, NULL); +MODULE_VERSION(pcf8563, 1); +MODULE_DEPEND(pcf8563, iicbus, 1, 1, 1); Copied: stable/8/sys/dev/iicbus/pcf8563reg.h (from r234248, head/sys/dev/iicbus/pcf8563reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/iicbus/pcf8563reg.h Sat May 26 08:58:29 2012 (r236079, copy of r234248, head/sys/dev/iicbus/pcf8563reg.h) @@ -0,0 +1,58 @@ +/* $NetBSD: pcf8563reg.h,v 1.1 2011/01/21 19:11:47 jakllsch Exp $ */ + +/*- + * Jonathan Kollasch, 2011 + * + * This file is in the public domain. + * + * $FreeBSD$ + */ + +/* + * NXP (Philips) PCF8563 RTC registers + */ + +/* We only have clock mode registers here. */ + +#ifndef _PCF8563REG_H_ +#define _PCF8563REG_H_ + +/* + * PCF8563 RTC I2C address: + * + * 101 0001 + */ +#define PCF8563_ADDR 0xa2 + +#define PCF8563_R_CS1 0x00 +#define PCF8563_R_CS2 0x01 +#define PCF8563_R_SECOND 0x02 +#define PCF8563_R_MINUTE 0x03 +#define PCF8563_R_HOUR 0x04 +#define PCF8563_R_DAY 0x05 +#define PCF8563_R_WEEKDAY 0x06 +#define PCF8563_R_MONTH 0x07 +#define PCF8563_R_YEAR 0x08 +#define PCF8563_R_MINUTE_ALARM 0x09 +#define PCF8563_R_HOUR_ALARM 0x0a +#define PCF8563_R_DAY_ALARM 0x0b +#define PCF8563_R_WEEKDAY_ALARM 0x0c +#define PCF8563_R_CLKOUT_CNTRL 0x0d +#define PCF8563_R_TIMER_CNTRL 0x0e +#define PCF8563_R_TIMER 0x0f + +#define PCF8563_R_SECOND_VL 0x80 +#define PCF8563_R_MONTH_C 0x80 + +#define PCF8563_NREGS 0x10 + +#define PCF8563_M_SECOND 0x7f +#define PCF8563_M_MINUTE 0x7f +#define PCF8563_M_HOUR 0x3f +#define PCF8563_M_DAY 0x3f +#define PCF8563_M_WEEKDAY 0x07 +#define PCF8563_M_MONTH 0x1f +#define PCF8563_M_CENTURY 0x80 +#define PCF8563_M_YEAR 0xff + +#endif /* _PCF8563REG_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat May 26 09:03:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC3451065686; Sat, 26 May 2012 09:03:14 +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 B4FD98FC18; Sat, 26 May 2012 09:03: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 q4Q93Eom064495; Sat, 26 May 2012 09:03:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q93Enb064481; Sat, 26 May 2012 09:03:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260903.q4Q93Enb064481@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:03: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: r236080 - stable/9/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:03:14 -0000 Author: marius Date: Sat May 26 09:03:14 2012 New Revision: 236080 URL: http://svn.freebsd.org/changeset/base/236080 Log: MFC: r234281 - Try to bring these files closer to style(9). - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Modified: stable/9/sys/arm/at91/at91_pio.c stable/9/sys/arm/at91/at91_piovar.h stable/9/sys/arm/at91/at91_pit.c stable/9/sys/arm/at91/at91_pmc.c stable/9/sys/arm/at91/at91_rst.c stable/9/sys/arm/at91/at91_twi.c stable/9/sys/arm/at91/at91_twireg.h stable/9/sys/arm/at91/at91_wdt.c stable/9/sys/arm/at91/at91reg.h stable/9/sys/arm/at91/at91sam9260.c stable/9/sys/arm/at91/at91var.h stable/9/sys/arm/at91/if_ate.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/arm/at91/at91_pio.c ============================================================================== --- stable/9/sys/arm/at91/at91_pio.c Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/at91_pio.c Sat May 26 09:03:14 2012 (r236080) @@ -52,30 +52,32 @@ struct at91_pio_softc struct mtx sc_mtx; /* basically a perimeter lock */ struct cdev *cdev; int flags; -#define OPENED 1 +#define OPENED 1 }; static inline uint32_t RD4(struct at91_pio_softc *sc, bus_size_t off) { + return (bus_read_4(sc->mem_res, off)); } static inline void WR4(struct at91_pio_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } -#define AT91_PIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) +#define AT91_PIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) #define AT91_PIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) -#define AT91_PIO_LOCK_INIT(_sc) \ +#define AT91_PIO_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "pio", MTX_SPIN) -#define AT91_PIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define AT91_PIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define AT91_PIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); -#define CDEV2SOFTC(dev) ((dev)->si_drv1) +#define AT91_PIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define AT91_PIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define AT91_PIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define CDEV2SOFTC(dev) ((dev)->si_drv1) static devclass_t at91_pio_devclass; @@ -132,9 +134,10 @@ at91_pio_probe(device_t dev) static int at91_pio_attach(device_t dev) { - struct at91_pio_softc *sc = device_get_softc(dev); + struct at91_pio_softc *sc; int err; + sc = device_get_softc(dev); sc->dev = dev; err = at91_pio_activate(dev); if (err) @@ -146,7 +149,7 @@ at91_pio_attach(device_t dev) AT91_PIO_LOCK_INIT(sc); /* - * Activate the interrupt, but disable all interrupts in the hardware + * Activate the interrupt, but disable all interrupts in the hardware. */ WR4(sc, PIO_IDR, 0xffffffff); err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, @@ -171,6 +174,7 @@ out:; static int at91_pio_detach(device_t dev) { + return (EBUSY); /* XXX */ } @@ -215,7 +219,6 @@ at91_pio_deactivate(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq_res), sc->irq_res); sc->irq_res = 0; - return; } static int @@ -225,7 +228,7 @@ at91_pio_intr(void *xsc) #if 0 uint32_t status; - /* Reading the status also clears the interrupt */ + /* Reading the status also clears the interrupt. */ status = RD4(sc, PIO_SR); if (status == 0) return; @@ -236,7 +239,7 @@ at91_pio_intr(void *xsc) return (FILTER_HANDLED); } -static int +static int at91_pio_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { struct at91_pio_softc *sc; @@ -246,11 +249,11 @@ at91_pio_open(struct cdev *dev, int ofla if (!(sc->flags & OPENED)) { sc->flags |= OPENED; #if 0 - // Enable interrupts + /* Enable interrupts. */ #endif } AT91_PIO_UNLOCK(sc); - return (0); + return (0); } static int @@ -262,7 +265,7 @@ at91_pio_close(struct cdev *dev, int ffl AT91_PIO_LOCK(sc); sc->flags &= ~OPENED; #if 0 - // Disable interrupts + /* Disable interrupts. */ #endif AT91_PIO_UNLOCK(sc); return (0); @@ -272,6 +275,7 @@ static int at91_pio_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { + return (ENXIO); } @@ -280,6 +284,7 @@ at91_pio_ioctl(struct cdev *dev, u_long * don't use bus_space, as that isn't yet available when we need to use * them. */ + void at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask, int use_pullup) { @@ -369,11 +374,10 @@ at91_pio_gpio_set_deglitch(uint32_t pio, PIO[PIO_IFER / 4] = data_mask; else PIO[PIO_IFDR / 4] = data_mask; - return; } void -at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, +at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, int enable_interrupt) { uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); @@ -382,14 +386,14 @@ at91_pio_gpio_set_interrupt(uint32_t pio PIO[PIO_IER / 4] = data_mask; else PIO[PIO_IDR / 4] = data_mask; - return; } uint32_t at91_pio_gpio_clear_interrupt(uint32_t pio) { uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); - /* reading this register will clear the interrupts */ + + /* Reading this register will clear the interrupts. */ return (PIO[PIO_ISR / 4]); } @@ -399,7 +403,7 @@ static device_method_t at91_pio_methods[ DEVMETHOD(device_attach, at91_pio_attach), DEVMETHOD(device_detach, at91_pio_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t at91_pio_driver = { @@ -408,4 +412,5 @@ static driver_t at91_pio_driver = { sizeof(struct at91_pio_softc), }; -DRIVER_MODULE(at91_pio, atmelarm, at91_pio_driver, at91_pio_devclass, 0, 0); +DRIVER_MODULE(at91_pio, atmelarm, at91_pio_driver, at91_pio_devclass, NULL, + NULL); Modified: stable/9/sys/arm/at91/at91_piovar.h ============================================================================== --- stable/9/sys/arm/at91/at91_piovar.h Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/at91_piovar.h Sat May 26 09:03:14 2012 (r236080) @@ -26,19 +26,23 @@ /* $FreeBSD$ */ #ifndef ARM_AT91_AT91_PIOVAR_H -#define ARM_AT91_AT91_PIOVAR_H +#define ARM_AT91_AT91_PIOVAR_H -void at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask, int use_pullup); -void at91_pio_use_periph_b(uint32_t pio, uint32_t periph_b_mask, int use_pullup); +void at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask, + int use_pullup); +void at91_pio_use_periph_b(uint32_t pio, uint32_t periph_b_mask, + int use_pullup); void at91_pio_use_gpio(uint32_t pio, uint32_t gpio_mask); void at91_pio_gpio_input(uint32_t pio, uint32_t input_enable_mask); void at91_pio_gpio_output(uint32_t pio, uint32_t output_enable_mask, - int use_pullup); + int use_pullup); void at91_pio_gpio_set(uint32_t pio, uint32_t data_mask); void at91_pio_gpio_clear(uint32_t pio, uint32_t data_mask); uint8_t at91_pio_gpio_get(uint32_t pio, uint32_t data_mask); -void at91_pio_gpio_set_deglitch(uint32_t pio, uint32_t data_mask, int use_deglitch); -void at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, int enable_interrupt); +void at91_pio_gpio_set_deglitch(uint32_t pio, uint32_t data_mask, + int use_deglitch); +void at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, + int enable_interrupt); uint32_t at91_pio_gpio_clear_interrupt(uint32_t pio); #endif /* ARM_AT91_AT91_PIOVAR_H */ Modified: stable/9/sys/arm/at91/at91_pit.c ============================================================================== --- stable/9/sys/arm/at91/at91_pit.c Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/at91_pit.c Sat May 26 09:03:14 2012 (r236080) @@ -59,12 +59,14 @@ static uint32_t timecount = 0; static inline uint32_t RD4(struct pit_softc *sc, bus_size_t off) { + return (bus_read_4(sc->mem_res, off)); } static inline void WR4(struct pit_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } @@ -112,11 +114,11 @@ at91pit_attach(device_t dev) RF_ACTIVE); if (sc->mem_res == NULL) - panic("couldn't allocate register resources"); + panic("couldn't allocate register resources"); rid = 0; irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 1, 1, 1, - RF_ACTIVE | RF_SHAREABLE); + RF_ACTIVE | RF_SHAREABLE); if (!irq) { device_printf(dev, "could not allocate interrupt resources.\n"); err = ENOMEM; @@ -124,16 +126,15 @@ at91pit_attach(device_t dev) } /* Activate the interrupt. */ - err = bus_setup_intr(dev, irq, INTR_TYPE_CLK, pit_intr, - NULL, NULL, &ih); - + err = bus_setup_intr(dev, irq, INTR_TYPE_CLK, pit_intr, NULL, NULL, + &ih); + at91pit_timecounter.tc_frequency = at91_master_clock / PIT_PRESCALE; tc_init(&at91pit_timecounter); - //Enable the PIT here. - WR4(sc, PIT_MR, - PIT_PIV(at91_master_clock / PIT_PRESCALE / hz) | - PIT_EN | PIT_IEN); + /* Enable the PIT here. */ + WR4(sc, PIT_MR, PIT_PIV(at91_master_clock / PIT_PRESCALE / hz) | + PIT_EN | PIT_IEN); out: return (err); } @@ -141,7 +142,7 @@ out: static device_method_t at91pit_methods[] = { DEVMETHOD(device_probe, at91pit_probe), DEVMETHOD(device_attach, at91pit_attach), - {0,0}, + DEVMETHOD_END }; static driver_t at91pit_driver = { @@ -152,7 +153,8 @@ static driver_t at91pit_driver = { static devclass_t at91pit_devclass; -DRIVER_MODULE(at91_pit, atmelarm, at91pit_driver, at91pit_devclass, 0, 0); +DRIVER_MODULE(at91_pit, atmelarm, at91pit_driver, at91pit_devclass, NULL, + NULL); static int pit_intr(void *arg) @@ -175,7 +177,7 @@ pit_intr(void *arg) static unsigned at91pit_get_timecount(struct timecounter *tc) { - uint32_t piir, icnt; + uint32_t piir, icnt; piir = RD4(sc, PIT_PIIR); /* Current count | over flows */ icnt = piir >> 20; /* Overflows */ @@ -192,7 +194,7 @@ DELAY(int us) last = PIT_PIV(RD4(sc, PIT_PIIR)); /* Max delay ~= 260s. @ 133Mhz */ - pit_freq = at91_master_clock / PIT_PRESCALE; + pit_freq = at91_master_clock / PIT_PRESCALE; cnt = ((pit_freq * us) + (mhz -1)) / mhz; cnt = (cnt <= 0) ? 1 : cnt; @@ -211,14 +213,17 @@ DELAY(int us) void cpu_startprofclock(void) { + } void cpu_stopprofclock(void) { + } void cpu_initclocks(void) { + } Modified: stable/9/sys/arm/at91/at91_pmc.c ============================================================================== --- stable/9/sys/arm/at91/at91_pmc.c Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/at91_pmc.c Sat May 26 09:03:14 2012 (r236080) @@ -180,9 +180,8 @@ at91_pmc_set_pllb_mode(struct at91_pmc_c if (on) { on = PMC_IER_LOCKB; value = sc->pllb_init; - } else { + } else value = 0; - } /* Workaround RM9200 Errata #26 */ if (at91_is_rm92() && @@ -232,12 +231,12 @@ at91_pmc_clock_add(const char *name, uin int i, buflen; clk = malloc(sizeof(*clk), M_PMC, M_NOWAIT | M_ZERO); - if (clk == NULL) + if (clk == NULL) goto err; buflen = strlen(name) + 1; clk->name = malloc(buflen, M_PMC, M_NOWAIT); - if (clk->name == NULL) + if (clk->name == NULL) goto err; strlcpy(clk->name, name, buflen); @@ -256,7 +255,7 @@ at91_pmc_clock_add(const char *name, uin } err: if (clk != NULL) { - if (clk->name != NULL) + if (clk->name != NULL) free(clk->name, M_PMC); free(clk, M_PMC); } @@ -331,15 +330,16 @@ at91_pmc_pll_rate(struct at91_pmc_clock div = (reg >> clk->pll_div_shift) & clk->pll_div_mask; mul = (reg >> clk->pll_mul_shift) & clk->pll_mul_mask; -// printf("pll = (%d / %d) * %d = %d\n", -// freq, div ,mul + 1, (freq/div) * (mul+1)); +#if 0 + printf("pll = (%d / %d) * %d = %d\n", + freq, div, mul + 1, (freq/div) * (mul+1)); +#endif if (div != 0 && mul != 0) { freq /= div; freq *= mul + 1; - } else { + } else freq = 0; - } clk->hz = freq; @@ -431,9 +431,8 @@ at91_pmc_init_clock(struct at91_pmc_soft if (at91_is_rm92()) { WR4(sc, PMC_SCDR, PMC_SCER_UHP | PMC_SCER_UDP); WR4(sc, PMC_SCER, PMC_SCER_MCKUDP); - } else { + } else WR4(sc, PMC_SCDR, PMC_SCER_UHP_SAM9 | PMC_SCER_UDP_SAM9); - } WR4(sc, CKGR_PLLBR, 0); /* @@ -443,15 +442,14 @@ at91_pmc_init_clock(struct at91_pmc_soft mck.parent = clock_list[mckr & 0x3]; mck.parent->refcnt++; - cpu.hz = - mck.hz = mck.parent->hz / - (1 << ((mckr & PMC_MCKR_PRES_MASK) >> 2)); + cpu.hz = mck.hz = mck.parent->hz / + (1 << ((mckr & PMC_MCKR_PRES_MASK) >> 2)); mdiv = (mckr & PMC_MCKR_MDIV_MASK) >> 8; if (at91_is_sam9()) { if (mdiv > 0) mck.hz /= mdiv * 2; - } else + } else mck.hz /= (1 + mdiv); /* Only found on SAM9G20 */ @@ -574,7 +572,7 @@ at91_pmc_attach(device_t dev) static device_method_t at91_pmc_methods[] = { DEVMETHOD(device_probe, at91_pmc_probe), DEVMETHOD(device_attach, at91_pmc_attach), - {0, 0}, + DEVMETHOD_END }; static driver_t at91_pmc_driver = { @@ -584,4 +582,5 @@ static driver_t at91_pmc_driver = { }; static devclass_t at91_pmc_devclass; -DRIVER_MODULE(at91_pmc, atmelarm, at91_pmc_driver, at91_pmc_devclass, 0, 0); +DRIVER_MODULE(at91_pmc, atmelarm, at91_pmc_driver, at91_pmc_devclass, NULL, + NULL); Modified: stable/9/sys/arm/at91/at91_rst.c ============================================================================== --- stable/9/sys/arm/at91/at91_rst.c Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/at91_rst.c Sat May 26 09:03:14 2012 (r236080) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #define RST_TIMEOUT (5) /* Seconds to hold NRST for hard reset */ -#define RST_TICK (20) /* sample NRST at hz/RST_TICK intervals */ +#define RST_TICK (20) /* sample NRST at hz/RST_TICK intervals */ static int rst_intr(void *arg); @@ -122,7 +122,7 @@ at91_rst_attach(device_t dev) case RST_SR_RST_WAKE: cause = "Wake Up"; break; - case RST_SR_RST_WDT: + case RST_SR_RST_WDT: cause = "Watchdog"; break; case RST_SR_RST_SOFT: @@ -153,7 +153,7 @@ rst_tick(void *argp) cpu_reset(); } else if ((RD4(sc, RST_SR) & RST_SR_NRSTL)) { /* User released the button in less than RST_TIMEOUT */ - sc->shutdown = 0; + sc->shutdown = 0; device_printf(sc->sc_dev, "shutting down...\n"); shutdown_nice(0); } else { @@ -167,7 +167,7 @@ rst_intr(void *argp) struct rst_softc *sc = argp; if (RD4(sc, RST_SR) & RST_SR_URSTS) { - if (sc->shutdown == 0) + if (sc->shutdown == 0) callout_reset(&sc->tick_ch, hz/RST_TICK, rst_tick, sc); return (FILTER_HANDLED); } @@ -177,7 +177,7 @@ rst_intr(void *argp) static device_method_t at91_rst_methods[] = { DEVMETHOD(device_probe, at91_rst_probe), DEVMETHOD(device_attach, at91_rst_attach), - {0,0}, + DEVMETHOD_END }; static driver_t at91_rst_driver = { @@ -188,7 +188,8 @@ static driver_t at91_rst_driver = { static devclass_t at91_rst_devclass; -DRIVER_MODULE(at91_rst, atmelarm, at91_rst_driver, at91_rst_devclass, 0, 0); +DRIVER_MODULE(at91_rst, atmelarm, at91_rst_driver, at91_rst_devclass, NULL, + NULL); void cpu_reset_sam9g20(void) __attribute__((weak)); void cpu_reset_sam9g20(void) {} @@ -198,7 +199,6 @@ cpu_reset(void) { if (rst_sc) { - cpu_reset_sam9g20(); /* May be null */ WR4(rst_sc, RST_MR, @@ -211,5 +211,6 @@ cpu_reset(void) RST_CR_KEY); } - for(;;) ; + for(;;) + ; } Modified: stable/9/sys/arm/at91/at91_twi.c ============================================================================== --- stable/9/sys/arm/at91/at91_twi.c Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/at91_twi.c Sat May 26 09:03:14 2012 (r236080) @@ -46,9 +46,9 @@ __FBSDID("$FreeBSD$"); #include #include "iicbus_if.h" -#define TWI_SLOW_CLOCK 1500 -#define TWI_FAST_CLOCK 45000 -#define TWI_FASTEST_CLOCK 90000 +#define TWI_SLOW_CLOCK 1500 +#define TWI_FAST_CLOCK 45000 +#define TWI_FASTEST_CLOCK 90000 struct at91_twi_softc { @@ -67,24 +67,26 @@ struct at91_twi_softc static inline uint32_t RD4(struct at91_twi_softc *sc, bus_size_t off) { + return bus_read_4(sc->mem_res, off); } static inline void WR4(struct at91_twi_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } -#define AT91_TWI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define AT91_TWI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define AT91_TWI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define AT91_TWI_LOCK_INIT(_sc) \ +#define AT91_TWI_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "twi", MTX_DEF) -#define AT91_TWI_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define AT91_TWI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define AT91_TWI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); -#define TWI_DEF_CLK 100000 +#define AT91_TWI_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define AT91_TWI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define AT91_TWI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define TWI_DEF_CLK 100000 static devclass_t at91_twi_devclass; @@ -102,6 +104,7 @@ static void at91_twi_deactivate(device_t static int at91_twi_probe(device_t dev) { + device_set_desc(dev, "TWI"); return (0); } @@ -385,7 +388,7 @@ static device_method_t at91_twi_methods[ DEVMETHOD(iicbus_callback, at91_twi_callback), DEVMETHOD(iicbus_reset, at91_twi_rst_card), DEVMETHOD(iicbus_transfer, at91_twi_transfer), - { 0, 0 } + DEVMETHOD_END }; static driver_t at91_twi_driver = { @@ -394,6 +397,7 @@ static driver_t at91_twi_driver = { sizeof(struct at91_twi_softc), }; -DRIVER_MODULE(at91_twi, atmelarm, at91_twi_driver, at91_twi_devclass, 0, 0); -DRIVER_MODULE(iicbus, at91_twi, iicbus_driver, iicbus_devclass, 0, 0); +DRIVER_MODULE(at91_twi, atmelarm, at91_twi_driver, at91_twi_devclass, NULL, + NULL); +DRIVER_MODULE(iicbus, at91_twi, iicbus_driver, iicbus_devclass, NULL, NULL); MODULE_DEPEND(at91_twi, iicbus, 1, 1, 1); Modified: stable/9/sys/arm/at91/at91_twireg.h ============================================================================== --- stable/9/sys/arm/at91/at91_twireg.h Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/at91_twireg.h Sat May 26 09:03:14 2012 (r236080) @@ -26,61 +26,61 @@ /* $FreeBSD$ */ #ifndef ARM_AT91_AT91_TWIREG_H -#define ARM_AT91_AT91_TWIREG_H +#define ARM_AT91_AT91_TWIREG_H -#define TWI_CR 0x00 /* TWI Control Register */ -#define TWI_MMR 0x04 /* TWI Master Mode Register */ -#define TWI_SMR 0x08 /* TWI Master Mode Register */ -#define TWI_IADR 0x0c /* TWI Internal Address Register */ -#define TWI_CWGR 0x10 /* TWI Clock Waveform Generator Reg */ +#define TWI_CR 0x00 /* TWI Control Register */ +#define TWI_MMR 0x04 /* TWI Master Mode Register */ +#define TWI_SMR 0x08 /* TWI Master Mode Register */ +#define TWI_IADR 0x0c /* TWI Internal Address Register */ +#define TWI_CWGR 0x10 /* TWI Clock Waveform Generator Reg */ /* 0x14 reserved */ /* 0x18 reserved */ /* 0x1c reserved */ -#define TWI_SR 0x20 /* TWI Status Register */ -#define TWI_IER 0x24 /* TWI Interrupt Enable Register */ -#define TWI_IDR 0x28 /* TWI Interrupt Disable Register */ -#define TWI_IMR 0x2c /* TWI Interrupt Mask Register */ -#define TWI_RHR 0x30 /* TWI Receiver Holding Register */ -#define TWI_THR 0x34 /* TWI Transmit Holding Register */ +#define TWI_SR 0x20 /* TWI Status Register */ +#define TWI_IER 0x24 /* TWI Interrupt Enable Register */ +#define TWI_IDR 0x28 /* TWI Interrupt Disable Register */ +#define TWI_IMR 0x2c /* TWI Interrupt Mask Register */ +#define TWI_RHR 0x30 /* TWI Receiver Holding Register */ +#define TWI_THR 0x34 /* TWI Transmit Holding Register */ /* TWI_CR */ -#define TWI_CR_START (1U << 0) /* Send a start */ -#define TWI_CR_STOP (1U << 1) /* Send a stop */ -#define TWI_CR_MSEN (1U << 2) /* Master Transfer Enable */ -#define TWI_CR_MSDIS (1U << 3) /* Master Transfer Disable */ -#define TWI_CR_SVEN (1U << 4) /* Slave Transfer Enable */ -#define TWI_CR_SVDIS (1U << 5) /* Slave Transfer Disable */ -#define TWI_CR_SWRST (1U << 7) /* Software Reset */ +#define TWI_CR_START (1U << 0) /* Send a start */ +#define TWI_CR_STOP (1U << 1) /* Send a stop */ +#define TWI_CR_MSEN (1U << 2) /* Master Transfer Enable */ +#define TWI_CR_MSDIS (1U << 3) /* Master Transfer Disable */ +#define TWI_CR_SVEN (1U << 4) /* Slave Transfer Enable */ +#define TWI_CR_SVDIS (1U << 5) /* Slave Transfer Disable */ +#define TWI_CR_SWRST (1U << 7) /* Software Reset */ /* TWI_MMR */ /* TWI_SMR */ -#define TWI_MMR_IADRSZ(n) ((n) << 8) /* Set size of transfer */ -#define TWI_MMR_MWRITE 0U /* Master Read Direction */ -#define TWI_MMR_MREAD (1U << 12) /* Master Read Direction */ -#define TWI_MMR_DADR(n) ((n) << 15) /* Device Address */ +#define TWI_MMR_IADRSZ(n) ((n) << 8) /* Set size of transfer */ +#define TWI_MMR_MWRITE 0U /* Master Read Direction */ +#define TWI_MMR_MREAD (1U << 12) /* Master Read Direction */ +#define TWI_MMR_DADR(n) ((n) << 15) /* Device Address */ /* TWI_CWGR */ -#define TWI_CWGR_CKDIV(x) ((x) << 16) /* Clock Divider */ -#define TWI_CWGR_CHDIV(x) ((x) << 8) /* Clock High Divider */ -#define TWI_CWGR_CLDIV(x) ((x) << 0) /* Clock Low Divider */ -#define TWI_CWGR_DIV(rate) \ - (at91_is_sam9() ? \ - ((at91_master_clock /(4*(rate))) - 3) : \ - ((at91_master_clock /(4*(rate))) - 2)) +#define TWI_CWGR_CKDIV(x) ((x) << 16) /* Clock Divider */ +#define TWI_CWGR_CHDIV(x) ((x) << 8) /* Clock High Divider */ +#define TWI_CWGR_CLDIV(x) ((x) << 0) /* Clock Low Divider */ +#define TWI_CWGR_DIV(rate) \ + (at91_is_sam9() ? \ + ((at91_master_clock / (4 * (rate))) - 3) : \ + ((at91_master_clock / (4 * (rate))) - 2)) /* TWI_SR */ /* TWI_IER */ /* TWI_IDR */ /* TWI_IMR */ -#define TWI_SR_TXCOMP (1U << 0) /* Transmission Completed */ -#define TWI_SR_RXRDY (1U << 1) /* Receive Holding Register Ready */ -#define TWI_SR_TXRDY (1U << 2) /* Transmit Holding Register Ready */ -#define TWI_SR_SVREAD (1U << 3) /* Slave Read */ -#define TWI_SR_SVACC (1U << 4) /* Slave Access */ -#define TWI_SR_GCACC (1U << 5) /* General Call Access */ -#define TWI_SR_OVRE (1U << 6) /* Overrun error */ -#define TWI_SR_UNRE (1U << 7) /* Underrun Error */ -#define TWI_SR_NACK (1U << 8) /* Not Acknowledged */ -#define TWI_SR_ARBLST (1U << 9) /* Arbitration Lost */ +#define TWI_SR_TXCOMP (1U << 0) /* Transmission Completed */ +#define TWI_SR_RXRDY (1U << 1) /* Receive Holding Register Ready */ +#define TWI_SR_TXRDY (1U << 2) /* Transmit Holding Register Ready */ +#define TWI_SR_SVREAD (1U << 3) /* Slave Read */ +#define TWI_SR_SVACC (1U << 4) /* Slave Access */ +#define TWI_SR_GCACC (1U << 5) /* General Call Access */ +#define TWI_SR_OVRE (1U << 6) /* Overrun error */ +#define TWI_SR_UNRE (1U << 7) /* Underrun Error */ +#define TWI_SR_NACK (1U << 8) /* Not Acknowledged */ +#define TWI_SR_ARBLST (1U << 9) /* Arbitration Lost */ #endif /* ARM_AT91_AT91_TWIREG_H */ Modified: stable/9/sys/arm/at91/at91_wdt.c ============================================================================== --- stable/9/sys/arm/at91/at91_wdt.c Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/at91_wdt.c Sat May 26 09:03:14 2012 (r236080) @@ -24,9 +24,9 @@ */ /* - * The sam9 watchdog hardware can be programed only once. So we set the hardware - * watchdog to 16s in wdt_attach and only reset it in the wdt_tick - * handler. The watchdog is halted in processor debug mode. + * The SAM9 watchdog hardware can be programed only once. So we set the + * hardware watchdog to 16 s in wdt_attach and only reset it in the wdt_tick + * handler. The watchdog is halted in processor debug mode. */ #include @@ -52,19 +52,21 @@ struct wdt_softc { struct callout tick_ch; eventhandler_tag sc_wet; void *intrhand; - u_int cmd; - u_int interval; + u_int cmd; + u_int interval; }; static inline uint32_t RD4(struct wdt_softc *sc, bus_size_t off) { + return (bus_read_4(sc->mem_res, off)); } static inline void WR4(struct wdt_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } @@ -157,7 +159,7 @@ wdt_attach(device_t dev) RF_ACTIVE); if (sc->mem_res == NULL) - panic("couldn't allocate wdt register resources"); + panic("couldn't allocate wdt register resources"); wdt_mr = RD4(sc, WDT_MR); if ((wdt_mr & WDT_WDRSTEN) == 0) @@ -172,9 +174,11 @@ wdt_attach(device_t dev) WR4(sc, WDT_MR, WDT_WDDBGHLT | WDT_WDD(0xC00)| WDT_WDFIEN| WDT_WDV(0xFFF)); #endif - /* This may have been set by Boot ROM so register value - * may not be what we just requested since this is a - * write once register. */ + /* + * This may have been set by Boot ROM so register value may + * not be what we just requested since this is a write once + * register. + */ wdt_mr = RD4(sc, WDT_MR); if (wdt_mr & WDT_WDFIEN) { rid = 0; @@ -184,15 +188,15 @@ wdt_attach(device_t dev) panic("could not allocate interrupt.\n"); err = bus_setup_intr(dev, irq, INTR_TYPE_CLK, wdt_intr, - NULL, sc, &sc->intrhand); + NULL, sc, &sc->intrhand); } /* interval * hz */ sc->interval = (((wdt_mr & WDT_WDV(~0)) + 1) * WDT_DIV) / - (WDT_CLOCK/hz); + (WDT_CLOCK/hz); device_printf(dev, "watchdog timeout: %d seconds\n", - sc->interval/hz); + sc->interval / hz); /* Slightly less than 1/2 of watchdog hardware timeout */ sc->interval = (sc->interval/2) - (sc->interval/20); @@ -208,7 +212,7 @@ wdt_attach(device_t dev) static device_method_t wdt_methods[] = { DEVMETHOD(device_probe, wdt_probe), DEVMETHOD(device_attach, wdt_attach), - {0,0}, + DEVMETHOD_END }; static driver_t wdt_driver = { @@ -219,4 +223,4 @@ static driver_t wdt_driver = { static devclass_t wdt_devclass; -DRIVER_MODULE(at91_wdt, atmelarm, wdt_driver, wdt_devclass, 0, 0); +DRIVER_MODULE(at91_wdt, atmelarm, wdt_driver, wdt_devclass, NULL, NULL); Modified: stable/9/sys/arm/at91/at91reg.h ============================================================================== --- stable/9/sys/arm/at91/at91reg.h Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/at91reg.h Sat May 26 09:03:14 2012 (r236080) @@ -28,43 +28,44 @@ */ #ifndef _AT91REG_H_ -#define _AT91REG_H_ +#define _AT91REG_H_ #include "opt_at91.h" /* Where builtin peripherals start in KVM */ -#define AT91_BASE 0xd0000000 +#define AT91_BASE 0xd0000000 /* A few things that we count on being the same * throught the whole family of SOCs */ /* SYSC System Controler */ /* System Registers */ -#define AT91_SYS_BASE 0xffff000 -#define AT91_SYS_SIZE 0x1000 +#define AT91_SYS_BASE 0xffff000 +#define AT91_SYS_SIZE 0x1000 #if defined(AT91SAM9G45) || defined(AT91SAM9263) -#define AT91_DBGU_BASE 0xfffee00 +#define AT91_DBGU_BASE 0xfffee00 #else -#define AT91_DBGU_BASE 0xffff200 +#define AT91_DBGU_BASE 0xffff200 #endif -#define AT91_DBGU_SIZE 0x200 -#define DBGU_C1R (64) /* Chip ID1 Register */ -#define DBGU_C2R (68) /* Chip ID2 Register */ -#define DBGU_FNTR (72) /* Force NTRST Register */ - -#define AT91_CPU_VERSION_MASK 0x0000001f -#define AT91_CPU_RM9200 0x09290780 -#define AT91_CPU_SAM9260 0x019803a0 -#define AT91_CPU_SAM9261 0x019703a0 -#define AT91_CPU_SAM9263 0x019607a0 -#define AT91_CPU_SAM9G10 0x819903a0 -#define AT91_CPU_SAM9G20 0x019905a0 -#define AT91_CPU_SAM9G45 0x819b05a0 - -#define AT91_ARCH(chipid) ((chipid >> 20) & 0xff) -#define AT91_CPU(chipid) (chipid & ~AT91_CPU_VERSION_MASK) -#define AT91_ARCH_SAM9 (0x19) -#define AT91_ARCH_RM92 (0x92) +#define AT91_DBGU_SIZE 0x200 +#define DBGU_C1R (64) /* Chip ID1 Register */ +#define DBGU_C2R (68) /* Chip ID2 Register */ +#define DBGU_FNTR (72) /* Force NTRST Register */ + +#define AT91_CPU_VERSION_MASK 0x0000001f +#define AT91_CPU_RM9200 0x09290780 +#define AT91_CPU_SAM9260 0x019803a0 +#define AT91_CPU_SAM9261 0x019703a0 +#define AT91_CPU_SAM9263 0x019607a0 +#define AT91_CPU_SAM9G10 0x819903a0 +#define AT91_CPU_SAM9G20 0x019905a0 +#define AT91_CPU_SAM9G45 0x819b05a0 + +#define AT91_ARCH(chipid) ((chipid >> 20) & 0xff) +#define AT91_CPU(chipid) (chipid & ~AT91_CPU_VERSION_MASK) +#define AT91_ARCH_SAM9 (0x19) +#define AT91_ARCH_SAM9XE (0x29) +#define AT91_ARCH_RM92 (0x92) #endif /* _AT91REG_H_ */ Modified: stable/9/sys/arm/at91/at91sam9260.c ============================================================================== --- stable/9/sys/arm/at91/at91sam9260.c Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/at91sam9260.c Sat May 26 09:03:14 2012 (r236080) @@ -93,7 +93,7 @@ static const int at91_irq_prio[32] = 0, /* Advanced Interrupt Controller IRQ2 */ }; -#define DEVICE(_name, _id, _unit) \ +#define DEVICE(_name, _id, _unit) \ { \ _name, _unit, \ AT91SAM9260_ ## _id ##_BASE, \ @@ -157,7 +157,7 @@ at91_add_child(device_t dev, int prio, c bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); if (irq2 != 0) bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91SAM9260_BASE) + if (addr != 0 && addr < AT91SAM9260_BASE) addr += AT91SAM9260_BASE; if (addr != 0) bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); @@ -182,13 +182,14 @@ at91_pll_outa(int freq) if (freq > 195000000) return (0x20000000); - else + else return (0x20008000); } static uint32_t at91_pll_outb(int freq) { + return (0x4000); } @@ -226,7 +227,7 @@ at91_attach(device_t dev) sc->sc_sh = at91sc->sc_sh; sc->dev = dev; - /* + /* * XXX These values work for the RM9200, SAM926[01], and SAM9260 * will have to fix this when we want to support anything else. XXX */ @@ -247,7 +248,7 @@ at91_attach(device_t dev) at91sc->sc_irq_system = AT91SAM9260_IRQ_SYSTEM; for (i = 0; i < 32; i++) { - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + i * 4, i); /* Priority. */ bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, @@ -276,10 +277,9 @@ at91_attach(device_t dev) i = bus_space_read_4(sc->sc_st, sc->sc_matrix_sh, AT91SAM9260_EBICSA); bus_space_write_4(sc->sc_st, sc->sc_matrix_sh, - AT91SAM9260_EBICSA, + AT91SAM9260_EBICSA, i | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); - /* Update USB device port clock info */ clk = at91_pmc_clock_ref("udpck"); clk->pmc_mask = PMC_SCER_UDP_SAM9; @@ -304,11 +304,12 @@ at91_attach(device_t dev) at91_pmc_clock_deref(clk); /* - * Fudge MAX pll in frequence down below 3.0 Mhz to ensure - * PMC alogrithm choose the divisor that causes the input clock - * to be near the optimal 2 Mhz per datasheet. We know - * we are going to be using this for the USB clock at 96 Mhz. - * Causes no extra frequency deviation for all recomended crystal values. + * Fudge MAX pll in frequence down below 3.0 MHz to ensure + * PMC alogrithm choose the divisor that causes the input clock + * to be near the optimal 2 MHz per datasheet. We know + * we are going to be using this for the USB clock at 96 MHz. + * Causes no extra frequency deviation for all recomended crystal + * values. */ clk = at91_pmc_clock_ref("pllb"); clk->pll_min_in = SAM9260_PLL_B_MIN_IN_FREQ; /* 1 MHz */ @@ -329,7 +330,7 @@ static device_method_t at91sam9260_metho DEVMETHOD(device_probe, at91_probe), DEVMETHOD(device_attach, at91_attach), DEVMETHOD(device_identify, at91_identify), - {0, 0}, + DEVMETHOD_END }; static driver_t at91sam9260_driver = { @@ -340,4 +341,5 @@ static driver_t at91sam9260_driver = { static devclass_t at91sam9260_devclass; -DRIVER_MODULE(at91sam9260, atmelarm, at91sam9260_driver, at91sam9260_devclass, 0, 0); +DRIVER_MODULE(at91sam9260, atmelarm, at91sam9260_driver, at91sam9260_devclass, + NULL, NULL); Modified: stable/9/sys/arm/at91/at91var.h ============================================================================== --- stable/9/sys/arm/at91/at91var.h Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/at91var.h Sat May 26 09:03:14 2012 (r236080) @@ -62,24 +62,27 @@ struct cpu_devs extern uint32_t at91_chip_id; static inline int at91_is_rm92(void); -static inline int at91_is_sam9(void) ; +static inline int at91_is_sam9(void); static inline int at91_cpu_is(u_int cpu); -static inline int -at91_is_rm92(void) +static inline int +at91_is_rm92(void) { + return (AT91_ARCH(at91_chip_id) == AT91_ARCH_RM92); } -static inline int -at91_is_sam9(void) +static inline int +at91_is_sam9(void) { + return (AT91_ARCH(at91_chip_id) == AT91_ARCH_SAM9); } -static inline int +static inline int at91_cpu_is(u_int cpu) { + return (AT91_CPU(at91_chip_id) == cpu); } Modified: stable/9/sys/arm/at91/if_ate.c ============================================================================== --- stable/9/sys/arm/at91/if_ate.c Sat May 26 08:58:29 2012 (r236079) +++ stable/9/sys/arm/at91/if_ate.c Sat May 26 09:03:14 2012 (r236080) @@ -120,38 +120,38 @@ __FBSDID("$FreeBSD$"); struct ate_softc { - struct ifnet *ifp; /* ifnet pointer */ - struct mtx sc_mtx; /* Basically a perimeter lock */ - device_t dev; /* Myself */ - device_t miibus; /* My child miibus */ - struct resource *irq_res; /* IRQ resource */ - struct resource *mem_res; /* Memory resource */ - struct callout tick_ch; /* Tick callout */ + struct ifnet *ifp; /* ifnet pointer */ + struct mtx sc_mtx; /* Basically a perimeter lock */ + device_t dev; /* Myself */ + device_t miibus; /* My child miibus */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat May 26 09:05:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30E8A1065672; Sat, 26 May 2012 09:05:46 +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 1B00B8FC0C; Sat, 26 May 2012 09:05: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 q4Q95jgY064663; Sat, 26 May 2012 09:05:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q95jBJ064653; Sat, 26 May 2012 09:05:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260905.q4Q95jBJ064653@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:05:45 +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: r236081 - stable/9/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:05:46 -0000 Author: marius Date: Sat May 26 09:05:45 2012 New Revision: 236081 URL: http://svn.freebsd.org/changeset/base/236081 Log: MFC: r234291, r234292 Add support for the Atmel SAM9XE family of microcontrollers, which consist of a ARM926EJ-S processor core with up to 512 Kbytes of on-chip flash. Tested with SAM9XE512. Modified: stable/9/sys/arm/at91/at91_pit.c stable/9/sys/arm/at91/at91_pmc.c stable/9/sys/arm/at91/at91_rst.c stable/9/sys/arm/at91/at91_twireg.h stable/9/sys/arm/at91/at91_wdt.c stable/9/sys/arm/at91/at91reg.h stable/9/sys/arm/at91/at91sam9260.c stable/9/sys/arm/at91/at91var.h stable/9/sys/arm/at91/if_ate.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/arm/at91/at91_pit.c ============================================================================== --- stable/9/sys/arm/at91/at91_pit.c Sat May 26 09:03:14 2012 (r236080) +++ stable/9/sys/arm/at91/at91_pit.c Sat May 26 09:05:45 2012 (r236081) @@ -90,7 +90,7 @@ static int at91pit_probe(device_t dev) { - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { device_set_desc(dev, "AT91SAM9 PIT"); return (0); } Modified: stable/9/sys/arm/at91/at91_pmc.c ============================================================================== --- stable/9/sys/arm/at91/at91_pmc.c Sat May 26 09:03:14 2012 (r236080) +++ stable/9/sys/arm/at91/at91_pmc.c Sat May 26 09:05:45 2012 (r236081) @@ -162,12 +162,14 @@ static const unsigned int at91_mainf_tbl static inline uint32_t RD4(struct at91_pmc_softc *sc, bus_size_t off) { + return (bus_read_4(sc->mem_res, off)); } static inline void WR4(struct at91_pmc_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } @@ -225,7 +227,8 @@ at91_pmc_set_periph_mode(struct at91_pmc } struct at91_pmc_clock * -at91_pmc_clock_add(const char *name, uint32_t irq, struct at91_pmc_clock *parent) +at91_pmc_clock_add(const char *name, uint32_t irq, + struct at91_pmc_clock *parent) { struct at91_pmc_clock *clk; int i, buflen; @@ -299,11 +302,13 @@ at91_pmc_clock_ref(const char *name) void at91_pmc_clock_deref(struct at91_pmc_clock *clk) { + } void at91_pmc_clock_enable(struct at91_pmc_clock *clk) { + /* XXX LOCKING? XXX */ if (clk->parent) at91_pmc_clock_enable(clk->parent); @@ -314,6 +319,7 @@ at91_pmc_clock_enable(struct at91_pmc_cl void at91_pmc_clock_disable(struct at91_pmc_clock *clk) { + /* XXX LOCKING? XXX */ if (--clk->refcnt == 0 && clk->set_mode) clk->set_mode(clk, 0); @@ -342,7 +348,6 @@ at91_pmc_pll_rate(struct at91_pmc_clock freq = 0; clk->hz = freq; - return (freq); } @@ -402,7 +407,7 @@ at91_pmc_init_clock(struct at91_pmc_soft uint32_t mckr; uint32_t mdiv; - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { uhpck.pmc_mask = PMC_SCER_UHP_SAM9; udpck.pmc_mask = PMC_SCER_UDP_SAM9; } @@ -446,7 +451,7 @@ at91_pmc_init_clock(struct at91_pmc_soft (1 << ((mckr & PMC_MCKR_PRES_MASK) >> 2)); mdiv = (mckr & PMC_MCKR_MDIV_MASK) >> 8; - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { if (mdiv > 0) mck.hz /= mdiv * 2; } else @@ -486,7 +491,6 @@ at91_pmc_deactivate(device_t dev) bus_release_resource(dev, SYS_RES_IOPORT, rman_get_rid(sc->mem_res), sc->mem_res); sc->mem_res = 0; - return; } static int Modified: stable/9/sys/arm/at91/at91_rst.c ============================================================================== --- stable/9/sys/arm/at91/at91_rst.c Sat May 26 09:03:14 2012 (r236080) +++ stable/9/sys/arm/at91/at91_rst.c Sat May 26 09:05:45 2012 (r236081) @@ -71,7 +71,7 @@ static int at91_rst_probe(device_t dev) { - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { device_set_desc(dev, "AT91SAM9 Reset Controller"); return (0); } Modified: stable/9/sys/arm/at91/at91_twireg.h ============================================================================== --- stable/9/sys/arm/at91/at91_twireg.h Sat May 26 09:03:14 2012 (r236080) +++ stable/9/sys/arm/at91/at91_twireg.h Sat May 26 09:05:45 2012 (r236081) @@ -64,7 +64,7 @@ #define TWI_CWGR_CHDIV(x) ((x) << 8) /* Clock High Divider */ #define TWI_CWGR_CLDIV(x) ((x) << 0) /* Clock Low Divider */ #define TWI_CWGR_DIV(rate) \ - (at91_is_sam9() ? \ + (at91_is_sam9() || at91_is_sam9xe() ? \ ((at91_master_clock / (4 * (rate))) - 3) : \ ((at91_master_clock / (4 * (rate))) - 2)) Modified: stable/9/sys/arm/at91/at91_wdt.c ============================================================================== --- stable/9/sys/arm/at91/at91_wdt.c Sat May 26 09:03:14 2012 (r236080) +++ stable/9/sys/arm/at91/at91_wdt.c Sat May 26 09:05:45 2012 (r236081) @@ -132,7 +132,7 @@ static int wdt_probe(device_t dev) { - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { device_set_desc(dev, "WDT"); return (0); } Modified: stable/9/sys/arm/at91/at91reg.h ============================================================================== --- stable/9/sys/arm/at91/at91reg.h Sat May 26 09:03:14 2012 (r236080) +++ stable/9/sys/arm/at91/at91reg.h Sat May 26 09:05:45 2012 (r236081) @@ -61,6 +61,9 @@ #define AT91_CPU_SAM9G10 0x819903a0 #define AT91_CPU_SAM9G20 0x019905a0 #define AT91_CPU_SAM9G45 0x819b05a0 +#define AT91_CPU_SAM9XE128 0x329973a0 +#define AT91_CPU_SAM9XE256 0x329a93a0 +#define AT91_CPU_SAM9XE512 0x329aa3a0 #define AT91_ARCH(chipid) ((chipid >> 20) & 0xff) #define AT91_CPU(chipid) (chipid & ~AT91_CPU_VERSION_MASK) Modified: stable/9/sys/arm/at91/at91sam9260.c ============================================================================== --- stable/9/sys/arm/at91/at91sam9260.c Sat May 26 09:03:14 2012 (r236080) +++ stable/9/sys/arm/at91/at91sam9260.c Sat May 26 09:05:45 2012 (r236081) @@ -197,21 +197,40 @@ static void at91_identify(driver_t *drv, device_t parent) { - if (at91_cpu_is(AT91_CPU_SAM9260)) { + switch (AT91_CPU(at91_chip_id)) { + case AT91_CPU_SAM9260: + case AT91_CPU_SAM9XE128: + case AT91_CPU_SAM9XE256: + case AT91_CPU_SAM9XE512: at91_add_child(parent, 0, "at91sam9260", 0, 0, 0, -1, 0, 0); at91_cpu_add_builtin_children(parent); + break; } } static int at91_probe(device_t dev) { + const char *desc; - if (at91_cpu_is(AT91_CPU_SAM9260)) { - device_set_desc(dev, "AT91SAM9260"); - return (0); + switch (AT91_CPU(at91_chip_id)) { + case AT91_CPU_SAM9260: + desc = "AT91SAM9260"; + break; + case AT91_CPU_SAM9XE128: + desc = "AT91SAM9XE128"; + break; + case AT91_CPU_SAM9XE256: + desc = "AT91SAM9XE256"; + break; + case AT91_CPU_SAM9XE512: + desc = "AT91SAM9XE512"; + break; + default: + return (ENXIO); } - return (ENXIO); + device_set_desc(dev, desc); + return (0); } static int @@ -227,10 +246,6 @@ at91_attach(device_t dev) sc->sc_sh = at91sc->sc_sh; sc->dev = dev; - /* - * XXX These values work for the RM9200, SAM926[01], and SAM9260 - * will have to fix this when we want to support anything else. XXX - */ if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_SYS_BASE, AT91SAM9260_SYS_SIZE, &sc->sc_sys_sh) != 0) panic("Enable to map system registers"); Modified: stable/9/sys/arm/at91/at91var.h ============================================================================== --- stable/9/sys/arm/at91/at91var.h Sat May 26 09:03:14 2012 (r236080) +++ stable/9/sys/arm/at91/at91var.h Sat May 26 09:05:45 2012 (r236081) @@ -63,6 +63,7 @@ extern uint32_t at91_chip_id; static inline int at91_is_rm92(void); static inline int at91_is_sam9(void); +static inline int at91_is_sam9xe(void); static inline int at91_cpu_is(u_int cpu); static inline int @@ -80,6 +81,13 @@ at91_is_sam9(void) } static inline int +at91_is_sam9xe(void) +{ + + return (AT91_ARCH(at91_chip_id) == AT91_ARCH_SAM9XE); +} + +static inline int at91_cpu_is(u_int cpu) { Modified: stable/9/sys/arm/at91/if_ate.c ============================================================================== --- stable/9/sys/arm/at91/if_ate.c Sat May 26 09:03:14 2012 (r236080) +++ stable/9/sys/arm/at91/if_ate.c Sat May 26 09:05:45 2012 (r236081) @@ -266,7 +266,7 @@ ate_attach(device_t dev) } /* New or old version, chooses buffer size. */ - sc->is_emacb = at91_is_sam9(); + sc->is_emacb = at91_is_sam9() || at91_is_sam9xe(); sc->rx_buf_size = RX_BUF_SIZE(sc); err = ate_activate(dev); From owner-svn-src-all@FreeBSD.ORG Sat May 26 09:08:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 536A8106564A; Sat, 26 May 2012 09:08:31 +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 3D6DE8FC0A; Sat, 26 May 2012 09:08: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 q4Q98VFA064856; Sat, 26 May 2012 09:08:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q98VYx064854; Sat, 26 May 2012 09:08:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260908.q4Q98VYx064854@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:08: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: r236082 - stable/9/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:08:31 -0000 Author: marius Date: Sat May 26 09:08:30 2012 New Revision: 236082 URL: http://svn.freebsd.org/changeset/base/236082 Log: MFC: r234293 Generate an obviously missing STOP when having finished transmitting data. This fixes communication with PCF8563. Modified: stable/9/sys/arm/at91/at91_twi.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/arm/at91/at91_twi.c ============================================================================== --- stable/9/sys/arm/at91/at91_twi.c Sat May 26 09:05:45 2012 (r236081) +++ stable/9/sys/arm/at91/at91_twi.c Sat May 26 09:08:30 2012 (r236082) @@ -364,6 +364,7 @@ at91_twi_transfer(device_t dev, struct i goto out; WR4(sc, TWI_THR, *buf++); } + WR4(sc, TWI_CR, TWI_CR_STOP); } if ((err = at91_twi_wait(sc, TWI_SR_TXCOMP))) break; From owner-svn-src-all@FreeBSD.ORG Sat May 26 09:08:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 572D4106566B; Sat, 26 May 2012 09:08:34 +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 41D578FC0C; Sat, 26 May 2012 09:08: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 q4Q98YUo064893; Sat, 26 May 2012 09:08:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q98Y3P064891; Sat, 26 May 2012 09:08:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260908.q4Q98Y3P064891@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:08: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: r236083 - stable/8/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:08:34 -0000 Author: marius Date: Sat May 26 09:08:33 2012 New Revision: 236083 URL: http://svn.freebsd.org/changeset/base/236083 Log: MFC: r234293 Generate an obviously missing STOP when having finished transmitting data. This fixes communication with PCF8563. Modified: stable/8/sys/arm/at91/at91_twi.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) Modified: stable/8/sys/arm/at91/at91_twi.c ============================================================================== --- stable/8/sys/arm/at91/at91_twi.c Sat May 26 09:08:30 2012 (r236082) +++ stable/8/sys/arm/at91/at91_twi.c Sat May 26 09:08:33 2012 (r236083) @@ -364,6 +364,7 @@ at91_twi_transfer(device_t dev, struct i goto out; WR4(sc, TWI_THR, *buf++); } + WR4(sc, TWI_CR, TWI_CR_STOP); } if ((err = at91_twi_wait(sc, TWI_SR_TXCOMP))) break; From owner-svn-src-all@FreeBSD.ORG Sat May 26 09:11:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7019F106566B; Sat, 26 May 2012 09:11:46 +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 5AFD38FC18; Sat, 26 May 2012 09:11: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 q4Q9BkbZ065094; Sat, 26 May 2012 09:11:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q9BkaZ065091; Sat, 26 May 2012 09:11:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260911.q4Q9BkaZ065091@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:11:46 +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: r236084 - stable/9/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:11:46 -0000 Author: marius Date: Sat May 26 09:11:45 2012 New Revision: 236084 URL: http://svn.freebsd.org/changeset/base/236084 Log: MFC: r234560 - Add support for MCI1 revision 2xx controllers and a work-around for their "Data Write Operation and number of bytes" erratum. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Modified: stable/9/sys/arm/at91/at91_mci.c stable/9/sys/arm/at91/at91_mcireg.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/arm/at91/at91_mci.c ============================================================================== --- stable/9/sys/arm/at91/at91_mci.c Sat May 26 09:08:33 2012 (r236083) +++ stable/9/sys/arm/at91/at91_mci.c Sat May 26 09:11:45 2012 (r236084) @@ -113,6 +113,7 @@ static void at91_mci_intr(void *); /* helper routines */ static int at91_mci_activate(device_t dev); static void at91_mci_deactivate(device_t dev); +static int at91_mci_is_mci1rev2xx(void); #define AT91_MCI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define AT91_MCI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) @@ -141,11 +142,16 @@ static void at91_mci_init(device_t dev) { struct at91_mci_softc *sc = device_get_softc(dev); + uint32_t val; WR4(sc, MCI_CR, MCI_CR_MCIEN); /* Enable controller */ WR4(sc, MCI_IDR, 0xffffffff); /* Turn off interrupts */ WR4(sc, MCI_DTOR, MCI_DTOR_DTOMUL_1M | 1); - WR4(sc, MCI_MR, 0x834a); // XXX GROSS HACK FROM LINUX + val = MCI_MR_PDCMODE; + val |= 0x34a; /* PWSDIV = 3; CLKDIV = 74 */ + if (at91_mci_is_mci1rev2xx()) + val |= MCI_MR_RDPROOF | MCI_MR_WRPROOF; + WR4(sc, MCI_MR, val); #ifndef AT91_MCI_SLOT_B WR4(sc, MCI_SDCR, 0); /* SLOT A, 1 bit bus */ #else @@ -303,6 +309,29 @@ at91_mci_deactivate(device_t dev) return; } +static int +at91_mci_is_mci1rev2xx(void) +{ + + switch (AT91_CPU(at91_chip_id)) { + case AT91_CPU_SAM9260: + case AT91_CPU_SAM9263: +#ifdef notyet + case AT91_CPU_CAP9: +#endif + case AT91_CPU_SAM9G10: + case AT91_CPU_SAM9G20: +#ifdef notyet + case AT91_CPU_SAM9RL: +#endif + case AT91_CPU_SAM9XE128: + case AT91_CPU_SAM9XE256: + case AT91_CPU_SAM9XE512: + return(1); + } + return (0); +} + static void at91_mci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { @@ -346,6 +375,7 @@ at91_mci_update_ios(device_t brdev, devi static void at91_mci_start_cmd(struct at91_mci_softc *sc, struct mmc_command *cmd) { + size_t len; uint32_t cmdr, ier = 0, mr; uint32_t *src, *dst; int i; @@ -397,6 +427,7 @@ at91_mci_start_cmd(struct at91_mci_softc WR4(sc, MCI_MR, mr | (data->len << 16) | MCI_MR_PDCMODE); WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); if (cmdr & MCI_CMDR_TRCMD_START) { + len = data->len; if (cmdr & MCI_CMDR_TRDIR) vaddr = cmd->data->data; else { @@ -411,6 +442,15 @@ at91_mci_start_cmd(struct at91_mci_softc vaddr = sc->bounce_buffer; src = (uint32_t *)cmd->data->data; dst = (uint32_t *)vaddr; + /* + * If this is MCI1 revision 2xx controller, apply + * a work-around for the "Data Write Operation and + * number of bytes" erratum. + */ + if (at91_mci_is_mci1rev2xx() && data->len < 12) { + len = 12; + memset(dst, 0, 12); + } if (sc->sc_cap & CAP_NEEDS_BYTESWAP) { for (i = 0; i < data->len / 4; i++) dst[i] = bswap32(src[i]); @@ -418,7 +458,7 @@ at91_mci_start_cmd(struct at91_mci_softc memcpy(dst, src, data->len); } data->xfer_len = 0; - if (bus_dmamap_load(sc->dmatag, sc->map, vaddr, data->len, + if (bus_dmamap_load(sc->dmatag, sc->map, vaddr, len, at91_mci_getaddr, &paddr, 0) != 0) { cmd->error = MMC_ERR_NO_MEMORY; sc->req = NULL; @@ -430,12 +470,12 @@ at91_mci_start_cmd(struct at91_mci_softc if (cmdr & MCI_CMDR_TRDIR) { bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_PREREAD); WR4(sc, PDC_RPR, paddr); - WR4(sc, PDC_RCR, data->len / 4); + WR4(sc, PDC_RCR, len / 4); ier = MCI_SR_ENDRX; } else { bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_PREWRITE); WR4(sc, PDC_TPR, paddr); - WR4(sc, PDC_TCR, data->len / 4); + WR4(sc, PDC_TCR, len / 4); ier = MCI_SR_TXBUFE; } } @@ -769,7 +809,7 @@ static device_method_t at91_mci_methods[ DEVMETHOD(mmcbr_acquire_host, at91_mci_acquire_host), DEVMETHOD(mmcbr_release_host, at91_mci_release_host), - {0, 0}, + DEVMETHOD_END }; static driver_t at91_mci_driver = { @@ -777,7 +817,8 @@ static driver_t at91_mci_driver = { at91_mci_methods, sizeof(struct at91_mci_softc), }; -static devclass_t at91_mci_devclass; +static devclass_t at91_mci_devclass; -DRIVER_MODULE(at91_mci, atmelarm, at91_mci_driver, at91_mci_devclass, 0, 0); +DRIVER_MODULE(at91_mci, atmelarm, at91_mci_driver, at91_mci_devclass, NULL, + NULL); Modified: stable/9/sys/arm/at91/at91_mcireg.h ============================================================================== --- stable/9/sys/arm/at91/at91_mcireg.h Sat May 26 09:08:33 2012 (r236083) +++ stable/9/sys/arm/at91/at91_mcireg.h Sat May 26 09:11:45 2012 (r236084) @@ -54,6 +54,9 @@ /* -------- MCI_MR : (MCI Offset: 0x4) MCI Mode Register -------- */ #define MCI_MR_CLKDIV (0xffu << 0) /* (MCI) Clock Divider */ #define MCI_MR_PWSDIV (0x3fu << 8) /* (MCI) Power Saving Divider */ +#define MCI_MR_RDPROOF (0x1u << 11) /* (MCI) Read Proof Enable */ +#define MCI_MR_WRPROOF (0x1u << 12) /* (MCI) Write Proof Enable */ +#define MCI_MR_PDCFBYTE (0x1u << 13) /* (MCI) PDC Force Byte Transfer */ #define MCI_MR_PDCPADV (0x1u << 14) /* (MCI) PDC Padding Value */ #define MCI_MR_PDCMODE (0x1u << 15) /* (MCI) PDC Oriented Mode */ #define MCI_MR_BLKLEN 0x3fff0000ul /* (MCI) Data Block Length */ From owner-svn-src-all@FreeBSD.ORG Sat May 26 09:13:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8D1E1065673; Sat, 26 May 2012 09:13:25 +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 B2E728FC08; Sat, 26 May 2012 09:13:25 +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 q4Q9DPYj065220; Sat, 26 May 2012 09:13:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q9DPXL065217; Sat, 26 May 2012 09:13:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260913.q4Q9DPXL065217@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:13:25 +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: r236085 - stable/9/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:13:26 -0000 Author: marius Date: Sat May 26 09:13:24 2012 New Revision: 236085 URL: http://svn.freebsd.org/changeset/base/236085 Log: MFC: r234561 Interrupts must be disabled while handling a partial cache line flush, as otherwise the interrupt handling code may modify data in the non-DMA part of the cache line while we have it stashed away in the temporary stack buffer, then we end up restoring a stale value. PR: 160431 Submitted by: Ian Lepore Modified: stable/9/sys/arm/arm/busdma_machdep.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/9/sys/arm/arm/busdma_machdep.c Sat May 26 09:11:45 2012 (r236084) +++ stable/9/sys/arm/arm/busdma_machdep.c Sat May 26 09:13:24 2012 (r236085) @@ -1091,14 +1091,16 @@ static void bus_dmamap_sync_buf(void *buf, int len, bus_dmasync_op_t op) { char _tmp_cl[arm_dcache_align], _tmp_clend[arm_dcache_align]; + register_t s; + int partial; if ((op & BUS_DMASYNC_PREWRITE) && !(op & BUS_DMASYNC_PREREAD)) { cpu_dcache_wb_range((vm_offset_t)buf, len); cpu_l2cache_wb_range((vm_offset_t)buf, len); } + partial = (((vm_offset_t)buf) | len) & arm_dcache_align_mask; if (op & BUS_DMASYNC_PREREAD) { - if (!(op & BUS_DMASYNC_PREWRITE) && - ((((vm_offset_t)(buf) | len) & arm_dcache_align_mask) == 0)) { + if (!(op & BUS_DMASYNC_PREWRITE) && !partial) { cpu_dcache_inv_range((vm_offset_t)buf, len); cpu_l2cache_inv_range((vm_offset_t)buf, len); } else { @@ -1107,27 +1109,32 @@ bus_dmamap_sync_buf(void *buf, int len, } } if (op & BUS_DMASYNC_POSTREAD) { - if ((vm_offset_t)buf & arm_dcache_align_mask) { - memcpy(_tmp_cl, (void *)((vm_offset_t)buf & ~ - arm_dcache_align_mask), - (vm_offset_t)buf & arm_dcache_align_mask); - } - if (((vm_offset_t)buf + len) & arm_dcache_align_mask) { - memcpy(_tmp_clend, (void *)((vm_offset_t)buf + len), - arm_dcache_align - (((vm_offset_t)(buf) + len) & - arm_dcache_align_mask)); + if (partial) { + s = intr_disable(); + if ((vm_offset_t)buf & arm_dcache_align_mask) + memcpy(_tmp_cl, (void *)((vm_offset_t)buf & + ~arm_dcache_align_mask), + (vm_offset_t)buf & arm_dcache_align_mask); + if (((vm_offset_t)buf + len) & arm_dcache_align_mask) + memcpy(_tmp_clend, + (void *)((vm_offset_t)buf + len), + arm_dcache_align - (((vm_offset_t)(buf) + + len) & arm_dcache_align_mask)); } cpu_dcache_inv_range((vm_offset_t)buf, len); cpu_l2cache_inv_range((vm_offset_t)buf, len); - - if ((vm_offset_t)buf & arm_dcache_align_mask) - memcpy((void *)((vm_offset_t)buf & - ~arm_dcache_align_mask), _tmp_cl, - (vm_offset_t)buf & arm_dcache_align_mask); - if (((vm_offset_t)buf + len) & arm_dcache_align_mask) - memcpy((void *)((vm_offset_t)buf + len), _tmp_clend, - arm_dcache_align - (((vm_offset_t)(buf) + len) & - arm_dcache_align_mask)); + if (partial) { + if ((vm_offset_t)buf & arm_dcache_align_mask) + memcpy((void *)((vm_offset_t)buf & + ~arm_dcache_align_mask), _tmp_cl, + (vm_offset_t)buf & arm_dcache_align_mask); + if (((vm_offset_t)buf + len) & arm_dcache_align_mask) + memcpy((void *)((vm_offset_t)buf + len), + _tmp_clend, arm_dcache_align - + (((vm_offset_t)(buf) + len) & + arm_dcache_align_mask)); + intr_restore(s); + } } } From owner-svn-src-all@FreeBSD.ORG Sat May 26 09:13:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89B30106579F; Sat, 26 May 2012 09:13:39 +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 74F728FC15; Sat, 26 May 2012 09:13:39 +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 q4Q9Ddwb065268; Sat, 26 May 2012 09:13:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q9DdID065266; Sat, 26 May 2012 09:13:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260913.q4Q9DdID065266@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:13:39 +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: r236086 - stable/8/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:13:39 -0000 Author: marius Date: Sat May 26 09:13:38 2012 New Revision: 236086 URL: http://svn.freebsd.org/changeset/base/236086 Log: MFC: r234561 Interrupts must be disabled while handling a partial cache line flush, as otherwise the interrupt handling code may modify data in the non-DMA part of the cache line while we have it stashed away in the temporary stack buffer, then we end up restoring a stale value. PR: 160431 Submitted by: Ian Lepore Modified: stable/8/sys/arm/arm/busdma_machdep.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) Modified: stable/8/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/8/sys/arm/arm/busdma_machdep.c Sat May 26 09:13:24 2012 (r236085) +++ stable/8/sys/arm/arm/busdma_machdep.c Sat May 26 09:13:38 2012 (r236086) @@ -1091,14 +1091,16 @@ static void bus_dmamap_sync_buf(void *buf, int len, bus_dmasync_op_t op) { char _tmp_cl[arm_dcache_align], _tmp_clend[arm_dcache_align]; + register_t s; + int partial; if ((op & BUS_DMASYNC_PREWRITE) && !(op & BUS_DMASYNC_PREREAD)) { cpu_dcache_wb_range((vm_offset_t)buf, len); cpu_l2cache_wb_range((vm_offset_t)buf, len); } + partial = (((vm_offset_t)buf) | len) & arm_dcache_align_mask; if (op & BUS_DMASYNC_PREREAD) { - if (!(op & BUS_DMASYNC_PREWRITE) && - ((((vm_offset_t)(buf) | len) & arm_dcache_align_mask) == 0)) { + if (!(op & BUS_DMASYNC_PREWRITE) && !partial) { cpu_dcache_inv_range((vm_offset_t)buf, len); cpu_l2cache_inv_range((vm_offset_t)buf, len); } else { @@ -1107,27 +1109,32 @@ bus_dmamap_sync_buf(void *buf, int len, } } if (op & BUS_DMASYNC_POSTREAD) { - if ((vm_offset_t)buf & arm_dcache_align_mask) { - memcpy(_tmp_cl, (void *)((vm_offset_t)buf & ~ - arm_dcache_align_mask), - (vm_offset_t)buf & arm_dcache_align_mask); - } - if (((vm_offset_t)buf + len) & arm_dcache_align_mask) { - memcpy(_tmp_clend, (void *)((vm_offset_t)buf + len), - arm_dcache_align - (((vm_offset_t)(buf) + len) & - arm_dcache_align_mask)); + if (partial) { + s = intr_disable(); + if ((vm_offset_t)buf & arm_dcache_align_mask) + memcpy(_tmp_cl, (void *)((vm_offset_t)buf & + ~arm_dcache_align_mask), + (vm_offset_t)buf & arm_dcache_align_mask); + if (((vm_offset_t)buf + len) & arm_dcache_align_mask) + memcpy(_tmp_clend, + (void *)((vm_offset_t)buf + len), + arm_dcache_align - (((vm_offset_t)(buf) + + len) & arm_dcache_align_mask)); } cpu_dcache_inv_range((vm_offset_t)buf, len); cpu_l2cache_inv_range((vm_offset_t)buf, len); - - if ((vm_offset_t)buf & arm_dcache_align_mask) - memcpy((void *)((vm_offset_t)buf & - ~arm_dcache_align_mask), _tmp_cl, - (vm_offset_t)buf & arm_dcache_align_mask); - if (((vm_offset_t)buf + len) & arm_dcache_align_mask) - memcpy((void *)((vm_offset_t)buf + len), _tmp_clend, - arm_dcache_align - (((vm_offset_t)(buf) + len) & - arm_dcache_align_mask)); + if (partial) { + if ((vm_offset_t)buf & arm_dcache_align_mask) + memcpy((void *)((vm_offset_t)buf & + ~arm_dcache_align_mask), _tmp_cl, + (vm_offset_t)buf & arm_dcache_align_mask); + if (((vm_offset_t)buf + len) & arm_dcache_align_mask) + memcpy((void *)((vm_offset_t)buf + len), + _tmp_clend, arm_dcache_align - + (((vm_offset_t)(buf) + len) & + arm_dcache_align_mask)); + intr_restore(s); + } } } From owner-svn-src-all@FreeBSD.ORG Sat May 26 09:16:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3123106564A; Sat, 26 May 2012 09:16:33 +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 C48FE8FC1D; Sat, 26 May 2012 09:16:33 +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 q4Q9GX80065451; Sat, 26 May 2012 09:16:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q9GXdl065446; Sat, 26 May 2012 09:16:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205260916.q4Q9GXdl065446@svn.freebsd.org> From: Michael Tuexen Date: Sat, 26 May 2012 09:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236087 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:16:34 -0000 Author: tuexen Date: Sat May 26 09:16:33 2012 New Revision: 236087 URL: http://svn.freebsd.org/changeset/base/236087 Log: Get rid of SCTP specific code to avoid CRC32C computations on loopback. Just just offloading. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat May 26 09:13:38 2012 (r236086) +++ head/sys/netinet/sctp_output.c Sat May 26 09:16:33 2012 (r236087) @@ -4116,14 +4116,8 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) && - (stcb) && - (stcb->asoc.loopback_scope))) { - sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); - } else { - SCTP_STAT_INCR(sctps_sendnocrc); - } + sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr)); + SCTP_STAT_INCR(sctps_sendswcrc); #endif if (V_udp_cksum) { SCTP_ENABLE_UDP_CSUM(o_pak); @@ -4474,14 +4468,8 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) && - (stcb) && - (stcb->asoc.loopback_scope))) { - sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); - } else { - SCTP_STAT_INCR(sctps_sendnocrc); - } + sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); + SCTP_STAT_INCR(sctps_sendswcrc); #endif if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), packet_length - sizeof(struct ip6_hdr))) == 0) { udp->uh_sum = 0xffff; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sat May 26 09:13:38 2012 (r236086) +++ head/sys/netinet/sctp_sysctl.c Sat May 26 09:16:33 2012 (r236087) @@ -55,9 +55,6 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; -#if !defined(SCTP_WITH_NO_CSUM) - SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT; -#endif SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; @@ -604,9 +601,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); -#if !defined(SCTP_WITH_NO_CSUM) - RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX); -#endif RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); @@ -870,11 +864,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); -#if !defined(SCTP_WITH_NO_CSUM) -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", - SCTPCTL_LOOPBACK_NOCSUM_DESC); -#endif SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sat May 26 09:13:38 2012 (r236086) +++ head/sys/netinet/sctp_sysctl.h Sat May 26 09:16:33 2012 (r236087) @@ -47,9 +47,6 @@ struct sctp_sysctl { uint32_t sctp_ecn_enable; uint32_t sctp_fr_max_burst_default; uint32_t sctp_strict_sacks; -#if !defined(SCTP_WITH_NO_CSUM) - uint32_t sctp_no_csum_on_loopback; -#endif uint32_t sctp_peer_chunk_oh; uint32_t sctp_max_burst_default; uint32_t sctp_max_chunks_on_queue; Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sat May 26 09:13:38 2012 (r236086) +++ head/sys/netinet6/sctp6_usrreq.c Sat May 26 09:16:33 2012 (r236087) @@ -150,11 +150,6 @@ sctp6_input(struct mbuf **i_pak, int *of goto sctp_skip_csum; } check = sh->checksum; /* save incoming checksum */ - if ((check == 0) && (SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback)) && - (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &ip6->ip6_dst))) { - SCTP_STAT_INCR(sctps_recvnocrc); - goto sctp_skip_csum; - } sh->checksum = 0; /* prepare for calc */ calc_check = sctp_calculate_cksum(m, iphlen); SCTP_STAT_INCR(sctps_recvswcrc); From owner-svn-src-all@FreeBSD.ORG Sat May 26 09:16:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02B64106566B; Sat, 26 May 2012 09:16:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E05638FC1F; Sat, 26 May 2012 09:16: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 q4Q9Gbq0065489; Sat, 26 May 2012 09:16:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q9GbwX065487; Sat, 26 May 2012 09:16:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260916.q4Q9GbwX065487@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:16: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: r236088 - stable/9/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:16:38 -0000 Author: marius Date: Sat May 26 09:16:37 2012 New Revision: 236088 URL: http://svn.freebsd.org/changeset/base/236088 Log: MFC: r234901 - Add missing locking in at91_usart_getc(). - Align the RX buffers on the cache line size, otherwise the requirement of partial cache line flushes on every are pretty much guaranteed. [1] - Make the code setting the RX timeout match its comment (apparently, start and stop bits were missed in the previous calculation). [1] - Cover the busdma operations in at91_usart_bus_{ipend,transmit}() with the hardware mutex, too, so these don't race against each other. - In at91_usart_bus_ipend(), reduce duplication in the code dealing with TX interrupts. - In at91_usart_bus_ipend(), turn the code dealing with RX interrupts into an else-if cascade in order reduce its complexity and to improve its run-time behavior. - In at91_usart_bus_ipend(), add missing BUS_DMASYNC_PREREAD calls on the RX buffer map before handing things over to the hardware again. [1] - In at91_usart_bus_getsig(), used a variable of sufficient width for storing the contents of USART_CSR. - Use KOBJMETHOD_END. - Remove an unused header. Submitted by: Ian Lepore [1] Reviewed by: Ian Lepore Modified: stable/9/sys/arm/at91/uart_dev_at91usart.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- stable/9/sys/arm/at91/uart_dev_at91usart.c Sat May 26 09:16:33 2012 (r236087) +++ stable/9/sys/arm/at91/uart_dev_at91usart.c Sat May 26 09:16:37 2012 (r236088) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -55,16 +54,17 @@ __FBSDID("$FreeBSD$"); */ struct at91_usart_rx { bus_addr_t pa; - uint8_t buffer[USART_BUFFER_SIZE]; + uint8_t *buffer; bus_dmamap_t map; }; struct at91_usart_softc { struct uart_softc base; - bus_dma_tag_t dmatag; /* bus dma tag for mbufs */ + bus_dma_tag_t tx_tag; bus_dmamap_t tx_map; uint32_t flags; -#define HAS_TIMEOUT 1 +#define HAS_TIMEOUT 1 + bus_dma_tag_t rx_tag; struct at91_usart_rx ping_pong[2]; struct at91_usart_rx *ping; struct at91_usart_rx *pong; @@ -95,7 +95,7 @@ static void at91_usart_init(struct uart_ static void at91_usart_term(struct uart_bas *bas); static void at91_usart_putc(struct uart_bas *bas, int); static int at91_usart_rxready(struct uart_bas *bas); -static int at91_usart_getc(struct uart_bas *bas, struct mtx *mtx); +static int at91_usart_getc(struct uart_bas *bas, struct mtx *hwmtx); extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; @@ -106,7 +106,7 @@ at91_usart_param(struct uart_bas *bas, i uint32_t mr; /* - * Assume 3-write RS-232 configuration. + * Assume 3-wire RS-232 configuration. * XXX Not sure how uart will present the other modes to us, so * XXX they are unimplemented. maybe ioctl? */ @@ -209,6 +209,7 @@ static struct uart_ops at91_usart_ops = static int at91_usart_probe(struct uart_bas *bas) { + /* We know that this is always here */ return (0); } @@ -236,6 +237,7 @@ at91_usart_init(struct uart_bas *bas, in static void at91_usart_term(struct uart_bas *bas) { + /* XXX */ } @@ -247,7 +249,7 @@ static void at91_usart_putc(struct uart_bas *bas, int c) { - while (!(RD4(bas, USART_CSR) & USART_CSR_TXRDY)) + while (!(RD4(bas, USART_CSR) & USART_CSR_TXRDY)) continue; WR4(bas, USART_THR, c); } @@ -266,14 +268,18 @@ at91_usart_rxready(struct uart_bas *bas) * Block waiting for a character. */ static int -at91_usart_getc(struct uart_bas *bas, struct mtx *mtx) +at91_usart_getc(struct uart_bas *bas, struct mtx *hwmtx) { int c; - while (!(RD4(bas, USART_CSR) & USART_CSR_RXRDY)) - continue; - c = RD4(bas, USART_RHR); - c &= 0xff; + uart_lock(hwmtx); + while (!(RD4(bas, USART_CSR) & USART_CSR_RXRDY)) { + uart_unlock(hwmtx); + DELAY(4); + uart_lock(hwmtx); + } + c = RD4(bas, USART_RHR) & 0xff; + uart_unlock(hwmtx); return (c); } @@ -290,7 +296,7 @@ static int at91_usart_bus_transmit(struc static kobj_method_t at91_usart_methods[] = { KOBJMETHOD(uart_probe, at91_usart_bus_probe), - KOBJMETHOD(uart_attach, at91_usart_bus_attach), + KOBJMETHOD(uart_attach, at91_usart_bus_attach), KOBJMETHOD(uart_flush, at91_usart_bus_flush), KOBJMETHOD(uart_getsig, at91_usart_bus_getsig), KOBJMETHOD(uart_ioctl, at91_usart_bus_ioctl), @@ -299,8 +305,8 @@ static kobj_method_t at91_usart_methods[ KOBJMETHOD(uart_receive, at91_usart_bus_receive), KOBJMETHOD(uart_setsig, at91_usart_bus_setsig), KOBJMETHOD(uart_transmit, at91_usart_bus_transmit), - - { 0, 0 } + + KOBJMETHOD_END }; int @@ -316,6 +322,7 @@ at91_usart_bus_probe(struct uart_softc * static void at91_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { + if (error != 0) return; *(bus_addr_t *)arg = segs[0].ds_addr; @@ -344,41 +351,53 @@ at91_usart_bus_attach(struct uart_softc WR4(&sc->sc_bas, USART_IDR, 0xffffffff); /* - * Allocate DMA tags and maps + * Allocate transmit DMA tag and map. We allow a transmit buffer + * to be any size, but it must map to a single contiguous physical + * extent. */ err = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - USART_BUFFER_SIZE, 1, USART_BUFFER_SIZE, BUS_DMA_ALLOCNOW, NULL, - NULL, &atsc->dmatag); + BUS_SPACE_MAXSIZE_32BIT, 1, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, + NULL, &atsc->tx_tag); if (err != 0) goto errout; - err = bus_dmamap_create(atsc->dmatag, 0, &atsc->tx_map); + err = bus_dmamap_create(atsc->tx_tag, 0, &atsc->tx_map); if (err != 0) goto errout; + if (atsc->flags & HAS_TIMEOUT) { + /* + * Allocate receive DMA tags, maps, and buffers. + * The receive buffers should be aligned to arm_dcache_align, + * otherwise partial cache line flushes on every receive + * interrupt are pretty much guaranteed. + */ + err = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), + arm_dcache_align, 0, BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR, NULL, NULL, sc->sc_rxfifosz, 1, + sc->sc_rxfifosz, BUS_DMA_ALLOCNOW, NULL, NULL, + &atsc->rx_tag); + if (err != 0) + goto errout; for (i = 0; i < 2; i++) { - err = bus_dmamap_create(atsc->dmatag, 0, - &atsc->ping_pong[i].map); + err = bus_dmamem_alloc(atsc->rx_tag, + (void **)&atsc->ping_pong[i].buffer, + BUS_DMA_NOWAIT, &atsc->ping_pong[i].map); if (err != 0) goto errout; - err = bus_dmamap_load(atsc->dmatag, + err = bus_dmamap_load(atsc->rx_tag, atsc->ping_pong[i].map, atsc->ping_pong[i].buffer, sc->sc_rxfifosz, at91_getaddr, &atsc->ping_pong[i].pa, 0); if (err != 0) goto errout; - bus_dmamap_sync(atsc->dmatag, atsc->ping_pong[i].map, + bus_dmamap_sync(atsc->rx_tag, atsc->ping_pong[i].map, BUS_DMASYNC_PREREAD); } atsc->ping = &atsc->ping_pong[0]; atsc->pong = &atsc->ping_pong[1]; } - /* - * Prime the pump with the RX buffer. We use two 64 byte bounce - * buffers here to avoid data overflow. - */ - /* Turn on rx and tx */ cr = USART_CR_RSTSTA | USART_CR_RSTRX | USART_CR_RSTTX; WR4(&sc->sc_bas, USART_CR, cr); @@ -397,8 +416,11 @@ at91_usart_bus_attach(struct uart_softc WR4(&sc->sc_bas, PDC_RNCR, sc->sc_rxfifosz); WR4(&sc->sc_bas, PDC_PTCR, PDC_PTCR_RXTEN); - /* Set the receive timeout to be 1.5 character times. */ - WR4(&sc->sc_bas, USART_RTOR, 12); + /* + * Set the receive timeout to be 1.5 character times + * assuming 8N1. + */ + WR4(&sc->sc_bas, USART_RTOR, 15); WR4(&sc->sc_bas, USART_CR, USART_CR_STTTO); WR4(&sc->sc_bas, USART_IER, USART_CSR_TIMEOUT | USART_CSR_RXBUFF | USART_CSR_ENDRX); @@ -407,7 +429,6 @@ at91_usart_bus_attach(struct uart_softc } WR4(&sc->sc_bas, USART_IER, USART_CSR_RXBRK); errout:; - // XXX bad return (err); } @@ -416,14 +437,17 @@ at91_usart_bus_transmit(struct uart_soft { bus_addr_t addr; struct at91_usart_softc *atsc; + int err; + err = 0; atsc = (struct at91_usart_softc *)sc; - if (bus_dmamap_load(atsc->dmatag, atsc->tx_map, sc->sc_txbuf, - sc->sc_txdatasz, at91_getaddr, &addr, 0) != 0) - return (EAGAIN); - bus_dmamap_sync(atsc->dmatag, atsc->tx_map, BUS_DMASYNC_PREWRITE); - uart_lock(sc->sc_hwmtx); + if (bus_dmamap_load(atsc->tx_tag, atsc->tx_map, sc->sc_txbuf, + sc->sc_txdatasz, at91_getaddr, &addr, 0) != 0) { + err = EAGAIN; + goto errout; + } + bus_dmamap_sync(atsc->tx_tag, atsc->tx_map, BUS_DMASYNC_PREWRITE); sc->sc_txbusy = 1; /* * Setup the PDC to transfer the data and interrupt us when it @@ -433,9 +457,11 @@ at91_usart_bus_transmit(struct uart_soft WR4(&sc->sc_bas, PDC_TCR, sc->sc_txdatasz); WR4(&sc->sc_bas, PDC_PTCR, PDC_PTCR_TXTEN); WR4(&sc->sc_bas, USART_IER, USART_CSR_ENDTX); +errout: uart_unlock(sc->sc_hwmtx); - return (0); + return (err); } + static int at91_usart_bus_setsig(struct uart_softc *sc, int sig) { @@ -465,12 +491,14 @@ at91_usart_bus_setsig(struct uart_softc uart_unlock(sc->sc_hwmtx); return (0); } + static int at91_usart_bus_receive(struct uart_softc *sc) { return (0); } + static int at91_usart_bus_param(struct uart_softc *sc, int baudrate, int databits, int stopbits, int parity) @@ -488,33 +516,31 @@ at91_rx_put(struct uart_softc *sc, int k if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) kdb_alt_break(key, &sc->sc_altbrk); #endif - uart_rx_put(sc, key); + uart_rx_put(sc, key); } static int at91_usart_bus_ipend(struct uart_softc *sc) { - int csr = RD4(&sc->sc_bas, USART_CSR); - int ipend = 0, i, len; struct at91_usart_softc *atsc; struct at91_usart_rx *p; + int i, ipend, len; + uint32_t csr; - atsc = (struct at91_usart_softc *)sc; + ipend = 0; + atsc = (struct at91_usart_softc *)sc; + uart_lock(sc->sc_hwmtx); + csr = RD4(&sc->sc_bas, USART_CSR); if (csr & USART_CSR_ENDTX) { - bus_dmamap_sync(atsc->dmatag, atsc->tx_map, + bus_dmamap_sync(atsc->tx_tag, atsc->tx_map, BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(atsc->dmatag, atsc->tx_map); - } - uart_lock(sc->sc_hwmtx); - if (csr & USART_CSR_TXRDY) { - if (sc->sc_txbusy) - ipend |= SER_INT_TXIDLE; - WR4(&sc->sc_bas, USART_IDR, USART_CSR_TXRDY); + bus_dmamap_unload(atsc->tx_tag, atsc->tx_map); } - if (csr & USART_CSR_ENDTX) { + if (csr & (USART_CSR_TXRDY | USART_CSR_ENDTX)) { if (sc->sc_txbusy) ipend |= SER_INT_TXIDLE; - WR4(&sc->sc_bas, USART_IDR, USART_CSR_ENDTX); + WR4(&sc->sc_bas, USART_IDR, csr & (USART_CSR_TXRDY | + USART_CSR_ENDTX)); } /* @@ -523,90 +549,103 @@ at91_usart_bus_ipend(struct uart_softc * * and do all the work elsewhere. I need to look at the CSR * bits right now and do things based on them to avoid races. */ - if ((atsc->flags & HAS_TIMEOUT) && (csr & USART_CSR_RXBUFF)) { - // Have a buffer overflow. Copy all data from both - // ping and pong. Insert overflow character. Reset - // ping and pong and re-enable the PDC to receive - // characters again. - bus_dmamap_sync(atsc->dmatag, atsc->ping->map, - BUS_DMASYNC_POSTREAD); - bus_dmamap_sync(atsc->dmatag, atsc->pong->map, - BUS_DMASYNC_POSTREAD); - for (i = 0; i < sc->sc_rxfifosz; i++) - at91_rx_put(sc, atsc->ping->buffer[i]); - for (i = 0; i < sc->sc_rxfifosz; i++) - at91_rx_put(sc, atsc->pong->buffer[i]); - uart_rx_put(sc, UART_STAT_OVERRUN); - csr &= ~(USART_CSR_ENDRX | USART_CSR_TIMEOUT); - WR4(&sc->sc_bas, PDC_RPR, atsc->ping->pa); - WR4(&sc->sc_bas, PDC_RCR, sc->sc_rxfifosz); - WR4(&sc->sc_bas, PDC_RNPR, atsc->pong->pa); - WR4(&sc->sc_bas, PDC_RNCR, sc->sc_rxfifosz); - WR4(&sc->sc_bas, PDC_PTCR, PDC_PTCR_RXTEN); - ipend |= SER_INT_RXREADY; - } - if ((atsc->flags & HAS_TIMEOUT) && (csr & USART_CSR_ENDRX)) { - // Shuffle data from 'ping' of ping pong buffer, but - // leave current 'pong' in place, as it has become the - // new 'ping'. We need to copy data and setup the old - // 'ping' as the new 'pong' when we're done. - bus_dmamap_sync(atsc->dmatag, atsc->ping->map, - BUS_DMASYNC_POSTREAD); - for (i = 0; i < sc->sc_rxfifosz; i++) - at91_rx_put(sc, atsc->ping->buffer[i]); - p = atsc->ping; - atsc->ping = atsc->pong; - atsc->pong = p; - WR4(&sc->sc_bas, PDC_RNPR, atsc->pong->pa); - WR4(&sc->sc_bas, PDC_RNCR, sc->sc_rxfifosz); - ipend |= SER_INT_RXREADY; - } - if ((atsc->flags & HAS_TIMEOUT) && (csr & USART_CSR_TIMEOUT)) { - // We have one partial buffer. We need to stop the - // PDC, get the number of characters left and from - // that compute number of valid characters. We then - // need to reset ping and pong and reenable the PDC. - // Not sure if there's a race here at fast baud rates - // we need to worry about. - WR4(&sc->sc_bas, PDC_PTCR, PDC_PTCR_RXTDIS); - bus_dmamap_sync(atsc->dmatag, atsc->ping->map, - BUS_DMASYNC_POSTREAD); - len = sc->sc_rxfifosz - RD4(&sc->sc_bas, PDC_RCR); - for (i = 0; i < len; i++) - at91_rx_put(sc, atsc->ping->buffer[i]); - WR4(&sc->sc_bas, PDC_RPR, atsc->ping->pa); - WR4(&sc->sc_bas, PDC_RCR, sc->sc_rxfifosz); - WR4(&sc->sc_bas, USART_CR, USART_CR_STTTO); - WR4(&sc->sc_bas, PDC_PTCR, PDC_PTCR_RXTEN); - ipend |= SER_INT_RXREADY; - } - if (!(atsc->flags & HAS_TIMEOUT) && (csr & USART_CSR_RXRDY)) { - // We have another charater in a device that doesn't support - // timeouts, so we do it one character at a time. + if (atsc->flags & HAS_TIMEOUT) { + if (csr & USART_CSR_RXBUFF) { + /* + * We have a buffer overflow. Copy all data from both + * ping and pong. Insert overflow character. Reset + * ping and pong and re-enable the PDC to receive + * characters again. + */ + bus_dmamap_sync(atsc->rx_tag, atsc->ping->map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(atsc->rx_tag, atsc->pong->map, + BUS_DMASYNC_POSTREAD); + for (i = 0; i < sc->sc_rxfifosz; i++) + at91_rx_put(sc, atsc->ping->buffer[i]); + for (i = 0; i < sc->sc_rxfifosz; i++) + at91_rx_put(sc, atsc->pong->buffer[i]); + uart_rx_put(sc, UART_STAT_OVERRUN); + bus_dmamap_sync(atsc->rx_tag, atsc->ping->map, + BUS_DMASYNC_PREREAD); + bus_dmamap_sync(atsc->rx_tag, atsc->pong->map, + BUS_DMASYNC_PREREAD); + WR4(&sc->sc_bas, PDC_RPR, atsc->ping->pa); + WR4(&sc->sc_bas, PDC_RCR, sc->sc_rxfifosz); + WR4(&sc->sc_bas, PDC_RNPR, atsc->pong->pa); + WR4(&sc->sc_bas, PDC_RNCR, sc->sc_rxfifosz); + WR4(&sc->sc_bas, PDC_PTCR, PDC_PTCR_RXTEN); + ipend |= SER_INT_RXREADY; + } else if (csr & USART_CSR_ENDRX) { + /* + * Shuffle data from ping of ping pong buffer, but + * leave current pong in place, as it has become the + * new ping. We need to copy data and setup the old + * ping as the new pong when we're done. + */ + bus_dmamap_sync(atsc->rx_tag, atsc->ping->map, + BUS_DMASYNC_POSTREAD); + for (i = 0; i < sc->sc_rxfifosz; i++) + at91_rx_put(sc, atsc->ping->buffer[i]); + p = atsc->ping; + atsc->ping = atsc->pong; + atsc->pong = p; + bus_dmamap_sync(atsc->rx_tag, atsc->pong->map, + BUS_DMASYNC_PREREAD); + WR4(&sc->sc_bas, PDC_RNPR, atsc->pong->pa); + WR4(&sc->sc_bas, PDC_RNCR, sc->sc_rxfifosz); + ipend |= SER_INT_RXREADY; + } else if (csr & USART_CSR_TIMEOUT) { + /* + * We have one partial buffer. We need to stop the + * PDC, get the number of characters left and from + * that compute number of valid characters. We then + * need to reset ping and pong and reenable the PDC. + * Not sure if there's a race here at fast baud rates + * we need to worry about. + */ + WR4(&sc->sc_bas, PDC_PTCR, PDC_PTCR_RXTDIS); + bus_dmamap_sync(atsc->rx_tag, atsc->ping->map, + BUS_DMASYNC_POSTREAD); + len = sc->sc_rxfifosz - RD4(&sc->sc_bas, PDC_RCR); + for (i = 0; i < len; i++) + at91_rx_put(sc, atsc->ping->buffer[i]); + bus_dmamap_sync(atsc->rx_tag, atsc->ping->map, + BUS_DMASYNC_PREREAD); + WR4(&sc->sc_bas, PDC_RPR, atsc->ping->pa); + WR4(&sc->sc_bas, PDC_RCR, sc->sc_rxfifosz); + WR4(&sc->sc_bas, USART_CR, USART_CR_STTTO); + WR4(&sc->sc_bas, PDC_PTCR, PDC_PTCR_RXTEN); + ipend |= SER_INT_RXREADY; + } + } else if (csr & USART_CSR_RXRDY) { + /* + * We have another charater in a device that doesn't support + * timeouts, so we do it one character at a time. + */ at91_rx_put(sc, RD4(&sc->sc_bas, USART_RHR) & 0xff); ipend |= SER_INT_RXREADY; } if (csr & USART_CSR_RXBRK) { - unsigned int cr = USART_CR_RSTSTA; - ipend |= SER_INT_BREAK; - WR4(&sc->sc_bas, USART_CR, cr); + WR4(&sc->sc_bas, USART_CR, USART_CR_RSTSTA); } uart_unlock(sc->sc_hwmtx); return (ipend); } + static int at91_usart_bus_flush(struct uart_softc *sc, int what) { + return (0); } static int at91_usart_bus_getsig(struct uart_softc *sc) { - uint32_t new, sig; - uint8_t csr; + uint32_t csr, new, sig; uart_lock(sc->sc_hwmtx); csr = RD4(&sc->sc_bas, USART_CSR); @@ -628,6 +667,7 @@ at91_usart_bus_getsig(struct uart_softc static int at91_usart_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) { + switch (request) { case UART_IOCTL_BREAK: case UART_IOCTL_IFLOW: @@ -637,7 +677,7 @@ at91_usart_bus_ioctl(struct uart_softc * /* only if we know our master clock rate */ if (DEFAULT_RCLK != 0) WR4(&sc->sc_bas, USART_BRGR, - BAUD2DIVISOR(*(int *)data)); + BAUD2DIVISOR(*(int *)data)); return (0); } return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Sat May 26 09:31:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F2791065676; Sat, 26 May 2012 09:31:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1F508FC0A; Sat, 26 May 2012 09:31:23 +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 q4Q9VNhD066139; Sat, 26 May 2012 09:31:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q9VNLt066132; Sat, 26 May 2012 09:31:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260931.q4Q9VNLt066132@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:31:23 +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: r236089 - in stable/9/sys: dev/mmc modules/mmcsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:31:25 -0000 Author: marius Date: Sat May 26 09:31:23 2012 New Revision: 236089 URL: http://svn.freebsd.org/changeset/base/236089 Log: MFC: r234524 o Fixes: - When switching to 4-bit operation, send a SET_CLR_CARD_DETECT command to disconnect the card-detect pull-up resistor from the DAT3 line before sending the SET_BUS_WIDTH command. - Add the missing "reserved" zero entry to the mantissa table used to decode various CSD fields. This was causing SD cards to report that they could run at 30 MHz instead of the maximum 25 MHz mandated in the spec. o Enhancements: - At the MMC layer, format various info from the CID into a string that uniquely identifies the card instance (manufacturer number, serial number, product name and revision, etc). Export it as an instance variable. - At the MMCSD layer, display the formatted card ID string, and also report the clock speed of the hardware (not the card's max speed), and the number of bits and number of blocks per transfer. It comes out like this now: mmcsd0: 968MB at mmc0 22.5MHz/4bit/128-block o Use DEVMETHOD_END. o Use NULL instead of 0 for pointers. PR: 156496 Submitted by: Ian Lepore Modified: stable/9/sys/dev/mmc/mmc.c stable/9/sys/dev/mmc/mmcbrvar.h stable/9/sys/dev/mmc/mmcreg.h stable/9/sys/dev/mmc/mmcsd.c stable/9/sys/dev/mmc/mmcvar.h stable/9/sys/modules/mmcsd/Makefile 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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/mmc/mmc.c ============================================================================== --- stable/9/sys/dev/mmc/mmc.c Sat May 26 09:16:37 2012 (r236088) +++ stable/9/sys/dev/mmc/mmc.c Sat May 26 09:31:23 2012 (r236089) @@ -101,6 +101,7 @@ struct mmc_ivars { uint32_t tran_speed; /* Max speed in normal mode */ uint32_t hs_tran_speed; /* Max speed in high speed mode */ uint32_t erase_sector; /* Card native erase sector size */ + char card_id_string[64];/* Formatted CID info (serial, MFG, etc) */ }; #define CMD_RETRIES 3 @@ -140,6 +141,7 @@ static void mmc_app_decode_scr(uint32_t static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd); static void mmc_scan(struct mmc_softc *sc); static int mmc_delete_cards(struct mmc_softc *sc); +static void mmc_format_card_id_string(struct mmc_ivars *ivar); static void mmc_ms_delay(int ms) @@ -606,6 +608,13 @@ mmc_set_card_bus_width(struct mmc_softc if (mmcbr_get_mode(sc->dev) == mode_sd) { memset(&cmd, 0, sizeof(struct mmc_command)); + cmd.opcode = ACMD_SET_CLR_CARD_DETECT; + cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; + cmd.arg = SD_CLR_CARD_DETECT; + err = mmc_wait_for_app_cmd(sc, rca, &cmd, CMD_RETRIES); + if (err != 0) + return (err); + memset(&cmd, 0, sizeof(struct mmc_command)); cmd.opcode = ACMD_SET_BUS_WIDTH; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; switch (width) { @@ -788,15 +797,52 @@ mmc_decode_cid_mmc(uint32_t *raw_cid, st cid->mdt_year = mmc_get_bits(raw_cid, 128, 8, 4) + 1997; } +static void +mmc_format_card_id_string(struct mmc_ivars *ivar) +{ + char oidstr[8]; + uint8_t c1; + uint8_t c2; + + /* + * Format a card ID string for use by the mmcsd driver, it's what + * appears between the <> in the following: + * mmcsd0: 968MB at mmc0 + * 22.5MHz/4bit/128-block + * + * The card_id_string in mmc_ivars is currently allocated as 64 bytes, + * and our max formatted length is currently 55 bytes if every field + * contains the largest value. + * + * Sometimes the oid is two printable ascii chars; when it's not, + * format it as 0xnnnn instead. + */ + c1 = (ivar->cid.oid >> 8) & 0x0ff; + c2 = ivar->cid.oid & 0x0ff; + if (c1 > 0x1f && c1 < 0x7f && c2 > 0x1f && c2 < 0x7f) + snprintf(oidstr, sizeof(oidstr), "%c%c", c1, c2); + else + snprintf(oidstr, sizeof(oidstr), "0x%04x", ivar->cid.oid); + snprintf(ivar->card_id_string, sizeof(ivar->card_id_string), + "%s%s %s %d.%d SN %d MFG %02d/%04d by %d %s", + ivar->mode == mode_sd ? "SD" : "MMC", ivar->high_cap ? "HC" : "", + ivar->cid.pnm, ivar->cid.prv >> 4, ivar->cid.prv & 0x0f, + ivar->cid.psn, ivar->cid.mdt_month, ivar->cid.mdt_year, + ivar->cid.mid, oidstr); +} + static const int exp[8] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000 }; + static const int mant[16] = { - 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 + 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 }; + static const int cur_min[8] = { 500, 1000, 5000, 10000, 25000, 35000, 60000, 100000 }; + static const int cur_max[8] = { 1000, 5000, 10000, 25000, 35000, 45000, 800000, 200000 }; @@ -1080,13 +1126,7 @@ mmc_log_card(device_t dev, struct mmc_iv { device_printf(dev, "Card at relative address %d%s:\n", ivar->rca, newcard ? " added" : ""); - device_printf(dev, " card: %s%s (0x%x/0x%x/\"%s\" rev %d.%d " - "m/d %02d.%04d s/n %08x)\n", - ivar->mode == mode_sd ? "SD" : "MMC", - ivar->high_cap ? " High Capacity" : "", - ivar->cid.mid, ivar->cid.oid, - ivar->cid.pnm, ivar->cid.prv >> 4, ivar->cid.prv & 0x0f, - ivar->cid.mdt_month, ivar->cid.mdt_year, ivar->cid.psn); + device_printf(dev, " card: %s\n", ivar->card_id_string); device_printf(dev, " bus: %ubit, %uMHz%s\n", (ivar->bus_width == bus_width_1 ? 1 : (ivar->bus_width == bus_width_4 ? 4 : 8)), @@ -1188,6 +1228,7 @@ mmc_discover_cards(struct mmc_softc *sc) if ((mmcbr_get_caps(sc->dev) & MMC_CAP_4_BIT_DATA) && (ivar->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) ivar->bus_width = bus_width_4; + mmc_format_card_id_string(ivar); if (bootverbose || mmc_debug) mmc_log_card(sc->dev, ivar, newcard); if (newcard) { @@ -1245,6 +1286,7 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->bus_width = bus_width_1; ivar->timing = bus_timing_normal; } + mmc_format_card_id_string(ivar); if (bootverbose || mmc_debug) mmc_log_card(sc->dev, ivar, newcard); if (newcard) { @@ -1477,6 +1519,9 @@ mmc_read_ivar(device_t bus, device_t chi case MMC_IVAR_MAX_DATA: *result = mmcbr_get_max_data(bus); break; + case MMC_IVAR_CARD_ID_STRING: + *(char **)result = ivar->card_id_string; + break; } return (0); } @@ -1527,7 +1572,7 @@ static device_method_t mmc_methods[] = { DEVMETHOD(mmcbus_acquire_bus, mmc_acquire_bus), DEVMETHOD(mmcbus_release_bus, mmc_release_bus), - {0, 0}, + DEVMETHOD_END }; static driver_t mmc_driver = { @@ -1537,6 +1582,5 @@ static driver_t mmc_driver = { }; static devclass_t mmc_devclass; - DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci, mmc_driver, mmc_devclass, NULL, NULL); Modified: stable/9/sys/dev/mmc/mmcbrvar.h ============================================================================== --- stable/9/sys/dev/mmc/mmcbrvar.h Sat May 26 09:16:37 2012 (r236088) +++ stable/9/sys/dev/mmc/mmcbrvar.h Sat May 26 09:31:23 2012 (r236089) @@ -56,6 +56,7 @@ #define DEV_MMC_MMCBRVAR_H #include +#include #include "mmcbr_if.h" enum mmcbr_device_ivars { @@ -72,8 +73,7 @@ enum mmcbr_device_ivars { MMCBR_IVAR_VDD, MMCBR_IVAR_CAPS, MMCBR_IVAR_TIMING, - MMCBR_IVAR_MAX_DATA, -// MMCBR_IVAR_, + MMCBR_IVAR_MAX_DATA }; /* Modified: stable/9/sys/dev/mmc/mmcreg.h ============================================================================== --- stable/9/sys/dev/mmc/mmcreg.h Sat May 26 09:16:37 2012 (r236088) +++ stable/9/sys/dev/mmc/mmcreg.h Sat May 26 09:31:23 2012 (r236089) @@ -139,8 +139,8 @@ struct mmc_command { #define R1_READY_FOR_DATA (1u << 8) /* sx, a */ #define R1_APP_CMD (1u << 5) /* sr, c */ #define R1_AKE_SEQ_ERROR (1u << 3) /* er, c */ -#define R1_STATUS(x) (x & 0xFFFFE000 -#define R1_CURRENT_STATE(x) ((x) & R1_CURRENT_STATE_MASK) >> 9 +#define R1_STATUS(x) ((x) & 0xFFFFE000) +#define R1_CURRENT_STATE(x) (((x) & R1_CURRENT_STATE_MASK) >> 9) #define R1_STATE_IDLE 0 #define R1_STATE_READY 1 #define R1_STATE_IDENT 2 @@ -330,6 +330,9 @@ struct mmc_request { #define SD_SWITCH_HS_MODE 1 #define SD_SWITCH_NOCHANGE 0xF +#define SD_CLR_CARD_DETECT 0 +#define SD_SET_CARD_DETECT 1 + #define SD_MAX_HS 50000000 /* OCR bits */ @@ -380,7 +383,7 @@ struct mmc_cid { uint8_t fwrev; }; -struct mmc_csd +struct mmc_csd { uint8_t csd_structure; uint8_t spec_vers; Modified: stable/9/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/9/sys/dev/mmc/mmcsd.c Sat May 26 09:16:37 2012 (r236088) +++ stable/9/sys/dev/mmc/mmcsd.c Sat May 26 09:31:23 2012 (r236089) @@ -66,11 +66,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include +#include #include "mmcbus_if.h" +#if __FreeBSD_version < 800002 +#define kproc_create kthread_create +#define kproc_exit kthread_exit +#endif + struct mmcsd_softc { device_t dev; struct mtx sc_mtx; @@ -95,7 +101,6 @@ static int mmcsd_dump(void *arg, void *v off_t offset, size_t length); static void mmcsd_task(void *arg); -static const char *mmcsd_card_name(device_t dev); static int mmcsd_bus_bit_width(device_t dev); #define MMCSD_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -122,6 +127,8 @@ mmcsd_attach(device_t dev) struct mmcsd_softc *sc; struct disk *d; intmax_t mb; + uint32_t speed; + uint32_t maxblocks; char unit; sc = device_get_softc(dev); @@ -157,11 +164,22 @@ mmcsd_attach(device_t dev) unit = 'G'; mb /= 1024; } - device_printf(dev, "%ju%cB <%s Memory Card>%s at %s %dMHz/%dbit\n", - mb, unit, mmcsd_card_name(dev), + /* + * Report the clock speed of the underlying hardware, which might be + * different than what the card reports due to hardware limitations. + * Report how many blocks the hardware transfers at once, but clip the + * number to MAXPHYS since the system won't initiate larger transfers. + */ + speed = mmcbr_get_clock(device_get_parent(dev)); + maxblocks = mmc_get_max_data(dev); + if (maxblocks > MAXPHYS) + maxblocks = MAXPHYS; + device_printf(dev, "%ju%cB <%s>%s at %s %d.%01dMHz/%dbit/%d-block\n", + mb, unit, mmc_get_card_id_string(dev), mmc_get_read_only(dev) ? " (read-only)" : "", device_get_nameunit(device_get_parent(dev)), - mmc_get_tran_speed(dev) / 1000000, mmcsd_bus_bit_width(dev)); + speed / 1000000, (speed / 100000) % 10, + mmcsd_bus_bit_width(dev), maxblocks); disk_create(d, DISK_VERSION); bioq_init(&sc->bio_queue); @@ -500,16 +518,6 @@ out: kproc_exit(0); } -static const char * -mmcsd_card_name(device_t dev) -{ - if (mmc_get_card_type(dev) == mode_mmc) - return ("MMC"); - if (mmc_get_high_cap(dev)) - return ("SDHC"); - return ("SD"); -} - static int mmcsd_bus_bit_width(device_t dev) { @@ -526,7 +534,7 @@ static device_method_t mmcsd_methods[] = DEVMETHOD(device_detach, mmcsd_detach), DEVMETHOD(device_suspend, mmcsd_suspend), DEVMETHOD(device_resume, mmcsd_resume), - {0, 0}, + DEVMETHOD_END }; static driver_t mmcsd_driver = { @@ -536,4 +544,4 @@ static driver_t mmcsd_driver = { }; static devclass_t mmcsd_devclass; -DRIVER_MODULE(mmcsd, mmc, mmcsd_driver, mmcsd_devclass, 0, 0); +DRIVER_MODULE(mmcsd, mmc, mmcsd_driver, mmcsd_devclass, NULL, NULL); Modified: stable/9/sys/dev/mmc/mmcvar.h ============================================================================== --- stable/9/sys/dev/mmc/mmcvar.h Sat May 26 09:16:37 2012 (r236088) +++ stable/9/sys/dev/mmc/mmcvar.h Sat May 26 09:31:23 2012 (r236089) @@ -69,7 +69,7 @@ enum mmc_device_ivars { MMC_IVAR_BUS_WIDTH, MMC_IVAR_ERASE_SECTOR, MMC_IVAR_MAX_DATA, -// MMC_IVAR_, + MMC_IVAR_CARD_ID_STRING }; /* @@ -89,5 +89,6 @@ MMC_ACCESSOR(card_type, CARD_TYPE, int) MMC_ACCESSOR(bus_width, BUS_WIDTH, int) MMC_ACCESSOR(erase_sector, ERASE_SECTOR, int) MMC_ACCESSOR(max_data, MAX_DATA, int) +MMC_ACCESSOR(card_id_string, CARD_ID_STRING, const char *) #endif /* DEV_MMC_MMCVAR_H */ Modified: stable/9/sys/modules/mmcsd/Makefile ============================================================================== --- stable/9/sys/modules/mmcsd/Makefile Sat May 26 09:16:37 2012 (r236088) +++ stable/9/sys/modules/mmcsd/Makefile Sat May 26 09:31:23 2012 (r236089) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../dev/mmc KMOD= mmcsd -SRCS= mmcsd.c mmcbus_if.h device_if.h bus_if.h +SRCS= bus_if.h device_if.h mmcbr_if.h mmcbus_if.h mmcsd.c .include From owner-svn-src-all@FreeBSD.ORG Sat May 26 09:31:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D55C1065672; Sat, 26 May 2012 09:31:26 +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 55F648FC08; Sat, 26 May 2012 09:31: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 q4Q9VQVV066174; Sat, 26 May 2012 09:31:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q9VQTO066167; Sat, 26 May 2012 09:31:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260931.q4Q9VQTO066167@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 09:31:26 +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: r236090 - in stable/8/sys: dev/mmc modules/mmcsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:31:26 -0000 Author: marius Date: Sat May 26 09:31:25 2012 New Revision: 236090 URL: http://svn.freebsd.org/changeset/base/236090 Log: MFC: r234524 o Fixes: - When switching to 4-bit operation, send a SET_CLR_CARD_DETECT command to disconnect the card-detect pull-up resistor from the DAT3 line before sending the SET_BUS_WIDTH command. - Add the missing "reserved" zero entry to the mantissa table used to decode various CSD fields. This was causing SD cards to report that they could run at 30 MHz instead of the maximum 25 MHz mandated in the spec. o Enhancements: - At the MMC layer, format various info from the CID into a string that uniquely identifies the card instance (manufacturer number, serial number, product name and revision, etc). Export it as an instance variable. - At the MMCSD layer, display the formatted card ID string, and also report the clock speed of the hardware (not the card's max speed), and the number of bits and number of blocks per transfer. It comes out like this now: mmcsd0: 968MB at mmc0 22.5MHz/4bit/128-block o Use DEVMETHOD_END. o Use NULL instead of 0 for pointers. PR: 156496 Submitted by: Ian Lepore Modified: stable/8/sys/dev/mmc/mmc.c stable/8/sys/dev/mmc/mmcbrvar.h stable/8/sys/dev/mmc/mmcreg.h stable/8/sys/dev/mmc/mmcsd.c stable/8/sys/dev/mmc/mmcvar.h stable/8/sys/modules/mmcsd/Makefile 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) Modified: stable/8/sys/dev/mmc/mmc.c ============================================================================== --- stable/8/sys/dev/mmc/mmc.c Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/dev/mmc/mmc.c Sat May 26 09:31:25 2012 (r236090) @@ -101,6 +101,7 @@ struct mmc_ivars { uint32_t tran_speed; /* Max speed in normal mode */ uint32_t hs_tran_speed; /* Max speed in high speed mode */ uint32_t erase_sector; /* Card native erase sector size */ + char card_id_string[64];/* Formatted CID info (serial, MFG, etc) */ }; #define CMD_RETRIES 3 @@ -140,6 +141,7 @@ static void mmc_app_decode_scr(uint32_t static int mmc_send_ext_csd(struct mmc_softc *sc, uint8_t *rawextcsd); static void mmc_scan(struct mmc_softc *sc); static int mmc_delete_cards(struct mmc_softc *sc); +static void mmc_format_card_id_string(struct mmc_ivars *ivar); static void mmc_ms_delay(int ms) @@ -606,6 +608,13 @@ mmc_set_card_bus_width(struct mmc_softc if (mmcbr_get_mode(sc->dev) == mode_sd) { memset(&cmd, 0, sizeof(struct mmc_command)); + cmd.opcode = ACMD_SET_CLR_CARD_DETECT; + cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; + cmd.arg = SD_CLR_CARD_DETECT; + err = mmc_wait_for_app_cmd(sc, rca, &cmd, CMD_RETRIES); + if (err != 0) + return (err); + memset(&cmd, 0, sizeof(struct mmc_command)); cmd.opcode = ACMD_SET_BUS_WIDTH; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; switch (width) { @@ -788,15 +797,52 @@ mmc_decode_cid_mmc(uint32_t *raw_cid, st cid->mdt_year = mmc_get_bits(raw_cid, 128, 8, 4) + 1997; } +static void +mmc_format_card_id_string(struct mmc_ivars *ivar) +{ + char oidstr[8]; + uint8_t c1; + uint8_t c2; + + /* + * Format a card ID string for use by the mmcsd driver, it's what + * appears between the <> in the following: + * mmcsd0: 968MB at mmc0 + * 22.5MHz/4bit/128-block + * + * The card_id_string in mmc_ivars is currently allocated as 64 bytes, + * and our max formatted length is currently 55 bytes if every field + * contains the largest value. + * + * Sometimes the oid is two printable ascii chars; when it's not, + * format it as 0xnnnn instead. + */ + c1 = (ivar->cid.oid >> 8) & 0x0ff; + c2 = ivar->cid.oid & 0x0ff; + if (c1 > 0x1f && c1 < 0x7f && c2 > 0x1f && c2 < 0x7f) + snprintf(oidstr, sizeof(oidstr), "%c%c", c1, c2); + else + snprintf(oidstr, sizeof(oidstr), "0x%04x", ivar->cid.oid); + snprintf(ivar->card_id_string, sizeof(ivar->card_id_string), + "%s%s %s %d.%d SN %d MFG %02d/%04d by %d %s", + ivar->mode == mode_sd ? "SD" : "MMC", ivar->high_cap ? "HC" : "", + ivar->cid.pnm, ivar->cid.prv >> 4, ivar->cid.prv & 0x0f, + ivar->cid.psn, ivar->cid.mdt_month, ivar->cid.mdt_year, + ivar->cid.mid, oidstr); +} + static const int exp[8] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000 }; + static const int mant[16] = { - 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 + 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 }; + static const int cur_min[8] = { 500, 1000, 5000, 10000, 25000, 35000, 60000, 100000 }; + static const int cur_max[8] = { 1000, 5000, 10000, 25000, 35000, 45000, 800000, 200000 }; @@ -1080,13 +1126,7 @@ mmc_log_card(device_t dev, struct mmc_iv { device_printf(dev, "Card at relative address %d%s:\n", ivar->rca, newcard ? " added" : ""); - device_printf(dev, " card: %s%s (0x%x/0x%x/\"%s\" rev %d.%d " - "m/d %02d.%04d s/n %08x)\n", - ivar->mode == mode_sd ? "SD" : "MMC", - ivar->high_cap ? " High Capacity" : "", - ivar->cid.mid, ivar->cid.oid, - ivar->cid.pnm, ivar->cid.prv >> 4, ivar->cid.prv & 0x0f, - ivar->cid.mdt_month, ivar->cid.mdt_year, ivar->cid.psn); + device_printf(dev, " card: %s\n", ivar->card_id_string); device_printf(dev, " bus: %ubit, %uMHz%s\n", (ivar->bus_width == bus_width_1 ? 1 : (ivar->bus_width == bus_width_4 ? 4 : 8)), @@ -1188,6 +1228,7 @@ mmc_discover_cards(struct mmc_softc *sc) if ((mmcbr_get_caps(sc->dev) & MMC_CAP_4_BIT_DATA) && (ivar->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) ivar->bus_width = bus_width_4; + mmc_format_card_id_string(ivar); if (bootverbose || mmc_debug) mmc_log_card(sc->dev, ivar, newcard); if (newcard) { @@ -1245,6 +1286,7 @@ mmc_discover_cards(struct mmc_softc *sc) ivar->bus_width = bus_width_1; ivar->timing = bus_timing_normal; } + mmc_format_card_id_string(ivar); if (bootverbose || mmc_debug) mmc_log_card(sc->dev, ivar, newcard); if (newcard) { @@ -1477,6 +1519,9 @@ mmc_read_ivar(device_t bus, device_t chi case MMC_IVAR_MAX_DATA: *result = mmcbr_get_max_data(bus); break; + case MMC_IVAR_CARD_ID_STRING: + *(char **)result = ivar->card_id_string; + break; } return (0); } @@ -1527,7 +1572,7 @@ static device_method_t mmc_methods[] = { DEVMETHOD(mmcbus_acquire_bus, mmc_acquire_bus), DEVMETHOD(mmcbus_release_bus, mmc_release_bus), - {0, 0}, + DEVMETHOD_END }; static driver_t mmc_driver = { @@ -1537,6 +1582,5 @@ static driver_t mmc_driver = { }; static devclass_t mmc_devclass; - DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci, mmc_driver, mmc_devclass, NULL, NULL); Modified: stable/8/sys/dev/mmc/mmcbrvar.h ============================================================================== --- stable/8/sys/dev/mmc/mmcbrvar.h Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/dev/mmc/mmcbrvar.h Sat May 26 09:31:25 2012 (r236090) @@ -56,6 +56,7 @@ #define DEV_MMC_MMCBRVAR_H #include +#include #include "mmcbr_if.h" enum mmcbr_device_ivars { @@ -72,8 +73,7 @@ enum mmcbr_device_ivars { MMCBR_IVAR_VDD, MMCBR_IVAR_CAPS, MMCBR_IVAR_TIMING, - MMCBR_IVAR_MAX_DATA, -// MMCBR_IVAR_, + MMCBR_IVAR_MAX_DATA }; /* Modified: stable/8/sys/dev/mmc/mmcreg.h ============================================================================== --- stable/8/sys/dev/mmc/mmcreg.h Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/dev/mmc/mmcreg.h Sat May 26 09:31:25 2012 (r236090) @@ -139,8 +139,8 @@ struct mmc_command { #define R1_READY_FOR_DATA (1u << 8) /* sx, a */ #define R1_APP_CMD (1u << 5) /* sr, c */ #define R1_AKE_SEQ_ERROR (1u << 3) /* er, c */ -#define R1_STATUS(x) (x & 0xFFFFE000 -#define R1_CURRENT_STATE(x) ((x) & R1_CURRENT_STATE_MASK) >> 9 +#define R1_STATUS(x) ((x) & 0xFFFFE000) +#define R1_CURRENT_STATE(x) (((x) & R1_CURRENT_STATE_MASK) >> 9) #define R1_STATE_IDLE 0 #define R1_STATE_READY 1 #define R1_STATE_IDENT 2 @@ -330,6 +330,9 @@ struct mmc_request { #define SD_SWITCH_HS_MODE 1 #define SD_SWITCH_NOCHANGE 0xF +#define SD_CLR_CARD_DETECT 0 +#define SD_SET_CARD_DETECT 1 + #define SD_MAX_HS 50000000 /* OCR bits */ @@ -380,7 +383,7 @@ struct mmc_cid { uint8_t fwrev; }; -struct mmc_csd +struct mmc_csd { uint8_t csd_structure; uint8_t spec_vers; Modified: stable/8/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/8/sys/dev/mmc/mmcsd.c Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/dev/mmc/mmcsd.c Sat May 26 09:31:25 2012 (r236090) @@ -66,11 +66,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include +#include #include "mmcbus_if.h" +#if __FreeBSD_version < 800002 +#define kproc_create kthread_create +#define kproc_exit kthread_exit +#endif + struct mmcsd_softc { device_t dev; struct mtx sc_mtx; @@ -95,7 +101,6 @@ static int mmcsd_dump(void *arg, void *v off_t offset, size_t length); static void mmcsd_task(void *arg); -static const char *mmcsd_card_name(device_t dev); static int mmcsd_bus_bit_width(device_t dev); #define MMCSD_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -122,6 +127,8 @@ mmcsd_attach(device_t dev) struct mmcsd_softc *sc; struct disk *d; intmax_t mb; + uint32_t speed; + uint32_t maxblocks; char unit; sc = device_get_softc(dev); @@ -157,11 +164,22 @@ mmcsd_attach(device_t dev) unit = 'G'; mb /= 1024; } - device_printf(dev, "%ju%cB <%s Memory Card>%s at %s %dMHz/%dbit\n", - mb, unit, mmcsd_card_name(dev), + /* + * Report the clock speed of the underlying hardware, which might be + * different than what the card reports due to hardware limitations. + * Report how many blocks the hardware transfers at once, but clip the + * number to MAXPHYS since the system won't initiate larger transfers. + */ + speed = mmcbr_get_clock(device_get_parent(dev)); + maxblocks = mmc_get_max_data(dev); + if (maxblocks > MAXPHYS) + maxblocks = MAXPHYS; + device_printf(dev, "%ju%cB <%s>%s at %s %d.%01dMHz/%dbit/%d-block\n", + mb, unit, mmc_get_card_id_string(dev), mmc_get_read_only(dev) ? " (read-only)" : "", device_get_nameunit(device_get_parent(dev)), - mmc_get_tran_speed(dev) / 1000000, mmcsd_bus_bit_width(dev)); + speed / 1000000, (speed / 100000) % 10, + mmcsd_bus_bit_width(dev), maxblocks); disk_create(d, DISK_VERSION); bioq_init(&sc->bio_queue); @@ -500,16 +518,6 @@ out: kproc_exit(0); } -static const char * -mmcsd_card_name(device_t dev) -{ - if (mmc_get_card_type(dev) == mode_mmc) - return ("MMC"); - if (mmc_get_high_cap(dev)) - return ("SDHC"); - return ("SD"); -} - static int mmcsd_bus_bit_width(device_t dev) { @@ -526,7 +534,7 @@ static device_method_t mmcsd_methods[] = DEVMETHOD(device_detach, mmcsd_detach), DEVMETHOD(device_suspend, mmcsd_suspend), DEVMETHOD(device_resume, mmcsd_resume), - {0, 0}, + DEVMETHOD_END }; static driver_t mmcsd_driver = { @@ -536,4 +544,4 @@ static driver_t mmcsd_driver = { }; static devclass_t mmcsd_devclass; -DRIVER_MODULE(mmcsd, mmc, mmcsd_driver, mmcsd_devclass, 0, 0); +DRIVER_MODULE(mmcsd, mmc, mmcsd_driver, mmcsd_devclass, NULL, NULL); Modified: stable/8/sys/dev/mmc/mmcvar.h ============================================================================== --- stable/8/sys/dev/mmc/mmcvar.h Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/dev/mmc/mmcvar.h Sat May 26 09:31:25 2012 (r236090) @@ -69,7 +69,7 @@ enum mmc_device_ivars { MMC_IVAR_BUS_WIDTH, MMC_IVAR_ERASE_SECTOR, MMC_IVAR_MAX_DATA, -// MMC_IVAR_, + MMC_IVAR_CARD_ID_STRING }; /* @@ -89,5 +89,6 @@ MMC_ACCESSOR(card_type, CARD_TYPE, int) MMC_ACCESSOR(bus_width, BUS_WIDTH, int) MMC_ACCESSOR(erase_sector, ERASE_SECTOR, int) MMC_ACCESSOR(max_data, MAX_DATA, int) +MMC_ACCESSOR(card_id_string, CARD_ID_STRING, const char *) #endif /* DEV_MMC_MMCVAR_H */ Modified: stable/8/sys/modules/mmcsd/Makefile ============================================================================== --- stable/8/sys/modules/mmcsd/Makefile Sat May 26 09:31:23 2012 (r236089) +++ stable/8/sys/modules/mmcsd/Makefile Sat May 26 09:31:25 2012 (r236090) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../dev/mmc KMOD= mmcsd -SRCS= mmcsd.c mmcbus_if.h device_if.h bus_if.h +SRCS= bus_if.h device_if.h mmcbr_if.h mmcbus_if.h mmcsd.c .include From owner-svn-src-all@FreeBSD.ORG Sat May 26 10:24:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54A261065670; Sat, 26 May 2012 10:24:31 +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 3DDB98FC16; Sat, 26 May 2012 10:24: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 q4QAOVkH072138; Sat, 26 May 2012 10:24:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QAOVGK072135; Sat, 26 May 2012 10:24:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205261024.q4QAOVGK072135@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 26 May 2012 10:24: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: r236091 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 10:24:31 -0000 Author: bz Date: Sat May 26 10:24:30 2012 New Revision: 236091 URL: http://svn.freebsd.org/changeset/base/236091 Log: MFC r235474: Switch to a standard 2 clause BSD license (from bsd-style-copyright). Approved by: Myricom Inc. (gallatin) Approved by: Intel Corporation (jfv) Modified: stable/9/sys/netinet/tcp_lro.c stable/9/sys/netinet/tcp_lro.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_lro.c ============================================================================== --- stable/9/sys/netinet/tcp_lro.c Sat May 26 09:31:25 2012 (r236090) +++ stable/9/sys/netinet/tcp_lro.c Sat May 26 10:24:30 2012 (r236091) @@ -1,37 +1,31 @@ -/****************************************************************************** - -Copyright (c) 2007, Myricom Inc. -Copyright (c) 2008, Intel Corporation. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Neither the name of the Myricom Inc, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - 3. Neither the name of the Intel Corporation, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -$FreeBSD$ -***************************************************************************/ +/*- + * Copyright (c) 2007, Myricom Inc. + * Copyright (c) 2008, Intel Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ #include #include Modified: stable/9/sys/netinet/tcp_lro.h ============================================================================== --- stable/9/sys/netinet/tcp_lro.h Sat May 26 09:31:25 2012 (r236090) +++ stable/9/sys/netinet/tcp_lro.h Sat May 26 10:24:30 2012 (r236091) @@ -1,39 +1,32 @@ -/******************************************************************************* +/*- + * Copyright (c) 2006, Myricom Inc. + * Copyright (c) 2008, Intel Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ -Copyright (c) 2006, Myricom Inc. -Copyright (c) 2008, Intel Corporation. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Neither the name of the Myricom Inc, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - 2. Neither the name of the Intel Corporation, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - -$FreeBSD$ - -***************************************************************************/ #ifndef _TCP_LRO_H_ #define _TCP_LRO_H_ From owner-svn-src-all@FreeBSD.ORG Sat May 26 10:24:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AFE5106564A; Sat, 26 May 2012 10:24:36 +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 147598FC08; Sat, 26 May 2012 10:24: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 q4QAOZ18072179; Sat, 26 May 2012 10:24:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QAOZWK072176; Sat, 26 May 2012 10:24:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205261024.q4QAOZWK072176@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 26 May 2012 10:24: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: r236092 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 10:24:36 -0000 Author: bz Date: Sat May 26 10:24:35 2012 New Revision: 236092 URL: http://svn.freebsd.org/changeset/base/236092 Log: MFC r235474: Switch to a standard 2 clause BSD license (from bsd-style-copyright). Approved by: Myricom Inc. (gallatin) Approved by: Intel Corporation (jfv) Modified: stable/8/sys/netinet/tcp_lro.c stable/8/sys/netinet/tcp_lro.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/tcp_lro.c ============================================================================== --- stable/8/sys/netinet/tcp_lro.c Sat May 26 10:24:30 2012 (r236091) +++ stable/8/sys/netinet/tcp_lro.c Sat May 26 10:24:35 2012 (r236092) @@ -1,37 +1,31 @@ -/****************************************************************************** - -Copyright (c) 2007, Myricom Inc. -Copyright (c) 2008, Intel Corporation. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Neither the name of the Myricom Inc, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - 3. Neither the name of the Intel Corporation, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -$FreeBSD$ -***************************************************************************/ +/*- + * Copyright (c) 2007, Myricom Inc. + * Copyright (c) 2008, Intel Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ #include #include Modified: stable/8/sys/netinet/tcp_lro.h ============================================================================== --- stable/8/sys/netinet/tcp_lro.h Sat May 26 10:24:30 2012 (r236091) +++ stable/8/sys/netinet/tcp_lro.h Sat May 26 10:24:35 2012 (r236092) @@ -1,39 +1,32 @@ -/******************************************************************************* +/*- + * Copyright (c) 2006, Myricom Inc. + * Copyright (c) 2008, Intel Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ -Copyright (c) 2006, Myricom Inc. -Copyright (c) 2008, Intel Corporation. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Neither the name of the Myricom Inc, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - 2. Neither the name of the Intel Corporation, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - -$FreeBSD$ - -***************************************************************************/ #ifndef _TCP_LRO_H_ #define _TCP_LRO_H_ From owner-svn-src-all@FreeBSD.ORG Sat May 26 10:28:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C00721065674; Sat, 26 May 2012 10:28:11 +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 ABF548FC18; Sat, 26 May 2012 10:28: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 q4QASBP7072362; Sat, 26 May 2012 10:28:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QASBCj072360; Sat, 26 May 2012 10:28:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205261028.q4QASBCj072360@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 26 May 2012 10:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236093 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 10:28:11 -0000 Author: bz Date: Sat May 26 10:28:11 2012 New Revision: 236093 URL: http://svn.freebsd.org/changeset/base/236093 Log: Trim the extra $FreeBSD$ from the comment below the license. We use the __FBSDID() macro on the file now instead. MFC after: 3 days Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Sat May 26 10:24:35 2012 (r236092) +++ head/sys/netinet/tcp_lro.c Sat May 26 10:28:11 2012 (r236093) @@ -27,8 +27,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #include From owner-svn-src-all@FreeBSD.ORG Sat May 26 12:15:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F305106564A; Sat, 26 May 2012 12:15:14 +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 487228FC08; Sat, 26 May 2012 12:15: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 q4QCFEJ1076721; Sat, 26 May 2012 12:15:14 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QCFEBa076719; Sat, 26 May 2012 12:15:14 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205261215.q4QCFEBa076719@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 12:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236094 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 12:15:14 -0000 Author: raj Date: Sat May 26 12:15:13 2012 New Revision: 236094 URL: http://svn.freebsd.org/changeset/base/236094 Log: Unify SPR defines formatting, no funtional changes. Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat May 26 10:28:11 2012 (r236093) +++ head/sys/powerpc/include/spr.h Sat May 26 12:15:13 2012 (r236094) @@ -115,9 +115,9 @@ #define SRR1_ISI_NOEXECUTE 0x10000000 /* Memory marked no-execute */ #define SRR1_ISI_PP 0x08000000 /* PP bits forbid access */ #define SPR_DECAR 0x036 /* ..8 Decrementer auto reload */ -#define SPR_EIE 0x050 /* ..8 Exception Interrupt ??? */ -#define SPR_EID 0x051 /* ..8 Exception Interrupt ??? */ -#define SPR_NRI 0x052 /* ..8 Exception Interrupt ??? */ +#define SPR_EIE 0x050 /* ..8 Exception Interrupt ??? */ +#define SPR_EID 0x051 /* ..8 Exception Interrupt ??? */ +#define SPR_NRI 0x052 /* ..8 Exception Interrupt ??? */ #define SPR_USPRG0 0x100 /* 4.. User SPR General 0 */ #define SPR_VRSAVE 0x100 /* .6. AltiVec VRSAVE */ #define SPR_SPRG0 0x110 /* 468 SPR General 0 */ @@ -202,49 +202,49 @@ #define SPR_DBAT2L 0x21d /* .6. Data BAT Reg 2 Lower */ #define SPR_DBAT3U 0x21e /* .6. Data BAT Reg 3 Upper */ #define SPR_DBAT3L 0x21f /* .6. Data BAT Reg 3 Lower */ -#define SPR_IC_CST 0x230 /* ..8 Instruction Cache CSR */ -#define IC_CST_IEN 0x80000000 /* I cache is ENabled (RO) */ -#define IC_CST_CMD_INVALL 0x0c000000 /* I cache invalidate all */ -#define IC_CST_CMD_UNLOCKALL 0x0a000000 /* I cache unlock all */ -#define IC_CST_CMD_UNLOCK 0x08000000 /* I cache unlock block */ -#define IC_CST_CMD_LOADLOCK 0x06000000 /* I cache load & lock block */ -#define IC_CST_CMD_DISABLE 0x04000000 /* I cache disable */ -#define IC_CST_CMD_ENABLE 0x02000000 /* I cache enable */ -#define IC_CST_CCER1 0x00200000 /* I cache error type 1 (RO) */ -#define IC_CST_CCER2 0x00100000 /* I cache error type 2 (RO) */ -#define IC_CST_CCER3 0x00080000 /* I cache error type 3 (RO) */ +#define SPR_IC_CST 0x230 /* ..8 Instruction Cache CSR */ +#define IC_CST_IEN 0x80000000 /* I cache is ENabled (RO) */ +#define IC_CST_CMD_INVALL 0x0c000000 /* I cache invalidate all */ +#define IC_CST_CMD_UNLOCKALL 0x0a000000 /* I cache unlock all */ +#define IC_CST_CMD_UNLOCK 0x08000000 /* I cache unlock block */ +#define IC_CST_CMD_LOADLOCK 0x06000000 /* I cache load & lock block */ +#define IC_CST_CMD_DISABLE 0x04000000 /* I cache disable */ +#define IC_CST_CMD_ENABLE 0x02000000 /* I cache enable */ +#define IC_CST_CCER1 0x00200000 /* I cache error type 1 (RO) */ +#define IC_CST_CCER2 0x00100000 /* I cache error type 2 (RO) */ +#define IC_CST_CCER3 0x00080000 /* I cache error type 3 (RO) */ #define SPR_IBAT4U 0x230 /* .6. Instruction BAT Reg 4 Upper */ -#define SPR_IC_ADR 0x231 /* ..8 Instruction Cache Address */ +#define SPR_IC_ADR 0x231 /* ..8 Instruction Cache Address */ #define SPR_IBAT4L 0x231 /* .6. Instruction BAT Reg 4 Lower */ -#define SPR_IC_DAT 0x232 /* ..8 Instruction Cache Data */ +#define SPR_IC_DAT 0x232 /* ..8 Instruction Cache Data */ #define SPR_IBAT5U 0x232 /* .6. Instruction BAT Reg 5 Upper */ #define SPR_IBAT5L 0x233 /* .6. Instruction BAT Reg 5 Lower */ #define SPR_IBAT6U 0x234 /* .6. Instruction BAT Reg 6 Upper */ #define SPR_IBAT6L 0x235 /* .6. Instruction BAT Reg 6 Lower */ #define SPR_IBAT7U 0x236 /* .6. Instruction BAT Reg 7 Upper */ #define SPR_IBAT7L 0x237 /* .6. Instruction BAT Reg 7 Lower */ -#define SPR_DC_CST 0x230 /* ..8 Data Cache CSR */ -#define DC_CST_DEN 0x80000000 /* D cache ENabled (RO) */ -#define DC_CST_DFWT 0x40000000 /* D cache Force Write-Thru (RO) */ -#define DC_CST_LES 0x20000000 /* D cache Little Endian Swap (RO) */ -#define DC_CST_CMD_FLUSH 0x0e000000 /* D cache invalidate all */ -#define DC_CST_CMD_INVALL 0x0c000000 /* D cache invalidate all */ -#define DC_CST_CMD_UNLOCKALL 0x0a000000 /* D cache unlock all */ -#define DC_CST_CMD_UNLOCK 0x08000000 /* D cache unlock block */ -#define DC_CST_CMD_CLRLESWAP 0x07000000 /* D cache clr little-endian swap */ -#define DC_CST_CMD_LOADLOCK 0x06000000 /* D cache load & lock block */ -#define DC_CST_CMD_SETLESWAP 0x05000000 /* D cache set little-endian swap */ -#define DC_CST_CMD_DISABLE 0x04000000 /* D cache disable */ -#define DC_CST_CMD_CLRFWT 0x03000000 /* D cache clear forced write-thru */ -#define DC_CST_CMD_ENABLE 0x02000000 /* D cache enable */ -#define DC_CST_CMD_SETFWT 0x01000000 /* D cache set forced write-thru */ -#define DC_CST_CCER1 0x00200000 /* D cache error type 1 (RO) */ -#define DC_CST_CCER2 0x00100000 /* D cache error type 2 (RO) */ -#define DC_CST_CCER3 0x00080000 /* D cache error type 3 (RO) */ +#define SPR_DC_CST 0x230 /* ..8 Data Cache CSR */ +#define DC_CST_DEN 0x80000000 /* D cache ENabled (RO) */ +#define DC_CST_DFWT 0x40000000 /* D cache Force Write-Thru (RO) */ +#define DC_CST_LES 0x20000000 /* D cache Little Endian Swap (RO) */ +#define DC_CST_CMD_FLUSH 0x0e000000 /* D cache invalidate all */ +#define DC_CST_CMD_INVALL 0x0c000000 /* D cache invalidate all */ +#define DC_CST_CMD_UNLOCKALL 0x0a000000 /* D cache unlock all */ +#define DC_CST_CMD_UNLOCK 0x08000000 /* D cache unlock block */ +#define DC_CST_CMD_CLRLESWAP 0x07000000 /* D cache clr little-endian swap */ +#define DC_CST_CMD_LOADLOCK 0x06000000 /* D cache load & lock block */ +#define DC_CST_CMD_SETLESWAP 0x05000000 /* D cache set little-endian swap */ +#define DC_CST_CMD_DISABLE 0x04000000 /* D cache disable */ +#define DC_CST_CMD_CLRFWT 0x03000000 /* D cache clear forced write-thru */ +#define DC_CST_CMD_ENABLE 0x02000000 /* D cache enable */ +#define DC_CST_CMD_SETFWT 0x01000000 /* D cache set forced write-thru */ +#define DC_CST_CCER1 0x00200000 /* D cache error type 1 (RO) */ +#define DC_CST_CCER2 0x00100000 /* D cache error type 2 (RO) */ +#define DC_CST_CCER3 0x00080000 /* D cache error type 3 (RO) */ #define SPR_DBAT4U 0x238 /* .6. Data BAT Reg 4 Upper */ -#define SPR_DC_ADR 0x231 /* ..8 Data Cache Address */ +#define SPR_DC_ADR 0x231 /* ..8 Data Cache Address */ #define SPR_DBAT4L 0x239 /* .6. Data BAT Reg 4 Lower */ -#define SPR_DC_DAT 0x232 /* ..8 Data Cache Data */ +#define SPR_DC_DAT 0x232 /* ..8 Data Cache Data */ #define SPR_DBAT5U 0x23a /* .6. Data BAT Reg 5 Upper */ #define SPR_DBAT5L 0x23b /* .6. Data BAT Reg 5 Lower */ #define SPR_DBAT6U 0x23c /* .6. Data BAT Reg 6 Upper */ @@ -252,46 +252,46 @@ #define SPR_DBAT7U 0x23e /* .6. Data BAT Reg 7 Upper */ #define SPR_DBAT7L 0x23f /* .6. Data BAT Reg 7 Lower */ #define SPR_MI_CTR 0x310 /* ..8 IMMU control */ -#define Mx_CTR_GPM 0x80000000 /* Group Protection Mode */ -#define Mx_CTR_PPM 0x40000000 /* Page Protection Mode */ -#define Mx_CTR_CIDEF 0x20000000 /* Cache-Inhibit DEFault */ -#define MD_CTR_WTDEF 0x20000000 /* Write-Through DEFault */ -#define Mx_CTR_RSV4 0x08000000 /* Reserve 4 TLB entries */ -#define MD_CTR_TWAM 0x04000000 /* TableWalk Assist Mode */ -#define Mx_CTR_PPCS 0x02000000 /* Priv/user state compare mode */ -#define Mx_CTR_TLB_INDX 0x000001f0 /* TLB index mask */ -#define Mx_CTR_TLB_INDX_BITPOS 8 /* TLB index shift */ +#define Mx_CTR_GPM 0x80000000 /* Group Protection Mode */ +#define Mx_CTR_PPM 0x40000000 /* Page Protection Mode */ +#define Mx_CTR_CIDEF 0x20000000 /* Cache-Inhibit DEFault */ +#define MD_CTR_WTDEF 0x20000000 /* Write-Through DEFault */ +#define Mx_CTR_RSV4 0x08000000 /* Reserve 4 TLB entries */ +#define MD_CTR_TWAM 0x04000000 /* TableWalk Assist Mode */ +#define Mx_CTR_PPCS 0x02000000 /* Priv/user state compare mode */ +#define Mx_CTR_TLB_INDX 0x000001f0 /* TLB index mask */ +#define Mx_CTR_TLB_INDX_BITPOS 8 /* TLB index shift */ #define SPR_MI_AP 0x312 /* ..8 IMMU access protection */ -#define Mx_GP_SUPER(n) (0 << (2*(15-(n)))) /* access is supervisor */ -#define Mx_GP_PAGE (1 << (2*(15-(n)))) /* access is page protect */ -#define Mx_GP_SWAPPED (2 << (2*(15-(n)))) /* access is swapped */ -#define Mx_GP_USER (3 << (2*(15-(n)))) /* access is user */ +#define Mx_GP_SUPER(n) (0 << (2*(15-(n)))) /* access is supervisor */ +#define Mx_GP_PAGE (1 << (2*(15-(n)))) /* access is page protect */ +#define Mx_GP_SWAPPED (2 << (2*(15-(n)))) /* access is swapped */ +#define Mx_GP_USER (3 << (2*(15-(n)))) /* access is user */ #define SPR_MI_EPN 0x313 /* ..8 IMMU effective number */ -#define Mx_EPN_EPN 0xfffff000 /* Effective Page Number mask */ -#define Mx_EPN_EV 0x00000020 /* Entry Valid */ -#define Mx_EPN_ASID 0x0000000f /* Address Space ID */ +#define Mx_EPN_EPN 0xfffff000 /* Effective Page Number mask */ +#define Mx_EPN_EV 0x00000020 /* Entry Valid */ +#define Mx_EPN_ASID 0x0000000f /* Address Space ID */ #define SPR_MI_TWC 0x315 /* ..8 IMMU tablewalk control */ -#define MD_TWC_L2TB 0xfffff000 /* Level-2 Tablewalk Base */ -#define Mx_TWC_APG 0x000001e0 /* Access Protection Group */ -#define Mx_TWC_G 0x00000010 /* Guarded memory */ -#define Mx_TWC_PS 0x0000000c /* Page Size (L1) */ -#define MD_TWC_WT 0x00000002 /* Write-Through */ -#define Mx_TWC_V 0x00000001 /* Entry Valid */ +#define MD_TWC_L2TB 0xfffff000 /* Level-2 Tablewalk Base */ +#define Mx_TWC_APG 0x000001e0 /* Access Protection Group */ +#define Mx_TWC_G 0x00000010 /* Guarded memory */ +#define Mx_TWC_PS 0x0000000c /* Page Size (L1) */ +#define MD_TWC_WT 0x00000002 /* Write-Through */ +#define Mx_TWC_V 0x00000001 /* Entry Valid */ #define SPR_MI_RPN 0x316 /* ..8 IMMU real (phys) page number */ -#define Mx_RPN_RPN 0xfffff000 /* Real Page Number */ -#define Mx_RPN_PP 0x00000ff0 /* Page Protection */ -#define Mx_RPN_SPS 0x00000008 /* Small Page Size */ -#define Mx_RPN_SH 0x00000004 /* SHared page */ -#define Mx_RPN_CI 0x00000002 /* Cache Inhibit */ -#define Mx_RPN_V 0x00000001 /* Valid */ +#define Mx_RPN_RPN 0xfffff000 /* Real Page Number */ +#define Mx_RPN_PP 0x00000ff0 /* Page Protection */ +#define Mx_RPN_SPS 0x00000008 /* Small Page Size */ +#define Mx_RPN_SH 0x00000004 /* SHared page */ +#define Mx_RPN_CI 0x00000002 /* Cache Inhibit */ +#define Mx_RPN_V 0x00000001 /* Valid */ #define SPR_MD_CTR 0x318 /* ..8 DMMU control */ #define SPR_M_CASID 0x319 /* ..8 CASID */ -#define M_CASID 0x0000000f /* Current AS Id */ +#define M_CASID 0x0000000f /* Current AS Id */ #define SPR_MD_AP 0x31a /* ..8 DMMU access protection */ #define SPR_MD_EPN 0x31b /* ..8 DMMU effective number */ #define SPR_M_TWB 0x31c /* ..8 MMU tablewalk base */ -#define M_TWB_L1TB 0xfffff000 /* level-1 translation base */ -#define M_TWB_L1INDX 0x00000ffc /* level-1 index */ +#define M_TWB_L1TB 0xfffff000 /* level-1 translation base */ +#define M_TWB_L1INDX 0x00000ffc /* level-1 index */ #define SPR_MD_TWC 0x31d /* ..8 DMMU tablewalk control */ #define SPR_MD_RPN 0x31e /* ..8 DMMU real (phys) page number */ #define SPR_MD_TW 0x31f /* ..8 MMU tablewalk scratch */ @@ -307,8 +307,8 @@ #define SPR_UMMCR1 0x3ac /* .6. User Monitor Mode Control Register 1 */ #define SPR_ZPR 0x3b0 /* 4.. Zone Protection Register */ #define SPR_MMCR2 0x3b0 /* .6. Monitor Mode Control Register 2 */ -#define SPR_MMCR2_THRESHMULT_32 0x80000000 /* Multiply MMCR0 threshold by 32 */ -#define SPR_MMCR2_THRESHMULT_2 0x00000000 /* Multiply MMCR0 threshold by 2 */ +#define SPR_MMCR2_THRESHMULT_32 0x80000000 /* Multiply MMCR0 threshold by 32 */ +#define SPR_MMCR2_THRESHMULT_2 0x00000000 /* Multiply MMCR0 threshold by 2 */ #define SPR_PID 0x3b1 /* 4.. Process ID */ #define SPR_PMC5 0x3b1 /* .6. Performance Counter Register 5 */ #define SPR_PMC6 0x3b2 /* .6. Performance Counter Register 6 */ @@ -323,14 +323,14 @@ #define SPR_970MMCR1 0x31e /* ... Monitor Mode Control Register 1 (PPC 970) */ #define SPR_970MMCRA 0x312 /* ... Monitor Mode Control Register 2 (PPC 970) */ #define SPR_970MMCR0 0x31b /* ... Monitor Mode Control Register 0 (PPC 970) */ -#define SPR_970PMC1 0x313 /* ... PMC 1 */ -#define SPR_970PMC2 0x314 /* ... PMC 2 */ -#define SPR_970PMC3 0x315 /* ... PMC 3 */ -#define SPR_970PMC4 0x316 /* ... PMC 4 */ -#define SPR_970PMC5 0x317 /* ... PMC 5 */ -#define SPR_970PMC6 0x318 /* ... PMC 6 */ -#define SPR_970PMC7 0x319 /* ... PMC 7 */ -#define SPR_970PMC8 0x31a /* ... PMC 8 */ +#define SPR_970PMC1 0x313 /* ... PMC 1 */ +#define SPR_970PMC2 0x314 /* ... PMC 2 */ +#define SPR_970PMC3 0x315 /* ... PMC 3 */ +#define SPR_970PMC4 0x316 /* ... PMC 4 */ +#define SPR_970PMC5 0x317 /* ... PMC 5 */ +#define SPR_970PMC6 0x318 /* ... PMC 6 */ +#define SPR_970PMC7 0x319 /* ... PMC 7 */ +#define SPR_970PMC8 0x31a /* ... PMC 8 */ #define SPR_MMCR0_FC 0x80000000 /* Freeze counters */ #define SPR_MMCR0_FCS 0x40000000 /* Freeze counters in supervisor mode */ @@ -554,7 +554,6 @@ #define L2CR_L2DRO 0x00000100 /* 23: L2DLL rollover checkstop enable. */ #define L2CR_L2IP 0x00000001 /* 31: L2 global invalidate in */ /* progress (read only). */ - #define SPR_L3CR 0x3fa /* .6. L3 Control Register */ #define L3CR_L3E 0x80000000 /* 0: L3 enable */ #define L3CR_L3PE 0x40000000 /* 1: L3 data parity enable */ @@ -582,15 +581,15 @@ #define SPR_ICCR 0x3fb /* 4.. Instruction Cache Cachability Register */ #define SPR_THRM1 0x3fc /* .6. Thermal Management Register */ #define SPR_THRM2 0x3fd /* .6. Thermal Management Register */ -#define SPR_THRM_TIN 0x80000000 /* Thermal interrupt bit (RO) */ -#define SPR_THRM_TIV 0x40000000 /* Thermal interrupt valid (RO) */ -#define SPR_THRM_THRESHOLD(x) ((x) << 23) /* Thermal sensor threshold */ -#define SPR_THRM_TID 0x00000004 /* Thermal interrupt direction */ -#define SPR_THRM_TIE 0x00000002 /* Thermal interrupt enable */ -#define SPR_THRM_VALID 0x00000001 /* Valid bit */ +#define SPR_THRM_TIN 0x80000000 /* Thermal interrupt bit (RO) */ +#define SPR_THRM_TIV 0x40000000 /* Thermal interrupt valid (RO) */ +#define SPR_THRM_THRESHOLD(x) ((x) << 23) /* Thermal sensor threshold */ +#define SPR_THRM_TID 0x00000004 /* Thermal interrupt direction */ +#define SPR_THRM_TIE 0x00000002 /* Thermal interrupt enable */ +#define SPR_THRM_VALID 0x00000001 /* Valid bit */ #define SPR_THRM3 0x3fe /* .6. Thermal Management Register */ -#define SPR_THRM_TIMER(x) ((x) << 1) /* Sampling interval timer */ -#define SPR_THRM_ENABLE 0x00000001 /* TAU Enable */ +#define SPR_THRM_TIMER(x) ((x) << 1) /* Sampling interval timer */ +#define SPR_THRM_ENABLE 0x00000001 /* TAU Enable */ #define SPR_FPECR 0x3fe /* .6. Floating-Point Exception Cause Register */ /* Time Base Register declarations */ @@ -600,7 +599,7 @@ #define TBR_TBWU 0x11d /* 468 Time Base Upper - supervisor, write */ /* Performance counter declarations */ -#define PMC_OVERFLOW 0x80000000 /* Counter has overflowed */ +#define PMC_OVERFLOW 0x80000000 /* Counter has overflowed */ /* The first five countable [non-]events are common to many PMC's */ #define PMCN_NONE 0 /* Count nothing */ @@ -616,7 +615,7 @@ #if defined(AIM) -#define SPR_ESR 0x3d4 /* 4.. Exception Syndrome Register */ +#define SPR_ESR 0x3d4 /* 4.. Exception Syndrome Register */ #define ESR_MCI 0x80000000 /* Machine check - instruction */ #define ESR_PIL 0x08000000 /* Program interrupt - illegal */ #define ESR_PPR 0x04000000 /* Program interrupt - privileged */ From owner-svn-src-all@FreeBSD.ORG Sat May 26 12:21:46 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05F041065670; Sat, 26 May 2012 12:21:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx10.syd.optusnet.com.au (fallbackmx10.syd.optusnet.com.au [211.29.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id 204FF8FC16; Sat, 26 May 2012 12:21:44 +0000 (UTC) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by fallbackmx10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4QCLbUw029522; Sat, 26 May 2012 22:21:37 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4QCLQ6a013722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 26 May 2012 22:21:28 +1000 Date: Sat, 26 May 2012 22:21:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten In-Reply-To: <201205252150.q4PLomFk035064@svn.freebsd.org> Message-ID: <20120526173233.A885@besplex.bde.org> References: <201205252150.q4PLomFk035064@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, kib@FreeBSD.org Subject: Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 12:21:46 -0000 On Fri, 25 May 2012, Ed Schouten wrote: > Log: > Remove use of non-ISO-C integer types from system call tables. > > These files already use ISO-C-style integer types, so make them less > inconsistent by preferring the standard types. These should actually be Linux types l_foo_t. ISO-C-style integer types seem to have only been used for a couple of uintptr_t's, and these uses are more than just style bugs on amd64 since uintptr_t is for the host (64 bits on amd64) while the target uintptr_t is only 32 bits. There are also a few misuses of the abominable caddr_t instead of l_caddr_t, so syscalls that don't even take a caddr_t. Otherwise, Linux types are used a lot to avoid size mismatches. > Modified: head/sys/amd64/linux32/syscalls.master > ============================================================================== > --- head/sys/amd64/linux32/syscalls.master Fri May 25 21:12:24 2012 (r236025) > +++ head/sys/amd64/linux32/syscalls.master Fri May 25 21:50:48 2012 (r236026) > @@ -54,8 +54,8 @@ > l_int mode); } > 9 AUE_LINK STD { int linux_link(char *path, char *to); } > 10 AUE_UNLINK STD { int linux_unlink(char *path); } > -11 AUE_EXECVE STD { int linux_execve(char *path, u_int32_t *argp, \ > - u_int32_t *envp); } > +11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t *argp, \ > + uint32_t *envp); } argp and envp aren't uintany_t * in either Linux or FreeBSD. They start as "char * const *". There is no Linux type for an indirect "char *", and one was hacked up here by pretending that "char *" is u_int32_t (it is actually just 32 bits). Using l_caddr_t seems to be the best hack available (since by abusing l_caddr_t, we know that it is actually char *). The `const' in the type for argp and envp is further from being handled correctly. Most or all syscall.master's just type-pun it away. Similarly for "const char *path". All the non-indirect "char *"s for pathnames and other things seem to be completely wrong on amd64 too. These pointers start as 32 bits, and it takes more than a bad type pun to turn then into kernel 64-bit pointers. The magic for this seems to be: - all args are converted to 64 bits (by zero-extension?) at a low level - the args struct for a pathname is [left padding]; char *; [right padding]; Since the char * is misdeclared, the explicit padding is null, but the layout of the args struct is correct because the wrong arg type in it supplies equivalent padding (extra 32 bits on the right). - the "char *" in the args struct is not actually a char *, and is unusable directly in the kernel. However, it is only used in copyin() and copyout(), where it becomes a user address and works correctly. (An older bug in this that the user address for copy*() is declared as "void *". "void *" means a kernel pointer. The type of a user address should be more like vm_offset_t, but even that needs logical translation for linux32). The same mechanism presumably avoids problems when raw caddr_t is used instead of l_caddr_t, and when uintptr_t is used instead of l_uintptr_t. > 12 AUE_CHDIR STD { int linux_chdir(char *path); } > 13 AUE_NULL STD { int linux_time(l_time_t *tm); } Example of a correct use of a linux type. Again, the first-level pointer is handled by the above magic, but for the second level we need an l_foo_t to describe its size correctly. > 14 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \ Broken except in the K&R case, but amd64 is too new to pretend to support K&R. Bug for bug compatible with mknod() and some other syscalls in kern/syscalls.master. mknod() takes an arg of type mode_t, not one of type int. l_mode_t exists so that the above can be declared correctly, and is already used for linux_chmod() and linux_chmodat(). OTOH, int for the mode arg is correct for open(), since open() is variadic at a level before the syscall, so its mode_t arg gets promoted to int. Similarly, if mknod() is compiled by a K&R compiler, or by a STDC compiler with no prototype in scope, then its mode_t arg gets promoted to int (but for the STDC case, the behaviour is then undefined once mknod() is reached). Normally this doesn't cause any problems, but it is easy to declare things correctly. > Modified: head/sys/compat/freebsd32/syscalls.master > ============================================================================== > --- head/sys/compat/freebsd32/syscalls.master Fri May 25 21:12:24 2012 (r236025) > +++ head/sys/compat/freebsd32/syscalls.master Fri May 25 21:50:48 2012 (r236026) > @@ -104,9 +104,9 @@ > int flags); } > 28 AUE_SENDMSG STD { int freebsd32_sendmsg(int s, struct msghdr32 *msg, \ > int flags); } > -29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, u_int32_t buf, \ > - u_int32_t len, int flags, u_int32_t from, \ > - u_int32_t fromlenaddr); } > +29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, uint32_t buf, \ > + uint32_t len, int flags, uint32_t from, \ > + uint32_t fromlenaddr); } Oops, I didn't looke at this file when I said that "ISO-C-style integer types seem to have only been used for a couple of uintptr_t's". This file is independent of Linux, so it can't use l_foo. It hard-codes 32 instead, starting with the directory name. Still, all of the types in the above are fairly bogus and hard to understand: - "int" for `s' and `flags' depends on ints being 32 bits - "struct msghdr32 *msg" depends on magic to translate first-level target 32-bit pointers to host N-bit pointers - uint32_t for `buf' and `from' is for pointers too. Now the magic for first-level pointers is not depended on - uint32_t for lengths is for size_t's. This is reasonable but would be clearer if spelled as size32_t (corresponding to l_size_t). > 30 AUE_ACCEPT NOPROTO { int accept(int s, caddr_t name, \ > int *anamelen); } As above for "int s". The use of caddr_t is more nonsense than usual. accept()'s second arg is not a caddr_t, but is "struct sockaddr * restrict". We depend first on type punning this to caddr_t, then to caddr_t actually being "char *", then on "char *" being a pointer, then on the usual magic for first-level pointers. kern/syscalls.master has the same caddr_t for the MCPT_NOA case of accept(), but not for the MSTD case. Perhaps userland accept() once actually took a caddr_t arg, but hopefully Linux is too new to have ever done that, and even compat cruft in FreeeBSD is too new to need that. > 31 AUE_GETPEERNAME NOPROTO { int getpeername(int fdes, caddr_t asa, \ Similarly. For getpeername(), the compat cruft in kern/syscalls.master is more clearly typed as MCOMPAT. > @@ -152,7 +152,7 @@ > 58 AUE_READLINK NOPROTO { ssize_t readlink(char *path, char *buf, \ > size_t count); } All uses of basic C types and POSIX types are wronger than uses of fixed-width types. Here the size_t is not translated to uint32_t as above. This presumably works due to essentially the same magic as for first-level pointers, up to the copyout step: the 32-bit size_t gets extended to an N-bit one (where N is 32 or 64 on supported arches). Zero extension of it works right for size_t, and there is no further magic corresponding to the copy*() step. The magic is very convenient. It should probably be explicitly depended on for all first-level pointers. For size_t's it should be depended on in no cases or all cases. > 59 AUE_EXECVE STD { int freebsd32_execve(char *fname, \ > - u_int32_t *argv, u_int32_t *envv); } > + uint32_t *argv, uint32_t *envv); } Usual hack for second-level pointers. > 60 AUE_UMASK NOPROTO { int umask(int newmask); } umask \ > umask_args int Usual bug for mode_t. > 61 AUE_CHROOT NOPROTO { int chroot(char *path); } > @@ -325,10 +325,10 @@ > 172 AUE_NULL UNIMPL nosys > 173 AUE_PREAD COMPAT6 { ssize_t freebsd32_pread(int fd, void *buf, \ > size_t nbyte, int pad, \ > - u_int32_t offset1, u_int32_t offset2); } > + uint32_t offset1, uint32_t offset2); } More confusing than usual. The size_t is translated by magic. Then there is bogus historical padding to be compatible with old mistakes in this area. Then there are 2 64-bit offsets (off_t's in the API) which are split because the translation code only understands 32-bit args. > [... stuff in which the largest obvious bugs are untranslated size_t's] > 481 AUE_KILL NOPROTO { int thr_kill2(pid_t pid, long id, int sig); } Untranslated pid_t depends on pid_t being no larger than int. Untranslated long completely breaks this. > 482 AUE_SHMOPEN NOPROTO { int shm_open(const char *path, int flags, \ > @@ -892,25 +892,25 @@ > #ifdef PAD64_REQUIRED > 485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t which, \ > int pad, \ > - u_int32_t id1, u_int32_t id2, \ > + uint32_t id1, uint32_t id2, \ > cpusetid_t setid); } Untranslated cpusetid_t. It works since it is int. > #else > 485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t which, \ > - u_int32_t id1, u_int32_t id2, \ > + uint32_t id1, uint32_t id2, \ > cpusetid_t setid); } > #endif > 486 AUE_NULL STD { int freebsd32_cpuset_getid(cpulevel_t level, \ > cpuwhich_t which, \ > - u_int32_t id1, u_int32_t id2, \ > + uint32_t id1, uint32_t id2, \ > cpusetid_t *setid); } This and later have several more cpsetid_t's. Also cpuwhich_t's. id_t's are translated since they are 64 bits. This is painful. All types that are documented to be represented by id_t are only 32 bits, and id_t is wrong for representing 64-bit unsigned types since it is signed. The above has type puns to represent the signed 64-bit int in 2 uint32_t's. A pid of -1 would become pid_t -1, then id_t -1, then 0xffffffff, 0xffffffff. Signed off_t also requires type puns to represent in 2 uint32_t's. > ... > @@ -920,7 +920,7 @@ > 491 AUE_FCHOWNAT NOPROTO { int fchownat(int fd, char *path, uid_t uid, \ > gid_t gid, int flag); } Untranslated foo_t's. > @@ -959,9 +959,9 @@ > 512 AUE_SHMCTL NOSTD { int freebsd32_shmctl(int shmid, int cmd, \ > struct shmid_ds32 *buf); } > 513 AUE_LPATHCONF NOPROTO { int lpathconf(char *path, int name); } > -514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, u_int64_t rights); } > +514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, uint64_t rights); } Broken, assuming that all the other spittings into 2 uint32_t's are needed. > 515 AUE_CAP_GETRIGHTS NOPROTO { int cap_getrights(int fd, \ > - u_int64_t *rightsp); } > + uint64_t *rightsp); } Now the uint64_t is indirect, so it pronbably works. > Modified: head/sys/kern/syscalls.master > ============================================================================== > --- head/sys/kern/syscalls.master Fri May 25 21:12:24 2012 (r236025) > +++ head/sys/kern/syscalls.master Fri May 25 21:50:48 2012 (r236026) I didn't think of uint*N_t in this at first either. > @@ -916,9 +916,9 @@ > 512 AUE_SHMCTL NOSTD { int shmctl(int shmid, int cmd, \ > struct shmid_ds *buf); } > 513 AUE_LPATHCONF STD { int lpathconf(char *path, int name); } > -514 AUE_CAP_NEW STD { int cap_new(int fd, u_int64_t rights); } > +514 AUE_CAP_NEW STD { int cap_new(int fd, uint64_t rights); } > 515 AUE_CAP_GETRIGHTS STD { int cap_getrights(int fd, \ > - u_int64_t *rightsp); } > + uint64_t *rightsp); } > 516 AUE_CAP_ENTER STD { int cap_enter(void); } > 517 AUE_CAP_GETMODE STD { int cap_getmode(u_int *modep); } > 518 AUE_PDFORK STD { int pdfork(int *fdp, int flags); } In fact, this file has only 3 uint*N_t's. This shows that these 3 are all API design bugs no matter how they are spelled. All the very old syscalls use basic C types. All the not so old ones use a STDC or POSIX typedefed type, with the typedef specific to the context. The 3 exceptions new ones that hard-code a fixed width are the above 2 CAP ones and sctp_peeloff(), which uses "uint32_t name". These bugs are easiest to fix in the Linux syscall.master's since the bugs are mostly already avoided using l_foo_t. In amd64/linux32/ syscalls.master, I only noticed the following ones: % 1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \ % sys_exit_args void "int" for the return and args is not quite right, and it bogotifies the use of l_int for some args. It works though (assuming 32-bit host ints). Assumptions that the return type is 32-bit int and that the host int is 32-bits are implicit in all over, so we should assume them here for simplicity. (Hmm, td_retval is actually 2 register_t's. 64 bits each on amd64. amd64/linux32 has remarkably little code to convert these 2 64-bit ints into 4 32-bit ints.) % 2 AUE_FORK STD { int linux_fork(void); } % 3 AUE_NULL NOPROTO { int read(int fd, char *buf, \ % u_int nbyte); } This u_int should strictly be l_size_t. l_size_t is used a lot elswhere in this file. In syscalls where the type is actually u_int, l_uint should be used. l_uint is used a lot elsewhere in this file. But not many syscsalls use u_int, so many of these l_uints are probably just different misspellings of l_size_t. So the density of logical type bugs is high even in this file. % 4 AUE_NULL NOPROTO { int write(int fd, char *buf, \ % u_int nbyte); } u_int seems to be more common in older syscalls. % 5 AUE_OPEN_RWTC STD { int linux_open(char *path, l_int flags, \ % l_int mode); } Finally, an example of perfectly correct use of l_int. It even correctly handles the subtlety that l_mode_t promotes to l_int since open() is variadic. (BTW, I don't like hard-coding this promotion and have wished for the __promoteof() operator for giving it for more than 20 years. The promotion of a typedefed type even harder to determine than the correct PRI* mistake to use for printing a typedefed type.) This declaration is still far from correct altogether, since it depends on the usual hacks: - int return type is actual l_int - char *path is actually "const char *path" at the target level - magic to convert target "char *" to and from host "char *" % 11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t *argp, \ % uint32_t *envp); } See above. % 41 AUE_DUP NOPROTO { int dup(u_int fd); } Another untranslated type. dup() doesn't even take a u_int to begin with (it takes a normal int descriptor). Untranslated int args aren't actually very common. % 54 AUE_IOCTL STD { int linux_ioctl(l_uint fd, l_uint cmd, \ % uintptr_t arg); } Now l_foo is used for the descriptor, but u_int is wrong -- Linux uses a normal int for the descriptor for ioctl() too. l_uint for cmd is wrong too. The type starts as u_long (same as in FreeBSD), at least in the 1997 Linux userland that I used to check this. This type mismatch is harmless because ints and longs are both 32 bits on Linux-i386. uintptr_t for arg is wronger. For ioctl(), this arg is the first variadic one and might not be present. I think declaring it in the above gives (via the Linux ABI) the garbage contents of a register for it when it isn't present. Native FreeBSD ioctl() has evem more magic. It misdeclares the arg as caddr_t instead, and gives stack garbage for it when it isn't present, and depends on the stack being large enough to avoid a memory fault when copying the stack garbage (the FreeBSD ABO gives at least a return address there). The type of the arg, when it is present, is specified to be caddr_t (:-() in FreeBSD. Linux (1997 userland) is better and says it is "char *". It should have been "void *". syscall.master's should probably declare it as "void *". Here it starts as a 32-bit pointer and the usual magic will convert it to a 64-bit non-pointer represented as a host uintptr_t by the above or by a host "void *" with "void *" in the above. copy*() will eventually turn it into "void *uaddr" either way. Then it will still not really be a kernel pointer, but is used as one in the implementation of copy*() on amd64 (this depends on a flat address space). % 55 AUE_FCNTL STD { int linux_fcntl(l_uint fd, l_uint cmd, \ % uintptr_t arg); } Same errors for the types of fd and arg. Different error for the type of cmd. Unlike for ioctl(), it starts as neither long or unsigned, but just int (POSIX spec). % 56 AUE_NULL UNIMPL mpx % 57 AUE_SETPGRP NOPROTO { int setpgid(int pid, int pgid); } l_pid_t exists and should be used. % 60 AUE_UMASK NOPROTO { int umask(int newmask); } l_mode_t exists and should be used. % 63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } Bogus fd types, as usual. % 65 AUE_GETPGRP NOPROTO { int getpgrp(void); } Should really be more careful with return types that are typedefed in the API (and are not just int statuses or fds). kern/syscalls.master is sloppy with this too. % 74 AUE_SYSCTL STD { int linux_sethostname(char *hostname, \ % u_int len); } get/sethostname() is horribly inconsistent. In FreeBSD, gethostname() is documented as taking a size_t and sethostname() is documented as taking an int. kern/syscalls.master uses u_int for both. Apparently there is enough magic with arg packing for this to work even on supported 64-bit big-endian systems. Linux userland was better even in 1997 -- it uses size_t for both. POSIX has specified gethostname() since at least 2001. It uses size_t of course. It says that these are 4.3BSD functions but it only specifies gethostname(), and it applies an OpenGroup resolution to change the type from socklen_t to size_t for gethostname(). This made it incompatible with BSD. Old BSD uses int for both, and FreeBSD apparently changed the documentation but not the code for gethostname() only, to be bug for compatible with POSIX. So the above should use l_size_t, and strictly, the code probably needs to be more careful than it is with unrepresentable sizes (native sethostname() wants a signed int and might not have the right checking for a 32-bit unsigned size_t). % 75 AUE_SETRLIMIT STD { int linux_setrlimit(l_uint resource, \ % struct l_rlimit *rlim); } % 76 AUE_GETRLIMIT STD { int linux_old_getrlimit(l_uint resource, \ % struct l_rlimit *rlim); } Resource numbers should be plain ints too. They are documented to be as such in old Linux userland man pages. But in old Linux (glibc) headers, they are obfuscated as __rlimit_resource_t, which an enum with gnu extensions, else plain int. % 78 AUE_NULL STD { int linux_gettimeofday( \ % struct l_timeval *tp, \ % struct timezone *tzp); } % 79 AUE_SETTIMEOFDAY STD { int linux_settimeofday( \ % struct l_timeval *tp, \ % struct timezone *tzp); } The timezone struct only has a couple of ints in it, so this abuse of the native timezone works, but is fragile. I forget if the timezone arg is deprecated to the point of ignoring it for native get/settimeofday(). If so, then this won't work for emulated get/settimeofday() % 85 AUE_READLINK STD { int linux_readlink(char *name, char *buf, \ % l_int count); } Native readlink was churned by POSIX from an int count to a size_t count. Linux readlink has takes a size_t count even in 1997 and probably still does. % 88 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ % l_int magic2, l_uint cmd, void *arg); } In old Linux userland it is documented to take only 3 int args, with the 3rd one named `flag'. % ; 89: old_readdir % 89 AUE_GETDIRENTRIES STD { int linux_readdir(l_uint fd, \ % struct l_dirent *dent, l_uint count); } Matches old Linux userland man page right down to the u_int for fd. % 91 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } Takes a void * and a size_t in modern munmap() and Linux had that in 1997. FreeBSD-3 had this too. The above matches FreeBSD-1. % 92 AUE_TRUNCATE STD { int linux_truncate(char *path, \ % l_ulong length); } Should use l_off_t, not l_ulong (except possibly if their is an unsigned hack to support file sizes of 2G-4G). % 93 AUE_FTRUNCATE STD { int linux_ftruncate(int fd, long length); } Using long is very broken. l_off_t is correct here too. % 94 AUE_FCHMOD NOPROTO { int fchmod(int fd, int mode); } mode_t is used for all other *chmod*()'s in this file % 95 AUE_FCHOWN NOPROTO { int fchown(int fd, int uid, int gid); } l_uid16_t and l_gid16_t are used for all other old *chown*() in this file. (Newer ones are spelled *lchown*() and take l_uid_t and l_gid_t's.) % 96 AUE_GETPRIORITY STD { int linux_getpriority(int which, int who); } % 97 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ % int prio); } `who' should have type pid_t, but is still int in FreeBSD native. In old Linux, it is int in the man page but is obfuscated as id_t in the glibc header. Even `which' is obfuscated as __priority_which_t in the glibc header. (I consider even using size_t for read() to be a regression. Typedefed types are hard to use correctly, as shown by this mail which points out that hundreds of incorrect uses, where the bugs are only harmless because the use of typedefed types makes no significant difference.) Got bored here, and looked at the rest less carefully. The newer syscalls seem to be handled more carefully, probably because plenty of Linux types existed when they were written. There just seemed to be too many l_[u]longs in them. % 168 AUE_POLL NOPROTO { int poll(struct pollfd *fds, \ % unsigned int nfds, int timeout); } Hrmph, this is the only one that misspells "unsigned" more verbosely as "unsigned int" instead of as the usual KNF abbreviation "u_int". Of course, poll() doesn't even take a u_int type. Modern poll takes an nfds_t type. Linux had that in 1997, and it was u_long, not u_int. Use of the native struct pollfd is dangerous. It works because it consists of an int followed by 2 shorts, and this matches the Linux type and neither has neither unnamed padding on at least amd64 and i386. % 180 AUE_PREAD STD { int linux_pread(l_uint fd, char *buf, \ % l_size_t nbyte, l_loff_t offset); } % [... several more bogus l_uints for fds] % 183 AUE_GETCWD STD { int linux_getcwd(char *buf, \ % l_ulong bufsize); } A different misspelling of l_size_t. % 191 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \ % struct l_rlimit *rlim); } Bogus resource number times for new rlimit syscalls too. % 193 AUE_TRUNCATE STD { int linux_truncate64(char *path, \ % l_loff_t length); } % 194 AUE_FTRUNCATE STD { int linux_ftruncate64(l_uint fd, \ % l_loff_t length); } How can this work? I was going to say that the splitting up of the 64-bit args in compat/freebsd32/syscalls.master was unnecessary because it is apparently not needed here. Then I misread this as doing the splitting. But it doesn't. Similarly later in this file. % 218 AUE_MINCORE STD { int linux_mincore(l_ulong start, \ % l_size_t len, u_char *vec); } % 219 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \ % int behav); } SIlly to have l_size_t in one and raw size_t in the next. I just noticed that NOPROTO calls never use l_foo. They go direct to the native calls, and spelling things without an l_ may be necessary for hiding the type mismatches from this. But this is especially fragile, and maybe the l_'s here would be harmless since they have no effect, since type checking for the direct calls is destroyed better using (sy_call_t *) casts. % 220 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ % void *dirent, l_uint count); } % 221 AUE_FCNTL STD { int linux_fcntl64(l_uint fd, l_uint cmd, \ % uintptr_t arg); } Type errors for 32-bit syscalls are often duplicated for the corresponding 64-bit ones. My old userland doesn't have these new syscalls to check, but I doubt that Linux changed the API for the non-64 bit parts, and u_int fds are bogus as usual. % 240 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, uint32_t val, \ % struct l_timespec *timeout, uint32_t *uaddr2, uint32_t val3); } % 241 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid, l_uint len, \ % l_ulong *user_mask_ptr); } % 242 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid, l_uint len, \ % l_ulong *user_mask_ptr); } % 243 AUE_NULL STD { int linux_set_thread_area(struct l_user_desc *desc); } Lots of style bugs which are not present in old code: - lines are not wrapped at 80 columns - wrapped lines are misindented. % 250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ % l_size_t len, int advice); } More style bugs. % 264 AUE_CLOCK_SETTIME STD { int linux_clock_settime(clockid_t which, struct l_timespec *tp); } % 265 AUE_NULL STD { int linux_clock_gettime(clockid_t which, struct l_timespec *tp); } % 266 AUE_NULL STD { int linux_clock_getres(clockid_t which, struct l_timespec *tp); } % 267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \ % struct l_timespec *rqtp, struct l_timespec *rmtp); } % 268 AUE_STATFS STD { int linux_statfs64(char *path, size_t bufsize, struct l_statfs64_buf *buf); } Another raw size_t. Another long line. % 269 AUE_FSTATFS STD { int linux_fstatfs64(void); } % 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } Raw ints for pids. % 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ % struct l_timeval *tptr); } % 272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ % l_loff_t offset, l_loff_t len, \ % int advice); } Just about all syscalls added since #239 are misformatted :-(. % 295 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, const char *filename, \ % l_int flags, l_int mode); } % 296 AUE_MKDIRAT STD { int linux_mkdirat(l_int dfd, const char *pathname, \ % l_int mode); } % 297 AUE_MKNODAT STD { int linux_mknodat(l_int dfd, const char *filename, \ % l_int mode, l_uint dev); } % 298 AUE_FCHOWNAT STD { int linux_fchownat(l_int dfd, const char *filename, \ % l_uid16_t uid, l_gid16_t gid, l_int flag); } % 299 AUE_FUTIMESAT STD { int linux_futimesat(l_int dfd, char *filename, \ % struct l_timeval *utimes); } % 300 AUE_FSTATAT STD { int linux_fstatat64(l_int dfd, char *pathname, \ % struct l_stat64 *statbuf, l_int flag); } % 301 AUE_UNLINKAT STD { int linux_unlinkat(l_int dfd, const char *pathname, \ % l_int flag); } % 302 AUE_RENAMEAT STD { int linux_renameat(l_int olddfd, const char *oldname, \ % l_int newdfd, const char *newname); } % 303 AUE_LINKAT STD { int linux_linkat(l_int olddfd, const char *oldname, \ % l_int newdfd, const char *newname, l_int flag); } % 304 AUE_SYMLINKAT STD { int linux_symlinkat(const char *oldname, l_int newdfd, \ % const char *newname); } % 305 AUE_READLINKAT STD { int linux_readlinkat(l_int dfd, const char *path, \ % char *buf, l_int bufsiz); } % 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ % l_mode_t mode); } % 307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode, int flag); } Mounds more misformatting. [... A small pile of misformatting] Bruce From owner-svn-src-all@FreeBSD.ORG Sat May 26 12:39:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D02E8106566C; Sat, 26 May 2012 12:39:23 +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 B03BC8FC08; Sat, 26 May 2012 12:39:23 +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 q4QCdNFw077778; Sat, 26 May 2012 12:39:23 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QCdNu1077776; Sat, 26 May 2012 12:39:23 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205261239.q4QCdNu1077776@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 12:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236095 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 12:39:23 -0000 Author: raj Date: Sat May 26 12:39:23 2012 New Revision: 236095 URL: http://svn.freebsd.org/changeset/base/236095 Log: Provide SPR definitions for newer Book-E (E500mc, E5500, PPC465). Obtained from: Freescale, Semihalf. Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat May 26 12:15:13 2012 (r236094) +++ head/sys/powerpc/include/spr.h Sat May 26 12:39:23 2012 (r236095) @@ -184,6 +184,8 @@ #define MPC8245 0x8081 #define FSL_E500v1 0x8020 #define FSL_E500v2 0x8021 +#define FSL_E500mc 0x8023 +#define FSL_E5500 0x8024 #define SPR_IBAT0U 0x210 /* .68 Instruction BAT Reg 0 Upper */ #define SPR_IBAT0U 0x210 /* .6. Instruction BAT Reg 0 Upper */ @@ -421,6 +423,7 @@ #define SPR_SRR3 0x3df /* 4.. Save/Restore Register 3 */ #define SPR_HID0 0x3f0 /* ..8 Hardware Implementation Register 0 */ #define SPR_HID1 0x3f1 /* ..8 Hardware Implementation Register 1 */ +#define SPR_HID2 0x3f3 /* ..8 Hardware Implementation Register 2 */ #define SPR_HID4 0x3f4 /* ..8 Hardware Implementation Register 4 */ #define SPR_HID5 0x3f6 /* ..8 Hardware Implementation Register 5 */ #define SPR_HID6 0x3f9 /* ..8 Hardware Implementation Register 6 */ @@ -627,6 +630,8 @@ #elif defined(E500) +#define SPR_MCSR 0x23c /* ..8 Machine Check Syndrome register */ + #define SPR_ESR 0x003e /* ..8 Exception Syndrome Register */ #define ESR_PIL 0x08000000 /* Program interrupt - illegal */ #define ESR_PPR 0x04000000 /* Program interrupt - privileged */ @@ -637,11 +642,16 @@ #define ESR_BO 0x00020000 /* Data/instruction storage, byte ordering */ #define ESR_SPE 0x00000080 /* SPE exception bit */ + #define SPR_CSRR0 0x03a /* ..8 58 Critical SRR0 */ #define SPR_CSRR1 0x03b /* ..8 59 Critical SRR1 */ #define SPR_MCSRR0 0x23a /* ..8 570 Machine check SRR0 */ #define SPR_MCSRR1 0x23b /* ..8 571 Machine check SRR1 */ +#define SPR_MMUCSR0 0x3f4 /* ..8 1012 MMU Control and Status Register 0 */ +#define MMUCSR0_L2TLB0_FI 0x04 /* TLB0 flash invalidate */ +#define MMUCSR0_L2TLB1_FI 0x02 /* TLB1 flash invalidate */ + #define SPR_SVR 0x3ff /* ..8 1023 System Version Register */ #define SVR_MPC8533 0x8034 #define SVR_MPC8533E 0x803c @@ -661,10 +671,16 @@ #define SVR_P2010E 0x80eb #define SVR_P2020 0x80e2 #define SVR_P2020E 0x80ea +#define SVR_P2041 0x8210 +#define SVR_P2041E 0x8218 +#define SVR_P3041 0x8211 +#define SVR_P3041E 0x8219 #define SVR_P4040 0x8200 #define SVR_P4040E 0x8208 #define SVR_P4080 0x8201 #define SVR_P4080E 0x8209 +#define SVR_P5020 0x8220 +#define SVR_P5020E 0x8228 #define SVR_VER(svr) (((svr) >> 16) & 0xffff) #define SPR_PID0 0x030 /* ..8 Process ID Register 0 */ @@ -707,6 +723,18 @@ #define SPR_MAS5 0x275 /* ..8 MMU Assist Register 5 Book-E */ #define SPR_MAS6 0x276 /* ..8 MMU Assist Register 6 Book-E/e500 */ #define SPR_MAS7 0x3B0 /* ..8 MMU Assist Register 7 Book-E/e500 */ +#define SPR_MAS8 0x155 /* ..8 MMU Assist Register 8 Book-E/e500 */ + +#define SPR_L1CFG0 0x203 /* ..8 L1 cache configuration register 0 */ +#define SPR_L1CFG1 0x204 /* ..8 L1 cache configuration register 1 */ + +#define SPR_CCR1 0x378 +#define CCR1_L2COBE 0x00000040 + +#define DCR_L2DCDCRAI 0x0000 /* L2 D-Cache DCR Address Pointer */ +#define DCR_L2DCDCRDI 0x0001 /* L2 D-Cache DCR Data Indirect */ +#define DCR_L2CR0 0x00 /* L2 Cache Configuration Register 0 */ +#define L2CR0_AS 0x30000000 #define SPR_L1CSR0 0x3F2 /* ..8 L1 Cache Control and Status Register 0 */ #define L1CSR0_DCPE 0x00010000 /* Data Cache Parity Enable */ @@ -715,12 +743,20 @@ #define L1CSR0_DCE 0x00000001 /* Data Cache Enable */ #define SPR_L1CSR1 0x3F3 /* ..8 L1 Cache Control and Status Register 1 */ #define L1CSR1_ICPE 0x00010000 /* Instruction Cache Parity Enable */ +#define L1CSR1_ICUL 0x00000400 /* Instr Cache Unable to Lock */ #define L1CSR1_ICLFR 0x00000100 /* Instruction Cache Lock Bits Flash Reset */ #define L1CSR1_ICFI 0x00000002 /* Instruction Cache Flash Invalidate */ #define L1CSR1_ICE 0x00000001 /* Instruction Cache Enable */ +#define SPR_L2CSR0 0x3F9 /* ..8 L2 Cache Control and Status Register 0 */ +#define L2CSR0_L2E 0x80000000 /* L2 Cache Enable */ +#define L2CSR0_L2PE 0x40000000 /* L2 Cache Parity Enable */ +#define L2CSR0_L2FI 0x00200000 /* L2 Cache Flash Invalidate */ +#define L2CSR0_L2LFC 0x00000400 /* L2 Cache Lock Flags Clear */ + #define SPR_BUCSR 0x3F5 /* ..8 Branch Unit Control and Status Register */ #define BUCSR_BPEN 0x00000001 /* Branch Prediction Enable */ +#define BUCSR_BBFI 0x00000200 /* Branch Buffer Flash Invalidate */ #endif /* #elif defined(E500) */ From owner-svn-src-all@FreeBSD.ORG Sat May 26 13:12:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D25B51065674; Sat, 26 May 2012 13:12:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BABA08FC17; Sat, 26 May 2012 13:12: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 q4QDCERD079129; Sat, 26 May 2012 13:12:14 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QDCELs079120; Sat, 26 May 2012 13:12:14 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201205261312.q4QDCELs079120@svn.freebsd.org> From: Rick Macklem Date: Sat, 26 May 2012 13:12: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: r236096 - in stable/9/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 13:12:14 -0000 Author: rmacklem Date: Sat May 26 13:12:14 2012 New Revision: 236096 URL: http://svn.freebsd.org/changeset/base/236096 Log: MFC: r235332 PR# 165923 reported intermittent write failures for dirty memory mapped pages being written back on an NFS mount. Since any thread can call VOP_PUTPAGES() to write back a dirty page, the credentials of that thread may not have write access to the file on an NFS server. (Often the uid is 0, which may be mapped to "nobody" in the NFS server.) Although there is no completely correct fix for this (NFS servers check access on every write RPC instead of at open/mmap time), this patch avoids the common cases by holding onto a credential that recently opened the file for writing and uses that credential for the write RPCs being done by VOP_PUTPAGES() for both NFS clients. Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c stable/9/sys/fs/nfsclient/nfs_clnode.c stable/9/sys/fs/nfsclient/nfs_clvnops.c stable/9/sys/fs/nfsclient/nfsnode.h stable/9/sys/nfsclient/nfs_bio.c stable/9/sys/nfsclient/nfs_node.c stable/9/sys/nfsclient/nfs_vnops.c stable/9/sys/nfsclient/nfsnode.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/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Sat May 26 12:39:23 2012 (r236095) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Sat May 26 13:12:14 2012 (r236096) @@ -281,7 +281,11 @@ ncl_putpages(struct vop_putpages_args *a vp = ap->a_vp; np = VTONFS(vp); td = curthread; /* XXX */ - cred = curthread->td_ucred; /* XXX */ + /* Set the cred to n_writecred for the write rpcs. */ + if (np->n_writecred != NULL) + cred = crhold(np->n_writecred); + else + cred = crhold(curthread->td_ucred); /* XXX */ nmp = VFSTONFS(vp->v_mount); pages = ap->a_m; count = ap->a_count; @@ -345,6 +349,7 @@ ncl_putpages(struct vop_putpages_args *a iomode = NFSWRITE_FILESYNC; error = ncl_writerpc(vp, &uio, cred, &iomode, &must_commit, 0); + crfree(cred); pmap_qremove(kva, npages); relpbuf(bp, &ncl_pbuf_freecnt); Modified: stable/9/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clnode.c Sat May 26 12:39:23 2012 (r236095) +++ stable/9/sys/fs/nfsclient/nfs_clnode.c Sat May 26 13:12:14 2012 (r236096) @@ -300,6 +300,8 @@ ncl_reclaim(struct vop_reclaim_args *ap) FREE((caddr_t)dp2, M_NFSDIROFF); } } + if (np->n_writecred != NULL) + crfree(np->n_writecred); FREE((caddr_t)np->n_fhp, M_NFSFH); if (np->n_v4 != NULL) FREE((caddr_t)np->n_v4, M_NFSV4NODE); Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvnops.c Sat May 26 12:39:23 2012 (r236095) +++ stable/9/sys/fs/nfsclient/nfs_clvnops.c Sat May 26 13:12:14 2012 (r236096) @@ -513,6 +513,7 @@ nfs_open(struct vop_open_args *ap) struct vattr vattr; int error; int fmode = ap->a_mode; + struct ucred *cred; if (vp->v_type != VREG && vp->v_type != VDIR && vp->v_type != VLNK) return (EOPNOTSUPP); @@ -604,7 +605,22 @@ nfs_open(struct vop_open_args *ap) } np->n_directio_opens++; } + + /* + * If this is an open for writing, capture a reference to the + * credentials, so they can be used by ncl_putpages(). Using + * these write credentials is preferable to the credentials of + * whatever thread happens to be doing the VOP_PUTPAGES() since + * the write RPCs are less likely to fail with EACCES. + */ + if ((fmode & FWRITE) != 0) { + cred = np->n_writecred; + np->n_writecred = crhold(ap->a_cred); + } else + cred = NULL; mtx_unlock(&np->n_mtx); + if (cred != NULL) + crfree(cred); vnode_create_vobject(vp, vattr.va_size, ap->a_td); return (0); } Modified: stable/9/sys/fs/nfsclient/nfsnode.h ============================================================================== --- stable/9/sys/fs/nfsclient/nfsnode.h Sat May 26 12:39:23 2012 (r236095) +++ stable/9/sys/fs/nfsclient/nfsnode.h Sat May 26 13:12:14 2012 (r236096) @@ -126,6 +126,7 @@ struct nfsnode { int n_directio_asyncwr; u_int64_t n_change; /* old Change attribute */ struct nfsv4node *n_v4; /* extra V4 stuff */ + struct ucred *n_writecred; /* Cred. for putpages */ }; #define n_atim n_un1.nf_atim Modified: stable/9/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/9/sys/nfsclient/nfs_bio.c Sat May 26 12:39:23 2012 (r236095) +++ stable/9/sys/nfsclient/nfs_bio.c Sat May 26 13:12:14 2012 (r236096) @@ -275,7 +275,11 @@ nfs_putpages(struct vop_putpages_args *a vp = ap->a_vp; np = VTONFS(vp); td = curthread; /* XXX */ - cred = curthread->td_ucred; /* XXX */ + /* Set the cred to n_writecred for the write rpcs. */ + if (np->n_writecred != NULL) + cred = crhold(np->n_writecred); + else + cred = crhold(curthread->td_ucred); /* XXX */ nmp = VFSTONFS(vp->v_mount); pages = ap->a_m; count = ap->a_count; @@ -339,6 +343,7 @@ nfs_putpages(struct vop_putpages_args *a iomode = NFSV3WRITE_FILESYNC; error = (nmp->nm_rpcops->nr_writerpc)(vp, &uio, cred, &iomode, &must_commit); + crfree(cred); pmap_qremove(kva, npages); relpbuf(bp, &nfs_pbuf_freecnt); Modified: stable/9/sys/nfsclient/nfs_node.c ============================================================================== --- stable/9/sys/nfsclient/nfs_node.c Sat May 26 12:39:23 2012 (r236095) +++ stable/9/sys/nfsclient/nfs_node.c Sat May 26 13:12:14 2012 (r236096) @@ -270,6 +270,8 @@ nfs_reclaim(struct vop_reclaim_args *ap) free((caddr_t)dp2, M_NFSDIROFF); } } + if (np->n_writecred != NULL) + crfree(np->n_writecred); if (np->n_fhsize > NFS_SMALLFH) { free((caddr_t)np->n_fhp, M_NFSBIGFH); } Modified: stable/9/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/9/sys/nfsclient/nfs_vnops.c Sat May 26 12:39:23 2012 (r236095) +++ stable/9/sys/nfsclient/nfs_vnops.c Sat May 26 13:12:14 2012 (r236096) @@ -509,6 +509,7 @@ nfs_open(struct vop_open_args *ap) struct vattr vattr; int error; int fmode = ap->a_mode; + struct ucred *cred; if (vp->v_type != VREG && vp->v_type != VDIR && vp->v_type != VLNK) return (EOPNOTSUPP); @@ -565,7 +566,22 @@ nfs_open(struct vop_open_args *ap) } np->n_directio_opens++; } + + /* + * If this is an open for writing, capture a reference to the + * credentials, so they can be used by nfs_putpages(). Using + * these write credentials is preferable to the credentials of + * whatever thread happens to be doing the VOP_PUTPAGES() since + * the write RPCs are less likely to fail with EACCES. + */ + if ((fmode & FWRITE) != 0) { + cred = np->n_writecred; + np->n_writecred = crhold(ap->a_cred); + } else + cred = NULL; mtx_unlock(&np->n_mtx); + if (cred != NULL) + crfree(cred); vnode_create_vobject(vp, vattr.va_size, ap->a_td); return (0); } Modified: stable/9/sys/nfsclient/nfsnode.h ============================================================================== --- stable/9/sys/nfsclient/nfsnode.h Sat May 26 12:39:23 2012 (r236095) +++ stable/9/sys/nfsclient/nfsnode.h Sat May 26 13:12:14 2012 (r236096) @@ -131,6 +131,7 @@ struct nfsnode { uint32_t n_namelen; int n_directio_opens; int n_directio_asyncwr; + struct ucred *n_writecred; /* Cred. for putpages */ }; #define n_atim n_un1.nf_atim From owner-svn-src-all@FreeBSD.ORG Sat May 26 13:36:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08B45106566C; Sat, 26 May 2012 13:36:19 +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 DDA558FC12; Sat, 26 May 2012 13:36: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 q4QDaIoX080109; Sat, 26 May 2012 13:36:18 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QDaIia080105; Sat, 26 May 2012 13:36:18 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205261336.q4QDaIia080105@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 13:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236097 - in head/sys/powerpc: booke powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 13:36:19 -0000 Author: raj Date: Sat May 26 13:36:18 2012 New Revision: 236097 URL: http://svn.freebsd.org/changeset/base/236097 Log: Rename e500 prefix to match other Book-E CPU variations. CPU id tidbits for the new cores. Obtained from: Freescale, Semihalf. Modified: head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/platform_bare.c head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sat May 26 13:12:14 2012 (r236096) +++ head/sys/powerpc/booke/machdep.c Sat May 26 13:36:18 2012 (r236097) @@ -185,8 +185,8 @@ SYSCTL_INT(_machdep, CPU_CACHELINE, cach int hw_direct_map = 0; -static void cpu_e500_startup(void *); -SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_e500_startup, NULL); +static void cpu_booke_startup(void *); +SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_booke_startup, NULL); void print_kernel_section_addr(void); void print_kenv(void); @@ -195,7 +195,7 @@ u_int booke_init(uint32_t, uint32_t); extern int elf32_nxstack; static void -cpu_e500_startup(void *dummy) +cpu_booke_startup(void *dummy) { int indx, size; @@ -538,7 +538,8 @@ cpu_halt(void) { mtmsr(mfmsr() & ~(PSL_CE | PSL_EE | PSL_ME | PSL_DE)); - while (1); + while (1) + ; } int Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Sat May 26 13:12:14 2012 (r236096) +++ head/sys/powerpc/booke/platform_bare.c Sat May 26 13:36:18 2012 (r236097) @@ -73,7 +73,7 @@ static int bare_smp_next_cpu(platform_t, static int bare_smp_get_bsp(platform_t, struct cpuref *cpuref); static int bare_smp_start_cpu(platform_t, struct pcpu *cpu); -static void e500_reset(platform_t); +static void booke_reset(platform_t); static platform_method_t bare_methods[] = { PLATFORMMETHOD(platform_probe, bare_probe), @@ -85,7 +85,7 @@ static platform_method_t bare_methods[] PLATFORMMETHOD(platform_smp_get_bsp, bare_smp_get_bsp), PLATFORMMETHOD(platform_smp_start_cpu, bare_smp_start_cpu), - PLATFORMMETHOD(platform_reset, e500_reset), + PLATFORMMETHOD(platform_reset, booke_reset), { 0, 0 } }; @@ -307,7 +307,7 @@ bare_smp_start_cpu(platform_t plat, stru } static void -e500_reset(platform_t plat) +booke_reset(platform_t plat) { /* @@ -328,6 +328,7 @@ e500_reset(platform_t plat) mtspr(SPR_DBCR0, mfspr(SPR_DBCR0) | DBCR0_IDM | DBCR0_RST_SYSTEM); printf("Reset failed...\n"); - while (1); + while (1) + ; } Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Sat May 26 13:12:14 2012 (r236096) +++ head/sys/powerpc/powerpc/cpu.c Sat May 26 13:36:18 2012 (r236097) @@ -75,13 +75,13 @@ #include static void cpu_6xx_setup(int cpuid, uint16_t vers); -static void cpu_e500_setup(int cpuid, uint16_t vers); static void cpu_970_setup(int cpuid, uint16_t vers); +static void cpu_booke_setup(int cpuid, uint16_t vers); int powerpc_pow_enabled; void (*cpu_idle_hook)(void) = NULL; static void cpu_idle_60x(void); -static void cpu_idle_e500(void); +static void cpu_idle_booke(void); struct cputab { const char *name; @@ -146,9 +146,13 @@ static const struct cputab models[] = { { "Motorola PowerPC 8245", MPC8245, REVFMT_MAJMIN, PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, { "Freescale e500v1 core", FSL_E500v1, REVFMT_MAJMIN, - 0, cpu_e500_setup }, + 0, cpu_booke_setup }, { "Freescale e500v2 core", FSL_E500v2, REVFMT_MAJMIN, - 0, cpu_e500_setup }, + 0, cpu_booke_setup }, + { "Freescale e500mc core", FSL_E500mc, REVFMT_MAJMIN, + 0, cpu_booke_setup }, + { "Freescale e5500 core", FSL_E5500, REVFMT_MAJMIN, + 0, cpu_booke_setup }, { "IBM Cell Broadband Engine", IBMCELLBE, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, NULL}, @@ -191,6 +195,8 @@ cpu_setup(u_int cpuid) break; case FSL_E500v1: case FSL_E500v2: + case FSL_E500mc: + case FSL_E5500: maj = (pvr >> 4) & 0xf; min = (pvr >> 0) & 0xf; break; @@ -438,7 +444,7 @@ cpu_6xx_print_cacheinfo(u_int cpuid, uin } static void -cpu_e500_setup(int cpuid, uint16_t vers) +cpu_booke_setup(int cpuid, uint16_t vers) { register_t hid0; @@ -453,7 +459,7 @@ cpu_e500_setup(int cpuid, uint16_t vers) printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, HID0_E500_BITMASK); if (cpu_idle_hook == NULL) - cpu_idle_hook = cpu_idle_e500; + cpu_idle_hook = cpu_idle_booke; } static void @@ -519,6 +525,7 @@ cpu_idle(int busy) CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); + if (cpu_idle_hook != NULL) { if (!busy) { critical_enter(); @@ -530,6 +537,7 @@ cpu_idle(int busy) critical_exit(); } } + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu); } @@ -576,7 +584,7 @@ cpu_idle_60x(void) } static void -cpu_idle_e500(void) +cpu_idle_booke(void) { register_t msr; From owner-svn-src-all@FreeBSD.ORG Sat May 26 13:42:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 916211065670; Sat, 26 May 2012 13:42:56 +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 7C1AA8FC17; Sat, 26 May 2012 13:42:56 +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 q4QDguvp080438; Sat, 26 May 2012 13:42:56 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QDguqn080436; Sat, 26 May 2012 13:42:56 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205261342.q4QDguqn080436@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 13:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236098 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 13:42:56 -0000 Author: raj Date: Sat May 26 13:42:55 2012 New Revision: 236098 URL: http://svn.freebsd.org/changeset/base/236098 Log: Retrieve CPU number info from the device tree. Obtained from: Freescale, Semihalf. Modified: head/sys/powerpc/booke/platform_bare.c Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Sat May 26 13:36:18 2012 (r236097) +++ head/sys/powerpc/booke/platform_bare.c Sat May 26 13:42:55 2012 (r236098) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008-2009 Semihalf, Rafal Jaworowski + * Copyright (c) 2008-2012 Semihalf. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -101,26 +101,16 @@ PLATFORM_DEF(bare_platform); static int bare_probe(platform_t plat) { - uint32_t ver, sr; + phandle_t cpus, child; + uint32_t sr; int i, law_max, tgt; - ver = SVR_VER(mfspr(SPR_SVR)); - switch (ver & ~0x0008) { /* Mask Security Enabled bit */ - case SVR_P4080: - maxcpu = 8; - break; - case SVR_P4040: - maxcpu = 4; - break; - case SVR_MPC8572: - case SVR_P1020: - case SVR_P2020: - maxcpu = 2; - break; - default: + if ((cpus = OF_finddevice("/cpus")) != 0) { + for (maxcpu = 0, child = OF_child(cpus); child != 0; + child = OF_peer(child), maxcpu++) + ; + } else maxcpu = 1; - break; - } /* * Clear local access windows. Skip DRAM entries, so we don't shoot From owner-svn-src-all@FreeBSD.ORG Sat May 26 14:23:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 368731065680; Sat, 26 May 2012 14:23:19 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F1108FC1C; Sat, 26 May 2012 14:23:19 +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 q4QENJvX082199; Sat, 26 May 2012 14:23:19 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QENIKv082185; Sat, 26 May 2012 14:23:18 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261423.q4QENIKv082185@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 14:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236099 - in vendor/openpam/dist: . bin bin/openpam_dump_policy bin/pamtest bin/su doc/man include/security lib misc t X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 14:23:19 -0000 Author: des Date: Sat May 26 14:23:18 2012 New Revision: 236099 URL: http://svn.freebsd.org/changeset/base/236099 Log: Vendor import of OpenPAM Micrampelis. Added: vendor/openpam/dist/TODO vendor/openpam/dist/bin/openpam_dump_policy/ vendor/openpam/dist/bin/openpam_dump_policy/Makefile.am vendor/openpam/dist/bin/openpam_dump_policy/Makefile.in vendor/openpam/dist/bin/openpam_dump_policy/openpam_dump_policy.c vendor/openpam/dist/doc/man/openpam_get_feature.3 vendor/openpam/dist/doc/man/openpam_readlinev.3 vendor/openpam/dist/doc/man/openpam_readword.3 vendor/openpam/dist/doc/man/openpam_set_feature.3 vendor/openpam/dist/doc/man/openpam_straddch.3 vendor/openpam/dist/lib/openpam_ctype.h vendor/openpam/dist/lib/openpam_features.c vendor/openpam/dist/lib/openpam_features.h vendor/openpam/dist/lib/openpam_get_feature.c vendor/openpam/dist/lib/openpam_readlinev.c vendor/openpam/dist/lib/openpam_readword.c vendor/openpam/dist/lib/openpam_set_feature.c vendor/openpam/dist/lib/openpam_straddch.c vendor/openpam/dist/lib/openpam_strlcat.h vendor/openpam/dist/pamgdb.in vendor/openpam/dist/t/ vendor/openpam/dist/t/Makefile.am vendor/openpam/dist/t/Makefile.in vendor/openpam/dist/t/t.h vendor/openpam/dist/t/t_main.c vendor/openpam/dist/t/t_openpam_readlinev.c vendor/openpam/dist/t/t_openpam_readword.c Modified: vendor/openpam/dist/CREDITS vendor/openpam/dist/HISTORY vendor/openpam/dist/LICENSE vendor/openpam/dist/Makefile.am vendor/openpam/dist/Makefile.in vendor/openpam/dist/RELNOTES vendor/openpam/dist/aclocal.m4 vendor/openpam/dist/bin/Makefile.am vendor/openpam/dist/bin/Makefile.in vendor/openpam/dist/bin/pamtest/pamtest.1 vendor/openpam/dist/bin/pamtest/pamtest.c vendor/openpam/dist/bin/su/su.1 vendor/openpam/dist/config.h.in vendor/openpam/dist/configure vendor/openpam/dist/configure.ac vendor/openpam/dist/doc/man/Makefile.am vendor/openpam/dist/doc/man/Makefile.in vendor/openpam/dist/doc/man/openpam.3 vendor/openpam/dist/doc/man/openpam_borrow_cred.3 vendor/openpam/dist/doc/man/openpam_free_data.3 vendor/openpam/dist/doc/man/openpam_free_envlist.3 vendor/openpam/dist/doc/man/openpam_get_option.3 vendor/openpam/dist/doc/man/openpam_log.3 vendor/openpam/dist/doc/man/openpam_nullconv.3 vendor/openpam/dist/doc/man/openpam_readline.3 vendor/openpam/dist/doc/man/openpam_restore_cred.3 vendor/openpam/dist/doc/man/openpam_set_option.3 vendor/openpam/dist/doc/man/openpam_subst.3 vendor/openpam/dist/doc/man/openpam_ttyconv.3 vendor/openpam/dist/doc/man/pam.3 vendor/openpam/dist/doc/man/pam.conf.5 vendor/openpam/dist/doc/man/pam_acct_mgmt.3 vendor/openpam/dist/doc/man/pam_authenticate.3 vendor/openpam/dist/doc/man/pam_chauthtok.3 vendor/openpam/dist/doc/man/pam_close_session.3 vendor/openpam/dist/doc/man/pam_conv.3 vendor/openpam/dist/doc/man/pam_end.3 vendor/openpam/dist/doc/man/pam_error.3 vendor/openpam/dist/doc/man/pam_get_authtok.3 vendor/openpam/dist/doc/man/pam_get_data.3 vendor/openpam/dist/doc/man/pam_get_item.3 vendor/openpam/dist/doc/man/pam_get_user.3 vendor/openpam/dist/doc/man/pam_getenv.3 vendor/openpam/dist/doc/man/pam_getenvlist.3 vendor/openpam/dist/doc/man/pam_info.3 vendor/openpam/dist/doc/man/pam_open_session.3 vendor/openpam/dist/doc/man/pam_prompt.3 vendor/openpam/dist/doc/man/pam_putenv.3 vendor/openpam/dist/doc/man/pam_set_data.3 vendor/openpam/dist/doc/man/pam_set_item.3 vendor/openpam/dist/doc/man/pam_setcred.3 vendor/openpam/dist/doc/man/pam_setenv.3 vendor/openpam/dist/doc/man/pam_sm_acct_mgmt.3 vendor/openpam/dist/doc/man/pam_sm_authenticate.3 vendor/openpam/dist/doc/man/pam_sm_chauthtok.3 vendor/openpam/dist/doc/man/pam_sm_close_session.3 vendor/openpam/dist/doc/man/pam_sm_open_session.3 vendor/openpam/dist/doc/man/pam_sm_setcred.3 vendor/openpam/dist/doc/man/pam_start.3 vendor/openpam/dist/doc/man/pam_strerror.3 vendor/openpam/dist/doc/man/pam_verror.3 vendor/openpam/dist/doc/man/pam_vinfo.3 vendor/openpam/dist/doc/man/pam_vprompt.3 vendor/openpam/dist/include/security/openpam.h vendor/openpam/dist/include/security/openpam_version.h vendor/openpam/dist/lib/Makefile.am vendor/openpam/dist/lib/Makefile.in vendor/openpam/dist/lib/openpam_check_owner_perms.c vendor/openpam/dist/lib/openpam_configure.c vendor/openpam/dist/lib/openpam_constants.h vendor/openpam/dist/lib/openpam_debug.h vendor/openpam/dist/lib/openpam_dynamic.c vendor/openpam/dist/lib/openpam_get_option.c vendor/openpam/dist/lib/openpam_impl.h vendor/openpam/dist/lib/openpam_load.c vendor/openpam/dist/lib/openpam_log.c vendor/openpam/dist/lib/openpam_readline.c vendor/openpam/dist/lib/openpam_set_option.c vendor/openpam/dist/lib/openpam_strlcmp.h vendor/openpam/dist/lib/openpam_strlcpy.h vendor/openpam/dist/lib/openpam_subst.c vendor/openpam/dist/lib/openpam_ttyconv.c vendor/openpam/dist/lib/pam_get_authtok.c vendor/openpam/dist/lib/pam_putenv.c vendor/openpam/dist/lib/pam_setenv.c vendor/openpam/dist/ltmain.sh vendor/openpam/dist/misc/gendoc.pl Modified: vendor/openpam/dist/CREDITS ============================================================================== --- vendor/openpam/dist/CREDITS Sat May 26 13:42:55 2012 (r236098) +++ vendor/openpam/dist/CREDITS Sat May 26 14:23:18 2012 (r236099) @@ -16,16 +16,21 @@ ideas: Brian Fundakowski Feldman Christos Zoulas Daniel Richard G. - Darren J. Moffat + Darren J. Moffat Dmitry V. Levin + Don Lewis Emmanuel Dreyfus Eric Melville - Gary Winiger + Gary Winiger + Gleb Smirnoff Hubert Feyrer + Jason Evans Joe Marcus Clarke Juli Mallett Jörg Sonnenberger + Maëlle Lesage Mark Murray + Matthias Drochner Mike Petullo Mikhail Teterin Mikko Työläjärvi @@ -38,4 +43,4 @@ ideas: Wojciech A. Koszek Yar Tikhiy -$Id: CREDITS 498 2011-11-21 16:27:04Z des $ +$Id: CREDITS 587 2012-04-08 11:12:10Z des $ Modified: vendor/openpam/dist/HISTORY ============================================================================== --- vendor/openpam/dist/HISTORY Sat May 26 13:42:55 2012 (r236098) +++ vendor/openpam/dist/HISTORY Sat May 26 14:23:18 2012 (r236099) @@ -1,3 +1,51 @@ +OpenPAM Micrampelis 2012-05-26 + + - FEATURE: Add an openpam_readword(3) function which reads the next + word from an input stream, applying shell quoting and escaping + rules. Add numerous unit tests for openpam_readword(3). + + - FEATURE: Add an openpam_readlinev(3) function which uses the + openpam_readword(3) function to read words from an input stream one + at a time until it reaches an unquoted, unescaped newline, and + returns an array of those words. Add several unit tests for + openpam_readlinev(3). + + - FEATURE: Add a PAM_HOST item which pam_start(3) initializes to the + machine's hostname. This was implemented in Lycopsida but + inadvertantly left out of the release notes. + + - FEATURE: In pam_get_authtok(3), if neither the application nor the + module have specified a prompt and PAM_HOST and PAM_RHOST are both + defined but not equal, use a different default prompt that includes + PAM_USER and PAM_HOST. + + - ENHANCE: Rewrite the policy parser to used openpam_readlinev(), + which greatly simplifies the code. + + - ENHANCE: The previous implementation of the policy parser relied on + the openpam_readline(3) function, which (by design) munges + whitespace and understands neither quotes nor backslash escapes. + As a result of the aforementioned rewrite, whitespace, quotes and + backslash escapes in policy files are now handled in a consistent + and predictable manner. + + - ENHANCE: On platforms that have it, use fdlopen(3) to load modules. + This closes the race between the ownership / permission check and + the dlopen(3) call. + + - ENHANCE: Reduce the amount of pointless error messages generated + while searching for a module. + + - ENHANCE: Numerous documentation improvements, both in content and + formatting. + + - BUGFIX: A patch incorporated in Lycopsida inadvertantly changed + OpenPAM's behavior when several policies exist for the same + service, from ignoring all but the first to concatenating them all. + Revert to the original behavior. + + - BUGFIX: Plug a memory leak in the policy parser. +============================================================================ OpenPAM Lycopsida 2011-12-18 - ENHANCE: removed static build autodetection, which didn't work @@ -269,7 +317,7 @@ OpenPAM Cinchona 2002-04-08 - ENHANCE: Add openpam_free_data(), a generic cleanup function for pam_set_data() consumers. ============================================================================ -OpenPAM Centaury 2002-03-14 +OpenPAM Centaury 2002-03-14 - BUGFIX: Add missing #include to openpam_log.c. @@ -308,7 +356,7 @@ OpenPAM Celandine 2002-03-05 module with the same version number as the library itself to one with no version number at all. ============================================================================ -OpenPAM Cantaloupe 2002-02-22 +OpenPAM Cantaloupe 2002-02-22 - BUGFIX: The proper use of PAM_SYMBOL_ERR is to indicate an invalid argument to pam_[gs]et_item(3), not to indicate dlsym(3) failures. @@ -338,7 +386,7 @@ OpenPAM Cantaloupe 2002-02-22 - ENHANCE: openpam_get_authtok() now respects the echo_pass, try_first_pass, and use_first_pass options. ============================================================================ -OpenPAM Caliopsis 2002-02-13 +OpenPAM Caliopsis 2002-02-13 Fixed a number of bugs in the previous release, including: - a number of bugs in and related to pam_[gs]et_item(3) @@ -349,8 +397,8 @@ Fixed a number of bugs in the previous r - missing 'continue' in openpam_dispatch.c caused successes to be counted as failures ============================================================================ -OpenPAM Calamite 2002-02-09 +OpenPAM Calamite 2002-02-09 First (beta) release. ============================================================================ -$Id: HISTORY 504 2011-12-18 14:11:12Z des $ +$Id: HISTORY 609 2012-05-26 13:57:45Z des $ Modified: vendor/openpam/dist/LICENSE ============================================================================== --- vendor/openpam/dist/LICENSE Sat May 26 13:42:55 2012 (r236098) +++ vendor/openpam/dist/LICENSE Sat May 26 14:23:18 2012 (r236099) @@ -1,6 +1,6 @@ Copyright (c) 2002-2003 Networks Associates Technology, Inc. -Copyright (c) 2004-2011 Dag-Erling Smørgrav +Copyright (c) 2004-2012 Dag-Erling Smørgrav All rights reserved. This software was developed for the FreeBSD Project by ThinkSec AS and @@ -32,4 +32,4 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -$Id: LICENSE 437 2011-09-13 12:00:13Z des $ +$Id: LICENSE 546 2012-03-31 23:13:20Z des $ Modified: vendor/openpam/dist/Makefile.am ============================================================================== --- vendor/openpam/dist/Makefile.am Sat May 26 13:42:55 2012 (r236098) +++ vendor/openpam/dist/Makefile.am Sat May 26 14:23:18 2012 (r236099) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 428 2010-03-09 17:32:17Z des $ +# $Id: Makefile.am 549 2012-04-01 20:38:30Z des $ ACLOCAL_AMFLAGS = -I m4 @@ -8,6 +8,8 @@ if WITH_DOC SUBDIRS += doc endif +SUBDIRS += t + EXTRA_DIST = \ CREDITS \ HISTORY \ Modified: vendor/openpam/dist/Makefile.in ============================================================================== --- vendor/openpam/dist/Makefile.in Sat May 26 13:42:55 2012 (r236098) +++ vendor/openpam/dist/Makefile.in Sat May 26 14:23:18 2012 (r236099) @@ -15,7 +15,7 @@ @SET_MAKE@ -# $Id: Makefile.am 428 2010-03-09 17:32:17Z des $ +# $Id: Makefile.am 549 2012-04-01 20:38:30Z des $ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -39,8 +39,8 @@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure INSTALL config.guess config.sub \ - depcomp install-sh ltmain.sh missing + $(srcdir)/pamgdb.in $(top_srcdir)/configure INSTALL TODO \ + config.guess config.sub depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -49,7 +49,7 @@ am__CONFIG_DISTCLEAN_FILES = config.stat configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = pamgdb CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = @@ -67,7 +67,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGE distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = lib bin modules include doc +DIST_SUBDIRS = lib bin modules include doc t DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -222,7 +222,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = lib bin modules include $(am__append_1) +SUBDIRS = lib bin modules include $(am__append_1) t EXTRA_DIST = \ CREDITS \ HISTORY \ @@ -288,6 +288,8 @@ $(srcdir)/config.h.in: $(am__configure_ distclean-hdr: -rm -f config.h stamp-h1 +pamgdb: $(top_builddir)/config.status $(srcdir)/pamgdb.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo Modified: vendor/openpam/dist/RELNOTES ============================================================================== --- vendor/openpam/dist/RELNOTES Sat May 26 13:42:55 2012 (r236098) +++ vendor/openpam/dist/RELNOTES Sat May 26 14:23:18 2012 (r236099) @@ -1,6 +1,6 @@ - Release notes for OpenPAM Lycopsida - =================================== + Release notes for OpenPAM Micrampelis + ===================================== This release corresponds to the code used in FreeBSD HEAD as of the release date, and is also expected to work on almost any POSIX-like @@ -19,6 +19,9 @@ intended for actual use, but rather to s application developers. It also includes a command-line application (pamtest) which can be used to test policies and modules. +Unit tests for limited portions of the library can be found in the t +subdirectory. + Please direct bug reports and inquiries to . -$Id: RELNOTES 506 2011-12-18 14:25:12Z des $ +$Id: RELNOTES 609 2012-05-26 13:57:45Z des $ Added: vendor/openpam/dist/TODO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openpam/dist/TODO Sat May 26 14:23:18 2012 (r236099) @@ -0,0 +1,13 @@ +Before the next release: + + - Complete the transition from PAM_LOG_DEBUG to PAM_LOG_LIBDEBUG. + +Whenever: + + - Implement mechanism to enable / disable optional features. Use it + to disable strict error checking so pamtest and unit tests can do + things that we don't allow in production. + + - Rewrite the module-loading code. + +$Id: TODO 592 2012-04-08 13:19:51Z des $ Modified: vendor/openpam/dist/aclocal.m4 ============================================================================== --- vendor/openpam/dist/aclocal.m4 Sat May 26 13:42:55 2012 (r236098) +++ vendor/openpam/dist/aclocal.m4 Sat May 26 14:23:18 2012 (r236099) @@ -22,8 +22,8 @@ To do so, use the procedure documented b # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -32,8 +32,8 @@ To do so, use the procedure documented b m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -167,6 +167,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -652,7 +654,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -816,6 +818,7 @@ AC_DEFUN([LT_LANG], m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -837,6 +840,29 @@ m4_defun([_LT_LANG], ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -867,6 +893,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ], m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -969,7 +999,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECK $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -977,6 +1013,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECK rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -988,6 +1025,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECK [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF @@ -1005,7 +1043,9 @@ _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1050,8 +1090,8 @@ _LT_EOF ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -1062,6 +1102,8 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi @@ -1345,14 +1387,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1429,13 +1484,13 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -1615,6 +1670,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [d lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1654,7 +1714,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [d # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do @@ -2200,7 +2260,7 @@ need_version=unknown case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2209,7 +2269,7 @@ aix3*) ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2274,7 +2334,7 @@ beos*) ;; bsdi[[45]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -2413,7 +2473,7 @@ m4_if([$1], [],[ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2466,17 +2526,18 @@ freebsd* | dragonfly*) ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -2537,7 +2598,7 @@ hpux9* | hpux10* | hpux11*) ;; interix[[3-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2553,7 +2614,7 @@ irix5* | irix6* | nonstopux*) nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2590,9 +2651,9 @@ linux*oldld* | linux*aout* | linux*coff* dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2655,7 +2716,7 @@ netbsd*) ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2724,7 +2785,7 @@ rdos*) ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2749,7 +2810,7 @@ sunos4*) ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2773,7 +2834,7 @@ sysv4 | sysv4.3*) sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -2804,7 +2865,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2814,7 +2875,7 @@ tpf*) ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -3236,7 +3297,7 @@ irix5* | irix6* | nonstopux*) lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3656,6 +3717,7 @@ for ac_symprfx in "" "_"; do # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -4240,7 +4302,9 @@ m4_if([$1], [CXX], [ case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi ;; esac else @@ -4332,18 +4396,33 @@ m4_if([$1], [CXX], [ ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; esac ;; esac @@ -4503,7 +4582,9 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) ;; + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] @@ -4528,7 +4609,6 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4779,8 +4859,7 @@ _LT_EOF xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ @@ -5075,6 +5154,7 @@ _LT_EOF # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' @@ -5172,7 +5252,6 @@ _LT_EOF fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -5614,9 +5693,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1] _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5770,7 +5846,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -6901,12 +6976,18 @@ public class foo { } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary @@ -7103,7 +7184,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7236,7 +7316,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7419,6 +7498,73 @@ CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -7488,6 +7634,13 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], @@ -8152,9 +8305,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) @@ -8326,15 +8494,15 @@ m4_define([lt_dict_filter], # @configure_input@ -# serial 3293 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) Modified: vendor/openpam/dist/bin/Makefile.am ============================================================================== --- vendor/openpam/dist/bin/Makefile.am Sat May 26 13:42:55 2012 (r236098) +++ vendor/openpam/dist/bin/Makefile.am Sat May 26 14:23:18 2012 (r236099) @@ -1,6 +1,6 @@ -# $Id: Makefile.am 467 2011-11-02 23:42:21Z des $ +# $Id: Makefile.am 538 2012-03-31 17:04:29Z des $ -SUBDIRS = +SUBDIRS = openpam_dump_policy if WITH_PAMTEST SUBDIRS += pamtest Modified: vendor/openpam/dist/bin/Makefile.in ============================================================================== --- vendor/openpam/dist/bin/Makefile.in Sat May 26 13:42:55 2012 (r236098) +++ vendor/openpam/dist/bin/Makefile.in Sat May 26 14:23:18 2012 (r236099) @@ -15,7 +15,7 @@ @SET_MAKE@ -# $Id: Makefile.am 467 2011-11-02 23:42:21Z des $ +# $Id: Makefile.am 538 2012-03-31 17:04:29Z des $ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -63,7 +63,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGE distdir ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = pamtest su +DIST_SUBDIRS = openpam_dump_policy pamtest su DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -207,7 +207,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = $(am__append_1) $(am__append_2) +SUBDIRS = openpam_dump_policy $(am__append_1) $(am__append_2) all: all-recursive .SUFFIXES: Added: vendor/openpam/dist/bin/openpam_dump_policy/Makefile.am ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openpam/dist/bin/openpam_dump_policy/Makefile.am Sat May 26 14:23:18 2012 (r236099) @@ -0,0 +1,7 @@ +# $Id: Makefile.am 538 2012-03-31 17:04:29Z des $ + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib + +noinst_PROGRAMS = openpam_dump_policy +openpam_dump_policy_SOURCES = openpam_dump_policy.c +openpam_dump_policy_LDADD = $(top_builddir)/lib/libpam.la Added: vendor/openpam/dist/bin/openpam_dump_policy/Makefile.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openpam/dist/bin/openpam_dump_policy/Makefile.in Sat May 26 14:23:18 2012 (r236099) @@ -0,0 +1,474 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# $Id: Makefile.am 538 2012-03-31 17:04:29Z des $ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat May 26 14:24:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A444C1065670; Sat, 26 May 2012 14:24:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 765298FC0A; Sat, 26 May 2012 14:24: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 q4QEOEEW082274; Sat, 26 May 2012 14:24:14 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QEOE8j082273; Sat, 26 May 2012 14:24:14 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261424.q4QEOE8j082273@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 14:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236100 - vendor/openpam/MICRAMPELIS X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 14:24:14 -0000 Author: des Date: Sat May 26 14:24:14 2012 New Revision: 236100 URL: http://svn.freebsd.org/changeset/base/236100 Log: Tag OpenPAM Micrampelis. Added: vendor/openpam/MICRAMPELIS/ - copied from r236099, vendor/openpam/dist/ From owner-svn-src-all@FreeBSD.ORG Sat May 26 14:44:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8144E106566B; Sat, 26 May 2012 14:44:19 +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 6BDB18FC08; Sat, 26 May 2012 14:44:19 +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 q4QEiJYB083221; Sat, 26 May 2012 14:44:19 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QEiJoi083219; Sat, 26 May 2012 14:44:19 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201205261444.q4QEiJoi083219@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 26 May 2012 14:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236101 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 14:44:19 -0000 Author: gavin Date: Sat May 26 14:44:18 2012 New Revision: 236101 URL: http://svn.freebsd.org/changeset/base/236101 Log: Updates to reflect recent commit bits handed back, etc. MFC after: 1 week Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sat May 26 14:24:14 2012 (r236100) +++ head/share/misc/committers-src.dot Sat May 26 14:44:18 2012 (r236101) @@ -39,6 +39,7 @@ billf [label="Bill Fumerola\nbillf@FreeB bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2002/01/29\n2009/09/13"] bmilekic [label="Bosko Milekic\nbmilekic@FreeBSD.org\n2000/09/21\n2008/11/10"] bushman [label="Michael Bushkov\nbushman@FreeBSD.org\n2007/03/10\n2010/04/29"] +ceri [label="Ceri Davies\nceri@FreeBSD.org\n2006/11/07\n2012/03/07"] cjc [label="Crist J. Clark\ncjc@FreeBSD.org\n2001/06/01\n2006/12/29"] dds [label="Diomidis Spinellis\ndds@FreeBSD.org\n2003/06/20\n2010/09/22"] dhartmei [label="Daniel Hartmeier\ndhartmei@FreeBSD.org\n2004/04/06\n2008/12/08"] @@ -58,20 +59,21 @@ jtc [label="J.T. Conklin\njtc@FreeBSD.or kbyanc [label="Kelly Yancey\nkbyanc@FreeBSD.org\n2000/07/11\n2006/07/25"] keichii [label="Michael Wu\nkeichii@FreeBSD.org\n2001/03/07\n2006/04/28"] linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2006/09/30\n2008/05/04"] +lulf [label="Ulf Lilleengen\nlulf@FreeBSD.org\n2007/10/24\n2012/01/19"] mb [label="Maxim Bolotin\nmb@FreeBSD.org\n2000/04/06\n2003/03/08"] marks [label="Mark Santcroos\nmarks@FreeBSD.org\n2004/03/18\n2008/09/29"] mike [label="Mike Barcroft\nmike@FreeBSD.org\n2001/07/17\n2006/04/28"] msmith [label="Mike Smith\nmsmith@FreeBSD.org\n????/??/??\n2003/12/15"] murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05\n2010/07/25"] +mux [label="Maxime Henrion\nmux@FreeBSD.org\n2002/03/03\n2011/06/22"] nate [label="Nate Willams\nnate@FreeBSD.org\n1993/06/12\n2003/12/15"] njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07\n2008/02/16"] non [label="Noriaki Mitsnaga\nnon@FreeBSD.org\n2000/06/19\n2007/03/06"] onoe [label="Atsushi Onoe\nonoe@FreeBSD.org\n2000/07/21\n2008/11/10"] +randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20\n2012/05/10"] rgrimes [label="Rod Grimes\nrgrimes@FreeBSD.org\n1993/06/12\n2003/03/08"] rink [label="Rink Springer\nrink@FreeBSD.org\n2006/01/16\n2010/11/04"] robert [label="Robert Drehmel\nrobert@FreeBSD.org\n2001/08/23\n2006/05/13"] -rmh [label="Robert Millan\nrmh@FreeBSD.org\n2011/09/18"] -rpaulo [label="Rui Paulo\nrpaulo@FreeBSD.org\n2007/09/25\n2010/12/03"] sah [label="Sam Hopkins\nsah@FreeBSD.org\n2004/12/15\n2008/11/10"] shafeeq [label="Shafeeq Sinnamohideen\nshafeeq@FreeBSD.org\n2000/06/19\n2006/04/06"] sheldonh [label="Sheldon Hearn\nsheldonh@FreeBSD.org\n1999/06/14\n2006/05/13"] @@ -82,6 +84,7 @@ tmm [label="Thomas Moestl\ntmm@FreeBSD.o toshi [label="Toshihiko Arai\ntoshi@FreeBSD.org\n2000/07/06\n2003/03/08"] tshiozak [label="Takuya SHIOZAKI\ntshiozak@FreeBSD.org\n2001/04/25\n2003/03/08"] uch [label="UCHIYAMA Yasushi\nuch@FreeBSD.org\n2000/06/21\n2002/04/24"] +yar [label="Yar Tikhiy\nyar@FreeBSD.org\n2001/03/25\n2012/05/23"] node [color=lightblue2, style=filled, bgcolor=black]; @@ -112,7 +115,6 @@ brueffer [label="Christian Brueffer\nbru bruno [label="Bruno Ducrot\nbruno@FreeBSD.org\n2005/07/18"] bschmidt [label="Bernhard Schmidt\nbschmidt@FreeBSD.org\n2010/02/06"] bz [label="Bjoern A. Zeeb\nbz@FreeBSD.org\n2004/07/27"] -ceri [label="Ceri Davies\nceri@FreeBSD.org\n2006/11/07"] cognet [label="Olivier Houchard\ncognet@FreeBSD.org\n2002/10/09"] cokane [label="Coleman Kane\ncokane@FreeBSD.org\n2000/06/19"] cperciva [label="Colin Percival\ncperciva@FreeBSD.org\n2004/01/20"] @@ -187,7 +189,6 @@ kib [label="Konstantin Belousov\nkib@Fre kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"] le [label="Lukas Ertl\nle@FreeBSD.org\n2004/02/02"] lstewart [label="Lawrence Stewart\nlstewart@FreeBSD.org\n2008/10/06"] -lulf [label="Ulf Lilleengen\nlulf@FreeBSD.org\n2007/10/24"] marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] marius [label="Marius Strobl\nmarius@FreeBSD.org\n2004/04/17"] markm [label="Mark Murray\nmarkm@FreeBSD.org\n199?/??/??"] @@ -202,7 +203,6 @@ mjacob [label="Matt Jacob\nmjacob@FreeBS mlaier [label="Max Laier\nmlaier@FreeBSD.org\n2004/02/10"] monthadar [label="Monthadar Al Jaberi\nmonthadar@FreeBSD.org\n2012/04/02"] mr [label="Michael Reifenberger\nmr@FreeBSD.org\n2001/09/30"] -mux [label="Maxime Henrion\nmux@FreeBSD.org\n2002/03/03"] neel [label="Neel Natu\nneel@FreeBSD.org\n2009/09/20"] netchild [label="Alexander Leidinger\nnetchild@FreeBSD.org\n2005/03/31"] nork [label="Norikatsu Shigemura\nnork@FreeBSD.org\n2009/06/09"] @@ -213,7 +213,7 @@ olli [label="Oliver Fromme\nolli@FreeBSD peadar [label="Peter Edwards\npeadar@FreeBSD.org\n2004/03/08"] peter [label="Peter Wemm\npeter@FreeBSD.org\n????/??/??"] pfg [label="Pedro Giffuni\npfg@FreeBSD.org\n2011/12/01"] -philip [label="Philip Paeps\nphilip@FreBSD.org\n2004/01/21"] +philip [label="Philip Paeps\nphilip@FreeBSD.org\n2004/01/21"] phk [label="Poul-Henning Kamp\nphk@FreeBSD.org\n1994/02/21"] pho [label="Peter Holm\npho@FreeBSD.org\n2008/11/16"] pjd [label="Pawel Jakub Dawidek\npjd@FreeBSD.org\n2004/02/02"] @@ -221,14 +221,15 @@ pluknet [label="Sergey Kandaurov\nplukne ps [label="Paul Saab\nps@FreeBSD.org\n2000/02/23"] qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2007/01/31"] -randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20"] ray [label="Aleksandr Rybalko\nray@FreeBSD.org\n2011/05/25"] rdivacky [label="Roman Divacky\nrdivacky@FreeBSD.org\n2008/03/13"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2007/02/23"] rik [label="Roman Kurakin\nrik@FreeBSD.org\n2003/12/18"] rmacklem [label="Rick Macklem\nrmacklem@FreeBSD.org\n2009/03/27"] +rmh [label="Robert Millan\nrmh@FreeBSD.org\n2011/09/18"] rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/09/15"] roberto [label="Ollivier Robert\nroberto@FreeBSD.org\n1995/02/22"] +rpaulo [label="Rui Paulo\nrpaulo@FreeBSD.org\n2007/09/25"] rrs [label="Randall R Stewart\nrrs@FreeBSD.org\n2007/02/08"] rse [label="Ralf S. Engelschall\nrse@FreeBSD.org\n1997/07/31"] rstone [label="Ryan Stone\nrstone@FreeBSD.org\n2010/04/19"] @@ -266,7 +267,6 @@ wes [label="Wes Peters\nwes@FreeBSD.org\ wilko [label="Wilko Bulte\nwilko@FreeBSD.org\n2000/01/13"] wollman [label="Garrett Wollman\nwollman@FreeBSD.org\n????/??/??"] wsalamon [label="Wayne Salamon\nwsalamon@FreeBSD.org\n2005/06/25"] -yar [label="Yar Tikhiy\nyar@FreeBSD.org\n2001/03/25"] yongari [label="Pyun YongHyeon\nyongari@FreeBSD.org\n2004/08/01"] zack [label="Zack Kirsch\nzack@FreeBSD.org\n2010/11/05"] zec [label="Marko Zec\nzec@FreeBSD.org\n2008/06/22"] From owner-svn-src-all@FreeBSD.ORG Sat May 26 16:26:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9D26106566B; Sat, 26 May 2012 16:26:23 +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 8B1EC8FC0C; Sat, 26 May 2012 16:26:23 +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 q4QGQN3F088173; Sat, 26 May 2012 16:26:23 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QGQN7N088171; Sat, 26 May 2012 16:26:23 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201205261626.q4QGQN7N088171@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 26 May 2012 16:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236102 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 16:26:23 -0000 Author: gavin Date: Sat May 26 16:26:23 2012 New Revision: 236102 URL: http://svn.freebsd.org/changeset/base/236102 Log: Update to reflect various doc commit bits taken into safekeeping. MFC after: 1 week Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Sat May 26 14:44:18 2012 (r236101) +++ head/share/misc/committers-doc.dot Sat May 26 16:26:23 2012 (r236102) @@ -32,15 +32,19 @@ node [color=grey62, style=filled, bgcolo ache [label="Andrey Chernov\nache@FreeBSD.org\n1997/06/13\n2010/12/11"] bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2000/08/22\n2009/09/13"] bvs [label="Vitaly Bogdanov\nbvs@FreeBSD.org\n2005/10/03\n2010/12/11"] +ceri [label="Ceri Davies\nceri@FreeBSD.org\n2002/03/17\n2012/02/29"] den [label="Denis Peplin\nden@FreeBSD.org\n2003/09/13\n2009/07/09"] garys [label="Gary W. Swearingen\ngarys@FreeBSD.org\n2005/08/21\n2008/03/02"] jcamou [label="Jesus R. Camou\njcamou@FreeBSD.org\n2005/03/02\n2008/12/20"] jesusr [label="Jesus Rodriguez Cuesta\njesusr@FreeBSD.org\n1998/12/10\n2010/12/11"] jim [label="Jim Mock\njim@FreeBSD.org\n1999/08/11\n2003/12/15"] josef [label="Josef El-Rayes\njosef@FreeBSD.org\n2004/01/15\n2008/03/29"] +marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03\n2012/04/25"] mheinen [label="Martin Heinen\nmheinen@FreeBSD.org\n2002/10/04\n2006/04/26"] +murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05\n2012/04/25"] nik [label="Nik Clayton\nnik@FreeBSD.org\n1998/02/26\n2008/12/20"] pgj [label="Gabor Pali\npgj@FreeBSD.org\n2008/04/21\n2010/12/01"] +roam [label="Peter Pentchev\nroam@FreeBSD.org\n2003/02/14\n2012/02/29"] node [color=lightblue2, style=filled, bgcolor=black]; @@ -51,7 +55,6 @@ bcr [label="Benedict Reuschling\nbcr@Fre blackend [label="Marc Fonvieille\nblackend@FreeBSD.org\n2002/06/16"] brd [label="Brad Davis\nbrd@FreeBSD.org\n2005/06/01"] brueffer [label="Christian Brueffer\nbrueffer@FreeBSD.org\n2003/01/13"] -ceri [label="Ceri Davies\nceri@FreeBSD.org\n2002/03/17"] chinsan [label="Chinsan Huang\nchinsan@FreeBSD.org\n2006/09/20"] danger [label="Daniel Gerzo\ndanger@FreeBSD.org\n2006/08/20"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] @@ -67,16 +70,13 @@ keramida [label="Giorgos Keramidas\nkera linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2004/03/31"] loader [label="Fukang Chen\nloader@FreeBSD.org\n2007/07/30"] manolis [label="Manolis Kiagias\nmanolis@FreeBSD.org\n2008/05/24"] -marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] marck [label="Dmitry Morozovsky\nmarck@FreeBSD.org\n2004/08/10"] maxim [label="Maxim Konovalov\nmaxim@FreeBSD.org\n2002/02/07"] miwi [label="Martin Wilke\nmiwi@FreeBSD.org\n2007/10/26"] -murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05"] pav [label="Pav Lucistnik\npav@FreeBSD.org\n2005/08/12"] pluknet [label="Sergey Kandaurov\npluknet@FreeBSD.org\n2012/02/14"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2004/10/16"] rene [label="Rene Ladan\nrene@FreeBSD.org\n2008/11/03"] -roam [label="Peter Pentchev\nroam@FreeBSD.org\n2003/02/14"] ryusuke [label="Ryusuke Suzuki\nryusuke@FreeBSD.org\n2009/12/21"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2003/07/20"] taras [label="Taras Korenko\ntaras@FreeBSD.org\n2010/06/25"] From owner-svn-src-all@FreeBSD.ORG Sat May 26 16:34:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B26431065670; Sat, 26 May 2012 16:34:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D74E8FC19; Sat, 26 May 2012 16:34:39 +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 q4QGYdbo088610; Sat, 26 May 2012 16:34:39 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QGYdAo088601; Sat, 26 May 2012 16:34:39 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261634.q4QGYdAo088601@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 16:34:39 +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: r236103 - stable/9/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 16:34:39 -0000 Author: des Date: Sat May 26 16:34:39 2012 New Revision: 236103 URL: http://svn.freebsd.org/changeset/base/236103 Log: MFH r225813,r225814,r226537: cosmetic Modified: stable/9/lib/libfetch/common.c stable/9/lib/libfetch/common.h stable/9/lib/libfetch/fetch.3 stable/9/lib/libfetch/fetch.c stable/9/lib/libfetch/fetch.h stable/9/lib/libfetch/file.c stable/9/lib/libfetch/ftp.c stable/9/lib/libfetch/http.c Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/common.c ============================================================================== --- stable/9/lib/libfetch/common.c Sat May 26 16:26:23 2012 (r236102) +++ stable/9/lib/libfetch/common.c Sat May 26 16:34:39 2012 (r236103) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/9/lib/libfetch/common.h ============================================================================== --- stable/9/lib/libfetch/common.h Sat May 26 16:26:23 2012 (r236102) +++ stable/9/lib/libfetch/common.h Sat May 26 16:34:39 2012 (r236103) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/9/lib/libfetch/fetch.3 ============================================================================== --- stable/9/lib/libfetch/fetch.3 Sat May 26 16:26:23 2012 (r236102) +++ stable/9/lib/libfetch/fetch.3 Sat May 26 16:34:39 2012 (r236103) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav +.\" Copyright (c) 1998-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd September 27, 2011 .Dt FETCH 3 .Os .Sh NAME Modified: stable/9/lib/libfetch/fetch.c ============================================================================== --- stable/9/lib/libfetch/fetch.c Sat May 26 16:26:23 2012 (r236102) +++ stable/9/lib/libfetch/fetch.c Sat May 26 16:34:39 2012 (r236103) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2004 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/9/lib/libfetch/fetch.h ============================================================================== --- stable/9/lib/libfetch/fetch.h Sat May 26 16:26:23 2012 (r236102) +++ stable/9/lib/libfetch/fetch.h Sat May 26 16:34:39 2012 (r236103) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2004 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/9/lib/libfetch/file.c ============================================================================== --- stable/9/lib/libfetch/file.c Sat May 26 16:26:23 2012 (r236102) +++ stable/9/lib/libfetch/file.c Sat May 26 16:34:39 2012 (r236103) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/9/lib/libfetch/ftp.c ============================================================================== --- stable/9/lib/libfetch/ftp.c Sat May 26 16:26:23 2012 (r236102) +++ stable/9/lib/libfetch/ftp.c Sat May 26 16:34:39 2012 (r236103) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); * * Major Changelog: * - * Dag-Erling Coïdan Smørgrav + * Dag-Erling Smørgrav * 9 Jun 1998 * * Incorporated into libfetch Modified: stable/9/lib/libfetch/http.c ============================================================================== --- stable/9/lib/libfetch/http.c Sat May 26 16:26:23 2012 (r236102) +++ stable/9/lib/libfetch/http.c Sat May 26 16:34:39 2012 (r236103) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2000-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Sat May 26 16:37:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96CAA1065676; Sat, 26 May 2012 16:37:43 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8244D8FC17; Sat, 26 May 2012 16:37: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 q4QGbhPt088790; Sat, 26 May 2012 16:37:43 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QGbhCV088788; Sat, 26 May 2012 16:37:43 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261637.q4QGbhCV088788@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 16:37: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: r236104 - stable/9/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 16:37:43 -0000 Author: des Date: Sat May 26 16:37:43 2012 New Revision: 236104 URL: http://svn.freebsd.org/changeset/base/236104 Log: MFH r230478: fix nits in already-merged r230307. Modified: stable/9/lib/libfetch/common.c Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/common.c ============================================================================== --- stable/9/lib/libfetch/common.c Sat May 26 16:34:39 2012 (r236103) +++ stable/9/lib/libfetch/common.c Sat May 26 16:37:43 2012 (r236104) @@ -416,7 +416,6 @@ fetch_cache_data(conn_t *conn, char *src if (conn->cache.size < nbytes) { tmp = realloc(conn->cache.buf, nbytes); if (tmp == NULL) { - errno = ENOMEM; fetch_syserr(); return (-1); } @@ -481,7 +480,7 @@ fetch_read(conn_t *conn, char *buf, size conn->cache.len -= total; conn->cache.pos += total; len -= total; - buf+= total; + buf += total; } while (len > 0) { From owner-svn-src-all@FreeBSD.ORG Sat May 26 16:42:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 73529106566B; Sat, 26 May 2012 16:42:48 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ED518FC12; Sat, 26 May 2012 16:42:48 +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 q4QGgmeo089031; Sat, 26 May 2012 16:42:48 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QGgmcJ089029; Sat, 26 May 2012 16:42:48 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261642.q4QGgmcJ089029@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 16:42:48 +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: r236105 - stable/9/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 16:42:48 -0000 Author: des Date: Sat May 26 16:42:47 2012 New Revision: 236105 URL: http://svn.freebsd.org/changeset/base/236105 Log: MFH r233648: cosmetic Modified: stable/9/lib/libfetch/fetch.3 Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/fetch.3 ============================================================================== --- stable/9/lib/libfetch/fetch.3 Sat May 26 16:37:43 2012 (r236104) +++ stable/9/lib/libfetch/fetch.3 Sat May 26 16:42:47 2012 (r236105) @@ -375,7 +375,7 @@ If the (if-modified-since) flag is specified, and the .Va ims_time -field is set in +field is set in .Vt "struct url" , then .Fn fetchXGetHTTP From owner-svn-src-all@FreeBSD.ORG Sat May 26 17:03:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEB33106566B; Sat, 26 May 2012 17:03:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9F538FC16; Sat, 26 May 2012 17:03: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 q4QH3jwS092417; Sat, 26 May 2012 17:03:45 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QH3j6J092415; Sat, 26 May 2012 17:03:45 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261703.q4QH3j6J092415@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236106 - head/lib/libpam/modules/pam_ssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:03:46 -0000 Author: des Date: Sat May 26 17:03:45 2012 New Revision: 236106 URL: http://svn.freebsd.org/changeset/base/236106 Log: Passing NULL as a key casues a segfault when loading SSH 1 keys. Use an empty string instead. Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c ============================================================================== --- head/lib/libpam/modules/pam_ssh/pam_ssh.c Sat May 26 16:42:47 2012 (r236105) +++ head/lib/libpam/modules/pam_ssh/pam_ssh.c Sat May 26 17:03:45 2012 (r236106) @@ -112,7 +112,7 @@ pam_ssh_load_key(const char *dir, const * with an empty passphrase, and if the key is not encrypted, * accept only an empty passphrase. */ - key = key_load_private(fn, NULL, &comment); + key = key_load_private(fn, "", &comment); if (key != NULL && !(*passphrase == '\0' && nullok)) { key_free(key); return (NULL); From owner-svn-src-all@FreeBSD.ORG Sat May 26 17:08:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAEE31065670; Sat, 26 May 2012 17:08:01 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D0128FC12; Sat, 26 May 2012 17:08:01 +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 q4QH81mo093825; Sat, 26 May 2012 17:08:01 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QH818j093822; Sat, 26 May 2012 17:08:01 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261708.q4QH818j093822@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:08:01 +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: r236108 - stable/9/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:08:01 -0000 Author: des Date: Sat May 26 17:08:01 2012 New Revision: 236108 URL: http://svn.freebsd.org/changeset/base/236108 Log: MFH r234837: avoid busy-loop on slow connections when no timeout is set. MFH r234838: don't reuse credentials when redirected to a different host. Modified: stable/9/lib/libfetch/common.c stable/9/lib/libfetch/http.c Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/common.c ============================================================================== --- stable/9/lib/libfetch/common.c Sat May 26 17:07:34 2012 (r236107) +++ stable/9/lib/libfetch/common.c Sat May 26 17:08:01 2012 (r236108) @@ -455,11 +455,9 @@ fetch_read(conn_t *conn, char *buf, size struct timeval now, timeout, delta; fd_set readfds; ssize_t rlen, total; - int r; char *start; - if (fetchTimeout) { - FD_ZERO(&readfds); + if (fetchTimeout > 0) { gettimeofday(&timeout, NULL); timeout.tv_sec += fetchTimeout; } @@ -523,23 +521,21 @@ fetch_read(conn_t *conn, char *buf, size return (-1); } // assert(rlen == FETCH_READ_WAIT); - while (fetchTimeout && !FD_ISSET(conn->sd, &readfds)) { + FD_ZERO(&readfds); + while (!FD_ISSET(conn->sd, &readfds)) { FD_SET(conn->sd, &readfds); - gettimeofday(&now, NULL); - delta.tv_sec = timeout.tv_sec - now.tv_sec; - delta.tv_usec = timeout.tv_usec - now.tv_usec; - if (delta.tv_usec < 0) { - delta.tv_usec += 1000000; - delta.tv_sec--; - } - if (delta.tv_sec < 0) { - errno = ETIMEDOUT; - fetch_syserr(); - return (-1); + if (fetchTimeout > 0) { + gettimeofday(&now, NULL); + if (!timercmp(&timeout, &now, >)) { + errno = ETIMEDOUT; + fetch_syserr(); + return (-1); + } + timersub(&timeout, &now, &delta); } errno = 0; - r = select(conn->sd + 1, &readfds, NULL, NULL, &delta); - if (r == -1) { + if (select(conn->sd + 1, &readfds, NULL, NULL, + fetchTimeout > 0 ? &delta : NULL) < 0) { if (errno == EINTR) { if (fetchRestartCalls) continue; Modified: stable/9/lib/libfetch/http.c ============================================================================== --- stable/9/lib/libfetch/http.c Sat May 26 17:07:34 2012 (r236107) +++ stable/9/lib/libfetch/http.c Sat May 26 17:08:01 2012 (r236108) @@ -1779,7 +1779,9 @@ http_request(struct url *URL, const char DEBUG(fprintf(stderr, "failed to parse new URL\n")); goto ouch; } - if (!*new->user && !*new->pwd) { + + /* Only copy credentials if the host matches */ + if (!strcmp(new->host, url->host) && !*new->user && !*new->pwd) { strcpy(new->user, url->user); strcpy(new->pwd, url->pwd); } From owner-svn-src-all@FreeBSD.ORG Sat May 26 17:10:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BBA71065676; Sat, 26 May 2012 17:10:17 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 837A18FC08; Sat, 26 May 2012 17:10: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 q4QHAHaK094565; Sat, 26 May 2012 17:10:17 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QHAHVj094549; Sat, 26 May 2012 17:10:17 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261710.q4QHAHVj094549@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236109 - in head: contrib/openpam contrib/openpam/bin contrib/openpam/bin/openpam_dump_policy contrib/openpam/bin/pamtest contrib/openpam/bin/su contrib/openpam/doc/man contrib/openpam... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:10:17 -0000 Author: des Date: Sat May 26 17:10:16 2012 New Revision: 236109 URL: http://svn.freebsd.org/changeset/base/236109 Log: Update to OpenPAM Micrampelis. Added: head/contrib/openpam/TODO - copied unchanged from r236101, vendor/openpam/dist/TODO head/contrib/openpam/bin/openpam_dump_policy/ - copied from r236101, vendor/openpam/dist/bin/openpam_dump_policy/ head/contrib/openpam/doc/man/openpam_get_feature.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_get_feature.3 head/contrib/openpam/doc/man/openpam_readlinev.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_readlinev.3 head/contrib/openpam/doc/man/openpam_readword.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_readword.3 head/contrib/openpam/doc/man/openpam_set_feature.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_set_feature.3 head/contrib/openpam/doc/man/openpam_straddch.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_straddch.3 head/contrib/openpam/lib/openpam_ctype.h - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_ctype.h head/contrib/openpam/lib/openpam_features.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_features.c head/contrib/openpam/lib/openpam_features.h - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_features.h head/contrib/openpam/lib/openpam_get_feature.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_get_feature.c head/contrib/openpam/lib/openpam_readlinev.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_readlinev.c head/contrib/openpam/lib/openpam_readword.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_readword.c head/contrib/openpam/lib/openpam_set_feature.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_set_feature.c head/contrib/openpam/lib/openpam_straddch.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_straddch.c head/contrib/openpam/lib/openpam_strlcat.h - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_strlcat.h head/contrib/openpam/pamgdb.in - copied unchanged from r236101, vendor/openpam/dist/pamgdb.in head/contrib/openpam/t/ - copied from r236101, vendor/openpam/dist/t/ head/usr.bin/pamtest/ head/usr.bin/pamtest/Makefile (contents, props changed) Modified: head/contrib/openpam/CREDITS head/contrib/openpam/HISTORY head/contrib/openpam/LICENSE head/contrib/openpam/Makefile.am head/contrib/openpam/Makefile.in head/contrib/openpam/RELNOTES head/contrib/openpam/aclocal.m4 head/contrib/openpam/bin/Makefile.am head/contrib/openpam/bin/Makefile.in head/contrib/openpam/bin/pamtest/pamtest.1 head/contrib/openpam/bin/pamtest/pamtest.c head/contrib/openpam/bin/su/su.1 head/contrib/openpam/config.h.in head/contrib/openpam/configure head/contrib/openpam/configure.ac head/contrib/openpam/doc/man/Makefile.am head/contrib/openpam/doc/man/Makefile.in head/contrib/openpam/doc/man/openpam.3 head/contrib/openpam/doc/man/openpam_borrow_cred.3 head/contrib/openpam/doc/man/openpam_free_data.3 head/contrib/openpam/doc/man/openpam_free_envlist.3 head/contrib/openpam/doc/man/openpam_get_option.3 head/contrib/openpam/doc/man/openpam_log.3 head/contrib/openpam/doc/man/openpam_nullconv.3 head/contrib/openpam/doc/man/openpam_readline.3 head/contrib/openpam/doc/man/openpam_restore_cred.3 head/contrib/openpam/doc/man/openpam_set_option.3 head/contrib/openpam/doc/man/openpam_subst.3 head/contrib/openpam/doc/man/openpam_ttyconv.3 head/contrib/openpam/doc/man/pam.3 head/contrib/openpam/doc/man/pam.conf.5 head/contrib/openpam/doc/man/pam_acct_mgmt.3 head/contrib/openpam/doc/man/pam_authenticate.3 head/contrib/openpam/doc/man/pam_chauthtok.3 head/contrib/openpam/doc/man/pam_close_session.3 head/contrib/openpam/doc/man/pam_conv.3 head/contrib/openpam/doc/man/pam_end.3 head/contrib/openpam/doc/man/pam_error.3 head/contrib/openpam/doc/man/pam_get_authtok.3 head/contrib/openpam/doc/man/pam_get_data.3 head/contrib/openpam/doc/man/pam_get_item.3 head/contrib/openpam/doc/man/pam_get_user.3 head/contrib/openpam/doc/man/pam_getenv.3 head/contrib/openpam/doc/man/pam_getenvlist.3 head/contrib/openpam/doc/man/pam_info.3 head/contrib/openpam/doc/man/pam_open_session.3 head/contrib/openpam/doc/man/pam_prompt.3 head/contrib/openpam/doc/man/pam_putenv.3 head/contrib/openpam/doc/man/pam_set_data.3 head/contrib/openpam/doc/man/pam_set_item.3 head/contrib/openpam/doc/man/pam_setcred.3 head/contrib/openpam/doc/man/pam_setenv.3 head/contrib/openpam/doc/man/pam_sm_acct_mgmt.3 head/contrib/openpam/doc/man/pam_sm_authenticate.3 head/contrib/openpam/doc/man/pam_sm_chauthtok.3 head/contrib/openpam/doc/man/pam_sm_close_session.3 head/contrib/openpam/doc/man/pam_sm_open_session.3 head/contrib/openpam/doc/man/pam_sm_setcred.3 head/contrib/openpam/doc/man/pam_start.3 head/contrib/openpam/doc/man/pam_strerror.3 head/contrib/openpam/doc/man/pam_verror.3 head/contrib/openpam/doc/man/pam_vinfo.3 head/contrib/openpam/doc/man/pam_vprompt.3 head/contrib/openpam/include/security/openpam.h head/contrib/openpam/include/security/openpam_version.h head/contrib/openpam/lib/Makefile.am head/contrib/openpam/lib/Makefile.in head/contrib/openpam/lib/openpam_check_owner_perms.c head/contrib/openpam/lib/openpam_configure.c head/contrib/openpam/lib/openpam_constants.h head/contrib/openpam/lib/openpam_debug.h head/contrib/openpam/lib/openpam_dynamic.c head/contrib/openpam/lib/openpam_get_option.c head/contrib/openpam/lib/openpam_impl.h head/contrib/openpam/lib/openpam_load.c head/contrib/openpam/lib/openpam_log.c head/contrib/openpam/lib/openpam_readline.c head/contrib/openpam/lib/openpam_set_option.c head/contrib/openpam/lib/openpam_strlcmp.h head/contrib/openpam/lib/openpam_strlcpy.h head/contrib/openpam/lib/openpam_subst.c head/contrib/openpam/lib/openpam_ttyconv.c head/contrib/openpam/lib/pam_get_authtok.c head/contrib/openpam/lib/pam_putenv.c head/contrib/openpam/lib/pam_setenv.c head/contrib/openpam/ltmain.sh head/contrib/openpam/misc/gendoc.pl head/lib/libpam/libpam/Makefile Directory Properties: head/contrib/openpam/ (props changed) Modified: head/contrib/openpam/CREDITS ============================================================================== --- head/contrib/openpam/CREDITS Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/CREDITS Sat May 26 17:10:16 2012 (r236109) @@ -16,16 +16,21 @@ ideas: Brian Fundakowski Feldman Christos Zoulas Daniel Richard G. - Darren J. Moffat + Darren J. Moffat Dmitry V. Levin + Don Lewis Emmanuel Dreyfus Eric Melville - Gary Winiger + Gary Winiger + Gleb Smirnoff Hubert Feyrer + Jason Evans Joe Marcus Clarke Juli Mallett Jörg Sonnenberger + Maëlle Lesage Mark Murray + Matthias Drochner Mike Petullo Mikhail Teterin Mikko Työläjärvi @@ -38,4 +43,4 @@ ideas: Wojciech A. Koszek Yar Tikhiy -$Id: CREDITS 498 2011-11-21 16:27:04Z des $ +$Id: CREDITS 587 2012-04-08 11:12:10Z des $ Modified: head/contrib/openpam/HISTORY ============================================================================== --- head/contrib/openpam/HISTORY Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/HISTORY Sat May 26 17:10:16 2012 (r236109) @@ -1,3 +1,51 @@ +OpenPAM Micrampelis 2012-05-26 + + - FEATURE: Add an openpam_readword(3) function which reads the next + word from an input stream, applying shell quoting and escaping + rules. Add numerous unit tests for openpam_readword(3). + + - FEATURE: Add an openpam_readlinev(3) function which uses the + openpam_readword(3) function to read words from an input stream one + at a time until it reaches an unquoted, unescaped newline, and + returns an array of those words. Add several unit tests for + openpam_readlinev(3). + + - FEATURE: Add a PAM_HOST item which pam_start(3) initializes to the + machine's hostname. This was implemented in Lycopsida but + inadvertantly left out of the release notes. + + - FEATURE: In pam_get_authtok(3), if neither the application nor the + module have specified a prompt and PAM_HOST and PAM_RHOST are both + defined but not equal, use a different default prompt that includes + PAM_USER and PAM_HOST. + + - ENHANCE: Rewrite the policy parser to used openpam_readlinev(), + which greatly simplifies the code. + + - ENHANCE: The previous implementation of the policy parser relied on + the openpam_readline(3) function, which (by design) munges + whitespace and understands neither quotes nor backslash escapes. + As a result of the aforementioned rewrite, whitespace, quotes and + backslash escapes in policy files are now handled in a consistent + and predictable manner. + + - ENHANCE: On platforms that have it, use fdlopen(3) to load modules. + This closes the race between the ownership / permission check and + the dlopen(3) call. + + - ENHANCE: Reduce the amount of pointless error messages generated + while searching for a module. + + - ENHANCE: Numerous documentation improvements, both in content and + formatting. + + - BUGFIX: A patch incorporated in Lycopsida inadvertantly changed + OpenPAM's behavior when several policies exist for the same + service, from ignoring all but the first to concatenating them all. + Revert to the original behavior. + + - BUGFIX: Plug a memory leak in the policy parser. +============================================================================ OpenPAM Lycopsida 2011-12-18 - ENHANCE: removed static build autodetection, which didn't work @@ -269,7 +317,7 @@ OpenPAM Cinchona 2002-04-08 - ENHANCE: Add openpam_free_data(), a generic cleanup function for pam_set_data() consumers. ============================================================================ -OpenPAM Centaury 2002-03-14 +OpenPAM Centaury 2002-03-14 - BUGFIX: Add missing #include to openpam_log.c. @@ -308,7 +356,7 @@ OpenPAM Celandine 2002-03-05 module with the same version number as the library itself to one with no version number at all. ============================================================================ -OpenPAM Cantaloupe 2002-02-22 +OpenPAM Cantaloupe 2002-02-22 - BUGFIX: The proper use of PAM_SYMBOL_ERR is to indicate an invalid argument to pam_[gs]et_item(3), not to indicate dlsym(3) failures. @@ -338,7 +386,7 @@ OpenPAM Cantaloupe 2002-02-22 - ENHANCE: openpam_get_authtok() now respects the echo_pass, try_first_pass, and use_first_pass options. ============================================================================ -OpenPAM Caliopsis 2002-02-13 +OpenPAM Caliopsis 2002-02-13 Fixed a number of bugs in the previous release, including: - a number of bugs in and related to pam_[gs]et_item(3) @@ -349,8 +397,8 @@ Fixed a number of bugs in the previous r - missing 'continue' in openpam_dispatch.c caused successes to be counted as failures ============================================================================ -OpenPAM Calamite 2002-02-09 +OpenPAM Calamite 2002-02-09 First (beta) release. ============================================================================ -$Id: HISTORY 504 2011-12-18 14:11:12Z des $ +$Id: HISTORY 609 2012-05-26 13:57:45Z des $ Modified: head/contrib/openpam/LICENSE ============================================================================== --- head/contrib/openpam/LICENSE Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/LICENSE Sat May 26 17:10:16 2012 (r236109) @@ -1,6 +1,6 @@ Copyright (c) 2002-2003 Networks Associates Technology, Inc. -Copyright (c) 2004-2011 Dag-Erling Smørgrav +Copyright (c) 2004-2012 Dag-Erling Smørgrav All rights reserved. This software was developed for the FreeBSD Project by ThinkSec AS and @@ -32,4 +32,4 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -$Id: LICENSE 437 2011-09-13 12:00:13Z des $ +$Id: LICENSE 546 2012-03-31 23:13:20Z des $ Modified: head/contrib/openpam/Makefile.am ============================================================================== --- head/contrib/openpam/Makefile.am Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/Makefile.am Sat May 26 17:10:16 2012 (r236109) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 428 2010-03-09 17:32:17Z des $ +# $Id: Makefile.am 549 2012-04-01 20:38:30Z des $ ACLOCAL_AMFLAGS = -I m4 @@ -8,6 +8,8 @@ if WITH_DOC SUBDIRS += doc endif +SUBDIRS += t + EXTRA_DIST = \ CREDITS \ HISTORY \ Modified: head/contrib/openpam/Makefile.in ============================================================================== --- head/contrib/openpam/Makefile.in Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/Makefile.in Sat May 26 17:10:16 2012 (r236109) @@ -15,7 +15,7 @@ @SET_MAKE@ -# $Id: Makefile.am 428 2010-03-09 17:32:17Z des $ +# $Id: Makefile.am 549 2012-04-01 20:38:30Z des $ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -39,8 +39,8 @@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure INSTALL config.guess config.sub \ - depcomp install-sh ltmain.sh missing + $(srcdir)/pamgdb.in $(top_srcdir)/configure INSTALL TODO \ + config.guess config.sub depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -49,7 +49,7 @@ am__CONFIG_DISTCLEAN_FILES = config.stat configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = pamgdb CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = @@ -67,7 +67,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGE distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = lib bin modules include doc +DIST_SUBDIRS = lib bin modules include doc t DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -222,7 +222,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = lib bin modules include $(am__append_1) +SUBDIRS = lib bin modules include $(am__append_1) t EXTRA_DIST = \ CREDITS \ HISTORY \ @@ -288,6 +288,8 @@ $(srcdir)/config.h.in: $(am__configure_ distclean-hdr: -rm -f config.h stamp-h1 +pamgdb: $(top_builddir)/config.status $(srcdir)/pamgdb.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo Modified: head/contrib/openpam/RELNOTES ============================================================================== --- head/contrib/openpam/RELNOTES Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/RELNOTES Sat May 26 17:10:16 2012 (r236109) @@ -1,6 +1,6 @@ - Release notes for OpenPAM Lycopsida - =================================== + Release notes for OpenPAM Micrampelis + ===================================== This release corresponds to the code used in FreeBSD HEAD as of the release date, and is also expected to work on almost any POSIX-like @@ -19,6 +19,9 @@ intended for actual use, but rather to s application developers. It also includes a command-line application (pamtest) which can be used to test policies and modules. +Unit tests for limited portions of the library can be found in the t +subdirectory. + Please direct bug reports and inquiries to . -$Id: RELNOTES 506 2011-12-18 14:25:12Z des $ +$Id: RELNOTES 609 2012-05-26 13:57:45Z des $ Copied: head/contrib/openpam/TODO (from r236101, vendor/openpam/dist/TODO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openpam/TODO Sat May 26 17:10:16 2012 (r236109, copy of r236101, vendor/openpam/dist/TODO) @@ -0,0 +1,13 @@ +Before the next release: + + - Complete the transition from PAM_LOG_DEBUG to PAM_LOG_LIBDEBUG. + +Whenever: + + - Implement mechanism to enable / disable optional features. Use it + to disable strict error checking so pamtest and unit tests can do + things that we don't allow in production. + + - Rewrite the module-loading code. + +$Id: TODO 592 2012-04-08 13:19:51Z des $ Modified: head/contrib/openpam/aclocal.m4 ============================================================================== --- head/contrib/openpam/aclocal.m4 Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/aclocal.m4 Sat May 26 17:10:16 2012 (r236109) @@ -22,8 +22,8 @@ To do so, use the procedure documented b # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -32,8 +32,8 @@ To do so, use the procedure documented b m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -167,6 +167,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -652,7 +654,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -816,6 +818,7 @@ AC_DEFUN([LT_LANG], m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -837,6 +840,29 @@ m4_defun([_LT_LANG], ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -867,6 +893,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ], m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -969,7 +999,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECK $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -977,6 +1013,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECK rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -988,6 +1025,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECK [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF @@ -1005,7 +1043,9 @@ _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1050,8 +1090,8 @@ _LT_EOF ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -1062,6 +1102,8 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi @@ -1345,14 +1387,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1429,13 +1484,13 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -1615,6 +1670,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [d lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1654,7 +1714,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [d # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do @@ -2200,7 +2260,7 @@ need_version=unknown case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2209,7 +2269,7 @@ aix3*) ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2274,7 +2334,7 @@ beos*) ;; bsdi[[45]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -2413,7 +2473,7 @@ m4_if([$1], [],[ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2466,17 +2526,18 @@ freebsd* | dragonfly*) ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -2537,7 +2598,7 @@ hpux9* | hpux10* | hpux11*) ;; interix[[3-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2553,7 +2614,7 @@ irix5* | irix6* | nonstopux*) nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2590,9 +2651,9 @@ linux*oldld* | linux*aout* | linux*coff* dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2655,7 +2716,7 @@ netbsd*) ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2724,7 +2785,7 @@ rdos*) ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2749,7 +2810,7 @@ sunos4*) ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2773,7 +2834,7 @@ sysv4 | sysv4.3*) sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -2804,7 +2865,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2814,7 +2875,7 @@ tpf*) ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -3236,7 +3297,7 @@ irix5* | irix6* | nonstopux*) lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3656,6 +3717,7 @@ for ac_symprfx in "" "_"; do # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -4240,7 +4302,9 @@ m4_if([$1], [CXX], [ case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi ;; esac else @@ -4332,18 +4396,33 @@ m4_if([$1], [CXX], [ ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; esac ;; esac @@ -4503,7 +4582,9 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) ;; + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] @@ -4528,7 +4609,6 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4779,8 +4859,7 @@ _LT_EOF xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ @@ -5075,6 +5154,7 @@ _LT_EOF # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' @@ -5172,7 +5252,6 @@ _LT_EOF fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -5614,9 +5693,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1] _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5770,7 +5846,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -6901,12 +6976,18 @@ public class foo { } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary @@ -7103,7 +7184,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7236,7 +7316,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7419,6 +7498,73 @@ CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -7488,6 +7634,13 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], @@ -8152,9 +8305,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) @@ -8326,15 +8494,15 @@ m4_define([lt_dict_filter], # @configure_input@ -# serial 3293 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) Modified: head/contrib/openpam/bin/Makefile.am ============================================================================== --- head/contrib/openpam/bin/Makefile.am Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/bin/Makefile.am Sat May 26 17:10:16 2012 (r236109) @@ -1,6 +1,6 @@ -# $Id: Makefile.am 467 2011-11-02 23:42:21Z des $ +# $Id: Makefile.am 538 2012-03-31 17:04:29Z des $ -SUBDIRS = +SUBDIRS = openpam_dump_policy if WITH_PAMTEST SUBDIRS += pamtest Modified: head/contrib/openpam/bin/Makefile.in ============================================================================== --- head/contrib/openpam/bin/Makefile.in Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/bin/Makefile.in Sat May 26 17:10:16 2012 (r236109) @@ -15,7 +15,7 @@ @SET_MAKE@ -# $Id: Makefile.am 467 2011-11-02 23:42:21Z des $ +# $Id: Makefile.am 538 2012-03-31 17:04:29Z des $ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -63,7 +63,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGE distdir ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = pamtest su +DIST_SUBDIRS = openpam_dump_policy pamtest su DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -207,7 +207,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = $(am__append_1) $(am__append_2) +SUBDIRS = openpam_dump_policy $(am__append_1) $(am__append_2) all: all-recursive .SUFFIXES: Modified: head/contrib/openpam/bin/pamtest/pamtest.1 ============================================================================== --- head/contrib/openpam/bin/pamtest/pamtest.1 Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/bin/pamtest/pamtest.1 Sat May 26 17:10:16 2012 (r236109) @@ -10,6 +10,9 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote +.\" products derived from this software without specific prior written +.\" permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -23,9 +26,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: pamtest.1 471 2011-11-03 09:44:40Z des $ +.\" $Id: pamtest.1 610 2012-05-26 14:03:45Z des $ .\" -.Dd November 2, 2011 +.Dd May 26, 2012 .Dt PAMTEST 1 .Os .Sh NAME @@ -33,7 +36,7 @@ .Nd PAM policy tester .Sh SYNOPSYS .Nm -.Op Fl dksv +.Op Fl dkMPsv .Op Fl H Ar rhost .Op Fl h Ar host .Op Fl t Ar tty @@ -116,6 +119,11 @@ The default is to use the result of call .Xr gethostname 3 . .It Fl k Keep going even if one of the commands fails. +.It Fl M +Disable path, ownership and permission checks on module files. +.It Fl P +Disable service name validation and path, ownership and permission +checks on policy files. .It Fl s Set the .Dv PAM_SILENT @@ -149,14 +157,14 @@ policy: pamtest -v system auth account change setcred open close unsetcred .Ed *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat May 26 17:13:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA7CA10656D0; Sat, 26 May 2012 17:13:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 31FA18FC19; Sat, 26 May 2012 17:13:50 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4QGnS3X007346; Sat, 26 May 2012 19:49:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4QGnSOO031534; Sat, 26 May 2012 19:49:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4QGnRxs031533; Sat, 26 May 2012 19:49:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 May 2012 19:49:27 +0300 From: Konstantin Belousov To: Bruce Evans Message-ID: <20120526164927.GU2358@deviant.kiev.zoral.com.ua> References: <201205252150.q4PLomFk035064@svn.freebsd.org> <20120526173233.A885@besplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Yp4ECpV6dHcLchHG" Content-Disposition: inline In-Reply-To: <20120526173233.A885@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Ed Schouten , rwatson@freebsd.org, svn-src-head@freebsd.org, jonathan@freebsd.org Subject: Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:13:52 -0000 --Yp4ECpV6dHcLchHG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 26, 2012 at 10:21:25PM +1000, Bruce Evans wrote: > On Fri, 25 May 2012, Ed Schouten wrote: >=20 > >Log: > > Remove use of non-ISO-C integer types from system call tables. > > > > These files already use ISO-C-style integer types, so make them less > > inconsistent by preferring the standard types. >=20 > These should actually be Linux types l_foo_t. ISO-C-style integer types > seem to have only been used for a couple of uintptr_t's, and these uses > are more than just style bugs on amd64 since uintptr_t is for the host > (64 bits on amd64) while the target uintptr_t is only 32 bits. There > are also a few misuses of the abominable caddr_t instead of l_caddr_t, > so syscalls that don't even take a caddr_t. Otherwise, Linux types > are used a lot to avoid size mismatches. >=20 > >Modified: head/sys/amd64/linux32/syscalls.master > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- head/sys/amd64/linux32/syscalls.master Fri May 25 21:12:24 2012=20 > >(r236025) > >+++ head/sys/amd64/linux32/syscalls.master Fri May 25 21:50:48 2012=20 > >(r236026) > >@@ -54,8 +54,8 @@ > > l_int mode); } > >9 AUE_LINK STD { int linux_link(char *path, char *to); } > >10 AUE_UNLINK STD { int linux_unlink(char *path); } > >-11 AUE_EXECVE STD { int linux_execve(char *path, u_int32_t=20 > >*argp, \ > >- u_int32_t *envp); } > >+11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t=20 > >*argp, \ > >+ uint32_t *envp); } >=20 > argp and envp aren't uintany_t * in either Linux or FreeBSD. They start = as > "char * const *". There is no Linux type for an indirect "char *", and o= ne > was hacked up here by pretending that "char *" is u_int32_t (it is actual= ly > just 32 bits). Using l_caddr_t seems to be the best hack available (since > by abusing l_caddr_t, we know that it is actually char *). >=20 > The `const' in the type for argp and envp is further from being handled > correctly. Most or all syscall.master's just type-pun it away. Similarly > for "const char *path". >=20 > All the non-indirect "char *"s for pathnames and other things seem to be > completely wrong on amd64 too. These pointers start as 32 bits, and it > takes more than a bad type pun to turn then into kernel 64-bit pointers. > The magic for this seems to be: > - all args are converted to 64 bits (by zero-extension?) at a low level The 'low level' AKA magic happens in several *_fetch_syscall_args() functions. For both linux32 and freebsd32, the magic code automatically zero-extends the arguments into 64bit entities. Linux passes args in registers, while FreeBSD uses words on stack. The types in the syscalls.master prototype should be in fact selected to fit the in-kernel prototypes for the functions implementing the syscalls, esp. for NOPROTO cases, and not to the low-level layout of the syscall entry data. > - the args struct for a pathname is > [left padding]; char *; [right padding]; > Since the char * is misdeclared, the explicit padding is null, but the > layout of the args struct is correct because the wrong arg type in it > supplies equivalent padding (extra 32 bits on the right). The arg struct layout is irrelevant, since fetch_syscall_args() functions perform the needed translation from process ABI to kernel ABI. I think that the padding could be completely eliminated for translated ABI, but since it is easier to reuse makesyscalls.sh instead of creating ABI-specific script, and since there is quite non-trivial count of NOPROTO declarations that just match the native-ABI syscall handlers, it is better not to start that. > - the "char *" in the args struct is not actually a char *, and is unusab= le > directly in the kernel. However, it is only used in copyin() and > copyout(), where it becomes a user address and works correctly. (An > older bug in this that the user address for copy*() is declared as > "void *". "void *" means a kernel pointer. The type of a user > address should be more like vm_offset_t, but even that needs logical > translation for linux32). It is char *, but in different address space. Linux-style type qualifiers like __usermode would be appropriate there (remember far/near ?), but we do not have static checkers that do understand the difference. >=20 > The same mechanism presumably avoids problems when raw caddr_t is used > instead of l_caddr_t, and when uintptr_t is used instead of l_uintptr_t. >=20 > >12 AUE_CHDIR STD { int linux_chdir(char *path); } > >13 AUE_NULL STD { int linux_time(l_time_t *tm); } >=20 > Example of a correct use of a linux type. Again, the first-level pointer > is handled by the above magic, but for the second level we need an l_foo_t > to describe its size correctly. >=20 > >14 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \ >=20 > Broken except in the K&R case, but amd64 is too new to pretend to support > K&R. Bug for bug compatible with mknod() and some other syscalls in C std version is irrelevant there. Args fetch code promotes all arguments to (u)int(32). > kern/syscalls.master. mknod() takes an arg of type mode_t, not one of > type int. l_mode_t exists so that the above can be declared correctly, > and is already used for linux_chmod() and linux_chmodat(). OTOH, int for > the mode arg is correct for open(), since open() is variadic at a level > before the syscall, so its mode_t arg gets promoted to int. Similarly, > if mknod() is compiled by a K&R compiler, or by a STDC compiler with no > prototype in scope, then its mode_t arg gets promoted to int (but for > the STDC case, the behaviour is then undefined once mknod() is reached). > Normally this doesn't cause any problems, but it is easy to declare > things correctly. >=20 > >Modified: head/sys/compat/freebsd32/syscalls.master > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- head/sys/compat/freebsd32/syscalls.master Fri May 25 21:12:24 2012= =20 > >(r236025) > >+++ head/sys/compat/freebsd32/syscalls.master Fri May 25 21:50:48 2012= =20 > >(r236026) > >@@ -104,9 +104,9 @@ > > int flags); } > >28 AUE_SENDMSG STD { int freebsd32_sendmsg(int s, struct=20 > >msghdr32 *msg, \ > > int flags); } > >-29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, u_int32_t=20 > >buf, \ > >- u_int32_t len, int flags, u_int32_t=20 > >from, \ > >- u_int32_t fromlenaddr); } > >+29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, uint32_t=20 > >buf, \ > >+ uint32_t len, int flags, uint32_t from, \ > >+ uint32_t fromlenaddr); } >=20 > Oops, I didn't looke at this file when I said that "ISO-C-style integer > types seem to have only been used for a couple of uintptr_t's". This > file is independent of Linux, so it can't use l_foo. It hard-codes 32 > instead, starting with the directory name. Still, all of the types in > the above are fairly bogus and hard to understand: > - "int" for `s' and `flags' depends on ints being 32 bits I agree that this is the biggest type-pun in the whole compat32/linux32 components. It would be nice to use int32_t/uint32_t instead of int there, since we in fact operate on ABI-defined type. But I do not think it is much worry to expect an arch to appear which have sizeof(int) !=3D 4. It is already engraved in stone. > - "struct msghdr32 *msg" depends on magic to translate first-level target > 32-bit pointers to host N-bit pointers > - uint32_t for `buf' and `from' is for pointers too. Now the magic for > first-level pointers is not depended on > - uint32_t for lengths is for size_t's. This is reasonable but would be > clearer if spelled as size32_t (corresponding to l_size_t). >=20 > >30 AUE_ACCEPT NOPROTO { int accept(int s, caddr_t name, \ > > int *anamelen); } >=20 > As above for "int s". The use of caddr_t is more nonsense than usual. > accept()'s second arg is not a caddr_t, but is "struct sockaddr * > restrict". We depend first on type punning this to caddr_t, then to > caddr_t actually being "char *", then on "char *" being a pointer, > then on the usual magic for first-level pointers. kern/syscalls.master > has the same caddr_t for the MCPT_NOA case of accept(), but not for > the MSTD case. Perhaps userland accept() once actually took a caddr_t > arg, but hopefully Linux is too new to have ever done that, and even > compat cruft in FreeeBSD is too new to need that. >=20 > >31 AUE_GETPEERNAME NOPROTO { int getpeername(int fdes, caddr_t asa, \ >=20 > Similarly. For getpeername(), the compat cruft in kern/syscalls.master > is more clearly typed as MCOMPAT. >=20 > >@@ -152,7 +152,7 @@ > >58 AUE_READLINK NOPROTO { ssize_t readlink(char *path, char *buf, \ > > size_t count); } >=20 > All uses of basic C types and POSIX types are wronger than uses of > fixed-width types. Here the size_t is not translated to uint32_t as > above. This presumably works due to essentially the same magic as for > first-level pointers, up to the copyout step: the 32-bit size_t gets > extended to an N-bit one (where N is 32 or 64 on supported arches). > Zero extension of it works right for size_t, and there is no further > magic corresponding to the copy*() step. >=20 > The magic is very convenient. It should probably be explicitly depended > on for all first-level pointers. For size_t's it should be depended on > in no cases or all cases. >=20 > >59 AUE_EXECVE STD { int freebsd32_execve(char *fname, \ > >- u_int32_t *argv, u_int32_t *envv); } > >+ uint32_t *argv, uint32_t *envv); } >=20 > Usual hack for second-level pointers. >=20 > >60 AUE_UMASK NOPROTO { int umask(int newmask); } umask \ > > umask_args int >=20 > Usual bug for mode_t. >=20 > >61 AUE_CHROOT NOPROTO { int chroot(char *path); } > >@@ -325,10 +325,10 @@ > >172 AUE_NULL UNIMPL nosys > >173 AUE_PREAD COMPAT6 { ssize_t freebsd32_pread(int fd, void *buf,=20 > >\ > > size_t nbyte, int pad, \ > >- u_int32_t offset1, u_int32_t offset2); } > >+ uint32_t offset1, uint32_t offset2); } >=20 > More confusing than usual. The size_t is translated by magic. Then there > is bogus historical padding to be compatible with old mistakes in this > area. Then there are 2 64-bit offsets (off_t's in the API) which are > split because the translation code only understands 32-bit args. >=20 > >[... stuff in which the largest obvious bugs are untranslated size_t's] >=20 > >481 AUE_KILL NOPROTO { int thr_kill2(pid_t pid, long id, int=20 > >sig); } >=20 > Untranslated pid_t depends on pid_t being no larger than int. >=20 > Untranslated long completely breaks this. >=20 > >482 AUE_SHMOPEN NOPROTO { int shm_open(const char *path, int flags, \ > >@@ -892,25 +892,25 @@ > >#ifdef PAD64_REQUIRED > >485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t=20 > >which, \ > > int pad, \ > >- u_int32_t id1, u_int32_t id2, \ > >+ uint32_t id1, uint32_t id2, \ > > cpusetid_t setid); } >=20 > Untranslated cpusetid_t. It works since it is int. >=20 > >#else > >485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t=20 > >which, \ > >- u_int32_t id1, u_int32_t id2, \ > >+ uint32_t id1, uint32_t id2, \ > > cpusetid_t setid); } > >#endif > >486 AUE_NULL STD { int freebsd32_cpuset_getid(cpulevel_t=20 > >level, \ > > cpuwhich_t which, \ > >- u_int32_t id1, u_int32_t id2, \ > >+ uint32_t id1, uint32_t id2, \ > > cpusetid_t *setid); } >=20 > This and later have several more cpsetid_t's. Also cpuwhich_t's. id_t's > are translated since they are 64 bits. This is painful. All types that > are documented to be represented by id_t are only 32 bits, and id_t is > wrong for representing 64-bit unsigned types since it is signed. The > above has type puns to represent the signed 64-bit int in 2 uint32_t's. > A pid of -1 would become pid_t -1, then id_t -1, then 0xffffffff, > 0xffffffff. Signed off_t also requires type puns to represent in 2 > uint32_t's. >=20 > >... > >@@ -920,7 +920,7 @@ > >491 AUE_FCHOWNAT NOPROTO { int fchownat(int fd, char *path, uid_t=20 > >uid, \ > > gid_t gid, int flag); } >=20 > Untranslated foo_t's. >=20 > >@@ -959,9 +959,9 @@ > >512 AUE_SHMCTL NOSTD { int freebsd32_shmctl(int shmid, int cmd, \ > > struct shmid_ds32 *buf); } > >513 AUE_LPATHCONF NOPROTO { int lpathconf(char *path, int name); } > >-514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, u_int64_t rights); } > >+514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, uint64_t rights); } >=20 > Broken, assuming that all the other spittings into 2 uint32_t's are neede= d. Yes, this is broken. I added Robert and Jonathan to Cc:. >=20 > >515 AUE_CAP_GETRIGHTS NOPROTO { int cap_getrights(int fd, \ > >- u_int64_t *rightsp); } > >+ uint64_t *rightsp); } >=20 > Now the uint64_t is indirect, so it pronbably works. I looked at the sys_cap_getrights(), it seems to do the right thing. >=20 > >Modified: head/sys/kern/syscalls.master > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- head/sys/kern/syscalls.master Fri May 25 21:12:24 2012 (r236025) > >+++ head/sys/kern/syscalls.master Fri May 25 21:50:48 2012 (r236026) >=20 > I didn't think of uint*N_t in this at first either. >=20 > >@@ -916,9 +916,9 @@ > >512 AUE_SHMCTL NOSTD { int shmctl(int shmid, int cmd, \ > > struct shmid_ds *buf); } > >513 AUE_LPATHCONF STD { int lpathconf(char *path, int name); } > >-514 AUE_CAP_NEW STD { int cap_new(int fd, u_int64_t rights); } > >+514 AUE_CAP_NEW STD { int cap_new(int fd, uint64_t rights); } > >515 AUE_CAP_GETRIGHTS STD { int cap_getrights(int fd, \ > >- u_int64_t *rightsp); } > >+ uint64_t *rightsp); } > >516 AUE_CAP_ENTER STD { int cap_enter(void); } > >517 AUE_CAP_GETMODE STD { int cap_getmode(u_int *modep); } > >518 AUE_PDFORK STD { int pdfork(int *fdp, int flags); } >=20 > In fact, this file has only 3 uint*N_t's. This shows that these 3 are > all API design bugs no matter how they are spelled. All the very old > syscalls use basic C types. All the not so old ones use a STDC or > POSIX typedefed type, with the typedef specific to the context. The > 3 exceptions new ones that hard-code a fixed width are the above 2 CAP > ones and sctp_peeloff(), which uses "uint32_t name". >=20 > These bugs are easiest to fix in the Linux syscall.master's since the > bugs are mostly already avoided using l_foo_t. In amd64/linux32/ > syscalls.master, I only noticed the following ones: >=20 > % 1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \ > % sys_exit_args void >=20 > "int" for the return and args is not quite right, and it bogotifies the > use of l_int for some args. It works though (assuming 32-bit host ints). > Assumptions that the return type is 32-bit int and that the host int is > 32-bits are implicit in all over, so we should assume them here for > simplicity. (Hmm, td_retval is actually 2 register_t's. 64 bits each > on amd64. amd64/linux32 has remarkably little code to convert these > 2 64-bit ints into 4 32-bit ints.) >=20 > % 2 AUE_FORK STD { int linux_fork(void); } > % 3 AUE_NULL NOPROTO { int read(int fd, char *buf, \ > % u_int nbyte); } >=20 > This u_int should strictly be l_size_t. l_size_t is used a lot elswhere > in this file. In syscalls where the type is actually u_int, l_uint should > be used. l_uint is used a lot elsewhere in this file. But not many > syscsalls use u_int, so many of these l_uints are probably just different > misspellings of l_size_t. So the density of logical type bugs is high > even in this file. >=20 > % 4 AUE_NULL NOPROTO { int write(int fd, char *buf, \ > % u_int nbyte); } >=20 > u_int seems to be more common in older syscalls. >=20 > % 5 AUE_OPEN_RWTC STD { int linux_open(char *path, l_int flags, \ > % l_int mode); } >=20 > Finally, an example of perfectly correct use of l_int. It even correctly > handles the subtlety that l_mode_t promotes to l_int since open() is > variadic. (BTW, I don't like hard-coding this promotion and have > wished for the __promoteof() operator for giving it for more than 20 > years. The promotion of a typedefed type even harder to determine than > the correct PRI* mistake to use for printing a typedefed type.) >=20 > This declaration is still far from correct altogether, since it depends > on the usual hacks: > - int return type is actual l_int > - char *path is actually "const char *path" at the target level > - magic to convert target "char *" to and from host "char *" >=20 > % 11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t=20 > *argp, \ > % uint32_t *envp); } >=20 > See above. >=20 > % 41 AUE_DUP NOPROTO { int dup(u_int fd); } >=20 > Another untranslated type. dup() doesn't even take a u_int to begin with > (it takes a normal int descriptor). Untranslated int args aren't actually > very common. >=20 > % 54 AUE_IOCTL STD { int linux_ioctl(l_uint fd, l_uint cmd, \ > % uintptr_t arg); } >=20 > Now l_foo is used for the descriptor, but u_int is wrong -- Linux uses > a normal int for the descriptor for ioctl() too. >=20 > l_uint for cmd is wrong too. The type starts as u_long (same as in > FreeBSD), at least in the 1997 Linux userland that I used to check > this. This type mismatch is harmless because ints and longs are both > 32 bits on Linux-i386. >=20 > uintptr_t for arg is wronger. For ioctl(), this arg is the first variadic > one and might not be present. I think declaring it in the above gives (v= ia > the Linux ABI) the garbage contents of a register for it when it isn't > present. Native FreeBSD ioctl() has evem more magic. It misdeclares the > arg as caddr_t instead, and gives stack garbage for it when it isn't > present, and depends on the stack being large enough to avoid a memory > fault when copying the stack garbage (the FreeBSD ABO gives at least a > return address there). >=20 > The type of the arg, when it is present, is specified to be caddr_t (:-() > in FreeBSD. Linux (1997 userland) is better and says it is "char *". It > should have been "void *". syscall.master's should probably declare it > as "void *". Here it starts as a 32-bit pointer and the usual magic will > convert it to a 64-bit non-pointer represented as a host uintptr_t by the > above or by a host "void *" with "void *" in the above. copy*() will > eventually turn it into "void *uaddr" either way. Then it will still > not really be a kernel pointer, but is used as one in the implementation > of copy*() on amd64 (this depends on a flat address space). >=20 >=20 > % 55 AUE_FCNTL STD { int linux_fcntl(l_uint fd, l_uint cmd, \ > % uintptr_t arg); } >=20 > Same errors for the types of fd and arg. Different error for the type of > cmd. Unlike for ioctl(), it starts as neither long or unsigned, but just > int (POSIX spec). >=20 > % 56 AUE_NULL UNIMPL mpx > % 57 AUE_SETPGRP NOPROTO { int setpgid(int pid, int pgid); } >=20 > l_pid_t exists and should be used. >=20 > % 60 AUE_UMASK NOPROTO { int umask(int newmask); } >=20 > l_mode_t exists and should be used. >=20 > % 63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } >=20 > Bogus fd types, as usual. >=20 > % 65 AUE_GETPGRP NOPROTO { int getpgrp(void); } >=20 > Should really be more careful with return types that are typedefed in the > API (and are not just int statuses or fds). kern/syscalls.master is > sloppy with this too. >=20 > % 74 AUE_SYSCTL STD { int linux_sethostname(char *hostname, \ > % u_int len); } >=20 > get/sethostname() is horribly inconsistent. In FreeBSD, gethostname() is > documented as taking a size_t and sethostname() is documented as taking > an int. kern/syscalls.master uses u_int for both. Apparently there is > enough magic with arg packing for this to work even on supported > 64-bit big-endian systems. Linux userland was better even in 1997 -- > it uses size_t for both. POSIX has specified gethostname() since at > least 2001. It uses size_t of course. It says that these are 4.3BSD > functions but it only specifies gethostname(), and it applies an > OpenGroup resolution to change the type from socklen_t to size_t for > gethostname(). This made it incompatible with BSD. Old BSD uses int > for both, and FreeBSD apparently changed the documentation but not the > code for gethostname() only, to be bug for compatible with POSIX. >=20 > So the above should use l_size_t, and strictly, the code probably needs > to be more careful than it is with unrepresentable sizes (native > sethostname() wants a signed int and might not have the right checking > for a 32-bit unsigned size_t). >=20 > % 75 AUE_SETRLIMIT STD { int linux_setrlimit(l_uint resource, \ > % struct l_rlimit *rlim); } > % 76 AUE_GETRLIMIT STD { int linux_old_getrlimit(l_uint resource, \ > % struct l_rlimit *rlim); } >=20 > Resource numbers should be plain ints too. They are documented to be > as such in old Linux userland man pages. But in old Linux (glibc) > headers, they are obfuscated as __rlimit_resource_t, which an enum > with gnu extensions, else plain int. >=20 > % 78 AUE_NULL STD { int linux_gettimeofday( \ > % struct l_timeval *tp, \ > % struct timezone *tzp); } > % 79 AUE_SETTIMEOFDAY STD { int linux_settimeofday( \ > % struct l_timeval *tp, \ > % struct timezone *tzp); } >=20 > The timezone struct only has a couple of ints in it, so this abuse of > the native timezone works, but is fragile. I forget if the timezone > arg is deprecated to the point of ignoring it for native > get/settimeofday(). If so, then this won't work for emulated > get/settimeofday() >=20 > % 85 AUE_READLINK STD { int linux_readlink(char *name, char *buf, \ > % l_int count); } >=20 > Native readlink was churned by POSIX from an int count to a size_t count. > Linux readlink has takes a size_t count even in 1997 and probably still > does. >=20 > % 88 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ > % l_int magic2, l_uint cmd, void *arg); } >=20 > In old Linux userland it is documented to take only 3 int args, with the > 3rd one named `flag'. >=20 > % ; 89: old_readdir > % 89 AUE_GETDIRENTRIES STD { int linux_readdir(l_uint fd, \ > % struct l_dirent *dent, l_uint count); } >=20 > Matches old Linux userland man page right down to the u_int for fd. >=20 >=20 > % 91 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } >=20 > Takes a void * and a size_t in modern munmap() and Linux had that in 1997. > FreeBSD-3 had this too. The above matches FreeBSD-1. >=20 > % 92 AUE_TRUNCATE STD { int linux_truncate(char *path, \ > % l_ulong length); } >=20 > Should use l_off_t, not l_ulong (except possibly if their is an unsigned > hack to support file sizes of 2G-4G). >=20 > % 93 AUE_FTRUNCATE STD { int linux_ftruncate(int fd, long length); } >=20 > Using long is very broken. l_off_t is correct here too. >=20 > % 94 AUE_FCHMOD NOPROTO { int fchmod(int fd, int mode); } >=20 > mode_t is used for all other *chmod*()'s in this file >=20 > % 95 AUE_FCHOWN NOPROTO { int fchown(int fd, int uid, int gid); } >=20 > l_uid16_t and l_gid16_t are used for all other old *chown*() in this file. > (Newer ones are spelled *lchown*() and take l_uid_t and l_gid_t's.) >=20 > % 96 AUE_GETPRIORITY STD { int linux_getpriority(int which, int who);=20 > } > % 97 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ > % int prio); } >=20 > `who' should have type pid_t, but is still int in FreeBSD native. In > old Linux, it is int in the man page but is obfuscated as id_t in the > glibc header. Even `which' is obfuscated as __priority_which_t in the > glibc header. (I consider even using size_t for read() to be a > regression. Typedefed types are hard to use correctly, as shown by > this mail which points out that hundreds of incorrect uses, where the > bugs are only harmless because the use of typedefed types makes no > significant difference.) >=20 > Got bored here, and looked at the rest less carefully. The newer > syscalls seem to be handled more carefully, probably because plenty > of Linux types existed when they were written. There just seemed to > be too many l_[u]longs in them. >=20 > % 168 AUE_POLL NOPROTO { int poll(struct pollfd *fds, \ > % unsigned int nfds, int timeout); } >=20 > Hrmph, this is the only one that misspells "unsigned" more verbosely as > "unsigned int" instead of as the usual KNF abbreviation "u_int". >=20 > Of course, poll() doesn't even take a u_int type. Modern poll takes > an nfds_t type. Linux had that in 1997, and it was u_long, not u_int. >=20 > Use of the native struct pollfd is dangerous. It works because it > consists of an int followed by 2 shorts, and this matches the Linux > type and neither has neither unnamed padding on at least amd64 and i386. >=20 > % 180 AUE_PREAD STD { int linux_pread(l_uint fd, char *buf, \ > % l_size_t nbyte, l_loff_t offset); } > % [... several more bogus l_uints for fds] >=20 > % 183 AUE_GETCWD STD { int linux_getcwd(char *buf, \ > % l_ulong bufsize); } >=20 > A different misspelling of l_size_t. >=20 > % 191 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \ > % struct l_rlimit *rlim); } >=20 > Bogus resource number times for new rlimit syscalls too. >=20 > % 193 AUE_TRUNCATE STD { int linux_truncate64(char *path, \ > % l_loff_t length); } > % 194 AUE_FTRUNCATE STD { int linux_ftruncate64(l_uint fd, \ > % l_loff_t length); } >=20 > How can this work? I was going to say that the splitting up of the 64-bit > args in compat/freebsd32/syscalls.master was unnecessary because it is > apparently not needed here. Then I misread this as doing the splitting. > But it doesn't. Similarly later in this file. >=20 > % 218 AUE_MINCORE STD { int linux_mincore(l_ulong start, \ > % l_size_t len, u_char *vec); } > % 219 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \ > % int behav); } >=20 > SIlly to have l_size_t in one and raw size_t in the next. >=20 > I just noticed that NOPROTO calls never use l_foo. They go direct to > the native calls, and spelling things without an l_ may be necessary > for hiding the type mismatches from this. But this is especially > fragile, and maybe the l_'s here would be harmless since they have no > effect, since type checking for the direct calls is destroyed better > using (sy_call_t *) casts. >=20 > % 220 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ > % void *dirent, l_uint count); } > % 221 AUE_FCNTL STD { int linux_fcntl64(l_uint fd, l_uint cmd, \ > % uintptr_t arg); } >=20 > Type errors for 32-bit syscalls are often duplicated for the corresponding > 64-bit ones. My old userland doesn't have these new syscalls to check, > but I doubt that Linux changed the API for the non-64 bit parts, and > u_int fds are bogus as usual. >=20 > % 240 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op,=20 > uint32_t val, \ > % struct l_timespec *timeout, uint32_t=20 > *uaddr2, uint32_t val3); } > % 241 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid,=20 > l_uint len, \ > % l_ulong *user_mask_ptr); } > % 242 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid,=20 > l_uint len, \ > % l_ulong *user_mask_ptr); } > % 243 AUE_NULL STD { int linux_set_thread_area(struct=20 > l_user_desc *desc); } >=20 > Lots of style bugs which are not present in old code: > - lines are not wrapped at 80 columns > - wrapped lines are misindented. >=20 >=20 > % 250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t=20 > offset, \ > % l_size_t len, int advice); } >=20 > More style bugs. >=20 > % 264 AUE_CLOCK_SETTIME STD { int linux_clock_settime(clockid_t=20 > which, struct l_timespec *tp); } > % 265 AUE_NULL STD { int linux_clock_gettime(clockid_t which,=20 > struct l_timespec *tp); } > % 266 AUE_NULL STD { int linux_clock_getres(clockid_t which,=20 > struct l_timespec *tp); } > % 267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which,=20 > int flags, \ > % struct l_timespec *rqtp, struct=20 > l_timespec *rmtp); } > % 268 AUE_STATFS STD { int linux_statfs64(char *path, size_t=20 > bufsize, struct l_statfs64_buf *buf); } >=20 > Another raw size_t. >=20 > Another long line. >=20 > % 269 AUE_FSTATFS STD { int linux_fstatfs64(void); } > % 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int=20 > sig); } >=20 > Raw ints for pids. >=20 > % 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ > % struct l_timeval *tptr); } > % 272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ > % l_loff_t offset, l_loff_t len, \ > % int advice); } >=20 > Just about all syscalls added since #239 are misformatted :-(. >=20 > % 295 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, const char=20 > *filename, \ > % l_int flags, l_int mode); } > % 296 AUE_MKDIRAT STD { int linux_mkdirat(l_int dfd, const char=20 > *pathname, \ > % l_int mode); } > % 297 AUE_MKNODAT STD { int linux_mknodat(l_int dfd, const char=20 > *filename, \ > % l_int mode, l_uint dev); } > % 298 AUE_FCHOWNAT STD { int linux_fchownat(l_int dfd, const char=20 > *filename, \ > % l_uid16_t uid, l_gid16_t gid, l_int=20 > flag); } > % 299 AUE_FUTIMESAT STD { int linux_futimesat(l_int dfd, char=20 > *filename, \ > % struct l_timeval *utimes); } > % 300 AUE_FSTATAT STD { int linux_fstatat64(l_int dfd, char=20 > *pathname, \ > % struct l_stat64 *statbuf, l_int=20 > flag); } > % 301 AUE_UNLINKAT STD { int linux_unlinkat(l_int dfd, const char=20 > *pathname, \ > % l_int flag); } > % 302 AUE_RENAMEAT STD { int linux_renameat(l_int olddfd, const=20 > char *oldname, \ > % l_int newdfd, const char *newname); } > % 303 AUE_LINKAT STD { int linux_linkat(l_int olddfd, const char=20 > *oldname, \ > % l_int newdfd, const char *newname,=20 > l_int flag); } > % 304 AUE_SYMLINKAT STD { int linux_symlinkat(const char *oldname,=20 > l_int newdfd, \ > % const char *newname); } > % 305 AUE_READLINKAT STD { int linux_readlinkat(l_int dfd, const char=20 > *path, \ > % char *buf, l_int bufsiz); } > % 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char=20 > *filename, \ > % l_mode_t mode); } > % 307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char=20 > *filename, l_int amode, int flag); } >=20 > Mounds more misformatting. >=20 > [... A small pile of misformatting] >=20 > Bruce --Yp4ECpV6dHcLchHG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/BCZcACgkQC3+MBN1Mb4ht6wCgkQF5Tjavfop7pSe84lruIo96 /tsAoLiE4owTVEC0kJZZS1hVW+3X/EiJ =c2ZS -----END PGP SIGNATURE----- --Yp4ECpV6dHcLchHG-- From owner-svn-src-all@FreeBSD.ORG Sat May 26 17:19:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E7B31065670; Sat, 26 May 2012 17:19:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69FD88FC12; Sat, 26 May 2012 17:19: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 q4QHJgrb096474; Sat, 26 May 2012 17:19:42 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QHJgWQ096472; Sat, 26 May 2012 17:19:42 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261719.q4QHJgWQ096472@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236110 - head/usr.bin/fetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:19:42 -0000 Author: des Date: Sat May 26 17:19:41 2012 New Revision: 236110 URL: http://svn.freebsd.org/changeset/base/236110 Log: Revert r232274 - unauthorized, unnecessary and incorrect. Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Sat May 26 17:10:16 2012 (r236109) +++ head/usr.bin/fetch/fetch.1 Sat May 26 17:19:41 2012 (r236110) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2012 Dag-Erling Smørgrav +.\" Copyright (c) 2000-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2012 +.Dd September 27, 2011 .Dt FETCH 1 .Os .Sh NAME @@ -214,11 +214,6 @@ When the flag is specified, wait this many seconds between successive retries. .El .Pp -.Ar URL -.Bd -literal - :(//((:)?@)?(:)?)?/()? -.Ed -.Pp If .Nm receives a From owner-svn-src-all@FreeBSD.ORG Sat May 26 17:28:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 363EC106567C; Sat, 26 May 2012 17:28:58 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21BEA8FC21; Sat, 26 May 2012 17:28: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 q4QHSv6D096894; Sat, 26 May 2012 17:28:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QHSvki096892; Sat, 26 May 2012 17:28:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261728.q4QHSvki096892@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:28: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: r236111 - stable/9/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:28:58 -0000 Author: des Date: Sat May 26 17:28:57 2012 New Revision: 236111 URL: http://svn.freebsd.org/changeset/base/236111 Log: MFH r234685: utf8 and drop middle name Modified: stable/9/lib/msun/src/s_fabsl.c Directory Properties: stable/9/lib/msun/ (props changed) Modified: stable/9/lib/msun/src/s_fabsl.c ============================================================================== --- stable/9/lib/msun/src/s_fabsl.c Sat May 26 17:19:41 2012 (r236110) +++ stable/9/lib/msun/src/s_fabsl.c Sat May 26 17:28:57 2012 (r236111) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2003 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Sat May 26 17:37:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15A06106566B; Sat, 26 May 2012 17:37:08 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 019FF8FC19; Sat, 26 May 2012 17:37: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 q4QHb7IY097300; Sat, 26 May 2012 17:37:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QHb7PL097297; Sat, 26 May 2012 17:37:07 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261737.q4QHb7PL097297@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:37: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: r236112 - stable/9/usr.bin/unzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:37:08 -0000 Author: des Date: Sat May 26 17:37:07 2012 New Revision: 236112 URL: http://svn.freebsd.org/changeset/base/236112 Log: MFH r234311: utf8 and drop middle name Modified: stable/9/usr.bin/unzip/unzip.1 stable/9/usr.bin/unzip/unzip.c Directory Properties: stable/9/usr.bin/unzip/ (props changed) Modified: stable/9/usr.bin/unzip/unzip.1 ============================================================================== --- stable/9/usr.bin/unzip/unzip.1 Sat May 26 17:28:57 2012 (r236111) +++ stable/9/usr.bin/unzip/unzip.1 Sat May 26 17:37:07 2012 (r236112) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2007-2008 Dag-Erling Coïdan Smørgrav +.\" Copyright (c) 2007-2008 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: stable/9/usr.bin/unzip/unzip.c ============================================================================== --- stable/9/usr.bin/unzip/unzip.c Sat May 26 17:28:57 2012 (r236111) +++ stable/9/usr.bin/unzip/unzip.c Sat May 26 17:37:07 2012 (r236112) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2009 Joerg Sonnenberger - * Copyright (c) 2007-2008 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2007-2008 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Sat May 26 17:38:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33F83106566B; Sat, 26 May 2012 17:38:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E94E8FC0A; Sat, 26 May 2012 17:38:56 +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 q4QHctdt097420; Sat, 26 May 2012 17:38:55 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QHctNw097418; Sat, 26 May 2012 17:38:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261738.q4QHctNw097418@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:38: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: r236113 - stable/9/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:38:56 -0000 Author: des Date: Sat May 26 17:38:55 2012 New Revision: 236113 URL: http://svn.freebsd.org/changeset/base/236113 Log: MFH r230059: improve examples Modified: stable/9/sbin/geom/class/part/gpart.8 Directory Properties: stable/9/sbin/geom/class/part/ (props changed) Modified: stable/9/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/9/sbin/geom/class/part/gpart.8 Sat May 26 17:37:07 2012 (r236112) +++ stable/9/sbin/geom/class/part/gpart.8 Sat May 26 17:38:55 2012 (r236113) @@ -996,17 +996,21 @@ partition that can boot from a .Cm freebsd-ufs partition, and install bootstrap code into it. -This partition must be larger than -.Pa /boot/gptboot , -or the GPT boot you are planning to write, but smaller than 545 KB. -A size of 15 blocks (7680 bytes) would be sufficient for -booting from UFS but 128 blocks (64 KB) is used in -this example to reserve some space for potential -future need (e.g.\& a larger +This partition must be larger than the bootstrap code +.Po +usually either +.Pa /boot/gptboot +or .Pa /boot/gptzfsboot -for booting from a ZFS partition). +.Pc , +but smaller than 545 kB since the first-stage loader will load the +entire partition into memory during boot, regardless of how much data +it actually contains. +This example uses 94 blocks (47 kB) so the next partition will be +aligned on a 64 kB boundary without the need to specify an explicit +offset or alignment. .Bd -literal -offset indent -/sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0 +/sbin/gpart add -b 34 -s 94 -t freebsd-boot ad0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 .Ed .Pp @@ -1014,7 +1018,7 @@ Create a 512MB-sized .Cm freebsd-ufs partition to contain a UFS filesystem from which the system can boot. .Bd -literal -offset indent -/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 +/sbin/gpart add -s 512M -t freebsd-ufs ad0 .Ed .Pp Create an MBR scheme on From owner-svn-src-all@FreeBSD.ORG Sat May 26 17:53:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAD911065678; Sat, 26 May 2012 17:53:35 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B62C28FC0A; Sat, 26 May 2012 17:53: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 q4QHrZ7L098077; Sat, 26 May 2012 17:53:35 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QHrZoC098075; Sat, 26 May 2012 17:53:35 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261753.q4QHrZoC098075@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:53:35 +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: r236114 - stable/9/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:53:35 -0000 Author: des Date: Sat May 26 17:53:35 2012 New Revision: 236114 URL: http://svn.freebsd.org/changeset/base/236114 Log: MFH r227797, 227932: add {STATIC,SHARED}_{C,CXX}FLAGS Modified: stable/9/share/mk/bsd.lib.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.lib.mk ============================================================================== --- stable/9/share/mk/bsd.lib.mk Sat May 26 17:38:55 2012 (r236113) +++ stable/9/share/mk/bsd.lib.mk Sat May 26 17:53:35 2012 (r236114) @@ -67,23 +67,32 @@ PICFLAG=-fpic PO_FLAG=-pg +.c.o: + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ + (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) + .c.po: - ${CC} ${PO_FLAG} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) .c.So: - ${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.cc.o: + ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + .cc.po .C.po .cpp.po .cxx.po: - ${CXX} ${PO_FLAG} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .cc.So .C.So .cpp.So .cxx.So: - ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .f.po: ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} From owner-svn-src-all@FreeBSD.ORG Sat May 26 17:56:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B69E1065673; Sat, 26 May 2012 17:56:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1703E8FC08; Sat, 26 May 2012 17: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 q4QHusTX098322; Sat, 26 May 2012 17:56:54 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QHusUV098319; Sat, 26 May 2012 17:56:54 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261756.q4QHusUV098319@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:56: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: r236115 - in stable/9/lib/libpam: . modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:56:55 -0000 Author: des Date: Sat May 26 17:56:54 2012 New Revision: 236115 URL: http://svn.freebsd.org/changeset/base/236115 Log: MFH r227798, r227933: simplify build by using STATIC_CFLAGS Modified: stable/9/lib/libpam/Makefile.inc stable/9/lib/libpam/modules/Makefile.inc Directory Properties: stable/9/lib/libpam/ (props changed) Modified: stable/9/lib/libpam/Makefile.inc ============================================================================== --- stable/9/lib/libpam/Makefile.inc Sat May 26 17:53:35 2012 (r236114) +++ stable/9/lib/libpam/Makefile.inc Sat May 26 17:56:54 2012 (r236115) @@ -31,4 +31,6 @@ DEBUG_FLAGS+= -DDEBUG SHLIB_MAJOR= 5 PAM_MOD_DIR= ${LIBDIR} +STATIC_CFLAGS+= -DOPENPAM_STATIC_MODULES + .include "../Makefile.inc" Modified: stable/9/lib/libpam/modules/Makefile.inc ============================================================================== --- stable/9/lib/libpam/modules/Makefile.inc Sat May 26 17:53:35 2012 (r236114) +++ stable/9/lib/libpam/modules/Makefile.inc Sat May 26 17:56:54 2012 (r236115) @@ -18,7 +18,4 @@ DPADD+= ${LIBPAM} LDADD+= -lpam .endif -.c.o: - ${CC} ${CFLAGS} -DOPENPAM_STATIC_MODULES -c ${.IMPSRC} - .include "../Makefile.inc" From owner-svn-src-all@FreeBSD.ORG Sat May 26 18:20:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59C96106566B; Sat, 26 May 2012 18:20:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44A6C8FC0C; Sat, 26 May 2012 18:20: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 q4QIKVim099340; Sat, 26 May 2012 18:20:31 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QIKVUZ099338; Sat, 26 May 2012 18:20:31 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261820.q4QIKVUZ099338@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 18:20: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: r236116 - stable/9/lib/libpam/libpam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 18:20:31 -0000 Author: des Date: Sat May 26 18:20:30 2012 New Revision: 236116 URL: http://svn.freebsd.org/changeset/base/236116 Log: MFH r226625, 226632: document what openpam_static.c is for Modified: stable/9/lib/libpam/libpam/Makefile Directory Properties: stable/9/lib/libpam/ (props changed) Modified: stable/9/lib/libpam/libpam/Makefile ============================================================================== --- stable/9/lib/libpam/libpam/Makefile Sat May 26 17:56:54 2012 (r236115) +++ stable/9/lib/libpam/libpam/Makefile Sat May 26 18:20:30 2012 (r236116) @@ -148,7 +148,15 @@ HEADERS= security/openpam.h \ ADD_HEADERS= security/pam_mod_misc.h +# # Static modules +# +# We build static versions of all modules and of openpam_static.o, +# then link them all together into openpam_static_modules.o. None of +# the modules export any symbols, but they store structures with +# pointers to their service functions in a linker set which the code +# in openpam_static.c traverses to locate the individual modules. +# MODULE_DIR= ../modules .include "${.CURDIR}/${MODULE_DIR}/modules.inc" STATIC_MODULES= ${MODULES:C/.*/${MODULE_DIR}\/&\/lib&.a/} @@ -159,7 +167,8 @@ CLEANFILES+= openpam_static.o \ openpam_static_modules.o: openpam_static.o ${STATIC_MODULES} ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC} -# Can't put openpam_static.c in SRCS but want .o in .depend. +# We can't put openpam_static.c in SRCS, but we still want to scan it +# for dependencies. DPSRCS= openpam_static.c # Headers From owner-svn-src-all@FreeBSD.ORG Sat May 26 20:03:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0B7A1065687; Sat, 26 May 2012 20:03:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBEF38FC12; Sat, 26 May 2012 20:03:48 +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 q4QK3mNK003655; Sat, 26 May 2012 20:03:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QK3mQj003650; Sat, 26 May 2012 20:03:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205262003.q4QK3mQj003650@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 26 May 2012 20:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236117 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 20:03:49 -0000 Author: kib Date: Sat May 26 20:03:47 2012 New Revision: 236117 URL: http://svn.freebsd.org/changeset/base/236117 Log: Stop treating td_sigmask specially for the purposes of new thread creation. Move it into the copied region of the struct thread. Update some comments. Requested by: bde X-MFC after: never Modified: head/sys/kern/kern_fork.c head/sys/kern/kern_kthread.c head/sys/kern/kern_thr.c head/sys/sys/proc.h Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat May 26 18:20:30 2012 (r236116) +++ head/sys/kern/kern_fork.c Sat May 26 20:03:47 2012 (r236117) @@ -475,7 +475,6 @@ do_fork(struct thread *td, int flags, st bcopy(&p2->p_comm, &td2->td_name, sizeof(td2->td_name)); td2->td_sigstk = td->td_sigstk; - td2->td_sigmask = td->td_sigmask; td2->td_flags = TDF_INMEM; td2->td_lend_user_pri = PRI_MAX; Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Sat May 26 18:20:30 2012 (r236116) +++ head/sys/kern/kern_kthread.c Sat May 26 20:03:47 2012 (r236117) @@ -271,7 +271,6 @@ kthread_add(void (*func)(void *), void * bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); -/* XXX check if we should zero. */ bcopy(&oldtd->td_startcopy, &newtd->td_startcopy, __rangeof(struct thread, td_startcopy, td_endcopy)); @@ -295,7 +294,6 @@ kthread_add(void (*func)(void *), void * /* this code almost the same as create_thread() in kern_thr.c */ PROC_LOCK(p); p->p_flag |= P_HADTHREADS; - newtd->td_sigmask = oldtd->td_sigmask; /* XXX dubious */ thread_link(newtd, p); thread_lock(oldtd); /* let the scheduler know about these things. */ Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Sat May 26 18:20:30 2012 (r236116) +++ head/sys/kern/kern_thr.c Sat May 26 20:03:47 2012 (r236117) @@ -252,7 +252,6 @@ create_thread(struct thread *td, mcontex PROC_LOCK(td->td_proc); td->td_proc->p_flag |= P_HADTHREADS; - newtd->td_sigmask = td->td_sigmask; thread_link(newtd, p); bcopy(p->p_comm, newtd->td_name, sizeof(newtd->td_name)); thread_lock(td); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat May 26 18:20:30 2012 (r236116) +++ head/sys/sys/proc.h Sat May 26 20:03:47 2012 (r236117) @@ -258,7 +258,6 @@ struct thread { u_int td_uticks; /* (t) Statclock hits in user mode. */ int td_intrval; /* (t) Return value for sleepq. */ sigset_t td_oldsigmask; /* (k) Saved mask from pre sigpause. */ - sigset_t td_sigmask; /* (c) Current signal mask. */ volatile u_int td_generation; /* (k) For detection of preemption */ stack_t td_sigstk; /* (k) Stack ptr and on-stack flag. */ int td_xsig; /* (c) Signal for ptrace */ @@ -272,10 +271,11 @@ struct thread { struct osd td_osd; /* (k) Object specific data. */ struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ pid_t td_dbg_forked; /* (c) Child pid for debugger. */ -#define td_endzero td_rqindex +#define td_endzero td_sigmask -/* Copied during fork1() or thread_sched_upcall(). */ +/* Copied during fork1() or create_thread(). */ #define td_startcopy td_endzero + sigset_t td_sigmask; /* (c) Current signal mask. */ u_char td_rqindex; /* (t) Run queue index. */ u_char td_base_pri; /* (t) Thread base kernel priority. */ u_char td_priority; /* (t) Thread active priority. */ @@ -285,7 +285,7 @@ struct thread { #define td_endcopy td_pcb /* - * Fields that must be manually set in fork1() or thread_sched_upcall() + * Fields that must be manually set in fork1() or create_thread() * or already have been set in the allocator, constructor, etc. */ struct pcb *td_pcb; /* (k) Kernel VA of pcb and kstack. */ From owner-svn-src-all@FreeBSD.ORG Sat May 26 20:13:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18889106564A; Sat, 26 May 2012 20:13:25 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 035A58FC0C; Sat, 26 May 2012 20:13:25 +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 q4QKDOgc004087; Sat, 26 May 2012 20:13:24 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QKDODI004084; Sat, 26 May 2012 20:13:24 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201205262013.q4QKDODI004084@svn.freebsd.org> From: Matthew D Fleming Date: Sat, 26 May 2012 20:13:24 +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: r236118 - stable/9/bin/kenv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 20:13:25 -0000 Author: mdf Date: Sat May 26 20:13:24 2012 New Revision: 236118 URL: http://svn.freebsd.org/changeset/base/236118 Log: MFC r235297, r235316: Add a -v and -N option to kenv(1), so it can be more easily used in scripts the way sysctl(8) is. The -N option, like in sysctl(8), displays only the kenv names, not their values. The -v option prints an individual kenv variable name with its value as name="value". This is the inverse of sysctl(8)'s -n flag, since the default behaviour of kenv(1) is already like sysctl(8) -n. Modified: stable/9/bin/kenv/kenv.1 stable/9/bin/kenv/kenv.c Directory Properties: stable/9/bin/ (props changed) stable/9/bin/csh/ (props changed) stable/9/bin/df/ (props changed) stable/9/bin/ed/ (props changed) stable/9/bin/expr/ (props changed) stable/9/bin/ps/ (props changed) stable/9/bin/sh/ (props changed) Modified: stable/9/bin/kenv/kenv.1 ============================================================================== --- stable/9/bin/kenv/kenv.1 Sat May 26 20:03:47 2012 (r236117) +++ stable/9/bin/kenv/kenv.1 Sat May 26 20:13:24 2012 (r236118) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 13, 2009 +.Dd May 11, 2012 .Dt KENV 1 .Os .Sh NAME @@ -32,9 +32,9 @@ .Nd dump or modify the kernel environment .Sh SYNOPSIS .Nm -.Op Fl hq +.Op Fl hNq .Nm -.Op Fl q +.Op Fl qv .Ar variable Ns Op = Ns Ar value .Nm .Op Fl q @@ -54,6 +54,11 @@ name is specified, .Nm will only report that value. If the +.Fl N +option is specified, +.Nm +will only display variable names and not their values. +If the .Fl u option is specified, .Nm @@ -68,6 +73,13 @@ If the option is set, warnings normally printed as a result of being unable to perform the requested operation will be suppressed. .Pp +If the +.Fl v +option is set, the variable name will be printed out for the +environment variable in addition to the value when +.Nm +is executed with a variable name. +.Pp Variables can be added to the kernel environment using the .Pa /boot/loader.conf file, or also statically compiled into the kernel using the statement Modified: stable/9/bin/kenv/kenv.c ============================================================================== --- stable/9/bin/kenv/kenv.c Sat May 26 20:03:47 2012 (r236117) +++ stable/9/bin/kenv/kenv.c Sat May 26 20:13:24 2012 (r236118) @@ -42,15 +42,17 @@ static int ksetenv(char *, char *); static int kunsetenv(char *); static int hflag = 0; +static int Nflag = 0; static int qflag = 0; static int uflag = 0; +static int vflag = 0; static void usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n", - "usage: kenv [-hq]", - " kenv [-q] variable[=value]", + "usage: kenv [-hNq]", + " kenv [-qv] variable[=value]", " kenv [-q] -u variable"); exit(1); } @@ -64,17 +66,23 @@ main(int argc, char **argv) error = 0; val = NULL; env = NULL; - while ((ch = getopt(argc, argv, "hqu")) != -1) { + while ((ch = getopt(argc, argv, "hNquv")) != -1) { switch (ch) { case 'h': hflag++; break; + case 'N': + Nflag++; + break; case 'q': qflag++; break; case 'u': uflag++; break; + case 'v': + vflag++; + break; default: usage(); } @@ -91,9 +99,9 @@ main(int argc, char **argv) argv++; argc--; } - if (hflag && (env != NULL)) + if ((hflag || Nflag) && env != NULL) usage(); - if ((argc > 0) || (uflag && (env == NULL))) + if (argc > 0 || ((uflag || vflag) && env == NULL)) usage(); if (env == NULL) { error = kdumpenv(); @@ -152,7 +160,10 @@ kdumpenv(void) if (cp == NULL) continue; *cp++ = '\0'; - printf("%s=\"%s\"\n", buf, cp); + if (Nflag) + printf("%s\n", buf); + else + printf("%s=\"%s\"\n", buf, cp); buf = cp; } return (0); @@ -167,7 +178,10 @@ kgetenv(char *env) ret = kenv(KENV_GET, env, buf, sizeof(buf)); if (ret == -1) return (ret); - printf("%s\n", buf); + if (vflag) + printf("%s=\"%s\"\n", env, buf); + else + printf("%s\n", buf); return (0); } From owner-svn-src-all@FreeBSD.ORG Sat May 26 21:02:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F36221065670; Sat, 26 May 2012 21:02:49 +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 D50F58FC15; Sat, 26 May 2012 21:02: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 q4QL2nZL006114; Sat, 26 May 2012 21:02:49 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QL2nhE006111; Sat, 26 May 2012 21:02:49 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205262102.q4QL2nhE006111@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 21:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236119 - in head/sys: conf powerpc/mpc85xx powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 21:02:50 -0000 Author: raj Date: Sat May 26 21:02:49 2012 New Revision: 236119 URL: http://svn.freebsd.org/changeset/base/236119 Log: Move OpenPIC FDT bus glue to a shared location, so that other PowerPC platforms can use it, not only MPC85XX. This is just reorg, no functional changes. Added: head/sys/powerpc/powerpc/openpic_fdt.c - copied unchanged from r236094, head/sys/powerpc/mpc85xx/openpic_fdt.c Deleted: head/sys/powerpc/mpc85xx/openpic_fdt.c Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat May 26 20:13:24 2012 (r236118) +++ head/sys/conf/files.powerpc Sat May 26 21:02:49 2012 (r236119) @@ -132,7 +132,6 @@ powerpc/mpc85xx/isa.c optional mpc85xx powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx powerpc/mpc85xx/nexus.c optional mpc85xx -powerpc/mpc85xx/openpic_fdt.c optional fdt powerpc/mpc85xx/pci_fdt.c optional pci mpc85xx powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_machdep.c optional aim @@ -194,6 +193,7 @@ powerpc/powerpc/mem.c optional mem powerpc/powerpc/mmu_if.m standard powerpc/powerpc/mp_machdep.c optional smp powerpc/powerpc/openpic.c standard +powerpc/powerpc/openpic_fdt.c optional fdt powerpc/powerpc/pic_if.m standard powerpc/powerpc/pmap_dispatch.c standard powerpc/powerpc/platform.c standard Copied: head/sys/powerpc/powerpc/openpic_fdt.c (from r236094, head/sys/powerpc/mpc85xx/openpic_fdt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powerpc/openpic_fdt.c Sat May 26 21:02:49 2012 (r236119, copy of r236094, head/sys/powerpc/mpc85xx/openpic_fdt.c) @@ -0,0 +1,93 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "pic_if.h" + +static int openpic_fdt_probe(device_t); +static int openpic_fdt_attach(device_t); + +static device_method_t openpic_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, openpic_fdt_probe), + DEVMETHOD(device_attach, openpic_fdt_attach), + + /* PIC interface */ + DEVMETHOD(pic_bind, openpic_bind), + DEVMETHOD(pic_config, openpic_config), + DEVMETHOD(pic_dispatch, openpic_dispatch), + DEVMETHOD(pic_enable, openpic_enable), + DEVMETHOD(pic_eoi, openpic_eoi), + DEVMETHOD(pic_ipi, openpic_ipi), + DEVMETHOD(pic_mask, openpic_mask), + DEVMETHOD(pic_unmask, openpic_unmask), + + { 0, 0 }, +}; + +static driver_t openpic_fdt_driver = { + "openpic", + openpic_fdt_methods, + sizeof(struct openpic_softc) +}; + +DRIVER_MODULE(openpic, simplebus, openpic_fdt_driver, openpic_devclass, 0, 0); + +static int +openpic_fdt_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "chrp,open-pic")) + return (ENXIO); + + device_set_desc(dev, OPENPIC_DEVSTR); + return (BUS_PROBE_DEFAULT); +} + +static int +openpic_fdt_attach(device_t dev) +{ + + return (openpic_common_attach(dev, ofw_bus_get_node(dev))); +} From owner-svn-src-all@FreeBSD.ORG Sat May 26 21:05:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6AB0106566C; Sat, 26 May 2012 21:05:11 +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 C09038FC0A; Sat, 26 May 2012 21:05: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 q4QL5BS4006246; Sat, 26 May 2012 21:05:11 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QL5BU5006245; Sat, 26 May 2012 21:05:11 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205262105.q4QL5BU5006245@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 21:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236120 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 21:05:11 -0000 Author: raj Date: Sat May 26 21:05:11 2012 New Revision: 236120 URL: http://svn.freebsd.org/changeset/base/236120 Log: Import EHCI attachment driver for Freescale integrated controller. Obtained from: Freescale, Semihalf. Written by: Michal Dubiel Added: head/sys/dev/usb/controller/ehci_fsl.c (contents, props changed) Added: head/sys/dev/usb/controller/ehci_fsl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/ehci_fsl.c Sat May 26 21:05:11 2012 (r236120) @@ -0,0 +1,423 @@ +/*- + * Copyright (c) 2010-2012 Semihalf + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "opt_platform.h" + +/* + * Register the driver + */ +/* Forward declarations */ +static int fsl_ehci_attach(device_t self); +static int fsl_ehci_detach(device_t self); +static int fsl_ehci_probe(device_t self); + +static device_method_t ehci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fsl_ehci_probe), + DEVMETHOD(device_attach, fsl_ehci_attach), + DEVMETHOD(device_detach, fsl_ehci_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + + { 0, 0 } +}; + +/* kobj_class definition */ +static driver_t ehci_driver = { + "ehci", + ehci_methods, + sizeof(struct ehci_softc) +}; + +static devclass_t ehci_devclass; + +DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); + +/* + * Private defines + */ +#define FSL_EHCI_REG_OFF 0x100 +#define FSL_EHCI_REG_SIZE 0x300 + +/* + * Internal interface registers' offsets. + * Offsets from 0x000 ehci dev space, big-endian access. + */ +enum internal_reg { + SNOOP1 = 0x400, + SNOOP2 = 0x404, + AGE_CNT_THRESH = 0x408, + SI_CTRL = 0x410, + CONTROL = 0x500 +}; + +/* CONTROL register bit flags */ +enum control_flags { + USB_EN = 0x00000004, + UTMI_PHY_EN = 0x00000200, + ULPI_INT_EN = 0x00000001 +}; + +/* SI_CTRL register bit flags */ +enum si_ctrl_flags { + FETCH_32 = 1, + FETCH_64 = 0 +}; + +#define SNOOP_RANGE_2GB 0x1E + +/* + * Operational registers' offsets. + * Offsets from USBCMD register, little-endian access. + */ +enum special_op_reg { + USBMODE = 0x0A8, + PORTSC = 0x084, + ULPI_VIEWPORT = 0x70 +}; + +/* USBMODE register bit flags */ +enum usbmode_flags { + HOST_MODE = 0x3, + DEVICE_MODE = 0x2 +}; + +#define PORT_POWER_MASK 0x00001000 + +/* + * Private methods + */ + +static void +set_to_host_mode(ehci_softc_t *sc) +{ + int tmp; + + tmp = bus_space_read_4(sc->sc_io_tag, sc->sc_io_hdl, USBMODE); + bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, USBMODE, tmp | HOST_MODE); +} + +static void +enable_usb(device_t dev, bus_space_tag_t iot, bus_space_handle_t ioh) +{ + int tmp; + phandle_t node; + char *phy_type; + + phy_type = NULL; + tmp = bus_space_read_4(iot, ioh, CONTROL) | USB_EN; + + node = ofw_bus_get_node(dev); + if ((node != 0) && + (OF_getprop_alloc(node, "phy_type", 1, (void **)&phy_type) > 0)) { + if (strncasecmp(phy_type, "utmi", strlen("utmi")) == 0) + tmp |= UTMI_PHY_EN; + free(phy_type, M_OFWPROP); + } + bus_space_write_4(iot, ioh, CONTROL, tmp); +} + +static void +set_32b_prefetch(bus_space_tag_t iot, bus_space_handle_t ioh) +{ + + bus_space_write_4(iot, ioh, SI_CTRL, FETCH_32); +} + +static void +set_snooping(bus_space_tag_t iot, bus_space_handle_t ioh) +{ + + bus_space_write_4(iot, ioh, SNOOP1, SNOOP_RANGE_2GB); + bus_space_write_4(iot, ioh, SNOOP2, 0x80000000 | SNOOP_RANGE_2GB); +} + +static void +clear_port_power(ehci_softc_t *sc) +{ + int tmp; + + tmp = bus_space_read_4(sc->sc_io_tag, sc->sc_io_hdl, PORTSC); + bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, PORTSC, tmp & ~PORT_POWER_MASK); +} + +/* + * Public methods + */ +static int +fsl_ehci_probe(device_t dev) +{ + + if (((ofw_bus_is_compatible(dev, "fsl-usb2-dr")) == 0) && + ((ofw_bus_is_compatible(dev, "fsl-usb2-mph")) == 0)) + return (ENXIO); + + device_set_desc(dev, "Freescale integrated EHCI controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +fsl_ehci_attach(device_t self) +{ + ehci_softc_t *sc; + int rid; + int err; + bus_space_handle_t ioh; + bus_space_tag_t iot; + + sc = device_get_softc(self); + rid = 0; + + sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = EHCI_MAX_DEVICES; + + if (usb_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) + return (ENOMEM); + + /* Allocate io resource for EHCI */ + sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_io_res == NULL) { + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENXIO); + } + iot = rman_get_bustag(sc->sc_io_res); + + /* + * Set handle to USB related registers subregion used by generic + * EHCI driver + */ + ioh = rman_get_bushandle(sc->sc_io_res); + + err = bus_space_subregion(iot, ioh, FSL_EHCI_REG_OFF, FSL_EHCI_REG_SIZE, + &sc->sc_io_hdl); + if (err != 0) { + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENXIO); + } + + /* Set little-endian tag for use by the generic EHCI driver */ + sc->sc_io_tag = &bs_le_tag; + + /* Allocate irq */ + sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENXIO); + } + + /* Setup interrupt handler */ + err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO, + NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); + if (err) { + device_printf(self, "Could not setup irq, %d\n", err); + sc->sc_intr_hdl = NULL; + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENXIO); + } + + /* Add USB device */ + sc->sc_bus.bdev = device_add_child(self, "usbus", -1); + if (!sc->sc_bus.bdev) { + device_printf(self, "Could not add USB device\n"); + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENOMEM); + } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + + sc->sc_id_vendor = 0x1234; + strlcpy(sc->sc_vendor, "Freescale", sizeof(sc->sc_vendor)); + + /* Enable USB */ + err = ehci_reset(sc); + if (err) { + device_printf(self, "Could not reset the controller\n"); + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENXIO); + } + + enable_usb(self, iot, ioh); + set_snooping(iot, ioh); + set_to_host_mode(sc); + set_32b_prefetch(iot, ioh); + + /* + * If usb subsystem is enabled in U-Boot, port power has to be turned + * off to allow proper discovery of devices during boot up. + */ + clear_port_power(sc); + + /* Set flags */ + sc->sc_flags |= EHCI_SCFLG_DONTRESET | EHCI_SCFLG_NORESTERM; + + err = ehci_init(sc); + if (!err) { + sc->sc_flags |= EHCI_SCFLG_DONEINIT; + err = device_probe_and_attach(sc->sc_bus.bdev); + } + + if (err) { + device_printf(self, "USB init failed err=%d\n", err); + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (EIO); + } + + return (0); +} + +static int +fsl_ehci_detach(device_t self) +{ + + int err; + ehci_softc_t *sc; + + sc = device_get_softc(self); + /* + * only call ehci_detach() after ehci_init() + */ + if (sc->sc_flags & EHCI_SCFLG_DONEINIT) { + ehci_detach(sc); + sc->sc_flags &= ~EHCI_SCFLG_DONEINIT; + } + + /* Disable interrupts that might have been switched on in ehci_init */ + if (sc->sc_io_tag && sc->sc_io_hdl) + bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, EHCI_USBINTR, 0); + + if (sc->sc_irq_res && sc->sc_intr_hdl) { + err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); + if (err) { + device_printf(self, "Could not tear down irq, %d\n", + err); + return (err); + } + sc->sc_intr_hdl = NULL; + } + + if (sc->sc_bus.bdev) { + device_delete_child(self, sc->sc_bus.bdev); + sc->sc_bus.bdev = NULL; + } + + /* During module unload there are lots of children leftover */ + device_delete_children(self); + + if (sc->sc_irq_res) { + bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); + sc->sc_irq_res = NULL; + } + + if (sc->sc_io_res) { + bus_release_resource(self, SYS_RES_MEMORY, 0, sc->sc_io_res); + sc->sc_io_res = NULL; + sc->sc_io_tag = 0; + sc->sc_io_hdl = 0; + } + + return (0); +} + From owner-svn-src-all@FreeBSD.ORG Sat May 26 21:07:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 704AE106566B; Sat, 26 May 2012 21:07:16 +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 5A86E8FC12; Sat, 26 May 2012 21:07: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 q4QL7GeU006361; Sat, 26 May 2012 21:07:16 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QL7Gt0006359; Sat, 26 May 2012 21:07:16 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205262107.q4QL7Gt0006359@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 21:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236121 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 21:07:16 -0000 Author: raj Date: Sat May 26 21:07:15 2012 New Revision: 236121 URL: http://svn.freebsd.org/changeset/base/236121 Log: Import eSDHC driver for Freescale integrated controller. Obtained from: Freescale, Semihalf Written by: Michal Dubiel Added: head/sys/powerpc/mpc85xx/fsl_sdhc.c (contents, props changed) head/sys/powerpc/mpc85xx/fsl_sdhc.h (contents, props changed) Added: head/sys/powerpc/mpc85xx/fsl_sdhc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/mpc85xx/fsl_sdhc.c Sat May 26 21:07:15 2012 (r236121) @@ -0,0 +1,1306 @@ +/*- + * Copyright (c) 2011-2012 Semihalf + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Driver for Freescale integrated eSDHC controller. + * Limitations: + * - No support for multi-block transfers. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "opt_platform.h" + +#include "mmcbr_if.h" + +#include "fsl_sdhc.h" + +#define DEBUG +#undef DEBUG +#ifdef DEBUG +#define DPRINTF(fmt, arg...) printf("DEBUG %s(): " fmt, __FUNCTION__, ##arg) +#else +#define DPRINTF(fmt, arg...) +#endif + + +/***************************************************************************** + * Register the driver + *****************************************************************************/ +/* Forward declarations */ +static int fsl_sdhc_probe(device_t); +static int fsl_sdhc_attach(device_t); +static int fsl_sdhc_detach(device_t); + +static int fsl_sdhc_read_ivar(device_t, device_t, int, uintptr_t *); +static int fsl_sdhc_write_ivar(device_t, device_t, int, uintptr_t); + +static int fsl_sdhc_update_ios(device_t, device_t); +static int fsl_sdhc_request(device_t, device_t, struct mmc_request *); +static int fsl_sdhc_get_ro(device_t, device_t); +static int fsl_sdhc_acquire_host(device_t, device_t); +static int fsl_sdhc_release_host(device_t, device_t); + +static device_method_t fsl_sdhc_methods[] = { + /* device_if */ + DEVMETHOD(device_probe, fsl_sdhc_probe), + DEVMETHOD(device_attach, fsl_sdhc_attach), + DEVMETHOD(device_detach, fsl_sdhc_detach), + + /* Bus interface */ + DEVMETHOD(bus_read_ivar, fsl_sdhc_read_ivar), + DEVMETHOD(bus_write_ivar, fsl_sdhc_write_ivar), + + /* OFW bus interface */ + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + /* mmcbr_if */ + DEVMETHOD(mmcbr_update_ios, fsl_sdhc_update_ios), + DEVMETHOD(mmcbr_request, fsl_sdhc_request), + DEVMETHOD(mmcbr_get_ro, fsl_sdhc_get_ro), + DEVMETHOD(mmcbr_acquire_host, fsl_sdhc_acquire_host), + DEVMETHOD(mmcbr_release_host, fsl_sdhc_release_host), + + {0, 0}, +}; + +/* kobj_class definition */ +static driver_t fsl_sdhc_driver = { + "sdhci", + fsl_sdhc_methods, + sizeof(struct fsl_sdhc_softc) +}; + +static devclass_t fsl_sdhc_devclass; + +DRIVER_MODULE(sdhci, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0); + + +/***************************************************************************** + * Private methods + *****************************************************************************/ +static inline int +read4(struct fsl_sdhc_softc *sc, unsigned int offset) +{ + + return bus_space_read_4(sc->bst, sc->bsh, offset); +} + +static inline void +write4(struct fsl_sdhc_softc *sc, unsigned int offset, int value) +{ + + bus_space_write_4(sc->bst, sc->bsh, offset, value); +} + +static inline void +set_bit(struct fsl_sdhc_softc *sc, uint32_t offset, uint32_t mask) +{ + uint32_t x = read4(sc, offset); + + write4(sc, offset, x | mask); +} + +static inline void +clear_bit(struct fsl_sdhc_softc *sc, uint32_t offset, uint32_t mask) +{ + uint32_t x = read4(sc, offset); + + write4(sc, offset, x & ~mask); +} + +static int +wait_for_bit_clear(struct fsl_sdhc_softc *sc, enum sdhc_reg_off reg, + uint32_t bit) +{ + uint32_t timeout = 10; + uint32_t stat; + + stat = read4(sc, reg); + while (stat & bit) { + if (timeout == 0) { + return (-1); + } + --timeout; + DELAY(1000); + stat = read4(sc, reg); + } + + return (0); +} + +static int +wait_for_free_line(struct fsl_sdhc_softc *sc, enum sdhc_line line) +{ + uint32_t timeout = 100; + uint32_t stat; + + stat = read4(sc, SDHC_PRSSTAT); + while (stat & line) { + if (timeout == 0) { + return (-1); + } + --timeout; + DELAY(1000); + stat = read4(sc, SDHC_PRSSTAT); + } + + return (0); +} + +static uint32_t +get_platform_clock(struct fsl_sdhc_softc *sc) +{ + device_t self, parent; + phandle_t node; + uint32_t clock; + + self = sc->self; + node = ofw_bus_get_node(self); + + /* Get sdhci node properties */ + if((OF_getprop(node, "clock-frequency", (void *)&clock, + sizeof(clock)) <= 0) || (clock == 0)) { + + /* + * Trying to get clock from parent device (soc) if correct + * clock cannot be acquired from sdhci node. + */ + parent = device_get_parent(self); + node = ofw_bus_get_node(parent); + + /* Get soc properties */ + if ((OF_getprop(node, "bus-frequency", (void *)&clock, + sizeof(clock)) <= 0) || (clock == 0)) { + device_printf(self,"Cannot acquire correct sdhci " + "frequency from DTS.\n"); + + return (0); + } + } + + DPRINTF("Acquired clock: %d from DTS\n", clock); + + return (clock); +} + +/** + * Set clock driving card. + * @param sc + * @param clock Desired clock frequency in Hz + */ +static void +set_clock(struct fsl_sdhc_softc *sc, uint32_t clock) +{ + uint32_t base_clock; + uint32_t divisor, prescaler = 1; + uint32_t round = 0; + + if (clock == sc->slot.clock) + return; + + if (clock == 0) { + clear_bit(sc, SDHC_SYSCTL, MASK_CLOCK_CONTROL | SYSCTL_PEREN | + SYSCTL_HCKEN | SYSCTL_IPGEN); + return; + } + + base_clock = sc->platform_clock; + round = base_clock & 0x2; + base_clock >>= 2; + base_clock += round; + round = 0; + + /* SD specification 1.1 doesn't allow frequences above 50 MHz */ + if (clock > FSL_SDHC_MAX_CLOCK) + clock = FSL_SDHC_MAX_CLOCK; + + /* + * divisor = ceil(base_clock / clock) + * TODO: Reconsider symmetric rounding here instead of ceiling. + */ + divisor = (base_clock + clock - 1) / clock; + + while (divisor > 16) { + round = divisor & 0x1; + divisor >>= 1; + + prescaler <<= 1; + } + divisor += round - 1; + + /* Turn off the clock. */ + clear_bit(sc, SDHC_SYSCTL, MASK_CLOCK_CONTROL); + + /* Write clock settings. */ + set_bit(sc, SDHC_SYSCTL, (prescaler << SHIFT_SDCLKFS) | + (divisor << SHIFT_DVS)); + + /* + * Turn on clocks. + * TODO: This actually disables clock automatic gating off feature of + * the controller which eventually should be enabled but as for now + * it prevents controller from generating card insertion/removal + * interrupts correctly. + */ + set_bit(sc, SDHC_SYSCTL, SYSCTL_PEREN | SYSCTL_HCKEN | SYSCTL_IPGEN); + + sc->slot.clock = clock; + + DPRINTF("given clock = %d, computed clock = %d\n", clock, + (base_clock / prescaler) / (divisor + 1)); +} + +static inline void +send_80_clock_ticks(struct fsl_sdhc_softc *sc) +{ + int err; + + err = wait_for_free_line(sc, SDHC_CMD_LINE | SDHC_DAT_LINE); + if (err != 0) { + device_printf(sc->self, "Can't acquire data/cmd lines\n"); + return; + } + + set_bit(sc, SDHC_SYSCTL, SYSCTL_INITA); + err = wait_for_bit_clear(sc, SDHC_SYSCTL, SYSCTL_INITA); + if (err != 0) { + device_printf(sc->self, "Can't send 80 clocks to the card.\n"); + } +} + +static void +set_bus_width(struct fsl_sdhc_softc *sc, enum mmc_bus_width width) +{ + + DPRINTF("setting bus width to %d\n", width); + switch (width) { + case bus_width_1: + set_bit(sc, SDHC_PROCTL, DTW_1); + break; + case bus_width_4: + set_bit(sc, SDHC_PROCTL, DTW_4); + break; + case bus_width_8: + set_bit(sc, SDHC_PROCTL, DTW_8); + break; + default: + device_printf(sc->self, "Unsupported bus width\n"); + } +} + +static void +reset_controller_all(struct fsl_sdhc_softc *sc) +{ + uint32_t count = 5; + + set_bit(sc, SDHC_SYSCTL, SYSCTL_RSTA); + while (read4(sc, SDHC_SYSCTL) & SYSCTL_RSTA) { + DELAY(FSL_SDHC_RESET_DELAY); + --count; + if (count == 0) { + device_printf(sc->self, + "Can't reset the controller\n"); + return; + } + } +} + +static void +reset_controller_dat_cmd(struct fsl_sdhc_softc *sc) +{ + int err; + + set_bit(sc, SDHC_SYSCTL, SYSCTL_RSTD | SYSCTL_RSTC); + err = wait_for_bit_clear(sc, SDHC_SYSCTL, SYSCTL_RSTD | SYSCTL_RSTC); + if (err != 0) { + device_printf(sc->self, "Can't reset data & command part!\n"); + return; + } +} + +static void +init_controller(struct fsl_sdhc_softc *sc) +{ + + /* Enable interrupts. */ +#ifdef FSL_SDHC_NO_DMA + write4(sc, SDHC_IRQSTATEN, MASK_IRQ_ALL & ~IRQ_DINT & ~IRQ_DMAE); + write4(sc, SDHC_IRQSIGEN, MASK_IRQ_ALL & ~IRQ_DINT & ~IRQ_DMAE); +#else + write4(sc, SDHC_IRQSTATEN, MASK_IRQ_ALL & ~IRQ_BRR & ~IRQ_BWR); + write4(sc, SDHC_IRQSIGEN, MASK_IRQ_ALL & ~IRQ_BRR & ~IRQ_BWR); + + /* Write DMA address */ + write4(sc, SDHC_DSADDR, sc->dma_phys); + + /* Enable snooping and fix for AHB2MAG bypass. */ + write4(sc, SDHC_DCR, DCR_SNOOP | DCR_AHB2MAG_BYPASS); +#endif + /* Set data timeout. */ + set_bit(sc, SDHC_SYSCTL, 0xe << SHIFT_DTOCV); + + /* Set water-mark levels (FIFO buffer size). */ + write4(sc, SDHC_WML, (FSL_SDHC_FIFO_BUF_WORDS << 16) | + FSL_SDHC_FIFO_BUF_WORDS); +} + +static void +init_mmc_host_struct(struct fsl_sdhc_softc *sc) +{ + struct mmc_host *host = &sc->mmc_host; + + /* Clear host structure. */ + bzero(host, sizeof(struct mmc_host)); + + /* Calculate minimum and maximum operating frequencies. */ + host->f_min = sc->platform_clock / FSL_SDHC_MAX_DIV; + host->f_max = FSL_SDHC_MAX_CLOCK; + + /* Set operation conditions (voltage). */ + host->host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; + + /* Set additional host controller capabilities. */ + host->caps = MMC_CAP_4_BIT_DATA; + + /* Set mode. */ + host->mode = mode_sd; +} + +static void +card_detect_task(void *arg, int pending) +{ + struct fsl_sdhc_softc *sc = (struct fsl_sdhc_softc *)arg; + int err; + int insert; + + insert = read4(sc, SDHC_PRSSTAT) & PRSSTAT_CINS; + + mtx_lock(&sc->mtx); + + if (insert) { + if (sc->child != NULL) { + mtx_unlock(&sc->mtx); + return; + } + + sc->child = device_add_child(sc->self, "mmc", -1); + if (sc->child == NULL) { + device_printf(sc->self, "Couldn't add MMC bus!\n"); + mtx_unlock(&sc->mtx); + return; + } + + /* Initialize MMC bus host structure. */ + init_mmc_host_struct(sc); + device_set_ivars(sc->child, &sc->mmc_host); + + } else { + if (sc->child == NULL) { + mtx_unlock(&sc->mtx); + return; + } + } + + mtx_unlock(&sc->mtx); + + if (insert) { + if ((err = device_probe_and_attach(sc->child)) != 0) { + device_printf(sc->self, "MMC bus failed on probe " + "and attach! error %d\n", err); + device_delete_child(sc->self, sc->child); + sc->child = NULL; + } + } else { + if (device_delete_child(sc->self, sc->child) != 0) + device_printf(sc->self, "Could not delete MMC bus!\n"); + sc->child = NULL; + } +} + +static void +card_detect_delay(void *arg) +{ + struct fsl_sdhc_softc *sc = arg; + + taskqueue_enqueue(taskqueue_swi_giant, &sc->card_detect_task); +} + +static void +finalize_request(struct fsl_sdhc_softc *sc) +{ + + DPRINTF("finishing request %x\n", sc->request); + + sc->request->done(sc->request); + sc->request = NULL; +} + +/** + * Read response from card. + * @todo Implement Auto-CMD responses being held in R3 for multi-block xfers. + * @param sc + */ +static void +get_response(struct fsl_sdhc_softc *sc) +{ + struct mmc_command *cmd = sc->request->cmd; + int i; + uint32_t val; + uint8_t ext = 0; + + if (cmd->flags & MMC_RSP_136) { + /* CRC is stripped, need to shift one byte left. */ + for (i = 0; i < 4; i++) { + val = read4(sc, SDHC_CMDRSP0 + i * 4); + cmd->resp[3 - i] = (val << 8) + ext; + ext = val >> 24; + } + } else { + cmd->resp[0] = read4(sc, SDHC_CMDRSP0); + } +} + +#ifdef FSL_SDHC_NO_DMA +/** + * Read all content of a fifo buffer. + * @warning Assumes data buffer is 32-bit aligned. + * @param sc + */ +static void +read_block_pio(struct fsl_sdhc_softc *sc) +{ + struct mmc_data *data = sc->request->cmd->data; + size_t left = min(FSL_SDHC_FIFO_BUF_SIZE, data->len); + uint8_t *buf = data->data; + uint32_t word; + + buf += sc->data_offset; + bus_space_read_multi_4(sc->bst, sc->bsh, SDHC_DATPORT, (uint32_t *)buf, + left >> 2); + + sc->data_offset += left; + + /* Handle 32-bit unaligned size case. */ + left &= 0x3; + if (left > 0) { + buf = (uint8_t *)data->data + (sc->data_offset & ~0x3); + word = read4(sc, SDHC_DATPORT); + while (left > 0) { + *(buf++) = word; + word >>= 8; + --left; + } + } +} + +/** + * Write a fifo buffer. + * @warning Assumes data buffer size is 32-bit aligned. + * @param sc + */ +static void +write_block_pio(struct fsl_sdhc_softc *sc) +{ + struct mmc_data *data = sc->request->cmd->data; + size_t left = min(FSL_SDHC_FIFO_BUF_SIZE, data->len); + uint8_t *buf = data->data; + uint32_t word = 0; + + DPRINTF("sc->data_offset %d\n", sc->data_offset); + + buf += sc->data_offset; + bus_space_write_multi_4(sc->bst, sc->bsh, SDHC_DATPORT, (uint32_t *)buf, + left >> 2); + + sc->data_offset += left; + + /* Handle 32-bit unaligned size case. */ + left &= 0x3; + if (left > 0) { + buf = (uint8_t *)data->data + (sc->data_offset & ~0x3); + while (left > 0) { + word += *(buf++); + word <<= 8; + --left; + } + write4(sc, SDHC_DATPORT, word); + } +} + +static void +pio_read_transfer(struct fsl_sdhc_softc *sc) +{ + + while (read4(sc, SDHC_PRSSTAT) & PRSSTAT_BREN) { + read_block_pio(sc); + + /* + * TODO: should we check here whether data_offset >= data->len? + */ + } +} + +static void +pio_write_transfer(struct fsl_sdhc_softc *sc) +{ + + while (read4(sc, SDHC_PRSSTAT) & PRSSTAT_BWEN) { + write_block_pio(sc); + + /* + * TODO: should we check here whether data_offset >= data->len? + */ + } +} +#endif /* FSL_SDHC_USE_DMA */ + +static inline void +handle_command_intr(struct fsl_sdhc_softc *sc, uint32_t irq_stat) +{ + struct mmc_command *cmd = sc->request->cmd; + + /* Handle errors. */ + if (irq_stat & IRQ_CTOE) { + cmd->error = MMC_ERR_TIMEOUT; + } else if (irq_stat & IRQ_CCE) { + cmd->error = MMC_ERR_BADCRC; + } else if (irq_stat & (IRQ_CEBE | IRQ_CIE)) { + cmd->error = MMC_ERR_FIFO; + } + + if (cmd->error) { + device_printf(sc->self, "Error interrupt occured\n"); + reset_controller_dat_cmd(sc); + return; + } + + if (sc->command_done) + return; + + if (irq_stat & IRQ_CC) { + sc->command_done = 1; + + if (cmd->flags & MMC_RSP_PRESENT) + get_response(sc); + } +} + +static inline void +handle_data_intr(struct fsl_sdhc_softc *sc, uint32_t irq_stat) +{ + struct mmc_command *cmd = sc->request->cmd; + + /* Handle errors. */ + if (irq_stat & IRQ_DTOE) { + cmd->error = MMC_ERR_TIMEOUT; + } else if (irq_stat & (IRQ_DCE | IRQ_DEBE)) { + cmd->error = MMC_ERR_BADCRC; + } else if (irq_stat & IRQ_ERROR_DATA_MASK) { + cmd->error = MMC_ERR_FAILED; + } + + if (cmd->error) { + device_printf(sc->self, "Error interrupt occured\n"); + sc->data_done = 1; + reset_controller_dat_cmd(sc); + return; + } + + if (sc->data_done) + return; + +#ifdef FSL_SDHC_NO_DMA + if (irq_stat & IRQ_BRR) { + pio_read_transfer(sc); + } + + if (irq_stat & IRQ_BWR) { + pio_write_transfer(sc); + } +#else + if (irq_stat & IRQ_DINT) { + struct mmc_data *data = sc->request->cmd->data; + + /* Synchronize DMA. */ + if (data->flags & MMC_DATA_READ) { + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_POSTREAD); + memcpy(data->data, sc->dma_mem, data->len); + } else { + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_POSTWRITE); + } + + /* + * TODO: For multiple block transfers, address of dma memory + * in DSADDR register should be set to the beginning of the + * segment here. Also offset to data pointer should be handled. + */ + } +#endif + + if (irq_stat & IRQ_TC) + sc->data_done = 1; +} + +static void +interrupt_handler(void *arg) +{ + struct fsl_sdhc_softc *sc = (struct fsl_sdhc_softc *)arg; + uint32_t irq_stat; + + mtx_lock(&sc->mtx); + + irq_stat = read4(sc, SDHC_IRQSTAT); + + /* Card interrupt. */ + if (irq_stat & IRQ_CINT) { + DPRINTF("Card interrupt recievied\n"); + + } + + /* Card insertion interrupt. */ + if (irq_stat & IRQ_CINS) { + clear_bit(sc, SDHC_IRQSIGEN, IRQ_CINS); + clear_bit(sc, SDHC_IRQSTATEN, IRQ_CINS); + set_bit(sc, SDHC_IRQSIGEN, IRQ_CRM); + set_bit(sc, SDHC_IRQSTATEN, IRQ_CRM); + + callout_reset(&sc->card_detect_callout, hz / 2, + card_detect_delay, sc); + } + + /* Card removal interrupt. */ + if (irq_stat & IRQ_CRM) { + clear_bit(sc, SDHC_IRQSIGEN, IRQ_CRM); + clear_bit(sc, SDHC_IRQSTATEN, IRQ_CRM); + set_bit(sc, SDHC_IRQSIGEN, IRQ_CINS); + set_bit(sc, SDHC_IRQSTATEN, IRQ_CINS); + + callout_stop(&sc->card_detect_callout); + taskqueue_enqueue(taskqueue_swi_giant, &sc->card_detect_task); + } + + /* Handle request interrupts. */ + if (sc->request) { + handle_command_intr(sc, irq_stat); + handle_data_intr(sc, irq_stat); + + /* + * Finalize request when transfer is done successfully + * or was interrupted due to error. + */ + if ((sc->data_done && sc->command_done) || + (sc->request->cmd->error)) + finalize_request(sc); + } + + /* Clear status register. */ + write4(sc, SDHC_IRQSTAT, irq_stat); + + mtx_unlock(&sc->mtx); +} + +#ifndef FSL_SDHC_NO_DMA +static void +dma_get_phys_addr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + + if (error != 0) + return; + + /* Get first segment's physical address. */ + *(bus_addr_t *)arg = segs->ds_addr; +} + +static int +init_dma(struct fsl_sdhc_softc *sc) +{ + device_t self = sc->self; + int err; + + err = bus_dma_tag_create(bus_get_dma_tag(self), + FSL_SDHC_DMA_BLOCK_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR, NULL, NULL, FSL_SDHC_DMA_BLOCK_SIZE, 1, + FSL_SDHC_DMA_BLOCK_SIZE, BUS_DMA_ALLOCNOW, NULL, NULL, + &sc->dma_tag); + + if (err) { + device_printf(self, "Could not create DMA tag!\n"); + return (-1); + } + + err = bus_dmamem_alloc(sc->dma_tag, (void **)&(sc->dma_mem), + BUS_DMA_NOWAIT | BUS_DMA_NOCACHE, &sc->dma_map); + if (err) { + device_printf(self, "Could not allocate DMA memory!\n"); + goto fail1; + } + + err = bus_dmamap_load(sc->dma_tag, sc->dma_map, (void *)sc->dma_mem, + FSL_SDHC_DMA_BLOCK_SIZE, dma_get_phys_addr, &sc->dma_phys, 0); + if (err) { + device_printf(self, "Could not load DMA map!\n"); + goto fail2; + } + + return (0); + +fail2: + bus_dmamem_free(sc->dma_tag, sc->dma_mem, sc->dma_map); +fail1: + bus_dma_tag_destroy(sc->dma_tag); + + return (-1); +} +#endif /* FSL_SDHC_NO_DMA */ + +static uint32_t +set_xfertyp_register(const struct mmc_command *cmd) +{ + uint32_t xfertyp = 0; + + /* Set command index. */ + xfertyp |= cmd->opcode << CMDINX_SHIFT; + + /* Set command type. */ + if (cmd->opcode == MMC_STOP_TRANSMISSION) + xfertyp |= CMDTYP_ABORT; + + /* Set data preset select. */ + if (cmd->data) { + xfertyp |= XFERTYP_DPSEL; + + /* Set transfer direction. */ + if (cmd->data->flags & MMC_DATA_READ) + xfertyp |= XFERTYP_DTDSEL; + } + + /* Set command index check. */ + if (cmd->flags & MMC_RSP_OPCODE) + xfertyp |= XFERTYP_CICEN; + + /* Set command CRC check. */ + if (cmd->flags & MMC_RSP_CRC) + xfertyp |= XFERTYP_CCCEN; + + /* Set response type */ + if (!(cmd->flags & MMC_RSP_PRESENT)) + xfertyp |= RSPTYP_NONE; + else if (cmd->flags & MMC_RSP_136) + xfertyp |= RSPTYP_136; + else if (cmd->flags & MMC_RSP_BUSY) + xfertyp |= RSPTYP_48_BUSY; + else + xfertyp |= RSPTYP_48; + +#ifndef FSL_SDHC_NO_DMA + /* Enable DMA */ + xfertyp |= XFERTYP_DMAEN; +#endif + + return (xfertyp); +} + +static uint32_t +set_blkattr_register(const struct mmc_data *data) +{ + + if (data->len <= FSL_SDHC_MAX_BLOCK_SIZE) { + /* One block transfer. */ + return (BLKATTR_BLOCK_COUNT(1) | ((data->len) & + BLKATTR_BLKSZE)); + } + + /* TODO: Write code here for multi-block transfers. */ + return (0); +} + +/** + * Initiate data transfer. Interrupt handler will finalize it. + * @todo Implement multi-block transfers. + * @param sc + * @param cmd + */ +static int +start_data(struct fsl_sdhc_softc *sc, struct mmc_data *data) +{ + uint32_t reg; + + if ((uint32_t)data->data & 0x3) { + device_printf(sc->self, "32-bit unaligned data pointer in " + "request\n"); + return (-1); + } + + sc->data_done = 0; + +#ifdef FSL_SDHC_NO_DMA + sc->data_ptr = data->data; + sc->data_offset = 0; +#else + /* Write DMA address register. */ + write4(sc, SDHC_DSADDR, sc->dma_phys); + + /* Synchronize DMA. */ + if (data->flags & MMC_DATA_READ) { + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_PREREAD); + } else { + memcpy(sc->dma_mem, data->data, data->len); + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_PREWRITE); + } +#endif + /* Set block size and count. */ + reg = set_blkattr_register(data); + if (reg == 0) { + device_printf(sc->self, "Requested unsupported multi-block " + "transfer.\n"); + return (-1); + } + write4(sc, SDHC_BLKATTR, reg); + + return (0); +} + +static int +start_command(struct fsl_sdhc_softc *sc, struct mmc_command *cmd) +{ + struct mmc_request *req = sc->request; + uint32_t mask; + uint32_t xfertyp; + int err; + + DPRINTF("opcode %d, flags 0x%08x\n", cmd->opcode, cmd->flags); + DPRINTF("PRSSTAT = 0x%08x\n", read4(sc, SDHC_PRSSTAT)); + + sc->command_done = 0; + + cmd->error = MMC_ERR_NONE; + + /* TODO: should we check here for card presence and clock settings? */ + + /* Always wait for free CMD line. */ + mask = SDHC_CMD_LINE; + /* Wait for free DAT if we have data or busy signal. */ + if (cmd->data || (cmd->flags & MMC_RSP_BUSY)) + mask |= SDHC_DAT_LINE; + /* We shouldn't wait for DAT for stop commands. */ + if (cmd == req->stop) + mask &= ~SDHC_DAT_LINE; + err = wait_for_free_line(sc, mask); + if (err != 0) { + device_printf(sc->self, "Controller never released inhibit " + "bit(s).\n"); + reset_controller_dat_cmd(sc); + cmd->error = MMC_ERR_FAILED; + sc->request = NULL; + req->done(req); + return (-1); + } + + xfertyp = set_xfertyp_register(cmd); + + if (cmd->data != NULL) { + err = start_data(sc, cmd->data); + if (err != 0) { + device_printf(sc->self, + "Data transfer request failed\n"); + reset_controller_dat_cmd(sc); + cmd->error = MMC_ERR_FAILED; + sc->request = NULL; + req->done(req); + return (-1); + } + } + + write4(sc, SDHC_CMDARG, cmd->arg); + write4(sc, SDHC_XFERTYP, xfertyp); + + DPRINTF("XFERTYP = 0x%08x\n", xfertyp); + DPRINTF("CMDARG = 0x%08x\n", cmd->arg); + + return (0); +} + +#ifdef DEBUG +static void +dump_registers(struct fsl_sdhc_softc *sc) +{ + printf("PRSSTAT = 0x%08x\n", read4(sc, SDHC_PRSSTAT)); + printf("PROCTL = 0x%08x\n", read4(sc, SDHC_PROCTL)); + printf("PMUXCR = 0x%08x\n", ccsr_read4(OCP85XX_PMUXCR)); + printf("HOSTCAPBLT = 0x%08x\n", read4(sc, SDHC_HOSTCAPBLT)); + printf("IRQSTAT = 0x%08x\n", read4(sc, SDHC_IRQSTAT)); + printf("IRQSTATEN = 0x%08x\n", read4(sc, SDHC_IRQSTATEN)); + printf("IRQSIGEN = 0x%08x\n", read4(sc, SDHC_IRQSIGEN)); + printf("WML = 0x%08x\n", read4(sc, SDHC_WML)); + printf("DSADDR = 0x%08x\n", read4(sc, SDHC_DSADDR)); + printf("XFERTYP = 0x%08x\n", read4(sc, SDHC_XFERTYP)); + printf("ECMCR = 0x%08x\n", ccsr_read4(OCP85XX_ECMCR)); + printf("DCR = 0x%08x\n", read4(sc, SDHC_DCR)); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat May 26 21:30:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D7241065740; Sat, 26 May 2012 21:30:19 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2368FC17; Sat, 26 May 2012 21:30:19 +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 q4QLUJkW007300; Sat, 26 May 2012 21:30:19 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QLUJCF007298; Sat, 26 May 2012 21:30:19 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201205262130.q4QLUJCF007298@svn.freebsd.org> From: Warren Block Date: Sat, 26 May 2012 21:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236122 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 21:30:19 -0000 Author: wblock (doc committer) Date: Sat May 26 21:30:18 2012 New Revision: 236122 URL: http://svn.freebsd.org/changeset/base/236122 Log: Wording corrections and simplifications. Approved by: gjb (mentor) MFC after: 3 days Modified: head/share/man/man4/vlan.4 Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Sat May 26 21:07:15 2012 (r236121) +++ head/share/man/man4/vlan.4 Sat May 26 21:30:18 2012 (r236122) @@ -79,16 +79,16 @@ to a properly configured switch port. The VLAN tag should match one of those set up in the switched network. .Pp -Initially .Nm -assumes the same minimum length for tagged and untagged frames. -This mode is selected by the +initially assumes the same minimum length for tagged and untagged frames. +This mode is selected by setting the .Xr sysctl 8 variable .Va net.link.vlan.soft_pad -set to 0 (default). -However, there are network devices that fail to adjust frame length, -should it fall below the allowed minimum due to untagging. +to 0 +.Pq default . +However, there are network devices that fail to adjust frame length +when it falls below the allowed minimum due to untagging. Such devices should be able to interoperate with .Nm after changing the value of @@ -97,7 +97,7 @@ to 1. In the latter mode, .Nm will pad short frames before tagging them -so that their length stays not less than the minimum value +so that their length is not less than the minimum value after untagging by the non-compliant devices. .Sh HARDWARE The @@ -111,7 +111,7 @@ receive and transmit long frames (up to header and FCS). The capabilities may be user-controlled by the respective parameters to .Xr ifconfig 8 , -.Cm vlanhwtag +.Cm vlanhwtag , and .Cm vlanmtu . However, a physical interface is not obliged to react to them: @@ -119,8 +119,8 @@ It may have either capability enabled pe a way to turn it off. The whole issue is very specific to a particular device and its driver. .Pp -By now, the list of physical interfaces able of full VLAN processing -in the hardware is limited to the following devices: +At present, physical interfaces capable of full VLAN processing +in the hardware is limited to these devices: .Xr ae 4 , .Xr age 4 , .Xr alc 4 , @@ -146,11 +146,10 @@ in the hardware is limited to the follow and .Xr vge 4 . .Pp -The rest of the Ethernet interfaces can run -VLANs using software emulation in the +Other Ethernet interfaces can run VLANs using software emulation in the .Nm driver. -However, some of them lack the capability +However, some lack the capability of transmitting and receiving long frames. Assigning such an interface as the parent to .Nm @@ -163,9 +162,8 @@ connectivity problems due to massive, in .Xr icmp 4 filtering that breaks the Path MTU Discovery mechanism. .Pp -The following interfaces support long frames for -.Nm -natively: +These interfaces natively support long frames for +.Nm : .Xr axe 4 , .Xr bfe 4 , .Xr cas 4 , From owner-svn-src-all@FreeBSD.ORG Sat May 26 21:49:48 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 74A93106566B; Sat, 26 May 2012 21:49:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id B801C8FC0C; Sat, 26 May 2012 21:49:47 +0000 (UTC) Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4QLnjlM017904; Sun, 27 May 2012 07:49:45 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail14.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4QLnaMD028997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 27 May 2012 07:49:36 +1000 Date: Sun, 27 May 2012 07:49:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <20120526164927.GU2358@deviant.kiev.zoral.com.ua> Message-ID: <20120527043827.W3357@besplex.bde.org> References: <201205252150.q4PLomFk035064@svn.freebsd.org> <20120526173233.A885@besplex.bde.org> <20120526164927.GU2358@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Ed Schouten , rwatson@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org, jonathan@FreeBSD.org Subject: Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 21:49:48 -0000 On Sat, 26 May 2012, Konstantin Belousov wrote: > On Sat, May 26, 2012 at 10:21:25PM +1000, Bruce Evans wrote: Please don't quote the whole thing. >> On Fri, 25 May 2012, Ed Schouten wrote: >> >>> Log: >>> Remove use of non-ISO-C integer types from system call tables. >>> >>> These files already use ISO-C-style integer types, so make them less >>> inconsistent by preferring the standard types. >> >> These should actually be Linux types l_foo_t. ISO-C-style integer types >> [... but only in the low-level linux headers where this is possible] >>> Modified: head/sys/amd64/linux32/syscalls.master >>> ============================================================================== >>> --- head/sys/amd64/linux32/syscalls.master Fri May 25 21:12:24 2012 >>> (r236025) >>> +++ head/sys/amd64/linux32/syscalls.master Fri May 25 21:50:48 2012 >>> (r236026) >>> @@ -54,8 +54,8 @@ >>> l_int mode); } >>> 9 AUE_LINK STD { int linux_link(char *path, char *to); } >>> 10 AUE_UNLINK STD { int linux_unlink(char *path); } >>> -11 AUE_EXECVE STD { int linux_execve(char *path, u_int32_t >>> *argp, \ >>> - u_int32_t *envp); } >>> +11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t >>> *argp, \ >>> + uint32_t *envp); } >> >> argp and envp aren't uintany_t * in either Linux or FreeBSD. They start as >> "char * const *". There is no Linux type for an indirect "char *", and one >> was hacked up here by pretending that "char *" is u_int32_t (it is actually >> just 32 bits). Using l_caddr_t seems to be the best hack available (since >> by abusing l_caddr_t, we know that it is actually char *). >> >> The `const' in the type for argp and envp is further from being handled >> correctly. Most or all syscall.master's just type-pun it away. Similarly >> for "const char *path". >> >> All the non-indirect "char *"s for pathnames and other things seem to be >> completely wrong on amd64 too. These pointers start as 32 bits, and it >> takes more than a bad type pun to turn then into kernel 64-bit pointers. >> The magic for this seems to be: >> - all args are converted to 64 bits (by zero-extension?) at a low level >>... > The 'low level' AKA magic happens in several *_fetch_syscall_args() > functions. For both linux32 and freebsd32, the magic code automatically > zero-extends the arguments into 64bit entities. Linux passes args in > registers, while FreeBSD uses words on stack. Actually, the amd64 linux_fetch32_fetch_syscall_args() just copies from 64-bit registers frame->tf_r* to 64-bit sa->args[*]. I can't see how this gives anything except garbage in the top bits. Is there magic in the switch to 64-bit mode that sets the top bits? Anyway, sign extension would give garbage for unsigned args, and zero-extension would give garbage for negative signed args. The amd64 ia32_fetch_syscall_args() is quite different. Now the args stack as 32 bits on the stack, so normal C accesses naturally extend them when assigning them to 64-bit memory sa->args[*]. The stack is in user space, so normal C accesses are unavailable at first. sa->code is read using fuword32(), which gives zero-extension. Then the stack is copied in and normal C accesses become available. Finally, all args are copied from 32-bit args[i] to 64-bit sa->args[i]. args[i] is u_int32_t, so this indeed gives zero-extension. But args[i] is signed (int64_t), since it is register_t which is bogusly signed. So for negative args, overflow occurs when int32_t accessed as u_int32_t via the type pun in the declaration of args[]. There is no further overflow when the result is assigned to sa->args[i], but the result is wrong (no longer negative). It takes further magic to undo this. BTW, struct syscall_args has bad names and formatting. It is missing indentation and sa_prefixes for all its members. These bugs are missing for the 64-bit register side of the copy (struct trapframe). > The types in the syscalls.master prototype should be in fact selected > to fit the in-kernel prototypes for the functions implementing the syscalls, No, they have to match the types actually passed so as to ignore any garbage bits created by previous magic steps. The lower levels cannot do a correct conversion since they don't have access to the type info generated from syscalls.master, and they shouldn't do a correct conversion since this is easier to do later -- only the functions implementing the syscalls can do it easily. The type info is mostly encoded in syscall args structs for the individual functions, in a way that the conversions only need to access fields in the structs to do the conversions (this only works for simple conversions but handles ignoring any leading and trailing bits up to reasonably boundaries, since this is needed for endianness handling). > esp. for NOPROTO cases, and not to the low-level layout of the syscall > entry data. Of course the layout must match the one actually used by the function implementing the syscall. For NOPROTO cases, this is given by sys/sysproto.h, not the syscall's C source code. This cannot use l_foo of course. But this is fragile, and there are only 41 NOPROTO cases, mostly for the simplest syscalls. It would be easy to wrap all of these so as never to use NOPROTO. It is also easy to check 41 cases. I checked them all and only found a few harmless errors, where only differences with kern/syscalls.master are counted as errors. These are mainly u_ints for ffs and perhaps a couple of ints for pid_t and vice versa. Anyway, it is correct to not use l_foo in the NOPROTO cases. compat/freebsd32/syscalls.master has 253 NOPROTO cases. Now too many to wrap or check easily. There are lots of pointer args which depend on magic. mknod() has a dev arg that is only int, but there has been discussion recently of bloating dev_t to 64 bits. One of the new CAP syscalls is more surely broken than the other, since it is NOPROTO but has a uint64_t arg. fcntl()'s 3rd arg is bogusly declared as long to match kern/sysalls.master. According to fcntl(3), the 3rd arg is actually int. Zero-extension of the int followed by not convering the 64-bit sa->argsp[i] back to int32_t via the fcntl_args struct might cause problems, but apparently this arg is rarely negative. Lots of NOPROTO entries are bug for bug compatible with kern/syscalls.master. It's weird that setreuid() is declared as taking int ids in the native and ia32 versions but as taking uid_t ids in the linux32 version. linux32 had to be more careful about uids because it also has 16-bit ones. >> - the args struct for a pathname is >> [left padding]; char *; [right padding]; >> Since the char * is misdeclared, the explicit padding is null, but the >> layout of the args struct is correct because the wrong arg type in it >> supplies equivalent padding (extra 32 bits on the right). >> > The arg struct layout is irrelevant, since fetch_syscall_args() functions > perform the needed translation from process ABI to kernel ABI. No, these functions cannot and do not do more than a simple translation, since they don't know the arg's actual size or signedness. They do basically the endianness part of the args struct (add right padding for little-endian). They messes up extra bits mainly for the top 32. The arg should have been promoted to 32 bits in userland earlier, but it is unclear of 32-bit ABIs require the extra bits to be non-garbage. When an arg is say int16_t, gcc does sign-extension in callers, but then doesn't trust this to have occured in callees, and does extra work to demote to the original type and then often to promote back to the 32-bit type. The args struct arranges for the corresponding demotion and repromotion when the callee is the kernel, provided the arg types are actually declared correctly. Now the demotion is almost free, by the type pun of ignoring unwanted bits in the args struct. > I think that the padding could be completely eliminated for translated > ABI, but since it is easier to reuse makesyscalls.sh instead of creating > ABI-specific script, and since there is quite non-trivial count of NOPROTO > declarations that just match the native-ABI syscall handlers, it is better > not to start that. It would just be slower without reorganizing all syscall layers. You would need a large switch statement with all syscalls that need special translation, or an extra layer of syscall functions. There are already too many layers of syscall functions. FreeBSD started with 1 or 2 more layers than Linux. Now it has 4 or 5 more layers for many important syscalls :-(. The second lowest layer was syscall(), and it much slower than Linux, since it has to fetch the args from the stack where Linux has most args in registers. With Linux-style layering, you can go straight from the lowest level to the individual syscall level (and shouldn't have sys_foo(), and a couple of kern_foo() layers between that and the actual work). Args are passed in registers and for the i386 ABI only to be pushed onto the stack to convert say lseek(2) into lseek(9). But given that FreeBSD lseek(9) wants to use an args struct, you shouldn't do extra work to pack the args struct. Leaving it sparse doesn't save cost much time unpacking it in read(9). >> - the "char *" in the args struct is not actually a char *, and is unusable >> directly in the kernel. However, it is only used in copyin() and >> copyout(), where it becomes a user address and works correctly. (An >> older bug in this that the user address for copy*() is declared as >> "void *". "void *" means a kernel pointer. The type of a user >> address should be more like vm_offset_t, but even that needs logical >> translation for linux32). >> > It is char *, but in different address space. Linux-style type qualifiers > like __usermode would be appropriate there (remember far/near ?), but > we do not have static checkers that do understand the difference. Of course it works for linux32, but this depends on the static checkers being stupid and on the user address space not being larger than the kernel address space (or at least on kernel pointers being large enough). Native mode depends on a flat virtual address space with ordinary pointers working, except in vm where it doesn't depend on the pointers part doesn't depend on the pointers part. The type puns from this are just more obvious in emulators. >>> 14 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \ >> >> Broken except in the K&R case, but amd64 is too new to pretend to support >> K&R. Bug for bug compatible with mknod() and some other syscalls in > > C std version is irrelevant there. Args fetch code promotes all arguments > to (u)int(32). No, the args fetch code starts with all args already 32 bits (32-bit register_t for FreeBSD native i386). Promotion from mode_t to int occurs in the userland ABI. I just checked that neither gcc -O3 nor clang -O3 depends on this promotion being a strict C one. They both load an arg that is declared as int32_t using "movswl" from the stack, but if the ABI guaranteed strict C promotion, then optimal code would depend on this and use "movl" from the stack. -march=i386 makes no difference to this (movswl is almost as fast as movl on modern x86, but on original i386 it was much slower). I try to avoid using args shorter than int because of this pessimization. It was supposed to be an optimization in C90 to allow functions to pass short args without promotion, but ABI and FUD makes it mostly a pessimization on i386. First, the ABI requires passing 32 bits on the stack. Before C90, and still if no prototype in scope, the caller is required to promote an int16_t arg to int according to C promotion rules. Callees could assume this. Now, callees can't assume this, since they can't know if the caller did more than pass garbage padding bits, since the callee might have a prototype in scope and the ABI may allow passing garbage. This pessimization can now cost a whole nanosecond per arg per call :-). Anyway, the kernel should fear the ABI just as much as C compilers, since it easier to give correct declarations that do the demotions automatically via the args struct than it is to give incorrect ones that work (just copy arg types from userland prototypes, except for variadic functions, and don't allow variadic functions like open() and fcntl() for syscalls). >>> Modified: head/sys/compat/freebsd32/syscalls.master >>> ============================================================================== >>> --- head/sys/compat/freebsd32/syscalls.master Fri May 25 21:12:24 2012 >>> (r236025) >>> +++ head/sys/compat/freebsd32/syscalls.master Fri May 25 21:50:48 2012 >>> (r236026) >>> @@ -104,9 +104,9 @@ >>> int flags); } >>> 28 AUE_SENDMSG STD { int freebsd32_sendmsg(int s, struct >>> msghdr32 *msg, \ >>> int flags); } >>> -29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, u_int32_t >>> buf, \ >>> - u_int32_t len, int flags, u_int32_t >>> from, \ >>> - u_int32_t fromlenaddr); } >>> +29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, uint32_t >>> buf, \ >>> + uint32_t len, int flags, uint32_t from, \ >>> + uint32_t fromlenaddr); } >> >> Oops, I didn't looke at this file when I said that "ISO-C-style integer >> types seem to have only been used for a couple of uintptr_t's". This >> file is independent of Linux, so it can't use l_foo. It hard-codes 32 >> instead, starting with the directory name. Still, all of the types in >> the above are fairly bogus and hard to understand: >> - "int" for `s' and `flags' depends on ints being 32 bits >> > I agree that this is the biggest type-pun in the whole compat32/linux32 > components. It would be nice to use int32_t/uint32_t instead of int there, > since we in fact operate on ABI-defined type. Something like l_int (e_int? for emulated int?) would be better because it is shorter and more specific. Similarly for l_size_t. You can almost translate back and forth automatically by adding and removing the prefix, while there is no way to decode from a generic int32_t back to a foo_t. > But I do not think it is much worry to expect an arch to appear which have > sizeof(int) != 4. It is already engraved in stone. Like long was in 1982. And the result of fixing that was the long long, LFS, Linux loff_t and lots of foo64() syscalls in Linux just to support 64-bit off_t. FreeBSD missed most of this since BSD had a clean "break" and converted early to 64-bit off_t and made long 64 bits on alpha. >>> 481 AUE_KILL NOPROTO { int thr_kill2(pid_t pid, long id, int >>> sig); } >> >> Untranslated pid_t depends on pid_t being no larger than int. >> >> Untranslated long completely breaks this. Actually no breakage, especially with NOPROTO, and without NOPROTO there is only a minor problem with zero-extension. It takes a 64-bit type to break things. >>> -514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, u_int64_t rights); } >>> +514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, uint64_t rights); } >> >> Broken, assuming that all the other spittings into 2 uint32_t's are needed. >> .. > Yes, this is broken. > I added Robert and Jonathan to Cc:. We only found this 64-bit type for freebsd32. >> These bugs are easiest to fix in the Linux syscall.master's since the >> bugs are mostly already avoided using l_foo_t. In amd64/linux32/ >> syscalls.master, I only noticed the following ones: >> ... >> % 193 AUE_TRUNCATE STD { int linux_truncate64(char *path, \ >> % l_loff_t length); } >> % 194 AUE_FTRUNCATE STD { int linux_ftruncate64(l_uint fd, \ >> % l_loff_t length); } >> >> How can this work? I was going to say that the splitting up of the 64-bit >> args in compat/freebsd32/syscalls.master was unnecessary because it is >> apparently not needed here. Then I misread this as doing the splitting. >> But it doesn't. Similarly later in this file. I'm now surer that loff_t cannot work. It gets passed as 2 32-bit registers. These get interpreted as 64-bit registers and copied to 2 64-bit args. But the above only describes 1 64-bit args. However, x86 is little-endian, so many values will work by ignoring the second register. All values below 2G will work provided the top bits are either sign-extended or zero-extended. All values between 2G and 4G will work provided the top bits are zero-extended. Negative loff_t's are common for linux_llseek() but not for linux_ltruncate(). And linux_llseek() doesn't have this bug since it is inmplemented almost correctly bt splitting the arg into "l_ulong ohigh, l_ulong olow" (is this big-endian order really correct?!). linux_llseek() claims to retun int instead of the 64-bit offset, and that is correct since the offset is returned indirectly. But linux_lseek() also claims to return int instead of l_off_t. That is bogus but works. Here is the complete list of syscalls with buggy loff_t's from linux32: % 180 AUE_PREAD STD { int linux_pread(l_uint fd, char *buf, \ % l_size_t nbyte, l_loff_t offset); } % 181 AUE_PWRITE STD { int linux_pwrite(l_uint fd, char *buf, \ % l_size_t nbyte, l_loff_t offset); } % 193 AUE_TRUNCATE STD { int linux_truncate64(char *path, \ % l_loff_t length); } % 194 AUE_FTRUNCATE STD { int linux_ftruncate64(l_uint fd, \ % l_loff_t length); } WHen there is only 1 loff_t arg and it is the last one, it won't mess up the other args. But what about loff_t apparently being in big-endian order for linux_llseek(). I guess the order is actually little-endian, but the order is reversed by allocation of the 2 halves in registers. % 250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ % l_size_t len, int advice); } % 272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ % l_loff_t offset, l_loff_t len, \ % int advice); } Now the loff_t's are in the middle of the args, and/or there are 2 of them, so later args are messed up. I didn't quote the whole thing, but its still a 17K reply, sorry. Bruce From owner-svn-src-all@FreeBSD.ORG Sat May 26 22:47:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F3F41065674; Sat, 26 May 2012 22:47:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39A0B8FC15; Sat, 26 May 2012 22:47: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 q4QMlvPc011246; Sat, 26 May 2012 22:47:57 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QMlvTX011244; Sat, 26 May 2012 22:47:57 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205262247.q4QMlvTX011244@svn.freebsd.org> From: Alan Cox Date: Sat, 26 May 2012 22:47: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: r236123 - stable/9/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 22:47:57 -0000 Author: alc Date: Sat May 26 22:47:56 2012 New Revision: 236123 URL: http://svn.freebsd.org/changeset/base/236123 Log: MFC r228513 Create large page mappings in pmap_map(). Modified: stable/9/sys/i386/i386/pmap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/i386/pmap.c ============================================================================== --- stable/9/sys/i386/i386/pmap.c Sat May 26 21:30:18 2012 (r236122) +++ stable/9/sys/i386/i386/pmap.c Sat May 26 22:47:56 2012 (r236123) @@ -1452,12 +1452,40 @@ vm_offset_t pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot) { vm_offset_t va, sva; + vm_paddr_t superpage_offset; + pd_entry_t newpde; - va = sva = *virt; + va = *virt; + /* + * Does the physical address range's size and alignment permit at + * least one superpage mapping to be created? + */ + superpage_offset = start & PDRMASK; + if ((end - start) - ((NBPDR - superpage_offset) & PDRMASK) >= NBPDR) { + /* + * Increase the starting virtual address so that its alignment + * does not preclude the use of superpage mappings. + */ + if ((va & PDRMASK) < superpage_offset) + va = (va & ~PDRMASK) + superpage_offset; + else if ((va & PDRMASK) > superpage_offset) + va = ((va + PDRMASK) & ~PDRMASK) + superpage_offset; + } + sva = va; while (start < end) { - pmap_kenter(va, start); - va += PAGE_SIZE; - start += PAGE_SIZE; + if ((start & PDRMASK) == 0 && end - start >= NBPDR && + pseflag) { + KASSERT((va & PDRMASK) == 0, + ("pmap_map: misaligned va %#x", va)); + newpde = start | PG_PS | pgeflag | PG_RW | PG_V; + pmap_kenter_pde(va, newpde); + va += NBPDR; + start += NBPDR; + } else { + pmap_kenter(va, start); + va += PAGE_SIZE; + start += PAGE_SIZE; + } } pmap_invalidate_range(kernel_pmap, sva, va); *virt = va; From owner-svn-src-all@FreeBSD.ORG Sat May 26 23:07:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C119106566C; Sat, 26 May 2012 23:07:46 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46C738FC08; Sat, 26 May 2012 23:07: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 q4QN7kt2012073; Sat, 26 May 2012 23:07:46 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QN7keu012071; Sat, 26 May 2012 23:07:46 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205262307.q4QN7keu012071@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 23:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236124 - vendor/openpam/dist/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 23:07:46 -0000 Author: des Date: Sat May 26 23:07:45 2012 New Revision: 236124 URL: http://svn.freebsd.org/changeset/base/236124 Log: OpenPAM Micrampelis was re-rolled due to a showstopper bug. Modified: vendor/openpam/dist/lib/openpam_configure.c Modified: vendor/openpam/dist/lib/openpam_configure.c ============================================================================== --- vendor/openpam/dist/lib/openpam_configure.c Sat May 26 22:47:56 2012 (r236123) +++ vendor/openpam/dist/lib/openpam_configure.c Sat May 26 23:07:45 2012 (r236124) @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam_configure.c 601 2012-04-14 20:37:45Z des $ + * $Id: openpam_configure.c 612 2012-05-26 23:02:55Z des $ */ #ifdef HAVE_CONFIG_H @@ -261,6 +261,8 @@ openpam_parse_chain(pam_handle_t *pamh, this->optc = wordc - i; for (i = 0; i < wordc - this->optc; ++i) { FREE(wordv[i]); + } + for (i = 0; i < this->optc; ++i) { wordv[i] = wordv[wordc - this->optc + i]; wordv[wordc - this->optc + i] = NULL; } From owner-svn-src-all@FreeBSD.ORG Sat May 26 23:08:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48C671065674; Sat, 26 May 2012 23:08:54 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 344D98FC15; Sat, 26 May 2012 23:08: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 q4QN8sNQ012163; Sat, 26 May 2012 23:08:54 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QN8sKS012161; Sat, 26 May 2012 23:08:54 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205262308.q4QN8sKS012161@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 23:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236125 - vendor/openpam/MICRAMPELIS/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 23:08:54 -0000 Author: des Date: Sat May 26 23:08:53 2012 New Revision: 236125 URL: http://svn.freebsd.org/changeset/base/236125 Log: OpenPAM Micrampelis was re-rolled due to a showstopper bug. Modified: vendor/openpam/MICRAMPELIS/lib/openpam_configure.c Directory Properties: vendor/openpam/MICRAMPELIS/ (props changed) Modified: vendor/openpam/MICRAMPELIS/lib/openpam_configure.c ============================================================================== --- vendor/openpam/MICRAMPELIS/lib/openpam_configure.c Sat May 26 23:07:45 2012 (r236124) +++ vendor/openpam/MICRAMPELIS/lib/openpam_configure.c Sat May 26 23:08:53 2012 (r236125) @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam_configure.c 601 2012-04-14 20:37:45Z des $ + * $Id: openpam_configure.c 612 2012-05-26 23:02:55Z des $ */ #ifdef HAVE_CONFIG_H @@ -261,6 +261,8 @@ openpam_parse_chain(pam_handle_t *pamh, this->optc = wordc - i; for (i = 0; i < wordc - this->optc; ++i) { FREE(wordv[i]); + } + for (i = 0; i < this->optc; ++i) { wordv[i] = wordv[wordc - this->optc + i]; wordv[wordc - this->optc + i] = NULL; } From owner-svn-src-all@FreeBSD.ORG Sat May 26 23:10:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 095E41065673; Sat, 26 May 2012 23:10:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8BB58FC12; Sat, 26 May 2012 23: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 q4QNALkX012285; Sat, 26 May 2012 23:10:21 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QNALLl012283; Sat, 26 May 2012 23:10:21 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205262310.q4QNALLl012283@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 23:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236126 - head/contrib/openpam/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 23:10:22 -0000 Author: des Date: Sat May 26 23:10:21 2012 New Revision: 236126 URL: http://svn.freebsd.org/changeset/base/236126 Log: OpenPAM Micrampelis was re-rolled due to a showstopper bug. Modified: head/contrib/openpam/lib/openpam_configure.c Directory Properties: head/contrib/openpam/ (props changed) Modified: head/contrib/openpam/lib/openpam_configure.c ============================================================================== --- head/contrib/openpam/lib/openpam_configure.c Sat May 26 23:08:53 2012 (r236125) +++ head/contrib/openpam/lib/openpam_configure.c Sat May 26 23:10:21 2012 (r236126) @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam_configure.c 601 2012-04-14 20:37:45Z des $ + * $Id: openpam_configure.c 612 2012-05-26 23:02:55Z des $ */ #ifdef HAVE_CONFIG_H @@ -261,6 +261,8 @@ openpam_parse_chain(pam_handle_t *pamh, this->optc = wordc - i; for (i = 0; i < wordc - this->optc; ++i) { FREE(wordv[i]); + } + for (i = 0; i < this->optc; ++i) { wordv[i] = wordv[wordc - this->optc + i]; wordv[wordc - this->optc + i] = NULL; } From owner-svn-src-all@FreeBSD.ORG Sat May 26 23:10:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF95910657EB; Sat, 26 May 2012 23:10:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA2C18FC16; Sat, 26 May 2012 23:10: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 q4QNAanE012328; Sat, 26 May 2012 23:10:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QNAaL0012326; Sat, 26 May 2012 23:10:36 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205262310.q4QNAaL0012326@svn.freebsd.org> From: Alan Cox Date: Sat, 26 May 2012 23:10: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: r236127 - stable/8/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 23:10:36 -0000 Author: alc Date: Sat May 26 23:10:36 2012 New Revision: 236127 URL: http://svn.freebsd.org/changeset/base/236127 Log: MFC r228513 Create large page mappings in pmap_map(). Modified: stable/8/sys/i386/i386/pmap.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Sat May 26 23:10:21 2012 (r236126) +++ stable/8/sys/i386/i386/pmap.c Sat May 26 23:10:36 2012 (r236127) @@ -1424,12 +1424,40 @@ vm_offset_t pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot) { vm_offset_t va, sva; + vm_paddr_t superpage_offset; + pd_entry_t newpde; - va = sva = *virt; + va = *virt; + /* + * Does the physical address range's size and alignment permit at + * least one superpage mapping to be created? + */ + superpage_offset = start & PDRMASK; + if ((end - start) - ((NBPDR - superpage_offset) & PDRMASK) >= NBPDR) { + /* + * Increase the starting virtual address so that its alignment + * does not preclude the use of superpage mappings. + */ + if ((va & PDRMASK) < superpage_offset) + va = (va & ~PDRMASK) + superpage_offset; + else if ((va & PDRMASK) > superpage_offset) + va = ((va + PDRMASK) & ~PDRMASK) + superpage_offset; + } + sva = va; while (start < end) { - pmap_kenter(va, start); - va += PAGE_SIZE; - start += PAGE_SIZE; + if ((start & PDRMASK) == 0 && end - start >= NBPDR && + pseflag) { + KASSERT((va & PDRMASK) == 0, + ("pmap_map: misaligned va %#x", va)); + newpde = start | PG_PS | pgeflag | PG_RW | PG_V; + pmap_kenter_pde(va, newpde); + va += NBPDR; + start += NBPDR; + } else { + pmap_kenter(va, start); + va += PAGE_SIZE; + start += PAGE_SIZE; + } } pmap_invalidate_range(kernel_pmap, sva, va); *virt = va; From owner-svn-src-all@FreeBSD.ORG Sat May 26 23:42:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0717B106566B; Sat, 26 May 2012 23:42:53 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E51CD8FC08; Sat, 26 May 2012 23:42:52 +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 q4QNgqvc013650; Sat, 26 May 2012 23:42:52 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QNgqAg013648; Sat, 26 May 2012 23:42:52 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205262342.q4QNgqAg013648@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 23:42:52 +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: r236128 - stable/9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 23:42:53 -0000 Author: des Date: Sat May 26 23:42:52 2012 New Revision: 236128 URL: http://svn.freebsd.org/changeset/base/236128 Log: Make yacc a bootstrap tool if building on head, since the new yacc is not 100% backward compatible. Also, build yacc before lex, because lex requires yacc but not vice versa. Modified: stable/9/Makefile.inc1 Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Sat May 26 23:10:36 2012 (r236127) +++ stable/9/Makefile.inc1 Sat May 26 23:42:52 2012 (r236128) @@ -1026,6 +1026,9 @@ _sed= usr.bin/sed .if ${BOOTSTRAPPING} < 900006 _lex= usr.bin/lex +.endif + +.if ${BOOTSTRAPPING} < 900006 || ${BOOTSTRAPPING} > 1000012 _yacc= usr.bin/yacc .endif @@ -1080,8 +1083,8 @@ bootstrap-tools: ${_mklocale} \ usr.bin/rpcgen \ ${_sed} \ - ${_lex} \ ${_yacc} \ + ${_lex} \ usr.bin/xinstall \ ${_gensnmptree} \ usr.sbin/config \ From owner-svn-src-all@FreeBSD.ORG Sat May 26 23:48:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 302BC1065673; Sat, 26 May 2012 23:48:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC7E8FC12; Sat, 26 May 2012 23:48: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 q4QNmuoo013949; Sat, 26 May 2012 23:48:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QNmudG013947; Sat, 26 May 2012 23:48:56 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205262348.q4QNmudG013947@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 23:48:56 +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: r236129 - stable/9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 23:48:57 -0000 Author: des Date: Sat May 26 23:48:56 2012 New Revision: 236129 URL: http://svn.freebsd.org/changeset/base/236129 Log: nit: use >= 1000013 instead of > 1000012 Modified: stable/9/Makefile.inc1 Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Sat May 26 23:42:52 2012 (r236128) +++ stable/9/Makefile.inc1 Sat May 26 23:48:56 2012 (r236129) @@ -1028,7 +1028,7 @@ _sed= usr.bin/sed _lex= usr.bin/lex .endif -.if ${BOOTSTRAPPING} < 900006 || ${BOOTSTRAPPING} > 1000012 +.if ${BOOTSTRAPPING} < 900006 || ${BOOTSTRAPPING} >= 1000013 _yacc= usr.bin/yacc .endif From owner-svn-src-all@FreeBSD.ORG Sat May 26 23:58:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C471106566C; Sat, 26 May 2012 23:58:52 +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 77BF58FC0A; Sat, 26 May 2012 23:58:52 +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 q4QNwq9t014376; Sat, 26 May 2012 23:58:52 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QNwqbL014374; Sat, 26 May 2012 23:58:52 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205262358.q4QNwqbL014374@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 26 May 2012 23:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236130 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 23:58:52 -0000 Author: bz Date: Sat May 26 23:58:51 2012 New Revision: 236130 URL: http://svn.freebsd.org/changeset/base/236130 Log: Correctly get the payload length in host byte order. While we already plan to support >64k payload here, the IPv6 header payload length obviously is only 16 bit and the calculations need to be right. Reported by: dim Tested by: dim MFC after: 1 day X-MFC: with r235958 Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sat May 26 23:48:56 2012 (r236129) +++ head/sys/netinet6/ip6_output.c Sat May 26 23:58:51 2012 (r236130) @@ -189,13 +189,13 @@ in6_delayed_cksum(struct mbuf *m, uint32 { u_short csum; - csum = in_cksum_skip(m, ntohl(plen), offset); + csum = in_cksum_skip(m, offset + plen, offset); if (m->m_pkthdr.csum_flags & CSUM_UDP && csum == 0) csum = 0xffff; offset += m->m_pkthdr.csum_data; /* checksum offset */ if (offset + sizeof(u_short) > m->m_len) { - printf("%s: delayed m_pullup, m->len: %d off: %d\n", + printf("%s: delayed m_pullup, m->len: %d off: %d\n", __func__, m->m_len, offset); /* * XXX this should not happen, but if it does, the correct @@ -962,7 +962,7 @@ passout: */ if (sw_csum & CSUM_DELAY_DATA) { sw_csum &= ~CSUM_DELAY_DATA; - in6_delayed_cksum(m, ip6->ip6_plen, sizeof(struct ip6_hdr)); + in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr)); } #ifdef SCTP if (sw_csum & CSUM_SCTP) { @@ -1077,7 +1077,7 @@ passout: * XXX-BZ handle the hw offloading case. Need flags. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - in6_delayed_cksum(m, ip6->ip6_plen, sizeof(*ip6)); + in6_delayed_cksum(m, plen, hlen); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #ifdef SCTP