From owner-svn-src-stable-7@FreeBSD.ORG Sun Jun 21 02:45:23 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B731D106566C; Sun, 21 Jun 2009 02:45:23 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A44B68FC17; Sun, 21 Jun 2009 02:45:23 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5L2jNEc093283; Sun, 21 Jun 2009 02:45:23 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5L2jNLY093281; Sun, 21 Jun 2009 02:45:23 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906210245.n5L2jNLY093281@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 21 Jun 2009 02:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194565 - stable/7/share/termcap X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2009 02:45:24 -0000 Author: edwin Date: Sun Jun 21 02:45:23 2009 New Revision: 194565 URL: http://svn.freebsd.org/changeset/base/194565 Log: MFC of 194146 Add missing termcap entry for rxvt-unicode. The termcap database does not have an entry for rxvt-unicode. This means that programs that need an entry such as vi fail to work when connecting via ssh using this terminal emulator. The added data is not the same as the PR submitted by Richard, it uses the :tc=xxx: option to inherit everything from rxvt-mono. PR: conf/117323 Submitted by: Richard Bradshaw Modified: stable/7/share/termcap/ (props changed) stable/7/share/termcap/termcap.src Modified: stable/7/share/termcap/termcap.src ============================================================================== --- stable/7/share/termcap/termcap.src Sun Jun 21 01:54:47 2009 (r194564) +++ stable/7/share/termcap/termcap.src Sun Jun 21 02:45:23 2009 (r194565) @@ -4547,6 +4547,12 @@ rxvt-mono|rxvt terminal emulator (monoch :te=\E[?47l\E8:ti=\E7\E[?47h:ue=\E[24m:up=\E[A:us=\E[4m:\ :vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:vs=\E[?25h: +# Termcap entry for rxvt-unicode, taken from http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.html#I_need_a_termcap_file_entry +rxvt-unicode|rxvt-unicode terminal (X Window System):\ + :SF=\E[%dS:SR=\E[%dT:bw:ec=\E[%dX:kb=\177:kd=\EOB:ke=\E[?1l\E>:\ + :kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:lm#0:te=\E[r\E[?1049l:\ + :ti=\E[?1049h:tc=rxvt-mono: + rxvt|rxvt terminal emulator (X Window System):\ :pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono: From owner-svn-src-stable-7@FreeBSD.ORG Sun Jun 21 02:46:56 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C31881065672; Sun, 21 Jun 2009 02:46:56 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 962AA8FC0C; Sun, 21 Jun 2009 02:46:56 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5L2kuDu093420; Sun, 21 Jun 2009 02:46:56 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5L2kuRt093418; Sun, 21 Jun 2009 02:46:56 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906210246.n5L2kuRt093418@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 21 Jun 2009 02:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194566 - stable/7/share/termcap X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2009 02:46:57 -0000 Author: edwin Date: Sun Jun 21 02:46:56 2009 New Revision: 194566 URL: http://svn.freebsd.org/changeset/base/194566 Log: MFC of 194152 Add missing terminal definition for Wyse 120 in termcap Although the PR contains also the definitions of the Wyse 60, they are not copied into it since there are already definition for them in the termcap file since 1997. Also, the PR didn't use the :tc=xxx: feature, so I've imploded them. PR: conf/81882 Submitted by: Meister des Chaos Modified: stable/7/share/termcap/ (props changed) stable/7/share/termcap/termcap.src Modified: stable/7/share/termcap/termcap.src ============================================================================== --- stable/7/share/termcap/termcap.src Sun Jun 21 02:45:23 2009 (r194565) +++ stable/7/share/termcap/termcap.src Sun Jun 21 02:46:56 2009 (r194566) @@ -3998,6 +3998,31 @@ wy100q|Wyse 100 for Quotron:\ :dc=\EW:dl=\ER:do=^J:ei=\Er:im=\Eq:is=\E`\072\200\EC\EDF\E0\E'\E(\EA21:\ :kd=^J:kl=^H:kr=^L:ku=^K:li#24:nd=^L:up=^K:us=\EG8:ue=\EG0:\ :so=\EG4:se=\EG0:sg#1:sr=\Ej:ho=^^:ug#1: +# Wyse 120 definitions from conf/81882 by Meister des Chaos +wy120|wyse120|wy150|wyse150|Wyse 120/150:\ + :am:bw:hs:km:mi:ms:xo:\ + :co#80:it#8:li#24:pb#9601:ws#45:\ + :ae=\EcD:al=\EE:as=\EcE:bl=^G:bt=\EI:cd=\EY:ce=\ET:cl=\E+:\ + :cm=\E=%+ %+ :cr=^M:ct=\E0:dc=\EW:dl=\ER:do=^J:ds=\EF\r:\ + :ei=\Er:fs=^M:ho=^^:i1=\EcB0\EcC1:i2=\EwJ\Ew1:im=\Eq:ip=:\ + :is=\Ed$\EcD\E'\Er\EH\003\Ed/\EO\Ee1\Ed*\E`@\E`9\E`1\016\024\El:\ + :k1=^A@\r:k2=^AA\r:k3=^AB\r:k4=^AC\r:k5=^AD\r:k6=^AE\r:\ + :k7=^AF\r:k8=^AG\r:k9=^AH\r:kD=\EW:kI=\EQ:kN=\EK:kP=\EJ:\ + :kb=^H:kd=^J:kh=^^:kl=^H:kr=^L:ku=^K:le=^H:ll=^^^K:mb=\EG2:\ + :me=\E(\EH\003\EG0\EcD:mh=\EGp:mr=\EG4:nd=^L:nw=\r\n:\ + :se=\EG0:sf=\n:so=\EGt:sr=\Ej:st=\E1:ta=\011:te=\Ew1:\ + :ti=\Ew0:ts=\EF:ue=\EG0:up=^K:us=\EG8:vb=\E`8\E`9:ve=\E`1:\ + :vi=\E`0: +wy120-w|wyse120-w|wy150-w|wyse150-w|wyse 120/150 132-column:\ + :cm=\Ea%i%dR%dC:co#132:ws#97:tc=wy120: +wy120-25|wyse120-25|wy150-25|wyse150-25|wyse 120/150 80-column 25-lines:\ + :li#25:tc=wy120: +wy120-25-w|wyse120-25-w|wy150-25-w|wyse150-25-w|wyse 120/150 132-column 25-lines:\ + :cm=\Ea%i%dR%dC:co#132:li#25:ws#97:tc=wy120: +wy120-vb|wyse120-vb|wy150-vb|wyse150-vb|Wyse 120/150 visible bell:\ + :bl@:tc=wy120: +wy120-w-vb|wy120-wvb|wyse120-wvb|wy150-w-vb|wyse150-w-vb|Wyse 120/150 132-column visible bell:\ + :bl@:cm=\Ea%i%dR%dC:co#132:ws#97:tc=wy120: # # -------------------------------- # # y: TELERAY From owner-svn-src-stable-7@FreeBSD.ORG Sun Jun 21 02:48:17 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3F1B106566C; Sun, 21 Jun 2009 02:48:16 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E15C08FC1C; Sun, 21 Jun 2009 02:48:16 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5L2mGsi093493; Sun, 21 Jun 2009 02:48:16 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5L2mGYY093491; Sun, 21 Jun 2009 02:48:16 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906210248.n5L2mGYY093491@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 21 Jun 2009 02:48:16 +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: r194567 - stable/7/share/termcap X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2009 02:48:17 -0000 Author: edwin Date: Sun Jun 21 02:48:16 2009 New Revision: 194567 URL: http://svn.freebsd.org/changeset/base/194567 Log: MFC of 194172 Termcap updates for screen and linux console: screen entry: F11-F20 keys added linux entry: F10-F20 keys added, ACS line graphics added PR: kern/108899 Submitted by: Joseph Terner Modified: stable/7/share/termcap/ (props changed) stable/7/share/termcap/termcap.src Modified: stable/7/share/termcap/termcap.src ============================================================================== --- stable/7/share/termcap/termcap.src Sun Jun 21 02:46:56 2009 (r194566) +++ stable/7/share/termcap/termcap.src Sun Jun 21 02:48:16 2009 (r194567) @@ -2771,6 +2771,8 @@ SC|screen|VT 100/ANSI X3.64 virtual term :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\ + :F3=\E[25~:F4=\E[26~:F5=\E[28~:F6=\E[29~:\ + :F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:\ :kh=\E[1~:kI=\E[2~:kD=\E[3~:@7=\E[4~:kP=\E[5~:\ :kN=\E[6~:eA=\E(B\E)0:as=^N:ae=^O:ti=\E[?1049h:te=\E[?1049l:\ :vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\ @@ -4526,7 +4528,9 @@ linux|Linux Console:\ :me=\E[0;10m:mh=\E[2m:mr=\E[7m:nd=\E[C:nw=^M^J:rc=\E8:\ :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ :ue=\E[24m:up=\E[A:us=\E[4m:vb=200\E[?5h\E[?5l:\ - :ve=\E[?25h:vi=\E[?25l: + :ve=\E[?25h:vi=\E[?25l:\ + :k;=\E[21~:F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:F5=\E[28~:\ + :F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~: linux-m|Linux Console no color:\ :pa@:Co@:AF@:AB@:op@:\ :tc=linux: From owner-svn-src-stable-7@FreeBSD.ORG Sun Jun 21 02:49:21 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA069106564A; Sun, 21 Jun 2009 02:49:21 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A77B78FC1D; Sun, 21 Jun 2009 02:49:21 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5L2nLWm093564; Sun, 21 Jun 2009 02:49:21 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5L2nLP0093562; Sun, 21 Jun 2009 02:49:21 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906210249.n5L2nLP0093562@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 21 Jun 2009 02:49: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: r194568 - stable/7/share/termcap X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2009 02:49:22 -0000 Author: edwin Date: Sun Jun 21 02:49:21 2009 New Revision: 194568 URL: http://svn.freebsd.org/changeset/base/194568 Log: Add missing passthrough printing entries for VT100 and workalikes in /etc/termcap: VT100 spec indicates that passthrough printing can be enabled by sending ESC[5i and disabled by sending ESC[4i These entries should be listed as po and pf in /etc/termcap, but are absent. See http://www.vt100.net/docs/vt102-ug/chapter5.html#S5.5.2.23 PR: conf/71549 Submitted by: Andrew Webster Modified: stable/7/share/termcap/ (props changed) stable/7/share/termcap/termcap.src Modified: stable/7/share/termcap/termcap.src ============================================================================== --- stable/7/share/termcap/termcap.src Sun Jun 21 02:48:16 2009 (r194567) +++ stable/7/share/termcap/termcap.src Sun Jun 21 02:49:21 2009 (r194568) @@ -2481,7 +2481,7 @@ vt100|dec-vt100|vt100-am|vt100am|dec vt1 :K1=\EOq:K2=\EOr:K3=\EOs:K4=\EOp:K5=\EOn:pt:sr=2*\EM:xn:\ :sc=2\E7:rc=2\E8:cs=5\E[%i%d;%dr:UP=2\E[%dA:DO=2\E[%dB:RI=2\E[%dC:\ :LE=2\E[%dD:ct=2\E[3g:st=2\EH:ta=^I:ms:bl=^G:cr=^M:eo:it#8:\ - :RA=\E[?7l:SA=\E[?7h: + :RA=\E[?7l:SA=\E[?7h:po=\E[5i:pf=\E[4i: vt100-nam|dec-vt100-nam|vt100nam|vt100 w/no am:\ :am@:xn@:\ :is=\E>\E[?1;3;4;5;7l\E[?8h\E[1;24r\E[24;1H:\ From owner-svn-src-stable-7@FreeBSD.ORG Sun Jun 21 15:36:11 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 535E01065670; Sun, 21 Jun 2009 15:36:11 +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 40AD18FC16; Sun, 21 Jun 2009 15:36:11 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5LFaBa9010529; Sun, 21 Jun 2009 15:36:11 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5LFaBsc010527; Sun, 21 Jun 2009 15:36:11 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200906211536.n5LFaBsc010527@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 21 Jun 2009 15:36:11 +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: r194587 - stable/7/bin/cp X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2009 15:36:12 -0000 Author: jilles Date: Sun Jun 21 15:36:10 2009 New Revision: 194587 URL: http://svn.freebsd.org/changeset/base/194587 Log: MFC r193086: Preserve file flags on symlinks in cp -Rp. This reported ENOSYS before. PR: bin/111226 (part of) Submitted by: Martin Kammerhofer Approved by: ed (mentor) (implicit) Modified: stable/7/bin/cp/ (props changed) stable/7/bin/cp/utils.c Modified: stable/7/bin/cp/utils.c ============================================================================== --- stable/7/bin/cp/utils.c Sun Jun 21 13:41:32 2009 (r194586) +++ stable/7/bin/cp/utils.c Sun Jun 21 15:36:10 2009 (r194587) @@ -339,7 +339,7 @@ setfile(struct stat *fs, int fd) if (!gotstat || fs->st_flags != ts.st_flags) if (fdval ? fchflags(fd, fs->st_flags) : - (islink ? (errno = ENOSYS) : + (islink ? lchflags(to.p_path, fs->st_flags) : chflags(to.p_path, fs->st_flags))) { warn("chflags: %s", to.p_path); rval = 1; From owner-svn-src-stable-7@FreeBSD.ORG Sun Jun 21 15:40:39 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB23B1065672; Sun, 21 Jun 2009 15:40:39 +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 8D7438FC0A; Sun, 21 Jun 2009 15:40:39 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5LFedMM010647; Sun, 21 Jun 2009 15:40:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5LFed72010644; Sun, 21 Jun 2009 15:40:39 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200906211540.n5LFed72010644@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 21 Jun 2009 15:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194588 - in stable/7: bin/rm usr.bin/find X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2009 15:40:40 -0000 Author: jilles Date: Sun Jun 21 15:40:39 2009 New Revision: 194588 URL: http://svn.freebsd.org/changeset/base/194588 Log: MFC r193087: rm, find -delete: fix removing symlinks with uchg/uappnd set Formerly, this tried to clear the flags on the symlink's target instead of the symlink itself. As before, this only happens for root or for the unlink(1) variant of rm. PR: bin/111226 (part of) Submitted by: Martin Kammerhofer Approved by: ed (mentor) (implicit) Modified: stable/7/bin/rm/ (props changed) stable/7/bin/rm/rm.c stable/7/usr.bin/find/ (props changed) stable/7/usr.bin/find/function.c Modified: stable/7/bin/rm/rm.c ============================================================================== --- stable/7/bin/rm/rm.c Sun Jun 21 15:36:10 2009 (r194587) +++ stable/7/bin/rm/rm.c Sun Jun 21 15:40:39 2009 (r194588) @@ -231,7 +231,7 @@ rm_tree(char **argv) else if (!uid && (p->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) && !(p->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)) && - chflags(p->fts_accpath, + lchflags(p->fts_accpath, p->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE)) < 0) goto err; continue; @@ -250,7 +250,7 @@ rm_tree(char **argv) if (!uid && (p->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) && !(p->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE))) - rval = chflags(p->fts_accpath, + rval = lchflags(p->fts_accpath, p->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE)); if (rval == 0) { /* @@ -350,7 +350,7 @@ rm_file(char **argv) if (!uid && !S_ISWHT(sb.st_mode) && (sb.st_flags & (UF_APPEND|UF_IMMUTABLE)) && !(sb.st_flags & (SF_APPEND|SF_IMMUTABLE))) - rval = chflags(f, sb.st_flags & ~(UF_APPEND|UF_IMMUTABLE)); + rval = lchflags(f, sb.st_flags & ~(UF_APPEND|UF_IMMUTABLE)); if (rval == 0) { if (S_ISWHT(sb.st_mode)) rval = undelete(f); Modified: stable/7/usr.bin/find/function.c ============================================================================== --- stable/7/usr.bin/find/function.c Sun Jun 21 15:36:10 2009 (r194587) +++ stable/7/usr.bin/find/function.c Sun Jun 21 15:40:39 2009 (r194588) @@ -443,7 +443,7 @@ f_delete(PLAN *plan __unused, FTSENT *en if ((entry->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) && !(entry->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)) && geteuid() == 0) - chflags(entry->fts_accpath, + lchflags(entry->fts_accpath, entry->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE)); /* rmdir directories, unlink everything else */ From owner-svn-src-stable-7@FreeBSD.ORG Sun Jun 21 19:31:42 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D6AC1065670; Sun, 21 Jun 2009 19:31: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 40E498FC08; Sun, 21 Jun 2009 19:31:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5LJVg5H016316; Sun, 21 Jun 2009 19:31:42 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5LJVgcL016315; Sun, 21 Jun 2009 19:31:42 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906211931.n5LJVgcL016315@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 21 Jun 2009 19:31:42 +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: r194603 - in stable/7/sys: . contrib/pf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2009 19:31:43 -0000 Author: des Date: Sun Jun 21 19:31:41 2009 New Revision: 194603 URL: http://svn.freebsd.org/changeset/base/194603 Log: Record r192973 as merged so it won't show up as eligible. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Sun Jun 21 19:39:34 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6578F1065672; Sun, 21 Jun 2009 19:39:34 +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 527988FC15; Sun, 21 Jun 2009 19:39:34 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5LJdYIM016533; Sun, 21 Jun 2009 19:39:34 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5LJdYfq016530; Sun, 21 Jun 2009 19:39:34 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906211939.n5LJdYfq016530@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 21 Jun 2009 19:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194604 - in stable/7/sys: . contrib/pf kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2009 19:39:35 -0000 Author: des Date: Sun Jun 21 19:39:34 2009 New Revision: 194604 URL: http://svn.freebsd.org/changeset/base/194604 Log: merge r193027, r193557, r192900, r193028: fix trailing-slash symlink bug PR: kern/21768 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/vfs_lookup.c stable/7/sys/sys/namei.h Modified: stable/7/sys/kern/vfs_lookup.c ============================================================================== --- stable/7/sys/kern/vfs_lookup.c Sun Jun 21 19:31:41 2009 (r194603) +++ stable/7/sys/kern/vfs_lookup.c Sun Jun 21 19:39:34 2009 (r194604) @@ -138,6 +138,9 @@ namei(struct nameidata *ndp) cnp->cn_flags &= ~LOCKSHARED; fdp = p->p_fd; + /* We will set this ourselves if we need it. */ + cnp->cn_flags &= ~TRAILINGSLASH; + /* * Get a buffer for the name to be translated, and copy the * name into the buffer. @@ -224,7 +227,7 @@ namei(struct nameidata *ndp) vfslocked = (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; ndp->ni_cnd.cn_flags &= ~GIANTHELD; /* - * Check for symbolic link + * If not a symbolic link, we're done. */ if ((cnp->cn_flags & ISSYMLINK) == 0) { if ((cnp->cn_flags & (SAVENAME | SAVESTART)) == 0) { @@ -367,7 +370,6 @@ lookup(struct nameidata *ndp) int docache; /* == 0 do not cache last component */ int wantparent; /* 1 => wantparent or lockparent flag */ int rdonly; /* lookup read-only flag bit */ - int trailing_slash; int error = 0; int dpunlocked = 0; /* dp has already been unlocked */ struct componentname *cnp = &ndp->ni_cnd; @@ -439,13 +441,12 @@ dirloop: * trailing slashes to handle symlinks, existing non-directories * and non-existing files that won't be directories specially later. */ - trailing_slash = 0; while (*cp == '/' && (cp[1] == '/' || cp[1] == '\0')) { cp++; ndp->ni_pathlen--; if (*cp == '\0') { - trailing_slash = 1; - *ndp->ni_next = '\0'; /* XXX for direnter() ... */ + *ndp->ni_next = '\0'; + cnp->cn_flags |= TRAILINGSLASH; } } ndp->ni_next = cp; @@ -604,27 +605,24 @@ unionlookup: if (error != EJUSTRETURN) goto bad; /* - * If creating and at end of pathname, then can consider - * allowing file to be created. + * At this point, we know we're at the end of the + * pathname. If creating / renaming, we can consider + * allowing the file or directory to be created / renamed, + * provided we're not on a read-only filesystem. */ if (rdonly) { error = EROFS; goto bad; } - if (*cp == '\0' && trailing_slash && - !(cnp->cn_flags & WILLBEDIR)) { + /* trailing slash only allowed for directories */ + if ((cnp->cn_flags & TRAILINGSLASH) && + !(cnp->cn_flags & WILLBEDIR)) { error = ENOENT; goto bad; } if ((cnp->cn_flags & LOCKPARENT) == 0) VOP_UNLOCK(dp, 0, td); /* - * This is a temporary assert to make sure I know what the - * behavior here was. - */ - KASSERT((cnp->cn_flags & (WANTPARENT|LOCKPARENT)) != 0, - ("lookup: Unhandled case.")); - /* * We return with ni_vp NULL to indicate that the entry * doesn't currently exist, leaving a pointer to the * (possibly locked) directory vnode in ndp->ni_dvp. @@ -687,7 +685,7 @@ unionlookup: * Check for symbolic link */ if ((dp->v_type == VLNK) && - ((cnp->cn_flags & FOLLOW) || trailing_slash || + ((cnp->cn_flags & FOLLOW) || (cnp->cn_flags & TRAILINGSLASH) || *ndp->ni_next == '/')) { cnp->cn_flags |= ISSYMLINK; if (dp->v_iflag & VI_DOOMED) { @@ -710,18 +708,10 @@ unionlookup: goto success; } - /* - * Check for bogus trailing slashes. - */ - if (trailing_slash && dp->v_type != VDIR) { - error = ENOTDIR; - goto bad2; - } - nextname: /* - * Not a symbolic link. If more pathname, - * continue at next component, else return. + * Not a symbolic link that we will follow. Continue with the + * next component if there is any; otherwise, we're done. */ KASSERT((cnp->cn_flags & ISLASTCN) || *ndp->ni_next == '/', ("lookup: invalid path state.")); @@ -741,6 +731,14 @@ nextname: goto dirloop; } /* + * If we're processing a path with a trailing slash, + * check that the end result is a directory. + */ + if ((cnp->cn_flags & TRAILINGSLASH) && dp->v_type != VDIR) { + error = ENOTDIR; + goto bad2; + } + /* * Disallow directory write attempts on read-only filesystems. */ if (rdonly && @@ -891,12 +889,6 @@ relookup(struct vnode *dvp, struct vnode if ((cnp->cn_flags & LOCKPARENT) == 0) VOP_UNLOCK(dp, 0, td); /* - * This is a temporary assert to make sure I know what the - * behavior here was. - */ - KASSERT((cnp->cn_flags & (WANTPARENT|LOCKPARENT)) != 0, - ("relookup: Unhandled case.")); - /* * We return with ni_vp NULL to indicate that the entry * doesn't currently exist, leaving a pointer to the * (possibly locked) directory vnode in ndp->ni_dvp. Modified: stable/7/sys/sys/namei.h ============================================================================== --- stable/7/sys/sys/namei.h Sun Jun 21 19:31:41 2009 (r194603) +++ stable/7/sys/sys/namei.h Sun Jun 21 19:39:34 2009 (r194604) @@ -127,26 +127,27 @@ struct nameidata { * name being sought. The caller is responsible for releasing the * buffer and for vrele'ing ni_startdir. */ -#define RDONLY 0x0000200 /* lookup with read-only semantics */ -#define HASBUF 0x0000400 /* has allocated pathname buffer */ -#define SAVENAME 0x0000800 /* save pathname buffer */ -#define SAVESTART 0x0001000 /* save starting directory */ -#define ISDOTDOT 0x0002000 /* current component name is .. */ -#define MAKEENTRY 0x0004000 /* entry is to be added to name cache */ -#define ISLASTCN 0x0008000 /* this is last component of pathname */ -#define ISSYMLINK 0x0010000 /* symlink needs interpretation */ -#define ISWHITEOUT 0x0020000 /* found whiteout */ -#define DOWHITEOUT 0x0040000 /* do whiteouts */ -#define WILLBEDIR 0x0080000 /* new files will be dirs; allow trailing / */ -#define ISUNICODE 0x0100000 /* current component name is unicode*/ -#define ISOPEN 0x0200000 /* caller is opening; return a real vnode. */ -#define NOCROSSMOUNT 0x0400000 /* do not cross mount points */ -#define NOMACCHECK 0x0800000 /* do not perform MAC checks */ -#define MPSAFE 0x1000000 /* namei() must acquire Giant if needed. */ -#define GIANTHELD 0x2000000 /* namei() is holding giant. */ -#define AUDITVNODE1 0x4000000 /* audit the looked up vnode information */ -#define AUDITVNODE2 0x8000000 /* audit the looked up vnode information */ -#define PARAMASK 0xffffe00 /* mask of parameter descriptors */ +#define RDONLY 0x00000200 /* lookup with read-only semantics */ +#define HASBUF 0x00000400 /* has allocated pathname buffer */ +#define SAVENAME 0x00000800 /* save pathname buffer */ +#define SAVESTART 0x00001000 /* save starting directory */ +#define ISDOTDOT 0x00002000 /* current component name is .. */ +#define MAKEENTRY 0x00004000 /* entry is to be added to name cache */ +#define ISLASTCN 0x00008000 /* this is last component of pathname */ +#define ISSYMLINK 0x00010000 /* symlink needs interpretation */ +#define ISWHITEOUT 0x00020000 /* found whiteout */ +#define DOWHITEOUT 0x00040000 /* do whiteouts */ +#define WILLBEDIR 0x00080000 /* new files will be dirs; allow trailing / */ +#define ISUNICODE 0x00100000 /* current component name is unicode*/ +#define ISOPEN 0x00200000 /* caller is opening; return a real vnode. */ +#define NOCROSSMOUNT 0x00400000 /* do not cross mount points */ +#define NOMACCHECK 0x00800000 /* do not perform MAC checks */ +#define MPSAFE 0x01000000 /* namei() must acquire Giant if needed. */ +#define GIANTHELD 0x02000000 /* namei() is holding giant. */ +#define AUDITVNODE1 0x04000000 /* audit the looked up vnode information */ +#define AUDITVNODE2 0x08000000 /* audit the looked up vnode information */ +#define TRAILINGSLASH 0x10000000 /* path ended in a slash */ +#define PARAMASK 0x1ffffe00 /* mask of parameter descriptors */ #define NDHASGIANT(NDP) (((NDP)->ni_cnd.cn_flags & GIANTHELD) != 0) From owner-svn-src-stable-7@FreeBSD.ORG Sun Jun 21 19:50:07 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23A8C1065675; Sun, 21 Jun 2009 19:50: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 0F4B28FC15; Sun, 21 Jun 2009 19:50:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5LJo7aE017012; Sun, 21 Jun 2009 19:50:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5LJo64G016987; Sun, 21 Jun 2009 19:50:06 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906211950.n5LJo64G016987@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 21 Jun 2009 19:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194605 - in stable/7/usr.sbin/nscd: . agents X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2009 19:50:08 -0000 Author: des Date: Sun Jun 21 19:50:06 2009 New Revision: 194605 URL: http://svn.freebsd.org/changeset/base/194605 Log: merge r194086, r194087, r194089, r194091, r194093, r194094, r194095, r194096, r194097, r194098: fix aliasing and other bugs revealed by WARNS, major code cleanup Modified: stable/7/usr.sbin/nscd/ (props changed) stable/7/usr.sbin/nscd/Makefile stable/7/usr.sbin/nscd/agent.c stable/7/usr.sbin/nscd/agent.h stable/7/usr.sbin/nscd/agents/group.c stable/7/usr.sbin/nscd/agents/group.h stable/7/usr.sbin/nscd/agents/passwd.c stable/7/usr.sbin/nscd/agents/passwd.h stable/7/usr.sbin/nscd/agents/services.c stable/7/usr.sbin/nscd/agents/services.h stable/7/usr.sbin/nscd/cachelib.c stable/7/usr.sbin/nscd/cachelib.h stable/7/usr.sbin/nscd/cacheplcs.c stable/7/usr.sbin/nscd/cacheplcs.h stable/7/usr.sbin/nscd/config.c stable/7/usr.sbin/nscd/config.h stable/7/usr.sbin/nscd/debug.c stable/7/usr.sbin/nscd/debug.h stable/7/usr.sbin/nscd/hashtable.h stable/7/usr.sbin/nscd/log.c stable/7/usr.sbin/nscd/mp_rs_query.c stable/7/usr.sbin/nscd/mp_ws_query.c stable/7/usr.sbin/nscd/nscd.c stable/7/usr.sbin/nscd/nscdcli.c stable/7/usr.sbin/nscd/parser.c stable/7/usr.sbin/nscd/protocol.c stable/7/usr.sbin/nscd/protocol.h stable/7/usr.sbin/nscd/query.c stable/7/usr.sbin/nscd/query.h stable/7/usr.sbin/nscd/singletons.c Modified: stable/7/usr.sbin/nscd/Makefile ============================================================================== --- stable/7/usr.sbin/nscd/Makefile Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/Makefile Sun Jun 21 19:50:06 2009 (r194605) @@ -3,7 +3,7 @@ PROG= nscd MAN= nscd.conf.5 nscd.8 -WARNS?= 2 +WARNS?= 3 SRCS= agent.c nscd.c nscdcli.c cachelib.c cacheplcs.c debug.c log.c \ config.c query.c mp_ws_query.c mp_rs_query.c singletons.c protocol.c \ parser.c Modified: stable/7/usr.sbin/nscd/agent.c ============================================================================== --- stable/7/usr.sbin/nscd/agent.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/agent.c Sun Jun 21 19:50:06 2009 (r194605) @@ -29,8 +29,9 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include + #include "agent.h" #include "debug.h" @@ -55,7 +56,7 @@ agent_cmp_func(const void *a1, const voi } struct agent_table * -init_agent_table() +init_agent_table(void) { struct agent_table *retval; Modified: stable/7/usr.sbin/nscd/agent.h ============================================================================== --- stable/7/usr.sbin/nscd/agent.h Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/agent.h Sun Jun 21 19:50:06 2009 (r194605) @@ -53,7 +53,7 @@ struct common_agent { struct multipart_agent { struct agent parent; - void *(*mp_init_func)(); + void *(*mp_init_func)(void); int (*mp_lookup_func)(char **, size_t *, void *); void (*mp_destroy_func)(void *); }; @@ -63,7 +63,7 @@ struct agent_table { size_t agents_num; }; -extern struct agent_table *init_agent_table(); +extern struct agent_table *init_agent_table(void); extern void register_agent(struct agent_table *, struct agent *); extern struct agent *find_agent(struct agent_table *, const char *, enum agent_type); Modified: stable/7/usr.sbin/nscd/agents/group.c ============================================================================== --- stable/7/usr.sbin/nscd/agents/group.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/agents/group.c Sun Jun 21 19:50:06 2009 (r194605) @@ -29,18 +29,19 @@ __FBSDID("$FreeBSD$"); #include -#include + #include -#include #include -#include +#include #include +#include + #include "../debug.h" -#include "passwd.h" +#include "group.h" static int group_marshal_func(struct group *, char *, size_t *); static int group_lookup_func(const char *, size_t, char **, size_t *); -static void *group_mp_init_func(); +static void *group_mp_init_func(void); static int group_mp_lookup_func(char **, size_t *, void *); static void group_mp_destroy_func(void *); @@ -184,7 +185,7 @@ group_lookup_func(const char *key, size_ } static void * -group_mp_init_func() +group_mp_init_func(void) { TRACE_IN(group_mp_init_func); setgrent(); @@ -219,7 +220,7 @@ group_mp_destroy_func(void *mdata) } struct agent * -init_group_agent() +init_group_agent(void) { struct common_agent *retval; @@ -238,7 +239,7 @@ init_group_agent() } struct agent * -init_group_mp_agent() +init_group_mp_agent(void) { struct multipart_agent *retval; Modified: stable/7/usr.sbin/nscd/agents/group.h ============================================================================== --- stable/7/usr.sbin/nscd/agents/group.h Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/agents/group.h Sun Jun 21 19:50:06 2009 (r194605) @@ -28,5 +28,5 @@ #include "../agent.h" -extern struct agent *init_group_agent(); -extern struct agent *init_group_mp_agent(); +extern struct agent *init_group_agent(void); +extern struct agent *init_group_mp_agent(void); Modified: stable/7/usr.sbin/nscd/agents/passwd.c ============================================================================== --- stable/7/usr.sbin/nscd/agents/passwd.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/agents/passwd.c Sun Jun 21 19:50:06 2009 (r194605) @@ -29,17 +29,19 @@ __FBSDID("$FreeBSD$"); #include + #include #include #include -#include #include +#include + #include "../debug.h" #include "passwd.h" static int passwd_marshal_func(struct passwd *, char *, size_t *); static int passwd_lookup_func(const char *, size_t, char **, size_t *); -static void *passwd_mp_init_func(); +static void *passwd_mp_init_func(void); static int passwd_mp_lookup_func(char **, size_t *, void *); static void passwd_mp_destroy_func(void *mdata); @@ -191,7 +193,7 @@ passwd_lookup_func(const char *key, size } static void * -passwd_mp_init_func() +passwd_mp_init_func(void) { TRACE_IN(passwd_mp_init_func); setpwent(); @@ -226,7 +228,7 @@ passwd_mp_destroy_func(void *mdata) } struct agent * -init_passwd_agent() +init_passwd_agent(void) { struct common_agent *retval; @@ -245,7 +247,7 @@ init_passwd_agent() } struct agent * -init_passwd_mp_agent() +init_passwd_mp_agent(void) { struct multipart_agent *retval; Modified: stable/7/usr.sbin/nscd/agents/passwd.h ============================================================================== --- stable/7/usr.sbin/nscd/agents/passwd.h Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/agents/passwd.h Sun Jun 21 19:50:06 2009 (r194605) @@ -28,5 +28,5 @@ #include "../agent.h" -extern struct agent *init_passwd_agent(); -extern struct agent *init_passwd_mp_agent(); +extern struct agent *init_passwd_agent(void); +extern struct agent *init_passwd_mp_agent(void); Modified: stable/7/usr.sbin/nscd/agents/services.c ============================================================================== --- stable/7/usr.sbin/nscd/agents/services.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/agents/services.c Sun Jun 21 19:50:06 2009 (r194605) @@ -29,18 +29,19 @@ __FBSDID("$FreeBSD$"); #include -#include + #include -#include #include -#include +#include #include +#include + #include "../debug.h" #include "services.h" static int services_marshal_func(struct servent *, char *, size_t *); static int services_lookup_func(const char *, size_t, char **, size_t *); -static void *services_mp_init_func(); +static void *services_mp_init_func(void); static int services_mp_lookup_func(char **, size_t *, void *); static void services_mp_destroy_func(void *); @@ -205,7 +206,7 @@ services_lookup_func(const char *key, si } static void * -services_mp_init_func() +services_mp_init_func(void) { TRACE_IN(services_mp_init_func); setservent(0); @@ -240,7 +241,7 @@ services_mp_destroy_func(void *mdata) } struct agent * -init_services_agent() +init_services_agent(void) { struct common_agent *retval; TRACE_IN(init_services_agent); @@ -259,7 +260,7 @@ init_services_agent() } struct agent * -init_services_mp_agent() +init_services_mp_agent(void) { struct multipart_agent *retval; Modified: stable/7/usr.sbin/nscd/agents/services.h ============================================================================== --- stable/7/usr.sbin/nscd/agents/services.h Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/agents/services.h Sun Jun 21 19:50:06 2009 (r194605) @@ -28,5 +28,5 @@ #include "../agent.h" -extern struct agent *init_services_agent(); -extern struct agent *init_services_mp_agent(); +extern struct agent *init_services_agent(void); +extern struct agent *init_services_mp_agent(void); Modified: stable/7/usr.sbin/nscd/cachelib.c ============================================================================== --- stable/7/usr.sbin/nscd/cachelib.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/cachelib.c Sun Jun 21 19:50:06 2009 (r194605) @@ -29,9 +29,11 @@ __FBSDID("$FreeBSD$"); #include + #include #include #include + #include "cachelib.h" #include "debug.h" @@ -144,6 +146,7 @@ ht_item_hash_func(const void *p, size_t return retval; } +HASHTABLE_PROTOTYPE(cache_ht_, cache_ht_item_, struct cache_ht_item_data_); HASHTABLE_GENERATE(cache_ht_, cache_ht_item_, struct cache_ht_item_data_, data, ht_item_hash_func, ht_items_cmp_func); @@ -289,7 +292,7 @@ clear_cache_entry(struct cache_entry_ *e struct cache_policy_ *policy; struct cache_policy_item_ *item, *next_item; size_t entry_size; - int i; + unsigned int i; if (entry->params->entry_type == CET_COMMON) { common_entry = (struct cache_common_entry_ *)entry; @@ -394,7 +397,6 @@ flush_cache_policy(struct cache_common_e hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &entry->items, &ht_key); - assert(hash >= 0); assert(hash < HASHTABLE_ENTRIES_COUNT(&entry->items)); ht_item = HASHTABLE_GET_ENTRY(&(entry->items), hash); @@ -563,13 +565,13 @@ register_cache_entry(struct cache_ *the_ new_common_entry->params = (struct cache_entry_params *)&new_common_entry->common_params; - new_common_entry->common_params.entry_name = (char *)calloc(1, + new_common_entry->common_params.cep.entry_name = (char *)calloc(1, entry_name_size); - assert(new_common_entry->common_params.entry_name != NULL); - strlcpy(new_common_entry->common_params.entry_name, + assert(new_common_entry->common_params.cep.entry_name != NULL); + strlcpy(new_common_entry->common_params.cep.entry_name, params->entry_name, entry_name_size); new_common_entry->name = - new_common_entry->common_params.entry_name; + new_common_entry->common_params.cep.entry_name; HASHTABLE_INIT(&(new_common_entry->items), struct cache_ht_item_data_, data, @@ -617,12 +619,12 @@ register_cache_entry(struct cache_ *the_ new_mp_entry->params = (struct cache_entry_params *)&new_mp_entry->mp_params; - new_mp_entry->mp_params.entry_name = (char *)calloc(1, + new_mp_entry->mp_params.cep.entry_name = (char *)calloc(1, entry_name_size); - assert(new_mp_entry->mp_params.entry_name != NULL); - strlcpy(new_mp_entry->mp_params.entry_name, params->entry_name, + assert(new_mp_entry->mp_params.cep.entry_name != NULL); + strlcpy(new_mp_entry->mp_params.cep.entry_name, params->entry_name, entry_name_size); - new_mp_entry->name = new_mp_entry->mp_params.entry_name; + new_mp_entry->name = new_mp_entry->mp_params.cep.entry_name; TAILQ_INIT(&new_mp_entry->ws_head); TAILQ_INIT(&new_mp_entry->rs_head); @@ -716,7 +718,6 @@ cache_read(struct cache_entry_ *entry, c hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &common_entry->items, &item_data); - assert(hash >= 0); assert(hash < HASHTABLE_ENTRIES_COUNT(&common_entry->items)); item = HASHTABLE_GET_ENTRY(&(common_entry->items), hash); @@ -820,7 +821,6 @@ cache_write(struct cache_entry_ *entry, hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &common_entry->items, &item_data); - assert(hash >= 0); assert(hash < HASHTABLE_ENTRIES_COUNT(&common_entry->items)); item = HASHTABLE_GET_ENTRY(&(common_entry->items), hash); Modified: stable/7/usr.sbin/nscd/cachelib.h ============================================================================== --- stable/7/usr.sbin/nscd/cachelib.h Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/cachelib.h Sun Jun 21 19:50:06 2009 (r194605) @@ -29,9 +29,6 @@ #ifndef __NSCD_CACHELIB_H__ #define __NSCD_CACHELIB_H__ -#include -#include -#include #include "hashtable.h" #include "cacheplcs.h" @@ -90,11 +87,8 @@ struct cache_entry_params /* params, used for most entries */ struct common_cache_entry_params { - /* inherited fields */ - enum cache_entry_t entry_type; + struct cache_entry_params cep; - /* unique fields */ - char *entry_name; size_t cache_entries_size; size_t max_elemsize; /* if 0 then no check is made */ @@ -108,9 +102,7 @@ struct common_cache_entry_params /* params, used for multipart entries */ struct mp_cache_entry_params { - /* inherited fields */ - enum cache_entry_t entry_type; - char *entry_name; + struct cache_entry_params cep; /* unique fields */ size_t max_elemsize; /* if 0 then no check is made */ Modified: stable/7/usr.sbin/nscd/cacheplcs.c ============================================================================== --- stable/7/usr.sbin/nscd/cacheplcs.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/cacheplcs.c Sun Jun 21 19:50:06 2009 (r194605) @@ -28,8 +28,12 @@ #include __FBSDID("$FreeBSD$"); +#include + #include +#include #include + #include "cacheplcs.h" #include "debug.h" @@ -55,7 +59,7 @@ static void cache_lru_policy_update_item struct cache_policy_item_ *); static void cache_queue_policy_add_item(struct cache_policy_ *, struct cache_policy_item_ *); -static struct cache_policy_item_ * cache_queue_policy_create_item(); +static struct cache_policy_item_ * cache_queue_policy_create_item(void); static void cache_queue_policy_destroy_item(struct cache_policy_item_ *); static struct cache_policy_item_ *cache_queue_policy_get_first_item( struct cache_policy_ *); @@ -77,7 +81,7 @@ static struct cache_queue_policy_ *init_ * cache_queue_policy_ with cache_update_item function changed. */ static struct cache_policy_item_ * -cache_queue_policy_create_item() +cache_queue_policy_create_item(void) { struct cache_queue_policy_item_ *retval; @@ -248,7 +252,7 @@ cache_fifo_policy_update_item(struct cac } struct cache_policy_ * -init_cache_fifo_policy() +init_cache_fifo_policy(void) { struct cache_queue_policy_ *retval; @@ -293,7 +297,7 @@ cache_lru_policy_update_item(struct cach } struct cache_policy_ * -init_cache_lru_policy() +init_cache_lru_policy(void) { struct cache_queue_policy_ *retval; @@ -530,7 +534,7 @@ cache_lfu_policy_get_prev_item(struct ca * functions pointers */ struct cache_policy_ * -init_cache_lfu_policy() +init_cache_lfu_policy(void) { int i; struct cache_lfu_policy_ *retval; Modified: stable/7/usr.sbin/nscd/cacheplcs.h ============================================================================== --- stable/7/usr.sbin/nscd/cacheplcs.h Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/cacheplcs.h Sun Jun 21 19:50:06 2009 (r194605) @@ -30,8 +30,6 @@ #define __NSCD_CACHEPLCS_H__ #include -#include -#include /* common policy definitions */ #define CACHELIB_MAX_FREQUENCY 100 @@ -59,7 +57,7 @@ struct cache_policy_item_ */ struct cache_policy_ { - struct cache_policy_item_* (*create_item_func)(); + struct cache_policy_item_* (*create_item_func)(void); void (*destroy_item_func)(struct cache_policy_item_ *); void (*add_item_func)(struct cache_policy_ *, @@ -123,15 +121,15 @@ typedef struct cache_queue_policy_ cache typedef struct cache_queue_policy_ cache_lru_policy_; /* fifo policy routines */ -extern struct cache_policy_ *init_cache_fifo_policy(); +extern struct cache_policy_ *init_cache_fifo_policy(void); extern void destroy_cache_fifo_policy(struct cache_policy_ *); /* lru policy routines */ -extern struct cache_policy_ *init_cache_lru_policy(); +extern struct cache_policy_ *init_cache_lru_policy(void); extern void destroy_cache_lru_policy(struct cache_policy_ *); /* lfu policy routines */ -extern struct cache_policy_ *init_cache_lfu_policy(); +extern struct cache_policy_ *init_cache_lfu_policy(void); extern void destroy_cache_lfu_policy(struct cache_policy_ *); #endif Modified: stable/7/usr.sbin/nscd/config.c ============================================================================== --- stable/7/usr.sbin/nscd/config.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/config.c Sun Jun 21 19:50:06 2009 (r194605) @@ -28,11 +28,17 @@ #include __FBSDID("$FreeBSD$"); +#include +#include + #include #include +#include +#include #include #include #include + #include "config.h" #include "debug.h" #include "log.h" @@ -170,14 +176,14 @@ create_configuration_entry(const char *n memcpy(&retval->mp_query_timeout, mp_timeout, sizeof(struct timeval)); - asprintf(&retval->positive_cache_params.entry_name, "%s+", name); - assert(retval->positive_cache_params.entry_name != NULL); + asprintf(&retval->positive_cache_params.cep.entry_name, "%s+", name); + assert(retval->positive_cache_params.cep.entry_name != NULL); - asprintf(&retval->negative_cache_params.entry_name, "%s-", name); - assert(retval->negative_cache_params.entry_name != NULL); + asprintf(&retval->negative_cache_params.cep.entry_name, "%s-", name); + assert(retval->negative_cache_params.cep.entry_name != NULL); - asprintf(&retval->mp_cache_params.entry_name, "%s*", name); - assert(retval->mp_cache_params.entry_name != NULL); + asprintf(&retval->mp_cache_params.cep.entry_name, "%s*", name); + assert(retval->mp_cache_params.cep.entry_name != NULL); TRACE_OUT(create_configuration_entry); return (retval); @@ -198,7 +204,7 @@ create_def_configuration_entry(const cha TRACE_IN(create_def_configuration_entry); memset(&positive_params, 0, sizeof(struct common_cache_entry_params)); - positive_params.entry_type = CET_COMMON; + positive_params.cep.entry_type = CET_COMMON; positive_params.cache_entries_size = DEFAULT_CACHE_HT_SIZE; positive_params.max_elemsize = DEFAULT_POSITIVE_ELEMENTS_SIZE; positive_params.satisf_elemsize = DEFAULT_POSITIVE_ELEMENTS_SIZE / 2; @@ -220,7 +226,7 @@ create_def_configuration_entry(const cha memset(&mp_params, 0, sizeof(struct mp_cache_entry_params)); - mp_params.entry_type = CET_MULTIPART; + mp_params.cep.entry_type = CET_MULTIPART; mp_params.max_elemsize = DEFAULT_MULTIPART_ELEMENTS_SIZE; mp_params.max_sessions = DEFAULT_MULITPART_SESSIONS_SIZE; mp_params.max_lifetime.tv_sec = DEFAULT_MULITPART_LIFETIME; @@ -242,9 +248,9 @@ destroy_configuration_entry(struct confi pthread_mutex_destroy(&entry->negative_cache_lock); pthread_mutex_destroy(&entry->mp_cache_lock); free(entry->name); - free(entry->positive_cache_params.entry_name); - free(entry->negative_cache_params.entry_name); - free(entry->mp_cache_params.entry_name); + free(entry->positive_cache_params.cep.entry_name); + free(entry->negative_cache_params.cep.entry_name); + free(entry->mp_cache_params.cep.entry_name); free(entry->mp_cache_entries); free(entry); TRACE_OUT(destroy_configuration_entry); @@ -563,7 +569,8 @@ fill_configuration_defaults(struct confi void destroy_configuration(struct configuration *config) { - int i; + unsigned int i; + TRACE_IN(destroy_configuration); assert(config != NULL); free(config->pidfile_path); Modified: stable/7/usr.sbin/nscd/config.h ============================================================================== --- stable/7/usr.sbin/nscd/config.h Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/config.h Sun Jun 21 19:50:06 2009 (r194605) @@ -29,11 +29,6 @@ #ifndef __NSCD_CONFIG_H__ #define __NSCD_CONFIG_H__ -#include -#include -#include -#include -#include #include "cachelib.h" #define DEFAULT_QUERY_TIMEOUT 8 Modified: stable/7/usr.sbin/nscd/debug.c ============================================================================== --- stable/7/usr.sbin/nscd/debug.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/debug.c Sun Jun 21 19:50:06 2009 (r194605) @@ -29,13 +29,14 @@ __FBSDID("$FreeBSD$"); #include + #include "debug.h" static int trace_level = 0; static int trace_level_bk = 0; void -__trace_in(const char *s, const char *f, int l) +nscd_trace_in(const char *s, const char *f, int l) { int i; if (trace_level < TRACE_WANTED) @@ -50,7 +51,7 @@ __trace_in(const char *s, const char *f, } void -__trace_point(const char *f, int l) +nscd_trace_point(const char *f, int l) { int i; @@ -64,7 +65,7 @@ __trace_point(const char *f, int l) } void -__trace_msg(const char *msg, const char *f, int l) +nscd_trace_msg(const char *msg, const char *f, int l) { int i; @@ -78,7 +79,7 @@ __trace_msg(const char *msg, const char } void -__trace_ptr(const char *desc, const void *p, const char *f, int l) +nscd_trace_ptr(const char *desc, const void *p, const char *f, int l) { int i; @@ -92,7 +93,7 @@ __trace_ptr(const char *desc, const void } void -__trace_int(const char *desc, int i, const char *f, int l) +nscd_trace_int(const char *desc, int i, const char *f, int l) { int j; @@ -106,7 +107,7 @@ __trace_int(const char *desc, int i, con } void -__trace_str(const char *desc, const char *s, const char *f, int l) +nscd_trace_str(const char *desc, const char *s, const char *f, int l) { int i; @@ -120,7 +121,7 @@ __trace_str(const char *desc, const char } void -__trace_out(const char *s, const char *f, int l) +nscd_trace_out(const char *s, const char *f, int l) { int i; @@ -135,14 +136,14 @@ __trace_out(const char *s, const char *f } void -__trace_on() +nscd_trace_on(void) { trace_level = trace_level_bk; trace_level_bk = 0; } void -__trace_off() +nscd_trace_off(void) { trace_level_bk = trace_level; trace_level = 1024; Modified: stable/7/usr.sbin/nscd/debug.h ============================================================================== --- stable/7/usr.sbin/nscd/debug.h Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/debug.h Sun Jun 21 19:50:06 2009 (r194605) @@ -33,35 +33,35 @@ /* #ifndef NDEBUG */ #if 0 -#define TRACE_IN(x) __trace_in(#x, __FILE__, __LINE__) -#define TRACE_POINT() __trace_point(__FILE__, __LINE__) -#define TRACE_MSG(x) __trace_msg(x, __FILE__, __LINE__) -#define TRACE_PTR(p) __trace_ptr(#p, p, __FILE__, __LINE__) -#define TRACE_INT(i) __trace_int(#i, i, __FILE__, __LINE__) -#define TRACE_STR(s) __trace_str(#s, s, __FILE__, __LINE__) -#define TRACE_OUT(x) __trace_out(#x, __FILE__, __LINE__) -#define TRACE_ON() __trace_on() -#define TRACE_OFF() __trace_off() +#define TRACE_IN(x) nscd_trace_in(#x, __FILE__, __LINE__) +#define TRACE_POINT() nscd_trace_point(__FILE__, __LINE__) +#define TRACE_MSG(x) nscd_trace_msg(x, __FILE__, __LINE__) +#define TRACE_PTR(p) nscd_trace_ptr(#p, p, __FILE__, __LINE__) +#define TRACE_INT(i) nscd_trace_int(#i, i, __FILE__, __LINE__) +#define TRACE_STR(s) nscd_trace_str(#s, s, __FILE__, __LINE__) +#define TRACE_OUT(x) nscd_trace_out(#x, __FILE__, __LINE__) +#define TRACE_ON() nscd_trace_on() +#define TRACE_OFF() nscd_trace_off() #else -#define TRACE_IN(x) -#define TRACE_POINT() -#define TRACE_MSG(x) -#define TRACE_PTR(p) -#define TRACE_INT(i) -#define TRACE_STR(s) -#define TRACE_OUT(x) -#define TRACE_ON() -#define TRACE_OFF() +#define TRACE_IN(x) (void)0 +#define TRACE_POINT() (void)0 +#define TRACE_MSG(x) (void)0 +#define TRACE_PTR(p) (void)0 +#define TRACE_INT(i) (void)0 +#define TRACE_STR(s) (void)0 +#define TRACE_OUT(x) (void)0 +#define TRACE_ON() (void)0 +#define TRACE_OFF() (void)0 #endif -extern void __trace_in(const char *, const char *, int); -extern void __trace_point(const char *, int); -extern void __trace_msg(const char *, const char *, int); -extern void __trace_ptr(const char *, const void *, const char *, int); -extern void __trace_int(const char *, int, const char *, int); -extern void __trace_str(const char *, const char *, const char *, int); -extern void __trace_out(const char *, const char *, int); -extern void __trace_on(); -extern void __trace_off(); +extern void nscd_trace_in(const char *, const char *, int); +extern void nscd_trace_point(const char *, int); +extern void nscd_trace_msg(const char *, const char *, int); +extern void nscd_trace_ptr(const char *, const void *, const char *, int); +extern void nscd_trace_int(const char *, int, const char *, int); +extern void nscd_trace_str(const char *, const char *, const char *, int); +extern void nscd_trace_out(const char *, const char *, int); +extern void nscd_trace_on(void); +extern void nscd_trace_off(void); #endif Modified: stable/7/usr.sbin/nscd/hashtable.h ============================================================================== --- stable/7/usr.sbin/nscd/hashtable.h Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/hashtable.h Sun Jun 21 19:50:06 2009 (r194605) @@ -29,11 +29,10 @@ #ifndef __CACHELIB_HASHTABLE_H__ #define __CACHELIB_HASHTABLE_H__ -#include #include #define HASHTABLE_INITIAL_ENTRIES_CAPACITY 8 -typedef int hashtable_index_t; +typedef unsigned int hashtable_index_t; /* * This file contains queue.h-like macro definitions for hash tables. Modified: stable/7/usr.sbin/nscd/log.c ============================================================================== --- stable/7/usr.sbin/nscd/log.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/log.c Sun Jun 21 19:50:06 2009 (r194605) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include "log.h" void Modified: stable/7/usr.sbin/nscd/mp_rs_query.c ============================================================================== --- stable/7/usr.sbin/nscd/mp_rs_query.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/mp_rs_query.c Sun Jun 21 19:50:06 2009 (r194605) @@ -28,15 +28,17 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include #include +#include +#include + #include #include +#include +#include #include #include -#include #include "cachelib.h" #include "config.h" @@ -138,7 +140,7 @@ on_mp_read_session_request_read2(struct result = qstate->read_func(qstate, c_mp_rs_request->entry, c_mp_rs_request->entry_length); - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { LOG_ERR_3("on_mp_read_session_request_read2", "read failed"); TRACE_OUT(on_mp_read_session_request_read2); @@ -196,7 +198,7 @@ on_mp_read_session_request_process(struc if (qstate->config_entry->perform_actual_lookups != 0) dec_cache_entry_name = strdup( - qstate->config_entry->mp_cache_params.entry_name); + qstate->config_entry->mp_cache_params.cep.entry_name); else { #ifdef NS_NSCD_EID_CHECKING if (check_query_eids(qstate) != 0) { @@ -206,7 +208,7 @@ on_mp_read_session_request_process(struc #endif asprintf(&dec_cache_entry_name, "%s%s", qstate->eid_str, - qstate->config_entry->mp_cache_params.entry_name); + qstate->config_entry->mp_cache_params.cep.entry_name); } assert(dec_cache_entry_name != NULL); @@ -461,7 +463,7 @@ on_mp_read_session_read_response_write1( if (read_response->error_code == 0) { result += qstate->write_func(qstate, &read_response->data_size, sizeof(size_t)); - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { TRACE_OUT(on_mp_read_session_read_response_write1); LOG_ERR_3("on_mp_read_session_read_response_write1", "write failed"); @@ -471,7 +473,7 @@ on_mp_read_session_read_response_write1( qstate->kevent_watermark = read_response->data_size; qstate->process_func = on_mp_read_session_read_response_write2; } else { - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { LOG_ERR_3("on_mp_read_session_read_response_write1", "write failed"); TRACE_OUT(on_mp_read_session_read_response_write1); @@ -497,7 +499,7 @@ on_mp_read_session_read_response_write2( &qstate->response); result = qstate->write_func(qstate, read_response->data, read_response->data_size); - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { LOG_ERR_3("on_mp_read_session_read_response_write2", "write failed"); TRACE_OUT(on_mp_read_session_read_response_write2); Modified: stable/7/usr.sbin/nscd/mp_ws_query.c ============================================================================== --- stable/7/usr.sbin/nscd/mp_ws_query.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/mp_ws_query.c Sun Jun 21 19:50:06 2009 (r194605) @@ -28,15 +28,16 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include #include +#include +#include + #include #include +#include #include #include -#include #include "cachelib.h" #include "config.h" @@ -144,7 +145,7 @@ on_mp_write_session_request_read2(struct result = qstate->read_func(qstate, c_mp_ws_request->entry, c_mp_ws_request->entry_length); - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { LOG_ERR_3("on_mp_write_session_request_read2", "read failed"); TRACE_OUT(on_mp_write_session_request_read2); @@ -215,7 +216,7 @@ on_mp_write_session_request_process(stru * cache entries - each with its own decorated name. */ asprintf(&dec_cache_entry_name, "%s%s", qstate->eid_str, - qstate->config_entry->mp_cache_params.entry_name); + qstate->config_entry->mp_cache_params.cep.entry_name); assert(dec_cache_entry_name != NULL); configuration_lock_rdlock(s_configuration); @@ -396,7 +397,7 @@ on_mp_write_session_write_request_read2( result = qstate->read_func(qstate, write_request->data, write_request->data_size); - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { LOG_ERR_3("on_mp_write_session_write_request_read2", "read failed"); TRACE_OUT(on_mp_write_session_write_request_read2); @@ -521,12 +522,12 @@ cache_entry register_new_mp_cache_entry( configuration_lock_entry(qstate->config_entry, CELT_MULTIPART); configuration_lock_wrlock(s_configuration); - en_bkp = qstate->config_entry->mp_cache_params.entry_name; - qstate->config_entry->mp_cache_params.entry_name = + en_bkp = qstate->config_entry->mp_cache_params.cep.entry_name; + qstate->config_entry->mp_cache_params.cep.entry_name = (char *)dec_cache_entry_name; register_cache_entry(s_cache, (struct cache_entry_params *) &qstate->config_entry->mp_cache_params); - qstate->config_entry->mp_cache_params.entry_name = en_bkp; + qstate->config_entry->mp_cache_params.cep.entry_name = en_bkp; configuration_unlock(s_configuration); configuration_lock_rdlock(s_configuration); Modified: stable/7/usr.sbin/nscd/nscd.c ============================================================================== --- stable/7/usr.sbin/nscd/nscd.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/nscd.c Sun Jun 21 19:50:06 2009 (r194605) @@ -28,12 +28,13 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include +#include #include -#include #include + #include #include #include @@ -122,14 +123,14 @@ init_cache_(struct configuration *config res = register_cache_entry(retval, (struct cache_entry_params *) &config_entry->positive_cache_params); config_entry->positive_cache_entry = find_cache_entry(retval, - config_entry->positive_cache_params.entry_name); + config_entry->positive_cache_params.cep.entry_name); assert(config_entry->positive_cache_entry != INVALID_CACHE_ENTRY); res = register_cache_entry(retval, (struct cache_entry_params *) &config_entry->negative_cache_params); config_entry->negative_cache_entry = find_cache_entry(retval, - config_entry->negative_cache_params.entry_name); + config_entry->negative_cache_params.cep.entry_name); assert(config_entry->negative_cache_entry != INVALID_CACHE_ENTRY); } @@ -315,9 +316,9 @@ process_socket_event(struct kevent *even * operations. It also does the actual socket IO operations. */ if (((qstate->use_alternate_io == 0) && - (qstate->kevent_watermark <= event_data->data)) || + (qstate->kevent_watermark <= (size_t)event_data->data)) || ((qstate->use_alternate_io != 0) && - (qstate->io_buffer_watermark <= event_data->data))) { + (qstate->io_buffer_watermark <= (size_t)event_data->data))) { if (qstate->use_alternate_io != 0) { switch (qstate->io_buffer_filter) { case EVFILT_READ: @@ -499,7 +500,7 @@ processing_loop(cache the_cache, struct struct kevent *event_data; event_data = &eventlist[0]; - if (event_data->ident == env->sockfd) { + if ((int)event_data->ident == env->sockfd) { for (i = 0; i < event_data->data; ++i) accept_connection(event_data, env, config); @@ -573,17 +574,17 @@ get_time_func(struct timeval *time) } /* - * The idea of _nss_cache_cycle_prevention_function is that nsdispatch will - * search for this symbol in the executable. This symbol is the attribute of - * the caching daemon. So, if it exists, nsdispatch won't try to connect to - * the caching daemon and will just ignore the 'cache' source in the - * nsswitch.conf. This method helps to avoid cycles and organize - * self-performing requests. + * The idea of _nss_cache_cycle_prevention_function is that nsdispatch + * will search for this symbol in the executable. This symbol is the + * attribute of the caching daemon. So, if it exists, nsdispatch won't try + * to connect to the caching daemon and will just ignore the 'cache' + * source in the nsswitch.conf. This method helps to avoid cycles and + * organize self-performing requests. + * + * (not actually a function; it used to be, but it doesn't make any + * difference, as long as it has external linkage) */ -void -_nss_cache_cycle_prevention_function(void) -{ -} +void *_nss_cache_cycle_prevention_function; int main(int argc, char *argv[]) Modified: stable/7/usr.sbin/nscd/nscdcli.c ============================================================================== --- stable/7/usr.sbin/nscd/nscdcli.c Sun Jun 21 19:39:34 2009 (r194604) +++ stable/7/usr.sbin/nscd/nscdcli.c Sun Jun 21 19:50:06 2009 (r194605) @@ -29,10 +29,12 @@ __FBSDID("$FreeBSD$"); #include -#include + #include +#include #include #include + #include #include #include @@ -70,9 +72,10 @@ safe_write(struct nscd_connection_ *conn nevents = kevent(connection->write_queue, NULL, 0, &eventlist, 1, &timeout); if ((nevents == 1) && (eventlist.filter == EVFILT_WRITE)) { - s_result = write(connection->sockfd, data + result, - eventlist.data < data_size - result ? - eventlist.data : data_size - result); + s_result = write(connection->sockfd, + (char *)data + result, + (size_t)eventlist.data < data_size - result ? + (size_t)eventlist.data : data_size - result); if (s_result == -1) return (-1); else @@ -106,9 +109,10 @@ safe_read(struct nscd_connection_ *conne nevents = kevent(connection->read_queue, NULL, 0, &eventlist, 1, &timeout); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Mon Jun 22 13:46:00 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 658C3106566C; Mon, 22 Jun 2009 13:46:00 +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 533CB8FC08; Mon, 22 Jun 2009 13:46:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5MDk0Dw040867; Mon, 22 Jun 2009 13:46:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5MDk0VM040865; Mon, 22 Jun 2009 13:46:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906221346.n5MDk0VM040865@svn.freebsd.org> From: John Baldwin Date: Mon, 22 Jun 2009 13:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194623 - stable/7/lib/libmemstat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2009 13:46:01 -0000 Author: jhb Date: Mon Jun 22 13:46:00 2009 New Revision: 194623 URL: http://svn.freebsd.org/changeset/base/194623 Log: MFC: Update the KVM backend for malloc stats to catch up to the internal structure BI change from the addition of DTrace malloc(9) probes. Modified: stable/7/lib/libmemstat/ (props changed) stable/7/lib/libmemstat/memstat_malloc.c Modified: stable/7/lib/libmemstat/memstat_malloc.c ============================================================================== --- stable/7/lib/libmemstat/memstat_malloc.c Mon Jun 22 10:59:34 2009 (r194622) +++ stable/7/lib/libmemstat/memstat_malloc.c Mon Jun 22 13:46:00 2009 (r194623) @@ -296,6 +296,7 @@ memstat_kvm_malloc(struct memory_type_li int hint_dontsearch, j, mp_maxcpus, ret; char name[MEMTYPE_MAXNAME]; struct malloc_type_stats mts[MEMSTAT_MAXCPU], *mtsp; + struct malloc_type_internal *mtip; struct malloc_type type, *typep; kvm_t *kvm; @@ -349,13 +350,11 @@ memstat_kvm_malloc(struct memory_type_li } /* - * Take advantage of explicit knowledge that - * malloc_type_internal is simply an array of statistics - * structures of number MAXCPU. Since our compile-time - * value for MAXCPU may differ from the kernel's, we - * populate our own array. + * Since our compile-time value for MAXCPU may differ from the + * kernel's, we populate our own array. */ - ret = kread(kvm, type.ks_handle, mts, mp_maxcpus * + mtip = type.ks_handle; + ret = kread(kvm, mtip->mti_stats, mts, mp_maxcpus * sizeof(struct malloc_type_stats), 0); if (ret != 0) { _memstat_mtl_empty(list); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jun 22 14:21:15 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DEFC106564A; Mon, 22 Jun 2009 14:21:15 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B24C8FC16; Mon, 22 Jun 2009 14:21:15 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5MELEfd043394; Mon, 22 Jun 2009 14:21:14 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5MELEQU043388; Mon, 22 Jun 2009 14:21:14 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906221421.n5MELEQU043388@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 22 Jun 2009 14:21:14 +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: r194624 - stable/7/sbin/ipfw X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2009 14:21:15 -0000 Author: luigi Date: Mon Jun 22 14:21:14 2009 New Revision: 194624 URL: http://svn.freebsd.org/changeset/base/194624 Log: MFC: various minor fixes including - use a format string in a printf() - move a variable declaration at the beginning of a block - const-ify strings - fix prototypes Modified: stable/7/sbin/ipfw/altq.c stable/7/sbin/ipfw/dummynet.c stable/7/sbin/ipfw/ipfw2.c stable/7/sbin/ipfw/main.c stable/7/sbin/ipfw/nat.c Modified: stable/7/sbin/ipfw/altq.c ============================================================================== --- stable/7/sbin/ipfw/altq.c Mon Jun 22 13:46:00 2009 (r194623) +++ stable/7/sbin/ipfw/altq.c Mon Jun 22 14:21:14 2009 (r194624) @@ -121,7 +121,7 @@ altq_name_to_qid(const char *name) return altq->qid; } -const char * +static const char * altq_qid_to_name(u_int32_t qid) { struct pf_altq *altq; Modified: stable/7/sbin/ipfw/dummynet.c ============================================================================== --- stable/7/sbin/ipfw/dummynet.c Mon Jun 22 13:46:00 2009 (r194623) +++ stable/7/sbin/ipfw/dummynet.c Mon Jun 22 14:21:14 2009 (r194624) @@ -297,8 +297,6 @@ ipfw_list_pipes(void *data, uint nbytes, sprintf(prefix, "%05d: %s %4d ms ", p->pipe_nr, buf, p->delay); print_flowset_parms(&(p->fs), prefix); - if (co.verbose) - printf(" V %20llu\n", align_uint64(&p->V) >> MY_M); q = (struct dn_flow_queue *)(p+1); list_queues(&(p->fs), q); Modified: stable/7/sbin/ipfw/ipfw2.c ============================================================================== --- stable/7/sbin/ipfw/ipfw2.c Mon Jun 22 13:46:00 2009 (r194623) +++ stable/7/sbin/ipfw/ipfw2.c Mon Jun 22 14:21:14 2009 (r194624) @@ -507,7 +507,7 @@ print_newports(ipfw_insn_u16 *cmd, int p } sep = " "; for (i = F_LEN((ipfw_insn *)cmd) - 1; i > 0; i--, p += 2) { - printf(sep); + printf("%s", sep); print_port(proto, p[0]); if (p[0] != p[1]) { printf("-"); Modified: stable/7/sbin/ipfw/main.c ============================================================================== --- stable/7/sbin/ipfw/main.c Mon Jun 22 13:46:00 2009 (r194623) +++ stable/7/sbin/ipfw/main.c Mon Jun 22 14:21:14 2009 (r194624) @@ -104,6 +104,7 @@ ipfw_main(int oldac, char **oldav) const char *errstr; char **av, **save_av; int do_acct = 0; /* Show packet/byte count */ + int try_next = 0; #define WHITESP " \t\f\v\n\r" if (oldac < 2) @@ -332,7 +333,6 @@ ipfw_main(int oldac, char **oldav) av[1] = p; } - int try_next = 0; if (co.use_set == 0) { if (_substrcmp(*av, "add") == 0) ipfw_add(ac, av); Modified: stable/7/sbin/ipfw/nat.c ============================================================================== --- stable/7/sbin/ipfw/nat.c Mon Jun 22 13:46:00 2009 (r194623) +++ stable/7/sbin/ipfw/nat.c Mon Jun 22 14:21:14 2009 (r194624) @@ -384,7 +384,7 @@ nospace: } static int -setup_redir_port(char *spool_buf, int len, +setup_redir_port(char *spool_buf, unsigned int len, int *_ac, char ***_av) { char **av, *sep, *protoName; @@ -575,7 +575,7 @@ nospace: } static int -setup_redir_proto(char *spool_buf, int len, +setup_redir_proto(char *spool_buf, unsigned int len, int *_ac, char ***_av) { char **av; @@ -858,8 +858,8 @@ ipfw_config_nat(int ac, char **av) if (!co.do_quiet) { /* After every modification, we show the resultant rule. */ int _ac = 3; - char *_av[] = {"show", "config", id}; - ipfw_show_nat(_ac, _av); + const char *_av[] = {"show", "config", id}; + ipfw_show_nat(_ac, (char **)(void *)_av); } } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jun 22 14:32:47 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE9461065670; Mon, 22 Jun 2009 14:32:47 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC1C58FC08; Mon, 22 Jun 2009 14:32:47 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5MEWllF043638; Mon, 22 Jun 2009 14:32:47 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5MEWlAq043636; Mon, 22 Jun 2009 14:32:47 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906221432.n5MEWlAq043636@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 22 Jun 2009 14:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194625 - stable/7/sbin/ipfw X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2009 14:32:48 -0000 Author: luigi Date: Mon Jun 22 14:32:47 2009 New Revision: 194625 URL: http://svn.freebsd.org/changeset/base/194625 Log: MFC: another prototype missed in previous commit Modified: stable/7/sbin/ipfw/nat.c Modified: stable/7/sbin/ipfw/nat.c ============================================================================== --- stable/7/sbin/ipfw/nat.c Mon Jun 22 14:21:14 2009 (r194624) +++ stable/7/sbin/ipfw/nat.c Mon Jun 22 14:32:47 2009 (r194625) @@ -319,7 +319,7 @@ StrToAddrAndPortRange (const char* str, */ static int -setup_redir_addr(char *spool_buf, int len, +setup_redir_addr(char *spool_buf, unsigned int len, int *_ac, char ***_av) { char **av, *sep; /* Token separator. */ From owner-svn-src-stable-7@FreeBSD.ORG Mon Jun 22 16:11:34 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB272106564A; Mon, 22 Jun 2009 16:11:34 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8D7A8FC19; Mon, 22 Jun 2009 16:11:34 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5MGBYVx045995; Mon, 22 Jun 2009 16:11:34 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5MGBYPd045993; Mon, 22 Jun 2009 16:11:34 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200906221611.n5MGBYPd045993@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 22 Jun 2009 16:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194636 - stable/7/usr.bin/w X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2009 16:11:35 -0000 Author: ume Date: Mon Jun 22 16:11:34 2009 New Revision: 194636 URL: http://svn.freebsd.org/changeset/base/194636 Log: MFC 181922: %b and %p may contain multibyte characters. Noticed by: nyan Modified: stable/7/usr.bin/w/ (props changed) stable/7/usr.bin/w/pr_time.c Modified: stable/7/usr.bin/w/pr_time.c ============================================================================== --- stable/7/usr.bin/w/pr_time.c Mon Jun 22 16:06:38 2009 (r194635) +++ stable/7/usr.bin/w/pr_time.c Mon Jun 22 16:11:34 2009 (r194636) @@ -44,6 +44,7 @@ static const char sccsid[] = "@(#)pr_tim #include #include +#include #include "extern.h" @@ -82,7 +83,7 @@ pr_attime(time_t *started, time_t *now) } (void)strftime(buf, sizeof(buf), fmt, &tp); - (void)printf("%-7.7s", buf); + (void)wprintf(L"%-7.7s", buf); } /* From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 09:51:39 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A22F106566C; Tue, 23 Jun 2009 09:51:39 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37D8E8FC25; Tue, 23 Jun 2009 09:51:39 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5N9pda7070791; Tue, 23 Jun 2009 09:51:39 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5N9pdaW070789; Tue, 23 Jun 2009 09:51:39 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200906230951.n5N9pdaW070789@svn.freebsd.org> From: Brian Somers Date: Tue, 23 Jun 2009 09:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194690 - in stable/7/etc: . periodic/daily X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 09:51:40 -0000 Author: brian Date: Tue Jun 23 09:51:38 2009 New Revision: 194690 URL: http://svn.freebsd.org/changeset/base/194690 Log: MFC: r193302: Avoid using find -delete in favour of find -prune PR: 122811 Modified: stable/7/etc/ (props changed) stable/7/etc/periodic/daily/100.clean-disks Modified: stable/7/etc/periodic/daily/100.clean-disks ============================================================================== --- stable/7/etc/periodic/daily/100.clean-disks Tue Jun 23 09:50:50 2009 (r194689) +++ stable/7/etc/periodic/daily/100.clean-disks Tue Jun 23 09:51:38 2009 (r194690) @@ -29,7 +29,7 @@ case "$daily_clean_disks_enable" in echo "" echo "Cleaning disks:" set -f noglob - args="$args -name "`echo "$daily_clean_disks_files" | + args="-name "`echo "$daily_clean_disks_files" | sed -e 's/^[ ]*//' \ -e 's/[ ]*$//' \ -e 's/[ ][ ]*/ -o -name /g'` @@ -41,9 +41,9 @@ case "$daily_clean_disks_enable" in print=;; esac - rc=$(find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \ - \( $args \) -atime +$daily_clean_disks_days -delete $print | - tee /dev/stderr | wc -l) + rc=$(find / \( ! -fstype local -o -fstype rdonly \) -prune -o \ + \( $args \) -atime +$daily_clean_disks_days \ + -execdir rm -df {} \; $print | tee /dev/stderr | wc -l) [ -z "$print" ] && rc=0 [ $rc -gt 1 ] && rc=1 set -f glob From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 10:37:28 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C45BF1065670; Tue, 23 Jun 2009 10:37:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1E6A8FC14; Tue, 23 Jun 2009 10:37:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NAbSuA073371; Tue, 23 Jun 2009 10:37:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NAbSgX073369; Tue, 23 Jun 2009 10:37:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906231037.n5NAbSgX073369@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 23 Jun 2009 10:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194691 - in stable/7/sys: . contrib/pf kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 10:37:29 -0000 Author: kib Date: Tue Jun 23 10:37:28 2009 New Revision: 194691 URL: http://svn.freebsd.org/changeset/base/194691 Log: MFC r185358 (by ganbold): Remove unused variable. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/kern_lockf.c Modified: stable/7/sys/kern/kern_lockf.c ============================================================================== --- stable/7/sys/kern/kern_lockf.c Tue Jun 23 09:51:38 2009 (r194690) +++ stable/7/sys/kern/kern_lockf.c Tue Jun 23 10:37:28 2009 (r194691) @@ -1342,7 +1342,6 @@ static int lf_setlock(struct lockf *state, struct lockf_entry *lock, struct vnode *vp, void **cookiep) { - struct lockf_entry *block; static char lockstr[] = "lockf"; int priority, error; @@ -1362,7 +1361,7 @@ lf_setlock(struct lockf *state, struct l /* * Scan lock list for this file looking for locks that would block us. */ - while ((block = lf_getblock(state, lock))) { + while (lf_getblock(state, lock)) { /* * Free the structure and return if nonblocking. */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 10:41:38 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5B421065670; Tue, 23 Jun 2009 10:41:38 +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 933DD8FC1F; Tue, 23 Jun 2009 10:41:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NAfcaY073483; Tue, 23 Jun 2009 10:41:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NAfcYn073481; Tue, 23 Jun 2009 10:41:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906231041.n5NAfcYn073481@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 23 Jun 2009 10:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194692 - in stable/7/sys: . contrib/pf kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 10:41:39 -0000 Author: kib Date: Tue Jun 23 10:41:38 2009 New Revision: 194692 URL: http://svn.freebsd.org/changeset/base/194692 Log: MFC r192681: Replace the while statement with the if for clarity. The loop body cannot be executed more then once. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/kern_lockf.c Modified: stable/7/sys/kern/kern_lockf.c ============================================================================== --- stable/7/sys/kern/kern_lockf.c Tue Jun 23 10:37:28 2009 (r194691) +++ stable/7/sys/kern/kern_lockf.c Tue Jun 23 10:41:38 2009 (r194692) @@ -1361,7 +1361,7 @@ lf_setlock(struct lockf *state, struct l /* * Scan lock list for this file looking for locks that would block us. */ - while (lf_getblock(state, lock)) { + if (lf_getblock(state, lock)) { /* * Free the structure and return if nonblocking. */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 10:47:43 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2BCD106566C; Tue, 23 Jun 2009 10:47:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C61338FC18; Tue, 23 Jun 2009 10:47:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NAlgu5073672; Tue, 23 Jun 2009 10:47:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NAlgnS073670; Tue, 23 Jun 2009 10:47:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906231047.n5NAlgnS073670@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 23 Jun 2009 10:47:42 +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: r194693 - in stable/7/sys: . contrib/pf kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 10:47:43 -0000 Author: kib Date: Tue Jun 23 10:47:42 2009 New Revision: 194693 URL: http://svn.freebsd.org/changeset/base/194693 Log: MFC r192683: In lf_advlockasync(), recheck for doomed vnode after the state->ls_lock is acquired. In the lf_purgelocks(), assert that vnode is doomed and set *statep to NULL before clearing ls_pending list. Otherwise, we allow for the thread executing lf_advlockasync() to put new pending entry after state->ls_lock is dropped in lf_purgelocks(). MFC r193931: Do not leak the state->ls_lock after VI_DOOMED check introduced in the r192683. MFC r194356: Decrement state->ls_threads when vnode appeared to be doomed. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/kern_lockf.c Modified: stable/7/sys/kern/kern_lockf.c ============================================================================== --- stable/7/sys/kern/kern_lockf.c Tue Jun 23 10:41:38 2009 (r194692) +++ stable/7/sys/kern/kern_lockf.c Tue Jun 23 10:47:42 2009 (r194693) @@ -633,7 +633,23 @@ lf_advlockasync(struct vop_advlockasync_ } sx_xlock(&state->ls_lock); - switch(ap->a_op) { + /* + * Recheck the doomed vnode after state->ls_lock is + * locked. lf_purgelocks() requires that no new threads add + * pending locks when vnode is marked by VI_DOOMED flag. + */ + VI_LOCK(vp); + if (vp->v_iflag & VI_DOOMED) { + state->ls_threads--; + wakeup(state); + VI_UNLOCK(vp); + sx_xunlock(&state->ls_lock); + lf_free_lock(lock); + return (ENOENT); + } + VI_UNLOCK(vp); + + switch (ap->a_op) { case F_SETLK: error = lf_setlock(state, lock, vp, ap->a_cookiep); break; @@ -755,8 +771,11 @@ lf_purgelocks(struct vnode *vp, struct l * the remaining locks. */ VI_LOCK(vp); + KASSERT(vp->v_iflag & VI_DOOMED, + ("lf_purgelocks: vp %p has not vgone yet", vp)); state = *statep; if (state) { + *statep = NULL; state->ls_threads++; VI_UNLOCK(vp); @@ -789,7 +808,6 @@ lf_purgelocks(struct vnode *vp, struct l VI_LOCK(vp); while (state->ls_threads > 1) msleep(state, VI_MTX(vp), 0, "purgelocks", 0); - *statep = 0; VI_UNLOCK(vp); /* From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 10:49:56 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33D9D106566C; Tue, 23 Jun 2009 10:49: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 218A08FC16; Tue, 23 Jun 2009 10:49:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NAnunx073755; Tue, 23 Jun 2009 10:49:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NAnuuC073753; Tue, 23 Jun 2009 10:49:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906231049.n5NAnuuC073753@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 23 Jun 2009 10:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194694 - in stable/7/sys: . contrib/pf kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 10:49:57 -0000 Author: kib Date: Tue Jun 23 10:49:55 2009 New Revision: 194694 URL: http://svn.freebsd.org/changeset/base/194694 Log: MFC r192684: In lf_purgelocks(), assert that state->ls_pending is empty after we weeded out threads, and clean ls_active instead of ls_pending. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/kern_lockf.c Modified: stable/7/sys/kern/kern_lockf.c ============================================================================== --- stable/7/sys/kern/kern_lockf.c Tue Jun 23 10:47:42 2009 (r194693) +++ stable/7/sys/kern/kern_lockf.c Tue Jun 23 10:49:55 2009 (r194694) @@ -816,7 +816,9 @@ lf_purgelocks(struct vnode *vp, struct l * above). We don't need to bother locking since we * are the last thread using this state structure. */ - LIST_FOREACH_SAFE(lock, &state->ls_pending, lf_link, nlock) { + KASSERT(LIST_EMPTY(&state->ls_pending), + ("lock pending for %p", state)); + LIST_FOREACH_SAFE(lock, &state->ls_active, lf_link, nlock) { LIST_REMOVE(lock, lf_link); lf_free_lock(lock); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 10:55:21 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFE73106566C; Tue, 23 Jun 2009 10:55:21 +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 DCF4E8FC1E; Tue, 23 Jun 2009 10:55:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NAtL91073971; Tue, 23 Jun 2009 10:55:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NAtLZo073968; Tue, 23 Jun 2009 10:55:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906231055.n5NAtLZo073968@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 23 Jun 2009 10:55: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: r194695 - in stable/7/sys: . contrib/pf kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 10:55:22 -0000 Author: kib Date: Tue Jun 23 10:55:21 2009 New Revision: 194695 URL: http://svn.freebsd.org/changeset/base/194695 Log: MFC r192685: The advisory lock may be activated or activated and removed during the sleep waiting for conditions when the lock may be granted. To prevent lf_setlock() from accessing possibly freed memory, add reference counting to the struct lockf_entry. Bump refcount around the sleep. Make lf_free_lock() return non-zero when structure was freed, and use this after the sleep to return EINTR to the caller. The error code might need a clarification, but we cannot return success to usermode, since the lock is not owned anymore. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/kern_lockf.c stable/7/sys/sys/lockf.h Modified: stable/7/sys/kern/kern_lockf.c ============================================================================== --- stable/7/sys/kern/kern_lockf.c Tue Jun 23 10:49:55 2009 (r194694) +++ stable/7/sys/kern/kern_lockf.c Tue Jun 23 10:55:21 2009 (r194695) @@ -106,7 +106,7 @@ static int lf_owner_matches(struct lock int); static struct lockf_entry * lf_alloc_lock(struct lock_owner *); -static void lf_free_lock(struct lockf_entry *); +static int lf_free_lock(struct lockf_entry *); static int lf_clearlock(struct lockf *, struct lockf_entry *); static int lf_overlaps(struct lockf_entry *, struct lockf_entry *); static int lf_blocks(struct lockf_entry *, struct lockf_entry *); @@ -347,9 +347,13 @@ lf_alloc_lock(struct lock_owner *lo) return (lf); } -static void +static int lf_free_lock(struct lockf_entry *lock) { + + KASSERT(lock->lf_refs > 0, ("lockf_entry negative ref count %p", lock)); + if (--lock->lf_refs > 0) + return (0); /* * Adjust the lock_owner reference count and * reclaim the entry if this is the last lock @@ -394,6 +398,7 @@ lf_free_lock(struct lockf_entry *lock) printf("Freed lock %p\n", lock); #endif free(lock, M_LOCKF); + return (1); } /* @@ -540,6 +545,7 @@ lf_advlockasync(struct vop_advlockasync_ * the lf_lock_owners_lock tax twice. */ lock = lf_alloc_lock(NULL); + lock->lf_refs = 1; lock->lf_start = start; lock->lf_end = end; lock->lf_owner = lo; @@ -1450,7 +1456,13 @@ lf_setlock(struct lockf *state, struct l goto out; } + lock->lf_refs++; error = sx_sleep(lock, &state->ls_lock, priority, lockstr, 0); + if (lf_free_lock(lock)) { + error = EINTR; + goto out; + } + /* * We may have been awakened by a signal and/or by a * debugger continuing us (in which cases we must @@ -1812,6 +1824,7 @@ lf_split(struct lockf *state, struct loc */ splitlock = lf_alloc_lock(lock1->lf_owner); memcpy(splitlock, lock1, sizeof *splitlock); + splitlock->lf_refs = 1; if (splitlock->lf_flags & F_REMOTE) vref(splitlock->lf_vnode); Modified: stable/7/sys/sys/lockf.h ============================================================================== --- stable/7/sys/sys/lockf.h Tue Jun 23 10:49:55 2009 (r194694) +++ stable/7/sys/sys/lockf.h Tue Jun 23 10:55:21 2009 (r194695) @@ -80,6 +80,7 @@ struct lockf_entry { LIST_ENTRY(lockf_entry) lf_link; /* (s) Linkage for lock lists */ struct lockf_edge_list lf_outedges; /* (s) list of out-edges */ struct lockf_edge_list lf_inedges; /* (s) list of out-edges */ + int lf_refs; /* (s) ref count */ }; LIST_HEAD(lockf_entry_list, lockf_entry); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 10:59:59 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D50A91065670; Tue, 23 Jun 2009 10:59:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1B7D8FC17; Tue, 23 Jun 2009 10:59:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NAxxva074091; Tue, 23 Jun 2009 10:59:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NAxxxK074085; Tue, 23 Jun 2009 10:59:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906231059.n5NAxxxK074085@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 23 Jun 2009 10:59:59 +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: r194696 - in stable/7/sys: . contrib/pf gnu/fs/ext2fs kern ufs/ufs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 11:00:00 -0000 Author: kib Date: Tue Jun 23 10:59:59 2009 New Revision: 194696 URL: http://svn.freebsd.org/changeset/base/194696 Log: MFC r194296: Do not use casts (int *)0 and (struct thread *)0 for the arguments of vn_rdwr, use NULL. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/gnu/fs/ext2fs/ext2_lookup.c stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c stable/7/sys/kern/kern_acct.c stable/7/sys/ufs/ufs/ufs_lookup.c stable/7/sys/ufs/ufs/ufs_vnops.c Modified: stable/7/sys/gnu/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/7/sys/gnu/fs/ext2fs/ext2_lookup.c Tue Jun 23 10:55:21 2009 (r194695) +++ stable/7/sys/gnu/fs/ext2fs/ext2_lookup.c Tue Jun 23 10:59:59 2009 (r194696) @@ -1049,8 +1049,8 @@ ext2_checkpath(source, target, cred) } error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, - IO_NODELOCKED | IO_NOMACCHECK, cred, NOCRED, (int *)0, - (struct thread *)0); + IO_NODELOCKED | IO_NOMACCHECK, cred, NOCRED, NULL, + NULL); if (error != 0) break; namlen = dirbuf.dotdot_type; /* like ufs little-endian */ Modified: stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c Tue Jun 23 10:55:21 2009 (r194695) +++ stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c Tue Jun 23 10:59:59 2009 (r194696) @@ -1057,8 +1057,7 @@ abortit: error = vn_rdwr(UIO_READ, fvp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, - tcnp->cn_cred, NOCRED, (int *)0, - (struct thread *)0); + tcnp->cn_cred, NOCRED, NULL, NULL); if (error == 0) { /* Like ufs little-endian: */ namlen = dirbuf.dotdot_type; @@ -1075,8 +1074,7 @@ abortit: (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_SYNC | IO_NOMACCHECK, tcnp->cn_cred, - NOCRED, (int *)0, - (struct thread *)0); + NOCRED, NULL, NULL); cache_purge(fdvp); } } @@ -1212,7 +1210,7 @@ ext2_mkdir(ap) error = vn_rdwr(UIO_WRITE, tvp, (caddr_t)&dirtemplate, sizeof (dirtemplate), (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_SYNC | IO_NOMACCHECK, cnp->cn_cred, NOCRED, - (int *)0, (struct thread *)0); + NULL, NULL); if (error) { dp->i_nlink--; dp->i_flag |= IN_CHANGE; @@ -1349,7 +1347,7 @@ ext2_symlink(ap) } else error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, - ap->a_cnp->cn_cred, NOCRED, (int *)0, (struct thread *)0); + ap->a_cnp->cn_cred, NOCRED, NULL, NULL); if (error) vput(vp); return (error); Modified: stable/7/sys/kern/kern_acct.c ============================================================================== --- stable/7/sys/kern/kern_acct.c Tue Jun 23 10:55:21 2009 (r194695) +++ stable/7/sys/kern/kern_acct.c Tue Jun 23 10:59:59 2009 (r194696) @@ -438,7 +438,7 @@ acct_process(struct thread *td) VOP_LEASE(acct_vp, td, acct_cred, LEASE_WRITE); ret = vn_rdwr(UIO_WRITE, acct_vp, (caddr_t)&acct, sizeof (acct), (off_t)0, UIO_SYSSPACE, IO_APPEND|IO_UNIT, acct_cred, NOCRED, - (int *)0, td); + NULL, td); VFS_UNLOCK_GIANT(vfslocked); sx_sunlock(&acct_sx); return (ret); Modified: stable/7/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/7/sys/ufs/ufs/ufs_lookup.c Tue Jun 23 10:55:21 2009 (r194695) +++ stable/7/sys/ufs/ufs/ufs_lookup.c Tue Jun 23 10:59:59 2009 (r194696) @@ -1248,7 +1248,7 @@ ufs_dir_dd_ino(struct vnode *vp, struct return (ENOTDIR); error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, - IO_NODELOCKED | IO_NOMACCHECK, cred, NOCRED, (int *)0, NULL); + IO_NODELOCKED | IO_NOMACCHECK, cred, NOCRED, NULL, NULL); if (error != 0) return (error); #if (BYTE_ORDER == LITTLE_ENDIAN) Modified: stable/7/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/7/sys/ufs/ufs/ufs_vnops.c Tue Jun 23 10:55:21 2009 (r194695) +++ stable/7/sys/ufs/ufs/ufs_vnops.c Tue Jun 23 10:59:59 2009 (r194696) @@ -1843,7 +1843,7 @@ ufs_symlink(ap) } else error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, - ap->a_cnp->cn_cred, NOCRED, (int *)0, (struct thread *)0); + ap->a_cnp->cn_cred, NOCRED, NULL, NULL); if (error) vput(vp); return (error); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 15:10:49 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2EDF106568A; Tue, 23 Jun 2009 15:10:49 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFB018FC0A; Tue, 23 Jun 2009 15:10:49 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NFAnw6080206; Tue, 23 Jun 2009 15:10:49 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NFAn94080202; Tue, 23 Jun 2009 15:10:49 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231510.n5NFAn94080202@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 15:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194717 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 15:10:50 -0000 Author: rnoland Date: Tue Jun 23 15:10:49 2009 New Revision: 194717 URL: http://svn.freebsd.org/changeset/base/194717 Log: Merge r190020 from HEAD Pull in some suspend / resume changes from Intel's code Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/i915_drv.h stable/7/sys/dev/drm/i915_reg.h stable/7/sys/dev/drm/i915_suspend.c Modified: stable/7/sys/dev/drm/i915_drv.h ============================================================================== --- stable/7/sys/dev/drm/i915_drv.h Tue Jun 23 15:08:03 2009 (r194716) +++ stable/7/sys/dev/drm/i915_drv.h Tue Jun 23 15:10:49 2009 (r194717) @@ -151,6 +151,8 @@ typedef struct drm_i915_private { u32 saveDSPACNTR; u32 saveDSPBCNTR; u32 saveDSPARB; + u32 saveRENDERSTANDBY; + u32 saveHWS; u32 savePIPEACONF; u32 savePIPEBCONF; u32 savePIPEASRC; @@ -232,8 +234,8 @@ typedef struct drm_i915_private { u8 saveAR_INDEX; u8 saveAR[21]; u8 saveDACMASK; - u8 saveDACDATA[256*3]; /* 256 3-byte colors */ u8 saveCR[37]; + struct { #ifdef __linux__ struct drm_mm gtt_space; @@ -651,7 +653,8 @@ extern int i915_wait_ring(struct drm_dev #define IS_G4X(dev) ((dev)->pci_device == 0x2E02 || \ (dev)->pci_device == 0x2E12 || \ - (dev)->pci_device == 0x2E22) + (dev)->pci_device == 0x2E22 || \ + IS_GM45(dev)) #define IS_G33(dev) ((dev)->pci_device == 0x29C2 || \ (dev)->pci_device == 0x29B2 || \ Modified: stable/7/sys/dev/drm/i915_reg.h ============================================================================== --- stable/7/sys/dev/drm/i915_reg.h Tue Jun 23 15:08:03 2009 (r194716) +++ stable/7/sys/dev/drm/i915_reg.h Tue Jun 23 15:10:49 2009 (r194717) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #define INTEL_GMCH_MEM_64M 0x1 #define INTEL_GMCH_MEM_128M 0 -#define INTEL_855_GMCH_GMS_MASK (0x7 << 4) +#define INTEL_GMCH_GMS_MASK (0xf << 4) #define INTEL_855_GMCH_GMS_DISABLED (0x0 << 4) #define INTEL_855_GMCH_GMS_STOLEN_1M (0x1 << 4) #define INTEL_855_GMCH_GMS_STOLEN_4M (0x2 << 4) @@ -48,6 +48,12 @@ __FBSDID("$FreeBSD$"); #define INTEL_915G_GMCH_GMS_STOLEN_48M (0x6 << 4) #define INTEL_915G_GMCH_GMS_STOLEN_64M (0x7 << 4) +#define INTEL_GMCH_GMS_STOLEN_128M (0x8 << 4) +#define INTEL_GMCH_GMS_STOLEN_256M (0x9 << 4) +#define INTEL_GMCH_GMS_STOLEN_96M (0xa << 4) +#define INTEL_GMCH_GMS_STOLEN_160M (0xb << 4) +#define INTEL_GMCH_GMS_STOLEN_224M (0xc << 4) +#define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4) /* PCI config space */ @@ -178,9 +184,27 @@ __FBSDID("$FreeBSD$"); #define DISPLAY_PLANE_B (1<<20) /* - * Instruction and interrupt control regs + * Fence registers */ +#define FENCE_REG_830_0 0x2000 +#define FENCE_REG_945_8 0x3000 +#define I830_FENCE_START_MASK 0x07f80000 +#define I830_FENCE_TILING_Y_SHIFT 12 +#define I830_FENCE_SIZE_BITS(size) ((ffs((size) >> 19) - 1) << 8) +#define I830_FENCE_PITCH_SHIFT 4 +#define I830_FENCE_REG_VALID (1<<0) + +#define I915_FENCE_START_MASK 0x0ff00000 +#define I915_FENCE_SIZE_BITS(size) ((ffs((size) >> 20) - 1) << 8) + +#define FENCE_REG_965_0 0x03000 +#define I965_FENCE_PITCH_SHIFT 2 +#define I965_FENCE_TILING_Y_SHIFT 1 +#define I965_FENCE_REG_VALID (1<<0) +/* + * Instruction and interrupt control regs + */ #define PRB0_TAIL 0x02030 #define PRB0_HEAD 0x02034 #define PRB0_START 0x02038 @@ -248,6 +272,7 @@ __FBSDID("$FreeBSD$"); #define CM0_RC_OP_FLUSH_DISABLE (1<<0) #define GFX_FLSH_CNTL 0x02170 /* 915+ only */ + /* * Framebuffer compression (915+ only) */ @@ -525,11 +550,17 @@ __FBSDID("$FreeBSD$"); #define DCC_ADDRESSING_MODE_DUAL_CHANNEL_INTERLEAVED (2 << 0) #define DCC_ADDRESSING_MODE_MASK (3 << 0) #define DCC_CHANNEL_XOR_DISABLE (1 << 10) +#define DCC_CHANNEL_XOR_BIT_17 (1 << 9) /** 965 MCH register controlling DRAM channel configuration */ #define C0DRB3 0x10206 #define C1DRB3 0x10606 +/** GM965 GM45 render standby register */ +#define MCHBAR_RENDER_STANDBY 0x111B8 + +#define PEG_BAND_GAP_DATA 0x14d68 + /* * Overlay regs */ @@ -593,6 +624,9 @@ __FBSDID("$FreeBSD$"); /* Hotplug control (945+ only) */ #define PORT_HOTPLUG_EN 0x61110 +#define HDMIB_HOTPLUG_INT_EN (1 << 29) +#define HDMIC_HOTPLUG_INT_EN (1 << 28) +#define HDMID_HOTPLUG_INT_EN (1 << 27) #define SDVOB_HOTPLUG_INT_EN (1 << 26) #define SDVOC_HOTPLUG_INT_EN (1 << 25) #define TV_HOTPLUG_INT_EN (1 << 18) @@ -600,6 +634,9 @@ __FBSDID("$FreeBSD$"); #define CRT_HOTPLUG_FORCE_DETECT (1 << 3) #define PORT_HOTPLUG_STAT 0x61114 +#define HDMIB_HOTPLUG_INT_STATUS (1 << 29) +#define HDMIC_HOTPLUG_INT_STATUS (1 << 28) +#define HDMID_HOTPLUG_INT_STATUS (1 << 27) #define CRT_HOTPLUG_INT_STATUS (1 << 11) #define TV_HOTPLUG_INT_STATUS (1 << 10) #define CRT_HOTPLUG_MONITOR_MASK (3 << 8) @@ -629,7 +666,16 @@ __FBSDID("$FreeBSD$"); #define SDVO_PHASE_SELECT_DEFAULT (6 << 19) #define SDVO_CLOCK_OUTPUT_INVERT (1 << 18) #define SDVOC_GANG_MODE (1 << 16) +#define SDVO_ENCODING_SDVO (0x0 << 10) +#define SDVO_ENCODING_HDMI (0x2 << 10) +/** Requird for HDMI operation */ +#define SDVO_NULL_PACKETS_DURING_VSYNC (1 << 9) #define SDVO_BORDER_ENABLE (1 << 7) +#define SDVO_AUDIO_ENABLE (1 << 6) +/** New with 965, default is to be set */ +#define SDVO_VSYNC_ACTIVE_HIGH (1 << 4) +/** New with 965, default is to be set */ +#define SDVO_HSYNC_ACTIVE_HIGH (1 << 3) #define SDVOB_PCIE_CONCURRENCY (1 << 3) #define SDVO_DETECTED (1 << 2) /* Bits to be preserved when writing */ @@ -1403,6 +1449,7 @@ __FBSDID("$FreeBSD$"); #define PIPEB_FRMCOUNT_GM45 0x71040 #define PIPEB_FLIPCOUNT_GM45 0x71044 + /* Display B control */ #define DSPBCNTR 0x71180 #define DISPPLANE_ALPHA_TRANS_ENABLE (1<<15) Modified: stable/7/sys/dev/drm/i915_suspend.c ============================================================================== --- stable/7/sys/dev/drm/i915_suspend.c Tue Jun 23 15:08:03 2009 (r194716) +++ stable/7/sys/dev/drm/i915_suspend.c Tue Jun 23 15:10:49 2009 (r194717) @@ -125,11 +125,6 @@ static void i915_save_vga(struct drm_dev /* VGA color palette registers */ dev_priv->saveDACMASK = I915_READ8(VGA_DACMASK); - /* DACCRX automatically increments during read */ - I915_WRITE8(VGA_DACRX, 0); - /* Read 3 bytes of color data from each index */ - for (i = 0; i < 256 * 3; i++) - dev_priv->saveDACDATA[i] = I915_READ8(VGA_DACDATA); /* MSR bits */ dev_priv->saveMSR = I915_READ8(VGA_MSR_READ); @@ -231,12 +226,6 @@ static void i915_restore_vga(struct drm_ /* VGA color palette registers */ I915_WRITE8(VGA_DACMASK, dev_priv->saveDACMASK); - /* DACCRX automatically increments during read */ - I915_WRITE8(VGA_DACWX, 0); - /* Read 3 bytes of color data from each index */ - for (i = 0; i < 256 * 3; i++) - I915_WRITE8(VGA_DACDATA, dev_priv->saveDACDATA[i]); - } int i915_save_state(struct drm_device *dev) @@ -250,6 +239,13 @@ int i915_save_state(struct drm_device *d pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB); #endif + /* Render Standby */ + if (IS_I965G(dev) && IS_MOBILE(dev)) + dev_priv->saveRENDERSTANDBY = I915_READ(MCHBAR_RENDER_STANDBY); + + /* Hardware status page */ + dev_priv->saveHWS = I915_READ(HWS_PGA); + /* Display arbitration control */ dev_priv->saveDSPARB = I915_READ(DSPARB); @@ -379,6 +375,14 @@ int i915_restore_state(struct drm_device pci_write_config_byte(dev->pdev, LBB, dev_priv->saveLBB); #endif + /* Render Standby */ + if (IS_I965G(dev) && IS_MOBILE(dev)) + I915_WRITE(MCHBAR_RENDER_STANDBY, dev_priv->saveRENDERSTANDBY); + + /* Hardware status page */ + I915_WRITE(HWS_PGA, dev_priv->saveHWS); + + /* Display arbitration */ I915_WRITE(DSPARB, dev_priv->saveDSPARB); /* Pipe & plane A info */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 15:22:38 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC78E106564A; Tue, 23 Jun 2009 15:22:38 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8CA48FC19; Tue, 23 Jun 2009 15:22:38 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NFMcX2080525; Tue, 23 Jun 2009 15:22:38 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NFMcw4080522; Tue, 23 Jun 2009 15:22:38 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231522.n5NFMcw4080522@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 15:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194718 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 15:22:39 -0000 Author: rnoland Date: Tue Jun 23 15:22:38 2009 New Revision: 194718 URL: http://svn.freebsd.org/changeset/base/194718 Log: Merge 190021 from HEAD Sync up the rest of the code that we use with what Intel is shipping -Some irq/vblank related changes that hopefully will help. -A little more cleanup while I'm here. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/i915_dma.c stable/7/sys/dev/drm/i915_irq.c Modified: stable/7/sys/dev/drm/i915_dma.c ============================================================================== --- stable/7/sys/dev/drm/i915_dma.c Tue Jun 23 15:10:49 2009 (r194717) +++ stable/7/sys/dev/drm/i915_dma.c Tue Jun 23 15:22:38 2009 (r194718) @@ -193,7 +193,7 @@ static int i915_initialize(struct drm_de dev_priv->ring.map.flags = 0; dev_priv->ring.map.mtrr = 0; - drm_core_ioremap(&dev_priv->ring.map, dev); + drm_core_ioremap_wc(&dev_priv->ring.map, dev); if (dev_priv->ring.map.handle == NULL) { i915_dma_cleanup(dev); @@ -209,7 +209,7 @@ static int i915_initialize(struct drm_de dev_priv->back_offset = init->back_offset; dev_priv->front_offset = init->front_offset; dev_priv->current_page = 0; - dev_priv->sarea_priv->pf_current_page = dev_priv->current_page; + dev_priv->sarea_priv->pf_current_page = 0; /* Allow hardware batchbuffers unless told otherwise. */ @@ -721,7 +721,7 @@ static int i915_flip_bufs(struct drm_dev DRM_DEBUG("%s\n", __func__); - LOCK_TEST_WITH_RETURN(dev, file_priv); + RING_LOCK_TEST_WITH_RETURN(dev, file_priv); ret = i915_dispatch_flip(dev); @@ -758,7 +758,7 @@ static int i915_getparam(struct drm_devi value = 0; break; default: - DRM_ERROR("Unknown parameter %d\n", param->param); + DRM_DEBUG("Unknown parameter %d\n", param->param); return -EINVAL; } @@ -791,7 +791,7 @@ static int i915_setparam(struct drm_devi dev_priv->allow_batchbuffer = param->value; break; default: - DRM_ERROR("unknown parameter %d\n", param->param); + DRM_DEBUG("unknown parameter %d\n", param->param); return -EINVAL; } @@ -822,7 +822,7 @@ static int i915_set_status_page(struct d dev_priv->hws_map.flags = 0; dev_priv->hws_map.mtrr = 0; - drm_core_ioremap(&dev_priv->hws_map, dev); + drm_core_ioremap_wc(&dev_priv->hws_map, dev); if (dev_priv->hws_map.handle == NULL) { i915_dma_cleanup(dev); dev_priv->status_gfx_addr = 0; @@ -880,8 +880,12 @@ int i915_driver_load(struct drm_device * /* Init HWS */ if (!I915_NEED_GFX_HWS(dev)) { ret = i915_init_phys_hws(dev); - if (ret != 0) + if (ret != 0) { + drm_rmmap(dev, dev_priv->mmio_map); + drm_free(dev_priv, sizeof(struct drm_i915_private), + DRM_MEM_DRIVER); return ret; + } } #ifdef __linux__ /* On the 945G/GM, the chipset reports the MSI capability on the @@ -901,6 +905,7 @@ int i915_driver_load(struct drm_device * intel_opregion_init(dev); #endif DRM_SPININIT(&dev_priv->user_irq_lock, "userirq"); + dev_priv->user_irq_refcount = 0; ret = drm_vblank_init(dev, I915_NUM_PIPE); Modified: stable/7/sys/dev/drm/i915_irq.c ============================================================================== --- stable/7/sys/dev/drm/i915_irq.c Tue Jun 23 15:10:49 2009 (r194717) +++ stable/7/sys/dev/drm/i915_irq.c Tue Jun 23 15:22:38 2009 (r194718) @@ -43,21 +43,28 @@ __FBSDID("$FreeBSD$"); * we leave them always unmasked in IMR and then control enabling them through * PIPESTAT alone. */ -#define I915_INTERRUPT_ENABLE_FIX (I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | \ - I915_DISPLAY_PIPE_B_EVENT_INTERRUPT) +#define I915_INTERRUPT_ENABLE_FIX (I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | \ + I915_DISPLAY_PIPE_B_EVENT_INTERRUPT) /** Interrupts that we mask and unmask at runtime. */ -#define I915_INTERRUPT_ENABLE_VAR (I915_USER_INTERRUPT) +#define I915_INTERRUPT_ENABLE_VAR (I915_USER_INTERRUPT) /** These are all of the interrupts used by the driver */ -#define I915_INTERRUPT_ENABLE_MASK (I915_INTERRUPT_ENABLE_FIX | \ - I915_INTERRUPT_ENABLE_VAR) +#define I915_INTERRUPT_ENABLE_MASK (I915_INTERRUPT_ENABLE_FIX | \ + I915_INTERRUPT_ENABLE_VAR) + +#define I915_PIPE_VBLANK_STATUS (PIPE_START_VBLANK_INTERRUPT_STATUS |\ + PIPE_VBLANK_INTERRUPT_STATUS) + +#define I915_PIPE_VBLANK_ENABLE (PIPE_START_VBLANK_INTERRUPT_ENABLE |\ + PIPE_VBLANK_INTERRUPT_ENABLE) + +#define DRM_I915_VBLANK_PIPE_ALL (DRM_I915_VBLANK_PIPE_A | \ + DRM_I915_VBLANK_PIPE_B) static inline void i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask) { - DRM_DEBUG("irq_enable_reg = 0x%08x, mask = 0x%08x\n", - dev_priv->irq_mask_reg, mask); mask &= I915_INTERRUPT_ENABLE_VAR; if ((dev_priv->irq_mask_reg & mask) != 0) { dev_priv->irq_mask_reg &= ~mask; @@ -189,59 +196,84 @@ irqreturn_t i915_driver_irq_handler(DRM_ drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; u32 iir, new_iir; u32 pipea_stats, pipeb_stats; + u32 vblank_status; + u32 vblank_enable; + int irq_received; atomic_inc(&dev_priv->irq_received); - for (iir = I915_READ(IIR) ; iir != 0 ; iir = new_iir) { + iir = I915_READ(IIR); - pipea_stats = pipeb_stats = 0; + if (IS_I965G(dev)) { + vblank_status = I915_START_VBLANK_INTERRUPT_STATUS; + vblank_enable = PIPE_START_VBLANK_INTERRUPT_ENABLE; + } else { + vblank_status = I915_VBLANK_INTERRUPT_STATUS; + vblank_enable = I915_VBLANK_INTERRUPT_ENABLE; + } + + for (;;) { + irq_received = iir != 0; + + /* Can't rely on pipestat interrupt bit in iir as it might + * have been cleared after the pipestat interrupt was received. + * It doesn't set the bit in iir again, but it still produces + * interrupts (for non-MSI). + */ + DRM_SPINLOCK(&dev_priv->user_irq_lock); + pipea_stats = I915_READ(PIPEASTAT); + pipeb_stats = I915_READ(PIPEBSTAT); /* * Clear the PIPE(A|B)STAT regs before the IIR */ - if (iir & I915_DISPLAY_PIPE_A_EVENT_INTERRUPT) { - DRM_SPINLOCK(&dev_priv->user_irq_lock); - pipea_stats = I915_READ(PIPEASTAT); + if (pipea_stats & 0x8000ffff) { I915_WRITE(PIPEASTAT, pipea_stats); - DRM_SPINUNLOCK(&dev_priv->user_irq_lock); + irq_received = 1; } - if (iir & I915_DISPLAY_PIPE_B_EVENT_INTERRUPT) { - DRM_SPINLOCK(&dev_priv->user_irq_lock); - pipeb_stats = I915_READ(PIPEBSTAT); + if (pipeb_stats & 0x8000ffff) { I915_WRITE(PIPEBSTAT, pipeb_stats); - DRM_SPINUNLOCK(&dev_priv->user_irq_lock); + irq_received = 1; } + DRM_SPINUNLOCK(&dev_priv->user_irq_lock); - I915_WRITE(IIR, iir); - new_iir = I915_READ(IIR); + if (!irq_received) + break; - DRM_DEBUG("iir = 0x%08x, pipestats a = 0x%08x, b = 0x%08x\n", - iir, pipea_stats, pipeb_stats); + I915_WRITE(IIR, iir); + new_iir = I915_READ(IIR); /* Flush posted writes */ if (dev_priv->sarea_priv) dev_priv->sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); if (iir & I915_USER_INTERRUPT) { -#ifdef I915_HAVE_GEM - dev_priv->mm.irq_gem_seqno = i915_get_gem_seqno(dev); -#endif DRM_WAKEUP(&dev_priv->irq_queue); } - if (pipea_stats & (PIPE_START_VBLANK_INTERRUPT_STATUS | - PIPE_VBLANK_INTERRUPT_STATUS)) + if (pipea_stats & vblank_status) drm_handle_vblank(dev, 0); - if (pipeb_stats & (PIPE_START_VBLANK_INTERRUPT_STATUS | - PIPE_VBLANK_INTERRUPT_STATUS)) + if (pipeb_stats & vblank_status) drm_handle_vblank(dev, 1); -#ifdef __linux__ - if ((pipeb_stats & I915_LEGACY_BLC_EVENT_STATUS) || - (iir & I915_ASLE_INTERRUPT)) - opregion_asle_intr(dev); -#endif + + /* With MSI, interrupts are only generated when iir + * transitions from zero to nonzero. If another bit got + * set while we were handling the existing iir bits, then + * we would never get another interrupt. + * + * This is fine on non-MSI as well, as if we hit this path + * we avoid exiting the interrupt handler only to generate + * another one. + * + * Note that for MSI this could cause a stray interrupt report + * if an interrupt landed in the time between writing IIR and + * the posting read. This should be rare enough to never + * trigger the 99% of 100,000 interrupts test for disabling + * stray interrupts. + */ + iir = new_iir; } } @@ -273,27 +305,25 @@ static int i915_emit_irq(struct drm_devi void i915_user_irq_get(struct drm_device *dev) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - unsigned long irqflags; DRM_DEBUG("\n"); - DRM_SPINLOCK_IRQSAVE(&dev_priv->user_irq_lock, irqflags); + DRM_SPINLOCK(&dev_priv->user_irq_lock); if (dev->irq_enabled && (++dev_priv->user_irq_refcount == 1)) i915_enable_irq(dev_priv, I915_USER_INTERRUPT); - DRM_SPINUNLOCK_IRQRESTORE(&dev_priv->user_irq_lock, irqflags); + DRM_SPINUNLOCK(&dev_priv->user_irq_lock); } void i915_user_irq_put(struct drm_device *dev) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - unsigned long irqflags; - DRM_SPINLOCK_IRQSAVE(&dev_priv->user_irq_lock, irqflags); -#ifdef __linux__ - BUG_ON(dev->irq_enabled && dev_priv->user_irq_refcount <= 0); -#endif - if (dev->irq_enabled && (--dev_priv->user_irq_refcount == 0)) - i915_disable_irq(dev_priv, I915_USER_INTERRUPT); - DRM_SPINUNLOCK_IRQRESTORE(&dev_priv->user_irq_lock, irqflags); + DRM_SPINLOCK(&dev_priv->user_irq_lock); + if (dev->irq_enabled) { + KASSERT(dev_priv->user_irq_refcount > 0, ("invalid refcount")); + if (--dev_priv->user_irq_refcount == 0) + i915_disable_irq(dev_priv, I915_USER_INTERRUPT); + } + DRM_SPINUNLOCK(&dev_priv->user_irq_lock); } static int i915_wait_irq(struct drm_device * dev, int irq_nr) @@ -320,15 +350,14 @@ static int i915_wait_irq(struct drm_devi READ_BREADCRUMB(dev_priv) >= irq_nr); i915_user_irq_put(dev); + if (ret == -ERESTART) + DRM_DEBUG("restarting syscall\n"); + if (ret == -EBUSY) { DRM_ERROR("EBUSY -- rec: %d emitted: %d\n", READ_BREADCRUMB(dev_priv), (int)dev_priv->counter); } - if (dev_priv->sarea_priv) - dev_priv->sarea_priv->last_dispatch = - READ_BREADCRUMB(dev_priv); - return ret; } @@ -341,13 +370,13 @@ int i915_irq_emit(struct drm_device *dev drm_i915_irq_emit_t *emit = data; int result; - RING_LOCK_TEST_WITH_RETURN(dev, file_priv); - if (!dev_priv) { DRM_ERROR("called with no initialization\n"); return -EINVAL; } + RING_LOCK_TEST_WITH_RETURN(dev, file_priv); + result = i915_emit_irq(dev); if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) { @@ -380,21 +409,21 @@ int i915_irq_wait(struct drm_device *dev int i915_enable_vblank(struct drm_device *dev, int pipe) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - unsigned long irqflags; - u32 pipestat; + int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; + u32 pipeconf; - /* - * Older chips didn't have the start vblank interrupt, - * but - */ - if (IS_I965G (dev)) - pipestat = PIPE_START_VBLANK_INTERRUPT_ENABLE; - else - pipestat = PIPE_VBLANK_INTERRUPT_ENABLE; + pipeconf = I915_READ(pipeconf_reg); + if (!(pipeconf & PIPEACONF_ENABLE)) + return -EINVAL; - DRM_SPINLOCK_IRQSAVE(&dev_priv->user_irq_lock, irqflags); - i915_enable_pipestat(dev_priv, pipe, pipestat); - DRM_SPINUNLOCK_IRQRESTORE(&dev_priv->user_irq_lock, irqflags); + DRM_SPINLOCK(&dev_priv->user_irq_lock); + if (IS_I965G(dev)) + i915_enable_pipestat(dev_priv, pipe, + PIPE_START_VBLANK_INTERRUPT_ENABLE); + else + i915_enable_pipestat(dev_priv, pipe, + PIPE_VBLANK_INTERRUPT_ENABLE); + DRM_SPINUNLOCK(&dev_priv->user_irq_lock); return 0; } @@ -404,12 +433,12 @@ int i915_enable_vblank(struct drm_device void i915_disable_vblank(struct drm_device *dev, int pipe) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - unsigned long irqflags; - DRM_SPINLOCK_IRQSAVE(&dev_priv->user_irq_lock, irqflags); + DRM_SPINLOCK(&dev_priv->user_irq_lock); i915_disable_pipestat(dev_priv, pipe, - PIPE_START_VBLANK_INTERRUPT_ENABLE | PIPE_VBLANK_INTERRUPT_ENABLE); - DRM_SPINUNLOCK_IRQRESTORE(&dev_priv->user_irq_lock, irqflags); + PIPE_VBLANK_INTERRUPT_ENABLE | + PIPE_START_VBLANK_INTERRUPT_ENABLE); + DRM_SPINUNLOCK(&dev_priv->user_irq_lock); } /* Set the vblank monitor pipe @@ -463,7 +492,6 @@ int i915_vblank_swap(struct drm_device * * Context switching to userland and back is plenty fast enough for * meeting the requirements of vblank swapping. */ - return -EINVAL; } @@ -473,6 +501,8 @@ void i915_driver_irq_preinstall(struct d { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + atomic_set_int(&dev_priv->irq_received, 0); + I915_WRITE(HWSTAM, 0xeffe); I915_WRITE(PIPEASTAT, 0); I915_WRITE(PIPEBSTAT, 0); @@ -505,13 +535,6 @@ int i915_driver_irq_postinstall(struct d I915_WRITE(IER, I915_INTERRUPT_ENABLE_MASK); I915_WRITE(IMR, dev_priv->irq_mask_reg); (void) I915_READ(IER); -#ifdef __linux__ - opregion_enable_asle(dev); -#endif - DRM_INIT_WAITQUEUE(&dev_priv->irq_queue); - - i915_enable_vblank(dev, 0); - i915_enable_vblank(dev, 1); return 0; } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 15:44:23 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7101106564A; Tue, 23 Jun 2009 15:44:23 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3BD38FC0C; Tue, 23 Jun 2009 15:44:23 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NFiNbC080985; Tue, 23 Jun 2009 15:44:23 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NFiNBA080983; Tue, 23 Jun 2009 15:44:23 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231544.n5NFiNBA080983@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 15:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194719 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 15:44:24 -0000 Author: rnoland Date: Tue Jun 23 15:44:23 2009 New Revision: 194719 URL: http://svn.freebsd.org/changeset/base/194719 Log: Merge 190022 from HEAD Rework vblank handling to try to resolve some reports of "slow" windows after vt switch or suspend. I can't really test this on Intel right now but I think I've heard reports of it on radeon as well. I can't break it on the radeon here. (This doesn't actually fix the "slow" window problem.) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/drm_irq.c Modified: stable/7/sys/dev/drm/drm_irq.c ============================================================================== --- stable/7/sys/dev/drm/drm_irq.c Tue Jun 23 15:22:38 2009 (r194718) +++ stable/7/sys/dev/drm/drm_irq.c Tue Jun 23 15:44:23 2009 (r194719) @@ -98,15 +98,13 @@ static void vblank_disable_fn(void *arg) void drm_vblank_cleanup(struct drm_device *dev) { - unsigned long irqflags; - /* Bail if the driver didn't call drm_vblank_init() */ if (dev->num_crtcs == 0) return; - DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags); + DRM_SPINLOCK(&dev->vbl_lock); callout_stop(&dev->vblank_disable_timer); - DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags); + DRM_SPINUNLOCK(&dev->vbl_lock); callout_drain(&dev->vblank_disable_timer); @@ -200,11 +198,25 @@ err: int drm_irq_uninstall(struct drm_device *dev) { + int crtc; + if (!dev->irq_enabled) return EINVAL; dev->irq_enabled = 0; + /* + * Wake up any waiters so they don't hang. + */ + DRM_SPINLOCK(&dev->vbl_lock); + for (crtc = 0; crtc < dev->num_crtcs; crtc++) { + DRM_WAKEUP(&dev->vblank[crtc].queue); + dev->vblank[crtc].enabled = 0; + dev->vblank[crtc].last = + dev->driver->get_vblank_counter(dev, crtc); + } + DRM_SPINUNLOCK(&dev->vbl_lock); + DRM_DEBUG("irq=%d\n", dev->irq); dev->driver->irq_uninstall(dev); @@ -277,16 +289,15 @@ static void drm_update_vblank_count(stru int drm_vblank_get(struct drm_device *dev, int crtc) { - unsigned long irqflags; int ret = 0; - DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags); + DRM_SPINLOCK(&dev->vbl_lock); /* Going from 0->1 means we have to enable interrupts again */ atomic_add_acq_int(&dev->vblank[crtc].refcount, 1); - DRM_DEBUG("vblank refcount = %d\n", dev->vblank[crtc].refcount); if (dev->vblank[crtc].refcount == 1 && !dev->vblank[crtc].enabled) { ret = dev->driver->enable_vblank(dev, crtc); + DRM_DEBUG("enabling vblank on crtc %d, ret: %d\n", crtc, ret); if (ret) atomic_dec(&dev->vblank[crtc].refcount); else { @@ -294,30 +305,28 @@ int drm_vblank_get(struct drm_device *de drm_update_vblank_count(dev, crtc); } } - DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags); + DRM_SPINUNLOCK(&dev->vbl_lock); return ret; } void drm_vblank_put(struct drm_device *dev, int crtc) { - unsigned long irqflags; + KASSERT(atomic_read(&dev->vblank[crtc].refcount) > 0, + ("invalid refcount")); - DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags); /* Last user schedules interrupt disable */ atomic_subtract_acq_int(&dev->vblank[crtc].refcount, 1); - DRM_DEBUG("vblank refcount = %d\n", dev->vblank[crtc].refcount); + if (dev->vblank[crtc].refcount == 0) callout_reset(&dev->vblank_disable_timer, 5 * DRM_HZ, (timeout_t *)vblank_disable_fn, (void *)dev); - DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags); } int drm_modeset_ctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_modeset_ctl *modeset = data; - unsigned long irqflags; int crtc, ret = 0; DRM_DEBUG("num_crtcs=%d\n", dev->num_crtcs); @@ -343,18 +352,22 @@ int drm_modeset_ctl(struct drm_device *d case _DRM_PRE_MODESET: DRM_DEBUG("pre-modeset\n"); if (!dev->vblank[crtc].inmodeset) { - dev->vblank[crtc].inmodeset = 1; - drm_vblank_get(dev, crtc); + dev->vblank[crtc].inmodeset = 0x1; + if (drm_vblank_get(dev, crtc) == 0) + dev->vblank[crtc].inmodeset |= 0x2; } break; case _DRM_POST_MODESET: DRM_DEBUG("post-modeset\n"); if (dev->vblank[crtc].inmodeset) { - DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags); + DRM_SPINLOCK(&dev->vbl_lock); dev->vblank_disable_allowed = 1; + DRM_SPINUNLOCK(&dev->vbl_lock); + + if (dev->vblank[crtc].inmodeset & 0x2) + drm_vblank_put(dev, crtc); + dev->vblank[crtc].inmodeset = 0; - DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags); - drm_vblank_put(dev, crtc); } break; default: @@ -445,7 +458,11 @@ int drm_wait_vblank(struct drm_device *d mtx_unlock(&dev->irq_lock); } - DRM_DEBUG("return = %d\n", ret); + if (ret == ERESTART) { + DRM_DEBUG("restarting syscall\n"); + return ret; + } + if (ret != EINTR) { struct timeval now; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 15:46:22 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B48E6106564A; Tue, 23 Jun 2009 15:46:22 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 879438FC20; Tue, 23 Jun 2009 15:46:22 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NFkMK5081081; Tue, 23 Jun 2009 15:46:22 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NFkMUj081077; Tue, 23 Jun 2009 15:46:22 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231546.n5NFkMUj081077@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 15:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194720 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 15:46:23 -0000 Author: rnoland Date: Tue Jun 23 15:46:22 2009 New Revision: 194720 URL: http://svn.freebsd.org/changeset/base/194720 Log: Merge 190023 from HEAD Add some debugging so I can see when syscalls are being restarted consistantly. After a lengthy irc discussion it seems like we shouldn't need to worry about them, but it's nice to know about. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/drm_lock.c stable/7/sys/dev/drm/mga_irq.c stable/7/sys/dev/drm/radeon_irq.c Modified: stable/7/sys/dev/drm/drm_lock.c ============================================================================== --- stable/7/sys/dev/drm/drm_lock.c Tue Jun 23 15:44:23 2009 (r194719) +++ stable/7/sys/dev/drm/drm_lock.c Tue Jun 23 15:46:22 2009 (r194720) @@ -87,7 +87,12 @@ int drm_lock(struct drm_device *dev, voi break; } DRM_UNLOCK(); - DRM_DEBUG("%d %s\n", lock->context, ret ? "interrupted" : "has lock"); + + if (ret == ERESTART) + DRM_DEBUG("restarting syscall\n"); + else + DRM_DEBUG("%d %s\n", lock->context, + ret ? "interrupted" : "has lock"); if (ret != 0) return ret; Modified: stable/7/sys/dev/drm/mga_irq.c ============================================================================== --- stable/7/sys/dev/drm/mga_irq.c Tue Jun 23 15:44:23 2009 (r194719) +++ stable/7/sys/dev/drm/mga_irq.c Tue Jun 23 15:46:22 2009 (r194720) @@ -139,6 +139,9 @@ int mga_driver_fence_wait(struct drm_dev (((cur_fence = atomic_read(&dev_priv->last_fence_retired)) - *sequence) <= (1 << 23))); + if (ret == -ERESTART) + DRM_DEBUG("restarting syscall\n"); + *sequence = cur_fence; return ret; Modified: stable/7/sys/dev/drm/radeon_irq.c ============================================================================== --- stable/7/sys/dev/drm/radeon_irq.c Tue Jun 23 15:44:23 2009 (r194719) +++ stable/7/sys/dev/drm/radeon_irq.c Tue Jun 23 15:46:22 2009 (r194720) @@ -282,6 +282,9 @@ static int radeon_wait_irq(struct drm_de DRM_WAIT_ON(ret, dev_priv->swi_queue, 3 * DRM_HZ, RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr); + if (ret == -ERESTART) + DRM_DEBUG("restarting syscall"); + return ret; } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 15:49:02 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E69EB106564A; Tue, 23 Jun 2009 15:49:02 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D43DD8FC1E; Tue, 23 Jun 2009 15:49:02 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NFn2LT081202; Tue, 23 Jun 2009 15:49:02 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NFn2Nm081200; Tue, 23 Jun 2009 15:49:02 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231549.n5NFn2Nm081200@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 15:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194721 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 15:49:03 -0000 Author: rnoland Date: Tue Jun 23 15:49:02 2009 New Revision: 194721 URL: http://svn.freebsd.org/changeset/base/194721 Log: Merge 190125 from HEAD Only issue the wakeup and store the counter if vblank is enabled on the pipe. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/drm_irq.c Modified: stable/7/sys/dev/drm/drm_irq.c ============================================================================== --- stable/7/sys/dev/drm/drm_irq.c Tue Jun 23 15:46:22 2009 (r194720) +++ stable/7/sys/dev/drm/drm_irq.c Tue Jun 23 15:49:02 2009 (r194721) @@ -210,10 +210,12 @@ int drm_irq_uninstall(struct drm_device */ DRM_SPINLOCK(&dev->vbl_lock); for (crtc = 0; crtc < dev->num_crtcs; crtc++) { - DRM_WAKEUP(&dev->vblank[crtc].queue); - dev->vblank[crtc].enabled = 0; - dev->vblank[crtc].last = - dev->driver->get_vblank_counter(dev, crtc); + if (dev->vblank[crtc].enabled) { + DRM_WAKEUP(&dev->vblank[crtc].queue); + dev->vblank[crtc].enabled = 0; + dev->vblank[crtc].last = + dev->driver->get_vblank_counter(dev, crtc); + } } DRM_SPINUNLOCK(&dev->vbl_lock); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 15:50:48 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC79B106564A; Tue, 23 Jun 2009 15:50:48 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99C0A8FC16; Tue, 23 Jun 2009 15:50:48 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NFomXM081284; Tue, 23 Jun 2009 15:50:48 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NFom1u081282; Tue, 23 Jun 2009 15:50:48 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231550.n5NFom1u081282@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 15:50:48 +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: r194722 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 15:50:49 -0000 Author: rnoland Date: Tue Jun 23 15:50:48 2009 New Revision: 194722 URL: http://svn.freebsd.org/changeset/base/194722 Log: Merge 190163 from HEAD Don't deref dev->dev_private before checking that it exists. Found with: Coverity Prevent(tm) CID: 2940 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/i915_drv.c Modified: stable/7/sys/dev/drm/i915_drv.c ============================================================================== --- stable/7/sys/dev/drm/i915_drv.c Tue Jun 23 15:49:02 2009 (r194721) +++ stable/7/sys/dev/drm/i915_drv.c Tue Jun 23 15:50:48 2009 (r194722) @@ -46,9 +46,8 @@ static drm_pci_id_list_t i915_pciidlist[ static int i915_suspend(device_t kdev) { struct drm_device *dev = device_get_softc(kdev); - struct drm_i915_private *dev_priv = dev->dev_private; - if (!dev || !dev_priv) { + if (!dev || !dev->dev_private) { DRM_ERROR("dev: 0x%lx, dev_priv: 0x%lx\n", (unsigned long) dev, (unsigned long) dev_priv); DRM_ERROR("DRM not initialized, aborting suspend.\n"); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 15:52:09 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53E771065672; Tue, 23 Jun 2009 15:52:09 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 413BA8FC0C; Tue, 23 Jun 2009 15:52:09 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NFq9gW081403; Tue, 23 Jun 2009 15:52:09 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NFq9nM081401; Tue, 23 Jun 2009 15:52:09 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231552.n5NFq9nM081401@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 15:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194723 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 15:52:10 -0000 Author: rnoland Date: Tue Jun 23 15:52:08 2009 New Revision: 194723 URL: http://svn.freebsd.org/changeset/base/194723 Log: Merge 190164 from HEAD Fix what appears to be a typo, and restore the registers correctly. Found with: Coverity Prevent(tm) CID: 2454 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/i915_suspend.c Modified: stable/7/sys/dev/drm/i915_suspend.c ============================================================================== --- stable/7/sys/dev/drm/i915_suspend.c Tue Jun 23 15:50:48 2009 (r194722) +++ stable/7/sys/dev/drm/i915_suspend.c Tue Jun 23 15:52:08 2009 (r194723) @@ -515,7 +515,7 @@ int i915_restore_state(struct drm_device for (i = 0; i < 16; i++) { I915_WRITE(SWF00 + (i << 2), dev_priv->saveSWF0[i]); - I915_WRITE(SWF10 + (i << 2), dev_priv->saveSWF1[i+7]); + I915_WRITE(SWF10 + (i << 2), dev_priv->saveSWF1[i]); } for (i = 0; i < 3; i++) I915_WRITE(SWF30 + (i << 2), dev_priv->saveSWF2[i]); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 15:53:17 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59CC91065677; Tue, 23 Jun 2009 15:53:17 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 473D08FC1F; Tue, 23 Jun 2009 15:53:17 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NFrHHY081498; Tue, 23 Jun 2009 15:53:17 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NFrHK4081496; Tue, 23 Jun 2009 15:53:17 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231553.n5NFrHK4081496@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 15:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194724 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 15:53:18 -0000 Author: rnoland Date: Tue Jun 23 15:53:17 2009 New Revision: 194724 URL: http://svn.freebsd.org/changeset/base/194724 Log: Merge 190166 from HEAD Remove the DRM_ERROR to fix build. It didn't make any sense anyway. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/i915_drv.c Modified: stable/7/sys/dev/drm/i915_drv.c ============================================================================== --- stable/7/sys/dev/drm/i915_drv.c Tue Jun 23 15:52:08 2009 (r194723) +++ stable/7/sys/dev/drm/i915_drv.c Tue Jun 23 15:53:17 2009 (r194724) @@ -48,8 +48,6 @@ static int i915_suspend(device_t kdev) struct drm_device *dev = device_get_softc(kdev); if (!dev || !dev->dev_private) { - DRM_ERROR("dev: 0x%lx, dev_priv: 0x%lx\n", - (unsigned long) dev, (unsigned long) dev_priv); DRM_ERROR("DRM not initialized, aborting suspend.\n"); return -ENODEV; } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 15:54:34 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BE6D106571B; Tue, 23 Jun 2009 15:54:34 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78C5E8FC1D; Tue, 23 Jun 2009 15:54:34 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NFsY9E081585; Tue, 23 Jun 2009 15:54:34 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NFsYhY081583; Tue, 23 Jun 2009 15:54:34 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231554.n5NFsYhY081583@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 15:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194725 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 15:54:35 -0000 Author: rnoland Date: Tue Jun 23 15:54:34 2009 New Revision: 194725 URL: http://svn.freebsd.org/changeset/base/194725 Log: Merge 190170 from HEAD vm_offset_t is unsigned, so compare of >= 0 is not needed. Found with: Coverity Prevent(tm) CID: 2259 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/drm_vm.c Modified: stable/7/sys/dev/drm/drm_vm.c ============================================================================== --- stable/7/sys/dev/drm/drm_vm.c Tue Jun 23 15:53:17 2009 (r194724) +++ stable/7/sys/dev/drm/drm_vm.c Tue Jun 23 15:54:34 2009 (r194725) @@ -54,7 +54,7 @@ int drm_mmap(struct cdev *kdev, vm_offse if (file_priv && !file_priv->authenticated) return EACCES; - if (dev->dma && offset >= 0 && offset < ptoa(dev->dma->page_count)) { + if (dev->dma && offset < ptoa(dev->dma->page_count)) { drm_device_dma_t *dma = dev->dma; DRM_SPINLOCK(&dev->dma_lock); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 15:56:11 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E3F5106566C; Tue, 23 Jun 2009 15:56:11 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E56268FC25; Tue, 23 Jun 2009 15:56:10 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NFuA12081740; Tue, 23 Jun 2009 15:56:10 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NFuAVN081737; Tue, 23 Jun 2009 15:56:10 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231556.n5NFuAVN081737@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 15:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194727 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 15:56:11 -0000 Author: rnoland Date: Tue Jun 23 15:56:10 2009 New Revision: 194727 URL: http://svn.freebsd.org/changeset/base/194727 Log: Merge 190400 from HEAD Intel handled the management of the breadcrumb counter inconsistently. Make sure that we always handle it the same way. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/i915_dma.c stable/7/sys/dev/drm/i915_irq.c Modified: stable/7/sys/dev/drm/i915_dma.c ============================================================================== --- stable/7/sys/dev/drm/i915_dma.c Tue Jun 23 15:55:58 2009 (r194726) +++ stable/7/sys/dev/drm/i915_dma.c Tue Jun 23 15:56:10 2009 (r194727) @@ -439,8 +439,7 @@ static void i915_emit_breadcrumb(struct drm_i915_private_t *dev_priv = dev->dev_private; RING_LOCALS; - dev_priv->counter++; - if (dev_priv->counter > 0x7FFFFFFFUL) + if (++dev_priv->counter > 0x7FFFFFFFUL) dev_priv->counter = 0; if (dev_priv->sarea_priv) dev_priv->sarea_priv->last_enqueue = dev_priv->counter; @@ -574,7 +573,10 @@ static int i915_dispatch_flip(struct drm OUT_RING(0); ADVANCE_LP_RING(); - dev_priv->sarea_priv->last_enqueue = dev_priv->counter++; + if (++dev_priv->counter > 0x7FFFFFFFUL) + dev_priv->counter = 0; + if (dev_priv->sarea_priv) + dev_priv->sarea_priv->last_enqueue = dev_priv->counter; BEGIN_LP_RING(4); OUT_RING(MI_STORE_DWORD_INDEX); Modified: stable/7/sys/dev/drm/i915_irq.c ============================================================================== --- stable/7/sys/dev/drm/i915_irq.c Tue Jun 23 15:55:58 2009 (r194726) +++ stable/7/sys/dev/drm/i915_irq.c Tue Jun 23 15:56:10 2009 (r194727) @@ -284,14 +284,13 @@ static int i915_emit_irq(struct drm_devi i915_kernel_lost_context(dev); - DRM_DEBUG("\n"); - - dev_priv->counter++; - if (dev_priv->counter > 0x7FFFFFFFUL) - dev_priv->counter = 1; + if (++dev_priv->counter > 0x7FFFFFFFUL) + dev_priv->counter = 0; if (dev_priv->sarea_priv) dev_priv->sarea_priv->last_enqueue = dev_priv->counter; + DRM_DEBUG("emitting: %d\n", dev_priv->counter); + BEGIN_LP_RING(4); OUT_RING(MI_STORE_DWORD_INDEX); OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT); @@ -331,9 +330,6 @@ static int i915_wait_irq(struct drm_devi drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int ret = 0; - DRM_DEBUG("irq_nr=%d breadcrumb=%d\n", irq_nr, - READ_BREADCRUMB(dev_priv)); - if (READ_BREADCRUMB(dev_priv) >= irq_nr) { if (dev_priv->sarea_priv) { dev_priv->sarea_priv->last_dispatch = @@ -345,6 +341,9 @@ static int i915_wait_irq(struct drm_devi if (dev_priv->sarea_priv) dev_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT; + DRM_DEBUG("irq_nr=%d breadcrumb=%d\n", irq_nr, + READ_BREADCRUMB(dev_priv)); + i915_user_irq_get(dev); DRM_WAIT_ON(ret, dev_priv->irq_queue, 3 * DRM_HZ, READ_BREADCRUMB(dev_priv) >= irq_nr); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 15:59:10 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAD821065673; Tue, 23 Jun 2009 15:59:10 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF0598FC1B; Tue, 23 Jun 2009 15:59:10 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NFxAYK081863; Tue, 23 Jun 2009 15:59:10 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NFxA44081861; Tue, 23 Jun 2009 15:59:10 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231559.n5NFxA44081861@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 15:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194728 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 15:59:12 -0000 Author: rnoland Date: Tue Jun 23 15:59:10 2009 New Revision: 194728 URL: http://svn.freebsd.org/changeset/base/194728 Log: Merge 190401 from HEAD Rework the management of vblank interrupts a bit. When a vt switch occurs the irq handler is uninstalled. Interrupts and the state tracking of what was enabled/disabled wasn't working properly. This should resolve the reports of "slow windows" after a vt switch, among other things. The radeon 2d driver seems to work a bit more correctly than the Intel driver. With the Intel driver, vblank interrupts will be enabled at system startup and will only be disabled after an additional modeset (vt switch, dpms, randr event). With this patch, I am able to run glxgears synced to vblank and vt switch while it is running without ill effects. (Still didn't fix the slow window issues on Intel) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/drm_irq.c Modified: stable/7/sys/dev/drm/drm_irq.c ============================================================================== --- stable/7/sys/dev/drm/drm_irq.c Tue Jun 23 15:56:10 2009 (r194727) +++ stable/7/sys/dev/drm/drm_irq.c Tue Jun 23 15:59:10 2009 (r194728) @@ -80,13 +80,14 @@ static void vblank_disable_fn(void *arg) } callout_deactivate(&dev->vblank_disable_timer); - DRM_DEBUG("vblank_disable_allowed=%d\n", dev->vblank_disable_allowed); + DRM_DEBUG("vblank_disable: %s\n", dev->vblank_disable_allowed ? + "allowed" : "denied"); if (!dev->vblank_disable_allowed) return; for (i = 0; i < dev->num_crtcs; i++) { if (atomic_read(&dev->vblank[i].refcount) == 0 && - dev->vblank[i].enabled) { + dev->vblank[i].enabled && !dev->vblank[i].inmodeset) { DRM_DEBUG("disabling vblank on crtc %d\n", i); dev->vblank[i].last = dev->driver->get_vblank_counter(dev, i); @@ -149,7 +150,7 @@ err: int drm_irq_install(struct drm_device *dev) { - int retcode; + int crtc, retcode; if (dev->irq == 0 || dev->dev_private == NULL) return EINVAL; @@ -186,6 +187,17 @@ int drm_irq_install(struct drm_device *d DRM_LOCK(); dev->driver->irq_postinstall(dev); DRM_UNLOCK(); + if (dev->driver->enable_vblank) { + DRM_SPINLOCK(&dev->vbl_lock); + for( crtc = 0 ; crtc < dev->num_crtcs ; crtc++) { + if (dev->driver->enable_vblank(dev, crtc) == 0) { + dev->vblank[crtc].enabled = 1; + } + } + callout_reset(&dev->vblank_disable_timer, 5 * DRM_HZ, + (timeout_t *)vblank_disable_fn, (void *)dev); + DRM_SPINUNLOCK(&dev->vbl_lock); + } return 0; err: @@ -212,9 +224,9 @@ int drm_irq_uninstall(struct drm_device for (crtc = 0; crtc < dev->num_crtcs; crtc++) { if (dev->vblank[crtc].enabled) { DRM_WAKEUP(&dev->vblank[crtc].queue); - dev->vblank[crtc].enabled = 0; dev->vblank[crtc].last = - dev->driver->get_vblank_counter(dev, crtc); + dev->driver->get_vblank_counter(dev, crtc); + dev->vblank[crtc].enabled = 0; } } DRM_SPINUNLOCK(&dev->vbl_lock); @@ -320,9 +332,11 @@ void drm_vblank_put(struct drm_device *d /* Last user schedules interrupt disable */ atomic_subtract_acq_int(&dev->vblank[crtc].refcount, 1); + DRM_SPINLOCK(&dev->vbl_lock); if (dev->vblank[crtc].refcount == 0) callout_reset(&dev->vblank_disable_timer, 5 * DRM_HZ, (timeout_t *)vblank_disable_fn, (void *)dev); + DRM_SPINUNLOCK(&dev->vbl_lock); } int drm_modeset_ctl(struct drm_device *dev, void *data, @@ -449,31 +463,26 @@ int drm_wait_vblank(struct drm_device *d } else { DRM_DEBUG("waiting on vblank count %d, crtc %d\n", vblwait->request.sequence, crtc); - for ( ret = 0 ; !ret && !((drm_vblank_count(dev, crtc) - - vblwait->request.sequence) <= (1 << 23)) ; ) { - mtx_lock(&dev->irq_lock); - if (!((drm_vblank_count(dev, crtc) - - vblwait->request.sequence) <= (1 << 23))) - ret = mtx_sleep(&dev->vblank[crtc].queue, - &dev->irq_lock, PCATCH, "vblwtq", - 3 * DRM_HZ); - mtx_unlock(&dev->irq_lock); - } - - if (ret == ERESTART) { - DRM_DEBUG("restarting syscall\n"); - return ret; + mtx_lock(&dev->irq_lock); + dev->vblank[crtc].last = vblwait->request.sequence; + for ( ret = 0 ; !ret && !(((drm_vblank_count(dev, crtc) - + vblwait->request.sequence) <= (1 << 23)) || + !dev->irq_enabled) ; ) { + ret = mtx_sleep(&dev->vblank[crtc].queue, + &dev->irq_lock, PCATCH, "vblwtq", + 3 * DRM_HZ); } + mtx_unlock(&dev->irq_lock); - if (ret != EINTR) { + if (ret != EINTR && ret != ERESTART) { struct timeval now; microtime(&now); vblwait->reply.tval_sec = now.tv_sec; vblwait->reply.tval_usec = now.tv_usec; vblwait->reply.sequence = drm_vblank_count(dev, crtc); - DRM_DEBUG("returning %d to client\n", - vblwait->reply.sequence); + DRM_DEBUG("returning %d to client, irq_enabled %d\n", + vblwait->reply.sequence, dev->irq_enabled); } else { DRM_DEBUG("vblank wait interrupted by signal\n"); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 16:00:14 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 898151065670; Tue, 23 Jun 2009 16:00:14 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74BED8FC0C; Tue, 23 Jun 2009 16:00:14 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NG0E1I081962; Tue, 23 Jun 2009 16:00:14 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NG0E2b081960; Tue, 23 Jun 2009 16:00:14 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231600.n5NG0E2b081960@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 16:00:14 +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: r194729 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 16:00:16 -0000 Author: rnoland Date: Tue Jun 23 16:00:14 2009 New Revision: 194729 URL: http://svn.freebsd.org/changeset/base/194729 Log: Merge 190433 from HEAD Fix up waiting on vblank again... This reverts a last minute change that I made on the last patch, it seems to upset suspend/resume and shutdown. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/drm_irq.c Modified: stable/7/sys/dev/drm/drm_irq.c ============================================================================== --- stable/7/sys/dev/drm/drm_irq.c Tue Jun 23 15:59:10 2009 (r194728) +++ stable/7/sys/dev/drm/drm_irq.c Tue Jun 23 16:00:14 2009 (r194729) @@ -463,16 +463,19 @@ int drm_wait_vblank(struct drm_device *d } else { DRM_DEBUG("waiting on vblank count %d, crtc %d\n", vblwait->request.sequence, crtc); - mtx_lock(&dev->irq_lock); dev->vblank[crtc].last = vblwait->request.sequence; for ( ret = 0 ; !ret && !(((drm_vblank_count(dev, crtc) - vblwait->request.sequence) <= (1 << 23)) || !dev->irq_enabled) ; ) { - ret = mtx_sleep(&dev->vblank[crtc].queue, - &dev->irq_lock, PCATCH, "vblwtq", - 3 * DRM_HZ); + mtx_lock(&dev->irq_lock); + if (!(((drm_vblank_count(dev, crtc) - + vblwait->request.sequence) <= (1 << 23)) || + !dev->irq_enabled)) + ret = mtx_sleep(&dev->vblank[crtc].queue, + &dev->irq_lock, PCATCH, "vblwtq", + 3 * DRM_HZ); + mtx_unlock(&dev->irq_lock); } - mtx_unlock(&dev->irq_lock); if (ret != EINTR && ret != ERESTART) { struct timeval now; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 16:02:04 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93E101065673; Tue, 23 Jun 2009 16:02:04 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FA038FC13; Tue, 23 Jun 2009 16:02:04 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NG24w3082056; Tue, 23 Jun 2009 16:02:04 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NG247J082053; Tue, 23 Jun 2009 16:02:04 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231602.n5NG247J082053@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 16:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194730 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 16:02:05 -0000 Author: rnoland Date: Tue Jun 23 16:02:04 2009 New Revision: 194730 URL: http://svn.freebsd.org/changeset/base/194730 Log: Merge 190595 from HEAD Simplify the radeon microcode loading. Submitted by: Christoph Mallon Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/r600_cp.c stable/7/sys/dev/drm/radeon_cp.c Modified: stable/7/sys/dev/drm/r600_cp.c ============================================================================== --- stable/7/sys/dev/drm/r600_cp.c Tue Jun 23 16:00:14 2009 (r194729) +++ stable/7/sys/dev/drm/r600_cp.c Tue Jun 23 16:02:04 2009 (r194730) @@ -282,6 +282,8 @@ static void r600_vm_init(struct drm_devi /* load r600 microcode */ static void r600_cp_load_microcode(drm_radeon_private_t *dev_priv) { + const u32 (*cp)[3]; + const u32 *pfp; int i; r600_do_cp_stop(dev_priv); @@ -298,116 +300,60 @@ static void r600_cp_load_microcode(drm_r RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R600)) { - DRM_INFO("Loading R600 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - R600_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - R600_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - R600_cp_microcode[i][2]); - } - - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading R600 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, R600_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610)) { - DRM_INFO("Loading RV610 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV610_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV610_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV610_cp_microcode[i][2]); - } - - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV610 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV610_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV630)) { - DRM_INFO("Loading RV630 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV630_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV630_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV630_cp_microcode[i][2]); - } - - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV630 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV630_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620)) { - DRM_INFO("Loading RV620 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV620_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV620_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV620_cp_microcode[i][2]); - } - - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV620 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV620_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV635)) { - DRM_INFO("Loading RV635 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV635_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV635_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV635_cp_microcode[i][2]); - } + switch (dev_priv->flags & RADEON_FAMILY_MASK) { + case CHIP_R600: + DRM_INFO("Loading R600 Microcode\n"); + cp = R600_cp_microcode; + pfp = R600_pfp_microcode; + break; + case CHIP_RV610: + DRM_INFO("Loading RV610 Microcode\n"); + cp = RV610_cp_microcode; + pfp = RV610_pfp_microcode; + break; + case CHIP_RV630: + DRM_INFO("Loading RV630 Microcode\n"); + cp = RV630_cp_microcode; + pfp = RV630_pfp_microcode; + break; + case CHIP_RV620: + DRM_INFO("Loading RV620 Microcode\n"); + cp = RV620_cp_microcode; + pfp = RV620_pfp_microcode; + break; + case CHIP_RV635: + DRM_INFO("Loading RV635 Microcode\n"); + cp = RV635_cp_microcode; + pfp = RV635_pfp_microcode; + break; + case CHIP_RV670: + DRM_INFO("Loading RV670 Microcode\n"); + cp = RV670_cp_microcode; + pfp = RV670_pfp_microcode; + break; + case CHIP_RS780: + DRM_INFO("Loading RS780 Microcode\n"); + cp = RS780_cp_microcode; + pfp = RS780_pfp_microcode; + break; + default: + goto no_microcode; + } - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV635 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV635_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV670)) { - DRM_INFO("Loading RV670 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][2]); - } + for (i = 0; i != PM4_UCODE_SIZE; i++) { + RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][0]); + RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][1]); + RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][2]); + } - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV670 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV670_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780)) { - DRM_INFO("Loading RS780 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RS780_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RS780_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RS780_cp_microcode[i][2]); - } + RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); + for (i = 0; i != PFP_UCODE_SIZE; i++) + RADEON_WRITE(R600_CP_PFP_UCODE_DATA, pfp[i]); +no_microcode:; - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RS780 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RS780_pfp_microcode[i]); - } RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_RADDR, 0); - } static void r700_vm_init(struct drm_device *dev) @@ -465,6 +411,8 @@ static void r700_vm_init(struct drm_devi /* load r600 microcode */ static void r700_cp_load_microcode(drm_radeon_private_t *dev_priv) { + const u32 *pfp; + const u32 *cp; int i; r600_do_cp_stop(dev_priv); @@ -479,51 +427,40 @@ static void r700_cp_load_microcode(drm_r DRM_UDELAY(15000); RADEON_WRITE(R600_GRBM_SOFT_RESET, 0); + switch (dev_priv->flags & RADEON_FAMILY_MASK) { + case CHIP_RV770: + DRM_INFO("Loading RV770 Microcode\n"); + pfp = RV770_pfp_microcode; + cp = RV770_cp_microcode; + break; + case CHIP_RV730: + DRM_INFO("Loading RV730 Microcode\n"); + pfp = RV730_pfp_microcode; + cp = RV730_cp_microcode; + break; + case CHIP_RV710: + DRM_INFO("Loading RV710 Microcode\n"); + pfp = RV710_pfp_microcode; + cp = RV710_cp_microcode; + break; + default: + goto no_microcode; + } + + RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); + for (i = 0; i != R700_PFP_UCODE_SIZE; i++) + RADEON_WRITE(R600_CP_PFP_UCODE_DATA, pfp[i]); + RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV770)) { - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV770 PFP Microcode\n"); - for (i = 0; i < R700_PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV770_pfp_microcode[i]); - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - DRM_INFO("Loading RV770 CP Microcode\n"); - for (i = 0; i < R700_PM4_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_ME_RAM_DATA, RV770_cp_microcode[i]); - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV730)) { - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV730 PFP Microcode\n"); - for (i = 0; i < R700_PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV730_pfp_microcode[i]); - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - DRM_INFO("Loading RV730 CP Microcode\n"); - for (i = 0; i < R700_PM4_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_ME_RAM_DATA, RV730_cp_microcode[i]); - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV710)) { - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV710 PFP Microcode\n"); - for (i = 0; i < R700_PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV710_pfp_microcode[i]); - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - DRM_INFO("Loading RV710 CP Microcode\n"); - for (i = 0; i < R700_PM4_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_ME_RAM_DATA, RV710_cp_microcode[i]); - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); + RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); + for (i = 0; i != R700_PM4_UCODE_SIZE; i++) + RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i]); + RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); +no_microcode:; - } RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_RADDR, 0); - } static void r600_test_writeback(drm_radeon_private_t *dev_priv) Modified: stable/7/sys/dev/drm/radeon_cp.c ============================================================================== --- stable/7/sys/dev/drm/radeon_cp.c Tue Jun 23 16:00:14 2009 (r194729) +++ stable/7/sys/dev/drm/radeon_cp.c Tue Jun 23 16:02:04 2009 (r194730) @@ -455,88 +455,70 @@ static void radeon_init_pipes(drm_radeon /* Load the microcode for the CP */ static void radeon_cp_load_microcode(drm_radeon_private_t * dev_priv) { + const u32 (*cp)[2]; int i; + DRM_DEBUG("\n"); radeon_do_wait_for_idle(dev_priv); RADEON_WRITE(RADEON_CP_ME_RAM_ADDR, 0); - if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R100) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV100) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV200) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS100) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS200)) { + switch (dev_priv->flags & RADEON_FAMILY_MASK) { + case CHIP_R100: + case CHIP_RV100: + case CHIP_RV200: + case CHIP_RS100: + case CHIP_RS200: DRM_INFO("Loading R100 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - R100_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - R100_cp_microcode[i][0]); - } - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R200) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV250) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV280) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS300)) { + cp = R100_cp_microcode; + break; + case CHIP_R200: + case CHIP_RV250: + case CHIP_RV280: + case CHIP_RS300: DRM_INFO("Loading R200 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - R200_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - R200_cp_microcode[i][0]); - } - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R300) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R350) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV350) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV380) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS400) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS480)) { + cp = R200_cp_microcode; + break; + case CHIP_R300: + case CHIP_R350: + case CHIP_RV350: + case CHIP_RV380: + case CHIP_RS400: + case CHIP_RS480: DRM_INFO("Loading R300 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - R300_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - R300_cp_microcode[i][0]); - } - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R420) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R423) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV410)) { + cp = R300_cp_microcode; + break; + case CHIP_R420: + case CHIP_R423: + case CHIP_RV410: DRM_INFO("Loading R400 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - R420_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - R420_cp_microcode[i][0]); - } - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS740)) { + cp = R420_cp_microcode; + break; + case CHIP_RS690: + case CHIP_RS740: DRM_INFO("Loading RS690/RS740 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - RS690_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - RS690_cp_microcode[i][0]); - } - } else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS600) { + cp = RS690_cp_microcode; + break; + case CHIP_RS600: DRM_INFO("Loading RS600 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - RS600_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - RS600_cp_microcode[i][0]); - } - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R520) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV530) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R580) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV560) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV570)) { + cp = RS600_cp_microcode; + break; + case CHIP_RV515: + case CHIP_R520: + case CHIP_RV530: + case CHIP_R580: + case CHIP_RV560: + case CHIP_RV570: DRM_INFO("Loading R500 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - R520_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - R520_cp_microcode[i][0]); - } + cp = R520_cp_microcode; + break; + default: + return; + } + + for (i = 0; i != 256; i++) { + RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, cp[i][1]); + RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, cp[i][0]); } } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 16:04:54 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E2971065675; Tue, 23 Jun 2009 16:04:54 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AE078FC2A; Tue, 23 Jun 2009 16:04:54 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NG4sFY082160; Tue, 23 Jun 2009 16:04:54 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NG4sCv082157; Tue, 23 Jun 2009 16:04:54 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231604.n5NG4sCv082157@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 16:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194731 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 16:04:55 -0000 Author: rnoland Date: Tue Jun 23 16:04:54 2009 New Revision: 194731 URL: http://svn.freebsd.org/changeset/base/194731 Log: Merge 190674 from HEAD A little more cleanup from AMD, if we don't have the right microcode there is no reason to mess with the chip. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/r600_cp.c stable/7/sys/dev/drm/radeon_cp.c Modified: stable/7/sys/dev/drm/r600_cp.c ============================================================================== --- stable/7/sys/dev/drm/r600_cp.c Tue Jun 23 16:02:04 2009 (r194730) +++ stable/7/sys/dev/drm/r600_cp.c Tue Jun 23 16:04:54 2009 (r194731) @@ -286,20 +286,6 @@ static void r600_cp_load_microcode(drm_r const u32 *pfp; int i; - r600_do_cp_stop(dev_priv); - - RADEON_WRITE(R600_CP_RB_CNTL, - R600_RB_NO_UPDATE | - R600_RB_BLKSZ(15) | - R600_RB_BUFSZ(3)); - - RADEON_WRITE(R600_GRBM_SOFT_RESET, R600_SOFT_RESET_CP); - RADEON_READ(R600_GRBM_SOFT_RESET); - DRM_UDELAY(15000); - RADEON_WRITE(R600_GRBM_SOFT_RESET, 0); - - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - switch (dev_priv->flags & RADEON_FAMILY_MASK) { case CHIP_R600: DRM_INFO("Loading R600 Microcode\n"); @@ -337,19 +323,32 @@ static void r600_cp_load_microcode(drm_r pfp = RS780_pfp_microcode; break; default: - goto no_microcode; + return; } - for (i = 0; i != PM4_UCODE_SIZE; i++) { + r600_do_cp_stop(dev_priv); + + RADEON_WRITE(R600_CP_RB_CNTL, + R600_RB_NO_UPDATE | + R600_RB_BLKSZ(15) | + R600_RB_BUFSZ(3)); + + RADEON_WRITE(R600_GRBM_SOFT_RESET, R600_SOFT_RESET_CP); + RADEON_READ(R600_GRBM_SOFT_RESET); + DRM_UDELAY(15000); + RADEON_WRITE(R600_GRBM_SOFT_RESET, 0); + + RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); + + for (i = 0; i < PM4_UCODE_SIZE; i++) { RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][0]); RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][1]); RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][2]); } RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - for (i = 0; i != PFP_UCODE_SIZE; i++) + for (i = 0; i < PFP_UCODE_SIZE; i++) RADEON_WRITE(R600_CP_PFP_UCODE_DATA, pfp[i]); -no_microcode:; RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); @@ -415,21 +414,9 @@ static void r700_cp_load_microcode(drm_r const u32 *cp; int i; - r600_do_cp_stop(dev_priv); - - RADEON_WRITE(R600_CP_RB_CNTL, - R600_RB_NO_UPDATE | - (15 << 8) | - (3 << 0)); - - RADEON_WRITE(R600_GRBM_SOFT_RESET, R600_SOFT_RESET_CP); - RADEON_READ(R600_GRBM_SOFT_RESET); - DRM_UDELAY(15000); - RADEON_WRITE(R600_GRBM_SOFT_RESET, 0); - switch (dev_priv->flags & RADEON_FAMILY_MASK) { case CHIP_RV770: - DRM_INFO("Loading RV770 Microcode\n"); + DRM_INFO("Loading RV770/RV790 Microcode\n"); pfp = RV770_pfp_microcode; cp = RV770_cp_microcode; break; @@ -444,19 +431,30 @@ static void r700_cp_load_microcode(drm_r cp = RV710_cp_microcode; break; default: - goto no_microcode; + return; } + r600_do_cp_stop(dev_priv); + + RADEON_WRITE(R600_CP_RB_CNTL, + R600_RB_NO_UPDATE | + (15 << 8) | + (3 << 0)); + + RADEON_WRITE(R600_GRBM_SOFT_RESET, R600_SOFT_RESET_CP); + RADEON_READ(R600_GRBM_SOFT_RESET); + DRM_UDELAY(15000); + RADEON_WRITE(R600_GRBM_SOFT_RESET, 0); + RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - for (i = 0; i != R700_PFP_UCODE_SIZE; i++) + for (i = 0; i < R700_PFP_UCODE_SIZE; i++) RADEON_WRITE(R600_CP_PFP_UCODE_DATA, pfp[i]); RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - for (i = 0; i != R700_PM4_UCODE_SIZE; i++) + for (i = 0; i < R700_PM4_UCODE_SIZE; i++) RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i]); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); -no_microcode:; RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); Modified: stable/7/sys/dev/drm/radeon_cp.c ============================================================================== --- stable/7/sys/dev/drm/radeon_cp.c Tue Jun 23 16:02:04 2009 (r194730) +++ stable/7/sys/dev/drm/radeon_cp.c Tue Jun 23 16:04:54 2009 (r194731) @@ -460,9 +460,6 @@ static void radeon_cp_load_microcode(drm DRM_DEBUG("\n"); - radeon_do_wait_for_idle(dev_priv); - - RADEON_WRITE(RADEON_CP_ME_RAM_ADDR, 0); switch (dev_priv->flags & RADEON_FAMILY_MASK) { case CHIP_R100: case CHIP_RV100: @@ -516,6 +513,10 @@ static void radeon_cp_load_microcode(drm return; } + radeon_do_wait_for_idle(dev_priv); + + RADEON_WRITE(RADEON_CP_ME_RAM_ADDR, 0); + for (i = 0; i != 256; i++) { RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, cp[i][1]); RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, cp[i][0]); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 16:06:13 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 937201065672; Tue, 23 Jun 2009 16:06:13 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80C6A8FC1B; Tue, 23 Jun 2009 16:06:13 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NG6DWT082250; Tue, 23 Jun 2009 16:06:13 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NG6D2x082248; Tue, 23 Jun 2009 16:06:13 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231606.n5NG6D2x082248@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 16:06: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: r194732 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 16:06:14 -0000 Author: rnoland Date: Tue Jun 23 16:06:13 2009 New Revision: 194732 URL: http://svn.freebsd.org/changeset/base/194732 Log: Merge 190675 from HEAD Add support for RV790 (HD 4890) asics Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/drm_pciids.h Modified: stable/7/sys/dev/drm/drm_pciids.h ============================================================================== --- stable/7/sys/dev/drm/drm_pciids.h Tue Jun 23 16:04:54 2009 (r194731) +++ stable/7/sys/dev/drm/drm_pciids.h Tue Jun 23 16:06:13 2009 (r194732) @@ -336,6 +336,8 @@ {0x1002, 0x944B, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4850 X2"}, \ {0x1002, 0x945A, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4870"}, \ {0x1002, 0x945B, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon M98"}, \ + {0x1002, 0x9460, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ + {0x1002, 0x9462, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ {0x1002, 0x946A, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI FirePro M7750"}, \ {0x1002, 0x946B, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI M98"}, \ {0x1002, 0x947A, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI M98"}, \ From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 16:07:56 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74976106566C; Tue, 23 Jun 2009 16:07:56 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61F288FC14; Tue, 23 Jun 2009 16:07:56 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NG7uV8082344; Tue, 23 Jun 2009 16:07:56 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NG7u1R082339; Tue, 23 Jun 2009 16:07:56 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231607.n5NG7u1R082339@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 16:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194733 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 16:07:57 -0000 Author: rnoland Date: Tue Jun 23 16:07:56 2009 New Revision: 194733 URL: http://svn.freebsd.org/changeset/base/194733 Log: Merge 190831 from HEAD Add regs required for occlusion queries support Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/r300_cmdbuf.c stable/7/sys/dev/drm/r300_reg.h stable/7/sys/dev/drm/radeon_cp.c stable/7/sys/dev/drm/radeon_drv.h Modified: stable/7/sys/dev/drm/r300_cmdbuf.c ============================================================================== --- stable/7/sys/dev/drm/r300_cmdbuf.c Tue Jun 23 16:06:13 2009 (r194732) +++ stable/7/sys/dev/drm/r300_cmdbuf.c Tue Jun 23 16:07:56 2009 (r194733) @@ -208,6 +208,10 @@ void r300_init_reg_flags(struct drm_devi ADD_RANGE(0x42C0, 2); ADD_RANGE(R300_RS_CNTL_0, 2); + ADD_RANGE(R300_SU_REG_DEST, 1); + if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV530) + ADD_RANGE(RV530_FG_ZBREG_DEST, 1); + ADD_RANGE(R300_SC_HYPERZ, 2); ADD_RANGE(0x43E8, 1); @@ -233,6 +237,7 @@ void r300_init_reg_flags(struct drm_devi ADD_RANGE(R300_ZB_DEPTHPITCH, 1); ADD_RANGE(R300_ZB_DEPTHCLEARVALUE, 1); ADD_RANGE(R300_ZB_ZMASK_OFFSET, 13); + ADD_RANGE(R300_ZB_ZPASS_DATA, 2); /* ZB_ZPASS_DATA, ZB_ZPASS_ADDR */ ADD_RANGE(R300_TX_FILTER_0, 16); ADD_RANGE(R300_TX_FILTER1_0, 16); Modified: stable/7/sys/dev/drm/r300_reg.h ============================================================================== --- stable/7/sys/dev/drm/r300_reg.h Tue Jun 23 16:06:13 2009 (r194732) +++ stable/7/sys/dev/drm/r300_reg.h Tue Jun 23 16:07:56 2009 (r194733) @@ -1776,6 +1776,11 @@ __FBSDID("$FreeBSD$"); #define R500_RB3D_COLOR_CLEAR_VALUE_AR 0x46c0 #define R500_RB3D_CONSTANT_COLOR_AR 0x4ef8 +#define R300_SU_REG_DEST 0x42c8 +#define RV530_FG_ZBREG_DEST 0x4be8 +#define R300_ZB_ZPASS_DATA 0x4f58 +#define R300_ZB_ZPASS_ADDR 0x4f5c + #endif /* _R300_REG_H */ /* *INDENT-ON* */ Modified: stable/7/sys/dev/drm/radeon_cp.c ============================================================================== --- stable/7/sys/dev/drm/radeon_cp.c Tue Jun 23 16:06:13 2009 (r194732) +++ stable/7/sys/dev/drm/radeon_cp.c Tue Jun 23 16:07:56 2009 (r194733) @@ -436,7 +436,7 @@ static void radeon_init_pipes(drm_radeon if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RV515) { RADEON_WRITE_PLL(R500_DYN_SCLK_PWMEM_PIPE, (1 | ((gb_pipe_sel >> 8) & 0xf) << 4)); - RADEON_WRITE(R500_SU_REG_DEST, ((1 << dev_priv->num_gb_pipes) - 1)); + RADEON_WRITE(R300_SU_REG_DEST, ((1 << dev_priv->num_gb_pipes) - 1)); } RADEON_WRITE(R300_GB_TILE_CONFIG, gb_tile_config); radeon_do_wait_for_idle(dev_priv); Modified: stable/7/sys/dev/drm/radeon_drv.h ============================================================================== --- stable/7/sys/dev/drm/radeon_drv.h Tue Jun 23 16:06:13 2009 (r194732) +++ stable/7/sys/dev/drm/radeon_drv.h Tue Jun 23 16:07:56 2009 (r194733) @@ -684,7 +684,6 @@ extern void r600_page_table_cleanup(stru /* pipe config regs */ #define R400_GB_PIPE_SELECT 0x402c #define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */ -#define R500_SU_REG_DEST 0x42c8 #define R300_GB_TILE_CONFIG 0x4018 # define R300_ENABLE_TILING (1 << 0) # define R300_PIPE_COUNT_RV350 (0 << 1) From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 16:09:05 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 658581065670; Tue, 23 Jun 2009 16:09:05 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5313C8FC2E; Tue, 23 Jun 2009 16:09:05 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NG95Et082423; Tue, 23 Jun 2009 16:09:05 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NG95mB082421; Tue, 23 Jun 2009 16:09:05 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231609.n5NG95mB082421@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 16:09:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194734 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 16:09:06 -0000 Author: rnoland Date: Tue Jun 23 16:09:05 2009 New Revision: 194734 URL: http://svn.freebsd.org/changeset/base/194734 Log: Merge 190833 from HEAD check offsets for R300_ZB_ZPASS_ADDR Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/r300_cmdbuf.c Modified: stable/7/sys/dev/drm/r300_cmdbuf.c ============================================================================== --- stable/7/sys/dev/drm/r300_cmdbuf.c Tue Jun 23 16:07:56 2009 (r194733) +++ stable/7/sys/dev/drm/r300_cmdbuf.c Tue Jun 23 16:09:05 2009 (r194734) @@ -236,8 +236,11 @@ void r300_init_reg_flags(struct drm_devi ADD_RANGE_MARK(R300_ZB_DEPTHOFFSET, 1, MARK_CHECK_OFFSET); /* check offset */ ADD_RANGE(R300_ZB_DEPTHPITCH, 1); ADD_RANGE(R300_ZB_DEPTHCLEARVALUE, 1); - ADD_RANGE(R300_ZB_ZMASK_OFFSET, 13); - ADD_RANGE(R300_ZB_ZPASS_DATA, 2); /* ZB_ZPASS_DATA, ZB_ZPASS_ADDR */ + ADD_RANGE(R300_ZB_ZMASK_OFFSET, 5); + ADD_RANGE(R300_ZB_HIZ_OFFSET, 5); + ADD_RANGE(R300_ZB_ZPASS_DATA, 1); + ADD_RANGE_MARK(R300_ZB_ZPASS_ADDR, 1, MARK_CHECK_OFFSET); /* check offset */ + ADD_RANGE(R300_ZB_DEPTHXY_OFFSET, 1) ADD_RANGE(R300_TX_FILTER_0, 16); ADD_RANGE(R300_TX_FILTER1_0, 16); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 16:11:44 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0FE0106566C; Tue, 23 Jun 2009 16:11:44 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE1B38FC12; Tue, 23 Jun 2009 16:11:44 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NGBiJ8082604; Tue, 23 Jun 2009 16:11:44 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NGBiFJ082602; Tue, 23 Jun 2009 16:11:44 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231611.n5NGBiFJ082602@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 16:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194735 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 16:11:45 -0000 Author: rnoland Date: Tue Jun 23 16:11:44 2009 New Revision: 194735 URL: http://svn.freebsd.org/changeset/base/194735 Log: Merge 194537 from HEAD Don't panic if drm_rmmap is called with a NULL map pointer. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/drm_bufs.c Modified: stable/7/sys/dev/drm/drm_bufs.c ============================================================================== --- stable/7/sys/dev/drm/drm_bufs.c Tue Jun 23 16:09:05 2009 (r194734) +++ stable/7/sys/dev/drm/drm_bufs.c Tue Jun 23 16:11:44 2009 (r194735) @@ -296,6 +296,9 @@ void drm_rmmap(struct drm_device *dev, d { DRM_SPINLOCK_ASSERT(&dev->dev_lock); + if (map == NULL) + return; + TAILQ_REMOVE(&dev->maplist, map, link); switch (map->type) { From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 16:12:40 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FD9B106566C; Tue, 23 Jun 2009 16:12:40 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72D278FC19; Tue, 23 Jun 2009 16:12:40 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NGCek6082678; Tue, 23 Jun 2009 16:12:40 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NGCeRU082676; Tue, 23 Jun 2009 16:12:40 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231612.n5NGCeRU082676@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 16:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194736 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 16:12:41 -0000 Author: rnoland Date: Tue Jun 23 16:12:40 2009 New Revision: 194736 URL: http://svn.freebsd.org/changeset/base/194736 Log: Merge 194539 from HEAD realloc() behaves identically to malloc when passed a NULL object pointer If an error does occur we would have left max_context with an incorrect value. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/drm_context.c Modified: stable/7/sys/dev/drm/drm_context.c ============================================================================== --- stable/7/sys/dev/drm/drm_context.c Tue Jun 23 16:11:44 2009 (r194735) +++ stable/7/sys/dev/drm/drm_context.c Tue Jun 23 16:12:40 2009 (r194736) @@ -72,34 +72,23 @@ int drm_ctxbitmap_next(struct drm_device } set_bit(bit, dev->ctx_bitmap); - DRM_DEBUG("drm_ctxbitmap_next bit : %d\n", bit); + DRM_DEBUG("bit : %d\n", bit); if ((bit+1) > dev->max_context) { - dev->max_context = (bit+1); - if (dev->context_sareas != NULL) { - drm_local_map_t **ctx_sareas; - - ctx_sareas = realloc(dev->context_sareas, - dev->max_context * sizeof(*dev->context_sareas), - DRM_MEM_SAREA, M_NOWAIT); - if (ctx_sareas == NULL) { - clear_bit(bit, dev->ctx_bitmap); - DRM_UNLOCK(); - return -1; - } - dev->context_sareas = ctx_sareas; - dev->context_sareas[bit] = NULL; - } else { - /* max_context == 1 at this point */ - dev->context_sareas = malloc(dev->max_context * - sizeof(*dev->context_sareas), DRM_MEM_SAREA, - M_NOWAIT); - if (dev->context_sareas == NULL) { - clear_bit(bit, dev->ctx_bitmap); - DRM_UNLOCK(); - return -1; - } - dev->context_sareas[bit] = NULL; + drm_local_map_t **ctx_sareas; + int max_ctx = (bit+1); + + ctx_sareas = realloc(dev->context_sareas, + max_ctx * sizeof(*dev->context_sareas), + DRM_MEM_SAREA, M_NOWAIT); + if (ctx_sareas == NULL) { + clear_bit(bit, dev->ctx_bitmap); + DRM_DEBUG("failed to allocate bit : %d\n", bit); + DRM_UNLOCK(); + return -1; } + dev->max_context = max_ctx; + dev->context_sareas = ctx_sareas; + dev->context_sareas[bit] = NULL; } DRM_UNLOCK(); return bit; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 16:14:09 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16BD7106566C; Tue, 23 Jun 2009 16:14:09 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF8558FC1C; Tue, 23 Jun 2009 16:14:08 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NGE8uO082762; Tue, 23 Jun 2009 16:14:08 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NGE87E082757; Tue, 23 Jun 2009 16:14:08 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200906231614.n5NGE87E082757@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Jun 2009 16:14: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: r194737 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 16:14:09 -0000 Author: rnoland Date: Tue Jun 23 16:14:08 2009 New Revision: 194737 URL: http://svn.freebsd.org/changeset/base/194737 Log: Merge 194540 from HEAD The G45 docs indicate that all G4X chips use the new framecount register. Intel agrees with my reading of the docs, make it so for all G4X chips. The new register also has a 32 bit width as opposed to 24 bits. Fix things up so that the counters roll over properly. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/i915_dma.c stable/7/sys/dev/drm/i915_drv.h stable/7/sys/dev/drm/i915_irq.c Modified: stable/7/sys/dev/drm/i915_dma.c ============================================================================== --- stable/7/sys/dev/drm/i915_dma.c Tue Jun 23 16:12:40 2009 (r194736) +++ stable/7/sys/dev/drm/i915_dma.c Tue Jun 23 16:14:08 2009 (r194737) @@ -871,10 +871,13 @@ int i915_driver_load(struct drm_device * ret = drm_addmap(dev, base, size, _DRM_REGISTERS, _DRM_KERNEL | _DRM_DRIVER, &dev_priv->mmio_map); - if (IS_GM45(dev)) - dev->driver->get_vblank_counter = gm45_get_vblank_counter; - else + if (IS_G4X(dev)) { + dev->driver->get_vblank_counter = g45_get_vblank_counter; + dev->max_vblank_count = 0xffffffff; /* 32 bits of frame count */ + } else { dev->driver->get_vblank_counter = i915_get_vblank_counter; + dev->max_vblank_count = 0x00ffffff; /* 24 bits of frame count */ + } #ifdef I915_HAVE_GEM i915_gem_load(dev); Modified: stable/7/sys/dev/drm/i915_drv.h ============================================================================== --- stable/7/sys/dev/drm/i915_drv.h Tue Jun 23 16:12:40 2009 (r194736) +++ stable/7/sys/dev/drm/i915_drv.h Tue Jun 23 16:14:08 2009 (r194737) @@ -453,7 +453,7 @@ extern int i915_vblank_pipe_get(struct d extern int i915_enable_vblank(struct drm_device *dev, int crtc); extern void i915_disable_vblank(struct drm_device *dev, int crtc); extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc); -extern u32 gm45_get_vblank_counter(struct drm_device *dev, int crtc); +extern u32 g45_get_vblank_counter(struct drm_device *dev, int crtc); extern int i915_vblank_swap(struct drm_device *dev, void *data, struct drm_file *file_priv); Modified: stable/7/sys/dev/drm/i915_irq.c ============================================================================== --- stable/7/sys/dev/drm/i915_irq.c Tue Jun 23 16:12:40 2009 (r194736) +++ stable/7/sys/dev/drm/i915_irq.c Tue Jun 23 16:14:08 2009 (r194737) @@ -177,7 +177,7 @@ u32 i915_get_vblank_counter(struct drm_d return count; } -u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) +u32 g45_get_vblank_counter(struct drm_device *dev, int pipe) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int reg = pipe ? PIPEB_FRMCOUNT_GM45 : PIPEA_FRMCOUNT_GM45; @@ -516,8 +516,6 @@ int i915_driver_irq_postinstall(struct d dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B; - dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ - /* Unmask the interrupts that we always want on. */ dev_priv->irq_mask_reg = ~I915_INTERRUPT_ENABLE_FIX; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 22:09:54 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B204106564A; Tue, 23 Jun 2009 22:09:54 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECC938FC18; Tue, 23 Jun 2009 22:09:53 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NM9rMV091933; Tue, 23 Jun 2009 22:09:53 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NM9rpQ091931; Tue, 23 Jun 2009 22:09:53 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906232209.n5NM9rpQ091931@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 23 Jun 2009 22:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194778 - stable/7/tools/tools/nanobsd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 22:09:54 -0000 Author: edwin Date: Tue Jun 23 22:09:53 2009 New Revision: 194778 URL: http://svn.freebsd.org/changeset/base/194778 Log: MFC of 194285 Add support for 256MB Hitachi CF card and 256MB Silicon Systems CF card This patch against RELENG_6 adds two more entries to src/tools/tools/nanobsd/FlashDevice.sub - one for a 256MB Hitachi CF card and one for a 256MB Silicon Systems CF card. Both entries have been verified to work with a Soekris net4801. PR: kern/101228 Submitted by: Henrik Brix Andersen Modified: stable/7/tools/tools/nanobsd/FlashDevice.sub (contents, props changed) Modified: stable/7/tools/tools/nanobsd/FlashDevice.sub ============================================================================== --- stable/7/tools/tools/nanobsd/FlashDevice.sub Tue Jun 23 22:08:55 2009 (r194777) +++ stable/7/tools/tools/nanobsd/FlashDevice.sub Tue Jun 23 22:09:53 2009 (r194778) @@ -41,6 +41,19 @@ sub_FlashDevice () { a1=`echo $1 | tr '[:upper:]' '[:lower:]'` a2=`echo $2 | tr '[:upper:]' '[:lower:]'` case $a1 in + hitachi) + case $a2 in + 256|256mb) + NANO_MEDIASIZE=`expr 256204800 / 512` + NANO_HEADS=15 + NANO_SECTS=48 + ;; + *) + echo "Unknown Hitachi Flash capacity" + exit 2 + ;; + esac + ;; integral) # Source: mich@FreeBSD.org case $a2 in @@ -129,6 +142,11 @@ sub_FlashDevice () { ;; siliconsystems) case $a2 in + 256|256mb) + NANO_MEDIASIZE=`expr 260571136 / 512` + NANO_HEADS=16 + NANO_SECTS=32 + ;; 4096|4g) NANO_MEDIASIZE=`expr -e 4224761856 / 512` NANO_HEADS=16 From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 22:16:07 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A960106566C; Tue, 23 Jun 2009 22:16:07 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 485068FC14; Tue, 23 Jun 2009 22:16:07 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NMG7rM092258; Tue, 23 Jun 2009 22:16:07 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NMG7lL092256; Tue, 23 Jun 2009 22:16:07 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906232216.n5NMG7lL092256@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 23 Jun 2009 22:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194780 - stable/7/tools/tools/nanobsd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 22:16:07 -0000 Author: edwin Date: Tue Jun 23 22:16:07 2009 New Revision: 194780 URL: http://svn.freebsd.org/changeset/base/194780 Log: MFC of r194286 r194310 r194332 Support for 64 Mb Kodak flash device. PR: misc/115025 Submitted by: Michael W Lucas Modified: stable/7/tools/tools/nanobsd/FlashDevice.sub (contents, props changed) Modified: stable/7/tools/tools/nanobsd/FlashDevice.sub ============================================================================== --- stable/7/tools/tools/nanobsd/FlashDevice.sub Tue Jun 23 22:12:37 2009 (r194779) +++ stable/7/tools/tools/nanobsd/FlashDevice.sub Tue Jun 23 22:16:07 2009 (r194780) @@ -68,6 +68,20 @@ sub_FlashDevice () { ;; esac ;; + kodak) + # Source: mwlucas@FreeBSD.org + case $a2 in + 64|64mb) + NANO_MEDIASIZE=`expr 64487424 / 512` + NANO_HEADS=4 + NANO_SECTS=32 + ;; + *) + echo "Unknown Kodak Flash capacity" + exit 2 + ;; + esac + ;; memorycorp) # Source: simon@FreeBSD.org case $a2 in From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 23 22:22:20 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91B081065670; Tue, 23 Jun 2009 22:22:20 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F2258FC17; Tue, 23 Jun 2009 22:22:20 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NMMKKh092574; Tue, 23 Jun 2009 22:22:20 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5NMMKCX092572; Tue, 23 Jun 2009 22:22:20 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906232222.n5NMMKCX092572@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 23 Jun 2009 22:22:20 +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: r194782 - stable/7/tools/tools/nanobsd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 22:22:21 -0000 Author: edwin Date: Tue Jun 23 22:22:20 2009 New Revision: 194782 URL: http://svn.freebsd.org/changeset/base/194782 Log: Fix NanoBSD when the data partition size is defined as a negative number. It is possible to ask nanobsd.sh to create a 'data' partition, separate from the system or configuration partitions, and furthermore, by specifying a negative value for its size to request that it use all space unused by those partitions for its own size. Because the two lines of code that calculate how much space is available for this data partition are written in perl-like syntax, the awk code that does the processing performs the calculation incorrectly. [note - this was already fixed by r174936] Furthermore, a comparison later down fails to newfs the partition when the size is negative. PR: misc/127759 Submitted by: Cyrus Rahman Modified: stable/7/tools/tools/nanobsd/nanobsd.sh (contents, props changed) Modified: stable/7/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- stable/7/tools/tools/nanobsd/nanobsd.sh Tue Jun 23 22:19:27 2009 (r194781) +++ stable/7/tools/tools/nanobsd/nanobsd.sh Tue Jun 23 22:22:20 2009 (r194782) @@ -474,7 +474,7 @@ create_i386_diskimage ( ) ( # XXX: fill from where ? # Create Data slice, if any. - if [ $NANO_DATASIZE -gt 0 ] ; then + if [ $NANO_DATASIZE -ne 0 ] ; then newfs ${NANO_NEWFS} /dev/${MD}s4 # XXX: fill from where ? fi From owner-svn-src-stable-7@FreeBSD.ORG Wed Jun 24 09:42:19 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 165811065701; Wed, 24 Jun 2009 09:42:19 +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 010C98FC2B; Wed, 24 Jun 2009 09:42:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5O9gIbv007971; Wed, 24 Jun 2009 09:42:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5O9gIQx007967; Wed, 24 Jun 2009 09:42:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906240942.n5O9gIQx007967@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 24 Jun 2009 09:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194815 - in stable/7/sys: . contrib/pf fs/cd9660 fs/devfs fs/pseudofs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 09:42:20 -0000 Author: kib Date: Wed Jun 24 09:42:18 2009 New Revision: 194815 URL: http://svn.freebsd.org/changeset/base/194815 Log: MFC r193919: Lock the vnode in cd9660, devfs and pseudofs implementation of VOP_IOCTL to prevent reclaim, since the vnode is passed unlocked to the VOP. MFC r193930: For cd9660_ioctl, check for recycled vnode after locking it. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/fs/cd9660/cd9660_vnops.c stable/7/sys/fs/devfs/devfs_vnops.c stable/7/sys/fs/pseudofs/pseudofs_vnops.c Modified: stable/7/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- stable/7/sys/fs/cd9660/cd9660_vnops.c Wed Jun 24 09:26:33 2009 (r194814) +++ stable/7/sys/fs/cd9660/cd9660_vnops.c Wed Jun 24 09:42:18 2009 (r194815) @@ -253,20 +253,35 @@ cd9660_ioctl(ap) struct thread *a_td; } */ *ap; { - struct vnode *vp = ap->a_vp; - struct iso_node *ip = VTOI(vp); + struct vnode *vp; + struct iso_node *ip; + int error; - if (vp->v_type == VCHR || vp->v_type == VBLK) + vp = ap->a_vp; + vn_lock(vp, LK_SHARED | LK_RETRY, ap->a_td); + if (vp->v_iflag & VI_DOOMED) { + VOP_UNLOCK(vp, 0, ap->a_td); + return (EBADF); + } + if (vp->v_type == VCHR || vp->v_type == VBLK) { + VOP_UNLOCK(vp, 0, ap->a_td); return (EOPNOTSUPP); + } - switch (ap->a_command) { + ip = VTOI(vp); + error = 0; + switch (ap->a_command) { case FIOGETLBA: *(int *)(ap->a_data) = ip->iso_start; - return 0; + break; default: - return (ENOTTY); + error = ENOTTY; + break; } + + VOP_UNLOCK(vp, 0, ap->a_td); + return (error); } /* Modified: stable/7/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/7/sys/fs/devfs/devfs_vnops.c Wed Jun 24 09:26:33 2009 (r194814) +++ stable/7/sys/fs/devfs/devfs_vnops.c Wed Jun 24 09:42:18 2009 (r194815) @@ -1240,11 +1240,19 @@ devfs_revoke(struct vop_revoke_args *ap) static int devfs_rioctl(struct vop_ioctl_args *ap) { - int error; + struct vnode *vp; struct devfs_mount *dmp; + int error; - dmp = VFSTODEVFS(ap->a_vp->v_mount); + vp = ap->a_vp; + vn_lock(vp, LK_SHARED | LK_RETRY, ap->a_td); + if (vp->v_iflag & VI_DOOMED) { + VOP_UNLOCK(vp, 0, ap->a_td); + return (EBADF); + } + dmp = VFSTODEVFS(vp->v_mount); sx_xlock(&dmp->dm_lock); + VOP_UNLOCK(vp, 0, ap->a_td); DEVFS_DMP_HOLD(dmp); devfs_populate(dmp); if (DEVFS_DMP_DROP(dmp)) { Modified: stable/7/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/7/sys/fs/pseudofs/pseudofs_vnops.c Wed Jun 24 09:26:33 2009 (r194814) +++ stable/7/sys/fs/pseudofs/pseudofs_vnops.c Wed Jun 24 09:42:18 2009 (r194815) @@ -260,34 +260,50 @@ pfs_getattr(struct vop_getattr_args *va) static int pfs_ioctl(struct vop_ioctl_args *va) { - struct vnode *vn = va->a_vp; - struct pfs_vdata *pvd = vn->v_data; - struct pfs_node *pn = pvd->pvd_pn; + struct vnode *vn; + struct pfs_vdata *pvd; + struct pfs_node *pn; struct proc *proc; int error; + vn = va->a_vp; + vn_lock(vn, LK_SHARED | LK_RETRY, va->a_td); + if (vn->v_iflag & VI_DOOMED) { + VOP_UNLOCK(vn, 0, va->a_td); + return (EBADF); + } + pvd = vn->v_data; + pn = pvd->pvd_pn; + PFS_TRACE(("%s: %lx", pn->pn_name, va->a_command)); pfs_assert_not_owned(pn); - if (vn->v_type != VREG) + if (vn->v_type != VREG) { + VOP_UNLOCK(vn, 0, va->a_td); PFS_RETURN (EINVAL); + } KASSERT_PN_IS_FILE(pn); - if (pn->pn_ioctl == NULL) + if (pn->pn_ioctl == NULL) { + VOP_UNLOCK(vn, 0, va->a_td); PFS_RETURN (ENOTTY); + } /* * This is necessary because process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) { + VOP_UNLOCK(vn, 0, va->a_td); PFS_RETURN (EIO); + } error = pn_ioctl(curthread, proc, pn, va->a_command, va->a_data); if (proc != NULL) PROC_UNLOCK(proc); + VOP_UNLOCK(vn, 0, va->a_td); PFS_RETURN (error); } From owner-svn-src-stable-7@FreeBSD.ORG Wed Jun 24 09:45:11 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25B6C1065674; Wed, 24 Jun 2009 09:45: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 12EBE8FC1C; Wed, 24 Jun 2009 09:45:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5O9jA9Z008098; Wed, 24 Jun 2009 09:45:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5O9jA6f008096; Wed, 24 Jun 2009 09:45:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906240945.n5O9jA6f008096@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 24 Jun 2009 09:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194816 - in stable/7/sys: . contrib/pf fs/fifofs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 09:45:12 -0000 Author: kib Date: Wed Jun 24 09:45:10 2009 New Revision: 194816 URL: http://svn.freebsd.org/changeset/base/194816 Log: MFC r193922: Remove unused VOP_IOCTL and VOP_KQFILTER implementations for fifofs. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/fs/fifofs/fifo_vnops.c Modified: stable/7/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- stable/7/sys/fs/fifofs/fifo_vnops.c Wed Jun 24 09:42:18 2009 (r194815) +++ stable/7/sys/fs/fifofs/fifo_vnops.c Wed Jun 24 09:45:10 2009 (r194816) @@ -87,8 +87,6 @@ struct fifoinfo { static vop_print_t fifo_print; static vop_open_t fifo_open; static vop_close_t fifo_close; -static vop_ioctl_t fifo_ioctl; -static vop_kqfilter_t fifo_kqfilter; static vop_pathconf_t fifo_pathconf; static vop_advlock_t fifo_advlock; @@ -114,8 +112,8 @@ struct vop_vector fifo_specops = { .vop_close = fifo_close, .vop_create = VOP_PANIC, .vop_getattr = VOP_EBADF, - .vop_ioctl = fifo_ioctl, - .vop_kqfilter = fifo_kqfilter, + .vop_ioctl = VOP_PANIC, + .vop_kqfilter = VOP_PANIC, .vop_lease = VOP_NULL, .vop_link = VOP_PANIC, .vop_mkdir = VOP_PANIC, @@ -302,42 +300,6 @@ fail1: return (0); } -/* - * Now unused vnode ioctl routine. - */ -/* ARGSUSED */ -static int -fifo_ioctl(ap) - struct vop_ioctl_args /* { - struct vnode *a_vp; - u_long a_command; - caddr_t a_data; - int a_fflag; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; -{ - - printf("WARNING: fifo_ioctl called unexpectedly\n"); - return (ENOTTY); -} - -/* - * Now unused vnode kqfilter routine. - */ -/* ARGSUSED */ -static int -fifo_kqfilter(ap) - struct vop_kqfilter_args /* { - struct vnode *a_vp; - struct knote *a_kn; - } */ *ap; -{ - - printf("WARNING: fifo_kqfilter called unexpectedly\n"); - return (EINVAL); -} - static void filt_fifordetach(struct knote *kn) { From owner-svn-src-stable-7@FreeBSD.ORG Wed Jun 24 09:54:06 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 549B1106566C; Wed, 24 Jun 2009 09:54:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 267D28FC12; Wed, 24 Jun 2009 09:54:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5O9s6eD008328; Wed, 24 Jun 2009 09:54:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5O9s5u3008322; Wed, 24 Jun 2009 09:54:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906240954.n5O9s5u3008322@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 24 Jun 2009 09:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194817 - in stable/7/sys: . contrib/pf fs/cd9660 fs/fifofs fs/msdosfs gnu/fs/xfs/FreeBSD kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 09:54:07 -0000 Author: kib Date: Wed Jun 24 09:54:05 2009 New Revision: 194817 URL: http://svn.freebsd.org/changeset/base/194817 Log: MFC r193923: s/a_fdidx/a_fp/ for VOP_OPEN comments that inline struct vop_open_args definition. MFC r193924: Fix r193923 by noting that type of a_fp is struct file *, not int. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/fs/cd9660/cd9660_vnops.c stable/7/sys/fs/fifofs/fifo_vnops.c stable/7/sys/fs/msdosfs/msdosfs_vnops.c stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c stable/7/sys/kern/uipc_mqueue.c Modified: stable/7/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- stable/7/sys/fs/cd9660/cd9660_vnops.c Wed Jun 24 09:45:10 2009 (r194816) +++ stable/7/sys/fs/cd9660/cd9660_vnops.c Wed Jun 24 09:54:05 2009 (r194817) @@ -166,7 +166,7 @@ cd9660_open(ap) int a_mode; struct ucred *a_cred; struct thread *a_td; - int a_fdidx; + struct file *a_fp; } */ *ap; { struct vnode *vp = ap->a_vp; Modified: stable/7/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- stable/7/sys/fs/fifofs/fifo_vnops.c Wed Jun 24 09:45:10 2009 (r194816) +++ stable/7/sys/fs/fifofs/fifo_vnops.c Wed Jun 24 09:54:05 2009 (r194817) @@ -166,7 +166,7 @@ fifo_open(ap) int a_mode; struct ucred *a_cred; struct thread *a_td; - int a_fdidx; + struct file *a_fp; } */ *ap; { struct vnode *vp = ap->a_vp; Modified: stable/7/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/7/sys/fs/msdosfs/msdosfs_vnops.c Wed Jun 24 09:45:10 2009 (r194816) +++ stable/7/sys/fs/msdosfs/msdosfs_vnops.c Wed Jun 24 09:54:05 2009 (r194817) @@ -215,7 +215,7 @@ msdosfs_open(ap) int a_mode; struct ucred *a_cred; struct thread *a_td; - int a_fdidx; + struct file *a_fp; } */ *ap; { struct denode *dep = VTODE(ap->a_vp); Modified: stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c ============================================================================== --- stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Wed Jun 24 09:45:10 2009 (r194816) +++ stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Wed Jun 24 09:54:05 2009 (r194817) @@ -198,7 +198,7 @@ _xfs_open( int a_mode; struct ucred *a_cred; struct thread *a_td; - int a_fdidx; + struct file *a_fp; } */ *ap) { int error; Modified: stable/7/sys/kern/uipc_mqueue.c ============================================================================== --- stable/7/sys/kern/uipc_mqueue.c Wed Jun 24 09:45:10 2009 (r194816) +++ stable/7/sys/kern/uipc_mqueue.c Wed Jun 24 09:54:05 2009 (r194817) @@ -1058,7 +1058,7 @@ struct vop_open_args { int a_mode; struct ucred *a_cred; struct thread *a_td; - int a_fdidx; + struct file *a_fp; }; #endif From owner-svn-src-stable-7@FreeBSD.ORG Wed Jun 24 13:38:09 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 691D51065678; Wed, 24 Jun 2009 13:38:09 +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 1858A8FC17; Wed, 24 Jun 2009 13:38:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ODc8ae015829; Wed, 24 Jun 2009 13:38:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ODc8R6015827; Wed, 24 Jun 2009 13:38:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906241338.n5ODc8R6015827@svn.freebsd.org> From: John Baldwin Date: Wed, 24 Jun 2009 13:38: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: r194834 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 13:38:10 -0000 Author: jhb Date: Wed Jun 24 13:38:08 2009 New Revision: 194834 URL: http://svn.freebsd.org/changeset/base/194834 Log: Defer the wakeup of the swapper process to the callers of tdsigwakeup() to avoid a deadlock since the thread lock isn't released until after tdsigwakeup() has returned. This is a direct commit instead of an MFC as this issue was fixed in HEAD by a much larger set of changes that are not suitable for MFC. Modified: stable/7/sys/kern/kern_sig.c Modified: stable/7/sys/kern/kern_sig.c ============================================================================== --- stable/7/sys/kern/kern_sig.c Wed Jun 24 13:36:37 2009 (r194833) +++ stable/7/sys/kern/kern_sig.c Wed Jun 24 13:38:08 2009 (r194834) @@ -88,7 +88,7 @@ static char *expand_name(const char *, u static int killpg1(struct thread *td, int sig, int pgid, int all); static int issignal(struct thread *p); static int sigprop(int sig); -static void tdsigwakeup(struct thread *, int, sig_t, int); +static int tdsigwakeup(struct thread *, int, sig_t, int); static void sig_suspend_threads(struct thread *, struct proc *, int); static int filt_sigattach(struct knote *kn); static void filt_sigdetach(struct knote *kn); @@ -2289,9 +2289,11 @@ do_tdsignal(struct proc *p, struct threa } else if (p->p_state == PRS_NORMAL) { if (p->p_flag & P_TRACED || action == SIG_CATCH) { thread_lock(td); - tdsigwakeup(td, sig, action, intrval); + wakeup_swapper = tdsigwakeup(td, sig, action, intrval); thread_unlock(td); PROC_SUNLOCK(p); + if (wakeup_swapper) + kick_proc0(); goto out; } @@ -2337,10 +2339,12 @@ do_tdsignal(struct proc *p, struct threa runfast: thread_lock(td); - tdsigwakeup(td, sig, action, intrval); + wakeup_swapper = tdsigwakeup(td, sig, action, intrval); thread_unlock(td); thread_unsuspend(p); PROC_SUNLOCK(p); + if (wakeup_swapper) + kick_proc0(); out: /* If we jump here, proc slock should not be owned. */ PROC_SLOCK_ASSERT(p, MA_NOTOWNED); @@ -2352,7 +2356,7 @@ out: * thread. We need to see what we can do about knocking it * out of any sleep it may be in etc. */ -static void +static int tdsigwakeup(struct thread *td, int sig, sig_t action, int intrval) { struct proc *p = td->td_proc; @@ -2380,7 +2384,7 @@ tdsigwakeup(struct thread *td, int sig, * trap() or syscall(). */ if ((td->td_flags & TDF_SINTR) == 0) - return; + return (0); /* * If SIGCONT is default (or ignored) and process is * asleep, we are finished; the process should not @@ -2397,7 +2401,7 @@ tdsigwakeup(struct thread *td, int sig, sigqueue_delete(&td->td_sigqueue, sig); PROC_SLOCK(p); thread_lock(td); - return; + return (0); } /* @@ -2418,8 +2422,7 @@ tdsigwakeup(struct thread *td, int sig, forward_signal(td); #endif } - if (wakeup_swapper) - kick_proc0(); + return (wakeup_swapper); } static void From owner-svn-src-stable-7@FreeBSD.ORG Wed Jun 24 20:22:47 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86A6E10656A5; Wed, 24 Jun 2009 20:22:47 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73B268FC13; Wed, 24 Jun 2009 20:22:47 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5OKMlSB027499; Wed, 24 Jun 2009 20:22:47 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5OKMlSK027497; Wed, 24 Jun 2009 20:22:47 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <200906242022.n5OKMlSK027497@svn.freebsd.org> From: Joerg Wunsch Date: Wed, 24 Jun 2009 20:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194896 - in stable/7/sys: . dev/fdc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 20:22:48 -0000 Author: joerg Date: Wed Jun 24 20:22:46 2009 New Revision: 194896 URL: http://svn.freebsd.org/changeset/base/194896 Log: Do not insist on the fd being read/write for the FD_SOPTS and FD_STYPE ioctls, so they can be applied to read/only media. Modified: stable/7/sys/ (props changed) stable/7/sys/dev/fdc/fdc.c Modified: stable/7/sys/dev/fdc/fdc.c ============================================================================== --- stable/7/sys/dev/fdc/fdc.c Wed Jun 24 20:06:16 2009 (r194895) +++ stable/7/sys/dev/fdc/fdc.c Wed Jun 24 20:22:46 2009 (r194896) @@ -1498,8 +1498,6 @@ fd_ioctl(struct g_provider *pp, u_long c return (0); case FD_STYPE: /* set drive type */ - if (!(fflag & FWRITE)) - return (EPERM); /* * Allow setting drive type temporarily iff * currently unset. Used for fdformat so any @@ -1521,8 +1519,6 @@ fd_ioctl(struct g_provider *pp, u_long c return (0); case FD_SOPTS: /* set drive options */ - if (!(fflag & FWRITE)) - return (EPERM); fd->options = *(int *)data; return (0); From owner-svn-src-stable-7@FreeBSD.ORG Wed Jun 24 20:40:11 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 175021065705; Wed, 24 Jun 2009 20:40:11 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0313B8FC15; Wed, 24 Jun 2009 20:40:11 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5OKeAU8028322; Wed, 24 Jun 2009 20:40:10 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5OKeAAF028317; Wed, 24 Jun 2009 20:40:10 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <200906242040.n5OKeAAF028317@svn.freebsd.org> From: Joerg Wunsch Date: Wed, 24 Jun 2009 20:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194899 - in stable/7/usr.sbin: fdcontrol fdformat fdread fdwrite X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 20:40:12 -0000 Author: joerg Date: Wed Jun 24 20:40:10 2009 New Revision: 194899 URL: http://svn.freebsd.org/changeset/base/194899 Log: Remove the defunct FDOPT_NOERRLOG; floppy media errors are no longer logged by the kernel anyway. In fdcontrol, open the file descriptor read-only, so the format for read-only media can be set. Modified: stable/7/usr.sbin/fdcontrol/ (props changed) stable/7/usr.sbin/fdcontrol/fdcontrol.c stable/7/usr.sbin/fdformat/ (props changed) stable/7/usr.sbin/fdformat/fdformat.c stable/7/usr.sbin/fdread/ (props changed) stable/7/usr.sbin/fdread/fdread.c stable/7/usr.sbin/fdwrite/ (props changed) stable/7/usr.sbin/fdwrite/fdwrite.c Modified: stable/7/usr.sbin/fdcontrol/fdcontrol.c ============================================================================== --- stable/7/usr.sbin/fdcontrol/fdcontrol.c Wed Jun 24 20:29:10 2009 (r194898) +++ stable/7/usr.sbin/fdcontrol/fdcontrol.c Wed Jun 24 20:40:10 2009 (r194899) @@ -72,7 +72,7 @@ main(int argc, char **argv) enum fd_drivetype type; struct fd_type ft, newft, *fdtp; const char *name, *descr; - int fd, i, mode, autofmt; + int fd, i, autofmt; autofmt = 0; while((i = getopt(argc, argv, "aFf:s:v")) != -1) @@ -116,12 +116,7 @@ main(int argc, char **argv) if(argc != 1) usage(); - if (show || showfmt) - mode = O_RDONLY | O_NONBLOCK; - else - mode = O_RDWR; - - if((fd = open(argv[0], mode)) < 0) + if((fd = open(argv[0], O_RDONLY | O_NONBLOCK)) < 0) err(EX_UNAVAILABLE, "open(%s)", argv[0]); if (ioctl(fd, FD_GDTYPE, &type) == -1) Modified: stable/7/usr.sbin/fdformat/fdformat.c ============================================================================== --- stable/7/usr.sbin/fdformat/fdformat.c Wed Jun 24 20:29:10 2009 (r194898) +++ stable/7/usr.sbin/fdformat/fdformat.c Wed Jun 24 20:40:10 2009 (r194899) @@ -146,7 +146,7 @@ main(int argc, char **argv) struct fdc_status fdcs[MAXPRINTERRS]; int format, fill, quiet, verify, verify_only, confirm; int fd, c, i, track, error, tracks_per_dot, bytes_per_track, errs; - int fdopts, flags; + int flags; char *fmtstring, *device; const char *name, *descr; @@ -250,11 +250,6 @@ main(int argc, char **argv) errx(EX_OSERR, "not a floppy disk: %s", device); if (ioctl(fd, FD_GDTYPE, &type) == -1) err(EX_OSERR, "ioctl(FD_GDTYPE)"); - if (ioctl(fd, FD_GOPTS, &fdopts) == -1) - err(EX_OSERR, "ioctl(FD_GOPTS)"); - fdopts |= FDOPT_NOERRLOG; - if (ioctl(fd, FD_SOPTS, &fdopts) == -1) - err(EX_OSERR, "ioctl(FD_SOPTS, FDOPT_NOERRLOG)"); if (format) { getname(type, &name, &descr); fdtp = get_fmt(format, type); Modified: stable/7/usr.sbin/fdread/fdread.c ============================================================================== --- stable/7/usr.sbin/fdread/fdread.c Wed Jun 24 20:29:10 2009 (r194898) +++ stable/7/usr.sbin/fdread/fdread.c Wed Jun 24 20:40:10 2009 (r194899) @@ -166,9 +166,6 @@ doread(int fd, FILE *of, const char *_de if (ioctl(fd, FD_GTYPE, &fdt) == -1) err(EX_OSERR, "ioctl(FD_GTYPE) failed -- not a floppy?"); - fdopts = FDOPT_NOERRLOG; - if (ioctl(fd, FD_SOPTS, &fdopts) == -1) - err(EX_OSERR, "ioctl(FD_SOPTS, FDOPT_NOERRLOG)"); secsize = 128 << fdt.secsize; tracksize = fdt.sectrac * secsize; @@ -300,7 +297,7 @@ doread(int fd, FILE *of, const char *_de int doreadid(int fd, unsigned int numids, unsigned int trackno) { - int rv = 0, fdopts; + int rv = 0; unsigned int i; struct fdc_readid info; struct fdc_status fdcs; @@ -309,10 +306,6 @@ doreadid(int fd, unsigned int numids, un if (ioctl(fd, FD_GTYPE, &fdt) == -1) err(EX_OSERR, "ioctl(FD_GTYPE) failed -- not a floppy?"); - fdopts = FDOPT_NOERRLOG; - if (ioctl(fd, FD_SOPTS, &fdopts) == -1) - err(EX_OSERR, "ioctl(FD_SOPTS, FDOPT_NOERRLOG)"); - for (i = 0; i < numids; i++) { info.cyl = trackno / fdt.heads; info.head = fdt.heads > 1? trackno % fdt.heads: 0; Modified: stable/7/usr.sbin/fdwrite/fdwrite.c ============================================================================== --- stable/7/usr.sbin/fdwrite/fdwrite.c Wed Jun 24 20:29:10 2009 (r194898) +++ stable/7/usr.sbin/fdwrite/fdwrite.c Wed Jun 24 20:40:10 2009 (r194899) @@ -66,7 +66,7 @@ main(int argc, char **argv) { int inputfd = -1, c, fdn = 0, i,j,fd; int bpt, verbose=1, nbytes=0, track; - int interactive = 1, fdopts; + int interactive = 1; const char *device= "/dev/fd0"; char *trackbuf = 0,*vrfybuf = 0; struct fd_type fdt; @@ -130,9 +130,6 @@ main(int argc, char **argv) if(ioctl(fd, FD_GTYPE, &fdt) < 0) errx(1, "not a floppy disk: %s", device); - fdopts = FDOPT_NOERRLOG; - if (ioctl(fd, FD_SOPTS, &fdopts) == -1) - err(1, "ioctl(FD_SOPTS, FDOPT_NOERRLOG)"); bpt = fdt.sectrac * (1< Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4C9E106564A; Thu, 25 Jun 2009 09:07:40 +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 C26518FC16; Thu, 25 Jun 2009 09:07:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5P97eFd045696; Thu, 25 Jun 2009 09:07:40 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5P97eAp045694; Thu, 25 Jun 2009 09:07:40 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906250907.n5P97eAp045694@svn.freebsd.org> From: Andriy Gapon Date: Thu, 25 Jun 2009 09:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194945 - stable/7/usr.sbin/syslogd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 09:07:41 -0000 Author: avg Date: Thu Jun 25 09:07:40 2009 New Revision: 194945 URL: http://svn.freebsd.org/changeset/base/194945 Log: MFC r194037: syslog.conf(5): correct example Modified: stable/7/usr.sbin/syslogd/ (props changed) stable/7/usr.sbin/syslogd/syslog.conf.5 Modified: stable/7/usr.sbin/syslogd/syslog.conf.5 ============================================================================== --- stable/7/usr.sbin/syslogd/syslog.conf.5 Thu Jun 25 08:52:20 2009 (r194944) +++ stable/7/usr.sbin/syslogd/syslog.conf.5 Thu Jun 25 09:07:40 2009 (r194945) @@ -476,16 +476,16 @@ uucp,news.crit /var/log/spoolerr # Pipe all authentication messages to a filter. auth.* |exec /usr/local/sbin/authfilter -# Save ftpd transactions along with mail and news -!ftpd -*.* /var/log/spoolerr - # Log all security messages to a separate file. security.* /var/log/security # Log all writes to /dev/console to a separate file. console.* /var/log/console.log +# Save ftpd transactions along with mail and news +!ftpd +*.* /var/log/spoolerr + # Log ipfw messages without syncing after every message. !ipfw *.* -/var/log/ipfw From owner-svn-src-stable-7@FreeBSD.ORG Thu Jun 25 09:17:52 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79E2F106564A; Thu, 25 Jun 2009 09:17:52 +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 4CF2A8FC15; Thu, 25 Jun 2009 09:17:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5P9Horq046014; Thu, 25 Jun 2009 09:17:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5P9Hog8046012; Thu, 25 Jun 2009 09:17:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906250917.n5P9Hog8046012@svn.freebsd.org> From: Andriy Gapon Date: Thu, 25 Jun 2009 09:17:50 +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: r194946 - in stable/7/contrib/gdb: . gdb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 09:17:53 -0000 Author: avg Date: Thu Jun 25 09:17:50 2009 New Revision: 194946 URL: http://svn.freebsd.org/changeset/base/194946 Log: MFC r194061: gdb: make 'thread apply all bt' always work on all threads Modified: stable/7/contrib/gdb/ (props changed) stable/7/contrib/gdb/gdb/stack.c Modified: stable/7/contrib/gdb/gdb/stack.c ============================================================================== --- stable/7/contrib/gdb/gdb/stack.c Thu Jun 25 09:07:40 2009 (r194945) +++ stable/7/contrib/gdb/gdb/stack.c Thu Jun 25 09:17:50 2009 (r194946) @@ -1230,6 +1230,22 @@ backtrace_command_1 (char *count_exp, in printf_filtered ("(More stack frames follow...)\n"); } +struct backtrace_command_args + { + char *count_exp; + int show_locals; + int from_tty; + }; + +/* Stub to call backtrace_command_1 by way of an error catcher. */ +static int +backtrace_command_stub (void *data) +{ + struct backtrace_command_args *args = (struct backtrace_command_args *)data; + backtrace_command_1 (args->count_exp, args->show_locals, args->from_tty); + return 0; +} + static void backtrace_command (char *arg, int from_tty) { @@ -1237,6 +1253,7 @@ backtrace_command (char *arg, int from_t char **argv = (char **) NULL; int argIndicatingFullTrace = (-1), totArgLen = 0, argc = 0; char *argPtr = arg; + struct backtrace_command_args btargs; if (arg != (char *) NULL) { @@ -1286,7 +1303,10 @@ backtrace_command (char *arg, int from_t } } - backtrace_command_1 (argPtr, (argIndicatingFullTrace >= 0), from_tty); + btargs.count_exp = argPtr; + btargs.show_locals = (argIndicatingFullTrace >= 0); + btargs.from_tty = from_tty; + catch_errors (backtrace_command_stub, (char *)&btargs, "", RETURN_MASK_ERROR); if (argIndicatingFullTrace >= 0 && totArgLen > 0) xfree (argPtr); @@ -1299,7 +1319,11 @@ static void backtrace_full_command (char static void backtrace_full_command (char *arg, int from_tty) { - backtrace_command_1 (arg, 1, from_tty); + struct backtrace_command_args btargs; + btargs.count_exp = arg; + btargs.show_locals = 1; + btargs.from_tty = from_tty; + catch_errors (backtrace_command_stub, (char *)&btargs, "", RETURN_MASK_ERROR); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jun 25 09:28:44 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7807E1065678; Thu, 25 Jun 2009 09:28:44 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48F8E8FC15; Thu, 25 Jun 2009 09:28:44 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5P9Si9v046317; Thu, 25 Jun 2009 09:28:44 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5P9SiX8046315; Thu, 25 Jun 2009 09:28:44 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906250928.n5P9SiX8046315@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 25 Jun 2009 09:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194948 - stable/7/release/picobsd/build X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 09:28:45 -0000 Author: luigi Date: Thu Jun 25 09:28:44 2009 New Revision: 194948 URL: http://svn.freebsd.org/changeset/base/194948 Log: MFC: enable creation of ISO images Modified: stable/7/release/picobsd/build/picobsd Modified: stable/7/release/picobsd/build/picobsd ============================================================================== --- stable/7/release/picobsd/build/picobsd Thu Jun 25 09:28:04 2009 (r194947) +++ stable/7/release/picobsd/build/picobsd Thu Jun 25 09:28:44 2009 (r194948) @@ -140,6 +140,7 @@ set_defaults() { # no arguments # mountpoint used to build memory filesystems c_fs=fs.PICOBSD # filename used for the memory filesystem c_img=picobsd.bin # filename used for the picobsd image + c_iso=picobsd.iso # filename used for the ISO image generate_iso="NO" # don't generate the iso image # select the right disklabel program @@ -276,15 +277,7 @@ set_msgs() { # OK \t3. Site-info: ${SITE}\n\t4. Full-path: ${MY_TREE}\n" } -# build the iso image -build_iso_image() { - log "build_iso_image()" - clear - set_msgs - printf "${MSG}---> Build the iso image not ready yet\n\n" -} - -# Main build procedure. +# Main build procedure. Builds both the disk image and the ISO build_image() { log "build_image() <${name}>" [ -n "${name}" ] || fail $? bad_type @@ -902,6 +895,16 @@ fill_floppy_image() { fi log "image used `du -s ${dst}` of ${blocks}k" + if [ "${generate_iso}" = "YES" ]; then + logverbose "generate_iso ${generate_iso}" + # build_iso_image # XXX not implemented yet + (cd ${BUILDDIR} + cp -p /boot/cdboot ${dst}/boot || fail $? no_space "copying cdboot" + mkisofs -b boot/cdboot -no-emul-boot -J -r -ldots -l -L \ + -o ${c_iso} ${dst} + ) + fi + (cd ${BUILDDIR} makefs -t ffs -o bsize=4096 -o fsize=512 \ -s ${blocks}k -f 50 ${c_img} ${dst} @@ -918,11 +921,6 @@ fill_floppy_image() { ) echo "BUILDDIR ${BUILDDIR}" - if [ "${generate_iso}" = "YES" ]; then - echo "generate_iso ${generate_iso}" - # build_iso_image # XXX not implemented yet - exit 1 - fi # dump the primary and secondary boot # XXX primary is 512 bytes From owner-svn-src-stable-7@FreeBSD.ORG Thu Jun 25 12:34:44 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B0E81065672; Thu, 25 Jun 2009 12:34:44 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 584C28FC1C; Thu, 25 Jun 2009 12:34:44 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5PCYijv051183; Thu, 25 Jun 2009 12:34:44 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5PCYip1051181; Thu, 25 Jun 2009 12:34:44 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200906251234.n5PCYip1051181@svn.freebsd.org> From: Nick Hibma Date: Thu, 25 Jun 2009 12:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194954 - stable/7/sys/dev/usb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 12:34:45 -0000 Author: n_hibma Date: Thu Jun 25 12:34:44 2009 New Revision: 194954 URL: http://svn.freebsd.org/changeset/base/194954 Log: Don't send multiple commands. Sending the ZTE switch command is sufficient. Modified: stable/7/sys/dev/usb/u3g.c Modified: stable/7/sys/dev/usb/u3g.c ============================================================================== --- stable/7/sys/dev/usb/u3g.c Thu Jun 25 12:34:05 2009 (r194953) +++ stable/7/sys/dev/usb/u3g.c Thu Jun 25 12:34:44 2009 (r194954) @@ -684,8 +684,6 @@ u3gstub_do_init(void *priv) device_printf(sc->sc_dev, "changing ZTE STOR modem to modem mode\n"); u3gstub_BBB_cmd(sc, ztestor_cmd); - u3gstub_BBB_cmd(sc, scsi_test_unit_ready); - u3gstub_BBB_cmd(sc, scsi_start_stop_unit); break; case U3GINIT_CMOTECH: if (bootverbose) From owner-svn-src-stable-7@FreeBSD.ORG Thu Jun 25 15:34:18 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BC6A106564A; Thu, 25 Jun 2009 15:34:18 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68CD28FC1D; Thu, 25 Jun 2009 15:34:18 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5PFYI0w055431; Thu, 25 Jun 2009 15:34:18 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5PFYIT3055429; Thu, 25 Jun 2009 15:34:18 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200906251534.n5PFYIT3055429@svn.freebsd.org> From: Hajimu UMEMOTO Date: Thu, 25 Jun 2009 15:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194964 - stable/7/usr.bin/ncal X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 15:34:19 -0000 Author: ume Date: Thu Jun 25 15:34:17 2009 New Revision: 194964 URL: http://svn.freebsd.org/changeset/base/194964 Log: MFC 194366, 194447: Fix column width of weekday names for multibyte locales. Modified: stable/7/usr.bin/ncal/ (props changed) stable/7/usr.bin/ncal/ncal.c Modified: stable/7/usr.bin/ncal/ncal.c ============================================================================== --- stable/7/usr.bin/ncal/ncal.c Thu Jun 25 15:30:25 2009 (r194963) +++ stable/7/usr.bin/ncal/ncal.c Thu Jun 25 15:34:17 2009 (r194964) @@ -417,13 +417,18 @@ printmonth(int y, int m, int jd_flag) { struct monthlines month; struct weekdays wds; - int i; + int i, len; mkmonth(y, m - 1, jd_flag, &month); mkweekdays(&wds); printf(" %ls %d\n", month.name, y); - for (i = 0; i != 7; i++) - wprintf(L"%.2ls%s\n", wds.names[i], month.lines[i]); + for (i = 0; i != 7; i++) { + len = wcslen(wds.names[i]); + if (wcswidth(wds.names[i], len) == len) + wprintf(L"%.2ls%s\n", wds.names[i], month.lines[i]); + else + wprintf(L"%.1ls%s\n", wds.names[i], month.lines[i]); + } if (flag_weeks) printf(" %s\n", month.weeks); } @@ -759,7 +764,7 @@ mkmonthb(int y, int m, int jd_flag, stru void mkweekdays(struct weekdays *wds) { - int i, len; + int i, len, width = 0; struct tm tm; wchar_t buf[20]; @@ -768,11 +773,15 @@ mkweekdays(struct weekdays *wds) for (i = 0; i != 7; i++) { tm.tm_wday = (i+1) % 7; wcsftime(buf, sizeof(buf), L"%a", &tm); - len = wcslen(buf); - if (len > 2) - len = 2; - wcscpy(wds->names[i], L" "); - wcsncpy(wds->names[i] + 2 - len, buf, len); + for (len = 2; len > 0; --len) { + if ((width = wcswidth(buf, len)) <= 2) + break; + } + wmemset(wds->names[i], L'\0', 4); + if (width == 1) + wds->names[i][0] = L' '; + wcsncat(wds->names[i], buf, len); + wcsncat(wds->names[i], L" ", 1); } } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jun 25 16:10:05 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13BD2106566C; Thu, 25 Jun 2009 16:10:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00EEB8FC0C; Thu, 25 Jun 2009 16:10:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5PGA45A056335; Thu, 25 Jun 2009 16:10:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5PGA479056333; Thu, 25 Jun 2009 16:10:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906251610.n5PGA479056333@svn.freebsd.org> From: John Baldwin Date: Thu, 25 Jun 2009 16:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194967 - in stable/7/sys: . contrib/pf kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 16:10:06 -0000 Author: jhb Date: Thu Jun 25 16:10:04 2009 New Revision: 194967 URL: http://svn.freebsd.org/changeset/base/194967 Log: MFC: Fix a deadlock in the getpeername() method for UNIX domain sockets. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/uipc_usrreq.c Modified: stable/7/sys/kern/uipc_usrreq.c ============================================================================== --- stable/7/sys/kern/uipc_usrreq.c Thu Jun 25 15:47:32 2009 (r194966) +++ stable/7/sys/kern/uipc_usrreq.c Thu Jun 25 16:10:04 2009 (r194967) @@ -672,7 +672,7 @@ uipc_peeraddr(struct socket *so, struct KASSERT(unp != NULL, ("uipc_peeraddr: unp == NULL")); *nam = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK); - UNP_PCB_LOCK(unp); + UNP_GLOBAL_RLOCK(); /* * XXX: It seems that this test always fails even when connection is * established. So, this else clause is added as workaround to @@ -682,7 +682,7 @@ uipc_peeraddr(struct socket *so, struct if (unp2 != NULL) { UNP_PCB_LOCK(unp2); if (unp2->unp_addr != NULL) - sa = (struct sockaddr *) unp->unp_conn->unp_addr; + sa = (struct sockaddr *) unp2->unp_addr; else sa = &sun_noname; bcopy(sa, *nam, sa->sa_len); @@ -691,7 +691,7 @@ uipc_peeraddr(struct socket *so, struct sa = &sun_noname; bcopy(sa, *nam, sa->sa_len); } - UNP_PCB_UNLOCK(unp); + UNP_GLOBAL_RUNLOCK(); return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Fri Jun 26 01:08:36 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D98810656BB; Fri, 26 Jun 2009 01:08:36 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 493028FC1F; Fri, 26 Jun 2009 01:08:36 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5Q18aPM070156; Fri, 26 Jun 2009 01:08:36 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5Q18ZBs070148; Fri, 26 Jun 2009 01:08:35 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200906260108.n5Q18ZBs070148@svn.freebsd.org> From: Brian Somers Date: Fri, 26 Jun 2009 01:08: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: r195027 - stable/7/usr.bin/tail X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2009 01:08:37 -0000 Author: brian Date: Fri Jun 26 01:08:35 2009 New Revision: 195027 URL: http://svn.freebsd.org/changeset/base/195027 Log: MFC: r193488: Persist forever when tailing with -F and ignore ENOENT failures. Correct the filename in other error messages. Modified: stable/7/usr.bin/tail/ (props changed) stable/7/usr.bin/tail/extern.h stable/7/usr.bin/tail/forward.c stable/7/usr.bin/tail/misc.c stable/7/usr.bin/tail/read.c stable/7/usr.bin/tail/reverse.c stable/7/usr.bin/tail/tail.1 stable/7/usr.bin/tail/tail.c Modified: stable/7/usr.bin/tail/extern.h ============================================================================== --- stable/7/usr.bin/tail/extern.h Fri Jun 26 01:04:50 2009 (r195026) +++ stable/7/usr.bin/tail/extern.h Fri Jun 26 01:08:35 2009 (r195027) @@ -61,16 +61,15 @@ typedef struct file_info file_info_t; enum STYLE { NOTSET = 0, FBYTES, FLINES, RBYTES, RLINES, REVERSE }; void follow(file_info_t *, enum STYLE, off_t); -void forward(FILE *, enum STYLE, off_t, struct stat *); -void reverse(FILE *, enum STYLE, off_t, struct stat *); +void forward(FILE *, const char *, enum STYLE, off_t, struct stat *); +void reverse(FILE *, const char *, enum STYLE, off_t, struct stat *); -int bytes(FILE *, off_t); -int lines(FILE *, off_t); +int bytes(FILE *, const char *, off_t); +int lines(FILE *, const char *, off_t); -void ierr(void); +void ierr(const char *); void oerr(void); int mapprint(struct mapinfo *, off_t, off_t); int maparound(struct mapinfo *, off_t); extern int Fflag, fflag, qflag, rflag, rval, no_files; -extern const char *fname; Modified: stable/7/usr.bin/tail/forward.c ============================================================================== --- stable/7/usr.bin/tail/forward.c Fri Jun 26 01:04:50 2009 (r195026) +++ stable/7/usr.bin/tail/forward.c Fri Jun 26 01:08:35 2009 (r195027) @@ -61,8 +61,8 @@ static const char sccsid[] = "@(#)forwar #include "extern.h" -static void rlines(FILE *, off_t, struct stat *); -static void show(file_info_t *); +static void rlines(FILE *, const char *fn, off_t, struct stat *); +static int show(file_info_t *); static void set_events(file_info_t *files); /* defines for inner loop actions */ @@ -99,7 +99,7 @@ static const file_info_t *last; * NOREG cyclically read lines into a wrap-around array of buffers */ void -forward(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) +forward(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) { int ch; @@ -111,13 +111,13 @@ forward(FILE *fp, enum STYLE style, off_ if (sbp->st_size < off) off = sbp->st_size; if (fseeko(fp, off, SEEK_SET) == -1) { - ierr(); + ierr(fn); return; } } else while (off--) if ((ch = getc(fp)) == EOF) { if (ferror(fp)) { - ierr(); + ierr(fn); return; } break; @@ -129,7 +129,7 @@ forward(FILE *fp, enum STYLE style, off_ for (;;) { if ((ch = getc(fp)) == EOF) { if (ferror(fp)) { - ierr(); + ierr(fn); return; } break; @@ -142,36 +142,36 @@ forward(FILE *fp, enum STYLE style, off_ if (S_ISREG(sbp->st_mode)) { if (sbp->st_size >= off && fseeko(fp, -off, SEEK_END) == -1) { - ierr(); + ierr(fn); return; } } else if (off == 0) { while (getc(fp) != EOF); if (ferror(fp)) { - ierr(); + ierr(fn); return; } } else - if (bytes(fp, off)) + if (bytes(fp, fn, off)) return; break; case RLINES: if (S_ISREG(sbp->st_mode)) if (!off) { if (fseeko(fp, (off_t)0, SEEK_END) == -1) { - ierr(); + ierr(fn); return; } } else - rlines(fp, off, sbp); + rlines(fp, fn, off, sbp); else if (off == 0) { while (getc(fp) != EOF); if (ferror(fp)) { - ierr(); + ierr(fn); return; } } else - if (lines(fp, off)) + if (lines(fp, fn, off)) return; break; default: @@ -182,7 +182,7 @@ forward(FILE *fp, enum STYLE style, off_ if (putchar(ch) == EOF) oerr(); if (ferror(fp)) { - ierr(); + ierr(fn); return; } (void)fflush(stdout); @@ -192,10 +192,7 @@ forward(FILE *fp, enum STYLE style, off_ * rlines -- display the last offset lines of the file. */ static void -rlines(fp, off, sbp) - FILE *fp; - off_t off; - struct stat *sbp; +rlines(FILE *fp, const char *fn, off_t off, struct stat *sbp) { struct mapinfo map; off_t curoff, size; @@ -214,7 +211,7 @@ rlines(fp, off, sbp) curoff = size - 2; while (curoff >= 0) { if (curoff < map.mapoff && maparound(&map, curoff) != 0) { - ierr(); + ierr(fn); return; } for (i = curoff - map.mapoff; i >= 0; i--) @@ -227,41 +224,44 @@ rlines(fp, off, sbp) } curoff++; if (mapprint(&map, curoff, size - curoff) != 0) { - ierr(); + ierr(fn); exit(1); } /* Set the file pointer to reflect the length displayed. */ if (fseeko(fp, sbp->st_size, SEEK_SET) == -1) { - ierr(); + ierr(fn); return; } if (map.start != NULL && munmap(map.start, map.maplen)) { - ierr(); + ierr(fn); return; } } -static void +static int show(file_info_t *file) { - int ch; + int ch; - while ((ch = getc(file->fp)) != EOF) { - if (last != file && no_files > 1) { - if (!qflag) - (void)printf("\n==> %s <==\n", file->file_name); - last = file; - } - if (putchar(ch) == EOF) - oerr(); - } - (void)fflush(stdout); - if (ferror(file->fp)) { - file->fp = NULL; - ierr(); - } else - clearerr(file->fp); + while ((ch = getc(file->fp)) != EOF) { + if (last != file && no_files > 1) { + if (!qflag) + (void)printf("\n==> %s <==\n", file->file_name); + last = file; + } + if (putchar(ch) == EOF) + oerr(); + } + (void)fflush(stdout); + if (ferror(file->fp)) { + fclose(file->fp); + file->fp = NULL; + ierr(file->file_name); + return 0; + } + clearerr(file->fp); + return 1; } static void @@ -309,7 +309,7 @@ set_events(file_info_t *files) void follow(file_info_t *files, enum STYLE style, off_t off) { - int active, i, n = -1; + int active, ev_change, i, n = -1; struct stat sb2; file_info_t *file; struct timespec ts; @@ -325,12 +325,12 @@ follow(file_info_t *files, enum STYLE st n++; if (no_files > 1 && !qflag) (void)printf("\n==> %s <==\n", file->file_name); - forward(file->fp, style, off, &file->st); + forward(file->fp, file->file_name, style, off, &file->st); if (Fflag && fileno(file->fp) != STDIN_FILENO) - n++; + n++; } } - if (! active) + if (!Fflag && !active) return; last = --file; @@ -344,28 +344,56 @@ follow(file_info_t *files, enum STYLE st set_events(files); for (;;) { - for (i = 0, file = files; i < no_files; i++, file++) { - if (! file->fp) - continue; - if (Fflag && file->fp && fileno(file->fp) != STDIN_FILENO) { - if (stat(file->file_name, &sb2) == 0 && - (sb2.st_ino != file->st.st_ino || - sb2.st_dev != file->st.st_dev || - sb2.st_nlink == 0)) { - show(file); - file->fp = freopen(file->file_name, "r", file->fp); - if (file->fp == NULL) { - ierr(); - continue; - } else { - memcpy(&file->st, &sb2, sizeof(struct stat)); - set_events(files); + ev_change = 0; + if (Fflag) { + for (i = 0, file = files; i < no_files; i++, file++) { + if (!file->fp) { + file->fp = fopen(file->file_name, "r"); + if (file->fp != NULL && + fstat(fileno(file->fp), &file->st) + == -1) { + fclose(file->fp); + file->fp = NULL; } + if (file->fp != NULL) + ev_change++; + continue; + } + if (fileno(file->fp) == STDIN_FILENO) + continue; + if (stat(file->file_name, &sb2) == -1) { + if (errno != ENOENT) + ierr(file->file_name); + show(file); + fclose(file->fp); + file->fp = NULL; + ev_change++; + continue; + } + + if (sb2.st_ino != file->st.st_ino || + sb2.st_dev != file->st.st_dev || + sb2.st_nlink == 0) { + show(file); + file->fp = freopen(file->file_name, "r", + file->fp); + if (file->fp != NULL) + memcpy(&file->st, &sb2, + sizeof(struct stat)); + else if (errno != ENOENT) + ierr(file->file_name); + ev_change++; } } - show(file); } + for (i = 0, file = files; i < no_files; i++, file++) + if (file->fp && !show(file)) + ev_change++; + + if (ev_change) + set_events(files); + switch (action) { case USE_KQUEUE: ts.tv_sec = 1; @@ -381,9 +409,9 @@ follow(file_info_t *files, enum STYLE st /* timeout */ break; } else if (ev->filter == EVFILT_READ && ev->data < 0) { - /* file shrank, reposition to end */ + /* file shrank, reposition to end */ if (lseek(ev->ident, (off_t)0, SEEK_END) == -1) { - ierr(); + ierr(file->file_name); continue; } } Modified: stable/7/usr.bin/tail/misc.c ============================================================================== --- stable/7/usr.bin/tail/misc.c Fri Jun 26 01:04:50 2009 (r195026) +++ stable/7/usr.bin/tail/misc.c Fri Jun 26 01:08:35 2009 (r195027) @@ -56,7 +56,7 @@ static const char sccsid[] = "@(#)misc.c #include "extern.h" void -ierr() +ierr(const char *fname) { warn("%s", fname); rval = 1; Modified: stable/7/usr.bin/tail/read.c ============================================================================== --- stable/7/usr.bin/tail/read.c Fri Jun 26 01:04:50 2009 (r195026) +++ stable/7/usr.bin/tail/read.c Fri Jun 26 01:08:35 2009 (r195027) @@ -66,7 +66,7 @@ static const char sccsid[] = "@(#)read.c * the end. */ int -bytes(FILE *fp, off_t off) +bytes(FILE *fp, const char *fn, off_t off) { int ch, len, tlen; char *ep, *p, *t; @@ -84,7 +84,7 @@ bytes(FILE *fp, off_t off) } } if (ferror(fp)) { - ierr(); + ierr(fn); free(sp); return 1; } @@ -136,7 +136,7 @@ bytes(FILE *fp, off_t off) * the end. */ int -lines(FILE *fp, off_t off) +lines(FILE *fp, const char *fn, off_t off) { struct { int blen; @@ -178,7 +178,7 @@ lines(FILE *fp, off_t off) } } if (ferror(fp)) { - ierr(); + ierr(fn); rc = 1; goto done; } Modified: stable/7/usr.bin/tail/reverse.c ============================================================================== --- stable/7/usr.bin/tail/reverse.c Fri Jun 26 01:04:50 2009 (r195026) +++ stable/7/usr.bin/tail/reverse.c Fri Jun 26 01:08:35 2009 (r195027) @@ -58,8 +58,8 @@ __FBSDID("$FreeBSD$"); #include "extern.h" -static void r_buf(FILE *); -static void r_reg(FILE *, enum STYLE, off_t, struct stat *); +static void r_buf(FILE *, const char *); +static void r_reg(FILE *, const char *, enum STYLE, off_t, struct stat *); /* * reverse -- display input in reverse order by line. @@ -80,25 +80,25 @@ static void r_reg(FILE *, enum STYLE, of * NOREG cyclically read input into a linked list of buffers */ void -reverse(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) +reverse(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) { if (style != REVERSE && off == 0) return; if (S_ISREG(sbp->st_mode)) - r_reg(fp, style, off, sbp); + r_reg(fp, fn, style, off, sbp); else switch(style) { case FBYTES: case RBYTES: - bytes(fp, off); + bytes(fp, fn, off); break; case FLINES: case RLINES: - lines(fp, off); + lines(fp, fn, off); break; case REVERSE: - r_buf(fp); + r_buf(fp, fn); break; default: break; @@ -109,7 +109,7 @@ reverse(FILE *fp, enum STYLE style, off_ * r_reg -- display a regular file in reverse order by line. */ static void -r_reg(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) +r_reg(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) { struct mapinfo map; off_t curoff, size, lineend; @@ -132,7 +132,7 @@ r_reg(FILE *fp, enum STYLE style, off_t if (curoff < map.mapoff || curoff >= map.mapoff + (off_t)map.maplen) { if (maparound(&map, curoff) != 0) { - ierr(); + ierr(fn); return; } } @@ -149,7 +149,7 @@ r_reg(FILE *fp, enum STYLE style, off_t /* Print the line and update offsets. */ if (mapprint(&map, curoff + 1, lineend - curoff - 1) != 0) { - ierr(); + ierr(fn); return; } lineend = curoff + 1; @@ -165,11 +165,11 @@ r_reg(FILE *fp, enum STYLE style, off_t } } if (curoff < 0 && mapprint(&map, 0, lineend) != 0) { - ierr(); + ierr(fn); return; } if (map.start != NULL && munmap(map.start, map.maplen)) - ierr(); + ierr(fn); } typedef struct bf { @@ -190,7 +190,7 @@ typedef struct bf { * user warned). */ static void -r_buf(FILE *fp) +r_buf(FILE *fp, const char *fn) { BF *mark, *tl, *tr; int ch, len, llen; @@ -226,7 +226,7 @@ r_buf(FILE *fp) *p++ = ch; if (ferror(fp)) { - ierr(); + ierr(fn); return; } Modified: stable/7/usr.bin/tail/tail.1 ============================================================================== --- stable/7/usr.bin/tail/tail.1 Fri Jun 26 01:04:50 2009 (r195026) +++ stable/7/usr.bin/tail/tail.1 Fri Jun 26 01:08:35 2009 (r195027) @@ -35,7 +35,7 @@ .\" @(#)tail.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 29, 2006 +.Dd June 05, 2009 .Dt TAIL 1 .Os .Sh NAME @@ -106,9 +106,16 @@ will also check to see if the file being The file is closed and reopened when .Nm detects that the filename being read from has a new inode number. +.Pp +If the file being followed does not (yet) exist or if it is removed, tail +will keep looking and will display the file from the beginning if and when +it is created. +.Pp The .Fl F -option is ignored if reading from standard input rather than a file. +option is the same as the +.Fl f +option if reading from standard input rather than a file. .It Fl n Ar number The location is .Ar number Modified: stable/7/usr.bin/tail/tail.c ============================================================================== --- stable/7/usr.bin/tail/tail.c Fri Jun 26 01:04:50 2009 (r195026) +++ stable/7/usr.bin/tail/tail.c Fri Jun 26 01:08:35 2009 (r195027) @@ -61,7 +61,6 @@ static const char sccsid[] = "@(#)tail.c #include "extern.h" int Fflag, fflag, qflag, rflag, rval, no_files; -const char *fname; file_info_t *files; @@ -72,6 +71,7 @@ int main(int argc, char *argv[]) { struct stat sb; + const char *fn; FILE *fp; off_t off; enum STYLE style; @@ -174,20 +174,23 @@ main(int argc, char *argv[]) } if (*argv && fflag) { - files = (struct file_info *) malloc(no_files * sizeof(struct file_info)); - if (! files) + files = (struct file_info *) malloc(no_files * + sizeof(struct file_info)); + if (!files) err(1, "Couldn't malloc space for file descriptors."); - for (file = files; (fname = *argv++); file++) { - file->file_name = malloc(strlen(fname)+1); + for (file = files; (fn = *argv++); file++) { + file->file_name = strdup(fn); if (! file->file_name) errx(1, "Couldn't malloc space for file name."); - strncpy(file->file_name, fname, strlen(fname)+1); if ((file->fp = fopen(file->file_name, "r")) == NULL || fstat(fileno(file->fp), &file->st)) { - file->fp = NULL; - ierr(); - continue; + if (file->fp != NULL) { + fclose(file->fp); + file->fp = NULL; + } + if (!Fflag || errno != ENOENT) + ierr(file->file_name); } } follow(files, style, off); @@ -196,29 +199,29 @@ main(int argc, char *argv[]) } free(files); } else if (*argv) { - for (first = 1; (fname = *argv++);) { - if ((fp = fopen(fname, "r")) == NULL || + for (first = 1; (fn = *argv++);) { + if ((fp = fopen(fn, "r")) == NULL || fstat(fileno(fp), &sb)) { - ierr(); + ierr(fn); continue; } if (argc > 1 && !qflag) { (void)printf("%s==> %s <==\n", - first ? "" : "\n", fname); + first ? "" : "\n", fn); first = 0; (void)fflush(stdout); } if (rflag) - reverse(fp, style, off, &sb); + reverse(fp, fn, style, off, &sb); else - forward(fp, style, off, &sb); + forward(fp, fn, style, off, &sb); } } else { - fname = "stdin"; + fn = "stdin"; if (fstat(fileno(stdin), &sb)) { - ierr(); + ierr(fn); exit(1); } @@ -233,9 +236,9 @@ main(int argc, char *argv[]) } if (rflag) - reverse(stdin, style, off, &sb); + reverse(stdin, fn, style, off, &sb); else - forward(stdin, style, off, &sb); + forward(stdin, fn, style, off, &sb); } exit(rval); } From owner-svn-src-stable-7@FreeBSD.ORG Fri Jun 26 06:59:47 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAB801065672; Fri, 26 Jun 2009 06:59:47 +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 D89178FC1E; Fri, 26 Jun 2009 06:59:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5Q6xlZt078119; Fri, 26 Jun 2009 06:59:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5Q6xlfp078117; Fri, 26 Jun 2009 06:59:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200906260659.n5Q6xlfp078117@svn.freebsd.org> From: Warner Losh Date: Fri, 26 Jun 2009 06:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195043 - stable/7/sbin/restore X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2009 06:59:48 -0000 Author: imp Date: Fri Jun 26 06:59:47 2009 New Revision: 195043 URL: http://svn.freebsd.org/changeset/base/195043 Log: Merge r187828: restore necessary NUL termination. Modified: stable/7/sbin/restore/ (props changed) stable/7/sbin/restore/interactive.c Modified: stable/7/sbin/restore/interactive.c ============================================================================== --- stable/7/sbin/restore/interactive.c Fri Jun 26 06:40:12 2009 (r195042) +++ stable/7/sbin/restore/interactive.c Fri Jun 26 06:59:47 2009 (r195043) @@ -545,6 +545,7 @@ printlist(char *name, char *basename) strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0)) continue; + locname[namelen] = '\0'; if (namelen + dp->d_namlen >= MAXPATHLEN) { fprintf(stderr, "%s%s: name exceeds %d char\n", locname, dp->d_name, MAXPATHLEN); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jun 26 13:37:54 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8795A1065672; Fri, 26 Jun 2009 13:37:54 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1A4E8FC1A; Fri, 26 Jun 2009 13:37:53 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5QDbrJH088087; Fri, 26 Jun 2009 13:37:53 GMT (envelope-from vanhu@svn.freebsd.org) Received: (from vanhu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5QDbr7k088085; Fri, 26 Jun 2009 13:37:53 GMT (envelope-from vanhu@svn.freebsd.org) Message-Id: <200906261337.n5QDbr7k088085@svn.freebsd.org> From: VANHULLEBUS Yvan Date: Fri, 26 Jun 2009 13:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195053 - in stable/7/sys: . contrib/pf netipsec X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2009 13:37:55 -0000 Author: vanhu Date: Fri Jun 26 13:37:53 2009 New Revision: 195053 URL: http://svn.freebsd.org/changeset/base/195053 Log: MFC: Only decrease refcnt once when flushing SPD entries, to avoid flushing entries which are still used. Obtained from: NETASQ Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/netipsec/key.c Modified: stable/7/sys/netipsec/key.c ============================================================================== --- stable/7/sys/netipsec/key.c Fri Jun 26 11:58:15 2009 (r195052) +++ stable/7/sys/netipsec/key.c Fri Jun 26 13:37:53 2009 (r195053) @@ -4057,10 +4057,21 @@ restart: if (sp->scangen == gen) /* previously handled */ continue; sp->scangen = gen; - if (sp->state == IPSEC_SPSTATE_DEAD) { - /* NB: clean entries created by key_spdflush */ + if (sp->state == IPSEC_SPSTATE_DEAD && + sp->refcnt == 1) { + /* + * Ensure that we only decrease refcnt once, + * when we're the last consumer. + * Directly call SP_DELREF/key_delsp instead + * of KEY_FREESP to avoid unlocking/relocking + * SPTREE_LOCK before key_delsp: may refcnt + * be increased again during that time ? + * NB: also clean entries created by + * key_spdflush + */ + SP_DELREF(sp); + key_delsp(sp); SPTREE_UNLOCK(); - KEY_FREESP(&sp); goto restart; } if (sp->lifetime == 0 && sp->validtime == 0) @@ -4070,7 +4081,6 @@ restart: sp->state = IPSEC_SPSTATE_DEAD; SPTREE_UNLOCK(); key_spdexpire(sp); - KEY_FREESP(&sp); goto restart; } }