From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 15 10:43: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 CB6721065678; Sun, 15 Mar 2009 10:43:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8FEC8FC1E; Sun, 15 Mar 2009 10:43:48 +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 n2FAhmBp024132; Sun, 15 Mar 2009 10:43:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FAhmR4024131; Sun, 15 Mar 2009 10:43:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200903151043.n2FAhmR4024131@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 15 Mar 2009 10:43: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: r189849 - stable/7/sbin/devd 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, 15 Mar 2009 10:43:49 -0000 Author: kib Date: Sun Mar 15 10:43:48 2009 New Revision: 189849 URL: http://svn.freebsd.org/changeset/base/189849 Log: MFC r189534: Document several notifications. MFC r189538 (by maxim): Spell. Sort .Xrs. Modified: stable/7/sbin/devd/ (props changed) stable/7/sbin/devd/devd.conf.5 Modified: stable/7/sbin/devd/devd.conf.5 ============================================================================== --- stable/7/sbin/devd/devd.conf.5 Sun Mar 15 09:58:31 2009 (r189848) +++ stable/7/sbin/devd/devd.conf.5 Sun Mar 15 10:43:48 2009 (r189849) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd October 25, 2006 +.Dd March 8, 2009 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -120,7 +120,7 @@ Specifies PID file. .It Ic set Ar regexp-name Qq Ar (some|regexp) ; Creates a regular expression and assigns it to the variable .Ar regexp-name . -The variable is avaiable throughout the rest of +The variable is available throughout the rest of the configuration file. All regular expressions have an implicit .Ql ^$ @@ -208,7 +208,7 @@ The following sub-statements are support statement. The .Dq Li notify -variable is avaiable inside this statement and contains, a value, depending +variable is available inside this statement and contains, a value, depending on which system and subsystem that delivered the event. .Bl -tag -width ".Ic directory" .It Ic action Qq Ar command ; @@ -223,7 +223,7 @@ statements can exist within a statement; .Ar value can be either a fixed string or a regular expression. -Below is a list of avaiable systems, subsystems, and types. +Below is a list of available systems, subsystems, and types. .It Ic media-type Qq Ar string ; See above. .El @@ -238,6 +238,10 @@ statement. .Ic Description .It Li bus Device name of parent bus. +.It Li cdev +Device node path if one is created by the +.Xr devfs 5 +filesystem. .It Li cisproduct CIS-product. .It Li cisvendor @@ -280,7 +284,7 @@ A partial list of systems, subsystems, a .Ic notify mechanism. .Pp -.Bl -tag -width ".Li IFNET" -compact +.Bl -tag -width ".Li coretemp" -compact .It Sy System .It Li ACPI Events related to the ACPI subsystem. @@ -313,6 +317,55 @@ took place. Carrier status changed to UP. .It Li LINK_DOWN Carrier status changed to DOWN. +.It Li ATTACH +The network interface is attached to the system. +.It Li DETACH +The network interface is detached from the system. +.El +.El +.It Li DEVFS +Events related to the +.Xr devfs 5 +filesystem. +.Bl -tag -width ".Sy Subsystem" -compact +.It Sy Subsystem +.It Li CDEV +.Bl -tag -width ".Li DESTROY" -compact +.It Sy Type +.It Li CREATE +The +.Xr devfs 5 +node is created. +.It Li DESTROY +The +.Xr devfs 5 +node is destroyed. +.El +.El +.It Li coretemp +Events related to the +.Xr coretemp 4 +device. +.Bl -tag -width ".Sy Subsystem" -compact +.It Sy Subsystem +.It Li Thermal +Notification that the CPU core has reached critical temperature. +.Bl -tag -width ".Ar temperature" -compact +.It Sy Type +.It Ar temperature +String containing the temperature of the core that has become too hot. +.El +.El +.It Li kern +Events related to the kernel. +.Bl -tag -width ".Sy Subsystem" -compact +.It Sy Subsystem +.It Li power +Information about the state of the system. +.Bl -tag -width ".li resume" -compact +.It Sy Type +.It Li resume +Notification that the system has woken from the suspended state. .El .El .El @@ -430,4 +483,6 @@ The installed .Pa /etc/devd.conf has many additional examples. .Sh SEE ALSO +.Xr coretemp 4 , +.Xr devfs 5 , .Xr devd 8 From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 15 17:20:29 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE33A10656CC; Sun, 15 Mar 2009 17:20:28 +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 D5BC38FC19; Sun, 15 Mar 2009 17:20:28 +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 n2FHKSob034889; Sun, 15 Mar 2009 17:20:28 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FHKS1C034884; Sun, 15 Mar 2009 17:20:28 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903151720.n2FHKS1C034884@svn.freebsd.org> From: Robert Noland Date: Sun, 15 Mar 2009 17:20: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: r189855 - in stable/7/sys: . conf contrib/pf dev/ath/ath_hal dev/cxgb dev/drm modules/drm/radeon 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, 15 Mar 2009 17:20:30 -0000 Author: rnoland Date: Sun Mar 15 17:20:28 2009 New Revision: 189855 URL: http://svn.freebsd.org/changeset/base/189855 Log: Merge 189499,189557,189558 This is the radeon r600+ code with fixes. A few days early, but it seems to fix some other vblank related issues as well. 189499: Import support for ATI Radeon R600 and R700 series chips. Tested on an HD3850 (RV670) on loan from Warren Block. Currently, you need one of the following for this to be useful: x11-drivers/xf86-video-radeonhd-devel (not tested) xf86-video-ati from git (EXA works, xv is too fast) xf86-video-radeonhd from git (EXA works, xv works) There is no 3d support available from dri just yet. 189557: Call the right function for the right chipset. 189558: -Make the PCI(E)/AGP calculations consistent -Calculate the scratch address correctly Added: stable/7/sys/dev/drm/r600_cp.c - copied, changed from r189499, head/sys/dev/drm/r600_cp.c stable/7/sys/dev/drm/r600_microcode.h - copied unchanged from r189499, head/sys/dev/drm/r600_microcode.h Modified: stable/7/sys/ (props changed) stable/7/sys/conf/files stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_pciids.h stable/7/sys/dev/drm/radeon_cp.c stable/7/sys/dev/drm/radeon_drm.h stable/7/sys/dev/drm/radeon_drv.h stable/7/sys/dev/drm/radeon_irq.c stable/7/sys/dev/drm/radeon_state.c stable/7/sys/modules/drm/radeon/Makefile Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Sun Mar 15 16:12:50 2009 (r189854) +++ stable/7/sys/conf/files Sun Mar 15 17:20:28 2009 (r189855) @@ -755,6 +755,7 @@ dev/drm/r128_irq.c optional r128drm dev/drm/r128_state.c optional r128drm \ compile-with "${NORMAL_C} -finline-limit=13500" dev/drm/r300_cmdbuf.c optional radeondrm +dev/drm/r600_cp.c optional radeondrm dev/drm/radeon_cp.c optional radeondrm dev/drm/radeon_drv.c optional radeondrm dev/drm/radeon_irq.c optional radeondrm Modified: stable/7/sys/dev/drm/drm_pciids.h ============================================================================== --- stable/7/sys/dev/drm/drm_pciids.h Sun Mar 15 16:12:50 2009 (r189854) +++ stable/7/sys/dev/drm/drm_pciids.h Sun Mar 15 17:20:28 2009 (r189855) @@ -240,12 +240,123 @@ {0x1002, 0x7297, CHIP_RV560|RADEON_NEW_MEMMAP, "ATI RV560"}, \ {0x1002, 0x7834, CHIP_RS300|RADEON_IS_IGP|RADEON_NEW_MEMMAP, "ATI Radeon RS350 9000/9100 IGP"}, \ {0x1002, 0x7835, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Radeon RS350 Mobility IGP"}, \ + {0x1002, 0x793f, CHIP_RS600|RADEON_IS_IGP|RADEON_NEW_MEMMAP, "ATI Radeon X1200"}, \ + {0x1002, 0x7941, CHIP_RS600|RADEON_IS_IGP|RADEON_NEW_MEMMAP, "ATI Radeon X1200"}, \ + {0x1002, 0x7942, CHIP_RS600|RADEON_IS_IGP|RADEON_NEW_MEMMAP, "ATI Radeon X1200"}, \ {0x1002, 0x791e, CHIP_RS690|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART, "ATI Radeon RS690 X1250 IGP"}, \ {0x1002, 0x791f, CHIP_RS690|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART, "ATI Radeon RS690 X1270 IGP"}, \ {0x1002, 0x796c, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART, "ATI Radeon RS740 HD2100 IGP"}, \ {0x1002, 0x796d, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART, "ATI Radeon RS740 HD2100 IGP"}, \ {0x1002, 0x796e, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART, "ATI Radeon RS740 HD2100 IGP"}, \ {0x1002, 0x796f, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART, "ATI Radeon RS740 HD2100 IGP"}, \ + {0x1002, 0x9400, CHIP_R600|RADEON_NEW_MEMMAP, "ATI Radeon HD 2900 XT"}, \ + {0x1002, 0x9401, CHIP_R600|RADEON_NEW_MEMMAP, "ATI Radeon HD 2900 XT"}, \ + {0x1002, 0x9402, CHIP_R600|RADEON_NEW_MEMMAP, "ATI Radeon HD 2900 XT"}, \ + {0x1002, 0x9403, CHIP_R600|RADEON_NEW_MEMMAP, "ATI Radeon HD 2900 Pro"}, \ + {0x1002, 0x9405, CHIP_R600|RADEON_NEW_MEMMAP, "ATI Radeon HD 2900 GT"}, \ + {0x1002, 0x940A, CHIP_R600|RADEON_NEW_MEMMAP, "ATI FireGL V8650"}, \ + {0x1002, 0x940B, CHIP_R600|RADEON_NEW_MEMMAP, "ATI FireGL V8600"}, \ + {0x1002, 0x940F, CHIP_R600|RADEON_NEW_MEMMAP, "ATI FireGL V7600"}, \ + {0x1002, 0x94C0, CHIP_RV610|RADEON_NEW_MEMMAP, "RV610"}, \ + {0x1002, 0x94C1, CHIP_RV610|RADEON_NEW_MEMMAP, "Radeon HD 2400 XT"}, \ + {0x1002, 0x94C3, CHIP_RV610|RADEON_NEW_MEMMAP, "Radeon HD 2400 Pro"}, \ + {0x1002, 0x94C4, CHIP_RV610|RADEON_NEW_MEMMAP, "Radeon HD 2400 PRO AGP"}, \ + {0x1002, 0x94C5, CHIP_RV610|RADEON_NEW_MEMMAP, "FireGL V4000"}, \ + {0x1002, 0x94C6, CHIP_RV610|RADEON_NEW_MEMMAP, "RV610"}, \ + {0x1002, 0x94C7, CHIP_RV610|RADEON_NEW_MEMMAP, "ATI Radeon HD 2350"}, \ + {0x1002, 0x94C8, CHIP_RV610|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 2400 XT"}, \ + {0x1002, 0x94C9, CHIP_RV610|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 2400"}, \ + {0x1002, 0x94CB, CHIP_RV610|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI RADEON E2400"}, \ + {0x1002, 0x94CC, CHIP_RV610|RADEON_NEW_MEMMAP, "ATI RV610"}, \ + {0x1002, 0x94CD, CHIP_RV610|RADEON_NEW_MEMMAP, "ATI FireMV 2260"}, \ + {0x1002, 0x9500, CHIP_RV670|RADEON_NEW_MEMMAP, "ATI RV670"}, \ + {0x1002, 0x9501, CHIP_RV670|RADEON_NEW_MEMMAP, "ATI Radeon HD3870"}, \ + {0x1002, 0x9504, CHIP_RV670|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 3850"}, \ + {0x1002, 0x9505, CHIP_RV670|RADEON_NEW_MEMMAP, "ATI Radeon HD3850"}, \ + {0x1002, 0x9506, CHIP_RV670|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 3850 X2"}, \ + {0x1002, 0x9507, CHIP_RV670|RADEON_NEW_MEMMAP, "ATI RV670"}, \ + {0x1002, 0x9508, CHIP_RV670|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 3870"}, \ + {0x1002, 0x9509, CHIP_RV670|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 3870 X2"}, \ + {0x1002, 0x950F, CHIP_RV670|RADEON_NEW_MEMMAP, "ATI Radeon HD3870 X2"}, \ + {0x1002, 0x9511, CHIP_RV670|RADEON_NEW_MEMMAP, "ATI FireGL V7700"}, \ + {0x1002, 0x9515, CHIP_RV670|RADEON_NEW_MEMMAP, "ATI Radeon HD3850"}, \ + {0x1002, 0x9517, CHIP_RV670|RADEON_NEW_MEMMAP, "ATI Radeon HD3690"}, \ + {0x1002, 0x9519, CHIP_RV670|RADEON_NEW_MEMMAP, "AMD Firestream 9170"}, \ + {0x1002, 0x9580, CHIP_RV630|RADEON_NEW_MEMMAP, "ATI RV630"}, \ + {0x1002, 0x9581, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 2600"}, \ + {0x1002, 0x9583, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 2600 XT"}, \ + {0x1002, 0x9586, CHIP_RV630|RADEON_NEW_MEMMAP, "ATI Radeon HD 2600 XT AGP"}, \ + {0x1002, 0x9587, CHIP_RV630|RADEON_NEW_MEMMAP, "ATI Radeon HD 2600 Pro AGP"}, \ + {0x1002, 0x9588, CHIP_RV630|RADEON_NEW_MEMMAP, "ATI Radeon HD 2600 XT"}, \ + {0x1002, 0x9589, CHIP_RV630|RADEON_NEW_MEMMAP, "ATI Radeon HD 2600 Pro"}, \ + {0x1002, 0x958A, CHIP_RV630|RADEON_NEW_MEMMAP, "ATI Gemini RV630"}, \ + {0x1002, 0x958B, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Gemini Mobility Radeon HD 2600 XT"}, \ + {0x1002, 0x958C, CHIP_RV630|RADEON_NEW_MEMMAP, "ATI FireGL V5600"}, \ + {0x1002, 0x958D, CHIP_RV630|RADEON_NEW_MEMMAP, "ATI FireGL V3600"}, \ + {0x1002, 0x958E, CHIP_RV630|RADEON_NEW_MEMMAP, "ATI Radeon HD 2600 LE"}, \ + {0x1002, 0x958F, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility FireGL Graphics Processor"}, \ + {0x1002, 0x95C0, CHIP_RV620|RADEON_NEW_MEMMAP, "ATI Radeon HD 3470"}, \ + {0x1002, 0x95C5, CHIP_RV620|RADEON_NEW_MEMMAP, "ATI Radeon HD 3450"}, \ + {0x1002, 0x95C6, CHIP_RV620|RADEON_NEW_MEMMAP, "ATI Radeon HD 3450"}, \ + {0x1002, 0x95C7, CHIP_RV620|RADEON_NEW_MEMMAP, "ATI Radeon HD 3430"}, \ + {0x1002, 0x95C9, CHIP_RV620|RADEON_NEW_MEMMAP, "ATI Radeon HD 3450"}, \ + {0x1002, 0x95C2, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 3430"}, \ + {0x1002, 0x95C4, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 3400 Series"}, \ + {0x1002, 0x95CC, CHIP_RV620|RADEON_NEW_MEMMAP, "ATI FirePro V3700"}, \ + {0x1002, 0x95CD, CHIP_RV620|RADEON_NEW_MEMMAP, "ATI FireMV 2450"}, \ + {0x1002, 0x95CE, CHIP_RV620|RADEON_NEW_MEMMAP, "ATI FireMV 2260"}, \ + {0x1002, 0x95CF, CHIP_RV620|RADEON_NEW_MEMMAP, "ATI FireMV 2260"}, \ + {0x1002, 0x9590, CHIP_RV635|RADEON_NEW_MEMMAP, "ATI ATI Radeon HD 3600 Series"}, \ + {0x1002, 0x9596, CHIP_RV635|RADEON_NEW_MEMMAP, "ATI ATI Radeon HD 3650 AGP"}, \ + {0x1002, 0x9597, CHIP_RV635|RADEON_NEW_MEMMAP, "ATI ATI Radeon HD 3600 PRO"}, \ + {0x1002, 0x9598, CHIP_RV635|RADEON_NEW_MEMMAP, "ATI ATI Radeon HD 3600 XT"}, \ + {0x1002, 0x9599, CHIP_RV635|RADEON_NEW_MEMMAP, "ATI ATI Radeon HD 3600 PRO"}, \ + {0x1002, 0x9591, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 3650"}, \ + {0x1002, 0x9593, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 3670"}, \ + {0x1002, 0x9595, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility FireGL V5700"}, \ + {0x1002, 0x959B, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility FireGL V5725"}, \ + {0x1002, 0x9610, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon HD 3200 Graphics"}, \ + {0x1002, 0x9611, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3100 Graphics"}, \ + {0x1002, 0x9612, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon HD 3200 Graphics"}, \ + {0x1002, 0x9613, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3100 Graphics"}, \ + {0x1002, 0x9614, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP, "ATI Radeon 3300 Graphics"}, \ + {0x1002, 0x9440, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ + {0x1002, 0x9441, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4870 X2"}, \ + {0x1002, 0x9442, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ + {0x1002, 0x944C, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ + {0x1002, 0x9450, CHIP_RV770|RADEON_NEW_MEMMAP, "AMD FireStream 9270"}, \ + {0x1002, 0x9452, CHIP_RV770|RADEON_NEW_MEMMAP, "AMD FireStream 9250"}, \ + {0x1002, 0x9444, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI FirePro V8750 (FireGL)"}, \ + {0x1002, 0x9446, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI FirePro V7760 (FireGL)"}, \ + {0x1002, 0x9456, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI FirePro V8700 (FireGL)"}, \ + {0x1002, 0x944E, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI FirePro RV770"}, \ + {0x1002, 0x944A, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4850"}, \ + {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, 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"}, \ + {0x1002, 0x947B, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI M98"}, \ + {0x1002, 0x9487, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI Radeon RV730 (AGP)"}, \ + {0x1002, 0x948F, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI Radeon RV730 (AGP)"}, \ + {0x1002, 0x9490, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI Radeon HD 4670"}, \ + {0x1002, 0x9498, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI Radeon HD 4650"}, \ + {0x1002, 0x9480, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4650"}, \ + {0x1002, 0x9488, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4670"}, \ + {0x1002, 0x9489, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI FirePro M5750"}, \ + {0x1002, 0x9491, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI RADEON E4600"}, \ + {0x1002, 0x949C, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI FirePro V7750 (FireGL)"}, \ + {0x1002, 0x949E, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI FirePro V5700 (FireGL)"}, \ + {0x1002, 0x949F, CHIP_RV730|RADEON_NEW_MEMMAP, "ATI FirePro V3750 (FireGL)"}, \ + {0x1002, 0x9540, CHIP_RV710|RADEON_NEW_MEMMAP, "ATI Radeon HD 4550"}, \ + {0x1002, 0x9541, CHIP_RV710|RADEON_NEW_MEMMAP, "ATI Radeon RV710"}, \ + {0x1002, 0x9542, CHIP_RV710|RADEON_NEW_MEMMAP, "ATI Radeon RV710"}, \ + {0x1002, 0x954E, CHIP_RV710|RADEON_NEW_MEMMAP, "ATI Radeon RV710"}, \ + {0x1002, 0x954F, CHIP_RV710|RADEON_NEW_MEMMAP, "ATI Radeon HD 4350"}, \ + {0x1002, 0x9552, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon 4300 Series"}, \ + {0x1002, 0x9553, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon 4500 Series"}, \ + {0x1002, 0x9555, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon 4500 Series"}, \ {0, 0, 0, NULL} #define r128_PCI_IDS \ Copied and modified: stable/7/sys/dev/drm/r600_cp.c (from r189499, head/sys/dev/drm/r600_cp.c) ============================================================================== --- head/sys/dev/drm/r600_cp.c Sat Mar 7 21:36:57 2009 (r189499, copy source) +++ stable/7/sys/dev/drm/r600_cp.c Sun Mar 15 17:20:28 2009 (r189855) @@ -1633,6 +1633,7 @@ static void r600_cp_init_ring_buffer(str struct drm_file *file_priv) { u32 ring_start; + u64 rptr_addr; if (((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RV770)) r700_gfx_init(dev, dev_priv); @@ -1687,27 +1688,20 @@ static void r600_cp_init_ring_buffer(str #if __OS_HAS_AGP if (dev_priv->flags & RADEON_IS_AGP) { - /* XXX */ - RADEON_WRITE(R600_CP_RB_RPTR_ADDR, - (dev_priv->ring_rptr->offset - - dev->agp->base + dev_priv->gart_vm_start) >> 8); - RADEON_WRITE(R600_CP_RB_RPTR_ADDR_HI, 0); + rptr_addr = dev_priv->ring_rptr->offset + - dev->agp->base + + dev_priv->gart_vm_start; } else #endif { - struct drm_sg_mem *entry = dev->sg; - unsigned long tmp_ofs, page_ofs; - - tmp_ofs = dev_priv->ring_rptr->offset - - (unsigned long)dev->sg->virtual; - page_ofs = tmp_ofs >> PAGE_SHIFT; - - RADEON_WRITE(R600_CP_RB_RPTR_ADDR, entry->busaddr[page_ofs] >> 8); - RADEON_WRITE(R600_CP_RB_RPTR_ADDR_HI, 0); - DRM_DEBUG("ring rptr: offset=0x%08lx handle=0x%08lx\n", - (unsigned long)entry->busaddr[page_ofs], - entry->handle + tmp_ofs); - } + rptr_addr = dev_priv->ring_rptr->offset + - ((unsigned long) dev->sg->virtual) + + dev_priv->gart_vm_start; + } + RADEON_WRITE(R600_CP_RB_RPTR_ADDR, + rptr_addr & 0xffffffff); + RADEON_WRITE(R600_CP_RB_RPTR_ADDR_HI, + upper_32_bits(rptr_addr)); #ifdef __BIG_ENDIAN RADEON_WRITE(R600_CP_RB_CNTL, @@ -1756,8 +1750,17 @@ static void r600_cp_init_ring_buffer(str * We simply put this behind the ring read pointer, this works * with PCI GART as well as (whatever kind of) AGP GART */ - RADEON_WRITE(R600_SCRATCH_ADDR, ((RADEON_READ(R600_CP_RB_RPTR_ADDR) << 8) - + R600_SCRATCH_REG_OFFSET) >> 8); + { + u64 scratch_addr; + + scratch_addr = RADEON_READ(R600_CP_RB_RPTR_ADDR); + scratch_addr |= ((u64)RADEON_READ(R600_CP_RB_RPTR_ADDR_HI)) << 32; + scratch_addr += R600_SCRATCH_REG_OFFSET; + scratch_addr >>= 8; + scratch_addr &= 0xffffffff; + + RADEON_WRITE(R600_SCRATCH_ADDR, (uint32_t)scratch_addr); + } RADEON_WRITE(R600_SCRATCH_UMSK, 0x7); Copied: stable/7/sys/dev/drm/r600_microcode.h (from r189499, head/sys/dev/drm/r600_microcode.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/dev/drm/r600_microcode.h Sun Mar 15 17:20:28 2009 (r189855, copy of r189499, head/sys/dev/drm/r600_microcode.h) @@ -0,0 +1,23295 @@ +/*- + * Copyright 2007 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +static const int ME_JUMP_TABLE_START = 1764; +static const int ME_JUMP_TABLE_END = 1792; + +#define PFP_UCODE_SIZE 576 +#define PM4_UCODE_SIZE 1792 +#define R700_PFP_UCODE_SIZE 848 +#define R700_PM4_UCODE_SIZE 1360 + +static const u32 R600_cp_microcode[][3]={ + { 0x00000000, 0xc0200400, 0x000 }, + { 0x00000000, 0x00a0000a, 0x000 }, + { 0x0000ffff, 0x00284621, 0x000 }, + { 0x00000000, 0xd9004800, 0x000 }, + { 0x00000000, 0xc0200400, 0x000 }, + { 0x00000000, 0x00a0000a, 0x000 }, + { 0x00000000, 0x00e00000, 0x000 }, + { 0x00010000, 0xc0294620, 0x000 }, + { 0x00000000, 0xd9004800, 0x000 }, + { 0x00000000, 0xc0200400, 0x000 }, + { 0x00000000, 0x00a0000a, 0x000 }, + { 0x81000000, 0x00204411, 0x000 }, + { 0x00000001, 0x00204811, 0x000 }, + { 0x00042004, 0x00604411, 0x614 }, + { 0x00000000, 0x00600000, 0x5b2 }, + { 0x00000000, 0x00600000, 0x5c5 }, + { 0x00000000, 0xc0200800, 0x000 }, + { 0x00000f00, 0x00281622, 0x000 }, + { 0x00000008, 0x00211625, 0x000 }, + { 0x00000020, 0x00203625, 0x000 }, + { 0x8d000000, 0x00204411, 0x000 }, + { 0x00000004, 0x002f0225, 0x000 }, + { 0x00000000, 0x0ce00000, 0x018 }, + { 0x00412000, 0x00404811, 0x019 }, + { 0x00422000, 0x00204811, 0x000 }, + { 0x8e000000, 0x00204411, 0x000 }, + { 0x00000031, 0x00204a2d, 0x000 }, + { 0x90000000, 0x00204411, 0x000 }, + { 0x00000000, 0x00204805, 0x000 }, + { 0x0000000c, 0x00211622, 0x000 }, + { 0x00000003, 0x00281625, 0x000 }, + { 0x00000019, 0x00211a22, 0x000 }, + { 0x00000004, 0x00281a26, 0x000 }, + { 0x00000000, 0x002914c5, 0x000 }, + { 0x00000021, 0x00203625, 0x000 }, + { 0x00000000, 0x003a1402, 0x000 }, + { 0x00000016, 0x00211625, 0x000 }, + { 0x00000003, 0x00281625, 0x000 }, + { 0x0000001d, 0x00200e2d, 0x000 }, + { 0xfffffffc, 0x00280e23, 0x000 }, + { 0x00000000, 0x002914a3, 0x000 }, + { 0x0000001d, 0x00203625, 0x000 }, + { 0x00008000, 0x00280e22, 0x000 }, + { 0x00000007, 0x00220e23, 0x000 }, + { 0x00000000, 0x0029386e, 0x000 }, + { 0x20000000, 0x00280e22, 0x000 }, + { 0x00000006, 0x00210e23, 0x000 }, + { 0x00000000, 0x0029386e, 0x000 }, + { 0x00000000, 0x00220222, 0x000 }, + { 0x00000000, 0x14e00000, 0x038 }, + { 0x00000000, 0x2ee00000, 0x035 }, + { 0x00000000, 0x2ce00000, 0x037 }, + { 0x00000000, 0x00400e2d, 0x039 }, + { 0x00000008, 0x00200e2d, 0x000 }, + { 0x00000009, 0x0040122d, 0x046 }, + { 0x00000001, 0x00400e2d, 0x039 }, + { 0x00000000, 0xc0200c00, 0x000 }, + { 0x003ffffc, 0x00281223, 0x000 }, + { 0x00000002, 0x00221224, 0x000 }, + { 0x0000001f, 0x00211e23, 0x000 }, + { 0x00000000, 0x14e00000, 0x03e }, + { 0x00000008, 0x00401c11, 0x041 }, + { 0x0000000d, 0x00201e2d, 0x000 }, + { 0x0000000f, 0x00281e27, 0x000 }, + { 0x00000003, 0x00221e27, 0x000 }, + { 0x7fc00000, 0x00281a23, 0x000 }, + { 0x00000014, 0x00211a26, 0x000 }, + { 0x00000001, 0x00331a26, 0x000 }, + { 0x00000008, 0x00221a26, 0x000 }, + { 0x00000000, 0x00290cc7, 0x000 }, + { 0x00000030, 0x00203624, 0x000 }, + { 0x00007f00, 0x00281221, 0x000 }, + { 0x00001400, 0x002f0224, 0x000 }, + { 0x00000000, 0x0ce00000, 0x04b }, + { 0x00000001, 0x00290e23, 0x000 }, + { 0x00000010, 0x00203623, 0x000 }, + { 0x0000e000, 0x00204411, 0x000 }, + { 0xfff80000, 0x00294a23, 0x000 }, + { 0x00000000, 0x003a2c02, 0x000 }, + { 0x00000002, 0x00220e2b, 0x000 }, + { 0xfc000000, 0x00280e23, 0x000 }, + { 0x00000011, 0x00203623, 0x000 }, + { 0x00001fff, 0x00294a23, 0x000 }, + { 0x00000030, 0x00204a2d, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000032, 0x00200e2d, 0x000 }, + { 0x060a0200, 0x00294a23, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000001, 0x00210222, 0x000 }, + { 0x00000000, 0x14e00000, 0x061 }, + { 0x00000000, 0x2ee00000, 0x05f }, + { 0x00000000, 0x2ce00000, 0x05e }, + { 0x00000000, 0x00400e2d, 0x062 }, + { 0x00000001, 0x00400e2d, 0x062 }, + { 0x0000000a, 0x00200e2d, 0x000 }, + { 0x0000000b, 0x0040122d, 0x06a }, + { 0x00000000, 0xc0200c00, 0x000 }, + { 0x003ffffc, 0x00281223, 0x000 }, + { 0x00000002, 0x00221224, 0x000 }, + { 0x7fc00000, 0x00281623, 0x000 }, + { 0x00000014, 0x00211625, 0x000 }, + { 0x00000001, 0x00331625, 0x000 }, + { 0x80000000, 0x00280e23, 0x000 }, + { 0x00000000, 0x00290ca3, 0x000 }, + { 0x3ffffc00, 0x00290e23, 0x000 }, + { 0x0000001f, 0x00211e23, 0x000 }, + { 0x00000000, 0x14e00000, 0x06d }, + { 0x00000100, 0x00401c11, 0x070 }, + { 0x0000000d, 0x00201e2d, 0x000 }, + { 0x000000f0, 0x00281e27, 0x000 }, + { 0x00000004, 0x00221e27, 0x000 }, + { 0x81000000, 0x00204411, 0x000 }, + { 0x0000000d, 0x00204811, 0x000 }, + { 0xfffff0ff, 0x00281a30, 0x000 }, + { 0x0000a028, 0x00204411, 0x000 }, + { 0x00000000, 0x002948e6, 0x000 }, + { 0x0000a018, 0x00204411, 0x000 }, + { 0x3fffffff, 0x00284a23, 0x000 }, + { 0x0000a010, 0x00204411, 0x000 }, + { 0x00000000, 0x00204804, 0x000 }, + { 0x0000002d, 0x0020162d, 0x000 }, + { 0x00000000, 0x002f00a3, 0x000 }, + { 0x00000000, 0x0cc00000, 0x080 }, + { 0x0000002e, 0x0020162d, 0x000 }, + { 0x00000000, 0x002f00a4, 0x000 }, + { 0x00000000, 0x0cc00000, 0x081 }, + { 0x00000000, 0x00400000, 0x087 }, + { 0x0000002d, 0x00203623, 0x000 }, + { 0x0000002e, 0x00203624, 0x000 }, + { 0x0000001d, 0x00201e2d, 0x000 }, + { 0x00000002, 0x00210227, 0x000 }, + { 0x00000000, 0x14e00000, 0x087 }, + { 0x00000000, 0x00600000, 0x5ed }, + { 0x00000000, 0x00600000, 0x5e1 }, + { 0x00000002, 0x00210e22, 0x000 }, + { 0x00000000, 0x14c00000, 0x08a }, + { 0x00000018, 0xc0403620, 0x090 }, + { 0x00000000, 0x2ee00000, 0x08e }, + { 0x00000000, 0x2ce00000, 0x08d }, + { 0x00000002, 0x00400e2d, 0x08f }, + { 0x00000003, 0x00400e2d, 0x08f }, + { 0x0000000c, 0x00200e2d, 0x000 }, + { 0x00000018, 0x00203623, 0x000 }, + { 0x00000003, 0x00210e22, 0x000 }, + { 0x00000000, 0x14c00000, 0x095 }, + { 0x0000a00c, 0x00204411, 0x000 }, + { 0x00000000, 0xc0204800, 0x000 }, + { 0x00000000, 0xc0404800, 0x09d }, + { 0x0000a00c, 0x00204411, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000000, 0x2ee00000, 0x09b }, + { 0x00000000, 0x2ce00000, 0x09a }, + { 0x00000002, 0x00400e2d, 0x09c }, + { 0x00000003, 0x00400e2d, 0x09c }, + { 0x0000000c, 0x00200e2d, 0x000 }, + { 0x00000000, 0x00204803, 0x000 }, + { 0x00000000, 0x003a0c02, 0x000 }, + { 0x003f0000, 0x00280e23, 0x000 }, + { 0x00000010, 0x00210e23, 0x000 }, + { 0x00000013, 0x00203623, 0x000 }, + { 0x0000001e, 0x0021022b, 0x000 }, + { 0x00000000, 0x14c00000, 0x0a4 }, + { 0x0000001c, 0xc0203620, 0x000 }, + { 0x0000001f, 0x0021022b, 0x000 }, + { 0x00000000, 0x14c00000, 0x0a7 }, + { 0x0000001b, 0xc0203620, 0x000 }, + { 0x00000008, 0x00210e2b, 0x000 }, + { 0x0000007f, 0x00280e23, 0x000 }, + { 0x00000000, 0x002f0223, 0x000 }, + { 0x00000000, 0x0ce00000, 0x0db }, + { 0x00000000, 0x27000000, 0x000 }, + { 0x00000000, 0x00600000, 0x28c }, + { 0x81000000, 0x00204411, 0x000 }, + { 0x00000006, 0x00204811, 0x000 }, + { 0x0000000c, 0x00221e30, 0x000 }, + { 0x99800000, 0x00204411, 0x000 }, + { 0x00000004, 0x0020122d, 0x000 }, + { 0x00000008, 0x00221224, 0x000 }, + { 0x00000010, 0x00201811, 0x000 }, + { 0x00000000, 0x00291ce4, 0x000 }, + { 0x00000000, 0x00604807, 0x128 }, + { 0x9b000000, 0x00204411, 0x000 }, + { 0x00000000, 0x00204802, 0x000 }, + { 0x9c000000, 0x00204411, 0x000 }, + { 0x00000000, 0x0033146f, 0x000 }, + { 0x00000001, 0x00333e23, 0x000 }, + { 0x00000000, 0xd9004800, 0x000 }, + { 0x00000000, 0x00203c05, 0x000 }, + { 0x81000000, 0x00204411, 0x000 }, + { 0x0000000e, 0x00204811, 0x000 }, + { 0x00000000, 0x00201010, 0x000 }, + { 0x0000e007, 0x00204411, 0x000 }, + { 0x0000000f, 0x0021022b, 0x000 }, + { 0x00000000, 0x14c00000, 0x0c5 }, + { 0x00f8ff08, 0x00204811, 0x000 }, + { 0x98000000, 0x00404811, 0x0d6 }, + { 0x000000f0, 0x00280e22, 0x000 }, + { 0x000000a0, 0x002f0223, 0x000 }, + { 0x00000000, 0x0cc00000, 0x0d4 }, + { 0x00000013, 0x00200e2d, 0x000 }, + { 0x00000001, 0x002f0223, 0x000 }, + { 0x00000000, 0x0ce00000, 0x0cf }, + { 0x00000002, 0x002f0223, 0x000 }, + { 0x00000000, 0x0ce00000, 0x0ce }, + { 0x00003f00, 0x00400c11, 0x0d0 }, + { 0x00001f00, 0x00400c11, 0x0d0 }, + { 0x00000f00, 0x00200c11, 0x000 }, + { 0x00380009, 0x00294a23, 0x000 }, + { 0x3f000000, 0x00280e2b, 0x000 }, + { 0x00000002, 0x00220e23, 0x000 }, + { 0x00000007, 0x00494a23, 0x0d6 }, + { 0x00380f09, 0x00204811, 0x000 }, + { 0x68000007, 0x00204811, 0x000 }, + { 0x00000008, 0x00214a27, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x060a0200, 0x00294a24, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x0000a202, 0x00204411, 0x000 }, + { 0x00ff0000, 0x00284a22, 0x000 }, + { 0x00000030, 0x00200e2d, 0x000 }, + { 0x0000002e, 0x0020122d, 0x000 }, + { 0x00000000, 0x002f0083, 0x000 }, + { 0x00000000, 0x0ce00000, 0x0e3 }, + { 0x00000000, 0x00600000, 0x5e7 }, + { 0x00000000, 0x00400000, 0x0e4 }, + { 0x00000000, 0x00600000, 0x5ea }, + { 0x00000007, 0x0020222d, 0x000 }, + { 0x00000005, 0x00220e22, 0x000 }, + { 0x00100000, 0x00280e23, 0x000 }, + { 0x00000000, 0x00292068, 0x000 }, + { 0x00000000, 0x003a0c02, 0x000 }, + { 0x000000ef, 0x00280e23, 0x000 }, + { 0x00000000, 0x00292068, 0x000 }, + { 0x0000001d, 0x00200e2d, 0x000 }, + { 0x00000003, 0x00210223, 0x000 }, + { 0x00000000, 0x14e00000, 0x0f1 }, + { 0x0000000b, 0x00210228, 0x000 }, + { 0x00000000, 0x14c00000, 0x0f1 }, + { 0x00000400, 0x00292228, 0x000 }, + { 0x0000001a, 0x00203628, 0x000 }, + { 0x0000001c, 0x00210e22, 0x000 }, + { 0x00000000, 0x14c00000, 0x0f6 }, + { 0x0000a30c, 0x00204411, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x0000001e, 0x00210e22, 0x000 }, + { 0x00000000, 0x14c00000, 0x104 }, + { 0x0000a30f, 0x00204411, 0x000 }, + { 0x00000013, 0x00200e2d, 0x000 }, + { 0x00000001, 0x002f0223, 0x000 }, + { 0x00000000, 0x0cc00000, 0x0fd }, + { 0xffffffff, 0x00404811, 0x104 }, + { 0x00000002, 0x002f0223, 0x000 }, + { 0x00000000, 0x0cc00000, 0x100 }, + { 0x0000ffff, 0x00404811, 0x104 }, + { 0x00000004, 0x002f0223, 0x000 }, + { 0x00000000, 0x0cc00000, 0x103 }, + { 0x000000ff, 0x00404811, 0x104 }, + { 0x00000001, 0x00204811, 0x000 }, + { 0x0002c400, 0x00204411, 0x000 }, + { 0x0000001f, 0x00210e22, 0x000 }, + { 0x00000000, 0x14c00000, 0x10b }, + { 0x00000010, 0x40210e20, 0x000 }, + { 0x00000019, 0x00203623, 0x000 }, + { 0x00000018, 0x40224a20, 0x000 }, + { 0x00000010, 0xc0424a20, 0x10d }, + { 0x00000000, 0x00200c11, 0x000 }, + { 0x00000019, 0x00203623, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x0000000a, 0x00201011, 0x000 }, + { 0x00000000, 0x002f0224, 0x000 }, + { 0x00000000, 0x0ce00000, 0x114 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000001, 0x00531224, 0x110 }, + { 0xffbfffff, 0x00283a2e, 0x000 }, + { 0x0000001b, 0x00210222, 0x000 }, + { 0x00000000, 0x14c00000, 0x127 }, + { 0x81000000, 0x00204411, 0x000 }, + { 0x0000000d, 0x00204811, 0x000 }, + { 0x00000018, 0x00220e30, 0x000 }, + { 0xfc000000, 0x00280e23, 0x000 }, + { 0x81000000, 0x00204411, 0x000 }, + { 0x0000000e, 0x00204811, 0x000 }, + { 0x00000000, 0x00201010, 0x000 }, + { 0x0000e00e, 0x00204411, 0x000 }, + { 0x07f8ff08, 0x00204811, 0x000 }, + { 0x00000000, 0x00294a23, 0x000 }, + { 0x00000024, 0x00201e2d, 0x000 }, + { 0x00000008, 0x00214a27, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x060a0200, 0x00294a24, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000000, 0x00800000, 0x000 }, + { 0x81000000, 0x00204411, 0x000 }, + { 0x00000001, 0x00204811, 0x000 }, + { 0x0000217c, 0x00204411, 0x000 }, + { 0x00800000, 0x00204811, 0x000 }, + { 0x00000000, 0x00204806, 0x000 }, + { 0x00000008, 0x00214a27, 0x000 }, + { 0x00000000, 0x17000000, 0x000 }, + { 0x0004217f, 0x00604411, 0x614 }, + { 0x0000001f, 0x00210230, 0x000 }, + { 0x00000000, 0x14c00000, 0x613 }, + { 0x00000004, 0x00404c11, 0x12e }, + { 0x00000000, 0x00600000, 0x00b }, + { 0x00000000, 0x00600411, 0x2fe }, + { 0x00000000, 0x00200411, 0x000 }, + { 0x00000000, 0x00600811, 0x19f }, + { 0x00000000, 0x00600000, 0x151 }, + { 0x0000ffff, 0x40280e20, 0x000 }, + { 0x00000010, 0xc0211220, 0x000 }, + { 0x0000ffff, 0x40280620, 0x000 }, + { 0x00000010, 0xc0210a20, 0x000 }, + { 0x00000000, 0x00341461, 0x000 }, + { 0x00000000, 0x00741882, 0x2a4 }, + { 0x0001a1fd, 0x00604411, 0x2c9 }, + { 0x00003fff, 0x002f022f, 0x000 }, + { 0x00000000, 0x0cc00000, 0x138 }, + { 0x00000000, 0xc0400400, 0x001 }, + { 0x00000000, 0x00600000, 0x00b }, + { 0x00000000, 0x00600411, 0x2fe }, + { 0x00000000, 0x00200411, 0x000 }, + { 0x00000000, 0x00600811, 0x19f }, + { 0x00003fff, 0x002f022f, 0x000 }, + { 0x00000000, 0x0ce00000, 0x000 }, + { 0x00000000, 0x00600000, 0x151 }, + { 0x00000010, 0x40210e20, 0x000 }, + { 0x0000ffff, 0xc0281220, 0x000 }, + { 0x00000010, 0x40211620, 0x000 }, + { 0x0000ffff, 0xc0681a20, 0x2a4 }, + { 0x0001a1fd, 0x00604411, 0x2c9 }, + { 0x00003fff, 0x002f022f, 0x000 }, + { 0x00000000, 0x0cc00000, 0x149 }, + { 0x00000000, 0xc0400400, 0x001 }, + { 0x0000225c, 0x00204411, 0x000 }, + { 0x00000001, 0x00300a2f, 0x000 }, + { 0x00000001, 0x00210a22, 0x000 }, + { 0x00000003, 0x00384a22, 0x000 }, + { 0x00002256, 0x00204411, 0x000 }, + { 0x0000001a, 0x00204811, 0x000 }, + { 0x0000a1fc, 0x00204411, 0x000 }, + { 0x00000001, 0x00804811, 0x000 }, + { 0x00000000, 0x00600000, 0x00b }, + { 0x00000000, 0x00600000, 0x17c }, + { 0x00000000, 0x00600000, 0x18d }, + { 0x00003fff, 0x002f022f, 0x000 }, + { 0x00000000, 0x0ce00000, 0x000 }, + { 0x00000000, 0x00202c08, 0x000 }, + { 0x00000000, 0x00202411, 0x000 }, + { 0x00000000, 0x00202811, 0x000 }, + { 0x00002256, 0x00204411, 0x000 }, + { 0x00000016, 0x00204811, 0x000 }, + { 0x0000225c, 0x00204411, 0x000 }, + { 0x00000003, 0x00204811, 0x000 }, + { 0x93800000, 0x00204411, 0x000 }, + { 0x00000002, 0x00221e29, 0x000 }, + { 0x00000000, 0x007048eb, 0x189 }, + { 0x00000000, 0x00600000, 0x2a4 }, + { 0x00000001, 0x40330620, 0x000 }, + { 0x00000000, 0xc0302409, 0x000 }, + { 0x00003fff, 0x002f022f, 0x000 }, + { 0x00000000, 0x0ce00000, 0x000 }, + { 0x00000000, 0x00600000, 0x28c }, + { 0x95000000, 0x00204411, 0x000 }, + { 0x00000000, 0x002f0221, 0x000 }, + { 0x00000000, 0x0ce00000, 0x173 }, + { 0x00000000, 0xc0204800, 0x000 }, + { 0x00000001, 0x00530621, 0x16f }, + { 0x92000000, 0x00204411, 0x000 }, + { 0x00000000, 0xc0604800, 0x184 }, + { 0x0001a1fd, 0x00204411, 0x000 }, + { 0x00000013, 0x0020062d, 0x000 }, + { 0x00000000, 0x0078042a, 0x2e4 }, + { 0x00000000, 0x00202809, 0x000 }, + { 0x00003fff, 0x002f022f, 0x000 }, + { 0x00000000, 0x0cc00000, 0x165 }, + { 0x00000000, 0xc0400400, 0x001 }, + { 0x00000210, 0x00600411, 0x2fe }, + { 0x00003fff, 0x002f022f, 0x000 }, + { 0x00000000, 0x0ce00000, 0x181 }, + { 0x0000001b, 0xc0203620, 0x000 }, + { 0x0000001c, 0xc0203620, 0x000 }, + { 0x3f800000, 0x00200411, 0x000 }, + { 0x46000000, 0x00600811, 0x19f }, + { 0x00000000, 0x00800000, 0x000 }, + { 0x0000a1fc, 0x00204411, 0x000 }, + { 0x00003fff, 0x002f022f, 0x000 }, + { 0x00000000, 0x0cc00000, 0x188 }, + { 0x00000001, 0x00804811, 0x000 }, + { 0x00000021, 0x00804811, 0x000 }, + { 0x0000ffff, 0x40280e20, 0x000 }, + { 0x00000010, 0xc0211220, 0x000 }, + { 0x0000ffff, 0x40281620, 0x000 }, + { 0x00000010, 0xc0811a20, 0x000 }, + { 0x81000000, 0x00204411, 0x000 }, + { 0x00000006, 0x00204811, 0x000 }, + { 0x00000008, 0x00221e30, 0x000 }, + { 0x00000032, 0x00201a2d, 0x000 }, + { 0x0000e000, 0x00204411, 0x000 }, + { 0xfffbff09, 0x00204811, 0x000 }, + { 0x00000011, 0x0020222d, 0x000 }, + { 0x00001fff, 0x00294a28, 0x000 }, + { 0x00000006, 0x0020222d, 0x000 }, + { 0x00000000, 0x002920e8, 0x000 }, + { 0x00000000, 0x00204808, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x060a0200, 0x00294a26, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000100, 0x00201811, 0x000 }, + { 0x00000008, 0x00621e28, 0x128 }, + { 0x00000008, 0x00822228, 0x000 }, + { 0x0002c000, 0x00204411, 0x000 }, + { 0x0000001b, 0x00600e2d, 0x1aa }, + { 0x0000001c, 0x00600e2d, 0x1aa }, + { 0x0000c008, 0x00204411, 0x000 }, + { 0x0000001d, 0x00200e2d, 0x000 }, + { 0x00000000, 0x14c00000, 0x1a6 }, + { 0x00000000, 0x00200411, 0x000 }, + { 0x00000000, 0x00204801, 0x000 }, + { 0x39000000, 0x00204811, 0x000 }, + { 0x00000000, 0x00204811, 0x000 }, + { 0x00000000, 0x00804802, 0x000 }, + { 0x00000020, 0x00202e2d, 0x000 }, + { 0x00000000, 0x003b0d63, 0x000 }, + { 0x00000008, 0x00224a23, 0x000 }, + { 0x00000010, 0x00224a23, 0x000 }, + { 0x00000018, 0x00224a23, 0x000 }, + { 0x00000000, 0x00804803, 0x000 }, + { 0x00000000, 0x00600000, 0x00b }, + { 0x00001000, 0x00600411, 0x2fe }, + { 0x00000000, 0x00200411, 0x000 }, + { 0x00000000, 0x00600811, 0x19f }, + { 0x00000007, 0x0021062f, 0x000 }, + { 0x00000019, 0x00200a2d, 0x000 }, + { 0x00000001, 0x00202c11, 0x000 }, + { 0x0000ffff, 0x40282220, 0x000 }, + { 0x0000000f, 0x00262228, 0x000 }, + { 0x00000010, 0x40212620, 0x000 }, + { 0x0000000f, 0x00262629, 0x000 }, + { 0x00000000, 0x00202802, 0x000 }, + { 0x00002256, 0x00204411, 0x000 }, + { 0x0000001b, 0x00204811, 0x000 }, + { 0x00000000, 0x002f0221, 0x000 }, + { 0x00000000, 0x0ce00000, 0x1cd }, + { 0x0000225c, 0x00204411, 0x000 }, + { 0x00000081, 0x00204811, 0x000 }, + { 0x0000a1fc, 0x00204411, 0x000 }, + { 0x00000001, 0x00204811, 0x000 }, + { 0x00000080, 0x00201c11, 0x000 }, + { 0x00000000, 0x002f0227, 0x000 }, + { 0x00000000, 0x0ce00000, 0x1c9 }, + { 0x00000000, 0x00600000, 0x1d6 }, + { 0x00000001, 0x00531e27, 0x1c5 }, + { 0x00000001, 0x00202c11, 0x000 }, + { 0x0000001f, 0x00280a22, 0x000 }, + { 0x0000001f, 0x00282a2a, 0x000 }, + { 0x00000001, 0x00530621, 0x1be }, + { 0x0000225c, 0x00204411, 0x000 }, + { 0x00000002, 0x00304a2f, 0x000 }, + { 0x0000a1fc, 0x00204411, 0x000 }, + { 0x00000001, 0x00204811, 0x000 }, + { 0x00000001, 0x00301e2f, 0x000 }, + { 0x00000000, 0x002f0227, 0x000 }, + { 0x00000000, 0x0ce00000, 0x000 }, + { 0x00000000, 0x00600000, 0x1d6 }, + { 0x00000001, 0x00531e27, 0x1d2 }, + { 0x0000ffff, 0x40280e20, 0x000 }, + { 0x0000000f, 0x00260e23, 0x000 }, + { 0x00000010, 0xc0211220, 0x000 }, + { 0x0000000f, 0x00261224, 0x000 }, + { 0x00000000, 0x00201411, 0x000 }, + { 0x00000000, 0x00601811, 0x2a4 }, + { 0x0001a1fd, 0x00204411, 0x000 }, + { 0x00000000, 0x002f022b, 0x000 }, + { 0x00000000, 0x0ce00000, 0x1e5 }, + { 0x00000010, 0x00221628, 0x000 }, + { 0xffff0000, 0x00281625, 0x000 }, + { 0x0000ffff, 0x00281a29, 0x000 }, + { 0x00000000, 0x002948c5, 0x000 }, + { 0x00000000, 0x0020480a, 0x000 }, + { 0x00000000, 0x00202c11, 0x000 }, + { 0x00000010, 0x00221623, 0x000 }, + { 0xffff0000, 0x00281625, 0x000 }, + { 0x0000ffff, 0x00281a24, 0x000 }, + { 0x00000000, 0x002948c5, 0x000 }, + { 0x00000000, 0x00731503, 0x1f2 }, + { 0x00000000, 0x00201805, 0x000 }, + { 0x00000000, 0x00731524, 0x1f2 }, + { 0x00000000, 0x002d14c5, 0x000 }, + { 0x00000000, 0x003008a2, 0x000 }, + { 0x00000000, 0x00204802, 0x000 }, + { 0x00000000, 0x00202802, 0x000 }, + { 0x00000000, 0x00202003, 0x000 }, + { 0x00000000, 0x00802404, 0x000 }, + { 0x0000000f, 0x00210225, 0x000 }, + { 0x00000000, 0x14c00000, 0x613 }, + { 0x00000000, 0x002b1405, 0x000 }, + { 0x00000001, 0x00901625, 0x000 }, + { 0x00000000, 0x00600000, 0x00b }, + { 0x00000000, 0x00600411, 0x2fe }, + { 0x00000000, 0x00200411, 0x000 }, + { 0x00000000, 0x00600811, 0x19f }, + { 0x00002256, 0x00204411, 0x000 }, + { 0x0000001a, 0x00294a22, 0x000 }, + { 0x00000000, 0xc0200000, 0x000 }, + { 0x00003fff, 0x002f022f, 0x000 }, + { 0x00000000, 0x0ce00000, 0x000 }, + { 0x00000000, 0xc0200400, 0x000 }, + { 0x0000225c, 0x00204411, 0x000 }, + { 0x00000003, 0x00384a21, 0x000 }, + { 0x0000a1fc, 0x00204411, 0x000 }, + { 0x00000001, 0x00204811, 0x000 }, + { 0x0000ffff, 0x40281220, 0x000 }, + { 0x00000010, 0xc0211a20, 0x000 }, + { 0x0000ffff, 0x40280e20, 0x000 }, + { 0x00000010, 0xc0211620, 0x000 }, + { 0x00000000, 0x00741465, 0x2a4 }, + { 0x0001a1fd, 0x00604411, 0x2c9 }, + { 0x00000001, 0x00330621, 0x000 }, + { 0x00000000, 0x002f0221, 0x000 }, + { 0x00000000, 0x0cc00000, 0x206 }, + { 0x00003fff, 0x002f022f, 0x000 }, + { 0x00000000, 0x0cc00000, 0x1ff }, + { 0x00000000, 0xc0400400, 0x001 }, + { 0x00000000, 0x00600000, 0x5c5 }, + { 0x00000000, 0x0040040f, 0x200 }, + { 0x00000000, 0x00600000, 0x5b2 }, + { 0x00000000, 0x00600000, 0x5c5 }, + { 0x00000210, 0x00600411, 0x2fe }, + { 0x00000000, 0x00600000, 0x18d }, + { 0x00000000, 0x00600000, 0x189 }, + { 0x00000000, 0x00600000, 0x2a4 }, + { 0x00000000, 0x00600000, 0x28c }, + { 0x93800000, 0x00204411, 0x000 }, + { 0x00000000, 0x00204808, 0x000 }, + { 0x95000000, 0x00204411, 0x000 }, + { 0x00000000, 0x002f022f, 0x000 }, + { 0x00000000, 0x0ce00000, 0x21f }, + { 0x00000000, 0xc0404800, 0x21c }, + { 0x92000000, 0x00204411, 0x000 }, + { 0x00000000, 0xc0204800, 0x000 }, + { 0x00002256, 0x00204411, 0x000 }, + { 0x00000016, 0x00204811, 0x000 }, + { 0x0000225c, 0x00204411, 0x000 }, + { 0x00000003, 0x00204811, 0x000 }, + { 0x0000a1fc, 0x00204411, 0x000 }, + { 0x00000001, 0x00204811, 0x000 }, + { 0x0001a1fd, 0x00204411, 0x000 }, + { 0x00000000, 0x00600411, 0x2e4 }, + { 0x00000000, 0xc0400400, 0x001 }, + { 0x00000000, 0x00600000, 0x5b2 }, + { 0x0000a00c, 0x00204411, 0x000 }, + { 0x00000000, 0xc0204800, 0x000 }, + { 0x00000000, 0xc0404800, 0x000 }, + { 0x00000000, 0x00600000, 0x00b }, + { 0x00000018, 0x40210a20, 0x000 }, + { 0x00000003, 0x002f0222, 0x000 }, + { 0x00000000, 0x0ae00000, 0x235 }, + { 0x0000001a, 0x0020222d, 0x000 }, + { 0x00080101, 0x00292228, 0x000 }, + { 0x0000001a, 0x00203628, 0x000 }, + { 0x0000a30c, 0x00204411, 0x000 }, + { 0x00000000, 0xc0204800, 0x000 }, + { 0x00000000, 0xc0204800, 0x000 }, + { 0x00000000, 0xc0404800, 0x23a }, + { 0x00000000, 0x00600000, 0x00b }, + { 0x00000010, 0x00600411, 0x2fe }, + { 0x3f800000, 0x00200411, 0x000 }, + { 0x00000000, 0x00600811, 0x19f }, + { 0x0000225c, 0x00204411, 0x000 }, + { 0x00000003, 0x00204811, 0x000 }, + { 0x00000000, 0x00600000, 0x265 }, + { 0x0000001d, 0x00201e2d, 0x000 }, + { 0x00000001, 0x00211e27, 0x000 }, + { 0x00000000, 0x14e00000, 0x253 }, + { 0x00000018, 0x00201e2d, 0x000 }, + { 0x0000ffff, 0x00281e27, 0x000 }, + { 0x00000000, 0x00341c27, 0x000 }, + { 0x00000000, 0x12c00000, 0x248 }, + { 0x00000000, 0x00201c11, 0x000 }, + { 0x00000000, 0x002f00e5, 0x000 }, + { 0x00000000, 0x08c00000, 0x24b }, + { 0x00000000, 0x00201407, 0x000 }, + { 0x00000018, 0x00201e2d, 0x000 }, + { 0x00000010, 0x00211e27, 0x000 }, + { 0x00000000, 0x00341c47, 0x000 }, + { 0x00000000, 0x12c00000, 0x250 }, + { 0x00000000, 0x00201c11, 0x000 }, + { 0x00000000, 0x002f00e6, 0x000 }, + { 0x00000000, 0x08c00000, 0x253 }, + { 0x00000000, 0x00201807, 0x000 }, + { 0x00000000, 0x00600000, 0x2aa }, + { 0x00002256, 0x00204411, 0x000 }, + { 0x00000000, 0x00342023, 0x000 }, + { 0x00000000, 0x12c00000, 0x25b }, + { 0x00000000, 0x00342044, 0x000 }, + { 0x00000000, 0x12c00000, 0x25a }, + { 0x00000016, 0x00404811, 0x25f }, + { 0x00000018, 0x00404811, 0x25f }, + { 0x00000000, 0x00342044, 0x000 }, + { 0x00000000, 0x12c00000, 0x25e }, + { 0x00000017, 0x00404811, 0x25f }, + { 0x00000019, 0x00204811, 0x000 }, + { 0x0000a1fc, 0x00204411, 0x000 }, + { 0x00000001, 0x00204811, 0x000 }, + { 0x0001a1fd, 0x00604411, 0x2d2 }, + { 0x00003fff, 0x002f022f, 0x000 }, + { 0x00000000, 0x0cc00000, 0x23f }, + { 0x00000000, 0xc0400400, 0x001 }, + { 0x00000010, 0x40210620, 0x000 }, + { 0x0000ffff, 0xc0280a20, 0x000 }, + { 0x00000010, 0x40210e20, 0x000 }, + { 0x0000ffff, 0xc0281220, 0x000 }, + { 0x00000010, 0x40211620, 0x000 }, + { 0x0000ffff, 0xc0881a20, 0x000 }, + { 0x81000000, 0x00204411, 0x000 }, + { 0x00000001, 0x00204811, 0x000 }, + { 0x00042004, 0x00604411, 0x614 }, + { 0x00000000, 0x00600000, 0x5b2 }, + { 0x00000000, 0xc0600000, 0x28c }, + { 0x00000005, 0x00200a2d, 0x000 }, + { 0x00000008, 0x00220a22, 0x000 }, + { 0x00000034, 0x00201a2d, 0x000 }, + { 0x00000024, 0x00201e2d, 0x000 }, + { 0x00007000, 0x00281e27, 0x000 }, + { 0x00000000, 0x00311ce6, 0x000 }, + { 0x00000033, 0x00201a2d, 0x000 }, + { 0x0000000c, 0x00221a26, 0x000 }, + { 0x00000000, 0x002f00e6, 0x000 }, + { 0x00000000, 0x06e00000, 0x27b }, + { 0x00000000, 0x00201c11, 0x000 }, + { 0x00000000, 0x00200c11, 0x000 }, + { 0x00000034, 0x00203623, 0x000 }, + { 0x00000010, 0x00201811, 0x000 }, + { 0x00000000, 0x00691ce2, 0x128 }, + { 0x93800000, 0x00204411, 0x000 }, + { 0x00000000, 0x00204807, 0x000 }, + { 0x95000000, 0x00204411, 0x000 }, + { 0x00000000, 0x002f022f, 0x000 }, + { 0x00000000, 0x0ce00000, 0x286 }, + { 0x00000001, 0x00333e2f, 0x000 }, + { 0x00000000, 0xd9004800, 0x000 }, + { 0x92000000, 0x00204411, 0x000 }, + { 0x00000000, 0xc0204800, 0x000 }, + { 0x00000024, 0x00403627, 0x000 }, + { 0x0000000c, 0xc0220a20, 0x000 }, + { 0x00000032, 0x00203622, 0x000 }, + { 0x00000031, 0xc0403620, 0x000 }, + { 0x0000a2a4, 0x00204411, 0x000 }, + { 0x00000009, 0x00204811, 0x000 }, + { 0xa1000000, 0x00204411, 0x000 }, + { 0x00000001, 0x00804811, 0x000 }, + { 0x00000029, 0x00201e2d, 0x000 }, + { 0x00000000, 0x002c1ce3, 0x000 }, + { 0x00000029, 0x00203627, 0x000 }, + { 0x0000002a, 0x00201e2d, 0x000 }, + { 0x00000000, 0x002c1ce4, 0x000 }, + { 0x0000002a, 0x00203627, 0x000 }, + { 0x0000002b, 0x00201e2d, 0x000 }, + { 0x00000000, 0x003120a3, 0x000 }, + { 0x00000000, 0x002d1d07, 0x000 }, + { 0x0000002b, 0x00203627, 0x000 }, + { 0x0000002c, 0x00201e2d, 0x000 }, + { 0x00000000, 0x003120c4, 0x000 }, + { 0x00000000, 0x002d1d07, 0x000 }, + { 0x0000002c, 0x00803627, 0x000 }, + { 0x00000029, 0x00203623, 0x000 }, + { 0x0000002a, 0x00203624, 0x000 }, + { 0x00000000, 0x00311ca3, 0x000 }, + { 0x0000002b, 0x00203627, 0x000 }, + { 0x00000000, 0x00311cc4, 0x000 }, + { 0x0000002c, 0x00803627, 0x000 }, + { 0x00000022, 0x00203627, 0x000 }, + { 0x00000023, 0x00203628, 0x000 }, + { 0x0000001d, 0x00201e2d, 0x000 }, + { 0x00000002, 0x00210227, 0x000 }, + { 0x00000000, 0x14c00000, 0x2c5 }, + { 0x00000000, 0x00400000, 0x2c2 }, + { 0x00000022, 0x00203627, 0x000 }, + { 0x00000023, 0x00203628, 0x000 }, + { 0x0000001d, 0x00201e2d, 0x000 }, + { 0x00000002, 0x00210227, 0x000 }, + { 0x00000000, 0x14e00000, 0x2c2 }, + { 0x00000003, 0x00210227, 0x000 }, + { 0x00000000, 0x14e00000, 0x2c5 }, + { 0x0000002b, 0x00201e2d, 0x000 }, + { 0x00000000, 0x002e00e1, 0x000 }, + { 0x00000000, 0x02c00000, 0x2c5 }, + { 0x00000029, 0x00201e2d, 0x000 }, + { 0x00000000, 0x003120a1, 0x000 }, + { 0x00000000, 0x002e00e8, 0x000 }, + { 0x00000000, 0x06c00000, 0x2c5 }, + { 0x0000002c, 0x00201e2d, 0x000 }, + { 0x00000000, 0x002e00e2, 0x000 }, + { 0x00000000, 0x02c00000, 0x2c5 }, + { 0x0000002a, 0x00201e2d, 0x000 }, + { 0x00000000, 0x003120c2, 0x000 }, + { 0x00000000, 0x002e00e8, 0x000 }, + { 0x00000000, 0x06c00000, 0x2c5 }, + { 0x00000000, 0x00600000, 0x5ed }, + { 0x00000000, 0x00600000, 0x29e }, + { 0x00000000, 0x00400000, 0x2c7 }, + { 0x00000000, 0x00600000, 0x29e }, + { 0x00000000, 0x00600000, 0x5e4 }, + { 0x00000000, 0x00400000, 0x2c7 }, + { 0x00000000, 0x00600000, 0x290 }, + { 0x00000000, 0x00400000, 0x2c7 }, + { 0x00000022, 0x00201e2d, 0x000 }, + { 0x00000023, 0x0080222d, 0x000 }, + { 0x00000010, 0x00221e23, 0x000 }, + { 0x00000000, 0x00294887, 0x000 }, + { 0x00000000, 0x00311ca3, 0x000 }, + { 0x00000010, 0x00221e27, 0x000 }, + { 0x00000000, 0x00294887, 0x000 }, + { 0x00000010, 0x00221e23, 0x000 }, + { 0x00000000, 0x003120c4, 0x000 }, + { 0x0000ffff, 0x00282228, 0x000 }, + { 0x00000000, 0x00894907, 0x000 }, + { 0x00000010, 0x00221e23, 0x000 }, + { 0x00000000, 0x00294887, 0x000 }, + { 0x00000010, 0x00221e21, 0x000 }, + { 0x00000000, 0x00294847, 0x000 }, + { 0x00000000, 0x00311ca3, 0x000 }, + { 0x00000010, 0x00221e27, 0x000 }, + { 0x00000000, 0x00294887, 0x000 }, + { 0x00000000, 0x00311ca1, 0x000 }, + { 0x00000010, 0x00221e27, 0x000 }, + { 0x00000000, 0x00294847, 0x000 }, + { 0x00000010, 0x00221e23, 0x000 }, + { 0x00000000, 0x003120c4, 0x000 }, + { 0x0000ffff, 0x00282228, 0x000 }, + { 0x00000000, 0x00294907, 0x000 }, + { 0x00000010, 0x00221e21, 0x000 }, + { 0x00000000, 0x003120c2, 0x000 }, + { 0x0000ffff, 0x00282228, 0x000 }, + { 0x00000000, 0x00894907, 0x000 }, + { 0x00000010, 0x00221e23, 0x000 }, + { 0x00000000, 0x00294887, 0x000 }, + { 0x00000001, 0x00220a21, 0x000 }, + { 0x00000000, 0x003308a2, 0x000 }, + { 0x00000010, 0x00221e22, 0x000 }, + { 0x00000010, 0x00212222, 0x000 }, + { 0x00000000, 0x00294907, 0x000 }, + { 0x00000000, 0x00311ca3, 0x000 }, + { 0x00000010, 0x00221e27, 0x000 }, + { 0x00000000, 0x00294887, 0x000 }, + { 0x00000001, 0x00220a21, 0x000 }, + { 0x00000000, 0x003008a2, 0x000 }, + { 0x00000010, 0x00221e22, 0x000 }, + { 0x00000010, 0x00212222, 0x000 }, + { 0x00000000, 0x00294907, 0x000 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 15 17:22:53 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B3291065674; Sun, 15 Mar 2009 17:22:53 +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 57C2C8FC19; Sun, 15 Mar 2009 17:22:53 +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 n2FHMrZB034997; Sun, 15 Mar 2009 17:22:53 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FHMrHO034996; Sun, 15 Mar 2009 17:22:53 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903151722.n2FHMrHO034996@svn.freebsd.org> From: Robert Noland Date: Sun, 15 Mar 2009 17:22: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: r189856 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Sun, 15 Mar 2009 17:22:54 -0000 Author: rnoland Date: Sun Mar 15 17:22:53 2009 New Revision: 189856 URL: http://svn.freebsd.org/changeset/base/189856 Log: Merge 189559 Fix the flags to bus_dmamem_* to allow the allocation to sleep while waiting for resources. It is really the load that we can't defer. BUS_DMA_NOCACHE belongs on bus_dmamap_load() as well. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_scatter.c Modified: stable/7/sys/dev/drm/drm_scatter.c ============================================================================== --- stable/7/sys/dev/drm/drm_scatter.c Sun Mar 15 17:20:28 2009 (r189855) +++ stable/7/sys/dev/drm/drm_scatter.c Sun Mar 15 17:22:53 2009 (r189856) @@ -92,7 +92,7 @@ drm_sg_alloc(struct drm_device *dev, str } ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, - BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map); + BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map); if (ret != 0) { bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); @@ -102,7 +102,8 @@ drm_sg_alloc(struct drm_device *dev, str } ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, - request->size, drm_sg_alloc_cb, entry, 0); + request->size, drm_sg_alloc_cb, entry, + BUS_DMA_NOWAIT | BUS_DMA_NOCACHE); if (ret != 0) { bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 15 17:23:46 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EABFA10656CA; Sun, 15 Mar 2009 17:23:46 +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 D4A3F8FC0A; Sun, 15 Mar 2009 17:23:46 +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 n2FHNk2G035062; Sun, 15 Mar 2009 17:23:46 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FHNktE035061; Sun, 15 Mar 2009 17:23:46 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903151723.n2FHNktE035061@svn.freebsd.org> From: Robert Noland Date: Sun, 15 Mar 2009 17:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189857 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Sun, 15 Mar 2009 17:23:49 -0000 Author: rnoland Date: Sun Mar 15 17:23:46 2009 New Revision: 189857 URL: http://svn.freebsd.org/changeset/base/189857 Log: Merge r189560 Change the flags to bus_dmamem around to allow it to sleep waiting for resources during allocation, but not during map load. Also, zero the buffers here. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_pci.c Modified: stable/7/sys/dev/drm/drm_pci.c ============================================================================== --- stable/7/sys/dev/drm/drm_pci.c Sun Mar 15 17:22:53 2009 (r189856) +++ stable/7/sys/dev/drm/drm_pci.c Sun Mar 15 17:23:46 2009 (r189857) @@ -83,15 +83,15 @@ drm_pci_alloc(struct drm_device *dev, si maxaddr, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */ NULL, NULL, /* filtfunc, filtfuncargs */ size, 1, size, /* maxsize, nsegs, maxsegsize */ - BUS_DMA_ALLOCNOW, NULL, NULL, /* flags, lockfunc, lockfuncargs */ + 0, NULL, NULL, /* flags, lockfunc, lockfuncargs */ &dmah->tag); if (ret != 0) { free(dmah, DRM_MEM_DMA); return NULL; } - ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, BUS_DMA_NOWAIT, - &dmah->map); + ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, + BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map); if (ret != 0) { bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); @@ -99,7 +99,7 @@ drm_pci_alloc(struct drm_device *dev, si } ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, size, - drm_pci_busdma_callback, dmah, 0); + drm_pci_busdma_callback, dmah, BUS_DMA_NOWAIT); if (ret != 0) { bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 15 17:24: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 6BA8110656F8; Sun, 15 Mar 2009 17:24: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 5809E8FC1A; Sun, 15 Mar 2009 17:24: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 n2FHOmnU035135; Sun, 15 Mar 2009 17:24:48 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FHOmDf035134; Sun, 15 Mar 2009 17:24:48 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903151724.n2FHOmDf035134@svn.freebsd.org> From: Robert Noland Date: Sun, 15 Mar 2009 17:24: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: r189858 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Sun, 15 Mar 2009 17:24:50 -0000 Author: rnoland Date: Sun Mar 15 17:24:48 2009 New Revision: 189858 URL: http://svn.freebsd.org/changeset/base/189858 Log: Merge r189561 There is no need to sync these buffers to swap. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_bufs.c Modified: stable/7/sys/dev/drm/drm_bufs.c ============================================================================== --- stable/7/sys/dev/drm/drm_bufs.c Sun Mar 15 17:23:46 2009 (r189857) +++ stable/7/sys/dev/drm/drm_bufs.c Sun Mar 15 17:24:48 2009 (r189858) @@ -1052,11 +1052,12 @@ int drm_mapbufs(struct drm_device *dev, vaddr = round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ); #if __FreeBSD_version >= 600023 retcode = vm_mmap(&vms->vm_map, &vaddr, size, PROT_READ | PROT_WRITE, - VM_PROT_ALL, MAP_SHARED, OBJT_DEVICE, dev->devnode, foff); + VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE, + dev->devnode, foff); #else retcode = vm_mmap(&vms->vm_map, &vaddr, size, PROT_READ | PROT_WRITE, - VM_PROT_ALL, MAP_SHARED, SLIST_FIRST(&dev->devnode->si_hlist), - foff); + VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, + SLIST_FIRST(&dev->devnode->si_hlist), foff); #endif if (retcode) goto done; From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 15 17:25: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 E993010656BB; Sun, 15 Mar 2009 17:25: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 D5E418FC22; Sun, 15 Mar 2009 17:25: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 n2FHPi4q035209; Sun, 15 Mar 2009 17:25:44 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FHPiYn035208; Sun, 15 Mar 2009 17:25:44 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903151725.n2FHPiYn035208@svn.freebsd.org> From: Robert Noland Date: Sun, 15 Mar 2009 17:25: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: r189859 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Sun, 15 Mar 2009 17:25:46 -0000 Author: rnoland Date: Sun Mar 15 17:25:44 2009 New Revision: 189859 URL: http://svn.freebsd.org/changeset/base/189859 Log: Merge r189562 Clean up the printing on amd64. Should also be consistent on i386. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_sysctl.c Modified: stable/7/sys/dev/drm/drm_sysctl.c ============================================================================== --- stable/7/sys/dev/drm/drm_sysctl.c Sun Mar 15 17:24:48 2009 (r189858) +++ stable/7/sys/dev/drm/drm_sysctl.c Sun Mar 15 17:25:44 2009 (r189859) @@ -185,8 +185,8 @@ static int drm_vm_info DRM_SYSCTL_HANDLE DRM_UNLOCK(); - DRM_SYSCTL_PRINT("\nslot offset size type flags " - "address mtrr\n"); + DRM_SYSCTL_PRINT("\nslot offset size " + "type flags address mtrr\n"); for (i = 0; i < mapcount; i++) { map = &tempmaps[i]; @@ -202,7 +202,7 @@ static int drm_vm_info DRM_SYSCTL_HANDLE yesno = "yes"; DRM_SYSCTL_PRINT( - "%4d 0x%08lx 0x%08lx %4.4s 0x%02x 0x%08lx %s\n", i, + "%4d 0x%016lx 0x%08lx %4.4s 0x%02x 0x%016lx %s\n", i, map->offset, map->size, type, map->flags, (unsigned long)map->handle, yesno); } From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 15 17:27: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 1814A10657D6; Sun, 15 Mar 2009 17:27:07 +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 F1B418FC13; Sun, 15 Mar 2009 17:27:06 +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 n2FHR67e035293; Sun, 15 Mar 2009 17:27:06 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2FHR6aQ035283; Sun, 15 Mar 2009 17:27:06 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903151727.n2FHR6aQ035283@svn.freebsd.org> From: Robert Noland Date: Sun, 15 Mar 2009 17:27: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: r189860 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Sun, 15 Mar 2009 17:27:10 -0000 Author: rnoland Date: Sun Mar 15 17:27:06 2009 New Revision: 189860 URL: http://svn.freebsd.org/changeset/base/189860 Log: Merge r189563 Consistently use kdev for the kernel device. Submitted by: vehemens Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drmP.h stable/7/sys/dev/drm/drm_drv.c stable/7/sys/dev/drm/i915_drv.c stable/7/sys/dev/drm/mach64_drv.c stable/7/sys/dev/drm/mga_drv.c stable/7/sys/dev/drm/r128_drv.c stable/7/sys/dev/drm/radeon_drv.c stable/7/sys/dev/drm/savage_drv.c stable/7/sys/dev/drm/sis_drv.c stable/7/sys/dev/drm/tdfx_drv.c Modified: stable/7/sys/dev/drm/drmP.h ============================================================================== --- stable/7/sys/dev/drm/drmP.h Sun Mar 15 17:25:44 2009 (r189859) +++ stable/7/sys/dev/drm/drmP.h Sun Mar 15 17:27:06 2009 (r189860) @@ -720,10 +720,10 @@ static inline int drm_core_has_AGP(struc extern int drm_debug_flag; /* Device setup support (drm_drv.c) */ -int drm_probe(device_t nbdev, drm_pci_id_list_t *idlist); -int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist); +int drm_probe(device_t kdev, drm_pci_id_list_t *idlist); +int drm_attach(device_t kdev, drm_pci_id_list_t *idlist); void drm_close(void *data); -int drm_detach(device_t nbdev); +int drm_detach(device_t kdev); d_ioctl_t drm_ioctl; d_open_t drm_open; d_read_t drm_read; Modified: stable/7/sys/dev/drm/drm_drv.c ============================================================================== --- stable/7/sys/dev/drm/drm_drv.c Sun Mar 15 17:25:44 2009 (r189859) +++ stable/7/sys/dev/drm/drm_drv.c Sun Mar 15 17:27:06 2009 (r189860) @@ -158,53 +158,53 @@ static int drm_msi_is_blacklisted(int ve return 0; } -int drm_probe(device_t dev, drm_pci_id_list_t *idlist) +int drm_probe(device_t kdev, drm_pci_id_list_t *idlist) { drm_pci_id_list_t *id_entry; int vendor, device; #if __FreeBSD_version < 700010 device_t realdev; - if (!strcmp(device_get_name(dev), "drmsub")) - realdev = device_get_parent(dev); + if (!strcmp(device_get_name(kdev), "drmsub")) + realdev = device_get_parent(kdev); else - realdev = dev; + realdev = kdev; vendor = pci_get_vendor(realdev); device = pci_get_device(realdev); #else - vendor = pci_get_vendor(dev); - device = pci_get_device(dev); + vendor = pci_get_vendor(kdev); + device = pci_get_device(kdev); #endif - if (pci_get_class(dev) != PCIC_DISPLAY - || pci_get_subclass(dev) != PCIS_DISPLAY_VGA) + if (pci_get_class(kdev) != PCIC_DISPLAY + || pci_get_subclass(kdev) != PCIS_DISPLAY_VGA) return ENXIO; id_entry = drm_find_description(vendor, device, idlist); if (id_entry != NULL) { - device_set_desc(dev, id_entry->name); + device_set_desc(kdev, id_entry->name); return 0; } return ENXIO; } -int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist) +int drm_attach(device_t kdev, drm_pci_id_list_t *idlist) { struct drm_device *dev; drm_pci_id_list_t *id_entry; int unit, msicount; - unit = device_get_unit(nbdev); - dev = device_get_softc(nbdev); + unit = device_get_unit(kdev); + dev = device_get_softc(kdev); #if __FreeBSD_version < 700010 - if (!strcmp(device_get_name(nbdev), "drmsub")) - dev->device = device_get_parent(nbdev); + if (!strcmp(device_get_name(kdev), "drmsub")) + dev->device = device_get_parent(kdev); else - dev->device = nbdev; + dev->device = kdev; #else - dev->device = nbdev; + dev->device = kdev; #endif dev->devnode = make_dev(&drm_cdevsw, unit, @@ -259,11 +259,11 @@ int drm_attach(device_t nbdev, drm_pci_i return drm_load(dev); } -int drm_detach(device_t nbdev) +int drm_detach(device_t kdev) { struct drm_device *dev; - dev = device_get_softc(nbdev); + dev = device_get_softc(kdev); drm_unload(dev); Modified: stable/7/sys/dev/drm/i915_drv.c ============================================================================== --- stable/7/sys/dev/drm/i915_drv.c Sun Mar 15 17:25:44 2009 (r189859) +++ stable/7/sys/dev/drm/i915_drv.c Sun Mar 15 17:27:06 2009 (r189860) @@ -43,9 +43,9 @@ static drm_pci_id_list_t i915_pciidlist[ i915_PCI_IDS }; -static int i915_suspend(device_t nbdev) +static int i915_suspend(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); struct drm_i915_private *dev_priv = dev->dev_private; if (!dev || !dev_priv) { @@ -57,16 +57,16 @@ static int i915_suspend(device_t nbdev) i915_save_state(dev); - return (bus_generic_suspend(nbdev)); + return (bus_generic_suspend(kdev)); } -static int i915_resume(device_t nbdev) +static int i915_resume(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); i915_restore_state(dev); - return (bus_generic_resume(nbdev)); + return (bus_generic_resume(kdev)); } static void i915_configure(struct drm_device *dev) @@ -100,31 +100,31 @@ static void i915_configure(struct drm_de } static int -i915_probe(device_t dev) +i915_probe(device_t kdev) { - return drm_probe(dev, i915_pciidlist); + return drm_probe(kdev, i915_pciidlist); } static int -i915_attach(device_t nbdev) +i915_attach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER, M_WAITOK | M_ZERO); i915_configure(dev); - return drm_attach(nbdev, i915_pciidlist); + return drm_attach(kdev, i915_pciidlist); } static int -i915_detach(device_t nbdev) +i915_detach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); int ret; - ret = drm_detach(nbdev); + ret = drm_detach(kdev); free(dev->driver, DRM_MEM_DRIVER); Modified: stable/7/sys/dev/drm/mach64_drv.c ============================================================================== --- stable/7/sys/dev/drm/mach64_drv.c Sun Mar 15 17:25:44 2009 (r189859) +++ stable/7/sys/dev/drm/mach64_drv.c Sun Mar 15 17:27:06 2009 (r189860) @@ -77,22 +77,22 @@ static void mach64_configure(struct drm_ } static int -mach64_probe(device_t dev) +mach64_probe(device_t kdev) { - return drm_probe(dev, mach64_pciidlist); + return drm_probe(kdev, mach64_pciidlist); } static int -mach64_attach(device_t nbdev) +mach64_attach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER, M_WAITOK | M_ZERO); mach64_configure(dev); - return drm_attach(nbdev, mach64_pciidlist); + return drm_attach(kdev, mach64_pciidlist); } int @@ -102,12 +102,12 @@ mach64_driver_load(struct drm_device * d } static int -mach64_detach(device_t nbdev) +mach64_detach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); int ret; - ret = drm_detach(nbdev); + ret = drm_detach(kdev); free(dev->driver, DRM_MEM_DRIVER); Modified: stable/7/sys/dev/drm/mga_drv.c ============================================================================== --- stable/7/sys/dev/drm/mga_drv.c Sun Mar 15 17:25:44 2009 (r189859) +++ stable/7/sys/dev/drm/mga_drv.c Sun Mar 15 17:27:06 2009 (r189860) @@ -120,31 +120,31 @@ static void mga_configure(struct drm_dev } static int -mga_probe(device_t dev) +mga_probe(device_t kdev) { - return drm_probe(dev, mga_pciidlist); + return drm_probe(kdev, mga_pciidlist); } static int -mga_attach(device_t nbdev) +mga_attach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER, M_WAITOK | M_ZERO); mga_configure(dev); - return drm_attach(nbdev, mga_pciidlist); + return drm_attach(kdev, mga_pciidlist); } static int -mga_detach(device_t nbdev) +mga_detach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); int ret; - ret = drm_detach(nbdev); + ret = drm_detach(kdev); free(dev->driver, DRM_MEM_DRIVER); Modified: stable/7/sys/dev/drm/r128_drv.c ============================================================================== --- stable/7/sys/dev/drm/r128_drv.c Sun Mar 15 17:25:44 2009 (r189859) +++ stable/7/sys/dev/drm/r128_drv.c Sun Mar 15 17:27:06 2009 (r189860) @@ -76,22 +76,22 @@ static void r128_configure(struct drm_de } static int -r128_probe(device_t dev) +r128_probe(device_t kdev) { - return drm_probe(dev, r128_pciidlist); + return drm_probe(kdev, r128_pciidlist); } static int -r128_attach(device_t nbdev) +r128_attach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER, M_WAITOK | M_ZERO); r128_configure(dev); - return drm_attach(nbdev, r128_pciidlist); + return drm_attach(kdev, r128_pciidlist); } int r128_driver_load(struct drm_device * dev, unsigned long flags) @@ -100,12 +100,12 @@ int r128_driver_load(struct drm_device * } static int -r128_detach(device_t nbdev) +r128_detach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); int ret; - ret = drm_detach(nbdev); + ret = drm_detach(kdev); free(dev->driver, DRM_MEM_DRIVER); Modified: stable/7/sys/dev/drm/radeon_drv.c ============================================================================== --- stable/7/sys/dev/drm/radeon_drv.c Sun Mar 15 17:25:44 2009 (r189859) +++ stable/7/sys/dev/drm/radeon_drv.c Sun Mar 15 17:27:06 2009 (r189860) @@ -80,31 +80,31 @@ static void radeon_configure(struct drm_ } static int -radeon_probe(device_t dev) +radeon_probe(device_t kdev) { - return drm_probe(dev, radeon_pciidlist); + return drm_probe(kdev, radeon_pciidlist); } static int -radeon_attach(device_t nbdev) +radeon_attach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER, M_WAITOK | M_ZERO); radeon_configure(dev); - return drm_attach(nbdev, radeon_pciidlist); + return drm_attach(kdev, radeon_pciidlist); } static int -radeon_detach(device_t nbdev) +radeon_detach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); int ret; - ret = drm_detach(nbdev); + ret = drm_detach(kdev); free(dev->driver, DRM_MEM_DRIVER); Modified: stable/7/sys/dev/drm/savage_drv.c ============================================================================== --- stable/7/sys/dev/drm/savage_drv.c Sun Mar 15 17:25:44 2009 (r189859) +++ stable/7/sys/dev/drm/savage_drv.c Sun Mar 15 17:27:06 2009 (r189860) @@ -66,31 +66,31 @@ static void savage_configure(struct drm_ } static int -savage_probe(device_t dev) +savage_probe(device_t kdev) { - return drm_probe(dev, savage_pciidlist); + return drm_probe(kdev, savage_pciidlist); } static int -savage_attach(device_t nbdev) +savage_attach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER, M_WAITOK | M_ZERO); savage_configure(dev); - return drm_attach(nbdev, savage_pciidlist); + return drm_attach(kdev, savage_pciidlist); } static int -savage_detach(device_t nbdev) +savage_detach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); int ret; - ret = drm_detach(nbdev); + ret = drm_detach(kdev); free(dev->driver, DRM_MEM_DRIVER); Modified: stable/7/sys/dev/drm/sis_drv.c ============================================================================== --- stable/7/sys/dev/drm/sis_drv.c Sun Mar 15 17:25:44 2009 (r189859) +++ stable/7/sys/dev/drm/sis_drv.c Sun Mar 15 17:27:06 2009 (r189860) @@ -60,31 +60,31 @@ static void sis_configure(struct drm_dev } static int -sis_probe(device_t dev) +sis_probe(device_t kdev) { - return drm_probe(dev, sis_pciidlist); + return drm_probe(kdev, sis_pciidlist); } static int -sis_attach(device_t nbdev) +sis_attach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER, M_WAITOK | M_ZERO); sis_configure(dev); - return drm_attach(nbdev, sis_pciidlist); + return drm_attach(kdev, sis_pciidlist); } static int -sis_detach(device_t nbdev) +sis_detach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); int ret; - ret = drm_detach(nbdev); + ret = drm_detach(kdev); free(dev->driver, DRM_MEM_DRIVER); Modified: stable/7/sys/dev/drm/tdfx_drv.c ============================================================================== --- stable/7/sys/dev/drm/tdfx_drv.c Sun Mar 15 17:25:44 2009 (r189859) +++ stable/7/sys/dev/drm/tdfx_drv.c Sun Mar 15 17:27:06 2009 (r189860) @@ -62,31 +62,31 @@ static void tdfx_configure(struct drm_de } static int -tdfx_probe(device_t dev) +tdfx_probe(device_t kdev) { - return drm_probe(dev, tdfx_pciidlist); + return drm_probe(kdev, tdfx_pciidlist); } static int -tdfx_attach(device_t nbdev) +tdfx_attach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER, M_WAITOK | M_ZERO); tdfx_configure(dev); - return drm_attach(nbdev, tdfx_pciidlist); + return drm_attach(kdev, tdfx_pciidlist); } static int -tdfx_detach(device_t nbdev) +tdfx_detach(device_t kdev) { - struct drm_device *dev = device_get_softc(nbdev); + struct drm_device *dev = device_get_softc(kdev); int ret; - ret = drm_detach(nbdev); + ret = drm_detach(kdev); free(dev->driver, DRM_MEM_DRIVER); From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 16:57: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 6D217106568B; Mon, 16 Mar 2009 16:57:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 594408FC13; Mon, 16 Mar 2009 16:57:04 +0000 (UTC) (envelope-from rwatson@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 n2GGv4Wd066392; Mon, 16 Mar 2009 16:57:04 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GGv4wg066390; Mon, 16 Mar 2009 16:57:04 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161657.n2GGv4wg066390@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 16:57: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: r189886 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb security/audit 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, 16 Mar 2009 16:57:05 -0000 Author: rwatson Date: Mon Mar 16 16:57:04 2009 New Revision: 189886 URL: http://svn.freebsd.org/changeset/base/189886 Log: Merge r174894 from head to stable/7: Change "audit_pipe_preselect" to "audit_pipe_presel" to make it print with proper alignment in ddb(4) and vmstat(8). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/security/audit/audit_pipe.c Modified: stable/7/sys/security/audit/audit_pipe.c ============================================================================== --- stable/7/sys/security/audit/audit_pipe.c Mon Mar 16 16:55:05 2009 (r189885) +++ stable/7/sys/security/audit/audit_pipe.c Mon Mar 16 16:57:04 2009 (r189886) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_AUDIT_PIPE, "audit_pipe", "Audit pipes"); static MALLOC_DEFINE(M_AUDIT_PIPE_ENTRY, "audit_pipeent", "Audit pipe entries and buffers"); -static MALLOC_DEFINE(M_AUDIT_PIPE_PRESELECT, "audit_pipe_preselect", +static MALLOC_DEFINE(M_AUDIT_PIPE_PRESELECT, "audit_pipe_presel", "Audit pipe preselection structure"); /* From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 17:03:33 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 882F41065675; Mon, 16 Mar 2009 17:03:33 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58D078FC08; Mon, 16 Mar 2009 17:03:33 +0000 (UTC) (envelope-from rwatson@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 n2GH3XaN066620; Mon, 16 Mar 2009 17:03:33 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GH3X8i066618; Mon, 16 Mar 2009 17:03:33 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161703.n2GH3X8i066618@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 17:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189887 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern security/audit 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, 16 Mar 2009 17:03:35 -0000 Author: rwatson Date: Mon Mar 16 17:03:33 2009 New Revision: 189887 URL: http://svn.freebsd.org/changeset/base/189887 Log: Merge r182750, r182754 from head to stable/7: If the process id specified is invalid, the system call returns ESRCH Unbreak the build. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_proc.c stable/7/sys/security/audit/audit_syscalls.c Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Mon Mar 16 16:57:04 2009 (r189886) +++ stable/7/sys/kern/kern_proc.c Mon Mar 16 17:03:33 2009 (r189887) @@ -994,10 +994,10 @@ sysctl_out_proc(struct proc *p, struct s np = pfind(pid); } if (np == NULL) - return EAGAIN; + return (ESRCH); if (np != p) { PROC_UNLOCK(np); - return EAGAIN; + return (ESRCH); } PROC_UNLOCK(np); return (0); Modified: stable/7/sys/security/audit/audit_syscalls.c ============================================================================== --- stable/7/sys/security/audit/audit_syscalls.c Mon Mar 16 16:57:04 2009 (r189886) +++ stable/7/sys/security/audit/audit_syscalls.c Mon Mar 16 17:03:33 2009 (r189887) @@ -314,12 +314,12 @@ auditon(struct thread *td, struct audito case A_GETPINFO: if (udata.au_aupinfo.ap_pid < 1) - return (EINVAL); + return (ESRCH); if ((tp = pfind(udata.au_aupinfo.ap_pid)) == NULL) - return (EINVAL); - if (p_cansee(td, tp) != 0) { + return (ESRCH); + if ((error = p_cansee(td, tp)) != 0) { PROC_UNLOCK(tp); - return (EINVAL); + return (error); } cred = tp->p_ucred; if (cred->cr_audit.ai_termid.at_type == AU_IPv6) { @@ -341,16 +341,16 @@ auditon(struct thread *td, struct audito case A_SETPMASK: if (udata.au_aupinfo.ap_pid < 1) - return (EINVAL); + return (ESRCH); newcred = crget(); if ((tp = pfind(udata.au_aupinfo.ap_pid)) == NULL) { crfree(newcred); - return (EINVAL); + return (ESRCH); } - if (p_cansee(td, tp) != 0) { + if ((error = p_cansee(td, tp)) != 0) { PROC_UNLOCK(tp); crfree(newcred); - return (EINVAL); + return (error); } oldcred = tp->p_ucred; crcopy(newcred, oldcred); @@ -377,9 +377,9 @@ auditon(struct thread *td, struct audito case A_GETPINFO_ADDR: if (udata.au_aupinfo_addr.ap_pid < 1) - return (EINVAL); + return (ESRCH); if ((tp = pfind(udata.au_aupinfo_addr.ap_pid)) == NULL) - return (EINVAL); + return (ESRCH); cred = tp->p_ucred; udata.au_aupinfo_addr.ap_auid = cred->cr_audit.ai_auid; udata.au_aupinfo_addr.ap_mask.am_success = From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 17:08: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 06DBA1065676; Mon, 16 Mar 2009 17:08:11 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7B1A8FC25; Mon, 16 Mar 2009 17:08:10 +0000 (UTC) (envelope-from rwatson@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 n2GH8A5j066787; Mon, 16 Mar 2009 17:08:10 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GH8AFo066786; Mon, 16 Mar 2009 17:08:10 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161708.n2GH8AFo066786@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 17:08: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: r189888 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb security/audit 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, 16 Mar 2009 17:08:11 -0000 Author: rwatson Date: Mon Mar 16 17:08:10 2009 New Revision: 189888 URL: http://svn.freebsd.org/changeset/base/189888 Log: Merge r186662 from head to stable/7: Fix white space botch: use carriage returns rather than tabs. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/security/audit/audit_pipe.c Modified: stable/7/sys/security/audit/audit_pipe.c ============================================================================== --- stable/7/sys/security/audit/audit_pipe.c Mon Mar 16 17:03:33 2009 (r189887) +++ stable/7/sys/security/audit/audit_pipe.c Mon Mar 16 17:08:10 2009 (r189888) @@ -169,7 +169,8 @@ struct audit_pipe { /* * Current pending record list. Protected by a combination of ap_mtx * and ap_sx. Note particularly that *both* locks are required to - * remove a record from the head of the queue, as an in-progress read * may sleep while copying and therefore cannot hold ap_mtx. + * remove a record from the head of the queue, as an in-progress read + * may sleep while copying and therefore cannot hold ap_mtx. */ TAILQ_HEAD(, audit_pipe_entry) ap_queue; From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 17:15: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 A67F61065673; Mon, 16 Mar 2009 17:15:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92A318FC12; Mon, 16 Mar 2009 17:15:02 +0000 (UTC) (envelope-from rwatson@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 n2GHF24g067024; Mon, 16 Mar 2009 17:15:02 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GHF2ek067023; Mon, 16 Mar 2009 17:15:02 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161715.n2GHF2ek067023@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 17:15: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: r189889 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb security/audit 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, 16 Mar 2009 17:15:03 -0000 Author: rwatson Date: Mon Mar 16 17:15:02 2009 New Revision: 189889 URL: http://svn.freebsd.org/changeset/base/189889 Log: Merge r186822 from head to stable/7: In AUDIT_SYSCALL_EXIT(), invoke audit_syscall_exit() only if an audit record is active on the current thread--historically we may always have wanted to enter the audit code if auditing was enabled, but now we just commit the audit record so don't need to enter if there isn't one. Obtained from: TrustedBSD Project Sponsored by: Apple, Inc. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/security/audit/audit.h Modified: stable/7/sys/security/audit/audit.h ============================================================================== --- stable/7/sys/security/audit/audit.h Mon Mar 16 17:08:10 2009 (r189888) +++ stable/7/sys/security/audit/audit.h Mon Mar 16 17:15:02 2009 (r189889) @@ -198,11 +198,11 @@ void audit_thread_free(struct thread *t /* * Wrap the audit_syscall_exit() function so that it is called only when - * auditing is enabled, or we have a audit record on the thread. It is - * possible that an audit record was begun before auditing was turned off. + * we have a audit record on the thread. Audit records can persist after + * auditing is disabled, so we don't just check audit_enabled here. */ #define AUDIT_SYSCALL_EXIT(error, td) do { \ - if (audit_enabled || (td->td_ar != NULL)) \ + if (td->td_ar != NULL) \ audit_syscall_exit(error, td); \ } while (0) From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 17:25: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 A94A0106566C; Mon, 16 Mar 2009 17:25:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 950D38FC0A; Mon, 16 Mar 2009 17:25:09 +0000 (UTC) (envelope-from rwatson@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 n2GHP9cf067293; Mon, 16 Mar 2009 17:25:09 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GHP94b067289; Mon, 16 Mar 2009 17:25:09 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161725.n2GHP94b067289@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 17:25: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: r189890 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb security/audit 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: Mon, 16 Mar 2009 17:25:10 -0000 Author: rwatson Date: Mon Mar 16 17:25:09 2009 New Revision: 189890 URL: http://svn.freebsd.org/changeset/base/189890 Log: Merge r189570 from head to stable/7: Add a new thread-private flag, TDP_AUDITREC, to indicate whether or not there is an audit record hung off of td_ar on the current thread. Test this flag instead of td_ar when auditing syscall arguments or checking for an audit record to commit on syscall return. Under these circumstances, td_pflags is much more likely to be in the cache (especially if there is no auditing of the current system call), so this should help reduce cache misses in the system call return path. Reported by: kris Obtained from: TrustedBSD Project Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/security/audit/audit.c stable/7/sys/security/audit/audit.h stable/7/sys/security/audit/audit_syscalls.c stable/7/sys/sys/proc.h Modified: stable/7/sys/security/audit/audit.c ============================================================================== --- stable/7/sys/security/audit/audit.c Mon Mar 16 17:15:02 2009 (r189889) +++ stable/7/sys/security/audit/audit.c Mon Mar 16 17:25:09 2009 (r189890) @@ -446,6 +446,8 @@ audit_syscall_enter(unsigned short code, au_id_t auid; KASSERT(td->td_ar == NULL, ("audit_syscall_enter: td->td_ar != NULL")); + KASSERT((td->td_pflags & TDP_AUDITREC) == 0, + ("audit_syscall_enter: TDP_AUDITREC set")); /* * In FreeBSD, each ABI has its own system call table, and hence @@ -496,9 +498,13 @@ audit_syscall_enter(unsigned short code, panic("audit_failing_stop: thread continued"); } td->td_ar = audit_new(event, td); - } else if (audit_pipe_preselect(auid, event, class, AU_PRS_BOTH, 0)) + if (td->td_ar != NULL) + td->td_pflags |= TDP_AUDITREC; + } else if (audit_pipe_preselect(auid, event, class, AU_PRS_BOTH, 0)) { td->td_ar = audit_new(event, td); - else + if (td->td_ar != NULL) + td->td_pflags |= TDP_AUDITREC; + } else td->td_ar = NULL; } @@ -526,6 +532,7 @@ audit_syscall_exit(int error, struct thr audit_commit(td->td_ar, error, retval); td->td_ar = NULL; + td->td_pflags &= ~TDP_AUDITREC; } void @@ -580,6 +587,8 @@ audit_thread_free(struct thread *td) { KASSERT(td->td_ar == NULL, ("audit_thread_free: td_ar != NULL")); + KASSERT((td->td_pflags & TDP_AUDITREC) == 0, + ("audit_thread_free: TDP_AUDITREC set")); } void Modified: stable/7/sys/security/audit/audit.h ============================================================================== --- stable/7/sys/security/audit/audit.h Mon Mar 16 17:15:02 2009 (r189889) +++ stable/7/sys/security/audit/audit.h Mon Mar 16 17:25:09 2009 (r189890) @@ -186,7 +186,7 @@ void audit_thread_free(struct thread *t * audit_enabled flag before performing the actual call. */ #define AUDIT_ARG(op, args...) do { \ - if (td->td_ar != NULL) \ + if (td->td_pflags & TDP_AUDITREC) \ audit_arg_ ## op (args); \ } while (0) @@ -202,7 +202,7 @@ void audit_thread_free(struct thread *t * auditing is disabled, so we don't just check audit_enabled here. */ #define AUDIT_SYSCALL_EXIT(error, td) do { \ - if (td->td_ar != NULL) \ + if (td->td_pflags & TDP_AUDITREC) \ audit_syscall_exit(error, td); \ } while (0) @@ -210,7 +210,7 @@ void audit_thread_free(struct thread *t * A Macro to wrap the audit_sysclose() function. */ #define AUDIT_SYSCLOSE(td, fd) do { \ - if (audit_enabled) \ + if (td->td_pflags & TDP_AUDITREC) \ audit_sysclose(td, fd); \ } while (0) Modified: stable/7/sys/security/audit/audit_syscalls.c ============================================================================== --- stable/7/sys/security/audit/audit_syscalls.c Mon Mar 16 17:15:02 2009 (r189889) +++ stable/7/sys/security/audit/audit_syscalls.c Mon Mar 16 17:25:09 2009 (r189890) @@ -96,6 +96,7 @@ audit(struct thread *td, struct audit_ar td->td_ar = audit_new(AUE_NULL, td); if (td->td_ar == NULL) return (ENOTSUP); + td->td_pflags |= TDP_AUDITREC; ar = td->td_ar; } Modified: stable/7/sys/sys/proc.h ============================================================================== --- stable/7/sys/sys/proc.h Mon Mar 16 17:15:02 2009 (r189889) +++ stable/7/sys/sys/proc.h Mon Mar 16 17:25:09 2009 (r189890) @@ -379,6 +379,7 @@ do { \ #define TDP_WAKEUP 0x00080000 /* Don't sleep in umtx cond_wait */ #define TDP_INBDFLUSH 0x00100000 /* Already in BO_BDFLUSH, do not recurse */ #define TDP_IGNSUSP 0x00800000 /* Permission to ignore the MNTK_SUSPEND* */ +#define TDP_AUDITREC 0x01000000 /* Audit record pending on thread */ /* * Reasons that the current thread can not be run yet. From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 17:30:38 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C46D1065670; Mon, 16 Mar 2009 17:30:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68BD98FC26; Mon, 16 Mar 2009 17:30:38 +0000 (UTC) (envelope-from rwatson@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 n2GHUcHc067489; Mon, 16 Mar 2009 17:30:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GHUc7L067488; Mon, 16 Mar 2009 17:30:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161730.n2GHUc7L067488@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 17:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189891 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2009 17:30:39 -0000 Author: rwatson Date: Mon Mar 16 17:30:38 2009 New Revision: 189891 URL: http://svn.freebsd.org/changeset/base/189891 Log: Merge r189545 from head to stable/7: By default, don't compile in counters of calls to various time query functions in the kernel, as these effectively serialize parallel calls to the gettimeofday(2) system call, as well as other kernel services that use timestamps. Use the NetBSD version of the fix (kern_tc.c:1.32 by ad@) as they have picked up our timecounter code and also ran into the same problem. Reported by: kris Obtained from: NetBSD Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_tc.c Modified: stable/7/sys/kern/kern_tc.c ============================================================================== --- stable/7/sys/kern/kern_tc.c Mon Mar 16 17:25:09 2009 (r189890) +++ stable/7/sys/kern/kern_tc.c Mon Mar 16 17:30:38 2009 (r189891) @@ -103,6 +103,7 @@ static int timestepwarnings; SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, ×tepwarnings, 0, ""); +#ifdef TC_COUNTERS #define TC_STATS(foo) \ static u_int foo; \ SYSCTL_UINT(_kern_timecounter, OID_AUTO, foo, CTLFLAG_RD, &foo, 0, "");\ @@ -114,7 +115,11 @@ TC_STATS(ngetbinuptime); TC_STATS(ngetna TC_STATS(ngetbintime); TC_STATS(ngetnanotime); TC_STATS(ngetmicrotime); TC_STATS(nsetclock); +#define TC_COUNT(var) var++ #undef TC_STATS +#else +#define TC_COUNT(var) /* nothing */ +#endif /* TC_COUNTERS */ static void tc_windup(void); static void cpu_tick_calibrate(int); @@ -180,7 +185,7 @@ binuptime(struct bintime *bt) struct timehands *th; u_int gen; - nbinuptime++; + TC_COUNT(nbinuptime); do { th = timehands; gen = th->th_generation; @@ -194,7 +199,7 @@ nanouptime(struct timespec *tsp) { struct bintime bt; - nnanouptime++; + TC_COUNT(nnanouptime); binuptime(&bt); bintime2timespec(&bt, tsp); } @@ -204,7 +209,7 @@ microuptime(struct timeval *tvp) { struct bintime bt; - nmicrouptime++; + TC_COUNT(nmicrouptime); binuptime(&bt); bintime2timeval(&bt, tvp); } @@ -213,7 +218,7 @@ void bintime(struct bintime *bt) { - nbintime++; + TC_COUNT(nbintime); binuptime(bt); bintime_add(bt, &boottimebin); } @@ -223,7 +228,7 @@ nanotime(struct timespec *tsp) { struct bintime bt; - nnanotime++; + TC_COUNT(nnanotime); bintime(&bt); bintime2timespec(&bt, tsp); } @@ -233,7 +238,7 @@ microtime(struct timeval *tvp) { struct bintime bt; - nmicrotime++; + TC_COUNT(nmicrotime); bintime(&bt); bintime2timeval(&bt, tvp); } @@ -244,7 +249,7 @@ getbinuptime(struct bintime *bt) struct timehands *th; u_int gen; - ngetbinuptime++; + TC_COUNT(ngetbinuptime); do { th = timehands; gen = th->th_generation; @@ -258,7 +263,7 @@ getnanouptime(struct timespec *tsp) struct timehands *th; u_int gen; - ngetnanouptime++; + TC_COUNT(ngetnanouptime); do { th = timehands; gen = th->th_generation; @@ -272,7 +277,7 @@ getmicrouptime(struct timeval *tvp) struct timehands *th; u_int gen; - ngetmicrouptime++; + TC_COUNT(ngetmicrouptime); do { th = timehands; gen = th->th_generation; @@ -286,7 +291,7 @@ getbintime(struct bintime *bt) struct timehands *th; u_int gen; - ngetbintime++; + TC_COUNT(ngetbintime); do { th = timehands; gen = th->th_generation; @@ -301,7 +306,7 @@ getnanotime(struct timespec *tsp) struct timehands *th; u_int gen; - ngetnanotime++; + TC_COUNT(ngetnanotime); do { th = timehands; gen = th->th_generation; @@ -315,7 +320,7 @@ getmicrotime(struct timeval *tvp) struct timehands *th; u_int gen; - ngetmicrotime++; + TC_COUNT(ngetmicrotime); do { th = timehands; gen = th->th_generation; @@ -406,7 +411,7 @@ tc_setclock(struct timespec *ts) struct bintime bt, bt2; cpu_tick_calibrate(1); - nsetclock++; + TC_COUNT(nsetclock); nanotime(&tbef); timespec2bintime(ts, &bt); binuptime(&bt2); From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 17: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 9846A106564A; Mon, 16 Mar 2009 17:46:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D3158FC1D; Mon, 16 Mar 2009 17:46:56 +0000 (UTC) (envelope-from rwatson@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 n2GHktKk067880; Mon, 16 Mar 2009 17:46:55 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GHktkE067879; Mon, 16 Mar 2009 17:46:55 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161746.n2GHktkE067879@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 17:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189892 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2009 17:46:57 -0000 Author: rwatson Date: Mon Mar 16 17:46:55 2009 New Revision: 189892 URL: http://svn.freebsd.org/changeset/base/189892 Log: Merge r189655 from head to stable/7: Prefer ENETDOWN to ENXIO when returning queuing errors due to a link down, interface down, etc, with if_cxgb's if_transmit routine. Reviewed by: kmacy Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/cxgb/cxgb_multiq.c Modified: stable/7/sys/dev/cxgb/cxgb_multiq.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_multiq.c Mon Mar 16 17:30:38 2009 (r189891) +++ stable/7/sys/dev/cxgb/cxgb_multiq.c Mon Mar 16 17:46:55 2009 (r189892) @@ -131,7 +131,7 @@ cxgb_pcpu_enqueue_packet_(struct sge_qse KASSERT(m->m_type == MT_DATA, ("bad mbuf type %d", m->m_type)); if (qs->qs_flags & QS_EXITING) { m_freem(m); - return (ENXIO); + return (ENETDOWN); } txq = &qs->txq[TXQ_ETH]; err = buf_ring_enqueue(&txq->txq_mr, m); @@ -425,13 +425,13 @@ cxgb_pcpu_start_(struct sge_qset *qs, st retry: if (!pi->link_config.link_ok) - initerr = ENXIO; + initerr = ENETDOWN; else if (qs->qs_flags & QS_EXITING) - initerr = ENXIO; + initerr = ENETDOWN; else if ((pi->ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - initerr = ENXIO; + initerr = ENETDOWN; else if ((pi->ifp->if_flags & IFF_UP) == 0) - initerr = ENXIO; + initerr = ENETDOWN; else if (immpkt) { if (!buf_ring_empty(&txq->txq_mr)) From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 17:55:24 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D17CD106566C; Mon, 16 Mar 2009 17:55:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD8108FC13; Mon, 16 Mar 2009 17:55:24 +0000 (UTC) (envelope-from rwatson@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 n2GHtOEN068110; Mon, 16 Mar 2009 17:55:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GHtOma068109; Mon, 16 Mar 2009 17:55:24 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161755.n2GHtOma068109@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 17:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189893 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cm dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2009 17:55:25 -0000 Author: rwatson Date: Mon Mar 16 17:55:24 2009 New Revision: 189893 URL: http://svn.freebsd.org/changeset/base/189893 Log: Merge r188545 from head to stable/7: Remove unused ifaddr and ifreq local variables. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cm/smc90cx6.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/cm/smc90cx6.c ============================================================================== --- stable/7/sys/dev/cm/smc90cx6.c Mon Mar 16 17:46:55 2009 (r189892) +++ stable/7/sys/dev/cm/smc90cx6.c Mon Mar 16 17:55:24 2009 (r189893) @@ -861,14 +861,10 @@ cm_ioctl(ifp, command, data) caddr_t data; { struct cm_softc *sc; - struct ifaddr *ifa; - struct ifreq *ifr; int error; error = 0; sc = ifp->if_softc; - ifa = (struct ifaddr *)data; - ifr = (struct ifreq *)data; #if defined(CM_DEBUG) && (CM_DEBUG > 2) if_printf(ifp, "ioctl() called, cmd = 0x%lx\n", command); From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 17:57:29 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7638D106566C; Mon, 16 Mar 2009 17:57:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ABD98FC15; Mon, 16 Mar 2009 17:57:29 +0000 (UTC) (envelope-from rwatson@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 n2GHvT9t068209; Mon, 16 Mar 2009 17:57:29 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GHvTnP068208; Mon, 16 Mar 2009 17:57:29 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161757.n2GHvTnP068208@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 17:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189894 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb net 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, 16 Mar 2009 17:57:31 -0000 Author: rwatson Date: Mon Mar 16 17:57:29 2009 New Revision: 189894 URL: http://svn.freebsd.org/changeset/base/189894 Log: Merge r188546 from head to stable/7: Remove unused ifaddr local variable in ioctl routine. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/net/if_vlan.c Modified: stable/7/sys/net/if_vlan.c ============================================================================== --- stable/7/sys/net/if_vlan.c Mon Mar 16 17:55:24 2009 (r189893) +++ stable/7/sys/net/if_vlan.c Mon Mar 16 17:57:29 2009 (r189894) @@ -1296,7 +1296,6 @@ vlan_trunk_capabilities(struct ifnet *if static int vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct ifaddr *ifa; struct ifnet *p; struct ifreq *ifr; struct ifvlan *ifv; @@ -1304,7 +1303,6 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd int error = 0; ifr = (struct ifreq *)data; - ifa = (struct ifaddr *)data; ifv = ifp->if_softc; switch (cmd) { From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 18:02:01 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BD331065680; Mon, 16 Mar 2009 18:02:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 279188FC16; Mon, 16 Mar 2009 18:02:01 +0000 (UTC) (envelope-from rwatson@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 n2GI21ek068385; Mon, 16 Mar 2009 18:02:01 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GI2179068384; Mon, 16 Mar 2009 18:02:01 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161802.n2GI2179068384@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 18:02:01 +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: r189895 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet 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, 16 Mar 2009 18:02:02 -0000 Author: rwatson Date: Mon Mar 16 18:02:00 2009 New Revision: 189895 URL: http://svn.freebsd.org/changeset/base/189895 Log: Merge r188962 from head to stable/7: In in_rtqkill(), assert the radix head lock, and pass RTF_RNH_LOCKED to in_rtrequest(); the radix head lock is already acquired before rnh_walktree is called in in_rtqtimo_one(). This avoids a recursive acquisition that is no longer permitted in 8.x due to use of an rwlock for the radix head lock. Reported by: dikshie While not strictly required in 7.x, I am merging this to keep locking as consistent as possible in the routing code between 7.x and 8.x. Note that because the rwlock change has not been merged, this becomes LOCK_ASSERT rather than WLOCK_ASSERT. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/in_rmx.c Modified: stable/7/sys/netinet/in_rmx.c ============================================================================== --- stable/7/sys/netinet/in_rmx.c Mon Mar 16 17:57:29 2009 (r189894) +++ stable/7/sys/netinet/in_rmx.c Mon Mar 16 18:02:00 2009 (r189895) @@ -219,6 +219,8 @@ in_rtqkill(struct radix_node *rn, void * struct rtentry *rt = (struct rtentry *)rn; int err; + RADIX_NODE_HEAD_LOCK_ASSERT(ap->rnh); + if (rt->rt_flags & RTPRF_OURS) { ap->found++; @@ -229,7 +231,8 @@ in_rtqkill(struct radix_node *rn, void * err = in_rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt), rt->rt_gateway, rt_mask(rt), - rt->rt_flags, 0, rt->rt_fibnum); + rt->rt_flags | RTF_RNH_LOCKED, 0, + rt->rt_fibnum); if (err) { log(LOG_WARNING, "in_rtqkill: error %d\n", err); } else { From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 18:05:32 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 354791065677; Mon, 16 Mar 2009 18:05:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20CB68FC21; Mon, 16 Mar 2009 18:05:32 +0000 (UTC) (envelope-from rwatson@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 n2GI5WuX068523; Mon, 16 Mar 2009 18:05:32 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GI5WQv068522; Mon, 16 Mar 2009 18:05:32 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161805.n2GI5WQv068522@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 18:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189896 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet6 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, 16 Mar 2009 18:05:34 -0000 Author: rwatson Date: Mon Mar 16 18:05:31 2009 New Revision: 189896 URL: http://svn.freebsd.org/changeset/base/189896 Log: Merge r188963 from head to stable/7: Assert the radix head lock in in6_rtqkill(). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet6/in6_rmx.c Modified: stable/7/sys/netinet6/in6_rmx.c ============================================================================== --- stable/7/sys/netinet6/in6_rmx.c Mon Mar 16 18:02:00 2009 (r189895) +++ stable/7/sys/netinet6/in6_rmx.c Mon Mar 16 18:05:31 2009 (r189896) @@ -289,6 +289,8 @@ in6_rtqkill(struct radix_node *rn, void struct rtentry *rt = (struct rtentry *)rn; int err; + RADIX_NODE_HEAD_LOCK_ASSERT(ap->rnh); + if (rt->rt_flags & RTPRF_OURS) { ap->found++; From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 18:07:24 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 234261065677; Mon, 16 Mar 2009 18:07:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E03C8FC1C; Mon, 16 Mar 2009 18:07:24 +0000 (UTC) (envelope-from rwatson@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 n2GI7NHi068607; Mon, 16 Mar 2009 18:07:23 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GI7Nbi068606; Mon, 16 Mar 2009 18:07:23 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161807.n2GI7Nbi068606@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 18:07: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: r189897 - stable/7/share/man/man8 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, 16 Mar 2009 18:07:27 -0000 Author: rwatson Date: Mon Mar 16 18:07:23 2009 New Revision: 189897 URL: http://svn.freebsd.org/changeset/base/189897 Log: Merge r189778 from head to stable/7: Don't suggest mounting procfs in diskless configurations. Modified: stable/7/share/man/man8/ (props changed) stable/7/share/man/man8/diskless.8 Modified: stable/7/share/man/man8/diskless.8 ============================================================================== --- stable/7/share/man/man8/diskless.8 Mon Mar 16 18:05:31 2009 (r189896) +++ stable/7/share/man/man8/diskless.8 Mon Mar 16 18:07:23 2009 (r189897) @@ -376,7 +376,6 @@ As a minimum, you normally need to have .Bd -literal -offset indent : / nfs ro 0 0 :/usr /usr nfs ro 0 0 -proc /proc procfs rw 0 0 .Ed .Pp You also need to create a customized version of From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 18:15:53 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16A461065670; Mon, 16 Mar 2009 18:15:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03C648FC22; Mon, 16 Mar 2009 18:15:53 +0000 (UTC) (envelope-from rwatson@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 n2GIFqPQ068871; Mon, 16 Mar 2009 18:15:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GIFq3p068870; Mon, 16 Mar 2009 18:15:52 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161815.n2GIFq3p068870@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 18:15:52 +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: r189898 - stable/7/sys/netinet6 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, 16 Mar 2009 18:15:53 -0000 Author: rwatson Date: Mon Mar 16 18:15:52 2009 New Revision: 189898 URL: http://svn.freebsd.org/changeset/base/189898 Log: Merge adding RTF_RNH_LOCKED to the flags argument of rtrequest() in in6_rtqkill(), making it match in_rtqkill(). This change appeared in 8.x as part of the arpv2 merge (r186119) but that isn't appropriate to merge. Modified: stable/7/sys/netinet6/in6_rmx.c Modified: stable/7/sys/netinet6/in6_rmx.c ============================================================================== --- stable/7/sys/netinet6/in6_rmx.c Mon Mar 16 18:07:23 2009 (r189897) +++ stable/7/sys/netinet6/in6_rmx.c Mon Mar 16 18:15:52 2009 (r189898) @@ -301,7 +301,7 @@ in6_rtqkill(struct radix_node *rn, void err = rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt), rt->rt_gateway, rt_mask(rt), - rt->rt_flags, 0); + rt->rt_flags|RTF_RNH_LOCKED, 0); if (err) { log(LOG_WARNING, "in6_rtqkill: error %d", err); } else { From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 17 06:54: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 B04C5106564A; Tue, 17 Mar 2009 06:54:42 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BE798FC0A; Tue, 17 Mar 2009 06:54:42 +0000 (UTC) (envelope-from lulf@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 n2H6sg0t085516; Tue, 17 Mar 2009 06:54:42 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2H6sgpu085502; Tue, 17 Mar 2009 06:54:42 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200903170654.n2H6sgpu085502@svn.freebsd.org> From: Ulf Lilleengen Date: Tue, 17 Mar 2009 06:54: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: r189918 - in stable/7: contrib/csup usr.bin/csup 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, 17 Mar 2009 06:54:43 -0000 Author: lulf Date: Tue Mar 17 06:54:41 2009 New Revision: 189918 URL: http://svn.freebsd.org/changeset/base/189918 Log: MFH: r186781 Merge support for CVSMode (aka. mirror mode) into csup. This means csup can now fetch a complete CVS repository. Support for rsync update of regular files are also included, but are not yet enabled. The change should not have an impact on existing csup usage, as little of the existing code has changed. r186871 - Update manpage now that cvs mode is supported. r188405 - Fix an issue where file attributes were not installed correctly during a Touch and SetAttrs operation. - SetAttrs and Touch were incorrectly switched. r188644 - Do not free the pattern lists immediately after use, as they might be needed again in case the connection is interrupted and csup have to reconnect. The lists will be freed after the collection has been completely processed. r189455 - Try to handle rcsfile write failures in the same way as cvsup, as they are not necessarily fatal. If the file was incorrectly written, the checksum will detect it and the file will be retransferred. Added: stable/7/contrib/csup/lex.rcs.c - copied unchanged from r186781, head/contrib/csup/lex.rcs.c stable/7/contrib/csup/rcsfile.c - copied unchanged from r186781, head/contrib/csup/rcsfile.c stable/7/contrib/csup/rcsfile.h - copied unchanged from r186781, head/contrib/csup/rcsfile.h stable/7/contrib/csup/rcsparse.c - copied unchanged from r186781, head/contrib/csup/rcsparse.c stable/7/contrib/csup/rcsparse.h - copied unchanged from r186781, head/contrib/csup/rcsparse.h stable/7/contrib/csup/rcstokenizer.h - copied unchanged from r186781, head/contrib/csup/rcstokenizer.h stable/7/contrib/csup/rcstokenizer.l - copied unchanged from r186781, head/contrib/csup/rcstokenizer.l stable/7/contrib/csup/rsyncfile.c - copied unchanged from r186781, head/contrib/csup/rsyncfile.c stable/7/contrib/csup/rsyncfile.h - copied unchanged from r186781, head/contrib/csup/rsyncfile.h Modified: stable/7/contrib/csup/ (props changed) stable/7/contrib/csup/GNUmakefile stable/7/contrib/csup/Makefile stable/7/contrib/csup/TODO stable/7/contrib/csup/config.c stable/7/contrib/csup/csup.1 stable/7/contrib/csup/detailer.c stable/7/contrib/csup/diff.c stable/7/contrib/csup/diff.h stable/7/contrib/csup/fattr.c stable/7/contrib/csup/fattr.h stable/7/contrib/csup/keyword.c stable/7/contrib/csup/keyword.h stable/7/contrib/csup/lister.c stable/7/contrib/csup/misc.c stable/7/contrib/csup/misc.h stable/7/contrib/csup/mux.c stable/7/contrib/csup/proto.c stable/7/contrib/csup/proto.h stable/7/contrib/csup/status.c stable/7/contrib/csup/stream.c stable/7/contrib/csup/stream.h stable/7/contrib/csup/updater.c stable/7/usr.bin/csup/ (props changed) stable/7/usr.bin/csup/Makefile Modified: stable/7/contrib/csup/GNUmakefile ============================================================================== --- stable/7/contrib/csup/GNUmakefile Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/GNUmakefile Tue Mar 17 06:54:41 2009 (r189918) @@ -12,8 +12,9 @@ GROUP?= 0 UNAME= $(shell uname -s) SRCS= attrstack.c config.c detailer.c diff.c fattr.c fixups.c fnmatch.c \ - globtree.c idcache.c keyword.c lister.c main.c misc.c mux.c pathcomp.c \ - parse.c proto.c status.c stream.c threads.c token.c updater.c + globtree.c idcache.c keyword.c lex.rcs.c lister.c main.c misc.c mux.c \ + pathcomp.c parse.c proto.c rcsfile.c rcsparse.c rsyncfile.c status.c \ + stream.c threads.c token.c updater.c OBJS= $(SRCS:.c=.o) WARNS= -Wall -W -Wno-unused-parameter -Wmissing-prototypes -Wpointer-arith \ Modified: stable/7/contrib/csup/Makefile ============================================================================== --- stable/7/contrib/csup/Makefile Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/Makefile Tue Mar 17 06:54:41 2009 (r189918) @@ -9,10 +9,11 @@ UNAME!= /usr/bin/uname -s PROG= csup SRCS= attrstack.c config.c detailer.c diff.c fattr.c fixups.c fnmatch.c \ globtree.c idcache.c keyword.c lister.c main.c misc.c mux.c parse.y \ - pathcomp.c proto.c status.c stream.c threads.c token.l updater.c + pathcomp.c proto.c status.c stream.c threads.c token.l updater.c \ + rcsfile.c rcsparse.c lex.rcs.c rsyncfile.c CFLAGS+= -I. -I${.CURDIR} -g -pthread -DHAVE_FFLAGS -DNDEBUG -WARNS?= 6 +WARNS?= 1 # A bit of tweaking is needed to get this Makefile working # with the bsd.prog.mk of all the *BSD OSes... Modified: stable/7/contrib/csup/TODO ============================================================================== --- stable/7/contrib/csup/TODO Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/TODO Tue Mar 17 06:54:41 2009 (r189918) @@ -28,4 +28,3 @@ MISSING FEATURES: checkout files (files in CVS/ subdirectores), a command line override to only update a specific collection and a third verbosity level to display commit log messages. -- Add support for CVS mode (maybe?). Modified: stable/7/contrib/csup/config.c ============================================================================== --- stable/7/contrib/csup/config.c Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/config.c Tue Mar 17 06:54:41 2009 (r189918) @@ -133,7 +133,6 @@ config_init(const char *file, struct col coll->co_options &= ~CO_CHECKRCS; /* In recent versions, we always try to set the file modes. */ coll->co_options |= CO_SETMODE; - /* XXX We don't support the rsync updating algorithm yet. */ coll->co_options |= CO_NORSYNC; error = config_parse_refusefiles(coll); if (error) @@ -444,10 +443,6 @@ coll_add(char *name) "\"%s\"\n", cur_coll->co_name); exit(1); } - if (!(cur_coll->co_options & CO_CHECKOUTMODE)) { - lprintf(-1, "Client only supports checkout mode\n"); - exit(1); - } if (!STAILQ_EMPTY(&colls)) { coll = STAILQ_LAST(&colls, coll, co_next); if (strcmp(coll->co_host, cur_coll->co_host) != 0) { Modified: stable/7/contrib/csup/csup.1 ============================================================================== --- stable/7/contrib/csup/csup.1 Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/csup.1 Tue Mar 17 06:54:41 2009 (r189918) @@ -442,8 +442,6 @@ They are called mode and .Em checkout mode. -.Nm -only supports the checkout mode for now. .Pp In CVS mode, the client receives copies of the actual RCS files making up the master CVS repository. CVS mode is the default mode of operation. Modified: stable/7/contrib/csup/detailer.c ============================================================================== --- stable/7/contrib/csup/detailer.c Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/detailer.c Tue Mar 17 06:54:41 2009 (r189918) @@ -30,13 +30,21 @@ #include #include #include +#include + +#include +#include +#include #include "config.h" #include "detailer.h" #include "fixups.h" +#include "globtree.h" #include "misc.h" #include "mux.h" #include "proto.h" +#include "rcsfile.h" +#include "rsyncfile.h" #include "status.h" #include "stream.h" @@ -56,8 +64,16 @@ struct detailer { static int detailer_batch(struct detailer *); static int detailer_coll(struct detailer *, struct coll *, struct status *); -static int detailer_dofile(struct detailer *, struct coll *, +static int detailer_dofile_co(struct detailer *, struct coll *, struct status *, char *); +static int detailer_dofile_rcs(struct detailer *, struct coll *, + char *, char *); +static int detailer_dofile_regular(struct detailer *, char *, char *); +static int detailer_dofile_rsync(struct detailer *, char *, char *); +static int detailer_checkrcsattr(struct detailer *, struct coll *, char *, + struct fattr *, int); +int detailer_send_details(struct detailer *, struct coll *, char *, + char *, struct fattr *); void * detailer(void *arg) @@ -186,8 +202,13 @@ detailer_batch(struct detailer *d) } if (fixup->f_coll != coll) break; - error = proto_printf(wr, "Y %s %s %s\n", fixup->f_name, - coll->co_tag, coll->co_date); + if (coll->co_options & CO_CHECKOUTMODE) + error = proto_printf(wr, "Y %s %s %s\n", + fixup->f_name, coll->co_tag, coll->co_date); + else { + error = proto_printf(wr, "A %s\n", + fixup->f_name); + } if (error) return (DETAILER_ERR_WRITE); fixup = NULL; @@ -208,12 +229,14 @@ detailer_batch(struct detailer *d) static int detailer_coll(struct detailer *d, struct coll *coll, struct status *st) { + struct fattr *rcsattr; struct stream *rd, *wr; - char *cmd, *file, *line, *msg; - int error; + char *attr, *cmd, *file, *line, *msg, *path, *target; + int error, attic; rd = d->rd; wr = d->wr; + attic = 0; line = stream_getln(rd, NULL); if (line == NULL) return (DETAILER_ERR_READ); @@ -226,17 +249,84 @@ detailer_coll(struct detailer *d, struct /* Delete file. */ file = proto_get_ascii(&line); if (file == NULL || line != NULL) - return (DETAILER_ERR_PROTO); + return (DETAILER_ERR_PROTO); error = proto_printf(wr, "D %s\n", file); if (error) return (DETAILER_ERR_WRITE); break; + case 'I': + case 'i': + case 'j': + /* Directory operations. */ + file = proto_get_ascii(&line); + if (file == NULL || line != NULL) + return (DETAILER_ERR_PROTO); + error = proto_printf(wr, "%s %s\n", cmd, file); + if (error) + return (DETAILER_ERR_WRITE); + break; + case 'J': + /* Set directory attributes. */ + file = proto_get_ascii(&line); + attr = proto_get_ascii(&line); + if (file == NULL || line != NULL || attr == NULL) + return (DETAILER_ERR_PROTO); + error = proto_printf(wr, "%s %s %s\n", cmd, file, attr); + if (error) + return (DETAILER_ERR_WRITE); + break; + case 'H': + case 'h': + /* Create a hard link. */ + file = proto_get_ascii(&line); + target = proto_get_ascii(&line); + if (file == NULL || target == NULL) + return (DETAILER_ERR_PROTO); + error = proto_printf(wr, "%s %s %s\n", cmd, file, + target); + break; + case 't': + file = proto_get_ascii(&line); + attr = proto_get_ascii(&line); + if (file == NULL || attr == NULL || line != NULL) { + return (DETAILER_ERR_PROTO); + } + rcsattr = fattr_decode(attr); + if (rcsattr == NULL) { + return (DETAILER_ERR_PROTO); + } + error = detailer_checkrcsattr(d, coll, file, rcsattr, + 1); + break; + + case 'T': + file = proto_get_ascii(&line); + attr = proto_get_ascii(&line); + if (file == NULL || attr == NULL || line != NULL) + return (DETAILER_ERR_PROTO); + rcsattr = fattr_decode(attr); + if (rcsattr == NULL) + return (DETAILER_ERR_PROTO); + error = detailer_checkrcsattr(d, coll, file, rcsattr, + 0); + break; + case 'U': /* Add or update file. */ file = proto_get_ascii(&line); if (file == NULL || line != NULL) return (DETAILER_ERR_PROTO); - error = detailer_dofile(d, coll, st, file); + if (coll->co_options & CO_CHECKOUTMODE) { + error = detailer_dofile_co(d, coll, st, file); + } else { + path = cvspath(coll->co_prefix, file, 0); + rcsattr = fattr_frompath(path, FATTR_NOFOLLOW); + error = detailer_send_details(d, coll, file, + path, rcsattr); + if (rcsattr != NULL) + fattr_free(rcsattr); + free(path); + } if (error) return (error); break; @@ -261,14 +351,110 @@ detailer_coll(struct detailer *d, struct return (0); } +/* + * Tell the server to update a regular file. + */ static int -detailer_dofile(struct detailer *d, struct coll *coll, struct status *st, - char *file) +detailer_dofile_regular(struct detailer *d, char *name, char *path) { + struct stream *wr; + struct stat st; char md5[MD5_DIGEST_SIZE]; + int error; + + wr = d->wr; + error = stat(path, &st); + /* If we don't have it or it's unaccessible, we want it again. */ + if (error) { + proto_printf(wr, "A %s\n", name); + return (0); + } + + /* If not, we want the file to be updated. */ + error = MD5_File(path, md5); + if (error) { + lprintf(-1, "Error reading \"%s\"\n", name); + return (error); + } + error = proto_printf(wr, "R %s %O %s\n", name, st.st_size, md5); + if (error) + return (DETAILER_ERR_WRITE); + return (0); +} + +/* + * Tell the server to update a file with the rsync algorithm. + */ +static int +detailer_dofile_rsync(struct detailer *d, char *name, char *path) +{ + struct stream *wr; + struct rsyncfile *rf; + + wr = d->wr; + rf = rsync_open(path, 0, 1); + if (rf == NULL) { + /* Fallback if we fail in opening it. */ + proto_printf(wr, "A %s\n", name); + return (0); + } + proto_printf(wr, "r %s %z %z\n", name, rsync_filesize(rf), + rsync_blocksize(rf)); + /* Detail the blocks. */ + while (rsync_nextblock(rf) != 0) + proto_printf(wr, "%s %s\n", rsync_rsum(rf), rsync_blockmd5(rf)); + proto_printf(wr, ".\n"); + rsync_close(rf); + return (0); +} + +/* + * Tell the server to update an RCS file that we have, or send it if we don't. + */ +static int +detailer_dofile_rcs(struct detailer *d, struct coll *coll, char *name, + char *path) +{ + struct stream *wr; + struct fattr *fa; + struct rcsfile *rf; + int error; + + wr = d->wr; + path = atticpath(coll->co_prefix, name); + fa = fattr_frompath(path, FATTR_NOFOLLOW); + if (fa == NULL) { + /* We don't have it, so send request to get it. */ + error = proto_printf(wr, "A %s\n", name); + if (error) + return (DETAILER_ERR_WRITE); + free(path); + return (0); + } + + rf = rcsfile_frompath(path, name, coll->co_cvsroot, coll->co_tag, 1); + free(path); + if (rf == NULL) { + error = proto_printf(wr, "A %s\n", name); + if (error) + return (DETAILER_ERR_WRITE); + return (0); + } + /* Tell to update the RCS file. The client version details follow. */ + rcsfile_send_details(rf, wr); + rcsfile_free(rf); + fattr_free(fa); + return (0); +} + +static int +detailer_dofile_co(struct detailer *d, struct coll *coll, struct status *st, + char *file) +{ struct stream *wr; struct fattr *fa; struct statusrec *sr; + char md5[MD5_DIGEST_SIZE]; char *path; int error, ret; @@ -337,3 +523,81 @@ detailer_dofile(struct detailer *d, stru return (DETAILER_ERR_WRITE); return (0); } + +int +detailer_checkrcsattr(struct detailer *d, struct coll *coll, char *name, + struct fattr *server_attr, int attic) +{ + struct fattr *client_attr; + char *attr, *path; + int error; + + /* + * I don't think we can use the status file, since it only records file + * attributes in cvsmode. + */ + client_attr = NULL; + path = cvspath(coll->co_prefix, name, attic); + if (path == NULL) { + return (DETAILER_ERR_PROTO); + } + + if (access(path, F_OK) == 0 && + ((client_attr = fattr_frompath(path, FATTR_NOFOLLOW)) != NULL) && + fattr_equal(client_attr, server_attr)) { + attr = fattr_encode(client_attr, NULL, 0); + if (attic) { + error = proto_printf(d->wr, "l %s %s\n", name, attr); + } else { + error = proto_printf(d->wr, "L %s %s\n", name, attr); + } + free(attr); + free(path); + fattr_free(client_attr); + if (error) + return (DETAILER_ERR_WRITE); + return (0); + } + /* We don't have it, so tell the server to send it. */ + error = detailer_send_details(d, coll, name, path, client_attr); + fattr_free(client_attr); + free(path); + return (error); +} + +int +detailer_send_details(struct detailer *d, struct coll *coll, char *name, + char *path, struct fattr *fa) +{ + int error; + size_t len; + + /* + * Try to check if the file exists either live or dead to see if we can + * edit it and put it live or dead, rather than receiving the entire + * file. + */ + if (fa == NULL) { + path = atticpath(coll->co_prefix, name); + fa = fattr_frompath(path, FATTR_NOFOLLOW); + } + if (fa == NULL) { + error = proto_printf(d->wr, "A %s\n", name); + if (error) + return (DETAILER_ERR_WRITE); + } else if (fattr_type(fa) == FT_FILE) { + if (isrcs(name, &len) && !(coll->co_options & CO_NORCS)) { + detailer_dofile_rcs(d, coll, name, path); + } else if (!(coll->co_options & CO_NORSYNC) && + !globtree_test(coll->co_norsync, name)) { + detailer_dofile_rsync(d, name, path); + } else { + detailer_dofile_regular(d, name, path); + } + } else { + error = proto_printf(d->wr, "N %s\n", name); + if (error) + return (DETAILER_ERR_WRITE); + } + return (0); +} Modified: stable/7/contrib/csup/diff.c ============================================================================== --- stable/7/contrib/csup/diff.c Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/diff.c Tue Mar 17 06:54:41 2009 (r189918) @@ -26,9 +26,12 @@ * $FreeBSD$ */ +#include + #include #include #include +#include #include #include @@ -36,15 +39,20 @@ #include "keyword.h" #include "misc.h" #include "stream.h" +#include "queue.h" typedef long lineno_t; #define EC_ADD 0 #define EC_DEL 1 +#define MAXKEY LONG_MAX /* Editing command and state. */ struct editcmd { int cmd; + long key; + int havetext; + int offset; lineno_t where; lineno_t count; lineno_t lasta; @@ -55,20 +63,28 @@ struct editcmd { struct diffinfo *di; struct stream *orig; struct stream *dest; + LIST_ENTRY(editcmd) next; +}; + +struct diffstart { + LIST_HEAD(, editcmd) dhead; }; static int diff_geteditcmd(struct editcmd *, char *); static int diff_copyln(struct editcmd *, lineno_t); +static int diff_ignoreln(struct editcmd *, lineno_t); static void diff_write(struct editcmd *, void *, size_t); +static int diff_insert_edit(struct diffstart *, struct editcmd *); +static void diff_free(struct diffstart *); int diff_apply(struct stream *rd, struct stream *orig, struct stream *dest, - struct keyword *keyword, struct diffinfo *di) + struct keyword *keyword, struct diffinfo *di, int comode) { struct editcmd ec; lineno_t i; - char *line; size_t size; + char *line; int empty, error, noeol; memset(&ec, 0, sizeof(ec)); @@ -104,7 +120,7 @@ diff_apply(struct stream *rd, struct str line = stream_getln(rd, &size); if (line == NULL) return (-1); - if (line[0] == '.') { + if (comode && line[0] == '.') { line++; size--; } @@ -124,10 +140,10 @@ diff_apply(struct stream *rd, struct str } line = stream_getln(rd, NULL); } - if (line == NULL) + if (comode && line == NULL) return (-1); /* If we got ".+", there's no ending newline. */ - if (strcmp(line, ".+") == 0 && !empty) + if (comode && strcmp(line, ".+") == 0 && !empty) noeol = 1; ec.where = 0; while ((line = stream_getln(orig, &size)) != NULL) @@ -143,6 +159,198 @@ diff_apply(struct stream *rd, struct str return (0); } +/* + * Reverse a diff using the same algorithm as in cvsup. + */ +static int +diff_write_reverse(struct stream *dest, struct diffstart *ds) +{ + struct editcmd *ec, *nextec; + long editline, endline, firstoutputlinedeleted; + long num_added, num_deleted, startline; + int num; + + nextec = LIST_FIRST(&ds->dhead); + editline = 0; + num = 0; + while (nextec != NULL) { + ec = nextec; + nextec = LIST_NEXT(nextec, next); + if (nextec == NULL) + break; + num++; + num_deleted = 0; + if (ec->havetext) + num_deleted = ec->count; + num_added = num_deleted + nextec->offset - ec->offset; + if (num_deleted > 0) { + firstoutputlinedeleted = ec->key - num_deleted + 1; + stream_printf(dest, "d%ld %ld\n", firstoutputlinedeleted, + num_deleted); + if (num_added <= 0) + continue; + } + if (num_added > 0) { + stream_printf(dest, "a%ld %ld\n", ec->key, num_added); + startline = ec->key - num_deleted + 1 + ec->offset; + endline = startline + num_added - 1; + + /* Copy lines from original file. First ignore some. */ + ec->editline = editline; + diff_ignoreln(ec, startline - 1); + diff_copyln(ec, endline); + editline = ec->editline; + } + } + return (0); +} + +/* + * Insert a diff into the list sorted on key. Should perhaps use quicker + * algorithms than insertion sort, but do this for now. + */ +static int +diff_insert_edit(struct diffstart *ds, struct editcmd *ec) +{ + struct editcmd *curec; + + if (ec == NULL) + return (0); + + if (LIST_EMPTY(&ds->dhead)) { + LIST_INSERT_HEAD(&ds->dhead, ec, next); + return (0); + } + + /* Insertion sort based on key. */ + LIST_FOREACH(curec, &ds->dhead, next) { + if (ec->key < curec->key) { + LIST_INSERT_BEFORE(curec, ec, next); + return (0); + } + if (LIST_NEXT(curec, next) == NULL) + break; + } + /* Just insert it after. */ + LIST_INSERT_AFTER(curec, ec, next); + return (0); +} + +static void +diff_free(struct diffstart *ds) +{ + struct editcmd *ec; + + while(!LIST_EMPTY(&ds->dhead)) { + ec = LIST_FIRST(&ds->dhead); + LIST_REMOVE(ec, next); + free(ec); + } +} + +/* + * Write the reverse diff from the diff in rd, and original file into + * destination. This algorithm is the same as used in cvsup. + */ +int +diff_reverse(struct stream *rd, struct stream *orig, struct stream *dest, + struct keyword *keyword, struct diffinfo *di) +{ + struct diffstart ds; + struct editcmd ec, *addec, *delec; + lineno_t i; + char *line; + int error, offset; + + memset(&ec, 0, sizeof(ec)); + ec.orig = orig; + ec.dest = dest; + ec.keyword = keyword; + ec.di = di; + addec = NULL; + delec = NULL; + ec.havetext = 0; + offset = 0; + LIST_INIT(&ds.dhead); + + /* Start with next since we need it. */ + line = stream_getln(rd, NULL); + /* First we build up the list of diffs from input. */ + while (line != NULL) { + error = diff_geteditcmd(&ec, line); + if (error) + break; + if (ec.cmd == EC_ADD) { + addec = xmalloc(sizeof(struct editcmd)); + *addec = ec; + addec->havetext = 1; + /* Ignore the lines we was supposed to add. */ + for (i = 0; i < ec.count; i++) { + line = stream_getln(rd, NULL); + if (line == NULL) + return (-1); + } + + /* Get the next diff command if we have one. */ + addec->key = addec->where + addec->count - offset; + if (delec != NULL && + delec->key == addec->key - addec->count) { + delec->key = addec->key; + delec->havetext = addec->havetext; + delec->count = addec->count; + diff_insert_edit(&ds, delec); + free(addec); + delec = NULL; + addec = NULL; + } else { + if (delec != NULL) { + diff_insert_edit(&ds, delec); + } + delec = NULL; + addec->offset = offset; + diff_insert_edit(&ds, addec); + addec = NULL; + } + offset -= ec.count; + } else if (ec.cmd == EC_DEL) { + if (delec != NULL) { + /* Update offset to our next. */ + diff_insert_edit(&ds, delec); + delec = NULL; + } + delec = xmalloc(sizeof(struct editcmd)); + *delec = ec; + delec->key = delec->where - 1 - offset; + delec->offset = offset; + delec->count = 0; + delec->havetext = 0; + /* Important to use the count we had before reset.*/ + offset += ec.count; + } + line = stream_getln(rd, NULL); + } + + while (line != NULL) + line = stream_getln(rd, NULL); + if (delec != NULL) { + diff_insert_edit(&ds, delec); + delec = NULL; + } + + addec = xmalloc(sizeof(struct editcmd)); + /* Should be filesize, but we set it to max value. */ + addec->key = MAXKEY; + addec->offset = offset; + addec->havetext = 0; + addec->count = 0; + diff_insert_edit(&ds, addec); + addec = NULL; + diff_write_reverse(dest, &ds); + diff_free(&ds); + stream_flush(dest); + return (0); +} + /* Get an editing command from the diff. */ static int diff_geteditcmd(struct editcmd *ec, char *line) @@ -181,8 +389,8 @@ diff_geteditcmd(struct editcmd *ec, char static int diff_copyln(struct editcmd *ec, lineno_t to) { - char *line; size_t size; + char *line; while (ec->editline < to) { line = stream_getln(ec->orig, &size); @@ -194,12 +402,28 @@ diff_copyln(struct editcmd *ec, lineno_t return (0); } +/* Ignore lines from the original version of the file up to line "to". */ +static int +diff_ignoreln(struct editcmd *ec, lineno_t to) +{ + size_t size; + char *line; + + while (ec->editline < to) { + line = stream_getln(ec->orig, &size); + if (line == NULL) + return (-1); + ec->editline++; + } + return (0); +} + /* Write a new line to the file, expanding RCS keywords appropriately. */ static void diff_write(struct editcmd *ec, void *buf, size_t size) { - char *line, *newline; size_t newsize; + char *line, *newline; int ret; line = buf; Modified: stable/7/contrib/csup/diff.h ============================================================================== --- stable/7/contrib/csup/diff.h Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/diff.h Tue Mar 17 06:54:41 2009 (r189918) @@ -45,6 +45,8 @@ struct diffinfo { }; int diff_apply(struct stream *, struct stream *, struct stream *, - struct keyword *, struct diffinfo *); + struct keyword *, struct diffinfo *, int); +int diff_reverse(struct stream *, struct stream *, + struct stream *, struct keyword *, struct diffinfo *); #endif /* !_DIFF_H_ */ Modified: stable/7/contrib/csup/fattr.c ============================================================================== --- stable/7/contrib/csup/fattr.c Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/fattr.c Tue Mar 17 06:54:41 2009 (r189918) @@ -44,7 +44,7 @@ /* * Include the appropriate definition for the file attributes we support. * There are two different files: fattr_bsd.h for BSD-like systems that - * support the extended file flags à la chflags() and fattr_posix.h for + * support the extended file flags a la chflags() and fattr_posix.h for * bare POSIX systems that don't. */ #ifdef HAVE_FFLAGS @@ -449,7 +449,7 @@ fattr_encode(const struct fattr *fa, fat piece++; } if (mask & FA_DEV) { - vallen = snprintf(piece->val, sizeof(piece->val), "%lld", + vallen = snprintf(piece->val, sizeof(piece->val), "%llx", (long long)fa->dev); len += snprintf(piece->len, sizeof(piece->len), "%lld", (long long)vallen) + vallen + 1; @@ -534,6 +534,13 @@ fattr_getlinkcount(const struct fattr *f return (fa->linkcount); } +char * +fattr_getlinktarget(const struct fattr *fa) +{ + + return (fa->linktarget); +} + /* * Eat the specified attribute and put it in the file attribute * structure. Returns NULL on error, or a pointer to the next @@ -732,18 +739,28 @@ fattr_makenode(const struct fattr *fa, c mode_t modemask, mode; int error; + error = 0; + if (fa->mask & FA_OWNER && fa->mask & FA_GROUP) modemask = FA_SETIDMASK | FA_PERMMASK; else modemask = FA_PERMMASK; /* We only implement fattr_makenode() for dirs for now. */ - assert(fa->type == FT_DIRECTORY); if (fa->mask & FA_MODE) mode = fa->mode & modemask; else mode = 0700; - error = mkdir(path, mode); + + if (fa->type == FT_DIRECTORY) + error = mkdir(path, mode); + else if (fa->type == FT_SYMLINK) { + error = symlink(fa->linktarget, path); + } else if (fa->type == FT_CDEV) { + lprintf(-1, "Character devices not supported!\n"); + } else if (fa->type == FT_BDEV) { + lprintf(-1, "Block devices not supported!\n"); + } return (error); } @@ -823,6 +840,19 @@ fattr_install(struct fattr *fa, const ch } #endif + /* + * If it is changed from a file to a symlink, remove the file + * and create the symlink. + */ + if (inplace && (fa->type == FT_SYMLINK) && + (old->type == FT_FILE)) { + error = unlink(topath); + if (error) + goto bad; + error = symlink(fa->linktarget, topath); + if (error) + goto bad; + } /* Determine whether we need to remove the target first. */ if (!inplace && (fa->type == FT_DIRECTORY) != (old->type == FT_DIRECTORY)) { @@ -853,8 +883,9 @@ fattr_install(struct fattr *fa, const ch if (mask & FA_GROUP) gid = fa->gid; error = chown(frompath, uid, gid); - if (error) + if (error) { goto bad; + } } if (mask & FA_MODE) { newmode = fa->mode & modemask; @@ -901,6 +932,9 @@ fattr_equal(const struct fattr *fa1, con mask = fa1->mask & fa2->mask; if (fa1->type == FT_UNKNOWN || fa2->type == FT_UNKNOWN) return (0); + if (mask & FA_FILETYPE) + if (fa1->type != fa2->type) + return (0); if (mask & FA_MODTIME) if (fa1->modtime != fa2->modtime) return (0); @@ -936,3 +970,12 @@ fattr_equal(const struct fattr *fa1, con return (0); return (1); } + +/* + * Must have to get the correct filesize sendt by the server. + */ +off_t +fattr_filesize(const struct fattr *fa) +{ + return (fa->size); +} Modified: stable/7/contrib/csup/fattr.h ============================================================================== --- stable/7/contrib/csup/fattr.h Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/fattr.h Tue Mar 17 06:54:41 2009 (r189918) @@ -101,6 +101,7 @@ int fattr_type(const struct fattr *); void fattr_maskout(struct fattr *, int); int fattr_getmask(const struct fattr *); nlink_t fattr_getlinkcount(const struct fattr *); +char *fattr_getlinktarget(const struct fattr *); void fattr_umask(struct fattr *, mode_t); void fattr_merge(struct fattr *, const struct fattr *); void fattr_mergedefault(struct fattr *); @@ -111,5 +112,7 @@ int fattr_install(struct fattr *, cons int fattr_equal(const struct fattr *, const struct fattr *); void fattr_free(struct fattr *); int fattr_supported(int); +off_t fattr_filesize(const struct fattr *); + #endif /* !_FATTR_H_ */ Modified: stable/7/contrib/csup/keyword.c ============================================================================== --- stable/7/contrib/csup/keyword.c Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/keyword.c Tue Mar 17 06:54:41 2009 (r189918) @@ -152,6 +152,29 @@ keyword_decode_expand(const char *expand return (-1); } +const char * +keyword_encode_expand(int expand) +{ + + switch (expand) { + case EXPAND_DEFAULT: + return ("."); + case EXPAND_KEYVALUE: + return ("kv"); + case EXPAND_KEYVALUELOCKER: + return ("kvl"); + case EXPAND_KEY: + return ("k"); + case EXPAND_OLD: + return ("o"); + case EXPAND_BINARY: + return ("b"); + case EXPAND_VALUE: + return ("v"); + } + return (NULL); +} + void keyword_free(struct keyword *keyword) { Modified: stable/7/contrib/csup/keyword.h ============================================================================== --- stable/7/contrib/csup/keyword.h Tue Mar 17 05:57:43 2009 (r189917) +++ stable/7/contrib/csup/keyword.h Tue Mar 17 06:54:41 2009 (r189918) @@ -42,6 +42,7 @@ struct keyword; struct keyword *keyword_new(void); int keyword_decode_expand(const char *); +const char *keyword_encode_expand(int); int keyword_alias(struct keyword *, const char *, const char *); int keyword_enable(struct keyword *, const char *); int keyword_disable(struct keyword *, const char *); Copied: stable/7/contrib/csup/lex.rcs.c (from r186781, head/contrib/csup/lex.rcs.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/contrib/csup/lex.rcs.c Tue Mar 17 06:54:41 2009 (r189918, copy of r186781, head/contrib/csup/lex.rcs.c) @@ -0,0 +1,2094 @@ + +#line 3 "lex.rcs.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 17 10:15: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 9528C106566C; Tue, 17 Mar 2009 10:15:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81FDE8FC13; Tue, 17 Mar 2009 10:15:49 +0000 (UTC) (envelope-from rwatson@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 n2HAFnLf092045; Tue, 17 Mar 2009 10:15:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HAFnDa092044; Tue, 17 Mar 2009 10:15:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903171015.n2HAFnDa092044@svn.freebsd.org> From: Robert Watson Date: Tue, 17 Mar 2009 10:15: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: r189920 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet 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, 17 Mar 2009 10:15:50 -0000 Author: rwatson Date: Tue Mar 17 10:15:49 2009 New Revision: 189920 URL: http://svn.freebsd.org/changeset/base/189920 Log: Merge r188992 from head to stable/7: In tcp_usr_shutdown() and tcp_usr_send(), I missed converting NULL checks for the tcpcb, previously used to detect complete disconnection, with INP_DROPPED checks. Correct that, preventing shutdown() from improperly generating a TCP segment with destination IP and port of 0.0.0.0:0. PR: kern/132050 Reported by: david gueluy Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/tcp_usrreq.c Modified: stable/7/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/7/sys/netinet/tcp_usrreq.c Tue Mar 17 09:50:40 2009 (r189919) +++ stable/7/sys/netinet/tcp_usrreq.c Tue Mar 17 10:15:49 2009 (r189920) @@ -712,7 +712,8 @@ tcp_usr_shutdown(struct socket *so) TCPDEBUG1(); socantsendmore(so); tcp_usrclosed(tp); - error = tcp_output_disconnect(tp); + if (!(inp->inp_vflag & INP_DROPPED)) + error = tcp_output_disconnect(tp); out: TCPDEBUG2(PRU_SHUTDOWN); @@ -844,7 +845,7 @@ tcp_usr_send(struct socket *so, int flag INP_INFO_WUNLOCK(&tcbinfo); headlocked = 0; } - if (tp != NULL) { + if (!(inp->inp_vflag & INP_DROPPED)) { if (flags & PRUS_MORETOCOME) tp->t_flags |= TF_MORETOCOME; error = tcp_output_send(tp); From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 17 14:18: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 F1E721065670; Tue, 17 Mar 2009 14:17:59 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DED9D8FC13; Tue, 17 Mar 2009 14:17:59 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HEHxlv097105; Tue, 17 Mar 2009 14:17:59 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HEHxNa097104; Tue, 17 Mar 2009 14:17:59 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200903171417.n2HEHxNa097104@svn.freebsd.org> From: Ken Smith Date: Tue, 17 Mar 2009 14:17: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: r189929 - stable/7/sys/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2009 14:18:01 -0000 Author: kensmith Date: Tue Mar 17 14:17:59 2009 New Revision: 189929 URL: http://svn.freebsd.org/changeset/base/189929 Log: We're a little less than a week from code freeze for the 7.2-REL release cycle. Give people a heads-up that there might be higher than usual developer activity during this period by starting to call it 7.2-PRERELEASE now. Modified: stable/7/sys/conf/newvers.sh Modified: stable/7/sys/conf/newvers.sh ============================================================================== --- stable/7/sys/conf/newvers.sh Tue Mar 17 13:07:11 2009 (r189928) +++ stable/7/sys/conf/newvers.sh Tue Mar 17 14:17:59 2009 (r189929) @@ -31,8 +31,8 @@ # $FreeBSD$ TYPE="FreeBSD" -REVISION="7.1" -BRANCH="STABLE" +REVISION="7.2" +BRANCH="PRERELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 17 14:29:26 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A0C91065677; Tue, 17 Mar 2009 14:29:26 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 170348FC1E; Tue, 17 Mar 2009 14:29:26 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HETP6k097507; Tue, 17 Mar 2009 14:29:25 GMT (envelope-from rafan@svn.freebsd.org) Received: (from rafan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HETPY4097506; Tue, 17 Mar 2009 14:29:25 GMT (envelope-from rafan@svn.freebsd.org) Message-Id: <200903171429.n2HETPY4097506@svn.freebsd.org> From: Rong-En Fan Date: Tue, 17 Mar 2009 14:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189930 - 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: Tue, 17 Mar 2009 14:29:27 -0000 Author: rafan Date: Tue Mar 17 14:29:25 2009 New Revision: 189930 URL: http://svn.freebsd.org/changeset/base/189930 Log: MFC r189216 (ahead original schedule due to the upcoming 7.2-RELEASE) - Remove kH (kp_kll) from screen. It has the identical key sequence as @7 (kp_end). As ncurses has the limitation that it returns the first matched key symbol, you can not use END in ncurses based program under screen (like ports/misc/mc). We did similar changes to xterm entry last year for exactly the same reason. PR: 132199 Submitted by: Timur I. Bakeyev 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 Tue Mar 17 14:17:59 2009 (r189929) +++ stable/7/share/termcap/termcap.src Tue Mar 17 14:29:25 2009 (r189930) @@ -2771,7 +2771,7 @@ 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~:\ - :kh=\E[1~:kI=\E[2~:kD=\E[3~:kH=\E[4~:@7=\E[4~:kP=\E[5~:\ + :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:\ :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\ From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 17 19:38:41 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 E82B41065723; Tue, 17 Mar 2009 19:38:40 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE1178FC18; Tue, 17 Mar 2009 19:38:40 +0000 (UTC) (envelope-from marcel@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 n2HJceCM004513; Tue, 17 Mar 2009 19:38:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HJceUA004503; Tue, 17 Mar 2009 19:38:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200903171938.n2HJceUA004503@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 17 Mar 2009 19:38: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: r189935 - in stable/7/sys: . contrib/pf dev/ata dev/ath/ath_hal dev/cxgb geom geom/part modules/geom/geom_part modules/geom/geom_part/geom_part_ebr 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, 17 Mar 2009 19:38:44 -0000 Author: marcel Date: Tue Mar 17 19:38:40 2009 New Revision: 189935 URL: http://svn.freebsd.org/changeset/base/189935 Log: Sync gpart with the trunk. This includes: o APM scheme supports Tivo Series 1 partitions (read only). o Bootcode support added to BSD scheme. o New EBR scheme to support Extended Boot Records (logical partitions). o PC98 scheme fixes (credits to nyan@) o VTOC8 scheme fixes (credits to marius@) Added: stable/7/sys/geom/part/g_part_ebr.c - copied, changed from r188354, head/sys/geom/part/g_part_ebr.c stable/7/sys/modules/geom/geom_part/geom_part_ebr/ - copied from r188354, head/sys/modules/geom/geom_part/geom_part_ebr/ Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ata/atapi-cd.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/geom/geom.h stable/7/sys/geom/geom_dev.c stable/7/sys/geom/geom_subr.c stable/7/sys/geom/part/g_part.c stable/7/sys/geom/part/g_part.h stable/7/sys/geom/part/g_part_apm.c stable/7/sys/geom/part/g_part_bsd.c stable/7/sys/geom/part/g_part_gpt.c stable/7/sys/geom/part/g_part_if.m stable/7/sys/geom/part/g_part_mbr.c stable/7/sys/geom/part/g_part_pc98.c stable/7/sys/geom/part/g_part_vtoc8.c stable/7/sys/modules/geom/geom_part/Makefile stable/7/sys/sys/disk.h stable/7/sys/sys/diskpc98.h Modified: stable/7/sys/dev/ata/atapi-cd.c ============================================================================== --- stable/7/sys/dev/ata/atapi-cd.c Tue Mar 17 19:37:47 2009 (r189934) +++ stable/7/sys/dev/ata/atapi-cd.c Tue Mar 17 19:38:40 2009 (r189935) @@ -218,7 +218,10 @@ acd_geom_ioctl(struct g_provider *pp, u_ case CDIOCRESET: acd_test_ready(dev); break; - + + case DIOCGPROVIDERALIAS: + break; + default: acd_read_toc(dev); acd_prevent_allow(dev, 1); Modified: stable/7/sys/geom/geom.h ============================================================================== --- stable/7/sys/geom/geom.h Tue Mar 17 19:37:47 2009 (r189934) +++ stable/7/sys/geom/geom.h Tue Mar 17 19:38:40 2009 (r189935) @@ -227,10 +227,11 @@ void g_error_provider(struct g_provider struct g_provider *g_provider_by_name(char const *arg); int g_getattr__(const char *attr, struct g_consumer *cp, void *var, int len); #define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof *(v)) -int g_handleattr(struct bio *bp, const char *attribute, void *val, int len); +int g_handleattr(struct bio *bp, const char *attribute, const void *val, + int len); int g_handleattr_int(struct bio *bp, const char *attribute, int val); int g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val); -int g_handleattr_str(struct bio *bp, const char *attribute, char *str); +int g_handleattr_str(struct bio *bp, const char *attribute, const char *str); struct g_consumer * g_new_consumer(struct g_geom *gp); struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...); struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...); Modified: stable/7/sys/geom/geom_dev.c ============================================================================== --- stable/7/sys/geom/geom_dev.c Tue Mar 17 19:37:47 2009 (r189934) +++ stable/7/sys/geom/geom_dev.c Tue Mar 17 19:38:40 2009 (r189935) @@ -124,6 +124,7 @@ g_dev_taste(struct g_class *mp, struct g { struct g_geom *gp; struct g_consumer *cp; + char *alias; int error; struct cdev *dev; u_int unit; @@ -147,6 +148,17 @@ g_dev_taste(struct g_class *mp, struct g gp->softc = dev; dev->si_drv1 = gp; dev->si_drv2 = cp; + + g_topology_unlock(); + + alias = g_malloc(MAXPATHLEN, M_WAITOK | M_ZERO); + error = (pp->geom->ioctl == NULL) ? ENODEV : + pp->geom->ioctl(pp, DIOCGPROVIDERALIAS, alias, 0, curthread); + if (!error && alias[0] != '\0') + make_dev_alias(dev, "%s", alias); + g_free(alias); + + g_topology_lock(); return (gp); } Modified: stable/7/sys/geom/geom_subr.c ============================================================================== --- stable/7/sys/geom/geom_subr.c Tue Mar 17 19:37:47 2009 (r189934) +++ stable/7/sys/geom/geom_subr.c Tue Mar 17 19:38:40 2009 (r189935) @@ -856,14 +856,14 @@ g_handleattr_off_t(struct bio *bp, const } int -g_handleattr_str(struct bio *bp, const char *attribute, char *str) +g_handleattr_str(struct bio *bp, const char *attribute, const char *str) { return (g_handleattr(bp, attribute, str, 0)); } int -g_handleattr(struct bio *bp, const char *attribute, void *val, int len) +g_handleattr(struct bio *bp, const char *attribute, const void *val, int len) { int error = 0; @@ -880,12 +880,13 @@ g_handleattr(struct bio *bp, const char } } else if (bp->bio_length == len) { bcopy(val, bp->bio_data, len); - bp->bio_completed = len; } else { printf("%s: %s bio_length %jd len %d -> EFAULT\n", __func__, bp->bio_to->name, (intmax_t)bp->bio_length, len); error = EFAULT; } + if (error == 0) + bp->bio_completed = bp->bio_length; g_io_deliver(bp, error); return (1); } Modified: stable/7/sys/geom/part/g_part.c ============================================================================== --- stable/7/sys/geom/part/g_part.c Tue Mar 17 19:37:47 2009 (r189934) +++ stable/7/sys/geom/part/g_part.c Tue Mar 17 19:38:40 2009 (r189935) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002, 2005-2008 Marcel Moolenaar + * Copyright (c) 2002, 2005-2009 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -86,6 +87,7 @@ static g_taste_t g_part_taste; static g_access_t g_part_access; static g_dumpconf_t g_part_dumpconf; +static g_ioctl_t g_part_ioctl; static g_orphan_t g_part_orphan; static g_spoiled_t g_part_spoiled; static g_start_t g_part_start; @@ -102,6 +104,7 @@ static struct g_class g_part_class = { /* Geom methods. */ .access = g_part_access, .dumpconf = g_part_dumpconf, + .ioctl = g_part_ioctl, .orphan = g_part_orphan, .spoiled = g_part_spoiled, .start = g_part_start, @@ -109,23 +112,6 @@ static struct g_class g_part_class = { DECLARE_GEOM_CLASS(g_part_class, g_part); -enum g_part_ctl { - G_PART_CTL_NONE, - G_PART_CTL_ADD, - G_PART_CTL_BOOTCODE, - G_PART_CTL_COMMIT, - G_PART_CTL_CREATE, - G_PART_CTL_DELETE, - G_PART_CTL_DESTROY, - G_PART_CTL_MODIFY, - G_PART_CTL_MOVE, - G_PART_CTL_RECOVER, - G_PART_CTL_RESIZE, - G_PART_CTL_SET, - G_PART_CTL_UNDO, - G_PART_CTL_UNSET -}; - /* * Support functions. */ @@ -181,10 +167,8 @@ g_part_geometry(struct g_part_table *tab u_int heads, sectors; int idx; - if (g_getattr("GEOM::fwsectors", cp, §ors) != 0 || - sectors < 1 || sectors > 63 || - g_getattr("GEOM::fwheads", cp, &heads) != 0 || - heads < 1 || heads > 255) { + if (g_getattr("GEOM::fwsectors", cp, §ors) != 0 || sectors == 0 || + g_getattr("GEOM::fwheads", cp, &heads) != 0 || heads == 0) { table->gpt_fixgeom = 0; table->gpt_heads = 0; table->gpt_sectors = 0; @@ -245,7 +229,8 @@ g_part_new_entry(struct g_part_table *ta LIST_INSERT_HEAD(&table->gpt_entry, entry, gpe_entry); else LIST_INSERT_AFTER(last, entry, gpe_entry); - } + } else + entry->gpe_offset = 0; entry->gpe_start = start; entry->gpe_end = end; return (entry); @@ -258,11 +243,14 @@ g_part_new_provider(struct g_geom *gp, s char buf[32]; struct g_consumer *cp; struct g_provider *pp; + off_t offset; cp = LIST_FIRST(&gp->consumer); pp = cp->provider; - entry->gpe_offset = entry->gpe_start * pp->sectorsize; + offset = entry->gpe_start * pp->sectorsize; + if (entry->gpe_offset < offset) + entry->gpe_offset = offset; if (entry->gpe_pp == NULL) { entry->gpe_pp = g_new_providerf(gp, "%s%s", gp->name, @@ -272,6 +260,7 @@ g_part_new_provider(struct g_geom *gp, s entry->gpe_pp->index = entry->gpe_index - 1; /* index is 1-based. */ entry->gpe_pp->mediasize = (entry->gpe_end - entry->gpe_start + 1) * pp->sectorsize; + entry->gpe_pp->mediasize -= entry->gpe_offset - offset; entry->gpe_pp->sectorsize = pp->sectorsize; entry->gpe_pp->flags = pp->flags & G_PF_CANDELETE; if (pp->stripesize > 0) { @@ -534,8 +523,8 @@ g_part_ctl_bootcode(struct gctl_req *req error = ENODEV; goto fail; } - if (gpp->gpp_codesize != sz) { - error = EINVAL; + if (gpp->gpp_codesize > sz) { + error = EFBIG; goto fail; } @@ -579,6 +568,8 @@ g_part_ctl_commit(struct gctl_req *req, return (EPERM); } + g_topology_unlock(); + cp = LIST_FIRST(&gp->consumer); if ((table->gpt_smhead | table->gpt_smtail) != 0) { pp = cp->provider; @@ -607,6 +598,7 @@ g_part_ctl_commit(struct gctl_req *req, } if (table->gpt_scheme == &g_part_null_scheme) { + g_topology_lock(); g_access(cp, -1, -1, -1); g_part_wither(gp, ENXIO); return (0); @@ -627,10 +619,13 @@ g_part_ctl_commit(struct gctl_req *req, } table->gpt_created = 0; table->gpt_opened = 0; + + g_topology_lock(); g_access(cp, -1, -1, -1); return (0); fail: + g_topology_lock(); gctl_error(req, "%d", error); return (error); } @@ -714,14 +709,6 @@ g_part_ctl_create(struct gctl_req *req, error = g_getattr("PART::depth", cp, &attr); table->gpt_depth = (!error) ? attr + 1 : 0; - /* If we're nested, get the absolute sector offset on disk. */ - if (table->gpt_depth) { - error = g_getattr("PART::offset", cp, &attr); - if (error) - goto fail; - table->gpt_offset = attr; - } - /* * Synthesize a disk geometry. Some partitioning schemes * depend on it and since some file systems need it even @@ -1345,7 +1332,7 @@ g_part_ctlreq(struct gctl_req *req, stru /* Obtain permissions if possible/necessary. */ close_on_error = 0; - table = NULL; /* Suppress uninit. warning. */ + table = NULL; if (modifies && (gpp.gpp_parms & G_PART_PARM_GEOM)) { table = gpp.gpp_geom->softc; if (table != NULL && !table->gpt_opened) { @@ -1361,7 +1348,16 @@ g_part_ctlreq(struct gctl_req *req, stru } } - error = EDOOFUS; /* Prevent bogus uninit. warning. */ + /* Allow the scheme to check or modify the parameters. */ + if (table != NULL) { + error = G_PART_PRECHECK(table, ctlreq, &gpp); + if (error) { + gctl_error(req, "%d pre-check failed", error); + goto out; + } + } else + error = EDOOFUS; /* Prevent bogus uninit. warning. */ + switch (ctlreq) { case G_PART_CTL_NONE: panic("%s", __func__); @@ -1417,6 +1413,7 @@ g_part_ctlreq(struct gctl_req *req, stru } } + out: if (error && close_on_error) { g_access(LIST_FIRST(&gpp.gpp_geom->consumer), -1, -1, -1); table->gpt_opened = 0; @@ -1442,6 +1439,7 @@ g_part_taste(struct g_class *mp, struct struct g_geom *gp; struct g_part_entry *entry; struct g_part_table *table; + struct root_hold_token *rht; int attr, depth; int error; @@ -1463,6 +1461,7 @@ g_part_taste(struct g_class *mp, struct return (NULL); } + rht = root_mount_hold(mp->name); g_topology_unlock(); /* @@ -1489,14 +1488,6 @@ g_part_taste(struct g_class *mp, struct table = gp->softc; - /* If we're nested, get the absolute sector offset on disk. */ - if (table->gpt_depth) { - error = g_getattr("PART::offset", cp, &attr); - if (error) - goto fail; - table->gpt_offset = attr; - } - /* * Synthesize a disk geometry. Some partitioning schemes * depend on it and since some file systems need it even @@ -1515,11 +1506,13 @@ g_part_taste(struct g_class *mp, struct g_part_new_provider(gp, table, entry); } + root_mount_rel(rht); g_access(cp, -1, 0, 0); return (gp); fail: g_topology_lock(); + root_mount_rel(rht); g_access(cp, -1, 0, 0); g_part_wither(gp, error); return (NULL); @@ -1576,6 +1569,10 @@ g_part_dumpconf(struct sbuf *sb, const c entry = pp->private; if (entry == NULL) return; + sbuf_printf(sb, "%s%ju\n", indent, + (uintmax_t)entry->gpe_start); + sbuf_printf(sb, "%s%ju\n", indent, + (uintmax_t)entry->gpe_end); sbuf_printf(sb, "%s%u\n", indent, entry->gpe_index); sbuf_printf(sb, "%s%s\n", indent, @@ -1602,6 +1599,31 @@ g_part_dumpconf(struct sbuf *sb, const c } } +static int +g_part_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, + struct thread *td) +{ + struct g_geom *gp; + struct g_part_table *table; + struct g_part_entry *entry; + int error; + + gp = pp->geom; + table = gp->softc; + entry = pp->private; + + switch (cmd) { + case DIOCGPROVIDERALIAS: + error = G_PART_DEVALIAS(table, entry, data, MAXPATHLEN); + break; + default: + error = ENOTTY; + break; + } + + return (error); +} + static void g_part_orphan(struct g_consumer *cp) { @@ -1681,8 +1703,8 @@ g_part_start(struct bio *bp) return; if (g_handleattr_int(bp, "PART::depth", table->gpt_depth)) return; - if (g_handleattr_int(bp, "PART::offset", - table->gpt_offset + entry->gpe_start)) + if (g_handleattr_str(bp, "PART::scheme", + table->gpt_scheme->name)) return; if (!strcmp("GEOM::kerneldump", bp->bio_attribute)) { /* @@ -1722,7 +1744,7 @@ static void g_part_init(struct g_class *mp) { - TAILQ_INSERT_TAIL(&g_part_schemes, &g_part_null_scheme, scheme_list); + TAILQ_INSERT_HEAD(&g_part_schemes, &g_part_null_scheme, scheme_list); } static void Modified: stable/7/sys/geom/part/g_part.h ============================================================================== --- stable/7/sys/geom/part/g_part.h Tue Mar 17 19:37:47 2009 (r189934) +++ stable/7/sys/geom/part/g_part.h Tue Mar 17 19:38:40 2009 (r189935) @@ -103,13 +103,6 @@ struct g_part_table { */ uint32_t gpt_sectors; uint32_t gpt_heads; - /* - * gpt_offset holds the absolute block address of the scheme - * on disk. Some partitioning schemes (historically) use - * absolute addressing. Relative addresses are obtained by - * subtracting gpt_offset from the absolute addresses. - */ - uint64_t gpt_offset; int gpt_depth; /* Sub-partitioning level. */ int gpt_isleaf:1; /* Cannot be sub-partitioned. */ @@ -122,6 +115,23 @@ struct g_part_table { struct g_part_entry *g_part_new_entry(struct g_part_table *, int, quad_t, quad_t); +enum g_part_ctl { + G_PART_CTL_NONE, + G_PART_CTL_ADD, + G_PART_CTL_BOOTCODE, + G_PART_CTL_COMMIT, + G_PART_CTL_CREATE, + G_PART_CTL_DELETE, + G_PART_CTL_DESTROY, + G_PART_CTL_MODIFY, + G_PART_CTL_MOVE, + G_PART_CTL_RECOVER, + G_PART_CTL_RESIZE, + G_PART_CTL_SET, + G_PART_CTL_UNDO, + G_PART_CTL_UNSET +}; + /* G_PART ctlreq parameters. */ #define G_PART_PARM_ENTRIES 0x0001 #define G_PART_PARM_FLAGS 0x0002 Modified: stable/7/sys/geom/part/g_part_apm.c ============================================================================== --- stable/7/sys/geom/part/g_part_apm.c Tue Mar 17 19:37:47 2009 (r189934) +++ stable/7/sys/geom/part/g_part_apm.c Tue Mar 17 19:38:40 2009 (r189935) @@ -50,6 +50,7 @@ struct g_part_apm_table { struct g_part_table base; struct apm_ddr ddr; struct apm_ent self; + int tivo_series1; }; struct g_part_apm_entry { @@ -61,12 +62,12 @@ static int g_part_apm_add(struct g_part_ struct g_part_parms *); static int g_part_apm_create(struct g_part_table *, struct g_part_parms *); static int g_part_apm_destroy(struct g_part_table *, struct g_part_parms *); -static int g_part_apm_dumpconf(struct g_part_table *, struct g_part_entry *, +static void g_part_apm_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_apm_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_apm_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); -static char *g_part_apm_name(struct g_part_table *, struct g_part_entry *, +static const char *g_part_apm_name(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_apm_probe(struct g_part_table *, struct g_consumer *); static int g_part_apm_read(struct g_part_table *, struct g_consumer *); @@ -99,6 +100,19 @@ static struct g_part_scheme g_part_apm_s }; G_PART_SCHEME_DECLARE(g_part_apm); +static void +swab(char *buf, size_t bufsz) +{ + int i; + char ch; + + for (i = 0; i < bufsz; i += 2) { + ch = buf[i]; + buf[i] = buf[i + 1]; + buf[i + 1] = ch; + } +} + static int apm_parse_type(const char *type, char *buf, size_t bufsz) { @@ -143,7 +157,8 @@ apm_parse_type(const char *type, char *b } static int -apm_read_ent(struct g_consumer *cp, uint32_t blk, struct apm_ent *ent) +apm_read_ent(struct g_consumer *cp, uint32_t blk, struct apm_ent *ent, + int tivo_series1) { struct g_provider *pp; char *buf; @@ -153,6 +168,8 @@ apm_read_ent(struct g_consumer *cp, uint buf = g_read_data(cp, pp->sectorsize * blk, pp->sectorsize, &error); if (buf == NULL) return (error); + if (tivo_series1) + swab(buf, pp->sectorsize); ent->ent_sig = be16dec(buf); ent->ent_pmblkcnt = be32dec(buf + 4); ent->ent_start = be32dec(buf + 8); @@ -231,7 +248,7 @@ g_part_apm_destroy(struct g_part_table * return (0); } -static int +static void g_part_apm_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { @@ -256,7 +273,6 @@ g_part_apm_dumpconf(struct g_part_table } else { /* confxml: scheme information */ } - return (0); } static int @@ -294,7 +310,7 @@ g_part_apm_modify(struct g_part_table *b return (0); } -static char * +static const char * g_part_apm_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) { @@ -316,6 +332,7 @@ g_part_apm_probe(struct g_part_table *ba return (ENXIO); table = (struct g_part_apm_table *)basetable; + table->tivo_series1 = 0; pp = cp->provider; /* Sanity-check the provider. */ @@ -326,17 +343,35 @@ g_part_apm_probe(struct g_part_table *ba buf = g_read_data(cp, 0L, pp->sectorsize, &error); if (buf == NULL) return (error); - table->ddr.ddr_sig = be16dec(buf); - table->ddr.ddr_blksize = be16dec(buf + 2); - table->ddr.ddr_blkcount = be32dec(buf + 4); - g_free(buf); - if (table->ddr.ddr_sig != APM_DDR_SIG) - return (ENXIO); - if (table->ddr.ddr_blksize != pp->sectorsize) - return (ENXIO); + if (be16dec(buf) == be16toh(APM_DDR_SIG)) { + /* Normal Apple DDR */ + table->ddr.ddr_sig = be16dec(buf); + table->ddr.ddr_blksize = be16dec(buf + 2); + table->ddr.ddr_blkcount = be32dec(buf + 4); + g_free(buf); + if (table->ddr.ddr_blksize != pp->sectorsize) + return (ENXIO); + } else { + /* + * Check for Tivo drives, which have no DDR and a different + * signature. Those whose first two bytes are 14 92 are + * Series 2 drives, and aren't supported. Those that start + * with 92 14 are series 1 drives and are supported. + */ + if (be16dec(buf) != 0x9214) { + /* If this is 0x1492 it could be a series 2 drive */ + g_free(buf); + return (ENXIO); + } + table->ddr.ddr_sig = APM_DDR_SIG; /* XXX */ + table->ddr.ddr_blksize = pp->sectorsize; /* XXX */ + table->ddr.ddr_blkcount = pp->mediasize / pp->sectorsize;/* XXX */ + table->tivo_series1 = 1; + g_free(buf); + } /* Check that there's a Partition Map. */ - error = apm_read_ent(cp, 1, &table->self); + error = apm_read_ent(cp, 1, &table->self, table->tivo_series1); if (error) return (error); if (table->self.ent_sig != APM_ENT_SIG) @@ -363,7 +398,7 @@ g_part_apm_read(struct g_part_table *bas basetable->gpt_entries = table->self.ent_pmblkcnt - 1; for (index = table->self.ent_pmblkcnt - 1; index > 0; index--) { - error = apm_read_ent(cp, index + 1, &ent); + error = apm_read_ent(cp, index + 1, &ent, table->tivo_series1); if (error) continue; if (!strcmp(ent.ent_type, APM_ENT_TYPE_UNUSED)) @@ -413,6 +448,11 @@ g_part_apm_write(struct g_part_table *ba int error, index; table = (struct g_part_apm_table *)basetable; + /* + * Tivo Series 1 disk partitions are currently read-only. + */ + if (table->tivo_series1) + return (EOPNOTSUPP); bzero(buf, sizeof(buf)); /* Write the DDR and 'self' entry only when we're newly created. */ Modified: stable/7/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/7/sys/geom/part/g_part_bsd.c Tue Mar 17 19:37:47 2009 (r189934) +++ stable/7/sys/geom/part/g_part_bsd.c Tue Mar 17 19:38:40 2009 (r189935) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); struct g_part_bsd_table { struct g_part_table base; - u_char *label; + u_char *bbarea; uint32_t offset; }; @@ -58,14 +58,15 @@ struct g_part_bsd_entry { static int g_part_bsd_add(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); +static int g_part_bsd_bootcode(struct g_part_table *, struct g_part_parms *); static int g_part_bsd_create(struct g_part_table *, struct g_part_parms *); static int g_part_bsd_destroy(struct g_part_table *, struct g_part_parms *); -static int g_part_bsd_dumpconf(struct g_part_table *, struct g_part_entry *, +static void g_part_bsd_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_bsd_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_bsd_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); -static char *g_part_bsd_name(struct g_part_table *, struct g_part_entry *, +static const char *g_part_bsd_name(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_bsd_probe(struct g_part_table *, struct g_consumer *); static int g_part_bsd_read(struct g_part_table *, struct g_consumer *); @@ -75,6 +76,7 @@ static int g_part_bsd_write(struct g_par static kobj_method_t g_part_bsd_methods[] = { KOBJMETHOD(g_part_add, g_part_bsd_add), + KOBJMETHOD(g_part_bootcode, g_part_bsd_bootcode), KOBJMETHOD(g_part_create, g_part_bsd_create), KOBJMETHOD(g_part_destroy, g_part_bsd_destroy), KOBJMETHOD(g_part_dumpconf, g_part_bsd_dumpconf), @@ -95,6 +97,7 @@ static struct g_part_scheme g_part_bsd_s .gps_entrysz = sizeof(struct g_part_bsd_entry), .gps_minent = 8, .gps_maxent = 20, + .gps_bootcodesz = BBSIZE, }; G_PART_SCHEME_DECLARE(g_part_bsd); @@ -157,6 +160,30 @@ g_part_bsd_add(struct g_part_table *base } static int +g_part_bsd_bootcode(struct g_part_table *basetable, struct g_part_parms *gpp) +{ + struct g_part_bsd_table *table; + const u_char *codeptr; + size_t hdsz, tlsz; + size_t codesz, tlofs; + + hdsz = 512; + tlofs = hdsz + 148 + basetable->gpt_entries * 16; + tlsz = BBSIZE - tlofs; + table = (struct g_part_bsd_table *)basetable; + bzero(table->bbarea, hdsz); + bzero(table->bbarea + tlofs, tlsz); + codeptr = gpp->gpp_codeptr; + codesz = MIN(hdsz, gpp->gpp_codesize); + if (codesz > 0) + bcopy(codeptr, table->bbarea, codesz); + codesz = MIN(tlsz, gpp->gpp_codesize - tlofs); + if (codesz > 0) + bcopy(codeptr + tlofs, table->bbarea + tlofs, codesz); + return (0); +} + +static int g_part_bsd_create(struct g_part_table *basetable, struct g_part_parms *gpp) { struct g_consumer *cp; @@ -173,13 +200,16 @@ g_part_bsd_create(struct g_part_table *b if (pp->sectorsize < sizeof(struct disklabel)) return (ENOSPC); + if (BBSIZE % pp->sectorsize) + return (ENOTBLK); msize = pp->mediasize / pp->sectorsize; secpercyl = basetable->gpt_sectors * basetable->gpt_heads; ncyls = msize / secpercyl; table = (struct g_part_bsd_table *)basetable; - ptr = table->label = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); + table->bbarea = g_malloc(BBSIZE, M_WAITOK | M_ZERO); + ptr = table->bbarea + pp->sectorsize; le32enc(ptr + 0, DISKMAGIC); /* d_magic */ le32enc(ptr + 40, pp->sectorsize); /* d_secsize */ @@ -216,7 +246,7 @@ g_part_bsd_destroy(struct g_part_table * return (0); } -static int +static void g_part_bsd_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { @@ -233,7 +263,6 @@ g_part_bsd_dumpconf(struct g_part_table } else { /* confxml: scheme information */ } - return (0); } static int @@ -241,9 +270,10 @@ g_part_bsd_dumpto(struct g_part_table *t { struct g_part_bsd_entry *entry; - /* Allow dumping to a swap partition only. */ + /* Allow dumping to a swap partition or an unused partition. */ entry = (struct g_part_bsd_entry *)baseentry; - return ((entry->part.p_fstype == FS_SWAP) ? 1 : 0); + return ((entry->part.p_fstype == FS_UNUSED || + entry->part.p_fstype == FS_SWAP) ? 1 : 0); } static int @@ -261,7 +291,7 @@ g_part_bsd_modify(struct g_part_table *b return (0); } -static char * +static const char * g_part_bsd_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) { @@ -284,6 +314,8 @@ g_part_bsd_probe(struct g_part_table *ta if (pp->sectorsize < sizeof(struct disklabel) || pp->mediasize < BBSIZE) return (ENOSPC); + if (BBSIZE % pp->sectorsize) + return (ENOTBLK); /* Check that there's a disklabel. */ buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error); @@ -313,16 +345,16 @@ g_part_bsd_read(struct g_part_table *bas table = (struct g_part_bsd_table *)basetable; msize = pp->mediasize / pp->sectorsize; - buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error); - if (buf == NULL) + table->bbarea = g_read_data(cp, 0, BBSIZE, &error); + if (table->bbarea == NULL) return (error); - table->label = buf; + buf = table->bbarea + pp->sectorsize; if (le32dec(buf + 40) != pp->sectorsize) goto invalid_label; sectors = le32dec(buf + 44); - if (sectors < 1 || sectors > 63) + if (sectors < 1 || sectors > 255) goto invalid_label; if (sectors != basetable->gpt_sectors && !basetable->gpt_fixgeom) { g_part_geometry_heads(msize, sectors, &chs, &heads); @@ -341,8 +373,13 @@ g_part_bsd_read(struct g_part_table *bas printf("GEOM: %s: geometry does not match label.\n", pp->name); chs = le32dec(buf + 60); - if (chs < 1 || chs > msize) + if (chs < 1) goto invalid_label; + /* Fix-up a sysinstall bug. */ + if (chs > msize) { + chs = msize; + le32enc(buf + 60, msize); + } if (chs != msize) printf("GEOM: %s: media size does not match label.\n", pp->name); @@ -367,8 +404,6 @@ g_part_bsd_read(struct g_part_table *bas part.p_cpg = le16dec(p + 14); if (part.p_size == 0) continue; - if (part.p_fstype == FS_UNUSED && index != RAW_PART) - continue; if (part.p_offset < table->offset) continue; baseentry = g_part_new_entry(basetable, index + 1, @@ -376,7 +411,7 @@ g_part_bsd_read(struct g_part_table *bas part.p_offset - table->offset + part.p_size - 1); entry = (struct g_part_bsd_entry *)baseentry; entry->part = part; - if (part.p_fstype == FS_UNUSED) + if (index == RAW_PART) baseentry->gpe_internal = 1; } @@ -384,7 +419,7 @@ g_part_bsd_read(struct g_part_table *bas invalid_label: printf("GEOM: %s: invalid disklabel.\n", pp->name); - g_free(table->label); + g_free(table->bbarea); return (EINVAL); } @@ -417,14 +452,15 @@ g_part_bsd_write(struct g_part_table *ba struct g_part_bsd_entry *entry; struct g_part_bsd_table *table; uint16_t sum; - u_char *p, *pe; + u_char *label, *p, *pe; int error, index; pp = cp->provider; table = (struct g_part_bsd_table *)basetable; baseentry = LIST_FIRST(&basetable->gpt_entry); + label = table->bbarea + pp->sectorsize; for (index = 1; index <= basetable->gpt_entries; index++) { - p = table->label + 148 + (index - 1) * 16; + p = label + 148 + (index - 1) * 16; entry = (baseentry != NULL && index == baseentry->gpe_index) ? (struct g_part_bsd_entry *)baseentry : NULL; if (entry != NULL && !baseentry->gpe_deleted) { @@ -442,13 +478,13 @@ g_part_bsd_write(struct g_part_table *ba } /* Calculate checksum. */ - le16enc(table->label + 136, 0); - pe = table->label + 148 + basetable->gpt_entries * 16; + le16enc(label + 136, 0); + pe = label + 148 + basetable->gpt_entries * 16; sum = 0; - for (p = table->label; p < pe; p += 2) + for (p = label; p < pe; p += 2) sum ^= le16dec(p); - le16enc(table->label + 136, sum); + le16enc(label + 136, sum); - error = g_write_data(cp, pp->sectorsize, table->label, pp->sectorsize); + error = g_write_data(cp, 0, table->bbarea, BBSIZE); return (error); } Copied and modified: stable/7/sys/geom/part/g_part_ebr.c (from r188354, head/sys/geom/part/g_part_ebr.c) ============================================================================== --- head/sys/geom/part/g_part_ebr.c Sun Feb 8 23:51:44 2009 (r188354, copy source) +++ stable/7/sys/geom/part/g_part_ebr.c Tue Mar 17 19:38:40 2009 (r189935) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -55,12 +54,15 @@ struct g_part_ebr_table { struct g_part_ebr_entry { struct g_part_entry base; struct dos_partition ent; + int alias; }; static int g_part_ebr_add(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static int g_part_ebr_create(struct g_part_table *, struct g_part_parms *); static int g_part_ebr_destroy(struct g_part_table *, struct g_part_parms *); +static int g_part_ebr_devalias(struct g_part_table *, struct g_part_entry *, + char *, size_t); static void g_part_ebr_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_ebr_dumpto(struct g_part_table *, struct g_part_entry *); @@ -68,6 +70,8 @@ static int g_part_ebr_modify(struct g_pa struct g_part_parms *); static const char *g_part_ebr_name(struct g_part_table *, struct g_part_entry *, char *, size_t); +static int g_part_ebr_precheck(struct g_part_table *, enum g_part_ctl, + struct g_part_parms *); static int g_part_ebr_probe(struct g_part_table *, struct g_consumer *); static int g_part_ebr_read(struct g_part_table *, struct g_consumer *); static int g_part_ebr_setunset(struct g_part_table *, struct g_part_entry *, @@ -80,10 +84,12 @@ static kobj_method_t g_part_ebr_methods[ KOBJMETHOD(g_part_add, g_part_ebr_add), KOBJMETHOD(g_part_create, g_part_ebr_create), KOBJMETHOD(g_part_destroy, g_part_ebr_destroy), + KOBJMETHOD(g_part_devalias, g_part_ebr_devalias), KOBJMETHOD(g_part_dumpconf, g_part_ebr_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_ebr_dumpto), KOBJMETHOD(g_part_modify, g_part_ebr_modify), KOBJMETHOD(g_part_name, g_part_ebr_name), + KOBJMETHOD(g_part_precheck, g_part_ebr_precheck), KOBJMETHOD(g_part_probe, g_part_ebr_probe), KOBJMETHOD(g_part_read, g_part_ebr_read), KOBJMETHOD(g_part_setunset, g_part_ebr_setunset), @@ -102,6 +108,9 @@ static struct g_part_scheme g_part_ebr_s }; G_PART_SCHEME_DECLARE(g_part_ebr); +static void ebr_set_chs(struct g_part_table *, uint32_t, u_char *, u_char *, + u_char *); + static void ebr_entry_decode(const char *p, struct dos_partition *ent) { @@ -117,19 +126,142 @@ ebr_entry_decode(const char *p, struct d ent->dp_size = le32dec(p + 12); } +static void +ebr_entry_link(struct g_part_table *table, uint32_t start, uint32_t end, + u_char *buf) +{ + + buf[0] = 0 /* dp_flag */; + ebr_set_chs(table, start, &buf[3] /* dp_scyl */, &buf[1] /* dp_shd */, + &buf[2] /* dp_ssect */); + buf[4] = 5 /* dp_typ */; + ebr_set_chs(table, end, &buf[7] /* dp_ecyl */, &buf[5] /* dp_ehd */, + &buf[6] /* dp_esect */); + le32enc(buf + 8, start); + le32enc(buf + 12, end - start + 1); +} + +static int +ebr_parse_type(const char *type, u_char *dp_typ) +{ + const char *alias; + char *endp; + long lt; + + if (type[0] == '!') { + lt = strtol(type + 1, &endp, 0); + if (type[1] == '\0' || *endp != '\0' || lt <= 0 || lt >= 256) + return (EINVAL); + *dp_typ = (u_char)lt; + return (0); + } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD); + if (!strcasecmp(type, alias)) { + *dp_typ = DOSPTYP_386BSD; + return (0); + } + return (EINVAL); +} + +static void +ebr_set_chs(struct g_part_table *table, uint32_t lba, u_char *cylp, u_char *hdp, + u_char *secp) +{ + uint32_t cyl, hd, sec; + + sec = lba % table->gpt_sectors + 1; + lba /= table->gpt_sectors; + hd = lba % table->gpt_heads; + lba /= table->gpt_heads; + cyl = lba; + if (cyl > 1023) + sec = hd = cyl = ~0; + + *cylp = cyl & 0xff; + *hdp = hd & 0xff; + *secp = (sec & 0x3f) | ((cyl >> 2) & 0xc0); +} + static int g_part_ebr_add(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { + struct g_geom *gp; + struct g_provider *pp; + struct g_part_ebr_entry *entry; + uint32_t start, size, sectors; - return (ENOSYS); + if (gpp->gpp_parms & G_PART_PARM_LABEL) + return (EINVAL); + + gp = basetable->gpt_gp; + pp = LIST_FIRST(&gp->consumer)->provider; + sectors = basetable->gpt_sectors; + + entry = (struct g_part_ebr_entry *)baseentry; + + start = gpp->gpp_start; + size = gpp->gpp_size; + if (size < 2 * sectors) + return (EINVAL); + if (start % sectors) { + size = size - sectors + (start % sectors); + start = start - (start % sectors) + sectors; + } + if (size % sectors) + size = size - (size % sectors); + if (size < 2 * sectors) + return (EINVAL); + + if (baseentry->gpe_deleted) + bzero(&entry->ent, sizeof(entry->ent)); + + KASSERT(baseentry->gpe_start <= start, (__func__)); + KASSERT(baseentry->gpe_end >= start + size - 1, (__func__)); + baseentry->gpe_index = (start / sectors) + 1; + baseentry->gpe_offset = (off_t)(start + sectors) * pp->sectorsize; + baseentry->gpe_start = start; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 17 20:59:46 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 296A5106568B; Tue, 17 Mar 2009 20:59:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15C008FC19; Tue, 17 Mar 2009 20:59:46 +0000 (UTC) (envelope-from bz@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 n2HKxjFd006197; Tue, 17 Mar 2009 20:59:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HKxjMf006194; Tue, 17 Mar 2009 20:59:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903172059.n2HKxjMf006194@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 17 Mar 2009 20:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189938 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet 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, 17 Mar 2009 20:59:47 -0000 Author: bz Date: Tue Mar 17 20:59:45 2009 New Revision: 189938 URL: http://svn.freebsd.org/changeset/base/189938 Log: MFC r183001: Implement IPv6 support for TCP MD5 Signature Option (RFC 2385) the same way it has been implemented for IPv4. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/tcp_output.c stable/7/sys/netinet/tcp_subr.c stable/7/sys/netinet/tcp_syncache.c Modified: stable/7/sys/netinet/tcp_output.c ============================================================================== --- stable/7/sys/netinet/tcp_output.c Tue Mar 17 19:57:11 2009 (r189937) +++ stable/7/sys/netinet/tcp_output.c Tue Mar 17 20:59:45 2009 (r189938) @@ -681,11 +681,7 @@ send: } #ifdef TCP_SIGNATURE /* TCP-MD5 (RFC2385). */ -#ifdef INET6 - if (!isipv6 && (tp->t_flags & TF_SIGNATURE)) -#else if (tp->t_flags & TF_SIGNATURE) -#endif /* INET6 */ to.to_flags |= TOF_SIGNATURE; #endif /* TCP_SIGNATURE */ @@ -954,12 +950,9 @@ send: tp->snd_up = tp->snd_una; /* drag it along */ #ifdef TCP_SIGNATURE -#ifdef INET6 - if (!isipv6) -#endif if (tp->t_flags & TF_SIGNATURE) { int sigoff = to.to_signature - opt; - tcp_signature_compute(m, sizeof(struct ip), len, optlen, + tcp_signature_compute(m, 0, len, optlen, (u_char *)(th + 1) + sigoff, IPSEC_DIR_OUTBOUND); } #endif Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Tue Mar 17 19:57:11 2009 (r189937) +++ stable/7/sys/netinet/tcp_subr.c Tue Mar 17 20:59:45 2009 (r189938) @@ -102,6 +102,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #endif /*IPSEC*/ #include @@ -1852,11 +1853,11 @@ tcp_signature_apply(void *fstate, void * } /* - * Compute TCP-MD5 hash of a TCPv4 segment. (RFC2385) + * Compute TCP-MD5 hash of a TCP segment. (RFC2385) * * Parameters: * m pointer to head of mbuf chain - * off0 offset to TCP header within the mbuf chain + * _unused * len length of TCP segment data, excluding options * optlen length of TCP segment options * buf pointer to storage for computed MD5 digest @@ -1866,9 +1867,6 @@ tcp_signature_apply(void *fstate, void * * When called from tcp_input(), we can be sure that th_sum has been * zeroed out and verified already. * - * This function is for IPv4 use only. Calling this function with an - * IPv6 packet in the mbuf chain will yield undefined results. - * * Return 0 if successful, otherwise return -1. * * XXX The key is retrieved from the system's PF_KEY SADB, by keying a @@ -1878,7 +1876,7 @@ tcp_signature_apply(void *fstate, void * * specify per-application flows but it is unstable. */ int -tcp_signature_compute(struct mbuf *m, int off0, int len, int optlen, +tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen, u_char *buf, u_int direction) { union sockaddr_union dst; @@ -1889,34 +1887,62 @@ tcp_signature_compute(struct mbuf *m, in struct ipovly *ipovly; struct secasvar *sav; struct tcphdr *th; +#ifdef INET6 + struct ip6_hdr *ip6; + struct in6_addr in6; + char ip6buf[INET6_ADDRSTRLEN]; + uint32_t plen; + uint16_t nhdr; +#endif u_short savecsum; KASSERT(m != NULL, ("NULL mbuf chain")); KASSERT(buf != NULL, ("NULL signature pointer")); /* Extract the destination from the IP header in the mbuf. */ - ip = mtod(m, struct ip *); bzero(&dst, sizeof(union sockaddr_union)); - dst.sa.sa_len = sizeof(struct sockaddr_in); - dst.sa.sa_family = AF_INET; - dst.sin.sin_addr = (direction == IPSEC_DIR_INBOUND) ? - ip->ip_src : ip->ip_dst; + ip = mtod(m, struct ip *); +#ifdef INET6 + ip6 = NULL; /* Make the compiler happy. */ +#endif + switch (ip->ip_v) { + case IPVERSION: + dst.sa.sa_len = sizeof(struct sockaddr_in); + dst.sa.sa_family = AF_INET; + dst.sin.sin_addr = (direction == IPSEC_DIR_INBOUND) ? + ip->ip_src : ip->ip_dst; + break; +#ifdef INET6 + case (IPV6_VERSION >> 4): + ip6 = mtod(m, struct ip6_hdr *); + dst.sa.sa_len = sizeof(struct sockaddr_in6); + dst.sa.sa_family = AF_INET6; + dst.sin6.sin6_addr = (direction == IPSEC_DIR_INBOUND) ? + ip6->ip6_src : ip6->ip6_dst; + break; +#endif + default: + return (EINVAL); + /* NOTREACHED */ + break; + } /* Look up an SADB entry which matches the address of the peer. */ sav = KEY_ALLOCSA(&dst, IPPROTO_TCP, htonl(TCP_SIG_SPI)); if (sav == NULL) { - printf("%s: SADB lookup failed for %s\n", __func__, - inet_ntoa(dst.sin.sin_addr)); + ipseclog((LOG_ERR, "%s: SADB lookup failed for %s\n", __func__, + (ip->ip_v == IPVERSION) ? inet_ntoa(dst.sin.sin_addr) : +#ifdef INET6 + (ip->ip_v == (IPV6_VERSION >> 4)) ? + ip6_sprintf(ip6buf, &dst.sin6.sin6_addr) : +#endif + "(unsupported)")); return (EINVAL); } MD5Init(&ctx); - ipovly = (struct ipovly *)ip; - th = (struct tcphdr *)((u_char *)ip + off0); - doff = off0 + sizeof(struct tcphdr) + optlen; - /* - * Step 1: Update MD5 hash with IP pseudo-header. + * Step 1: Update MD5 hash with IP(v6) pseudo-header. * * XXX The ippseudo header MUST be digested in network byte order, * or else we'll fail the regression test. Assume all fields we've @@ -1924,12 +1950,55 @@ tcp_signature_compute(struct mbuf *m, in * XXX One cannot depend on ipovly->ih_len here. When called from * tcp_output(), the underlying ip_len member has not yet been set. */ - ippseudo.ippseudo_src = ipovly->ih_src; - ippseudo.ippseudo_dst = ipovly->ih_dst; - ippseudo.ippseudo_pad = 0; - ippseudo.ippseudo_p = IPPROTO_TCP; - ippseudo.ippseudo_len = htons(len + sizeof(struct tcphdr) + optlen); - MD5Update(&ctx, (char *)&ippseudo, sizeof(struct ippseudo)); + switch (ip->ip_v) { + case IPVERSION: + ipovly = (struct ipovly *)ip; + ippseudo.ippseudo_src = ipovly->ih_src; + ippseudo.ippseudo_dst = ipovly->ih_dst; + ippseudo.ippseudo_pad = 0; + ippseudo.ippseudo_p = IPPROTO_TCP; + ippseudo.ippseudo_len = htons(len + sizeof(struct tcphdr) + + optlen); + MD5Update(&ctx, (char *)&ippseudo, sizeof(struct ippseudo)); + + th = (struct tcphdr *)((u_char *)ip + sizeof(struct ip)); + doff = sizeof(struct ip) + sizeof(struct tcphdr) + optlen; + break; +#ifdef INET6 + /* + * RFC 2385, 2.0 Proposal + * For IPv6, the pseudo-header is as described in RFC 2460, namely the + * 128-bit source IPv6 address, 128-bit destination IPv6 address, zero- + * extended next header value (to form 32 bits), and 32-bit segment + * length. + * Note: Upper-Layer Packet Length comes before Next Header. + */ + case (IPV6_VERSION >> 4): + in6 = ip6->ip6_src; + in6_clearscope(&in6); + MD5Update(&ctx, (char *)&in6, sizeof(struct in6_addr)); + in6 = ip6->ip6_dst; + in6_clearscope(&in6); + MD5Update(&ctx, (char *)&in6, sizeof(struct in6_addr)); + plen = htonl(len + sizeof(struct tcphdr) + optlen); + MD5Update(&ctx, (char *)&plen, sizeof(uint32_t)); + nhdr = 0; + MD5Update(&ctx, (char *)&nhdr, sizeof(uint8_t)); + MD5Update(&ctx, (char *)&nhdr, sizeof(uint8_t)); + MD5Update(&ctx, (char *)&nhdr, sizeof(uint8_t)); + nhdr = IPPROTO_TCP; + MD5Update(&ctx, (char *)&nhdr, sizeof(uint8_t)); + + th = (struct tcphdr *)((u_char *)ip6 + sizeof(struct ip6_hdr)); + doff = sizeof(struct ip6_hdr) + sizeof(struct tcphdr) + optlen; + break; +#endif + default: + return (EINVAL); + /* NOTREACHED */ + break; + } + /* * Step 2: Update MD5 hash with TCP header, excluding options. Modified: stable/7/sys/netinet/tcp_syncache.c ============================================================================== --- stable/7/sys/netinet/tcp_syncache.c Tue Mar 17 19:57:11 2009 (r189937) +++ stable/7/sys/netinet/tcp_syncache.c Tue Mar 17 20:59:45 2009 (r189938) @@ -1425,7 +1425,7 @@ syncache_respond(struct syncache *sc) #ifdef TCP_SIGNATURE if (sc->sc_flags & SCF_SIGNATURE) - tcp_signature_compute(m, sizeof(struct ip), 0, optlen, + tcp_signature_compute(m, 0, 0, optlen, to.to_signature, IPSEC_DIR_OUTBOUND); #endif #ifdef INET6 From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 01:57:27 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 7D3AC1065677; Wed, 18 Mar 2009 01:57:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D86A8FC14; Wed, 18 Mar 2009 01:57:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I1vR0b011728; Wed, 18 Mar 2009 01:57:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I1vRkO011727; Wed, 18 Mar 2009 01:57:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180157.n2I1vRkO011727@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 01:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189941 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re 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, 18 Mar 2009 01:57:28 -0000 Author: yongari Date: Wed Mar 18 01:57:26 2009 New Revision: 189941 URL: http://svn.freebsd.org/changeset/base/189941 Log: MFC r187481: - Do not read and write RX configuration register multiple times. - Always program RX configuration register from scratch instead of doing read/modify/write. - Rename re_setmulti() to re_set_rxmode() to be reflect reality. - Simplify hash filter logic a little while I am here. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Tue Mar 17 21:21:33 2009 (r189940) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 01:57:26 2009 (r189941) @@ -266,7 +266,7 @@ static int re_miibus_readreg (device_t, static int re_miibus_writereg (device_t, int, int, int); static void re_miibus_statchg (device_t); -static void re_setmulti (struct rl_softc *); +static void re_set_rxmode (struct rl_softc *); static void re_reset (struct rl_softc *); static void re_setwol (struct rl_softc *); static void re_clrwol (struct rl_softc *); @@ -607,26 +607,23 @@ re_miibus_statchg(device_t dev) } /* - * Program the 64-bit multicast hash filter. + * Set the RX configuration and 64-bit multicast hash filter. */ static void -re_setmulti(struct rl_softc *sc) +re_set_rxmode(struct rl_softc *sc) { struct ifnet *ifp; - int h = 0; - u_int32_t hashes[2] = { 0, 0 }; struct ifmultiaddr *ifma; - u_int32_t rxfilt; - int mcnt = 0; + uint32_t hashes[2] = { 0, 0 }; + uint32_t h, rxfilt; RL_LOCK_ASSERT(sc); ifp = sc->rl_ifp; + rxfilt = RL_RXCFG_CONFIG | RL_RXCFG_RX_INDIV | RL_RXCFG_RX_BROAD; - rxfilt = CSR_READ_4(sc, RL_RXCFG); - rxfilt &= ~(RL_RXCFG_RX_ALLPHYS | RL_RXCFG_RX_MULTI); - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { if (ifp->if_flags & IFF_PROMISC) rxfilt |= RL_RXCFG_RX_ALLPHYS; /* @@ -635,17 +632,10 @@ re_setmulti(struct rl_softc *sc) * promiscuous mode. */ rxfilt |= RL_RXCFG_RX_MULTI; - CSR_WRITE_4(sc, RL_RXCFG, rxfilt); - CSR_WRITE_4(sc, RL_MAR0, 0xFFFFFFFF); - CSR_WRITE_4(sc, RL_MAR4, 0xFFFFFFFF); - return; + hashes[0] = hashes[1] = 0xffffffff; + goto done; } - /* first, zot all the existing hash bits */ - CSR_WRITE_4(sc, RL_MAR0, 0); - CSR_WRITE_4(sc, RL_MAR4, 0); - - /* now program new ones */ IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -656,31 +646,29 @@ re_setmulti(struct rl_softc *sc) hashes[0] |= (1 << h); else hashes[1] |= (1 << (h - 32)); - mcnt++; } IF_ADDR_UNLOCK(ifp); - if (mcnt) + if (hashes[0] != 0 || hashes[1] != 0) { + /* + * For some unfathomable reason, RealTek decided to + * reverse the order of the multicast hash registers + * in the PCI Express parts. This means we have to + * write the hash pattern in reverse order for those + * devices. + */ + if ((sc->rl_flags & RL_FLAG_INVMAR) != 0) { + h = bswap32(hashes[0]); + hashes[0] = bswap32(hashes[1]); + hashes[1] = h; + } rxfilt |= RL_RXCFG_RX_MULTI; - else - rxfilt &= ~RL_RXCFG_RX_MULTI; + } +done: + CSR_WRITE_4(sc, RL_MAR0, hashes[0]); + CSR_WRITE_4(sc, RL_MAR4, hashes[1]); CSR_WRITE_4(sc, RL_RXCFG, rxfilt); - - /* - * For some unfathomable reason, RealTek decided to reverse - * the order of the multicast hash registers in the PCI Express - * parts. This means we have to write the hash pattern in reverse - * order for those devices. - */ - - if ((sc->rl_flags & RL_FLAG_INVMAR) != 0) { - CSR_WRITE_4(sc, RL_MAR0, bswap32(hashes[1])); - CSR_WRITE_4(sc, RL_MAR4, bswap32(hashes[0])); - } else { - CSR_WRITE_4(sc, RL_MAR0, hashes[0]); - CSR_WRITE_4(sc, RL_MAR4, hashes[1]); - } } static void @@ -2498,7 +2486,6 @@ re_init_locked(struct rl_softc *sc) { struct ifnet *ifp = sc->rl_ifp; struct mii_data *mii; - u_int32_t rxcfg = 0; uint16_t cfg; union { uint32_t align_dummy; @@ -2583,7 +2570,7 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); /* - * Set the initial TX and RX configuration. + * Set the initial TX configuration. */ if (sc->rl_testmode) { if (sc->rl_type == RL_8169) @@ -2597,32 +2584,10 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_1(sc, RL_EARLY_TX_THRESH, 16); - CSR_WRITE_4(sc, RL_RXCFG, RL_RXCFG_CONFIG); - - /* Set the individual bit to receive frames for this host only. */ - rxcfg = CSR_READ_4(sc, RL_RXCFG); - rxcfg |= RL_RXCFG_RX_INDIV; - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) - rxcfg |= RL_RXCFG_RX_ALLPHYS; - else - rxcfg &= ~RL_RXCFG_RX_ALLPHYS; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - - /* - * Set capture broadcast bit to capture broadcast frames. - */ - if (ifp->if_flags & IFF_BROADCAST) - rxcfg |= RL_RXCFG_RX_BROAD; - else - rxcfg &= ~RL_RXCFG_RX_BROAD; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - /* - * Program the multicast filter, if necessary. + * Set the initial RX configuration. */ - re_setmulti(sc); + re_set_rxmode(sc); #ifdef DEVICE_POLLING /* @@ -2761,7 +2726,7 @@ re_ioctl(struct ifnet *ifp, u_long comma if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if (((ifp->if_flags ^ sc->rl_if_flags) & (IFF_PROMISC | IFF_ALLMULTI)) != 0) - re_setmulti(sc); + re_set_rxmode(sc); } else re_init_locked(sc); } else { @@ -2774,7 +2739,7 @@ re_ioctl(struct ifnet *ifp, u_long comma case SIOCADDMULTI: case SIOCDELMULTI: RL_LOCK(sc); - re_setmulti(sc); + re_set_rxmode(sc); RL_UNLOCK(sc); break; case SIOCGIFMEDIA: From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 02:00:24 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C709106566B; Wed, 18 Mar 2009 02:00:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18DF38FC1B; Wed, 18 Mar 2009 02:00:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I20NVS011895; Wed, 18 Mar 2009 02:00:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I20NVT011893; Wed, 18 Mar 2009 02:00:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180200.n2I20NVT011893@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 02:00: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: r189943 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 02:00:24 -0000 Author: yongari Date: Wed Mar 18 02:00:23 2009 New Revision: 189943 URL: http://svn.freebsd.org/changeset/base/189943 Log: MFC r187482: Retire RL_FLAG_INVMAR bit to match its comment and reality. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Wed Mar 18 01:57:54 2009 (r189942) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 02:00:23 2009 (r189943) @@ -657,7 +657,7 @@ re_set_rxmode(struct rl_softc *sc) * write the hash pattern in reverse order for those * devices. */ - if ((sc->rl_flags & RL_FLAG_INVMAR) != 0) { + if ((sc->rl_flags & RL_FLAG_PCIE) != 0) { h = bswap32(hashes[0]); hashes[0] = bswap32(hashes[1]); hashes[1] = h; @@ -1234,22 +1234,21 @@ re_attach(device_t dev) break; case RL_HWREV_8100E: case RL_HWREV_8101E: - sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | - RL_FLAG_PHYWAKE | RL_FLAG_FASTETHER; + sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | + RL_FLAG_FASTETHER; break; case RL_HWREV_8102E: case RL_HWREV_8102EL: - sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | - RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | - RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP; + sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP; break; case RL_HWREV_8168_SPIN1: case RL_HWREV_8168_SPIN2: sc->rl_flags |= RL_FLAG_WOLRXENB; /* FALLTHROUGH */ case RL_HWREV_8168_SPIN3: - sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | - RL_FLAG_MACSTAT; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_MACSTAT; break; case RL_HWREV_8168C_SPIN2: sc->rl_flags |= RL_FLAG_MACSLEEP; @@ -1260,9 +1259,8 @@ re_attach(device_t dev) /* FALLTHROUGH */ case RL_HWREV_8168CP: case RL_HWREV_8168D: - sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | - RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | - RL_FLAG_CMDSTOP; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | + RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP; /* * These controllers support jumbo frame but it seems * that enabling it requires touching additional magic Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Wed Mar 18 01:57:54 2009 (r189942) +++ stable/7/sys/pci/if_rlreg.h Wed Mar 18 02:00:23 2009 (r189943) @@ -852,7 +852,6 @@ struct rl_softc { int rl_txstart; uint32_t rl_flags; #define RL_FLAG_MSI 0x0001 -#define RL_FLAG_INVMAR 0x0004 #define RL_FLAG_PHYWAKE 0x0008 #define RL_FLAG_NOJUMBO 0x0010 #define RL_FLAG_PAR 0x0020 From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 02:03:16 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 D07CE1065670; Wed, 18 Mar 2009 02:03:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC1A18FC18; Wed, 18 Mar 2009 02:03:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I23Ghe012010; Wed, 18 Mar 2009 02:03:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I23G57012008; Wed, 18 Mar 2009 02:03:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180203.n2I23G57012008@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 02:03: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: r189944 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 02:03:17 -0000 Author: yongari Date: Wed Mar 18 02:03:16 2009 New Revision: 189944 URL: http://svn.freebsd.org/changeset/base/189944 Log: MFC r187483: - Add support for 8110SCe part. Some magic registers were taken from Linux driver. - Swap hardware revisions for 8110S and 8169S as Linux driver claims. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Wed Mar 18 02:00:23 2009 (r189943) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 02:03:16 2009 (r189944) @@ -199,9 +199,10 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8169, RL_8169, "8169"}, { RL_HWREV_8169S, RL_8169, "8169S"}, { RL_HWREV_8110S, RL_8169, "8110S"}, - { RL_HWREV_8169_8110SB, RL_8169, "8169SB"}, - { RL_HWREV_8169_8110SC, RL_8169, "8169SC"}, - { RL_HWREV_8169_8110SBL, RL_8169, "8169SBL"}, + { RL_HWREV_8169_8110SB, RL_8169, "8169SB/8110SB"}, + { RL_HWREV_8169_8110SC, RL_8169, "8169SC/8110SC"}, + { RL_HWREV_8169_8110SBL, RL_8169, "8169SBL/8110SBL"}, + { RL_HWREV_8169_8110SCE, RL_8169, "8169SC/8110SC"}, { RL_HWREV_8100, RL_8139, "8100"}, { RL_HWREV_8101, RL_8139, "8101"}, { RL_HWREV_8100E, RL_8169, "8100E"}, @@ -688,12 +689,10 @@ re_reset(struct rl_softc *sc) if (i == RL_TIMEOUT) device_printf(sc->rl_dev, "reset never completed!\n"); - if ((sc->rl_flags & RL_FLAG_PHY8169) != 0) + if ((sc->rl_flags & RL_FLAG_MACRESET) != 0) CSR_WRITE_1(sc, 0x82, 1); - if ((sc->rl_flags & RL_FLAG_PHY8110S) != 0) { - CSR_WRITE_1(sc, 0x82, 1); - re_gmii_writereg(sc->rl_dev, 1, 0x0B, 0); - } + if (sc->rl_hwrev == RL_HWREV_8169S) + re_gmii_writereg(sc->rl_dev, 1, 0x0b, 0); } #ifdef RE_DIAG @@ -1209,12 +1208,22 @@ re_attach(device_t dev) hw_rev = re_hwrevs; hwrev = CSR_READ_4(sc, RL_TXCFG); - device_printf(dev, "Chip rev. 0x%08x\n", hwrev & 0x7c800000); + switch (hwrev & 0x70000000) { + case 0x00000000: + case 0x10000000: + device_printf(dev, "Chip rev. 0x%08x\n", hwrev & 0xfc800000); + hwrev &= (RL_TXCFG_HWREV | 0x80000000); + break; + default: + device_printf(dev, "Chip rev. 0x%08x\n", hwrev & 0x7c800000); + hwrev &= RL_TXCFG_HWREV; + break; + } device_printf(dev, "MAC rev. 0x%08x\n", hwrev & 0x00700000); - hwrev &= RL_TXCFG_HWREV; while (hw_rev->rl_desc != NULL) { if (hw_rev->rl_rev == hwrev) { sc->rl_type = hw_rev->rl_type; + sc->rl_hwrev = hw_rev->rl_rev; break; } hw_rev++; @@ -1229,9 +1238,6 @@ re_attach(device_t dev) case RL_HWREV_8139CPLUS: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER; break; - case RL_HWREV_8110S: - sc->rl_flags |= RL_FLAG_PHY8110S; - break; case RL_HWREV_8100E: case RL_HWREV_8101E: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | @@ -1273,14 +1279,16 @@ re_attach(device_t dev) */ sc->rl_flags |= RL_FLAG_NOJUMBO; break; - case RL_HWREV_8169: - case RL_HWREV_8169S: - sc->rl_flags |= RL_FLAG_PHY8169; - break; case RL_HWREV_8169_8110SB: - case RL_HWREV_8169_8110SC: case RL_HWREV_8169_8110SBL: - sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHY8169; + case RL_HWREV_8169_8110SC: + case RL_HWREV_8169_8110SCE: + sc->rl_flags |= RL_FLAG_PHYWAKE; + /* FALLTHROUGH */ + case RL_HWREV_8169: + case RL_HWREV_8169S: + case RL_HWREV_8110S: + sc->rl_flags |= RL_FLAG_MACRESET; break; default: break; @@ -2484,6 +2492,7 @@ re_init_locked(struct rl_softc *sc) { struct ifnet *ifp = sc->rl_ifp; struct mii_data *mii; + uint32_t reg; uint16_t cfg; union { uint32_t align_dummy; @@ -2519,6 +2528,17 @@ re_init_locked(struct rl_softc *sc) } else cfg |= RL_CPLUSCMD_RXENB | RL_CPLUSCMD_TXENB; CSR_WRITE_2(sc, RL_CPLUS_CMD, cfg); + if (sc->rl_hwrev == RL_HWREV_8169_8110SC || + sc->rl_hwrev == RL_HWREV_8169_8110SCE) { + reg = 0x000fff00; + if ((CSR_READ_1(sc, RL_CFG2) & RL_CFG2_PCI66MHZ) != 0) + reg |= 0x000000ff; + if (sc->rl_hwrev == RL_HWREV_8169_8110SCE) + reg |= 0x00f00000; + CSR_WRITE_4(sc, 0x7c, reg); + /* Disable interrupt mitigation. */ + CSR_WRITE_2(sc, 0xe2, 0); + } /* * Disable TSO if interface MTU size is greater than MSS * allowed in controller. Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Wed Mar 18 02:00:23 2009 (r189943) +++ stable/7/sys/pci/if_rlreg.h Wed Mar 18 02:03:16 2009 (r189944) @@ -154,8 +154,8 @@ /* Known revision codes. */ #define RL_HWREV_8169 0x00000000 -#define RL_HWREV_8110S 0x00800000 -#define RL_HWREV_8169S 0x04000000 +#define RL_HWREV_8169S 0x00800000 +#define RL_HWREV_8110S 0x04000000 #define RL_HWREV_8169_8110SB 0x10000000 #define RL_HWREV_8169_8110SC 0x18000000 #define RL_HWREV_8102EL 0x24800000 @@ -180,6 +180,7 @@ #define RL_HWREV_8101 0x74c00000 #define RL_HWREV_8100 0x78800000 #define RL_HWREV_8169_8110SBL 0x7CC00000 +#define RL_HWREV_8169_8110SCE 0x98000000 #define RL_TXDMA_16BYTES 0x00000000 #define RL_TXDMA_32BYTES 0x00000100 @@ -859,8 +860,7 @@ struct rl_softc { #define RL_FLAG_MACSTAT 0x0080 #define RL_FLAG_FASTETHER 0x0100 #define RL_FLAG_CMDSTOP 0x0200 -#define RL_FLAG_PHY8169 0x0400 -#define RL_FLAG_PHY8110S 0x0800 +#define RL_FLAG_MACRESET 0x0400 #define RL_FLAG_WOLRXENB 0x1000 #define RL_FLAG_MACSLEEP 0x2000 #define RL_FLAG_PCIE 0x4000 From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 02:07: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 B8F5E106566C; Wed, 18 Mar 2009 02:07:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A52528FC0A; Wed, 18 Mar 2009 02:07:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I277gw012126; Wed, 18 Mar 2009 02:07:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I277fJ012125; Wed, 18 Mar 2009 02:07:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180207.n2I277fJ012125@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 02:07: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: r189945 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re 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, 18 Mar 2009 02:07:08 -0000 Author: yongari Date: Wed Mar 18 02:07:07 2009 New Revision: 189945 URL: http://svn.freebsd.org/changeset/base/189945 Log: MFC r188381: Reclaim transmitted frames in re_tick(). This is for PCIe controllers that lose Tx completion interrupts under certain conditions. With this change it's safe to use MSI on PCIe controllers so enable MSI on these controllers. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Wed Mar 18 02:03:16 2009 (r189944) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 02:07:07 2009 (r189945) @@ -156,7 +156,7 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); #include "miibus_if.h" /* Tunables. */ -static int msi_disable = 1; +static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); #define RE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) @@ -2064,6 +2064,13 @@ re_tick(void *xsc) mii_tick(mii); if ((sc->rl_flags & RL_FLAG_LINK) == 0) re_miibus_statchg(sc->rl_dev); + /* + * Reclaim transmitted frames here. Technically it is not + * necessary to do here but it ensures periodic reclamation + * regardless of Tx completion interrupt which seems to be + * lost on PCIe based controllers under certain situations. + */ + re_txeof(sc); re_watchdog(sc); callout_reset(&sc->rl_stat_callout, hz, re_tick, sc); } From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 02:10:01 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCEBC1065691; Wed, 18 Mar 2009 02:10:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0E8F8FC1B; Wed, 18 Mar 2009 02:10:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I2A1Am012233; Wed, 18 Mar 2009 02:10:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I2A1QB012231; Wed, 18 Mar 2009 02:10:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180210.n2I2A1QB012231@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 02:10:01 +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: r189946 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 02:10:02 -0000 Author: yongari Date: Wed Mar 18 02:10:01 2009 New Revision: 189946 URL: http://svn.freebsd.org/changeset/base/189946 Log: MFC r188474: Allocating 2 MSI messages do not seem to work on certain controllers so use just 1 MSI message. This fixes regression introduced in r188381. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Wed Mar 18 02:07:07 2009 (r189945) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 02:10:01 2009 (r189946) @@ -1149,7 +1149,8 @@ re_attach(device_t dev) if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); } - if (msic == RL_MSI_MESSAGES && msi_disable == 0) { + if (msic > 0 && msi_disable == 0) { + msic = 1; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { device_printf(dev, "Using %d MSI messages\n", Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Wed Mar 18 02:07:07 2009 (r189945) +++ stable/7/sys/pci/if_rlreg.h Wed Mar 18 02:10:01 2009 (r189946) @@ -758,7 +758,7 @@ struct rl_stats { #define RE_RX_DESC_BUFLEN MCLBYTES #endif -#define RL_MSI_MESSAGES 2 +#define RL_MSI_MESSAGES 1 #define RL_ADDR_LO(y) ((uint64_t) (y) & 0xFFFFFFFF) #define RL_ADDR_HI(y) ((uint64_t) (y) >> 32) From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 02:12:33 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFFB3106566C; Wed, 18 Mar 2009 02:12:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 920CE8FC1F; Wed, 18 Mar 2009 02:12:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I2CX4C012337; Wed, 18 Mar 2009 02:12:33 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I2CXwK012336; Wed, 18 Mar 2009 02:12:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180212.n2I2CXwK012336@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 02:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189947 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re 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, 18 Mar 2009 02:12:34 -0000 Author: yongari Date: Wed Mar 18 02:12:33 2009 New Revision: 189947 URL: http://svn.freebsd.org/changeset/base/189947 Log: MFC r189555: Add a new tunable hw.re.prefer_iomap which disables memory register mapping. The tunable is OFF for all controllers except RTL8169SC family. RTL8169SC seems to require more magic to use memory register mapping. r187483 added a fix for RTL8169SCe controller but it does not looke like fix other variants of RTL8169SC. Tested by: Gavin Stone-Tolcher g.stone-tolcher <> its dot uq dot edu dot au Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Wed Mar 18 02:10:01 2009 (r189946) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 02:12:33 2009 (r189947) @@ -158,6 +158,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); +static int prefer_iomap = 0; +TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap); #define RE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) @@ -1118,25 +1120,35 @@ re_attach(device_t dev) pci_enable_busmaster(dev); devid = pci_get_device(dev); - /* Prefer memory space register mapping over IO space. */ - sc->rl_res_id = PCIR_BAR(1); - sc->rl_res_type = SYS_RES_MEMORY; - /* RTL8168/8101E seems to use different BARs. */ - if (devid == RT_DEVICEID_8168 || devid == RT_DEVICEID_8101E) - sc->rl_res_id = PCIR_BAR(2); + /* + * Prefer memory space register mapping over IO space. + * Because RTL8169SC does not seem to work when memory mapping + * is used always activate io mapping. + */ + if (devid == RT_DEVICEID_8169SC) + prefer_iomap = 1; + if (prefer_iomap == 0) { + sc->rl_res_id = PCIR_BAR(1); + sc->rl_res_type = SYS_RES_MEMORY; + /* RTL8168/8101E seems to use different BARs. */ + if (devid == RT_DEVICEID_8168 || devid == RT_DEVICEID_8101E) + sc->rl_res_id = PCIR_BAR(2); + } else { + sc->rl_res_id = PCIR_BAR(0); + sc->rl_res_type = SYS_RES_IOPORT; + } sc->rl_res = bus_alloc_resource_any(dev, sc->rl_res_type, &sc->rl_res_id, RF_ACTIVE); - - if (sc->rl_res == NULL) { + if (sc->rl_res == NULL && prefer_iomap == 0) { sc->rl_res_id = PCIR_BAR(0); sc->rl_res_type = SYS_RES_IOPORT; sc->rl_res = bus_alloc_resource_any(dev, sc->rl_res_type, &sc->rl_res_id, RF_ACTIVE); - if (sc->rl_res == NULL) { - device_printf(dev, "couldn't map ports/memory\n"); - error = ENXIO; - goto fail; - } + } + if (sc->rl_res == NULL) { + device_printf(dev, "couldn't map ports/memory\n"); + error = ENXIO; + goto fail; } sc->rl_btag = rman_get_bustag(sc->rl_res); From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 02:23:01 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D80221065673; Wed, 18 Mar 2009 02:23:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C317D8FC15; Wed, 18 Mar 2009 02:23:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I2N1hr012598; Wed, 18 Mar 2009 02:23:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I2N1Vc012595; Wed, 18 Mar 2009 02:23:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180223.n2I2N1Vc012595@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 02:23:01 +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: r189948 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/nfe 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, 18 Mar 2009 02:23:02 -0000 Author: yongari Date: Wed Mar 18 02:23:01 2009 New Revision: 189948 URL: http://svn.freebsd.org/changeset/base/189948 Log: MFC r183561, 186346: r183561: Add hardware MAC statistics support. Register information was obtained from Linux forcedeth driver. While I'm here move creating a sysctl node for process_limit to function nfe_sysctl_node(). Tested by: "Arno J. Klaassen" < arno heho dot snv dot jussieu dot fr > r186346: Fix a typo. Submitted by: clemens fischer via Shigeaki Tagashira Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/nfe/if_nfe.c stable/7/sys/dev/nfe/if_nfereg.h stable/7/sys/dev/nfe/if_nfevar.h Modified: stable/7/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/7/sys/dev/nfe/if_nfe.c Wed Mar 18 02:12:33 2009 (r189947) +++ stable/7/sys/dev/nfe/if_nfe.c Wed Mar 18 02:23:01 2009 (r189948) @@ -122,6 +122,9 @@ static void nfe_dma_map_segs(void *, bus static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_nfe_proc_limit(SYSCTL_HANDLER_ARGS); +static void nfe_sysctl_node(struct nfe_softc *); +static void nfe_stats_clear(struct nfe_softc *); +static void nfe_stats_update(struct nfe_softc *); #ifdef NFE_DEBUG static int nfedebug = 0; @@ -454,18 +457,19 @@ nfe_attach(device_t dev) break; case PCI_PRODUCT_NVIDIA_MCP51_LAN1: case PCI_PRODUCT_NVIDIA_MCP51_LAN2: - sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT; + sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT | NFE_MIB_V1; break; case PCI_PRODUCT_NVIDIA_CK804_LAN1: case PCI_PRODUCT_NVIDIA_CK804_LAN2: case PCI_PRODUCT_NVIDIA_MCP04_LAN1: case PCI_PRODUCT_NVIDIA_MCP04_LAN2: - sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM; + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | + NFE_MIB_V1; break; case PCI_PRODUCT_NVIDIA_MCP55_LAN1: case PCI_PRODUCT_NVIDIA_MCP55_LAN2: sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | - NFE_HW_VLAN | NFE_PWR_MGMT | NFE_TX_FLOW_CTRL; + NFE_HW_VLAN | NFE_PWR_MGMT | NFE_TX_FLOW_CTRL | NFE_MIB_V2; break; case PCI_PRODUCT_NVIDIA_MCP61_LAN1: @@ -481,7 +485,7 @@ nfe_attach(device_t dev) case PCI_PRODUCT_NVIDIA_MCP73_LAN3: case PCI_PRODUCT_NVIDIA_MCP73_LAN4: sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT | - NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL; + NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL | NFE_MIB_V2; break; case PCI_PRODUCT_NVIDIA_MCP77_LAN1: case PCI_PRODUCT_NVIDIA_MCP77_LAN2: @@ -489,7 +493,7 @@ nfe_attach(device_t dev) case PCI_PRODUCT_NVIDIA_MCP77_LAN4: /* XXX flow control */ sc->nfe_flags |= NFE_40BIT_ADDR | NFE_HW_CSUM | NFE_PWR_MGMT | - NFE_CORRECT_MACADDR; + NFE_CORRECT_MACADDR | NFE_MIB_V3; break; case PCI_PRODUCT_NVIDIA_MCP79_LAN1: case PCI_PRODUCT_NVIDIA_MCP79_LAN2: @@ -497,14 +501,15 @@ nfe_attach(device_t dev) case PCI_PRODUCT_NVIDIA_MCP79_LAN4: /* XXX flow control */ sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | - NFE_PWR_MGMT | NFE_CORRECT_MACADDR; + NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_MIB_V3; break; case PCI_PRODUCT_NVIDIA_MCP65_LAN1: case PCI_PRODUCT_NVIDIA_MCP65_LAN2: case PCI_PRODUCT_NVIDIA_MCP65_LAN3: case PCI_PRODUCT_NVIDIA_MCP65_LAN4: sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | - NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL; + NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL | + NFE_MIB_V2; break; } @@ -551,24 +556,8 @@ nfe_attach(device_t dev) goto fail; nfe_alloc_jrx_ring(sc, &sc->jrxq); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "process_limit", CTLTYPE_INT | CTLFLAG_RW, - &sc->nfe_process_limit, 0, sysctl_hw_nfe_proc_limit, "I", - "max number of Rx events to process"); - - sc->nfe_process_limit = NFE_PROC_DEFAULT; - error = resource_int_value(device_get_name(dev), device_get_unit(dev), - "process_limit", &sc->nfe_process_limit); - if (error == 0) { - if (sc->nfe_process_limit < NFE_PROC_MIN || - sc->nfe_process_limit > NFE_PROC_MAX) { - device_printf(dev, "process_limit value out of range; " - "using default: %d\n", NFE_PROC_DEFAULT); - sc->nfe_process_limit = NFE_PROC_DEFAULT; - } - } + /* Create sysctl node. */ + nfe_sysctl_node(sc); ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); @@ -2767,6 +2756,9 @@ nfe_init_locked(void *xsc) NFE_WRITE(sc, NFE_PHY_STATUS, 0xf); + /* Clear hardware stats. */ + nfe_stats_clear(sc); + #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) nfe_disable_intr(sc); @@ -2855,6 +2847,8 @@ nfe_stop(struct ifnet *ifp) tdata->m = NULL; } } + /* Update hardware stats. */ + nfe_stats_update(sc); } @@ -2906,6 +2900,7 @@ nfe_tick(void *xsc) mii = device_get_softc(sc->nfe_miibus); mii_tick(mii); + nfe_stats_update(sc); nfe_watchdog(ifp); callout_reset(&sc->nfe_stat_ch, hz, nfe_tick, sc); } @@ -3013,3 +3008,199 @@ sysctl_hw_nfe_proc_limit(SYSCTL_HANDLER_ return (sysctl_int_range(oidp, arg1, arg2, req, NFE_PROC_MIN, NFE_PROC_MAX)); } + + +#define NFE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) +#define NFE_SYSCTL_STAT_ADD64(c, h, n, p, d) \ + SYSCTL_ADD_ULONG(c, h, OID_AUTO, n, CTLFLAG_RD, p, d) + +static void +nfe_sysctl_node(struct nfe_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct nfe_hw_stats *stats; + int error; + + stats = &sc->nfe_stats; + ctx = device_get_sysctl_ctx(sc->nfe_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->nfe_dev)); + SYSCTL_ADD_PROC(ctx, child, + OID_AUTO, "process_limit", CTLTYPE_INT | CTLFLAG_RW, + &sc->nfe_process_limit, 0, sysctl_hw_nfe_proc_limit, "I", + "max number of Rx events to process"); + + sc->nfe_process_limit = NFE_PROC_DEFAULT; + error = resource_int_value(device_get_name(sc->nfe_dev), + device_get_unit(sc->nfe_dev), "process_limit", + &sc->nfe_process_limit); + if (error == 0) { + if (sc->nfe_process_limit < NFE_PROC_MIN || + sc->nfe_process_limit > NFE_PROC_MAX) { + device_printf(sc->nfe_dev, + "process_limit value out of range; " + "using default: %d\n", NFE_PROC_DEFAULT); + sc->nfe_process_limit = NFE_PROC_DEFAULT; + } + } + + if ((sc->nfe_flags & (NFE_MIB_V1 | NFE_MIB_V2 | NFE_MIB_V3)) == 0) + return; + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "NFE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + + NFE_SYSCTL_STAT_ADD32(ctx, child, "frame_errors", + &stats->rx_frame_errors, "Framing Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "extra_bytes", + &stats->rx_extra_bytes, "Extra Bytes"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "late_cols", + &stats->rx_late_cols, "Late Collisions"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "runts", + &stats->rx_runts, "Runts"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "jumbos", + &stats->rx_jumbos, "Jumbos"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "fifo_overuns", + &stats->rx_fifo_overuns, "FIFO Overruns"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "crc_errors", + &stats->rx_crc_errors, "CRC Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "fae", + &stats->rx_fae, "Frame Alignment Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "len_errors", + &stats->rx_len_errors, "Length Errors"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "unicast", + &stats->rx_unicast, "Unicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "multicast", + &stats->rx_multicast, "Multicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "broadcast", + &stats->rx_broadcast, "Broadcast Frames"); + if ((sc->nfe_flags & NFE_MIB_V2) != 0) { + NFE_SYSCTL_STAT_ADD64(ctx, child, "octets", + &stats->rx_octets, "Octets"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "pause", + &stats->rx_pause, "Pause frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "drops", + &stats->rx_drops, "Drop frames"); + } + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + NFE_SYSCTL_STAT_ADD64(ctx, child, "octets", + &stats->tx_octets, "Octets"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "zero_rexmits", + &stats->tx_zero_rexmits, "Zero Retransmits"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "one_rexmits", + &stats->tx_one_rexmits, "One Retransmits"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "multi_rexmits", + &stats->tx_multi_rexmits, "Multiple Retransmits"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "late_cols", + &stats->tx_late_cols, "Late Collisions"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "fifo_underuns", + &stats->tx_fifo_underuns, "FIFO Underruns"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "carrier_losts", + &stats->tx_carrier_losts, "Carrier Losts"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "excess_deferrals", + &stats->tx_excess_deferals, "Excess Deferrals"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "retry_errors", + &stats->tx_retry_errors, "Retry Errors"); + if ((sc->nfe_flags & NFE_MIB_V2) != 0) { + NFE_SYSCTL_STAT_ADD32(ctx, child, "deferrals", + &stats->tx_deferals, "Deferrals"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "frames", + &stats->tx_frames, "Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "pause", + &stats->tx_pause, "Pause Frames"); + } + if ((sc->nfe_flags & NFE_MIB_V3) != 0) { + NFE_SYSCTL_STAT_ADD32(ctx, child, "unicast", + &stats->tx_deferals, "Unicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "multicast", + &stats->tx_frames, "Multicast Frames"); + NFE_SYSCTL_STAT_ADD32(ctx, child, "broadcast", + &stats->tx_pause, "Broadcast Frames"); + } +} + +#undef NFE_SYSCTL_STAT_ADD32 +#undef NFE_SYSCTL_STAT_ADD64 + +static void +nfe_stats_clear(struct nfe_softc *sc) +{ + int i, mib_cnt; + + if ((sc->nfe_flags & NFE_MIB_V1) != 0) + mib_cnt = NFE_NUM_MIB_STATV1; + else if ((sc->nfe_flags & (NFE_MIB_V2 | NFE_MIB_V3)) != 0) + mib_cnt = NFE_NUM_MIB_STATV2; + else + return; + + for (i = 0; i < mib_cnt; i += sizeof(uint32_t)) + NFE_READ(sc, NFE_TX_OCTET + i); + + if ((sc->nfe_flags & NFE_MIB_V3) != 0) { + NFE_READ(sc, NFE_TX_UNICAST); + NFE_READ(sc, NFE_TX_MULTICAST); + NFE_READ(sc, NFE_TX_BROADCAST); + } +} + +static void +nfe_stats_update(struct nfe_softc *sc) +{ + struct nfe_hw_stats *stats; + + NFE_LOCK_ASSERT(sc); + + if ((sc->nfe_flags & (NFE_MIB_V1 | NFE_MIB_V2 | NFE_MIB_V3)) == 0) + return; + + stats = &sc->nfe_stats; + stats->tx_octets += NFE_READ(sc, NFE_TX_OCTET); + stats->tx_zero_rexmits += NFE_READ(sc, NFE_TX_ZERO_REXMIT); + stats->tx_one_rexmits += NFE_READ(sc, NFE_TX_ONE_REXMIT); + stats->tx_multi_rexmits += NFE_READ(sc, NFE_TX_MULTI_REXMIT); + stats->tx_late_cols += NFE_READ(sc, NFE_TX_LATE_COL); + stats->tx_fifo_underuns += NFE_READ(sc, NFE_TX_FIFO_UNDERUN); + stats->tx_carrier_losts += NFE_READ(sc, NFE_TX_CARRIER_LOST); + stats->tx_excess_deferals += NFE_READ(sc, NFE_TX_EXCESS_DEFERRAL); + stats->tx_retry_errors += NFE_READ(sc, NFE_TX_RETRY_ERROR); + stats->rx_frame_errors += NFE_READ(sc, NFE_RX_FRAME_ERROR); + stats->rx_extra_bytes += NFE_READ(sc, NFE_RX_EXTRA_BYTES); + stats->rx_late_cols += NFE_READ(sc, NFE_RX_LATE_COL); + stats->rx_runts += NFE_READ(sc, NFE_RX_RUNT); + stats->rx_jumbos += NFE_READ(sc, NFE_RX_JUMBO); + stats->rx_fifo_overuns += NFE_READ(sc, NFE_RX_FIFO_OVERUN); + stats->rx_crc_errors += NFE_READ(sc, NFE_RX_CRC_ERROR); + stats->rx_fae += NFE_READ(sc, NFE_RX_FAE); + stats->rx_len_errors += NFE_READ(sc, NFE_RX_LEN_ERROR); + stats->rx_unicast += NFE_READ(sc, NFE_RX_UNICAST); + stats->rx_multicast += NFE_READ(sc, NFE_RX_MULTICAST); + stats->rx_broadcast += NFE_READ(sc, NFE_RX_BROADCAST); + + if ((sc->nfe_flags & NFE_MIB_V2) != 0) { + stats->tx_deferals += NFE_READ(sc, NFE_TX_DEFERAL); + stats->tx_frames += NFE_READ(sc, NFE_TX_FRAME); + stats->rx_octets += NFE_READ(sc, NFE_RX_OCTET); + stats->tx_pause += NFE_READ(sc, NFE_TX_PAUSE); + stats->rx_pause += NFE_READ(sc, NFE_RX_PAUSE); + stats->rx_drops += NFE_READ(sc, NFE_RX_DROP); + } + + if ((sc->nfe_flags & NFE_MIB_V3) != 0) { + stats->tx_unicast += NFE_READ(sc, NFE_TX_UNICAST); + stats->tx_multicast += NFE_READ(sc, NFE_TX_MULTICAST); + stats->rx_broadcast += NFE_READ(sc, NFE_TX_BROADCAST); + } +} Modified: stable/7/sys/dev/nfe/if_nfereg.h ============================================================================== --- stable/7/sys/dev/nfe/if_nfereg.h Wed Mar 18 02:12:33 2009 (r189947) +++ stable/7/sys/dev/nfe/if_nfereg.h Wed Mar 18 02:23:01 2009 (r189948) @@ -87,11 +87,41 @@ #define NFE_PHY_SPEED 0x18c #define NFE_PHY_CTL 0x190 #define NFE_PHY_DATA 0x194 +#define NFE_TX_UNICAST 0x1a0 +#define NFE_TX_MULTICAST 0x1a4 +#define NFE_TX_BROADCAST 0x1a8 #define NFE_WOL_CTL 0x200 #define NFE_PATTERN_CRC 0x204 #define NFE_PATTERN_MASK 0x208 #define NFE_PWR_CAP 0x268 #define NFE_PWR_STATE 0x26c +#define NFE_TX_OCTET 0x280 +#define NFE_TX_ZERO_REXMIT 0x284 +#define NFE_TX_ONE_REXMIT 0x288 +#define NFE_TX_MULTI_REXMIT 0x28c +#define NFE_TX_LATE_COL 0x290 +#define NFE_TX_FIFO_UNDERUN 0x294 +#define NFE_TX_CARRIER_LOST 0x298 +#define NFE_TX_EXCESS_DEFERRAL 0x29c +#define NFE_TX_RETRY_ERROR 0x2a0 +#define NFE_RX_FRAME_ERROR 0x2a4 +#define NFE_RX_EXTRA_BYTES 0x2a8 +#define NFE_RX_LATE_COL 0x2ac +#define NFE_RX_RUNT 0x2b0 +#define NFE_RX_JUMBO 0x2b4 +#define NFE_RX_FIFO_OVERUN 0x2b8 +#define NFE_RX_CRC_ERROR 0x2bc +#define NFE_RX_FAE 0x2c0 +#define NFE_RX_LEN_ERROR 0x2c4 +#define NFE_RX_UNICAST 0x2c8 +#define NFE_RX_MULTICAST 0x2cc +#define NFE_RX_BROADCAST 0x2d0 +#define NFE_TX_DEFERAL 0x2d4 +#define NFE_TX_FRAME 0x2d8 +#define NFE_RX_OCTET 0x2dc +#define NFE_TX_PAUSE 0x2e0 +#define NFE_RX_PAUSE 0x2e4 +#define NFE_RX_DROP 0x2e8 #define NFE_VTAG_CTL 0x300 #define NFE_MSIX_MAP0 0x3e0 #define NFE_MSIX_MAP1 0x3e4 @@ -182,6 +212,10 @@ #define NFE_SEED_100TX 0x00002d00 #define NFE_SEED_1000T 0x00007400 +#define NFE_NUM_MIB_STATV1 21 +#define NFE_NUM_MIB_STATV2 27 +#define NFE_NUM_MIB_STATV3 30 + #define NFE_MSI_MESSAGES 8 #define NFE_MSI_VECTOR_0_ENABLED 0x01 Modified: stable/7/sys/dev/nfe/if_nfevar.h ============================================================================== --- stable/7/sys/dev/nfe/if_nfevar.h Wed Mar 18 02:12:33 2009 (r189947) +++ stable/7/sys/dev/nfe/if_nfevar.h Wed Mar 18 02:23:01 2009 (r189948) @@ -70,6 +70,39 @@ struct nfe_jrx_ring { int jnext; }; +struct nfe_hw_stats { + uint64_t rx_octets; + uint32_t rx_frame_errors; + uint32_t rx_extra_bytes; + uint32_t rx_late_cols; + uint32_t rx_runts; + uint32_t rx_jumbos; + uint32_t rx_fifo_overuns; + uint32_t rx_crc_errors; + uint32_t rx_fae; + uint32_t rx_len_errors; + uint32_t rx_unicast; + uint32_t rx_multicast; + uint32_t rx_broadcast; + uint32_t rx_pause; + uint32_t rx_drops; + uint64_t tx_octets; + uint32_t tx_zero_rexmits; + uint32_t tx_one_rexmits; + uint32_t tx_multi_rexmits; + uint32_t tx_late_cols; + uint32_t tx_fifo_underuns; + uint32_t tx_carrier_losts; + uint32_t tx_excess_deferals; + uint32_t tx_retry_errors; + uint32_t tx_deferals; + uint32_t tx_frames; + uint32_t tx_pause; + uint32_t tx_unicast; + uint32_t tx_multicast; + uint32_t tx_broadcast; +}; + struct nfe_softc { struct ifnet *nfe_ifp; device_t nfe_dev; @@ -96,10 +129,14 @@ struct nfe_softc { #define NFE_PWR_MGMT 0x0010 #define NFE_CORRECT_MACADDR 0x0020 #define NFE_TX_FLOW_CTRL 0x0040 +#define NFE_MIB_V1 0x0080 +#define NFE_MIB_V2 0x0100 +#define NFE_MIB_V3 0x0200 int nfe_jumbo_disable; uint32_t rxtxctl; uint8_t mii_phyaddr; uint8_t eaddr[ETHER_ADDR_LEN]; + struct nfe_hw_stats nfe_stats; struct taskqueue *nfe_tq; struct task nfe_int_task; struct task nfe_tx_task; From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 02:26: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 043CB1065706; Wed, 18 Mar 2009 02:26:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E450B8FC0A; Wed, 18 Mar 2009 02:26:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I2QkEf012723; Wed, 18 Mar 2009 02:26:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I2QkPe012722; Wed, 18 Mar 2009 02:26:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180226.n2I2QkPe012722@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 02:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189949 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 02:26:48 -0000 Author: yongari Date: Wed Mar 18 02:26:46 2009 New Revision: 189949 URL: http://svn.freebsd.org/changeset/base/189949 Log: MFC r188382: Document loader tunable hw.re.msi_disable. Bump .Dd Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/igb.4 (props changed) stable/7/share/man/man4/re.4 Modified: stable/7/share/man/man4/re.4 ============================================================================== --- stable/7/share/man/man4/re.4 Wed Mar 18 02:23:01 2009 (r189948) +++ stable/7/share/man/man4/re.4 Wed Mar 18 02:26:46 2009 (r189949) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2006 +.Dd February 9, 2009 .Dt RE 4 .Os .Sh NAME @@ -169,6 +169,16 @@ USRobotics USR997902 Gigabit Ethernet (8 .It Xterasys XN-152 10/100/1000 NIC (8169) .El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.re.msi_disable +This tunable disables MSI support on the Ethernet hardware. +The default value is 0. +.El .Sh DIAGNOSTICS .Bl -diag .It "re%d: couldn't map memory" From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 03:29: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 B91C1106566B; Wed, 18 Mar 2009 03:29:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A58628FC14; Wed, 18 Mar 2009 03:29:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I3T5iZ014256; Wed, 18 Mar 2009 03:29:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I3T5NK014255; Wed, 18 Mar 2009 03:29:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180329.n2I3T5NK014255@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 03:29: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: r189951 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 03:29:06 -0000 Author: yongari Date: Wed Mar 18 03:29:05 2009 New Revision: 189951 URL: http://svn.freebsd.org/changeset/base/189951 Log: MFC r189564: Report current link state while auto-negotiation is in progress. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ip1000phy.c Modified: stable/7/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/7/sys/dev/mii/ip1000phy.c Wed Mar 18 02:38:35 2009 (r189950) +++ stable/7/sys/dev/mii/ip1000phy.c Wed Mar 18 03:29:05 2009 (r189951) @@ -296,7 +296,7 @@ done: * Only retry autonegotiation every mii_anegticks seconds. */ if (sc->mii_ticks <= sc->mii_anegticks) - return (0); + break; sc->mii_ticks = 0; ip1000phy_mii_phy_auto(sc); From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 03:31: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 23D9A106564A; Wed, 18 Mar 2009 03:31:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 104A28FC1A; Wed, 18 Mar 2009 03:31:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I3VJPd014355; Wed, 18 Mar 2009 03:31:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I3VJ2E014354; Wed, 18 Mar 2009 03:31:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180331.n2I3VJ2E014354@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 03:31:19 +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: r189952 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 03:31:20 -0000 Author: yongari Date: Wed Mar 18 03:31:19 2009 New Revision: 189952 URL: http://svn.freebsd.org/changeset/base/189952 Log: MFC r189565: For unknown speed, explicitly set IFM_NONE. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ip1000phy.c Modified: stable/7/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/7/sys/dev/mii/ip1000phy.c Wed Mar 18 03:29:05 2009 (r189951) +++ stable/7/sys/dev/mii/ip1000phy.c Wed Mar 18 03:31:19 2009 (r189952) @@ -353,6 +353,9 @@ ip1000phy_status(struct mii_softc *sc) case IP1000PHY_LSR_SPEED_1000: mii->mii_media_active |= IFM_1000_T; break; + default: + mii->mii_media_active |= IFM_NONE; + return; } if ((stat & IP1000PHY_LSR_FULL_DUPLEX) != 0) mii->mii_media_active |= IFM_FDX; @@ -373,6 +376,9 @@ ip1000phy_status(struct mii_softc *sc) case PC_LinkSpeed_1000: mii->mii_media_active |= IFM_1000_T; break; + default: + mii->mii_media_active |= IFM_NONE; + return; } if ((stat & PC_PhyDuplexStatus) != 0) mii->mii_media_active |= IFM_FDX; From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 03:33:45 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 B58CC106566C; Wed, 18 Mar 2009 03:33:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87B1D8FC17; Wed, 18 Mar 2009 03:33:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I3Xj5O014458; Wed, 18 Mar 2009 03:33:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I3Xj2L014457; Wed, 18 Mar 2009 03:33:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180333.n2I3Xj2L014457@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 03:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189953 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 03:33:46 -0000 Author: yongari Date: Wed Mar 18 03:33:45 2009 New Revision: 189953 URL: http://svn.freebsd.org/changeset/base/189953 Log: MFC r189566: Use mii_phy_add_media() and remove setting each media type. While I'm here, don't set mii_anegticks as it's set by mii_phy_add_media(). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ip1000phy.c Modified: stable/7/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/7/sys/dev/mii/ip1000phy.c Wed Mar 18 03:31:19 2009 (r189952) +++ stable/7/sys/dev/mii/ip1000phy.c Wed Mar 18 03:33:45 2009 (r189953) @@ -118,7 +118,6 @@ ip1000phy_attach(device_t dev) sc->mii_phy = ma->mii_phyno; sc->mii_service = ip1000phy_service; sc->mii_pdata = mii; - sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_NOISOLATE; mii->mii_instance++; @@ -126,37 +125,14 @@ ip1000phy_attach(device_t dev) isc->model = MII_MODEL(ma->mii_id2); isc->revision = MII_REV(ma->mii_id2); + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + if (sc->mii_capabilities & BMSR_EXTSTAT) + sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); device_printf(dev, " "); -#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) - - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst), - BMCR_ISO); - - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst), - IP1000PHY_BMCR_10); - printf("10baseT, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, sc->mii_inst), - IP1000PHY_BMCR_10 | IP1000PHY_BMCR_FDX); - printf("10baseT-FDX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, sc->mii_inst), - IP1000PHY_BMCR_100); - printf("100baseTX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, sc->mii_inst), - IP1000PHY_BMCR_100 | IP1000PHY_BMCR_FDX); - printf("100baseTX-FDX, "); - /* 1000baseT half-duplex, really supported? */ - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0, sc->mii_inst), - IP1000PHY_BMCR_1000); - printf("1000baseTX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, IFM_FDX, sc->mii_inst), - IP1000PHY_BMCR_1000 | IP1000PHY_BMCR_FDX); - printf("1000baseTX-FDX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 0); - printf("auto\n"); -#undef ADD - ip1000phy_reset(sc); + mii_phy_add_media(sc); + printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); return(0); From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 03:36: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 39C6D106567D; Wed, 18 Mar 2009 03:36:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B6498FC19; Wed, 18 Mar 2009 03:36:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I3a8oO014552; Wed, 18 Mar 2009 03:36:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I3a80G014550; Wed, 18 Mar 2009 03:36:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180336.n2I3a80G014550@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 03:36: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: r189954 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 03:36:10 -0000 Author: yongari Date: Wed Mar 18 03:36:08 2009 New Revision: 189954 URL: http://svn.freebsd.org/changeset/base/189954 Log: MFC r189567: For IP1001 PHYs, read auto-negotiation advertisement register to get default next page configuration. While I'm here explicitly set IP1000PHY_ANAR_CSMA bit. This bit is read-only and always set by hardware so setting it has no effect but it would clear the intention. With this change controllers that couldn't establish 1000baseT link should work. PR: kern/130846 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ip1000phy.c stable/7/sys/dev/mii/ip1000phyreg.h Modified: stable/7/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/7/sys/dev/mii/ip1000phy.c Wed Mar 18 03:33:45 2009 (r189953) +++ stable/7/sys/dev/mii/ip1000phy.c Wed Mar 18 03:36:08 2009 (r189954) @@ -391,18 +391,24 @@ ip1000phy_status(struct mii_softc *sc) } static int -ip1000phy_mii_phy_auto(struct mii_softc *mii) +ip1000phy_mii_phy_auto(struct mii_softc *sc) { + struct ip1000phy_softc *isc; uint32_t reg; - PHY_WRITE(mii, IP1000PHY_MII_ANAR, - IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | + isc = (struct ip1000phy_softc *)sc; + reg = 0; + if (isc->model == MII_MODEL_ICPLUS_IP1001) + reg = PHY_READ(sc, IP1000PHY_MII_ANAR); + reg |= IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | IP1000PHY_ANAR_100TX | IP1000PHY_ANAR_100TX_FDX | - IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE); + IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE; + PHY_WRITE(sc, IP1000PHY_MII_ANAR, reg | IP1000PHY_ANAR_CSMA); + reg = IP1000PHY_1000CR_1000T | IP1000PHY_1000CR_1000T_FDX; reg |= IP1000PHY_1000CR_MASTER; - PHY_WRITE(mii, IP1000PHY_MII_1000CR, reg); - PHY_WRITE(mii, IP1000PHY_MII_BMCR, (IP1000PHY_BMCR_FDX | + PHY_WRITE(sc, IP1000PHY_MII_1000CR, reg); + PHY_WRITE(sc, IP1000PHY_MII_BMCR, (IP1000PHY_BMCR_FDX | IP1000PHY_BMCR_AUTOEN | IP1000PHY_BMCR_STARTNEG)); return (EJUSTRETURN); Modified: stable/7/sys/dev/mii/ip1000phyreg.h ============================================================================== --- stable/7/sys/dev/mii/ip1000phyreg.h Wed Mar 18 03:33:45 2009 (r189953) +++ stable/7/sys/dev/mii/ip1000phyreg.h Wed Mar 18 03:36:08 2009 (r189954) @@ -61,6 +61,7 @@ /* Autonegotiation advertisement register */ #define IP1000PHY_MII_ANAR 0x04 +#define IP1000PHY_ANAR_CSMA 0x0001 #define IP1000PHY_ANAR_10T 0x0020 #define IP1000PHY_ANAR_10T_FDX 0x0040 #define IP1000PHY_ANAR_100TX 0x0080 From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 11:30: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 74A78106566B; Wed, 18 Mar 2009 11:30:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 609CB8FC1E; Wed, 18 Mar 2009 11:30:47 +0000 (UTC) (envelope-from bz@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 n2IBUl7x025149; Wed, 18 Mar 2009 11:30:47 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IBUlaH025146; Wed, 18 Mar 2009 11:30:47 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903181130.n2IBUlaH025146@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 18 Mar 2009 11:30: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: r189956 - in stable/7: . sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/netinet sys/netinet6 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, 18 Mar 2009 11:30:48 -0000 Author: bz Date: Wed Mar 18 11:30:47 2009 New Revision: 189956 URL: http://svn.freebsd.org/changeset/base/189956 Log: MFC r184096: Bring over the change switching from using sequential to random ephemeral port allocation as implemented in netinet/in_pcb.c rev. 1.143 (initially from OpenBSD) and follow-up commits during the last four and a half years including rev. 1.157, 1.162 and 1.199. This now is relying on the same infrastructure as has been implemented in in_pcb.c since rev. 1.199. Reviewed by: rwatson (UPDATING) Modified: stable/7/UPDATING stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/in_pcb.h stable/7/sys/netinet6/in6_src.c Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Wed Mar 18 03:56:26 2009 (r189955) +++ stable/7/UPDATING Wed Mar 18 11:30:47 2009 (r189956) @@ -8,6 +8,13 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090318: + Change IPv6 ephemeral port allocation from sequential to + random allocation, like IPv4 has done for more than four years. + The implementation shares infrastructure with IPv4. This + means that there is only one set of sysctls to control both + IPv4 and IPv6. See ip(4) man page for details. + 20090312: A workaround is committed to allow the creation of System V shared memory segment of size > 2 GB on the 64-bit architectures. Modified: stable/7/sys/netinet/in_pcb.h ============================================================================== --- stable/7/sys/netinet/in_pcb.h Wed Mar 18 03:56:26 2009 (r189955) +++ stable/7/sys/netinet/in_pcb.h Wed Mar 18 11:30:47 2009 (r189956) @@ -483,6 +483,9 @@ extern int ipport_firstauto; extern int ipport_lastauto; extern int ipport_hifirstauto; extern int ipport_hilastauto; +extern int ipport_randomized; +extern int ipport_stoprandom; +extern int ipport_tcpallocs; extern struct callout ipport_tick_callout; void in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *); Modified: stable/7/sys/netinet6/in6_src.c ============================================================================== --- stable/7/sys/netinet6/in6_src.c Wed Mar 18 03:56:26 2009 (r189955) +++ stable/7/sys/netinet6/in6_src.c Wed Mar 18 11:30:47 2009 (r189956) @@ -91,6 +91,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include #include @@ -774,7 +777,7 @@ in6_pcbsetport(struct in6_addr *laddr, s { struct socket *so = inp->inp_socket; u_int16_t lport = 0, first, last, *lastport; - int count, error, wild = 0; + int count, error, wild = 0, dorandom; struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; INP_INFO_WLOCK_ASSERT(pcbinfo); @@ -807,56 +810,58 @@ in6_pcbsetport(struct in6_addr *laddr, s last = ipport_lastauto; lastport = &pcbinfo->ipi_lastport; } + /* - * Simple check to ensure all ports are not used up causing - * a deadlock here. - * - * We split the two cases (up and down) so that the direction - * is not being tested on each round of the loop. + * For UDP, use random port allocation as long as the user + * allows it. For TCP (and as of yet unknown) connections, + * use random port allocation only if the user allows it AND + * ipport_tick() allows it. */ - if (first > last) { - /* - * counting down - */ - count = first - last; + if (ipport_randomized && + (!ipport_stoprandom || pcbinfo == &udbinfo)) + dorandom = 1; + else + dorandom = 0; + /* + * It makes no sense to do random port allocation if + * we have the only port available. + */ + if (first == last) + dorandom = 0; + /* Make sure to not include UDP packets in the count. */ + if (pcbinfo != &udbinfo) + ipport_tcpallocs++; - do { - if (count-- < 0) { /* completely used? */ - /* - * Undo any address bind that may have - * occurred above. - */ - inp->in6p_laddr = in6addr_any; - return (EAGAIN); - } - --*lastport; - if (*lastport > first || *lastport < last) - *lastport = first; - lport = htons(*lastport); - } while (in6_pcblookup_local(pcbinfo, &inp->in6p_laddr, - lport, wild, cred)); - } else { - /* - * counting up - */ - count = last - first; + /* + * Instead of having two loops further down counting up or down + * make sure that first is always <= last and go with only one + * code path implementing all logic. + */ + if (first > last) { + u_int16_t aux; - do { - if (count-- < 0) { /* completely used? */ - /* - * Undo any address bind that may have - * occurred above. - */ - inp->in6p_laddr = in6addr_any; - return (EAGAIN); - } - ++*lastport; - if (*lastport < first || *lastport > last) - *lastport = first; - lport = htons(*lastport); - } while (in6_pcblookup_local(pcbinfo, &inp->in6p_laddr, - lport, wild, cred)); - } + aux = first; + first = last; + last = aux; + } + + if (dorandom) + *lastport = first + (arc4random() % (last - first)); + + count = last - first; + + do { + if (count-- < 0) { /* completely used? */ + /* Undo an address bind that may have occurred. */ + inp->in6p_laddr = in6addr_any; + return (EADDRNOTAVAIL); + } + ++*lastport; + if (*lastport < first || *lastport > last) + *lastport = first; + lport = htons(*lastport); + } while (in6_pcblookup_local(pcbinfo, &inp->in6p_laddr, + lport, wild, cred)); inp->inp_lport = lport; if (in_pcbinshash(inp) != 0) { From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 12:25:41 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 5289D106567D; Wed, 18 Mar 2009 12:25:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 253F08FC13; Wed, 18 Mar 2009 12:25:41 +0000 (UTC) (envelope-from bz@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 n2ICPfx6026169; Wed, 18 Mar 2009 12:25:41 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ICPffj026168; Wed, 18 Mar 2009 12:25:41 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903181225.n2ICPffj026168@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 18 Mar 2009 12:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189957 - in stable/7/sys: . contrib/pf dev/cxgb kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 12:25:42 -0000 Author: bz Date: Wed Mar 18 12:25:40 2009 New Revision: 189957 URL: http://svn.freebsd.org/changeset/base/189957 Log: MFC r185583: Fix a credential reference leak. [1] Close subtle but relatively unlikely race conditions when propagating the vnode write error to other active sessions tracing to the same vnode, without holding a reference on the vnode anymore. [2] PR: kern/126368 [1] Submitted by: rwatson [2] Reviewed by: kib, rwatson Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_ktrace.c Modified: stable/7/sys/kern/kern_ktrace.c ============================================================================== --- stable/7/sys/kern/kern_ktrace.c Wed Mar 18 11:30:47 2009 (r189956) +++ stable/7/sys/kern/kern_ktrace.c Wed Mar 18 12:25:40 2009 (r189957) @@ -907,12 +907,7 @@ ktr_writerequest(struct thread *td, stru */ mtx_lock(&ktrace_mtx); vp = td->td_proc->p_tracevp; - if (vp != NULL) - VREF(vp); cred = td->td_proc->p_tracecred; - if (cred != NULL) - crhold(cred); - mtx_unlock(&ktrace_mtx); /* * If vp is NULL, the vp has been cleared out from under this @@ -921,9 +916,13 @@ ktr_writerequest(struct thread *td, stru */ if (vp == NULL) { KASSERT(cred == NULL, ("ktr_writerequest: cred != NULL")); + mtx_unlock(&ktrace_mtx); return; } + VREF(vp); KASSERT(cred != NULL, ("ktr_writerequest: cred == NULL")); + crhold(cred); + mtx_unlock(&ktrace_mtx); kth = &req->ktr_header; datalen = data_lengths[(u_short)kth->ktr_type & ~KTR_DROP]; @@ -963,18 +962,26 @@ ktr_writerequest(struct thread *td, stru error = VOP_WRITE(vp, &auio, IO_UNIT | IO_APPEND, cred); VOP_UNLOCK(vp, 0, td); vn_finished_write(mp); - vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); - if (!error) + crfree(cred); + if (!error) { + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); return; + } + VFS_UNLOCK_GIANT(vfslocked); + /* * If error encountered, give up tracing on this vnode. We defer * all the vrele()'s on the vnode until after we are finished walking * the various lists to avoid needlessly holding locks. + * NB: at this point we still hold the vnode reference that must + * not go away as we need the valid vnode to compare with. Thus let + * vrele_count start at 1 and the reference will be freed + * by the loop at the end after our last use of vp. */ log(LOG_NOTICE, "ktrace write failed, errno %d, tracing stopped\n", error); - vrele_count = 0; + vrele_count = 1; /* * First, clear this vnode from being used by any processes in the * system. From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 13:19: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 367DE1065672; Wed, 18 Mar 2009 13:19:47 +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 22F348FC1D; Wed, 18 Mar 2009 13:19:47 +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 n2IDJlIJ027223; Wed, 18 Mar 2009 13:19:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IDJlrj027222; Wed, 18 Mar 2009 13:19:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200903181319.n2IDJlrj027222@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 18 Mar 2009 13:19: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: r189958 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/devfs 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, 18 Mar 2009 13:19:48 -0000 Author: kib Date: Wed Mar 18 13:19:46 2009 New Revision: 189958 URL: http://svn.freebsd.org/changeset/base/189958 Log: MFC r189693: Enable advisory file locking for devfs vnodes. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/devfs/devfs_vnops.c Modified: stable/7/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/7/sys/fs/devfs/devfs_vnops.c Wed Mar 18 12:25:40 2009 (r189957) +++ stable/7/sys/fs/devfs/devfs_vnops.c Wed Mar 18 13:19:46 2009 (r189958) @@ -387,14 +387,6 @@ devfs_access(struct vop_access_args *ap) /* ARGSUSED */ static int -devfs_advlock(struct vop_advlock_args *ap) -{ - - return (ap->a_flags & F_FLOCK ? EOPNOTSUPP : EINVAL); -} - -/* ARGSUSED */ -static int devfs_close(struct vop_close_args *ap) { struct vnode *vp = ap->a_vp, *oldvp; @@ -1501,7 +1493,6 @@ static struct vop_vector devfs_specops = .vop_default = &default_vnodeops, .vop_access = devfs_access, - .vop_advlock = devfs_advlock, .vop_bmap = VOP_PANIC, .vop_close = devfs_close, .vop_create = VOP_PANIC, From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 13:47:45 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 7888E106564A; Wed, 18 Mar 2009 13:47:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49FFE8FC08; Wed, 18 Mar 2009 13:47:45 +0000 (UTC) (envelope-from bz@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 n2IDljHt027814; Wed, 18 Mar 2009 13:47:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IDljQN027812; Wed, 18 Mar 2009 13:47:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903181347.n2IDljQN027812@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 18 Mar 2009 13:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189960 - in stable/7/sys: . contrib/pf dev/cxgb kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 13:47:46 -0000 Author: bz Date: Wed Mar 18 13:47:44 2009 New Revision: 189960 URL: http://svn.freebsd.org/changeset/base/189960 Log: MFC r185893: Make sure nmbclusters are initialized before maxsockets by running the tunable_mbinit() SYSINIT at SI_ORDER_MIDDLE before the init_maxsockets() SYSINT at SI_ORDER_ANY. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_mbuf.c stable/7/sys/kern/uipc_socket.c Modified: stable/7/sys/kern/kern_mbuf.c ============================================================================== --- stable/7/sys/kern/kern_mbuf.c Wed Mar 18 13:40:37 2009 (r189959) +++ stable/7/sys/kern/kern_mbuf.c Wed Mar 18 13:47:44 2009 (r189960) @@ -101,6 +101,11 @@ int nmbjumbo9; /* limits number of 9k int nmbjumbo16; /* limits number of 16k jumbo clusters */ struct mbstat mbstat; +/* + * tunable_mbinit() has to be run before init_maxsockets() thus + * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets() + * runs at SI_ORDER_ANY. + */ static void tunable_mbinit(void *dummy) { @@ -112,7 +117,7 @@ tunable_mbinit(void *dummy) nmbjumbo16 = nmbjumbo9 / 2; TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); } -SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_mbinit, NULL); +SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL); /* XXX: These should be tuneables. Can't change UMA limits on the fly. */ static int Modified: stable/7/sys/kern/uipc_socket.c ============================================================================== --- stable/7/sys/kern/uipc_socket.c Wed Mar 18 13:40:37 2009 (r189959) +++ stable/7/sys/kern/uipc_socket.c Wed Mar 18 13:47:44 2009 (r189960) @@ -237,7 +237,8 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsock "Maximum number of sockets avaliable"); /* - * Initialise maxsockets. + * Initialise maxsockets. This SYSINIT must be run after + * tunable_mbinit(). */ static void init_maxsockets(void *ignored) { From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 14:36:50 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 22BEB106566B; Wed, 18 Mar 2009 14:36:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E94768FC1A; Wed, 18 Mar 2009 14:36:49 +0000 (UTC) (envelope-from bz@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 n2IEanfx028926; Wed, 18 Mar 2009 14:36:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IEanvr028924; Wed, 18 Mar 2009 14:36:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903181436.n2IEanvr028924@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 18 Mar 2009 14:36: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: r189964 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet netinet6 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, 18 Mar 2009 14:36:50 -0000 Author: bz Date: Wed Mar 18 14:36:49 2009 New Revision: 189964 URL: http://svn.freebsd.org/changeset/base/189964 Log: MFC r185333: Unify the v4 and v6 versions of pcbdetach and pcbfree as good as possible so that they are easily diffable. No functional changes. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/in_pcb.c stable/7/sys/netinet6/in6_pcb.c Modified: stable/7/sys/netinet/in_pcb.c ============================================================================== --- stable/7/sys/netinet/in_pcb.c Wed Mar 18 14:33:10 2009 (r189963) +++ stable/7/sys/netinet/in_pcb.c Wed Mar 18 14:36:49 2009 (r189964) @@ -880,7 +880,7 @@ void in_pcbdetach(struct inpcb *inp) { - KASSERT(inp->inp_socket != NULL, ("in_pcbdetach: inp_socket == NULL")); + KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__)); inp->inp_socket->so_pcb = NULL; inp->inp_socket = NULL; @@ -895,14 +895,14 @@ in_pcbfree(struct inpcb *inp) { struct inpcbinfo *ipi = inp->inp_pcbinfo; - KASSERT(inp->inp_socket == NULL, ("in_pcbfree: inp_socket != NULL")); + KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); INP_INFO_WLOCK_ASSERT(ipi); INP_WLOCK_ASSERT(inp); #ifdef IPSEC ipsec4_delete_pcbpolicy(inp); -#endif /*IPSEC*/ +#endif /* IPSEC */ inp->inp_gencnt = ++ipi->ipi_gencnt; in_pcbremlists(inp); if (inp->inp_options) Modified: stable/7/sys/netinet6/in6_pcb.c ============================================================================== --- stable/7/sys/netinet6/in6_pcb.c Wed Mar 18 14:33:10 2009 (r189963) +++ stable/7/sys/netinet6/in6_pcb.c Wed Mar 18 14:36:49 2009 (r189964) @@ -416,7 +416,8 @@ void in6_pcbdetach(struct inpcb *inp) { - KASSERT(inp->inp_socket != NULL, ("in6_pcbdetach: inp_socket == NULL")); + KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__)); + inp->inp_socket->so_pcb = NULL; inp->inp_socket = NULL; } @@ -426,8 +427,9 @@ in6_pcbfree(struct inpcb *inp) { struct inpcbinfo *ipi = inp->inp_pcbinfo; - KASSERT(inp->inp_socket == NULL, ("in6_pcbfree: inp_socket != NULL")); - INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo); + KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); + + INP_INFO_WLOCK_ASSERT(ipi); INP_WLOCK_ASSERT(inp); #ifdef IPSEC @@ -445,6 +447,7 @@ in6_pcbfree(struct inpcb *inp) inp_freemoptions(inp->inp_moptions); inp->inp_vflag = 0; crfree(inp->inp_cred); + #ifdef MAC mac_destroy_inpcb(inp); #endif From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 14:43: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 C92D01065670; Wed, 18 Mar 2009 14:43:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6B398FC1B; Wed, 18 Mar 2009 14:43:56 +0000 (UTC) (envelope-from bz@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 n2IEhurj029097; Wed, 18 Mar 2009 14:43:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IEhud4029096; Wed, 18 Mar 2009 14:43:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903181443.n2IEhud4029096@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 18 Mar 2009 14:43: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: r189965 - in stable/7/sys: . contrib/pf dev/cxgb kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 14:43:57 -0000 Author: bz Date: Wed Mar 18 14:43:56 2009 New Revision: 189965 URL: http://svn.freebsd.org/changeset/base/189965 Log: MFC r185892: Style changes only. Put the return type on an extra line[1] and add an empty line at the beginning as we do not have any local variables. Submitted by: rwatson [1] Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/uipc_socket.c Modified: stable/7/sys/kern/uipc_socket.c ============================================================================== --- stable/7/sys/kern/uipc_socket.c Wed Mar 18 14:36:49 2009 (r189964) +++ stable/7/sys/kern/uipc_socket.c Wed Mar 18 14:43:56 2009 (r189965) @@ -240,8 +240,10 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsock * Initialise maxsockets. This SYSINIT must be run after * tunable_mbinit(). */ -static void init_maxsockets(void *ignored) +static void +init_maxsockets(void *ignored) { + TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets); maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters)); } From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 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 EAE57106566B; Wed, 18 Mar 2009 16:09:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D64138FC12; Wed, 18 Mar 2009 16:09:05 +0000 (UTC) (envelope-from bz@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 n2IG95ju030795; Wed, 18 Mar 2009 16:09:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IG95Jf030784; Wed, 18 Mar 2009 16:09:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903181609.n2IG95Jf030784@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 18 Mar 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: r189966 - in stable/7/sys: . contrib/pf dev/cxgb dev/cxgb/ulp/tom netinet netinet6 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, 18 Mar 2009 16:09:06 -0000 Author: bz Date: Wed Mar 18 16:09:05 2009 New Revision: 189966 URL: http://svn.freebsd.org/changeset/base/189966 Log: MFC r186222: Use inc_flags instead of the inc_isipv6 alias which so far had been the only flag with random usage patterns. Switch inc_flags to be used as a real bit field by using INC_ISIPV6 with bitops to check for the 'isipv6' condition. While here fix a place or two where in case of v4 inc_flags were not properly initialized before.[1] Found by: rwatson during review [1] Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/7/sys/netinet/in_pcb.c stable/7/sys/netinet/in_pcb.h stable/7/sys/netinet/tcp_hostcache.c stable/7/sys/netinet/tcp_input.c stable/7/sys/netinet/tcp_subr.c stable/7/sys/netinet/tcp_syncache.c stable/7/sys/netinet/tcp_timewait.c stable/7/sys/netinet/tcp_usrreq.c stable/7/sys/netinet6/icmp6.c stable/7/sys/netinet6/ip6_output.c Modified: stable/7/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- stable/7/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Mar 18 14:43:56 2009 (r189965) +++ stable/7/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Mar 18 16:09:05 2009 (r189966) @@ -3270,8 +3270,6 @@ syncache_add_accept_req(struct cpl_pass_ toep->tp_iss = toep->tp_delack_seq = toep->tp_rcv_wup = toep->tp_copied_seq = rcv_isn + 1; - - inc.inc_isipv6 = 0; inc.inc_len = 0; inc.inc_faddr.s_addr = req->peer_ip; inc.inc_laddr.s_addr = req->local_ip; @@ -3611,7 +3609,6 @@ syncache_expand_establish_req(struct cpl th.th_seq = req->rcv_isn; th.th_flags = TH_ACK; - inc.inc_isipv6 = 0; inc.inc_len = 0; inc.inc_faddr.s_addr = req->peer_ip; inc.inc_laddr.s_addr = req->local_ip; Modified: stable/7/sys/netinet/in_pcb.c ============================================================================== --- stable/7/sys/netinet/in_pcb.c Wed Mar 18 14:43:56 2009 (r189965) +++ stable/7/sys/netinet/in_pcb.c Wed Mar 18 16:09:05 2009 (r189966) @@ -1622,7 +1622,7 @@ db_print_inconninfo(struct in_conninfo * indent += 2; #ifdef INET6 - if (inc->inc_flags == 1) { + if (inc->inc_flags & INC_ISIPV6) { /* IPv6. */ ip6_sprintf(laddr_str, &inc->inc6_laddr); ip6_sprintf(faddr_str, &inc->inc6_faddr); Modified: stable/7/sys/netinet/in_pcb.h ============================================================================== --- stable/7/sys/netinet/in_pcb.h Wed Mar 18 14:43:56 2009 (r189965) +++ stable/7/sys/netinet/in_pcb.h Wed Mar 18 16:09:05 2009 (r189966) @@ -106,6 +106,12 @@ struct in_conninfo { /* protocol dependent part */ struct in_endpoints inc_ie; }; + +/* + * Flags for inc_flags. + */ +#define INC_ISIPV6 0x01 + #define inc_isipv6 inc_flags /* temp compatability */ #define inc_fport inc_ie.ie_fport #define inc_lport inc_ie.ie_lport Modified: stable/7/sys/netinet/tcp_hostcache.c ============================================================================== --- stable/7/sys/netinet/tcp_hostcache.c Wed Mar 18 14:43:56 2009 (r189965) +++ stable/7/sys/netinet/tcp_hostcache.c Wed Mar 18 16:09:05 2009 (r189966) @@ -276,7 +276,7 @@ tcp_hc_lookup(struct in_conninfo *inc) /* * Hash the foreign ip address. */ - if (inc->inc_isipv6) + if (inc->inc_flags & INC_ISIPV6) hash = HOSTCACHE_HASH6(&inc->inc6_faddr); else hash = HOSTCACHE_HASH(&inc->inc_faddr); @@ -294,7 +294,7 @@ tcp_hc_lookup(struct in_conninfo *inc) * Iterate through entries in bucket row looking for a match. */ TAILQ_FOREACH(hc_entry, &hc_head->hch_bucket, rmx_q) { - if (inc->inc_isipv6) { + if (inc->inc_flags & INC_ISIPV6) { if (memcmp(&inc->inc6_faddr, &hc_entry->ip6, sizeof(inc->inc6_faddr)) == 0) return hc_entry; @@ -331,7 +331,7 @@ tcp_hc_insert(struct in_conninfo *inc) /* * Hash the foreign ip address. */ - if (inc->inc_isipv6) + if (inc->inc_flags & INC_ISIPV6) hash = HOSTCACHE_HASH6(&inc->inc6_faddr); else hash = HOSTCACHE_HASH(&inc->inc_faddr); @@ -386,7 +386,7 @@ tcp_hc_insert(struct in_conninfo *inc) * Initialize basic information of hostcache entry. */ bzero(hc_entry, sizeof(*hc_entry)); - if (inc->inc_isipv6) + if (inc->inc_flags & INC_ISIPV6) bcopy(&inc->inc6_faddr, &hc_entry->ip6, sizeof(hc_entry->ip6)); else hc_entry->ip4 = inc->inc_faddr; Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Wed Mar 18 14:43:56 2009 (r189965) +++ stable/7/sys/netinet/tcp_input.c Wed Mar 18 16:09:05 2009 (r189966) @@ -564,9 +564,9 @@ findpcb: "tp not listening", __func__)); bzero(&inc, sizeof(inc)); - inc.inc_isipv6 = isipv6; #ifdef INET6 if (isipv6) { + inc.inc_flags |= INC_ISIPV6; inc.inc6_faddr = ip6->ip6_src; inc.inc6_laddr = ip6->ip6_dst; } else @@ -2974,14 +2974,11 @@ tcp_mssopt(struct in_conninfo *inc) u_long maxmtu = 0; u_long thcmtu = 0; size_t min_protoh; -#ifdef INET6 - int isipv6 = inc->inc_isipv6 ? 1 : 0; -#endif KASSERT(inc != NULL, ("tcp_mssopt with NULL in_conninfo pointer")); #ifdef INET6 - if (isipv6) { + if (inc->inc_flags & INC_ISIPV6) { mss = tcp_v6mssdflt; maxmtu = tcp_maxmtu6(inc, NULL); thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Wed Mar 18 14:43:56 2009 (r189965) +++ stable/7/sys/netinet/tcp_subr.c Wed Mar 18 16:09:05 2009 (r189966) @@ -1191,7 +1191,6 @@ tcp_ctlinput(int cmd, struct sockaddr *s * value (if given) and then notify. */ bzero(&inc, sizeof(inc)); - inc.inc_flags = 0; /* IPv4 */ inc.inc_faddr = faddr; inc.inc_fibnum = inp->inp_inc.inc_fibnum; @@ -1228,13 +1227,11 @@ tcp_ctlinput(int cmd, struct sockaddr *s if (inp != NULL) INP_WUNLOCK(inp); } else { + bzero(&inc, sizeof(inc)); inc.inc_fport = th->th_dport; inc.inc_lport = th->th_sport; inc.inc_faddr = faddr; inc.inc_laddr = ip->ip_src; -#ifdef INET6 - inc.inc_isipv6 = 0; -#endif syncache_unreach(&inc, th); } INP_INFO_WUNLOCK(&tcbinfo); @@ -1303,11 +1300,12 @@ tcp6_ctlinput(int cmd, struct sockaddr * (struct sockaddr *)ip6cp->ip6c_src, th.th_sport, cmd, NULL, notify); + bzero(&inc, sizeof(inc)); inc.inc_fport = th.th_dport; inc.inc_lport = th.th_sport; inc.inc6_faddr = ((struct sockaddr_in6 *)sa)->sin6_addr; inc.inc6_laddr = ip6cp->ip6c_src->sin6_addr; - inc.inc_isipv6 = 1; + inc.inc_flags |= INC_ISIPV6; INP_INFO_WLOCK(&tcbinfo); syncache_unreach(&inc, &th); INP_INFO_WUNLOCK(&tcbinfo); @@ -2188,7 +2186,7 @@ tcp_log_addrs(struct in_conninfo *inc, s strcat(s, "TCP: ["); sp = s + strlen(s); - if (inc && inc->inc_isipv6 == 0) { + if (inc && ((inc->inc_flags & INC_ISIPV6) == 0)) { inet_ntoa_r(inc->inc_faddr, sp); sp = s + strlen(s); sprintf(sp, "]:%i to [", ntohs(inc->inc_fport)); Modified: stable/7/sys/netinet/tcp_syncache.c ============================================================================== --- stable/7/sys/netinet/tcp_syncache.c Wed Mar 18 14:43:56 2009 (r189965) +++ stable/7/sys/netinet/tcp_syncache.c Wed Mar 18 16:09:05 2009 (r189966) @@ -474,7 +474,7 @@ syncache_lookup(struct in_conninfo *inc, struct syncache_head *sch; #ifdef INET6 - if (inc->inc_isipv6) { + if (inc->inc_flags & INC_ISIPV6) { sch = &tcp_syncache.hashbase[ SYNCACHE_HASH6(inc, tcp_syncache.hashmask)]; *schp = sch; @@ -498,7 +498,7 @@ syncache_lookup(struct in_conninfo *inc, /* Circle through bucket row to find matching entry. */ TAILQ_FOREACH(sc, &sch->sch_bucket, sc_hash) { #ifdef INET6 - if (sc->sc_inc.inc_isipv6) + if (sc->sc_inc.inc_flags & INC_ISIPV6) continue; #endif if (ENDPTS_EQ(&inc->inc_ie, &sc->sc_inc.inc_ie)) @@ -683,9 +683,9 @@ syncache_socket(struct syncache *sc, str INP_WLOCK(inp); /* Insert new socket into PCB hash list. */ - inp->inp_inc.inc_isipv6 = sc->sc_inc.inc_isipv6; + inp->inp_inc.inc_flags = sc->sc_inc.inc_flags; #ifdef INET6 - if (sc->sc_inc.inc_isipv6) { + if (sc->sc_inc.inc_flags & INC_ISIPV6) { inp->in6p_laddr = sc->sc_inc.inc6_laddr; } else { inp->inp_vflag &= ~INP_IPV6; @@ -702,7 +702,7 @@ syncache_socket(struct syncache *sc, str * put the PCB on the hash lists. */ #ifdef INET6 - if (sc->sc_inc.inc_isipv6) + if (sc->sc_inc.inc_flags & INC_ISIPV6) inp->in6p_laddr = in6addr_any; else #endif @@ -716,7 +716,7 @@ syncache_socket(struct syncache *sc, str printf("syncache_socket: could not copy policy\n"); #endif #ifdef INET6 - if (sc->sc_inc.inc_isipv6) { + if (sc->sc_inc.inc_flags & INC_ISIPV6) { struct inpcb *oinp = sotoinpcb(lso); struct in6_addr laddr6; struct sockaddr_in6 sin6; @@ -1043,7 +1043,7 @@ _syncache_add(struct in_conninfo *inc, s cred = crhold(so->so_cred); #ifdef INET6 - if (inc->inc_isipv6 && + if ((inc->inc_flags & INC_ISIPV6) && (inp->in6p_flags & IN6P_AUTOFLOWLABEL)) autoflowlabel = 1; #endif @@ -1072,7 +1072,7 @@ _syncache_add(struct in_conninfo *inc, s * Remember the IP options, if any. */ #ifdef INET6 - if (!inc->inc_isipv6) + if (!(inc->inc_flags & INC_ISIPV6)) #endif ipopts = (m) ? ip_srcroute(m) : NULL; @@ -1173,10 +1173,11 @@ _syncache_add(struct in_conninfo *inc, s sc->sc_cred = cred; cred = NULL; sc->sc_ipopts = ipopts; + /* XXX-BZ this fib assignment is just useless. */ sc->sc_inc.inc_fibnum = inp->inp_inc.inc_fibnum; bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo)); #ifdef INET6 - if (!inc->inc_isipv6) + if (!(inc->inc_flags & INC_ISIPV6)) #endif { sc->sc_ip_tos = ip_tos; @@ -1316,7 +1317,7 @@ syncache_respond(struct syncache *sc) hlen = #ifdef INET6 - (sc->sc_inc.inc_isipv6) ? sizeof(struct ip6_hdr) : + (sc->sc_inc.inc_flags & INC_ISIPV6) ? sizeof(struct ip6_hdr) : #endif sizeof(struct ip); tlen = hlen + sizeof(struct tcphdr); @@ -1343,7 +1344,7 @@ syncache_respond(struct syncache *sc) m->m_pkthdr.rcvif = NULL; #ifdef INET6 - if (sc->sc_inc.inc_isipv6) { + if (sc->sc_inc.inc_flags & INC_ISIPV6) { ip6 = mtod(m, struct ip6_hdr *); ip6->ip6_vfc = IPV6_VERSION; ip6->ip6_nxt = IPPROTO_TCP; @@ -1429,7 +1430,7 @@ syncache_respond(struct syncache *sc) to.to_signature, IPSEC_DIR_OUTBOUND); #endif #ifdef INET6 - if (sc->sc_inc.inc_isipv6) + if (sc->sc_inc.inc_flags & INC_ISIPV6) ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) + optlen); else #endif @@ -1438,7 +1439,7 @@ syncache_respond(struct syncache *sc) optlen = 0; #ifdef INET6 - if (sc->sc_inc.inc_isipv6) { + if (sc->sc_inc.inc_flags & INC_ISIPV6) { th->th_sum = 0; th->th_sum = in6_cksum(m, IPPROTO_TCP, hlen, tlen + optlen - hlen); @@ -1691,7 +1692,7 @@ syncookie_lookup(struct in_conninfo *inc sc->sc_iss = ack; #ifdef INET6 - if (inc->inc_isipv6) { + if (inc->inc_flags & INC_ISIPV6) { if (sotoinpcb(so)->in6p_flags & IN6P_AUTOFLOWLABEL) sc->sc_flowlabel = md5_buffer[1] & IPV6_FLOWLABEL_MASK; } else @@ -1779,7 +1780,7 @@ syncache_pcblist(struct sysctl_req *req, continue; bzero(&xt, sizeof(xt)); xt.xt_len = sizeof(xt); - if (sc->sc_inc.inc_isipv6) + if (sc->sc_inc.inc_flags & INC_ISIPV6) xt.xt_inp.inp_vflag = INP_IPV6; else xt.xt_inp.inp_vflag = INP_IPV4; Modified: stable/7/sys/netinet/tcp_timewait.c ============================================================================== --- stable/7/sys/netinet/tcp_timewait.c Wed Mar 18 14:43:56 2009 (r189965) +++ stable/7/sys/netinet/tcp_timewait.c Wed Mar 18 16:09:05 2009 (r189966) @@ -529,7 +529,7 @@ tcp_twrespond(struct tcptw *tw, int flag struct tcpopt to; #ifdef INET6 struct ip6_hdr *ip6 = NULL; - int isipv6 = inp->inp_inc.inc_isipv6; + int isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6; #endif INP_WLOCK_ASSERT(inp); Modified: stable/7/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/7/sys/netinet/tcp_usrreq.c Wed Mar 18 14:43:56 2009 (r189965) +++ stable/7/sys/netinet/tcp_usrreq.c Wed Mar 18 16:09:05 2009 (r189966) @@ -538,7 +538,7 @@ tcp6_usr_connect(struct socket *so, stru } inp->inp_vflag &= ~INP_IPV4; inp->inp_vflag |= INP_IPV6; - inp->inp_inc.inc_isipv6 = 1; + inp->inp_inc.inc_flags |= INC_ISIPV6; if ((error = prison_remote_ip6(td->td_ucred, &sin6p->sin6_addr)) != 0) goto out; if ((error = tcp6_connect(tp, nam, td)) != 0) Modified: stable/7/sys/netinet6/icmp6.c ============================================================================== --- stable/7/sys/netinet6/icmp6.c Wed Mar 18 14:43:56 2009 (r189965) +++ stable/7/sys/netinet6/icmp6.c Wed Mar 18 16:09:05 2009 (r189966) @@ -1129,7 +1129,7 @@ icmp6_mtudisc_update(struct ip6ctlparam mtu = IPV6_MMTU - 8; bzero(&inc, sizeof(inc)); - inc.inc_flags = 1; /* IPv6 */ + inc.inc_flags |= INC_ISIPV6; inc.inc6_faddr = *dst; if (in6_setscope(&inc.inc6_faddr, m->m_pkthdr.rcvif, NULL)) return; Modified: stable/7/sys/netinet6/ip6_output.c ============================================================================== --- stable/7/sys/netinet6/ip6_output.c Wed Mar 18 14:43:56 2009 (r189965) +++ stable/7/sys/netinet6/ip6_output.c Wed Mar 18 16:09:05 2009 (r189966) @@ -1314,7 +1314,7 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s struct in_conninfo inc; bzero(&inc, sizeof(inc)); - inc.inc_flags = 1; /* IPv6 */ + inc.inc_flags |= INC_ISIPV6; inc.inc6_faddr = *dst; if (ifp == NULL) From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 16:24: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 ECCBF1065672; Wed, 18 Mar 2009 16:24:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFE2C8FC1A; Wed, 18 Mar 2009 16:24:39 +0000 (UTC) (envelope-from alc@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 n2IGOdMG031167; Wed, 18 Mar 2009 16:24:39 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IGOdKk031166; Wed, 18 Mar 2009 16:24:39 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200903181624.n2IGOdKk031166@svn.freebsd.org> From: Alan Cox Date: Wed, 18 Mar 2009 16:24: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: r189968 - stable/7/sys/vm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 16:24:40 -0000 Author: alc Date: Wed Mar 18 16:24:39 2009 New Revision: 189968 URL: http://svn.freebsd.org/changeset/base/189968 Log: MFC revision 1.363 Eliminate redundant code from vm_page_startup(). (In retrospect, this change should have been included in the superpages MFC. This change subsumes r189750.) Discussed with: jhb Modified: stable/7/sys/vm/vm_page.c Modified: stable/7/sys/vm/vm_page.c ============================================================================== --- stable/7/sys/vm/vm_page.c Wed Mar 18 16:19:44 2009 (r189967) +++ stable/7/sys/vm/vm_page.c Wed Mar 18 16:24:39 2009 (r189968) @@ -209,7 +209,6 @@ vm_offset_t vm_page_startup(vm_offset_t vaddr) { vm_offset_t mapped; - vm_size_t npages; vm_paddr_t page_range; vm_paddr_t new_end; int i; @@ -224,9 +223,6 @@ vm_page_startup(vm_offset_t vaddr) vm_paddr_t low_water, high_water; int biggestone; - vm_paddr_t total; - - total = 0; biggestsize = 0; biggestone = 0; nblocks = 0; @@ -252,7 +248,6 @@ vm_page_startup(vm_offset_t vaddr) if (phys_avail[i + 1] > high_water) high_water = phys_avail[i + 1]; ++nblocks; - total += size; } end = phys_avail[biggestone+1]; @@ -320,8 +315,6 @@ vm_page_startup(vm_offset_t vaddr) #else #error "Either VM_PHYSSEG_DENSE or VM_PHYSSEG_SPARSE must be defined." #endif - npages = (total - (page_range * sizeof(struct vm_page)) - - (end - new_end)) / PAGE_SIZE; end = new_end; /* @@ -363,22 +356,6 @@ vm_page_startup(vm_offset_t vaddr) vm_page_array[i].order = VM_NFREEORDER; vm_page_array_size = page_range; -#if 0 - /* - * This assertion tests the hypothesis that npages and total are - * redundant. XXX - * - * XXX: This always fails if VM_NRESERVLEVEL > 0 because - * npages includes the memory for vm_reserv_startup() but - * page_range doesn't. - */ - page_range = 0; - for (i = 0; phys_avail[i + 1] != 0; i += 2) - page_range += atop(phys_avail[i + 1] - phys_avail[i]); - KASSERT(page_range == npages, - ("vm_page_startup: inconsistent page counts")); -#endif - /* * Initialize the physical memory allocator. */ From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 17:14: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 A71E91065673; Wed, 18 Mar 2009 17:14:44 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A21C8FC16; Wed, 18 Mar 2009 17:14:44 +0000 (UTC) (envelope-from bms@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 n2IHEiWP032247; Wed, 18 Mar 2009 17:14:44 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IHEib6032246; Wed, 18 Mar 2009 17:14:44 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200903181714.n2IHEib6032246@svn.freebsd.org> From: Bruce M Simpson Date: Wed, 18 Mar 2009 17:14: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: r189969 - stable/7/sys/dev/ae 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, 18 Mar 2009 17:14:45 -0000 Author: bms Date: Wed Mar 18 17:14:44 2009 New Revision: 189969 URL: http://svn.freebsd.org/changeset/base/189969 Log: MFC r183567: Merge Wake-on-Lan (WOL) support for the Attansic/Atheros L2. This was left out of the backport to RELENG_7 as the WOL infrastructure had not yet been backported to RELENG_7 when the ae(4) driver was merged. Tested OK on an ASUS EeePC 701 using ports/net/wol. Submitted by: yongari Modified: stable/7/sys/dev/ae/if_ae.c Modified: stable/7/sys/dev/ae/if_ae.c ============================================================================== --- stable/7/sys/dev/ae/if_ae.c Wed Mar 18 16:24:39 2009 (r189968) +++ stable/7/sys/dev/ae/if_ae.c Wed Mar 18 17:14:44 2009 (r189969) @@ -380,8 +380,10 @@ ae_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); - if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) + if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) { + ifp->if_capabilities |= IFCAP_WOL_MAGIC; sc->flags |= AE_FLAG_PMG; + } ifp->if_capenable = ifp->if_capabilities; /* @@ -1329,6 +1331,7 @@ ae_pm_init(ae_softc_t *sc) struct ifnet *ifp; uint32_t val; uint16_t pmstat; + struct mii_data *mii; int pmc; AE_LOCK_ASSERT(sc); @@ -1340,7 +1343,40 @@ ae_pm_init(ae_softc_t *sc) return; } - ae_powersave_enable(sc); + /* + * Configure WOL if enabled. + */ + if ((ifp->if_capenable & IFCAP_WOL) != 0) { + mii = device_get_softc(sc->miibus); + mii_pollstat(mii); + if ((mii->mii_media_status & IFM_AVALID) != 0 && + (mii->mii_media_status & IFM_ACTIVE) != 0) { + AE_WRITE_4(sc, AE_WOL_REG, AE_WOL_MAGIC | \ + AE_WOL_MAGIC_PME); + + /* + * Configure MAC. + */ + val = AE_MAC_RX_EN | AE_MAC_CLK_PHY | \ + AE_MAC_TX_CRC_EN | AE_MAC_TX_AUTOPAD | \ + ((AE_HALFBUF_DEFAULT << AE_HALFBUF_SHIFT) & \ + AE_HALFBUF_MASK) | \ + ((AE_MAC_PREAMBLE_DEFAULT << \ + AE_MAC_PREAMBLE_SHIFT) & AE_MAC_PREAMBLE_MASK) | \ + AE_MAC_BCAST_EN | AE_MAC_MCAST_EN; + if ((IFM_OPTIONS(mii->mii_media_active) & \ + IFM_FDX) != 0) + val |= AE_MAC_FULL_DUPLEX; + AE_WRITE_4(sc, AE_MAC_REG, val); + + } else { /* No link. */ + AE_WRITE_4(sc, AE_WOL_REG, AE_WOL_LNKCHG | \ + AE_WOL_LNKCHG_PME); + AE_WRITE_4(sc, AE_MAC_REG, 0); + } + } else { + ae_powersave_enable(sc); + } /* * PCIE hacks. Magic numbers. @@ -1358,6 +1394,8 @@ ae_pm_init(ae_softc_t *sc) pci_find_extcap(sc->dev, PCIY_PMG, &pmc); pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2); pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2); } From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 18:08:32 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71642106567B; Wed, 18 Mar 2009 18:08:32 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DE978FC08; Wed, 18 Mar 2009 18:08:32 +0000 (UTC) (envelope-from jamie@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 n2II8Wpw033291; Wed, 18 Mar 2009 18:08:32 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2II8VT0033288; Wed, 18 Mar 2009 18:08:31 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200903181808.n2II8VT0033288@svn.freebsd.org> From: Jamie Gritton Date: Wed, 18 Mar 2009 18:08:31 +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: r189970 - stable/7/sbin/ifconfig X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 18:08:33 -0000 Author: jamie Date: Wed Mar 18 18:08:31 2009 New Revision: 189970 URL: http://svn.freebsd.org/changeset/base/189970 Log: MFC r189864: Default to AF_LOCAL instead of AF_INET sockets for non-family-specific operations. This allows the query operations to work in non-IPv4 jails, and will be necessary in a future of possible non-INET networking. Approved by: bz (mentor) Modified: stable/7/sbin/ifconfig/ (props changed) stable/7/sbin/ifconfig/ifclone.c stable/7/sbin/ifconfig/ifconfig.c stable/7/sbin/ifconfig/ifgroup.c Modified: stable/7/sbin/ifconfig/ifclone.c ============================================================================== --- stable/7/sbin/ifconfig/ifclone.c Wed Mar 18 17:14:44 2009 (r189969) +++ stable/7/sbin/ifconfig/ifclone.c Wed Mar 18 18:08:31 2009 (r189970) @@ -53,9 +53,9 @@ list_cloners(void) int idx; int s; - s = socket(AF_INET, SOCK_DGRAM, 0); + s = socket(AF_LOCAL, SOCK_DGRAM, 0); if (s == -1) - err(1, "socket(AF_INET,SOCK_DGRAM)"); + err(1, "socket(AF_LOCAL,SOCK_DGRAM)"); memset(&ifcr, 0, sizeof(ifcr)); Modified: stable/7/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.c Wed Mar 18 17:14:44 2009 (r189969) +++ stable/7/sbin/ifconfig/ifconfig.c Wed Mar 18 18:08:31 2009 (r189970) @@ -434,21 +434,22 @@ static const struct cmd setifdstaddr_cmd DEF_CMD("ifdstaddr", 0, setifdstaddr); static int -ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *afp) +ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp) { - const struct afswtch *nafp; + const struct afswtch *afp, *nafp; struct callback *cb; int s; strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name); + afp = uafp != NULL ? uafp : af_getbyname("inet"); top: - if (afp == NULL) - afp = af_getbyname("inet"); ifr.ifr_addr.sa_family = afp->af_af == AF_LINK || afp->af_af == AF_UNSPEC ? - AF_INET : afp->af_af; + AF_LOCAL : afp->af_af; - if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0) + if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0 && + (uafp != NULL || errno != EPROTONOSUPPORT || + (s = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0)) err(1, "socket(family %u,SOCK_DGRAM", ifr.ifr_addr.sa_family); while (argc > 0) { @@ -792,11 +793,12 @@ status(const struct afswtch *afp, const if (afp == NULL) { allfamilies = 1; - afp = af_getbyname("inet"); - } else + ifr.ifr_addr.sa_family = AF_LOCAL; + } else { allfamilies = 0; - - ifr.ifr_addr.sa_family = afp->af_af == AF_LINK ? AF_INET : afp->af_af; + ifr.ifr_addr.sa_family = + afp->af_af == AF_LINK ? AF_LOCAL : afp->af_af; + } strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0); Modified: stable/7/sbin/ifconfig/ifgroup.c ============================================================================== --- stable/7/sbin/ifconfig/ifgroup.c Wed Mar 18 17:14:44 2009 (r189969) +++ stable/7/sbin/ifconfig/ifgroup.c Wed Mar 18 18:08:31 2009 (r189970) @@ -131,9 +131,9 @@ printgroup(const char *groupname) int len, cnt = 0; int s; - s = socket(AF_INET, SOCK_DGRAM, 0); + s = socket(AF_LOCAL, SOCK_DGRAM, 0); if (s == -1) - err(1, "socket(AF_INET,SOCK_DGRAM)"); + err(1, "socket(AF_LOCAL,SOCK_DGRAM)"); bzero(&ifgr, sizeof(ifgr)); strlcpy(ifgr.ifgr_name, groupname, sizeof(ifgr.ifgr_name)); if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) { From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 18:18: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 1E78D106579D; Wed, 18 Mar 2009 18:18:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AAB18FC13; Wed, 18 Mar 2009 18:18:39 +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 n2IIIcri033545; Wed, 18 Mar 2009 18:18:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IIIcnF033542; Wed, 18 Mar 2009 18:18:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903181818.n2IIIcnF033542@svn.freebsd.org> From: John Baldwin Date: Wed, 18 Mar 2009 18:18: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: r189971 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/udf 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, 18 Mar 2009 18:18:40 -0000 Author: jhb Date: Wed Mar 18 18:18:38 2009 New Revision: 189971 URL: http://svn.freebsd.org/changeset/base/189971 Log: MFC: Add support for fifos to UDF. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/udf/udf.h stable/7/sys/fs/udf/udf_vfsops.c stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf.h ============================================================================== --- stable/7/sys/fs/udf/udf.h Wed Mar 18 18:08:31 2009 (r189970) +++ stable/7/sys/fs/udf/udf.h Wed Mar 18 18:18:38 2009 (r189971) @@ -137,3 +137,5 @@ int udf_vget(struct mount *, ino_t, int, extern uma_zone_t udf_zone_trans; extern uma_zone_t udf_zone_node; extern uma_zone_t udf_zone_ds; + +extern struct vop_vector udf_fifoops; Modified: stable/7/sys/fs/udf/udf_vfsops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vfsops.c Wed Mar 18 18:08:31 2009 (r189970) +++ stable/7/sys/fs/udf/udf_vfsops.c Wed Mar 18 18:18:38 2009 (r189971) @@ -681,6 +681,7 @@ udf_vget(struct mount *mp, ino_t ino, in break; case 9: vp->v_type = VFIFO; + vp->v_op = &udf_fifoops; break; case 10: vp->v_type = VSOCK; Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Wed Mar 18 18:08:31 2009 (r189970) +++ stable/7/sys/fs/udf/udf_vnops.c Wed Mar 18 18:18:38 2009 (r189971) @@ -48,6 +48,7 @@ #include +#include #include #include #include @@ -60,9 +61,11 @@ static vop_getattr_t udf_getattr; static vop_open_t udf_open; static vop_ioctl_t udf_ioctl; static vop_pathconf_t udf_pathconf; +static vop_print_t udf_print; static vop_read_t udf_read; static vop_readdir_t udf_readdir; static vop_readlink_t udf_readlink; +static vop_setattr_t udf_setattr; static vop_strategy_t udf_strategy; static vop_bmap_t udf_bmap; static vop_cachedlookup_t udf_lookup; @@ -84,14 +87,26 @@ static struct vop_vector udf_vnodeops = .vop_lookup = vfs_cache_lookup, .vop_open = udf_open, .vop_pathconf = udf_pathconf, + .vop_print = udf_print, .vop_read = udf_read, .vop_readdir = udf_readdir, .vop_readlink = udf_readlink, .vop_reclaim = udf_reclaim, + .vop_setattr = udf_setattr, .vop_strategy = udf_strategy, .vop_vptofh = udf_vptofh, }; +struct vop_vector udf_fifoops = { + .vop_default = &fifo_specops, + .vop_access = udf_access, + .vop_getattr = udf_getattr, + .vop_print = udf_print, + .vop_reclaim = udf_reclaim, + .vop_setattr = udf_setattr, + .vop_vptofh = udf_vptofh, +}; + MALLOC_DEFINE(M_UDFFID, "udf_fid", "UDF FileId structure"); MALLOC_DEFINE(M_UDFDS, "udf_ds", "UDF Dirstream structure"); @@ -305,6 +320,38 @@ udf_getattr(struct vop_getattr_args *a) return (0); } +static int +udf_setattr(struct vop_setattr_args *a) +{ + struct vnode *vp; + struct vattr *vap; + + vp = a->a_vp; + vap = a->a_vap; + if (vap->va_flags != (u_long)VNOVAL || vap->va_uid != (uid_t)VNOVAL || + vap->va_gid != (gid_t)VNOVAL || vap->va_atime.tv_sec != VNOVAL || + vap->va_mtime.tv_sec != VNOVAL || vap->va_mode != (mode_t)VNOVAL) + return (EROFS); + if (vap->va_size != (u_quad_t)VNOVAL) { + switch (vp->v_type) { + case VDIR: + return (EISDIR); + case VLNK: + case VREG: + return (EROFS); + case VCHR: + case VBLK: + case VSOCK: + case VFIFO: + case VNON: + case VBAD: + case VMARKER: + return (0); + } + } + return (0); +} + /* * File specific ioctls. */ @@ -341,6 +388,20 @@ udf_pathconf(struct vop_pathconf_args *a } } +static int +udf_print(struct vop_print_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct udf_node *node = VTON(vp); + + printf(" ino %lu, on dev %s", (u_long)node->hash_id, + devtoname(node->udfmp->im_dev)); + if (vp->v_type == VFIFO) + fifo_printinfo(vp); + printf("\n"); + return (0); +} + #define lblkno(udfmp, loc) ((loc) >> (udfmp)->bshift) #define blkoff(udfmp, loc) ((loc) & (udfmp)->bmask) #define lblktosize(imp, blk) ((blk) << (udfmp)->bshift) From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 18:20: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 472B810656C6; Wed, 18 Mar 2009 18:20:21 +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 32BFE8FC1B; Wed, 18 Mar 2009 18:20:21 +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 n2IIKL1v033635; Wed, 18 Mar 2009 18:20:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IIKLFr033632; Wed, 18 Mar 2009 18:20:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903181820.n2IIKLFr033632@svn.freebsd.org> From: John Baldwin Date: Wed, 18 Mar 2009 18:20: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: r189972 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/udf 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, 18 Mar 2009 18:20:23 -0000 Author: jhb Date: Wed Mar 18 18:20:20 2009 New Revision: 189972 URL: http://svn.freebsd.org/changeset/base/189972 Log: MFC: Add rudimentary support for symbolic links on UDF. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/udf/ecma167-udf.h stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/ecma167-udf.h ============================================================================== --- stable/7/sys/fs/udf/ecma167-udf.h Wed Mar 18 18:18:38 2009 (r189971) +++ stable/7/sys/fs/udf/ecma167-udf.h Wed Mar 18 18:20:20 2009 (r189972) @@ -354,6 +354,18 @@ struct file_entry { #define UDF_FENTRY_PERM_GRP_MASK 0xE0 #define UDF_FENTRY_PERM_OWNER_MASK 0x1C00 +/* Path Component [4/14.16.1] */ +struct path_component { + uint8_t type; + uint8_t length; + uint16_t version; + uint8_t identifier[1]; +} __packed; +#define UDF_PATH_ROOT 2 +#define UDF_PATH_DOTDOT 3 +#define UDF_PATH_DOT 4 +#define UDF_PATH_PATH 5 + union dscrptr { struct desc_tag tag; struct anchor_vdp avdp; Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Wed Mar 18 18:18:38 2009 (r189971) +++ stable/7/sys/fs/udf/udf_vnops.c Wed Mar 18 18:20:20 2009 (r189972) @@ -846,12 +846,121 @@ udf_readdir(struct vop_readdir_args *a) return (error); } -/* Are there any implementations out there that do soft-links? */ static int udf_readlink(struct vop_readlink_args *ap) { - printf("%s called\n", __func__); - return (EOPNOTSUPP); + struct path_component *pc, *end; + struct vnode *vp; + struct uio uio; + struct iovec iov[1]; + struct udf_node *node; + void *buf; + char *cp; + int error, len, root; + + /* + * A symbolic link in UDF is a list of variable-length path + * component structures. We build a pathname in the caller's + * uio by traversing this list. + */ + vp = ap->a_vp; + node = VTON(vp); + len = le64toh(node->fentry->inf_len); + buf = malloc(iov[0].iov_len, M_DEVBUF, M_WAITOK); + iov[0].iov_base = buf; + iov[0].iov_len = len; + uio.uio_iov = iov; + uio.uio_iovcnt = 1; + uio.uio_offset = 0; + uio.uio_resid = iov[0].iov_len; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_READ; + uio.uio_td = curthread; + error = VOP_READ(vp, &uio, 0, ap->a_cred); + if (error) + goto error; + + pc = buf; + end = (void *)((char *)buf + len); + root = 0; + while (pc < end) { + switch (pc->type) { + case UDF_PATH_ROOT: + /* Only allow this at the beginning of a path. */ + if ((void *)pc != buf) { + error = EINVAL; + goto error; + } + cp = "/"; + len = 1; + root = 1; + break; + case UDF_PATH_DOT: + cp = "."; + len = 1; + break; + case UDF_PATH_DOTDOT: + cp = ".."; + len = 2; + break; + case UDF_PATH_PATH: + if (pc->length == 0) { + error = EINVAL; + goto error; + } + /* + * XXX: We only support CS8 which appears to map + * to ASCII directly. + */ + switch (pc->identifier[0]) { + case 8: + cp = pc->identifier + 1; + len = pc->length - 1; + break; + default: + error = EOPNOTSUPP; + goto error; + } + break; + default: + error = EINVAL; + goto error; + } + + /* + * If this is not the first component, insert a path + * separator. + */ + if (pc != buf) { + /* If we started with root we already have a "/". */ + if (root) + goto skipslash; + root = 0; + if (ap->a_uio->uio_resid < 1) { + error = ENAMETOOLONG; + goto error; + } + error = uiomove("/", 1, ap->a_uio); + if (error) + break; + } + skipslash: + + /* Append string at 'cp' of length 'len' to our path. */ + if (len > ap->a_uio->uio_resid) { + error = ENAMETOOLONG; + goto error; + } + error = uiomove(cp, len, ap->a_uio); + if (error) + break; + + /* Advance to next component. */ + pc = (void *)((char *)pc + 4 + pc->length); + } +error: + free(buf, M_DEVBUF); + return (error); } static int From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 18:25:57 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43477106564A; Wed, 18 Mar 2009 18:25:57 +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 2662E8FC1F; Wed, 18 Mar 2009 18:25:57 +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 n2IIPvYu033797; Wed, 18 Mar 2009 18:25:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IIPunx033795; Wed, 18 Mar 2009 18:25:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903181825.n2IIPunx033795@svn.freebsd.org> From: John Baldwin Date: Wed, 18 Mar 2009 18:25: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: r189973 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/udf 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, 18 Mar 2009 18:25:58 -0000 Author: jhb Date: Wed Mar 18 18:25:56 2009 New Revision: 189973 URL: http://svn.freebsd.org/changeset/base/189973 Log: MFC: Mark udf(4) MPSAFE and add support for using shared vnode locks for pathname lookups. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/udf/udf_vfsops.c stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf_vfsops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vfsops.c Wed Mar 18 18:20:20 2009 (r189972) +++ stable/7/sys/fs/udf/udf_vfsops.c Wed Mar 18 18:25:56 2009 (r189973) @@ -344,6 +344,7 @@ udf_mountfs(struct vnode *devvp, struct mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; + mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED; MNT_IUNLOCK(mp); udfmp->im_mountp = mp; udfmp->im_dev = devvp->v_rdev; @@ -546,22 +547,13 @@ static int udf_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td) { struct udf_mnt *udfmp; - struct vnode *vp; ino_t id; - int error; udfmp = VFSTOUDFFS(mp); id = udf_getid(&udfmp->root_icb); - error = udf_vget(mp, id, LK_EXCLUSIVE, vpp); - if (error) - return error; - - vp = *vpp; - vp->v_vflag |= VV_ROOT; - - return (0); + return (udf_vget(mp, id, flags, vpp)); } static int @@ -597,6 +589,22 @@ udf_vget(struct mount *mp, ino_t ino, in if (error || *vpp != NULL) return (error); + /* + * We must promote to an exclusive lock for vnode creation. This + * can happen if lookup is passed LOCKSHARED. + */ + if ((flags & LK_TYPE_MASK) == LK_SHARED) { + flags &= ~LK_TYPE_MASK; + flags |= LK_EXCLUSIVE; + } + + /* + * We do not lock vnode creation as it is believed to be too + * expensive for such rare case as simultaneous creation of vnode + * for same ino by different processes. We just allow them to race + * and check later to decide who wins. Let the race begin! + */ + td = curthread; udfmp = VFSTOUDFFS(mp); @@ -690,6 +698,13 @@ udf_vget(struct mount *mp, ino_t ino, in vp->v_type = VLNK; break; } + + if (vp->v_type != VFIFO) + VN_LOCK_ASHARE(vp); + + if (ino == udf_getid(&udfmp->root_icb)) + vp->v_vflag |= VV_ROOT; + *vpp = vp; return (0); Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Wed Mar 18 18:20:20 2009 (r189972) +++ stable/7/sys/fs/udf/udf_vnops.c Wed Mar 18 18:25:56 2009 (r189973) @@ -1056,13 +1056,14 @@ udf_lookup(struct vop_cachedlookup_args long namelen; ino_t id = 0; int offset, error = 0; - int numdirpasses, fsize; + int fsize, lkflags, ltype, numdirpasses; dvp = a->a_dvp; node = VTON(dvp); udfmp = node->udfmp; nameiop = a->a_cnp->cn_nameiop; flags = a->a_cnp->cn_flags; + lkflags = a->a_cnp->cn_lkflags; nameptr = a->a_cnp->cn_nameptr; namelen = a->a_cnp->cn_namelen; fsize = le64toh(node->fentry->inf_len); @@ -1124,20 +1125,36 @@ lookloop: /* Did we have a match? */ if (id) { - if (flags & ISDOTDOT) - VOP_UNLOCK(dvp, 0, a->a_cnp->cn_thread); - error = udf_vget(udfmp->im_mountp, id, LK_EXCLUSIVE, &tdp); - if (flags & ISDOTDOT) - vn_lock(dvp, LK_EXCLUSIVE|LK_RETRY, a->a_cnp->cn_thread); - if (!error) { + /* + * Remember where this entry was if it's the final + * component. + */ + if ((flags & ISLASTCN) && nameiop == LOOKUP) + node->diroff = ds->offset + ds->off; + if (numdirpasses == 2) + nchstats.ncs_pass2++; + udf_closedir(ds); + + if (flags & ISDOTDOT) { + error = vn_vget_ino(dvp, id, lkflags, &tdp); + } else if (node->hash_id == id) { + VREF(dvp); /* we want ourself, ie "." */ /* - * Remember where this entry was if it's the final - * component. + * When we lookup "." we still can be asked to lock it + * differently. */ - if ((flags & ISLASTCN) && nameiop == LOOKUP) - node->diroff = ds->offset + ds->off; - if (numdirpasses == 2) - nchstats.ncs_pass2++; + ltype = lkflags & LK_TYPE_MASK; + if (ltype != VOP_ISLOCKED(dvp, td)) { + if (ltype == LK_EXCLUSIVE) + vn_lock(dvp, LK_UPGRADE | LK_RETRY, td); + else /* if (ltype == LK_SHARED) */ + vn_lock(dvp, LK_DOWNGRADE | LK_RETRY, + td); + } + tdp = dvp; + } else + error = udf_vget(udfmp->im_mountp, id, lkflags, &tdp); + if (!error) { *vpp = tdp; /* Put this entry in the cache */ if (flags & MAKEENTRY) @@ -1151,6 +1168,7 @@ lookloop: udf_closedir(ds); goto lookloop; } + udf_closedir(ds); /* Enter name into cache as non-existant */ if (flags & MAKEENTRY) @@ -1164,7 +1182,6 @@ lookloop: } } - udf_closedir(ds); return (error); } From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 18:30: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 76D2F10656BD; Wed, 18 Mar 2009 18:30: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 637368FC15; Wed, 18 Mar 2009 18:30: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 n2IIU0oO033939; Wed, 18 Mar 2009 18:30:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IIU0F4033938; Wed, 18 Mar 2009 18:30:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903181830.n2IIU0F4033938@svn.freebsd.org> From: John Baldwin Date: Wed, 18 Mar 2009 18:30: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: r189974 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb ufs/ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 18:30:01 -0000 Author: jhb Date: Wed Mar 18 18:30:00 2009 New Revision: 189974 URL: http://svn.freebsd.org/changeset/base/189974 Log: MFC: - If the g_access() call for the initial root mount fails, then fully cleanup. Before the GEOM consumer would not have been closed. - Bump the reference on the character device being mounted while the associated devfs vnode is locked. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/ufs/ffs/ffs_vfsops.c Modified: stable/7/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/7/sys/ufs/ffs/ffs_vfsops.c Wed Mar 18 18:25:56 2009 (r189973) +++ stable/7/sys/ufs/ffs/ffs_vfsops.c Wed Mar 18 18:30:00 2009 (r189974) @@ -622,10 +622,13 @@ ffs_mountfs(devvp, mp, td) struct g_consumer *cp; struct mount *nmp; - dev = devvp->v_rdev; + bp = NULL; + ump = NULL; cred = td ? td->td_ucred : NOCRED; - ronly = (mp->mnt_flag & MNT_RDONLY) != 0; + + dev = devvp->v_rdev; + dev_ref(dev); DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "ffs", ronly ? 0 : 1); @@ -640,8 +643,7 @@ ffs_mountfs(devvp, mp, td) PICKUP_GIANT(); VOP_UNLOCK(devvp, 0, td); if (error) - return (error); - dev_ref(dev); + goto out; if (devvp->v_rdev->si_iosize_max != 0) mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max; if (mp->mnt_iosize_max > MAXPHYS) @@ -650,8 +652,6 @@ ffs_mountfs(devvp, mp, td) devvp->v_bufobj.bo_private = cp; devvp->v_bufobj.bo_ops = &ffs_ops; - bp = NULL; - ump = NULL; fs = NULL; sblockloc = 0; /* From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 18:38:26 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA70110656CD; Wed, 18 Mar 2009 18:38:26 +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 ACC608FC0C; Wed, 18 Mar 2009 18:38:26 +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 n2IIcQ69034184; Wed, 18 Mar 2009 18:38:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IIcQAp034183; Wed, 18 Mar 2009 18:38:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903181838.n2IIcQAp034183@svn.freebsd.org> From: John Baldwin Date: Wed, 18 Mar 2009 18:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189975 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/cd9660 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, 18 Mar 2009 18:38:28 -0000 Author: jhb Date: Wed Mar 18 18:38:26 2009 New Revision: 189975 URL: http://svn.freebsd.org/changeset/base/189975 Log: MFC: Keep the vnode for the mountpoint locked on return from namei() until after g_vfs_open() to match other filesystems. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/cd9660/cd9660_vfsops.c Modified: stable/7/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- stable/7/sys/fs/cd9660/cd9660_vfsops.c Wed Mar 18 18:30:00 2009 (r189974) +++ stable/7/sys/fs/cd9660/cd9660_vfsops.c Wed Mar 18 18:38:26 2009 (r189975) @@ -154,14 +154,14 @@ cd9660_mount(struct mount *mp, struct th * Not an update, or updating the name: look up the name * and verify that it refers to a sensible block device. */ - NDINIT(&ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, fspec, td); + NDINIT(&ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspec, td); if ((error = namei(&ndp))) return (error); NDFREE(&ndp, NDF_ONLY_PNBUF); devvp = ndp.ni_vp; if (!vn_isdisk(devvp, &error)) { - vrele(devvp); + vput(devvp); return (error); } @@ -170,7 +170,6 @@ cd9660_mount(struct mount *mp, struct th * or has superuser abilities */ accessmode = VREAD; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); error = VOP_ACCESS(devvp, accessmode, td->td_ucred, td); if (error) error = priv_check(td, PRIV_VFS_MOUNT_PERM); @@ -178,22 +177,20 @@ cd9660_mount(struct mount *mp, struct th vput(devvp); return (error); } - VOP_UNLOCK(devvp, 0, td); if ((mp->mnt_flag & MNT_UPDATE) == 0) { error = iso_mountfs(devvp, mp, td); + if (error) + vrele(devvp); } else { if (devvp != imp->im_devvp) error = EINVAL; /* needs translation */ - else - vrele(devvp); - } - if (error) { - vrele(devvp); - return error; + vput(devvp); } + if (error) + return (error); vfs_mountedfrom(mp, fspec); - return 0; + return (0); } /* @@ -224,7 +221,6 @@ iso_mountfs(devvp, mp, td) struct bufobj *bo; char *cs_local, *cs_disk; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "cd9660", 0); From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 18:42: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 C12E210656CF; Wed, 18 Mar 2009 18:42:48 +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 A304A8FC17; Wed, 18 Mar 2009 18:42:48 +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 n2IIgmIo034314; Wed, 18 Mar 2009 18:42:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IIgmvI034311; Wed, 18 Mar 2009 18:42:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903181842.n2IIgmvI034311@svn.freebsd.org> From: John Baldwin Date: Wed, 18 Mar 2009 18:42: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: r189976 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/cd9660 fs/udf 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, 18 Mar 2009 18:42:50 -0000 Author: jhb Date: Wed Mar 18 18:42:48 2009 New Revision: 189976 URL: http://svn.freebsd.org/changeset/base/189976 Log: MFC: Consolidate error handling in mount routines and make the mountpoint hold a reference on the cdev the fs is mounted on. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/cd9660/cd9660_vfsops.c stable/7/sys/fs/udf/udf_vfsops.c Modified: stable/7/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- stable/7/sys/fs/cd9660/cd9660_vfsops.c Wed Mar 18 18:38:26 2009 (r189975) +++ stable/7/sys/fs/cd9660/cd9660_vfsops.c Wed Mar 18 18:42:48 2009 (r189976) @@ -205,7 +205,7 @@ iso_mountfs(devvp, mp, td) struct iso_mnt *isomp = (struct iso_mnt *)0; struct buf *bp = NULL; struct buf *pribp = NULL, *supbp = NULL; - struct cdev *dev = devvp->v_rdev; + struct cdev *dev; int error = EINVAL; int high_sierra = 0; int iso_bsize; @@ -221,6 +221,8 @@ iso_mountfs(devvp, mp, td) struct bufobj *bo; char *cs_local, *cs_disk; + dev = devvp->v_rdev; + dev_ref(dev); DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "cd9660", 0); @@ -228,27 +230,21 @@ iso_mountfs(devvp, mp, td) PICKUP_GIANT(); VOP_UNLOCK(devvp, 0, td); if (error) - return error; + goto out; if (devvp->v_rdev->si_iosize_max != 0) mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max; if (mp->mnt_iosize_max > MAXPHYS) mp->mnt_iosize_max = MAXPHYS; bo = &devvp->v_bufobj; - bo->bo_private = cp; - bo->bo_ops = g_vfs_bufops; /* This is the "logical sector size". The standard says this * should be 2048 or the physical sector size on the device, * whichever is greater. */ if ((ISO_DEFAULT_BLOCK_SIZE % cp->provider->sectorsize) != 0) { - DROP_GIANT(); - g_topology_lock(); - g_vfs_close(cp, td); - g_topology_unlock(); - PICKUP_GIANT(); - return (EINVAL); + error = EINVAL; + goto out; } iso_bsize = cp->provider->sectorsize; @@ -487,6 +483,7 @@ out: free((caddr_t)isomp, M_ISOFSMNT); mp->mnt_data = (qaddr_t)0; } + dev_rel(dev); return error; } @@ -526,6 +523,7 @@ cd9660_unmount(mp, mntflags, td) g_topology_unlock(); PICKUP_GIANT(); vrele(isomp->im_devvp); + dev_rel(isomp->im_dev); free((caddr_t)isomp, M_ISOFSMNT); mp->mnt_data = (qaddr_t)0; MNT_ILOCK(mp); Modified: stable/7/sys/fs/udf/udf_vfsops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vfsops.c Wed Mar 18 18:38:26 2009 (r189975) +++ stable/7/sys/fs/udf/udf_vfsops.c Wed Mar 18 18:42:48 2009 (r189976) @@ -301,8 +301,10 @@ udf_checktag(struct desc_tag *tag, uint1 } static int -udf_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) { +udf_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) +{ struct buf *bp = NULL; + struct cdev *dev; struct anchor_vdp avdp; struct udf_mnt *udfmp = NULL; struct part_desc *pd; @@ -319,6 +321,8 @@ udf_mountfs(struct vnode *devvp, struct struct g_consumer *cp; struct bufobj *bo; + dev = devvp->v_rdev; + dev_ref(dev); DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "udf", 0); @@ -326,7 +330,7 @@ udf_mountfs(struct vnode *devvp, struct PICKUP_GIANT(); VOP_UNLOCK(devvp, 0, td); if (error) - return error; + goto bail; bo = &devvp->v_bufobj; @@ -347,7 +351,7 @@ udf_mountfs(struct vnode *devvp, struct mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED; MNT_IUNLOCK(mp); udfmp->im_mountp = mp; - udfmp->im_dev = devvp->v_rdev; + udfmp->im_dev = dev; udfmp->im_devvp = devvp; udfmp->im_d2l = NULL; udfmp->im_cp = cp; @@ -364,12 +368,8 @@ udf_mountfs(struct vnode *devvp, struct if (((logical_secsize % cp->provider->sectorsize) != 0) || (logical_secsize < cp->provider->sectorsize)) { - DROP_GIANT(); - g_topology_lock(); - g_vfs_close(cp, td); - g_topology_unlock(); - PICKUP_GIANT(); - return (EINVAL); + error = EINVAL; + goto bail; } bsize = cp->provider->sectorsize; @@ -492,11 +492,14 @@ bail: FREE(udfmp, M_UDFMOUNT); if (bp != NULL) brelse(bp); - DROP_GIANT(); - g_topology_lock(); - g_vfs_close(cp, td); - g_topology_unlock(); - PICKUP_GIANT(); + if (cp != NULL) { + DROP_GIANT(); + g_topology_lock(); + g_vfs_close(cp, td); + g_topology_unlock(); + PICKUP_GIANT(); + } + dev_rel(dev); return error; }; @@ -529,6 +532,7 @@ udf_unmount(struct mount *mp, int mntfla g_topology_unlock(); PICKUP_GIANT(); vrele(udfmp->im_devvp); + dev_rel(udfmp->im_dev); if (udfmp->s_table != NULL) FREE(udfmp->s_table, M_UDFMOUNT); From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 18:46:50 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 E3ED2106567E; Wed, 18 Mar 2009 18:46:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D143D8FC1A; Wed, 18 Mar 2009 18:46:50 +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 n2IIkou9034615; Wed, 18 Mar 2009 18:46:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IIkoc6034614; Wed, 18 Mar 2009 18:46:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903181846.n2IIkoc6034614@svn.freebsd.org> From: John Baldwin Date: Wed, 18 Mar 2009 18:46: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: r189979 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 18:46:52 -0000 Author: jhb Date: Wed Mar 18 18:46:50 2009 New Revision: 189979 URL: http://svn.freebsd.org/changeset/base/189979 Log: MFC: Add VN_LOCK_ASHARE() and VN_LOCK_AREC() macros to make it easier to share code with HEAD. Modified: stable/7/sys/sys/vnode.h Modified: stable/7/sys/sys/vnode.h ============================================================================== --- stable/7/sys/sys/vnode.h Wed Mar 18 18:43:31 2009 (r189978) +++ stable/7/sys/sys/vnode.h Wed Mar 18 18:46:50 2009 (r189979) @@ -397,6 +397,9 @@ extern void (*lease_updatetime)(int delt #define VI_UNLOCK(vp) mtx_unlock(&(vp)->v_interlock) #define VI_MTX(vp) (&(vp)->v_interlock) +#define VN_LOCK_AREC(vp) ((vp)->v_vnlock->lk_flags |= LK_CANRECURSE) +#define VN_LOCK_ASHARE(vp) ((vp)->v_vnlock->lk_flags &= ~LK_NOSHARE) + #endif /* _KERNEL */ /* From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 19:51: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 EE7471065693; Wed, 18 Mar 2009 19:51:40 +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 DBCE58FC1A; Wed, 18 Mar 2009 19:51:40 +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 n2IJpeLm036023; Wed, 18 Mar 2009 19:51:40 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IJpe8J036022; Wed, 18 Mar 2009 19:51:40 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200903181951.n2IJpe8J036022@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 18 Mar 2009 19:51: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: r189982 - stable/7/release/picobsd/bridge 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, 18 Mar 2009 19:51:42 -0000 Author: luigi Date: Wed Mar 18 19:51:40 2009 New Revision: 189982 URL: http://svn.freebsd.org/changeset/base/189982 Log: replace vnconfig with mdconfig and related tools (mdmfs, newfs) and libraries. Also add the kld* tools so we can load modules. Modified: stable/7/release/picobsd/bridge/crunch.conf Modified: stable/7/release/picobsd/bridge/crunch.conf ============================================================================== --- stable/7/release/picobsd/bridge/crunch.conf Wed Mar 18 19:38:39 2009 (r189981) +++ stable/7/release/picobsd/bridge/crunch.conf Wed Mar 18 19:51:40 2009 (r189982) @@ -135,8 +135,9 @@ progs arp # 0KB. progs bsdlabel # 4KB. progs fdisk # 4KB. -progs vnconfig # 0KB. +progs mdconfig # 0KB. +progs kldload kldunload kldstat kldxref #progs grep # 16KB. progs date # 4KB. #progs mount_nfs # 0KB. @@ -145,9 +146,11 @@ progs ping # 4KB. #progs routed # 32KB. progs ipfw # 12KB. progs traceroute # 0KB. +progs mdmfs +ln mdmfs mount_mfs # progs mount_cd9660 # 4KB. # ln mount_cd9660 cd9660 -# progs newfs # 12KB. +progs newfs #ln newfs mount_mfs ln chown chgrp # ln mount_msdosfs msdos @@ -180,3 +183,4 @@ libs -ledit -lutil -lmd -lcrypt -lmp -lm libs -lz -lpcap -lwrap libs -ltermcap -lgnuregex # -lcurses libs -lgeom +libs -lsbuf -lbsdxml From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 20:18: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 907A51065677; Wed, 18 Mar 2009 20:18:23 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 639538FC18; Wed, 18 Mar 2009 20:18:23 +0000 (UTC) (envelope-from bz@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 n2IKIN9N036639; Wed, 18 Mar 2009 20:18:23 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IKINLA036637; Wed, 18 Mar 2009 20:18:23 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903182018.n2IKINLA036637@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 18 Mar 2009 20:18: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: r189984 - in stable/7/sys: . contrib/pf dev/cxgb netinet6 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: Wed, 18 Mar 2009 20:18:24 -0000 Author: bz Date: Wed Mar 18 20:18:23 2009 New Revision: 189984 URL: http://svn.freebsd.org/changeset/base/189984 Log: MFC r186791: Switch protosw* structs to C99 initializers. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet6/in6_gif.c stable/7/sys/netipsec/xform_ipip.c Modified: stable/7/sys/netinet6/in6_gif.c ============================================================================== --- stable/7/sys/netinet6/in6_gif.c Wed Mar 18 20:03:33 2009 (r189983) +++ stable/7/sys/netinet6/in6_gif.c Wed Mar 18 20:18:23 2009 (r189984) @@ -74,12 +74,15 @@ static int gif_validate6(const struct ip struct ifnet *); extern struct domain inet6domain; -struct ip6protosw in6_gif_protosw = -{ SOCK_RAW, &inet6domain, 0/* IPPROTO_IPV[46] */, PR_ATOMIC|PR_ADDR, - in6_gif_input, rip6_output, 0, rip6_ctloutput, - 0, - 0, 0, 0, 0, - &rip6_usrreqs +struct ip6protosw in6_gif_protosw = { + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = 0, /* IPPROTO_IPV[46] */ + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = in6_gif_input, + .pr_output = rip6_output, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreqs = &rip6_usrreqs }; int Modified: stable/7/sys/netipsec/xform_ipip.c ============================================================================== --- stable/7/sys/netipsec/xform_ipip.c Wed Mar 18 20:03:33 2009 (r189983) +++ stable/7/sys/netipsec/xform_ipip.c Wed Mar 18 20:18:23 2009 (r189984) @@ -652,22 +652,24 @@ static struct xformsw ipe4_xformsw = { }; extern struct domain inetdomain; -static struct protosw ipe4_protosw = -{ SOCK_RAW, &inetdomain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR|PR_LASTHDR, - ip4_input, - 0, 0, rip_ctloutput, - 0, - 0, 0, 0, 0, - &rip_usrreqs +static struct protosw ipe4_protosw = { + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_IPV4, + .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, + .pr_input = ip4_input, + .pr_ctloutput = rip_ctloutput, + .pr_usrreqs = &rip_usrreqs }; #ifdef INET6 -static struct ip6protosw ipe6_protosw = -{ SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR, - ip4_input6, - 0, 0, rip_ctloutput, - 0, - 0, 0, 0, 0, - &rip_usrreqs +static struct ip6protosw ipe6_protosw = { + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_IPV6, + .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, + .pr_input = ip4_input6, + .pr_ctloutput = rip_ctloutput, + .pr_usrreqs = &rip_usrreqs }; #endif From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 20:22: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 66F001065673; Wed, 18 Mar 2009 20:22:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A32E8FC0C; Wed, 18 Mar 2009 20:22:22 +0000 (UTC) (envelope-from bz@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 n2IKMMl5036767; Wed, 18 Mar 2009 20:22:22 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IKMMRI036766; Wed, 18 Mar 2009 20:22:22 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903182022.n2IKMMRI036766@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 18 Mar 2009 20:22: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: r189985 - stable/7 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 20:22:24 -0000 Author: bz Date: Wed Mar 18 20:22:21 2009 New Revision: 189985 URL: http://svn.freebsd.org/changeset/base/189985 Log: MFC r179232 by jb: Add a knob to allow just the kernels to be built during a 'make universe'. MFC r185250 by des: Change the universe target to warn the user for every world or kernel that fails. The error message includes a reference to the relevant log file. Modified: stable/7/Makefile (contents, props changed) Modified: stable/7/Makefile ============================================================================== --- stable/7/Makefile Wed Mar 18 20:18:23 2009 (r189984) +++ stable/7/Makefile Wed Mar 18 20:22:21 2009 (r189985) @@ -285,22 +285,30 @@ KERNCONFS:= ${KERNCONFS:S/^NOTES$/LINT/} universe: universe_${target} .ORDER: universe_prologue universe_${target} universe_epilogue universe_${target}: +.if !defined(MAKE_JUST_KERNELS) @echo ">> ${target} started on `LC_ALL=C date`" - -cd ${.CURDIR} && ${MAKE} ${JFLAG} buildworld \ + @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ + ${MAKE} ${JFLAG} buildworld \ TARGET=${target} \ - __MAKE_CONF=/dev/null \ - > _.${target}.buildworld 2>&1 + > _.${target}.buildworld 2>&1 || \ + echo "${target} world failed," \ + "check _.${target}.buildworld for details") @echo ">> ${target} buildworld completed on `LC_ALL=C date`" +.endif .if exists(${.CURDIR}/sys/${target}/conf/NOTES) - -cd ${.CURDIR}/sys/${target}/conf && ${MAKE} LINT \ - > ${.CURDIR}/_.${target}.makeLINT 2>&1 + @(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \ + ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ + echo "${target} 'make LINT' failed," \ + "check _.${target}.makeLINT for details") .endif .for kernel in ${KERNCONFS} - -cd ${.CURDIR} && ${MAKE} ${JFLAG} buildkernel \ + @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ + ${MAKE} ${JFLAG} buildkernel \ TARGET=${target} \ KERNCONF=${kernel} \ - __MAKE_CONF=/dev/null \ - > _.${target}.${kernel} 2>&1 + > _.${target}.${kernel} 2>&1 || \ + echo "${target} ${kernel} kernel failed," \ + "check _.${target}.${kernel} for details") .endfor @echo ">> ${target} completed on `LC_ALL=C date`" .endfor From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 21:43:16 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 BC9FB106566B; Wed, 18 Mar 2009 21:43:16 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9A058FC13; Wed, 18 Mar 2009 21:43:16 +0000 (UTC) (envelope-from emax@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 n2ILhGGn038405; Wed, 18 Mar 2009 21:43:16 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ILhGwW038397; Wed, 18 Mar 2009 21:43:16 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200903182143.n2ILhGwW038397@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 18 Mar 2009 21:43: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: r189989 - stable/7/lib/libbluetooth 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, 18 Mar 2009 21:43:17 -0000 Author: emax Date: Wed Mar 18 21:43:16 2009 New Revision: 189989 URL: http://svn.freebsd.org/changeset/base/189989 Log: MFC r189462 MFC is ahead of schedule due to request. Add Bluetooth compatibility shims. Inspired by Linux BlueZ and NetBSD. Discussed with: Iain Hibbert plunky -at- rya-online -dot- net of NetBSD Requested by: Bruce Simpson bms -at- incunabulum -dot- net Tested by: Bruce Simpson bms -at- incunabulum -dot- net Added: stable/7/lib/libbluetooth/dev.c - copied unchanged from r189462, head/lib/libbluetooth/dev.c stable/7/lib/libbluetooth/hci.c - copied unchanged from r189462, head/lib/libbluetooth/hci.c Modified: stable/7/lib/libbluetooth/ (props changed) stable/7/lib/libbluetooth/Makefile stable/7/lib/libbluetooth/bluetooth.3 stable/7/lib/libbluetooth/bluetooth.c stable/7/lib/libbluetooth/bluetooth.h Modified: stable/7/lib/libbluetooth/Makefile ============================================================================== --- stable/7/lib/libbluetooth/Makefile Wed Mar 18 21:33:53 2009 (r189988) +++ stable/7/lib/libbluetooth/Makefile Wed Mar 18 21:43:16 2009 (r189989) @@ -9,7 +9,7 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../.. SHLIB_MAJOR= 3 -SRCS= bluetooth.c +SRCS= bluetooth.c dev.c hci.c INCS= bluetooth.h MLINKS+= bluetooth.3 bt_gethostbyname.3 @@ -27,6 +27,12 @@ MLINKS+= bluetooth.3 bt_endprotoent.3 MLINKS+= bluetooth.3 bt_ntoa.3 MLINKS+= bluetooth.3 bt_aton.3 +MLINKS+= bluetooth.3 bt_devaddr.3 +MLINKS+= bluetooth.3 bt_devname.3 + +MLINKS+= bluetooth.3 bt_devinfo.3 +MLINKS+= bluetooth.3 bt_devenum.3 + MLINKS+= bluetooth.3 bdaddr_same.3 MLINKS+= bluetooth.3 bdaddr_any.3 MLINKS+= bluetooth.3 bdaddr_copy.3 Modified: stable/7/lib/libbluetooth/bluetooth.3 ============================================================================== --- stable/7/lib/libbluetooth/bluetooth.3 Wed Mar 18 21:33:53 2009 (r189988) +++ stable/7/lib/libbluetooth/bluetooth.3 Wed Mar 18 21:43:16 2009 (r189989) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2003 Maksim Yevmenkin +.\" Copyright (c) 2003-2009 Maksim Yevmenkin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ .\" $Id: bluetooth.3,v 1.5 2003/05/20 23:04:30 max Exp $ .\" $FreeBSD$ .\" -.Dd August 13, 2008 +.Dd February 13, 2009 .Dt BLUETOOTH 3 .Os .Sh NAME @@ -74,6 +74,16 @@ .Ft const char * .Fn bt_ntoa "const bdaddr_t *ba" "char *str" .Ft int +.Fn bt_devaddr "const char *devname" "bdaddr_t *addr" +.Ft int +.Fn bt_devname "char *devname" "const bdaddr_t *addr" +.Ft int +.Fn (bt_devenum_cb_t) "int s" "struct bt_devinfo const *di" "void *arg" +.Ft int +.Fn bt_devinfo "struct bt_devinfo *di" +.Ft int +.Fn bt_devenum "bt_devenum_cb_t *cb" "void *arg" +.Ft int .Fn bdaddr_same "const bdaddr_t *a" "const bdaddr_t *b" .Ft int .Fn bdaddr_any "const bdaddr_t *a" @@ -197,6 +207,110 @@ It is up to the caller to ensure that pr If no buffer was provided then internal static buffer will be used. .Pp The +.Fn bt_devaddr +function interprets the specified +.Fa devname +string as the address or device name of a Bluetooth device on the local system, +and places the device address in the provided +.Fa bdaddr , +if any. +The function returns 1 if the string was successfully interpreted, +or 0 if the string did not match any local device. +The +.Fn bt_devname +function takes a Bluetooth device address and copies the local device +name associated with that address into the buffer provided, +if any. +Caller must ensure that provided buffer is at least +.Dv HCI_DEVNAME_SIZE +characters in size. +The function returns 1 when the device was found, +otherwise 0. +.Pp +The +.Fn bt_devinfo +function populates prodivded +.Vt bt_devinfo +structure with the information about given Bluetooth device. +The caller is expected to pass Bluetooth device name in the +.Fa devname +field of the passed +.Vt bt_devinfo +structure. +The function returns 0 when successful, +otherwise -1. +The +.Vt bt_devinfo +structure is defined as follows +.Bd -literal -offset indent +struct bt_devinfo +{ + char devname[HCI_DEVNAME_SIZE]; + + uint32_t state; + + bdaddr_t bdaddr; + uint16_t _reserved0; + + uint8_t features[HCI_DEVFEATURES_SIZE]; + + /* buffer info */ + uint16_t _reserved1; + uint16_t cmd_free; + uint16_t sco_size; + uint16_t sco_pkts; + uint16_t sco_free; + uint16_t acl_size; + uint16_t acl_pkts; + uint16_t acl_free; + + /* stats */ + uint32_t cmd_sent; + uint32_t evnt_recv; + uint32_t acl_recv; + uint32_t acl_sent; + uint32_t sco_recv; + uint32_t sco_sent; + uint32_t bytes_recv; + uint32_t bytes_sent; + + /* misc/specific */ + uint16_t link_policy_info; + uint16_t packet_type_info; + uint16_t role_switch_info; + uint16_t debug; + + uint8_t _padding[20]; +}; +.Ed +.Pp +The +.Fn bt_devenum +function enumerates Bluetooth devices present in the system. +For every device found, +the function will call provided +.Fa cb +callback function which should be of +.Vt bt_devenum_cb_t +type. +The callback function is passed a +.Dv HCI +socket +.Fa s , +fully populated +.Vt bt_devinfo +structure +.Fa di +and +.Fa arg +argument provided to the +.Fn bt_devenum . +The callback function can stop enumeration by returning a value +that is greater than zero. +The function returns number of successfully enumerated devices, +or -1 if an error occurred. +.Pp +The .Fn bdaddr_same , .Fn bdaddr_any and @@ -287,7 +401,8 @@ on EOF or error. .Xr getprotobynumber 3 , .Xr herror 3 , .Xr inet_aton 3 , -.Xr inet_ntoa 3 +.Xr inet_ntoa 3 , +.Xr ng_hci 4 .Sh CAVEAT The .Fn bt_gethostent @@ -312,6 +427,20 @@ The function opens and/or rewinds the .Pa /etc/bluetooth/protocols file. +.Pp +The +.Fn bt_devenum +function enumerates up to +.Dv HCI_DEVMAX +Bluetooth devices. +During enumeration the +.Fn bt_devenum +function uses the same +.Dv HCI +socket. +The function guarantees that the socket, +passed to the callback function, +will be bound and connected to the Bluetooth device being enumerated. .Sh AUTHORS .An Maksim Yevmenkin Aq m_evmenkin@yahoo.com .Sh BUGS Modified: stable/7/lib/libbluetooth/bluetooth.c ============================================================================== --- stable/7/lib/libbluetooth/bluetooth.c Wed Mar 18 21:33:53 2009 (r189988) +++ stable/7/lib/libbluetooth/bluetooth.c Wed Mar 18 21:43:16 2009 (r189989) @@ -1,7 +1,9 @@ /* * bluetooth.c - * - * Copyright (c) 2001-2003 Maksim Yevmenkin + */ + +/*- + * Copyright (c) 2001-2009 Maksim Yevmenkin * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/7/lib/libbluetooth/bluetooth.h ============================================================================== --- stable/7/lib/libbluetooth/bluetooth.h Wed Mar 18 21:33:53 2009 (r189988) +++ stable/7/lib/libbluetooth/bluetooth.h Wed Mar 18 21:43:16 2009 (r189989) @@ -1,7 +1,9 @@ /* * bluetooth.h - * - * Copyright (c) 2001-2003 Maksim Yevmenkin + */ + +/*- + * Copyright (c) 2001-2009 Maksim Yevmenkin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,9 +37,12 @@ #include #include #include +#include #include #include +#include #include +#include #include #include #include @@ -72,6 +77,63 @@ void bt_endprotoent (v char const * bt_ntoa (bdaddr_t const *ba, char *str); int bt_aton (char const *str, bdaddr_t *ba); +/* bt_devXXXX() functions (inspired by NetBSD) */ +int bt_devaddr (char const *devname, bdaddr_t *addr); +int bt_devname (char *devname, bdaddr_t const *addr); + +/* + * Bluetooth HCI functions + */ + +#define HCI_DEVMAX 32 /* arbitrary */ +#define HCI_DEVNAME_SIZE NG_NODESIZ +#define HCI_DEVFEATURES_SIZE NG_HCI_FEATURES_SIZE + +struct bt_devinfo +{ + char devname[HCI_DEVNAME_SIZE]; + + uint32_t state; /* device/implementation specific */ + + bdaddr_t bdaddr; + uint16_t _reserved0; + + uint8_t features[HCI_DEVFEATURES_SIZE]; + + /* buffer info */ + uint16_t _reserved1; + uint16_t cmd_free; + uint16_t sco_size; + uint16_t sco_pkts; + uint16_t sco_free; + uint16_t acl_size; + uint16_t acl_pkts; + uint16_t acl_free; + + /* stats */ + uint32_t cmd_sent; + uint32_t evnt_recv; + uint32_t acl_recv; + uint32_t acl_sent; + uint32_t sco_recv; + uint32_t sco_sent; + uint32_t bytes_recv; + uint32_t bytes_sent; + + /* misc/specific */ + uint16_t link_policy_info; + uint16_t packet_type_info; + uint16_t role_switch_info; + uint16_t debug; + + uint8_t _padding[20]; /* leave space for future additions */ +}; + +typedef int (bt_devenum_cb_t)(int, struct bt_devinfo const *, void *); + +int bt_devinfo (struct bt_devinfo *di); +int bt_devenum (bt_devenum_cb_t *cb, void *arg); + /* * bdaddr utility functions (from NetBSD) */ Copied: stable/7/lib/libbluetooth/dev.c (from r189462, head/lib/libbluetooth/dev.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/libbluetooth/dev.c Wed Mar 18 21:43:16 2009 (r189989, copy of r189462, head/lib/libbluetooth/dev.c) @@ -0,0 +1,95 @@ +/* + * dev.c + */ + +/*- + * Copyright (c) 2009 Maksim Yevmenkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +struct bt_devaddr_match_arg +{ + char devname[HCI_DEVNAME_SIZE]; + bdaddr_t const *bdaddr; +}; + +static bt_devenum_cb_t bt_devaddr_match; + +int +bt_devaddr(char const *devname, bdaddr_t *addr) +{ + struct bt_devinfo di; + + strlcpy(di.devname, devname, sizeof(di.devname)); + + if (bt_devinfo(&di) < 0) + return (0); + + if (addr != NULL) + bdaddr_copy(addr, &di.bdaddr); + + return (1); +} + +int +bt_devname(char *devname, bdaddr_t const *addr) +{ + struct bt_devaddr_match_arg arg; + + memset(&arg, 0, sizeof(arg)); + arg.bdaddr = addr; + + if (bt_devenum(&bt_devaddr_match, &arg) < 0) + return (0); + + if (arg.devname[0] == '\0') { + errno = ENXIO; + return (0); + } + + if (devname != NULL) + strlcpy(devname, arg.devname, HCI_DEVNAME_SIZE); + + return (1); +} + +static int +bt_devaddr_match(int s, struct bt_devinfo const *di, void *arg) +{ + struct bt_devaddr_match_arg *m = (struct bt_devaddr_match_arg *)arg; + + if (!bdaddr_same(&di->bdaddr, m->bdaddr)) + return (0); + + strlcpy(m->devname, di->devname, sizeof(m->devname)); + + return (1); +} + Copied: stable/7/lib/libbluetooth/hci.c (from r189462, head/lib/libbluetooth/hci.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/libbluetooth/hci.c Wed Mar 18 21:43:16 2009 (r189989, copy of r189462, head/lib/libbluetooth/hci.c) @@ -0,0 +1,246 @@ +/* + * hci.c + */ + +/*- + * Copyright (c) 2009 Maksim Yevmenkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +static char * bt_dev2node (char const *devname, char *nodename, int nnlen); + +int +bt_devinfo(struct bt_devinfo *di) +{ + union { + struct ng_btsocket_hci_raw_node_state r0; + struct ng_btsocket_hci_raw_node_bdaddr r1; + struct ng_btsocket_hci_raw_node_features r2; + struct ng_btsocket_hci_raw_node_buffer r3; + struct ng_btsocket_hci_raw_node_stat r4; + struct ng_btsocket_hci_raw_node_link_policy_mask r5; + struct ng_btsocket_hci_raw_node_packet_mask r6; + struct ng_btsocket_hci_raw_node_role_switch r7; + struct ng_btsocket_hci_raw_node_debug r8; + } rp; + struct sockaddr_hci ha; + int s, rval; + + if (di == NULL) { + errno = EINVAL; + return (-1); + } + + memset(&ha, 0, sizeof(ha)); + ha.hci_len = sizeof(ha); + ha.hci_family = AF_BLUETOOTH; + + if (bt_aton(di->devname, &rp.r1.bdaddr)) { + if (!bt_devname(ha.hci_node, &rp.r1.bdaddr)) + return (-1); + } else if (bt_dev2node(di->devname, ha.hci_node, + sizeof(ha.hci_node)) == NULL) { + errno = ENXIO; + return (-1); + } + + s = socket(PF_BLUETOOTH, SOCK_RAW, BLUETOOTH_PROTO_HCI); + if (s < 0) + return (-1); + + rval = -1; + + if (bind(s, (struct sockaddr *) &ha, sizeof(ha)) < 0 || + connect(s, (struct sockaddr *) &ha, sizeof(ha)) < 0) + goto bad; + strlcpy(di->devname, ha.hci_node, sizeof(di->devname)); + + if (ioctl(s, SIOC_HCI_RAW_NODE_GET_STATE, &rp.r0, sizeof(rp.r0)) < 0) + goto bad; + di->state = rp.r0.state; + + if (ioctl(s, SIOC_HCI_RAW_NODE_GET_BDADDR, &rp.r1, sizeof(rp.r1)) < 0) + goto bad; + bdaddr_copy(&di->bdaddr, &rp.r1.bdaddr); + + if (ioctl(s, SIOC_HCI_RAW_NODE_GET_FEATURES, &rp.r2, sizeof(rp.r2)) < 0) + goto bad; + memcpy(di->features, rp.r2.features, sizeof(di->features)); + + if (ioctl(s, SIOC_HCI_RAW_NODE_GET_BUFFER, &rp.r3, sizeof(rp.r3)) < 0) + goto bad; + di->cmd_free = rp.r3.buffer.cmd_free; + di->sco_size = rp.r3.buffer.sco_size; + di->sco_pkts = rp.r3.buffer.sco_pkts; + di->sco_free = rp.r3.buffer.sco_free; + di->acl_size = rp.r3.buffer.acl_size; + di->acl_pkts = rp.r3.buffer.acl_pkts; + di->acl_free = rp.r3.buffer.acl_free; + + if (ioctl(s, SIOC_HCI_RAW_NODE_GET_STAT, &rp.r4, sizeof(rp.r4)) < 0) + goto bad; + di->cmd_sent = rp.r4.stat.cmd_sent; + di->evnt_recv = rp.r4.stat.evnt_recv; + di->acl_recv = rp.r4.stat.acl_recv; + di->acl_sent = rp.r4.stat.acl_sent; + di->sco_recv = rp.r4.stat.sco_recv; + di->sco_sent = rp.r4.stat.sco_sent; + di->bytes_recv = rp.r4.stat.bytes_recv; + di->bytes_sent = rp.r4.stat.bytes_sent; + + if (ioctl(s, SIOC_HCI_RAW_NODE_GET_LINK_POLICY_MASK, + &rp.r5, sizeof(rp.r5)) < 0) + goto bad; + di->link_policy_info = rp.r5.policy_mask; + + if (ioctl(s, SIOC_HCI_RAW_NODE_GET_PACKET_MASK, + &rp.r6, sizeof(rp.r6)) < 0) + goto bad; + di->packet_type_info = rp.r6.packet_mask; + + if (ioctl(s, SIOC_HCI_RAW_NODE_GET_ROLE_SWITCH, + &rp.r7, sizeof(rp.r7)) < 0) + goto bad; + di->role_switch_info = rp.r7.role_switch; + + if (ioctl(s, SIOC_HCI_RAW_NODE_GET_DEBUG, &rp.r8, sizeof(rp.r8)) < 0) + goto bad; + di->debug = rp.r8.debug; + + rval = 0; +bad: + close(s); + + return (rval); +} + +int +bt_devenum(bt_devenum_cb_t cb, void *arg) +{ + struct ng_btsocket_hci_raw_node_list_names rp; + struct bt_devinfo di; + struct sockaddr_hci ha; + int s, i, count; + + rp.num_names = HCI_DEVMAX; + rp.names = (struct nodeinfo *) calloc(rp.num_names, + sizeof(struct nodeinfo)); + if (rp.names == NULL) { + errno = ENOMEM; + return (-1); + } + + memset(&ha, 0, sizeof(ha)); + ha.hci_len = sizeof(ha); + ha.hci_family = AF_BLUETOOTH; + ha.hci_node[0] = 'x'; + + s = socket(PF_BLUETOOTH, SOCK_RAW, BLUETOOTH_PROTO_HCI); + if (s < 0) { + free(rp.names); + + return (-1); + } + + if (bind(s, (struct sockaddr *) &ha, sizeof(ha)) < 0 || + connect(s, (struct sockaddr *) &ha, sizeof(ha)) < 0 || + ioctl(s, SIOC_HCI_RAW_NODE_LIST_NAMES, &rp, sizeof(rp)) < 0) { + close(s); + free(rp.names); + + return (-1); + } + + for (count = 0, i = 0; i < rp.num_names; i ++) { + strlcpy(di.devname, rp.names[i].name, sizeof(di.devname)); + if (bt_devinfo(&di) < 0) + continue; + + count ++; + + if (cb == NULL) + continue; + + strlcpy(ha.hci_node, rp.names[i].name, sizeof(ha.hci_node)); + if (bind(s, (struct sockaddr *) &ha, sizeof(ha)) < 0 || + connect(s, (struct sockaddr *) &ha, sizeof(ha)) < 0) + continue; + + if ((*cb)(s, &di, arg) > 0) + break; + } + + close (s); + free(rp.names); + + return (count); +} + +static char * +bt_dev2node(char const *devname, char *nodename, int nnlen) +{ + static char const * bt_dev_prefix[] = { + "btccc", /* 3Com Bluetooth PC-CARD */ + "h4", /* UART/serial Bluetooth devices */ + "ubt", /* Bluetooth USB devices */ + NULL /* should be last */ + }; + + static char _nodename[HCI_DEVNAME_SIZE]; + char const **p; + char *ep; + int plen, unit; + + if (nodename == NULL) { + nodename = _nodename; + nnlen = HCI_DEVNAME_SIZE; + } + + for (p = bt_dev_prefix; *p != NULL; p ++) { + plen = strlen(*p); + if (strncmp(devname, *p, plen) != 0) + continue; + + unit = strtoul(devname + plen, &ep, 10); + if (*ep != '\0' && + strcmp(ep, "hci") != 0 && + strcmp(ep, "l2cap") != 0) + return (NULL); /* can't make sense of device name */ + + snprintf(nodename, nnlen, "%s%uhci", *p, unit); + + return (nodename); + } + + return (NULL); +} + From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 21:46:55 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC38F1065670; Wed, 18 Mar 2009 21:46:55 +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 D8AD48FC1A; Wed, 18 Mar 2009 21:46:55 +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 n2ILkt9d038569; Wed, 18 Mar 2009 21:46:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ILktXB038567; Wed, 18 Mar 2009 21:46:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903182146.n2ILktXB038567@svn.freebsd.org> From: Warner Losh Date: Wed, 18 Mar 2009 21:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189990 - in stable/7/sys: . conf contrib/pf dev/ath/ath_hal dev/cxgb dev/sis modules/sis pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 21:46:57 -0000 Author: imp Date: Wed Mar 18 21:46:55 2009 New Revision: 189990 URL: http://svn.freebsd.org/changeset/base/189990 Log: MFC 181524: Move sis to sys/dev/sis for consistency. Added: stable/7/sys/dev/sis/ - copied from r181524, head/sys/dev/sis/ Deleted: stable/7/sys/pci/if_sis.c stable/7/sys/pci/if_sisreg.h Modified: stable/7/sys/ (props changed) stable/7/sys/conf/files stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/modules/sis/Makefile Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Wed Mar 18 21:43:16 2009 (r189989) +++ stable/7/sys/conf/files Wed Mar 18 21:46:55 2009 (r189990) @@ -1107,6 +1107,7 @@ dev/si/si3_t225.c optional si dev/si/si_eisa.c optional si eisa dev/si/si_isa.c optional si isa dev/si/si_pci.c optional si pci +dev/sis/if_sis.c optional sis pci dev/sk/if_sk.c optional sk pci dev/smbus/smb.c optional smb dev/smbus/smbconf.c optional smbus @@ -2112,7 +2113,6 @@ pci/amdsmb.c optional amdsmb pci pci/if_mn.c optional mn pci pci/if_pcn.c optional pcn pci pci/if_rl.c optional rl pci -pci/if_sis.c optional sis pci pci/if_ste.c optional ste pci pci/if_tl.c optional tl pci pci/if_wb.c optional wb pci Modified: stable/7/sys/modules/sis/Makefile ============================================================================== --- stable/7/sys/modules/sis/Makefile Wed Mar 18 21:43:16 2009 (r189989) +++ stable/7/sys/modules/sis/Makefile Wed Mar 18 21:46:55 2009 (r189990) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../pci +.PATH: ${.CURDIR}/../../dev/sis KMOD= if_sis SRCS= if_sis.c device_if.h bus_if.h pci_if.h From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 21:51:03 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D6F3106567C; Wed, 18 Mar 2009 21:51:03 +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 5811E8FC13; Wed, 18 Mar 2009 21:51:03 +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 n2ILp3nx038719; Wed, 18 Mar 2009 21:51:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ILp2IH038712; Wed, 18 Mar 2009 21:51:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903182151.n2ILp2IH038712@svn.freebsd.org> From: John Baldwin Date: Wed, 18 Mar 2009 21:51: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: r189991 - in stable/7/sys: . compat/linux compat/svr4 contrib/pf dev/ath/ath_hal dev/cxgb fs/coda i386/ibcs2 kern nfsserver 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, 18 Mar 2009 21:51:05 -0000 Author: jhb Date: Wed Mar 18 21:51:02 2009 New Revision: 189991 URL: http://svn.freebsd.org/changeset/base/189991 Log: MFC: Use shared vnode locks when invoking VOP_READDIR(). Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linux/linux_file.c stable/7/sys/compat/linux/linux_getcwd.c stable/7/sys/compat/svr4/svr4_misc.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/coda/coda_vnops.c stable/7/sys/i386/ibcs2/ibcs2_misc.c stable/7/sys/kern/vfs_syscalls.c stable/7/sys/nfsserver/nfs_serv.c Modified: stable/7/sys/compat/linux/linux_file.c ============================================================================== --- stable/7/sys/compat/linux/linux_file.c Wed Mar 18 21:46:55 2009 (r189990) +++ stable/7/sys/compat/linux/linux_file.c Wed Mar 18 21:51:02 2009 (r189991) @@ -465,7 +465,7 @@ getdents_common(struct thread *td, struc buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); lbuf = malloc(LINUX_MAXRECLEN, M_TEMP, M_WAITOK | M_ZERO); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); again: aiov.iov_base = buf; Modified: stable/7/sys/compat/linux/linux_getcwd.c ============================================================================== --- stable/7/sys/compat/linux/linux_getcwd.c Wed Mar 18 21:46:55 2009 (r189990) +++ stable/7/sys/compat/linux/linux_getcwd.c Wed Mar 18 21:51:02 2009 (r189991) @@ -163,7 +163,7 @@ linux_getcwd_scandir(lvpp, uvpp, bpp, bu cn.cn_nameptr = ".."; cn.cn_namelen = 2; cn.cn_consume = 0; - cn.cn_lkflags = LK_EXCLUSIVE; + cn.cn_lkflags = LK_SHARED; /* * At this point, lvp is locked and will be unlocked by the lookup. Modified: stable/7/sys/compat/svr4/svr4_misc.c ============================================================================== --- stable/7/sys/compat/svr4/svr4_misc.c Wed Mar 18 21:46:55 2009 (r189990) +++ stable/7/sys/compat/svr4/svr4_misc.c Wed Mar 18 21:51:02 2009 (r189991) @@ -278,7 +278,7 @@ svr4_sys_getdents64(td, uap) buflen = max(DIRBLKSIZ, nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); again: aiov.iov_base = buf; aiov.iov_len = buflen; @@ -447,7 +447,7 @@ svr4_sys_getdents(td, uap) buflen = min(MAXBSIZE, uap->nbytes); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); off = fp->f_offset; again: aiov.iov_base = buf; Modified: stable/7/sys/fs/coda/coda_vnops.c ============================================================================== --- stable/7/sys/fs/coda/coda_vnops.c Wed Mar 18 21:46:55 2009 (r189990) +++ stable/7/sys/fs/coda/coda_vnops.c Wed Mar 18 21:51:02 2009 (r189991) @@ -1510,7 +1510,7 @@ coda_readdir(struct vop_readdir_args *ap */ CODADEBUG(CODA_READDIR, myprintf(("indirect readdir: fid = %s, " "refcnt = %d\n", coda_f2s(&cp->c_fid), vp->v_usecount));); - vn_lock(cp->c_ovp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(cp->c_ovp, LK_SHARED | LK_RETRY, td); error = VOP_READDIR(cp->c_ovp, uiop, cred, eofflag, ncookies, cookies); VOP_UNLOCK(cp->c_ovp, 0, td); Modified: stable/7/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- stable/7/sys/i386/ibcs2/ibcs2_misc.c Wed Mar 18 21:46:55 2009 (r189990) +++ stable/7/sys/i386/ibcs2/ibcs2_misc.c Wed Mar 18 21:51:02 2009 (r189991) @@ -356,7 +356,7 @@ ibcs2_getdents(td, uap) buflen = max(DIRBLKSIZ, uap->nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); again: aiov.iov_base = buf; aiov.iov_len = buflen; @@ -518,7 +518,7 @@ ibcs2_read(td, uap) buflen = max(DIRBLKSIZ, uap->nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); again: aiov.iov_base = buf; aiov.iov_len = buflen; Modified: stable/7/sys/kern/vfs_syscalls.c ============================================================================== --- stable/7/sys/kern/vfs_syscalls.c Wed Mar 18 21:46:55 2009 (r189990) +++ stable/7/sys/kern/vfs_syscalls.c Wed Mar 18 21:51:02 2009 (r189991) @@ -3665,7 +3665,7 @@ unionread: auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; auio.uio_resid = uap->count; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); loff = auio.uio_offset = fp->f_offset; #ifdef MAC error = mac_check_vnode_readdir(td->td_ucred, vp); @@ -3824,8 +3824,7 @@ unionread: auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; auio.uio_resid = count; - /* vn_lock(vp, LK_SHARED | LK_RETRY, td); */ - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); AUDIT_ARG(vnode, vp, ARG_VNODE1); loff = auio.uio_offset = fp->f_offset; #ifdef MAC Modified: stable/7/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/7/sys/nfsserver/nfs_serv.c Wed Mar 18 21:46:55 2009 (r189990) +++ stable/7/sys/nfsserver/nfs_serv.c Wed Mar 18 21:51:02 2009 (r189991) @@ -3236,7 +3236,7 @@ again: io.uio_rw = UIO_READ; io.uio_td = NULL; eofflag = 0; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; @@ -3518,7 +3518,7 @@ again: io.uio_rw = UIO_READ; io.uio_td = NULL; eofflag = 0; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 21:54:29 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14716106564A; Wed, 18 Mar 2009 21:54:29 +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 022578FC1E; Wed, 18 Mar 2009 21:54:29 +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 n2ILsSqB038863; Wed, 18 Mar 2009 21:54:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ILsSn0038862; Wed, 18 Mar 2009 21:54:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903182154.n2ILsSn0038862@svn.freebsd.org> From: John Baldwin Date: Wed, 18 Mar 2009 21:54: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: r189993 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sis 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, 18 Mar 2009 21:54:30 -0000 Author: jhb Date: Wed Mar 18 21:54:28 2009 New Revision: 189993 URL: http://svn.freebsd.org/changeset/base/189993 Log: MFC: Remove a comment and expand scope of sysctl sx lock a bit to fully restore limiting of wired memory by userspace for sysctls. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sis/if_sis.c (props changed) stable/7/sys/dev/sis/if_sisreg.h (props changed) stable/7/sys/kern/kern_sysctl.c Modified: stable/7/sys/kern/kern_sysctl.c ============================================================================== --- stable/7/sys/kern/kern_sysctl.c Wed Mar 18 21:51:11 2009 (r189992) +++ stable/7/sys/kern/kern_sysctl.c Wed Mar 18 21:54:28 2009 (r189993) @@ -1199,14 +1199,6 @@ kernel_sysctlbyname(struct thread *td, c oid[1] = 3; /* name2oid */ oidlen = sizeof(oid); - /* - * XXX: Prone to a possible race condition between lookup and - * execution? Maybe put locking around it? - * - * Userland is just as racy, so I think the current implementation - * is fine. - */ - error = kernel_sysctl(td, oid, 2, oid, &oidlen, (void *)name, strlen(name), &plen, flags); if (error) @@ -1517,10 +1509,10 @@ userland_sysctl(struct thread *td, int * uio_yield(); } - SYSCTL_XUNLOCK(); if (req.lock == REQ_WIRED && req.validlen > 0) vsunlock(req.oldptr, req.validlen); + SYSCTL_XUNLOCK(); if (error && error != ENOMEM) return (error); From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 21:57:35 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6B2D10656BC; Wed, 18 Mar 2009 21:57:35 +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 894738FC1E; Wed, 18 Mar 2009 21:57:35 +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 n2ILvZC6039018; Wed, 18 Mar 2009 21:57:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ILvZgG039017; Wed, 18 Mar 2009 21:57:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903182157.n2ILvZgG039017@svn.freebsd.org> From: John Baldwin Date: Wed, 18 Mar 2009 21:57: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: r189995 - stable/7/sys/dev/sis 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, 18 Mar 2009 21:57:39 -0000 Author: jhb Date: Wed Mar 18 21:57:35 2009 New Revision: 189995 URL: http://svn.freebsd.org/changeset/base/189995 Log: Remove the empty mergeinfo from these files. Modified: stable/7/sys/dev/sis/if_sis.c (props changed) stable/7/sys/dev/sis/if_sisreg.h (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 22:12:55 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C9371065675; Wed, 18 Mar 2009 22:12:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECD108FC1C; Wed, 18 Mar 2009 22:12:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IMCsju039366; Wed, 18 Mar 2009 22:12:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IMCsAP039363; Wed, 18 Mar 2009 22:12:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903182212.n2IMCsAP039363@svn.freebsd.org> From: Marius Strobl Date: Wed, 18 Mar 2009 22:12: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: r189996 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb net netinet netinet6 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, 18 Mar 2009 22:12:56 -0000 Author: marius Date: Wed Mar 18 22:12:54 2009 New Revision: 189996 URL: http://svn.freebsd.org/changeset/base/189996 Log: MFC: r189494 On architectures with strict alignment requirements compensate the misalignment of the IP header that prepending the EtherIP header might have caused. PR: 131921 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/net/if_gif.h stable/7/sys/netinet/in_gif.c stable/7/sys/netinet6/in6_gif.c Modified: stable/7/sys/net/if_gif.h ============================================================================== --- stable/7/sys/net/if_gif.h Wed Mar 18 21:57:35 2009 (r189995) +++ stable/7/sys/net/if_gif.h Wed Mar 18 22:12:54 2009 (r189996) @@ -100,6 +100,8 @@ struct etherip_header { #define ETHERIP_VER_VERS_MASK 0x0f #define ETHERIP_VER_RSVD_MASK 0xf0 #define ETHERIP_VERSION 0x03 +/* mbuf adjust factor to force 32-bit alignment of IP header */ +#define ETHERIP_ALIGN 2 /* Prototypes */ void gif_input(struct mbuf *, int, struct ifnet *); Modified: stable/7/sys/netinet/in_gif.c ============================================================================== --- stable/7/sys/netinet/in_gif.c Wed Mar 18 21:57:35 2009 (r189995) +++ stable/7/sys/netinet/in_gif.c Wed Mar 18 22:12:54 2009 (r189996) @@ -98,7 +98,7 @@ in_gif_output(struct ifnet *ifp, int fam struct sockaddr_in *sin_dst = (struct sockaddr_in *)sc->gif_pdst; struct ip iphdr; /* capsule IP header, host byte ordered */ struct etherip_header eiphdr; - int proto, error; + int error, len, proto; u_int8_t tos; GIF_LOCK_ASSERT(sc); @@ -182,13 +182,27 @@ in_gif_output(struct ifnet *ifp, int fam &iphdr.ip_tos, &tos); /* prepend new IP header */ - M_PREPEND(m, sizeof(struct ip), M_DONTWAIT); - if (m && m->m_len < sizeof(struct ip)) - m = m_pullup(m, sizeof(struct ip)); + len = sizeof(struct ip); +#ifndef __NO_STRICT_ALIGNMENT + if (family == AF_LINK) + len += ETHERIP_ALIGN; +#endif + M_PREPEND(m, len, M_DONTWAIT); + if (m != NULL && m->m_len < len) + m = m_pullup(m, len); if (m == NULL) { printf("ENOBUFS in in_gif_output %d\n", __LINE__); return ENOBUFS; } +#ifndef __NO_STRICT_ALIGNMENT + if (family == AF_LINK) { + len = mtod(m, vm_offset_t) & 3; + KASSERT(len == 0 || len == ETHERIP_ALIGN, + ("in_gif_output: unexpected misalignment")); + m->m_data += len; + m->m_len -= ETHERIP_ALIGN; + } +#endif bcopy(&iphdr, mtod(m, struct ip *), sizeof(struct ip)); M_SETFIB(m, sc->gif_fibnum); Modified: stable/7/sys/netinet6/in6_gif.c ============================================================================== --- stable/7/sys/netinet6/in6_gif.c Wed Mar 18 21:57:35 2009 (r189995) +++ stable/7/sys/netinet6/in6_gif.c Wed Mar 18 22:12:54 2009 (r189996) @@ -96,7 +96,7 @@ in6_gif_output(struct ifnet *ifp, struct sockaddr_in6 *sin6_dst = (struct sockaddr_in6 *)sc->gif_pdst; struct ip6_hdr *ip6; struct etherip_header eiphdr; - int proto, error; + int error, len, proto; u_int8_t itos, otos; GIF_LOCK_ASSERT(sc); @@ -164,13 +164,27 @@ in6_gif_output(struct ifnet *ifp, } /* prepend new IP header */ - M_PREPEND(m, sizeof(struct ip6_hdr), M_DONTWAIT); - if (m && m->m_len < sizeof(struct ip6_hdr)) - m = m_pullup(m, sizeof(struct ip6_hdr)); + len = sizeof(struct ip6_hdr); +#ifndef __NO_STRICT_ALIGNMENT + if (family == AF_LINK) + len += ETHERIP_ALIGN; +#endif + M_PREPEND(m, len, M_DONTWAIT); + if (m != NULL && m->m_len < len) + m = m_pullup(m, len); if (m == NULL) { printf("ENOBUFS in in6_gif_output %d\n", __LINE__); return ENOBUFS; } +#ifndef __NO_STRICT_ALIGNMENT + if (family == AF_LINK) { + len = mtod(m, vm_offset_t) & 3; + KASSERT(len == 0 || len == ETHERIP_ALIGN, + ("in6_gif_output: unexpected misalignment")); + m->m_data += len; + m->m_len -= ETHERIP_ALIGN; + } +#endif ip6 = mtod(m, struct ip6_hdr *); ip6->ip6_flow = 0; From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 22:57:55 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E0C510656D3; Wed, 18 Mar 2009 22:57:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A8268FC15; Wed, 18 Mar 2009 22:57:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IMvt3A040395; Wed, 18 Mar 2009 22:57:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2IMvt1h040392; Wed, 18 Mar 2009 22:57:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903182257.n2IMvt1h040392@svn.freebsd.org> From: Marius Strobl Date: Wed, 18 Mar 2009 22:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189998 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mpt 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, 18 Mar 2009 22:57:56 -0000 Author: marius Date: Wed Mar 18 22:57:55 2009 New Revision: 189998 URL: http://svn.freebsd.org/changeset/base/189998 Log: MFC: r172842 (partial), r178725 Restore multi-release tradition of the driver. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_raid.c Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Wed Mar 18 22:13:29 2009 (r189997) +++ stable/7/sys/dev/mpt/mpt.h Wed Mar 18 22:57:55 2009 (r189998) @@ -270,13 +270,30 @@ void mpt_map_rquest(void *, bus_dma_segm #define mpt_setup_intr bus_setup_intr #endif +/* **************************** NewBUS CAM Support ****************************/ +#if __FreeBSD_version < 700049 +#define mpt_xpt_bus_register(sim, parent, bus) \ + xpt_bus_register(sim, bus) +#else +#define mpt_xpt_bus_register xpt_bus_register +#endif + /**************************** Kernel Thread Support ***************************/ -#if __FreeBSD_version > 500005 +#if __FreeBSD_version > 800001 +#define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ + kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) +#define mpt_kthread_exit(status) \ + kproc_exit(status) +#elif __FreeBSD_version > 500005 #define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) +#define mpt_kthread_exit(status) \ + kthread_exit(status) #else #define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ kthread_create(func, farg, proc_ptr, fmtstr, arg) +#define mpt_kthread_exit(status) \ + kthread_exit(status) #endif /****************************** Timer Facilities ******************************/ Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Wed Mar 18 22:13:29 2009 (r189997) +++ stable/7/sys/dev/mpt/mpt_cam.c Wed Mar 18 22:57:55 2009 (r189998) @@ -346,7 +346,7 @@ mpt_cam_attach(struct mpt_softc *mpt) * Register exactly this bus. */ MPT_LOCK(mpt); - if (xpt_bus_register(mpt->sim, mpt->dev, 0) != CAM_SUCCESS) { + if (mpt_xpt_bus_register(mpt->sim, mpt->dev, 0) != CAM_SUCCESS) { mpt_prt(mpt, "Bus registration Failed!\n"); error = ENOMEM; MPT_UNLOCK(mpt); @@ -385,7 +385,8 @@ mpt_cam_attach(struct mpt_softc *mpt) * Register this bus. */ MPT_LOCK(mpt); - if (xpt_bus_register(mpt->phydisk_sim, mpt->dev, 1) != CAM_SUCCESS) { + if (mpt_xpt_bus_register(mpt->phydisk_sim, mpt->dev, 1) != + CAM_SUCCESS) { mpt_prt(mpt, "Physical Disk Bus registration Failed!\n"); error = ENOMEM; MPT_UNLOCK(mpt); @@ -3988,7 +3989,7 @@ mpt_recovery_thread(void *arg) mpt->recovery_thread = NULL; wakeup(&mpt->recovery_thread); MPT_UNLOCK(mpt); - kthread_exit(0); + mpt_kthread_exit(0); } static int Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Wed Mar 18 22:13:29 2009 (r189997) +++ stable/7/sys/dev/mpt/mpt_raid.c Wed Mar 18 22:57:55 2009 (r189998) @@ -722,7 +722,7 @@ mpt_raid_thread(void *arg) mpt->raid_thread = NULL; wakeup(&mpt->raid_thread); MPT_UNLOCK(mpt); - kthread_exit(0); + mpt_kthread_exit(0); } #if 0 From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 23:08: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 AB141106566B; Wed, 18 Mar 2009 23:08:28 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by mx1.freebsd.org (Postfix) with ESMTP id 7ADC08FC18; Wed, 18 Mar 2009 23:08:28 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id BE10C2F3B1B; Wed, 18 Mar 2009 19:08:27 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 18 Mar 2009 19:08:27 -0400 X-Sasl-enc: ICBLQ0KRsXj3h2N2KLIjI7reGrWorzMqi+JcvKDxSc4P 1237417707 Received: from anglepoise.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id ADB7913D8C; Wed, 18 Mar 2009 19:08:26 -0400 (EDT) Message-ID: <49C17EE3.5090305@incunabulum.net> Date: Wed, 18 Mar 2009 23:08:19 +0000 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.19 (X11/20090125) MIME-Version: 1.0 To: Maksim Yevmenkin References: <200903182143.n2ILhGwW038397@svn.freebsd.org> In-Reply-To: <200903182143.n2ILhGwW038397@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r189989 - stable/7/lib/libbluetooth 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, 18 Mar 2009 23:08:29 -0000 Maksim Yevmenkin wrote: > Author: emax > Date: Wed Mar 18 21:43:16 2009 > New Revision: 189989 > URL: http://svn.freebsd.org/changeset/base/189989 > > Log: > MFC r189462 > MFC is ahead of schedule due to request. > > Add Bluetooth compatibility shims. Inspired by Linux BlueZ and NetBSD. > Most excellent, thank you! From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 23:13: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 3FDB91065672; Wed, 18 Mar 2009 23:13:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B2E78FC08; Wed, 18 Mar 2009 23:13:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2INDa8C040753; Wed, 18 Mar 2009 23:13:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2INDZFs040748; Wed, 18 Mar 2009 23:13:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903182313.n2INDZFs040748@svn.freebsd.org> From: Marius Strobl Date: Wed, 18 Mar 2009 23:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189999 - in stable/7/sys: . contrib/pf dev/cxgb dev/mpt 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, 18 Mar 2009 23:13:37 -0000 Author: marius Date: Wed Mar 18 23:13:35 2009 New Revision: 189999 URL: http://svn.freebsd.org/changeset/base/189999 Log: MFC: r186878 Make the whole initiator mode part of mpt(4) endian-clean, specifically SPI controllers now also work in big-endian machines and some conversions relevant for FC and SAS controllers as well as support for ILP32 machines which all were omitted in previous attempts are now also implemented. The IOCTL-interface is intentionally left (and where needed actually changed) to be completely little-endian as otherwise we would have to add conversion code for every possible configuration page to mpt(4), which didn't seem the right thing to do, neither did converting only half of the user- interface to the native byte order. This change was tested on amd64 (SAS+SPI), i386 (SAS) and sparc64 (SAS+SPI). Due to lack of the necessary hardware the target mode code is still left to be made endian-clean. Reviewed by: scottl Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_raid.c stable/7/sys/dev/mpt/mpt_user.c Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Wed Mar 18 22:57:55 2009 (r189998) +++ stable/7/sys/dev/mpt/mpt.c Wed Mar 18 23:13:35 2009 (r189999) @@ -1637,7 +1637,7 @@ mpt_read_extcfg_header(struct mpt_softc rslt->PageVersion = cfgp->Header.PageVersion; rslt->PageNumber = cfgp->Header.PageNumber; rslt->PageType = cfgp->Header.PageType; - rslt->ExtPageLength = cfgp->ExtPageLength; + rslt->ExtPageLength = le16toh(cfgp->ExtPageLength); rslt->ExtPageType = cfgp->ExtPageType; error = 0; break; @@ -1668,7 +1668,7 @@ mpt_read_extcfg_page(struct mpt_softc *m req = mpt_get_request(mpt, sleep_ok); if (req == NULL) { - mpt_prt(mpt, "mpt_read_cfg_page: Get request failed!\n"); + mpt_prt(mpt, "mpt_read_extcfg_page: Get request failed!\n"); return (-1); } @@ -2025,6 +2025,7 @@ mpt_read_config_info_ioc(struct mpt_soft mpt_raid_free_mem(mpt); return (EIO); } + mpt2host_config_page_ioc3(mpt->ioc_page3); mpt_raid_wakeup(mpt); return (0); } @@ -2760,6 +2761,7 @@ mpt_enable_ioc(struct mpt_softc *mpt, in void mpt2host_sge_simple_union(SGE_SIMPLE_UNION *sge) { + MPT_2_HOST32(sge, FlagsLength); MPT_2_HOST32(sge, u.Address64.Low); MPT_2_HOST32(sge, u.Address64.High); @@ -2768,6 +2770,7 @@ mpt2host_sge_simple_union(SGE_SIMPLE_UNI void mpt2host_iocfacts_reply(MSG_IOC_FACTS_REPLY *rp) { + MPT_2_HOST16(rp, MsgVersion); MPT_2_HOST16(rp, HeaderVersion); MPT_2_HOST32(rp, MsgContext); @@ -2794,6 +2797,7 @@ mpt2host_iocfacts_reply(MSG_IOC_FACTS_RE void mpt2host_portfacts_reply(MSG_PORT_FACTS_REPLY *pfp) { + MPT_2_HOST16(pfp, Reserved); MPT_2_HOST16(pfp, Reserved1); MPT_2_HOST32(pfp, MsgContext); @@ -2809,20 +2813,139 @@ mpt2host_portfacts_reply(MSG_PORT_FACTS_ MPT_2_HOST16(pfp, Reserved4); MPT_2_HOST32(pfp, Reserved5); } + void mpt2host_config_page_ioc2(CONFIG_PAGE_IOC_2 *ioc2) { int i; - ioc2->CapabilitiesFlags = htole32(ioc2->CapabilitiesFlags); + + MPT_2_HOST32(ioc2, CapabilitiesFlags); for (i = 0; i < MPI_IOC_PAGE_2_RAID_VOLUME_MAX; i++) { MPT_2_HOST16(ioc2, RaidVolume[i].Reserved3); } } void +mpt2host_config_page_ioc3(CONFIG_PAGE_IOC_3 *ioc3) +{ + + MPT_2_HOST16(ioc3, Reserved2); +} + +void +mpt2host_config_page_scsi_port_0(CONFIG_PAGE_SCSI_PORT_0 *sp0) +{ + + MPT_2_HOST32(sp0, Capabilities); + MPT_2_HOST32(sp0, PhysicalInterface); +} + +void +mpt2host_config_page_scsi_port_1(CONFIG_PAGE_SCSI_PORT_1 *sp1) +{ + + MPT_2_HOST32(sp1, Configuration); + MPT_2_HOST32(sp1, OnBusTimerValue); + MPT_2_HOST16(sp1, IDConfig); +} + +void +host2mpt_config_page_scsi_port_1(CONFIG_PAGE_SCSI_PORT_1 *sp1) +{ + + HOST_2_MPT32(sp1, Configuration); + HOST_2_MPT32(sp1, OnBusTimerValue); + HOST_2_MPT16(sp1, IDConfig); +} + +void +mpt2host_config_page_scsi_port_2(CONFIG_PAGE_SCSI_PORT_2 *sp2) +{ + int i; + + MPT_2_HOST32(sp2, PortFlags); + MPT_2_HOST32(sp2, PortSettings); + for (i = 0; i < sizeof(sp2->DeviceSettings) / + sizeof(*sp2->DeviceSettings); i++) { + MPT_2_HOST16(sp2, DeviceSettings[i].DeviceFlags); + } +} + +void +mpt2host_config_page_scsi_device_0(CONFIG_PAGE_SCSI_DEVICE_0 *sd0) +{ + + MPT_2_HOST32(sd0, NegotiatedParameters); + MPT_2_HOST32(sd0, Information); +} + +void +mpt2host_config_page_scsi_device_1(CONFIG_PAGE_SCSI_DEVICE_1 *sd1) +{ + + MPT_2_HOST32(sd1, RequestedParameters); + MPT_2_HOST32(sd1, Reserved); + MPT_2_HOST32(sd1, Configuration); +} + +void +host2mpt_config_page_scsi_device_1(CONFIG_PAGE_SCSI_DEVICE_1 *sd1) +{ + + HOST_2_MPT32(sd1, RequestedParameters); + HOST_2_MPT32(sd1, Reserved); + HOST_2_MPT32(sd1, Configuration); +} + +void +mpt2host_config_page_fc_port_0(CONFIG_PAGE_FC_PORT_0 *fp0) +{ + + MPT_2_HOST32(fp0, Flags); + MPT_2_HOST32(fp0, PortIdentifier); + MPT_2_HOST32(fp0, WWNN.Low); + MPT_2_HOST32(fp0, WWNN.High); + MPT_2_HOST32(fp0, WWPN.Low); + MPT_2_HOST32(fp0, WWPN.High); + MPT_2_HOST32(fp0, SupportedServiceClass); + MPT_2_HOST32(fp0, SupportedSpeeds); + MPT_2_HOST32(fp0, CurrentSpeed); + MPT_2_HOST32(fp0, MaxFrameSize); + MPT_2_HOST32(fp0, FabricWWNN.Low); + MPT_2_HOST32(fp0, FabricWWNN.High); + MPT_2_HOST32(fp0, FabricWWPN.Low); + MPT_2_HOST32(fp0, FabricWWPN.High); + MPT_2_HOST32(fp0, DiscoveredPortsCount); + MPT_2_HOST32(fp0, MaxInitiators); +} + +void +mpt2host_config_page_fc_port_1(CONFIG_PAGE_FC_PORT_1 *fp1) +{ + + MPT_2_HOST32(fp1, Flags); + MPT_2_HOST32(fp1, NoSEEPROMWWNN.Low); + MPT_2_HOST32(fp1, NoSEEPROMWWNN.High); + MPT_2_HOST32(fp1, NoSEEPROMWWPN.Low); + MPT_2_HOST32(fp1, NoSEEPROMWWPN.High); +} + +void +host2mpt_config_page_fc_port_1(CONFIG_PAGE_FC_PORT_1 *fp1) +{ + + HOST_2_MPT32(fp1, Flags); + HOST_2_MPT32(fp1, NoSEEPROMWWNN.Low); + HOST_2_MPT32(fp1, NoSEEPROMWWNN.High); + HOST_2_MPT32(fp1, NoSEEPROMWWPN.Low); + HOST_2_MPT32(fp1, NoSEEPROMWWPN.High); +} + +void mpt2host_config_page_raid_vol_0(CONFIG_PAGE_RAID_VOL_0 *volp) { int i; + MPT_2_HOST16(volp, VolumeStatus.Reserved); MPT_2_HOST16(volp, VolumeSettings.Settings); MPT_2_HOST32(volp, MaxLBA); @@ -2836,8 +2959,21 @@ mpt2host_config_page_raid_vol_0(CONFIG_P } void +mpt2host_config_page_raid_phys_disk_0(CONFIG_PAGE_RAID_PHYS_DISK_0 *rpd0) +{ + + MPT_2_HOST32(rpd0, Reserved1); + MPT_2_HOST16(rpd0, PhysDiskStatus.Reserved); + MPT_2_HOST32(rpd0, MaxLBA); + MPT_2_HOST16(rpd0, ErrorData.Reserved); + MPT_2_HOST16(rpd0, ErrorData.ErrorCount); + MPT_2_HOST16(rpd0, ErrorData.SmartCount); +} + +void mpt2host_mpi_raid_vol_indicator(MPI_RAID_VOL_INDICATOR *vi) { + MPT_2_HOST16(vi, TotalBlocks.High); MPT_2_HOST16(vi, TotalBlocks.Low); MPT_2_HOST16(vi, BlocksRemaining.High); Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Wed Mar 18 22:57:55 2009 (r189998) +++ stable/7/sys/dev/mpt/mpt.h Wed Mar 18 23:13:35 2009 (r189999) @@ -317,14 +317,39 @@ void mpt2host_sge_simple_union(SGE_SIMPL void mpt2host_iocfacts_reply(MSG_IOC_FACTS_REPLY *); void mpt2host_portfacts_reply(MSG_PORT_FACTS_REPLY *); void mpt2host_config_page_ioc2(CONFIG_PAGE_IOC_2 *); +void mpt2host_config_page_ioc3(CONFIG_PAGE_IOC_3 *); +void mpt2host_config_page_scsi_port_0(CONFIG_PAGE_SCSI_PORT_0 *); +void mpt2host_config_page_scsi_port_1(CONFIG_PAGE_SCSI_PORT_1 *); +void host2mpt_config_page_scsi_port_1(CONFIG_PAGE_SCSI_PORT_1 *); +void mpt2host_config_page_scsi_port_2(CONFIG_PAGE_SCSI_PORT_2 *); +void mpt2host_config_page_scsi_device_0(CONFIG_PAGE_SCSI_DEVICE_0 *); +void mpt2host_config_page_scsi_device_1(CONFIG_PAGE_SCSI_DEVICE_1 *); +void host2mpt_config_page_scsi_device_1(CONFIG_PAGE_SCSI_DEVICE_1 *); +void mpt2host_config_page_fc_port_0(CONFIG_PAGE_FC_PORT_0 *); +void mpt2host_config_page_fc_port_1(CONFIG_PAGE_FC_PORT_1 *); +void host2mpt_config_page_fc_port_1(CONFIG_PAGE_FC_PORT_1 *); void mpt2host_config_page_raid_vol_0(CONFIG_PAGE_RAID_VOL_0 *); +void mpt2host_config_page_raid_phys_disk_0(CONFIG_PAGE_RAID_PHYS_DISK_0 *); void mpt2host_mpi_raid_vol_indicator(MPI_RAID_VOL_INDICATOR *); #else #define mpt2host_sge_simple_union(x) do { ; } while (0) #define mpt2host_iocfacts_reply(x) do { ; } while (0) #define mpt2host_portfacts_reply(x) do { ; } while (0) #define mpt2host_config_page_ioc2(x) do { ; } while (0) +#define mpt2host_config_page_ioc3(x) do { ; } while (0) +#define mpt2host_config_page_scsi_port_0(x) do { ; } while (0) +#define mpt2host_config_page_scsi_port_1(x) do { ; } while (0) +#define host2mpt_config_page_scsi_port_1(x) do { ; } while (0) +#define mpt2host_config_page_scsi_port_2(x) do { ; } while (0) +#define mpt2host_config_page_scsi_device_0(x) do { ; } while (0) +#define mpt2host_config_page_scsi_device_1(x) do { ; } while (0) +#define host2mpt_config_page_scsi_device_1(x) do { ; } while (0) +#define mpt2host_config_page_fc_port_0(x) do { ; } while (0) +#define mpt2host_config_page_fc_port_1(x) do { ; } while (0) +#define host2mpt_config_page_fc_port_1(x) do { ; } while (0) #define mpt2host_config_page_raid_vol_0(x) do { ; } while (0) +#define mpt2host_config_page_raid_phys_disk_0(x) \ + do { ; } while (0) #define mpt2host_mpi_raid_vol_indicator(x) do { ; } while (0) #endif Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Wed Mar 18 22:57:55 2009 (r189998) +++ stable/7/sys/dev/mpt/mpt_cam.c Wed Mar 18 23:13:35 2009 (r189999) @@ -437,6 +437,7 @@ mpt_read_config_info_fc(struct mpt_softc mpt_prt(mpt, "failed to read FC Port Page 0\n"); return (-1); } + mpt2host_config_page_fc_port_0(&mpt->mpt_fcport_page0); mpt->mpt_fcport_speed = mpt->mpt_fcport_page0.CurrentSpeed; @@ -527,13 +528,14 @@ mpt_set_initial_config_fc(struct mpt_sof mpt_prt(mpt, "failed to read FC page 1\n"); return (mpt_fc_reset_link(mpt, 1)); } + mpt2host_config_page_fc_port_1(&fc); /* * Check our flags to make sure we support the role we want. */ doit = 0; role = 0; - fl = le32toh(fc.Flags);; + fl = fc.Flags; if (fl & MPI_FCPORTPAGE1_FLAGS_PROT_FCP_INIT) { role |= MPT_ROLE_INITIATOR; @@ -587,7 +589,8 @@ mpt_set_initial_config_fc(struct mpt_sof } if (doit) { - fc.Flags = htole32(fl); + fc.Flags = fl; + host2mpt_config_page_fc_port_1(&fc); r = mpt_write_cfg_page(mpt, MPI_CONFIG_ACTION_PAGE_WRITE_NVRAM, 0, &fc.Header, sizeof(fc), FALSE, 5000); @@ -982,6 +985,7 @@ mpt_read_config_info_spi(struct mpt_soft if (rv) { mpt_prt(mpt, "failed to read SPI Port Page 0\n"); } else { + mpt2host_config_page_scsi_port_0(&mpt->mpt_port_page0); mpt_lprt(mpt, MPT_PRT_NEGOTIATION, "SPI Port Page 0: Capabilities %x PhysicalInterface %x\n", mpt->mpt_port_page0.Capabilities, @@ -993,6 +997,7 @@ mpt_read_config_info_spi(struct mpt_soft if (rv) { mpt_prt(mpt, "failed to read SPI Port Page 1\n"); } else { + mpt2host_config_page_scsi_port_1(&mpt->mpt_port_page1); mpt_lprt(mpt, MPT_PRT_DEBUG, "SPI Port Page 1: Configuration %x OnBusTimerValue %x\n", mpt->mpt_port_page1.Configuration, @@ -1008,6 +1013,7 @@ mpt_read_config_info_spi(struct mpt_soft "Port Page 2: Flags %x Settings %x\n", mpt->mpt_port_page2.PortFlags, mpt->mpt_port_page2.PortSettings); + mpt2host_config_page_scsi_port_2(&mpt->mpt_port_page2); for (i = 0; i < 16; i++) { mpt_lprt(mpt, MPT_PRT_NEGOTIATION, " Port Page 2 Tgt %d: timo %x SF %x Flags %x\n", @@ -1026,6 +1032,7 @@ mpt_read_config_info_spi(struct mpt_soft "cannot read SPI Target %d Device Page 0\n", i); continue; } + mpt2host_config_page_scsi_device_0(&mpt->mpt_dev_page0[i]); mpt_lprt(mpt, MPT_PRT_NEGOTIATION, "target %d page 0: Negotiated Params %x Information %x\n", i, mpt->mpt_dev_page0[i].NegotiatedParameters, @@ -1039,6 +1046,7 @@ mpt_read_config_info_spi(struct mpt_soft "cannot read SPI Target %d Device Page 1\n", i); continue; } + mpt2host_config_page_scsi_device_1(&mpt->mpt_dev_page1[i]); mpt_lprt(mpt, MPT_PRT_NEGOTIATION, "target %d page 1: Requested Params %x Configuration %x\n", i, mpt->mpt_dev_page1[i].RequestedParameters, @@ -1068,6 +1076,7 @@ mpt_set_initial_config_spi(struct mpt_so "be %x\n", mpt->mpt_port_page1.Configuration, pp1val); tmp = mpt->mpt_port_page1; tmp.Configuration = pp1val; + host2mpt_config_page_scsi_port_1(&tmp); error = mpt_write_cur_cfg_page(mpt, 0, &tmp.Header, sizeof(tmp), FALSE, 5000); if (error) { @@ -1078,6 +1087,7 @@ mpt_set_initial_config_spi(struct mpt_so if (error) { return (-1); } + mpt2host_config_page_scsi_port_1(&tmp); if (tmp.Configuration != pp1val) { mpt_prt(mpt, "failed to reset SPI Port Page 1 Config value\n"); @@ -1432,7 +1442,8 @@ bad: memset(se, 0, sizeof (*se)); se->Address.Low = htole32(dm_segs->ds_addr & 0xffffffff); if (sizeof(bus_addr_t) > 4) { - se->Address.High = ((uint64_t) dm_segs->ds_addr) >> 32; + se->Address.High = + htole32(((uint64_t)dm_segs->ds_addr) >> 32); } MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); tf = flags; @@ -1507,9 +1518,9 @@ bad: chain_list_addr += cur_off; if (sizeof (bus_addr_t) > 4) { ce->Address.High = - htole32((uint32_t) ((uint64_t)chain_list_addr >> 32)); + htole32(((uint64_t)chain_list_addr) >> 32); } - ce->Address.Low = htole32((uint32_t) chain_list_addr); + ce->Address.Low = htole32(chain_list_addr & 0xffffffff); ce->Flags = MPI_SGE_FLAGS_CHAIN_ELEMENT | MPI_SGE_FLAGS_64_BIT_ADDRESSING; @@ -1536,6 +1547,7 @@ bad: ce->Length = (this_seg_lim - seg) * sizeof (SGE_SIMPLE64); } + ce->Length = htole16(ce->Length); /* * Fill in the chain list SGE elements with our segment data. @@ -1546,7 +1558,8 @@ bad: */ while (seg < this_seg_lim) { memset(se, 0, sizeof (*se)); - se->Address.Low = htole32(dm_segs->ds_addr); + se->Address.Low = htole32(dm_segs->ds_addr & + 0xffffffff); if (sizeof (bus_addr_t) > 4) { se->Address.High = htole32(((uint64_t)dm_segs->ds_addr) >> 32); @@ -1830,7 +1843,7 @@ bad: uint32_t tf; memset(se, 0,sizeof (*se)); - se->Address = dm_segs->ds_addr; + se->Address = htole32(dm_segs->ds_addr); @@ -1908,7 +1921,7 @@ bad: - ce->Address = chain_list_addr; + ce->Address = htole32(chain_list_addr); ce->Flags = MPI_SGE_FLAGS_CHAIN_ELEMENT; @@ -1935,6 +1948,7 @@ bad: ce->Length = (this_seg_lim - seg) * sizeof (SGE_SIMPLE32); } + ce->Length = htole16(ce->Length); /* * Fill in the chain list SGE elements with our segment data. @@ -1945,7 +1959,7 @@ bad: */ while (seg < this_seg_lim) { memset(se, 0, sizeof (*se)); - se->Address = dm_segs->ds_addr; + se->Address = htole32(dm_segs->ds_addr); @@ -2193,6 +2207,7 @@ mpt_start(struct cam_sim *sim, union ccb mpt_req->Control |= MPI_SCSIIO_CONTROL_NO_DISCONNECT; } } + mpt_req->Control = htole32(mpt_req->Control); /* Copy the scsi command block into place */ if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0) { @@ -2317,7 +2332,7 @@ mpt_bus_reset(struct mpt_softc *mpt, tar error = mpt_wait_req(mpt, mpt->tmf_req, REQ_STATE_DONE, REQ_STATE_DONE, sleep_ok, 5000); - status = mpt->tmf_req->IOCStatus; + status = le16toh(mpt->tmf_req->IOCStatus); response = mpt->tmf_req->ResponseCode; mpt->tmf_req->state = REQ_STATE_FREE; @@ -2524,10 +2539,11 @@ mpt_cam_event(struct mpt_softc *mpt, req struct cam_sim *sim; struct cam_path *tmppath; struct ccb_relsim crs; - PTR_EVENT_DATA_QUEUE_FULL pqf = - (PTR_EVENT_DATA_QUEUE_FULL) msg->Data; + PTR_EVENT_DATA_QUEUE_FULL pqf; lun_id_t lun_id; + pqf = (PTR_EVENT_DATA_QUEUE_FULL)msg->Data; + pqf->CurrentDepth = le16toh(pqf->CurrentDepth); mpt_prt(mpt, "QUEUE FULL EVENT: Bus 0x%02x Target 0x%02x Depth " "%d\n", pqf->Bus, pqf->TargetID, pqf->CurrentDepth); if (mpt->phydisk_sim) { @@ -3086,9 +3102,10 @@ mpt_scsi_reply_frame_handler(struct mpt_ && (ccb->ccb_h.flags & (CAM_SENSE_PHYS | CAM_SENSE_PTR)) == 0) { ccb->ccb_h.status |= CAM_AUTOSNS_VALID; ccb->csio.sense_resid = - ccb->csio.sense_len - scsi_io_reply->SenseCount; + ccb->csio.sense_len - le32toh(scsi_io_reply->SenseCount); bcopy(req->sense_vbuf, &ccb->csio.sense_data, - min(ccb->csio.sense_len, scsi_io_reply->SenseCount)); + min(ccb->csio.sense_len, + le32toh(scsi_io_reply->SenseCount))); } if ((sstate & MPI_SCSI_STATE_QUEUE_TAG_REJECTED) != 0) { @@ -3776,6 +3793,8 @@ mpt_get_spi_settings(struct mpt_softc *m mpt_prt(mpt, "can't get tgt %d config page 0\n", tgt); return (rv); } + mpt2host_config_page_scsi_device_0(&tmp); + MPTLOCK_2_CAMLOCK(mpt); mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_get_spi_settings[%d]: current NP %x Info %x\n", tgt, @@ -3905,6 +3924,7 @@ mpt_update_spi_config(struct mpt_softc * "mpt_update_spi_config[%d].page1: Requested Params 0x%08x\n", tgt, mpt->mpt_dev_page1[tgt].RequestedParameters); tmp = mpt->mpt_dev_page1[tgt]; + host2mpt_config_page_scsi_device_1(&tmp); rv = mpt_write_cur_cfg_page(mpt, tgt, &tmp.Header, sizeof(tmp), FALSE, 5000); if (rv) { @@ -4156,7 +4176,7 @@ mpt_recover_commands(struct mpt_softc *m error = mpt_wait_req(mpt, mpt->tmf_req, REQ_STATE_DONE, REQ_STATE_DONE, TRUE, 500); - status = mpt->tmf_req->IOCStatus; + status = le16toh(mpt->tmf_req->IOCStatus); response = mpt->tmf_req->ResponseCode; mpt->tmf_req->state = REQ_STATE_FREE; Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Wed Mar 18 22:57:55 2009 (r189998) +++ stable/7/sys/dev/mpt/mpt_raid.c Wed Mar 18 23:13:35 2009 (r189999) @@ -564,7 +564,7 @@ mpt_raid_reply_frame_handler(struct mpt_ action_result = REQ_TO_RAID_ACTION_RESULT(req); memcpy(&action_result->action_data, &reply->ActionData, sizeof(action_result->action_data)); - action_result->action_status = reply->ActionStatus; + action_result->action_status = le16toh(reply->ActionStatus); return (TRUE); } @@ -583,7 +583,7 @@ mpt_issue_raid_req(struct mpt_softc *mpt rap = req->req_vbuf; memset(rap, 0, sizeof *rap); rap->Action = Action; - rap->ActionDataWord = ActionDataWord; + rap->ActionDataWord = htole32(ActionDataWord); rap->Function = MPI_FUNCTION_RAID_ACTION; rap->VolumeID = vol->config_page->VolumeID; rap->VolumeBus = vol->config_page->VolumeBus; @@ -592,12 +592,13 @@ mpt_issue_raid_req(struct mpt_softc *mpt else rap->PhysDiskNum = 0xFF; se = (SGE_SIMPLE32 *)&rap->ActionDataSGE; - se->Address = addr; + se->Address = htole32(addr); MPI_pSGE_SET_LENGTH(se, len); MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_END_OF_LIST | write ? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST)); + se->FlagsLength = htole32(se->FlagsLength); rap->MsgContext = htole32(req->index | raid_handler_id); mpt_check_doorbell(mpt); @@ -1226,6 +1227,7 @@ mpt_refresh_raid_disk(struct mpt_softc * mpt_prt(mpt, "mpt_refresh_raid_disk: " "Failed to read RAID Disk Page(%d)\n", ioc_disk->PhysDiskNum); + mpt2host_config_page_raid_phys_disk_0(&mpt_disk->config_page); } static void @@ -1354,6 +1356,7 @@ mpt_refresh_raid_data(struct mpt_softc * "mpt_refresh_raid_data: Failed to read IOC Page 3\n"); return (-1); } + mpt2host_config_page_ioc3(mpt->ioc_page3); ioc_disk = mpt->ioc_page3->PhysDisk; ioc_last_disk = ioc_disk + mpt->ioc_page3->NumPhysDisks; @@ -1384,6 +1387,7 @@ mpt_refresh_raid_data(struct mpt_softc * "Failed to read IOC Page 2\n"); return (-1); } + mpt2host_config_page_ioc2(mpt->ioc_page2); ioc_vol = mpt->ioc_page2->RaidVolume; ioc_last_vol = ioc_vol + mpt->ioc_page2->NumActiveVolumes; Modified: stable/7/sys/dev/mpt/mpt_user.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_user.c Wed Mar 18 22:57:55 2009 (r189998) +++ stable/7/sys/dev/mpt/mpt_user.c Wed Mar 18 23:13:35 2009 (r189999) @@ -256,7 +256,7 @@ mpt_user_read_cfg_header(struct mpt_soft params.PageLength = 0; params.PageNumber = page_req->header.PageNumber; params.PageType = page_req->header.PageType; - params.PageAddress = page_req->page_address; + params.PageAddress = le32toh(page_req->page_address); error = mpt_issue_cfg_req(mpt, req, ¶ms, /*addr*/0, /*len*/0, TRUE, 5000); if (error != 0) { @@ -270,7 +270,7 @@ mpt_user_read_cfg_header(struct mpt_soft return (ETIMEDOUT); } - page_req->ioc_status = req->IOCStatus; + page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) { cfgp = req->req_vbuf; bcopy(&cfgp->Header, &page_req->header, @@ -301,15 +301,15 @@ mpt_user_read_cfg_page(struct mpt_softc params.PageLength = hdr->PageLength; params.PageNumber = hdr->PageNumber; params.PageType = hdr->PageType & MPI_CONFIG_PAGETYPE_MASK; - params.PageAddress = page_req->page_address; + params.PageAddress = le32toh(page_req->page_address); error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr, - page_req->len, TRUE, 5000); + le32toh(page_req->len), TRUE, 5000); if (error != 0) { mpt_prt(mpt, "mpt_user_read_cfg_page timed out\n"); return (ETIMEDOUT); } - page_req->ioc_status = req->IOCStatus; + page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_POSTREAD); @@ -337,7 +337,7 @@ mpt_user_read_extcfg_header(struct mpt_s params.PageLength = 0; params.PageNumber = ext_page_req->header.PageNumber; params.PageType = MPI_CONFIG_PAGETYPE_EXTENDED; - params.PageAddress = ext_page_req->page_address; + params.PageAddress = le32toh(ext_page_req->page_address); params.ExtPageType = ext_page_req->header.ExtPageType; params.ExtPageLength = 0; error = mpt_issue_cfg_req(mpt, req, ¶ms, /*addr*/0, /*len*/0, @@ -353,7 +353,7 @@ mpt_user_read_extcfg_header(struct mpt_s return (ETIMEDOUT); } - ext_page_req->ioc_status = req->IOCStatus; + ext_page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) { cfgp = req->req_vbuf; ext_page_req->header.PageVersion = cfgp->Header.PageVersion; @@ -387,17 +387,17 @@ mpt_user_read_extcfg_page(struct mpt_sof params.PageLength = 0; params.PageNumber = hdr->PageNumber; params.PageType = MPI_CONFIG_PAGETYPE_EXTENDED; - params.PageAddress = ext_page_req->page_address; + params.PageAddress = le32toh(ext_page_req->page_address); params.ExtPageType = hdr->ExtPageType; params.ExtPageLength = hdr->ExtPageLength; error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr, - ext_page_req->len, TRUE, 5000); + le32toh(ext_page_req->len), TRUE, 5000); if (error != 0) { mpt_prt(mpt, "mpt_user_read_extcfg_page timed out\n"); return (ETIMEDOUT); } - ext_page_req->ioc_status = req->IOCStatus; + ext_page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_POSTREAD); @@ -446,7 +446,7 @@ mpt_user_write_cfg_page(struct mpt_softc params.PageVersion = hdr->PageVersion; params.PageLength = hdr->PageLength; params.PageNumber = hdr->PageNumber; - params.PageAddress = page_req->page_address; + params.PageAddress = le32toh(page_req->page_address); #if 0 /* Restore stripped out attributes */ hdr->PageType |= hdr_attr; @@ -455,13 +455,13 @@ mpt_user_write_cfg_page(struct mpt_softc params.PageType = hdr->PageType; #endif error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr, - page_req->len, TRUE, 5000); + le32toh(page_req->len), TRUE, 5000); if (error != 0) { mpt_prt(mpt, "mpt_write_cfg_page timed out\n"); return (ETIMEDOUT); } - page_req->ioc_status = req->IOCStatus; + page_req->ioc_status = htole16(req->IOCStatus); mpt_free_request(mpt, req); return (0); } @@ -536,14 +536,15 @@ mpt_user_raid_action(struct mpt_softc *m if (mpt_page->vaddr != NULL && raid_act->len != 0) { bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_PREWRITE); - se->Address = mpt_page->paddr; - MPI_pSGE_SET_LENGTH(se, raid_act->len); + se->Address = htole32(mpt_page->paddr); + MPI_pSGE_SET_LENGTH(se, le32toh(raid_act->len)); MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_END_OF_LIST | raid_act->write ? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST)); } + se->FlagsLength = htole32(se->FlagsLength); rap->MsgContext = htole32(req->index | user_handler_id); mpt_check_doorbell(mpt); @@ -559,7 +560,7 @@ mpt_user_raid_action(struct mpt_softc *m return (error); } - raid_act->ioc_status = req->IOCStatus; + raid_act->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) != MPI_IOCSTATUS_SUCCESS) { mpt_free_request(mpt, req); return (0); From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 23:25:12 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 825A1106566B; Wed, 18 Mar 2009 23:25:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CEB88FC18; Wed, 18 Mar 2009 23:25:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2INPCOV041102; Wed, 18 Mar 2009 23:25:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2INPCZd041098; Wed, 18 Mar 2009 23:25:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903182325.n2INPCZd041098@svn.freebsd.org> From: Marius Strobl Date: Wed, 18 Mar 2009 23:25:12 +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: r190000 - in stable/7/sys: . boot/sparc64/loader contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sun4v/include 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, 18 Mar 2009 23:25:13 -0000 Author: marius Date: Wed Mar 18 23:25:12 2009 New Revision: 190000 URL: http://svn.freebsd.org/changeset/base/190000 Log: MFC: r181398 - Reimplement {d,i}tlb_enter() and {d,i}tlb_va_to_pa() in C. There's no particular reason for them to be implemented in assembler and having them in C allows easier extension as well as using more C macros and {d,i}tlb_slot_max rather than hard-coding magic (and actually spitfire-only) values. - Fix the compilation of pmap_print_tte(). - Change pmap_print_tlb() to use ldxa() rather than re-rolling it inline as well as TLB_DAR_SLOT and {d,i}tlb_slot_max rather than hardcoding magic (and actually spitfire-only) values. - While at it, suffix the above mentioned functions with "_sun4u" to underline they're architecture-specific. - Use __FBSDID and macros instead of magic values in locore.S. - Remove unused includes and smp_stack in locore.S. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/sparc64/loader/locore.S stable/7/sys/boot/sparc64/loader/main.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/tte.h stable/7/sys/sun4v/include/tte.h Modified: stable/7/sys/boot/sparc64/loader/locore.S ============================================================================== --- stable/7/sys/boot/sparc64/loader/locore.S Wed Mar 18 23:13:35 2009 (r189999) +++ stable/7/sys/boot/sparc64/loader/locore.S Wed Mar 18 23:25:12 2009 (r190000) @@ -4,35 +4,34 @@ * All rights reserved. * * As long as the above copyright statement and this notice remain - * unchanged, you can do what ever you want with this file. - * - * $FreeBSD$ + * unchanged, you can do what ever you want with this file. */ +#include +__FBSDID("$FreeBSD$"); + #define LOCORE -#include -#include +#include +#include +#include #include -#include -#include #define PAGE_SIZE 8192 #define PAGE_SHIFT 13 -#define SPOFF 2047 #define STACK_SIZE (2 * PAGE_SIZE) ENTRY(_start) - /* limit interrupts */ - wrpr %g0, 13, %pil + /* Limit interrupts. */ + wrpr %g0, PIL_TICK - 1, %pil /* * PSTATE: privileged, interrupts enabled, floating point * unit enabled */ - wrpr %g0, PSTATE_PRIV|PSTATE_IE|PSTATE_PEF, %pstate - wr %g0, 0x4, %fprs + wrpr %g0, PSTATE_PRIV | PSTATE_IE | PSTATE_PEF, %pstate + wr %g0, FPRS_FEF, %fprs setx stack + STACK_SIZE - SPOFF - CCFSZ, %l7, %l6 mov %l6, %sp @@ -40,74 +39,4 @@ ENTRY(_start) mov %o4, %o0 sir -/* - * %o0 input VA constant - * %o1 current iTLB offset - * %o2 current iTLB TTE tag - */ -ENTRY(itlb_va_to_pa) - clr %o1 -0: ldxa [%o1] ASI_ITLB_TAG_READ_REG, %o2 - cmp %o2, %o0 - bne,a %xcc, 1f - nop - /* return PA of matching entry */ - ldxa [%o1] ASI_ITLB_DATA_ACCESS_REG, %o0 - sllx %o0, 23, %o0 - srlx %o0, PAGE_SHIFT+23, %o0 - sllx %o0, PAGE_SHIFT, %o0 - retl - mov %o0, %o1 -1: cmp %o1, 63<<3 - blu %xcc, 0b - add %o1, 8, %o1 - clr %o0 - retl - not %o0 - -ENTRY(dtlb_va_to_pa) - clr %o1 -0: ldxa [%o1] ASI_DTLB_TAG_READ_REG, %o2 - cmp %o2, %o0 - bne,a %xcc, 1f - nop - /* return PA of matching entry */ - ldxa [%o1] ASI_DTLB_DATA_ACCESS_REG, %o0 - sllx %o0, 23, %o0 - srlx %o0, PAGE_SHIFT+23, %o0 - sllx %o0, PAGE_SHIFT, %o0 - retl - mov %o0, %o1 -1: cmp %o1, 63<<3 - blu %xcc, 0b - add %o1, 8, %o1 - clr %o0 - retl - not %o0 - -/* - * %o0 = vpn - * %o1 = tte data - */ -ENTRY(itlb_enter) - rdpr %pstate, %o4 - wrpr %o4, PSTATE_IE, %pstate - mov AA_IMMU_TAR, %o3 - stxa %o0, [%o3] ASI_IMMU - stxa %o1, [%g0] ASI_ITLB_DATA_IN_REG - membar #Sync - retl - wrpr %o4, 0, %pstate - -ENTRY(dtlb_enter) - rdpr %pstate, %o4 - wrpr %o4, PSTATE_IE, %pstate - mov AA_DMMU_TAR, %o3 - stxa %o0, [%o3] ASI_DMMU - stxa %o1, [%g0] ASI_DTLB_DATA_IN_REG - membar #Sync - retl - wrpr %o4, 0, %pstate - .comm stack, STACK_SIZE, 32 - .comm smp_stack, STACK_SIZE, 32 Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Wed Mar 18 23:13:35 2009 (r189999) +++ stable/7/sys/boot/sparc64/loader/main.c Wed Mar 18 23:25:12 2009 (r190000) @@ -4,7 +4,7 @@ * All rights reserved. * * As long as the above copyright statement and this notice remain - * unchanged, you can do what ever you want with this file. + * unchanged, you can do what ever you want with this file. */ #include @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "bootstrap.h" @@ -56,10 +57,10 @@ static struct mmu_ops { typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3, void *openfirmware); -extern void itlb_enter(u_long vpn, u_long data); -extern void dtlb_enter(u_long vpn, u_long data); -extern vm_offset_t itlb_va_to_pa(vm_offset_t); -extern vm_offset_t dtlb_va_to_pa(vm_offset_t); +static void dtlb_enter_sun4u(u_long vpn, u_long data); +static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); +static void itlb_enter_sun4u(u_long vpn, u_long data); +static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); extern vm_offset_t md_load(char *, vm_offset_t *); static int sparc64_autoload(void); static ssize_t sparc64_readin(const int, vm_offset_t, const size_t); @@ -76,6 +77,13 @@ static vm_offset_t init_heap(void); static void tlb_init_sun4u(void); static void tlb_init_sun4v(void); +#ifdef LOADER_DEBUG +typedef u_int64_t tte_t; + +static void pmap_print_tlb_sun4u(void); +static void pmap_print_tte_sun4u(tte_t, tte_t); +#endif + static struct mmu_ops mmu_ops_sun4u = { tlb_init_sun4u, mmu_mapin_sun4u }; static struct mmu_ops mmu_ops_sun4v = { tlb_init_sun4v, mmu_mapin_sun4v }; @@ -344,9 +352,8 @@ __elfN(exec)(struct preloaded_file *fp) return (error); printf("jumping to kernel entry at %#lx.\n", e->e_entry); -#if 0 - pmap_print_tlb('i'); - pmap_print_tlb('d'); +#if LOADER_DEBUG + pmap_print_tlb_sun4u(); #endif entry = e->e_entry; @@ -358,6 +365,64 @@ __elfN(exec)(struct preloaded_file *fp) panic("%s: exec returned", __func__); } +static vm_offset_t +dtlb_va_to_pa_sun4u(vm_offset_t va) +{ + u_long reg; + int i; + + for (i = 0; i < dtlb_slot_max; i++) { + reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + if (TLB_TAR_VA(reg) != va) + continue; + reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG); + return ((reg & TD_PA_SF_MASK) >> TD_PA_SHIFT); + } + return (-1); +} + +static vm_offset_t +itlb_va_to_pa_sun4u(vm_offset_t va) +{ + u_long reg; + int i; + + for (i = 0; i < itlb_slot_max; i++) { + reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + if (TLB_TAR_VA(reg) != va) + continue; + reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG); + return ((reg & TD_PA_SF_MASK) >> TD_PA_SHIFT); + } + return (-1); +} + +static void +itlb_enter_sun4u(u_long vpn, u_long data) +{ + u_long reg; + + reg = rdpr(pstate); + wrpr(pstate, reg & ~PSTATE_IE, 0); + stxa(AA_IMMU_TAR, ASI_IMMU, vpn); + stxa(0, ASI_ITLB_DATA_IN_REG, data); + membar(Sync); + wrpr(pstate, reg, 0); +} + +static void +dtlb_enter_sun4u(u_long vpn, u_long data) +{ + u_long reg; + + reg = rdpr(pstate); + wrpr(pstate, reg & ~PSTATE_IE, 0); + stxa(AA_DMMU_TAR, ASI_DMMU, vpn); + stxa(0, ASI_DTLB_DATA_IN_REG, data); + membar(Sync); + wrpr(pstate, reg, 0); +} + static int mmu_mapin_sun4u(vm_offset_t va, vm_size_t len) { @@ -371,8 +436,8 @@ mmu_mapin_sun4u(vm_offset_t va, vm_size_ len += va & PAGE_MASK_4M; va &= ~PAGE_MASK_4M; while (len) { - if (dtlb_va_to_pa(va) == (vm_offset_t)-1 || - itlb_va_to_pa(va) == (vm_offset_t)-1) { + if (dtlb_va_to_pa_sun4u(va) == (vm_offset_t)-1 || + itlb_va_to_pa_sun4u(va) == (vm_offset_t)-1) { /* Allocate a physical page, claim the virtual area. */ if (pa == (vm_offset_t)-1) { pa = alloc_phys(PAGE_SIZE_4M, PAGE_SIZE_4M); @@ -404,8 +469,8 @@ mmu_mapin_sun4u(vm_offset_t va, vm_size_ itlb_store[itlb_slot].te_va = va; dtlb_slot++; itlb_slot++; - dtlb_enter(va, data); - itlb_enter(va, data); + dtlb_enter_sun4u(va, data); + itlb_enter_sun4u(va, data); pa = (vm_offset_t)-1; } len -= len > PAGE_SIZE_4M ? PAGE_SIZE_4M : len; @@ -620,14 +685,12 @@ exit(int code) } #ifdef LOADER_DEBUG -typedef u_int64_t tte_t; - static const char *page_sizes[] = { " 8k", " 64k", "512k", " 4m" }; static void -pmap_print_tte(tte_t tag, tte_t tte) +pmap_print_tte_sun4u(tte_t tag, tte_t tte) { printf("%s %s ", @@ -641,36 +704,31 @@ pmap_print_tte(tte_t tag, tte_t tte) printf(tte & TD_L ? "\e[32mL\e[0m " : " "); printf(tte & TD_IE ? "IE " : " "); printf(tte & TD_NFO ? "NFO " : " "); - printf("tag=0x%lx pa=0x%lx va=0x%lx ctx=%ld\n", tag, TD_PA(tte), - TT_VA(tag), TT_CTX(tag)); + printf("pa=0x%lx va=0x%lx ctx=%ld\n", + TD_PA(tte), TLB_TAR_VA(tag), TLB_TAR_CTX(tag)); } -void -pmap_print_tlb(char which) + +static void +pmap_print_tlb_sun4u(void) { + tte_t tag, tte; int i; - tte_t tte, tag; - for (i = 0; i < 64*8; i += 8) { - if (which == 'i') { - __asm__ __volatile__("ldxa [%1] %2, %0\n" : - "=r" (tag) : "r" (i), - "i" (ASI_ITLB_TAG_READ_REG)); - __asm__ __volatile__("ldxa [%1] %2, %0\n" : - "=r" (tte) : "r" (i), - "i" (ASI_ITLB_DATA_ACCESS_REG)); - } - else { - __asm__ __volatile__("ldxa [%1] %2, %0\n" : - "=r" (tag) : "r" (i), - "i" (ASI_DTLB_TAG_READ_REG)); - __asm__ __volatile__("ldxa [%1] %2, %0\n" : - "=r" (tte) : "r" (i), - "i" (ASI_DTLB_DATA_ACCESS_REG)); - } + for (i = 0; i < itlb_slot_max; i++) { + tte = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG); + if (!(tte & TD_V)) + continue; + tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + printf("iTLB-%2u: ", i); + pmap_print_tte_sun4u(tag, tte); + } + for (i = 0; i < dtlb_slot_max; i++) { + tte = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG); if (!(tte & TD_V)) continue; - printf("%cTLB-%2u: ", which, i>>3); - pmap_print_tte(tag, tte); + tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + printf("dTLB-%2u: ", i); + pmap_print_tte_sun4u(tag, tte); } } #endif Modified: stable/7/sys/sparc64/include/tte.h ============================================================================== --- stable/7/sys/sparc64/include/tte.h Wed Mar 18 23:13:35 2009 (r189999) +++ stable/7/sys/sparc64/include/tte.h Wed Mar 18 23:25:12 2009 (r190000) @@ -43,12 +43,16 @@ #define TD_SIZE_BITS (2) #define TD_SOFT2_BITS (9) #define TD_DIAG_BITS (9) -#define TD_PA_BITS (28) +#define TD_PA_CH_BITS (30) +#define TD_PA_SF_BITS (28) +#define TD_PA_BITS TD_PA_SF_BITS #define TD_SOFT_BITS (6) #define TD_SIZE_MASK ((1UL << TD_SIZE_BITS) - 1) #define TD_SOFT2_MASK ((1UL << TD_SOFT2_BITS) - 1) #define TD_DIAG_MASK ((1UL << TD_DIAG_BITS) - 1) +#define TD_PA_CH_MASK ((1UL << TD_PA_CH_BITS) - 1) +#define TD_PA_SF_MASK ((1UL << TD_PA_SF_BITS) - 1) #define TD_PA_MASK ((1UL << TD_PA_BITS) - 1) #define TD_SOFT_MASK ((1UL << TD_SOFT_BITS) - 1) Modified: stable/7/sys/sun4v/include/tte.h ============================================================================== --- stable/7/sys/sun4v/include/tte.h Wed Mar 18 23:13:35 2009 (r189999) +++ stable/7/sys/sun4v/include/tte.h Wed Mar 18 23:25:12 2009 (r190000) @@ -41,11 +41,15 @@ #define TD_SOFT2_BITS (9) #define TD_DIAG_BITS (9) +#define TD_PA_CH_BITS (30) +#define TD_PA_SF_BITS (28) #define TD_PA_BITS (42) #define TD_SOFT_BITS (6) #define TD_SOFT2_MASK ((1UL << TD_SOFT2_BITS) - 1) #define TD_DIAG_MASK ((1UL << TD_DIAG_BITS) - 1) +#define TD_PA_CH_MASK ((1UL << TD_PA_CH_BITS) - 1) +#define TD_PA_SF_MASK ((1UL << TD_PA_SF_BITS) - 1) #define TD_PA_MASK ((1UL << TD_PA_BITS) - 1) #define TD_SOFT_MASK ((1UL << TD_SOFT_BITS) - 1) From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 23:35: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 633F2106564A; Wed, 18 Mar 2009 23:35:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F93F8FC1E; Wed, 18 Mar 2009 23:35:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2INZet8041344; Wed, 18 Mar 2009 23:35:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2INZepv041343; Wed, 18 Mar 2009 23:35:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903182335.n2INZepv041343@svn.freebsd.org> From: Marius Strobl Date: Wed, 18 Mar 2009 23:35: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: r190001 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include 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, 18 Mar 2009 23:35:41 -0000 Author: marius Date: Wed Mar 18 23:35:40 2009 New Revision: 190001 URL: http://svn.freebsd.org/changeset/base/190001 Log: MFC: r181642 Assume OpenSolaris knows better and use their value for VM_MAX_PROM_ADDRESS. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/vmparam.h Modified: stable/7/sys/sparc64/include/vmparam.h ============================================================================== --- stable/7/sys/sparc64/include/vmparam.h Wed Mar 18 23:25:12 2009 (r190000) +++ stable/7/sys/sparc64/include/vmparam.h Wed Mar 18 23:35:40 2009 (r190001) @@ -194,7 +194,7 @@ #define VM_MAX_KERNEL_ADDRESS (vm_max_kernel_address) #define VM_MIN_PROM_ADDRESS (0x00000000f0000000UL) -#define VM_MAX_PROM_ADDRESS (0x00000000ffffe000UL) +#define VM_MAX_PROM_ADDRESS (0x00000000ffffffffUL) #define VM_MIN_USER_ADDRESS (0x0000000000000000UL) #define VM_MAX_USER_ADDRESS (0x000007fe00000000UL) From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 18 23:50:25 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FDDD106564A; Wed, 18 Mar 2009 23:50:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BA018FC19; Wed, 18 Mar 2009 23:50:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2INoPlm041691; Wed, 18 Mar 2009 23:50:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2INoPhF041690; Wed, 18 Mar 2009 23:50:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903182350.n2INoPhF041690@svn.freebsd.org> From: Marius Strobl Date: Wed, 18 Mar 2009 23:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190002 - in stable/7/sys: . boot/sparc64/loader contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 23:50:26 -0000 Author: marius Date: Wed Mar 18 23:50:25 2009 New Revision: 190002 URL: http://svn.freebsd.org/changeset/base/190002 Log: MFC: r182478, r182766 - Read ASI_{D,I}TLB_DATA_ACCESS_REG twice in order to work around errata of USIII and beyond (USIII erratum #19, USIII+ erratum #1, USIIIi erratum #1). - Use the cheetah PA mask in {d,i}tlb_va_to_pa_sun4u() for USIII and beyond. This is done so that these functions will still mask the debug bits of spitfire-class CPUs once we increase TD_PA_BITS to match the number of bits used for the PA by cheetah-class CPUs. - Change {d,i}tlb_enter_sun4u() to also set TLB_CTX_KERNEL as the context of the mappings entered. This is more or less cosmetic as TLB_CTX_KERNEL is 0. - Now that we have to distinguish between different sun4u CPUs in the loader anyway, no longer do trial and error when reading the portid property. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/sparc64/loader/main.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Wed Mar 18 23:35:40 2009 (r190001) +++ stable/7/sys/boot/sparc64/loader/main.c Wed Mar 18 23:50:25 2009 (r190002) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bootstrap.h" #include "libofw.h" @@ -57,8 +58,10 @@ static struct mmu_ops { typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3, void *openfirmware); +static inline u_long dtlb_get_data_sun4u(int slot); static void dtlb_enter_sun4u(u_long vpn, u_long data); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); +static inline u_long itlb_get_data_sun4u(int slot); static void itlb_enter_sun4u(u_long vpn, u_long data); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); extern vm_offset_t md_load(char *, vm_offset_t *); @@ -92,6 +95,7 @@ struct tlb_entry *dtlb_store; struct tlb_entry *itlb_store; int dtlb_slot; int itlb_slot; +int cpu_impl; static int dtlb_slot_max; static int itlb_slot_max; @@ -365,60 +369,98 @@ __elfN(exec)(struct preloaded_file *fp) panic("%s: exec returned", __func__); } +static inline u_long +dtlb_get_data_sun4u(int slot) +{ + + /* + * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * around errata of USIII and beyond. + */ + (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); + return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); +} + +static inline u_long +itlb_get_data_sun4u(int slot) +{ + + /* + * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work + * around errata of USIII and beyond. + */ + (void)ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG); + return (ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG)); +} + static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t va) { - u_long reg; + u_long pstate, reg; int i; + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < dtlb_slot_max; i++) { reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG); + reg = dtlb_get_data_sun4u(i); + wrpr(pstate, pstate, 0); + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + return ((reg & TD_PA_CH_MASK) >> TD_PA_SHIFT); return ((reg & TD_PA_SF_MASK) >> TD_PA_SHIFT); } + wrpr(pstate, pstate, 0); return (-1); } static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t va) { - u_long reg; + u_long pstate, reg; int i; + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < itlb_slot_max; i++) { reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG); + reg = itlb_get_data_sun4u(i); + wrpr(pstate, pstate, 0); + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + return ((reg & TD_PA_CH_MASK) >> TD_PA_SHIFT); return ((reg & TD_PA_SF_MASK) >> TD_PA_SHIFT); } + wrpr(pstate, pstate, 0); return (-1); } static void -itlb_enter_sun4u(u_long vpn, u_long data) +dtlb_enter_sun4u(u_long vpn, u_long data) { u_long reg; reg = rdpr(pstate); wrpr(pstate, reg & ~PSTATE_IE, 0); - stxa(AA_IMMU_TAR, ASI_IMMU, vpn); - stxa(0, ASI_ITLB_DATA_IN_REG, data); + stxa(AA_DMMU_TAR, ASI_DMMU, + TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); + stxa(0, ASI_DTLB_DATA_IN_REG, data); membar(Sync); wrpr(pstate, reg, 0); } static void -dtlb_enter_sun4u(u_long vpn, u_long data) +itlb_enter_sun4u(u_long vpn, u_long data) { u_long reg; reg = rdpr(pstate); wrpr(pstate, reg & ~PSTATE_IE, 0); - stxa(AA_DMMU_TAR, ASI_DMMU, vpn); - stxa(0, ASI_DTLB_DATA_IN_REG, data); + stxa(AA_IMMU_TAR, ASI_IMMU, + TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); + stxa(0, ASI_ITLB_DATA_IN_REG, data); membar(Sync); wrpr(pstate, reg, 0); } @@ -539,19 +581,18 @@ tlb_init_sun4u(void) u_int bootcpu; u_int cpu; + cpu_impl = VER_IMPL(rdpr(ver)); bootcpu = UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)); for (child = OF_child(root); child != 0; child = OF_peer(child)) { - if (child == -1) - panic("%s: can't get child phandle", __func__); - if (OF_getprop(child, "device_type", buf, sizeof(buf)) > 0 && - strcmp(buf, "cpu") == 0) { - if (OF_getprop(child, "upa-portid", &cpu, - sizeof(cpu)) == -1 && OF_getprop(child, "portid", - &cpu, sizeof(cpu)) == -1) - panic("%s: can't get portid", __func__); - if (cpu == bootcpu) - break; - } + if (OF_getprop(child, "device_type", buf, sizeof(buf)) <= 0) + continue; + if (strcmp(buf, "cpu") != 0) + continue; + if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ? + "upa-portid" : "portid", &cpu, sizeof(cpu)) <= 0) + continue; + if (cpu == bootcpu) + break; } if (cpu != bootcpu) panic("%s: no node for bootcpu?!?!", __func__); @@ -712,10 +753,14 @@ static void pmap_print_tlb_sun4u(void) { tte_t tag, tte; + u_long pstate; int i; + pstate = rdpr(pstate); for (i = 0; i < itlb_slot_max; i++) { - tte = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + tte = itlb_get_data_sun4u(i); + wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); @@ -723,7 +768,9 @@ pmap_print_tlb_sun4u(void) pmap_print_tte_sun4u(tag, tte); } for (i = 0; i < dtlb_slot_max; i++) { - tte = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + tte = dtlb_get_data_sun4u(i); + wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 00:02:08 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A53C106568A; Thu, 19 Mar 2009 00:02:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 051A58FC14; Thu, 19 Mar 2009 00:02:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J028U4042023; Thu, 19 Mar 2009 00:02:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J027PR042014; Thu, 19 Mar 2009 00:02:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903190002.n2J027PR042014@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 00:02: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: r190004 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 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, 19 Mar 2009 00:02:09 -0000 Author: marius Date: Thu Mar 19 00:02:07 2009 New Revision: 190004 URL: http://svn.freebsd.org/changeset/base/190004 Log: MFC: r182689 - USIII-based machines can consist of CPUs having different cache sizes (and running at different frequencies) so move the cacheinfo to the PCPU data. While at it, remove some redundant and/or unused members from struct cacheinfo. - In sparc64_init don't assume the first CPU node we find in the OFW device tree is the BSP. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/cache.h stable/7/sys/sparc64/include/pcpu.h stable/7/sys/sparc64/sparc64/cache.c stable/7/sys/sparc64/sparc64/cheetah.c stable/7/sys/sparc64/sparc64/genassym.c stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/mp_exception.S stable/7/sys/sparc64/sparc64/mp_machdep.c stable/7/sys/sparc64/sparc64/spitfire.c Modified: stable/7/sys/sparc64/include/cache.h ============================================================================== --- stable/7/sys/sparc64/include/cache.h Wed Mar 18 23:52:20 2009 (r190003) +++ stable/7/sys/sparc64/include/cache.h Thu Mar 19 00:02:07 2009 (r190004) @@ -45,10 +45,6 @@ #ifndef _MACHINE_CACHE_H_ #define _MACHINE_CACHE_H_ -#ifndef LOCORE -#include -#endif - #define DCACHE_COLOR_BITS (1) #define DCACHE_COLORS (1 << DCACHE_COLOR_BITS) #define DCACHE_COLOR_MASK (DCACHE_COLORS - 1) @@ -80,31 +76,27 @@ * Cache control information */ struct cacheinfo { - u_int c_enabled; /* true => cache is enabled */ u_int ic_size; /* instruction cache */ - u_int ic_set; - u_int ic_l2set; u_int ic_assoc; u_int ic_linesize; u_int dc_size; /* data cache */ - u_int dc_l2size; u_int dc_assoc; u_int dc_linesize; u_int ec_size; /* external cache info */ u_int ec_assoc; - u_int ec_l2set; u_int ec_linesize; - u_int ec_l2linesize; }; #ifdef _KERNEL +struct pcpu; + typedef void cache_enable_t(void); typedef void cache_flush_t(void); typedef void dcache_page_inval_t(vm_paddr_t pa); typedef void icache_page_inval_t(vm_paddr_t pa); -void cache_init(phandle_t node); +void cache_init(struct pcpu *pcpu); cache_enable_t cheetah_cache_enable; cache_flush_t cheetah_cache_flush; @@ -121,8 +113,6 @@ extern cache_flush_t *cache_flush; extern dcache_page_inval_t *dcache_page_inval; extern icache_page_inval_t *icache_page_inval; -extern struct cacheinfo cache; - #endif /* KERNEL */ #endif /* !LOCORE */ Modified: stable/7/sys/sparc64/include/pcpu.h ============================================================================== --- stable/7/sys/sparc64/include/pcpu.h Wed Mar 18 23:52:20 2009 (r190003) +++ stable/7/sys/sparc64/include/pcpu.h Thu Mar 19 00:02:07 2009 (r190004) @@ -31,6 +31,7 @@ #define _MACHINE_PCPU_H_ #include +#include #include #include @@ -43,6 +44,7 @@ struct pmap; * point at the globaldata structure. */ #define PCPU_MD_FIELDS \ + struct cacheinfo pc_cache; \ struct intr_request pc_irpool[IR_FREE]; \ struct intr_request *pc_irhead; \ struct intr_request **pc_irtail; \ Modified: stable/7/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cache.c Wed Mar 18 23:52:20 2009 (r190003) +++ stable/7/sys/sparc64/sparc64/cache.c Thu Mar 19 00:02:07 2009 (r190004) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -81,8 +82,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct cacheinfo cache; - cache_enable_t *cache_enable; cache_flush_t *cache_flush; dcache_page_inval_t *dcache_page_inval; @@ -94,33 +93,41 @@ icache_page_inval_t *icache_page_inval; * Fill in the cache parameters using the cpu node. */ void -cache_init(phandle_t node) +cache_init(struct pcpu *pcpu) { u_long set; - if (OF_GET(node, "icache-size", cache.ic_size) == -1 || - OF_GET(node, "icache-line-size", cache.ic_linesize) == -1 || - OF_GET(node, "icache-associativity", cache.ic_assoc) == -1 || - OF_GET(node, "dcache-size", cache.dc_size) == -1 || - OF_GET(node, "dcache-line-size", cache.dc_linesize) == -1 || - OF_GET(node, "dcache-associativity", cache.dc_assoc) == -1 || - OF_GET(node, "ecache-size", cache.ec_size) == -1 || - OF_GET(node, "ecache-line-size", cache.ec_linesize) == -1 || - OF_GET(node, "ecache-associativity", cache.ec_assoc) == -1) + if (OF_GET(pcpu->pc_node, "icache-size", + pcpu->pc_cache.ic_size) == -1 || + OF_GET(pcpu->pc_node, "icache-line-size", + pcpu->pc_cache.ic_linesize) == -1 || + OF_GET(pcpu->pc_node, "icache-associativity", + pcpu->pc_cache.ic_assoc) == -1 || + OF_GET(pcpu->pc_node, "dcache-size", + pcpu->pc_cache.dc_size) == -1 || + OF_GET(pcpu->pc_node, "dcache-line-size", + pcpu->pc_cache.dc_linesize) == -1 || + OF_GET(pcpu->pc_node, "dcache-associativity", + pcpu->pc_cache.dc_assoc) == -1 || + OF_GET(pcpu->pc_node, "ecache-size", + pcpu->pc_cache.ec_size) == -1 || + OF_GET(pcpu->pc_node, "ecache-line-size", + pcpu->pc_cache.ec_linesize) == -1 || + OF_GET(pcpu->pc_node, "ecache-associativity", + pcpu->pc_cache.ec_assoc) == -1) panic("cache_init: could not retrieve cache parameters"); - cache.ic_set = cache.ic_size / cache.ic_assoc; - cache.ic_l2set = ffs(cache.ic_set) - 1; - if ((cache.ic_set & ~(1UL << cache.ic_l2set)) != 0) + set = pcpu->pc_cache.ic_size / pcpu->pc_cache.ic_assoc; + if ((set & ~(1UL << (ffs(set) - 1))) != 0) panic("cache_init: I$ set size not a power of 2"); - cache.dc_l2size = ffs(cache.dc_size) - 1; - if ((cache.dc_size & ~(1UL << cache.dc_l2size)) != 0) + if ((pcpu->pc_cache.dc_size & + ~(1UL << (ffs(pcpu->pc_cache.dc_size) - 1))) != 0) panic("cache_init: D$ size not a power of 2"); - if (((cache.dc_size / cache.dc_assoc) / PAGE_SIZE) != DCACHE_COLORS) + if (((pcpu->pc_cache.dc_size / pcpu->pc_cache.dc_assoc) / + PAGE_SIZE) != DCACHE_COLORS) panic("cache_init: too many D$ colors"); - set = cache.ec_size / cache.ec_assoc; - cache.ec_l2set = ffs(set) - 1; - if ((set & ~(1UL << cache.ec_l2set)) != 0) + set = pcpu->pc_cache.ec_size / pcpu->pc_cache.ec_assoc; + if ((set & ~(1UL << (ffs(set) - 1))) != 0) panic("cache_init: E$ set size not a power of 2"); if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { Modified: stable/7/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cheetah.c Wed Mar 18 23:52:20 2009 (r190003) +++ stable/7/sys/sparc64/sparc64/cheetah.c Thu Mar 19 00:02:07 2009 (r190004) @@ -72,7 +72,7 @@ cheetah_dcache_page_inval(vm_paddr_t spa KASSERT((spa & PAGE_MASK) == 0, ("%s: pa not page aligned", __func__)); cookie = ipi_dcache_page_inval(tl_ipi_cheetah_dcache_page_inval, spa); - for (pa = spa; pa < spa + PAGE_SIZE; pa += cache.dc_linesize) + for (pa = spa; pa < spa + PAGE_SIZE; pa += PCPU_GET(cache.dc_linesize)) stxa_sync(pa, ASI_DCACHE_INVALIDATE, 0); ipi_wait(cookie); } Modified: stable/7/sys/sparc64/sparc64/genassym.c ============================================================================== --- stable/7/sys/sparc64/sparc64/genassym.c Wed Mar 18 23:52:20 2009 (r190003) +++ stable/7/sys/sparc64/sparc64/genassym.c Thu Mar 19 00:02:07 2009 (r190004) @@ -188,11 +188,12 @@ ASSYM(PM_TSB_MISS_COUNT, offsetof(struct ASSYM(PM_TSB_CAP_MISS_COUNT, offsetof(struct pmap, pm_tsb_cap_miss_count)); #endif #ifdef SUN4U +ASSYM(PC_CACHE, offsetof(struct pcpu, pc_cache)); ASSYM(PC_MID, offsetof(struct pcpu, pc_mid)); +ASSYM(PC_PMAP, offsetof(struct pcpu, pc_pmap)); ASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx)); ASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max)); ASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min)); -ASSYM(PC_PMAP, offsetof(struct pcpu, pc_pmap)); #endif ASSYM(IR_NEXT, offsetof(struct intr_request, ir_next)); Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Wed Mar 18 23:52:20 2009 (r190003) +++ stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 00:02:07 2009 (r190004) @@ -279,6 +279,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l phandle_t child; phandle_t root; u_int clock; + uint32_t portid; end = 0; kmdp = NULL; @@ -314,12 +315,40 @@ sparc64_init(caddr_t mdp, u_long o1, u_l init_param1(); + /* + * Prime our per-CPU data page for use. Note, we are using it for + * our stack, so don't pass the real size (PAGE_SIZE) to pcpu_init + * or it'll zero it out from under us. + */ + pc = (struct pcpu *)(pcpu0 + (PCPU_PAGES * PAGE_SIZE)) - 1; + pcpu_init(pc, 0, sizeof(struct pcpu)); + pc->pc_addr = (vm_offset_t)pcpu0; + pc->pc_mid = UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)); + pc->pc_tlb_ctx = TLB_CTX_USER_MIN; + pc->pc_tlb_ctx_min = TLB_CTX_USER_MIN; + pc->pc_tlb_ctx_max = TLB_CTX_USER_MAX; + + /* + * Determine the OFW node (and ensure the + * BSP is in the device tree in the first place). + */ + pc->pc_node = 0; root = OF_peer(0); for (child = OF_child(root); child != 0; child = OF_peer(child)) { - OF_getprop(child, "device_type", type, sizeof(type)); - if (strcmp(type, "cpu") == 0) + if (OF_getprop(child, "device_type", type, sizeof(type)) <= 0) + continue; + if (strcmp(type, "cpu") != 0) + continue; + if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ? + "upa-portid" : "portid", &portid, sizeof(portid)) <= 0) + continue; + if (portid == pc->pc_mid) { + pc->pc_node = child; break; + } } + if (pc->pc_node == 0) + OF_exit(); /* * Initialize the tick counter. Must be before the console is inited @@ -353,8 +382,8 @@ sparc64_init(caddr_t mdp, u_long o1, u_l end = (vm_offset_t)_end; } - cache_init(child); - uma_set_align(cache.dc_linesize - 1); + cache_init(pc); + uma_set_align(pc->pc_cache.dc_linesize - 1); cpu_block_copy = bcopy; cpu_block_zero = bzero; @@ -397,7 +426,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l intr_init1(); /* - * Initialize proc0 stuff (p_contested needs to be done early). + * Initialize proc0, set kstack0, frame0, curthread and curpcb. */ proc_linkup0(&proc0, &thread0); proc0.p_md.md_sigtramp = NULL; @@ -407,22 +436,8 @@ sparc64_init(caddr_t mdp, u_long o1, u_l (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; frame0.tf_tstate = TSTATE_IE | TSTATE_PEF | TSTATE_PRIV; thread0.td_frame = &frame0; - - /* - * Prime our per-cpu data page for use. Note, we are using it for our - * stack, so don't pass the real size (PAGE_SIZE) to pcpu_init or - * it'll zero it out from under us. - */ - pc = (struct pcpu *)(pcpu0 + (PCPU_PAGES * PAGE_SIZE)) - 1; - pcpu_init(pc, 0, sizeof(struct pcpu)); pc->pc_curthread = &thread0; pc->pc_curpcb = thread0.td_pcb; - pc->pc_mid = UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)); - pc->pc_addr = (vm_offset_t)pcpu0; - pc->pc_node = child; - pc->pc_tlb_ctx = TLB_CTX_USER_MIN; - pc->pc_tlb_ctx_min = TLB_CTX_USER_MIN; - pc->pc_tlb_ctx_max = TLB_CTX_USER_MAX; /* * Initialize global registers. Modified: stable/7/sys/sparc64/sparc64/mp_exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_exception.S Wed Mar 18 23:52:20 2009 (r190003) +++ stable/7/sys/sparc64/sparc64/mp_exception.S Thu Mar 19 00:02:07 2009 (r190004) @@ -57,9 +57,8 @@ ENTRY(tl_ipi_spitfire_dcache_page_inval) ldx [%g5 + ICA_PA], %g6 srlx %g6, PAGE_SHIFT - DC_TAG_SHIFT, %g6 - SET(cache, %g3, %g2) - lduw [%g2 + DC_SIZE], %g3 - lduw [%g2 + DC_LINESIZE], %g4 + lduw [PCPU(CACHE) + DC_SIZE], %g3 + lduw [PCPU(CACHE) + DC_LINESIZE], %g4 sub %g3, %g4, %g2 1: ldxa [%g2] ASI_DCACHE_TAG, %g1 @@ -98,9 +97,8 @@ ENTRY(tl_ipi_spitfire_icache_page_inval) ldx [%g5 + ICA_PA], %g6 srlx %g6, PAGE_SHIFT - IC_TAG_SHIFT, %g6 - SET(cache, %g3, %g2) - lduw [%g2 + IC_SIZE], %g3 - lduw [%g2 + IC_LINESIZE], %g4 + lduw [PCPU(CACHE) + IC_SIZE], %g3 + lduw [PCPU(CACHE) + IC_LINESIZE], %g4 sub %g3, %g4, %g2 1: ldda [%g2] ASI_ICACHE_TAG, %g0 /*, %g1 */ @@ -140,8 +138,7 @@ ENTRY(tl_ipi_cheetah_dcache_page_inval) set PAGE_SIZE, %g2 add %g1, %g2, %g3 - SET(cache, %g4, %g2) - lduw [%g2 + DC_LINESIZE], %g2 + lduw [PCPU(CACHE) + DC_LINESIZE], %g2 1: stxa %g0, [%g1] ASI_DCACHE_INVALIDATE membar #Sync Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Wed Mar 18 23:52:20 2009 (r190003) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Thu Mar 19 00:02:07 2009 (r190004) @@ -294,6 +294,8 @@ cpu_mp_start(void) pc->pc_mid = mid; pc->pc_node = child; + cache_init(pc); + all_cpus |= 1 << cpuid; intr_add_cpu(cpuid); } Modified: stable/7/sys/sparc64/sparc64/spitfire.c ============================================================================== --- stable/7/sys/sparc64/sparc64/spitfire.c Wed Mar 18 23:52:20 2009 (r190003) +++ stable/7/sys/sparc64/sparc64/spitfire.c Thu Mar 19 00:02:07 2009 (r190004) @@ -72,9 +72,11 @@ spitfire_cache_flush(void) { u_long addr; - for (addr = 0; addr < cache.dc_size; addr += cache.dc_linesize) + for (addr = 0; addr < PCPU_GET(cache.dc_size); + addr += PCPU_GET(cache.dc_linesize)) stxa_sync(addr, ASI_DCACHE_TAG, 0); - for (addr = 0; addr < cache.ic_size; addr += cache.ic_linesize) + for (addr = 0; addr < PCPU_GET(cache.ic_size); + addr += PCPU_GET(cache.ic_linesize)) stxa_sync(addr, ASI_ICACHE_TAG, 0); } @@ -93,7 +95,8 @@ spitfire_dcache_page_inval(vm_paddr_t pa PMAP_STATS_INC(spitfire_dcache_npage_inval); target = pa >> (PAGE_SHIFT - DC_TAG_SHIFT); cookie = ipi_dcache_page_inval(tl_ipi_spitfire_dcache_page_inval, pa); - for (addr = 0; addr < cache.dc_size; addr += cache.dc_linesize) { + for (addr = 0; addr < PCPU_GET(cache.dc_size); + addr += PCPU_GET(cache.dc_linesize)) { tag = ldxa(addr, ASI_DCACHE_TAG); if (((tag >> DC_VALID_SHIFT) & DC_VALID_MASK) == 0) continue; @@ -121,7 +124,8 @@ spitfire_icache_page_inval(vm_paddr_t pa PMAP_STATS_INC(spitfire_icache_npage_inval); target = pa >> (PAGE_SHIFT - IC_TAG_SHIFT); cookie = ipi_icache_page_inval(tl_ipi_spitfire_icache_page_inval, pa); - for (addr = 0; addr < cache.ic_size; addr += cache.ic_linesize) { + for (addr = 0; addr < PCPU_GET(cache.ic_size); + addr += PCPU_GET(cache.ic_linesize)) { __asm __volatile("ldda [%1] %2, %%g0" /*, %g1 */ : "=r" (tag) : "r" (addr), "n" (ASI_ICACHE_TAG)); if (((tag >> IC_VALID_SHIFT) & IC_VALID_MASK) == 0) From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 00:04:31 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 35458106564A; Thu, 19 Mar 2009 00:04:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06ADF8FC16; Thu, 19 Mar 2009 00:04:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J04UcC042126; Thu, 19 Mar 2009 00:04:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J04Ukt042125; Thu, 19 Mar 2009 00:04:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903190004.n2J04Ukt042125@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 00:04:30 +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: r190005 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sun4v/sun4v 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, 19 Mar 2009 00:04:32 -0000 Author: marius Date: Thu Mar 19 00:04:30 2009 New Revision: 190005 URL: http://svn.freebsd.org/changeset/base/190005 Log: MFC: r182691 Resurrect clock.c from r164371. Added: stable/7/sys/sun4v/sun4v/clock.c - copied unchanged from r182691, head/sys/sun4v/sun4v/clock.c Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Copied: stable/7/sys/sun4v/sun4v/clock.c (from r182691, head/sys/sun4v/sun4v/clock.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sun4v/sun4v/clock.c Thu Mar 19 00:04:30 2009 (r190005, copy of r182691, head/sys/sun4v/sun4v/clock.c) @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 2001 Jake Burkholder. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +u_long tick_increment; +u_long tick_freq; +u_long tick_MHz; + +void +DELAY(int n) +{ + u_long start, end; + + start = rd(tick); + if (n < 0) + return; + end = start + (u_long)n * tick_MHz; + while (rd(tick) < end) + ; +} + +void +cpu_startprofclock(void) +{ +} + +void +cpu_stopprofclock(void) +{ +} + +int +sysbeep(int pitch, int period) +{ + /* + * XXX: function exists to enable RAID drivers to compile at the moment. + */ + return (0); +} From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 00:28: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 D3AB5106566C; Thu, 19 Mar 2009 00:28:54 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C15288FC15; Thu, 19 Mar 2009 00:28:54 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J0SsWc042657; Thu, 19 Mar 2009 00:28:54 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J0SsTa042656; Thu, 19 Mar 2009 00:28:54 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903190028.n2J0SsTa042656@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Mar 2009 00:28: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: r190006 - in stable/7/usr.sbin: . makefs 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, 19 Mar 2009 00:28:55 -0000 Author: sam Date: Thu Mar 19 00:28:54 2009 New Revision: 190006 URL: http://svn.freebsd.org/changeset/base/190006 Log: MFC makefs: a tool for creating a file system image from a directory tree Added: stable/7/usr.sbin/makefs/ (props changed) - copied from r189999, head/usr.sbin/makefs/ Modified: stable/7/usr.sbin/Makefile Modified: stable/7/usr.sbin/Makefile ============================================================================== --- stable/7/usr.sbin/Makefile Thu Mar 19 00:04:30 2009 (r190005) +++ stable/7/usr.sbin/Makefile Thu Mar 19 00:28:54 2009 (r190006) @@ -86,6 +86,7 @@ SUBDIR= ${_ac} \ ${_lptcontrol} \ ${_mailstats} \ mailwrapper \ + makefs \ ${_makemap} \ manctl \ memcontrol \ From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 00:52:30 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 ED7E6106564A; Thu, 19 Mar 2009 00:52:30 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFB818FC19; Thu, 19 Mar 2009 00:52:30 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J0qUTA043251; Thu, 19 Mar 2009 00:52:30 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J0qUSj043249; Thu, 19 Mar 2009 00:52:30 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903190052.n2J0qUSj043249@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 19 Mar 2009 00:52:30 +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: r190008 - in stable/7/sys: . contrib/pf dev/cxgb dev/sis 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, 19 Mar 2009 00:52:31 -0000 Author: yongari Date: Thu Mar 19 00:52:30 2009 New Revision: 190008 URL: http://svn.freebsd.org/changeset/base/190008 Log: MFC r185784: Fix a long standing VLAN tagged frame handling bug. When VLAN tagged frame is received the hardware sets 'LONG' bit of Rx status word. It is always set when the size of received frame exceeded 1518 bytes, including CRC. This VLAN tagged frame clears 'OK' bit of Rx status word such that driver should not rely on 'OK' bit of Rx status word to pass the VLAN tagged frame to upper stack. To fix the bug, don't use SIS_CMDSTS_PKT_OK for Rx error check and introduce SIS_RXSTAT_ERROR macro that checks Rx errors. If we are configured to accept VLAN tagged frames and the received frame size is less than or equal to maximum allowed length of VLAN tagged frame, clear 'LONG' bit of Rx status word before checking Rx errors. Reported by: Vladimir Ermako < samflanker <> gmail DOT com > Tested by: Vladimir Ermako < samflanker <> gmail DOT com > Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sis/if_sis.c stable/7/sys/dev/sis/if_sisreg.h Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Thu Mar 19 00:44:22 2009 (r190007) +++ stable/7/sys/dev/sis/if_sis.c Thu Mar 19 00:52:30 2009 (r190008) @@ -1431,7 +1431,11 @@ sis_rxeof(struct sis_softc *sc) * it should simply get re-used next time this descriptor * comes up in the ring. */ - if (!(rxstat & SIS_CMDSTS_PKT_OK)) { + if ((ifp->if_capenable & IFCAP_VLAN_MTU) != 0 && + total_len <= (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN - + ETHER_CRC_LEN)) + rxstat &= ~SIS_RXSTAT_GIANT; + if (SIS_RXSTAT_ERROR(rxstat) != 0) { ifp->if_ierrors++; if (rxstat & SIS_RXSTAT_COLL) ifp->if_collisions++; Modified: stable/7/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/7/sys/dev/sis/if_sisreg.h Thu Mar 19 00:44:22 2009 (r190007) +++ stable/7/sys/dev/sis/if_sisreg.h Thu Mar 19 00:52:30 2009 (r190008) @@ -348,6 +348,11 @@ struct sis_desc { #define SIS_RXSTAT_OVERRUN 0x02000000 #define SIS_RXSTAT_RX_ABORT 0x04000000 +#define SIS_RXSTAT_ERROR(x) \ + ((x) & (SIS_RXSTAT_RX_ABORT | SIS_RXSTAT_OVERRUN | \ + SIS_RXSTAT_GIANT | SIS_RXSTAT_SYMBOLERR | SIS_RXSTAT_RUNT | \ + SIS_RXSTAT_CRCERR | SIS_RXSTAT_ALIGNERR)) + #define SIS_DSTCLASS_REJECT 0x00000000 #define SIS_DSTCLASS_UNICAST 0x00800000 #define SIS_DSTCLASS_MULTICAST 0x01000000 From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 00:55:27 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 700F71065675; Thu, 19 Mar 2009 00:55:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C80C8FC1E; Thu, 19 Mar 2009 00:55:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J0tRL9043361; Thu, 19 Mar 2009 00:55:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J0tRqc043360; Thu, 19 Mar 2009 00:55:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903190055.n2J0tRqc043360@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 19 Mar 2009 00:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190009 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sis 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, 19 Mar 2009 00:55:28 -0000 Author: yongari Date: Thu Mar 19 00:55:27 2009 New Revision: 190009 URL: http://svn.freebsd.org/changeset/base/190009 Log: MFC r188550: Receving VLAN oversized frames raise SIS_ISR_RX_ERR interrupt, so make sis_rxeof() handle that too. Previously it used to receive the frame and reset controller. PR: kern/131414 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sis/if_sis.c Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Thu Mar 19 00:52:30 2009 (r190008) +++ stable/7/sys/dev/sis/if_sis.c Thu Mar 19 00:55:27 2009 (r190009) @@ -1662,10 +1662,11 @@ sis_intr(void *arg) SIS_ISR_TX_OK | SIS_ISR_TX_IDLE) ) sis_txeof(sc); - if (status & (SIS_ISR_RX_DESC_OK|SIS_ISR_RX_OK|SIS_ISR_RX_IDLE)) + if (status & (SIS_ISR_RX_DESC_OK | SIS_ISR_RX_OK | + SIS_ISR_RX_ERR | SIS_ISR_RX_IDLE)) sis_rxeof(sc); - if (status & (SIS_ISR_RX_ERR | SIS_ISR_RX_OFLOW)) + if (status & SIS_ISR_RX_OFLOW) sis_rxeoc(sc); if (status & (SIS_ISR_RX_IDLE)) From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 01:07: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 507B31065672; Thu, 19 Mar 2009 01:07:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39DF08FC18; Thu, 19 Mar 2009 01:07:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J17LGl043612; Thu, 19 Mar 2009 01:07:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J17LhO043610; Thu, 19 Mar 2009 01:07:21 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903190107.n2J17LhO043610@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 19 Mar 2009 01:07: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: r190010 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/txp 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, 19 Mar 2009 01:07:23 -0000 Author: yongari Date: Thu Mar 19 01:07:21 2009 New Revision: 190010 URL: http://svn.freebsd.org/changeset/base/190010 Log: MFC r189022: Update to latest 3Com firmware image. The latest fimware is required to make 3CR990 familiy controllers run on NV flash firmware version 03.001.008. The latest firmware added HMAC digest information so teach txp(4) to pass them to sleep image before downloading is started. While I'm here restore previous IMR/IER register if firmware downloading have failed. PR: kern/89876, kern/132047 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/txp/3c990img.h stable/7/sys/dev/txp/if_txp.c stable/7/sys/dev/txp/if_txpreg.h Modified: stable/7/sys/dev/txp/3c990img.h ============================================================================== --- stable/7/sys/dev/txp/3c990img.h Thu Mar 19 00:55:27 2009 (r190009) +++ stable/7/sys/dev/txp/3c990img.h Thu Mar 19 01:07:21 2009 (r190010) @@ -1,22 +1,17 @@ -/* $OpenBSD: 3c990img.h,v 1.2 2001/06/05 02:15:17 jason Exp $ */ -/* $FreeBSD$ */ +/* $FreeBSD$ */ /*- - * Copyright (C) 1999-2001 3Com, Inc. - * All rights reserved. + * Copyright 1999-2003 3Com Corporation. All Rights Reserved. * - * Redistribution and use in source and binary forms of the 3CR990 microcode - * are permitted provided - * that the following conditions are met: + * Redistribution and use in source and binary forms of the 3c990img.h + * microcode software are permitted provided that the following conditions + * are met: * 1. Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes 3CR990 microcode - * 4. The name of 3Com may not be used to endorse or promote products + * 3. The name of 3Com may not be used to endorse or promote products * derived from this software without specific prior written permission * * THIS SOFTWARE IS PROVIDED BY 3COM ``AS IS'' AND ANY EXPRESS OR @@ -30,735 +25,458 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * USER ACKNOWLEDGES AND AGREES THAT PURCHASE OR USE OF THE 3CR990 microcode - * SOFTWARE WILL NOT CREATE OR GIVE GROUNDS FOR A LICENSE BY IMPLICATION, - * ESTOPPEL, OR OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT, - * TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN ANY OTHER - * 3COM HARDWARE OR SOFTWARE EITHER SOLELY OR IN COMBINATION WITH THE 3CR990 - * microcode SOFTWARE - */ + * USER ACKNOWLEDGES AND AGREES THAT PURCHASE OR USE OF THE 3c990img.h + * MICROCODE SOFTWARE WILL NOT CREATE OR GIVE GROUNDS FOR A LICENSE BY + * IMPLICATION, ESTOPPEL, OR OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS + * (PATENT, COPYRIGHT, TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) + * EMBODIED IN ANY OTHER 3COM HARDWARE OR SOFTWARE EITHER SOLELY OR IN + * COMBINATION WITH THE 3c990img.h MICROCODE SOFTWARE + */ unsigned char tc990image[] = { 0x54, 0x59, 0x50, 0x48, 0x4f, 0x4f, 0x4e, 0x00, 0x02, 0x00, 0x00, 0x00, -0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0x01, 0x00, 0x00, -0xd6, 0xbb, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x39, 0x00, 0x00, 0xea, -0x05, 0x00, 0x00, 0xea, 0x04, 0x00, 0x00, 0xea, 0x03, 0x00, 0x00, 0xea, -0x02, 0x00, 0x00, 0xea, 0x01, 0x00, 0x00, 0xea, 0x4a, 0x05, 0x00, 0xea, -0xb4, 0x1d, 0x00, 0xea, 0x07, 0x00, 0x2d, 0xe9, 0x0e, 0x00, 0xa0, 0xe1, -0x00, 0x10, 0x0f, 0xe1, 0xd0, 0x20, 0x9f, 0xe5, 0x12, 0xff, 0x2f, 0xe1, -0xfe, 0xff, 0xff, 0xea, 0x01, 0x00, 0x80, 0xe0, 0x04, 0x20, 0x81, 0xe4, -0x01, 0x00, 0x50, 0xe1, 0xfc, 0xff, 0xff, 0x1a, 0x0e, 0xf0, 0xa0, 0xe1, -0x00, 0xa0, 0xa0, 0xe1, 0x0e, 0xb0, 0xa0, 0xe1, 0x00, 0x00, 0xa0, 0xe3, -0xa8, 0x10, 0x9f, 0xe5, 0x00, 0x00, 0x81, 0xe5, 0xa4, 0x10, 0x9f, 0xe5, -0x00, 0x00, 0x81, 0xe5, 0x01, 0x16, 0xa0, 0xe3, 0x00, 0x00, 0x91, 0xe5, -0x01, 0x00, 0x80, 0xe3, 0x00, 0x00, 0x81, 0xe5, 0xd7, 0x00, 0xa0, 0xe3, -0x00, 0xf0, 0x21, 0xe1, 0x88, 0xd0, 0x9f, 0xe5, 0xdb, 0x00, 0xa0, 0xe3, -0x00, 0xf0, 0x21, 0xe1, 0x7c, 0xd0, 0x9f, 0xe5, 0xd2, 0x00, 0xa0, 0xe3, -0x00, 0xf0, 0x21, 0xe1, 0x74, 0xd0, 0x9f, 0xe5, 0xd1, 0x00, 0xa0, 0xe3, -0x00, 0xf0, 0x21, 0xe1, 0x6c, 0xd0, 0x9f, 0xe5, 0x8a, 0x1d, 0x00, 0xeb, -0xd3, 0x00, 0xa0, 0xe3, 0x00, 0xf0, 0x21, 0xe1, 0x60, 0xd0, 0x9f, 0xe5, -0x60, 0x00, 0x9f, 0xe5, 0x60, 0x10, 0x9f, 0xe5, 0x60, 0x20, 0x9f, 0xe5, -0xdb, 0xff, 0xff, 0xeb, 0x5c, 0x00, 0x9f, 0xe5, 0x5c, 0x10, 0x9f, 0xe5, -0x00, 0x20, 0xa0, 0xe3, 0xd7, 0xff, 0xff, 0xeb, 0x54, 0x00, 0x9f, 0xe5, -0x54, 0x10, 0x9f, 0xe5, 0xd4, 0xff, 0xff, 0xeb, 0x0a, 0x00, 0xa0, 0xe1, -0x0b, 0xf0, 0xa0, 0xe1, 0xd3, 0x10, 0xa0, 0xe3, 0x01, 0xf0, 0x21, 0xe1, -0xd4, 0xff, 0xff, 0xeb, 0x3c, 0xa0, 0x9f, 0xe5, 0x1a, 0xff, 0x2f, 0xe1, -0xc6, 0xff, 0xff, 0xea, 0x01, 0x2e, 0xff, 0xff, 0x0c, 0x00, 0x10, 0x00, -0x1c, 0x00, 0x10, 0x00, 0x3c, 0x38, 0x00, 0x80, 0xfc, 0x37, 0x00, 0x80, -0xfc, 0x3f, 0x00, 0x80, 0xfc, 0x33, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, -0x00, 0x30, 0x00, 0x80, 0xad, 0xde, 0xad, 0xde, 0xc8, 0xc2, 0x00, 0x00, -0x20, 0xab, 0x20, 0x40, 0x5c, 0x2b, 0x00, 0x00, 0x9c, 0x04, 0x00, 0x80, -0xd1, 0xd1, 0x21, 0x40, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x40, 0x7b, 0x00, 0x00, 0x4d, 0x42, 0x00, 0x00, -0x60, 0x01, 0xff, 0xff, 0xb0, 0xb5, 0x07, 0x1c, 0x12, 0x4c, 0x00, 0x25, -0x60, 0x6b, 0x00, 0x28, 0x1d, 0xd0, 0x38, 0x1c, 0x10, 0x49, 0x06, 0xf0, -0x55, 0xff, 0x61, 0x6b, 0xc0, 0x46, 0x08, 0x60, 0x00, 0x28, 0x14, 0xd0, -0x38, 0x01, 0x0d, 0x49, 0x40, 0x18, 0x19, 0x23, 0xdb, 0x01, 0xc0, 0x18, -0x41, 0x6b, 0x80, 0x29, 0x0b, 0xd2, 0x01, 0x31, 0x41, 0x63, 0x60, 0x6b, -0xc1, 0x69, 0xc0, 0x46, 0x61, 0x63, 0x39, 0x07, 0x41, 0x60, 0xc7, 0x62, -0xb0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x28, 0x1c, 0xfa, 0xe7, 0x00, 0x00, -0x38, 0x17, 0x00, 0x80, 0xee, 0x05, 0x00, 0x00, 0x58, 0x1d, 0x00, 0x80, -0x02, 0x49, 0x4a, 0x6b, 0xc0, 0x46, 0xc2, 0x61, 0x48, 0x63, 0x70, 0x47, -0x38, 0x17, 0x00, 0x80, 0x00, 0x20, 0x02, 0x49, 0xc0, 0x46, 0x48, 0x61, -0x70, 0x47, 0x00, 0x00, 0x9c, 0x04, 0x00, 0x80, -0x00, 0xb5, 0x00, 0x20, 0x04, 0x49, 0xc0, 0x46, 0x48, 0x61, 0x04, 0x48, -0x04, 0x49, 0x09, 0x68, 0x07, 0xf0, 0xa3, 0xf9, 0x08, 0xbc, 0x18, 0x47, -0x9c, 0x04, 0x00, 0x80, 0xdd, 0x01, 0xff, 0xff, 0x74, 0x76, 0x21, 0x40, -0xf0, 0xb5, 0x04, 0x1c, 0x41, 0x4e, 0x00, 0x25, 0x70, 0x69, 0x00, 0x28, -0x03, 0xd1, 0xff, 0xf7, 0xa7, 0xff, 0x07, 0x1c, 0x03, 0xd1, 0x28, 0x1c, -0xf0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x3c, 0x21, 0x00, 0x20, 0x79, 0x60, -0xbd, 0x60, 0x06, 0xf0, 0x2f, 0xff, 0x00, 0x20, 0x79, 0x68, 0x00, 0x29, -0x06, 0xd9, 0x39, 0x68, 0xc0, 0x46, 0x0d, 0x54, 0x79, 0x68, 0x01, 0x30, -0x81, 0x42, 0xf8, 0xd8, 0x39, 0x68, 0x00, 0x20, 0xff, 0x23, 0x0a, 0x18, -0x13, 0x70, 0x43, 0x08, 0x05, 0xd3, 0x43, 0x08, 0x5b, 0x00, 0x1b, 0x19, -0x1b, 0x89, 0x1b, 0x0a, 0x05, 0xe0, 0x43, 0x08, 0x5b, 0x00, 0x1b, 0x19, -0x1b, 0x89, 0x1b, 0x06, 0x1b, 0x0e, 0x93, 0x71, 0x01, 0x30, 0x06, 0x28, -0xea, 0xd3, 0xc1, 0x20, 0xc0, 0x00, 0x08, 0x73, 0x03, 0x0a, 0x4b, 0x73, -0x38, 0x68, 0xff, 0x21, 0x01, 0x31, 0x81, 0x73, 0x0b, 0x0a, 0xc3, 0x73, -0x08, 0x22, 0x02, 0x74, 0x13, 0x0a, 0x43, 0x74, 0x06, 0x22, 0x82, 0x74, -0x04, 0x22, 0xc2, 0x74, 0x01, 0x75, 0x0b, 0x0a, 0x43, 0x75, 0x0e, 0x30, -0x00, 0x21, 0x4a, 0x00, 0x13, 0x19, 0x1d, 0x89, 0x16, 0x18, 0x35, 0x72, -0x2b, 0x0a, 0x73, 0x72, 0x00, 0x25, 0x17, 0x4e, 0x92, 0x19, 0xd5, 0x81, -0x01, 0x31, 0x03, 0x29, 0xf1, 0xd3, 0x21, 0x68, 0xc0, 0x46, 0x81, 0x73, -0x0b, 0x0a, 0xc3, 0x73, 0x0b, 0x0c, 0x03, 0x74, 0x0b, 0x0e, 0x43, 0x74, -0x31, 0x60, 0x61, 0x68, 0xc0, 0x46, 0x01, 0x76, 0x0b, 0x0a, 0x43, 0x76, -0x0b, 0x0c, 0x83, 0x76, 0x0b, 0x0e, 0xc3, 0x76, 0x71, 0x60, 0x60, 0x69, -0xc0, 0x46, 0x70, 0x61, 0xa0, 0x69, 0xc0, 0x46, 0xb0, 0x61, 0x38, 0x1c, -0x06, 0xf0, 0x3a, 0xff, 0x38, 0x1c, 0xff, 0xf7, 0x61, 0xff, 0x05, 0x48, -0x05, 0x49, 0x0b, 0x68, 0x05, 0x4a, 0x00, 0x21, 0x07, 0xf0, 0x19, 0xf9, -0x01, 0x20, 0x85, 0xe7, 0x9c, 0x04, 0x00, 0x80, 0xdd, 0x01, 0xff, 0xff, -0x70, 0x76, 0x21, 0x40, 0x98, 0x3a, 0x00, 0x00, 0x90, 0xb5, 0x1d, 0x4f, -0x79, 0x69, 0x00, 0x29, 0x32, 0xd0, 0x80, 0x6a, 0x01, 0x7b, 0x43, 0x7b, -0x1b, 0x02, 0x19, 0x43, 0xc1, 0x23, 0xdb, 0x00, 0x99, 0x42, 0x29, 0xd1, -0x01, 0x7d, 0x43, 0x7d, 0x1b, 0x02, 0x19, 0x43, 0x01, 0x23, 0x5b, 0x02, -0x0e, 0x30, 0x99, 0x42, 0x20, 0xd1, 0xc3, 0x1d, 0x07, 0x33, 0x14, 0xcb, -0x9b, 0x07, 0xdb, 0x0e, 0xda, 0x40, 0x5b, 0x42, 0x20, 0x33, 0x9c, 0x40, -0x14, 0x43, 0x79, 0x68, 0xa1, 0x42, 0x13, 0xd1, 0x00, 0x21, 0x4a, 0x00, -0x13, 0x18, 0x1c, 0x7a, 0x5b, 0x7a, 0x1b, 0x02, 0x1c, 0x43, 0xd2, 0x19, -0xd4, 0x81, 0x01, 0x31, 0x09, 0x06, 0x09, 0x0e, 0x03, 0x29, 0xf2, 0xdb, -0x79, 0x69, 0x38, 0x1c, 0x07, 0xf0, 0xd7, 0xf8, 0x00, 0x20, 0x78, 0x61, -0x90, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, 0x9c, 0x04, 0x00, 0x80, -0xf0, 0xb5, 0x07, 0x1c, 0x01, 0x25, 0x20, 0x48, 0x01, 0x22, 0x00, 0x21, -0x03, 0x68, 0x08, 0x20, 0x07, 0xf0, 0xc7, 0xf8, 0x04, 0x1c, 0xff, 0x2c, -0x03, 0xd1, 0x00, 0x20, 0xf0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x20, 0x1c, -0x19, 0x4e, 0x00, 0x22, 0x11, 0x21, 0x33, 0x68, 0x07, 0xf0, 0xb9, 0xf8, -0xff, 0x23, 0x45, 0x33, 0x98, 0x42, 0x1e, 0xd1, 0x20, 0x1c, 0x39, 0x1c, -0x14, 0x4a, 0x13, 0x68, 0xff, 0x22, 0x45, 0x32, -0x07, 0xf0, 0xad, 0xf8, 0xff, 0x23, 0x45, 0x33, 0x98, 0x42, 0x12, 0xd1, -0x00, 0x22, 0x13, 0x21, 0x33, 0x68, 0x20, 0x1c, 0x07, 0xf0, 0xa3, 0xf8, -0x06, 0x06, 0x36, 0x0e, 0x00, 0x20, 0x78, 0x71, 0x38, 0x1c, 0x0b, 0x49, -0x0a, 0x68, 0xff, 0x21, 0x45, 0x31, 0x07, 0xf0, 0x97, 0xf8, 0xb0, 0x42, -0x00, 0xd0, 0x00, 0x25, 0x20, 0x1c, 0x07, 0x49, 0x09, 0x68, 0x07, 0xf0, -0x8e, 0xf8, 0x28, 0x1c, 0xca, 0xe7, 0x00, 0x00, 0x74, 0x6e, 0x21, 0x40, -0x8c, 0x6e, 0x21, 0x40, 0x80, 0x6e, 0x21, 0x40, 0x94, 0x6e, 0x21, 0x40, -0x88, 0x6e, 0x21, 0x40, 0xf0, 0xb5, 0xff, 0x21, 0x45, 0x31, 0x00, 0x20, -0x51, 0x4f, 0x00, 0x26, 0x3a, 0x18, 0xe1, 0x23, 0x1b, 0x01, 0xd2, 0x18, -0x16, 0x73, 0x01, 0x30, 0x88, 0x42, 0xf7, 0xd3, 0x4d, 0x4b, 0xf8, 0x18, -0xff, 0xf7, 0xa0, 0xff, 0x01, 0x25, 0x2d, 0x05, 0x00, 0x28, 0x0e, 0xd0, -0xe1, 0x23, 0x1b, 0x01, 0xf8, 0x18, 0x01, 0x7b, 0x41, 0x29, 0x16, 0xd0, -0x41, 0x7b, 0x53, 0x29, 0x13, 0xd0, 0x81, 0x7b, 0x46, 0x29, 0x10, 0xd0, -0xc0, 0x7b, 0x00, 0x28, 0x0d, 0xd0, 0x01, 0x23, 0x1b, 0x03, 0xb8, 0x69, -0x98, 0x43, 0xb8, 0x61, 0xe8, 0x61, 0x5b, 0x00, 0xb8, 0x69, 0x98, 0x43, -0xb8, 0x61, 0xe8, 0x61, 0xf0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x3c, 0x49, -0x39, 0x23, 0x9b, 0x01, 0xf8, 0x18, 0x0a, 0x68, 0xc0, 0x46, 0xc2, 0x80, -0x4a, 0x68, 0xc0, 0x46, 0x02, 0x81, 0x89, 0x68, 0xc0, 0x46, 0x41, 0x81, -0x3c, 0x1c, 0x00, 0x21, 0x37, 0x1c, 0x4a, 0x00, 0x12, 0x19, 0x39, 0x23, -0x9b, 0x01, 0xd2, 0x18, 0x17, 0x80, 0x01, 0x31, 0x09, 0x06, 0x09, 0x0e, -0x03, 0x29, 0xf4, 0xdb, 0x07, 0x73, 0x2f, 0x48, 0x2f, 0x49, 0x0b, 0x68, -0x2f, 0x4a, 0x00, 0x21, 0x07, 0xf0, 0x2d, 0xf8, 0xe9, 0x23, 0x1b, 0x01, -0xe0, 0x18, 0x07, 0x73, 0x42, 0x89, 0x19, 0x21, 0x49, 0x01, 0x8a, 0x42, -0x00, 0xda, 0x41, 0x81, 0x00, 0x21, 0x82, 0x7b, 0x00, 0x2a, 0x0c, 0xdd, -0x16, 0x22, 0x4a, 0x43, 0x12, 0x19, 0x75, 0x23, 0x5b, 0x01, 0xd2, 0x18, -0xd7, 0x70, 0x01, 0x31, 0x09, 0x06, 0x09, 0x0e, 0x82, 0x7b, 0x8a, 0x42, -0xf2, 0xdc, 0xef, 0x23, 0x1b, 0x01, 0xe0, 0x18, 0xc7, 0x71, 0x39, 0x1c, -0x00, 0x20, 0x42, 0x00, 0x12, 0x19, 0xef, 0x23, 0x1b, 0x01, 0xd2, 0x18, -0x11, 0x72, 0x51, 0x72, 0x01, 0x30, 0x00, 0x06, 0x00, 0x0e, 0x04, 0x28, -0xf3, 0xdb, 0x79, 0x23, 0x5b, 0x01, 0xe0, 0x18, 0x01, 0x72, 0x3d, 0x23, -0x9b, 0x01, 0xe0, 0x18, 0x81, 0x60, 0x14, 0x48, 0x14, 0x49, 0xc0, 0x46, -0x08, 0x60, 0x01, 0x23, 0x1b, 0x03, 0xa0, 0x69, 0x18, 0x43, 0xa0, 0x61, -0xe1, 0x69, 0x99, 0x43, 0xe1, 0x61, 0xe8, 0x61, 0xe0, 0x69, 0xc0, 0x46, -0x28, 0x62, 0x5b, 0x00, 0xa0, 0x69, 0x98, 0x43, 0xa0, 0x61, 0xe8, 0x61, -0x03, 0xf0, 0xee, 0xff, 0x0a, 0x48, 0x0b, 0x49, 0xc0, 0x46, 0x08, 0x60, -0x88, 0xe7, 0x00, 0x00, 0xf8, 0x0d, 0x00, 0x80, 0x1c, 0x0e, 0x00, 0x00, -0x40, 0x00, 0x14, 0x40, 0x39, 0x06, 0xff, 0xff, 0x70, 0x76, 0x21, 0x40, -0x80, 0x4f, 0x12, 0x00, 0x08, 0x6e, 0x21, 0x40, 0x88, 0x70, 0x21, 0x40, -0x7d, 0x0c, 0xff, 0xff, 0x78, 0x70, 0x21, 0x40, 0xb0, 0xb5, 0x00, 0x20, -0x1c, 0x4f, 0xef, 0x23, 0x1b, 0x01, 0xfc, 0x18, 0xe1, 0x79, 0x00, 0x29, -0x0c, 0xdd, 0x00, 0x21, 0x42, 0x00, 0xd2, 0x19, 0xef, 0x23, 0x1b, 0x01, -0xd2, 0x18, 0x51, 0x72, 0x01, 0x30, 0x00, 0x06, 0x00, 0x0e, 0xe2, 0x79, -0x82, 0x42, 0xf3, 0xdc, 0x39, 0x23, 0x9b, 0x01, -0xf8, 0x18, 0xc2, 0x6a, 0x11, 0x4d, 0x00, 0x2a, 0x04, 0xd0, 0x11, 0x48, -0x00, 0x21, 0x2b, 0x68, 0x06, 0xf0, 0xa5, 0xff, 0x00, 0xf0, 0x2a, 0xf8, -0x0e, 0x48, 0x05, 0x22, 0x00, 0x21, 0x2b, 0x68, 0x06, 0xf0, 0x9d, 0xff, -0xe0, 0x79, 0x00, 0x28, 0x05, 0xd1, 0xe9, 0x23, 0x1b, 0x01, 0xf8, 0x18, -0x80, 0x7b, 0x00, 0x28, 0x04, 0xd0, 0x08, 0x48, 0x7d, 0x21, 0x09, 0x01, -0x00, 0xf0, 0x71, 0xf8, 0xb0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, -0xf8, 0x0d, 0x00, 0x80, 0x70, 0x76, 0x21, 0x40, 0xb5, 0x07, 0xff, 0xff, -0x6d, 0x07, 0xff, 0xff, 0xd1, 0x07, 0xff, 0xff, 0x00, 0x20, 0x02, 0x49, -0xc0, 0x46, 0x08, 0x73, 0x70, 0x47, 0x00, 0x00, 0x38, 0x1c, 0x00, 0x80, -0x80, 0xb4, 0x00, 0x21, 0x09, 0x48, 0xc0, 0x46, 0x01, 0x60, 0x00, 0x20, -0x08, 0x4a, 0x43, 0x00, 0x1b, 0x18, 0x9b, 0x00, 0x9f, 0x18, 0xb9, 0x60, -0xd1, 0x50, 0x79, 0x60, 0x01, 0x30, 0x00, 0x06, 0x00, 0x0e, 0x05, 0x28, -0xf3, 0xdb, 0x80, 0xbc, 0x70, 0x47, 0x00, 0x00, 0x04, 0x6e, 0x21, 0x40, -0x40, 0xab, 0x20, 0x40, 0xb0, 0xb4, 0x00, 0x29, 0x03, 0xd0, 0x07, 0x68, -0x00, 0x2f, 0x02, 0xd1, 0x01, 0x60, 0xb0, 0xbc, 0x70, 0x47, 0x3a, 0x1c, -0x53, 0x68, 0x4c, 0x68, 0xa3, 0x42, 0x08, 0xd8, 0x13, 0x1c, 0x12, 0x68, -0x00, 0x2a, 0x02, 0xd0, 0x55, 0x68, 0xa5, 0x42, 0xf8, 0xd9, 0x00, 0x2b, -0x03, 0xd1, 0x3a, 0x68, 0xc0, 0x46, 0x0a, 0x60, 0xea, 0xe7, 0x18, 0x68, -0xc0, 0x46, 0x08, 0x60, 0x19, 0x60, 0xe6, 0xe7, 0x90, 0xb4, 0x00, 0x29, -0x15, 0xd0, 0x02, 0x68, 0x17, 0x1c, 0x8a, 0x42, 0x08, 0xd0, 0x13, 0x1c, -0x14, 0x68, 0x00, 0x2c, 0x02, 0xd0, 0x22, 0x1c, 0x8a, 0x42, 0xf8, 0xd1, -0x00, 0x2b, 0x03, 0xd1, 0x3a, 0x68, 0xc0, 0x46, 0x02, 0x60, 0x02, 0xe0, -0x10, 0x68, 0xc0, 0x46, 0x18, 0x60, 0x00, 0x20, 0x08, 0x60, 0x90, 0xbc, -0x70, 0x47, 0x00, 0xb5, 0x01, 0x68, 0xff, 0xf7, 0xe1, 0xff, 0x08, 0xbc, -0x18, 0x47, 0x90, 0xb5, 0x00, 0x22, 0x11, 0x4c, 0x53, 0x00, 0x9b, 0x18, -0x9b, 0x00, 0x1b, 0x19, 0x9b, 0x68, 0x00, 0x2b, 0x04, 0xd1, 0x53, 0x00, -0x9b, 0x18, 0x9b, 0x00, 0x1f, 0x19, 0x04, 0xe0, 0x01, 0x32, 0x12, 0x06, -0x12, 0x0e, 0x05, 0x2a, 0xee, 0xdb, 0x00, 0x23, 0x05, 0x2a, 0x03, 0xd1, -0x18, 0x1c, 0x90, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0xb8, 0x60, 0x79, 0x60, -0x3b, 0x60, 0x39, 0x1c, 0x03, 0x48, 0xff, 0xf7, 0x9d, 0xff, 0x38, 0x1c, -0xf3, 0xe7, 0x00, 0x00, 0x40, 0xab, 0x20, 0x40, 0x04, 0x6e, 0x21, 0x40, -0x80, 0xb5, 0x07, 0x1c, 0x39, 0x1c, 0x04, 0x48, 0xff, 0xf7, 0xb0, 0xff, -0x00, 0x20, 0xb8, 0x60, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, -0x04, 0x6e, 0x21, 0x40, 0xf0, 0xb5, 0x0f, 0x4c, 0x27, 0x68, 0x00, 0x2f, -0x17, 0xd0, 0x78, 0x68, 0x00, 0x28, 0x0c, 0xd1, 0x0c, 0x4e, 0x00, 0x25, -0x30, 0x1c, 0xff, 0xf7, 0xb6, 0xff, 0xb8, 0x68, 0x06, 0xf0, 0xd4, 0xfe, -0xbd, 0x60, 0x27, 0x68, 0x78, 0x68, 0x00, 0x28, 0xf4, 0xd0, 0x00, 0x2f, -0x05, 0xd0, 0x78, 0x68, 0x01, 0x38, 0x78, 0x60, 0x3f, 0x68, 0x00, 0x2f, -0xf9, 0xd1, 0xf0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x04, 0x6e, 0x21, 0x40, -0x04, 0x6e, 0x21, 0x40, 0x00, 0xb5, 0x04, 0x48, 0x04, 0x49, 0x0a, 0x68, -0x01, 0x21, 0x06, 0xf0, 0xbb, 0xfe, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, -0x68, 0x1c, 0x00, 0x80, 0xc0, 0x6f, 0x21, 0x40, 0x80, 0xb5, 0x0b, 0x4f, -0x78, 0x7b, 0x01, 0x28, 0x08, 0xd0, 0x02, 0x28, -0x01, 0xd1, 0x00, 0xf0, 0x65, 0xf8, 0x78, 0x7b, 0x01, 0x28, 0x04, 0xd1, -0x79, 0x7a, 0x03, 0xe0, 0x00, 0xf0, 0x0c, 0xf8, 0xf7, 0xe7, 0x79, 0x89, -0x03, 0x48, 0xff, 0xf7, 0x82, 0xff, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, -0x88, 0x1c, 0x00, 0x80, 0xd1, 0x07, 0xff, 0xff, 0x00, 0xb5, 0x08, 0x48, -0xe9, 0x23, 0x1b, 0x01, 0xc1, 0x18, 0x09, 0x7b, 0x49, 0x00, 0x08, 0x18, -0xef, 0x23, 0x1b, 0x01, 0xc0, 0x18, 0x41, 0x7a, 0x00, 0x7a, 0x00, 0xf0, -0xd5, 0xf9, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, 0xf8, 0x0d, 0x00, 0x80, -0x90, 0xb5, 0xc8, 0x00, 0x40, 0x18, 0x80, 0x00, 0x19, 0x49, 0x40, 0x18, -0x41, 0x78, 0x19, 0x4c, 0xe9, 0x23, 0x1b, 0x01, 0xe7, 0x18, 0x08, 0x29, -0x1d, 0xd2, 0x02, 0xa3, 0x5b, 0x5c, 0x5b, 0x00, 0x9f, 0x44, 0x00, 0x1c, -0x10, 0x10, 0x04, 0x04, 0x10, 0x10, 0x19, 0x1c, 0x02, 0x30, 0x00, 0x21, -0x01, 0x31, 0x09, 0x06, 0x09, 0x0e, 0x03, 0x29, 0xfa, 0xdb, 0x0f, 0x49, -0x0a, 0x68, 0x01, 0x21, 0x06, 0xf0, 0x62, 0xfe, 0x38, 0x7b, 0x40, 0x00, -0x00, 0x19, 0xef, 0x23, 0x1b, 0x01, 0xc0, 0x18, 0x41, 0x7a, 0x01, 0x31, -0x41, 0x72, 0x90, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x20, 0x39, 0x7b, -0x49, 0x00, 0x09, 0x19, 0xef, 0x23, 0x1b, 0x01, 0xc9, 0x18, 0x48, 0x72, -0xf3, 0xe7, 0x00, 0x00, 0xe4, 0x2b, 0x00, 0x80, 0xf8, 0x0d, 0x00, 0x80, -0xc0, 0x6f, 0x21, 0x40, 0x00, 0xb5, 0x0b, 0x48, 0xe9, 0x23, 0x1b, 0x01, -0xc1, 0x18, 0x09, 0x7b, 0x16, 0x23, 0x59, 0x43, 0x08, 0x18, 0x75, 0x23, -0x5b, 0x01, 0xc1, 0x18, 0x09, 0x78, 0xe9, 0x23, 0x1b, 0x01, 0xc0, 0x18, -0xc0, 0x7b, 0xfe, 0x23, 0x18, 0x40, 0x00, 0xf0, 0xad, 0xf9, 0x08, 0xbc, -0x18, 0x47, 0x00, 0x00, 0xf8, 0x0d, 0x00, 0x80, 0xf0, 0xb5, 0x04, 0x1c, -0xc8, 0x00, 0x40, 0x18, 0x80, 0x00, 0x32, 0x49, 0x46, 0x18, 0x00, 0x25, -0x31, 0x48, 0xe9, 0x23, 0x1b, 0x01, 0xc7, 0x18, 0x39, 0x7b, 0x16, 0x23, -0x59, 0x43, 0x08, 0x18, 0x75, 0x23, 0x5b, 0x01, 0xc2, 0x18, 0xd1, 0x78, -0x63, 0x68, 0x1b, 0x06, 0x1b, 0x0e, 0x0c, 0x2b, 0x3b, 0xd1, 0x29, 0x4b, -0x54, 0x78, 0x36, 0x78, 0x34, 0x40, 0x24, 0x06, 0x24, 0x0e, 0x1e, 0x1c, -0xe9, 0x23, 0x1b, 0x01, 0xc0, 0x18, 0xc0, 0x7b, 0x40, 0x08, 0x07, 0xd3, -0x8c, 0x42, 0x24, 0xd0, 0x90, 0x78, 0xa0, 0x42, 0x0a, 0xd0, 0x88, 0x42, -0x1f, 0xd1, 0x06, 0xe0, 0x00, 0x2c, 0x02, 0xd0, 0x00, 0x29, 0x1a, 0xd1, -0x02, 0xe0, 0x00, 0x29, 0x17, 0xd0, 0x01, 0x25, 0x00, 0x2d, 0x03, 0xd0, -0x90, 0x79, 0x80, 0x23, 0x18, 0x43, 0x90, 0x71, 0x00, 0x25, 0x38, 0x7b, -0x16, 0x23, 0x58, 0x43, 0x80, 0x19, 0x16, 0x4b, 0xc0, 0x18, 0x16, 0x49, -0x0a, 0x68, 0x01, 0x21, 0x06, 0xf0, 0xe4, 0xfd, 0x68, 0x1c, 0x05, 0x06, -0x2d, 0x0e, 0x03, 0x2d, 0xef, 0xdb, 0x38, 0x7b, 0x16, 0x23, 0x58, 0x43, -0x80, 0x19, 0x75, 0x23, 0x5b, 0x01, 0xc0, 0x18, 0xc4, 0x70, 0x0b, 0x48, -0x39, 0x7b, 0x01, 0x31, 0x39, 0x73, 0x39, 0x7b, 0xba, 0x7b, 0x91, 0x42, -0x09, 0xdb, 0x00, 0x21, 0x39, 0x73, 0xef, 0x23, 0x1b, 0x01, 0xc0, 0x18, -0xc0, 0x79, 0x00, 0x28, 0x01, 0xd0, 0x01, 0x20, 0x78, 0x73, 0xf0, 0xbc, -0x08, 0xbc, 0x18, 0x47, 0xe4, 0x2b, 0x00, 0x80, 0xf8, 0x0d, 0x00, 0x80, -0xa4, 0x0e, 0x00, 0x00, 0xc0, 0x6f, 0x21, 0x40, 0xb0, 0xb5, 0x00, 0x27, -0x07, 0x4d, 0x08, 0x4c, 0x01, 0x21, 0x2a, 0x68, 0x20, 0x1c, 0x06, 0xf0, -0xb1, 0xfd, 0x78, 0x1c, 0x07, 0x06, 0x3f, 0x0e, -0x03, 0x2f, 0xf5, 0xdb, 0xb0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, -0xc0, 0x6f, 0x21, 0x40, 0x44, 0x1d, 0x00, 0x80, 0xb0, 0xb5, 0xc8, 0x00, -0x40, 0x18, 0x80, 0x00, 0x19, 0x49, 0x47, 0x18, 0x38, 0x78, 0x0d, 0x28, -0x2a, 0xdb, 0x12, 0x28, 0x28, 0xdc, 0xb8, 0x78, 0x10, 0x28, 0x25, 0xd1, -0x79, 0x78, 0x15, 0x48, 0x3d, 0x23, 0x9b, 0x01, 0xc4, 0x18, 0x13, 0x29, -0x16, 0xd1, 0x13, 0x4b, 0xc5, 0x18, 0xa0, 0x68, 0x00, 0x28, 0x01, 0xd0, -0xff, 0xf7, 0x94, 0xfe, 0x00, 0x20, 0x39, 0x18, 0xc9, 0x78, 0xc0, 0x46, -0x29, 0x54, 0x01, 0x30, 0x0e, 0x28, 0xf8, 0xd3, 0x38, 0x79, 0x00, 0x02, -0xf9, 0x78, 0x01, 0x43, 0x0a, 0x48, 0xff, 0xf7, 0x5c, 0xfe, 0xa0, 0x60, -0x78, 0x78, 0x14, 0x28, 0x04, 0xd1, 0xa0, 0x68, 0x00, 0x28, 0x01, 0xd0, -0xff, 0xf7, 0x7c, 0xfe, 0xb0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, -0xe4, 0x2b, 0x00, 0x80, 0xf8, 0x0d, 0x00, 0x80, 0x4c, 0x0f, 0x00, 0x00, -0xc5, 0x09, 0xff, 0xff, 0xf0, 0xb5, 0xcb, 0x00, 0x59, 0x18, 0x89, 0x00, -0x17, 0x4a, 0x8f, 0x18, 0x39, 0x78, 0xc5, 0x1d, 0x19, 0x35, 0x0b, 0x29, -0x22, 0xdb, 0x10, 0x29, 0x20, 0xdc, 0xb8, 0x78, 0x10, 0x28, 0x1d, 0xd1, -0xfe, 0x1c, 0x78, 0x78, 0x15, 0x28, 0x0e, 0xd1, 0x00, 0x24, 0x30, 0x1c, -0x0f, 0x49, 0x0a, 0x68, 0x01, 0x21, 0x06, 0xf0, 0x49, 0xfd, 0x00, 0x28, -0x00, 0xd1, 0x28, 0x71, 0x60, 0x1c, 0x04, 0x06, 0x24, 0x0e, 0x03, 0x2c, -0xf1, 0xdb, 0x78, 0x78, 0x16, 0x28, 0x09, 0xd1, 0x30, 0x1c, 0x07, 0x49, -0x0a, 0x68, 0x01, 0x21, 0x06, 0xf0, 0x38, 0xfd, 0x00, 0x28, 0x01, 0xd1, -0x00, 0x20, 0x28, 0x71, 0xf0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, -0xe4, 0x2b, 0x00, 0x80, 0xc0, 0x6f, 0x21, 0x40, 0xc8, 0x00, 0x40, 0x18, -0x80, 0x00, 0x0c, 0x49, 0x40, 0x18, 0x01, 0x78, 0x0d, 0x29, 0x12, 0xd1, -0x41, 0x78, 0x15, 0x29, 0x0f, 0xd1, 0x80, 0x78, 0x10, 0x28, 0x0c, 0xd1, -0x07, 0x48, 0x08, 0x4b, 0xc3, 0x18, 0x00, 0x21, 0x00, 0x22, 0x5a, 0x54, -0x01, 0x31, 0x0c, 0x29, 0xfb, 0xd3, 0x79, 0x23, 0x5b, 0x01, 0xc0, 0x18, -0x02, 0x72, 0x70, 0x47, 0xe4, 0x2b, 0x00, 0x80, 0xf8, 0x0d, 0x00, 0x80, -0x28, 0x0f, 0x00, 0x00, 0x83, 0x00, 0x18, 0x18, 0x80, 0x00, 0x02, 0x49, -0x40, 0x18, 0x02, 0x4b, 0xc0, 0x18, 0x70, 0x47, 0xf8, 0x0d, 0x00, 0x80, -0x81, 0x0e, 0x00, 0x00, 0x80, 0xb4, 0x00, 0x20, 0x09, 0x49, 0x00, 0x22, -0x43, 0x00, 0x5f, 0x18, 0xef, 0x23, 0x1b, 0x01, 0xfb, 0x18, 0x1a, 0x72, -0x01, 0x30, 0x00, 0x06, 0x00, 0x0e, 0x04, 0x28, 0xf4, 0xdb, 0xef, 0x23, -0x1b, 0x01, 0xc8, 0x18, 0xc2, 0x71, 0x80, 0xbc, 0x70, 0x47, 0x00, 0x00, -0xf8, 0x0d, 0x00, 0x80, 0x88, 0xb5, 0x01, 0x1c, 0x0b, 0x4a, 0xc0, 0x46, -0x00, 0x92, 0x0b, 0x4f, 0x0b, 0x4b, 0xf8, 0x18, 0x1a, 0x23, 0x0a, 0x1c, -0x04, 0x21, 0x04, 0xf0, 0xe9, 0xf8, 0x05, 0x28, 0x06, 0xd1, 0x00, 0x20, -0xef, 0x23, 0x1b, 0x01, 0xf9, 0x18, 0xc8, 0x71, 0xff, 0xf7, 0x0a, 0xfd, -0x88, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, 0xad, 0x0b, 0xff, 0xff, -0xf8, 0x0d, 0x00, 0x80, 0xf8, 0x0e, 0x00, 0x00, 0x00, 0xb5, 0x43, 0x00, -0x18, 0x18, 0x80, 0x00, 0x04, 0x49, 0x40, 0x18, 0x40, 0x7a, 0x04, 0x49, -0xc0, 0x46, 0xc8, 0x71, 0xff, 0xf7, 0xf4, 0xfc, 0x08, 0xbc, 0x18, 0x47, -0x5c, 0xac, 0x20, 0x40, 0xe8, 0x1c, 0x00, 0x80, 0xb0, 0xb5, 0x04, 0x1c, -0x0d, 0x1c, 0x00, 0x27, 0x03, 0xf0, 0x42, 0xfe, -0x00, 0x28, 0x1d, 0xd0, 0x18, 0x21, 0x01, 0x70, 0x0f, 0x49, 0xc0, 0x46, -0xc1, 0x60, 0x0f, 0x49, 0xc0, 0x46, 0x41, 0x60, 0x0e, 0x49, 0xc0, 0x46, -0x81, 0x60, 0x04, 0x74, 0x01, 0x21, 0x41, 0x74, 0x04, 0x21, 0x81, 0x74, -0x11, 0x21, 0xc1, 0x74, 0x10, 0x21, 0x01, 0x75, 0x45, 0x75, 0x00, 0x21, -0x81, 0x75, 0x01, 0x21, 0x21, 0x43, 0xc1, 0x75, 0x00, 0x21, 0x03, 0xf0, -0xd9, 0xfc, 0x07, 0x1c, 0x38, 0x1c, 0xb0, 0xbc, 0x08, 0xbc, 0x18, 0x47, -0xe4, 0x2b, 0x00, 0x80, 0x00, 0x3f, 0xf3, 0x03, 0x31, 0x08, 0xff, 0xff, -0xb0, 0xb5, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x27, 0x03, 0xf0, 0x12, 0xfe, -0x00, 0x28, 0x13, 0xd0, 0x08, 0x21, 0x01, 0x70, 0x0a, 0x49, 0xc0, 0x46, -0xc1, 0x60, 0x0a, 0x49, 0xc0, 0x46, 0x41, 0x60, 0x09, 0x49, 0xc0, 0x46, -0x81, 0x60, 0x04, 0x74, 0x45, 0x74, 0x01, 0x21, 0x21, 0x43, 0x81, 0x74, -0x00, 0x21, 0x03, 0xf0, 0xb3, 0xfc, 0x07, 0x1c, 0x38, 0x1c, 0xb0, 0xbc, -0x08, 0xbc, 0x18, 0x47, 0xe4, 0x2b, 0x00, 0x80, 0x00, 0x3f, 0xf3, 0x13, -0xe1, 0x08, 0xff, 0xff, 0xc1, 0x10, 0x05, 0xd1, 0x40, 0x07, 0x40, 0x0f, -0x80, 0x00, 0x02, 0x49, 0x08, 0x58, 0x70, 0x47, 0x00, 0x20, 0xfc, 0xe7, -0x20, 0x6e, 0x21, 0x40, 0xcb, 0x00, 0x59, 0x18, 0x89, 0x00, 0x08, 0x48, -0x42, 0x5c, 0x03, 0x2a, 0x0a, 0xd1, 0x08, 0x18, 0x41, 0x78, 0x18, 0x29, -0x06, 0xd1, 0x81, 0x78, 0x10, 0x29, 0x03, 0xd1, 0xc0, 0x78, 0x03, 0x49, -0xc0, 0x46, 0xc8, 0x62, 0x70, 0x47, 0x00, 0x00, 0xe4, 0x2b, 0x00, 0x80, -0xf8, 0x1b, 0x00, 0x80, 0xf0, 0xb4, 0x02, 0x7c, 0xd6, 0x07, 0xf6, 0x0f, -0xc7, 0x1d, 0x19, 0x37, 0x1c, 0x4d, 0x00, 0x24, 0xca, 0x00, 0x52, 0x18, -0x92, 0x00, 0x00, 0x2e, 0x23, 0xd0, 0xae, 0x5c, 0x19, 0x4d, 0xcb, 0x00, -0x59, 0x18, 0x89, 0x00, 0x69, 0x18, 0x00, 0x2e, 0x15, 0xd1, 0x03, 0x23, -0xab, 0x54, 0x13, 0x22, 0x4a, 0x70, 0x10, 0x22, 0x8a, 0x70, 0x09, 0x22, -0x13, 0x4b, 0x5d, 0x6a, 0x02, 0x23, 0x1d, 0x40, 0x00, 0xd1, 0x01, 0x22, -0x04, 0x23, 0x00, 0x2d, 0x00, 0xd1, 0x00, 0x23, 0x1a, 0x43, 0xca, 0x70, -0x15, 0x22, 0x3a, 0x71, 0x00, 0xe0, 0x3c, 0x71, 0xc1, 0x61, 0x04, 0x62, -0x44, 0x61, 0xf0, 0xbc, 0x70, 0x47, 0x14, 0x21, 0x39, 0x71, 0x09, 0x49, -0x52, 0x19, 0x01, 0x62, 0x82, 0x61, 0x00, 0x21, 0x54, 0x54, 0x01, 0x31, -0x24, 0x29, 0xfb, 0xd3, 0x05, 0x49, 0xc0, 0x46, 0x41, 0x61, 0xee, 0xe7, -0xe4, 0x2b, 0x00, 0x80, 0x08, 0x2c, 0x00, 0x80, 0xf8, 0x1b, 0x00, 0x80, -0x95, 0x0c, 0xff, 0xff, 0xc5, 0x0c, 0xff, 0xff, 0x14, 0x22, 0xc3, 0x1d, -0x19, 0x33, 0x1a, 0x71, 0xcb, 0x00, 0x59, 0x18, 0x89, 0x00, 0x04, 0x4a, -0x89, 0x18, 0x81, 0x61, 0x03, 0x49, 0xc0, 0x46, 0x01, 0x62, 0x00, 0x21, -0x41, 0x61, 0x70, 0x47, 0xe4, 0x2b, 0x00, 0x80, 0xf1, 0x09, 0xff, 0xff, -0x80, 0xb4, 0x02, 0x7c, 0xd7, 0x07, 0xff, 0x0f, 0xcb, 0x00, 0x59, 0x18, -0x89, 0x00, 0xc2, 0x1d, 0x19, 0x32, 0x00, 0x2f, 0x27, 0xd0, 0x1a, 0x4b, -0xc9, 0x18, 0x15, 0x23, 0x13, 0x71, 0x00, 0x22, 0xc1, 0x61, 0x42, 0x61, -0x02, 0x62, 0x17, 0x4a, 0x79, 0x23, 0x5b, 0x01, 0xd0, 0x18, 0x03, 0x7a, -0x10, 0x20, 0x00, 0x2b, 0x11, 0xd0, 0x0d, 0x23, 0x0b, 0x70, 0x16, 0x23, -0x4b, 0x70, 0x88, 0x70, 0x00, 0x20, 0x17, 0x18, 0x79, 0x23, 0x5b, 0x01, -0xfb, 0x18, 0x5b, 0x7a, 0x0f, 0x18, 0xfb, 0x70, 0x01, 0x30, 0x0b, 0x28, -0xf5, 0xd3, 0x80, 0xbc, 0x70, 0x47, 0x02, 0x22, -0x0a, 0x70, 0x17, 0x22, 0x4a, 0x70, 0x88, 0x70, 0xf7, 0xe7, 0x14, 0x23, -0x13, 0x71, 0x07, 0x4a, 0x89, 0x18, 0x81, 0x61, 0x06, 0x49, 0xc0, 0x46, -0x01, 0x62, 0x06, 0x49, 0xc0, 0x46, 0x41, 0x61, 0xeb, 0xe7, 0x00, 0x00, -0x08, 0x2c, 0x00, 0x80, 0xf8, 0x0d, 0x00, 0x80, 0xe4, 0x2b, 0x00, 0x80, -0xe1, 0x0a, 0xff, 0xff, 0x81, 0x0d, 0xff, 0xff, 0x14, 0x22, 0xc3, 0x1d, -0x19, 0x33, 0x1a, 0x71, 0x04, 0x4a, 0xcb, 0x00, 0x59, 0x18, 0x89, 0x00, -0x02, 0x62, 0x03, 0x4a, 0x89, 0x18, 0x81, 0x61, 0x70, 0x47, 0x00, 0x00, -0x71, 0x0a, 0xff, 0xff, 0xe4, 0x2b, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe1, -0x00, 0x10, 0xa0, 0xe1, 0xc0, 0x10, 0x81, 0xe3, 0x01, 0xf0, 0x21, 0xe1, -0x1e, 0xff, 0x2f, 0xe1, 0x00, 0xf0, 0x21, 0xe1, 0x1e, 0xff, 0x2f, 0xe1, -0x00, 0x00, 0x0f, 0xe1, 0xc0, 0x00, 0x80, 0xe3, 0x00, 0xf0, 0x21, 0xe1, -0x1e, 0xff, 0x2f, 0xe1, 0x00, 0x00, 0x0f, 0xe1, 0xc0, 0x00, 0xc0, 0xe3, +0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf, 0xcd, 0x57, 0xc3, +0xba, 0x01, 0x2c, 0xe8, 0xcd, 0xef, 0xa9, 0xd9, 0x6f, 0xbb, 0x76, 0x2f, +0x86, 0x49, 0xac, 0x1b, 0x40, 0x01, 0x00, 0x00, 0x8a, 0xe4, 0x00, 0x00, +0x00, 0x00, 0xff, 0xff, 0x39, 0x00, 0x00, 0xea, 0x05, 0x00, 0x00, 0xea, +0x04, 0x00, 0x00, 0xea, 0x03, 0x00, 0x00, 0xea, 0x02, 0x00, 0x00, 0xea, +0x01, 0x00, 0x00, 0xea, 0x32, 0x02, 0x00, 0xea, 0xc0, 0x14, 0x00, 0xea, +0x07, 0x00, 0x2d, 0xe9, 0x0e, 0x00, 0xa0, 0xe1, 0x00, 0x10, 0x0f, 0xe1, +0xd0, 0x20, 0x9f, 0xe5, 0x12, 0xff, 0x2f, 0xe1, 0xfe, 0xff, 0xff, 0xea, +0x01, 0x00, 0x80, 0xe0, 0x04, 0x20, 0x81, 0xe4, 0x01, 0x00, 0x50, 0xe1, +0xfc, 0xff, 0xff, 0x1a, 0x0e, 0xf0, 0xa0, 0xe1, 0x00, 0xa0, 0xa0, 0xe1, +0x0e, 0xb0, 0xa0, 0xe1, 0x00, 0x00, 0xa0, 0xe3, 0xa8, 0x10, 0x9f, 0xe5, +0x00, 0x00, 0x81, 0xe5, 0xa4, 0x10, 0x9f, 0xe5, 0x00, 0x00, 0x81, 0xe5, +0x01, 0x16, 0xa0, 0xe3, 0x00, 0x00, 0x91, 0xe5, 0x01, 0x00, 0x80, 0xe3, +0x00, 0x00, 0x81, 0xe5, 0xd7, 0x00, 0xa0, 0xe3, 0x00, 0xf0, 0x21, 0xe1, +0x88, 0xd0, 0x9f, 0xe5, 0xdb, 0x00, 0xa0, 0xe3, 0x00, 0xf0, 0x21, 0xe1, +0x7c, 0xd0, 0x9f, 0xe5, 0xd2, 0x00, 0xa0, 0xe3, 0x00, 0xf0, 0x21, 0xe1, +0x74, 0xd0, 0x9f, 0xe5, 0xd1, 0x00, 0xa0, 0xe3, 0x00, 0xf0, 0x21, 0xe1, +0x6c, 0xd0, 0x9f, 0xe5, 0x96, 0x14, 0x00, 0xeb, 0xd3, 0x00, 0xa0, 0xe3, +0x00, 0xf0, 0x21, 0xe1, 0x60, 0xd0, 0x9f, 0xe5, 0x60, 0x00, 0x9f, 0xe5, +0x60, 0x10, 0x9f, 0xe5, 0x60, 0x20, 0x9f, 0xe5, 0xdb, 0xff, 0xff, 0xeb, +0x5c, 0x00, 0x9f, 0xe5, 0x5c, 0x10, 0x9f, 0xe5, 0x00, 0x20, 0xa0, 0xe3, +0xd7, 0xff, 0xff, 0xeb, 0x54, 0x00, 0x9f, 0xe5, 0x54, 0x10, 0x9f, 0xe5, +0xd4, 0xff, 0xff, 0xeb, 0x0a, 0x00, 0xa0, 0xe1, 0x0b, 0xf0, 0xa0, 0xe1, +0xd3, 0x10, 0xa0, 0xe3, 0x01, 0xf0, 0x21, 0xe1, 0xd4, 0xff, 0xff, 0xeb, +0x3c, 0xa0, 0x9f, 0xe5, 0x1a, 0xff, 0x2f, 0xe1, 0xc6, 0xff, 0xff, 0xea, +0x01, 0x21, 0xff, 0xff, 0x0c, 0x00, 0x10, 0x00, 0x1c, 0x00, 0x10, 0x00, +0x3c, 0x38, 0x00, 0x80, 0xfc, 0x37, 0x00, 0x80, 0xfc, 0x3f, 0x00, 0x80, +0x7c, 0x34, 0x00, 0x80, 0x80, 0x0f, 0x00, 0x00, 0x80, 0x30, 0x00, 0x80, +0xad, 0xde, 0xad, 0xde, 0x5c, 0xbc, 0x00, 0x00, 0x24, 0xab, 0x20, 0x40, +0x48, 0x29, 0x00, 0x00, 0x28, 0x05, 0x00, 0x80, 0x8d, 0xd2, 0x21, 0x40, +0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x44, 0x57, 0x00, 0x00, 0x71, 0xaf, 0x00, 0x00, 0x60, 0x01, 0xff, 0xff, +0xb0, 0xb5, 0x07, 0x1c, 0x12, 0x4c, 0x00, 0x25, 0x20, 0x68, 0x00, 0x28, +0x1d, 0xd0, 0x38, 0x1c, 0x10, 0x49, 0x04, 0xf0, 0x71, 0xfd, 0x21, 0x68, +0xc0, 0x46, 0x08, 0x60, 0x00, 0x28, 0x14, 0xd0, 0x38, 0x01, 0x0d, 0x49, +0x40, 0x18, 0x19, 0x23, 0xdb, 0x01, 0xc0, 0x18, 0x41, 0x6b, 0x80, 0x29, +0x0b, 0xd2, 0x01, 0x31, 0x41, 0x63, 0x20, 0x68, 0xc1, 0x69, 0xc0, 0x46, +0x21, 0x60, 0x39, 0x07, 0x41, 0x60, 0xc7, 0x62, 0xb0, 0xbc, 0x08, 0xbc, +0x18, 0x47, 0x28, 0x1c, 0xfa, 0xe7, 0x00, 0x00, 0xe8, 0x17, 0x00, 0x80, +0xee, 0x05, 0x00, 0x00, 0xa0, 0x1c, 0x00, 0x80, 0x02, 0x49, 0x0a, 0x68, +0xc0, 0x46, 0xc2, 0x61, 0x08, 0x60, 0x70, 0x47, +0xe8, 0x17, 0x00, 0x80, 0x70, 0x47, 0x00, 0x00, 0x70, 0x47, 0x00, 0x00, +0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe1, 0x00, 0x10, 0xa0, 0xe1, +0xc0, 0x10, 0x81, 0xe3, 0x01, 0xf0, 0x21, 0xe1, 0x1e, 0xff, 0x2f, 0xe1, 0x00, 0xf0, 0x21, 0xe1, 0x1e, 0xff, 0x2f, 0xe1, 0x00, 0x00, 0x0f, 0xe1, -0x40, 0x00, 0x80, 0xe3, 0x00, 0xf0, 0x21, 0xe1, 0x1e, 0xff, 0x2f, 0xe1, -0x00, 0x00, 0x0f, 0xe1, 0x80, 0x00, 0x10, 0xe3, 0x80, 0x00, 0x80, 0xe3, -0x00, 0xf0, 0x21, 0xe1, 0x00, 0x00, 0x00, 0x12, 0x1e, 0xff, 0x2f, 0xe1, -0x00, 0x00, 0x50, 0xe3, 0x00, 0x00, 0x0f, 0xe1, 0x80, 0x00, 0xc0, 0x13, +0xc0, 0x00, 0x80, 0xe3, 0x00, 0xf0, 0x21, 0xe1, 0x1e, 0xff, 0x2f, 0xe1, +0x00, 0x00, 0x0f, 0xe1, 0xc0, 0x00, 0xc0, 0xe3, 0x00, 0xf0, 0x21, 0xe1, +0x1e, 0xff, 0x2f, 0xe1, 0x00, 0x00, 0x0f, 0xe1, 0x40, 0x00, 0x80, 0xe3, 0x00, 0xf0, 0x21, 0xe1, 0x1e, 0xff, 0x2f, 0xe1, 0x00, 0x00, 0x0f, 0xe1, -0x80, 0x00, 0xc0, 0xe3, 0x00, 0xf0, 0x21, 0xe1, 0x1e, 0xff, 0x2f, 0xe1, -0x91, 0x00, 0x00, 0xe0, 0x1e, 0xff, 0x2f, 0xe1, 0x01, 0x20, 0x80, 0xe0, -0x01, 0x00, 0x80, 0xe0, 0x1e, 0xff, 0x2f, 0xe1, 0x80, 0xb5, 0x08, 0x4f, -0x64, 0x28, 0x04, 0xd3, 0x64, 0x20, 0xf8, 0x62, 0x00, 0x20, 0xc0, 0x43, -0x03, 0xe0, 0xf8, 0x62, 0x04, 0x49, 0x06, 0xf0, 0xb1, 0xfe, 0x38, 0x63, -0x78, 0x63, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0xf8, 0x0d, 0x00, 0x80, -0x88, 0x13, 0x00, 0x00, 0x80, 0xb4, 0x10, 0x4b, 0x00, 0x22, 0xdf, 0x6a, -0x64, 0x2f, 0x03, 0xd2, 0x09, 0x68, 0x09, 0x68, 0x49, 0x08, 0x02, 0xd2, -0x10, 0x1c, 0x80, 0xbc, 0x70, 0x47, 0x19, 0x1c, 0x9b, 0x6b, 0x0f, 0x6b, -0xbb, 0x42, 0x05, 0xd2, 0x40, 0x68, 0x00, 0x04, 0x00, 0x0c, 0x18, 0x18, -0x88, 0x63, 0xf1, 0xe7, 0x41, 0x68, 0x05, 0x4b, 0x19, 0x43, 0x41, 0x60, -0x04, 0x48, 0xc1, 0x6b, 0x01, 0x31, 0xc1, 0x63, 0x02, 0x20, 0xe8, 0xe7, -0xf8, 0x0d, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x94, 0x2c, 0x00, 0x80, -0x90, 0xb5, 0x07, 0x1c, 0x15, 0x4c, 0x00, 0x20, 0xe1, 0x6a, 0x64, 0x29, -0x0b, 0xd2, 0xb9, 0x6e, 0x49, 0x08, 0x08, 0xd3, 0xe1, 0x6b, 0x62, 0x6b, -0x91, 0x42, 0x07, 0xd2, 0xfa, 0x1d, 0x39, 0x32, 0x52, 0x8b, 0x89, 0x18, -0xe1, 0x63, 0x90, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x78, 0x6a, 0x39, 0x6b, -0xc0, 0x46, 0x48, 0x62, 0x38, 0x6b, 0x03, 0xf0, 0xc7, 0xf9, 0x38, 0x1c, -0x02, 0xf0, 0x7d, 0xfe, 0x01, 0x20, 0xbb, 0x23, 0x1b, 0x01, 0xe1, 0x18, -0xc8, 0x70, 0x05, 0x49, 0x0a, 0x6c, 0x12, 0x18, 0x0a, 0x64, 0x04, 0x49, -0x8a, 0x6d, 0x12, 0x18, 0x8a, 0x65, 0xe4, 0xe7, 0xf8, 0x0d, 0x00, 0x80, -0x94, 0x2c, 0x00, 0x80, 0x2c, 0x2c, 0x00, 0x80, 0x80, 0xb4, 0x0a, 0x48, -0xc0, 0x6d, 0x02, 0x23, 0x18, 0x40, 0x09, 0x4a, 0x00, 0x21, 0x00, 0x28, -0x03, 0xd0, 0x91, 0x63, 0xd1, 0x63, 0x80, 0xbc, 0x70, 0x47, 0x06, 0x48, -0x07, 0x68, 0x7b, 0x1c, 0x03, 0x60, 0x0a, 0x2f, -0xf7, 0xd3, 0x01, 0x60, 0xf3, 0xe7, 0x00, 0x00, 0x2c, 0x2c, 0x00, 0x80, -0xf8, 0x0d, 0x00, 0x80, 0x5c, 0x01, 0x00, 0x80, 0x70, 0x47, 0x02, 0x04, -0x12, 0x0c, 0x00, 0x0c, 0x10, 0x18, 0x0a, 0x04, 0x12, 0x0c, 0x09, 0x0c, -0x51, 0x18, 0x08, 0x18, 0x01, 0x0c, 0x05, 0xd0, 0x01, 0x04, 0x09, 0x0c, -0x00, 0x0c, 0x08, 0x18, 0x01, 0x0c, 0xf9, 0xd1, 0x00, 0x04, 0x00, 0x0c, -0x70, 0x47, 0x80, 0xb4, 0x00, 0x22, 0x00, 0x29, 0x18, 0xd0, 0x4f, 0x08, -0x7b, 0x1e, 0x00, 0x2f, 0x06, 0xd0, 0x07, 0x88, 0xba, 0x18, 0x02, 0x30, -0x1f, 0x1c, 0x01, 0x3b, 0x00, 0x2f, 0xf8, 0xd1, 0x49, 0x08, 0x03, 0xd3, -0x00, 0x88, 0x00, 0x06, 0x00, 0x0e, 0x82, 0x18, 0x10, 0x0c, 0x05, 0xd0, -0x10, 0x04, 0x00, 0x0c, 0x11, 0x0c, 0x42, 0x18, 0x10, 0x0c, 0xf9, 0xd1, -0x10, 0x04, 0x00, 0x0c, 0x80, 0xbc, 0x70, 0x47, 0x80, 0xb5, 0x83, 0x89, -0xc7, 0x89, 0xfb, 0x18, 0x07, 0x8a, 0xfb, 0x18, 0x47, 0x8a, 0xfb, 0x18, -0x40, 0x7a, 0x00, 0x02, 0xc7, 0x18, 0x38, 0x0c, 0x05, 0xd0, 0x38, 0x04, -0x00, 0x0c, 0x3b, 0x0c, 0xc7, 0x18, 0x38, 0x0c, 0xf9, 0xd1, 0x08, 0x1c, -0x11, 0x1c, 0xff, 0xf7, 0xc8, 0xff, 0x01, 0x1c, 0x38, 0x1c, 0xff, 0xf7, -0xb0, 0xff, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x90, 0xb5, 0x02, 0x23, -0x82, 0x68, 0x1a, 0x40, 0x00, 0x27, 0x00, 0x2a, 0x0f, 0xd0, 0x0a, 0x4a, -0x93, 0x69, 0x01, 0x33, 0x93, 0x61, 0x0a, 0x68, 0x8b, 0x68, 0x9a, 0x18, -0x00, 0x68, 0x1c, 0x18, 0x57, 0x81, 0x09, 0x69, 0x10, 0x1c, 0xff, 0xf7, -0xac, 0xff, 0xc0, 0x43, 0x60, 0x81, 0x38, 0x1c, 0x90, 0xbc, 0x08, 0xbc, -0x18, 0x47, 0x00, 0x00, 0x94, 0x2c, 0x00, 0x80, 0x90, 0xb5, 0x04, 0x23, -0x82, 0x68, 0x1a, 0x40, 0x00, 0x27, 0x00, 0x2a, 0x11, 0xd0, 0x4a, 0x68, -0x52, 0x09, 0x0e, 0xd3, 0x09, 0x4a, 0x13, 0x6a, 0x01, 0x33, 0x13, 0x62, -0xcb, 0x68, 0x02, 0x68, 0x9c, 0x18, 0x01, 0x23, 0x9b, 0x07, 0x08, 0x3a, -0x1a, 0x43, 0x12, 0x68, 0x00, 0xf0, 0x2e, 0xf8, 0x20, 0x82, 0x38, 0x1c, -0x90, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, 0x94, 0x2c, 0x00, 0x80, -0x90, 0xb5, 0x80, 0x23, 0x82, 0x68, 0x1a, 0x40, 0x00, 0x24, 0x00, 0x2a, -0x15, 0xd0, 0x4a, 0x68, 0x92, 0x09, 0x12, 0xd3, 0x0b, 0x4a, 0xd3, 0x69, -0x01, 0x33, 0xd3, 0x61, 0xcb, 0x68, 0x02, 0x68, 0x9f, 0x18, 0x01, 0x23, -0x9b, 0x07, 0x08, 0x3a, 0x1a, 0x43, 0x12, 0x68, 0x00, 0xf0, 0x0e, 0xf8, -0x00, 0x28, 0x00, 0xd1, 0x04, 0x48, 0xc0, 0x46, 0xf8, 0x80, 0x20, 0x1c, -0x90, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, 0x94, 0x2c, 0x00, 0x80, -0xff, 0xff, 0x00, 0x00, 0xb0, 0xb5, 0x14, 0x1c, 0x05, 0x1c, 0x0f, 0x1c, -0x38, 0x69, 0xb9, 0x68, 0x41, 0x18, 0x38, 0x68, 0xff, 0xf7, 0x53, 0xff, -0xc0, 0x43, 0x01, 0x04, 0x09, 0x0c, 0x20, 0x1c, 0xff, 0xf7, 0x39, 0xff, -0x04, 0x1c, 0xb8, 0x68, 0x79, 0x69, 0x40, 0x18, 0x69, 0x68, 0x88, 0x42, -0x0c, 0xd2, 0x2a, 0x68, 0x12, 0x18, 0x09, 0x1a, 0x10, 0x1c, 0x00, 0xf0, -0x05, 0xf9, 0xc0, 0x43, 0x01, 0x04, 0x09, 0x0c, 0x20, 0x1c, 0xff, 0xf7, -0x26, 0xff, 0x04, 0x1c, 0xe0, 0x43, 0x00, 0x04, 0x00, 0x0c, 0xb0, 0xbc, -0x08, 0xbc, 0x18, 0x47, 0x80, 0xb5, 0x07, 0x1c, 0xb8, 0x6b, 0xc0, 0x08, -0x1a, 0xd3, 0xb8, 0x6a, 0xf9, 0x6b, 0x40, 0x18, 0x79, 0x6c, 0x00, 0xf0, -0xed, 0xf8, 0xc0, 0x43, 0x01, 0x04, 0x09, 0x0c, 0x0a, 0x48, 0x07, 0xd0, -0x20, 0x23, 0xb9, 0x69, 0x19, 0x43, 0xb9, 0x61, -0x01, 0x6b, 0x01, 0x31, 0x01, 0x63, 0x07, 0xe0, 0xff, 0x23, 0x01, 0x33, -0xb9, 0x69, 0x19, 0x43, 0xb9, 0x61, 0x41, 0x6a, 0x01, 0x31, 0x41, 0x62, -0x00, 0x20, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x94, 0x2c, 0x00, 0x80, -0x80, 0xb5, 0x07, 0x1c, 0xb8, 0x6b, 0x41, 0x09, 0x1c, 0xd3, 0xc0, 0x08, -0x1a, 0xd3, 0xf8, 0x1d, 0x39, 0x30, 0x00, 0x7b, 0x06, 0x28, 0x15, 0xd1, -0x38, 0x1c, 0x00, 0xf0, 0x53, 0xf8, 0x01, 0x1c, 0x0a, 0x48, 0x07, 0xd0, -0x40, 0x23, 0xb9, 0x69, 0x19, 0x43, 0xb9, 0x61, 0x81, 0x6b, 0x01, 0x31, -0x81, 0x63, 0x07, 0xe0, 0x01, 0x23, 0x9b, 0x02, 0xb9, 0x69, 0x19, 0x43, -0xb9, 0x61, 0xc1, 0x6a, 0x01, 0x31, 0xc1, 0x62, 0x00, 0x20, 0x80, 0xbc, -0x08, 0xbc, 0x18, 0x47, 0x94, 0x2c, 0x00, 0x80, 0xb0, 0xb5, 0x07, 0x1c, -0xb8, 0x6b, 0x81, 0x09, 0x2c, 0xd3, 0xc0, 0x08, 0x2a, 0xd3, 0xf8, 0x1d, -0x39, 0x30, 0x00, 0x7b, 0x11, 0x28, 0x25, 0xd1, 0xb8, 0x6a, 0x39, 0x6c, -0x40, 0x18, 0x01, 0x23, 0x9b, 0x07, 0x06, 0x30, 0x18, 0x43, 0x00, 0x68, -0x05, 0x04, 0x2d, 0x0c, 0x0f, 0x4c, 0x11, 0xd0, 0x38, 0x1c, 0x00, 0xf0, -0x1f, 0xf8, 0x00, 0x28, 0x0c, 0xd0, 0xa8, 0x42, 0x02, 0xd1, 0x0c, 0x4b, -0x98, 0x42, 0x07, 0xd0, 0x80, 0x23, 0xb8, 0x69, 0x18, 0x43, 0xb8, 0x61, -0x60, 0x6b, 0x01, 0x30, 0x60, 0x63, 0x07, 0xe0, 0x01, 0x23, 0x5b, 0x02, -0xb8, 0x69, 0x18, 0x43, 0xb8, 0x61, 0xa0, 0x6a, 0x01, 0x30, 0xa0, 0x62, -0x00, 0x20, 0xb0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x94, 0x2c, 0x00, 0x80, -0xff, 0xff, 0x00, 0x00, 0xf0, 0xb5, 0xff, 0xb0, 0x99, 0xb0, 0x04, 0x1c, -0xe0, 0x6b, 0x61, 0x6c, 0x09, 0x18, 0x03, 0xaa, 0x85, 0x18, 0xa3, 0x6a, -0x00, 0x20, 0x8a, 0x08, 0x01, 0x32, 0x97, 0x92, 0x07, 0xd0, 0x82, 0x00, -0x9f, 0x58, 0x03, 0xae, 0xb7, 0x50, 0x97, 0x9a, 0x01, 0x30, 0x82, 0x42, -0xf7, 0xd8, 0x60, 0x6a, 0x01, 0x23, 0x9b, 0x07, 0x04, 0x30, 0x18, 0x43, -0x00, 0x68, 0xc0, 0x46, 0x02, 0x90, 0x02, 0xaf, 0x3f, 0x88, 0x03, 0xa8, -0xff, 0xf7, 0x87, 0xfe, 0xc0, 0x43, 0x01, 0x04, 0x09, 0x0c, 0x38, 0x1c, -0xff, 0xf7, 0x6d, 0xfe, 0x07, 0x1c, 0xe0, 0x6b, 0xa1, 0x6c, 0x40, 0x18, -0x61, 0x6a, 0x01, 0x23, 0x9b, 0x07, 0x08, 0x31, 0x19, 0x43, 0x09, 0x68, -0xc0, 0x46, 0x01, 0x91, 0x01, 0xa9, 0x09, 0x88, 0x01, 0x31, 0x88, 0x42, -0x0c, 0xd2, 0xa2, 0x6a, 0x12, 0x18, 0x09, 0x1a, 0x10, 0x1c, 0x00, 0xf0, -0x2f, 0xf8, 0xc0, 0x43, 0x01, 0x04, 0x09, 0x0c, 0x38, 0x1c, 0xff, 0xf7, -0x50, 0xfe, 0x07, 0x1c, 0xa8, 0x89, 0xe9, 0x89, 0x08, 0x18, 0x29, 0x8a, -0x08, 0x18, 0x69, 0x8a, 0x08, 0x18, 0x69, 0x7a, 0x09, 0x02, 0x08, 0x18, -0xa1, 0x6c, 0x62, 0x6c, 0x89, 0x1a, 0x0a, 0x04, 0x12, 0x0c, 0x11, 0x02, -0x12, 0x0a, 0x11, 0x43, 0x09, 0x04, 0x09, 0x0c, 0x09, 0x18, 0x08, 0x0c, -0x05, 0xd0, 0x08, 0x04, 0x00, 0x0c, 0x09, 0x0c, 0x41, 0x18, 0x08, 0x0c, -0xf9, 0xd1, 0x38, 0x1c, 0xff, 0xf7, 0x2f, 0xfe, 0xc0, 0x43, 0x00, 0x04, -0x00, 0x0c, 0x7f, 0xb0, 0x19, 0xb0, 0xf0, 0xbc, 0x08, 0xbc, 0x18, 0x47, -0xb0, 0xb4, 0x00, 0x22, 0x00, 0x29, 0x2e, 0xd0, 0x83, 0x07, 0x9b, 0x0f, -0xdc, 0x00, 0x47, 0x18, 0x04, 0x25, 0xef, 0x1b, 0xbf, 0x07, 0xbf, 0x0f, -0xff, 0x00, 0x80, 0x08, 0x80, 0x00, 0x59, 0x18, 0x03, 0x31, 0x89, 0x08, -0x4d, 0x1e, 0x02, 0xc8, 0xe1, 0x40, 0xa1, 0x40, 0x6b, 0x1e, 0x00, 0x2d, -0x09, 0xd0, 0x0c, 0x04, 0x24, 0x0c, 0xa2, 0x18, -0x09, 0x0c, 0x8a, 0x18, 0x02, 0xc8, 0x1c, 0x1c, 0x01, 0x3b, 0x00, 0x2c, -0xf5, 0xd1, 0xb9, 0x40, 0x08, 0x1c, 0xf8, 0x40, 0x01, 0x04, 0x09, 0x0c, -0x89, 0x18, 0x00, 0x0c, 0x42, 0x18, 0x10, 0x0c, 0x05, 0xd0, 0x10, 0x04, -0x00, 0x0c, 0x11, 0x0c, 0x42, 0x18, 0x10, 0x0c, 0xf9, 0xd1, 0x10, 0x04, -0x00, 0x0c, 0xb0, 0xbc, 0x70, 0x47, 0x00, 0x00, 0x90, 0xb4, 0x00, 0x20, -0x01, 0x27, 0x11, 0x49, 0x42, 0x00, 0x12, 0x18, 0xd2, 0x00, 0x53, 0x18, -0x9c, 0x68, 0x01, 0x23, 0x9b, 0x07, 0x23, 0x43, 0x1b, 0x68, 0x1b, 0x03, -0x1b, 0x0b, 0x8a, 0x58, 0x12, 0x03, 0x12, 0x0b, 0x93, 0x42, 0x0c, 0xd1, -0x01, 0x30, 0x04, 0x28, 0xec, 0xd3, 0x08, 0x48, 0xc0, 0x6a, 0x01, 0x03, -0x09, 0x0b, 0x07, 0x48, 0xc0, 0x6e, 0x00, 0x03, 0x00, 0x0b, 0x81, 0x42, -0x02, 0xd0, 0x38, 0x1c, 0x90, 0xbc, 0x70, 0x47, 0x00, 0x20, 0xfb, 0xe7, -0x18, 0x03, 0x00, 0x80, 0x00, 0x40, 0x14, 0x40, 0xf8, 0x0d, 0x00, 0x80, -0x98, 0xb4, 0x14, 0x4a, 0xc0, 0x46, 0x00, 0x92, 0x83, 0x00, 0x13, 0x48, -0xc0, 0x58, 0x07, 0x03, 0x3f, 0x0b, 0x12, 0x48, 0xc0, 0x58, 0x02, 0x03, -0x12, 0x0b, 0x11, 0x48, 0xc0, 0x58, 0x00, 0x03, 0x00, 0x0b, 0x10, 0x4c, -0xe4, 0x58, 0x01, 0x23, 0x9b, 0x07, 0x23, 0x43, 0x1b, 0x68, 0x9b, 0x00, -0xcc, 0x00, 0x01, 0x21, 0x98, 0x42, 0x01, 0xd1, 0x08, 0x1c, 0x09, 0xe0, -0x98, 0x42, 0x03, 0xd9, 0x10, 0x1a, 0xda, 0x1b, 0x80, 0x18, 0x00, 0xe0, -0x18, 0x1a, 0x84, 0x42, 0xf4, 0xd3, 0x00, 0x20, 0x98, 0xbc, 0x70, 0x47, -0x55, 0x55, 0x55, 0x55, 0x90, 0x03, 0x00, 0x80, 0x98, 0x03, 0x00, 0x80, -0x78, 0x03, 0x00, 0x80, 0x88, 0x03, 0x00, 0x80, 0x80, 0xb4, 0x13, 0x04, -0x00, 0xd0, 0x01, 0x3a, 0x80, 0x00, 0x0b, 0x1c, 0x13, 0x49, 0x0f, 0x58, -0xc0, 0x46, 0x3b, 0x60, 0x0b, 0x58, 0xc0, 0x46, 0x5a, 0x60, 0x0a, 0x58, -0x08, 0x32, 0x10, 0x4b, 0x1b, 0x58, 0x9a, 0x42, 0x01, 0xd3, 0x0f, 0x4a, -0x12, 0x58, 0x0f, 0x4b, 0x1f, 0x58, 0x01, 0x23, 0x9b, 0x07, 0x3b, 0x43, -0x1b, 0x68, 0x9b, 0x00, 0x17, 0x03, 0x3f, 0x0b, 0x9f, 0x42, 0x06, 0xd1, -0x0a, 0x48, 0xc1, 0x68, 0x01, 0x31, 0xc1, 0x60, 0x01, 0x20, 0x80, 0xbc, -0x70, 0x47, 0x08, 0x4b, 0x1b, 0x58, 0xc0, 0x46, 0x1a, 0x60, 0x0a, 0x50, -0x00, 0x20, 0xf6, 0xe7, 0x78, 0x03, 0x00, 0x80, 0x98, 0x03, 0x00, 0x80, -0x90, 0x03, 0x00, 0x80, 0x88, 0x03, 0x00, 0x80, 0xa0, 0x82, 0x20, 0x40, -0x80, 0x03, 0x00, 0x80, 0xff, 0x5f, 0x2d, 0xe9, 0x48, 0xfe, 0xff, 0xeb, -0x01, 0xb6, 0xa0, 0xe3, 0x01, 0xb1, 0x8b, 0xe2, 0x02, 0x7a, 0xa0, 0xe3, -0x01, 0x6a, 0xa0, 0xe3, 0xc4, 0xa0, 0x9f, 0xe5, 0x01, 0x99, 0xa0, 0xe3, -0x01, 0x56, 0xa0, 0xe3, 0xbc, 0x80, 0x9f, 0xe5, 0x14, 0x40, 0x9b, 0xe5, -0x00, 0x00, 0x54, 0xe3, 0x29, 0x00, 0x00, 0x0a, 0x03, 0x0a, 0x14, 0xe3, -0x17, 0x00, 0x00, 0x0a, 0x08, 0x00, 0x9a, 0xe5, 0x00, 0x00, 0x50, 0xe3, -0x0a, 0x00, 0x00, 0x0a, 0x01, 0x0a, 0x14, 0xe3, 0x03, 0x00, 0x00, 0x0a, -0x00, 0x00, 0xa0, 0xe3, 0xb0, 0x19, 0x00, 0xeb, 0x14, 0x60, 0x85, 0xe5, -0x0e, 0x00, 0x00, 0xea, 0x02, 0x0a, 0x14, 0xe3, 0x0c, 0x00, 0x00, 0x0a, -0x01, 0x00, 0xa0, 0xe3, 0xaa, 0x19, 0x00, 0xeb, 0x08, 0x00, 0x00, 0xea, -0x18, 0x00, 0x9a, 0xe5, 0x01, 0x0a, 0xc0, 0xe3, 0x18, 0x00, 0x8a, 0xe5, -0x1c, 0x00, 0x85, 0xe5, 0x14, 0x60, 0x85, 0xe5, 0x18, 0x00, 0x9a, 0xe5, -0x02, 0x0a, 0xc0, 0xe3, 0x18, 0x00, 0x8a, 0xe5, -0x1c, 0x00, 0x85, 0xe5, 0x14, 0x70, 0x85, 0xe5, 0x01, 0x09, 0x14, 0xe3, -0x01, 0x00, 0x00, 0x0a, 0x99, 0x19, 0x00, 0xeb, 0x14, 0x90, 0x85, 0xe5, -0x02, 0x00, 0x14, 0xe3, 0x3a, 0x00, 0x00, 0x1b, 0x01, 0x00, 0x14, 0xe3, -0x3e, 0x00, 0x00, 0x1b, 0x02, 0x0b, 0x14, 0xe3, 0x42, 0x00, 0x00, 0x1b, -0x01, 0x0b, 0x14, 0xe3, 0x1a, 0x00, 0x00, 0x1b, 0x18, 0x00, 0x98, 0xe5, -0x01, 0x00, 0x80, 0xe2, 0x18, 0x00, 0x88, 0xe5, 0xd2, 0xff, 0xff, 0xea, -0xff, 0x5f, 0xbd, 0xe8, 0x04, 0xf0, 0x5e, 0xe2, 0xf8, 0x0d, 0x00, 0x80, -0x04, 0x83, 0x20, 0x40, 0x10, 0x10, 0x1f, 0xe5, 0x10, 0x30, 0x91, 0xe5, -0x00, 0x20, 0xc3, 0xe1, 0x10, 0x20, 0x81, 0xe5, 0x01, 0x16, 0xa0, 0xe3, -0x0c, 0x20, 0x81, 0xe5, 0x0b, 0x12, 0xa0, 0xe3, 0x00, 0x00, 0x81, 0xe5, -0x18, 0x10, 0x9f, 0xe5, 0xb0, 0x24, 0xd1, 0xe1, 0x01, 0x20, 0x82, 0xe2, -0xb0, 0x24, 0xc1, 0xe1, 0x3c, 0x20, 0x91, 0xe5, 0x00, 0x00, 0x82, 0xe1, -0x3c, 0x00, 0x81, 0xe5, 0x1e, 0xff, 0x2f, 0xe1, 0xa0, 0x82, 0x20, 0x40, -0xff, 0xff, 0xff, 0xea, 0xfe, 0xff, 0xff, 0xea, 0x01, 0x0b, 0xa0, 0xe3, -0x01, 0x16, 0xa0, 0xe3, 0x14, 0x00, 0x81, 0xe5, 0x00, 0x1a, 0x81, 0xe1, -0x24, 0x20, 0x91, 0xe5, 0x70, 0x00, 0x1f, 0xe5, 0x00, 0x00, 0x00, 0x00, -0x20, 0x20, 0x80, 0xe5, 0x28, 0x10, 0x91, 0xe5, 0x00, 0x00, 0x00, 0x00, -0x24, 0x10, 0x80, 0xe5, 0x28, 0x20, 0x90, 0xe5, 0x01, 0x20, 0x82, 0xe2, -0x28, 0x20, 0x80, 0xe5, 0x3f, 0x00, 0x01, 0xe2, 0x3f, 0x00, 0x50, 0xe3, -0x1e, 0xff, 0x2f, 0x11, 0x18, 0x00, 0x9f, 0xe5, 0x00, 0x10, 0x90, 0xe5, -0x01, 0x10, 0x81, 0xe2, 0x00, 0x10, 0x80, 0xe5, 0x02, 0x18, 0xa0, 0xe3, -0x0b, 0x02, 0xa0, 0xe3, 0x00, 0x10, 0x80, 0xe5, 0x1e, 0xff, 0x2f, 0xe1, -0xa0, 0x03, 0x00, 0x80, 0x0b, 0x10, 0xa0, 0xe3, 0x02, 0x19, 0x81, 0xe2, -0x06, 0x07, 0xa0, 0xe3, 0x4c, 0x11, 0x80, 0xe5, 0xff, 0xff, 0xff, 0xea, -0xfe, 0xff, 0xff, 0xea, 0x0c, 0x10, 0xa0, 0xe3, 0x02, 0x19, 0x81, 0xe2, -0x06, 0x07, 0xa0, 0xe3, 0x4c, 0x11, 0x80, 0xe5, 0xff, 0xff, 0xff, 0xea, +0x80, 0x00, 0x10, 0xe3, 0x80, 0x00, 0x80, 0xe3, 0x00, 0xf0, 0x21, 0xe1, +0x00, 0x00, 0x00, 0x12, 0x1e, 0xff, 0x2f, 0xe1, 0x00, 0x00, 0x50, 0xe3, +0x00, 0x00, 0x0f, 0xe1, 0x80, 0x00, 0xc0, 0x13, 0x00, 0xf0, 0x21, 0xe1, +0x1e, 0xff, 0x2f, 0xe1, 0x00, 0x00, 0x0f, 0xe1, 0x80, 0x00, 0xc0, 0xe3, +0x00, 0xf0, 0x21, 0xe1, 0x1e, 0xff, 0x2f, 0xe1, 0x91, 0x00, 0x00, 0xe0, +0x1e, 0xff, 0x2f, 0xe1, 0x01, 0x20, 0x80, 0xe0, 0x01, 0x00, 0x80, 0xe0, +0x1e, 0xff, 0x2f, 0xe1, 0x80, 0xb5, 0x08, 0x4f, 0x64, 0x28, 0x04, 0xd3, +0x64, 0x20, 0x38, 0x63, 0x00, 0x20, 0xc0, 0x43, 0x03, 0xe0, 0x38, 0x63, +0x04, 0x49, 0x05, 0xf0, 0xf7, 0xfa, 0x78, 0x63, 0xb8, 0x63, 0x80, 0xbc, +0x08, 0xbc, 0x18, 0x47, 0x68, 0x0e, 0x00, 0x80, 0x88, 0x13, 0x00, 0x00, +0x80, 0xb4, 0x10, 0x4b, 0x00, 0x22, 0x1f, 0x6b, 0x64, 0x2f, 0x03, 0xd2, +0x09, 0x68, 0x09, 0x68, 0x49, 0x08, 0x02, 0xd2, 0x10, 0x1c, 0x80, 0xbc, +0x70, 0x47, 0x19, 0x1c, 0xdb, 0x6b, 0x4f, 0x6b, 0xbb, 0x42, 0x05, 0xd2, +0x40, 0x68, 0x00, 0x04, 0x00, 0x0c, 0x18, 0x18, 0xc8, 0x63, 0xf1, 0xe7, +0x41, 0x68, 0x05, 0x4b, 0x19, 0x43, 0x41, 0x60, 0x04, 0x48, 0xc1, 0x6b, +0x01, 0x31, 0xc1, 0x63, 0x02, 0x20, 0xe8, 0xe7, 0x68, 0x0e, 0x00, 0x80, +0x00, 0x00, 0x00, 0x80, 0x0c, 0x2b, 0x00, 0x80, 0x90, 0xb5, 0x07, 0x1c, +0x15, 0x4c, 0x00, 0x20, 0x21, 0x6b, 0x64, 0x29, 0x0b, 0xd2, 0xb9, 0x6e, +0x49, 0x08, 0x08, 0xd3, 0x21, 0x6c, 0xa2, 0x6b, 0x91, 0x42, 0x07, 0xd2, +0xfa, 0x1d, 0x39, 0x32, 0x52, 0x8b, 0x89, 0x18, 0x21, 0x64, 0x90, 0xbc, +0x08, 0xbc, 0x18, 0x47, 0x78, 0x6a, 0x39, 0x6b, 0xc0, 0x46, 0x48, 0x62, +0x38, 0x6b, 0x02, 0xf0, 0x23, 0xfe, 0x38, 0x1c, 0x02, 0xf0, 0xde, 0xfa, +0x01, 0x20, 0xbb, 0x23, 0x1b, 0x01, 0xe1, 0x18, 0xc8, 0x73, 0x05, 0x49, +0x0a, 0x6c, 0x12, 0x18, 0x0a, 0x64, 0x04, 0x49, 0x8a, 0x6d, 0x12, 0x18, +0x8a, 0x65, 0xe4, 0xe7, 0x68, 0x0e, 0x00, 0x80, 0x0c, 0x2b, 0x00, 0x80, +0xa4, 0x2a, 0x00, 0x80, 0x80, 0xb4, 0x0a, 0x48, 0xc0, 0x6d, 0x02, 0x23, +0x18, 0x40, 0x09, 0x4a, 0x00, 0x21, 0x00, 0x28, 0x03, 0xd0, 0xd1, 0x63, +0x11, 0x64, 0x80, 0xbc, 0x70, 0x47, 0x06, 0x48, 0x07, 0x68, 0x7b, 0x1c, +0x03, 0x60, 0x0a, 0x2f, 0xf7, 0xd3, 0x01, 0x60, 0xf3, 0xe7, 0x00, 0x00, +0xa4, 0x2a, 0x00, 0x80, 0x68, 0x0e, 0x00, 0x80, 0xe0, 0x01, 0x00, 0x80, +0x70, 0x47, 0x02, 0x04, 0x12, 0x0c, 0x00, 0x0c, 0x10, 0x18, 0x0a, 0x04, +0x12, 0x0c, 0x09, 0x0c, 0x51, 0x18, 0x08, 0x18, 0x01, 0x0c, 0x05, 0xd0, +0x01, 0x04, 0x09, 0x0c, 0x00, 0x0c, 0x08, 0x18, 0x01, 0x0c, 0xf9, 0xd1, +0x00, 0x04, 0x00, 0x0c, 0x70, 0x47, 0x80, 0xb4, 0x00, 0x22, 0x00, 0x29, +0x18, 0xd0, 0x4f, 0x08, 0x7b, 0x1e, 0x00, 0x2f, +0x06, 0xd0, 0x07, 0x88, 0xba, 0x18, 0x02, 0x30, 0x1f, 0x1c, 0x01, 0x3b, +0x00, 0x2f, 0xf8, 0xd1, 0x49, 0x08, 0x03, 0xd3, 0x00, 0x88, 0x00, 0x06, +0x00, 0x0e, 0x82, 0x18, 0x10, 0x0c, 0x05, 0xd0, 0x10, 0x04, 0x00, 0x0c, +0x11, 0x0c, 0x42, 0x18, 0x10, 0x0c, 0xf9, 0xd1, 0x10, 0x04, 0x00, 0x0c, +0x80, 0xbc, 0x70, 0x47, 0x80, 0xb5, 0x83, 0x89, 0xc7, 0x89, 0xfb, 0x18, +0x07, 0x8a, 0xfb, 0x18, 0x47, 0x8a, 0xfb, 0x18, 0x40, 0x7a, 0x00, 0x02, +0xc7, 0x18, 0x38, 0x0c, 0x05, 0xd0, 0x38, 0x04, 0x00, 0x0c, 0x3b, 0x0c, +0xc7, 0x18, 0x38, 0x0c, 0xf9, 0xd1, 0x08, 0x1c, 0x11, 0x1c, 0xff, 0xf7, +0xc8, 0xff, 0x01, 0x1c, 0x38, 0x1c, 0xff, 0xf7, 0xb0, 0xff, 0x80, 0xbc, +0x08, 0xbc, 0x18, 0x47, 0x90, 0xb5, 0x02, 0x23, 0x82, 0x68, 0x1a, 0x40, +0x00, 0x27, 0x00, 0x2a, 0x0f, 0xd0, 0x0a, 0x4a, 0x93, 0x69, 0x01, 0x33, +0x93, 0x61, 0x0a, 0x68, 0x8b, 0x68, 0x9a, 0x18, 0x00, 0x68, 0x1c, 0x18, +0x57, 0x81, 0x09, 0x69, 0x10, 0x1c, 0xff, 0xf7, 0xac, 0xff, 0xc0, 0x43, +0x60, 0x81, 0x38, 0x1c, 0x90, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, +0x0c, 0x2b, 0x00, 0x80, 0x90, 0xb5, 0x04, 0x23, 0x82, 0x68, 0x1a, 0x40, +0x00, 0x27, 0x00, 0x2a, 0x11, 0xd0, 0x4a, 0x68, 0x52, 0x09, 0x0e, 0xd3, +0x09, 0x4a, 0x13, 0x6a, 0x01, 0x33, 0x13, 0x62, 0xcb, 0x68, 0x02, 0x68, +0x9c, 0x18, 0x01, 0x23, 0x9b, 0x07, 0x08, 0x3a, 0x1a, 0x43, 0x12, 0x68, +0x00, 0xf0, 0x2e, 0xf8, 0x20, 0x82, 0x38, 0x1c, 0x90, 0xbc, 0x08, 0xbc, +0x18, 0x47, 0x00, 0x00, 0x0c, 0x2b, 0x00, 0x80, 0x90, 0xb5, 0x80, 0x23, +0x82, 0x68, 0x1a, 0x40, 0x00, 0x24, 0x00, 0x2a, 0x15, 0xd0, 0x4a, 0x68, +0x92, 0x09, 0x12, 0xd3, 0x0b, 0x4a, 0xd3, 0x69, 0x01, 0x33, 0xd3, 0x61, +0xcb, 0x68, 0x02, 0x68, 0x9f, 0x18, 0x01, 0x23, 0x9b, 0x07, 0x08, 0x3a, +0x1a, 0x43, 0x12, 0x68, 0x00, 0xf0, 0x0e, 0xf8, 0x00, 0x28, 0x00, 0xd1, +0x04, 0x48, 0xc0, 0x46, 0xf8, 0x80, 0x20, 0x1c, 0x90, 0xbc, 0x08, 0xbc, +0x18, 0x47, 0x00, 0x00, 0x0c, 0x2b, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, +0xb0, 0xb5, 0x14, 0x1c, 0x05, 0x1c, 0x0f, 0x1c, 0x38, 0x69, 0xb9, 0x68, +0x41, 0x18, 0x38, 0x68, 0xff, 0xf7, 0x53, 0xff, 0xc0, 0x43, 0x01, 0x04, +0x09, 0x0c, 0x20, 0x1c, 0xff, 0xf7, 0x39, 0xff, 0x04, 0x1c, 0xb8, 0x68, +0x79, 0x69, 0x40, 0x18, 0x69, 0x68, 0x88, 0x42, 0x0c, 0xd2, 0x2a, 0x68, +0x12, 0x18, 0x09, 0x1a, 0x10, 0x1c, 0x00, 0xf0, 0x05, 0xf9, 0xc0, 0x43, +0x01, 0x04, 0x09, 0x0c, 0x20, 0x1c, 0xff, 0xf7, 0x26, 0xff, 0x04, 0x1c, +0xe0, 0x43, 0x00, 0x04, 0x00, 0x0c, 0xb0, 0xbc, 0x08, 0xbc, 0x18, 0x47, +0x80, 0xb5, 0x07, 0x1c, 0xb8, 0x6b, 0xc0, 0x08, 0x1a, 0xd3, 0xb8, 0x6a, +0xf9, 0x6b, 0x40, 0x18, 0x79, 0x6c, 0x00, 0xf0, 0xed, 0xf8, 0xc0, 0x43, +0x01, 0x04, 0x09, 0x0c, 0x0a, 0x48, 0x07, 0xd0, 0x20, 0x23, 0xb9, 0x69, +0x19, 0x43, 0xb9, 0x61, 0x01, 0x6b, 0x01, 0x31, 0x01, 0x63, 0x07, 0xe0, +0xff, 0x23, 0x01, 0x33, 0xb9, 0x69, 0x19, 0x43, 0xb9, 0x61, 0x41, 0x6a, +0x01, 0x31, 0x41, 0x62, 0x00, 0x20, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, +0x0c, 0x2b, 0x00, 0x80, 0x80, 0xb5, 0x07, 0x1c, 0xb8, 0x6b, 0x41, 0x09, +0x1c, 0xd3, 0xc0, 0x08, 0x1a, 0xd3, 0xf8, 0x1d, 0x39, 0x30, 0x00, 0x7b, +0x06, 0x28, 0x15, 0xd1, 0x38, 0x1c, 0x00, 0xf0, 0x53, 0xf8, 0x01, 0x1c, +0x0a, 0x48, 0x07, 0xd0, 0x40, 0x23, 0xb9, 0x69, +0x19, 0x43, 0xb9, 0x61, 0x81, 0x6b, 0x01, 0x31, 0x81, 0x63, 0x07, 0xe0, +0x01, 0x23, 0x9b, 0x02, 0xb9, 0x69, 0x19, 0x43, 0xb9, 0x61, 0xc1, 0x6a, +0x01, 0x31, 0xc1, 0x62, 0x00, 0x20, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, +0x0c, 0x2b, 0x00, 0x80, 0xb0, 0xb5, 0x07, 0x1c, 0xb8, 0x6b, 0x81, 0x09, +0x2c, 0xd3, 0xc0, 0x08, 0x2a, 0xd3, 0xf8, 0x1d, 0x39, 0x30, 0x00, 0x7b, +0x11, 0x28, 0x25, 0xd1, 0xb8, 0x6a, 0x39, 0x6c, 0x40, 0x18, 0x01, 0x23, +0x9b, 0x07, 0x06, 0x30, 0x18, 0x43, 0x00, 0x68, 0x05, 0x04, 0x2d, 0x0c, +0x0f, 0x4c, 0x11, 0xd0, 0x38, 0x1c, 0x00, 0xf0, 0x1f, 0xf8, 0x00, 0x28, +0x0c, 0xd0, 0xa8, 0x42, 0x02, 0xd1, 0x0c, 0x4b, 0x98, 0x42, 0x07, 0xd0, +0x80, 0x23, 0xb8, 0x69, 0x18, 0x43, 0xb8, 0x61, 0x60, 0x6b, 0x01, 0x30, +0x60, 0x63, 0x07, 0xe0, 0x01, 0x23, 0x5b, 0x02, 0xb8, 0x69, 0x18, 0x43, +0xb8, 0x61, 0xa0, 0x6a, 0x01, 0x30, 0xa0, 0x62, 0x00, 0x20, 0xb0, 0xbc, +0x08, 0xbc, 0x18, 0x47, 0x0c, 0x2b, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, +0xf0, 0xb5, 0xff, 0xb0, 0x99, 0xb0, 0x04, 0x1c, 0xe0, 0x6b, 0x61, 0x6c, +0x09, 0x18, 0x03, 0xaa, 0x85, 0x18, 0xa3, 0x6a, 0x00, 0x20, 0x8a, 0x08, +0x01, 0x32, 0x97, 0x92, 0x07, 0xd0, 0x82, 0x00, 0x9f, 0x58, 0x03, 0xae, +0xb7, 0x50, 0x97, 0x9a, 0x01, 0x30, 0x82, 0x42, 0xf7, 0xd8, 0x60, 0x6a, +0x01, 0x23, 0x9b, 0x07, 0x04, 0x30, 0x18, 0x43, 0x00, 0x68, 0xc0, 0x46, +0x02, 0x90, 0x02, 0xaf, 0x3f, 0x88, 0x03, 0xa8, 0xff, 0xf7, 0x87, 0xfe, +0xc0, 0x43, 0x01, 0x04, 0x09, 0x0c, 0x38, 0x1c, 0xff, 0xf7, 0x6d, 0xfe, +0x07, 0x1c, 0xe0, 0x6b, 0xa1, 0x6c, 0x40, 0x18, 0x61, 0x6a, 0x01, 0x23, +0x9b, 0x07, 0x08, 0x31, 0x19, 0x43, 0x09, 0x68, 0xc0, 0x46, 0x01, 0x91, +0x01, 0xa9, 0x09, 0x88, 0x01, 0x31, 0x88, 0x42, 0x0c, 0xd2, 0xa2, 0x6a, +0x12, 0x18, 0x09, 0x1a, 0x10, 0x1c, 0x00, 0xf0, 0x2f, 0xf8, 0xc0, 0x43, +0x01, 0x04, 0x09, 0x0c, 0x38, 0x1c, 0xff, 0xf7, 0x50, 0xfe, 0x07, 0x1c, +0xa8, 0x89, 0xe9, 0x89, 0x08, 0x18, 0x29, 0x8a, 0x08, 0x18, 0x69, 0x8a, +0x08, 0x18, 0x69, 0x7a, 0x09, 0x02, 0x08, 0x18, 0xa1, 0x6c, 0x62, 0x6c, +0x89, 0x1a, 0x0a, 0x04, 0x12, 0x0c, 0x11, 0x02, 0x12, 0x0a, 0x11, 0x43, +0x09, 0x04, 0x09, 0x0c, 0x09, 0x18, 0x08, 0x0c, 0x05, 0xd0, 0x08, 0x04, +0x00, 0x0c, 0x09, 0x0c, 0x41, 0x18, 0x08, 0x0c, 0xf9, 0xd1, 0x38, 0x1c, +0xff, 0xf7, 0x2f, 0xfe, 0xc0, 0x43, 0x00, 0x04, 0x00, 0x0c, 0x7f, 0xb0, +0x19, 0xb0, 0xf0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0xb0, 0xb4, 0x00, 0x22, +0x00, 0x29, 0x2e, 0xd0, 0x83, 0x07, 0x9b, 0x0f, 0xdc, 0x00, 0x47, 0x18, +0x04, 0x25, 0xef, 0x1b, 0xbf, 0x07, 0xbf, 0x0f, 0xff, 0x00, 0x80, 0x08, +0x80, 0x00, 0x59, 0x18, 0x03, 0x31, 0x89, 0x08, 0x4d, 0x1e, 0x02, 0xc8, +0xe1, 0x40, 0xa1, 0x40, 0x6b, 0x1e, 0x00, 0x2d, 0x09, 0xd0, 0x0c, 0x04, +0x24, 0x0c, 0xa2, 0x18, 0x09, 0x0c, 0x8a, 0x18, 0x02, 0xc8, 0x1c, 0x1c, +0x01, 0x3b, 0x00, 0x2c, 0xf5, 0xd1, 0xb9, 0x40, 0x08, 0x1c, 0xf8, 0x40, +0x01, 0x04, 0x09, 0x0c, 0x89, 0x18, 0x00, 0x0c, 0x42, 0x18, 0x10, 0x0c, +0x05, 0xd0, 0x10, 0x04, 0x00, 0x0c, 0x11, 0x0c, 0x42, 0x18, 0x10, 0x0c, +0xf9, 0xd1, 0x10, 0x04, 0x00, 0x0c, 0xb0, 0xbc, 0x70, 0x47, 0x00, 0x00, +0x90, 0xb4, 0x00, 0x20, 0x01, 0x27, 0x11, 0x49, 0x42, 0x00, 0x12, 0x18, +0xd2, 0x00, 0x53, 0x18, 0x9c, 0x68, 0x01, 0x23, +0x9b, 0x07, 0x23, 0x43, 0x1b, 0x68, 0x1b, 0x03, 0x1b, 0x0b, 0x8a, 0x58, +0x12, 0x03, 0x12, 0x0b, 0x93, 0x42, 0x0c, 0xd1, 0x01, 0x30, 0x04, 0x28, +0xec, 0xd3, 0x08, 0x48, 0xc0, 0x6a, 0x01, 0x03, 0x09, 0x0b, 0x07, 0x48, +0x00, 0x6f, 0x00, 0x03, 0x00, 0x0b, 0x81, 0x42, 0x02, 0xd0, 0x38, 0x1c, +0x90, 0xbc, 0x70, 0x47, 0x00, 0x20, 0xfb, 0xe7, 0xa8, 0x03, 0x00, 0x80, +0x00, 0x40, 0x14, 0x40, 0x68, 0x0e, 0x00, 0x80, 0x98, 0xb4, 0x14, 0x4a, +0xc0, 0x46, 0x00, 0x92, 0x83, 0x00, 0x13, 0x48, 0xc0, 0x58, 0x07, 0x03, +0x3f, 0x0b, 0x12, 0x48, 0xc0, 0x58, 0x02, 0x03, 0x12, 0x0b, 0x11, 0x48, +0xc0, 0x58, 0x00, 0x03, 0x00, 0x0b, 0x10, 0x4c, 0xe4, 0x58, 0x01, 0x23, +0x9b, 0x07, 0x23, 0x43, 0x1b, 0x68, 0x9b, 0x00, 0xcc, 0x00, 0x01, 0x21, +0x98, 0x42, 0x01, 0xd1, 0x08, 0x1c, 0x09, 0xe0, 0x98, 0x42, 0x03, 0xd9, +0x10, 0x1a, 0xda, 0x1b, 0x80, 0x18, 0x00, 0xe0, 0x18, 0x1a, 0x84, 0x42, +0xf4, 0xd3, 0x00, 0x20, 0x98, 0xbc, 0x70, 0x47, 0x55, 0x55, 0x55, 0x55, +0x20, 0x04, 0x00, 0x80, 0x28, 0x04, 0x00, 0x80, 0x08, 0x04, 0x00, 0x80, +0x18, 0x04, 0x00, 0x80, 0x80, 0xb4, 0x13, 0x04, 0x00, 0xd0, 0x01, 0x3a, +0x80, 0x00, 0x0b, 0x1c, 0x13, 0x49, 0x0f, 0x58, 0xc0, 0x46, 0x3b, 0x60, +0x0b, 0x58, 0xc0, 0x46, 0x5a, 0x60, 0x0a, 0x58, 0x08, 0x32, 0x10, 0x4b, +0x1b, 0x58, 0x9a, 0x42, 0x01, 0xd3, 0x0f, 0x4a, 0x12, 0x58, 0x0f, 0x4b, +0x1f, 0x58, 0x01, 0x23, 0x9b, 0x07, 0x3b, 0x43, 0x1b, 0x68, 0x9b, 0x00, +0x17, 0x03, 0x3f, 0x0b, 0x9f, 0x42, 0x06, 0xd1, 0x0a, 0x48, 0xc1, 0x68, +0x01, 0x31, 0xc1, 0x60, 0x01, 0x20, 0x80, 0xbc, 0x70, 0x47, 0x08, 0x4b, +0x1b, 0x58, 0xc0, 0x46, 0x1a, 0x60, 0x0a, 0x50, 0x00, 0x20, 0xf6, 0xe7, +0x08, 0x04, 0x00, 0x80, 0x28, 0x04, 0x00, 0x80, 0x20, 0x04, 0x00, 0x80, +0x18, 0x04, 0x00, 0x80, 0xa0, 0x82, 0x20, 0x40, 0x10, 0x04, 0x00, 0x80, +0xff, 0x5f, 0x2d, 0xe9, 0x48, 0xfe, 0xff, 0xeb, 0x01, 0xb6, 0xa0, 0xe3, +0x01, 0xb1, 0x8b, 0xe2, 0x02, 0x8a, 0xa0, 0xe3, 0x01, 0x7a, 0xa0, 0xe3, +0x01, 0xa9, 0xa0, 0xe3, 0x01, 0x56, 0xa0, 0xe3, 0xc8, 0x60, 0x9f, 0xe5, +0xc8, 0x90, 0x9f, 0xe5, 0x14, 0x40, 0x9b, 0xe5, 0x00, 0x00, 0x54, 0xe3, +0x2c, 0x00, 0x00, 0x0a, 0x03, 0x0a, 0x14, 0xe3, 0x11, 0x00, 0x00, 0x0a, +0x0c, 0x00, 0x96, 0xe5, 0x00, 0x00, 0x50, 0xe3, 0x21, 0x00, 0x00, 0x0a, +0x01, 0x0a, 0x14, 0xe3, 0x05, 0x00, 0x00, 0x0a, 0x1c, 0x00, 0x96, 0xe5, +0x01, 0x0a, 0xc0, 0xe3, 0x1c, 0x00, 0x86, 0xe5, 0x1c, 0x00, 0x85, 0xe5, +0x14, 0x70, 0x85, 0xe5, 0x06, 0x00, 0x00, 0xea, 0x02, 0x0a, 0x14, 0xe3, +0x04, 0x00, 0x00, 0x0a, 0x1c, 0x00, 0x96, 0xe5, 0x02, 0x0a, 0xc0, 0xe3, +0x1c, 0x00, 0x86, 0xe5, 0x1c, 0x00, 0x85, 0xe5, 0x14, 0x80, 0x85, 0xe5, +0x01, 0x09, 0x14, 0xe3, 0x04, 0x00, 0x00, 0x0a, 0x1c, 0x00, 0x96, 0xe5, +0x01, 0x09, 0xc0, 0xe3, 0x1c, 0x00, 0x86, 0xe5, 0x1c, 0x00, 0x85, 0xe5, +0x14, 0xa0, 0x85, 0xe5, 0x02, 0x00, 0x14, 0xe3, 0x40, 0x00, 0x00, 0x1b, +0x01, 0x00, 0x14, 0xe3, 0x54, 0x00, 0x00, 0x1b, 0x02, 0x0b, 0x14, 0xe3, +0x67, 0x00, 0x00, 0x1b, 0x01, 0x0b, 0x14, 0xe3, 0x20, 0x00, 0x00, 0x1b, +0x18, 0x00, 0x99, 0xe5, 0x01, 0x00, 0x80, 0xe2, 0x18, 0x00, 0x89, 0xe5, +0xd5, 0xff, 0xff, 0xea, 0x1c, 0x00, 0x96, 0xe5, 0x01, 0x0a, 0xc0, 0xe3, +0x1c, 0x00, 0x86, 0xe5, 0x1c, 0x00, 0x85, 0xe5, +0x14, 0x70, 0x85, 0xe5, 0xe1, 0xff, 0xff, 0xea, 0xff, 0x5f, 0xbd, 0xe8, +0x04, 0xf0, 0x5e, 0xe2, 0x68, 0x0e, 0x00, 0x80, 0x08, 0x83, 0x20, 0x40, +0x10, 0x10, 0x1f, 0xe5, 0x14, 0x30, 0x91, 0xe5, 0x00, 0x20, 0xc3, 0xe1, +0x14, 0x20, 0x81, 0xe5, 0x01, 0x16, 0xa0, 0xe3, 0x0c, 0x20, 0x81, 0xe5, +0x0b, 0x12, 0xa0, 0xe3, 0x00, 0x00, 0x81, 0xe5, 0x18, 0x10, 0x9f, 0xe5, +0xb0, 0x24, 0xd1, 0xe1, 0x01, 0x20, 0x82, 0xe2, 0xb0, 0x24, 0xc1, 0xe1, +0x3c, 0x20, 0x91, 0xe5, 0x00, 0x00, 0x82, 0xe1, 0x3c, 0x00, 0x81, 0xe5, +0x1e, 0xff, 0x2f, 0xe1, 0xa0, 0x82, 0x20, 0x40, 0xff, 0xff, 0xff, 0xea, +0xfe, 0xff, 0xff, 0xea, 0x01, 0x0b, 0xa0, 0xe3, 0x01, 0x16, 0xa0, 0xe3, +0x14, 0x00, 0x81, 0xe5, 0x00, 0x1a, 0x81, 0xe1, 0x24, 0x20, 0x91, 0xe5, +0x70, 0x00, 0x1f, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x24, 0x20, 0x80, 0xe5, +0x28, 0x10, 0x91, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x28, 0x10, 0x80, 0xe5, +0x2c, 0x20, 0x90, 0xe5, 0x01, 0x20, 0x82, 0xe2, 0x2c, 0x20, 0x80, 0xe5, +0x3f, 0x00, 0x01, 0xe2, 0x3f, 0x00, 0x50, 0xe3, 0x1e, 0xff, 0x2f, 0x11, +0x18, 0x00, 0x9f, 0xe5, 0x00, 0x10, 0x90, 0xe5, 0x01, 0x10, 0x81, 0xe2, +0x00, 0x10, 0x80, 0xe5, 0x02, 0x18, 0xa0, 0xe3, 0x0b, 0x02, 0xa0, 0xe3, +0x00, 0x10, 0x80, 0xe5, 0x1e, 0xff, 0x2f, 0xe1, 0x30, 0x04, 0x00, 0x80, +0x01, 0x06, 0xa0, 0xe3, 0x01, 0x01, 0x80, 0xe2, 0x00, 0x10, 0x90, 0xe5, +0x01, 0x08, 0x11, 0xe3, 0x0b, 0x10, 0xa0, 0xe3, 0x02, 0x19, 0x81, 0xe2, +0x05, 0x00, 0x00, 0x1a, 0x00, 0x20, 0x90, 0xe5, 0x42, 0x28, 0xb0, 0xe1, +0x05, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x90, 0xe5, 0x02, 0x0c, 0x10, 0xe3, +0x02, 0x00, 0x00, 0x0a, 0x06, 0x07, 0xa0, 0xe3, 0x4c, 0x11, 0x80, 0xe5, +0x03, 0x00, 0x00, 0xea, 0x0c, 0x00, 0x9f, 0xe5, 0x00, 0x00, 0x00, 0x00, +0x40, 0x10, 0x80, 0xe5, 0xff, 0xff, 0xff, 0xea, 0xfe, 0xff, 0xff, 0xea, +0x00, 0x00, 0x00, 0x80, 0x01, 0x06, 0xa0, 0xe3, 0x01, 0x01, 0x80, 0xe2, +0x00, 0x10, 0x90, 0xe5, 0x01, 0x08, 0x11, 0xe3, 0x0c, 0x10, 0xa0, 0xe3, +0x02, 0x19, 0x81, 0xe2, 0x05, 0x00, 0x00, 0x1a, 0x00, 0x20, 0x90, 0xe5, +0x42, 0x28, 0xb0, 0xe1, 0x05, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x90, 0xe5, +0x02, 0x0c, 0x10, 0xe3, 0x02, 0x00, 0x00, 0x0a, 0x06, 0x07, 0xa0, 0xe3, +0x4c, 0x11, 0x80, 0xe5, 0x03, 0x00, 0x00, 0xea, 0x4c, 0x00, 0x1f, 0xe5, +0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x80, 0xe5, 0xff, 0xff, 0xff, 0xea, 0xfe, 0xff, 0xff, 0xea, 0x02, 0x1b, 0xa0, 0xe3, 0x01, 0x06, 0xa0, 0xe3, -0x14, 0x10, 0x80, 0xe5, 0x1e, 0xff, 0x2f, 0xe1, 0x04, 0x21, 0x1f, 0xe5, -0x10, 0x30, 0x92, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x80, 0xe5, -0x18, 0x00, 0x92, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0xe5, -0x00, 0x10, 0xa0, 0xe3, 0x10, 0x10, 0x82, 0xe5, 0x01, 0x06, 0xa0, 0xe3, -0x18, 0x10, 0x82, 0xe5, 0x0c, 0x10, 0x80, 0xe5, 0x18, 0x10, 0x92, 0xe5, +0x14, 0x10, 0x80, 0xe5, 0x1e, 0xff, 0x2f, 0xe1, 0x80, 0x21, 0x1f, 0xe5, +0x14, 0x30, 0x92, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x80, 0xe5, +0x1c, 0x00, 0x92, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0xe5, +0x00, 0x10, 0xa0, 0xe3, 0x14, 0x10, 0x82, 0xe5, 0x01, 0x06, 0xa0, 0xe3, +0x1c, 0x10, 0x82, 0xe5, 0x0c, 0x10, 0x80, 0xe5, 0x1c, 0x10, 0x92, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x10, 0x80, 0xe5, 0x1e, 0xff, 0x2f, 0xe1, -0x44, 0x21, 0x1f, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x18, 0x10, 0x82, 0xe5, -0x01, 0x16, 0xa0, 0xe3, 0x10, 0x00, 0x82, 0xe5, 0x0c, 0x00, 0x81, 0xe5, -0x18, 0x00, 0x92, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x81, 0xe5, +0xc0, 0x21, 0x1f, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x10, 0x82, 0xe5, +0x01, 0x16, 0xa0, 0xe3, 0x14, 0x00, 0x82, 0xe5, 0x0c, 0x00, 0x81, 0xe5, +0x1c, 0x00, 0x92, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x81, 0xe5, 0x1e, 0xff, 0x2f, 0xe1, 0x80, 0xb5, 0x0f, 0x1c, 0x38, 0x1c, 0x00, 0xf0, -0x17, 0xf8, 0x00, 0x28, 0x02, 0xd0, 0x38, 0x1c, 0x00, 0xf0, 0x76, 0xf8, -0x00, 0x20, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x80, 0xb5, 0x0f, 0x1c, -0x38, 0x1c, 0x00, 0xf0, 0x09, 0xf8, 0x00, 0x28, 0x02, 0xd0, 0x38, 0x1c, -0x00, 0xf0, 0x68, 0xf8, 0x00, 0x20, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, -0xf0, 0xb4, 0x07, 0x68, 0x3a, 0x78, 0xd2, 0x07, 0xd2, 0x0f, 0x00, 0x24, -0x00, 0x2a, 0x03, 0xd0, 0xff, 0x22, 0x01, 0x32, +0x17, 0xf8, 0x00, 0x28, 0x02, 0xd0, 0x38, 0x1c, +0x00, 0xf0, 0x92, 0xf8, 0x00, 0x20, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, +0x80, 0xb5, 0x0f, 0x1c, 0x38, 0x1c, 0x00, 0xf0, 0x09, 0xf8, 0x00, 0x28, +0x02, 0xd0, 0x38, 0x1c, 0x00, 0xf0, 0x84, 0xf8, 0x00, 0x20, 0x80, 0xbc, +0x08, 0xbc, 0x18, 0x47, 0xf0, 0xb4, 0x07, 0x68, 0x3a, 0x78, 0xd2, 0x07, +0xd2, 0x0f, 0x00, 0x24, 0x00, 0x2a, 0x03, 0xd0, 0xff, 0x22, 0x01, 0x32, 0x42, 0x60, 0x00, 0xe0, 0x44, 0x60, 0x3a, 0x7b, 0x7b, 0x7b, 0x1b, 0x02, 0x1a, 0x43, 0x81, 0x2a, 0x08, 0xd1, 0x01, 0x23, 0x5b, 0x02, 0x42, 0x68, 0x1a, 0x43, 0x42, 0x60, 0x04, 0x22, 0xbf, 0x18, 0x82, 0x60, 0x00, 0xe0, 0x84, 0x60, 0x3a, 0x7b, 0x7b, 0x7b, 0x1b, 0x02, 0x1a, 0x43, 0x08, 0x2a, 0x06, 0xd1, 0x06, 0x23, 0x41, 0x68, 0x19, 0x43, 0x41, 0x60, 0x81, 0x68, -0x0e, 0x31, 0x2c, 0xe0, 0x13, 0x02, 0x12, 0x0a, 0x12, 0x06, 0x12, 0x0e, -0x1a, 0x43, 0x12, 0x04, 0x12, 0x0c, 0x2e, 0x3a, 0x16, 0x4b, 0x9a, 0x42, -0x24, 0xd8, 0x01, 0x25, 0x42, 0x68, 0x15, 0x43, 0x45, 0x60, 0xba, 0x7b, -0xfb, 0x7b, 0x1b, 0x02, 0x1a, 0x43, 0x12, 0x4b, 0x9a, 0x42, 0x19, 0xd1, -0xfb, 0x1d, 0x09, 0x33, 0x44, 0xcb, 0x9b, 0x07, 0xdb, 0x0e, 0xda, 0x40, -0x5b, 0x42, 0x20, 0x33, 0x9e, 0x40, 0x16, 0x43, 0x03, 0x2e, 0x0f, 0xd1, -0x39, 0x7d, 0x7b, 0x7d, 0x1b, 0x02, 0x19, 0x43, 0x08, 0x29, 0x07, 0xd1, -0x04, 0x21, 0x29, 0x43, 0x41, 0x60, 0x81, 0x68, 0x16, 0x31, 0x81, 0x60, -0x01, 0x21, 0x01, 0xe0, 0x00, 0x21, 0x84, 0x60, 0x08, 0x1c, 0xf0, 0xbc, -0x70, 0x47, 0x00, 0x00, 0xae, 0x05, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, -0x80, 0xb4, 0x42, 0x68, 0xd1, 0x08, 0x3f, 0xd3, 0x01, 0x68, 0x83, 0x68, -0x59, 0x18, 0x02, 0x39, 0x8f, 0x78, 0xff, 0x06, 0xff, 0x0e, 0x05, 0x2f, -0x03, 0xd1, 0xda, 0x1d, 0x0d, 0x32, 0xc2, 0x60, 0x05, 0xe0, 0xbf, 0x00, -0xdb, 0x19, 0xc3, 0x60, 0x08, 0x23, 0x1a, 0x43, 0x42, 0x60, 0x8a, 0x78, -0xd2, 0x06, 0xd2, 0x0e, 0x92, 0x00, 0x02, 0x61, 0x0a, 0x79, 0x4b, 0x79, -0x1b, 0x02, 0x1a, 0x43, 0x13, 0x02, 0x12, 0x0a, 0x12, 0x06, 0x12, 0x0e, -0x1a, 0x43, 0x12, 0x04, 0x12, 0x0c, 0x42, 0x61, 0xca, 0x7a, 0x06, 0x2a, -0x03, 0xd1, 0x10, 0x23, 0x42, 0x68, 0x1a, 0x43, 0x10, 0xe0, 0x11, 0x2a, -0x03, 0xd1, 0x20, 0x23, 0x42, 0x68, 0x1a, 0x43, 0x0a, 0xe0, 0x33, 0x2a, -0x03, 0xd1, 0x40, 0x23, 0x42, 0x68, 0x1a, 0x43, 0x04, 0xe0, 0x32, 0x2a, -0x03, 0xd1, 0x80, 0x23, 0x42, 0x68, 0x1a, 0x43, 0x42, 0x60, 0xc9, 0x7a, -0xc0, 0x46, 0x01, 0x76, 0x80, 0xbc, 0x70, 0x47, 0x0a, 0x78, 0xc0, 0x46, -0x02, 0x60, 0x4b, 0x78, 0x1b, 0x02, 0x1a, 0x43, 0x02, 0x60, 0x8b, 0x78, -0x1b, 0x04, 0x1a, 0x43, 0x02, 0x60, 0xc9, 0x78, 0x09, 0x06, 0x11, 0x43, -0x01, 0x60, 0x70, 0x47, 0xf0, 0xb5, 0x00, 0x21, 0x00, 0x24, 0x00, 0x27, -0x80, 0x6a, 0x02, 0x7b, 0x43, 0x7b, 0x1b, 0x02, 0x1a, 0x43, 0x81, 0x2a, -0x00, 0xd1, 0x04, 0x30, 0x02, 0x7b, 0x43, 0x7b, 0x1b, 0x02, 0x1a, 0x43, -0x08, 0x2a, 0x01, 0xd1, 0x0e, 0x30, 0x24, 0xe0, 0x13, 0x02, 0x12, 0x0a, -0x12, 0x06, 0x12, 0x0e, 0x1a, 0x43, 0x12, 0x04, 0x12, 0x0c, 0x2e, 0x3a, -0x42, 0x4b, 0x9a, 0x42, 0x74, 0xd8, 0x82, 0x7b, 0xc3, 0x7b, 0x1b, 0x02, -0x1a, 0x43, 0x40, 0x4b, 0x9a, 0x42, 0x6e, 0xd1, 0xc3, 0x1d, 0x09, 0x33, -0x24, 0xcb, 0x9b, 0x07, 0xdb, 0x0e, 0xda, 0x40, 0x5b, 0x42, 0x20, 0x33, -0x9d, 0x40, 0x15, 0x43, 0x03, 0x2d, 0x63, 0xd1, 0x02, 0x7d, 0x43, 0x7d, -0x1b, 0x02, 0x1a, 0x43, 0x08, 0x2a, 0x5c, 0xd1, 0x16, 0x30, 0x42, 0x7a, -0x11, 0x2a, 0x58, 0xd1, 0x02, 0x78, 0xd2, 0x06, 0xd2, 0x0e, 0x92, 0x00, -0x10, 0x18, 0x02, 0x78, 0x43, 0x78, 0x1b, 0x02, 0x1a, 0x43, 0x43, 0x23, -0x1b, 0x02, 0x9a, 0x42, 0x4b, 0xd1, 0xc3, 0x1d, 0x01, 0x33, 0xd8, 0x1d, -0xe9, 0x30, 0x02, 0x78, 0x35, 0x2a, 0x04, 0xd1, -0x82, 0x78, 0x05, 0x2a, 0x19, 0xd1, 0x01, 0x21, 0x0d, 0xe0, 0x01, 0x2a, -0x01, 0xd1, 0x87, 0x1c, 0x09, 0xe0, 0x03, 0x2a, 0x01, 0xd1, 0x84, 0x1c, -0x05, 0xe0, 0xff, 0x2a, 0x0d, 0xd0, 0x00, 0x2a, 0x01, 0xd1, 0x01, 0x30, -0x02, 0xe0, 0x42, 0x78, 0x10, 0x18, 0x02, 0x30, 0x00, 0x2f, 0xe4, 0xd0, -0x00, 0x2c, 0xe2, 0xd0, 0x00, 0x29, 0xe0, 0xd0, 0x01, 0xe0, 0x00, 0x29, -0x2e, 0xd0, 0xd9, 0x1d, 0x09, 0x31, 0x0e, 0x1c, 0x19, 0x4d, 0xe3, 0x23, -0x1b, 0x01, 0xe8, 0x18, 0xff, 0xf7, 0x78, 0xff, 0x00, 0x2f, 0x04, 0xd0, -0x16, 0x4b, 0xe8, 0x18, 0x39, 0x1c, 0xff, 0xf7, 0x71, 0xff, 0x00, 0x2c, -0x04, 0xd0, 0x14, 0x4b, 0xe8, 0x18, 0x21, 0x1c, 0xff, 0xf7, 0x6a, 0xff, -0x31, 0x1c, 0x12, 0x4d, 0xe8, 0x1d, 0x11, 0x30, 0xff, 0xf7, 0x64, 0xff, -0x00, 0x2f, 0x08, 0xd0, 0xe8, 0x1d, 0x0d, 0x30, 0x39, 0x1c, 0xff, 0xf7, -0x5d, 0xff, 0x02, 0xe0, 0x08, 0xe0, 0x07, 0xe0, 0x06, 0xe0, 0x00, 0x2c, -0x04, 0xd0, 0xe8, 0x1d, 0x09, 0x30, 0x21, 0x1c, 0xff, 0xf7, 0x52, 0xff, -0xf0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x00, 0xae, 0x05, 0x00, 0x00, -0xaa, 0xaa, 0x00, 0x00, 0xf8, 0x0d, 0x00, 0x80, 0x34, 0x0e, 0x00, 0x00, -0x38, 0x0e, 0x00, 0x00, 0x98, 0x6e, 0x21, 0x40, 0x80, 0xb5, 0x07, 0x1c, -0x48, 0x68, 0x80, 0x09, 0x26, 0xd3, 0xb8, 0x6a, 0xc9, 0x68, 0x40, 0x18, -0x01, 0x23, 0x9b, 0x07, 0x02, 0x30, 0x18, 0x43, 0x00, 0x68, 0x00, 0x04, -0x00, 0x0c, 0x11, 0x23, 0x9b, 0x02, 0x98, 0x42, 0x18, 0xd1, 0x78, 0x6a, -0x39, 0x6b, 0xc0, 0x46, 0x48, 0x62, 0x38, 0x6b, 0x02, 0xf0, 0x26, 0xfc, -0x38, 0x1c, 0x02, 0xf0, 0xdc, 0xf8, 0x01, 0x20, 0x07, 0x49, 0xc0, 0x46, -0xc8, 0x70, 0x07, 0x49, 0x4a, 0x6c, 0x12, 0x18, 0x4a, 0x64, 0x06, 0x49, -0x8a, 0x6d, 0x12, 0x18, 0x8a, 0x65, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, -0x00, 0x20, 0xfa, 0xe7, 0xa8, 0x19, 0x00, 0x80, 0x94, 0x2c, 0x00, 0x80, -0x2c, 0x2c, 0x00, 0x80, 0x81, 0x07, 0x19, 0xd0, 0x80, 0x08, 0x80, 0x00, -0x01, 0x23, 0x9b, 0x07, 0x01, 0x1d, 0x18, 0x43, 0x00, 0x68, 0x19, 0x43, -0x09, 0x68, 0x02, 0x02, 0x12, 0x0e, 0x12, 0x06, 0x00, 0x0a, 0xff, 0x23, -0x1b, 0x04, 0x18, 0x40, 0x10, 0x43, 0x0a, 0x0a, 0x12, 0x06, 0x12, 0x0e, -0x10, 0x43, 0x09, 0x02, 0x1b, 0x0a, 0x19, 0x40, 0x08, 0x43, 0x70, 0x47, -0x01, 0x23, 0x9b, 0x07, 0x18, 0x43, 0x00, 0x68, 0x01, 0x06, 0x02, 0x02, -0xff, 0x23, 0x1b, 0x04, 0x1a, 0x40, 0x11, 0x43, 0x02, 0x0a, 0x1b, 0x0a, -0x1a, 0x40, 0x11, 0x43, 0x00, 0x0e, 0x08, 0x43, 0xed, 0xe7, 0x00, 0x00, -0xf0, 0xb5, 0x04, 0x23, 0x81, 0x6b, 0x19, 0x40, 0x00, 0x22, 0x00, 0x29, -0x46, 0xd0, 0xc7, 0x1d, 0x39, 0x37, 0x39, 0x7b, 0x33, 0x29, 0x01, 0xd0, -0x32, 0x29, 0x3f, 0xd1, 0x01, 0x6b, 0xc0, 0x46, 0x4a, 0x65, 0xc4, 0x1d, -0x2d, 0x34, 0xcd, 0x1d, 0x2d, 0x35, 0x00, 0x22, 0x93, 0x00, 0xe6, 0x58, -0xc0, 0x46, 0xee, 0x50, 0x01, 0x32, 0x07, 0x2a, 0xf8, 0xd3, 0x82, 0x6a, -0xc0, 0x46, 0x4a, 0x63, 0x82, 0x6a, 0xc0, 0x46, 0x8a, 0x62, 0x7a, 0x8b, -0xcb, 0x1d, 0x39, 0x33, 0x5a, 0x83, 0x40, 0x6a, 0xc0, 0x46, 0x48, 0x62, -0x12, 0x48, 0x01, 0x27, 0x42, 0x68, 0x00, 0x2a, 0x10, 0xd1, 0xc2, 0x68, -0x00, 0x2a, 0x13, 0xd1, 0x42, 0x69, 0x00, 0x2a, 0x0d, 0xd1, 0x01, 0x61, -0xc1, 0x60, 0x01, 0x6a, 0x02, 0x29, 0x02, 0xd3, 0x20, 0x30, 0x07, 0x71, -0x0c, 0xe0, 0x00, 0xf0, 0x13, 0xf8, 0x09, 0xe0, -0xc2, 0x68, 0x00, 0x2a, 0x02, 0xd1, 0x01, 0x61, 0xc1, 0x60, 0x03, 0xe0, -0x02, 0x69, 0xc0, 0x46, 0x51, 0x65, 0x01, 0x61, 0x38, 0x1c, 0xf0, 0xbc, -0x08, 0xbc, 0x18, 0x47, 0x10, 0x1c, 0xfa, 0xe7, 0xfc, 0x05, 0x00, 0x80, -0x90, 0xb5, 0x1e, 0x49, 0x00, 0x27, 0xca, 0x68, 0x00, 0x2a, 0x35, 0xd0, -0xc8, 0x1d, 0xf9, 0x30, 0x82, 0x62, 0xca, 0x68, 0x92, 0x6a, 0xc0, 0x46, -0xc2, 0x62, 0xca, 0x69, 0x53, 0x00, 0x9b, 0x18, 0x5b, 0x02, 0x17, 0x4a, -0x9c, 0x18, 0x17, 0x4b, 0xe3, 0x18, 0x82, 0x63, 0x03, 0x63, 0xcb, 0x1d, -0xff, 0x33, 0x5a, 0x33, 0x1f, 0x72, 0x3a, 0x1c, 0xcb, 0x69, 0x00, 0x2b, -0x01, 0xd0, 0xca, 0x61, 0x01, 0xe0, 0x01, 0x23, 0xcb, 0x61, 0x0f, 0x1c, -0xc9, 0x68, 0x49, 0x6a, 0x09, 0x89, 0x01, 0x31, 0x41, 0x63, 0xf8, 0x1d, -0xff, 0x30, 0x3a, 0x30, 0x42, 0x60, 0x02, 0x82, 0x82, 0x60, 0xc2, 0x60, -0x38, 0x1c, 0x00, 0xf0, 0xcb, 0xfa, 0x38, 0x6a, 0x01, 0x30, 0x38, 0x62, -0x38, 0x1c, 0x00, 0xf0, 0x0b, 0xf8, 0x90, 0xbc, 0x08, 0xbc, 0x18, 0x47, -0x38, 0x1c, 0xfa, 0xe7, 0xfc, 0x05, 0x00, 0x80, 0x48, 0xad, 0x20, 0x40, -0x64, 0x07, 0x00, 0x00, 0xf0, 0xb5, 0x07, 0x1c, 0xf9, 0x1d, 0xf9, 0x31, +0x0e, 0x31, 0x3c, 0xe0, 0xc1, 0x23, 0xdb, 0x00, 0x9a, 0x42, 0x03, 0xd1, +0x41, 0x68, 0x24, 0x4b, 0x19, 0x43, 0x3e, 0xe0, 0x23, 0x4b, 0x9a, 0x42, +0x04, 0xd1, 0x01, 0x23, 0x1b, 0x03, 0x41, 0x68, 0x19, 0x43, 0x36, 0xe0, +0x13, 0x02, 0x12, 0x0a, 0x12, 0x06, 0x12, 0x0e, 0x1a, 0x43, 0x12, 0x04, +0x12, 0x0c, 0x2e, 0x3a, 0x1c, 0x4b, 0x9a, 0x42, 0x2d, 0xd8, 0x01, 0x25, +0x42, 0x68, 0x15, 0x43, 0x45, 0x60, 0xba, 0x7b, 0xfb, 0x7b, 0x1b, 0x02, +0x1a, 0x43, 0x18, 0x4b, 0x9a, 0x42, 0x22, 0xd1, 0xfb, 0x1d, 0x09, 0x33, +0x44, 0xcb, 0x9b, 0x07, 0xdb, 0x0e, 0xda, 0x40, 0x5b, 0x42, 0x20, 0x33, +0x9e, 0x40, 0x16, 0x43, 0x03, 0x2e, 0x18, 0xd1, 0x39, 0x7d, 0x7b, 0x7d, +0x1b, 0x02, 0x19, 0x43, 0x08, 0x29, 0x07, 0xd1, 0x04, 0x21, 0x29, 0x43, +0x41, 0x60, 0x81, 0x68, 0x16, 0x31, 0x81, 0x60, 0x01, 0x21, 0x0a, 0xe0, +0xc1, 0x23, 0xdb, 0x00, 0x99, 0x42, 0x04, 0xd1, 0x01, 0x21, 0x89, 0x03, +0x29, 0x43, 0x41, 0x60, 0x00, 0xe0, 0x84, 0x60, 0x00, 0x21, 0x08, 0x1c, +0xf0, 0xbc, 0x70, 0x47, 0x02, 0x40, 0x00, 0x00, 0x81, 0x80, 0x00, 0x00, +0xae, 0x05, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x80, 0xb4, 0x42, 0x68, +0xd1, 0x08, 0x3f, 0xd3, 0x01, 0x68, 0x83, 0x68, 0x59, 0x18, 0x02, 0x39, +0x8f, 0x78, 0x3f, 0x07, 0x3f, 0x0f, 0x05, 0x2f, 0x03, 0xd1, 0xda, 0x1d, +0x0d, 0x32, 0xc2, 0x60, 0x05, 0xe0, 0xbf, 0x00, 0xdb, 0x19, 0xc3, 0x60, +0x08, 0x23, 0x1a, 0x43, 0x42, 0x60, 0x8a, 0x78, 0x12, 0x07, 0x12, 0x0f, +0x92, 0x00, 0x02, 0x61, 0x0a, 0x79, 0x4b, 0x79, 0x1b, 0x02, 0x1a, 0x43, +0x13, 0x02, 0x12, 0x0a, 0x12, 0x06, 0x12, 0x0e, 0x1a, 0x43, 0x12, 0x04, +0x12, 0x0c, 0x42, 0x61, 0xca, 0x7a, 0x06, 0x2a, 0x03, 0xd1, 0x10, 0x23, +0x42, 0x68, 0x1a, 0x43, 0x10, 0xe0, 0x11, 0x2a, 0x03, 0xd1, 0x20, 0x23, +0x42, 0x68, 0x1a, 0x43, 0x0a, 0xe0, 0x33, 0x2a, 0x03, 0xd1, 0x40, 0x23, +0x42, 0x68, 0x1a, 0x43, 0x04, 0xe0, 0x32, 0x2a, 0x03, 0xd1, 0x80, 0x23, +0x42, 0x68, 0x1a, 0x43, 0x42, 0x60, 0xc9, 0x7a, 0xc0, 0x46, 0x01, 0x76, +0x80, 0xbc, 0x70, 0x47, 0x0a, 0x78, 0xc0, 0x46, 0x02, 0x60, 0x4b, 0x78, +0x1b, 0x02, 0x1a, 0x43, 0x02, 0x60, 0x8b, 0x78, 0x1b, 0x04, 0x1a, 0x43, +0x02, 0x60, 0xc9, 0x78, 0x09, 0x06, 0x11, 0x43, 0x01, 0x60, 0x70, 0x47, +0x80, 0xb5, 0x07, 0x1c, 0x48, 0x68, 0x80, 0x09, 0x26, 0xd3, 0xb8, 0x6a, +0xc9, 0x68, 0x40, 0x18, 0x01, 0x23, 0x9b, 0x07, 0x02, 0x30, 0x18, 0x43, +0x00, 0x68, 0x00, 0x04, 0x00, 0x0c, 0x11, 0x23, 0x9b, 0x02, 0x98, 0x42, +0x18, 0xd1, 0x78, 0x6a, 0x39, 0x6b, 0xc0, 0x46, +0x48, 0x62, 0x38, 0x6b, 0x02, 0xf0, 0xd0, 0xf8, 0x38, 0x1c, 0x01, 0xf0, +0x8b, 0xfd, 0x01, 0x20, 0x07, 0x49, 0xc0, 0x46, 0xc8, 0x73, 0x07, 0x49, +0x4a, 0x6c, 0x12, 0x18, 0x4a, 0x64, 0x06, 0x49, 0x8a, 0x6d, 0x12, 0x18, +0x8a, 0x65, 0x80, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x00, 0x20, 0xfa, 0xe7, +0x18, 0x1a, 0x00, 0x80, 0x0c, 0x2b, 0x00, 0x80, 0xa4, 0x2a, 0x00, 0x80, +0x81, 0x07, 0x19, 0xd0, 0x80, 0x08, 0x80, 0x00, 0x01, 0x23, 0x9b, 0x07, +0x01, 0x1d, 0x18, 0x43, 0x00, 0x68, 0x19, 0x43, 0x09, 0x68, 0x02, 0x02, +0x12, 0x0e, 0x12, 0x06, 0x00, 0x0a, 0xff, 0x23, 0x1b, 0x04, 0x18, 0x40, +0x10, 0x43, 0x0a, 0x0a, 0x12, 0x06, 0x12, 0x0e, 0x10, 0x43, 0x09, 0x02, +0x1b, 0x0a, 0x19, 0x40, 0x08, 0x43, 0x70, 0x47, 0x01, 0x23, 0x9b, 0x07, +0x18, 0x43, 0x00, 0x68, 0x01, 0x06, 0x02, 0x02, 0xff, 0x23, 0x1b, 0x04, +0x1a, 0x40, 0x11, 0x43, 0x02, 0x0a, 0x1b, 0x0a, 0x1a, 0x40, 0x11, 0x43, +0x00, 0x0e, 0x08, 0x43, 0xed, 0xe7, 0x00, 0x00, 0xf0, 0xb5, 0x04, 0x23, +0x81, 0x6b, 0x19, 0x40, 0x00, 0x22, 0x00, 0x29, 0x46, 0xd0, 0xc7, 0x1d, +0x39, 0x37, 0x39, 0x7b, 0x33, 0x29, 0x01, 0xd0, 0x32, 0x29, 0x3f, 0xd1, +0x01, 0x6b, 0xc0, 0x46, 0x4a, 0x65, 0xc4, 0x1d, 0x2d, 0x34, 0xcd, 0x1d, +0x2d, 0x35, 0x00, 0x22, 0x93, 0x00, 0xe6, 0x58, 0xc0, 0x46, 0xee, 0x50, +0x01, 0x32, 0x07, 0x2a, 0xf8, 0xd3, 0x82, 0x6a, 0xc0, 0x46, 0x4a, 0x63, +0x82, 0x6a, 0xc0, 0x46, 0x8a, 0x62, 0x7a, 0x8b, 0xcb, 0x1d, 0x39, 0x33, +0x5a, 0x83, 0x40, 0x6a, 0xc0, 0x46, 0x48, 0x62, 0x12, 0x48, 0x01, 0x27, +0x42, 0x68, 0x00, 0x2a, 0x10, 0xd1, 0xc2, 0x68, 0x00, 0x2a, 0x13, 0xd1, +0x42, 0x69, 0x00, 0x2a, 0x0d, 0xd1, 0x01, 0x61, 0xc1, 0x60, 0x01, 0x6a, +0x02, 0x29, 0x02, 0xd3, 0x20, 0x30, 0x07, 0x71, 0x0c, 0xe0, 0x00, 0xf0, +0x13, 0xf8, 0x09, 0xe0, 0xc2, 0x68, 0x00, 0x2a, 0x02, 0xd1, 0x01, 0x61, +0xc1, 0x60, 0x03, 0xe0, 0x02, 0x69, 0xc0, 0x46, 0x51, 0x65, 0x01, 0x61, +0x38, 0x1c, 0xf0, 0xbc, 0x08, 0xbc, 0x18, 0x47, 0x10, 0x1c, 0xfa, 0xe7, +0x6c, 0x06, 0x00, 0x80, 0x80, 0xb5, 0x1e, 0x49, 0x00, 0x22, 0xcb, 0x68, +0x00, 0x2b, 0x34, 0xd0, 0xc8, 0x1d, 0xf9, 0x30, 0x83, 0x62, 0xcb, 0x68, +0x9b, 0x6a, 0xc0, 0x46, 0xc3, 0x62, 0xcf, 0x69, 0x7b, 0x00, 0xdf, 0x19, +0x7f, 0x02, 0x17, 0x4b, 0xff, 0x18, 0xff, 0x37, 0x65, 0x37, 0x83, 0x63, +0x07, 0x63, 0xcb, 0x1d, 0xff, 0x33, 0x5a, 0x33, 0x1a, 0x72, 0xcb, 0x69, +0x00, 0x2b, 0x01, 0xd0, 0xca, 0x61, 0x01, 0xe0, 0x01, 0x23, 0xcb, 0x61, +0x0f, 0x1c, 0xc9, 0x68, 0x49, 0x6a, 0x09, 0x89, 0x01, 0x31, 0x41, 0x63, +0xf8, 0x1d, 0xff, 0x30, 0x3a, 0x30, 0x42, 0x60, 0x02, 0x82, 0x82, 0x60, +0xc2, 0x60, 0x38, 0x1c, 0x00, 0xf0, 0xce, 0xfa, 0x38, 0x6a, 0x01, 0x30, +0x38, 0x62, 0x38, 0x1c, 0x00, 0xf0, 0x0a, 0xf8, 0x80, 0xbc, 0x08, 0xbc, +0x18, 0x47, 0x10, 0x1c, 0xfa, 0xe7, 0x00, 0x00, 0x6c, 0x06, 0x00, 0x80, +0x1c, 0xad, 0x20, 0x40, 0xf0, 0xb5, 0x07, 0x1c, 0xf9, 0x1d, 0xf9, 0x31, 0x88, 0x6a, 0xc2, 0x1d, 0x2d, 0x32, 0x01, 0x23, 0x9b, 0x07, 0x08, 0x32, 0x1a, 0x43, 0xc8, 0x6a, 0x12, 0x68, 0x12, 0x04, 0x12, 0x0c, 0x80, 0x18, 0x82, 0x79, 0xc3, 0x79, 0x1b, 0x02, 0x1a, 0x43, 0x13, 0x02, 0x12, 0x0a, 0x12, 0x06, 0x12, 0x0e, 0x1a, 0x43, 0x12, 0x04, 0x12, 0x0c, 0x02, 0x38, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 02:13: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 37F601065670; Thu, 19 Mar 2009 02:13:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2191D8FC0A; Thu, 19 Mar 2009 02:13:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J2DFcZ044985; Thu, 19 Mar 2009 02:13:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J2DFKv044983; Thu, 19 Mar 2009 02:13:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903190213.n2J2DFKv044983@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 19 Mar 2009 02:13:15 +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: r190013 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/msk 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, 19 Mar 2009 02:13:17 -0000 Author: yongari Date: Thu Mar 19 02:13:14 2009 New Revision: 190013 URL: http://svn.freebsd.org/changeset/base/190013 Log: MFC r187325: Add hardware MAC statistics support. Also added some reserved statistics register definition. Users can get current MAC statistics from dev.msk.%d.stats sysctl node(%d is unit number of a device). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Thu Mar 19 01:43:03 2009 (r190012) +++ stable/7/sys/dev/msk/if_msk.c Thu Mar 19 02:13:14 2009 (r190013) @@ -291,6 +291,11 @@ static void msk_setmulti(struct msk_if_s static void msk_setvlan(struct msk_if_softc *, struct ifnet *); static void msk_setpromisc(struct msk_if_softc *); +static void msk_stats_clear(struct msk_if_softc *); +static void msk_stats_update(struct msk_if_softc *); +static int msk_sysctl_stat32(SYSCTL_HANDLER_ARGS); +static int msk_sysctl_stat64(SYSCTL_HANDLER_ARGS); +static void msk_sysctl_node(struct msk_if_softc *); static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_msk_proc_limit(SYSCTL_HANDLER_ARGS); @@ -1435,6 +1440,7 @@ msk_attach(device_t dev) callout_init_mtx(&sc_if->msk_tick_ch, &sc_if->msk_softc->msk_mtx, 0); TASK_INIT(&sc_if->msk_link_task, 0, msk_link_task, sc_if); + msk_sysctl_node(sc_if); /* Disable jumbo frame for Yukon FE. */ if (sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_FE) @@ -3544,15 +3550,8 @@ msk_init_locked(struct msk_if_softc *sc_ /* Dummy read the Interrupt Source Register. */ CSR_READ_1(sc, MR_ADDR(sc_if->msk_port, GMAC_IRQ_SRC)); - /* Set MIB Clear Counter Mode. */ - gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_PHY_ADDR); - GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac | GM_PAR_MIB_CLR); - /* Read all MIB Counters with Clear Mode set. */ - for (i = 0; i < GM_MIB_CNT_SIZE; i++) - GMAC_READ_2(sc, sc_if->msk_port, GM_MIB_CNT_BASE + 8 * i); - /* Clear MIB Clear Counter Mode. */ - gmac &= ~GM_PAR_MIB_CLR; - GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac); + /* Clear MIB stats. */ + msk_stats_clear(sc_if); /* Disable FCS. */ GMAC_WRITE_2(sc, sc_if->msk_port, GM_RX_CTRL, GM_RXCR_CRC_DIS); @@ -3838,6 +3837,8 @@ msk_stop(struct msk_if_softc *sc_if) GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, val); /* Read again to ensure writing. */ GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL); + /* Update stats and clear counters. */ + msk_stats_update(sc_if); /* Stop Tx BMU. */ CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_txq, Q_CSR), BMU_STOP); @@ -3953,6 +3954,295 @@ msk_stop(struct msk_if_softc *sc_if) sc_if->msk_link = 0; } +/* + * When GM_PAR_MIB_CLR bit of GM_PHY_ADDR is set, reading lower + * counter clears high 16 bits of the counter such that accessing + * lower 16 bits should be the last operation. + */ +#define MSK_READ_MIB32(x, y) \ + (((uint32_t)GMAC_READ_2(sc, x, (y) + 4)) << 16) + \ + (uint32_t)GMAC_READ_2(sc, x, y) +#define MSK_READ_MIB64(x, y) \ + (((uint64_t)MSK_READ_MIB32(x, (y) + 8)) << 32) + \ + (uint64_t)MSK_READ_MIB32(x, y) + +static void +msk_stats_clear(struct msk_if_softc *sc_if) +{ + struct msk_softc *sc; + uint32_t reg; + uint16_t gmac; + int i; + + MSK_IF_LOCK_ASSERT(sc_if); + + sc = sc_if->msk_softc; + /* Set MIB Clear Counter Mode. */ + gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_PHY_ADDR); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac | GM_PAR_MIB_CLR); + /* Read all MIB Counters with Clear Mode set. */ + for (i = GM_RXF_UC_OK; i <= GM_TXE_FIFO_UR; i++) + reg = MSK_READ_MIB32(sc_if->msk_port, i); + /* Clear MIB Clear Counter Mode. */ + gmac &= ~GM_PAR_MIB_CLR; + GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac); +} + +static void +msk_stats_update(struct msk_if_softc *sc_if) +{ + struct msk_softc *sc; + struct ifnet *ifp; + struct msk_hw_stats *stats; + uint16_t gmac; + uint32_t reg; + + MSK_IF_LOCK_ASSERT(sc_if); + + ifp = sc_if->msk_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + sc = sc_if->msk_softc; + stats = &sc_if->msk_stats; + /* Set MIB Clear Counter Mode. */ + gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_PHY_ADDR); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac | GM_PAR_MIB_CLR); + + /* Rx stats. */ + stats->rx_ucast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_UC_OK); + stats->rx_bcast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_BC_OK); + stats->rx_pause_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_MPAUSE); + stats->rx_mcast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_MC_OK); + stats->rx_crc_errs += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_FCS_ERR); + reg = MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE1); + stats->rx_good_octets += + MSK_READ_MIB64(sc_if->msk_port, GM_RXO_OK_LO); + stats->rx_bad_octets += + MSK_READ_MIB64(sc_if->msk_port, GM_RXO_ERR_LO); + stats->rx_runts += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SHT); + stats->rx_runt_errs += + MSK_READ_MIB32(sc_if->msk_port, GM_RXE_FRAG); + stats->rx_pkts_64 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_64B); + stats->rx_pkts_65_127 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_127B); + stats->rx_pkts_128_255 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_255B); + stats->rx_pkts_256_511 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_511B); + stats->rx_pkts_512_1023 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_1023B); + stats->rx_pkts_1024_1518 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_1518B); + stats->rx_pkts_1519_max += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_MAX_SZ); + stats->rx_pkts_too_long += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_LNG_ERR); + stats->rx_pkts_jabbers += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_JAB_PKT); + reg = MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE2); + stats->rx_fifo_oflows += + MSK_READ_MIB32(sc_if->msk_port, GM_RXE_FIFO_OV); + reg = MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE3); + + /* Tx stats. */ + stats->tx_ucast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_UC_OK); + stats->tx_bcast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_BC_OK); + stats->tx_pause_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_MPAUSE); + stats->tx_mcast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_MC_OK); + stats->tx_octets += + MSK_READ_MIB64(sc_if->msk_port, GM_TXO_OK_LO); + stats->tx_pkts_64 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_64B); + stats->tx_pkts_65_127 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_127B); + stats->tx_pkts_128_255 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_255B); + stats->tx_pkts_256_511 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_511B); + stats->tx_pkts_512_1023 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_1023B); + stats->tx_pkts_1024_1518 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_1518B); + stats->tx_pkts_1519_max += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_MAX_SZ); + reg = MSK_READ_MIB32(sc_if->msk_port, GM_TXF_SPARE1); + stats->tx_colls += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_COL); + stats->tx_late_colls += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_LAT_COL); + stats->tx_excess_colls += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_ABO_COL); + stats->tx_multi_colls += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_MUL_COL); + stats->tx_single_colls += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_SNG_COL); + stats->tx_underflows += + MSK_READ_MIB32(sc_if->msk_port, GM_TXE_FIFO_UR); + /* Clear MIB Clear Counter Mode. */ + gmac &= ~GM_PAR_MIB_CLR; + GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac); +} + +static int +msk_sysctl_stat32(SYSCTL_HANDLER_ARGS) +{ + struct msk_softc *sc; + struct msk_if_softc *sc_if; + uint32_t result, *stat; + int off; + + sc_if = (struct msk_if_softc *)arg1; + sc = sc_if->msk_softc; + off = arg2; + stat = (uint32_t *)((uint8_t *)&sc_if->msk_stats + off); + + MSK_IF_LOCK(sc_if); + result = MSK_READ_MIB32(sc_if->msk_port, GM_MIB_CNT_BASE + off * 2); + result += *stat; + MSK_IF_UNLOCK(sc_if); + + return (sysctl_handle_int(oidp, &result, 0, req)); +} + +static int +msk_sysctl_stat64(SYSCTL_HANDLER_ARGS) +{ + struct msk_softc *sc; + struct msk_if_softc *sc_if; + uint64_t result, *stat; + int off; + + sc_if = (struct msk_if_softc *)arg1; + sc = sc_if->msk_softc; + off = arg2; + stat = (uint64_t *)((uint8_t *)&sc_if->msk_stats + off); + + MSK_IF_LOCK(sc_if); + result = MSK_READ_MIB64(sc_if->msk_port, GM_MIB_CNT_BASE + off * 2); + result += *stat; + MSK_IF_UNLOCK(sc_if); + + return (sysctl_handle_quad(oidp, &result, 0, req)); +} + +#undef MSK_READ_MIB32 +#undef MSK_READ_MIB64 + +#define MSK_SYSCTL_STAT32(sc, c, o, p, n, d) \ + SYSCTL_ADD_PROC(c, p, OID_AUTO, o, CTLTYPE_UINT | CTLFLAG_RD, \ + sc, offsetof(struct msk_hw_stats, n), msk_sysctl_stat32, \ + "IU", d) +#define MSK_SYSCTL_STAT64(sc, c, o, p, n, d) \ + SYSCTL_ADD_PROC(c, p, OID_AUTO, o, CTLTYPE_UINT | CTLFLAG_RD, \ + sc, offsetof(struct msk_hw_stats, n), msk_sysctl_stat64, \ + "Q", d) + +static void +msk_sysctl_node(struct msk_if_softc *sc_if) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *schild; + struct sysctl_oid *tree; + + ctx = device_get_sysctl_ctx(sc_if->msk_if_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc_if->msk_if_dev)); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "MSK Statistics"); + schild = child = SYSCTL_CHILDREN(tree); + tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "MSK RX Statistics"); + child = SYSCTL_CHILDREN(tree); + MSK_SYSCTL_STAT32(sc_if, ctx, "ucast_frames", + child, rx_ucast_frames, "Good unicast frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "bcast_frames", + child, rx_bcast_frames, "Good broadcast frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "pause_frames", + child, rx_pause_frames, "Pause frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "mcast_frames", + child, rx_mcast_frames, "Multicast frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "crc_errs", + child, rx_crc_errs, "CRC errors"); + MSK_SYSCTL_STAT64(sc_if, ctx, "good_octets", + child, rx_good_octets, "Good octets"); + MSK_SYSCTL_STAT64(sc_if, ctx, "bad_octets", + child, rx_bad_octets, "Bad octets"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_64", + child, rx_pkts_64, "64 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_65_127", + child, rx_pkts_65_127, "65 to 127 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_128_255", + child, rx_pkts_128_255, "128 to 255 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_256_511", + child, rx_pkts_256_511, "256 to 511 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_512_1023", + child, rx_pkts_512_1023, "512 to 1023 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_1024_1518", + child, rx_pkts_1024_1518, "1024 to 1518 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_1519_max", + child, rx_pkts_1519_max, "1519 to max frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_too_long", + child, rx_pkts_too_long, "frames too long"); + MSK_SYSCTL_STAT32(sc_if, ctx, "jabbers", + child, rx_pkts_jabbers, "Jabber errors"); + MSK_SYSCTL_STAT32(sc_if, ctx, "jabbers", + child, rx_fifo_oflows, "FIFO overflows"); + + tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "MSK TX Statistics"); + child = SYSCTL_CHILDREN(tree); + MSK_SYSCTL_STAT32(sc_if, ctx, "ucast_frames", + child, tx_ucast_frames, "Unicast frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "bcast_frames", + child, tx_bcast_frames, "Broadcast frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "pause_frames", + child, tx_pause_frames, "Pause frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "mcast_frames", + child, tx_mcast_frames, "Multicast frames"); + MSK_SYSCTL_STAT64(sc_if, ctx, "octets", + child, tx_octets, "Octets"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_64", + child, tx_pkts_64, "64 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_65_127", + child, tx_pkts_65_127, "65 to 127 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_128_255", + child, tx_pkts_128_255, "128 to 255 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_256_511", + child, tx_pkts_256_511, "256 to 511 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_512_1023", + child, tx_pkts_512_1023, "512 to 1023 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_1024_1518", + child, tx_pkts_1024_1518, "1024 to 1518 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_1519_max", + child, tx_pkts_1519_max, "1519 to max frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "colls", + child, tx_colls, "Collisions"); + MSK_SYSCTL_STAT32(sc_if, ctx, "late_colls", + child, tx_late_colls, "Late collisions"); + MSK_SYSCTL_STAT32(sc_if, ctx, "excess_colls", + child, tx_excess_colls, "Excessive collisions"); + MSK_SYSCTL_STAT32(sc_if, ctx, "multi_colls", + child, tx_multi_colls, "Multiple collisions"); + MSK_SYSCTL_STAT32(sc_if, ctx, "single_colls", + child, tx_single_colls, "Single collisions"); + MSK_SYSCTL_STAT32(sc_if, ctx, "underflows", + child, tx_underflows, "FIFO underflows"); +} + +#undef MSK_SYSCTL_STAT32 +#undef MSK_SYSCTL_STAT64 + static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) { Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Thu Mar 19 01:43:03 2009 (r190012) +++ stable/7/sys/dev/msk/if_mskreg.h Thu Mar 19 02:13:14 2009 (r190013) @@ -1614,6 +1614,8 @@ (GM_MIB_CNT_BASE + 24) /* Multicast Frames Received OK */ #define GM_RXF_FCS_ERR \ (GM_MIB_CNT_BASE + 32) /* Rx Frame Check Seq. Error */ +#define GM_RXF_SPARE1 \ + (GM_MIB_CNT_BASE + 40) /* Rx spare 1 */ #define GM_RXO_OK_LO \ (GM_MIB_CNT_BASE + 48) /* Octets Received OK Low */ #define GM_RXO_OK_HI \ @@ -1644,8 +1646,12 @@ (GM_MIB_CNT_BASE + 152) /* Rx Frame too Long Error */ #define GM_RXF_JAB_PKT \ (GM_MIB_CNT_BASE + 160) /* Rx Jabber Packet Frame */ +#define GM_RXF_SPARE2 \ + (GM_MIB_CNT_BASE + 168) /* Rx spare 2 */ #define GM_RXE_FIFO_OV \ (GM_MIB_CNT_BASE + 176) /* Rx FIFO overflow Event */ +#define GM_RXF_SPARE3 \ + (GM_MIB_CNT_BASE + 184) /* Rx spare 3 */ #define GM_TXF_UC_OK \ (GM_MIB_CNT_BASE + 192) /* Unicast Frames Xmitted OK */ #define GM_TXF_BC_OK \ @@ -1672,6 +1678,8 @@ (GM_MIB_CNT_BASE + 280) /* 1024-1518 Byte Tx Frame */ #define GM_TXF_MAX_SZ \ (GM_MIB_CNT_BASE + 288) /* 1519-MaxSize Byte Tx Frame */ +#define GM_TXF_SPARE1 \ + (GM_MIB_CNT_BASE + 296) /* Tx spare 1 */ #define GM_TXF_COL \ (GM_MIB_CNT_BASE + 304) /* Tx Collision */ #define GM_TXF_LAT_COL \ @@ -2270,6 +2278,52 @@ struct msk_ring_data { /* Forward decl. */ struct msk_if_softc; +struct msk_hw_stats { + /* Rx stats. */ + uint32_t rx_ucast_frames; + uint32_t rx_bcast_frames; + uint32_t rx_pause_frames; + uint32_t rx_mcast_frames; + uint32_t rx_crc_errs; + uint32_t rx_spare1; + uint64_t rx_good_octets; + uint64_t rx_bad_octets; + uint32_t rx_runts; + uint32_t rx_runt_errs; + uint32_t rx_pkts_64; + uint32_t rx_pkts_65_127; + uint32_t rx_pkts_128_255; + uint32_t rx_pkts_256_511; + uint32_t rx_pkts_512_1023; + uint32_t rx_pkts_1024_1518; + uint32_t rx_pkts_1519_max; + uint32_t rx_pkts_too_long; + uint32_t rx_pkts_jabbers; + uint32_t rx_spare2; + uint32_t rx_fifo_oflows; + uint32_t rx_spare3; + /* Tx stats. */ + uint32_t tx_ucast_frames; + uint32_t tx_bcast_frames; + uint32_t tx_pause_frames; + uint32_t tx_mcast_frames; + uint64_t tx_octets; + uint32_t tx_pkts_64; + uint32_t tx_pkts_65_127; + uint32_t tx_pkts_128_255; + uint32_t tx_pkts_256_511; + uint32_t tx_pkts_512_1023; + uint32_t tx_pkts_1024_1518; + uint32_t tx_pkts_1519_max; + uint32_t tx_spare1; + uint32_t tx_colls; + uint32_t tx_late_colls; + uint32_t tx_excess_colls; + uint32_t tx_multi_colls; + uint32_t tx_single_colls; + uint32_t tx_underflows; +}; + /* Softc for the Marvell Yukon II controller. */ struct msk_softc { struct resource *msk_res[1]; /* I/O resource */ @@ -2340,6 +2394,7 @@ struct msk_if_softc { struct msk_chain_data msk_cdata; struct msk_ring_data msk_rdata; struct msk_softc *msk_softc; /* parent controller */ + struct msk_hw_stats msk_stats; struct task msk_link_task; struct task msk_tx_task; int msk_if_flags; From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 06:44: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 DF635106566B; Thu, 19 Mar 2009 06:44:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB25B8FC1A; Thu, 19 Mar 2009 06:44:00 +0000 (UTC) (envelope-from marcel@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 n2J6i0BX050746; Thu, 19 Mar 2009 06:44:00 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J6i0Cl050743; Thu, 19 Mar 2009 06:44:00 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200903190644.n2J6i0Cl050743@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 19 Mar 2009 06:44: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: r190014 - in stable/7/sbin/geom: . class/part misc 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, 19 Mar 2009 06:44:01 -0000 Author: marcel Date: Thu Mar 19 06:44:00 2009 New Revision: 190014 URL: http://svn.freebsd.org/changeset/base/190014 Log: MFC r184070,185454,185495-185496,188330 -- gpart(8): o Add support for multiple attributes. o Parse the error string returned by the kernel. o Prefer the start and end attributes over the offset and size attributes. Modified: stable/7/sbin/geom/ (props changed) stable/7/sbin/geom/class/part/ (props changed) stable/7/sbin/geom/class/part/geom_part.c stable/7/sbin/geom/misc/ (props changed) Modified: stable/7/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/7/sbin/geom/class/part/geom_part.c Thu Mar 19 02:13:14 2009 (r190013) +++ stable/7/sbin/geom/class/part/geom_part.c Thu Mar 19 06:44:00 2009 (r190014) @@ -63,10 +63,11 @@ static char index_param[] = "index"; static char partcode_param[] = "partcode"; static void gpart_bootcode(struct gctl_req *, unsigned int); +static void gpart_issue(struct gctl_req *, unsigned int); static void gpart_show(struct gctl_req *, unsigned int); struct g_command PUBSYM(class_commands)[] = { - { "add", 0, NULL, { + { "add", 0, gpart_issue, { { 'b', "start", NULL, G_TYPE_STRING }, { 's', "size", NULL, G_TYPE_STRING }, { 't', "type", NULL, G_TYPE_STRING }, @@ -84,25 +85,25 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "geom", NULL }, - { "commit", 0, NULL, G_NULL_OPTS, "geom", NULL }, - { "create", 0, NULL, { + { "commit", 0, gpart_issue, G_NULL_OPTS, "geom", NULL }, + { "create", 0, gpart_issue, { { 's', "scheme", NULL, G_TYPE_STRING }, { 'n', "entries", optional, G_TYPE_STRING }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "provider", NULL }, - { "delete", 0, NULL, { + { "delete", 0, gpart_issue, { { 'i', index_param, NULL, G_TYPE_STRING }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL }, - { "destroy", 0, NULL, { + { "destroy", 0, gpart_issue, { { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL }, - { "modify", 0, NULL, { + { "modify", 0, gpart_issue, { { 'i', index_param, NULL, G_TYPE_STRING }, { 'l', "label", optional, G_TYPE_STRING }, { 't', "type", optional, G_TYPE_STRING }, @@ -110,7 +111,7 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "geom", NULL }, - { "set", 0, NULL, { + { "set", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, { 'i', index_param, NULL, G_TYPE_STRING }, { 'f', "flags", flags, G_TYPE_STRING }, @@ -123,8 +124,8 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, NULL, "[-lr] [geom ...]" }, - { "undo", 0, NULL, G_NULL_OPTS, "geom", NULL }, - { "unset", 0, NULL, { + { "undo", 0, gpart_issue, G_NULL_OPTS, "geom", NULL }, + { "unset", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, { 'i', index_param, NULL, G_TYPE_STRING }, { 'f', "flags", flags, G_TYPE_STRING }, @@ -186,17 +187,23 @@ static struct gprovider * find_provider(struct ggeom *gp, unsigned long long minsector) { struct gprovider *pp, *bestpp; - unsigned long long offset; + const char *s; unsigned long long sector, bestsector; bestpp = NULL; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { - offset = atoll(find_provcfg(pp, "offset")); - sector = offset / pp->lg_sectorsize; + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + sector = atoll(s) / pp->lg_sectorsize; + } else + sector = atoll(s); + if (sector < minsector) continue; if (bestpp != NULL && sector >= bestsector) continue; + bestpp = pp; bestsector = sector; } @@ -216,13 +223,20 @@ fmtsize(int64_t rawsz) static const char * fmtattrib(struct gprovider *pp) { - static char buf[64]; - const char *val; + static char buf[128]; + struct gconfig *gc; + u_int idx; - val = find_provcfg(pp, "attrib"); - if (val == NULL) - return (""); - snprintf(buf, sizeof(buf), " [%s] ", val); + buf[0] = '\0'; + idx = 0; + LIST_FOREACH(gc, &pp->lg_config, lg_config) { + if (strcmp(gc->lg_name, "attrib") != 0) + continue; + idx += snprintf(buf + idx, sizeof(buf) - idx, "%s%s", + (idx == 0) ? " [" : ",", gc->lg_val); + } + if (idx > 0) + snprintf(buf + idx, sizeof(buf) - idx, "] "); return (buf); } @@ -232,7 +246,7 @@ gpart_show_geom(struct ggeom *gp, const struct gprovider *pp; const char *s, *scheme; unsigned long long first, last, sector, end; - unsigned long long offset, length, secsz; + unsigned long long length, secsz; int idx, wblocks, wname; scheme = find_geomcfg(gp, "scheme"); @@ -250,14 +264,24 @@ gpart_show_geom(struct ggeom *gp, const scheme, fmtsize(pp->lg_mediasize)); while ((pp = find_provider(gp, first)) != NULL) { - s = find_provcfg(pp, "offset"); - offset = atoll(s); - sector = offset / secsz; - s = find_provcfg(pp, "length"); - length = atoll(s); + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + sector = atoll(s) / secsz; + } else + sector = atoll(s); + + s = find_provcfg(pp, "end"); + if (s == NULL) { + s = find_provcfg(pp, "length"); + length = atoll(s) / secsz; + end = sector + length - 1; + } else { + end = atoll(s); + length = end - sector + 1; + } s = find_provcfg(pp, "index"); idx = atoi(s); - end = sector + length / secsz; if (first < sector) { printf(" %*llu %*llu %*s - free - (%s)\n", wblocks, first, wblocks, sector - first, @@ -265,16 +289,17 @@ gpart_show_geom(struct ggeom *gp, const fmtsize((sector - first) * secsz)); } printf(" %*llu %*llu %*d %s %s (%s)\n", - wblocks, sector, wblocks, end - sector, + wblocks, sector, wblocks, length, wname, idx, find_provcfg(pp, element), fmtattrib(pp), fmtsize(pp->lg_mediasize)); - first = end; + first = end + 1; } if (first <= last) { + length = last - first + 1; printf(" %*llu %*llu %*s - free - (%s)\n", - wblocks, first, wblocks, last - first + 1, + wblocks, first, wblocks, length, wname, "", - fmtsize((last - first + 1) * secsz)); + fmtsize(length * secsz)); } printf("\n"); } @@ -439,7 +464,7 @@ gpart_write_partcode(struct gctl_req *re } static void -gpart_bootcode(struct gctl_req *req, unsigned int fl __unused) +gpart_bootcode(struct gctl_req *req, unsigned int fl) { const char *s; char *sp; @@ -494,9 +519,42 @@ gpart_bootcode(struct gctl_req *req, uns errx(EXIT_FAILURE, "no -b nor -p"); } - if (bootcode != NULL) { - s = gctl_issue(req); - if (s != NULL) - errx(EXIT_FAILURE, "%s", s); - } + if (bootcode != NULL) + gpart_issue(req, fl); +} + +static void +gpart_issue(struct gctl_req *req, unsigned int fl __unused) +{ + char buf[4096]; + char *errmsg; + const char *errstr; + int error, status; + + bzero(buf, sizeof(buf)); + gctl_rw_param(req, "output", sizeof(buf), buf); + errstr = gctl_issue(req); + if (errstr == NULL || errstr[0] == '\0') { + if (buf[0] != '\0') + printf("%s", buf); + status = EXIT_SUCCESS; + goto done; + } + + error = strtol(errstr, &errmsg, 0); + if (errmsg != errstr) { + while (errmsg[0] == ' ') + errmsg++; + if (errmsg[0] != '\0') + warnc(error, "%s", errmsg); + else + warnc(error, NULL); + } else + warnx("%s", errmsg); + + status = EXIT_FAILURE; + + done: + gctl_free(req); + exit(status); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 07:37: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 D9B1B106564A; Thu, 19 Mar 2009 07:37:00 +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 C65C78FC18; Thu, 19 Mar 2009 07:37:00 +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 n2J7b0cW051976; Thu, 19 Mar 2009 07:37:00 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J7b0OL051975; Thu, 19 Mar 2009 07:37:00 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903190737.n2J7b0OL051975@svn.freebsd.org> From: Robert Noland Date: Thu, 19 Mar 2009 07:37: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: r190015 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Thu, 19 Mar 2009 07:37:02 -0000 Author: rnoland Date: Thu Mar 19 07:37:00 2009 New Revision: 190015 URL: http://svn.freebsd.org/changeset/base/190015 Log: Merge 189868 Fix R600 writeback across suspend/resume. This is likely a NOOP for us, since I haven't ported the suspend/resume code yet. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/r600_cp.c Modified: stable/7/sys/dev/drm/r600_cp.c ============================================================================== --- stable/7/sys/dev/drm/r600_cp.c Thu Mar 19 06:44:00 2009 (r190014) +++ stable/7/sys/dev/drm/r600_cp.c Thu Mar 19 07:37:00 2009 (r190015) @@ -1740,9 +1740,6 @@ static void r600_cp_init_ring_buffer(str RADEON_WRITE(R600_CP_DEBUG, (1 << 27) | (1 << 28)); - /* Start with assuming that writeback doesn't work */ - dev_priv->writeback_works = 0; - /* Initialize the scratch register pointer. This will cause * the scratch register values to be written out to memory * whenever they are updated. From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 07:39: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 A48E0106564A; Thu, 19 Mar 2009 07:39:07 +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 7728E8FC12; Thu, 19 Mar 2009 07:39:07 +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 n2J7d7cb052067; Thu, 19 Mar 2009 07:39:07 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J7d7o0052064; Thu, 19 Mar 2009 07:39:07 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903190739.n2J7d7o0052064@svn.freebsd.org> From: Robert Noland Date: Thu, 19 Mar 2009 07:39: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: r190016 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Thu, 19 Mar 2009 07:39:08 -0000 Author: rnoland Date: Thu Mar 19 07:39:07 2009 New Revision: 190016 URL: http://svn.freebsd.org/changeset/base/190016 Log: Merge 189869 Get rid of any remaining PZERO flags in mtx_sleep() Also, clean up some ifdef mess while I'm here. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_drv.c stable/7/sys/dev/drm/drm_lock.c stable/7/sys/dev/drm/radeon_cp.c Modified: stable/7/sys/dev/drm/drm_drv.c ============================================================================== --- stable/7/sys/dev/drm/drm_drv.c Thu Mar 19 07:37:00 2009 (r190015) +++ stable/7/sys/dev/drm/drm_drv.c Thu Mar 19 07:39:07 2009 (r190016) @@ -666,7 +666,7 @@ void drm_close(void *data) } /* Contention */ retcode = mtx_sleep((void *)&dev->lock.lock_queue, - &dev->dev_lock, PZERO | PCATCH, "drmlk2", 0); + &dev->dev_lock, PCATCH, "drmlk2", 0); if (retcode) break; } Modified: stable/7/sys/dev/drm/drm_lock.c ============================================================================== --- stable/7/sys/dev/drm/drm_lock.c Thu Mar 19 07:37:00 2009 (r190015) +++ stable/7/sys/dev/drm/drm_lock.c Thu Mar 19 07:39:07 2009 (r190016) @@ -82,7 +82,7 @@ int drm_lock(struct drm_device *dev, voi /* Contention */ ret = mtx_sleep((void *)&dev->lock.lock_queue, &dev->dev_lock, - PZERO | PCATCH, "drmlk2", 0); + PCATCH, "drmlk2", 0); if (ret != 0) break; } Modified: stable/7/sys/dev/drm/radeon_cp.c ============================================================================== --- stable/7/sys/dev/drm/radeon_cp.c Thu Mar 19 07:37:00 2009 (r190015) +++ stable/7/sys/dev/drm/radeon_cp.c Thu Mar 19 07:39:07 2009 (r190016) @@ -1708,26 +1708,14 @@ void radeon_do_release(struct drm_device if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) { while ((ret = r600_do_cp_idle(dev_priv)) != 0) { DRM_DEBUG("radeon_do_cp_idle %d\n", ret); -#ifdef __linux__ - schedule(); -#elsif defined(__FreeBSD__) mtx_sleep(&ret, &dev->dev_lock, 0, "rdnrel", 1); -#else - tsleep(&ret, PZERO, "rdnrel", 1); -#endif } } else { while ((ret = radeon_do_cp_idle(dev_priv)) != 0) { DRM_DEBUG("radeon_do_cp_idle %d\n", ret); -#ifdef __linux__ - schedule(); -#elsif defined(__FreeBSD__) mtx_sleep(&ret, &dev->dev_lock, 0, "rdnrel", 1); -#else - tsleep(&ret, PZERO, "rdnrel", 1); -#endif } } if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) { From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 07:40:41 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 BB01E106567D; Thu, 19 Mar 2009 07:40:41 +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 8CB478FC1D; Thu, 19 Mar 2009 07:40:41 +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 n2J7efhb052151; Thu, 19 Mar 2009 07:40:41 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J7efQm052150; Thu, 19 Mar 2009 07:40:41 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903190740.n2J7efQm052150@svn.freebsd.org> From: Robert Noland Date: Thu, 19 Mar 2009 07:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190017 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/atkbdc dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 07:40:42 -0000 Author: rnoland Date: Thu Mar 19 07:40:41 2009 New Revision: 190017 URL: http://svn.freebsd.org/changeset/base/190017 Log: Merge 189870 Teach psm about O_ASYNC This makes Xorg happy if you aren't using moused. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/atkbdc/psm.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/atkbdc/psm.c ============================================================================== --- stable/7/sys/dev/atkbdc/psm.c Thu Mar 19 07:39:07 2009 (r190016) +++ stable/7/sys/dev/atkbdc/psm.c Thu Mar 19 07:40:41 2009 (r190017) @@ -70,7 +70,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include #include #include #include @@ -212,6 +215,7 @@ struct psm_softc { /* Driver status inf struct cdev *bdev; int lasterr; int cmdcount; + struct sigio *async; /* Processes waiting for SIGIO */ }; static devclass_t psm_devclass; #define PSM_SOFTC(unit) \ @@ -1383,6 +1387,7 @@ psmopen(struct cdev *dev, int flag, int sc->mode.level = sc->dflt_mode.level; sc->mode.protocol = sc->dflt_mode.protocol; sc->watchdog = FALSE; + sc->async = NULL; /* flush the event queue */ sc->queue.count = 0; @@ -1522,6 +1527,12 @@ psmclose(struct cdev *dev, int flag, int /* remove anything left in the output buffer */ empty_aux_buffer(sc->kbdc, 10); + /* clean up and sigio requests */ + if (sc->async != NULL) { + funsetown(&sc->async); + sc->async = NULL; + } + /* close is almost always successful */ sc->state &= ~PSM_OPEN; kbdc_lock(sc->kbdc, FALSE); @@ -2083,6 +2094,15 @@ psmioctl(struct cdev *dev, u_long cmd, c break; #endif /* MOUSE_GETHWID */ + case FIONBIO: + case FIOASYNC: + break; + case FIOSETOWN: + error = fsetown(*(int *)addr, &sc->async); + break; + case FIOGETOWN: + *(int *) addr = fgetown(&sc->async); + break; default: return (ENOTTY); } @@ -2972,6 +2992,9 @@ next: wakeup(sc); } selwakeuppri(&sc->rsel, PZERO); + if (sc->async != NULL) { + pgsigio(&sc->async, SIGIO, 0); + } sc->state &= ~PSM_SOFTARMED; splx(s); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 07:41:58 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93E361065674; Thu, 19 Mar 2009 07:41:58 +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 815AF8FC0A; Thu, 19 Mar 2009 07:41:58 +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 n2J7fwfE052220; Thu, 19 Mar 2009 07:41:58 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J7fwqh052219; Thu, 19 Mar 2009 07:41:58 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903190741.n2J7fwqh052219@svn.freebsd.org> From: Robert Noland Date: Thu, 19 Mar 2009 07:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190018 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Thu, 19 Mar 2009 07:41:59 -0000 Author: rnoland Date: Thu Mar 19 07:41:58 2009 New Revision: 190018 URL: http://svn.freebsd.org/changeset/base/190018 Log: Merge 189899 Use the right MSI_REARM for RS600. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/radeon_irq.c Modified: stable/7/sys/dev/drm/radeon_irq.c ============================================================================== --- stable/7/sys/dev/drm/radeon_irq.c Thu Mar 19 07:40:41 2009 (r190017) +++ stable/7/sys/dev/drm/radeon_irq.c Thu Mar 19 07:41:58 2009 (r190018) @@ -229,6 +229,7 @@ irqreturn_t radeon_driver_irq_handler(DR RADEON_WRITE(RADEON_AIC_CNTL, tmp | RS400_MSI_REARM); break; + case CHIP_RS600: case CHIP_RS690: case CHIP_RS740: tmp = RADEON_READ(RADEON_BUS_CNTL) & From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 08:18: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 754731065670; Thu, 19 Mar 2009 08:18: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 484FA8FC0A; Thu, 19 Mar 2009 08:18: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 n2J8IDY9053091; Thu, 19 Mar 2009 08:18:13 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J8ID8R053090; Thu, 19 Mar 2009 08:18:13 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903190818.n2J8ID8R053090@svn.freebsd.org> From: Robert Noland Date: Thu, 19 Mar 2009 08:18: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: r190019 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 08:18:15 -0000 Author: rnoland Date: Thu Mar 19 08:18:13 2009 New Revision: 190019 URL: http://svn.freebsd.org/changeset/base/190019 Log: Record only commit to document that 173573,175381,176624,177480,183397 have all been merged. Not sure where these got lost exactly... Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 12:32: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 6573710656F2; Thu, 19 Mar 2009 12:32:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 528E38FC16; Thu, 19 Mar 2009 12:32:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JCWDAU060841; Thu, 19 Mar 2009 12:32:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JCWDYx060840; Thu, 19 Mar 2009 12:32:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191232.n2JCWDYx060840@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 12:32: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: r190028 - in stable/7/sys: . conf contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 12:32:14 -0000 Author: marius Date: Thu Mar 19 12:32:13 2009 New Revision: 190028 URL: http://svn.freebsd.org/changeset/base/190028 Log: MFC: r182729 Switch sun4v to back to using its own clock.c, which was ressurected in r190005, as the sparc64 version is going to be rototilled and sun4v currently can't be verified to still work with the new sparc64 one due to its overall state. Modified: stable/7/sys/ (props changed) stable/7/sys/conf/files.sun4v stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/conf/files.sun4v ============================================================================== --- stable/7/sys/conf/files.sun4v Thu Mar 19 12:31:59 2009 (r190027) +++ stable/7/sys/conf/files.sun4v Thu Mar 19 12:32:13 2009 (r190028) @@ -34,7 +34,7 @@ libkern/fls.c standard libkern/flsl.c standard sparc64/sparc64/autoconf.c standard sun4v/sun4v/bus_machdep.c standard -sparc64/sparc64/clock.c standard +sun4v/sun4v/clock.c standard sparc64/sparc64/db_disasm.c optional ddb sun4v/sun4v/db_interface.c optional ddb sun4v/sun4v/db_trace.c optional ddb From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 12:55:12 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 450D01065670; Thu, 19 Mar 2009 12:55:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F9F28FC08; Thu, 19 Mar 2009 12:55:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JCtC46061579; Thu, 19 Mar 2009 12:55:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JCtB7p061565; Thu, 19 Mar 2009 12:55:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191255.n2JCtB7p061565@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 12:55: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: r190033 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 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, 19 Mar 2009 12:55:13 -0000 Author: marius Date: Thu Mar 19 12:55:11 2009 New Revision: 190033 URL: http://svn.freebsd.org/changeset/base/190033 Log: MFC: r182730, r182743, r183201 - USIII-based machines can consist of CPUs running at different frequencies (and having different cache sizes) so use the STICK (System TICK) timer, which was introduced due to this and is driven by the same frequency across all CPUs, instead of the TICK timer, whose frequency varies with the CPU clock, to drive hardclock. We use the STICK timers only when absolutely necessary though as the STICK timers are driven at frequencies as low as 5MHz, resulting in bad granularity compared to the TICK timers. However, don't employ the workaround for the BlackBird erratum #1 when using the TICK timer on machines with cheetah-class CPUs for performance reasons. Note that using the STICK counter also causes a hang with USIIIi MP machines for reasons unknown, but these can only consist of identical CPUs anyway. - Given that we only (try to) synchronize the (S)TICK timers of APs with the BSP during startup, we could end up spinning forever in DELAY(9) if that function is migrated to another CPU while we're spinning due to clock drift afterwards, so pin to the CPU in order to avoid migration. Unfortunately, pinning doesn't work at the point DELAY(9) is required by the low-level console drivers, yet, so switch to a function pointer, which is updated accordingly, for implementing DELAY(9). For USIII and beyond, this would also allow to easily use the STICK counter instead of the TICK one here, there's no benefit in doing so however. While at it, use cpu_spinwait(9) for spinning in the delay- functions. This currently is a NOP though. - Don't set the TICK timer of the BSP to 0 during startup as there's no need to do so. - Implement cpu_est_clockrate(). - Unfortunately, USIIIi-based machines don't provide a timecounter device besides the STICK and TICK counters (well, in theory the Tomatillo bridges have a performance counter that can be (ab)used as timecounter by configuring it to count bus cycles, though unlike the performance counter of Schizo bridges, the Tomatillo one is broken and counts Sun knows what in this mode). This means that we've to use a (S)TICK counter for timecounting, which has the old problem of not being in sync across CPUs, so provide an additional timecounter function which binds itself to the BSP but has an adequate low priority. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/clock.h stable/7/sys/sparc64/include/cpufunc.h stable/7/sys/sparc64/include/pcpu.h stable/7/sys/sparc64/include/smp.h stable/7/sys/sparc64/include/tick.h stable/7/sys/sparc64/include/ver.h stable/7/sys/sparc64/sparc64/clock.c stable/7/sys/sparc64/sparc64/exception.S stable/7/sys/sparc64/sparc64/genassym.c stable/7/sys/sparc64/sparc64/locore.S stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/mp_locore.S stable/7/sys/sparc64/sparc64/mp_machdep.c stable/7/sys/sparc64/sparc64/tick.c Modified: stable/7/sys/sparc64/include/clock.h ============================================================================== --- stable/7/sys/sparc64/include/clock.h Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/include/clock.h Thu Mar 19 12:55:11 2009 (r190033) @@ -29,10 +29,12 @@ #ifndef _MACHINE_CLOCK_H_ #define _MACHINE_CLOCK_H_ -extern u_long tick_increment; -extern u_long tick_freq; -extern u_long tick_MHz; +extern void (*delay_func)(int usec); +extern u_long clock_boot; -int sysbeep(int, int); +void delay_boot(int usec); +void delay_tick(int usec); + +int sysbeep(int pitch, int period); #endif /* !_MACHINE_CLOCK_H_ */ Modified: stable/7/sys/sparc64/include/cpufunc.h ============================================================================== --- stable/7/sys/sparc64/include/cpufunc.h Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/include/cpufunc.h Thu Mar 19 12:55:11 2009 (r190033) @@ -174,6 +174,15 @@ int fasword32(u_long asi, void *addr, ui } while (0) /* + * Trick GAS/GCC into compiling access to STICK/STICK_COMPARE independently + * of the selected instruction set. + */ +#define rdstick() rd(asr24) +#define rdstickcmpr() rd(asr25) +#define wrstick(val, xor) wr(asr24, (val), (xor)) +#define wrstickcmpr(val, xor) wr(asr25, (val), (xor)) + +/* * Macro intended to be used instead of wr(asr23, val, xor) for writing to * the TICK_COMPARE register in order to avoid a bug in BlackBird CPUs that * can cause these writes to fail under certain condidtions which in turn Modified: stable/7/sys/sparc64/include/pcpu.h ============================================================================== --- stable/7/sys/sparc64/include/pcpu.h Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/include/pcpu.h Thu Mar 19 12:55:11 2009 (r190033) @@ -53,6 +53,7 @@ struct pmap; vm_offset_t pc_addr; \ u_long pc_tickref; \ u_long pc_tickadj; \ + u_int pc_clock; \ u_int pc_mid; \ u_int pc_node; \ u_int pc_tlb_ctx; \ Modified: stable/7/sys/sparc64/include/smp.h ============================================================================== --- stable/7/sys/sparc64/include/smp.h Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/include/smp.h Thu Mar 19 12:55:11 2009 (r190033) @@ -29,9 +29,10 @@ #ifndef _MACHINE_SMP_H_ #define _MACHINE_SMP_H_ -#define CPU_CLKSYNC 1 -#define CPU_INIT 2 -#define CPU_BOOTSTRAP 3 +#define CPU_TICKSYNC 1 +#define CPU_STICKSYNC 2 +#define CPU_INIT 3 +#define CPU_BOOTSTRAP 4 #ifndef LOCORE @@ -62,6 +63,7 @@ struct cpu_start_args { u_int csa_state; vm_offset_t csa_pcpu; u_long csa_tick; + u_long csa_stick; u_long csa_ver; struct tte csa_ttes[PCPU_PAGES]; }; Modified: stable/7/sys/sparc64/include/tick.h ============================================================================== --- stable/7/sys/sparc64/include/tick.h Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/include/tick.h Thu Mar 19 12:55:11 2009 (r190033) @@ -29,7 +29,9 @@ #ifndef _MACHINE_TICK_H_ #define _MACHINE_TICK_H_ -void tick_init(u_long clock); +extern u_int hardclock_use_stick; + +void tick_clear(void); void tick_start(void); void tick_stop(void); Modified: stable/7/sys/sparc64/include/ver.h ============================================================================== --- stable/7/sys/sparc64/include/ver.h Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/include/ver.h Thu Mar 19 12:55:11 2009 (r190033) @@ -41,6 +41,8 @@ #define VER_MAXTL_SIZE (8) #define VER_MAXWIN_SIZE (5) +#ifndef LOCORE + #define VER_MANUF_MASK (((1L< #include +#include +#include +#include + #include +#include +#include + +void (*delay_func)(int usec); +u_long clock_boot; + +void +DELAY(int usec) +{ -u_long tick_increment; -u_long tick_freq; -u_long tick_MHz; + (*delay_func)(usec); +} void -DELAY(int n) +delay_boot(int usec) { - u_long start, end; + u_long end; - start = rd(tick); - if (n < 0) + if (usec < 0) return; - end = start + (u_long)n * tick_MHz; + + end = rd(tick) + (u_long)usec * clock_boot / 1000000; while (rd(tick) < end) - ; + cpu_spinwait(); +} + +void +delay_tick(int usec) +{ + u_long end; + + if (usec < 0) + return; + + /* + * We avoid being migrated to another CPU with a possibly + * unsynchronized TICK timer while spinning. + */ + sched_pin(); + + end = rd(tick) + (u_long)usec * PCPU_GET(clock) / 1000000; + while (rd(tick) < end) + cpu_spinwait(); + + sched_unpin(); } void Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/sparc64/exception.S Thu Mar 19 12:55:11 2009 (r190033) @@ -550,7 +550,7 @@ END(tl0_sfsr_trap) tl ## traplvl ## _intr level, 1 << level #define TICK(traplvl) \ - tl ## traplvl ## _intr PIL_TICK, 1 + tl ## traplvl ## _intr PIL_TICK, 0x10001 #define INTR_LEVEL(tl) \ INTR(1, tl) ; \ Modified: stable/7/sys/sparc64/sparc64/genassym.c ============================================================================== --- stable/7/sys/sparc64/sparc64/genassym.c Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/sparc64/genassym.c Thu Mar 19 12:55:11 2009 (r190033) @@ -83,10 +83,11 @@ ASSYM(PAGE_SIZE_4M, PAGE_SIZE_4M); ASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu)); ASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state)); #ifdef SUN4U -ASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick)); -ASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver)); ASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid)); +ASSYM(CSA_STICK, offsetof(struct cpu_start_args, csa_stick)); +ASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick)); ASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes)); +ASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver)); #endif #ifdef SUN4V ASSYM(CSA_CPUID, offsetof(struct cpu_start_args, csa_cpuid)); Modified: stable/7/sys/sparc64/sparc64/locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/locore.S Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/sparc64/locore.S Thu Mar 19 12:55:11 2009 (r190033) @@ -54,7 +54,6 @@ ENTRY(_start) wrpr %g0, 0, %cleanwin wrpr %g0, 0, %pil wr %g0, 0, %fprs - wrpr %g0, 0, %tick /* * Get onto our per-CPU panic stack, which precedes the struct pcpu in Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 12:55:11 2009 (r190033) @@ -133,18 +133,6 @@ struct kva_md_info kmi; u_long ofw_vec; u_long ofw_tba; -/* - * Note: timer quality for CPU's is set low to try and prevent them from - * being chosen as the primary timecounter. The CPU counters are not - * synchronized among the CPU's so in MP machines this causes problems - * when calculating the time. With this value the CPU's should only be - * chosen as the primary timecounter as a last resort. - */ - -#define UP_TICK_QUALITY 1000 -#define MP_TICK_QUALITY -100 -static struct timecounter tick_tc; - char sparc64_model[32]; static int cpu_use_vis = 1; @@ -152,7 +140,6 @@ static int cpu_use_vis = 1; cpu_block_copy_t *cpu_block_copy; cpu_block_zero_t *cpu_block_zero; -static timecounter_get_t tick_get_timecount; void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec); void sparc64_shutdown_final(void *dummy, int howto); @@ -180,22 +167,6 @@ cpu_startup(void *arg) vm_paddr_t physsz; int i; - tick_tc.tc_get_timecount = tick_get_timecount; - tick_tc.tc_poll_pps = NULL; - tick_tc.tc_counter_mask = ~0u; - tick_tc.tc_frequency = tick_freq; - tick_tc.tc_name = "tick"; - tick_tc.tc_quality = UP_TICK_QUALITY; -#ifdef SMP - /* - * We do not know if each CPU's tick counter is synchronized. - */ - if (cpu_mp_probe()) - tick_tc.tc_quality = MP_TICK_QUALITY; -#endif - - tc_init(&tick_tc); - physsz = 0; for (i = 0; i < sparc64_nmemreg; i++) physsz += sparc64_memreg[i].mr_size; @@ -217,7 +188,7 @@ cpu_startup(void *arg) if (bootverbose) printf("machine: %s\n", sparc64_model); - cpu_identify(rdpr(ver), tick_freq, PCPU_GET(cpuid)); + cpu_identify(rdpr(ver), PCPU_GET(clock), curcpu); } void @@ -262,12 +233,6 @@ spinlock_exit(void) wrpr(pil, td->td_md.md_saved_pil, 0); } -unsigned -tick_get_timecount(struct timecounter *tc) -{ - return ((unsigned)rd(tick)); -} - void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec) { @@ -278,7 +243,6 @@ sparc64_init(caddr_t mdp, u_long o1, u_l caddr_t kmdp; phandle_t child; phandle_t root; - u_int clock; uint32_t portid; end = 0; @@ -291,6 +255,21 @@ sparc64_init(caddr_t mdp, u_long o1, u_l cpu_impl = VER_IMPL(rdpr(ver)); /* + * Clear (S)TICK timer (including NPT). + */ + tick_clear(); + + /* + * UltraSparc II[e,i] based systems come up with the tick interrupt + * enabled and a handler that resets the tick counter, causing DELAY() + * to not work properly when used early in boot. + * UltraSPARC III based systems come up with the system tick interrupt + * enabled, causing an interrupt storm on startup since they are not + * handled. + */ + tick_stop(); + + /* * Initialize Open Firmware (needed for console). */ OF_init(vec); @@ -329,7 +308,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l pc->pc_tlb_ctx_max = TLB_CTX_USER_MAX; /* - * Determine the OFW node (and ensure the + * Determine the OFW node and frequency of the BSP (and ensure the * BSP is in the device tree in the first place). */ pc->pc_node = 0; @@ -349,17 +328,23 @@ sparc64_init(caddr_t mdp, u_long o1, u_l } if (pc->pc_node == 0) OF_exit(); + if (OF_getprop(child, "clock-frequency", &pc->pc_clock, + sizeof(pc->pc_clock)) <= 0) + OF_exit(); /* - * Initialize the tick counter. Must be before the console is inited - * in order to provide the low-level console drivers with a working - * DELAY(). + * Provide a DELAY() that works before PCPU_REG is set. We can't + * set PCPU_REG without also taking over the trap table or the + * firmware will overwrite it. Unfortunately, it's way to early + * to also take over the trap table at this point. */ - OF_getprop(child, "clock-frequency", &clock, sizeof(clock)); - tick_init(clock); + clock_boot = pc->pc_clock; + delay_func = delay_boot; /* * Initialize the console before printing anything. + * NB: the low-level console drivers require a working DELAY() at + * this point. */ cninit(); @@ -445,6 +430,11 @@ sparc64_init(caddr_t mdp, u_long o1, u_l cpu_setregs(pc); /* + * It's now safe to use the real DELAY(). + */ + delay_func = delay_tick; + + /* * Initialize the message buffer (after setting trap table). */ msgbufinit(msgbufp, MSGBUF_SIZE); @@ -720,8 +710,13 @@ cpu_shutdown(void *args) int cpu_est_clockrate(int cpu_id, uint64_t *rate) { + struct pcpu *pc; - return (ENXIO); + pc = pcpu_find(cpu_id); + if (pc == NULL || rate == NULL) + return (EINVAL); + *rate = pc->pc_clock; + return (0); } /* Modified: stable/7/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_locore.S Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/sparc64/mp_locore.S Thu Mar 19 12:55:11 2009 (r190033) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -92,7 +93,7 @@ ENTRY(mp_startup) SET(cpu_start_args, %l1, %l0) - mov CPU_CLKSYNC, %l1 + mov CPU_TICKSYNC, %l1 membar #StoreLoad stw %l1, [%l0 + CSA_STATE] @@ -101,7 +102,25 @@ ENTRY(mp_startup) nop wrpr %l1, 0, %tick - UPA_GET_MID(%o0) + rdpr %ver, %l1 + stx %l1, [%l0 + CSA_VER] + + srlx %l1, VER_IMPL_SHIFT, %l1 + sll %l1, VER_IMPL_SIZE, %l1 + srl %l1, VER_IMPL_SIZE, %l1 + cmp %l1, CPU_IMPL_ULTRASPARCIII + bl %icc, 3f + nop + mov CPU_STICKSYNC, %l1 + membar #StoreLoad + stw %l1, [%l0 + CSA_STATE] + +2: ldx [%l0 + CSA_STICK], %l1 + brz %l1, 2b + nop + wr %l1, 0, %asr24 + +3: UPA_GET_MID(%o0) #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, "mp_start: CPU %d entered kernel" @@ -110,9 +129,6 @@ ENTRY(mp_startup) 9: #endif - rdpr %ver, %l1 - stx %l1, [%l0 + CSA_VER] - /* * Inform the boot processor we have inited. */ @@ -123,9 +139,9 @@ ENTRY(mp_startup) /* * Wait till its our turn to bootstrap. */ -2: lduw [%l0 + CSA_MID], %l1 +4: lduw [%l0 + CSA_MID], %l1 cmp %l1, %o0 - bne %xcc, 2b + bne %xcc, 4b nop #if KTR_COMPILE & KTR_SMP @@ -141,7 +157,7 @@ ENTRY(mp_startup) /* * Map the per-CPU pages. */ -3: sllx %l2, TTE_SHIFT, %l3 +5: sllx %l2, TTE_SHIFT, %l3 add %l1, %l3, %l3 ldx [%l3 + TTE_VPN], %l4 @@ -156,7 +172,7 @@ ENTRY(mp_startup) add %l2, 1, %l2 cmp %l2, PCPU_PAGES - bne %xcc, 3b + bne %xcc, 5b nop /* Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Thu Mar 19 12:55:11 2009 (r190033) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -101,7 +102,7 @@ static ih_func_t cpu_ipi_stop; * since the other processors will use it before the boot CPU enters the * kernel. */ -struct cpu_start_args cpu_start_args = { 0, -1, -1, 0, 0 }; +struct cpu_start_args cpu_start_args = { 0, -1, -1, 0, 0, 0 }; struct ipi_cache_args ipi_cache_args; struct ipi_tlb_args ipi_tlb_args; struct pcb stoppcbs[MAXCPU]; @@ -270,17 +271,25 @@ cpu_mp_start(void) if (OF_getprop(child, "clock-frequency", &clock, sizeof(clock)) <= 0) panic("%s: can't get clock", __func__); + if (clock != PCPU_GET(clock)) + hardclock_use_stick = 1; csa->csa_state = 0; sun4u_startcpu(child, (void *)mp_tramp, 0); s = intr_disable(); - while (csa->csa_state != CPU_CLKSYNC) + while (csa->csa_state != CPU_TICKSYNC) ; membar(StoreLoad); csa->csa_tick = rd(tick); + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { + while (csa->csa_state != CPU_STICKSYNC) + ; + membar(StoreLoad); + csa->csa_stick = rdstick(); + } while (csa->csa_state != CPU_INIT) ; - csa->csa_tick = 0; + csa->csa_tick = csa->csa_stick = 0; intr_restore(s); cpuid = mp_ncpus++; @@ -291,6 +300,7 @@ cpu_mp_start(void) pc = (struct pcpu *)(va + (PCPU_PAGES * PAGE_SIZE)) - 1; pcpu_init(pc, cpuid, sizeof(*pc)); pc->pc_addr = va; + pc->pc_clock = clock; pc->pc_mid = mid; pc->pc_node = child; Modified: stable/7/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/7/sys/sparc64/sparc64/tick.c Thu Mar 19 12:52:19 2009 (r190032) +++ stable/7/sys/sparc64/sparc64/tick.c Thu Mar 19 12:55:11 2009 (r190033) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 2005, 2008 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,22 +29,30 @@ __FBSDID("$FreeBSD$"); #include -#include #include -#include -#include +#include +#include +#include #include +#include +#include +#include #include #include -#include +#include + #include #include #include #include #include -#define TICK_GRACE 10000 +/* 10000 ticks proved okay for 500MHz. */ +#define TICK_GRACE(clock) ((clock) / 1000000 * 2 * 10) + +#define TICK_QUALITY_MP 10 +#define TICK_QUALITY_UP 1000 SYSCTL_NODE(_machdep, OID_AUTO, tick, CTLFLAG_RD, 0, "tick statistics"); @@ -63,7 +72,24 @@ static int adjust_ticks = 0; SYSCTL_INT(_machdep_tick, OID_AUTO, adjust_ticks, CTLFLAG_RD, &adjust_ticks, 0, "total number of tick interrupts with adjustment"); +u_int hardclock_use_stick = 0; +SYSCTL_INT(_machdep_tick, OID_AUTO, hardclock_use_stick, CTLFLAG_RD, + &hardclock_use_stick, 0, "hardclock uses STICK instead of TICK timer"); + +static struct timecounter tick_tc; +static u_long tick_increment; + +static uint64_t tick_cputicks(void); +static timecounter_get_t tick_get_timecount_up; +#ifdef SMP +static timecounter_get_t tick_get_timecount_mp; +#endif static void tick_hardclock(struct trapframe *tf); +static void tick_hardclock_bbwar(struct trapframe *tf); +static inline void tick_hardclock_common(struct trapframe *tf, u_long tick, + u_long adj); +static inline void tick_process(struct trapframe *tf); +static void stick_hardclock(struct trapframe *tf); static uint64_t tick_cputicks(void) @@ -75,9 +101,65 @@ tick_cputicks(void) void cpu_initclocks(void) { + uint32_t clock; stathz = hz; + + /* + * Given that the STICK timers typically are driven at rather low + * frequencies they shouldn't be used except when really necessary. + */ + if (hardclock_use_stick != 0) { + if (OF_getprop(OF_parent(PCPU_GET(node)), "stick-frequency", + &clock, sizeof(clock)) == -1) + panic("%s: could not determine STICK frequency", __func__); + intr_setup(PIL_TICK, stick_hardclock, -1, NULL, NULL); + /* + * We don't provide a CPU ticker as long as the frequency + * supplied isn't actually used per-CPU. + */ + } else { + clock = PCPU_GET(clock); + intr_setup(PIL_TICK, cpu_impl < CPU_IMPL_ULTRASPARCIII ? + tick_hardclock_bbwar : tick_hardclock, -1, NULL, NULL); + set_cputicker(tick_cputicks, clock, 0); + } + tick_increment = clock / hz; + /* + * Avoid stopping of hardclock in terms of a lost (S)TICK interrupt + * by ensuring that the (S)TICK period is at least TICK_GRACE ticks. + */ + if (tick_increment < TICK_GRACE(clock)) + panic("%s: HZ too high, decrease to at least %d", + __func__, clock / TICK_GRACE(clock)); tick_start(); + + /* + * Initialize the TICK-based timecounter. This must not happen + * before SI_SUB_INTRINSIC for tick_get_timecount_mp() to work. + */ + tick_tc.tc_get_timecount = tick_get_timecount_up; + tick_tc.tc_poll_pps = NULL; + tick_tc.tc_counter_mask = ~0u; + tick_tc.tc_frequency = PCPU_GET(clock); + tick_tc.tc_name = "tick"; + tick_tc.tc_quality = TICK_QUALITY_UP; + tick_tc.tc_priv = NULL; +#ifdef SMP + /* + * We (try to) sync the (S)TICK timers of APs with the BSP during + * their startup but not afterwards. The resulting drift can + * cause problems when the time is calculated based on (S)TICK + * values read on different CPUs. Thus we bind to the BSP for + * reading the register and use a low quality for the otherwise + * high quality (S)TICK timers in the MP case. + */ + if (cpu_mp_probe()) { + tick_tc.tc_get_timecount = tick_get_timecount_mp; + tick_tc.tc_quality = TICK_QUALITY_MP; + } +#endif + tc_init(&tick_tc); } static inline void @@ -93,27 +175,68 @@ tick_process(struct trapframe *tf) statclock(TRAPF_USERMODE(tf)); } +/* + * NB: the sequence of reading the (S)TICK register, calculating the value + * of the next tick and writing it to the (S)TICK_COMPARE register must not + * be interrupted, not even by an IPI, otherwise a value that is in the past + * could be written in the worst case, causing hardclock to stop. + */ + static void tick_hardclock(struct trapframe *tf) { - u_long adj, ref, tick; - long delta; + u_long adj, tick; + register_t s; + + critical_enter(); + adj = PCPU_GET(tickadj); + s = intr_disable(); + tick = rd(tick); + wr(tick_cmpr, tick + tick_increment - adj, 0); + intr_restore(s); + tick_hardclock_common(tf, tick, adj); + critical_exit(); +} + +static void +tick_hardclock_bbwar(struct trapframe *tf) +{ + u_long adj, tick; register_t s; - int count; - /* - * The sequence of reading the TICK register, calculating the value - * of the next tick and writing it to the TICK_CMPR register must not - * be interrupted, not even by an IPI, otherwise a value that is in - * the past could be written in the worst case, causing hardclock to - * stop. - */ critical_enter(); adj = PCPU_GET(tickadj); s = intr_disable(); tick = rd(tick); wrtickcmpr(tick + tick_increment - adj, 0); intr_restore(s); + tick_hardclock_common(tf, tick, adj); + critical_exit(); +} + +static void +stick_hardclock(struct trapframe *tf) +{ + u_long adj, stick; + register_t s; + + critical_enter(); + adj = PCPU_GET(tickadj); + s = intr_disable(); + stick = rdstick(); + wrstickcmpr(stick + tick_increment - adj, 0); + intr_restore(s); + tick_hardclock_common(tf, stick, adj); + critical_exit(); +} + +static inline void +tick_hardclock_common(struct trapframe *tf, u_long tick, u_long adj) +{ + u_long ref; + long delta; + int count; + ref = PCPU_GET(tickref); delta = tick - ref; count = 0; @@ -139,29 +262,36 @@ tick_hardclock(struct trapframe *tf) } PCPU_SET(tickref, ref); PCPU_SET(tickadj, adj); - critical_exit(); } -void -tick_init(u_long clock) +static u_int +tick_get_timecount_up(struct timecounter *tc) { - tick_freq = clock; - tick_MHz = clock / 1000000; - tick_increment = clock / hz; + return ((u_int)rd(tick)); +} - /* - * UltraSparc II[e,i] based systems come up with the tick interrupt - * enabled and a handler that resets the tick counter, causing DELAY() - * to not work properly when used early in boot. - * UltraSPARC III based systems come up with the system tick interrupt - * enabled, causing an interrupt storm on startup since they are not - * handled. - */ - tick_stop(); +#ifdef SMP +static u_int +tick_get_timecount_mp(struct timecounter *tc) +{ + struct thread *td; + u_int tick; + + td = curthread; + thread_lock(td); + sched_bind(td, 0); + thread_unlock(td); + + tick = tick_get_timecount_up(tc); + + thread_lock(td); + sched_unbind(td); + thread_unlock(td); - set_cputicker(tick_cputicks, tick_freq, 0); + return (tick); } +#endif void tick_start(void) @@ -170,32 +300,34 @@ tick_start(void) register_t s; /* - * Avoid stopping of hardclock in terms of a lost tick interrupt - * by ensuring that the tick period is at least TICK_GRACE ticks. - * This check would be better placed in tick_init(), however we - * have to call tick_init() before cninit() in order to provide - * the low-level console drivers with a working DELAY() which in - * turn means we cannot use panic() in tick_init(). - */ - if (tick_increment < TICK_GRACE) - panic("%s: HZ too high, decrease to at least %ld", __func__, - tick_freq / TICK_GRACE); - - if (curcpu == 0) - intr_setup(PIL_TICK, tick_hardclock, -1, NULL, NULL); - - /* - * Try to make the tick interrupts as synchronously as possible on - * all CPUs to avoid inaccuracies for migrating processes. Leave out - * one tick to make sure that it is not missed. + * Try to make the (S)TICK interrupts as synchronously as possible + * on all CPUs to avoid inaccuracies for migrating processes. Leave + * out one tick to make sure that it is not missed. */ + critical_enter(); PCPU_SET(tickadj, 0); s = intr_disable(); - base = rd(tick); + if (hardclock_use_stick != 0) + base = rdstick(); + else + base = rd(tick); base = roundup(base, tick_increment); PCPU_SET(tickref, base); - wrtickcmpr(base + tick_increment, 0); + if (hardclock_use_stick != 0) + wrstickcmpr(base + tick_increment, 0); + else + wrtickcmpr(base + tick_increment, 0); intr_restore(s); + critical_exit(); +} + +void +tick_clear(void) +{ + + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + wrstick(0, 0); + wrpr(tick, 0, 0); } void @@ -203,6 +335,6 @@ tick_stop(void) { if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) - wr(asr25, 1L << 63, 0); + wrstickcmpr(1L << 63, 0); wrtickcmpr(1L << 63, 0); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 13:00: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 AF5BF106564A; Thu, 19 Mar 2009 13:00:21 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C4718FC25; Thu, 19 Mar 2009 13:00:21 +0000 (UTC) (envelope-from nyan@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 n2JD0LfK061755; Thu, 19 Mar 2009 13:00:21 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JD0LmH061754; Thu, 19 Mar 2009 13:00:21 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200903191300.n2JD0LmH061754@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 19 Mar 2009 13:00: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: r190034 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/ppc 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, 19 Mar 2009 13:00:22 -0000 Author: nyan Date: Thu Mar 19 13:00:21 2009 New Revision: 190034 URL: http://svn.freebsd.org/changeset/base/190034 Log: MFC: r182441 Remove unneeded include. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/ppc/ppc_isa.c Modified: stable/7/sys/dev/ppc/ppc_isa.c ============================================================================== --- stable/7/sys/dev/ppc/ppc_isa.c Thu Mar 19 12:55:11 2009 (r190033) +++ stable/7/sys/dev/ppc/ppc_isa.c Thu Mar 19 13:00:21 2009 (r190034) @@ -37,11 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__i386__) && defined(PC98) -#include -#else -#include -#endif #include #include From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 13:02: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 2C3071065676; Thu, 19 Mar 2009 13:02:38 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19A428FC23; Thu, 19 Mar 2009 13:02:38 +0000 (UTC) (envelope-from nyan@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 n2JD2bU4061849; Thu, 19 Mar 2009 13:02:37 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JD2b5n061848; Thu, 19 Mar 2009 13:02:37 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200903191302.n2JD2b5n061848@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 19 Mar 2009 13:02:37 +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: r190035 - in stable/7/sys: . boot contrib/pf dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 13:02:39 -0000 Author: nyan Date: Thu Mar 19 13:02:37 2009 New Revision: 190035 URL: http://svn.freebsd.org/changeset/base/190035 Log: MFC: r186073 Disconnect the efi from pc98. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/Makefile stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/boot/Makefile ============================================================================== --- stable/7/sys/boot/Makefile Thu Mar 19 13:00:21 2009 (r190034) +++ stable/7/sys/boot/Makefile Thu Mar 19 13:02:37 2009 (r190035) @@ -8,7 +8,7 @@ SUBDIR+= ficl .endif # Build EFI library. -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || ${MACHINE_ARCH} == "ia64" SUBDIR+= efi .endif From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 13:08:25 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3C35106566B; Thu, 19 Mar 2009 13:08:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E01F48FC19; Thu, 19 Mar 2009 13:08:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JD8OWh062108; Thu, 19 Mar 2009 13:08:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JD8OnB062106; Thu, 19 Mar 2009 13:08:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191308.n2JD8OnB062106@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 13:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190038 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 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, 19 Mar 2009 13:08:25 -0000 Author: marius Date: Thu Mar 19 13:08:24 2009 New Revision: 190038 URL: http://svn.freebsd.org/changeset/base/190038 Log: MFC: r182767 The physical address space of cheetah-class CPUs has been extended to 43 bits so update TD_PA_BITS accordingly. For the most part this increase is transparent to the existing code except for when reading the physical address from ASI_{D,I}TLB_DATA_ACCESS_REG, which we only do in the loader and which was already adjusted in r190002, or from the OFW translations node. While at it, ensure we are only taking valid OFW mapping entries into account. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/tte.h stable/7/sys/sparc64/sparc64/pmap.c Modified: stable/7/sys/sparc64/include/tte.h ============================================================================== --- stable/7/sys/sparc64/include/tte.h Thu Mar 19 13:03:17 2009 (r190037) +++ stable/7/sys/sparc64/include/tte.h Thu Mar 19 13:08:24 2009 (r190038) @@ -36,21 +36,24 @@ #define TD_SIZE_SHIFT (61) #define TD_SOFT2_SHIFT (50) -#define TD_DIAG_SHIFT (41) +#define TD_DIAG_SF_SHIFT (41) +#define TD_RSVD_CH_SHIFT (43) #define TD_PA_SHIFT (13) #define TD_SOFT_SHIFT (7) #define TD_SIZE_BITS (2) #define TD_SOFT2_BITS (9) -#define TD_DIAG_BITS (9) +#define TD_DIAG_SF_BITS (9) +#define TD_RSVD_CH_BITS (7) #define TD_PA_CH_BITS (30) #define TD_PA_SF_BITS (28) -#define TD_PA_BITS TD_PA_SF_BITS +#define TD_PA_BITS TD_PA_CH_BITS #define TD_SOFT_BITS (6) #define TD_SIZE_MASK ((1UL << TD_SIZE_BITS) - 1) #define TD_SOFT2_MASK ((1UL << TD_SOFT2_BITS) - 1) -#define TD_DIAG_MASK ((1UL << TD_DIAG_BITS) - 1) +#define TD_DIAG_SF_MASK ((1UL << TD_DIAG_SF_BITS) - 1) +#define TD_RSVD_CH_MASK ((1UL << TD_RSVD_CH_BITS) - 1) #define TD_PA_CH_MASK ((1UL << TD_PA_CH_BITS) - 1) #define TD_PA_SF_MASK ((1UL << TD_PA_SF_BITS) - 1) #define TD_PA_MASK ((1UL << TD_PA_BITS) - 1) Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Thu Mar 19 13:03:17 2009 (r190037) +++ stable/7/sys/sparc64/sparc64/pmap.c Thu Mar 19 13:08:24 2009 (r190038) @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define PMAP_DEBUG @@ -473,6 +474,8 @@ pmap_bootstrap(vm_offset_t ekva) "translation: start=%#lx size=%#lx tte=%#lx", translations[i].om_start, translations[i].om_size, translations[i].om_tte); + if ((translations[i].om_tte & TD_V) == 0) + continue; if (translations[i].om_start < VM_MIN_PROM_ADDRESS || translations[i].om_start > VM_MAX_PROM_ADDRESS) continue; @@ -483,7 +486,11 @@ pmap_bootstrap(vm_offset_t ekva) tp->tte_vpn = TV_VPN(va, TS_8K); tp->tte_data = ((translations[i].om_tte & - ~(TD_SOFT_MASK << TD_SOFT_SHIFT)) | TD_EXEC) + + ~((TD_SOFT2_MASK << TD_SOFT2_SHIFT) | + (cpu_impl < CPU_IMPL_ULTRASPARCIII ? + (TD_DIAG_SF_MASK << TD_DIAG_SF_SHIFT) : + (TD_RSVD_CH_MASK << TD_RSVD_CH_SHIFT)) | + (TD_SOFT_MASK << TD_SOFT_SHIFT))) | TD_EXEC) + off; } } @@ -603,6 +610,8 @@ pmap_init(void) for (i = 0; i < translations_size; i++) { addr = translations[i].om_start; size = translations[i].om_size; + if ((translations[i].om_tte & TD_V) == 0) + continue; if (addr < VM_MIN_PROM_ADDRESS || addr > VM_MAX_PROM_ADDRESS) continue; result = vm_map_find(kernel_map, NULL, 0, &addr, size, FALSE, From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 13: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 41967106566C; Thu, 19 Mar 2009 13:09:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CBB28FC15; Thu, 19 Mar 2009 13:09:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JD9sw6062186; Thu, 19 Mar 2009 13:09:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JD9rLm062180; Thu, 19 Mar 2009 13:09:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191309.n2JD9rLm062180@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 13: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: r190039 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 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, 19 Mar 2009 13:09:55 -0000 Author: marius Date: Thu Mar 19 13:09:53 2009 New Revision: 190039 URL: http://svn.freebsd.org/changeset/base/190039 Log: MFC: r182768 Flesh out MMU and cache handling of cheetah-class CPUs. Added: stable/7/sys/sparc64/include/dcr.h - copied unchanged from r182768, head/sys/sparc64/include/dcr.h Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/cpu.h stable/7/sys/sparc64/sparc64/cheetah.c stable/7/sys/sparc64/sparc64/genassym.c stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/mp_machdep.c Modified: stable/7/sys/sparc64/include/cpu.h ============================================================================== --- stable/7/sys/sparc64/include/cpu.h Thu Mar 19 13:08:24 2009 (r190038) +++ stable/7/sys/sparc64/include/cpu.h Thu Mar 19 13:09:53 2009 (r190039) @@ -52,6 +52,7 @@ extern char btext[]; extern char etext[]; +void cheetah_init(void); void cpu_halt(void); void cpu_reset(void); void fork_trampoline(void); Copied: stable/7/sys/sparc64/include/dcr.h (from r182768, head/sys/sparc64/include/dcr.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/include/dcr.h Thu Mar 19 13:09:53 2009 (r190039, copy of r182768, head/sys/sparc64/include/dcr.h) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2008 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_DCR_H_ +#define _MACHINE_DCR_H_ + +/* + * Definitions for the UltraSPARC-III Depatch Control Register (ASR 18). + */ +#define DCR_MS (1UL << 0) +#define DCR_IFPOE (1UL << 1) +#define DCR_SI (1UL << 3) +#define DCR_RPE (1UL << 4) +#define DCR_BPE (1UL << 5) + +#define DCR_OBSDATA_SHIFT 6 +#define DCR_OBSDATA_CT_BITS 8 +#define DCR_OBSDATA_CT_MASK \ + (((1UL << DCR_OBSDATA_CT_BITS) - 1) << DCR_OBSDATA_SHIFT) + +/* The following bits are valid for the UltraSPARC-III+/IV+ only. */ +#define DCR_IPE (1UL << 5) + +#define DCR_OBSDATA_CTP_BITS 6 +#define DCR_OBSDATA_CTP_MASK \ + (((1UL << DCR_OBSDATA_CTP_BITS) - 1) << DCR_OBSDATA_SHIFT) + +#define DCR_DPE (1UL << 12) + +/* The following bits are valid for the UltraSPARC-IV+ only. */ +#define DCR_BPM_SHIFT 13 +#define DCR_BPM_BITS 2 +#define DCR_BPM_MASK \ + (((1UL << DCR_BPM_BITS) - 1) << DCR_BPM_SHIFT) + +#define DCR_JPE (1UL << 15) +#define DCR_ITPE (1UL << 16) +#define DCR_DTPE (1UL << 17) +#define DCR_PPE (1UL << 18) + +#endif /* _MACHINE_DCR_H_ */ Modified: stable/7/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cheetah.c Thu Mar 19 13:08:24 2009 (r190038) +++ stable/7/sys/sparc64/sparc64/cheetah.c Thu Mar 19 13:09:53 2009 (r190039) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2003 Jake Burkholder. + * Copyright (c) 2005, 2008 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,9 +40,60 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include #include #include +#include +#include + +/* A FLUSH is required after changing LSU_IC (the address is ignored). */ +#define CHEETAH_FLUSH_LSU_IC() __asm __volatile("flush %%g0" : :) + +#define CHEETAH_ICACHE_TAG_LOWER 0x30 + +/* + * CPU-specific initialization + */ +void +cheetah_init(void) +{ + register_t s; + + /* + * Disable interrupts for safety, this shouldn't be actually + * necessary though. + */ + s = intr_disable(); + + /* + * Ensure DCR_IFPOE is disabled as long as we haven't implemented + * support for it (if ever) as most if not all firmware versions + * apparently turn it on. Not making use of DCR_IFPOE should also + * avoid Cheetah erratum #109. + */ + wr(asr18, rd(asr18) & ~DCR_IFPOE, 0); + + /* Ensure the TSB Extension Registers hold 0 as TSB_Base. */ + + stxa(AA_DMMU_TSB_PEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_PEXT_REG, ASI_IMMU, 0); + membar(Sync); + + stxa(AA_DMMU_TSB_SEXT_REG, ASI_DMMU, 0); + /* + * NB: the secondary context was removed from the iMMU. + */ + membar(Sync); + + stxa(AA_DMMU_TSB_NEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); + membar(Sync); + + intr_restore(s); +} /* * Enable level 1 caches. @@ -49,7 +101,15 @@ __FBSDID("$FreeBSD$"); void cheetah_cache_enable(void) { + u_long lsu; + lsu = ldxa(0, ASI_LSU_CTL_REG); + if (cpu_impl == CPU_IMPL_ULTRASPARCIII) { + /* Disable P$ due to Cheetah erratum #18. */ + lsu &= ~LSU_PE; + } + stxa(0, ASI_LSU_CTL_REG, lsu | LSU_IC | LSU_DC); + CHEETAH_FLUSH_LSU_IC(); } /* @@ -58,7 +118,22 @@ cheetah_cache_enable(void) void cheetah_cache_flush(void) { + u_long addr, lsu; + for (addr = 0; addr < PCPU_GET(cache.dc_size); + addr += PCPU_GET(cache.dc_linesize)) + stxa_sync(addr, ASI_DCACHE_TAG, 0); + + /* The I$ must be disabled when flushing it so ensure it's off. */ + lsu = ldxa(0, ASI_LSU_CTL_REG); + stxa(0, ASI_LSU_CTL_REG, lsu & ~(LSU_IC)); + CHEETAH_FLUSH_LSU_IC(); + for (addr = CHEETAH_ICACHE_TAG_LOWER; + addr < PCPU_GET(cache.ic_size) * 2; + addr += PCPU_GET(cache.ic_linesize) * 2) + stxa_sync(addr, ASI_ICACHE_TAG, 0); + stxa(0, ASI_LSU_CTL_REG, lsu); + CHEETAH_FLUSH_LSU_IC(); } /* @@ -87,6 +162,12 @@ cheetah_icache_page_inval(vm_paddr_t pa) } +#define cheetah_dmap_all() do { \ + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); \ + stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); \ + flush(KERNBASE); \ +} while (0) + /* * Flush all non-locked mappings from the TLB. */ @@ -94,15 +175,20 @@ void cheetah_tlb_flush_nonlocked(void) { - panic("cheetah_tlb_flush_nonlocked"); + cheetah_dmap_all(); } /* * Flush all user mappings from the TLB. */ void -cheetah_tlb_flush_user(void) +cheetah_tlb_flush_user() { - panic("cheetah_tlb_flush_user"); + /* + * Just use cheetah_dmap_all() and accept somes TLB misses + * rather than searching all 1040 D-TLB and 144 I-TLB slots + * for non-kernel mappings. + */ + cheetah_dmap_all(); } Modified: stable/7/sys/sparc64/sparc64/genassym.c ============================================================================== --- stable/7/sys/sparc64/sparc64/genassym.c Thu Mar 19 13:08:24 2009 (r190038) +++ stable/7/sys/sparc64/sparc64/genassym.c Thu Mar 19 13:09:53 2009 (r190039) @@ -66,10 +66,13 @@ ASSYM(PCPU_PAGES, PCPU_PAGES); ASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT); -ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS); -ASSYM(TLB_DEMAP_PRIMARY, TLB_DEMAP_PRIMARY); +#ifdef SUN4U +ASSYM(TLB_DEMAP_ALL, TLB_DEMAP_ALL); +#endif ASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT); +ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS); ASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE); +ASSYM(TLB_DEMAP_PRIMARY, TLB_DEMAP_PRIMARY); ASSYM(INT_SHIFT, INT_SHIFT); ASSYM(PTR_SHIFT, PTR_SHIFT); Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 13:08:24 2009 (r190038) +++ stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 13:09:53 2009 (r190039) @@ -255,6 +255,12 @@ sparc64_init(caddr_t mdp, u_long o1, u_l cpu_impl = VER_IMPL(rdpr(ver)); /* + * Do CPU-specific Initialization. + */ + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + cheetah_init(); + + /* * Clear (S)TICK timer (including NPT). */ tick_clear(); Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Thu Mar 19 13:08:24 2009 (r190038) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Thu Mar 19 13:09:53 2009 (r190039) @@ -379,6 +379,8 @@ cpu_mp_bootstrap(struct pcpu *pc) volatile struct cpu_start_args *csa; csa = &cpu_start_args; + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + cheetah_init(); pmap_map_tsb(); /* * Flush all non-locked TLB entries possibly left over by the From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 13:11: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 CD08210656C6; Thu, 19 Mar 2009 13:11:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B92168FC1C; Thu, 19 Mar 2009 13:11:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JDB2EM062290; Thu, 19 Mar 2009 13:11:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JDB2qB062288; Thu, 19 Mar 2009 13:11:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191311.n2JDB2qB062288@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 13:11: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: r190040 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/sparc64 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, 19 Mar 2009 13:11:04 -0000 Author: marius Date: Thu Mar 19 13:11:02 2009 New Revision: 190040 URL: http://svn.freebsd.org/changeset/base/190040 Log: MFC: r182769 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/mp_machdep.c Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 13:09:53 2009 (r190039) +++ stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 13:11:02 2009 (r190040) @@ -374,6 +374,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l } cache_init(pc); + cache_enable(); uma_set_align(pc->pc_cache.dc_linesize - 1); cpu_block_copy = bcopy; Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Thu Mar 19 13:09:53 2009 (r190039) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Thu Mar 19 13:11:02 2009 (r190040) @@ -381,6 +381,7 @@ cpu_mp_bootstrap(struct pcpu *pc) csa = &cpu_start_args; if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(); + cache_enable(); pmap_map_tsb(); /* * Flush all non-locked TLB entries possibly left over by the From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 13:17: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 A3E9B106567E; Thu, 19 Mar 2009 13:17:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 877D88FC26; Thu, 19 Mar 2009 13:17:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JDHJvB062520; Thu, 19 Mar 2009 13:17:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JDHJvv062517; Thu, 19 Mar 2009 13:17:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191317.n2JDHJvv062517@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 13:17:19 +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: r190041 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 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, 19 Mar 2009 13:17:23 -0000 Author: marius Date: Thu Mar 19 13:17:19 2009 New Revision: 190041 URL: http://svn.freebsd.org/changeset/base/190041 Log: MFC: r182773 Use the PROM provided SUNW,set-trap-table to take over the trap table. This is required in order to set obp-control-relinquished within the PROM, allowing to safely read the OFW translations node. Without this, f.e. a `ofwdump -ap` triggers a fatal reset error or worse things on machines based on USIII and beyond. In theory this should allow to remove touching %tba in cpu_setregs(), in practice we seem to currently face a chicken and egg problem when doing so however. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/trap.h stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/trap.c Modified: stable/7/sys/sparc64/include/trap.h ============================================================================== --- stable/7/sys/sparc64/include/trap.h Thu Mar 19 13:11:02 2009 (r190040) +++ stable/7/sys/sparc64/include/trap.h Thu Mar 19 13:17:19 2009 (r190041) @@ -90,6 +90,7 @@ #define T_KERNEL 64 #ifndef LOCORE +void sun4u_set_traptable(void *tba_addr); extern const char *trap_msg[]; #endif Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 13:11:02 2009 (r190040) +++ stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 13:17:19 2009 (r190041) @@ -437,6 +437,16 @@ sparc64_init(caddr_t mdp, u_long o1, u_l cpu_setregs(pc); /* + * Take over the trap table via the PROM. Using the PROM for this + * is necessary in order to set obp-control-relinquished to true + * within the PROM so obtaining /virtual-memory/translations doesn't + * trigger a fatal reset error or worse things further down the road. + * XXX it should be possible to use this soley instead of writing + * %tba in cpu_setregs(). Doing so causes a hang however. + */ + sun4u_set_traptable(tl0_base); + + /* * It's now safe to use the real DELAY(). */ delay_func = delay_tick; Modified: stable/7/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/trap.c Thu Mar 19 13:11:02 2009 (r190040) +++ stable/7/sys/sparc64/sparc64/trap.c Thu Mar 19 13:17:19 2009 (r190041) @@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$"); #endif #include +#include + #include #include #include @@ -227,6 +229,28 @@ int debugger_on_signal = 0; SYSCTL_INT(_debug, OID_AUTO, debugger_on_signal, CTLFLAG_RW, &debugger_on_signal, 0, ""); +/* + * SUNW,set-trap-table allows to take over %tba from the PROM, which + * will turn off interrupts and handle outstanding ones while doing so, + * in a safe way. + */ +void +sun4u_set_traptable(void *tba_addr) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t tba_addr; + } args = { + (cell_t)"SUNW,set-trap-table", + 2, + }; + + args.tba_addr = (cell_t)tba_addr; + openfirmware(&args); +} + void trap(struct trapframe *tf) { From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 13:18: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 A997E106566B; Thu, 19 Mar 2009 13:18:28 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E99C8FC17; Thu, 19 Mar 2009 13:18:28 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JDIS9r062599; Thu, 19 Mar 2009 13:18:28 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JDISH8062598; Thu, 19 Mar 2009 13:18:28 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200903191318.n2JDISH8062598@svn.freebsd.org> From: Christian Brueffer Date: Thu, 19 Mar 2009 13:18: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: r190042 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 13:18:29 -0000 Author: brueffer Date: Thu Mar 19 13:18:28 2009 New Revision: 190042 URL: http://svn.freebsd.org/changeset/base/190042 Log: MFC: r186965 Recognize et(4), igb(4), ixgbe(4) and nxge(4) devices. Correct some minor whitespace in the ae(4) entry. The iwn(4) entry was left out as the driver has not been merged. Modified: stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/sysinstall/devices.c Modified: stable/7/usr.sbin/sysinstall/devices.c ============================================================================== --- stable/7/usr.sbin/sysinstall/devices.c Thu Mar 19 13:17:19 2009 (r190041) +++ stable/7/usr.sbin/sysinstall/devices.c Thu Mar 19 13:18:28 2009 (r190042) @@ -93,7 +93,7 @@ static struct _devname { DISK("mfid%d", "LSI MegaRAID SAS array", 4), FLOPPY("fd%d", "floppy drive unit A", 4), SERIAL("cuad%d", "%s on device %s (COM%d)", 16), - NETWORK("ae", "Attansic/Atheros L2 FastEthernet"), + NETWORK("ae", "Attansic/Atheros L2 Fast Ethernet"), NETWORK("age", "Attansic/Atheros L1 Gigabit Ethernet"), NETWORK("ale", "Atheros AR8121/AR8113/AR8114 PCIe Ethernet"), NETWORK("an", "Aironet 4500/4800 802.11 wireless adapter"), @@ -115,12 +115,15 @@ static struct _devname { NETWORK("ed", "Novell NE1000/2000; 3C503; NE2000-compatible PCMCIA"), NETWORK("ep", "3Com 3C509 Ethernet card/3C589 PCMCIA"), NETWORK("em", "Intel(R) PRO/1000 Ethernet card"), + NETWORK("et", "Agere ET1310 based PCI Express Gigabit Ethernet card"), NETWORK("ex", "Intel EtherExpress Pro/10 Ethernet card"), NETWORK("fe", "Fujitsu MB86960A/MB86965A Ethernet card"), NETWORK("gem", "Apple GMAC or Sun ERI/GEM Ethernet adapter"), NETWORK("hme", "Sun HME (Happy Meal Ethernet) Ethernet adapter"), NETWORK("ie", "AT&T StarLAN 10 and EN100; 3Com 3C507; NI5210"), + NETWORK("igb", "Intel(R) PRO/1000 PCI Express Gigabit Ethernet card"), NETWORK("ixgb", "Intel(R) PRO/10Gb Ethernet card"), + NETWORK("ixgbe", "Intel(R) PRO/10Gb Ethernet card"), NETWORK("jme", "JMicron JMC250 Gigabit/JMC260 Fast Ethernet"), NETWORK("kue", "Kawasaki LSI USB Ethernet adapter"), NETWORK("le", "AMD Am7900 LANCE or Am79C9xx PCnet Ethernet adapter"), @@ -130,6 +133,7 @@ static struct _devname { NETWORK("nfe", "NVIDIA nForce MCP Ethernet"), NETWORK("nge", "NatSemi PCI Gigabit Ethernet card"), NETWORK("nve", "NVIDIA nForce MCP Ethernet"), + NETWORK("nxge", "Neterion Xframe 10GbE Server/Storage adapter"), NETWORK("pcn", "AMD Am79c79x PCI Ethernet card"), NETWORK("ray", "Raytheon Raylink 802.11 wireless adapter"), NETWORK("re", "RealTek 8139C+/8169/8169S/8110S PCI Ethernet card"), From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 13:24: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 D16D81065670; Thu, 19 Mar 2009 13:24:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE8F08FC13; Thu, 19 Mar 2009 13:24:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JDOmnj062787; Thu, 19 Mar 2009 13:24:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JDOmIU062786; Thu, 19 Mar 2009 13:24:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191324.n2JDOmIU062786@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 13:24: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: r190043 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/sparc64 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, 19 Mar 2009 13:24:49 -0000 Author: marius Date: Thu Mar 19 13:24:48 2009 New Revision: 190043 URL: http://svn.freebsd.org/changeset/base/190043 Log: MFC: r182774 When determining whether we trapped while in the PROM don't only check for addresses below the PROM range but also those above. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/sparc64/exception.S Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Thu Mar 19 13:18:28 2009 (r190042) +++ stable/7/sys/sparc64/sparc64/exception.S Thu Mar 19 13:24:48 2009 (r190043) @@ -2738,6 +2738,10 @@ ENTRY(tl1_ret) cmp %l1, %l5 bl,a,pt %xcc, 1f nop + set VM_MAX_PROM_ADDRESS, %l5 + cmp %l1, %l5 + bg,a,pt %xcc, 1f + nop wrpr %g0, PSTATE_NORMAL, %pstate From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 13:48: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 84CA4106564A; Thu, 19 Mar 2009 13:48:43 +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 72A9C8FC20; Thu, 19 Mar 2009 13:48:43 +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 n2JDmhmP063386; Thu, 19 Mar 2009 13:48:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JDmhBE063385; Thu, 19 Mar 2009 13:48:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903191348.n2JDmhBE063385@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Mar 2009 13:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190045 - in stable/7/sys: . fs/udf 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, 19 Mar 2009 13:48:44 -0000 Author: avg Date: Thu Mar 19 13:48:43 2009 New Revision: 190045 URL: http://svn.freebsd.org/changeset/base/190045 Log: MFC 188815, 188815: fix incorrect error return when reading a large dir Approved by: jhb (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 13:38:20 2009 (r190044) +++ stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 13:48:43 2009 (r190045) @@ -818,17 +818,16 @@ udf_readdir(struct vop_readdir_args *a) error = udf_uiodir(&uiodir, dir.d_reclen, uio, ds->this_off); } - if (error) { - printf("uiomove returned %d\n", error); + if (error) break; - } - } /* tell the calling layer whether we need to be called again */ *a->a_eofflag = uiodir.eofflag; uio->uio_offset = ds->offset + ds->off; + if (error < 0) + error = 0; if (!error) error = ds->error; From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:00:24 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 408F51065673; Thu, 19 Mar 2009 14:00:24 +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 1389E8FC1A; Thu, 19 Mar 2009 14:00:24 +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 n2JE0NcD063737; Thu, 19 Mar 2009 14:00:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JE0Nti063736; Thu, 19 Mar 2009 14:00:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903191400.n2JE0Nti063736@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Mar 2009 14:00: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: r190047 - in stable/7/sys: . fs/udf 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, 19 Mar 2009 14:00:25 -0000 Author: avg Date: Thu Mar 19 14:00:23 2009 New Revision: 190047 URL: http://svn.freebsd.org/changeset/base/190047 Log: MFC 189067,189363: udf_strategy: tiny optimization of logic, calculations; extra diagnostics Approved by: jhb (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 13:53:42 2009 (r190046) +++ stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:00:23 2009 (r190047) @@ -404,7 +404,7 @@ udf_print(struct vop_print_args *ap) #define lblkno(udfmp, loc) ((loc) >> (udfmp)->bshift) #define blkoff(udfmp, loc) ((loc) & (udfmp)->bmask) -#define lblktosize(imp, blk) ((blk) << (udfmp)->bshift) +#define lblktosize(udfmp, blk) ((blk) << (udfmp)->bshift) static int udf_read(struct vop_read_args *ap) @@ -968,34 +968,27 @@ udf_strategy(struct vop_strategy_args *a struct buf *bp; struct vnode *vp; struct udf_node *node; - int maxsize; - daddr_t sector; struct bufobj *bo; - int multiplier; + off_t offset; + uint32_t maxsize; + daddr_t sector; + int error; bp = a->a_bp; vp = a->a_vp; node = VTON(vp); if (bp->b_blkno == bp->b_lblkno) { - /* - * Files that are embedded in the fentry don't translate well - * to a block number. Reject. - */ - if (udf_bmap_internal(node, bp->b_lblkno * node->udfmp->bsize, - §or, &maxsize)) { + offset = lblktosize(node->udfmp, bp->b_lblkno); + error = udf_bmap_internal(node, offset, §or, &maxsize); + if (error) { clrbuf(bp); bp->b_blkno = -1; + bufdone(bp); + return (0); } - /* bmap gives sector numbers, bio works with device blocks */ - multiplier = node->udfmp->bsize / DEV_BSIZE; - bp->b_blkno = sector * multiplier; - - } - if ((long)bp->b_blkno == -1) { - bufdone(bp); - return (0); + bp->b_blkno = sector << (node->udfmp->bshift - DEV_BSHIFT); } bo = node->udfmp->im_bo; bp->b_iooffset = dbtob(bp->b_blkno); From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:05: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 4BFE61065678; Thu, 19 Mar 2009 14:05:00 +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 378548FC15; Thu, 19 Mar 2009 14:05:00 +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 n2JE50FV063870; Thu, 19 Mar 2009 14:05:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JE50jL063869; Thu, 19 Mar 2009 14:05:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903191405.n2JE50jL063869@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Mar 2009 14:05: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: r190048 - in stable/7/sys: . fs/udf 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, 19 Mar 2009 14:05:01 -0000 Author: avg Date: Thu Mar 19 14:04:59 2009 New Revision: 190048 URL: http://svn.freebsd.org/changeset/base/190048 Log: MFC 189068: udf_read: correctly read data from files with data embedded into fentry Approved by: jhb (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:00:23 2009 (r190047) +++ stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:04:59 2009 (r190048) @@ -406,6 +406,14 @@ udf_print(struct vop_print_args *ap) #define blkoff(udfmp, loc) ((loc) & (udfmp)->bmask) #define lblktosize(udfmp, blk) ((blk) << (udfmp)->bshift) +static inline int +is_data_in_fentry(const struct udf_node *node) +{ + const struct file_entry *fentry = node->fentry; + + return ((le16toh(fentry->icbtag.flags) & 0x7) == 3); +} + static int udf_read(struct vop_read_args *ap) { @@ -413,7 +421,9 @@ udf_read(struct vop_read_args *ap) struct uio *uio = ap->a_uio; struct udf_node *node = VTON(vp); struct udf_mnt *udfmp; + struct file_entry *fentry; struct buf *bp; + uint8_t *data; daddr_t lbn, rablock; off_t diff, fsize; int error = 0; @@ -423,6 +433,22 @@ udf_read(struct vop_read_args *ap) return (0); if (uio->uio_offset < 0) return (EINVAL); + + if (is_data_in_fentry(node)) { + fentry = node->fentry; + data = &fentry->data[le32toh(fentry->l_ea)]; + fsize = le32toh(fentry->l_ad); + + n = uio->uio_resid; + diff = fsize - uio->uio_offset; + if (diff <= 0) + return (0); + if (diff < n) + n = diff; + error = uiomove(data + uio->uio_offset, (int)n, uio); + return (error); + } + fsize = le64toh(node->fentry->inf_len); udfmp = node->udfmp; do { From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:07:27 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 B4023106564A; Thu, 19 Mar 2009 14:07:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1A628FC0C; Thu, 19 Mar 2009 14:07:27 +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 n2JE7R2V063975; Thu, 19 Mar 2009 14:07:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JE7RvG063974; Thu, 19 Mar 2009 14:07:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903191407.n2JE7RvG063974@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Mar 2009 14:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190049 - in stable/7/sys: . fs/udf 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, 19 Mar 2009 14:07:28 -0000 Author: avg Date: Thu Mar 19 14:07:27 2009 New Revision: 190049 URL: http://svn.freebsd.org/changeset/base/190049 Log: MFC 189069: udf_map: return proper error code instead of leaking an internal one Approved by: jhb (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:04:59 2009 (r190048) +++ stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:07:27 2009 (r190049) @@ -1039,8 +1039,19 @@ udf_bmap(struct vop_bmap_args *a) if (a->a_runb) *a->a_runb = 0; - error = udf_bmap_internal(node, a->a_bn * node->udfmp->bsize, &lsector, - &max_size); + /* + * UDF_INVALID_BMAP means data embedded into fentry, this is an internal + * error that should not be propagated to calling code. + * Most obvious mapping for this error is EOPNOTSUPP as we can not truly + * translate block numbers in this case. + * Incidentally, this return code will make vnode pager to use VOP_READ + * to get data for mmap-ed pages and udf_read knows how to do the right + * thing for this kind of files. + */ + error = udf_bmap_internal(node, a->a_bn << node->udfmp->bshift, + &lsector, &max_size); + if (error == UDF_INVALID_BMAP) + return (EOPNOTSUPP); if (error) return (error); From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:09: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 46E04106564A; Thu, 19 Mar 2009 14:09:21 +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 1A5368FC1E; Thu, 19 Mar 2009 14:09:21 +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 n2JE9Lvf064066; Thu, 19 Mar 2009 14:09:21 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JE9KuW064064; Thu, 19 Mar 2009 14:09:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903191409.n2JE9KuW064064@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Mar 2009 14:09: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: r190050 - in stable/7/sys: . fs/udf 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, 19 Mar 2009 14:09:22 -0000 Author: avg Date: Thu Mar 19 14:09:20 2009 New Revision: 190050 URL: http://svn.freebsd.org/changeset/base/190050 Log: MFC 189070: udf: add read-ahead support modeled after cd9660 Approved by: jhb (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/fs/udf/udf_vfsops.c stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf_vfsops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vfsops.c Thu Mar 19 14:07:27 2009 (r190049) +++ stable/7/sys/fs/udf/udf_vfsops.c Thu Mar 19 14:09:20 2009 (r190050) @@ -334,6 +334,11 @@ udf_mountfs(struct vnode *devvp, struct bo = &devvp->v_bufobj; + if (devvp->v_rdev->si_iosize_max != 0) + mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max; + if (mp->mnt_iosize_max > MAXPHYS) + mp->mnt_iosize_max = MAXPHYS; + /* XXX: should be M_WAITOK */ MALLOC(udfmp, struct udf_mnt *, sizeof(struct udf_mnt), M_UDFMOUNT, M_NOWAIT | M_ZERO); Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:07:27 2009 (r190049) +++ stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:09:20 2009 (r190050) @@ -1028,6 +1028,7 @@ udf_bmap(struct vop_bmap_args *a) struct udf_node *node; uint32_t max_size; daddr_t lsector; + int nblk; int error; node = VTON(a->a_vp); @@ -1058,9 +1059,23 @@ udf_bmap(struct vop_bmap_args *a) /* Translate logical to physical sector number */ *a->a_bnp = lsector << (node->udfmp->bshift - DEV_BSHIFT); - /* Punt on read-ahead for now */ - if (a->a_runp) - *a->a_runp = 0; + /* + * Determine maximum number of readahead blocks following the + * requested block. + */ + if (a->a_runp) { + nblk = (max_size >> node->udfmp->bshift) - 1; + if (nblk <= 0) + *a->a_runp = 0; + else if (nblk >= (MAXBSIZE >> node->udfmp->bshift)) + *a->a_runp = (MAXBSIZE >> node->udfmp->bshift) - 1; + else + *a->a_runp = nblk; + } + + if (a->a_runb) { + *a->a_runb = 0; + } return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:11: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 431BB1065673; Thu, 19 Mar 2009 14:11:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DBC08FC21; Thu, 19 Mar 2009 14:11:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JEB4Qq064242; Thu, 19 Mar 2009 14:11:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JEB3RD064233; Thu, 19 Mar 2009 14:11:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191411.n2JEB3RD064233@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 14:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190051 - in stable/7/sys: . boot/sparc64/loader contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 sun4v/include 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, 19 Mar 2009 14:11:05 -0000 Author: marius Date: Thu Mar 19 14:11:03 2009 New Revision: 190051 URL: http://svn.freebsd.org/changeset/base/190051 Log: MFC: r182877, r188455, r188477 USIII and beyond CPUs have stricter requirements when it comes to synchronization needed after stores to internal ASIs in order to make side-effects visible. This mainly requires the MEMBAR #Sync after such stores to be replaced with a FLUSH. We use KERNBASE in the kernel and the newly introduced PROMBASE for the loader as the addresses to FLUSH as these are guaranteed to not trap. Actually, the USII synchronization rules also already require a FLUSH in pretty much all of the cases changed. We're also hitting an additional USIII synchronization rule which requires stores to AA_IMMU_SFSR to be immediately followed by a DONE, FLUSH or RETRY. Doing so triggers a RED state exception though so leave the MEMBAR #Sync. Linux apparently also has gotten away with doing the same for quite some time now, apart from the fact that it's not clear to me why we need to clear the valid bit from the SFSR in the first place. Reviewed by: nwhitehorn Modified: stable/7/sys/ (props changed) stable/7/sys/boot/sparc64/loader/main.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/vmparam.h stable/7/sys/sparc64/sparc64/exception.S stable/7/sys/sparc64/sparc64/mp_exception.S stable/7/sys/sparc64/sparc64/pmap.c stable/7/sys/sparc64/sparc64/support.S stable/7/sys/sparc64/sparc64/swtch.S stable/7/sys/sparc64/sparc64/tlb.c stable/7/sys/sun4v/include/vmparam.h Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Thu Mar 19 14:09:20 2009 (r190050) +++ stable/7/sys/boot/sparc64/loader/main.c Thu Mar 19 14:11:03 2009 (r190051) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bootstrap.h" #include "libofw.h" @@ -356,7 +357,7 @@ __elfN(exec)(struct preloaded_file *fp) return (error); printf("jumping to kernel entry at %#lx.\n", e->e_entry); -#if LOADER_DEBUG +#ifdef LOADER_DEBUG pmap_print_tlb_sun4u(); #endif @@ -461,7 +462,7 @@ itlb_enter_sun4u(u_long vpn, u_long data stxa(AA_IMMU_TAR, ASI_IMMU, TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); stxa(0, ASI_ITLB_DATA_IN_REG, data); - membar(Sync); + flush(PROMBASE); wrpr(pstate, reg, 0); } @@ -726,7 +727,7 @@ exit(int code) } #ifdef LOADER_DEBUG -static const char *page_sizes[] = { +static const char *const page_sizes[] = { " 8k", " 64k", "512k", " 4m" }; Modified: stable/7/sys/sparc64/include/vmparam.h ============================================================================== --- stable/7/sys/sparc64/include/vmparam.h Thu Mar 19 14:09:20 2009 (r190050) +++ stable/7/sys/sparc64/include/vmparam.h Thu Mar 19 14:11:03 2009 (r190051) @@ -40,7 +40,6 @@ * $FreeBSD$ */ - #ifndef _MACHINE_VMPARAM_H_ #define _MACHINE_VMPARAM_H_ @@ -203,6 +202,7 @@ #define VM_MAXUSER_ADDRESS (VM_MAX_USER_ADDRESS) #define KERNBASE (VM_MIN_KERNEL_ADDRESS) +#define PROMBASE (VM_MIN_PROM_ADDRESS) #define USRSTACK (VM_MAX_USER_ADDRESS) /* Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Thu Mar 19 14:09:20 2009 (r190050) +++ stable/7/sys/sparc64/sparc64/exception.S Thu Mar 19 14:11:03 2009 (r190051) @@ -498,6 +498,11 @@ END(rsf_fatal) wr %g0, ASI_IMMU, %asi rdpr %tpc, %g3 ldxa [%g0 + AA_IMMU_SFSR] %asi, %g4 + /* + * XXX in theory, a store to AA_IMMU_SFSR must be immediately + * followed by a DONE, FLUSH or RETRY for USIII. In practice, + * this triggers a RED state exception though. + */ stxa %g0, [%g0 + AA_IMMU_SFSR] %asi membar #Sync ba %xcc, tl0_sfsr_trap @@ -716,8 +721,9 @@ ENTRY(tl0_immu_miss_trap) * Put back the contents of the tag access register, in case we * faulted. */ + sethi %hi(KERNBASE), %g2 stxa %g1, [%g0 + AA_IMMU_TAR] %asi - membar #Sync + flush %g2 /* * Switch to alternate globals. @@ -1213,6 +1219,11 @@ END(tl0_fp_restore) wr %g0, ASI_IMMU, %asi rdpr %tpc, %g3 ldxa [%g0 + AA_IMMU_SFSR] %asi, %g4 + /* + * XXX in theory, a store to AA_IMMU_SFSR must be immediately + * followed by a DONE, FLUSH or RETRY for USIII. In practice, + * this triggers a RED state exception though. + */ stxa %g0, [%g0 + AA_IMMU_SFSR] %asi membar #Sync ba %xcc, tl1_insn_exceptn_trap Modified: stable/7/sys/sparc64/sparc64/mp_exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_exception.S Thu Mar 19 14:09:20 2009 (r190050) +++ stable/7/sys/sparc64/sparc64/mp_exception.S Thu Mar 19 14:11:03 2009 (r190051) @@ -199,9 +199,10 @@ ENTRY(tl_ipi_tlb_page_demap) ldx [%g5 + ITA_VA], %g2 or %g2, %g3, %g2 + sethi %hi(KERNBASE), %g3 stxa %g0, [%g2] ASI_DMMU_DEMAP stxa %g0, [%g2] ASI_IMMU_DEMAP - membar #Sync + flush %g3 IPI_DONE(%g5, %g1, %g2, %g3) retry @@ -234,13 +235,13 @@ ENTRY(tl_ipi_tlb_range_demap) ldx [%g5 + ITA_START], %g1 ldx [%g5 + ITA_END], %g2 - set PAGE_SIZE, %g6 - 1: or %g1, %g3, %g4 + sethi %hi(KERNBASE), %g6 stxa %g0, [%g4] ASI_DMMU_DEMAP stxa %g0, [%g4] ASI_IMMU_DEMAP - membar #Sync + flush %g6 + set PAGE_SIZE, %g6 add %g1, %g6, %g1 cmp %g1, %g2 blt,a,pt %xcc, 1b @@ -265,9 +266,10 @@ ENTRY(tl_ipi_tlb_context_demap) #endif mov TLB_DEMAP_PRIMARY | TLB_DEMAP_CONTEXT, %g1 + sethi %hi(KERNBASE), %g3 stxa %g0, [%g1] ASI_DMMU_DEMAP stxa %g0, [%g1] ASI_IMMU_DEMAP - membar #Sync + flush %g3 IPI_DONE(%g5, %g1, %g2, %g3) retry Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Thu Mar 19 14:09:20 2009 (r190050) +++ stable/7/sys/sparc64/sparc64/pmap.c Thu Mar 19 14:11:03 2009 (r190051) @@ -556,7 +556,7 @@ pmap_map_tsb(void) * FP block operations in the kernel). */ stxa(AA_DMMU_SCXR, ASI_DMMU, TLB_CTX_KERNEL); - membar(Sync); + flush(KERNBASE); intr_restore(s); } @@ -1961,7 +1961,7 @@ pmap_activate(struct thread *td) stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); stxa(AA_DMMU_PCXR, ASI_DMMU, context); - membar(Sync); + flush(KERNBASE); mtx_unlock_spin(&sched_lock); } Modified: stable/7/sys/sparc64/sparc64/support.S ============================================================================== --- stable/7/sys/sparc64/sparc64/support.S Thu Mar 19 14:09:20 2009 (r190050) +++ stable/7/sys/sparc64/sparc64/support.S Thu Mar 19 14:11:03 2009 (r190051) @@ -780,8 +780,9 @@ ENTRY(openfirmware_exit) sub %l0, SPOFF, %fp ! setup a stack in a locked page sub %l0, SPOFF + CCFSZ, %sp mov AA_DMMU_PCXR, %l3 ! force primary DMMU context 0 + sethi %hi(KERNBASE), %l5 stxa %g0, [%l3] ASI_DMMU - membar #Sync + flush %l5 wrpr %g0, 0, %tl ! force trap level 0 call %l6 mov %i0, %o0 Modified: stable/7/sys/sparc64/sparc64/swtch.S ============================================================================== --- stable/7/sys/sparc64/sparc64/swtch.S Thu Mar 19 14:09:20 2009 (r190050) +++ stable/7/sys/sparc64/sparc64/swtch.S Thu Mar 19 14:11:03 2009 (r190051) @@ -237,8 +237,9 @@ ENTRY(cpu_switch) mov AA_IMMU_TSB, %i5 stxa %i4, [%i5] ASI_IMMU mov AA_DMMU_PCXR, %i5 + sethi %hi(KERNBASE), %i4 stxa %i3, [%i5] ASI_DMMU - membar #Sync + flush %i4 /* * Done, return and load the new process's window from the stack. Modified: stable/7/sys/sparc64/sparc64/tlb.c ============================================================================== --- stable/7/sys/sparc64/sparc64/tlb.c Thu Mar 19 14:09:20 2009 (r190050) +++ stable/7/sys/sparc64/sparc64/tlb.c Thu Mar 19 14:11:03 2009 (r190051) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include PMAP_STATS_VAR(tlb_ncontext_demap); PMAP_STATS_VAR(tlb_npage_demap); @@ -85,7 +86,7 @@ tlb_context_demap(struct pmap *pm) s = intr_disable(); stxa(TLB_DEMAP_PRIMARY | TLB_DEMAP_CONTEXT, ASI_DMMU_DEMAP, 0); stxa(TLB_DEMAP_PRIMARY | TLB_DEMAP_CONTEXT, ASI_IMMU_DEMAP, 0); - membar(Sync); + flush(KERNBASE); intr_restore(s); } ipi_wait(cookie); @@ -111,7 +112,7 @@ tlb_page_demap(struct pmap *pm, vm_offse s = intr_disable(); stxa(TLB_DEMAP_VA(va) | flags, ASI_DMMU_DEMAP, 0); stxa(TLB_DEMAP_VA(va) | flags, ASI_IMMU_DEMAP, 0); - membar(Sync); + flush(KERNBASE); intr_restore(s); } ipi_wait(cookie); @@ -139,7 +140,7 @@ tlb_range_demap(struct pmap *pm, vm_offs for (va = start; va < end; va += PAGE_SIZE) { stxa(TLB_DEMAP_VA(va) | flags, ASI_DMMU_DEMAP, 0); stxa(TLB_DEMAP_VA(va) | flags, ASI_IMMU_DEMAP, 0); - membar(Sync); + flush(KERNBASE); } intr_restore(s); } Modified: stable/7/sys/sun4v/include/vmparam.h ============================================================================== --- stable/7/sys/sun4v/include/vmparam.h Thu Mar 19 14:09:20 2009 (r190050) +++ stable/7/sys/sun4v/include/vmparam.h Thu Mar 19 14:11:03 2009 (r190051) @@ -40,7 +40,6 @@ * $FreeBSD$ */ - #ifndef _MACHINE_VMPARAM_H_ #define _MACHINE_VMPARAM_H_ @@ -203,6 +202,7 @@ #define VM_MAXUSER_ADDRESS (VM_MAX_USER_ADDRESS) #define KERNBASE (VM_MIN_KERNEL_ADDRESS) +#define PROMBASE (VM_MIN_PROM_ADDRESS) #define USRSTACK (VM_MAX_USER_ADDRESS) /* From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:12:08 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B8ED106566B; Thu, 19 Mar 2009 14:12:08 +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 ECF908FC14; Thu, 19 Mar 2009 14:12:07 +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 n2JEC7Ei064323; Thu, 19 Mar 2009 14:12:07 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JEC721064320; Thu, 19 Mar 2009 14:12:07 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903191412.n2JEC721064320@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Mar 2009 14:12: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: r190052 - in stable/7/sys: . fs/udf 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, 19 Mar 2009 14:12:09 -0000 Author: avg Date: Thu Mar 19 14:12:07 2009 New Revision: 190052 URL: http://svn.freebsd.org/changeset/base/190052 Log: MFC 189082: udf_readatoffset: read through directory vnode, do not read > MAXBSIZE Approved by: jhb (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/fs/udf/udf.h stable/7/sys/fs/udf/udf_vfsops.c stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf.h ============================================================================== --- stable/7/sys/fs/udf/udf.h Thu Mar 19 14:11:03 2009 (r190051) +++ stable/7/sys/fs/udf/udf.h Thu Mar 19 14:12:07 2009 (r190052) @@ -95,27 +95,12 @@ struct ifid { MALLOC_DECLARE(M_UDFFENTRY); static __inline int -udf_readlblks(struct udf_mnt *udfmp, int sector, int size, struct buf **bp) +udf_readdevblks(struct udf_mnt *udfmp, int sector, int size, struct buf **bp) { return (RDSECTOR(udfmp->im_devvp, sector, (size + udfmp->bmask) & ~udfmp->bmask, bp)); } -static __inline int -udf_readalblks(struct udf_mnt *udfmp, int lsector, int size, struct buf **bp) -{ - daddr_t rablock, lblk; - int rasize; - - lblk = (lsector + udfmp->part_start) << (udfmp->bshift - DEV_BSHIFT); - rablock = (lblk + 1) << udfmp->bshift; - rasize = size; - - return (breadn(udfmp->im_devvp, lblk, - (size + udfmp->bmask) & ~udfmp->bmask, - &rablock, &rasize, 1, NOCRED, bp)); -} - /* * Produce a suitable file number from an ICB. The passed in ICB is expected * to be in little endian (meaning that it hasn't been swapped for big Modified: stable/7/sys/fs/udf/udf_vfsops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vfsops.c Thu Mar 19 14:11:03 2009 (r190051) +++ stable/7/sys/fs/udf/udf_vfsops.c Thu Mar 19 14:12:07 2009 (r190052) @@ -476,7 +476,7 @@ udf_mountfs(struct vnode *devvp, struct */ sector = le32toh(udfmp->root_icb.loc.lb_num) + udfmp->part_start; size = le32toh(udfmp->root_icb.len); - if ((error = udf_readlblks(udfmp, sector, size, &bp)) != 0) { + if ((error = udf_readdevblks(udfmp, sector, size, &bp)) != 0) { printf("Cannot read sector %d\n", sector); goto bail; } @@ -795,7 +795,7 @@ udf_find_partmaps(struct udf_mnt *udfmp, * XXX If reading the first Sparing Table fails, should look * for another table. */ - if ((error = udf_readlblks(udfmp, le32toh(pms->st_loc[0]), + if ((error = udf_readdevblks(udfmp, le32toh(pms->st_loc[0]), le32toh(pms->st_size), &bp)) != 0) { if (bp != NULL) brelse(bp); Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:11:03 2009 (r190051) +++ stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:12:07 2009 (r190052) @@ -1282,16 +1282,20 @@ static int udf_readatoffset(struct udf_node *node, int *size, off_t offset, struct buf **bp, uint8_t **data) { - struct udf_mnt *udfmp; - struct file_entry *fentry = NULL; + struct udf_mnt *udfmp = node->udfmp; + struct vnode *vp = node->i_vnode; + struct file_entry *fentry; struct buf *bp1; uint32_t max_size; daddr_t sector; + off_t off; + int adj_size; int error; - udfmp = node->udfmp; - - *bp = NULL; + /* + * This call is made *not* only to detect UDF_INVALID_BMAP case, + * max_size is used as an ad-hoc read-ahead hint for "normal" case. + */ error = udf_bmap_internal(node, offset, §or, &max_size); if (error == UDF_INVALID_BMAP) { /* @@ -1309,9 +1313,18 @@ udf_readatoffset(struct udf_node *node, /* Adjust the size so that it is within range */ if (*size == 0 || *size > max_size) *size = max_size; - *size = min(*size, MAXBSIZE); - if ((error = udf_readlblks(udfmp, sector, *size + (offset & udfmp->bmask), bp))) { + /* + * Because we will read starting at block boundary, we need to adjust + * how much we need to read so that all promised data is in. + * Also, we can't promise to read more than MAXBSIZE bytes starting + * from block boundary, so adjust what we promise too. + */ + off = blkoff(udfmp, offset); + *size = min(*size, MAXBSIZE - off); + adj_size = (*size + off + udfmp->bmask) & ~udfmp->bmask; + *bp = NULL; + if ((error = bread(vp, lblkno(udfmp, offset), adj_size, NOCRED, bp))) { printf("warning: udf_readlblks returned error %d\n", error); /* note: *bp may be non-NULL */ return (error); From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:15:12 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 F0975106566B; Thu, 19 Mar 2009 14:15:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D557F8FC15; Thu, 19 Mar 2009 14:15:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JEFBCr064537; Thu, 19 Mar 2009 14:15:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JEFBfU064531; Thu, 19 Mar 2009 14:15:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191415.n2JEFBfU064531@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 14:15: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: r190055 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 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, 19 Mar 2009 14:15:13 -0000 Author: marius Date: Thu Mar 19 14:15:11 2009 New Revision: 190055 URL: http://svn.freebsd.org/changeset/base/190055 Log: MFC: r182878 For cheetah-class CPUs ensure that the dt512_0 is set to hold 8k pages for all three contexts and configure the dt512_1 to hold 4MB pages for them (e.g. for direct mappings). This might allow for additional optimization by using the faulting page sizes provided by AA_DMMU_TAG_ACCESS_EXT for bypassing the page size walker for the dt512 in the superpage support code. Submitted by: nwhitehorn (initial patch) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/asi.h stable/7/sys/sparc64/include/tlb.h stable/7/sys/sparc64/sparc64/cheetah.c stable/7/sys/sparc64/sparc64/genassym.c stable/7/sys/sparc64/sparc64/pmap.c stable/7/sys/sparc64/sparc64/swtch.S Modified: stable/7/sys/sparc64/include/asi.h ============================================================================== --- stable/7/sys/sparc64/include/asi.h Thu Mar 19 14:14:21 2009 (r190054) +++ stable/7/sys/sparc64/include/asi.h Thu Mar 19 14:15:11 2009 (r190055) @@ -140,6 +140,7 @@ #define AA_DMMU_TSB_PEXT_REG 0x48 #define AA_DMMU_TSB_SEXT_REG 0x50 #define AA_DMMU_TSB_NEXT_REG 0x58 +#define AA_DMMU_TAG_ACCESS_EXT 0x60 /* US-III family */ #define ASI_DMMU_TSB_8KB_PTR_REG 0x59 #define ASI_DMMU_TSB_64KB_PTR_REG 0x5a Modified: stable/7/sys/sparc64/include/tlb.h ============================================================================== --- stable/7/sys/sparc64/include/tlb.h Thu Mar 19 14:14:21 2009 (r190054) +++ stable/7/sys/sparc64/include/tlb.h Thu Mar 19 14:15:11 2009 (r190055) @@ -51,6 +51,34 @@ #define TLB_TAR_VA(va) ((va) & ~TAR_CTX_MASK) #define TLB_TAR_CTX(ctx) ((ctx) & TAR_CTX_MASK) +#define TLB_CXR_CTX_BITS (13) +#define TLB_CXR_CTX_MASK \ + (((1UL << TLB_CXR_CTX_BITS) - 1) << TLB_CXR_CTX_SHIFT) +#define TLB_CXR_CTX_SHIFT (0) +#define TLB_CXR_PGSZ_BITS (3) +#define TLB_PCXR_PGSZ_MASK \ + ((((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_N_PGSZ0_SHIFT) | \ + (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_N_PGSZ1_SHIFT) | \ + (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_P_PGSZ0_SHIFT) | \ + (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_P_PGSZ1_SHIFT)) +#define TLB_PCXR_N_PGSZ0_SHIFT (61) +#define TLB_PCXR_N_PGSZ1_SHIFT (58) +#define TLB_PCXR_P_PGSZ0_SHIFT (16) +#define TLB_PCXR_P_PGSZ1_SHIFT (19) +#define TLB_SCXR_PGSZ_MASK \ + ((((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_SCXR_S_PGSZ0_SHIFT) | \ + (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_SCXR_S_PGSZ1_SHIFT)) +#define TLB_SCXR_S_PGSZ1_SHIFT (19) +#define TLB_SCXR_S_PGSZ0_SHIFT (16) + +#define TLB_TAE_PGSZ_BITS (3) +#define TLB_TAE_PGSZ0_MASK \ + (((1UL << TLB_TAE_PGSZ_BITS) - 1) << TLB_TAE_PGSZ0_SHIFT) +#define TLB_TAE_PGSZ1_MASK \ + (((1UL << TLB_TAE_PGSZ_BITS) - 1) << TLB_TAE_PGSZ1_SHIFT) +#define TLB_TAE_PGSZ0_SHIFT (16) +#define TLB_TAE_PGSZ1_SHIFT (19) + #define TLB_DEMAP_ID_SHIFT (4) #define TLB_DEMAP_ID_PRIMARY (0) #define TLB_DEMAP_ID_SECONDARY (1) @@ -59,8 +87,7 @@ #define TLB_DEMAP_TYPE_SHIFT (6) #define TLB_DEMAP_TYPE_PAGE (0) #define TLB_DEMAP_TYPE_CONTEXT (1) -/* US-III and greater only */ -#define TLB_DEMAP_TYPE_ALL (2) +#define TLB_DEMAP_TYPE_ALL (2) /* USIII and beyond only */ #define TLB_DEMAP_VA(va) ((va) & ~PAGE_MASK) #define TLB_DEMAP_ID(id) ((id) << TLB_DEMAP_ID_SHIFT) Modified: stable/7/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cheetah.c Thu Mar 19 14:14:21 2009 (r190054) +++ stable/7/sys/sparc64/sparc64/cheetah.c Thu Mar 19 14:15:11 2009 (r190055) @@ -92,6 +92,26 @@ cheetah_init(void) stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); membar(Sync); + /* + * Ensure that the dt512_0 is set to hold 8k pages for all three + * contexts and configure the dt512_1 to hold 4MB pages for them + * (e.g. for direct mappings). + * NB: according to documentation, this requires a contex demap + * _before_ changing the corresponding page size, but we hardly + * can flush our locked pages here, so we use a demap all instead. + */ + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); + membar(Sync); + stxa(AA_DMMU_PCXR, ASI_DMMU, + (TS_8K << TLB_PCXR_N_PGSZ0_SHIFT) | + (TS_4M << TLB_PCXR_N_PGSZ1_SHIFT) | + (TS_8K << TLB_PCXR_P_PGSZ0_SHIFT) | + (TS_4M << TLB_PCXR_P_PGSZ1_SHIFT)); + stxa(AA_DMMU_SCXR, ASI_DMMU, + (TS_8K << TLB_SCXR_S_PGSZ0_SHIFT) | + (TS_4M << TLB_SCXR_S_PGSZ1_SHIFT)); + flush(KERNBASE); + intr_restore(s); } Modified: stable/7/sys/sparc64/sparc64/genassym.c ============================================================================== --- stable/7/sys/sparc64/sparc64/genassym.c Thu Mar 19 14:14:21 2009 (r190054) +++ stable/7/sys/sparc64/sparc64/genassym.c Thu Mar 19 14:15:11 2009 (r190055) @@ -132,6 +132,7 @@ ASSYM(TD_W, TD_W); ASSYM(TS_MIN, TS_MIN); ASSYM(TS_MAX, TS_MAX); +ASSYM(TLB_PCXR_PGSZ_MASK, TLB_PCXR_PGSZ_MASK); ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK); ASSYM(TV_SIZE_BITS, TV_SIZE_BITS); #endif Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Thu Mar 19 14:14:21 2009 (r190054) +++ stable/7/sys/sparc64/sparc64/pmap.c Thu Mar 19 14:15:11 2009 (r190055) @@ -545,7 +545,6 @@ pmap_map_tsb(void) pa = tsb_kernel_phys + i; data = TD_V | TD_4M | TD_PA(pa) | TD_L | TD_CP | TD_CV | TD_P | TD_W; - /* XXX - cheetah */ stxa(AA_DMMU_TAR, ASI_DMMU, TLB_TAR_VA(va) | TLB_TAR_CTX(TLB_CTX_KERNEL)); stxa_sync(0, ASI_DTLB_DATA_IN_REG, data); @@ -555,7 +554,8 @@ pmap_map_tsb(void) * Set the secondary context to be the kernel context (needed for * FP block operations in the kernel). */ - stxa(AA_DMMU_SCXR, ASI_DMMU, TLB_CTX_KERNEL); + stxa(AA_DMMU_SCXR, ASI_DMMU, (ldxa(AA_DMMU_SCXR, ASI_DMMU) & + TLB_SCXR_PGSZ_MASK) | TLB_CTX_KERNEL); flush(KERNBASE); intr_restore(s); @@ -1960,7 +1960,8 @@ pmap_activate(struct thread *td) stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); - stxa(AA_DMMU_PCXR, ASI_DMMU, context); + stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) & + TLB_PCXR_PGSZ_MASK) | context); flush(KERNBASE); mtx_unlock_spin(&sched_lock); Modified: stable/7/sys/sparc64/sparc64/swtch.S ============================================================================== --- stable/7/sys/sparc64/sparc64/swtch.S Thu Mar 19 14:14:21 2009 (r190054) +++ stable/7/sys/sparc64/sparc64/swtch.S Thu Mar 19 14:15:11 2009 (r190055) @@ -236,7 +236,11 @@ ENTRY(cpu_switch) stxa %i4, [%i5] ASI_DMMU mov AA_IMMU_TSB, %i5 stxa %i4, [%i5] ASI_IMMU + setx TLB_PCXR_PGSZ_MASK, %i5, %i4 mov AA_DMMU_PCXR, %i5 + ldxa [%i5] ASI_DMMU, %i2 + and %i2, %i4, %i2 + or %i3, %i2, %i3 sethi %hi(KERNBASE), %i4 stxa %i3, [%i5] ASI_DMMU flush %i4 From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:17:35 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10B211065675; Thu, 19 Mar 2009 14:17:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE2B08FC1A; Thu, 19 Mar 2009 14:17:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JEHY9I064643; Thu, 19 Mar 2009 14:17:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JEHY9e064639; Thu, 19 Mar 2009 14:17:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191417.n2JEHY9e064639@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 14:17: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: r190056 - in stable/7/sys: . boot/sparc64/loader contrib/pf dev/ath/ath_hal dev/cxgb sparc64/sparc64 sun4v/include 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, 19 Mar 2009 14:17:36 -0000 Author: marius Date: Thu Mar 19 14:17:34 2009 New Revision: 190056 URL: http://svn.freebsd.org/changeset/base/190056 Log: MFC: r182916, r188455 (partial) Work around Cheetah+ erratum 34 (USIII+ erratum #10) by relocating the locked entry in it16 slot 0, which typically is occupied by the PROM, and manually entering locked entries in slots != 0. Thanks to Hubert Feyrer for donating the Blade 2000 this change was developed on. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/sparc64/loader/main.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/sparc64/genassym.c stable/7/sys/sparc64/sparc64/mp_locore.S stable/7/sys/sun4v/include/asi.h Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Thu Mar 19 14:15:11 2009 (r190055) +++ stable/7/sys/boot/sparc64/loader/main.c Thu Mar 19 14:17:34 2009 (r190056) @@ -6,6 +6,31 @@ * As long as the above copyright statement and this notice remain * unchanged, you can do what ever you want with this file. */ +/*- + * Copyright (c) 2008 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ #include __FBSDID("$FreeBSD$"); @@ -65,6 +90,7 @@ static vm_offset_t dtlb_va_to_pa_sun4u(v static inline u_long itlb_get_data_sun4u(int slot); static void itlb_enter_sun4u(u_long vpn, u_long data); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); +static void itlb_relocate_locked0_sun4u(void); extern vm_offset_t md_load(char *, vm_offset_t *); static int sparc64_autoload(void); static ssize_t sparc64_readin(const int, vm_offset_t, const size_t); @@ -456,9 +482,32 @@ static void itlb_enter_sun4u(u_long vpn, u_long data) { u_long reg; + int i; reg = rdpr(pstate); wrpr(pstate, reg & ~PSTATE_IE, 0); + + if (cpu_impl == CPU_IMPL_ULTRASPARCIIIp) { + /* + * Search an unused slot != 0 and explicitly enter the data + * and tag there in order to avoid Cheetah+ erratum 34. + */ + for (i = 1; i < itlb_slot_max; i++) { + if ((itlb_get_data_sun4u(i) & TD_V) != 0) + continue; + + stxa(AA_IMMU_TAR, ASI_IMMU, + TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); + stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); + flush(PROMBASE); + break; + } + wrpr(pstate, reg, 0); + if (i == itlb_slot_max) + panic("%s: could not find an unused slot", __func__); + return; + } + stxa(AA_IMMU_TAR, ASI_IMMU, TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); stxa(0, ASI_ITLB_DATA_IN_REG, data); @@ -466,6 +515,48 @@ itlb_enter_sun4u(u_long vpn, u_long data wrpr(pstate, reg, 0); } +static void +itlb_relocate_locked0_sun4u(void) +{ + u_long data, pstate, tag; + int i; + + if (cpu_impl != CPU_IMPL_ULTRASPARCIIIp) + return; + + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + + data = itlb_get_data_sun4u(0); + if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) { + wrpr(pstate, pstate, 0); + return; + } + + /* Flush the mapping of slot 0. */ + tag = ldxa(TLB_DAR_SLOT(0), ASI_ITLB_TAG_READ_REG); + stxa(TLB_DEMAP_VA(TLB_TAR_VA(tag)) | TLB_DEMAP_PRIMARY | + TLB_DEMAP_PAGE, ASI_IMMU_DEMAP, 0); + flush(0); /* The USIII-family ignores the address. */ + + /* + * Search a replacement slot != 0 and enter the data and tag + * that formerly were in slot 0. + */ + for (i = 1; i < itlb_slot_max; i++) { + if ((itlb_get_data_sun4u(i) & TD_V) != 0) + continue; + + stxa(AA_IMMU_TAR, ASI_IMMU, tag); + stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); + flush(0); /* The USIII-family ignores the address. */ + break; + } + wrpr(pstate, pstate, 0); + if (i == itlb_slot_max) + panic("%s: could not find a replacement slot", __func__); +} + static int mmu_mapin_sun4u(vm_offset_t va, vm_size_t len) { @@ -603,6 +694,25 @@ tlb_init_sun4u(void) OF_getprop(child, "#itlb-entries", &itlb_slot_max, sizeof(itlb_slot_max)) == -1) panic("%s: can't get TLB slot max.", __func__); + + if (cpu_impl == CPU_IMPL_ULTRASPARCIIIp) { +#ifdef LOADER_DEBUG + printf("pre fixup:\n"); + pmap_print_tlb_sun4u(); +#endif + + /* + * Relocate the locked entry in it16 slot 0 (if existent) + * as part of working around Cheetah+ erratum 34. + */ + itlb_relocate_locked0_sun4u(); + +#ifdef LOADER_DEBUG + printf("post fixup:\n"); + pmap_print_tlb_sun4u(); +#endif + } + dtlb_store = malloc(dtlb_slot_max * sizeof(*dtlb_store)); itlb_store = malloc(itlb_slot_max * sizeof(*itlb_store)); if (dtlb_store == NULL || itlb_store == NULL) Modified: stable/7/sys/sparc64/sparc64/genassym.c ============================================================================== --- stable/7/sys/sparc64/sparc64/genassym.c Thu Mar 19 14:15:11 2009 (r190055) +++ stable/7/sys/sparc64/sparc64/genassym.c Thu Mar 19 14:17:34 2009 (r190056) @@ -123,15 +123,18 @@ ASSYM(TTE_SHIFT, TTE_SHIFT); ASSYM(TTE_VPN, offsetof(struct tte, tte_vpn)); ASSYM(TTE_DATA, offsetof(struct tte, tte_data)); +ASSYM(TD_V, TD_V); ASSYM(TD_EXEC, TD_EXEC); ASSYM(TD_REF, TD_REF); ASSYM(TD_SW, TD_SW); +ASSYM(TD_L, TD_L); ASSYM(TD_CP, TD_CP); ASSYM(TD_CV, TD_CV); ASSYM(TD_W, TD_W); ASSYM(TS_MIN, TS_MIN); ASSYM(TS_MAX, TS_MAX); +ASSYM(TLB_DAR_SLOT_SHIFT, TLB_DAR_SLOT_SHIFT); ASSYM(TLB_PCXR_PGSZ_MASK, TLB_PCXR_PGSZ_MASK); ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK); ASSYM(TV_SIZE_BITS, TV_SIZE_BITS); Modified: stable/7/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_locore.S Thu Mar 19 14:15:11 2009 (r190055) +++ stable/7/sys/sparc64/sparc64/mp_locore.S Thu Mar 19 14:17:34 2009 (r190056) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2002 Jake Burkholder. + * Copyright (c) 2008 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,12 +43,78 @@ __FBSDID("$FreeBSD$"); .text _ALIGN_TEXT -1: rd %pc, %l0 - ldx [%l0 + (4f-1b)], %l1 - add %l0, (6f-1b), %l2 + /* + * Initialize misc. state to known values: interrupts disabled, + * normal globals, no clean windows, PIL 0, and floating point + * disabled. + */ +1: wrpr %g0, PSTATE_NORMAL, %pstate + wrpr %g0, 0, %cleanwin + wrpr %g0, 0, %pil + wr %g0, 0, %fprs + + rdpr %ver, %l7 + srlx %l7, VER_IMPL_SHIFT, %l7 + sll %l7, VER_IMPL_SIZE, %l7 + srl %l7, VER_IMPL_SIZE, %l7 + cmp %l7, CPU_IMPL_ULTRASPARCIIIp + bne %icc, 3f + nop + + /* + * Relocate the locked entry in it16 slot 0 (if existent) + * as part of working around Cheetah+ erratum 34. + */ + + setx TD_V | TD_L, %l1, %l0 + /* + * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * around errata of USIII and beyond. + */ + ldxa [%g0] ASI_ITLB_DATA_ACCESS_REG, %g0 + ldxa [%g0] ASI_ITLB_DATA_ACCESS_REG, %l6 + and %l6, %l0, %l1 + cmp %l0, %l1 + bne %xcc, 3f + nop + + /* Flush the mapping of slot 0. */ + ldxa [%g0] ASI_ITLB_TAG_READ_REG, %l5 + srlx %l5, TAR_VPN_SHIFT, %l0 + sllx %l0, TAR_VPN_SHIFT, %l0 + or %l0, TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, %l0 + stxa %g0, [%l0] ASI_IMMU_DEMAP + /* The USIII-family ignores the address. */ + flush %g0 + + /* + * Search a replacement slot != 0 and enter the data and tag + * that formerly were in slot 0. + */ + mov (1 << TLB_DAR_SLOT_SHIFT), %l4 + setx TD_V, %l1, %l0 + /* + * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * around errata of USIII and beyond. + */ +2: ldxa [%l4] ASI_ITLB_DATA_ACCESS_REG, %g0 + ldxa [%l4] ASI_ITLB_DATA_ACCESS_REG, %l1 + and %l1, %l0, %l1 + cmp %l0, %l1 + be,a %xcc, 2b + add %l4, (1 << TLB_DAR_SLOT_SHIFT), %l4 + wr %g0, ASI_IMMU, %asi + stxa %l5, [%g0 + AA_IMMU_TAR] %asi + stxa %l6, [%l4] ASI_ITLB_DATA_ACCESS_REG + /* The USIII-family ignores the address. */ + flush %g0 + +3: rd %pc, %l6 + ldx [%l6 + (9f-3b)], %l1 + add %l6, (11f-3b), %l2 clr %l3 -2: cmp %l3, %l1 - be %xcc, 3f +4: cmp %l3, %l1 + be %xcc, 8f nop ldx [%l2 + TTE_VPN], %l4 ldx [%l2 + TTE_DATA], %l5 @@ -56,41 +123,64 @@ __FBSDID("$FreeBSD$"); wr %g0, ASI_DMMU, %asi stxa %l4, [%g0 + AA_DMMU_TAR] %asi stxa %l5, [%g0] ASI_DTLB_DATA_IN_REG - wr %g0, ASI_IMMU, %asi + membar #Sync + + cmp %l7, CPU_IMPL_ULTRASPARCIIIp + bne %icc, 6f + wr %g0, ASI_IMMU, %asi + + /* + * Search an unused slot != 0 and explicitly enter the data + * and tag there in order to avoid Cheetah+ erratum 34. + */ + mov (1 << TLB_DAR_SLOT_SHIFT), %l0 + setx TD_V, %o1, %o0 + /* + * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * around errata of USIII and beyond. + */ +5: ldxa [%l0] ASI_ITLB_DATA_ACCESS_REG, %g0 + ldxa [%l0] ASI_ITLB_DATA_ACCESS_REG, %o1 + and %o1, %o0, %o1 + cmp %o0, %o1 + be,a %xcc, 5b + add %l0, (1 << TLB_DAR_SLOT_SHIFT), %l0 + sethi %hi(KERNBASE), %o0 + stxa %l4, [%g0 + AA_IMMU_TAR] %asi + stxa %l5, [%l0] ASI_ITLB_DATA_ACCESS_REG + flush %o0 + ba %xcc, 7f + nop + +6: sethi %hi(KERNBASE), %l0 stxa %l4, [%g0 + AA_IMMU_TAR] %asi stxa %l5, [%g0] ASI_ITLB_DATA_IN_REG - membar #Sync - flush %l4 - add %l2, 1 << TTE_SHIFT, %l2 + flush %l0 +7: add %l2, 1 << TTE_SHIFT, %l2 add %l3, 1, %l3 - ba %xcc, 2b + ba %xcc, 4b nop -3: ldx [%l0 + (5f-1b)], %l1 +8: ldx [%l6 + (10f-3b)], %l1 jmpl %l1, %g0 nop _ALIGN_DATA -4: .xword 0x0 -5: .xword 0x0 -6: +9: .xword 0x0 +10: .xword 0x0 +11: DATA(mp_tramp_code) .xword 1b DATA(mp_tramp_code_len) - .xword 6b-1b + .xword 11b-1b DATA(mp_tramp_tlb_slots) - .xword 4b-1b + .xword 9b-1b DATA(mp_tramp_func) - .xword 5b-1b + .xword 10b-1b /* * void mp_startup(void) */ ENTRY(mp_startup) - wrpr %g0, PSTATE_NORMAL, %pstate - wrpr %g0, 0, %cleanwin - wrpr %g0, 0, %pil - wr %g0, 0, %fprs - SET(cpu_start_args, %l1, %l0) mov CPU_TICKSYNC, %l1 Modified: stable/7/sys/sun4v/include/asi.h ============================================================================== --- stable/7/sys/sun4v/include/asi.h Thu Mar 19 14:15:11 2009 (r190055) +++ stable/7/sys/sun4v/include/asi.h Thu Mar 19 14:17:34 2009 (r190056) @@ -162,6 +162,7 @@ #define ASI_ITLB_DATA_IN_REG 0x54 #define ASI_ITLB_DATA_ACCESS_REG 0x55 #define ASI_ITLB_TAG_READ_REG 0x56 +#define ASI_IMMU_DEMAP 0x57 #define ASI_DMMU 0x58 #define ASI_DTLB_DATA_IN_REG 0x5c #define ASI_DTLB_DATA_ACCESS_REG 0x5d From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:20:01 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E1501065673; Thu, 19 Mar 2009 14:20:01 +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 5AA9D8FC20; Thu, 19 Mar 2009 14:20:01 +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 n2JEK16G064743; Thu, 19 Mar 2009 14:20:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JEK1DP064742; Thu, 19 Mar 2009 14:20:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903191420.n2JEK1DP064742@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Mar 2009 14:20:01 +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: r190057 - in stable/7/sys: . fs/udf 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, 19 Mar 2009 14:20:02 -0000 Author: avg Date: Thu Mar 19 14:20:00 2009 New Revision: 190057 URL: http://svn.freebsd.org/changeset/base/190057 Log: MFC 189111: udf_readatoffset: correctly hanlde data in fentry Approved by: jhb (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:17:34 2009 (r190056) +++ stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:20:00 2009 (r190057) @@ -1305,6 +1305,12 @@ udf_readatoffset(struct udf_node *node, fentry = node->fentry; *data = &fentry->data[le32toh(fentry->l_ea)]; *size = le32toh(fentry->l_ad); + if (offset >= *size) + *size = 0; + else { + *data += offset; + *size -= offset; + } return (0); } else if (error != 0) { return (error); From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:26:16 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 129E5106567A; Thu, 19 Mar 2009 14:26:16 +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 003018FC29; Thu, 19 Mar 2009 14:26:16 +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 n2JEQF5e064972; Thu, 19 Mar 2009 14:26:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JEQFE8064971; Thu, 19 Mar 2009 14:26:15 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903191426.n2JEQFE8064971@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Mar 2009 14:26:15 +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: r190059 - in stable/7/sys: . fs/udf 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, 19 Mar 2009 14:26:17 -0000 Author: avg Date: Thu Mar 19 14:26:15 2009 New Revision: 190059 URL: http://svn.freebsd.org/changeset/base/190059 Log: MFC 189302: udf_readdir: do not advance offset if entry can not be uio-ed Approved by: jhb (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:23:17 2009 (r190058) +++ stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:26:15 2009 (r190059) @@ -846,11 +846,11 @@ udf_readdir(struct vop_readdir_args *a) } if (error) break; + uio->uio_offset = ds->offset + ds->off; } /* tell the calling layer whether we need to be called again */ *a->a_eofflag = uiodir.eofflag; - uio->uio_offset = ds->offset + ds->off; if (error < 0) error = 0; From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:32: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 E9730106564A; Thu, 19 Mar 2009 14:32:11 +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 D77EA8FC20; Thu, 19 Mar 2009 14:32:11 +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 n2JEWBxj065155; Thu, 19 Mar 2009 14:32:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JEWBjT065154; Thu, 19 Mar 2009 14:32:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903191432.n2JEWBjT065154@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Mar 2009 14:32: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: r190060 - in stable/7/sys: . fs/udf 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, 19 Mar 2009 14:32:12 -0000 Author: avg Date: Thu Mar 19 14:32:11 2009 New Revision: 190060 URL: http://svn.freebsd.org/changeset/base/190060 Log: MFC 189364: udf: use truly unique directory cookie Approved by: jhb (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:26:15 2009 (r190059) +++ stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 14:32:11 2009 (r190060) @@ -725,7 +725,7 @@ udf_getfid(struct udf_dirstream *ds) * Update the offset. Align on a 4 byte boundary because the * UDF spec says so. */ - ds->this_off = ds->off; + ds->this_off = ds->offset + ds->off; if (!ds->fid_fragment) { ds->off += (total_fid_size + 3) & ~0x03; } else { From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 14:51: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 BE8BB106570A; Thu, 19 Mar 2009 14:51:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A935B8FC08; Thu, 19 Mar 2009 14:51:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JEpuV0065619; Thu, 19 Mar 2009 14:51:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JEpu0h065617; Thu, 19 Mar 2009 14:51:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191451.n2JEpu0h065617@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 14:51: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: r190061 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 14:51:59 -0000 Author: marius Date: Thu Mar 19 14:51:56 2009 New Revision: 190061 URL: http://svn.freebsd.org/changeset/base/190061 Log: MFC: r183152 Clear any possibly pending PCI error bits left by the firmware. These could trigger an error interrupt that we can't actually to do anything against as soon as enabling the error handlers. While at it don't bother about writing only to the write-one-to-clear bits when clearing error bits. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/pci/psycho.c stable/7/sys/sparc64/pci/psychoreg.h Modified: stable/7/sys/sparc64/pci/psycho.c ============================================================================== --- stable/7/sys/sparc64/pci/psycho.c Thu Mar 19 14:32:11 2009 (r190060) +++ stable/7/sys/sparc64/pci/psycho.c Thu Mar 19 14:51:56 2009 (r190061) @@ -369,9 +369,6 @@ psycho_attach(device_t dev) sc->sc_mtx = osc->sc_mtx; } - /* Clear PCI AFSR. */ - PCICTL_WRITE8(sc, PCR_AFS, PCIAFSR_ERRMASK); - csr = PSYCHO_READ8(sc, PSR_CS); ver = PSYCHO_GCSR_VERS(csr); sc->sc_ign = 0x1f; /* Hummingbird/Sabre IGN is always 0x1f. */ @@ -425,7 +422,7 @@ psycho_attach(device_t dev) break; } - csr |= PCICTL_SERR | PCICTL_ERRINTEN | PCICTL_ARB_4; + csr |= PCICTL_ERRINTEN | PCICTL_ARB_4; csr &= ~(PCICTL_SBHINTEN | PCICTL_WAKEUPEN); #ifdef PSYCHO_DEBUG device_printf(dev, "PCI CSR 0x%016llx -> 0x%016llx\n", @@ -533,46 +530,7 @@ psycho_attach(device_t dev) "controller for INO %d", __func__, n); } - /* - * Establish handlers for interesting interrupts... - * - * XXX We need to remember these and remove this to support - * hotplug on the UPA/FHC bus. - * - * XXX Not all controllers have these, but installing them - * is better than trying to sort through this mess. - */ - psycho_set_intr(sc, 1, PSR_UE_INT_MAP, psycho_ue, NULL); - psycho_set_intr(sc, 2, PSR_CE_INT_MAP, psycho_ce, NULL); -#ifdef DEBUGGER_ON_POWERFAIL - psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, psycho_powerfail, - NULL); -#else - psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, NULL, - (driver_intr_t *)psycho_powerfail); -#endif - /* Psycho-specific initialization */ if (sc->sc_mode == PSYCHO_MODE_PSYCHO) { - /* - * Hummingbirds/Sabres do not have the following two - * interrupts. - */ - - /* - * The spare hardware interrupt is used for the - * over-temperature interrupt. - */ - psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, - NULL, psycho_overtemp); -#ifdef PSYCHO_MAP_WAKEUP - /* - * psycho_wakeup() doesn't do anything useful right - * now. - */ - psycho_set_intr(sc, 5, PSR_PWRMGT_INT_MAP, - psycho_wakeup, NULL); -#endif /* PSYCHO_MAP_WAKEUP */ - /* Initialize the counter-timer. */ sparc64_counter_init(device_get_nameunit(dev), rman_get_bustag(sc->sc_mem_res), @@ -612,14 +570,6 @@ psycho_attach(device_t dev) iommu_reset(sc->sc_is); } - /* - * Register a PCI bus error interrupt handler according to which - * half this is. Hummingbird/Sabre don't have a PCI bus B error - * interrupt but they are also only used for PCI bus A. - */ - psycho_set_intr(sc, 0, sc->sc_half == 0 ? PSR_PCIAERR_INT_MAP : - PSR_PCIBERR_INT_MAP, psycho_pci_bus, NULL); - /* Allocate our tags. */ sc->sc_pci_memt = psycho_alloc_bus_tag(sc, PCI_MEMORY_BUS_SPACE); sc->sc_pci_iot = psycho_alloc_bus_tag(sc, PCI_IO_BUS_SPACE); @@ -643,11 +593,61 @@ psycho_attach(device_t dev) prop_array[0], prop_array[1], prop_array[0]); sc->sc_pci_secbus = prop_array[0]; - /* Clear PCI status error bits. */ + /* Clear any pending PCI error bits. */ PCIB_WRITE_CONFIG(dev, sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, - PCIR_STATUS, PCIM_STATUS_PERR | PCIM_STATUS_RMABORT | - PCIM_STATUS_RTABORT | PCIM_STATUS_STABORT | - PCIM_STATUS_PERRREPORT, 2); + PCIR_STATUS, PCIB_READ_CONFIG(dev, sc->sc_pci_secbus, + PCS_DEVICE, PCS_FUNC, PCIR_STATUS, 2), 2); + PCICTL_WRITE8(sc, PCR_CS, PCICTL_READ8(sc, PCR_CS)); + PCICTL_WRITE8(sc, PCR_AFS, PCICTL_READ8(sc, PCR_AFS)); + + if (osc == NULL) { + /* + * Establish handlers for interesting interrupts... + * + * XXX We need to remember these and remove this to support + * hotplug on the UPA/FHC bus. + * + * XXX Not all controllers have these, but installing them + * is better than trying to sort through this mess. + */ + psycho_set_intr(sc, 1, PSR_UE_INT_MAP, psycho_ue, NULL); + psycho_set_intr(sc, 2, PSR_CE_INT_MAP, psycho_ce, NULL); +#ifdef DEBUGGER_ON_POWERFAIL + psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, psycho_powerfail, + NULL); +#else + psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, NULL, + (driver_intr_t *)psycho_powerfail); +#endif + if (sc->sc_mode == PSYCHO_MODE_PSYCHO) { + /* + * Hummingbirds/Sabres do not have the following two + * interrupts. + */ + + /* + * The spare hardware interrupt is used for the + * over-temperature interrupt. + */ + psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, + NULL, psycho_overtemp); +#ifdef PSYCHO_MAP_WAKEUP + /* + * psycho_wakeup() doesn't do anything useful right + * now. + */ + psycho_set_intr(sc, 5, PSR_PWRMGT_INT_MAP, + psycho_wakeup, NULL); +#endif /* PSYCHO_MAP_WAKEUP */ + } + } + /* + * Register a PCI bus error interrupt handler according to which + * half this is. Hummingbird/Sabre don't have a PCI bus B error + * interrupt but they are also only used for PCI bus A. + */ + psycho_set_intr(sc, 0, sc->sc_half == 0 ? PSR_PCIAERR_INT_MAP : + PSR_PCIBERR_INT_MAP, psycho_pci_bus, NULL); /* * Set the latency timer register as this isn't always done by the @@ -808,7 +808,7 @@ psycho_ce(void *arg) device_printf(sc->sc_dev, "correctable DMA error AFAR %#lx " "AFSR %#lx\n", (u_long)afar, (u_long)afsr); /* Clear the error bits that we caught. */ - PSYCHO_WRITE8(sc, PSR_CE_AFS, afsr & CEAFSR_ERRMASK); + PSYCHO_WRITE8(sc, PSR_CE_AFS, afsr); mtx_unlock_spin(sc->sc_mtx); return (FILTER_HANDLED); } Modified: stable/7/sys/sparc64/pci/psychoreg.h ============================================================================== --- stable/7/sys/sparc64/pci/psychoreg.h Thu Mar 19 14:32:11 2009 (r190060) +++ stable/7/sys/sparc64/pci/psychoreg.h Thu Mar 19 14:51:56 2009 (r190061) @@ -265,10 +265,6 @@ #define CEAFSR_P_DRD (1UL << 62) /* Pri. error caused by DVMA read */ #define CEAFSR_P_PIO (1UL << 63) /* Pri. error caused by PIO access */ -#define CEAFSR_ERRMASK \ - (CEAFSR_P_PIO | CEAFSR_P_DRD | CEAFSR_P_DWR | \ - CEAFSR_S_PIO | CEAFSR_S_DRD | CEAFSR_S_DWR) - /* PCI asynchronous fault status register */ #define PCIAFSR_P_MA (1UL << 63) /* Pri. master abort */ #define PCIAFSR_P_TA (1UL << 62) /* Pri. target abort */ @@ -282,10 +278,6 @@ #define PCIAFSR_BLK (1UL << 31) /* failed pri. transfer was block r/w */ #define PCIAFSR_MID (0x3eUL << 25) /* UPA MID causing error transaction */ -#define PCIAFSR_ERRMASK \ - (PCIAFSR_P_MA | PCIAFSR_P_TA | PCIAFSR_P_RTRY | PCIAFSR_P_RERR |\ - PCIAFSR_S_MA | PCIAFSR_S_TA | PCIAFSR_S_RTRY | PCIAFSR_S_RERR) - /* PCI diagnostic register */ #define DIAG_RTRY_DIS 0x0000000000000040 /* dis. retry limit */ #define DIAG_ISYNC_DIS 0x0000000000000020 /* dis. DMA write / int sync */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 15:01:25 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0586C1065670; Thu, 19 Mar 2009 15:01:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6E288FC14; Thu, 19 Mar 2009 15:01:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JF1OSU065900; Thu, 19 Mar 2009 15:01:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JF1OQl065899; Thu, 19 Mar 2009 15:01:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191501.n2JF1OQl065899@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 15:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190062 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/sparc64 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, 19 Mar 2009 15:01:25 -0000 Author: marius Date: Thu Mar 19 15:01:24 2009 New Revision: 190062 URL: http://svn.freebsd.org/changeset/base/190062 Log: MFC: r183144 - Add a missing prototype. - Remove a banal comment. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/sparc64/intr_machdep.c Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Thu Mar 19 14:51:56 2009 (r190061) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Thu Mar 19 15:01:24 2009 (r190062) @@ -111,6 +111,7 @@ static struct mtx intrcnt_lock; static int assign_cpu; static void intr_assign_next_cpu(struct intr_vector *iv); +static void intr_shuffle_irqs(void *arg __unused); #endif static int intr_assign_cpu(void *arg, u_char cpu); @@ -520,7 +521,7 @@ intr_add_cpu(u_int cpu) /* * Distribute all the interrupt sources among the available CPUs once the - * AP's have been launched. + * APs have been launched. */ static void intr_shuffle_irqs(void *arg __unused) @@ -533,7 +534,6 @@ intr_shuffle_irqs(void *arg __unused) if (mp_ncpus == 1) return; - /* Round-robin assign a CPU to each enabled source. */ sx_xlock(&intr_table_lock); assign_cpu = 1; for (i = 0; i < IV_MAX; i++) { From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 15: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 95C031065670; Thu, 19 Mar 2009 15:08:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67C6B8FC1E; Thu, 19 Mar 2009 15:08:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JF8at3066120; Thu, 19 Mar 2009 15:08:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JF8a5L066119; Thu, 19 Mar 2009 15:08:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191508.n2JF8a5L066119@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 15:08:36 +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: r190063 - in stable/7/sys: . conf contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 15:08:37 -0000 Author: marius Date: Thu Mar 19 15:08:35 2009 New Revision: 190063 URL: http://svn.freebsd.org/changeset/base/190063 Log: MFC: r183202, r183203, r183204 Some of the assembly files depend on v9a/v9b-only instructions so compile these with -mcpu=ultrasparc (which is the hard-coded default of our system compiler), which allows the remainder of the kernel to be compiled with "only" -mcpu=v9 for reference and testing purposes. Modified: stable/7/sys/ (props changed) stable/7/sys/conf/files.sparc64 stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/conf/files.sparc64 ============================================================================== --- stable/7/sys/conf/files.sparc64 Thu Mar 19 15:01:24 2009 (r190062) +++ stable/7/sys/conf/files.sparc64 Thu Mar 19 15:08:35 2009 (r190063) @@ -90,19 +90,22 @@ sparc64/sparc64/db_trace.c optional ddb sparc64/sparc64/db_hwwatch.c optional ddb sparc64/sparc64/dump_machdep.c standard sparc64/sparc64/elf_machdep.c standard -sparc64/sparc64/exception.S standard no-obj +sparc64/sparc64/exception.S standard no-obj \ + compile-with "${NORMAL_S} -mcpu=ultrasparc" sparc64/sparc64/eeprom.c optional eeprom ebus | eeprom fhc | \ eeprom sbus sparc64/sparc64/gdb_machdep.c optional gdb sparc64/sparc64/identcpu.c standard sparc64/sparc64/in_cksum.c optional inet -sparc64/sparc64/interrupt.S standard no-obj +sparc64/sparc64/interrupt.S standard no-obj \ + compile-with "${NORMAL_S} -mcpu=ultrasparc" sparc64/sparc64/intr_machdep.c standard sparc64/sparc64/iommu.c standard sparc64/sparc64/locore.S standard no-obj sparc64/sparc64/machdep.c standard sparc64/sparc64/mem.c optional mem -sparc64/sparc64/mp_exception.S optional smp +sparc64/sparc64/mp_exception.S optional smp \ + compile-with "${NORMAL_S} -mcpu=ultrasparc" sparc64/sparc64/mp_locore.S optional smp sparc64/sparc64/mp_machdep.c optional smp sparc64/sparc64/nexus.c standard @@ -115,7 +118,8 @@ sparc64/sparc64/rwindow.c standard sparc64/sparc64/sc_machdep.c optional sc sparc64/sparc64/spitfire.c standard sparc64/sparc64/stack_machdep.c optional ddb | stack -sparc64/sparc64/support.S standard +sparc64/sparc64/support.S standard \ + compile-with "${NORMAL_S} -mcpu=ultrasparc" sparc64/sparc64/sys_machdep.c standard sparc64/sparc64/swtch.S standard sparc64/sparc64/tick.c standard From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 15:16: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 ECEE2106568D; Thu, 19 Mar 2009 15:16:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8B588FC0C; Thu, 19 Mar 2009 15:16:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JFG5Z7066325; Thu, 19 Mar 2009 15:16:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JFG5Vx066323; Thu, 19 Mar 2009 15:16:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191516.n2JFG5Vx066323@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 15:16: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: r190064 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/dc 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, 19 Mar 2009 15:16:07 -0000 Author: marius Date: Thu Mar 19 15:16:05 2009 New Revision: 190064 URL: http://svn.freebsd.org/changeset/base/190064 Log: MFC: r183505 cosmetic changes and style fixes Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/dc/dcphy.c stable/7/sys/dev/dc/pnphy.c Modified: stable/7/sys/dev/dc/dcphy.c ============================================================================== --- stable/7/sys/dev/dc/dcphy.c Thu Mar 19 15:08:35 2009 (r190063) +++ stable/7/sys/dev/dc/dcphy.c Thu Mar 19 15:16:05 2009 (r190064) @@ -35,9 +35,9 @@ __FBSDID("$FreeBSD$"); /* * Pseudo-driver for internal NWAY support on DEC 21143 and workalike - * controllers. Technically we're abusing the miibus code to handle + * controllers. Technically we're abusing the miibus code to handle * media selection and NWAY support here since there is no MII - * interface. However the logical operations are roughly the same, + * interface. However the logical operations are roughly the same, * and the alternative is to create a fake MII interface in the driver, * which is harder to do. */ @@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$"); /* * This is the subsystem ID for the built-in 21143 ethernet - * in several Compaq Presario systems. Apparently these are + * in several Compaq Presario systems. Apparently these are * 10Mbps only, so we need to treat them specially. */ #define COMPAQ_PRESARIO_ID 0xb0bb0e11 @@ -127,7 +127,7 @@ dcphy_probe(device_t dev) */ if (ma->mii_id1 != DC_VENDORID_DEC || ma->mii_id2 != DC_DEVICEID_21143) - return(ENXIO); + return (ENXIO); device_set_desc(dev, "Intel 21143 NWAY media interface"); @@ -171,20 +171,16 @@ dcphy_attach(device_t dev) switch (pci_get_subdevice(brdev) << 16 | pci_get_subvendor(brdev)) { case COMPAQ_PRESARIO_ID: /* Example of how to only allow 10Mbps modes. */ - sc->mii_capabilities = BMSR_ANEG|BMSR_10TFDX|BMSR_10THDX; + sc->mii_capabilities = BMSR_ANEG | BMSR_10TFDX | BMSR_10THDX; break; default: - if (dc_sc->dc_pmode == DC_PMODE_SIA) { + if (dc_sc->dc_pmode == DC_PMODE_SIA) sc->mii_capabilities = - BMSR_ANEG|BMSR_10TFDX|BMSR_10THDX; - } else { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, - sc->mii_inst), BMCR_LOOP|BMCR_S100); - + BMSR_ANEG | BMSR_10TFDX | BMSR_10THDX; + else sc->mii_capabilities = - BMSR_ANEG|BMSR_100TXFDX|BMSR_100TXHDX| - BMSR_10TFDX|BMSR_10THDX; - } + BMSR_ANEG | BMSR_100TXFDX | BMSR_100TXHDX | + BMSR_10TFDX | BMSR_10THDX; break; } @@ -195,7 +191,7 @@ dcphy_attach(device_t dev) #undef ADD MIIBUS_MEDIAINIT(sc->mii_dev); - return(0); + return (0); } static int @@ -213,9 +209,8 @@ dcphy_service(struct mii_softc *sc, stru /* * If we're not polling our PHY instance, just return. */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { + if (IFM_INST(ife->ifm_media) != sc->mii_inst) return (0); - } break; case MII_MEDIACHG: @@ -223,9 +218,8 @@ dcphy_service(struct mii_softc *sc, stru * If the media indicates a different PHY instance, * isolate ourselves. */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { + if (IFM_INST(ife->ifm_media) != sc->mii_inst) return (0); - } /* * If the interface is not up, don't do anything. @@ -236,8 +230,8 @@ dcphy_service(struct mii_softc *sc, stru sc->mii_flags = 0; mii->mii_media_active = IFM_NONE; mode = CSR_READ_4(dc_sc, DC_NETCFG); - mode &= ~(DC_NETCFG_FULLDUPLEX|DC_NETCFG_PORTSEL| - DC_NETCFG_PCS|DC_NETCFG_SCRAMBLER|DC_NETCFG_SPEEDSEL); + mode &= ~(DC_NETCFG_FULLDUPLEX | DC_NETCFG_PORTSEL | + DC_NETCFG_PCS | DC_NETCFG_SCRAMBLER | DC_NETCFG_SPEEDSEL); switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: @@ -252,7 +246,7 @@ dcphy_service(struct mii_softc *sc, stru case IFM_100_TX: dcphy_reset(sc); DC_CLRBIT(dc_sc, DC_10BTCTRL, DC_TCTL_AUTONEGENBL); - mode |= DC_NETCFG_PORTSEL|DC_NETCFG_PCS| + mode |= DC_NETCFG_PORTSEL | DC_NETCFG_PCS | DC_NETCFG_SCRAMBLER; if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) mode |= DC_NETCFG_FULLDUPLEX; @@ -278,7 +272,7 @@ dcphy_service(struct mii_softc *sc, stru CSR_WRITE_4(dc_sc, DC_NETCFG, mode); break; default: - return(EINVAL); + return (EINVAL); } break; @@ -366,7 +360,7 @@ dcphy_status(struct mii_softc *sc) anlpar = tstat >> 16; if (anlpar & ANLPAR_TX_FD && sc->mii_capabilities & BMSR_100TXFDX) - mii->mii_media_active |= IFM_100_TX|IFM_FDX; + mii->mii_media_active |= IFM_100_TX | IFM_FDX; else if (anlpar & ANLPAR_T4 && sc->mii_capabilities & BMSR_100T4) mii->mii_media_active |= IFM_100_T4; @@ -374,7 +368,7 @@ dcphy_status(struct mii_softc *sc) sc->mii_capabilities & BMSR_100TXHDX) mii->mii_media_active |= IFM_100_TX; else if (anlpar & ANLPAR_10_FD) - mii->mii_media_active |= IFM_10_T|IFM_FDX; + mii->mii_media_active |= IFM_10_T | IFM_FDX; else if (anlpar & ANLPAR_10) mii->mii_media_active |= IFM_10_T; else @@ -384,10 +378,11 @@ dcphy_status(struct mii_softc *sc) DC_TCTL_AUTONEGENBL); return; } + /* * If the other side doesn't support NWAY, then the * best we can do is determine if we have a 10Mbps or - * 100Mbps link. There's no way to know if the link + * 100Mbps link. There's no way to know if the link * is full or half duplex, so we default to half duplex * and hope that the user is clever enough to manually * change the media settings if we're wrong. @@ -404,15 +399,12 @@ dcphy_status(struct mii_softc *sc) } skip: - if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_SPEEDSEL) mii->mii_media_active |= IFM_10_T; else mii->mii_media_active |= IFM_100_TX; if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX) mii->mii_media_active |= IFM_FDX; - - return; } static int @@ -433,7 +425,7 @@ dcphy_auto(struct mii_softc *mii) DC_SETBIT(sc, DC_10BTCTRL, DC_TCTL_AUTONEGENBL); DC_SETBIT(sc, DC_10BTSTAT, DC_ASTAT_TXDISABLE); - return(EJUSTRETURN); + return (EJUSTRETURN); } static void @@ -446,7 +438,4 @@ dcphy_reset(struct mii_softc *mii) DC_CLRBIT(sc, DC_SIARESET, DC_SIA_RESET); DELAY(1000); DC_SETBIT(sc, DC_SIARESET, DC_SIA_RESET); - - return; } - Modified: stable/7/sys/dev/dc/pnphy.c ============================================================================== --- stable/7/sys/dev/dc/pnphy.c Thu Mar 19 15:08:35 2009 (r190063) +++ stable/7/sys/dev/dc/pnphy.c Thu Mar 19 15:16:05 2009 (r190064) @@ -35,8 +35,8 @@ __FBSDID("$FreeBSD$"); /* * Pseudo-driver for media selection on the Lite-On PNIC 82c168 - * chip. The NWAY support on this chip is horribly broken, so we - * only support manual mode selection. This is lame, but getting + * chip. The NWAY support on this chip is horribly broken, so we + * only support manual mode selection. This is lame, but getting * NWAY to work right is amazingly difficult. */ @@ -112,7 +112,7 @@ pnphy_probe(device_t dev) */ if (ma->mii_id1 != DC_VENDORID_LO || ma->mii_id2 != DC_DEVICEID_82C168) - return(ENXIO); + return (ENXIO); device_set_desc(dev, "PNIC 82c168 media interface"); @@ -143,7 +143,7 @@ pnphy_attach(device_t dev) #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) sc->mii_capabilities = - BMSR_100TXFDX|BMSR_100TXHDX|BMSR_10TFDX|BMSR_10THDX; + BMSR_100TXFDX | BMSR_100TXHDX | BMSR_10TFDX | BMSR_10THDX; sc->mii_capabilities &= ma->mii_capmask; device_printf(dev, " "); mii_add_media(sc); @@ -157,7 +157,7 @@ pnphy_attach(device_t dev) #undef ADD MIIBUS_MEDIAINIT(sc->mii_dev); - return(0); + return (0); } static int @@ -170,9 +170,8 @@ pnphy_service(struct mii_softc *sc, stru /* * If we're not polling our PHY instance, just return. */ - if (IFM_INST(ife->ifm_media) != sc->mii_inst) { + if (IFM_INST(ife->ifm_media) != sc->mii_inst) return (0); - } break; case MII_MEDIACHG: @@ -200,19 +199,19 @@ pnphy_service(struct mii_softc *sc, stru */ return (EINVAL); case IFM_100_TX: - mii->mii_media_active = IFM_ETHER|IFM_100_TX; + mii->mii_media_active = IFM_ETHER | IFM_100_TX; if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) mii->mii_media_active |= IFM_FDX; MIIBUS_STATCHG(sc->mii_dev); - return(0); + return (0); case IFM_10_T: - mii->mii_media_active = IFM_ETHER|IFM_10_T; + mii->mii_media_active = IFM_ETHER | IFM_10_T; if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) mii->mii_media_active |= IFM_FDX; MIIBUS_STATCHG(sc->mii_dev); - return(0); + return (0); default: - return(EINVAL); + return (EINVAL); } break; @@ -263,6 +262,4 @@ pnphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_TX; if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX) mii->mii_media_active |= IFM_FDX; - - return; } From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 15:21: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 AFA221065674; Thu, 19 Mar 2009 15:21:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BD778FC1C; Thu, 19 Mar 2009 15:21:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JFL49p066470; Thu, 19 Mar 2009 15:21:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JFL40i066469; Thu, 19 Mar 2009 15:21:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191521.n2JFL40i066469@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 15:21: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: r190065 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 15:21:05 -0000 Author: marius Date: Thu Mar 19 15:21:04 2009 New Revision: 190065 URL: http://svn.freebsd.org/changeset/base/190065 Log: MFC: 183762 Enable mpt(4) as some later models have on-board Fusion-MPT controllers and it's sufficient endian-clean since r189999. While at it, remove the commented out ncr(4) as it doesn't even use bus_dma(9), which isn't worth fixing though as sym(4) already supports a superset of the controllers driven by ncr(4). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/conf/GENERIC Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Thu Mar 19 15:16:05 2009 (r190064) +++ stable/7/sys/sparc64/conf/GENERIC Thu Mar 19 15:21:04 2009 (r190065) @@ -95,9 +95,8 @@ options AHC_REG_PRETTY_PRINT # Print re # output. Adds ~128k to driver. device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters -#device mpt # LSI-Logic MPT-Fusion -#device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') +device mpt # LSI-Logic MPT-Fusion +device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D device esp # NCR53c9x (FEPS/FAS366) # SCSI peripherals From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 15:30:45 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 A2E8D1065670; Thu, 19 Mar 2009 15:30:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F4208FC0C; Thu, 19 Mar 2009 15:30:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JFUjAx066725; Thu, 19 Mar 2009 15:30:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JFUjlj066724; Thu, 19 Mar 2009 15:30:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191530.n2JFUjlj066724@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 15:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190066 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/sparc64 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, 19 Mar 2009 15:30:46 -0000 Author: marius Date: Thu Mar 19 15:30:45 2009 New Revision: 190066 URL: http://svn.freebsd.org/changeset/base/190066 Log: MFC: r185006 Micro-optimize spitfire_block_{copy,zero}(): - Predict the loop as taken as it's more likely that there's still data to copy and memory to zero respectively. - Don't waste the delay slot. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/sparc64/support.S Modified: stable/7/sys/sparc64/sparc64/support.S ============================================================================== --- stable/7/sys/sparc64/sparc64/support.S Thu Mar 19 15:21:04 2009 (r190065) +++ stable/7/sys/sparc64/sparc64/support.S Thu Mar 19 15:30:45 2009 (r190066) @@ -647,7 +647,7 @@ ENTRY(spitfire_block_copy) stda %f32, [%o1] %asi add %o0, 64, %o0 sub %o2, 64, %o2 - ba %xcc, 2b + ba,pt %xcc, 2b add %o1, 64, %o1 3: membar #Sync @@ -655,10 +655,8 @@ ENTRY(spitfire_block_copy) stda %f16, [%o1] %asi membar #Sync - wr %g0, 0, %fprs - retl - nop + wr %g0, 0, %fprs END(spitfire_block_copy) /* @@ -704,14 +702,12 @@ ENTRY(spitfire_block_zero) stda %f0, [%o0 + 128] %asi stda %f0, [%o0 + 192] %asi sub %o1, 256, %o1 - brnz %o1, 1b + brnz,pt %o1, 1b add %o0, 256, %o0 membar #Sync - wr %g0, 0, %fprs - retl - nop + wr %g0, 0, %fprs END(spitfire_block_zero) .globl fpu_fault_end @@ -806,7 +802,6 @@ ENTRY(bintr) ENTRY(eintr) nop - /* * XXX including sys/gmon.h in genassym.c is not possible due to uintfptr_t * badness. From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 15:32: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 02821106566B; Thu, 19 Mar 2009 15:32:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C92F28FC21; Thu, 19 Mar 2009 15:32:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JFWGsF066810; Thu, 19 Mar 2009 15:32:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JFWGKI066809; Thu, 19 Mar 2009 15:32:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191532.n2JFWGKI066809@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 15:32: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: r190067 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/sparc64 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, 19 Mar 2009 15:32:18 -0000 Author: marius Date: Thu Mar 19 15:32:16 2009 New Revision: 190067 URL: http://svn.freebsd.org/changeset/base/190067 Log: MFC: r185007 Use the spitfire VIS block copy/zero functions also with cheetah- class CPUs. In theory one could also use versions additionally taking advantage of the prefetch cache with cheetah-class CPUs, in my worldstone runs these either didn't provide extra speedup (USIII+) in comparison to the existing spitfire versions or were even slightly slower (USIIIi) though, so they aren't committed for now. The basic problem leading to the VIS-based copy/zero functions being initially disabled for cheetah-class CPUs was solved by letting cheetah_init() clear DCR_IFPOE. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/sparc64/machdep.c Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 15:30:45 2009 (r190066) +++ stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 15:32:16 2009 (r190067) @@ -387,6 +387,12 @@ sparc64_init(caddr_t mdp, u_long o1, u_l case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: case CPU_IMPL_ULTRASPARCIIe: + case CPU_IMPL_ULTRASPARCIII: /* NB: we've disabled P$. */ + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + case CPU_IMPL_ULTRASPARCIIIip: cpu_block_copy = spitfire_block_copy; cpu_block_zero = spitfire_block_zero; break; @@ -773,7 +779,7 @@ sparc64_shutdown_final(void *dummy, int /* Turn the power off? */ if ((howto & RB_POWEROFF) != 0) cpu_shutdown(&args); - /* In case of halt, return to the firmware */ + /* In case of halt, return to the firmware. */ if ((howto & RB_HALT) != 0) cpu_halt(); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 15:35: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 3D5A5106564A; Thu, 19 Mar 2009 15:35:34 +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 2A5288FC1F; Thu, 19 Mar 2009 15:35:34 +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 n2JFZYwD066961; Thu, 19 Mar 2009 15:35:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JFZYh5066959; Thu, 19 Mar 2009 15:35:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903191535.n2JFZYh5066959@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Mar 2009 15:35: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: r190068 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/puc dev/uart 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, 19 Mar 2009 15:35:35 -0000 Author: jhb Date: Thu Mar 19 15:35:33 2009 New Revision: 190068 URL: http://svn.freebsd.org/changeset/base/190068 Log: MFC: Add support for the single-port NetMos NM9835 serial adapter. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/puc/pucdata.c stable/7/sys/dev/uart/uart_bus_pci.c Modified: stable/7/sys/dev/puc/pucdata.c ============================================================================== --- stable/7/sys/dev/puc/pucdata.c Thu Mar 19 15:32:16 2009 (r190067) +++ stable/7/sys/dev/puc/pucdata.c Thu Mar 19 15:35:33 2009 (r190068) @@ -743,6 +743,18 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_2P, 0x10, 8, 0, }, + /* + * This is more specific than the generic NM9835 entry that follows, and + * is placed here to _prevent_ puc from claiming this single port card. + * + * uart(4) will claim this device. + */ + { 0x9710, 0x9835, 0x1000, 1, + "NetMos NM9835 based 1-port serial", + DEFAULT_RCLK, + PUC_PORT_1S, 0x10, 4, 0, + }, + { 0x9710, 0x9835, 0xffff, 0, "NetMos NM9835 Dual UART and 1284 Printer port", DEFAULT_RCLK, Modified: stable/7/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/7/sys/dev/uart/uart_bus_pci.c Thu Mar 19 15:32:16 2009 (r190067) +++ stable/7/sys/dev/uart/uart_bus_pci.c Thu Mar 19 15:35:33 2009 (r190068) @@ -109,6 +109,7 @@ static struct pci_id pci_ns8250_ids[] = { 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART", 0x10, 16384000 }, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, +{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 15:40:45 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 01E651065693; Thu, 19 Mar 2009 15:40:44 +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 CD4578FC21; Thu, 19 Mar 2009 15:40:44 +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 n2JFeicE067168; Thu, 19 Mar 2009 15:40:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JFeiLb067165; Thu, 19 Mar 2009 15:40:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903191540.n2JFeiLb067165@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Mar 2009 15:40: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: r190070 - in stable/7/sys: . boot/i386/libi386 contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 15:40:49 -0000 Author: jhb Date: Thu Mar 19 15:40:44 2009 New Revision: 190070 URL: http://svn.freebsd.org/changeset/base/190070 Log: MFC: Teach the BIOS CD driver to use bounce buffers when the destination address is > 1 MB. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/i386/libi386/bioscd.c stable/7/sys/boot/i386/libi386/biosdisk.c stable/7/sys/boot/i386/libi386/libi386.h stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/boot/i386/libi386/bioscd.c ============================================================================== --- stable/7/sys/boot/i386/libi386/bioscd.c Thu Mar 19 15:40:39 2009 (r190069) +++ stable/7/sys/boot/i386/libi386/bioscd.c Thu Mar 19 15:40:44 2009 (r190070) @@ -173,9 +173,9 @@ bc_add(int biosdev) static void bc_print(int verbose) { - int i; char line[80]; - + int i; + for (i = 0; i < nbcinfo; i++) { sprintf(line, " cd%d: Device 0x%x\n", i, bcinfo[i].bc_sp.sp_devicespec); @@ -235,7 +235,7 @@ bc_strategy(void *devdata, int rw, daddr if (dblk % (BIOSCD_SECSIZE / DEV_BSIZE) != 0) return (EINVAL); dblk /= (BIOSCD_SECSIZE / DEV_BSIZE); - DEBUG("read %d from %d to %p", blks, dblk, buf); + DEBUG("read %d from %lld to %p", blks, dblk, buf); if (rsize) *rsize = 0; @@ -244,9 +244,9 @@ bc_strategy(void *devdata, int rw, daddr return (EIO); } #ifdef BD_SUPPORT_FRAGS - DEBUG("bc_strategy: frag read %d from %d+%d to %p", + DEBUG("frag read %d from %lld+%d to %p", fragsize, dblk, blks, buf + (blks * BIOSCD_SECSIZE)); - if (fragsize && bc_read(unit, dblk + blks, 1, fragsize)) { + if (fragsize && bc_read(unit, dblk + blks, 1, fragbuf)) { DEBUG("frag read error"); return(EIO); } @@ -257,11 +257,15 @@ bc_strategy(void *devdata, int rw, daddr return (0); } +/* Max number of sectors to bounce-buffer at a time. */ +#define CD_BOUNCEBUF 8 + static int bc_read(int unit, daddr_t dblk, int blks, caddr_t dest) { - u_int result, retry; - static unsigned short packet[8]; + u_int maxfer, resid, result, retry, x; + caddr_t bbuf, p, xp; + static struct edd_packet packet; int biosdev; #ifdef DISK_DEBUG int error; @@ -275,47 +279,77 @@ bc_read(int unit, daddr_t dblk, int blks if (blks == 0) return (0); + /* Decide whether we have to bounce */ + if (VTOP(dest) >> 20 != 0) { + /* + * The destination buffer is above first 1MB of + * physical memory so we have to arrange a suitable + * bounce buffer. + */ + x = min(CD_BOUNCEBUF, (unsigned)blks); + bbuf = alloca(x * BIOSCD_SECSIZE); + maxfer = x; + } else { + bbuf = NULL; + maxfer = 0; + } + biosdev = bc_unit2bios(unit); - /* - * Loop retrying the operation a couple of times. The BIOS - * may also retry. - */ - for (retry = 0; retry < 3; retry++) { - /* If retrying, reset the drive */ - if (retry > 0) { + resid = blks; + p = dest; + + while (resid > 0) { + if (bbuf) + xp = bbuf; + else + xp = p; + x = resid; + if (maxfer > 0) + x = min(x, maxfer); + + /* + * Loop retrying the operation a couple of times. The BIOS + * may also retry. + */ + for (retry = 0; retry < 3; retry++) { + /* If retrying, reset the drive */ + if (retry > 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0; + v86.edx = biosdev; + v86int(); + } + + packet.len = 0x10; + packet.count = x; + packet.offset = VTOPOFF(xp); + packet.seg = VTOPSEG(xp); + packet.lba = dblk; v86.ctl = V86_FLAGS; v86.addr = 0x13; - v86.eax = 0; + v86.eax = 0x4200; v86.edx = biosdev; + v86.ds = VTOPSEG(&packet); + v86.esi = VTOPOFF(&packet); v86int(); + result = (v86.efl & PSL_C); + if (result == 0) + break; } - - packet[0] = 0x10; - packet[1] = blks; - packet[2] = VTOPOFF(dest); - packet[3] = VTOPSEG(dest); - packet[4] = dblk & 0xffff; - packet[5] = dblk >> 16; - packet[6] = 0; - packet[7] = 0; - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x4200; - v86.edx = biosdev; - v86.ds = VTOPSEG(packet); - v86.esi = VTOPOFF(packet); - v86int(); - result = (v86.efl & PSL_C); - if (result == 0) - break; - } #ifdef DISK_DEBUG - error = (v86.eax >> 8) & 0xff; + error = (v86.eax >> 8) & 0xff; #endif - DEBUG("%d sectors from %ld to %p (0x%x) %s", blks, dblk, dest, - VTOP(dest), result ? "failed" : "ok"); - DEBUG("unit %d status 0x%x", unit, error); + DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, + VTOP(p), result ? "failed" : "ok"); + DEBUG("unit %d status 0x%x", unit, error); + if (bbuf != NULL) + bcopy(bbuf, p, x * BIOSCD_SECSIZE); + p += (x * BIOSCD_SECSIZE); + dblk += x; + resid -= x; + } /* hexdump(dest, (blks * BIOSCD_SECSIZE)); */ return(0); Modified: stable/7/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/7/sys/boot/i386/libi386/biosdisk.c Thu Mar 19 15:40:39 2009 (r190069) +++ stable/7/sys/boot/i386/libi386/biosdisk.c Thu Mar 19 15:40:44 2009 (r190070) @@ -1109,14 +1109,6 @@ bd_realstrategy(void *devdata, int rw, d /* Max number of sectors to bounce-buffer if the request crosses a 64k boundary */ #define FLOPPY_BOUNCEBUF 18 -struct edd_packet { - uint16_t len; - uint16_t count; - uint16_t offset; - uint16_t seg; - uint64_t lba; -}; - static int bd_edd_io(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest, int write) { Modified: stable/7/sys/boot/i386/libi386/libi386.h ============================================================================== --- stable/7/sys/boot/i386/libi386/libi386.h Thu Mar 19 15:40:39 2009 (r190069) +++ stable/7/sys/boot/i386/libi386/libi386.h Thu Mar 19 15:40:44 2009 (r190070) @@ -52,6 +52,14 @@ struct i386_devdesc } d_kind; }; +struct edd_packet { + uint16_t len; + uint16_t count; + uint16_t offset; + uint16_t seg; + uint64_t lba; +}; + int i386_getdev(void **vdev, const char *devspec, const char **path); char *i386_fmtdev(void *vdev); int i386_setcurrdev(struct env_var *ev, int flags, const void *value); From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 15:45: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 63F281065796; Thu, 19 Mar 2009 15:45:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3642C8FC15; Thu, 19 Mar 2009 15:45:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JFjier067388; Thu, 19 Mar 2009 15:45:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JFjiIN067387; Thu, 19 Mar 2009 15:45:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191545.n2JFjiIN067387@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 15:45: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: r190072 - stable/7/share/man/man9 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 15:45:46 -0000 Author: marius Date: Thu Mar 19 15:45:43 2009 New Revision: 190072 URL: http://svn.freebsd.org/changeset/base/190072 Log: MFC: r179694 Mark "highaddr" and "lowaddr" appropriately. Change "dma" to "DMA". Fix spelling mistage found by rodrigc@. Reviewed by: rodrigc, danger Modified: stable/7/share/man/man9/ (props changed) stable/7/share/man/man9/bus_dma.9 Modified: stable/7/share/man/man9/bus_dma.9 ============================================================================== --- stable/7/share/man/man9/bus_dma.9 Thu Mar 19 15:44:13 2009 (r190071) +++ stable/7/share/man/man9/bus_dma.9 Thu Mar 19 15:45:43 2009 (r190072) @@ -283,7 +283,7 @@ Client specified lock/mutex manipulation This will be called from within busdma whenever a client lock needs to be manipulated. In its current form, the function will be called immediately before -the callback for a dma load operation that has been deferred with +the callback for a DMA load operation that has been deferred with .Dv BUS_DMA_LOCK and immediately after with .Dv BUS_DMA_UNLOCK . @@ -364,17 +364,26 @@ indicates that there are no boundary res Bounds of the window of bus address space that .Em cannot be directly accessed by the device. -The window contains all addresses greater than lowaddr and -less than or equal to highaddr. -For example, a device incapable of DMA above 4GB, would specify -a highaddr of +The window contains all addresses greater than +.Fa lowaddr +and less than or equal to +.Fa highaddr . +For example, a device incapable of DMA above 4GB, would specify a +.Fa highaddr +of .Dv BUS_SPACE_MAXADDR -and a lowaddr of +and a +.Fa lowaddr +of .Dv BUS_SPACE_MAXADDR_32BIT . -Similarly a device that can only dma to addresses bellow 16MB would -specify a highaddr of +Similarly a device that can only perform DMA to addresses below +16MB would specify a +.Fa highaddr +of .Dv BUS_SPACE_MAXADDR -and a lowaddr of +and a +.Fa lowaddr +of .Dv BUS_SPACE_MAXADDR_24BIT . Some implementations requires that some region of device visible address space, overlapping available host memory, be outside the From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 15:49:31 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 2C7B4106566C; Thu, 19 Mar 2009 15:49:31 +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 19CC08FC1A; Thu, 19 Mar 2009 15:49:31 +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 n2JFnUmC067577; Thu, 19 Mar 2009 15:49:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JFnUku067576; Thu, 19 Mar 2009 15:49:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903191549.n2JFnUku067576@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Mar 2009 15:49:30 +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: r190074 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/udf 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, 19 Mar 2009 15:49:31 -0000 Author: avg Date: Thu Mar 19 15:49:30 2009 New Revision: 190074 URL: http://svn.freebsd.org/changeset/base/190074 Log: MFC 179060: udf: fix and speedup timestamp calculations markus and emax are notified Approved by: jhb (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/udf/udf_vnops.c Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 15:46:33 2009 (r190073) +++ stable/7/sys/fs/udf/udf_vnops.c Thu Mar 19 15:49:30 2009 (r190074) @@ -188,9 +188,9 @@ udf_open(struct vop_open_args *ap) { return 0; } -static int mon_lens[2][12] = { - {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, - {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} +static const int mon_lens[2][12] = { + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}, + {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335} }; static int @@ -206,25 +206,25 @@ udf_isaleapyear(int year) } /* - * XXX This is just a rough hack. Daylight savings isn't calculated and tv_nsec - * is ignored. * Timezone calculation compliments of Julian Elischer . */ static void udf_timetotimespec(struct timestamp *time, struct timespec *t) { - int i, lpyear, daysinyear, year; + int i, lpyear, daysinyear, year, startyear; union { uint16_t u_tz_offset; int16_t s_tz_offset; } tz; - t->tv_nsec = 0; - - /* DirectCD seems to like using bogus year values */ + /* + * DirectCD seems to like using bogus year values. + * Don't trust time->month as it will be used for an array index. + */ year = le16toh(time->year); - if (year < 1970) { + if (year < 1970 || time->month < 1 || time->month > 12) { t->tv_sec = 0; + t->tv_nsec = 0; return; } @@ -232,25 +232,37 @@ udf_timetotimespec(struct timestamp *tim t->tv_sec = time->second; t->tv_sec += time->minute * 60; t->tv_sec += time->hour * 3600; - t->tv_sec += time->day * 3600 * 24; + t->tv_sec += (time->day - 1) * 3600 * 24; /* Calculate the month */ lpyear = udf_isaleapyear(year); - for (i = 1; i < time->month; i++) - t->tv_sec += mon_lens[lpyear][i] * 3600 * 24; + t->tv_sec += mon_lens[lpyear][time->month - 1] * 3600 * 24; /* Speed up the calculation */ - if (year > 1979) + startyear = 1970; + if (year > 2009) { + t->tv_sec += 1262304000; + startyear += 40; + } else if (year > 1999) { + t->tv_sec += 946684800; + startyear += 30; + } else if (year > 1989) { + t->tv_sec += 631152000; + startyear += 20; + } else if (year > 1979) { t->tv_sec += 315532800; - if (year > 1989) - t->tv_sec += 315619200; - if (year > 1999) - t->tv_sec += 315532800; - for (i = 2000; i < year; i++) { - daysinyear = udf_isaleapyear(i) + 365 ; - t->tv_sec += daysinyear * 3600 * 24; + startyear += 10; } + daysinyear = (year - startyear) * 365; + for (i = startyear; i < year; i++) + daysinyear += udf_isaleapyear(i); + t->tv_sec += daysinyear * 3600 * 24; + + /* Calculate microseconds */ + t->tv_nsec = time->centisec * 10000 + time->hund_usec * 100 + + time->usec; + /* * Calculate the time zone. The timezone is 12 bit signed 2's * complement, so we gotta do some extra magic to handle it right. @@ -259,7 +271,7 @@ udf_timetotimespec(struct timestamp *tim tz.u_tz_offset &= 0x0fff; if (tz.u_tz_offset & 0x0800) tz.u_tz_offset |= 0xf000; /* extend the sign to 16 bits */ - if ((time->type_tz & 0x1000) && (tz.s_tz_offset != -2047)) + if ((le16toh(time->type_tz) & 0x1000) && (tz.s_tz_offset != -2047)) t->tv_sec -= tz.s_tz_offset * 60; return; From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 16:03: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 919BD1065674; Thu, 19 Mar 2009 16:03:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C07C8FC16; Thu, 19 Mar 2009 16:03:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JG3L2Q068123; Thu, 19 Mar 2009 16:03:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JG3LMw068119; Thu, 19 Mar 2009 16:03:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191603.n2JG3LMw068119@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 16:03: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: r190077 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 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, 19 Mar 2009 16:03:22 -0000 Author: marius Date: Thu Mar 19 16:03:21 2009 New Revision: 190077 URL: http://svn.freebsd.org/changeset/base/190077 Log: MFC: r185008, r188456 - Allow the front-end to specify that iommu(4) should disable rerun of the streaming cache for silicon bug workarounds. - Announce the presence of a streaming cache on attach for informational purposes. - For performance reasons don't do unnecessary flushes of the streaming cache when coherent mappings are synced. - Fix some minor style issues. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/bus_private.h stable/7/sys/sparc64/include/iommureg.h stable/7/sys/sparc64/include/iommuvar.h stable/7/sys/sparc64/sparc64/iommu.c Modified: stable/7/sys/sparc64/include/bus_private.h ============================================================================== --- stable/7/sys/sparc64/include/bus_private.h Thu Mar 19 15:59:29 2009 (r190076) +++ stable/7/sys/sparc64/include/bus_private.h Thu Mar 19 16:03:21 2009 (r190077) @@ -66,9 +66,10 @@ struct bus_dmamap { int dm_flags; /* (p) */ }; -/* Flag values. */ -#define DMF_LOADED 1 /* Map is loaded */ -#define DMF_COHERENT 2 /* Coherent mapping requested */ +/* Flag values */ +#define DMF_LOADED (1 << 0) /* Map is loaded. */ +#define DMF_COHERENT (1 << 1) /* Coherent mapping requested. */ +#define DMF_STREAMED (1 << 2) /* Streaming cache used. */ int sparc64_dma_alloc_map(bus_dma_tag_t dmat, bus_dmamap_t *mapp); void sparc64_dma_free_map(bus_dma_tag_t dmat, bus_dmamap_t map); Modified: stable/7/sys/sparc64/include/iommureg.h ============================================================================== --- stable/7/sys/sparc64/include/iommureg.h Thu Mar 19 15:59:29 2009 (r190076) +++ stable/7/sys/sparc64/include/iommureg.h Thu Mar 19 16:03:21 2009 (r190077) @@ -54,7 +54,7 @@ #define ISR_PGFLUSH 0x0008 /* streaming buffer page flush */ #define ISR_FLUSHSYNC 0x0010 /* streaming buffer flush sync */ -/* streaming buffer diagnostics registers. */ +/* streaming buffer diagnostics registers */ #define ISD_DATA_DIAG 0x0000 /* streaming buffer data RAM diag 0..127 */ #define ISD_ERROR_DIAG 0x0400 /* streaming buffer error status diag 0..127 */ #define ISD_PG_TAG_DIAG 0x0800 /* streaming buffer page tag diag 0..15 */ @@ -63,6 +63,7 @@ /* streaming buffer control register */ #define STRBUF_EN 0x0000000000000001UL #define STRBUF_D 0x0000000000000002UL +#define STRBUF_RR_DIS 0x0000000000000004UL #define IOMMU_MAXADDR(bits) ((1UL << (bits)) - 1) @@ -91,7 +92,7 @@ #define IOMMUCR_EN 0x0000000000000001UL /* - * Diagnostic register definitions. + * Diagnostic register definitions */ #define IOMMU_DTAG_VPNBITS 19 #define IOMMU_DTAG_VPNMASK ((1 << IOMMU_DTAG_VPNBITS) - 1) @@ -126,10 +127,10 @@ /* Writeable */ #define IOTTE_W 0x0000000000000002UL -/* log2 of the IOMMU TTE size. */ +/* log2 of the IOMMU TTE size */ #define IOTTE_SHIFT 3 -/* Streaming buffer line size. */ +/* Streaming buffer line size */ #define STRBUF_LINESZ 64 /* Modified: stable/7/sys/sparc64/include/iommuvar.h ============================================================================== --- stable/7/sys/sparc64/include/iommuvar.h Thu Mar 19 15:59:29 2009 (r190076) +++ stable/7/sys/sparc64/include/iommuvar.h Thu Mar 19 16:03:21 2009 (r190077) @@ -45,12 +45,12 @@ TAILQ_HEAD(iommu_maplruq_head, bus_dmamap); /* - * Per-IOMMU state. The parenthesized comments indicate the locking strategy: + * Per-IOMMU state; the parenthesized comments indicate the locking strategy: * i - protected by is_mtx. * r - read-only after initialization. * * - comment refers to pointer target / target hardware registers * (for bus_addr_t). - * is_maplruq is also locked by is_mtx. Elements of is_tsb may only be + * is_maplruq is also locked by is_mtx. Elements of is_tsb may only be * accessed from functions operating on the map owning the corresponding * resource, so the locking the user is required to do to protect the * map is sufficient. @@ -81,7 +81,7 @@ struct iommu_state { */ volatile char is_flush[STRBUF_FLUSHSYNC_NBYTES * 3 - 1]; - /* copies of our parents state, to allow us to be self contained */ + /* copies of our parent's state, to allow us to be self contained */ bus_space_tag_t is_bustag; /* (r) Our bus tag */ bus_space_handle_t is_bushandle; /* (r) */ bus_addr_t is_iommu; /* (r, *i) IOMMU registers */ @@ -96,6 +96,9 @@ struct iommu_state { bus_addr_t is_dva; /* (r, *r) */ /* Tag compare diagnostics access */ bus_addr_t is_dtcmp; /* (r, *r) */ + /* behavior flags */ + u_int is_flags; /* (r) */ +#define IOMMU_RERUN_DISABLE (1 << 0) }; /* interfaces for PCI/SBus code */ Modified: stable/7/sys/sparc64/sparc64/iommu.c ============================================================================== --- stable/7/sys/sparc64/sparc64/iommu.c Thu Mar 19 15:59:29 2009 (r190076) +++ stable/7/sys/sparc64/sparc64/iommu.c Thu Mar 19 16:03:21 2009 (r190077) @@ -119,8 +119,7 @@ __FBSDID("$FreeBSD$"); * - When running out of DVMA space, return EINPROGRESS in the non- * BUS_DMA_NOWAIT case and delay the callback until sufficient space * becomes available. - * - Use the streaming cache unless BUS_DMA_COHERENT is specified; do not - * flush the streaming cache when coherent mappings are synced. + * - Use the streaming cache unless BUS_DMA_COHERENT is specified. */ #include "opt_iommu.h" @@ -150,12 +149,12 @@ __FBSDID("$FreeBSD$"); #include /* - * Tuning constants. + * Tuning constants */ #define IOMMU_MAX_PRE (32 * 1024) #define IOMMU_MAX_PRE_SEG 3 -/* Threshold for using the streaming buffer. */ +/* Threshold for using the streaming buffer */ #define IOMMU_STREAM_THRESH 128 MALLOC_DEFINE(M_IOMMU, "dvmamem", "IOMMU DVMA Buffers"); @@ -309,9 +308,10 @@ iommu_init(const char *name, struct iomm is->is_dvmabase = IOTSB_VSTART(is->is_tsbsize); size = IOTSB_BASESZ << is->is_tsbsize; - printf("%s: DVMA map: %#lx to %#lx\n", name, + printf("%s: DVMA map: %#lx to %#lx%s\n", name, is->is_dvmabase, is->is_dvmabase + - (size << (IO_PAGE_SHIFT - IOTTE_SHIFT)) - 1); + (size << (IO_PAGE_SHIFT - IOTTE_SHIFT)) - 1, + IOMMU_HAS_SB(is) ? ", streaming buffer" : ""); /* * Set up resource mamangement. @@ -376,11 +376,13 @@ iommu_reset(struct iommu_state *is) for (i = 0; i < 2; i++) { if (is->is_sb[i] != 0) { - /* Enable diagnostics mode? */ - IOMMU_WRITE8(is, is_sb[i], ISR_CTL, STRBUF_EN); - - /* No streaming buffers? Disable them */ - if (IOMMU_READ8(is, is_sb[i], ISR_CTL) == 0) + IOMMU_WRITE8(is, is_sb[i], ISR_CTL, STRBUF_EN | + ((is->is_flags & IOMMU_RERUN_DISABLE) != 0 ? + STRBUF_RR_DIS : 0)); + + /* No streaming buffers? Disable them. */ + if ((IOMMU_READ8(is, is_sb[i], ISR_CTL) & + STRBUF_EN) == 0) is->is_sb[i] = 0; } } @@ -585,7 +587,7 @@ iommu_dvmamap_vunload(struct iommu_state struct bus_dmamap_res *r; int streamed = 0; - IS_LOCK_ASSERT(is); /* for iommu_strbuf_sync() below. */ + IS_LOCK_ASSERT(is); /* for iommu_strbuf_sync() below */ SLIST_FOREACH(r, &map->dm_reslist, dr_link) { streamed |= iommu_remove(is, BDR_START(r), r->dr_used); r->dr_used = 0; @@ -820,7 +822,7 @@ iommu_dvmamap_destroy(bus_dma_tag_t dt, } /* - * IOMMU DVMA operations, common to PCI and SBus. + * IOMMU DVMA operations, common to PCI and SBus */ static int iommu_dvmamap_load_buffer(bus_dma_tag_t dt, struct iommu_state *is, @@ -831,8 +833,8 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t bus_size_t sgsize, esize; vm_offset_t vaddr, voffs; vm_paddr_t curaddr; - int error, sgcnt, firstpg, stream; pmap_t pmap = NULL; + int error, firstpg, sgcnt; KASSERT(buflen != 0, ("%s: buflen == 0!", __func__)); if (buflen > dt->dt_maxsize) @@ -853,7 +855,9 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t sgcnt = *segp; firstpg = 1; - stream = iommu_use_streaming(is, map, buflen); + map->dm_flags &= ~DMF_STREAMED; + map->dm_flags |= iommu_use_streaming(is, map, buflen) != 0 ? + DMF_STREAMED : 0; for (; buflen > 0; ) { /* * Get the physical address for this page. @@ -874,7 +878,7 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t vaddr += sgsize; iommu_enter(is, trunc_io_page(dvmaddr), trunc_io_page(curaddr), - stream, flags); + (map->dm_flags & DMF_STREAMED) != 0, flags); /* * Chop the chunk up into segments of at most maxsegsz, but try @@ -1139,7 +1143,7 @@ iommu_dvmamap_sync(bus_dma_tag_t dt, bus /* XXX This is probably bogus. */ if ((op & BUS_DMASYNC_PREREAD) != 0) membar(Sync); - if (IOMMU_HAS_SB(is) && + if ((map->dm_flags & DMF_STREAMED) != 0 && ((op & BUS_DMASYNC_POSTREAD) != 0 || (op & BUS_DMASYNC_PREWRITE) != 0)) { IS_LOCK(is); From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 16:11: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 0EC6A10658CE; Thu, 19 Mar 2009 16:11:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96FDD8FC24; Thu, 19 Mar 2009 16:11:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JGBExY068396; Thu, 19 Mar 2009 16:11:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JGBEh4068394; Thu, 19 Mar 2009 16:11:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191611.n2JGBEh4068394@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 16:11: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: r190078 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 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, 19 Mar 2009 16:11:23 -0000 Author: marius Date: Thu Mar 19 16:11:14 2009 New Revision: 190078 URL: http://svn.freebsd.org/changeset/base/190078 Log: MFC: r185109 Use the interrupt level right below PIL_FAST for executing interrupt filters instead of PIL_FAST and allow special filters and handlers for interrupts which need to be able to interrupt even filters, f.e. bus error interrupts, to be registered with the revived INTR_FAST at PIL_FAST. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/intr_machdep.h stable/7/sys/sparc64/sparc64/intr_machdep.c Modified: stable/7/sys/sparc64/include/intr_machdep.h ============================================================================== --- stable/7/sys/sparc64/include/intr_machdep.h Thu Mar 19 16:03:21 2009 (r190077) +++ stable/7/sys/sparc64/include/intr_machdep.h Thu Mar 19 16:11:14 2009 (r190078) @@ -47,8 +47,9 @@ #define PIL_AST 4 /* ast ipi */ #define PIL_STOP 5 /* stop cpu ipi */ #define PIL_PREEMPT 6 /* preempt idle thread cpu ipi */ +#define PIL_FILTER 12 /* filter interrupts */ #define PIL_FAST 13 /* fast interrupts */ -#define PIL_TICK 14 +#define PIL_TICK 14 /* tick interrupts */ #ifndef LOCORE Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Thu Mar 19 16:03:21 2009 (r190077) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Thu Mar 19 16:11:14 2009 (r190078) @@ -89,7 +89,7 @@ struct intr_vector intr_vectors[IV_MAX]; uint16_t intr_countp[IV_MAX]; static u_long intr_stray_count[IV_MAX]; -static const char *pil_names[] = { +static const char *const pil_names[] = { "stray", "low", /* PIL_LOW */ "ithrd", /* PIL_ITHREAD */ @@ -97,7 +97,8 @@ static const char *pil_names[] = { "ast", /* PIL_AST */ "stop", /* PIL_STOP */ "preempt", /* PIL_PREEMPT */ - "stray", "stray", "stray", "stray", "stray", "stray", + "stray", "stray", "stray", "stray", "stray", + "filter", /* PIL_FILTER */ "fast", /* PIL_FAST */ "tick", /* PIL_TICK */ }; @@ -374,10 +375,16 @@ inthand_add(const char *name, int vec, d struct intr_event *ie; struct intr_handler *ih; struct intr_vector *iv; - int error, fast; + int error, filter; if (vec < 0 || vec >= IV_MAX) return (EINVAL); + /* + * INTR_FAST filters/handlers are special purpose only, allowing + * them to be shared just would complicate things unnecessarily. + */ + if ((flags & INTR_FAST) != 0 && (flags & INTR_EXCL) == 0) + return (EINVAL); sx_xlock(&intr_table_lock); iv = &intr_vectors[vec]; ic = iv->iv_ic; @@ -394,24 +401,25 @@ inthand_add(const char *name, int vec, d ic->ic_disable(iv); iv->iv_refcnt++; if (iv->iv_refcnt == 1) - intr_setup(filt != NULL ? PIL_FAST : PIL_ITHREAD, intr_fast, + intr_setup((flags & INTR_FAST) != 0 ? PIL_FAST : + filt != NULL ? PIL_FILTER : PIL_ITHREAD, intr_fast, vec, intr_execute_handlers, iv); else if (filt != NULL) { /* - * Check if we need to upgrade from PIL_ITHREAD to PIL_FAST. + * Check if we need to upgrade from PIL_ITHREAD to PIL_FILTER. * Given that apart from the on-board SCCs and UARTs shared * interrupts are rather uncommon on sparc64 this sould be * pretty rare in practice. */ - fast = 0; + filter = 0; TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { if (ih->ih_filter != NULL && ih->ih_filter != filt) { - fast = 1; + filter = 1; break; } } - if (fast == 0) - intr_setup(PIL_FAST, intr_fast, vec, + if (filter == 0) + intr_setup(PIL_FILTER, intr_fast, vec, intr_execute_handlers, iv); } intr_stray_count[vec] = 0; From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 16:14: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 9E9E11065A4B; Thu, 19 Mar 2009 16:14:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D4728FC16; Thu, 19 Mar 2009 16:14:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JGE0bu068495; Thu, 19 Mar 2009 16:14:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JGE03a068492; Thu, 19 Mar 2009 16:14:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191614.n2JGE03a068492@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 16:14: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: r190079 - in stable/7/sys: . contrib/pf dev/cxgb dev/isp 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, 19 Mar 2009 16:14:07 -0000 Author: marius Date: Thu Mar 19 16:14:00 2009 New Revision: 190079 URL: http://svn.freebsd.org/changeset/base/190079 Log: MFC: r186140 Don't try reading the SXP_PINS_DIFF on the 10160 and 12160 SCSI controllers. Reading this register, for which there are indications that it doesn't really exist, returns 0 on at least some 12160 and doing so on Sun Fire V880 causes a data access error exception. Reported and tested by: Beat Gaetzi Approved by: mjacob Obtained from: OpenBSD (modulo setting isp_lvdmode) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/isp/isp.c Modified: stable/7/sys/dev/isp/isp.c ============================================================================== --- stable/7/sys/dev/isp/isp.c Thu Mar 19 16:11:14 2009 (r190078) +++ stable/7/sys/dev/isp/isp.c Thu Mar 19 16:14:00 2009 (r190079) @@ -335,6 +335,23 @@ isp_reset(ispsoftc_t *isp) /* * XXX: Should probably do some bus sensing. */ + } else if (IS_ULTRA3(isp)) { + sdparam *sdp = isp->isp_param; + + isp->isp_clock = 100; + + if (IS_10160(isp)) + btype = "10160"; + else if (IS_12160(isp)) + btype = "12160"; + else + btype = ""; + sdp->isp_lvdmode = 1; + + if (IS_DUALBUS(isp)) { + sdp++; + sdp->isp_lvdmode = 1; + } } else if (IS_ULTRA2(isp)) { static const char m[] = "bus %d is in %s Mode"; uint16_t l; @@ -346,10 +363,6 @@ isp_reset(ispsoftc_t *isp) btype = "1280"; else if (IS_1080(isp)) btype = "1080"; - else if (IS_10160(isp)) - btype = "10160"; - else if (IS_12160(isp)) - btype = "12160"; else btype = ""; From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 16:37:31 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 45A2C106578B; Thu, 19 Mar 2009 16:37:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EC778FC0A; Thu, 19 Mar 2009 16:37:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JGbVoo069066; Thu, 19 Mar 2009 16:37:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JGbUIp069063; Thu, 19 Mar 2009 16:37:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191637.n2JGbUIp069063@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 16:37:30 +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: r190080 - in stable/7/sys: . contrib/pf dev/cxgb sparc64/include sparc64/sparc64 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, 19 Mar 2009 16:37:34 -0000 Author: marius Date: Thu Mar 19 16:37:30 2009 New Revision: 190080 URL: http://svn.freebsd.org/changeset/base/190080 Log: MFC: r186682 - Currently the PMAP code is laid out to let the kernel TSB cover the whole KVA space using one locked 4MB dTLB entry per GB of physical memory. On Cheetah-class machines only the dt16 can hold locked entries though, which would be completely consumed for the kernel TSB on machines with >= 16GB. Therefore limit the KVA space to use no more than half of the lockable dTLB slots, given that we need them also for other things. - Add sanity checks which ensure that we don't exhaust the (lockable) TLB slots. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/tlb.h stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/pmap.c Modified: stable/7/sys/sparc64/include/tlb.h ============================================================================== --- stable/7/sys/sparc64/include/tlb.h Thu Mar 19 16:14:00 2009 (r190079) +++ stable/7/sys/sparc64/include/tlb.h Thu Mar 19 16:37:30 2009 (r190080) @@ -129,6 +129,8 @@ typedef void tlb_flush_user_t(void); struct pmap; struct tlb_entry; +extern int dtlb_slots; +extern int itlb_slots; extern int kernel_tlb_slots; extern struct tlb_entry *kernel_tlbs; Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 16:14:00 2009 (r190079) +++ stable/7/sys/sparc64/sparc64/machdep.c Thu Mar 19 16:37:30 2009 (r190080) @@ -115,6 +115,8 @@ typedef int ofw_vec_t(void *); extern vm_offset_t ksym_start, ksym_end; #endif +int dtlb_slots; +int itlb_slots; struct tlb_entry *kernel_tlbs; int kernel_tlb_slots; @@ -373,6 +375,19 @@ sparc64_init(caddr_t mdp, u_long o1, u_l end = (vm_offset_t)_end; } + /* + * Determine the TLB slot maxima, which are expected to be + * equal across all CPUs. + * NB: for Cheetah-class CPUs, these properties only refer + * to the t16s. + */ + if (OF_getprop(pc->pc_node, "#dtlb-entries", &dtlb_slots, + sizeof(dtlb_slots)) == -1) + panic("sparc64_init: cannot determine number of dTLB slots"); + if (OF_getprop(pc->pc_node, "#itlb-entries", &itlb_slots, + sizeof(itlb_slots)) == -1) + panic("sparc64_init: cannot determine number of iTLB slots"); + cache_init(pc); cache_enable(); uma_set_align(pc->pc_cache.dc_linesize - 1); Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Thu Mar 19 16:14:00 2009 (r190079) +++ stable/7/sys/sparc64/sparc64/pmap.c Thu Mar 19 16:37:30 2009 (r190080) @@ -334,13 +334,23 @@ pmap_bootstrap(vm_offset_t ekva) /* * Calculate the size of kernel virtual memory, and the size and mask - * for the kernel TSB. + * for the kernel TSB based on the phsyical memory size but limited + * by letting the kernel TSB take up no more than half of the dTLB + * slots available for locked entries. */ virtsz = roundup(physsz, PAGE_SIZE_4M << (PAGE_SHIFT - TTE_SHIFT)); + virtsz = MIN(virtsz, + (dtlb_slots / 2 * PAGE_SIZE_4M) << (PAGE_SHIFT - TTE_SHIFT)); vm_max_kernel_address = VM_MIN_KERNEL_ADDRESS + virtsz; tsb_kernel_size = virtsz >> (PAGE_SHIFT - TTE_SHIFT); tsb_kernel_mask = (tsb_kernel_size >> TTE_SHIFT) - 1; + if (kernel_tlb_slots + PCPU_PAGES + tsb_kernel_size / PAGE_SIZE_4M + + 1 /* PROM page */ + 1 /* spare */ > dtlb_slots) + panic("pmap_bootstrap: insufficient dTLB entries"); + if (kernel_tlb_slots + 1 /* PROM page */ + 1 /* spare */ > itlb_slots) + panic("pmap_bootstrap: insufficient iTLB entries"); + /* * Allocate the kernel TSB and lock it in the TLB. */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 16:44:37 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 A324510656ED; Thu, 19 Mar 2009 16:44:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 756948FC1D; Thu, 19 Mar 2009 16:44:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JGiboe069436; Thu, 19 Mar 2009 16:44:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JGib4g069434; Thu, 19 Mar 2009 16:44:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191644.n2JGib4g069434@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 16:44:37 +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: r190082 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bge dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 16:44:39 -0000 Author: marius Date: Thu Mar 19 16:44:37 2009 New Revision: 190082 URL: http://svn.freebsd.org/changeset/base/190082 Log: MFC: r188164, r188457 - device_shutdown returns an int. - Don't reset the PHY probe retry counter within the loop so it will eventually terminate as intended. [1] Submitted by: Helen Zhang [1] Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Mar 19 16:39:59 2009 (r190081) +++ stable/7/sys/dev/bge/if_bge.c Thu Mar 19 16:44:37 2009 (r190082) @@ -348,7 +348,7 @@ static void bge_init_locked(struct bge_s static void bge_init(void *); static void bge_stop(struct bge_softc *); static void bge_watchdog(struct bge_softc *); -static void bge_shutdown(device_t); +static int bge_shutdown(device_t); static int bge_ifmedia_upd_locked(struct ifnet *); static int bge_ifmedia_upd(struct ifnet *); static void bge_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -2674,11 +2674,11 @@ bge_attach(device_t dev) * if we get a conflict with the ASF firmware accessing * the PHY. */ + trys = 0; BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); again: bge_asf_driver_up(sc); - trys = 0; if (mii_phy_probe(dev, &sc->bge_miibus, bge_ifmedia_upd, bge_ifmedia_sts)) { if (trys++ < 4) { @@ -4280,17 +4280,18 @@ bge_stop(struct bge_softc *sc) * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int bge_shutdown(device_t dev) { struct bge_softc *sc; sc = device_get_softc(dev); - BGE_LOCK(sc); bge_stop(sc); bge_reset(sc); BGE_UNLOCK(sc); + + return (0); } static int From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 16:55:27 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 4CEAE106568E; Thu, 19 Mar 2009 16:55:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A06A8FC0A; Thu, 19 Mar 2009 16:55:27 +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 n2JGtRYh069719; Thu, 19 Mar 2009 16:55:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JGtRjm069718; Thu, 19 Mar 2009 16:55:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903191655.n2JGtRjm069718@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Mar 2009 16:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190084 - in stable/7/sys: . boot/i386/libi386 contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 16:55:28 -0000 Author: jhb Date: Thu Mar 19 16:55:26 2009 New Revision: 190084 URL: http://svn.freebsd.org/changeset/base/190084 Log: MFC: Fix uninitialized pointer dereference. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/i386/libi386/devicename.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/boot/i386/libi386/devicename.c ============================================================================== --- stable/7/sys/boot/i386/libi386/devicename.c Thu Mar 19 16:44:37 2009 (r190083) +++ stable/7/sys/boot/i386/libi386/devicename.c Thu Mar 19 16:55:26 2009 (r190084) @@ -150,6 +150,8 @@ i386_parsedev(struct i386_devdesc **dev, cp++; } } + } else { + cp = np; } if (*cp && (*cp != ':')) { err = EINVAL; @@ -173,6 +175,8 @@ i386_parsedev(struct i386_devdesc **dev, err = EUNIT; goto fail; } + } else { + cp = np; } if (*cp && (*cp != ':')) { err = EINVAL; From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 17:02: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 6CE6B106564A; Thu, 19 Mar 2009 17:02:11 +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 593B48FC1E; Thu, 19 Mar 2009 17:02:11 +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 n2JH2B4J069967; Thu, 19 Mar 2009 17:02:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JH2Bnx069962; Thu, 19 Mar 2009 17:02:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903191702.n2JH2Bnx069962@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Mar 2009 17:02: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: r190086 - in stable/7/sys: . boot/i386/libi386 boot/i386/loader contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 17:02:12 -0000 Author: jhb Date: Thu Mar 19 17:02:10 2009 New Revision: 190086 URL: http://svn.freebsd.org/changeset/base/190086 Log: MFC: - Make it possible to disable GPT support by setting LOADER_NO_GPT_SUPPORT in make.conf or src.conf. - When GPT is enabled (which it is by default), use memory above 1 MB and leave the memory from the end of the bss to the end of the 640k window purely for the stack. The loader has grown and now it is much more common for the heap and stack to grow into each other when both are located in the 640k window. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/i386/libi386/Makefile stable/7/sys/boot/i386/libi386/biosdisk.c stable/7/sys/boot/i386/libi386/devicename.c stable/7/sys/boot/i386/loader/Makefile stable/7/sys/boot/i386/loader/main.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/boot/i386/libi386/Makefile ============================================================================== --- stable/7/sys/boot/i386/libi386/Makefile Thu Mar 19 16:55:42 2009 (r190085) +++ stable/7/sys/boot/i386/libi386/Makefile Thu Mar 19 17:02:10 2009 (r190086) @@ -26,6 +26,10 @@ CFLAGS+= -DDISK_DEBUG CFLAGS+= -DSMBIOS_SERIAL_NUMBERS .endif +.if !defined(LOADER_NO_GPT_SUPPORT) +CFLAGS+= -DLOADER_GPT_SUPPORT +.endif + # Include simple terminal emulation (cons25-compatible) CFLAGS+= -DTERM_EMU Modified: stable/7/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/7/sys/boot/i386/libi386/biosdisk.c Thu Mar 19 16:55:42 2009 (r190085) +++ stable/7/sys/boot/i386/libi386/biosdisk.c Thu Mar 19 17:02:10 2009 (r190086) @@ -68,12 +68,14 @@ __FBSDID("$FreeBSD$"); # define DEBUG(fmt, args...) #endif +#ifdef LOADER_GPT_SUPPORT struct gpt_part { int gp_index; uuid_t gp_type; uint64_t gp_start; uint64_t gp_end; }; +#endif struct open_disk { int od_dkunit; /* disk unit number */ @@ -90,25 +92,31 @@ struct open_disk { #define BD_FLOPPY 0x0004 #define BD_LABELOK 0x0008 #define BD_PARTTABOK 0x0010 +#ifdef LOADER_GPT_SUPPORT #define BD_GPTOK 0x0020 +#endif union { struct { struct disklabel mbr_disklabel; int mbr_nslices; /* slice count */ struct dos_partition mbr_slicetab[NEXTDOSPART]; } _mbr; +#ifdef LOADER_GPT_SUPPORT struct { int gpt_nparts; struct gpt_part *gpt_partitions; } _gpt; +#endif } _data; }; #define od_disklabel _data._mbr.mbr_disklabel #define od_nslices _data._mbr.mbr_nslices #define od_slicetab _data._mbr.mbr_slicetab +#ifdef LOADER_GPT_SUPPORT #define od_nparts _data._gpt.gpt_nparts #define od_partitions _data._gpt.gpt_partitions +#endif /* * List of BIOS devices, translation from disk unit number to @@ -130,8 +138,10 @@ static int bd_write(struct open_disk *od static int bd_int13probe(struct bdinfo *bd); +#ifdef LOADER_GPT_SUPPORT static void bd_printgptpart(struct open_disk *od, struct gpt_part *gp, char *prefix, int verbose); +#endif static void bd_printslice(struct open_disk *od, struct dos_partition *dp, char *prefix, int verbose); static void bd_printbsdslice(struct open_disk *od, daddr_t offset, @@ -163,8 +173,10 @@ static void bd_closedisk(struct open_dis static int bd_open_mbr(struct open_disk *od, struct i386_devdesc *dev); static int bd_bestslice(struct open_disk *od); static void bd_checkextended(struct open_disk *od, int slicenum); +#ifdef LOADER_GPT_SUPPORT static int bd_open_gpt(struct open_disk *od, struct i386_devdesc *dev); static struct gpt_part *bd_best_gptpart(struct open_disk *od); +#endif /* * Translate between BIOS device numbers and our private unit numbers. @@ -286,6 +298,7 @@ bd_print(int verbose) if (!bd_opendisk(&od, &dev)) { +#ifdef LOADER_GPT_SUPPORT /* Do we have a GPT table? */ if (od->od_flags & BD_GPTOK) { for (j = 0; j < od->od_nparts; j++) { @@ -293,9 +306,10 @@ bd_print(int verbose) od->od_partitions[j].gp_index); bd_printgptpart(od, &od->od_partitions[j], line, verbose); } - + } else +#endif /* Do we have a partition table? */ - } else if (od->od_flags & BD_PARTTABOK) { + if (od->od_flags & BD_PARTTABOK) { dptr = &od->od_slicetab[0]; /* Check for a "dedicated" disk */ @@ -316,6 +330,7 @@ bd_print(int verbose) } } +#ifdef LOADER_GPT_SUPPORT static uuid_t efi = GPT_ENT_TYPE_EFI; static uuid_t freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; static uuid_t freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; @@ -368,6 +383,7 @@ bd_printgptpart(struct open_disk *od, st stats); pager_output(line); } +#endif /* * Print information about slices on a disk. For the size calculations we @@ -569,8 +585,10 @@ bd_opendisk(struct open_disk **odp, stru } /* Determine disk layout. */ +#ifdef LOADER_GPT_SUPPORT error = bd_open_gpt(od, dev); if (error) +#endif error = bd_open_mbr(od, dev); out: @@ -834,6 +852,7 @@ bd_bestslice(struct open_disk *od) return (prefslice); } +#ifdef LOADER_GPT_SUPPORT static int bd_open_gpt(struct open_disk *od, struct i386_devdesc *dev) { @@ -1009,6 +1028,7 @@ bd_best_gptpart(struct open_disk *od) } return (prefpart); } +#endif static int bd_close(struct open_file *f) @@ -1028,8 +1048,10 @@ bd_closedisk(struct open_disk *od) if (od->od_flags & BD_FLOPPY) delay(3000000); #endif +#ifdef LOADER_GPT_SUPPORT if (od->od_flags & BD_GPTOK) free(od->od_partitions); +#endif free(od); } Modified: stable/7/sys/boot/i386/libi386/devicename.c ============================================================================== --- stable/7/sys/boot/i386/libi386/devicename.c Thu Mar 19 16:55:42 2009 (r190085) +++ stable/7/sys/boot/i386/libi386/devicename.c Thu Mar 19 17:02:10 2009 (r190086) @@ -120,6 +120,7 @@ i386_parsedev(struct i386_devdesc **dev, err = EUNIT; goto fail; } +#ifdef LOADER_GPT_SUPPORT if (*cp == 'p') { /* got a GPT partition */ np = cp + 1; slice = strtol(np, &cp, 10); @@ -133,6 +134,7 @@ i386_parsedev(struct i386_devdesc **dev, } partition = 0xff; } else { +#endif if (*cp == 's') { /* got a slice number */ np = cp + 1; slice = strtol(np, &cp, 10); @@ -149,7 +151,9 @@ i386_parsedev(struct i386_devdesc **dev, } cp++; } +#ifdef LOADER_GPT_SUPPORT } +#endif } else { cp = np; } @@ -226,14 +230,18 @@ i386_fmtdev(void *vdev) case DEVT_DISK: cp = buf; cp += sprintf(cp, "%s%d", dev->d_dev->dv_name, dev->d_unit); +#ifdef LOADER_GPT_SUPPORT if (dev->d_kind.biosdisk.partition == 0xff) { cp += sprintf(cp, "p%d", dev->d_kind.biosdisk.slice); } else { +#endif if (dev->d_kind.biosdisk.slice > 0) cp += sprintf(cp, "s%d", dev->d_kind.biosdisk.slice); if (dev->d_kind.biosdisk.partition >= 0) cp += sprintf(cp, "%c", dev->d_kind.biosdisk.partition + 'a'); +#ifdef LOADER_GPT_SUPPORT } +#endif strcat(cp, ":"); break; Modified: stable/7/sys/boot/i386/loader/Makefile ============================================================================== --- stable/7/sys/boot/i386/loader/Makefile Thu Mar 19 16:55:42 2009 (r190085) +++ stable/7/sys/boot/i386/loader/Makefile Thu Mar 19 17:02:10 2009 (r190086) @@ -42,6 +42,9 @@ CFLAGS+= -DLOADER_BZIP2_SUPPORT .if !defined(LOADER_NO_GZIP_SUPPORT) CFLAGS+= -DLOADER_GZIP_SUPPORT .endif +.if !defined(LOADER_NO_GPT_SUPPORT) +CFLAGS+= -DLOADER_GPT_SUPPORT +.endif # Always add MI sources .PATH: ${.CURDIR}/../../common Modified: stable/7/sys/boot/i386/loader/main.c ============================================================================== --- stable/7/sys/boot/i386/loader/main.c Thu Mar 19 16:55:42 2009 (r190085) +++ stable/7/sys/boot/i386/loader/main.c Thu Mar 19 17:02:10 2009 (r190086) @@ -96,7 +96,7 @@ main(void) */ bios_getmem(); -#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) +#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || defined(LOADER_GPT_SUPPORT) heap_top = PTOV(memtop_copyin); memtop_copyin -= 0x300000; heap_bottom = PTOV(memtop_copyin); From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 17:06: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 CE9C11065686; Thu, 19 Mar 2009 17:06:05 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B852C8FC1B; Thu, 19 Mar 2009 17:06:05 +0000 (UTC) (envelope-from rdivacky@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 n2JH65Tr070117; Thu, 19 Mar 2009 17:06:05 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JH65B0070103; Thu, 19 Mar 2009 17:06:05 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200903191706.n2JH65B0070103@svn.freebsd.org> From: Roman Divacky Date: Thu, 19 Mar 2009 17:06: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: r190087 - in stable/7/sys: . compat/ndis contrib/altq/altq contrib/pf dev/ath/ath_hal dev/cxgb dev/mca dev/nsp dev/stg dev/txp i386/i386 i386/isa netinet netipsec vm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 17:06:08 -0000 Author: rdivacky Date: Thu Mar 19 17:06:04 2009 New Revision: 190087 URL: http://svn.freebsd.org/changeset/base/190087 Log: Merge r189004. Requested by: yongari Approved by: ed (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/ndis/kern_ndis.c stable/7/sys/compat/ndis/subr_hal.c stable/7/sys/compat/ndis/subr_ndis.c stable/7/sys/compat/ndis/subr_ntoskrnl.c stable/7/sys/contrib/altq/altq/altq_subr.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mca/mca_bus.c stable/7/sys/dev/nsp/nsp.c stable/7/sys/dev/stg/tmc18c30.c stable/7/sys/dev/txp/if_txp.c stable/7/sys/i386/i386/vm86.c stable/7/sys/i386/isa/npx.c stable/7/sys/netinet/sctp_input.c stable/7/sys/netipsec/key.c stable/7/sys/vm/vm_pager.c Modified: stable/7/sys/compat/ndis/kern_ndis.c ============================================================================== --- stable/7/sys/compat/ndis/kern_ndis.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/compat/ndis/kern_ndis.c Thu Mar 19 17:06:04 2009 (r190087) @@ -256,10 +256,8 @@ ndis_getdone_func(adapter, status) } static void -ndis_resetdone_func(adapter, status, addressingreset) - ndis_handle adapter; - ndis_status status; - uint8_t addressingreset; +ndis_resetdone_func(ndis_handle adapter, ndis_status status, + uint8_t addressingreset) { ndis_miniport_block *block; struct ndis_softc *sc; Modified: stable/7/sys/compat/ndis/subr_hal.c ============================================================================== --- stable/7/sys/compat/ndis/subr_hal.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/compat/ndis/subr_hal.c Thu Mar 19 17:06:04 2009 (r190087) @@ -142,18 +142,14 @@ WRITE_PORT_ULONG(port, val) } static void -WRITE_PORT_USHORT(port, val) - uint16_t *port; - uint16_t val; +WRITE_PORT_USHORT(uint16_t *port, uint16_t val) { bus_space_write_2(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val); return; } static void -WRITE_PORT_UCHAR(port, val) - uint8_t *port; - uint8_t val; +WRITE_PORT_UCHAR(uint8_t *port, uint8_t val) { bus_space_write_1(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val); return; @@ -378,9 +374,7 @@ KfAcquireSpinLock(lock) } void -KfReleaseSpinLock(lock, newirql) - kspin_lock *lock; - uint8_t newirql; +KfReleaseSpinLock(kspin_lock *lock, uint8_t newirql) { KeReleaseSpinLockFromDpcLevel(lock); KeLowerIrql(newirql); @@ -407,8 +401,7 @@ KeQueryPerformanceCounter(freq) } uint8_t -KfRaiseIrql(irql) - uint8_t irql; +KfRaiseIrql(uint8_t irql) { uint8_t oldirql; @@ -428,8 +421,7 @@ KfRaiseIrql(irql) } void -KfLowerIrql(oldirql) - uint8_t oldirql; +KfLowerIrql(uint8_t oldirql) { if (oldirql == DISPATCH_LEVEL) return; @@ -453,8 +445,7 @@ KeRaiseIrqlToDpcLevel(void) } static void -_KeLowerIrql(oldirql) - uint8_t oldirql; +_KeLowerIrql(uint8_t oldirql) { KeLowerIrql(oldirql); return; Modified: stable/7/sys/compat/ndis/subr_ndis.c ============================================================================== --- stable/7/sys/compat/ndis/subr_ndis.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/compat/ndis/subr_ndis.c Thu Mar 19 17:06:04 2009 (r190087) @@ -891,10 +891,8 @@ NdisInitializeReadWriteLock(lock) } static void -NdisAcquireReadWriteLock(lock, writeacc, state) - ndis_rw_lock *lock; - uint8_t writeacc; - ndis_lock_state *state; +NdisAcquireReadWriteLock(ndis_rw_lock *lock, uint8_t writeacc, + ndis_lock_state *state) { if (writeacc == TRUE) { KeAcquireSpinLock(&lock->nrl_spinlock, &state->nls_oldirql); @@ -1077,13 +1075,9 @@ ndis_map_cb(arg, segs, nseg, error) } static void -NdisMStartBufferPhysicalMapping(adapter, buf, mapreg, writedev, addrarray, arraysize) - ndis_handle adapter; - ndis_buffer *buf; - uint32_t mapreg; - uint8_t writedev; - ndis_paddr_unit *addrarray; - uint32_t *arraysize; +NdisMStartBufferPhysicalMapping(ndis_handle adapter, ndis_buffer *buf, + uint32_t mapreg, uint8_t writedev, ndis_paddr_unit *addrarray, + uint32_t *arraysize) { ndis_miniport_block *block; struct ndis_softc *sc; @@ -1399,12 +1393,8 @@ NdisQueryMapRegisterCount(bustype, cnt) } static ndis_status -NdisMAllocateMapRegisters(adapter, dmachannel, dmasize, physmapneeded, maxmap) - ndis_handle adapter; - uint32_t dmachannel; - uint8_t dmasize; - uint32_t physmapneeded; - uint32_t maxmap; +NdisMAllocateMapRegisters(ndis_handle adapter, uint32_t dmachannel, + uint8_t dmasize, uint32_t physmapneeded, uint32_t maxmap) { struct ndis_softc *sc; ndis_miniport_block *block; @@ -1482,12 +1472,8 @@ ndis_mapshared_cb(arg, segs, nseg, error */ static void -NdisMAllocateSharedMemory(adapter, len, cached, vaddr, paddr) - ndis_handle adapter; - uint32_t len; - uint8_t cached; - void **vaddr; - ndis_physaddr *paddr; +NdisMAllocateSharedMemory(ndis_handle adapter, uint32_t len, uint8_t cached, + void **vaddr, ndis_physaddr *paddr) { ndis_miniport_block *block; struct ndis_softc *sc; @@ -1605,11 +1591,8 @@ ndis_asyncmem_complete(dobj, arg) } static ndis_status -NdisMAllocateSharedMemoryAsync(adapter, len, cached, ctx) - ndis_handle adapter; - uint32_t len; - uint8_t cached; - void *ctx; +NdisMAllocateSharedMemoryAsync(ndis_handle adapter, uint32_t len, + uint8_t cached, void *ctx) { ndis_miniport_block *block; struct ndis_allocwork *w; @@ -1642,12 +1625,8 @@ NdisMAllocateSharedMemoryAsync(adapter, } static void -NdisMFreeSharedMemory(adapter, len, cached, vaddr, paddr) - ndis_handle adapter; - uint32_t len; - uint8_t cached; - void *vaddr; - ndis_physaddr paddr; +NdisMFreeSharedMemory(ndis_handle adapter, uint32_t len, uint8_t cached, + void *vaddr, ndis_physaddr paddr) { ndis_miniport_block *block; struct ndis_softc *sc; @@ -1754,10 +1733,8 @@ NdisMGetDmaAlignment(handle) */ static ndis_status -NdisMInitializeScatterGatherDma(adapter, is64, maxphysmap) - ndis_handle adapter; - uint8_t is64; - uint32_t maxphysmap; +NdisMInitializeScatterGatherDma(ndis_handle adapter, uint8_t is64, + uint32_t maxphysmap) { struct ndis_softc *sc; ndis_miniport_block *block; @@ -2358,14 +2335,9 @@ ndis_intrhand(dpc, intr, sysarg1, sysarg } static ndis_status -NdisMRegisterInterrupt(intr, adapter, ivec, ilevel, reqisr, shared, imode) - ndis_miniport_interrupt *intr; - ndis_handle adapter; - uint32_t ivec; - uint32_t ilevel; - uint8_t reqisr; - uint8_t shared; - ndis_interrupt_mode imode; +NdisMRegisterInterrupt(ndis_miniport_interrupt *intr, ndis_handle adapter, + uint32_t ivec, uint32_t ilevel, uint8_t reqisr, uint8_t shared, + ndis_interrupt_mode imode) { ndis_miniport_block *block; ndis_miniport_characteristics *ch; Modified: stable/7/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- stable/7/sys/compat/ndis/subr_ntoskrnl.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/compat/ndis/subr_ntoskrnl.c Thu Mar 19 17:06:04 2009 (r190087) @@ -445,10 +445,7 @@ ntoskrnl_memmove(dst, src, size) } static void * -ntoskrnl_memchr(buf, ch, len) - void *buf; - unsigned char ch; - size_t len; +ntoskrnl_memchr(void *buf, unsigned char ch, size_t len) { if (len != 0) { unsigned char *p = buf; @@ -519,10 +516,8 @@ ntoskrnl_tolower(c) } static uint8_t -RtlEqualUnicodeString(str1, str2, caseinsensitive) - unicode_string *str1; - unicode_string *str2; - uint8_t caseinsensitive; +RtlEqualUnicodeString(unicode_string *str1, unicode_string *str2, + uint8_t caseinsensitive) { int i; @@ -594,10 +589,7 @@ ntoskrnl_unicode_to_ascii(unicode, ascii } uint32_t -RtlUnicodeStringToAnsiString(dest, src, allocate) - ansi_string *dest; - unicode_string *src; - uint8_t allocate; +RtlUnicodeStringToAnsiString(ansi_string *dest, unicode_string *src, uint8_t allocate) { if (dest == NULL || src == NULL) return(STATUS_INVALID_PARAMETER); @@ -625,10 +617,8 @@ RtlUnicodeStringToAnsiString(dest, src, } uint32_t -RtlAnsiStringToUnicodeString(dest, src, allocate) - unicode_string *dest; - ansi_string *src; - uint8_t allocate; +RtlAnsiStringToUnicodeString(unicode_string *dest, ansi_string *src, + uint8_t allocate) { if (dest == NULL || src == NULL) return(STATUS_INVALID_PARAMETER); @@ -726,14 +716,9 @@ IoGetDriverObjectExtension(drv, clid) uint32_t -IoCreateDevice(drv, devextlen, devname, devtype, devchars, exclusive, newdev) - driver_object *drv; - uint32_t devextlen; - unicode_string *devname; - uint32_t devtype; - uint32_t devchars; - uint8_t exclusive; - device_object **newdev; +IoCreateDevice(driver_object *drv, uint32_t devextlen, unicode_string *devname, + uint32_t devtype, uint32_t devchars, uint8_t exclusive, + device_object **newdev) { device_object *dev; @@ -951,17 +936,9 @@ IoBuildAsynchronousFsdRequest(func, dobj } static irp * -IoBuildDeviceIoControlRequest(iocode, dobj, ibuf, ilen, obuf, olen, - isinternal, event, status) - uint32_t iocode; - device_object *dobj; - void *ibuf; - uint32_t ilen; - void *obuf; - uint32_t olen; - uint8_t isinternal; - nt_kevent *event; - io_status_block *status; +IoBuildDeviceIoControlRequest(uint32_t iocode, device_object *dobj, void *ibuf, + uint32_t ilen, void *obuf, uint32_t olen, uint8_t isinternal, + nt_kevent *event, io_status_block *status) { irp *ip; io_stack_location *sl; @@ -1047,9 +1024,7 @@ IoBuildDeviceIoControlRequest(iocode, do } static irp * -IoAllocateIrp(stsize, chargequota) - uint8_t stsize; - uint8_t chargequota; +IoAllocateIrp(uint8_t stsize, uint8_t chargequota) { irp *i; @@ -1063,9 +1038,7 @@ IoAllocateIrp(stsize, chargequota) } static irp * -IoMakeAssociatedIrp(ip, stsize) - irp *ip; - uint8_t stsize; +IoMakeAssociatedIrp(irp *ip, uint8_t stsize) { irp *associrp; @@ -1092,10 +1065,7 @@ IoFreeIrp(ip) } static void -IoInitializeIrp(io, psize, ssize) - irp *io; - uint16_t psize; - uint8_t ssize; +IoInitializeIrp(irp *io, uint16_t psize, uint8_t ssize) { bzero((char *)io, IoSizeOfIrp(ssize)); io->irp_size = psize; @@ -1124,16 +1094,14 @@ IoReuseIrp(ip, status) } void -IoAcquireCancelSpinLock(irql) - uint8_t *irql; +IoAcquireCancelSpinLock(uint8_t *irql) { KeAcquireSpinLock(&ntoskrnl_cancellock, irql); return; } void -IoReleaseCancelSpinLock(irql) - uint8_t irql; +IoReleaseCancelSpinLock(uint8_t irql) { KeReleaseSpinLock(&ntoskrnl_cancellock, irql); return; @@ -1182,9 +1150,7 @@ IofCallDriver(dobj, ip) } void -IofCompleteRequest(ip, prioboost) - irp *ip; - uint8_t prioboost; +IofCompleteRequest(irp *ip, uint8_t prioboost) { uint32_t i; uint32_t status; @@ -1292,9 +1258,7 @@ KeAcquireInterruptSpinLock(iobj) } void -KeReleaseInterruptSpinLock(iobj, irql) - kinterrupt *iobj; - uint8_t irql; +KeReleaseInterruptSpinLock(kinterrupt *iobj, uint8_t irql) { KeReleaseSpinLock(&ntoskrnl_intlock, irql); return; @@ -1332,19 +1296,9 @@ KeSynchronizeExecution(iobj, syncfunc, s */ uint32_t -IoConnectInterrupt(iobj, svcfunc, svcctx, lock, vector, irql, - syncirql, imode, shared, affinity, savefloat) - kinterrupt **iobj; - void *svcfunc; - void *svcctx; - uint32_t vector; - kspin_lock *lock; - uint8_t irql; - uint8_t syncirql; - uint8_t imode; - uint8_t shared; - uint32_t affinity; - uint8_t savefloat; +IoConnectInterrupt(kinterrupt **iobj, void *svcfunc, void *svcctx, + kspin_lock *lock, uint32_t vector, uint8_t irql, uint8_t syncirql, + uint8_t imode, uint8_t shared, uint32_t affinity, uint8_t savefloat) { uint8_t curirql; @@ -1689,12 +1643,8 @@ KeTickCount(void) */ uint32_t -KeWaitForSingleObject(arg, reason, mode, alertable, duetime) - void *arg; - uint32_t reason; - uint32_t mode; - uint8_t alertable; - int64_t *duetime; +KeWaitForSingleObject(void *arg, uint32_t reason, uint32_t mode, + uint8_t alertable, int64_t *duetime) { wait_block w; struct thread *td = curthread; @@ -1801,16 +1751,9 @@ KeWaitForSingleObject(arg, reason, mode, } static uint32_t -KeWaitForMultipleObjects(cnt, obj, wtype, reason, mode, - alertable, duetime, wb_array) - uint32_t cnt; - nt_dispatch_header *obj[]; - uint32_t wtype; - uint32_t reason; - uint32_t mode; - uint8_t alertable; - int64_t *duetime; - wait_block *wb_array; +KeWaitForMultipleObjects(uint32_t cnt, nt_dispatch_header *obj[], uint32_t wtype, + uint32_t reason, uint32_t mode, uint8_t alertable, int64_t *duetime, + wait_block *wb_array) { struct thread *td = curthread; wait_block *whead, *w; @@ -2011,9 +1954,7 @@ wait_done: } static void -WRITE_REGISTER_USHORT(reg, val) - uint16_t *reg; - uint16_t val; +WRITE_REGISTER_USHORT(uint16_t *reg, uint16_t val) { bus_space_write_2(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg, val); return; @@ -2043,16 +1984,13 @@ READ_REGISTER_ULONG(reg) } static uint8_t -READ_REGISTER_UCHAR(reg) - uint8_t *reg; +READ_REGISTER_UCHAR(uint8_t *reg) { return(bus_space_read_1(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg)); } static void -WRITE_REGISTER_UCHAR(reg, val) - uint8_t *reg; - uint8_t val; +WRITE_REGISTER_UCHAR(uint8_t *reg, uint8_t val) { bus_space_write_1(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg, val); return; @@ -2107,33 +2045,25 @@ _aullrem(a, b) } static int64_t -_allshl(a, b) - int64_t a; - uint8_t b; +_allshl(int64_t a, uint8_t b) { return (a << b); } static uint64_t -_aullshl(a, b) - uint64_t a; - uint8_t b; +_aullshl(uint64_t a, uint8_t b) { return (a << b); } static int64_t -_allshr(a, b) - int64_t a; - uint8_t b; +_allshr(int64_t a, uint8_t b) { return (a >> b); } static uint64_t -_aullshr(a, b) - uint64_t a; - uint8_t b; +_aullshr(uint64_t a, uint8_t b) { return (a >> b); } @@ -2198,15 +2128,9 @@ ntoskrnl_findwrap(func) } static void -ExInitializePagedLookasideList(lookaside, allocfunc, freefunc, - flags, size, tag, depth) - paged_lookaside_list *lookaside; - lookaside_alloc_func *allocfunc; - lookaside_free_func *freefunc; - uint32_t flags; - size_t size; - uint32_t tag; - uint16_t depth; +ExInitializePagedLookasideList(paged_lookaside_list *lookaside, + lookaside_alloc_func *allocfunc, lookaside_free_func *freefunc, + uint32_t flags, size_t size, uint32_t tag, uint16_t depth) { bzero((char *)lookaside, sizeof(paged_lookaside_list)); @@ -2253,15 +2177,9 @@ ExDeletePagedLookasideList(lookaside) } static void -ExInitializeNPagedLookasideList(lookaside, allocfunc, freefunc, - flags, size, tag, depth) - npaged_lookaside_list *lookaside; - lookaside_alloc_func *allocfunc; - lookaside_free_func *freefunc; - uint32_t flags; - size_t size; - uint32_t tag; - uint16_t depth; +ExInitializeNPagedLookasideList(npaged_lookaside_list *lookaside, + lookaside_alloc_func *allocfunc, lookaside_free_func *freefunc, + uint32_t flags, size_t size, uint32_t tag, uint16_t depth) { bzero((char *)lookaside, sizeof(npaged_lookaside_list)); @@ -2479,12 +2397,8 @@ ExInterlockedAddLargeStatistic(addend, i }; mdl * -IoAllocateMdl(vaddr, len, secondarybuf, chargequota, iopkt) - void *vaddr; - uint32_t len; - uint8_t secondarybuf; - uint8_t chargequota; - irp *iopkt; +IoAllocateMdl(void *vaddr, uint32_t len, uint8_t secondarybuf, + uint8_t chargequota, irp *iopkt) { mdl *m; int zone = 0; @@ -2633,23 +2547,15 @@ MmBuildMdlForNonPagedPool(m) } static void * -MmMapLockedPages(buf, accessmode) - mdl *buf; - uint8_t accessmode; +MmMapLockedPages(mdl *buf, uint8_t accessmode) { buf->mdl_flags |= MDL_MAPPED_TO_SYSTEM_VA; return(MmGetMdlVirtualAddress(buf)); } static void * -MmMapLockedPagesSpecifyCache(buf, accessmode, cachetype, vaddr, - bugcheck, prio) - mdl *buf; - uint8_t accessmode; - uint32_t cachetype; - void *vaddr; - uint32_t bugcheck; - uint32_t prio; +MmMapLockedPagesSpecifyCache(mdl *buf, uint8_t accessmode, uint32_t cachetype, + void *vaddr, uint32_t bugcheck, uint32_t prio) { return(MmMapLockedPages(buf, accessmode)); } @@ -3227,9 +3133,7 @@ srand(seed) } static uint8_t -IoIsWdmVersionAvailable(major, minor) - uint8_t major; - uint8_t minor; +IoIsWdmVersionAvailable(uint8_t major, uint8_t minor) { if (major == WDM_MAJOR && minor == WDM_MINOR_WINXP) return(TRUE); @@ -3289,9 +3193,7 @@ KeInitializeMutex(kmutex, level) } static uint32_t -KeReleaseMutex(kmutex, kwait) - kmutant *kmutex; - uint8_t kwait; +KeReleaseMutex(kmutant *kmutex, uint8_t kwait) { uint32_t prevstate; @@ -3323,10 +3225,7 @@ KeReadStateMutex(kmutex) } void -KeInitializeEvent(kevent, type, state) - nt_kevent *kevent; - uint32_t type; - uint8_t state; +KeInitializeEvent(nt_kevent *kevent, uint32_t type, uint8_t state) { InitializeListHead((&kevent->k_header.dh_waitlisthead)); kevent->k_header.dh_sigstate = state; @@ -3353,10 +3252,7 @@ KeResetEvent(kevent) } uint32_t -KeSetEvent(kevent, increment, kwait) - nt_kevent *kevent; - uint32_t increment; - uint8_t kwait; +KeSetEvent(nt_kevent *kevent, uint32_t increment, uint8_t kwait) { uint32_t prevstate; wait_block *w; @@ -3458,14 +3354,8 @@ KeReadStateEvent(kevent) */ static ndis_status -ObReferenceObjectByHandle(handle, reqaccess, otype, - accessmode, object, handleinfo) - ndis_handle handle; - uint32_t reqaccess; - void *otype; - uint8_t accessmode; - void **object; - void **handleinfo; +ObReferenceObjectByHandle(ndis_handle handle, uint32_t reqaccess, void *otype, + uint8_t accessmode, void **object, void **handleinfo) { nt_objref *nr; @@ -4112,9 +4002,7 @@ KeSetImportanceDpc(dpc, imp) } void -KeSetTargetProcessorDpc(dpc, cpu) - kdpc *dpc; - uint8_t cpu; +KeSetTargetProcessorDpc(kdpc *dpc, uint8_t cpu) { if (cpu > mp_ncpus) return; Modified: stable/7/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- stable/7/sys/contrib/altq/altq/altq_subr.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/contrib/altq/altq/altq_subr.c Thu Mar 19 17:06:04 2009 (r190087) @@ -812,10 +812,7 @@ read_dsfield(m, pktattr) } void -write_dsfield(m, pktattr, dsfield) - struct mbuf *m; - struct altq_pktattr *pktattr; - u_int8_t dsfield; +write_dsfield(struct mbuf *m, struct altq_pktattr *pktattr, u_int8_t dsfield) { struct mbuf *m0; Modified: stable/7/sys/dev/mca/mca_bus.c ============================================================================== --- stable/7/sys/dev/mca/mca_bus.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/dev/mca/mca_bus.c Thu Mar 19 17:06:04 2009 (r190087) @@ -68,10 +68,7 @@ struct mca_device { /* Not supposed to use this function! */ void -mca_pos_set (dev, reg, data) - device_t dev; - u_int8_t reg; - u_int8_t data; +mca_pos_set (device_t dev, u_int8_t reg, u_int8_t data) { struct mca_device * m_dev = device_get_ivars(dev); u_int8_t slot = mca_get_slot(dev); @@ -98,9 +95,7 @@ mca_pos_set (dev, reg, data) } u_int8_t -mca_pos_get (dev, reg) - device_t dev; - u_int8_t reg; +mca_pos_get (device_t dev, u_int8_t reg) { u_int8_t slot = mca_get_slot(dev); u_int8_t data = 0; @@ -158,9 +153,7 @@ mca_pos_get (dev, reg) } const char * -mca_match_id (id, mca_devs) - u_int16_t id; - struct mca_ident * mca_devs; +mca_match_id (u_int16_t id, struct mca_ident *mca_devs) { struct mca_ident * m = mca_devs; while(m->name != NULL) { @@ -172,9 +165,7 @@ mca_match_id (id, mca_devs) } u_int8_t -mca_pos_read (dev, reg) - device_t dev; - u_int8_t reg; +mca_pos_read (device_t dev, u_int8_t reg) { struct mca_device * m_dev = device_get_ivars(dev); Modified: stable/7/sys/dev/nsp/nsp.c ============================================================================== --- stable/7/sys/dev/nsp/nsp.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/dev/nsp/nsp.c Thu Mar 19 17:06:04 2009 (r190087) @@ -218,11 +218,8 @@ nsp_cr_read_1(bst, bsh, ofs) } static __inline void -nsp_cr_write_1(bst, bsh, ofs, va) - bus_space_tag_t bst; - bus_space_handle_t bsh; - bus_addr_t ofs; - u_int8_t va; +nsp_cr_write_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_addr_t ofs, + u_int8_t va) { bus_space_write_1(bst, bsh, nsp_idxr, ofs); @@ -230,9 +227,7 @@ nsp_cr_write_1(bst, bsh, ofs, va) } static int -nsp_expect_signal(sc, curphase, mask) - struct nsp_softc *sc; - u_int8_t curphase, mask; +nsp_expect_signal(struct nsp_softc *sc, u_int8_t curphase, u_int8_t mask) { struct scsi_low_softc *slp = &sc->sc_sclow; bus_space_tag_t bst = sc->sc_iot; @@ -1224,10 +1219,7 @@ WriteLoop: } static int -nsp_negate_signal(sc, mask, s) - struct nsp_softc *sc; - u_int8_t mask; - u_char *s; +nsp_negate_signal(struct nsp_softc *sc, u_int8_t mask, u_char *s) { struct scsi_low_softc *slp = &sc->sc_sclow; bus_space_tag_t bst = sc->sc_iot; @@ -1354,10 +1346,8 @@ nsp_disconnected(sc, ti) static void nsp_error(struct nsp_softc *, u_char *, u_int8_t, u_int8_t, u_int8_t); static void -nsp_error(sc, s, isrc, ph, irqphs) - struct nsp_softc *sc; - u_char *s; - u_int8_t isrc, ph, irqphs; +nsp_error(struct nsp_softc * sc, u_char *s, u_int8_t isrc, u_int8_t ph, + u_int8_t irqphs) { struct scsi_low_softc *slp = &sc->sc_sclow; @@ -1430,10 +1420,7 @@ nsp_ccb_nexus_establish(sc) } static int -nsp_phase_match(sc, phase, stat) - struct nsp_softc *sc; - u_int8_t phase; - u_int8_t stat; +nsp_phase_match(struct nsp_softc *sc, u_int8_t phase, u_int8_t stat) { struct scsi_low_softc *slp = &sc->sc_sclow; Modified: stable/7/sys/dev/stg/tmc18c30.c ============================================================================== --- stable/7/sys/dev/stg/tmc18c30.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/dev/stg/tmc18c30.c Thu Mar 19 17:06:04 2009 (r190087) @@ -191,9 +191,7 @@ struct scsi_low_funcs stgfuncs = { * hwfuncs ****************************************************/ static __inline void -stghw_bcr_write_1(sc, bcv) - struct stg_softc *sc; - u_int8_t bcv; +stghw_bcr_write_1(struct stg_softc *sc, u_int8_t bcv) { bus_space_write_1(sc->sc_iot, sc->sc_ioh, tmc_bctl, bcv); @@ -722,10 +720,7 @@ stg_pio_write(sc, ti, thold) } static int -stg_negate_signal(sc, mask, s) - struct stg_softc *sc; - u_int8_t mask; - u_char *s; +stg_negate_signal(struct stg_softc *sc, u_int8_t mask, u_char *s) { struct scsi_low_softc *slp = &sc->sc_sclow; bus_space_tag_t bst = sc->sc_iot; @@ -749,9 +744,7 @@ stg_negate_signal(sc, mask, s) } static int -stg_expect_signal(sc, phase, mask) - struct stg_softc *sc; - u_int8_t phase, mask; +stg_expect_signal(struct stg_softc *sc, u_int8_t phase, u_int8_t mask) { struct scsi_low_softc *slp = &sc->sc_sclow; bus_space_tag_t bst = sc->sc_iot; Modified: stable/7/sys/dev/txp/if_txp.c ============================================================================== --- stable/7/sys/dev/txp/if_txp.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/dev/txp/if_txp.c Thu Mar 19 17:06:04 2009 (r190087) @@ -1390,11 +1390,8 @@ oactive: * Handle simple commands sent to the typhoon */ static int -txp_command(sc, id, in1, in2, in3, out1, out2, out3, wait) - struct txp_softc *sc; - u_int16_t id, in1, *out1; - u_int32_t in2, in3, *out2, *out3; - int wait; +txp_command(struct txp_softc *sc, u_int16_t id, u_int16_t in1, u_int32_t in2, + u_int32_t in3, u_int16_t *out1, u_int32_t *out2, u_int32_t *out3, int wait) { struct txp_rsp_desc *rsp = NULL; @@ -1415,14 +1412,9 @@ txp_command(sc, id, in1, in2, in3, out1, } static int -txp_command2(sc, id, in1, in2, in3, in_extp, in_extn, rspp, wait) - struct txp_softc *sc; - u_int16_t id, in1; - u_int32_t in2, in3; - struct txp_ext_desc *in_extp; - u_int8_t in_extn; - struct txp_rsp_desc **rspp; - int wait; +txp_command2(struct txp_softc *sc, u_int16_t id, u_int16_t in1, u_int32_t in2, + u_int32_t in3, struct txp_ext_desc *in_extp, u_int8_t in_extn, + struct txp_rsp_desc **rspp, int wait) { struct txp_hostvar *hv = sc->sc_hostvar; struct txp_cmd_desc *cmd; @@ -1488,12 +1480,8 @@ txp_command2(sc, id, in1, in2, in3, in_e } static int -txp_response(sc, ridx, id, seq, rspp) - struct txp_softc *sc; - u_int32_t ridx; - u_int16_t id; - u_int16_t seq; - struct txp_rsp_desc **rspp; +txp_response(struct txp_softc *sc, u_int32_t ridx, u_int16_t id, u_int16_t seq, + struct txp_rsp_desc **rspp) { struct txp_hostvar *hv = sc->sc_hostvar; struct txp_rsp_desc *rsp; Modified: stable/7/sys/i386/i386/vm86.c ============================================================================== --- stable/7/sys/i386/i386/vm86.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/i386/i386/vm86.c Thu Mar 19 17:06:04 2009 (r190087) @@ -615,10 +615,7 @@ vm86_datacall(intnum, vmf, vmc) } vm_offset_t -vm86_getaddr(vmc, sel, off) - struct vm86context *vmc; - u_short sel; - u_short off; +vm86_getaddr(struct vm86context *vmc, u_short sel, u_short off) { int i, page; vm_offset_t addr; Modified: stable/7/sys/i386/isa/npx.c ============================================================================== --- stable/7/sys/i386/isa/npx.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/i386/isa/npx.c Thu Mar 19 17:06:04 2009 (r190087) @@ -452,8 +452,7 @@ npx_attach(dev) * Initialize floating point unit. */ void -npxinit(control) - u_short control; +npxinit(u_short control) { static union savefpu dummy; register_t savecrit; Modified: stable/7/sys/netinet/sctp_input.c ============================================================================== --- stable/7/sys/netinet/sctp_input.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/netinet/sctp_input.c Thu Mar 19 17:06:04 2009 (r190087) @@ -5570,10 +5570,7 @@ sctp_print_mbuf_chain(struct mbuf *m) #endif void -sctp_input_with_port(i_pak, off, port) - struct mbuf *i_pak; - int off; - uint16_t port; +sctp_input_with_port(struct mbuf *i_pak, int off, uint16_t port) { #ifdef SCTP_MBUF_LOGGING struct mbuf *mat; Modified: stable/7/sys/netipsec/key.c ============================================================================== --- stable/7/sys/netipsec/key.c Thu Mar 19 17:02:10 2009 (r190086) +++ stable/7/sys/netipsec/key.c Thu Mar 19 17:06:04 2009 (r190087) @@ -2406,10 +2406,7 @@ key_spddump(so, m, mhp) } static struct mbuf * -key_setdumpsp(sp, type, seq, pid) - struct secpolicy *sp; - u_int8_t type; - u_int32_t seq, pid; +key_setdumpsp(struct secpolicy *sp, u_int8_t type, u_int32_t seq, u_int32_t pid) { struct mbuf *result = NULL, *m; struct seclifetime lt; @@ -3302,10 +3299,8 @@ key_mature(struct secasvar *sav) * subroutine for SADB_GET and SADB_DUMP. */ static struct mbuf * -key_setdumpsa(sav, type, satype, seq, pid) - struct secasvar *sav; - u_int8_t type, satype; - u_int32_t seq, pid; +key_setdumpsa(struct secasvar *sav, u_int8_t type, u_int8_t satype, + u_int32_t seq, u_int32_t pid) { struct mbuf *result = NULL, *tres = NULL, *m; int i; @@ -3443,12 +3438,8 @@ fail: * set data into sadb_msg. */ static struct mbuf * -key_setsadbmsg(type, tlen, satype, seq, pid, reserved) - u_int8_t type, satype; - u_int16_t tlen; - u_int32_t seq; - pid_t pid; - u_int16_t reserved; +key_setsadbmsg(u_int8_t type, u_int16_t tlen, u_int8_t satype, u_int32_t seq, + pid_t pid, u_int16_t reserved) { struct mbuf *m; struct sadb_msg *p; @@ -3523,11 +3514,7 @@ key_setsadbsa(sav) * set data into sadb_address. */ static struct mbuf * -key_setsadbaddr(exttype, saddr, prefixlen, ul_proto) - u_int16_t exttype; - const struct sockaddr *saddr; - u_int8_t prefixlen; - u_int16_t ul_proto; +key_setsadbaddr(u_int16_t exttype, const struct sockaddr *saddr, u_int8_t prefixlen, u_int16_t ul_proto) { struct mbuf *m; struct sadb_address *p; @@ -3574,9 +3561,7 @@ key_setsadbaddr(exttype, saddr, prefixle * set data into sadb_x_sa2. */ static struct mbuf * -key_setsadbxsa2(mode, seq, reqid) - u_int8_t mode; - u_int32_t seq, reqid; +key_setsadbxsa2(u_int8_t mode, u_int32_t seq, u_int32_t reqid) { struct mbuf *m; struct sadb_x_sa2 *p; @@ -3608,10 +3593,7 @@ key_setsadbxsa2(mode, seq, reqid) * set data into sadb_x_policy */ static struct mbuf * -key_setsadbxpolicy(type, dir, id) - u_int16_t type; - u_int8_t dir; - u_int32_t id; +key_setsadbxpolicy(u_int16_t type, u_int8_t dir, u_int32_t id) { struct mbuf *m; struct sadb_x_policy *p; @@ -4343,8 +4325,7 @@ key_randomfill(p, l) * 0: invalid satype. */ static u_int16_t -key_satype2proto(satype) - u_int8_t satype; +key_satype2proto(u_int8_t satype) { switch (satype) { case SADB_SATYPE_UNSPEC: @@ -4369,8 +4350,7 @@ key_satype2proto(satype) * 0: invalid protocol type. */ static u_int8_t -key_proto2satype(proto) - u_int16_t proto; +key_proto2satype(u_int16_t proto) { switch (proto) { case IPPROTO_AH: @@ -5229,11 +5209,8 @@ key_delete(so, m, mhp) * delete all SAs for src/dst. Called from key_delete(). */ static int -key_delete_all(so, m, mhp, proto) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 17:27:41 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 C80D1106564A; Thu, 19 Mar 2009 17:27:41 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 777E58FC0C; Thu, 19 Mar 2009 17:27:41 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id A49A89CB071; Thu, 19 Mar 2009 18:11:49 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id icvloOwrVP4f; Thu, 19 Mar 2009 18:11:47 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id E94C39CB124; Thu, 19 Mar 2009 18:11:46 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n2JHBka3036857; Thu, 19 Mar 2009 18:11:46 +0100 (CET) (envelope-from rdivacky) Date: Thu, 19 Mar 2009 18:11:46 +0100 From: Roman Divacky To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Message-ID: <20090319171146.GA36774@freebsd.org> References: <200903191706.n2JH65B0070103@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline In-Reply-To: <200903191706.n2JH65B0070103@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: svn commit: r190087 - in stable/7/sys: . compat/ndis contrib/altq/altq contrib/pf dev/ath/ath_hal dev/cxgb dev/mca dev/nsp dev/stg dev/txp i386/i386 i386/isa netinet netipsec vm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 17:27:42 -0000 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 19, 2009 at 05:06:05PM +0000, Roman Divacky wrote: > Author: rdivacky > Date: Thu Mar 19 17:06:04 2009 > New Revision: 190087 > URL: http://svn.freebsd.org/changeset/base/190087 >=20 > Log: > Merge r189004. sorry about the miserable commit message, this was merged Change the functions to ANSI in those cases where it breaks promotion to int rule. See ISO C Standard: SS6.7.5.3:15. Approved by: kib (mentor) Reviewed by: warner Tested by: silence on -current --opJtzjQTFsWo+cga Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAknCfNIACgkQLVEj6D3CBExpSACfWMUFzQQe0c/dMRQhpLRFzrwY M9EAn22A7EOqJKUxd0ykhremSVvLmKRD =nLnk -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga-- From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 17:42: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 BEEAE10656C0; Thu, 19 Mar 2009 17:42:11 +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 AB59B8FC20; Thu, 19 Mar 2009 17:42:11 +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 n2JHgBZX070887; Thu, 19 Mar 2009 17:42:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JHgBbe070885; Thu, 19 Mar 2009 17:42:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903191742.n2JHgBbe070885@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Mar 2009 17:42: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: r190090 - in stable/7/sys: . amd64/acpica contrib/pf dev/ath/ath_hal dev/cxgb i386/acpica 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, 19 Mar 2009 17:42:12 -0000 Author: jhb Date: Thu Mar 19 17:42:11 2009 New Revision: 190090 URL: http://svn.freebsd.org/changeset/base/190090 Log: MFC: Ignore I/O APICs with a starting IRQ > 255. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/acpica/madt.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/acpica/madt.c Modified: stable/7/sys/amd64/acpica/madt.c ============================================================================== --- stable/7/sys/amd64/acpica/madt.c Thu Mar 19 17:16:33 2009 (r190089) +++ stable/7/sys/amd64/acpica/madt.c Thu Mar 19 17:42:11 2009 (r190090) @@ -483,6 +483,10 @@ madt_parse_apics(ACPI_SUBTABLE_HEADER *e apic->Id); if (ioapics[apic->Id].io_apic != NULL) panic("%s: Double APIC ID %u", __func__, apic->Id); + if (apic->GlobalIrqBase >= FIRST_MSI_INT) { + printf("MADT: Ignoring bogus I/O APIC ID %u", apic->Id); + break; + } ioapics[apic->Id].io_apic = ioapic_create(apic->Address, apic->Id, apic->GlobalIrqBase); ioapics[apic->Id].io_vector = apic->GlobalIrqBase; Modified: stable/7/sys/i386/acpica/madt.c ============================================================================== --- stable/7/sys/i386/acpica/madt.c Thu Mar 19 17:16:33 2009 (r190089) +++ stable/7/sys/i386/acpica/madt.c Thu Mar 19 17:42:11 2009 (r190090) @@ -482,6 +482,10 @@ madt_parse_apics(ACPI_SUBTABLE_HEADER *e apic->Id); if (ioapics[apic->Id].io_apic != NULL) panic("%s: Double APIC ID %u", __func__, apic->Id); + if (apic->GlobalIrqBase >= FIRST_MSI_INT) { + printf("MADT: Ignoring bogus I/O APIC ID %u", apic->Id); + break; + } ioapics[apic->Id].io_apic = ioapic_create(apic->Address, apic->Id, apic->GlobalIrqBase); ioapics[apic->Id].io_vector = apic->GlobalIrqBase; From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 17:46: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 27C45106574B; Thu, 19 Mar 2009 17:46:52 +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 14B2A8FC0C; Thu, 19 Mar 2009 17:46:52 +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 n2JHkpoU071019; Thu, 19 Mar 2009 17:46:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JHkpoM071018; Thu, 19 Mar 2009 17:46:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903191746.n2JHkpoM071018@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Mar 2009 17:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190091 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb isa 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, 19 Mar 2009 17:46:53 -0000 Author: jhb Date: Thu Mar 19 17:46:51 2009 New Revision: 190091 URL: http://svn.freebsd.org/changeset/base/190091 Log: MFC: Allow syscons to work on amd64 and i386 without any hints. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/isa/syscons_isa.c Modified: stable/7/sys/isa/syscons_isa.c ============================================================================== --- stable/7/sys/isa/syscons_isa.c Thu Mar 19 17:42:11 2009 (r190090) +++ stable/7/sys/isa/syscons_isa.c Thu Mar 19 17:46:51 2009 (r190091) @@ -103,7 +103,9 @@ scprobe(device_t dev) static int scattach(device_t dev) { - return sc_attach_unit(device_get_unit(dev), device_get_flags(dev)); + + return (sc_attach_unit(device_get_unit(dev), device_get_flags(dev) | + SC_AUTODETECT_KBD)); } static int @@ -240,8 +242,10 @@ sc_get_cons_priority(int *unit, int *fla *flags = f; } } - if (*unit < 0) - return CN_DEAD; + if (*unit < 0) { + *unit = 0; + *flags = 0; + } #if 0 return ((*flags & SC_KERNEL_CONSOLE) ? CN_INTERNAL : CN_NORMAL); #endif From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 18:04:37 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 756D5106564A; Thu, 19 Mar 2009 18:04:37 +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 627108FC16; Thu, 19 Mar 2009 18:04:37 +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 n2JI4bQI071403; Thu, 19 Mar 2009 18:04:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JI4bZ4071402; Thu, 19 Mar 2009 18:04:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903191804.n2JI4bZ4071402@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Mar 2009 18:04:37 +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: r190092 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 18:04:38 -0000 Author: jhb Date: Thu Mar 19 18:04:37 2009 New Revision: 190092 URL: http://svn.freebsd.org/changeset/base/190092 Log: MFC: Honor the prefetchable flag in memory BARs. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/pci/pci.c Modified: stable/7/sys/dev/pci/pci.c ============================================================================== --- stable/7/sys/dev/pci/pci.c Thu Mar 19 17:46:51 2009 (r190091) +++ stable/7/sys/dev/pci/pci.c Thu Mar 19 18:04:37 2009 (r190092) @@ -2295,9 +2295,11 @@ pci_add_map(device_t pcib, device_t bus, testval = PCIB_READ_CONFIG(pcib, b, s, f, reg, 4); PCIB_WRITE_CONFIG(pcib, b, s, f, reg, map, 4); - if (PCI_BAR_MEM(map)) + if (PCI_BAR_MEM(map)) { type = SYS_RES_MEMORY; - else + if (map & PCIM_BAR_MEM_PREFETCH) + prefetch = 1; + } else type = SYS_RES_IOPORT; ln2size = pci_mapsize(testval); ln2range = pci_maprange(testval); @@ -3444,6 +3446,8 @@ pci_alloc_map(device_t dev, device_t chi count = 1UL << mapsize; if (RF_ALIGNMENT(flags) < mapsize) flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize); + if (PCI_BAR_MEM(testval) && (testval & PCIM_BAR_MEM_PREFETCH)) + flags |= RF_PREFETCHABLE; /* * Allocate enough resource, and then write back the From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 20:40:12 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 12DB21065670; Thu, 19 Mar 2009 20:40:12 +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 F2EC38FC14; Thu, 19 Mar 2009 20:40:11 +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 n2JKeBdb075155; Thu, 19 Mar 2009 20:40:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JKeBgK075153; Thu, 19 Mar 2009 20:40:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903192040.n2JKeBgK075153@svn.freebsd.org> From: Warner Losh Date: Thu, 19 Mar 2009 20:40: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: r190104 - in stable/7/sys: . conf contrib/pf dev/ath/ath_hal dev/cxgb dev/pcn modules/pcn pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 20:40:12 -0000 Author: imp Date: Thu Mar 19 20:40:11 2009 New Revision: 190104 URL: http://svn.freebsd.org/changeset/base/190104 Log: MFC: r181740 Move pcn. Added: stable/7/sys/dev/pcn/ - copied from r181740, head/sys/dev/pcn/ Deleted: stable/7/sys/pci/if_pcn.c stable/7/sys/pci/if_pcnreg.h Modified: stable/7/sys/ (props changed) stable/7/sys/conf/files stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/modules/pcn/Makefile Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Thu Mar 19 20:38:45 2009 (r190103) +++ stable/7/sys/conf/files Thu Mar 19 20:40:11 2009 (r190104) @@ -1041,6 +1041,7 @@ dev/pci/pci_pci.c optional pci dev/pci/pci_user.c optional pci dev/pci/pcib_if.m standard dev/pci/vga_pci.c optional pci +dev/pcn/if_pcn.c optional pcn pci dev/pdq/if_fea.c optional fea eisa dev/pdq/if_fpa.c optional fpa pci dev/pdq/pdq.c optional nowerror fea eisa | fpa pci @@ -2111,7 +2112,6 @@ pci/alpm.c optional alpm pci pci/amdpm.c optional amdpm pci | nfpm pci pci/amdsmb.c optional amdsmb pci pci/if_mn.c optional mn pci -pci/if_pcn.c optional pcn pci pci/if_rl.c optional rl pci pci/if_ste.c optional ste pci pci/if_tl.c optional tl pci Modified: stable/7/sys/modules/pcn/Makefile ============================================================================== --- stable/7/sys/modules/pcn/Makefile Thu Mar 19 20:38:45 2009 (r190103) +++ stable/7/sys/modules/pcn/Makefile Thu Mar 19 20:40:11 2009 (r190104) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../pci +.PATH: ${.CURDIR}/../../dev/pcn KMOD= if_pcn SRCS= if_pcn.c device_if.h bus_if.h pci_if.h From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 21:40:12 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 9C74E1065673; Thu, 19 Mar 2009 21:40:12 +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 703178FC12; Thu, 19 Mar 2009 21:40:12 +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 n2JLeCjl077229; Thu, 19 Mar 2009 21:40:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JLeCKE077228; Thu, 19 Mar 2009 21:40:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903192140.n2JLeCKE077228@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Mar 2009 21:40:12 +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: r190115 - stable/7/sys/dev/pcn 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, 19 Mar 2009 21:40:13 -0000 Author: jhb Date: Thu Mar 19 21:40:12 2009 New Revision: 190115 URL: http://svn.freebsd.org/changeset/base/190115 Log: Remove empty mergeinfo. Modified: stable/7/sys/dev/pcn/if_pcn.c (props changed) stable/7/sys/dev/pcn/if_pcnreg.h (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 19 22:01: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 F1CC11065672; Thu, 19 Mar 2009 22:01:19 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEE8F8FC21; Thu, 19 Mar 2009 22:01:19 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JM1JF6077804; Thu, 19 Mar 2009 22:01:19 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JM1JRX077803; Thu, 19 Mar 2009 22:01:19 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200903192201.n2JM1JRX077803@svn.freebsd.org> From: Christian Brueffer Date: Thu, 19 Mar 2009 22:01:19 +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: r190116 - in stable/7/sys: . contrib/pf dev/cxgb dev/pcn 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, 19 Mar 2009 22:01:20 -0000 Author: brueffer Date: Thu Mar 19 22:01:19 2009 New Revision: 190116 URL: http://svn.freebsd.org/changeset/base/190116 Log: MFC: r186715 Call pcn_start_locked() instead of pcn_start() where the softc lock is already held. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/pcn/if_pcn.c Modified: stable/7/sys/dev/pcn/if_pcn.c ============================================================================== --- stable/7/sys/dev/pcn/if_pcn.c Thu Mar 19 21:40:12 2009 (r190115) +++ stable/7/sys/dev/pcn/if_pcn.c Thu Mar 19 22:01:19 2009 (r190116) @@ -1446,7 +1446,7 @@ pcn_watchdog(ifp) pcn_init_locked(sc); if (ifp->if_snd.ifq_head != NULL) - pcn_start(ifp); + pcn_start_locked(ifp); PCN_UNLOCK(sc); From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 00:34:51 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50EF41065675; Fri, 20 Mar 2009 00:34:51 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CA088FC14; Fri, 20 Mar 2009 00:34:51 +0000 (UTC) (envelope-from csjp@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 n2K0YpFe080886; Fri, 20 Mar 2009 00:34:51 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K0Ypq3080883; Fri, 20 Mar 2009 00:34:51 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200903200034.n2K0Ypq3080883@svn.freebsd.org> From: "Christian S.J. Peron" Date: Fri, 20 Mar 2009 00:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190118 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern security/audit 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: Fri, 20 Mar 2009 00:34:52 -0000 Author: csjp Date: Fri Mar 20 00:34:50 2009 New Revision: 190118 URL: http://svn.freebsd.org/changeset/base/190118 Log: MFC r181060 - Add vn_fullpath_global() - Fix issues in auditing pathnames within chroot/jail envs Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/vfs_cache.c stable/7/sys/security/audit/audit_bsm_klib.c stable/7/sys/sys/vnode.h Modified: stable/7/sys/kern/vfs_cache.c ============================================================================== --- stable/7/sys/kern/vfs_cache.c Thu Mar 19 22:34:55 2009 (r190117) +++ stable/7/sys/kern/vfs_cache.c Fri Mar 20 00:34:50 2009 (r190118) @@ -790,6 +790,32 @@ vn_fullpath(struct thread *td, struct vn } /* + * This function is similar to vn_fullpath, but it attempts to lookup the + * pathname relative to the global root mount point. This is required for the + * auditing sub-system, as audited pathnames must be absolute, relative to the + * global root mount point. + */ +int +vn_fullpath_global(struct thread *td, struct vnode *vn, + char **retbuf, char **freebuf) +{ + char *buf; + int error; + + if (disablefullpath) + return (ENODEV); + if (vn == NULL) + return (EINVAL); + buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + error = vn_fullpath1(td, vn, rootvnode, buf, retbuf, MAXPATHLEN); + if (!error) + *freebuf = buf; + else + free(buf, M_TEMP); + return (error); +} + +/* * The magic behind kern___getcwd() and vn_fullpath(). */ static int Modified: stable/7/sys/security/audit/audit_bsm_klib.c ============================================================================== --- stable/7/sys/security/audit/audit_bsm_klib.c Thu Mar 19 22:34:55 2009 (r190117) +++ stable/7/sys/security/audit/audit_bsm_klib.c Fri Mar 20 00:34:50 2009 (r190118) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -483,73 +484,110 @@ auditon_command_event(int cmd) * directory is NULL, we could use 'rootvnode' to obtain the root directory, * but this results in a volfs name written to the audit log. So we will * leave the filename starting with '/' in the audit log in this case. - * - * XXXRW: Since we combine two paths here, ideally a buffer of size - * MAXPATHLEN * 2 would be passed in. */ void audit_canon_path(struct thread *td, char *path, char *cpath) { - char *bufp; - char *retbuf, *freebuf; - struct vnode *vnp; + struct vnode *cvnp, *rvnp; + char *rbuf, *fbuf, *copy; struct filedesc *fdp; - int cisr, error, vfslocked; + struct sbuf sbf; + int error, cwir, locked; - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, - "audit_canon_path() at %s:%d", __FILE__, __LINE__); + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s: at %s:%d", + __func__, __FILE__, __LINE__); + copy = path; + rvnp = cvnp = NULL; fdp = td->td_proc->p_fd; - bufp = path; - cisr = 0; FILEDESC_SLOCK(fdp); - if (*(path) == '/') { - while (*(bufp) == '/') - bufp++; /* Skip leading '/'s. */ - /* - * If no process root, or it is the same as the system root, - * audit the path as passed in with a single '/'. - */ - if ((fdp->fd_rdir == NULL) || - (fdp->fd_rdir == rootvnode)) { - vnp = NULL; - bufp--; /* Restore one '/'. */ - } else { - vnp = fdp->fd_rdir; /* Use process root. */ - vref(vnp); - } - } else { - vnp = fdp->fd_cdir; /* Prepend the current dir. */ - cisr = (fdp->fd_rdir == fdp->fd_cdir); - vref(vnp); - bufp = path; + /* + * Make sure that we handle the chroot(2) case. If there is an + * alternate root directory, prepend it to the audited pathname. + */ + if (fdp->fd_rdir != NULL && fdp->fd_rdir != rootvnode) { + rvnp = fdp->fd_rdir; + vhold(rvnp); + } + /* + * If the supplied path is relative, make sure we capture the current + * working directory so we can prepend it to the supplied relative + * path. + */ + if (*path != '/') { + cvnp = fdp->fd_cdir; + vhold(cvnp); } + cwir = (fdp->fd_rdir == fdp->fd_cdir); FILEDESC_SUNLOCK(fdp); - if (vnp != NULL) { + /* + * NB: We require that the supplied array be at least MAXPATHLEN bytes + * long. If this is not the case, then we can run into serious trouble. + */ + (void) sbuf_new(&sbf, cpath, MAXPATHLEN, SBUF_FIXEDLEN); + /* + * Strip leading forward slashes. + */ + while (*copy == '/') + copy++; + /* + * Make sure we handle chroot(2) and prepend the global path to these + * environments. + * + * NB: vn_fullpath(9) on FreeBSD is less reliable than vn_getpath(9) + * on Darwin. As a result, this may need some additional attention + * in the future. + */ + if (rvnp != NULL) { /* - * XXX: vn_fullpath() on FreeBSD is "less reliable" than - * vn_getpath() on Darwin, so this will need more attention - * in the future. Also, the question and string bounding - * here seems a bit questionable and will also require - * attention. + * Although unlikely, it is possible for filesystems to define + * their own VOP_LOCK, so strictly speaking, we need to + * conditionally pickup Giant around calls to vn_lock(9) */ - vfslocked = VFS_LOCK_GIANT(vnp->v_mount); - vn_lock(vnp, LK_EXCLUSIVE | LK_RETRY, td); - error = vn_fullpath(td, vnp, &retbuf, &freebuf); - if (error == 0) { - /* Copy and free buffer allocated by vn_fullpath(). - * If the current working directory was the same as - * the root directory, and the path was a relative - * pathname, do not separate the two components with - * the '/' character. - */ - snprintf(cpath, MAXPATHLEN, "%s%s%s", retbuf, - cisr ? "" : "/", bufp); - free(freebuf, M_TEMP); - } else + locked = VFS_LOCK_GIANT(rvnp->v_mount); + vn_lock(rvnp, LK_EXCLUSIVE | LK_RETRY, td); + vdrop(rvnp); + error = vn_fullpath_global(td, rvnp, &rbuf, &fbuf); + VOP_UNLOCK(rvnp, 0, td); + VFS_UNLOCK_GIANT(locked); + if (error) { cpath[0] = '\0'; - vput(vnp); - VFS_UNLOCK_GIANT(vfslocked); - } else - strlcpy(cpath, bufp, MAXPATHLEN); + if (cvnp != NULL) + vdrop(cvnp); + return; + } + (void) sbuf_cat(&sbf, rbuf); + free(fbuf, M_TEMP); + } + if (cvnp != NULL) { + locked = VFS_LOCK_GIANT(cvnp->v_mount); + vn_lock(cvnp, LK_EXCLUSIVE | LK_RETRY, td); + vdrop(cvnp); + error = vn_fullpath(td, cvnp, &rbuf, &fbuf); + VOP_UNLOCK(cvnp, 0, td); + VFS_UNLOCK_GIANT(locked); + if (error) { + cpath[0] = '\0'; + return; + } + (void) sbuf_cat(&sbf, rbuf); + free(fbuf, M_TEMP); + } + if (cwir == 0 || (cwir != 0 && cvnp == NULL)) + (void) sbuf_cat(&sbf, "/"); + /* + * Now that we have processed any alternate root and relative path + * names, add the supplied pathname. + */ + (void) sbuf_cat(&sbf, copy); + /* + * One or more of the previous sbuf operations could have resulted in + * the supplied buffer being overflowed. Check to see if this is the + * case. + */ + if (sbuf_overflowed(&sbf) != 0) { + cpath[0] = '\0'; + return; + } + sbuf_finish(&sbf); } Modified: stable/7/sys/sys/vnode.h ============================================================================== --- stable/7/sys/sys/vnode.h Thu Mar 19 22:34:55 2009 (r190117) +++ stable/7/sys/sys/vnode.h Fri Mar 20 00:34:50 2009 (r190118) @@ -581,6 +581,8 @@ int speedup_syncer(void); vn_fullpath(FIRST_THREAD_IN_PROC(p), (p)->p_textvp, rb, rfb) int vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf); +int vn_fullpath_global(struct thread *td, struct vnode *vn, + char **retbuf, char **freebuf); int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid, mode_t acc_mode, struct ucred *cred, int *privused); From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 00:38:16 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 2B2D0106564A; Fri, 20 Mar 2009 00:38:15 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1829C8FC15; Fri, 20 Mar 2009 00:38:15 +0000 (UTC) (envelope-from csjp@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 n2K0cEJx081014; Fri, 20 Mar 2009 00:38:14 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K0cENJ081013; Fri, 20 Mar 2009 00:38:14 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200903200038.n2K0cENJ081013@svn.freebsd.org> From: "Christian S.J. Peron" Date: Fri, 20 Mar 2009 00:38: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: r190119 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb security/audit 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, 20 Mar 2009 00:38:17 -0000 Author: csjp Date: Fri Mar 20 00:38:14 2009 New Revision: 190119 URL: http://svn.freebsd.org/changeset/base/190119 Log: MFC r182090 - use sbuf_putc instead of sbuf_cat Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/security/audit/audit_bsm_klib.c Modified: stable/7/sys/security/audit/audit_bsm_klib.c ============================================================================== --- stable/7/sys/security/audit/audit_bsm_klib.c Fri Mar 20 00:34:50 2009 (r190118) +++ stable/7/sys/security/audit/audit_bsm_klib.c Fri Mar 20 00:38:14 2009 (r190119) @@ -574,7 +574,7 @@ audit_canon_path(struct thread *td, char free(fbuf, M_TEMP); } if (cwir == 0 || (cwir != 0 && cvnp == NULL)) - (void) sbuf_cat(&sbf, "/"); + (void) sbuf_putc(&sbf, '/'); /* * Now that we have processed any alternate root and relative path * names, add the supplied pathname. From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 00:55: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 E9427106566C; Fri, 20 Mar 2009 00:55:38 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB8F78FC1D; Fri, 20 Mar 2009 00:55:38 +0000 (UTC) (envelope-from csjp@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 n2K0tc0f081443; Fri, 20 Mar 2009 00:55:38 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K0tcb2081442; Fri, 20 Mar 2009 00:55:38 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200903200055.n2K0tcb2081442@svn.freebsd.org> From: "Christian S.J. Peron" Date: Fri, 20 Mar 2009 00:55: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: r190120 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb security/audit 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, 20 Mar 2009 00:55:39 -0000 Author: csjp Date: Fri Mar 20 00:55:38 2009 New Revision: 190120 URL: http://svn.freebsd.org/changeset/base/190120 Log: MFC r184660 - Dont hold Giant around vn_fullpath and vn_fullpath_global Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/security/audit/audit_bsm_klib.c Modified: stable/7/sys/security/audit/audit_bsm_klib.c ============================================================================== --- stable/7/sys/security/audit/audit_bsm_klib.c Fri Mar 20 00:38:14 2009 (r190119) +++ stable/7/sys/security/audit/audit_bsm_klib.c Fri Mar 20 00:55:38 2009 (r190120) @@ -492,7 +492,7 @@ audit_canon_path(struct thread *td, char char *rbuf, *fbuf, *copy; struct filedesc *fdp; struct sbuf sbf; - int error, cwir, locked; + int error, cwir; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s: at %s:%d", __func__, __FILE__, __LINE__); @@ -539,17 +539,8 @@ audit_canon_path(struct thread *td, char * in the future. */ if (rvnp != NULL) { - /* - * Although unlikely, it is possible for filesystems to define - * their own VOP_LOCK, so strictly speaking, we need to - * conditionally pickup Giant around calls to vn_lock(9) - */ - locked = VFS_LOCK_GIANT(rvnp->v_mount); - vn_lock(rvnp, LK_EXCLUSIVE | LK_RETRY, td); - vdrop(rvnp); error = vn_fullpath_global(td, rvnp, &rbuf, &fbuf); - VOP_UNLOCK(rvnp, 0, td); - VFS_UNLOCK_GIANT(locked); + vdrop(rvnp); if (error) { cpath[0] = '\0'; if (cvnp != NULL) @@ -560,12 +551,8 @@ audit_canon_path(struct thread *td, char free(fbuf, M_TEMP); } if (cvnp != NULL) { - locked = VFS_LOCK_GIANT(cvnp->v_mount); - vn_lock(cvnp, LK_EXCLUSIVE | LK_RETRY, td); - vdrop(cvnp); error = vn_fullpath(td, cvnp, &rbuf, &fbuf); - VOP_UNLOCK(cvnp, 0, td); - VFS_UNLOCK_GIANT(locked); + vdrop(cvnp); if (error) { cpath[0] = '\0'; return; From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 01:15:50 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 E0033106564A; Fri, 20 Mar 2009 01:15:50 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD3328FC19; Fri, 20 Mar 2009 01:15:50 +0000 (UTC) (envelope-from csjp@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 n2K1FopD081909; Fri, 20 Mar 2009 01:15:50 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K1ForV081908; Fri, 20 Mar 2009 01:15:50 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200903200115.n2K1ForV081908@svn.freebsd.org> From: "Christian S.J. Peron" Date: Fri, 20 Mar 2009 01:15: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: r190121 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Mar 2009 01:15:51 -0000 Author: csjp Date: Fri Mar 20 01:15:50 2009 New Revision: 190121 URL: http://svn.freebsd.org/changeset/base/190121 Log: MFC r182120 - Avoid printing warning message for vnodes that have dead fileops when MAC is enabled Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/vfs_subr.c Modified: stable/7/sys/kern/vfs_subr.c ============================================================================== --- stable/7/sys/kern/vfs_subr.c Fri Mar 20 00:55:38 2009 (r190120) +++ stable/7/sys/kern/vfs_subr.c Fri Mar 20 01:15:50 2009 (r190121) @@ -949,7 +949,7 @@ alloc: mac_init_vnode(vp); if (mp != NULL && (mp->mnt_flag & MNT_MULTILABEL) == 0) mac_associate_vnode_singlelabel(mp, vp); - else if (mp == NULL) + else if (mp == NULL && vops != &dead_vnodeops) printf("NULL mp in getnewvnode()\n"); #endif if (mp != NULL) { From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 03:10:12 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 BC8B910656E8; Fri, 20 Mar 2009 03:10:12 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A97A98FC20; Fri, 20 Mar 2009 03:10:12 +0000 (UTC) (envelope-from nyan@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 n2K3ACf8084324; Fri, 20 Mar 2009 03:10:12 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K3ACos084323; Fri, 20 Mar 2009 03:10:12 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200903200310.n2K3ACos084323@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 20 Mar 2009 03:10:12 +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: r190122 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb pc98/cbus 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, 20 Mar 2009 03:10:13 -0000 Author: nyan Date: Fri Mar 20 03:10:12 2009 New Revision: 190122 URL: http://svn.freebsd.org/changeset/base/190122 Log: MFC: r189445 Allow syscons to work without any hints. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/pc98/cbus/syscons_cbus.c Modified: stable/7/sys/pc98/cbus/syscons_cbus.c ============================================================================== --- stable/7/sys/pc98/cbus/syscons_cbus.c Fri Mar 20 01:15:50 2009 (r190121) +++ stable/7/sys/pc98/cbus/syscons_cbus.c Fri Mar 20 03:10:12 2009 (r190122) @@ -205,8 +205,10 @@ sc_get_cons_priority(int *unit, int *fla *flags = f; } } - if (*unit < 0) - return CN_DEAD; + if (*unit < 0) { + *unit = 0; + *flags = 0; + } return CN_INTERNAL; } From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 05:42: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 0374F106566B; Fri, 20 Mar 2009 05:42:28 +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 E490C8FC0A; Fri, 20 Mar 2009 05:42:27 +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 n2K5gRAc087419; Fri, 20 Mar 2009 05:42:27 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K5gRmp087418; Fri, 20 Mar 2009 05:42:27 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903200542.n2K5gRmp087418@svn.freebsd.org> From: Robert Noland Date: Fri, 20 Mar 2009 05:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190128 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Fri, 20 Mar 2009 05:42:28 -0000 Author: rnoland Date: Fri Mar 20 05:42:27 2009 New Revision: 190128 URL: http://svn.freebsd.org/changeset/base/190128 Log: Merge 189908 Use flsl() here rather than ffsl() I discovered that we were computing page_order differently than linux. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_bufs.c Modified: stable/7/sys/dev/drm/drm_bufs.c ============================================================================== --- stable/7/sys/dev/drm/drm_bufs.c Fri Mar 20 05:33:58 2009 (r190127) +++ stable/7/sys/dev/drm/drm_bufs.c Fri Mar 20 05:42:27 2009 (r190128) @@ -1106,7 +1106,7 @@ int drm_order(unsigned long size) if (size == 0) return 0; - order = ffsl(size) - 1; + order = flsl(size) - 1; if (size & ~(1ul << order)) ++order; From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 05:43:25 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3447B106566B; Fri, 20 Mar 2009 05:43:25 +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 218B18FC1F; Fri, 20 Mar 2009 05:43:25 +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 n2K5hPoO087483; Fri, 20 Mar 2009 05:43:25 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K5hPWM087482; Fri, 20 Mar 2009 05:43:25 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903200543.n2K5hPWM087482@svn.freebsd.org> From: Robert Noland Date: Fri, 20 Mar 2009 05:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190129 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Fri, 20 Mar 2009 05:43:25 -0000 Author: rnoland Date: Fri Mar 20 05:43:24 2009 New Revision: 190129 URL: http://svn.freebsd.org/changeset/base/190129 Log: Merge 189909 Change the logic around to match ati_pcigart. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/r600_cp.c Modified: stable/7/sys/dev/drm/r600_cp.c ============================================================================== --- stable/7/sys/dev/drm/r600_cp.c Fri Mar 20 05:42:27 2009 (r190128) +++ stable/7/sys/dev/drm/r600_cp.c Fri Mar 20 05:43:24 2009 (r190129) @@ -174,7 +174,6 @@ int r600_page_table_init(struct drm_devi if (entry->busaddr[i] == 0) { DRM_ERROR("unable to map PCIGART pages!\n"); r600_page_table_cleanup(dev, gart_info); - ret = -EINVAL; goto done; } #endif @@ -193,6 +192,7 @@ int r600_page_table_init(struct drm_devi entry_addr += ATI_PCIGART_PAGE_SIZE; } } + ret = 1; #ifdef __linux__ done: #endif @@ -2100,7 +2100,7 @@ int r600_do_init_cp(struct drm_device *d dev_priv->gart_info.addr, dev_priv->pcigart_offset); - if (r600_page_table_init(dev)) { + if (!r600_page_table_init(dev)) { DRM_ERROR("Failed to init GART table\n"); r600_do_cleanup_cp(dev); return -EINVAL; From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 05:44:31 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 8F9B9106566B; Fri, 20 Mar 2009 05:44:31 +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 6246E8FC1D; Fri, 20 Mar 2009 05:44:31 +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 n2K5iVJ3087564; Fri, 20 Mar 2009 05:44:31 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K5iV8F087563; Fri, 20 Mar 2009 05:44:31 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903200544.n2K5iV8F087563@svn.freebsd.org> From: Robert Noland Date: Fri, 20 Mar 2009 05:44:31 +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: r190130 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Fri, 20 Mar 2009 05:44:32 -0000 Author: rnoland Date: Fri Mar 20 05:44:31 2009 New Revision: 190130 URL: http://svn.freebsd.org/changeset/base/190130 Log: Merge 189910 Cast register maps and offsets to vm_offset_t Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drmP.h Modified: stable/7/sys/dev/drm/drmP.h ============================================================================== --- stable/7/sys/dev/drm/drmP.h Fri Mar 20 05:43:24 2009 (r190129) +++ stable/7/sys/dev/drm/drmP.h Fri Mar 20 05:44:31 2009 (r190130) @@ -240,17 +240,23 @@ typedef u_int8_t u8; #endif #define DRM_READ8(map, offset) \ - *(volatile u_int8_t *) (((unsigned long)(map)->handle) + (offset)) + *(volatile u_int8_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) #define DRM_READ16(map, offset) \ - *(volatile u_int16_t *) (((unsigned long)(map)->handle) + (offset)) + *(volatile u_int16_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) #define DRM_READ32(map, offset) \ - *(volatile u_int32_t *)(((unsigned long)(map)->handle) + (offset)) + *(volatile u_int32_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) #define DRM_WRITE8(map, offset, val) \ - *(volatile u_int8_t *) (((unsigned long)(map)->handle) + (offset)) = val + *(volatile u_int8_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) = val #define DRM_WRITE16(map, offset, val) \ - *(volatile u_int16_t *) (((unsigned long)(map)->handle) + (offset)) = val + *(volatile u_int16_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) = val #define DRM_WRITE32(map, offset, val) \ - *(volatile u_int32_t *)(((unsigned long)(map)->handle) + (offset)) = val + *(volatile u_int32_t *)(((vm_offset_t)(map)->handle) + \ + (vm_offset_t)(offset)) = val #define DRM_VERIFYAREA_READ( uaddr, size ) \ (!useracc(__DECONST(caddr_t, uaddr), size, VM_PROT_READ)) From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 05:45: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 6301C10656D2; Fri, 20 Mar 2009 05:45:28 +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 F1ED88FC1B; Fri, 20 Mar 2009 05:45:26 +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 n2K5jQqv087640; Fri, 20 Mar 2009 05:45:26 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K5jQLo087639; Fri, 20 Mar 2009 05:45:26 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903200545.n2K5jQLo087639@svn.freebsd.org> From: Robert Noland Date: Fri, 20 Mar 2009 05:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190131 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Fri, 20 Mar 2009 05:45:32 -0000 Author: rnoland Date: Fri Mar 20 05:45:26 2009 New Revision: 190131 URL: http://svn.freebsd.org/changeset/base/190131 Log: Merge 189911 We can have more than 3 pci resources Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drmP.h Modified: stable/7/sys/dev/drm/drmP.h ============================================================================== --- stable/7/sys/dev/drm/drmP.h Fri Mar 20 05:44:31 2009 (r190130) +++ stable/7/sys/dev/drm/drmP.h Fri Mar 20 05:45:26 2009 (r190131) @@ -613,7 +613,7 @@ struct drm_driver_info { }; /* Length for the array of resource pointers for drm_get_resource_*. */ -#define DRM_MAX_PCI_RESOURCE 3 +#define DRM_MAX_PCI_RESOURCE 6 /** * DRM device functions structure From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 05:46:26 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E9861065688; Fri, 20 Mar 2009 05:46:26 +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 2A19F8FC1C; Fri, 20 Mar 2009 05:46:26 +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 n2K5kQhG087704; Fri, 20 Mar 2009 05:46:26 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K5kQwK087703; Fri, 20 Mar 2009 05:46:26 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903200546.n2K5kQwK087703@svn.freebsd.org> From: Robert Noland Date: Fri, 20 Mar 2009 05:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190132 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Fri, 20 Mar 2009 05:46:27 -0000 Author: rnoland Date: Fri Mar 20 05:46:25 2009 New Revision: 190132 URL: http://svn.freebsd.org/changeset/base/190132 Log: Merge 189912 Minor code cleanup Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_bufs.c Modified: stable/7/sys/dev/drm/drm_bufs.c ============================================================================== --- stable/7/sys/dev/drm/drm_bufs.c Fri Mar 20 05:45:26 2009 (r190131) +++ stable/7/sys/dev/drm/drm_bufs.c Fri Mar 20 05:46:25 2009 (r190132) @@ -216,7 +216,7 @@ int drm_addmap(struct drm_device * dev, DRM_LOCK(); return EINVAL; } - map->offset = map->offset + dev->sg->handle; + map->offset += dev->sg->handle; break; case _DRM_CONSISTENT: /* Unfortunately, we don't get any alignment specification from From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 05:47: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 685D2106564A; Fri, 20 Mar 2009 05:47: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 55C6B8FC17; Fri, 20 Mar 2009 05:47: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 n2K5lnwf087799; Fri, 20 Mar 2009 05:47:49 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K5lnkE087798; Fri, 20 Mar 2009 05:47:49 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903200547.n2K5lnkE087798@svn.freebsd.org> From: Robert Noland Date: Fri, 20 Mar 2009 05:47: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: r190133 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Fri, 20 Mar 2009 05:47:50 -0000 Author: rnoland Date: Fri Mar 20 05:47:49 2009 New Revision: 190133 URL: http://svn.freebsd.org/changeset/base/190133 Log: Merge 189913 Add list_for_each_prev to our linux compatibility. We need this for nouveau Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_linux_list.h Modified: stable/7/sys/dev/drm/drm_linux_list.h ============================================================================== --- stable/7/sys/dev/drm/drm_linux_list.h Fri Mar 20 05:46:25 2009 (r190132) +++ stable/7/sys/dev/drm/drm_linux_list.h Fri Mar 20 05:47:49 2009 (r190133) @@ -67,6 +67,10 @@ list_del(struct list_head *entry) { #define list_for_each(entry, head) \ for (entry = (head)->next; entry != head; entry = (entry)->next) +#define list_for_each_prev(entry, head) \ + for (entry = (head)->prev; entry != (head); \ + entry = entry->prev) + #define list_for_each_safe(entry, temp, head) \ for (entry = (head)->next, temp = (entry)->next; \ entry != head; \ From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 05:50: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 AE8D11065670; Fri, 20 Mar 2009 05:50:42 +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 9BE608FC0A; Fri, 20 Mar 2009 05:50:42 +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 n2K5ogNR087908; Fri, 20 Mar 2009 05:50:42 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K5oggQ087907; Fri, 20 Mar 2009 05:50:42 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903200550.n2K5oggQ087907@svn.freebsd.org> From: Robert Noland Date: Fri, 20 Mar 2009 05:50: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: r190134 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Fri, 20 Mar 2009 05:50:43 -0000 Author: rnoland Date: Fri Mar 20 05:50:42 2009 New Revision: 190134 URL: http://svn.freebsd.org/changeset/base/190134 Log: Merge 189914,189916 Improve the debugging output of drm_mmap Cast to (unsigned long) to make printf happy on i386 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_vm.c Modified: stable/7/sys/dev/drm/drm_vm.c ============================================================================== --- stable/7/sys/dev/drm/drm_vm.c Fri Mar 20 05:47:49 2009 (r190133) +++ stable/7/sys/dev/drm/drm_vm.c Fri Mar 20 05:50:42 2009 (r190134) @@ -86,8 +86,14 @@ int drm_mmap(struct cdev *kdev, vm_offse } if (map == NULL) { + DRM_DEBUG("Can't find map, requested offset = %016lx\n", + (unsigned long)offset); + TAILQ_FOREACH(map, &dev->maplist, link) { + DRM_DEBUG("map offset = %016lx, handle = %016lx\n", + (unsigned long)map->offset, + (unsigned long)map->handle); + } DRM_UNLOCK(); - DRM_DEBUG("can't find map\n"); return -1; } if (((map->flags&_DRM_RESTRICTED) && !DRM_SUSER(DRM_CURPROC))) { From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 05:51: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 22106106564A; Fri, 20 Mar 2009 05:51:55 +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 0F40D8FC14; Fri, 20 Mar 2009 05:51:55 +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 n2K5psBc087975; Fri, 20 Mar 2009 05:51:54 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2K5ps4R087974; Fri, 20 Mar 2009 05:51:54 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903200551.n2K5ps4R087974@svn.freebsd.org> From: Robert Noland Date: Fri, 20 Mar 2009 05:51: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: r190135 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb 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: Fri, 20 Mar 2009 05:51:57 -0000 Author: rnoland Date: Fri Mar 20 05:51:54 2009 New Revision: 190135 URL: http://svn.freebsd.org/changeset/base/190135 Log: Merge 189915 Add support for matching solely on vendor id. We will use this method with nouveau Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_drv.c Modified: stable/7/sys/dev/drm/drm_drv.c ============================================================================== --- stable/7/sys/dev/drm/drm_drv.c Fri Mar 20 05:50:42 2009 (r190134) +++ stable/7/sys/dev/drm/drm_drv.c Fri Mar 20 05:51:54 2009 (r190135) @@ -182,7 +182,10 @@ int drm_probe(device_t kdev, drm_pci_id_ id_entry = drm_find_description(vendor, device, idlist); if (id_entry != NULL) { - device_set_desc(kdev, id_entry->name); + if (!device_get_desc(kdev)) { + DRM_DEBUG("desc : %s\n", device_get_desc(kdev)); + device_set_desc(kdev, id_entry->name); + } return 0; } @@ -290,7 +293,8 @@ drm_pci_id_list_t *drm_find_description( for (i = 0; idlist[i].vendor != 0; i++) { if ((idlist[i].vendor == vendor) && - (idlist[i].device == device)) { + ((idlist[i].device == device) || + (idlist[i].device == 0))) { return &idlist[i]; } } From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 13:46:31 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 EA0361065673; Fri, 20 Mar 2009 13:46:30 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCB3D8FC1D; Fri, 20 Mar 2009 13:46:30 +0000 (UTC) (envelope-from jamie@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 n2KDkUC6003970; Fri, 20 Mar 2009 13:46:30 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KDkUgJ003967; Fri, 20 Mar 2009 13:46:30 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200903201346.n2KDkUgJ003967@svn.freebsd.org> From: Jamie Gritton Date: Fri, 20 Mar 2009 13:46:30 +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: r190154 - stable/7/sbin/ifconfig X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Mar 2009 13:46:32 -0000 Author: jamie Date: Fri Mar 20 13:46:30 2009 New Revision: 190154 URL: http://svn.freebsd.org/changeset/base/190154 Log: Revert r189970 until its implications get sorted out in CURRENT. Approved by: bz(mentor) Modified: stable/7/sbin/ifconfig/ (props changed) stable/7/sbin/ifconfig/ifclone.c stable/7/sbin/ifconfig/ifconfig.c stable/7/sbin/ifconfig/ifgroup.c Modified: stable/7/sbin/ifconfig/ifclone.c ============================================================================== --- stable/7/sbin/ifconfig/ifclone.c Fri Mar 20 13:44:43 2009 (r190153) +++ stable/7/sbin/ifconfig/ifclone.c Fri Mar 20 13:46:30 2009 (r190154) @@ -53,9 +53,9 @@ list_cloners(void) int idx; int s; - s = socket(AF_LOCAL, SOCK_DGRAM, 0); + s = socket(AF_INET, SOCK_DGRAM, 0); if (s == -1) - err(1, "socket(AF_LOCAL,SOCK_DGRAM)"); + err(1, "socket(AF_INET,SOCK_DGRAM)"); memset(&ifcr, 0, sizeof(ifcr)); Modified: stable/7/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.c Fri Mar 20 13:44:43 2009 (r190153) +++ stable/7/sbin/ifconfig/ifconfig.c Fri Mar 20 13:46:30 2009 (r190154) @@ -434,22 +434,21 @@ static const struct cmd setifdstaddr_cmd DEF_CMD("ifdstaddr", 0, setifdstaddr); static int -ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp) +ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *afp) { - const struct afswtch *afp, *nafp; + const struct afswtch *nafp; struct callback *cb; int s; strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name); - afp = uafp != NULL ? uafp : af_getbyname("inet"); top: + if (afp == NULL) + afp = af_getbyname("inet"); ifr.ifr_addr.sa_family = afp->af_af == AF_LINK || afp->af_af == AF_UNSPEC ? - AF_LOCAL : afp->af_af; + AF_INET : afp->af_af; - if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0 && - (uafp != NULL || errno != EPROTONOSUPPORT || - (s = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0)) + if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0) err(1, "socket(family %u,SOCK_DGRAM", ifr.ifr_addr.sa_family); while (argc > 0) { @@ -793,12 +792,11 @@ status(const struct afswtch *afp, const if (afp == NULL) { allfamilies = 1; - ifr.ifr_addr.sa_family = AF_LOCAL; - } else { + afp = af_getbyname("inet"); + } else allfamilies = 0; - ifr.ifr_addr.sa_family = - afp->af_af == AF_LINK ? AF_LOCAL : afp->af_af; - } + + ifr.ifr_addr.sa_family = afp->af_af == AF_LINK ? AF_INET : afp->af_af; strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0); Modified: stable/7/sbin/ifconfig/ifgroup.c ============================================================================== --- stable/7/sbin/ifconfig/ifgroup.c Fri Mar 20 13:44:43 2009 (r190153) +++ stable/7/sbin/ifconfig/ifgroup.c Fri Mar 20 13:46:30 2009 (r190154) @@ -131,9 +131,9 @@ printgroup(const char *groupname) int len, cnt = 0; int s; - s = socket(AF_LOCAL, SOCK_DGRAM, 0); + s = socket(AF_INET, SOCK_DGRAM, 0); if (s == -1) - err(1, "socket(AF_LOCAL,SOCK_DGRAM)"); + err(1, "socket(AF_INET,SOCK_DGRAM)"); bzero(&ifgr, sizeof(ifgr)); strlcpy(ifgr.ifgr_name, groupname, sizeof(ifgr.ifgr_name)); if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) { From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 15:52:12 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 564DA1065672; Fri, 20 Mar 2009 15:52:12 +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 42FFB8FC15; Fri, 20 Mar 2009 15:52:12 +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 n2KFqCEY006888; Fri, 20 Mar 2009 15:52:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KFqCnw006887; Fri, 20 Mar 2009 15:52:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903201552.n2KFqCnw006887@svn.freebsd.org> From: John Baldwin Date: Fri, 20 Mar 2009 15:52:12 +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: r190159 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb nfsclient 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, 20 Mar 2009 15:52:13 -0000 Author: jhb Date: Fri Mar 20 15:52:11 2009 New Revision: 190159 URL: http://svn.freebsd.org/changeset/base/190159 Log: MFC: Add a new vfs.nfs.prime_access_cache sysctl to determine whether or not nfs_getattr() will use an ACCESS RPC to prime the access cache instead of a simple GETATTR RPC. The sysctl defaults to enabled to maintain the previous behavior. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/nfsclient/nfs_vnops.c Modified: stable/7/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/7/sys/nfsclient/nfs_vnops.c Fri Mar 20 14:32:51 2009 (r190158) +++ stable/7/sys/nfsclient/nfs_vnops.c Fri Mar 20 15:52:11 2009 (r190159) @@ -208,6 +208,11 @@ static int nfsaccess_cache_timeout = NFS SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW, &nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout"); +static int nfs_prime_access_cache = 1; +SYSCTL_INT(_vfs_nfs, OID_AUTO, prime_access_cache, CTLFLAG_RW, + &nfs_prime_access_cache, 0, + "Prime NFS ACCESS cache when fetching attributes"); + static int nfsv3_commit_on_close = 0; SYSCTL_INT(_vfs_nfs, OID_AUTO, nfsv3_commit_on_close, CTLFLAG_RW, &nfsv3_commit_on_close, 0, "write+commit on close, else only write"); @@ -643,7 +648,7 @@ nfs_getattr(struct vop_getattr_args *ap) */ if (nfs_getattrcache(vp, &vattr) == 0) goto nfsmout; - if (v3 && nfsaccess_cache_timeout > 0) { + if (v3 && nfs_prime_access_cache && nfsaccess_cache_timeout > 0) { nfsstats.accesscache_misses++; nfs3_access_otw(vp, NFSV3ACCESS_ALL, ap->a_td, ap->a_cred); if (nfs_getattrcache(vp, &vattr) == 0) From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 18:00: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 B7E911065690; Fri, 20 Mar 2009 18:00:19 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3A308FC2C; Fri, 20 Mar 2009 18:00:19 +0000 (UTC) (envelope-from csjp@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 n2KI0JfD009477; Fri, 20 Mar 2009 18:00:19 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KI0J0O009476; Fri, 20 Mar 2009 18:00:19 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200903201800.n2KI0J0O009476@svn.freebsd.org> From: "Christian S.J. Peron" Date: Fri, 20 Mar 2009 18:00:19 +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: r190165 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb net 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, 20 Mar 2009 18:00:21 -0000 Author: csjp Date: Fri Mar 20 18:00:19 2009 New Revision: 190165 URL: http://svn.freebsd.org/changeset/base/190165 Log: MFC r189490 - Mark bpf(4) stats sysctl as mpsafe. We do not require Giant here. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/net/bpf.c Modified: stable/7/sys/net/bpf.c ============================================================================== --- stable/7/sys/net/bpf.c Fri Mar 20 17:51:26 2009 (r190164) +++ stable/7/sys/net/bpf.c Fri Mar 20 18:00:19 2009 (r190165) @@ -129,7 +129,7 @@ SYSCTL_INT(_net_bpf, OID_AUTO, maxbufsiz static int bpf_maxinsns = BPF_MAXINSNS; SYSCTL_INT(_net_bpf, OID_AUTO, maxinsns, CTLFLAG_RW, &bpf_maxinsns, 0, "Maximum bpf program instructions"); -SYSCTL_NODE(_net_bpf, OID_AUTO, stats, CTLFLAG_RW, +SYSCTL_NODE(_net_bpf, OID_AUTO, stats, CTLFLAG_MPSAFE | CTLFLAG_RW, bpf_stats_sysctl, "bpf statistics portal"); static d_open_t bpfopen; From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 18:04: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 7BFC4106566B; Fri, 20 Mar 2009 18:04:20 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 684DC8FC0A; Fri, 20 Mar 2009 18:04:20 +0000 (UTC) (envelope-from csjp@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 n2KI4K41009652; Fri, 20 Mar 2009 18:04:20 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KI4KQS009651; Fri, 20 Mar 2009 18:04:20 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200903201804.n2KI4KQS009651@svn.freebsd.org> From: "Christian S.J. Peron" Date: Fri, 20 Mar 2009 18:04: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: r190167 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb security/mac_bsdextended 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, 20 Mar 2009 18:04:21 -0000 Author: csjp Date: Fri Mar 20 18:04:20 2009 New Revision: 190167 URL: http://svn.freebsd.org/changeset/base/190167 Log: MFC r189590 - Mark the mac_bsdextended rules sysctl as mpsafe. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/security/mac_bsdextended/mac_bsdextended.c Modified: stable/7/sys/security/mac_bsdextended/mac_bsdextended.c ============================================================================== --- stable/7/sys/security/mac_bsdextended/mac_bsdextended.c Fri Mar 20 18:01:32 2009 (r190166) +++ stable/7/sys/security/mac_bsdextended/mac_bsdextended.c Fri Mar 20 18:04:20 2009 (r190167) @@ -196,8 +196,8 @@ out: return (error); } -SYSCTL_NODE(_security_mac_bsdextended, OID_AUTO, rules, CTLFLAG_RW, - sysctl_rule, "BSD extended MAC rules"); +SYSCTL_NODE(_security_mac_bsdextended, OID_AUTO, rules, + CTLFLAG_MPSAFE | CTLFLAG_RW, sysctl_rule, "BSD extended MAC rules"); static void ugidfw_init(struct mac_policy_conf *mpc) From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 20:55:57 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76D4B106564A; Fri, 20 Mar 2009 20:55:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63CE68FC14; Fri, 20 Mar 2009 20:55:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KKtvCn013242; Fri, 20 Mar 2009 20:55:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KKtvZK013241; Fri, 20 Mar 2009 20:55:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200903202055.n2KKtvZK013241@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Mar 2009 20:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190175 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netgraph X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Mar 2009 20:55:58 -0000 Author: mav Date: Fri Mar 20 20:55:57 2009 New Revision: 190175 URL: http://svn.freebsd.org/changeset/base/190175 Log: MFC rev. 186093 To avoid one doubtless netgraph SMP scalability limitation point, switch node queues processing from single swi:net thread to several specialized threads. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netgraph/ng_base.c Modified: stable/7/sys/netgraph/ng_base.c ============================================================================== --- stable/7/sys/netgraph/ng_base.c Fri Mar 20 19:04:31 2009 (r190174) +++ stable/7/sys/netgraph/ng_base.c Fri Mar 20 20:55:57 2009 (r190175) @@ -61,10 +61,11 @@ #include #include #include +#include +#include +#include #include -#include - #include #include #include @@ -203,7 +204,7 @@ static int ng_generic_msg(node_p here, i static ng_ID_t ng_decodeidname(const char *name); static int ngb_mod_event(module_t mod, int event, void *data); static void ng_worklist_add(node_p node); -static void ngintr(void); +static void ngthread(void *); static int ng_apply_item(node_p node, item_p item, int rw); static void ng_flush_input_queue(struct ng_queue * ngq); static node_p ng_ID2noderef(ng_ID_t ID); @@ -251,6 +252,10 @@ MALLOC_DEFINE(M_NETGRAPH_MSG, "netgraph_ mtx_lock(&ng_worklist_mtx) #define NG_WORKLIST_UNLOCK() \ mtx_unlock(&ng_worklist_mtx) +#define NG_WORKLIST_SLEEP() \ + mtx_sleep(&ng_worklist, &ng_worklist_mtx, PI_NET, "sleep", 0) +#define NG_WORKLIST_WAKEUP() \ + wakeup_one(&ng_worklist) #ifdef NETGRAPH_DEBUG /*----------------------------------------------*/ /* @@ -2865,9 +2870,13 @@ out: uma_zone_t ng_qzone; uma_zone_t ng_qdzone; +static int numthreads = 0; /* number of queue threads */ static int maxalloc = 4096;/* limit the damage of a leak */ static int maxdata = 512; /* limit the damage of a DoS */ +TUNABLE_INT("net.graph.threads", &numthreads); +SYSCTL_INT(_net_graph, OID_AUTO, threads, CTLFLAG_RDTUN, &numthreads, + 0, "Number of queue processing threads to create"); TUNABLE_INT("net.graph.maxalloc", &maxalloc); SYSCTL_INT(_net_graph, OID_AUTO, maxalloc, CTLFLAG_RDTUN, &maxalloc, 0, "Maximum number of non-data queue items to allocate"); @@ -3061,7 +3070,7 @@ ng_mod_event(module_t mod, int event, vo static int ngb_mod_event(module_t mod, int event, void *data) { - int error = 0; + int i, error = 0; switch (event) { case MOD_LOAD: @@ -3087,8 +3096,17 @@ ngb_mod_event(module_t mod, int event, v ng_qdzone = uma_zcreate("NetGraph data items", sizeof(struct ng_item), NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); uma_zone_set_max(ng_qdzone, maxdata); - netisr_register(NETISR_NETGRAPH, (netisr_t *)ngintr, NULL, - NETISR_MPSAFE); + /* Autoconfigure number of threads. */ + if (numthreads <= 0) + numthreads = mp_ncpus; + /* Create threads. */ + for (i = 0; i < numthreads; i++) { + if (kthread_create(ngthread, NULL, NULL, + 0, 0, "ng_queue%d", i)) { + numthreads = i - 1; + break; + } + } break; case MOD_UNLOAD: /* You can't unload it because an interface may be using it. */ @@ -3243,25 +3261,20 @@ SYSCTL_PROC(_debug, OID_AUTO, ng_dump_it /*********************************************************************** * Worklist routines **********************************************************************/ -/* NETISR thread enters here */ /* * Pick a node off the list of nodes with work, - * try get an item to process off it. - * If there are no more, remove the node from the list. + * try get an item to process off it. Remove the node from the list. */ static void -ngintr(void) +ngthread(void *arg) { for (;;) { node_p node; /* Get node from the worklist. */ NG_WORKLIST_LOCK(); - node = TAILQ_FIRST(&ng_worklist); - if (!node) { - NG_WORKLIST_UNLOCK(); - break; - } + while ((node = TAILQ_FIRST(&ng_worklist)) == NULL) + NG_WORKLIST_SLEEP(); TAILQ_REMOVE(&ng_worklist, node, nd_work); NG_WORKLIST_UNLOCK(); CTR3(KTR_NET, "%20s: node [%x] (%p) taken off worklist", @@ -3317,9 +3330,9 @@ ng_worklist_add(node_p node) NG_WORKLIST_LOCK(); TAILQ_INSERT_TAIL(&ng_worklist, node, nd_work); NG_WORKLIST_UNLOCK(); - schednetisr(NETISR_NETGRAPH); CTR3(KTR_NET, "%20s: node [%x] (%p) put on worklist", __func__, node->nd_ID, node); + NG_WORKLIST_WAKEUP(); } else { CTR3(KTR_NET, "%20s: node [%x] (%p) already on worklist", __func__, node->nd_ID, node); From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 21:22: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 A67AC106566C; Fri, 20 Mar 2009 21:22:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9390F8FC14; Fri, 20 Mar 2009 21:22:14 +0000 (UTC) (envelope-from bz@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 n2KLMEF7013857; Fri, 20 Mar 2009 21:22:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KLMENg013852; Fri, 20 Mar 2009 21:22:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903202122.n2KLMENg013852@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 20 Mar 2009 21:22: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: r190177 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet netinet6 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, 20 Mar 2009 21:22:15 -0000 Author: bz Date: Fri Mar 20 21:22:14 2009 New Revision: 190177 URL: http://svn.freebsd.org/changeset/base/190177 Log: MFC r185344: Remove in6_pcbdetach() as it is exactly the same function as in_pcbdetach() and we don't need the code twice. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/tcp_usrreq.c stable/7/sys/netinet6/in6_pcb.c stable/7/sys/netinet6/in6_pcb.h stable/7/sys/netinet6/raw_ip6.c stable/7/sys/netinet6/udp6_usrreq.c Modified: stable/7/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/7/sys/netinet/tcp_usrreq.c Fri Mar 20 21:12:38 2009 (r190176) +++ stable/7/sys/netinet/tcp_usrreq.c Fri Mar 20 21:22:14 2009 (r190177) @@ -183,24 +183,15 @@ tcp_detach(struct socket *so, struct inp if (inp->inp_vflag & INP_DROPPED) { KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && " "INP_DROPPED && tp != NULL")); + in_pcbdetach(inp); #ifdef INET6 - if (isipv6) { - in6_pcbdetach(inp); + if (isipv6) in6_pcbfree(inp); - } else { + else #endif - in_pcbdetach(inp); in_pcbfree(inp); -#ifdef INET6 - } -#endif } else { -#ifdef INET6 - if (isipv6) - in6_pcbdetach(inp); - else -#endif - in_pcbdetach(inp); + in_pcbdetach(inp); INP_WUNLOCK(inp); } } else { @@ -216,23 +207,14 @@ tcp_detach(struct socket *so, struct inp if (inp->inp_vflag & INP_DROPPED || tp->t_state < TCPS_SYN_SENT) { tcp_discardcb(tp); + in_pcbdetach(inp); #ifdef INET6 - if (isipv6) { - in6_pcbdetach(inp); + if (isipv6) in6_pcbfree(inp); - } else { + else #endif - in_pcbdetach(inp); in_pcbfree(inp); -#ifdef INET6 - } -#endif } else { -#ifdef INET6 - if (isipv6) - in6_pcbdetach(inp); - else -#endif in_pcbdetach(inp); } } @@ -1481,17 +1463,13 @@ tcp_attach(struct socket *so) inp->inp_vflag |= INP_IPV4; tp = tcp_newtcpcb(inp); if (tp == NULL) { + in_pcbdetach(inp); #ifdef INET6 - if (isipv6) { - in6_pcbdetach(inp); + if (isipv6) in6_pcbfree(inp); - } else { + else #endif - in_pcbdetach(inp); in_pcbfree(inp); -#ifdef INET6 - } -#endif INP_INFO_WUNLOCK(&tcbinfo); return (ENOBUFS); } Modified: stable/7/sys/netinet6/in6_pcb.c ============================================================================== --- stable/7/sys/netinet6/in6_pcb.c Fri Mar 20 21:12:38 2009 (r190176) +++ stable/7/sys/netinet6/in6_pcb.c Fri Mar 20 21:22:14 2009 (r190177) @@ -413,16 +413,6 @@ in6_pcbdisconnect(struct inpcb *inp) } void -in6_pcbdetach(struct inpcb *inp) -{ - - KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__)); - - inp->inp_socket->so_pcb = NULL; - inp->inp_socket = NULL; -} - -void in6_pcbfree(struct inpcb *inp) { struct inpcbinfo *ipi = inp->inp_pcbinfo; Modified: stable/7/sys/netinet6/in6_pcb.h ============================================================================== --- stable/7/sys/netinet6/in6_pcb.h Fri Mar 20 21:12:38 2009 (r190176) +++ stable/7/sys/netinet6/in6_pcb.h Fri Mar 20 21:22:14 2009 (r190177) @@ -73,7 +73,6 @@ void in6_pcbpurgeif0 __P((struct inpcbin void in6_losing __P((struct inpcb *)); int in6_pcbbind __P((struct inpcb *, struct sockaddr *, struct ucred *)); int in6_pcbconnect __P((struct inpcb *, struct sockaddr *, struct ucred *)); -void in6_pcbdetach __P((struct inpcb *)); void in6_pcbdisconnect __P((struct inpcb *)); void in6_pcbfree __P((struct inpcb *)); int in6_pcbladdr __P((struct inpcb *, struct sockaddr *, Modified: stable/7/sys/netinet6/raw_ip6.c ============================================================================== --- stable/7/sys/netinet6/raw_ip6.c Fri Mar 20 21:12:38 2009 (r190176) +++ stable/7/sys/netinet6/raw_ip6.c Fri Mar 20 21:22:14 2009 (r190177) @@ -600,7 +600,7 @@ rip6_detach(struct socket *so) INP_INFO_WLOCK(&ripcbinfo); INP_WLOCK(inp); FREE(inp->in6p_icmp6filt, M_PCB); - in6_pcbdetach(inp); + in_pcbdetach(inp); in6_pcbfree(inp); INP_INFO_WUNLOCK(&ripcbinfo); } Modified: stable/7/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/7/sys/netinet6/udp6_usrreq.c Fri Mar 20 21:12:38 2009 (r190176) +++ stable/7/sys/netinet6/udp6_usrreq.c Fri Mar 20 21:22:14 2009 (r190177) @@ -889,7 +889,7 @@ udp6_detach(struct socket *so) INP_INFO_WLOCK(&udbinfo); INP_WLOCK(inp); - in6_pcbdetach(inp); + in_pcbdetach(inp); in6_pcbfree(inp); INP_INFO_WUNLOCK(&udbinfo); } From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 21:46: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 7CED8106564A; Fri, 20 Mar 2009 21:46:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69D278FC13; Fri, 20 Mar 2009 21:46:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KLkSmY014414; Fri, 20 Mar 2009 21:46:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KLkSbD014413; Fri, 20 Mar 2009 21:46:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200903202146.n2KLkSbD014413@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Mar 2009 21:46: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: r190178 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sound/pci/hda X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Mar 2009 21:46:29 -0000 Author: mav Date: Fri Mar 20 21:46:28 2009 New Revision: 190178 URL: http://svn.freebsd.org/changeset/base/190178 Log: MFC rev. 188510, 189876, 189879 s/succeded/succeeded/ in comments. Fix spelling in message. Remove CD input hack for ALC268 based Acer systems. Latest systems does not implement CD input in hardware, while unconditional showing it confuse users. Also it was made in the way that sometimes improper with present driver. Add patch for ALC268 based Acer TM5320 to make headphones jack sensing work. Default configuration defines two separate playback associations, which current driver unable to trace properly due to order they are defined and limited codec uniformity. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sound/pci/hda/hdac.c Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Fri Mar 20 21:22:14 2009 (r190177) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Fri Mar 20 21:46:28 2009 (r190178) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090131_0127" +#define HDA_DRV_TEST_REV "20090316_0130" SND_DECLARE_FILE("$FreeBSD$"); @@ -253,6 +253,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define ACER_A4715_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x0133) #define ACER_3681WXM_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x0110) #define ACER_T6292_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x011b) +#define ACER_T5320_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x011f) #define ACER_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0xffff) /* Asus */ @@ -2459,13 +2460,14 @@ hdac_widget_pin_getconfig(struct hdac_wi patch = "seq=15 device=Headphones"; break; } - } else if (id == HDA_CODEC_ALC268 && - HDA_DEV_MATCH(ACER_ALL_SUBVENDOR, sc->pci_subvendor)) { + } else if (id == HDA_CODEC_ALC268) { + if (sc->pci_subvendor == ACER_T5320_SUBVENDOR) { switch (nid) { - case 28: - patch = "device=CD conn=fixed"; + case 20: /* Headphones Jack */ + patch = "as=1 seq=15"; break; } + } } if (patch != NULL) @@ -4981,7 +4983,7 @@ hdac_audio_trace_as_out(struct hdac_devi /* Find next pin */ for (i = seq; i < 16 && ases[as].pins[i] == 0; i++) ; - /* Check if there is no any left. If so - we succeded. */ + /* Check if there is no any left. If so - we succeeded. */ if (i == 16) return (1); @@ -5027,7 +5029,7 @@ hdac_audio_trace_as_out(struct hdac_devi hdac_audio_trace_dac(devinfo, as, i, ases[as].pins[i], hpredir, min, res, 0); ases[as].dacs[i] = res; - /* We succeded, so call next. */ + /* We succeeded, so call next. */ if (hdac_audio_trace_as_out(devinfo, as, i + 1)) return (1); /* If next failed, we should retry with next min */ @@ -6002,7 +6004,7 @@ retry: if (res) { HDA_BOOTVERBOSE( device_printf(devinfo->codec->sc->dev, - "Association %d (%d) trace succeded\n", + "Association %d (%d) trace succeeded\n", j, as[j].index); ); } else { @@ -7907,9 +7909,9 @@ hdac_pcm_attach(device_t dev) device_printf(dev, "+--------------------------------------+\n"); hdac_dump_pcmchannels(pdevinfo); device_printf(dev, "\n"); - device_printf(dev, "+--------------------------------+\n"); - device_printf(dev, "| DUMPING Playback/Record Pathes |\n"); - device_printf(dev, "+--------------------------------+\n"); + device_printf(dev, "+-------------------------------+\n"); + device_printf(dev, "| DUMPING Playback/Record Paths |\n"); + device_printf(dev, "+-------------------------------+\n"); hdac_dump_dac(pdevinfo); hdac_dump_adc(pdevinfo); hdac_dump_mix(pdevinfo); From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 20 23:06: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 124351065675; Fri, 20 Mar 2009 23:06:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D2E78FC0C; Fri, 20 Mar 2009 23:06:17 +0000 (UTC) (envelope-from bz@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 n2KN6GxG016545; Fri, 20 Mar 2009 23:06:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KN6GWE016539; Fri, 20 Mar 2009 23:06:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903202306.n2KN6GWE016539@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 20 Mar 2009 23:06: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: r190190 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet netinet6 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, 20 Mar 2009 23:06:24 -0000 Author: bz Date: Fri Mar 20 23:06:16 2009 New Revision: 190190 URL: http://svn.freebsd.org/changeset/base/190190 Log: MFC r185366: Unify ipsec[46]_delete_pcbpolicy in ipsec_delete_pcbpolicy. Ignoring different names because of macros (in6pcb, in6p_sp) and inp vs. in6p variable name both functions were entirely identical. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/in_pcb.c stable/7/sys/netinet/sctp_pcb.c stable/7/sys/netinet6/in6_pcb.c stable/7/sys/netipsec/ipsec.c stable/7/sys/netipsec/ipsec.h stable/7/sys/netipsec/ipsec6.h Modified: stable/7/sys/netinet/in_pcb.c ============================================================================== --- stable/7/sys/netinet/in_pcb.c Fri Mar 20 22:17:27 2009 (r190189) +++ stable/7/sys/netinet/in_pcb.c Fri Mar 20 23:06:16 2009 (r190190) @@ -901,7 +901,7 @@ in_pcbfree(struct inpcb *inp) INP_WLOCK_ASSERT(inp); #ifdef IPSEC - ipsec4_delete_pcbpolicy(inp); + ipsec_delete_pcbpolicy(inp); #endif /* IPSEC */ inp->inp_gencnt = ++ipi->ipi_gencnt; in_pcbremlists(inp); Modified: stable/7/sys/netinet/sctp_pcb.c ============================================================================== --- stable/7/sys/netinet/sctp_pcb.c Fri Mar 20 22:17:27 2009 (r190189) +++ stable/7/sys/netinet/sctp_pcb.c Fri Mar 20 23:06:16 2009 (r190190) @@ -3449,7 +3449,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, cnt = 0; if (so) { #ifdef IPSEC - ipsec4_delete_pcbpolicy(ip_pcb); + ipsec_delete_pcbpolicy(ip_pcb); #endif /* IPSEC */ /* Unlocks not needed since the socket is gone now */ Modified: stable/7/sys/netinet6/in6_pcb.c ============================================================================== --- stable/7/sys/netinet6/in6_pcb.c Fri Mar 20 22:17:27 2009 (r190189) +++ stable/7/sys/netinet6/in6_pcb.c Fri Mar 20 23:06:16 2009 (r190190) @@ -424,7 +424,7 @@ in6_pcbfree(struct inpcb *inp) #ifdef IPSEC if (inp->in6p_sp != NULL) - ipsec6_delete_pcbpolicy(inp); + ipsec_delete_pcbpolicy(inp); #endif /* IPSEC */ inp->inp_gencnt = ++ipi->ipi_gencnt; in_pcbremlists(inp); Modified: stable/7/sys/netipsec/ipsec.c ============================================================================== --- stable/7/sys/netipsec/ipsec.c Fri Mar 20 22:17:27 2009 (r190189) +++ stable/7/sys/netipsec/ipsec.c Fri Mar 20 23:06:16 2009 (r190190) @@ -1151,7 +1151,7 @@ ipsec4_get_policy(inp, request, len, mp) /* delete policy in PCB */ int -ipsec4_delete_pcbpolicy(inp) +ipsec_delete_pcbpolicy(inp) struct inpcb *inp; { IPSEC_ASSERT(inp != NULL, ("null inp")); @@ -1241,27 +1241,6 @@ ipsec6_get_policy(in6p, request, len, mp return ipsec_get_policy(pcb_sp, mp); } - -int -ipsec6_delete_pcbpolicy(in6p) - struct in6pcb *in6p; -{ - IPSEC_ASSERT(in6p != NULL, ("null in6p")); - - if (in6p->in6p_sp == NULL) - return 0; - - if (in6p->in6p_sp->sp_in != NULL) - KEY_FREESP(&in6p->in6p_sp->sp_in); - - if (in6p->in6p_sp->sp_out != NULL) - KEY_FREESP(&in6p->in6p_sp->sp_out); - - ipsec_delpcbpolicy(in6p->in6p_sp); - in6p->in6p_sp = NULL; - - return 0; -} #endif /* Modified: stable/7/sys/netipsec/ipsec.h ============================================================================== --- stable/7/sys/netipsec/ipsec.h Fri Mar 20 22:17:27 2009 (r190189) +++ stable/7/sys/netipsec/ipsec.h Fri Mar 20 23:06:16 2009 (r190190) @@ -373,7 +373,7 @@ extern int ipsec4_set_policy __P((struct caddr_t request, size_t len, struct ucred *cred)); extern int ipsec4_get_policy __P((struct inpcb *inpcb, caddr_t request, size_t len, struct mbuf **mp)); -extern int ipsec4_delete_pcbpolicy __P((struct inpcb *)); +extern int ipsec_delete_pcbpolicy __P((struct inpcb *)); extern int ipsec4_in_reject __P((struct mbuf *, struct inpcb *)); struct secas; Modified: stable/7/sys/netipsec/ipsec6.h ============================================================================== --- stable/7/sys/netipsec/ipsec6.h Fri Mar 20 22:17:27 2009 (r190189) +++ stable/7/sys/netipsec/ipsec6.h Fri Mar 20 23:06:16 2009 (r190190) @@ -51,7 +51,6 @@ extern int ip6_esp_randpad; struct inpcb; -extern int ipsec6_delete_pcbpolicy __P((struct inpcb *)); extern int ipsec6_set_policy __P((struct inpcb *inp, int optname, caddr_t request, size_t len, struct ucred *cred)); extern int ipsec6_get_policy From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 11:18: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 D6C28106564A; Sat, 21 Mar 2009 11:18:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA4708FC22; Sat, 21 Mar 2009 11:18:59 +0000 (UTC) (envelope-from bz@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 n2LBIxZe034643; Sat, 21 Mar 2009 11:18:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LBIxtk034636; Sat, 21 Mar 2009 11:18:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903211118.n2LBIxtk034636@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 21 Mar 2009 11:18: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: r190197 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet netinet6 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 11:19:00 -0000 Author: bz Date: Sat Mar 21 11:18:59 2009 New Revision: 190197 URL: http://svn.freebsd.org/changeset/base/190197 Log: MFC r185370: Merge in6_pcbfree() into in_pcbfree() which after the previous IPsec change in r185366 (r185366 for stable/7) only differed in two additonal IPv6 lines. Rather than splattering conditional code everywhere add the v6 check centrally at this single place. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/in_pcb.c stable/7/sys/netinet/tcp_timewait.c stable/7/sys/netinet/tcp_usrreq.c stable/7/sys/netinet6/in6_pcb.c stable/7/sys/netinet6/in6_pcb.h stable/7/sys/netinet6/raw_ip6.c stable/7/sys/netinet6/udp6_usrreq.c Modified: stable/7/sys/netinet/in_pcb.c ============================================================================== --- stable/7/sys/netinet/in_pcb.c Sat Mar 21 10:10:33 2009 (r190196) +++ stable/7/sys/netinet/in_pcb.c Sat Mar 21 11:18:59 2009 (r190197) @@ -901,10 +901,17 @@ in_pcbfree(struct inpcb *inp) INP_WLOCK_ASSERT(inp); #ifdef IPSEC - ipsec_delete_pcbpolicy(inp); + if (inp->inp_sp != NULL) + ipsec_delete_pcbpolicy(inp); #endif /* IPSEC */ inp->inp_gencnt = ++ipi->ipi_gencnt; in_pcbremlists(inp); +#ifdef INET6 + if (inp->inp_vflag & INP_IPV6PROTO) { + ip6_freepcbopts(inp->in6p_outputopts); + ip6_freemoptions(inp->in6p_moptions); + } +#endif if (inp->inp_options) (void)m_free(inp->inp_options); if (inp->inp_moptions != NULL) Modified: stable/7/sys/netinet/tcp_timewait.c ============================================================================== --- stable/7/sys/netinet/tcp_timewait.c Sat Mar 21 10:10:33 2009 (r190196) +++ stable/7/sys/netinet/tcp_timewait.c Sat Mar 21 11:18:59 2009 (r190197) @@ -501,14 +501,8 @@ tcp_twclose(struct tcptw *tw, int reuse) */ INP_WUNLOCK(inp); } - } else { -#ifdef INET6 - if (inp->inp_vflag & INP_IPV6PROTO) - in6_pcbfree(inp); - else -#endif - in_pcbfree(inp); - } + } else + in_pcbfree(inp); tcpstat.tcps_closed++; crfree(tw->tw_cred); tw->tw_cred = NULL; Modified: stable/7/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/7/sys/netinet/tcp_usrreq.c Sat Mar 21 10:10:33 2009 (r190196) +++ stable/7/sys/netinet/tcp_usrreq.c Sat Mar 21 11:18:59 2009 (r190197) @@ -155,9 +155,6 @@ static void tcp_detach(struct socket *so, struct inpcb *inp) { struct tcpcb *tp; -#ifdef INET6 - int isipv6 = INP_CHECK_SOCKAF(so, AF_INET6) != 0; -#endif INP_INFO_WLOCK_ASSERT(&tcbinfo); INP_WLOCK_ASSERT(inp); @@ -184,12 +181,7 @@ tcp_detach(struct socket *so, struct inp KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && " "INP_DROPPED && tp != NULL")); in_pcbdetach(inp); -#ifdef INET6 - if (isipv6) - in6_pcbfree(inp); - else -#endif - in_pcbfree(inp); + in_pcbfree(inp); } else { in_pcbdetach(inp); INP_WUNLOCK(inp); @@ -208,15 +200,9 @@ tcp_detach(struct socket *so, struct inp tp->t_state < TCPS_SYN_SENT) { tcp_discardcb(tp); in_pcbdetach(inp); -#ifdef INET6 - if (isipv6) - in6_pcbfree(inp); - else -#endif - in_pcbfree(inp); - } else { - in_pcbdetach(inp); - } + in_pcbfree(inp); + } else + in_pcbdetach(inp); } } @@ -1464,12 +1450,7 @@ tcp_attach(struct socket *so) tp = tcp_newtcpcb(inp); if (tp == NULL) { in_pcbdetach(inp); -#ifdef INET6 - if (isipv6) - in6_pcbfree(inp); - else -#endif - in_pcbfree(inp); + in_pcbfree(inp); INP_INFO_WUNLOCK(&tcbinfo); return (ENOBUFS); } Modified: stable/7/sys/netinet6/in6_pcb.c ============================================================================== --- stable/7/sys/netinet6/in6_pcb.c Sat Mar 21 10:10:33 2009 (r190196) +++ stable/7/sys/netinet6/in6_pcb.c Sat Mar 21 11:18:59 2009 (r190197) @@ -101,12 +101,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef IPSEC -#include -#include -#include -#endif /* IPSEC */ - #include struct in6_addr zeroin6_addr; @@ -412,39 +406,6 @@ in6_pcbdisconnect(struct inpcb *inp) in_pcbrehash(inp); } -void -in6_pcbfree(struct inpcb *inp) -{ - struct inpcbinfo *ipi = inp->inp_pcbinfo; - - KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); - - INP_INFO_WLOCK_ASSERT(ipi); - INP_WLOCK_ASSERT(inp); - -#ifdef IPSEC - if (inp->in6p_sp != NULL) - ipsec_delete_pcbpolicy(inp); -#endif /* IPSEC */ - inp->inp_gencnt = ++ipi->ipi_gencnt; - in_pcbremlists(inp); - ip6_freepcbopts(inp->in6p_outputopts); - ip6_freemoptions(inp->in6p_moptions); - /* Check and free IPv4 related resources in case of mapped addr */ - if (inp->inp_options) - (void)m_free(inp->inp_options); - if (inp->inp_moptions != NULL) - inp_freemoptions(inp->inp_moptions); - inp->inp_vflag = 0; - crfree(inp->inp_cred); - -#ifdef MAC - mac_destroy_inpcb(inp); -#endif - INP_WUNLOCK(inp); - uma_zfree(ipi->ipi_zone, inp); -} - struct sockaddr * in6_sockaddr(in_port_t port, struct in6_addr *addr_p) { Modified: stable/7/sys/netinet6/in6_pcb.h ============================================================================== --- stable/7/sys/netinet6/in6_pcb.h Sat Mar 21 10:10:33 2009 (r190196) +++ stable/7/sys/netinet6/in6_pcb.h Sat Mar 21 11:18:59 2009 (r190197) @@ -74,7 +74,6 @@ void in6_losing __P((struct inpcb *)); int in6_pcbbind __P((struct inpcb *, struct sockaddr *, struct ucred *)); int in6_pcbconnect __P((struct inpcb *, struct sockaddr *, struct ucred *)); void in6_pcbdisconnect __P((struct inpcb *)); -void in6_pcbfree __P((struct inpcb *)); int in6_pcbladdr __P((struct inpcb *, struct sockaddr *, struct in6_addr **)); struct inpcb * Modified: stable/7/sys/netinet6/raw_ip6.c ============================================================================== --- stable/7/sys/netinet6/raw_ip6.c Sat Mar 21 10:10:33 2009 (r190196) +++ stable/7/sys/netinet6/raw_ip6.c Sat Mar 21 11:18:59 2009 (r190197) @@ -601,7 +601,7 @@ rip6_detach(struct socket *so) INP_WLOCK(inp); FREE(inp->in6p_icmp6filt, M_PCB); in_pcbdetach(inp); - in6_pcbfree(inp); + in_pcbfree(inp); INP_INFO_WUNLOCK(&ripcbinfo); } Modified: stable/7/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/7/sys/netinet6/udp6_usrreq.c Sat Mar 21 10:10:33 2009 (r190196) +++ stable/7/sys/netinet6/udp6_usrreq.c Sat Mar 21 11:18:59 2009 (r190197) @@ -890,7 +890,7 @@ udp6_detach(struct socket *so) INP_INFO_WLOCK(&udbinfo); INP_WLOCK(inp); in_pcbdetach(inp); - in6_pcbfree(inp); + in_pcbfree(inp); INP_INFO_WUNLOCK(&udbinfo); } From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 12:02:12 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 0DCBB10656CF; Sat, 21 Mar 2009 12:02:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC0FC8FC18; Sat, 21 Mar 2009 12:02:11 +0000 (UTC) (envelope-from bz@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 n2LC2Bji035476; Sat, 21 Mar 2009 12:02:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LC2BHe035474; Sat, 21 Mar 2009 12:02:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903211202.n2LC2BHe035474@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 21 Mar 2009 12:02: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: r190198 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 12:02:20 -0000 Author: bz Date: Sat Mar 21 12:02:11 2009 New Revision: 190198 URL: http://svn.freebsd.org/changeset/base/190198 Log: MFC r185371: Replace most INP_CHECK_SOCKAF() uses checking if it is an IPv6 socket by comparing a constant inp vflag. This is expected to help to reduce extra locking. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/tcp_output.c stable/7/sys/netinet/tcp_usrreq.c Modified: stable/7/sys/netinet/tcp_output.c ============================================================================== --- stable/7/sys/netinet/tcp_output.c Sat Mar 21 11:18:59 2009 (r190197) +++ stable/7/sys/netinet/tcp_output.c Sat Mar 21 12:02:11 2009 (r190198) @@ -1113,7 +1113,7 @@ timer: { ip->ip_len = m->m_pkthdr.len; #ifdef INET6 - if (INP_CHECK_SOCKAF(so, AF_INET6)) + if (tp->t_inpcb->inp_vflag & INP_IPV6PROTO) ip->ip_ttl = in6_selecthlim(tp->t_inpcb, NULL); #endif /* INET6 */ /* Modified: stable/7/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/7/sys/netinet/tcp_usrreq.c Sat Mar 21 11:18:59 2009 (r190197) +++ stable/7/sys/netinet/tcp_usrreq.c Sat Mar 21 12:02:11 2009 (r190198) @@ -1242,7 +1242,7 @@ tcp_ctloutput(struct socket *so, struct INP_WLOCK(inp); if (sopt->sopt_level != IPPROTO_TCP) { #ifdef INET6 - if (INP_CHECK_SOCKAF(so, AF_INET6)) { + if (inp->inp_vflag & INP_IPV6PROTO) { INP_WUNLOCK(inp); error = ip6_ctloutput(so, sopt); } else { @@ -1421,9 +1421,6 @@ tcp_attach(struct socket *so) struct tcpcb *tp; struct inpcb *inp; int error; -#ifdef INET6 - int isipv6 = INP_CHECK_SOCKAF(so, AF_INET6) != 0; -#endif if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) { error = soreserve(so, tcp_sendspace, tcp_recvspace); @@ -1440,7 +1437,7 @@ tcp_attach(struct socket *so) } inp = sotoinpcb(so); #ifdef INET6 - if (isipv6) { + if (inp->inp_vflag & INP_IPV6PROTO) { inp->inp_vflag |= INP_IPV6; inp->in6p_hops = -1; /* use kernel default */ } From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 12:53: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 511E11065674; Sat, 21 Mar 2009 12:53:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D2738FC1F; Sat, 21 Mar 2009 12:53:43 +0000 (UTC) (envelope-from bz@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 n2LCrhbX036481; Sat, 21 Mar 2009 12:53:43 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LCrgXX036468; Sat, 21 Mar 2009 12:53:42 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903211253.n2LCrgXX036468@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 21 Mar 2009 12:53: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: r190199 - in stable/7/sys: . contrib/pf dev/cxgb netinet netinet6 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: Sat, 21 Mar 2009 12:53:44 -0000 Author: bz Date: Sat Mar 21 12:53:42 2009 New Revision: 190199 URL: http://svn.freebsd.org/changeset/base/190199 Log: MFC r186141: Another step assimilating IPv[46] PCB code - directly use the inpcb names rather than the following IPv6 compat macros: in6pcb, in6p_sp, in6p_ip6_nxt, in6p_flowinfo, in6p_vflag, in6p_flags, in6p_socket, in6p_lport, in6p_fport, in6p_ppcb and sotoin6pcb(). Apart from removing duplicate code in netipsec, this is a pure whitespace, not a functional change. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/tcp_subr.c stable/7/sys/netinet/tcp_syncache.c stable/7/sys/netinet/tcp_usrreq.c stable/7/sys/netinet6/icmp6.c stable/7/sys/netinet6/in6_pcb.c stable/7/sys/netinet6/in6_pcb.h stable/7/sys/netinet6/in6_src.c stable/7/sys/netinet6/ip6_input.c stable/7/sys/netinet6/ip6_output.c stable/7/sys/netinet6/raw_ip6.c stable/7/sys/netinet6/udp6_usrreq.c stable/7/sys/netipsec/ipsec.c stable/7/sys/netipsec/key.c Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netinet/tcp_subr.c Sat Mar 21 12:53:42 2009 (r190199) @@ -341,7 +341,7 @@ tcpip_fillheaders(struct inpcb *inp, voi ip6 = (struct ip6_hdr *)ip_ptr; ip6->ip6_flow = (ip6->ip6_flow & ~IPV6_FLOWINFO_MASK) | - (inp->in6p_flowinfo & IPV6_FLOWINFO_MASK); + (inp->inp_flow & IPV6_FLOWINFO_MASK); ip6->ip6_vfc = (ip6->ip6_vfc & ~IPV6_VERSION_MASK) | (IPV6_VERSION & IPV6_VERSION_MASK); ip6->ip6_nxt = IPPROTO_TCP; Modified: stable/7/sys/netinet/tcp_syncache.c ============================================================================== --- stable/7/sys/netinet/tcp_syncache.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netinet/tcp_syncache.c Sat Mar 21 12:53:42 2009 (r190199) @@ -748,8 +748,8 @@ syncache_socket(struct syncache *sc, str goto abort; } /* Override flowlabel from in6_pcbconnect. */ - inp->in6p_flowinfo &= ~IPV6_FLOWLABEL_MASK; - inp->in6p_flowinfo |= sc->sc_flowlabel; + inp->inp_flow &= ~IPV6_FLOWLABEL_MASK; + inp->inp_flow |= sc->sc_flowlabel; } else #endif { @@ -1044,7 +1044,7 @@ _syncache_add(struct in_conninfo *inc, s #ifdef INET6 if ((inc->inc_flags & INC_ISIPV6) && - (inp->in6p_flags & IN6P_AUTOFLOWLABEL)) + (inp->inp_flags & IN6P_AUTOFLOWLABEL)) autoflowlabel = 1; #endif ip_ttl = inp->inp_ip_ttl; @@ -1693,7 +1693,7 @@ syncookie_lookup(struct in_conninfo *inc #ifdef INET6 if (inc->inc_flags & INC_ISIPV6) { - if (sotoinpcb(so)->in6p_flags & IN6P_AUTOFLOWLABEL) + if (sotoinpcb(so)->inp_flags & IN6P_AUTOFLOWLABEL) sc->sc_flowlabel = md5_buffer[1] & IPV6_FLOWLABEL_MASK; } else #endif Modified: stable/7/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/7/sys/netinet/tcp_usrreq.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netinet/tcp_usrreq.c Sat Mar 21 12:53:42 2009 (r190199) @@ -1145,9 +1145,9 @@ tcp6_connect(struct tcpcb *tp, struct so inp->in6p_faddr = sin6->sin6_addr; inp->inp_fport = sin6->sin6_port; /* update flowinfo - draft-itojun-ipv6-flowlabel-api-00 */ - inp->in6p_flowinfo &= ~IPV6_FLOWLABEL_MASK; - if (inp->in6p_flags & IN6P_AUTOFLOWLABEL) - inp->in6p_flowinfo |= + inp->inp_flow &= ~IPV6_FLOWLABEL_MASK; + if (inp->inp_flags & IN6P_AUTOFLOWLABEL) + inp->inp_flow |= (htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK); in_pcbrehash(inp); Modified: stable/7/sys/netinet6/icmp6.c ============================================================================== --- stable/7/sys/netinet6/icmp6.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netinet6/icmp6.c Sat Mar 21 12:53:42 2009 (r190199) @@ -1868,8 +1868,8 @@ icmp6_rip6_input(struct mbuf **mp, int o { struct mbuf *m = *mp; struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); - struct in6pcb *in6p; - struct in6pcb *last = NULL; + struct inpcb *in6p; + struct inpcb *last = NULL; struct sockaddr_in6 fromsa; struct icmp6_hdr *icmp6; struct mbuf *opts = NULL; @@ -1902,7 +1902,7 @@ icmp6_rip6_input(struct mbuf **mp, int o LIST_FOREACH(in6p, &ripcb, inp_list) { if ((in6p->inp_vflag & INP_IPV6) == 0) continue; - if (in6p->in6p_ip6_nxt != IPPROTO_ICMPV6) + if (in6p->inp_ip_p != IPPROTO_ICMPV6) continue; if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_laddr) && !IN6_ARE_ADDR_EQUAL(&in6p->in6p_laddr, &ip6->ip6_dst)) @@ -1952,13 +1952,13 @@ icmp6_rip6_input(struct mbuf **mp, int o } if (n != NULL || (n = m_copy(m, 0, (int)M_COPYALL)) != NULL) { - if (last->in6p_flags & IN6P_CONTROLOPTS) + if (last->inp_flags & IN6P_CONTROLOPTS) ip6_savecontrol(last, n, &opts); /* strip intermediate headers */ m_adj(n, off); - SOCKBUF_LOCK(&last->in6p_socket->so_rcv); + SOCKBUF_LOCK(&last->inp_socket->so_rcv); if (sbappendaddr_locked( - &last->in6p_socket->so_rcv, + &last->inp_socket->so_rcv, (struct sockaddr *)&fromsa, n, opts) == 0) { /* should notify about lost packet */ @@ -1967,9 +1967,9 @@ icmp6_rip6_input(struct mbuf **mp, int o m_freem(opts); } SOCKBUF_UNLOCK( - &last->in6p_socket->so_rcv); + &last->inp_socket->so_rcv); } else - sorwakeup_locked(last->in6p_socket); + sorwakeup_locked(last->inp_socket); opts = NULL; } INP_RUNLOCK(last); @@ -1978,7 +1978,7 @@ icmp6_rip6_input(struct mbuf **mp, int o } INP_INFO_RUNLOCK(&ripcbinfo); if (last) { - if (last->in6p_flags & IN6P_CONTROLOPTS) + if (last->inp_flags & IN6P_CONTROLOPTS) ip6_savecontrol(last, m, &opts); /* strip intermediate headers */ m_adj(m, off); @@ -2002,15 +2002,15 @@ icmp6_rip6_input(struct mbuf **mp, int o } } } - SOCKBUF_LOCK(&last->in6p_socket->so_rcv); - if (sbappendaddr_locked(&last->in6p_socket->so_rcv, + SOCKBUF_LOCK(&last->inp_socket->so_rcv); + if (sbappendaddr_locked(&last->inp_socket->so_rcv, (struct sockaddr *)&fromsa, m, opts) == 0) { m_freem(m); if (opts) m_freem(opts); - SOCKBUF_UNLOCK(&last->in6p_socket->so_rcv); + SOCKBUF_UNLOCK(&last->inp_socket->so_rcv); } else - sorwakeup_locked(last->in6p_socket); + sorwakeup_locked(last->inp_socket); INP_RUNLOCK(last); } else { m_freem(m); Modified: stable/7/sys/netinet6/in6_pcb.c ============================================================================== --- stable/7/sys/netinet6/in6_pcb.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netinet6/in6_pcb.c Sat Mar 21 12:53:42 2009 (r190199) @@ -382,9 +382,9 @@ in6_pcbconnect(register struct inpcb *in inp->in6p_faddr = sin6->sin6_addr; inp->inp_fport = sin6->sin6_port; /* update flowinfo - draft-itojun-ipv6-flowlabel-api-00 */ - inp->in6p_flowinfo &= ~IPV6_FLOWLABEL_MASK; - if (inp->in6p_flags & IN6P_AUTOFLOWLABEL) - inp->in6p_flowinfo |= + inp->inp_flow &= ~IPV6_FLOWLABEL_MASK; + if (inp->inp_flags & IN6P_AUTOFLOWLABEL) + inp->inp_flow |= (htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK); in_pcbrehash(inp); @@ -402,7 +402,7 @@ in6_pcbdisconnect(struct inpcb *inp) bzero((caddr_t)&inp->in6p_faddr, sizeof(inp->in6p_faddr)); inp->inp_fport = 0; /* clear flowinfo - draft-itojun-ipv6-flowlabel-api-00 */ - inp->in6p_flowinfo &= ~IPV6_FLOWLABEL_MASK; + inp->inp_flow &= ~IPV6_FLOWLABEL_MASK; in_pcbrehash(inp); } @@ -605,7 +605,7 @@ in6_pcbnotify(struct inpcbinfo *pcbinfo, */ if (lport == 0 && fport == 0 && flowinfo && inp->inp_socket != NULL && - flowinfo == (inp->in6p_flowinfo & IPV6_FLOWLABEL_MASK) && + flowinfo == (inp->inp_flow & IPV6_FLOWLABEL_MASK) && IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, &sa6_src.sin6_addr)) goto do_notify; else if (!IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, @@ -724,7 +724,7 @@ in6_pcblookup_local(struct inpcbinfo *pc void in6_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifnet *ifp) { - struct in6pcb *in6p; + struct inpcb *in6p; struct ip6_moptions *im6o; struct in6_multi_mship *imm, *nimm; Modified: stable/7/sys/netinet6/in6_pcb.h ============================================================================== --- stable/7/sys/netinet6/in6_pcb.h Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netinet6/in6_pcb.h Sat Mar 21 12:53:42 2009 (r190199) @@ -97,7 +97,7 @@ int in6_getpeeraddr __P((struct socket * int in6_getsockaddr __P((struct socket *so, struct sockaddr **nam)); int in6_mapped_sockaddr __P((struct socket *so, struct sockaddr **nam)); int in6_mapped_peeraddr __P((struct socket *so, struct sockaddr **nam)); -int in6_selecthlim __P((struct in6pcb *, struct ifnet *)); +int in6_selecthlim __P((struct inpcb *, struct ifnet *)); int in6_pcbsetport __P((struct in6_addr *, struct inpcb *, struct ucred *)); void init_sin6 __P((struct sockaddr_in6 *sin6, struct mbuf *m)); #endif /* _KERNEL */ Modified: stable/7/sys/netinet6/in6_src.c ============================================================================== --- stable/7/sys/netinet6/in6_src.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netinet6/in6_src.c Sat Mar 21 12:53:42 2009 (r190199) @@ -741,7 +741,7 @@ in6_selectroute(struct sockaddr_in6 *dst * 3. The system default hoplimit. */ int -in6_selecthlim(struct in6pcb *in6p, struct ifnet *ifp) +in6_selecthlim(struct inpcb *in6p, struct ifnet *ifp) { if (in6p && in6p->in6p_hops >= 0) Modified: stable/7/sys/netinet6/ip6_input.c ============================================================================== --- stable/7/sys/netinet6/ip6_input.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netinet6/ip6_input.c Sat Mar 21 12:53:42 2009 (r190199) @@ -1110,7 +1110,7 @@ ip6_savecontrol(struct inpcb *in6p, stru if (v4only) return; - if ((in6p->in6p_flags & IN6P_TCLASS) != 0) { + if ((in6p->inp_flags & IN6P_TCLASS) != 0) { u_int32_t flowinfo; int tclass; @@ -1131,7 +1131,7 @@ ip6_savecontrol(struct inpcb *in6p, stru * returned to normal user. * See also RFC 2292 section 6 (or RFC 3542 section 8). */ - if ((in6p->in6p_flags & IN6P_HOPOPTS) != 0) { + if ((in6p->inp_flags & IN6P_HOPOPTS) != 0) { /* * Check if a hop-by-hop options header is contatined in the * received packet, and if so, store the options as ancillary @@ -1183,7 +1183,7 @@ ip6_savecontrol(struct inpcb *in6p, stru } } - if ((in6p->in6p_flags & (IN6P_RTHDR | IN6P_DSTOPTS)) != 0) { + if ((in6p->inp_flags & (IN6P_RTHDR | IN6P_DSTOPTS)) != 0) { int nxt = ip6->ip6_nxt, off = sizeof(struct ip6_hdr); /* @@ -1244,7 +1244,7 @@ ip6_savecontrol(struct inpcb *in6p, stru switch (nxt) { case IPPROTO_DSTOPTS: - if (!(in6p->in6p_flags & IN6P_DSTOPTS)) + if (!(in6p->inp_flags & IN6P_DSTOPTS)) break; *mp = sbcreatecontrol((caddr_t)ip6e, elen, @@ -1255,7 +1255,7 @@ ip6_savecontrol(struct inpcb *in6p, stru mp = &(*mp)->m_next; break; case IPPROTO_ROUTING: - if (!in6p->in6p_flags & IN6P_RTHDR) + if (!in6p->inp_flags & IN6P_RTHDR) break; *mp = sbcreatecontrol((caddr_t)ip6e, elen, Modified: stable/7/sys/netinet6/ip6_output.c ============================================================================== --- stable/7/sys/netinet6/ip6_output.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netinet6/ip6_output.c Sat Mar 21 12:53:42 2009 (r190199) @@ -1458,7 +1458,7 @@ ip6_ctloutput(struct socket *so, struct else { /* -1 = kernel default */ in6p->in6p_hops = optval; - if ((in6p->in6p_vflag & + if ((in6p->inp_vflag & INP_IPV4) != 0) in6p->inp_ip_ttl = optval; } @@ -1466,19 +1466,19 @@ ip6_ctloutput(struct socket *so, struct #define OPTSET(bit) \ do { \ if (optval) \ - in6p->in6p_flags |= (bit); \ + in6p->inp_flags |= (bit); \ else \ - in6p->in6p_flags &= ~(bit); \ + in6p->inp_flags &= ~(bit); \ } while (/*CONSTCOND*/ 0) #define OPTSET2292(bit) \ do { \ - in6p->in6p_flags |= IN6P_RFC2292; \ + in6p->inp_flags |= IN6P_RFC2292; \ if (optval) \ - in6p->in6p_flags |= (bit); \ + in6p->inp_flags |= (bit); \ else \ - in6p->in6p_flags &= ~(bit); \ + in6p->inp_flags &= ~(bit); \ } while (/*CONSTCOND*/ 0) -#define OPTBIT(bit) (in6p->in6p_flags & (bit) ? 1 : 0) +#define OPTBIT(bit) (in6p->inp_flags & (bit) ? 1 : 0) case IPV6_RECVPKTINFO: /* cannot mix with RFC2292 */ @@ -1572,16 +1572,16 @@ do { \ * available only prior to bind(2). * see ipng mailing list, Jun 22 2001. */ - if (in6p->in6p_lport || + if (in6p->inp_lport || !IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_laddr)) { error = EINVAL; break; } OPTSET(IN6P_IPV6_V6ONLY); if (optval) - in6p->in6p_vflag &= ~INP_IPV4; + in6p->inp_vflag &= ~INP_IPV4; else - in6p->in6p_vflag |= INP_IPV4; + in6p->inp_vflag |= INP_IPV4; break; case IPV6_RECVTCLASS: /* cannot mix with RFC2292 XXX */ @@ -1762,18 +1762,18 @@ do { \ switch (optval) { case IPV6_PORTRANGE_DEFAULT: - in6p->in6p_flags &= ~(IN6P_LOWPORT); - in6p->in6p_flags &= ~(IN6P_HIGHPORT); + in6p->inp_flags &= ~(IN6P_LOWPORT); + in6p->inp_flags &= ~(IN6P_HIGHPORT); break; case IPV6_PORTRANGE_HIGH: - in6p->in6p_flags &= ~(IN6P_LOWPORT); - in6p->in6p_flags |= IN6P_HIGHPORT; + in6p->inp_flags &= ~(IN6P_LOWPORT); + in6p->inp_flags |= IN6P_HIGHPORT; break; case IPV6_PORTRANGE_LOW: - in6p->in6p_flags &= ~(IN6P_HIGHPORT); - in6p->in6p_flags |= IN6P_LOWPORT; + in6p->inp_flags &= ~(IN6P_HIGHPORT); + in6p->inp_flags |= IN6P_LOWPORT; break; default: @@ -1885,7 +1885,7 @@ do { \ case IPV6_PORTRANGE: { int flags; - flags = in6p->in6p_flags; + flags = in6p->inp_flags; if (flags & IN6P_HIGHPORT) optval = IPV6_PORTRANGE_HIGH; else if (flags & IN6P_LOWPORT) @@ -2044,7 +2044,7 @@ ip6_raw_ctloutput(struct socket *so, str { int error = 0, optval, optlen; const int icmp6off = offsetof(struct icmp6_hdr, icmp6_cksum); - struct in6pcb *in6p = sotoin6pcb(so); + struct inpcb *in6p = sotoinpcb(so); int level, op, optname; level = sopt->sopt_level; @@ -3315,7 +3315,7 @@ ip6_splithdr(struct mbuf *m, struct ip6_ * Compute IPv6 extension header length. */ int -ip6_optlen(struct in6pcb *in6p) +ip6_optlen(struct inpcb *in6p) { int len; Modified: stable/7/sys/netinet6/raw_ip6.c ============================================================================== --- stable/7/sys/netinet6/raw_ip6.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netinet6/raw_ip6.c Sat Mar 21 12:53:42 2009 (r190199) @@ -156,10 +156,10 @@ rip6_input(struct mbuf **mp, int *offp, INP_INFO_RLOCK(&ripcbinfo); LIST_FOREACH(in6p, &ripcb, inp_list) { /* XXX inp locking */ - if ((in6p->in6p_vflag & INP_IPV6) == 0) + if ((in6p->inp_vflag & INP_IPV6) == 0) continue; - if (in6p->in6p_ip6_nxt && - in6p->in6p_ip6_nxt != proto) + if (in6p->inp_ip_p && + in6p->inp_ip_p != proto) continue; if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_laddr) && !IN6_ARE_ADDR_EQUAL(&in6p->in6p_laddr, &ip6->ip6_dst)) @@ -193,12 +193,12 @@ rip6_input(struct mbuf **mp, int *offp, } else #endif /* IPSEC */ if (n) { - if (last->in6p_flags & IN6P_CONTROLOPTS || - last->in6p_socket->so_options & SO_TIMESTAMP) + if (last->inp_flags & IN6P_CONTROLOPTS || + last->inp_socket->so_options & SO_TIMESTAMP) ip6_savecontrol(last, n, &opts); /* strip intermediate headers */ m_adj(n, *offp); - if (sbappendaddr(&last->in6p_socket->so_rcv, + if (sbappendaddr(&last->inp_socket->so_rcv, (struct sockaddr *)&fromsa, n, opts) == 0) { m_freem(n); @@ -206,7 +206,7 @@ rip6_input(struct mbuf **mp, int *offp, m_freem(opts); rip6stat.rip6s_fullsock++; } else - sorwakeup(last->in6p_socket); + sorwakeup(last->inp_socket); opts = NULL; } INP_RUNLOCK(last); @@ -227,19 +227,19 @@ rip6_input(struct mbuf **mp, int *offp, } else #endif /* IPSEC */ if (last) { - if (last->in6p_flags & IN6P_CONTROLOPTS || - last->in6p_socket->so_options & SO_TIMESTAMP) + if (last->inp_flags & IN6P_CONTROLOPTS || + last->inp_socket->so_options & SO_TIMESTAMP) ip6_savecontrol(last, m, &opts); /* Strip intermediate headers. */ m_adj(m, *offp); - if (sbappendaddr(&last->in6p_socket->so_rcv, + if (sbappendaddr(&last->inp_socket->so_rcv, (struct sockaddr *)&fromsa, m, opts) == 0) { m_freem(m); if (opts) m_freem(opts); rip6stat.rip6s_fullsock++; } else - sorwakeup(last->in6p_socket); + sorwakeup(last->inp_socket); INP_RUNLOCK(last); } else { rip6stat.rip6s_nosock++; @@ -337,7 +337,7 @@ rip6_output(m, va_alist) control = va_arg(ap, struct mbuf *); va_end(ap); - in6p = sotoin6pcb(so); + in6p = sotoinpcb(so); INP_WLOCK(in6p); dst = &dstsock->sin6_addr; @@ -419,14 +419,14 @@ rip6_output(m, va_alist) * Fill in the rest of the IPv6 header fields. */ ip6->ip6_flow = (ip6->ip6_flow & ~IPV6_FLOWINFO_MASK) | - (in6p->in6p_flowinfo & IPV6_FLOWINFO_MASK); + (in6p->inp_flow & IPV6_FLOWINFO_MASK); ip6->ip6_vfc = (ip6->ip6_vfc & ~IPV6_VERSION_MASK) | (IPV6_VERSION & IPV6_VERSION_MASK); /* * ip6_plen will be filled in ip6_output, so not fill it here. */ - ip6->ip6_nxt = in6p->in6p_ip6_nxt; + ip6->ip6_nxt = in6p->inp_ip_p; ip6->ip6_hlim = in6_selecthlim(in6p, oifp); if (so->so_proto->pr_protocol == IPPROTO_ICMPV6 || @@ -577,7 +577,7 @@ rip6_attach(struct socket *so, int proto inp = (struct inpcb *)so->so_pcb; INP_INFO_WUNLOCK(&ripcbinfo); inp->inp_vflag |= INP_IPV6; - inp->in6p_ip6_nxt = (long)proto; + inp->inp_ip_p = (long)proto; inp->in6p_hops = -1; /* use kernel default */ inp->in6p_cksum = -1; inp->in6p_icmp6filt = filter; Modified: stable/7/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/7/sys/netinet6/udp6_usrreq.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netinet6/udp6_usrreq.c Sat Mar 21 12:53:42 2009 (r190199) @@ -147,7 +147,7 @@ udp6_append(struct inpcb *inp, struct mb } #endif opts = NULL; - if (inp->in6p_flags & IN6P_CONTROLOPTS || + if (inp->inp_flags & IN6P_CONTROLOPTS || inp->inp_socket->so_options & SO_TIMESTAMP) ip6_savecontrol(inp, n, &opts); m_adj(n, off + sizeof(struct udphdr)); @@ -251,7 +251,7 @@ udp6_input(struct mbuf **mp, int *offp, LIST_FOREACH(inp, &udb, inp_list) { if ((inp->inp_vflag & INP_IPV6) == 0) continue; - if (inp->in6p_lport != uh->uh_dport) + if (inp->inp_lport != uh->uh_dport) continue; /* * XXX: Do not check source port of incoming datagram @@ -270,7 +270,7 @@ udp6_input(struct mbuf **mp, int *offp, if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) { if (!IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, &ip6->ip6_src) || - inp->in6p_fport != uh->uh_sport) + inp->inp_fport != uh->uh_sport) continue; } @@ -549,7 +549,7 @@ udp6_output(struct inpcb *inp, struct mb fport = sin6->sin6_port; /* allow 0 port */ if (IN6_IS_ADDR_V4MAPPED(faddr)) { - if ((inp->in6p_flags & IN6P_IPV6_V6ONLY)) { + if ((inp->inp_flags & IN6P_IPV6_V6ONLY)) { /* * I believe we should explicitly discard the * packet when mapped addresses are disabled, @@ -593,7 +593,7 @@ udp6_output(struct inpcb *inp, struct mb error = EADDRNOTAVAIL; goto release; } - if (inp->in6p_lport == 0 && + if (inp->inp_lport == 0 && (error = in6_pcbsetport(laddr, inp, td->td_ucred)) != 0) goto release; } else { @@ -602,7 +602,7 @@ udp6_output(struct inpcb *inp, struct mb goto release; } if (IN6_IS_ADDR_V4MAPPED(&inp->in6p_faddr)) { - if ((inp->in6p_flags & IN6P_IPV6_V6ONLY)) { + if ((inp->inp_flags & IN6P_IPV6_V6ONLY)) { /* * XXX: this case would happen when the * application sets the V6ONLY flag after @@ -619,7 +619,7 @@ udp6_output(struct inpcb *inp, struct mb } laddr = &inp->in6p_laddr; faddr = &inp->in6p_faddr; - fport = inp->in6p_fport; + fport = inp->inp_fport; } if (af == AF_INET) @@ -639,7 +639,7 @@ udp6_output(struct inpcb *inp, struct mb * Stuff checksum and output datagram. */ udp6 = (struct udphdr *)(mtod(m, caddr_t) + hlen); - udp6->uh_sport = inp->in6p_lport; /* lport is always set in the PCB */ + udp6->uh_sport = inp->inp_lport; /* lport is always set in the PCB */ udp6->uh_dport = fport; if (plen <= 0xffff) udp6->uh_ulen = htons((u_short)plen); @@ -650,7 +650,7 @@ udp6_output(struct inpcb *inp, struct mb switch (af) { case AF_INET6: ip6 = mtod(m, struct ip6_hdr *); - ip6->ip6_flow = inp->in6p_flowinfo & IPV6_FLOWINFO_MASK; + ip6->ip6_flow = inp->inp_flow & IPV6_FLOWINFO_MASK; ip6->ip6_vfc &= ~IPV6_VERSION_MASK; ip6->ip6_vfc |= IPV6_VERSION; #if 0 /* ip6_plen will be filled in ip6_output. */ Modified: stable/7/sys/netipsec/ipsec.c ============================================================================== --- stable/7/sys/netipsec/ipsec.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netipsec/ipsec.c Sat Mar 21 12:53:42 2009 (r190199) @@ -207,7 +207,7 @@ SYSCTL_STRUCT(_net_inet6_ipsec6, IPSECCT static int ipsec4_setspidx_inpcb __P((struct mbuf *, struct inpcb *pcb)); #ifdef INET6 -static int ipsec6_setspidx_in6pcb __P((struct mbuf *, struct in6pcb *pcb)); +static int ipsec6_setspidx_in6pcb __P((struct mbuf *, struct inpcb *pcb)); #endif static int ipsec_setspidx __P((struct mbuf *, struct secpolicyindex *, int)); static void ipsec4_get_ulp __P((struct mbuf *m, struct secpolicyindex *, int)); @@ -315,7 +315,7 @@ ipsec_getpolicybysock(m, dir, inp, error if (inp->inp_vflag & INP_IPV6PROTO) { #ifdef INET6 *error = ipsec6_setspidx_in6pcb(m, inp); - pcbsp = inp->in6p_sp; + pcbsp = inp->inp_sp; #else *error = EINVAL; /* should not happen */ #endif @@ -515,26 +515,26 @@ ipsec4_setspidx_inpcb(m, pcb) static int ipsec6_setspidx_in6pcb(m, pcb) struct mbuf *m; - struct in6pcb *pcb; + struct inpcb *pcb; { struct secpolicyindex *spidx; int error; IPSEC_ASSERT(pcb != NULL, ("null pcb")); - IPSEC_ASSERT(pcb->in6p_sp != NULL, ("null inp_sp")); - IPSEC_ASSERT(pcb->in6p_sp->sp_out != NULL && pcb->in6p_sp->sp_in != NULL, + IPSEC_ASSERT(pcb->inp_sp != NULL, ("null inp_sp")); + IPSEC_ASSERT(pcb->inp_sp->sp_out != NULL && pcb->inp_sp->sp_in != NULL, ("null sp_in || sp_out")); - bzero(&pcb->in6p_sp->sp_in->spidx, sizeof(*spidx)); - bzero(&pcb->in6p_sp->sp_out->spidx, sizeof(*spidx)); + bzero(&pcb->inp_sp->sp_in->spidx, sizeof(*spidx)); + bzero(&pcb->inp_sp->sp_out->spidx, sizeof(*spidx)); - spidx = &pcb->in6p_sp->sp_in->spidx; + spidx = &pcb->inp_sp->sp_in->spidx; error = ipsec_setspidx(m, spidx, 1); if (error) goto bad; spidx->dir = IPSEC_DIR_INBOUND; - spidx = &pcb->in6p_sp->sp_out->spidx; + spidx = &pcb->inp_sp->sp_out->spidx; error = ipsec_setspidx(m, spidx, 1); if (error) goto bad; @@ -543,8 +543,8 @@ ipsec6_setspidx_in6pcb(m, pcb) return 0; bad: - bzero(&pcb->in6p_sp->sp_in->spidx, sizeof(*spidx)); - bzero(&pcb->in6p_sp->sp_out->spidx, sizeof(*spidx)); + bzero(&pcb->inp_sp->sp_in->spidx, sizeof(*spidx)); + bzero(&pcb->inp_sp->sp_out->spidx, sizeof(*spidx)); return error; } #endif @@ -1174,7 +1174,7 @@ ipsec_delete_pcbpolicy(inp) #ifdef INET6 int ipsec6_set_policy(in6p, optname, request, len, cred) - struct in6pcb *in6p; + struct inpcb *in6p; int optname; caddr_t request; size_t len; @@ -1193,10 +1193,10 @@ ipsec6_set_policy(in6p, optname, request /* select direction */ switch (xpl->sadb_x_policy_dir) { case IPSEC_DIR_INBOUND: - pcb_sp = &in6p->in6p_sp->sp_in; + pcb_sp = &in6p->inp_sp->sp_in; break; case IPSEC_DIR_OUTBOUND: - pcb_sp = &in6p->in6p_sp->sp_out; + pcb_sp = &in6p->inp_sp->sp_out; break; default: ipseclog((LOG_ERR, "%s: invalid direction=%u\n", __func__, @@ -1209,7 +1209,7 @@ ipsec6_set_policy(in6p, optname, request int ipsec6_get_policy(in6p, request, len, mp) - struct in6pcb *in6p; + struct inpcb *in6p; caddr_t request; size_t len; struct mbuf **mp; @@ -1220,7 +1220,7 @@ ipsec6_get_policy(in6p, request, len, mp /* sanity check. */ if (in6p == NULL || request == NULL || mp == NULL) return EINVAL; - IPSEC_ASSERT(in6p->in6p_sp != NULL, ("null in6p_sp")); + IPSEC_ASSERT(in6p->inp_sp != NULL, ("null inp_sp")); if (len < sizeof(*xpl)) return EINVAL; xpl = (struct sadb_x_policy *)request; @@ -1228,10 +1228,10 @@ ipsec6_get_policy(in6p, request, len, mp /* select direction */ switch (xpl->sadb_x_policy_dir) { case IPSEC_DIR_INBOUND: - pcb_sp = in6p->in6p_sp->sp_in; + pcb_sp = in6p->inp_sp->sp_in; break; case IPSEC_DIR_OUTBOUND: - pcb_sp = in6p->in6p_sp->sp_out; + pcb_sp = in6p->inp_sp->sp_out; break; default: ipseclog((LOG_ERR, "%s: invalid direction=%u\n", __func__, @@ -1603,14 +1603,14 @@ size_t ipsec6_hdrsiz(m, dir, in6p) struct mbuf *m; u_int dir; - struct in6pcb *in6p; + struct inpcb *in6p; { struct secpolicy *sp; int error; size_t size; IPSEC_ASSERT(m != NULL, ("null mbuf")); - IPSEC_ASSERT(in6p == NULL || in6p->in6p_socket != NULL, + IPSEC_ASSERT(in6p == NULL || in6p->inp_socket != NULL, ("socket w/o inpcb")); /* get SP for this packet */ Modified: stable/7/sys/netipsec/key.c ============================================================================== --- stable/7/sys/netipsec/key.c Sat Mar 21 12:02:11 2009 (r190198) +++ stable/7/sys/netipsec/key.c Sat Mar 21 12:53:42 2009 (r190199) @@ -1142,42 +1142,24 @@ key_freeso(struct socket *so) IPSEC_ASSERT(so != NULL, ("null so")); switch (so->so_proto->pr_domain->dom_family) { +#if defined(INET) || defined(INET6) #ifdef INET case PF_INET: - { - struct inpcb *pcb = sotoinpcb(so); - - /* Does it have a PCB ? */ - if (pcb == NULL) - return; - key_freesp_so(&pcb->inp_sp->sp_in); - key_freesp_so(&pcb->inp_sp->sp_out); - } - break; #endif #ifdef INET6 case PF_INET6: +#endif { -#ifdef HAVE_NRL_INPCB - struct inpcb *pcb = sotoinpcb(so); + struct inpcb *pcb = sotoinpcb(so); /* Does it have a PCB ? */ if (pcb == NULL) return; key_freesp_so(&pcb->inp_sp->sp_in); key_freesp_so(&pcb->inp_sp->sp_out); -#else - struct in6pcb *pcb = sotoin6pcb(so); - - /* Does it have a PCB ? */ - if (pcb == NULL) - return; - key_freesp_so(&pcb->in6p_sp->sp_in); - key_freesp_so(&pcb->in6p_sp->sp_out); -#endif } break; -#endif /* INET6 */ +#endif /* INET || INET6 */ default: ipseclog((LOG_DEBUG, "%s: unknown address family=%d.\n", __func__, so->so_proto->pr_domain->dom_family)); From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 13:37: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 B3AD2106566C; Sat, 21 Mar 2009 13:37:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0ED38FC08; Sat, 21 Mar 2009 13:37:49 +0000 (UTC) (envelope-from bz@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 n2LDbnAT037339; Sat, 21 Mar 2009 13:37:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LDbn8S037334; Sat, 21 Mar 2009 13:37:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200903211337.n2LDbn8S037334@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 21 Mar 2009 13:37: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: r190200 - in stable/7/sys: . contrib/pf dev/cxgb netinet netinet6 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 13:37:50 -0000 Author: bz Date: Sat Mar 21 13:37:49 2009 New Revision: 190200 URL: http://svn.freebsd.org/changeset/base/190200 Log: MFC r186223: Another step assimilating IPv[46] PCB code: normalize IN6P_* compat flags usage to their equialent INP_* counterpart. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/in_pcb.h stable/7/sys/netinet6/icmp6.c stable/7/sys/netinet6/ip6_output.c stable/7/sys/netinet6/raw_ip6.c stable/7/sys/netinet6/udp6_usrreq.c Modified: stable/7/sys/netinet/in_pcb.h ============================================================================== --- stable/7/sys/netinet/in_pcb.h Sat Mar 21 12:53:42 2009 (r190199) +++ stable/7/sys/netinet/in_pcb.h Sat Mar 21 13:37:49 2009 (r190200) @@ -466,7 +466,7 @@ void inp_4tuple_get(struct inpcb *inp, #define IN6P_RECVIF INP_RECVIF #define IN6P_MTUDISC INP_MTUDISC #define IN6P_FAITH INP_FAITH -#define IN6P_CONTROLOPTS INP_CONTROLOPTS +#define IN6P_CONTROLOPTS INP_CONTROLOPTS /* * socket AF version is {newer than,or include} * actual datagram AF version Modified: stable/7/sys/netinet6/icmp6.c ============================================================================== --- stable/7/sys/netinet6/icmp6.c Sat Mar 21 12:53:42 2009 (r190199) +++ stable/7/sys/netinet6/icmp6.c Sat Mar 21 13:37:49 2009 (r190200) @@ -1952,7 +1952,7 @@ icmp6_rip6_input(struct mbuf **mp, int o } if (n != NULL || (n = m_copy(m, 0, (int)M_COPYALL)) != NULL) { - if (last->inp_flags & IN6P_CONTROLOPTS) + if (last->inp_flags & INP_CONTROLOPTS) ip6_savecontrol(last, n, &opts); /* strip intermediate headers */ m_adj(n, off); @@ -1978,7 +1978,7 @@ icmp6_rip6_input(struct mbuf **mp, int o } INP_INFO_RUNLOCK(&ripcbinfo); if (last) { - if (last->inp_flags & IN6P_CONTROLOPTS) + if (last->inp_flags & INP_CONTROLOPTS) ip6_savecontrol(last, m, &opts); /* strip intermediate headers */ m_adj(m, off); Modified: stable/7/sys/netinet6/ip6_output.c ============================================================================== --- stable/7/sys/netinet6/ip6_output.c Sat Mar 21 12:53:42 2009 (r190199) +++ stable/7/sys/netinet6/ip6_output.c Sat Mar 21 13:37:49 2009 (r190200) @@ -1552,7 +1552,7 @@ do { \ break; case IPV6_FAITH: - OPTSET(IN6P_FAITH); + OPTSET(INP_FAITH); break; case IPV6_RECVPATHMTU: @@ -1762,18 +1762,18 @@ do { \ switch (optval) { case IPV6_PORTRANGE_DEFAULT: - in6p->inp_flags &= ~(IN6P_LOWPORT); - in6p->inp_flags &= ~(IN6P_HIGHPORT); + in6p->inp_flags &= ~(INP_LOWPORT); + in6p->inp_flags &= ~(INP_HIGHPORT); break; case IPV6_PORTRANGE_HIGH: - in6p->inp_flags &= ~(IN6P_LOWPORT); - in6p->inp_flags |= IN6P_HIGHPORT; + in6p->inp_flags &= ~(INP_LOWPORT); + in6p->inp_flags |= INP_HIGHPORT; break; case IPV6_PORTRANGE_LOW: - in6p->inp_flags &= ~(IN6P_HIGHPORT); - in6p->inp_flags |= IN6P_LOWPORT; + in6p->inp_flags &= ~(INP_HIGHPORT); + in6p->inp_flags |= INP_LOWPORT; break; default: @@ -1875,7 +1875,7 @@ do { \ break; case IPV6_FAITH: - optval = OPTBIT(IN6P_FAITH); + optval = OPTBIT(INP_FAITH); break; case IPV6_V6ONLY: @@ -1886,9 +1886,9 @@ do { \ { int flags; flags = in6p->inp_flags; - if (flags & IN6P_HIGHPORT) + if (flags & INP_HIGHPORT) optval = IPV6_PORTRANGE_HIGH; - else if (flags & IN6P_LOWPORT) + else if (flags & INP_LOWPORT) optval = IPV6_PORTRANGE_LOW; else optval = 0; Modified: stable/7/sys/netinet6/raw_ip6.c ============================================================================== --- stable/7/sys/netinet6/raw_ip6.c Sat Mar 21 12:53:42 2009 (r190199) +++ stable/7/sys/netinet6/raw_ip6.c Sat Mar 21 13:37:49 2009 (r190200) @@ -193,7 +193,7 @@ rip6_input(struct mbuf **mp, int *offp, } else #endif /* IPSEC */ if (n) { - if (last->inp_flags & IN6P_CONTROLOPTS || + if (last->inp_flags & INP_CONTROLOPTS || last->inp_socket->so_options & SO_TIMESTAMP) ip6_savecontrol(last, n, &opts); /* strip intermediate headers */ @@ -227,7 +227,7 @@ rip6_input(struct mbuf **mp, int *offp, } else #endif /* IPSEC */ if (last) { - if (last->inp_flags & IN6P_CONTROLOPTS || + if (last->inp_flags & INP_CONTROLOPTS || last->inp_socket->so_options & SO_TIMESTAMP) ip6_savecontrol(last, m, &opts); /* Strip intermediate headers. */ Modified: stable/7/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/7/sys/netinet6/udp6_usrreq.c Sat Mar 21 12:53:42 2009 (r190199) +++ stable/7/sys/netinet6/udp6_usrreq.c Sat Mar 21 13:37:49 2009 (r190200) @@ -147,7 +147,7 @@ udp6_append(struct inpcb *inp, struct mb } #endif opts = NULL; - if (inp->inp_flags & IN6P_CONTROLOPTS || + if (inp->inp_flags & INP_CONTROLOPTS || inp->inp_socket->so_options & SO_TIMESTAMP) ip6_savecontrol(inp, n, &opts); m_adj(n, off + sizeof(struct udphdr)); From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 15:35: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 04757106566B; Sat, 21 Mar 2009 15:35:11 +0000 (UTC) (envelope-from richardtector@thekeelecentre.com) Received: from mx0.thekeelecentre.com (mx0.thekeelecentre.com [IPv6:2001:470:1f09:16f:2::3]) by mx1.freebsd.org (Postfix) with ESMTP id 85D878FC17; Sat, 21 Mar 2009 15:35:10 +0000 (UTC) (envelope-from richardtector@thekeelecentre.com) Received: from localhost (filter.mx0.thekeelecentre.com [217.206.238.165]) by mx0.thekeelecentre.com (Postfix) with ESMTP id 7BC8D45176; Sat, 21 Mar 2009 15:35:09 +0000 (GMT) X-Virus-Scanned: amavisd-new at thekeelecentre.com Received: from mx0.thekeelecentre.com ([217.206.238.167]) by localhost (filter.mx0.thekeelecentre.com [217.206.238.165]) (amavisd-new, port 10024) with ESMTP id 9875WngrhmRh; Sat, 21 Mar 2009 15:35:08 +0000 (UTC) Received: from [10.0.2.11] (daffy.tector.org.uk [82.71.32.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx0.thekeelecentre.com (Postfix) with ESMTPSA id 6F92C45048; Sat, 21 Mar 2009 15:35:08 +0000 (GMT) Message-ID: <49C50926.4000906@thekeelecentre.com> Date: Sat, 21 Mar 2009 15:35:02 +0000 From: Richard Tector User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <200902071319.n17DJ8Wd092736@svn.freebsd.org> In-Reply-To: <200902071319.n17DJ8Wd092736@svn.freebsd.org> Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms020604000209070101030003" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r188281 - in stable/7: . etc etc/defaults etc/periodic/weekly lib/libc lib/libc/string lib/libc/sys lib/libkvm share/man/man4 sys sys/compat/freebsd32 sys/contrib/pf sys/dev/ath/ath_hal... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 15:35:11 -0000 This is a cryptographically signed message in MIME format. --------------ms020604000209070101030003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Feb 7 13:19:08 2009 > New Revision: 188281 > URL: http://svn.freebsd.org/changeset/base/188281 I think this commit may have broken isc-dhcp30-server built with DHCP_JAIL option: cc -O -pipe -D_PATH_DHCPD_CONF=\"/usr/local/etc/dhcpd.conf\" -D_PATH_DHCPD_DB=\"/var/db/dhcpd.leases\" -D_PATH_DHCPD_PID=\"/var/run/dhcpd.pid\" -D_PATH_DHCRELAY_PID=\"/var/run/dhcrelay.pid\" -D_PATH_DHCLIENT_CONF=\"/usr/local/etc/dhclient.conf\" -D_PATH_DHCLIENT_SCRIPT=\"/usr/local/sbin/dhclient-script\" -D_PATH_DHCLIENT_DB=\"/var/db/dhclient.leases\" -D_PATH_DHCLIENT_PID=\"/var/run/dhclient.pid\" -Dwarn=dhcp_warn -DNOMINUM -DPARANOIA -DJAIL -I/usr/ports/net/isc-dhcp30-server/work/dhcp-3.0.7 -I/usr/ports/net/isc-dhcp30-server/work/dhcp-3.0.7/includes -O -Wall -Wno-unused -c dhcpd.c dhcpd.c: In function 'setup_jail': dhcpd.c:234: error: 'struct jail' has no member named 'ip_number' *** Error code 1 Regards, Richard --------------ms020604000209070101030003 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIHPDCC A5owggMDoAMCAQICAQcwDQYJKoZIhvcNAQEEBQAwgYExCzAJBgNVBAYTAlVLMRYwFAYDVQQI Ew1TdGFmZm9yZHNoaXJlMQ4wDAYDVQQHEwVLZWVsZTEZMBcGA1UEChMQVGhlIEtlZWxlIENl bnRyZTEvMC0GA1UEAxMmVGhlIEtlZWxlIENlbnRyZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw HhcNMDYwOTI5MTQyNTM4WhcNMTAwOTI5MTQyNTM4WjCBijELMAkGA1UEBhMCVUsxFjAUBgNV BAgTDVN0YWZmb3Jkc2hpcmUxGTAXBgNVBAoTEFRoZSBLZWVsZSBDZW50cmUxFzAVBgNVBAMT DlJpY2hhcmQgVGVjdG9yMS8wLQYJKoZIhvcNAQkBFiByaWNoYXJkdGVjdG9yQHRoZWtlZWxl Y2VudHJlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxAE7t9Z0xg5iVOnqE2q7 UhaRoPrygXPXnZ4bHM8P2E4VKfpCP9tmU5rqP/zDwOKwUAFZsv1yHvzMj2d4S8nTP3eC75YY pztd1tiGIUyi2O1vtQuVrcogCC0Xe8TovubsjeosoEN6kujkTLhgWKj+/jDtb0ELiSwh7NnN CoStDvcCAwEAAaOCARUwggERMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wg R2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBR5NRc2TrF8Qfj9ZMKvq5m5Lh9IFTCB tgYDVR0jBIGuMIGrgBSNCaM0QC1N5Hiyb/MPAVd/ouQEEqGBh6SBhDCBgTELMAkGA1UEBhMC VUsxFjAUBgNVBAgTDVN0YWZmb3Jkc2hpcmUxDjAMBgNVBAcTBUtlZWxlMRkwFwYDVQQKExBU aGUgS2VlbGUgQ2VudHJlMS8wLQYDVQQDEyZUaGUgS2VlbGUgQ2VudHJlIENlcnRpZmljYXRl IEF1dGhvcml0eYIJAJZYbH4e6XXnMA0GCSqGSIb3DQEBBAUAA4GBABy7Pq1hPDwR2vUs9Jlh LHXE1xLe/COWwTjmZ95mnvsX6XL6eVEzuc0xE66Mf1pyFxDKXxTCBj+G/ialE9AYiXTJAAVJ uvhvkm/u1vXdlNlfQJDRnZKFxrZsIT03LIysq+Hb4qZDpQvgWUUyGib4Ze7pNXPp8HOtlTgB ICafws5LMIIDmjCCAwOgAwIBAgIBBzANBgkqhkiG9w0BAQQFADCBgTELMAkGA1UEBhMCVUsx FjAUBgNVBAgTDVN0YWZmb3Jkc2hpcmUxDjAMBgNVBAcTBUtlZWxlMRkwFwYDVQQKExBUaGUg S2VlbGUgQ2VudHJlMS8wLQYDVQQDEyZUaGUgS2VlbGUgQ2VudHJlIENlcnRpZmljYXRlIEF1 dGhvcml0eTAeFw0wNjA5MjkxNDI1MzhaFw0xMDA5MjkxNDI1MzhaMIGKMQswCQYDVQQGEwJV SzEWMBQGA1UECBMNU3RhZmZvcmRzaGlyZTEZMBcGA1UEChMQVGhlIEtlZWxlIENlbnRyZTEX MBUGA1UEAxMOUmljaGFyZCBUZWN0b3IxLzAtBgkqhkiG9w0BCQEWIHJpY2hhcmR0ZWN0b3JA dGhla2VlbGVjZW50cmUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEATu31nTG DmJU6eoTartSFpGg+vKBc9ednhsczw/YThUp+kI/22ZTmuo//MPA4rBQAVmy/XIe/MyPZ3hL ydM/d4LvlhinO13W2IYhTKLY7W+1C5WtyiAILRd7xOi+5uyN6iygQ3qS6ORMuGBYqP7+MO1v QQuJLCHs2c0KhK0O9wIDAQABo4IBFTCCAREwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYd T3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFHk1FzZOsXxB+P1kwq+r mbkuH0gVMIG2BgNVHSMEga4wgauAFI0JozRALU3keLJv8w8BV3+i5AQSoYGHpIGEMIGBMQsw CQYDVQQGEwJVSzEWMBQGA1UECBMNU3RhZmZvcmRzaGlyZTEOMAwGA1UEBxMFS2VlbGUxGTAX BgNVBAoTEFRoZSBLZWVsZSBDZW50cmUxLzAtBgNVBAMTJlRoZSBLZWVsZSBDZW50cmUgQ2Vy dGlmaWNhdGUgQXV0aG9yaXR5ggkAllhsfh7pdecwDQYJKoZIhvcNAQEEBQADgYEAHLs+rWE8 PBHa9Sz0mWEsdcTXEt78I5bBOOZn3mae+xfpcvp5UTO5zTETrox/WnIXEMpfFMIGP4b+JqUT 0BiJdMkABUm6+G+Sb+7W9d2U2V9AkNGdkoXGtmwhPTcsjKyr4dvipkOlC+BZRTIaJvhl7uk1 c+nwc62VOAEgJp/CzksxggMbMIIDFwIBATCBhzCBgTELMAkGA1UEBhMCVUsxFjAUBgNVBAgT DVN0YWZmb3Jkc2hpcmUxDjAMBgNVBAcTBUtlZWxlMRkwFwYDVQQKExBUaGUgS2VlbGUgQ2Vu dHJlMS8wLQYDVQQDEyZUaGUgS2VlbGUgQ2VudHJlIENlcnRpZmljYXRlIEF1dGhvcml0eQIB BzAJBgUrDgMCGgUAoIIB6TAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJ BTEPFw0wOTAzMjExNTM1MDJaMCMGCSqGSIb3DQEJBDEWBBTRMPzLc/WtnQH5fjuvO/8itMdv zjBSBgkqhkiG9w0BCQ8xRTBDMAoGCCqGSIb3DQMHMA4GCCqGSIb3DQMCAgIAgDANBggqhkiG 9w0DAgIBQDAHBgUrDgMCBzANBggqhkiG9w0DAgIBKDCBmAYJKwYBBAGCNxAEMYGKMIGHMIGB MQswCQYDVQQGEwJVSzEWMBQGA1UECBMNU3RhZmZvcmRzaGlyZTEOMAwGA1UEBxMFS2VlbGUx GTAXBgNVBAoTEFRoZSBLZWVsZSBDZW50cmUxLzAtBgNVBAMTJlRoZSBLZWVsZSBDZW50cmUg Q2VydGlmaWNhdGUgQXV0aG9yaXR5AgEHMIGaBgsqhkiG9w0BCRACCzGBiqCBhzCBgTELMAkG A1UEBhMCVUsxFjAUBgNVBAgTDVN0YWZmb3Jkc2hpcmUxDjAMBgNVBAcTBUtlZWxlMRkwFwYD VQQKExBUaGUgS2VlbGUgQ2VudHJlMS8wLQYDVQQDEyZUaGUgS2VlbGUgQ2VudHJlIENlcnRp ZmljYXRlIEF1dGhvcml0eQIBBzANBgkqhkiG9w0BAQEFAASBgAJhjP5aFnl5VlHScpYeGjFw ED0G5a+CC4Ssn5oBtr7qCjYBfzeZI5n6+kFADiSotZaJOrVxe5E//CZwQedYzU20TiFdoowV 2ULkrJV0jApwaB6NW265NMGPMyXrkw3qnRB9RJWbWXYHZyxorsrJUtuFqTUZ1L12YhbzvHpk wFloAAAAAAAA --------------ms020604000209070101030003-- From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 17:17: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 EC1D5106566B; Sat, 21 Mar 2009 17:17:22 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id A79AA8FC16; Sat, 21 Mar 2009 17:17:22 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from [IPv6:2001:7b8:3a7:0:79b0:cf5:9667:f4f7] (unknown [IPv6:2001:7b8:3a7:0:79b0:cf5:9667:f4f7]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id CC8805C42; Sat, 21 Mar 2009 18:17:21 +0100 (CET) Message-ID: <49C52124.5050707@andric.com> Date: Sat, 21 Mar 2009 18:17:24 +0100 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1b4pre) Gecko/20090319 Shredder/3.0b3pre MIME-Version: 1.0 To: Richard Tector References: <200902071319.n17DJ8Wd092736@svn.freebsd.org> <49C50926.4000906@thekeelecentre.com> In-Reply-To: <49C50926.4000906@thekeelecentre.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable-7@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r188281 - in stable/7: . etc etc/defaults etc/periodic/weekly lib/libc lib/libc/string lib/libc/sys lib/libkvm share/man/man4 sys sys/compat/freebsd32 sys/contrib/pf sys/dev/ath/ath_hal... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 17:17:23 -0000 On 2009-03-21 16:35, Richard Tector wrote: >> URL: http://svn.freebsd.org/changeset/base/188281 > > I think this commit may have broken isc-dhcp30-server built with > DHCP_JAIL option: This has been an issue for some time now, please see here for a possible patch: http://www.freebsd.org/cgi/query-pr.cgi?pr=131515 From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 17:25: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 8947A1065673; Sat, 21 Mar 2009 17:25:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 3AE988FC0A; Sat, 21 Mar 2009 17:25:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 6382241C6A7; Sat, 21 Mar 2009 18:25:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id XnPXVHnD6pH1; Sat, 21 Mar 2009 18:25:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 0A67741C690; Sat, 21 Mar 2009 18:25:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 731D84448E6; Sat, 21 Mar 2009 17:24:43 +0000 (UTC) Date: Sat, 21 Mar 2009 17:24:42 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Dimitry Andric In-Reply-To: <49C52124.5050707@andric.com> Message-ID: <20090321172213.M67075@maildrop.int.zabbadoz.net> References: <200902071319.n17DJ8Wd092736@svn.freebsd.org> <49C50926.4000906@thekeelecentre.com> <49C52124.5050707@andric.com> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, Richard Tector Subject: Re: svn commit: r188281 - in stable/7: . etc etc/defaults etc/periodic/weekly lib/libc lib/libc/string lib/libc/sys lib/libkvm share/man/man4 sys sys/compat/freebsd32 sys/contrib/pf sys/dev/ath/ath_hal... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 17:25:08 -0000 On Sat, 21 Mar 2009, Dimitry Andric wrote: > On 2009-03-21 16:35, Richard Tector wrote: >>> URL: http://svn.freebsd.org/changeset/base/188281 >> >> I think this commit may have broken isc-dhcp30-server built with >> DHCP_JAIL option: > > This has been an issue for some time now, please see here for a possible > patch: > > http://www.freebsd.org/cgi/query-pr.cgi?pr=131515 I'll follow-up there. The thread belongs there, not here. -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 21:12: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 4FB49106564A; Sat, 21 Mar 2009 21:12:17 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DBC78FC13; Sat, 21 Mar 2009 21:12:17 +0000 (UTC) (envelope-from rodrigc@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 n2LLCH0W047041; Sat, 21 Mar 2009 21:12:17 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LLCHOV047040; Sat, 21 Mar 2009 21:12:17 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200903212112.n2LLCHOV047040@svn.freebsd.org> From: Craig Rodrigues Date: Sat, 21 Mar 2009 21:12: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: r190216 - stable/7/etc/rc.d X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 21:12:18 -0000 Author: rodrigc Date: Sat Mar 21 21:12:16 2009 New Revision: 190216 URL: http://svn.freebsd.org/changeset/base/190216 Log: MFC r180318: Remove the $DUMPDIR variable. It's redundant and the rest of the script uses $dumpdir directly. Modified: stable/7/etc/rc.d/savecore Modified: stable/7/etc/rc.d/savecore ============================================================================== --- stable/7/etc/rc.d/savecore Sat Mar 21 20:44:46 2009 (r190215) +++ stable/7/etc/rc.d/savecore Sat Mar 21 21:12:16 2009 (r190216) @@ -17,11 +17,6 @@ stop_cmd=":" savecore_prestart() { - # ${DUMPDIR} should be a directory or a symbolic link - # to the crash directory if core dumps are to be saved. - # - DUMPDIR="${dumpdir:-/var/crash}" - # Quit if we have no dump device case ${dumpdev} in [Nn][Oo] | '') @@ -58,7 +53,7 @@ savecore_prestart() savecore_start() { echo "Checking for core dump on ${dumpdev}..." - savecore ${savecore_flags} ${DUMPDIR} ${dumpdev} + savecore ${savecore_flags} ${dumpdir} ${dumpdev} } load_rc_config $name From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 21:16: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 12C901065670; Sat, 21 Mar 2009 21:16:06 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F42248FC0C; Sat, 21 Mar 2009 21:16:05 +0000 (UTC) (envelope-from rodrigc@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 n2LLG5WM047160; Sat, 21 Mar 2009 21:16:05 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LLG589047158; Sat, 21 Mar 2009 21:16:05 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200903212116.n2LLG589047158@svn.freebsd.org> From: Craig Rodrigues Date: Sat, 21 Mar 2009 21:16: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: r190217 - in stable/7/etc: defaults rc.d X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 21:16:06 -0000 Author: rodrigc Date: Sat Mar 21 21:16:05 2009 New Revision: 190217 URL: http://svn.freebsd.org/changeset/base/190217 Log: MFC r182460: Add the ability to run /usr/sbin/crashinfo on a new core dump automatically during boot. Right now this is disabled by default, but it can be enabled by setting 'crashinfo_enable=YES' in rc.conf. Modified: stable/7/etc/defaults/rc.conf stable/7/etc/rc.d/savecore Modified: stable/7/etc/defaults/rc.conf ============================================================================== --- stable/7/etc/defaults/rc.conf Sat Mar 21 21:12:16 2009 (r190216) +++ stable/7/etc/defaults/rc.conf Sat Mar 21 21:16:05 2009 (r190217) @@ -542,6 +542,8 @@ chkprintcap_flags="-d" # Create missing dumpdev="AUTO" # Device to crashdump to (device name, AUTO, or NO). dumpdir="/var/crash" # Directory where crash dumps are to be stored savecore_flags="" # Used if dumpdev is enabled above, and present. +crashinfo_enable="NO" # Automatically generate crash dump summary. +crashinfo_program="/usr/sbin/crashinfo" # Script to generate crash dump summary. enable_quotas="NO" # turn on quotas on startup (or NO). check_quotas="YES" # Check quotas on startup (or NO). quotaon_flags="-a" # Turn quotas on for all file systems (if enabled) Modified: stable/7/etc/rc.d/savecore ============================================================================== --- stable/7/etc/rc.d/savecore Sat Mar 21 21:12:16 2009 (r190216) +++ stable/7/etc/rc.d/savecore Sat Mar 21 21:16:05 2009 (r190217) @@ -54,6 +54,9 @@ savecore_start() { echo "Checking for core dump on ${dumpdev}..." savecore ${savecore_flags} ${dumpdir} ${dumpdev} + if checkyesno crashinfo_enable; then + ${crashinfo_program} -d ${dumpdir} + fi } load_rc_config $name From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 22:20: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 608511065678; Sat, 21 Mar 2009 22:20:56 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DB918FC14; Sat, 21 Mar 2009 22:20:56 +0000 (UTC) (envelope-from dougb@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 n2LMKtWa048714; Sat, 21 Mar 2009 22:20:55 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LMKtP7048713; Sat, 21 Mar 2009 22:20:55 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200903212220.n2LMKtP7048713@svn.freebsd.org> From: Doug Barton Date: Sat, 21 Mar 2009 22:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190222 - stable/7/contrib/wpa_supplicant X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 22:20:57 -0000 Author: dougb Date: Sat Mar 21 22:20:55 2009 New Revision: 190222 URL: http://svn.freebsd.org/changeset/base/190222 Log: MFC r189902, clarify a few sections and add FreeBSD-specific notes Modified: stable/7/contrib/wpa_supplicant/ (props changed) stable/7/contrib/wpa_supplicant/wpa_supplicant.conf (contents, props changed) Modified: stable/7/contrib/wpa_supplicant/wpa_supplicant.conf ============================================================================== --- stable/7/contrib/wpa_supplicant/wpa_supplicant.conf Sat Mar 21 21:56:23 2009 (r190221) +++ stable/7/contrib/wpa_supplicant/wpa_supplicant.conf Sat Mar 21 22:20:55 2009 (r190222) @@ -1,5 +1,7 @@ ##### Example wpa_supplicant configuration file ############################### # +# ***** Please check wpa_supplicant.conf(5) for details on these options ***** +# # This file describes configuration file format and lists all available option. # Please also take a look at simpler configuration examples in 'examples' # subdirectory. @@ -59,19 +61,6 @@ # DIR=/var/run/wpa_supplicant GROUP=0 # (group can be either group name or gid) # -# For UDP connections (default on Windows): The value will be ignored. This -# variable is just used to select that the control interface is to be created. -# The value can be set to, e.g., udp (ctrl_interface=udp) -# -# For Windows Named Pipe: This value can be used to set the security descriptor -# for controlling access to the control interface. Security descriptor can be -# set using Security Descriptor String Format (see http://msdn.microsoft.com/ -# library/default.asp?url=/library/en-us/secauthz/security/ -# security_descriptor_string_format.asp). The descriptor string needs to be -# prefixed with SDDL=. For example, ctrl_interface=SDDL=D: would set an empty -# DACL (which will reject all connections). See README-Windows.txt for more -# information about SDDL string format. -# ctrl_interface=/var/run/wpa_supplicant # IEEE 802.1X/EAPOL version @@ -102,6 +91,8 @@ eapol_version=1 # the driver reports successful association; each network block should have # explicit security policy (i.e., only one option in the lists) for # key_mgmt, pairwise, group, proto variables +# +# For use in FreeBSD with the wlan module ap_scan must be set to 1. ap_scan=1 # EAP fast re-authentication @@ -165,7 +156,7 @@ fast_reauth=1 # scan_ssid: # 0 = do not scan this SSID with specific Probe Request frames (default) # 1 = scan with SSID-specific Probe Request frames (this can be used to -# find APs that do not accept broadcast SSID or use multiple SSIDs; +# find APs that hide (do not broadcast) SSID or use multiple SSIDs; # this will add latency to scanning, so enable this only when needed) # # bssid: BSSID (optional); if set, this network block is used only when @@ -181,7 +172,7 @@ fast_reauth=1 # policy, signal strength, etc. # Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not # using this priority to select the order for scanning. Instead, they try the -# networks in the order that used in the configuration file. +# networks in the order that they are listed in the configuration file. # # mode: IEEE 802.11 operation mode # 0 = infrastructure (Managed) mode, i.e., associate with an AP (default) From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 22:32: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 50E9F1065670; Sat, 21 Mar 2009 22:32:54 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D7B48FC0A; Sat, 21 Mar 2009 22:32:54 +0000 (UTC) (envelope-from dougb@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 n2LMWsBI049017; Sat, 21 Mar 2009 22:32:54 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LMWslJ049015; Sat, 21 Mar 2009 22:32:54 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200903212232.n2LMWslJ049015@svn.freebsd.org> From: Doug Barton Date: Sat, 21 Mar 2009 22:32: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: r190223 - stable/7/usr.sbin/mergemaster X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 22:32:54 -0000 Author: dougb Date: Sat Mar 21 22:32:53 2009 New Revision: 190223 URL: http://svn.freebsd.org/changeset/base/190223 Log: MFC r189761, r189763, r189992, r189994: 1. Fix creation and saving of the new mtree file with the -D option 2. Clean up usage() and man page so the options are all listed consistently 3. Add -F option 4. More man page cleanups for CVS -> VCS, punctuation, etc. Modified: stable/7/usr.sbin/mergemaster/ (props changed) stable/7/usr.sbin/mergemaster/mergemaster.8 stable/7/usr.sbin/mergemaster/mergemaster.sh Modified: stable/7/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- stable/7/usr.sbin/mergemaster/mergemaster.8 Sat Mar 21 22:20:55 2009 (r190222) +++ stable/7/usr.sbin/mergemaster/mergemaster.8 Sat Mar 21 22:32:53 2009 (r190223) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2009 +.Dd March 18, 2009 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -32,14 +32,14 @@ .Nd merge configuration files, et al during an upgrade .Sh SYNOPSIS .Nm -.Op Fl achiprsvCPU -.Op Fl A Ar Target architecture -.Op Fl D Ar /destdir/path +.Op Fl scrvahipFCPU .Op Fl m Ar /path/to/sources .Op Fl t Ar /path/to/temp/root .Op Fl d .Op Fl u Ar N .Op Fl w Ar N +.Op Fl A Ar Target architecture +.Op Fl D Ar /destdir/path .Sh DESCRIPTION The .Nm @@ -82,15 +82,23 @@ merge by hand later. By default it creates the temporary root in .Pa /var/tmp/temproot and compares the -.Xr cvs 1 -version $Id/$FreeBSD strings for files that have them, deleting +Version Control System (VCS) Id strings ($FreeBSD$) +for files that have them, deleting the temporary file if the strings match. If there is -no $Id string, or if the strings are different it +no Id string, or if the strings are different it compares the files themselves. You can -also specify that the script ignore the $Id strings and -compare every file. +also specify that the script ignore the Id strings and +compare every file with the +.Op Fl s +option. +Using the +.Op Fl F +option +.Nm +will install the new file for you if they differ only by +VCS strings. .Pp The merge menu option is designed to let you easily combine your customizations from the old version of a file into the new one. @@ -117,11 +125,13 @@ After installing an updated version of this file you should probably run .Xr pwd_mkdb 8 -with the -p option to rebuild your password databases +with the +.Op Fl p +option to rebuild your password databases and recreate .Pa /etc/passwd . .Pp -The script uses the owner and group id's +The script uses the owner and group ids that the files are created with by .Pa /usr/src/etc/Makefile , and file permissions as specified by the umask. @@ -158,9 +168,9 @@ and therefore can override both files. The options are as follows: .Bl -tag -width Fl .It Fl s -Perform a strict comparison, diff'ing every pair of files. +Perform a strict comparison, diffing every pair of files. This comparison is performed line by line, -without regard to CVS $Id's. +without regard to VCS Ids. .It Fl c Use context diffs instead of unified diffs. .It Fl r @@ -189,8 +199,11 @@ directory exists, it creates a new one i non-existent directory. This option unsets the verbose flag, but is compatible with all other options. -Setting -a makes --w superfluous. +Setting +.Op Fl a +makes +.Op Fl w +superfluous. .It Fl h Display usage and help information. .It Fl i @@ -202,6 +215,9 @@ Compares only files known to be essentia {build|install}world, including .Pa /etc/make.conf . +.It Fl F +If the files differ only by VCS Id ($FreeBSD$) +install the new file. .It Fl C After a standard .Nm @@ -213,6 +229,8 @@ Preserve files that you replace in or another directory you specify in your .Nm rc file. +.It Fl U +Attempt to auto upgrade files that have not been user modified. .It Fl m Ar /path/to/sources Specify the path to the directory where you want to do the .Xr make 1 . @@ -234,7 +252,9 @@ instead of the default .It Fl d Add the date and time to the name of the temporary root directory. -If -t is specified, this option must +If +.Op Fl t +is specified, this option must follow it if you want the date added too. .It Fl u Ar N Specify a numeric umask. @@ -250,8 +270,6 @@ Specify an alternative architecture name. .It Fl D Ar /path Specify the destination directory for the installed files. -.It Fl U -Attempt to auto upgrade files that have not been user modified. .El .Sh ENVIRONMENT The @@ -314,12 +332,15 @@ with all values commented out: # Specify the destination directory for the installed files #DESTDIR= # -# Strict comparison bypasses the CVS $Id tests and compares every file +# Strict comparison skips the VCS Id test and compares every file #STRICT=no # # Type of diff, such as unified, context, etc. #DIFF_FLAG='-u' # +# Install the new file if it differs only by VCS Id ($FreeBSD$) +#FREEBSD_ID= +# # Verbose mode includes more details and additional checks #VERBOSE= # @@ -345,7 +366,7 @@ with all values commented out: #IGNORE_FILES='/etc/motd /etc/printcap foo bar' # # Additional options for diff. This will get unset when using -s. -#DIFF_OPTIONS='-I$\&FreeBSD:.*[$]' # Ignores CVS Id tags +#DIFF_OPTIONS='-Bb' # Ignore changes in whitespace # # Location to store the list of mtree values for AUTO_UPGRADE purposes #MTREEDB='/var/db' @@ -382,7 +403,7 @@ Typically all you will need to do is typ .Nm at the prompt and the script will do all the work for you. .Pp -To use context diff's and have +To use context diffs and have .Nm explain more things as it goes along, use: .Pp @@ -401,7 +422,6 @@ comparison, use: .Pp .Dl # mergemaster -sw 110 .Sh SEE ALSO -.Xr cvs 1 , .Xr diff 1 , .Xr make 1 , .Xr more 1 , Modified: stable/7/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/7/usr.sbin/mergemaster/mergemaster.sh Sat Mar 21 22:20:55 2009 (r190222) +++ stable/7/usr.sbin/mergemaster/mergemaster.sh Sat Mar 21 22:32:53 2009 (r190223) @@ -15,8 +15,8 @@ PATH=/bin:/usr/bin:/usr/sbin display_usage () { VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4` echo "mergemaster version ${VERSION_NUMBER}" - echo 'Usage: mergemaster [-scrvahipCP] [-m /path]' - echo ' [-t /path] [-d] [-u N] [-w N] [-D /path]' + echo 'Usage: mergemaster [-scrvahipFCPU]' + echo ' [-m /path] [-t /path] [-d] [-u N] [-w N] [-A arch] [-D /path]' echo "Options:" echo " -s Strict comparison (diff every pair of files)" echo " -c Use context diff instead of unified diff" @@ -26,8 +26,11 @@ display_usage () { echo " -h Display more complete help" echo ' -i Automatically install files that do not exist in destination directory' echo ' -p Pre-buildworld mode, only compares crucial files' + echo ' -F Install files that differ only by revision control Id ($FreeBSD$)' echo ' -C Compare local rc.conf variables to the defaults' echo ' -P Preserve files that are overwritten' + echo " -U Attempt to auto upgrade files that have not been user modified" + echo '' echo " -m /path/directory Specify location of source to do the make in" echo " -t /path/directory Specify temp root directory" echo " -d Add date and time to directory name (e.g., /var/tmp/temproot.`date +%m%d.%H.%M`)" @@ -35,7 +38,6 @@ display_usage () { echo " -w N Specify a screen width in columns to sdiff" echo " -A architecture Alternative architecture name to pass to make" echo ' -D /path/directory Specify the destination directory to install files to' - echo " -U Attempt to auto upgrade files that have not been user modified." echo '' } @@ -263,11 +265,14 @@ MTREEFILE="${MTREEDB}/mergemaster.mtree" # Check the command line options # -while getopts ":ascrvhipCPm:t:du:w:D:A:U" COMMAND_LINE_ARGUMENT ; do +while getopts ":ascrvhipCPm:t:du:w:D:A:FU" COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in A) ARCHSTRING='TARGET_ARCH='${OPTARG} ;; + F) + FREEBSD_ID=yes + ;; U) AUTO_UPGRADE=yes ;; @@ -671,7 +676,7 @@ find ${TEMPROOT} -type f -size 0 -delete # Build the mtree database in a temporary location. MTREENEW=`mktemp -t mergemaster.mtree` case "${PRE_WORLD}" in -'') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${DESTDIR}${MTREENEW} 2>/dev/null +'') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null ;; *) # We don't want to mess with the mtree database on a pre-world run. ;; @@ -1020,6 +1025,19 @@ for COMPFILE in `find . -type f -size +0 # Use more if not. # Use unified diffs by default. Context diffs give me a headache. :) # + # If the user chose the -F option, test for that before proceeding + # + if [ -n "$FREEBSD_ID" ]; then + if diff -q -I'[$]FreeBSD:.*$' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \ + /dev/null 2>&1; then + if mm_install "${COMPFILE}"; then + echo "*** Updated revision control Id for ${DESTDIR}${COMPFILE#.}" + else + echo "*** Problem installing ${COMPFILE}, it will remain to merge by hand later" + fi + continue + fi + fi case "${AUTO_RUN}" in '') # prompt user to install/delete/merge changes @@ -1032,15 +1050,15 @@ for COMPFILE in `find . -type f -size +0 esac # Auto run test fi # Yes, the files are different fi # Yes, the file still remains to be checked -done # This is for the do way up there at the beginning of the comparison +done # This is for the for way up there at the beginning of the comparison echo '' echo "*** Comparison complete" -if [ -f "${DESTDIR}${MTREENEW}" ]; then +if [ -f "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" - test -e "${MTREEFILE}" && unlink ${MTREEFILE} - mv ${DESTDIR}${MTREENEW} ${DESTDIR}${MTREEFILE} + test -e "${DESTDIR}${MTREEFILE}" && unlink ${DESTDIR}${MTREEFILE} + mv ${MTREENEW} ${DESTDIR}${MTREEFILE} fi echo '' From owner-svn-src-stable-7@FreeBSD.ORG Sat Mar 21 23:03:57 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44CD21065689; Sat, 21 Mar 2009 23:03:57 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 318378FC1A; Sat, 21 Mar 2009 23:03:57 +0000 (UTC) (envelope-from dougb@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 n2LN3vm0049897; Sat, 21 Mar 2009 23:03:57 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2LN3uwV049894; Sat, 21 Mar 2009 23:03:56 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200903212303.n2LN3uwV049894@svn.freebsd.org> From: Doug Barton Date: Sat, 21 Mar 2009 23:03: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: r190228 - in stable/7/contrib/bind9: . lib/dns X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2009 23:03:58 -0000 Author: dougb Date: Sat Mar 21 23:03:56 2009 New Revision: 190228 URL: http://svn.freebsd.org/changeset/base/190228 Log: MFC the 9.4.3-P2 update Modified: stable/7/contrib/bind9/ (props changed) stable/7/contrib/bind9/CHANGES (contents, props changed) stable/7/contrib/bind9/lib/dns/validator.c (contents, props changed) stable/7/contrib/bind9/version (contents, props changed) Modified: stable/7/contrib/bind9/CHANGES ============================================================================== --- stable/7/contrib/bind9/CHANGES Sat Mar 21 23:00:40 2009 (r190227) +++ stable/7/contrib/bind9/CHANGES Sat Mar 21 23:03:56 2009 (r190228) @@ -1,3 +1,8 @@ + --- 9.4.3-P2 released --- + +2579. [bug] DNSSEC lookaside validation failed to handle unknown + algorithms. [RT #19479] + --- 9.4.3-P1 released --- 2522. [security] Handle -1 from DSA_do_verify(). Modified: stable/7/contrib/bind9/lib/dns/validator.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/validator.c Sat Mar 21 23:00:40 2009 (r190227) +++ stable/7/contrib/bind9/lib/dns/validator.c Sat Mar 21 23:03:56 2009 (r190228) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: validator.c,v 1.119.18.41 2008/08/21 04:59:42 marka Exp $ */ +/* $Id: validator.c,v 1.119.18.41.2.1 2009/03/17 02:23:49 marka Exp $ */ /*! \file */ @@ -211,6 +211,37 @@ exit_check(dns_validator_t *val) { return (ISC_TRUE); } +/* + * Check that we have atleast one supported algorithm in the DLV RRset. + */ +static inline isc_boolean_t +dlv_algorithm_supported(dns_validator_t *val) { + dns_rdata_t rdata = DNS_RDATA_INIT; + dns_rdata_dlv_t dlv; + isc_result_t result; + + for (result = dns_rdataset_first(&val->dlv); + result == ISC_R_SUCCESS; + result = dns_rdataset_next(&val->dlv)) { + dns_rdata_reset(&rdata); + dns_rdataset_current(&val->dlv, &rdata); + result = dns_rdata_tostruct(&rdata, &dlv, NULL); + RUNTIME_CHECK(result == ISC_R_SUCCESS); + + if (!dns_resolver_algorithm_supported(val->view->resolver, + val->event->name, + dlv.algorithm)) + continue; + + if (dlv.digest_type != DNS_DSDIGEST_SHA256 && + dlv.digest_type != DNS_DSDIGEST_SHA1) + continue; + + return (ISC_TRUE); + } + return (ISC_FALSE); +} + /*% * Look in the NSEC record returned from a DS query to see if there is * a NS RRset at this name. If it is found we are at a delegation point. @@ -2297,19 +2328,36 @@ dlvfetched(isc_task_t *task, isc_event_t sizeof(namebuf)); dns_rdataset_clone(&val->frdataset, &val->dlv); val->havedlvsep = ISC_TRUE; - validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", namebuf); - dlv_validator_start(val); + if (dlv_algorithm_supported(val)) { + validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", + namebuf); + dlv_validator_start(val); + } else { + validator_log(val, ISC_LOG_DEBUG(3), + "DLV %s found with no supported algorithms", + namebuf); + markanswer(val); + validator_done(val, ISC_R_SUCCESS); + } } else if (eresult == DNS_R_NXRRSET || eresult == DNS_R_NXDOMAIN || eresult == DNS_R_NCACHENXRRSET || eresult == DNS_R_NCACHENXDOMAIN) { - result = finddlvsep(val, ISC_TRUE); + result = finddlvsep(val, ISC_TRUE); if (result == ISC_R_SUCCESS) { - dns_name_format(dns_fixedname_name(&val->dlvsep), - namebuf, sizeof(namebuf)); - validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", - namebuf); - dlv_validator_start(val); + if (dlv_algorithm_supported(val)) { + dns_name_format(dns_fixedname_name(&val->dlvsep), + namebuf, sizeof(namebuf)); + validator_log(val, ISC_LOG_DEBUG(3), + "DLV %s found", namebuf); + dlv_validator_start(val); + } else { + validator_log(val, ISC_LOG_DEBUG(3), + "DLV %s found with no supported " + "algorithms", namebuf); + markanswer(val); + validator_done(val, ISC_R_SUCCESS); + } } else if (result == ISC_R_NOTFOUND) { validator_log(val, ISC_LOG_DEBUG(3), "DLV not found"); markanswer(val); @@ -2372,9 +2420,16 @@ startfinddlvsep(dns_validator_t *val, dn } dns_name_format(dns_fixedname_name(&val->dlvsep), namebuf, sizeof(namebuf)); - validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", namebuf); - dlv_validator_start(val); - return (DNS_R_WAIT); + if (dlv_algorithm_supported(val)) { + validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", namebuf); + dlv_validator_start(val); + return (DNS_R_WAIT); + } + validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found with no supported " + "algorithms", namebuf); + markanswer(val); + validator_done(val, ISC_R_SUCCESS); + return (ISC_R_SUCCESS); } /*% Modified: stable/7/contrib/bind9/version ============================================================================== --- stable/7/contrib/bind9/version Sat Mar 21 23:00:40 2009 (r190227) +++ stable/7/contrib/bind9/version Sat Mar 21 23:03:56 2009 (r190228) @@ -1,4 +1,4 @@ -# $Id: version,v 1.29.134.23.2.1 2008/12/24 00:21:22 marka Exp $ +# $Id: version,v 1.29.134.23.2.2 2009/03/17 02:23:49 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=4 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=1 +RELEASEVER=2