From owner-svn-src-all@FreeBSD.ORG Sun May 19 00:53:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6F83A7DE; Sun, 19 May 2013 00:53:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6104ABF8; Sun, 19 May 2013 00:53:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4J0r73L009878; Sun, 19 May 2013 00:53:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4J0r7jS009877; Sun, 19 May 2013 00:53:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305190053.r4J0r7jS009877@svn.freebsd.org> From: Adrian Chadd Date: Sun, 19 May 2013 00:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250795 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 00:53:07 -0000 Author: adrian Date: Sun May 19 00:53:06 2013 New Revision: 250795 URL: http://svnweb.freebsd.org/changeset/base/250795 Log: Since we're now using the ah pointer, always declare it. This fixes non-DEBUG builds. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun May 19 00:04:24 2013 (r250794) +++ head/sys/dev/ath/if_ath.c Sun May 19 00:53:06 2013 (r250795) @@ -4709,9 +4709,7 @@ ath_tx_dump(struct ath_softc *sc, struct void ath_legacy_tx_drain(struct ath_softc *sc, ATH_RESET_TYPE reset_type) { -#ifdef ATH_DEBUG struct ath_hal *ah = sc->sc_ah; -#endif struct ifnet *ifp = sc->sc_ifp; int i; struct ath_buf *bf_last; From owner-svn-src-all@FreeBSD.ORG Sun May 19 01:33:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC246FDA; Sun, 19 May 2013 01:33:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD90BD29; Sun, 19 May 2013 01:33:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4J1XHwg024565; Sun, 19 May 2013 01:33:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4J1XH0J024564; Sun, 19 May 2013 01:33:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305190133.r4J1XH0J024564@svn.freebsd.org> From: Adrian Chadd Date: Sun, 19 May 2013 01:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250796 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 01:33:18 -0000 Author: adrian Date: Sun May 19 01:33:17 2013 New Revision: 250796 URL: http://svnweb.freebsd.org/changeset/base/250796 Log: More non-ATH_DEBUG build fixes. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sun May 19 00:53:06 2013 (r250795) +++ head/sys/dev/ath/if_ath_tx.c Sun May 19 01:33:17 2013 (r250796) @@ -929,7 +929,6 @@ ath_tx_handoff_hw(struct ath_softc *sc, static void ath_legacy_tx_dma_restart(struct ath_softc *sc, struct ath_txq *txq) { - struct ath_hal *ah = sc->sc_ah; struct ath_buf *bf, *bf_last; ATH_TXQ_LOCK_ASSERT(txq); @@ -949,8 +948,10 @@ ath_legacy_tx_dma_restart(struct ath_sof bf_last, (uint32_t) bf->bf_daddr); +#ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RESET) ath_tx_dump(sc, txq); +#endif /* * This is called from a restart, so DMA is known to be @@ -964,8 +965,9 @@ ath_legacy_tx_dma_restart(struct ath_sof ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, bf->bf_daddr); txq->axq_flags |= ATH_TXQ_PUTRUNNING; - ath_hal_gettxdesclinkptr(ah, bf_last->bf_lastds, &txq->axq_link); - ath_hal_txstart(ah, txq->axq_qnum); + ath_hal_gettxdesclinkptr(sc->sc_ah, bf_last->bf_lastds, + &txq->axq_link); + ath_hal_txstart(sc->sc_ah, txq->axq_qnum); } /* From owner-svn-src-all@FreeBSD.ORG Sun May 19 01:45:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 822655F8; Sun, 19 May 2013 01:45:30 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 728E8D9C; Sun, 19 May 2013 01:45:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4J1jU5t028548; Sun, 19 May 2013 01:45:30 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4J1jU21028547; Sun, 19 May 2013 01:45:30 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201305190145.r4J1jU21028547@svn.freebsd.org> From: Sean Bruno Date: Sun, 19 May 2013 01:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250797 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 01:45:30 -0000 Author: sbruno Date: Sun May 19 01:45:29 2013 New Revision: 250797 URL: http://svnweb.freebsd.org/changeset/base/250797 Log: Update snd quirks for T520, T420, X220. Group onboard mic and headphone mic jack together. Creates association that will switch between microphone inputs depending on the state of the headphone jack being connected to a live mic. Fixes onboard mic not working at all on T520. Tested on T520, T420. Suspect X220 needs this too, untested on. MFC after: 1 month Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Sun May 19 01:33:17 2013 (r250796) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Sun May 19 01:45:29 2013 (r250797) @@ -347,6 +347,16 @@ hdac_pin_patch(struct hdaa_widget *w) case 25: patch = "as=1 seq=15"; break; + /* + * Group onboard mic and headphone mic + * together. Fixes onboard mic. + */ + case 27: + patch = "as=2 seq=15"; + break; + case 35: + patch = "as=2"; + break; } } else if (id == HDA_CODEC_ALC269 && (subid == LENOVO_X1CRBN_SUBVENDOR || From owner-svn-src-all@FreeBSD.ORG Sun May 19 01:52:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C212F9A0; Sun, 19 May 2013 01:52:39 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3256E57; Sun, 19 May 2013 01:52:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4J1qd78031464; Sun, 19 May 2013 01:52:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4J1qdSX031463; Sun, 19 May 2013 01:52:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201305190152.r4J1qdSX031463@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 19 May 2013 01:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250798 - stable/9/sys/powerpc/powermac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 01:52:39 -0000 Author: nwhitehorn Date: Sun May 19 01:52:39 2013 New Revision: 250798 URL: http://svnweb.freebsd.org/changeset/base/250798 Log: MFC r250290: Only check fan type once. Not only is continuously rechecking pointless, a single random failure can reprogram what control mechanism we try to use. Modified: stable/9/sys/powerpc/powermac/smu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/powermac/smu.c ============================================================================== --- stable/9/sys/powerpc/powermac/smu.c Sun May 19 01:45:29 2013 (r250797) +++ stable/9/sys/powerpc/powermac/smu.c Sun May 19 01:52:39 2013 (r250798) @@ -78,8 +78,8 @@ struct smu_fan { SMU_FAN_RPM, SMU_FAN_PWM } type; - int old_style; int setpoint; + int old_style; int rpm; }; @@ -123,6 +123,7 @@ struct smu_softc { struct smu_fan *sc_fans; int sc_nfans; + int old_style_fans; struct smu_sensor *sc_sensors; int sc_nsensors; @@ -654,6 +655,37 @@ doorbell_attach(device_t dev) */ static int +smu_fan_check_old_style(struct smu_fan *fan) +{ + device_t smu = fan->dev; + struct smu_softc *sc = device_get_softc(smu); + struct smu_cmd cmd; + int error; + + if (sc->old_style_fans != -1) + return (sc->old_style_fans); + + /* + * Apple has two fan control mechanisms. We can't distinguish + * them except by seeing if the new one fails. If the new one + * fails, use the old one. + */ + + cmd.cmd = SMU_FAN; + cmd.len = 2; + cmd.data[0] = 0x31; + cmd.data[1] = fan->reg; + + do { + error = smu_run_cmd(smu, &cmd, 1); + } while (error == EWOULDBLOCK); + + sc->old_style_fans = (error != 0); + + return (sc->old_style_fans); +} + +static int smu_fan_set_rpm(struct smu_fan *fan, int rpm) { device_t smu = fan->dev; @@ -667,12 +699,8 @@ smu_fan_set_rpm(struct smu_fan *fan, int rpm = max(fan->fan.min_rpm, rpm); rpm = min(fan->fan.max_rpm, rpm); - /* - * Apple has two fan control mechanisms. We can't distinguish - * them except by seeing if the new one fails. If the new one - * fails, use the old one. - */ - + smu_fan_check_old_style(fan); + if (!fan->old_style) { cmd.len = 4; cmd.data[0] = 0x30; @@ -683,9 +711,7 @@ smu_fan_set_rpm(struct smu_fan *fan, int error = smu_run_cmd(smu, &cmd, 1); if (error && error != EWOULDBLOCK) fan->old_style = 1; - } - - if (fan->old_style) { + } else { cmd.len = 14; cmd.data[0] = 0x00; /* RPM fan. */ cmd.data[1] = 1 << fan->reg; @@ -707,6 +733,8 @@ smu_fan_read_rpm(struct smu_fan *fan) struct smu_cmd cmd; int rpm, error; + smu_fan_check_old_style(fan); + if (!fan->old_style) { cmd.cmd = SMU_FAN; cmd.len = 2; @@ -944,9 +972,10 @@ smu_count_fans(device_t dev) child = OF_peer(child)) { nfans++; /* When allocated, fill the fan properties. */ - if (sc->sc_fans != NULL) + if (sc->sc_fans != NULL) { smu_fill_fan_prop(dev, child, nfans - 1); + } } } if (nfans == 0) { From owner-svn-src-all@FreeBSD.ORG Sun May 19 01:58:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EA812D1E; Sun, 19 May 2013 01:58:00 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DAF02E8D; Sun, 19 May 2013 01:58:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4J1w0rb032658; Sun, 19 May 2013 01:58:00 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4J1w0b9032657; Sun, 19 May 2013 01:58:00 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201305190158.r4J1w0b9032657@svn.freebsd.org> From: Greg Lehey Date: Sun, 19 May 2013 01:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250799 - stable/9/lib/libc/stdio X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 01:58:01 -0000 Author: grog Date: Sun May 19 01:58:00 2013 New Revision: 250799 URL: http://svnweb.freebsd.org/changeset/base/250799 Log: MFH r242738: Clarify that the ' flag is an apostrophe. Modified: stable/9/lib/libc/stdio/printf.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/printf.3 ============================================================================== --- stable/9/lib/libc/stdio/printf.3 Sun May 19 01:52:39 2013 (r250798) +++ stable/9/lib/libc/stdio/printf.3 Sun May 19 01:58:00 2013 (r250799) @@ -277,7 +277,7 @@ number produced by a signed conversion. A .Cm + overrides a space if both are used. -.It Sq Cm ' +.It So "'" Sc (apostrophe) Decimal conversions .Cm ( d , u , or From owner-svn-src-all@FreeBSD.ORG Sun May 19 04:10:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 86354456; Sun, 19 May 2013 04:10:36 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7846C854; Sun, 19 May 2013 04:10:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4J4AaZW079148; Sun, 19 May 2013 04:10:36 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4J4AZj9079137; Sun, 19 May 2013 04:10:35 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201305190410.r4J4AZj9079137@svn.freebsd.org> From: Jamie Gritton Date: Sun, 19 May 2013 04:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250804 - in head: etc etc/rc.d sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 04:10:36 -0000 Author: jamie Date: Sun May 19 04:10:34 2013 New Revision: 250804 URL: http://svnweb.freebsd.org/changeset/base/250804 Log: Refine the "nojail" rc keyword, adding "nojailvnet" for files that don't apply to most jails but do apply to vnet jails. This includes adding a new sysctl "security.jail.vnet" to identify vnet jails. PR: conf/149050 Submitted by: mdodd MFC after: 3 days Modified: head/etc/rc head/etc/rc.d/ipfw head/etc/rc.d/netif head/etc/rc.d/routing head/etc/rc.shutdown head/sys/kern/kern_jail.c Modified: head/etc/rc ============================================================================== --- head/etc/rc Sun May 19 03:04:34 2013 (r250803) +++ head/etc/rc Sun May 19 04:10:34 2013 (r250804) @@ -77,6 +77,9 @@ if [ `/sbin/sysctl -n security.jail.jail if [ "$early_late_divider" = "FILESYSTEMS" ]; then early_late_divider=NETWORKING fi + if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + skip="$skip -s nojailvnet" + fi fi # Do a first pass to get everything up to $early_late_divider so that Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Sun May 19 03:04:34 2013 (r250803) +++ head/etc/rc.d/ipfw Sun May 19 04:10:34 2013 (r250804) @@ -5,7 +5,7 @@ # PROVIDE: ipfw # REQUIRE: ppp -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr . /etc/network.subr Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Sun May 19 03:04:34 2013 (r250803) +++ head/etc/rc.d/netif Sun May 19 04:10:34 2013 (r250804) @@ -28,7 +28,7 @@ # PROVIDE: netif # REQUIRE: atm1 FILESYSTEMS serial sppp sysctl # REQUIRE: ipfilter ipfs -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr . /etc/network.subr Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Sun May 19 03:04:34 2013 (r250803) +++ head/etc/rc.d/routing Sun May 19 04:10:34 2013 (r250804) @@ -7,7 +7,7 @@ # PROVIDE: routing # REQUIRE: faith netif ppp stf -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr . /etc/network.subr Modified: head/etc/rc.shutdown ============================================================================== --- head/etc/rc.shutdown Sun May 19 03:04:34 2013 (r250803) +++ head/etc/rc.shutdown Sun May 19 04:10:34 2013 (r250804) @@ -81,7 +81,12 @@ fi # and perform the operation # rcorder_opts="-k shutdown" -[ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && rcorder_opts="$rcorder_opts -s nojail" +if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then + rcorder_opts="$rcorder_opts -s nojail" + if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + rcorder_opts="$rcorder_opts -s nojailvnet" + fi +fi case ${local_startup} in [Nn][Oo] | '') ;; Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sun May 19 03:04:34 2013 (r250803) +++ head/sys/kern/kern_jail.c Sun May 19 04:10:34 2013 (r250804) @@ -4132,6 +4132,26 @@ SYSCTL_PROC(_security_jail, OID_AUTO, ja CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_jail_jailed, "I", "Process in jail?"); +static int +sysctl_jail_vnet(SYSCTL_HANDLER_ARGS) +{ + int error, havevnet; +#ifdef VIMAGE + struct ucred *cred = req->td->td_ucred; + + havevnet = jailed(cred) && prison_owns_vnet(cred); +#else + havevnet = 0; +#endif + error = SYSCTL_OUT(req, &havevnet, sizeof(havevnet)); + + return (error); +} + +SYSCTL_PROC(_security_jail, OID_AUTO, vnet, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_jail_vnet, "I", "Jail owns VNET?"); + #if defined(INET) || defined(INET6) SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, &jail_max_af_ips, 0, From owner-svn-src-all@FreeBSD.ORG Sun May 19 05:49:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AAE00756; Sun, 19 May 2013 05:49:25 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9B065A8F; Sun, 19 May 2013 05:49:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4J5nPGO014806; Sun, 19 May 2013 05:49:25 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4J5nLHD014780; Sun, 19 May 2013 05:49:21 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201305190549.r4J5nLHD014780@svn.freebsd.org> From: Hiroki Sato Date: Sun, 19 May 2013 05:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250805 - in head/release/doc: en_US.ISO8859-1/hardware ja_JP.eucJP/hardware/alpha ja_JP.eucJP/hardware/amd64 ja_JP.eucJP/hardware/i386 ja_JP.eucJP/hardware/ia64 ja_JP.eucJP/hardware/pc... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 05:49:25 -0000 Author: hrs Date: Sun May 19 05:49:21 2013 New Revision: 250805 URL: http://svnweb.freebsd.org/changeset/base/250805 Log: Fix build after doc/projects/xml-tools integration. Added: head/release/doc/ja_JP.eucJP/share/xml/dev-auto-ja.ent - copied unchanged from r250804, head/release/doc/ja_JP.eucJP/share/xml/dev-auto-ja.xml head/release/doc/ru_RU.KOI8-R/share/xml/dev-auto-ru.ent - copied unchanged from r250804, head/release/doc/ru_RU.KOI8-R/share/xml/dev-auto-ru.xml Deleted: head/release/doc/ja_JP.eucJP/share/xml/dev-auto-ja.xml head/release/doc/ru_RU.KOI8-R/share/xml/dev-auto-ru.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/Makefile head/release/doc/ja_JP.eucJP/hardware/alpha/Makefile head/release/doc/ja_JP.eucJP/hardware/amd64/Makefile head/release/doc/ja_JP.eucJP/hardware/i386/Makefile head/release/doc/ja_JP.eucJP/hardware/ia64/Makefile head/release/doc/ja_JP.eucJP/hardware/pc98/Makefile head/release/doc/ja_JP.eucJP/hardware/sparc64/Makefile head/release/doc/ja_JP.eucJP/share/xml/catalog head/release/doc/ja_JP.eucJP/share/xml/catalog.xml head/release/doc/ru_RU.KOI8-R/hardware/alpha/Makefile head/release/doc/ru_RU.KOI8-R/hardware/amd64/Makefile head/release/doc/ru_RU.KOI8-R/hardware/i386/Makefile head/release/doc/ru_RU.KOI8-R/hardware/ia64/Makefile head/release/doc/ru_RU.KOI8-R/hardware/pc98/Makefile head/release/doc/ru_RU.KOI8-R/hardware/sparc64/Makefile head/release/doc/ru_RU.KOI8-R/share/xml/catalog head/release/doc/ru_RU.KOI8-R/share/xml/catalog.xml head/release/doc/zh_CN.GB2312/hardware/Makefile Modified: head/release/doc/en_US.ISO8859-1/hardware/Makefile ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/en_US.ISO8859-1/hardware/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -18,7 +18,7 @@ JADEFLAGS+= -V %generate-article-toc% # SGML content SRCS+= article.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent CATALOGS+= -c ${DEV-AUTODIR}/catalog-auto Modified: head/release/doc/ja_JP.eucJP/hardware/alpha/Makefile ============================================================================== --- head/release/doc/ja_JP.eucJP/hardware/alpha/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ja_JP.eucJP/hardware/alpha/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -17,8 +17,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ja.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ja.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ja_JP.eucJP/hardware/amd64/Makefile ============================================================================== --- head/release/doc/ja_JP.eucJP/hardware/amd64/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ja_JP.eucJP/hardware/amd64/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -17,8 +17,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ja.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ja.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ja_JP.eucJP/hardware/i386/Makefile ============================================================================== --- head/release/doc/ja_JP.eucJP/hardware/i386/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ja_JP.eucJP/hardware/i386/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -17,8 +17,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ja.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ja.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ja_JP.eucJP/hardware/ia64/Makefile ============================================================================== --- head/release/doc/ja_JP.eucJP/hardware/ia64/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ja_JP.eucJP/hardware/ia64/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -17,8 +17,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ja.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ja.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ja_JP.eucJP/hardware/pc98/Makefile ============================================================================== --- head/release/doc/ja_JP.eucJP/hardware/pc98/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ja_JP.eucJP/hardware/pc98/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -17,8 +17,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ja.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ja.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ja_JP.eucJP/hardware/sparc64/Makefile ============================================================================== --- head/release/doc/ja_JP.eucJP/hardware/sparc64/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ja_JP.eucJP/hardware/sparc64/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -17,8 +17,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ja.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ja.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ja_JP.eucJP/share/xml/catalog ============================================================================== --- head/release/doc/ja_JP.eucJP/share/xml/catalog Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ja_JP.eucJP/share/xml/catalog Sun May 19 05:49:21 2013 (r250805) @@ -6,7 +6,7 @@ PUBLIC "-//FreeBSD//DOCUMENT Release Notes DocBook Stylesheet//EN" "release.dsl" PUBLIC "-//FreeBSD//ENTITIES Auto Generated Device Lists//JA" - "dev-auto-ja.xml" + "dev-auto-ja.ent" Modified: head/release/doc/ja_JP.eucJP/share/xml/catalog.xml ============================================================================== --- head/release/doc/ja_JP.eucJP/share/xml/catalog.xml Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ja_JP.eucJP/share/xml/catalog.xml Sun May 19 05:49:21 2013 (r250805) @@ -7,5 +7,5 @@ + uri="dev-auto-ja.ent"/> Copied: head/release/doc/ja_JP.eucJP/share/xml/dev-auto-ja.ent (from r250804, head/release/doc/ja_JP.eucJP/share/xml/dev-auto-ja.xml) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/doc/ja_JP.eucJP/share/xml/dev-auto-ja.ent Sun May 19 05:49:21 2013 (r250805, copy of r250804, head/release/doc/ja_JP.eucJP/share/xml/dev-auto-ja.xml) @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + +</ulink> をご覧ください。'> + +</ulink> をご覧ください。'> + + + + + + + +W</quote>, C</quote>, S</quote> および A</quote> シリーズとその互換 SCSI ホストアダプタに対応しています。'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: head/release/doc/ru_RU.KOI8-R/hardware/alpha/Makefile ============================================================================== --- head/release/doc/ru_RU.KOI8-R/hardware/alpha/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ru_RU.KOI8-R/hardware/alpha/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -21,8 +21,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ru.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ru.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ru_RU.KOI8-R/hardware/amd64/Makefile ============================================================================== --- head/release/doc/ru_RU.KOI8-R/hardware/amd64/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ru_RU.KOI8-R/hardware/amd64/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -21,8 +21,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ru.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ru.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ru_RU.KOI8-R/hardware/i386/Makefile ============================================================================== --- head/release/doc/ru_RU.KOI8-R/hardware/i386/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ru_RU.KOI8-R/hardware/i386/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -21,8 +21,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ru.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ru.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ru_RU.KOI8-R/hardware/ia64/Makefile ============================================================================== --- head/release/doc/ru_RU.KOI8-R/hardware/ia64/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ru_RU.KOI8-R/hardware/ia64/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -21,8 +21,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ru.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ru.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ru_RU.KOI8-R/hardware/pc98/Makefile ============================================================================== --- head/release/doc/ru_RU.KOI8-R/hardware/pc98/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ru_RU.KOI8-R/hardware/pc98/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -21,8 +21,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ru.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ru.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ru_RU.KOI8-R/hardware/sparc64/Makefile ============================================================================== --- head/release/doc/ru_RU.KOI8-R/hardware/sparc64/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ru_RU.KOI8-R/hardware/sparc64/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -21,8 +21,8 @@ SRCS+= ../common/hw.ent SRCS+= ../common/artheader.xml SRCS+= ../common/dev.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml -SRCS+= ../../share/xml/dev-auto-ru.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent +SRCS+= ../../share/xml/dev-auto-ru.ent .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: head/release/doc/ru_RU.KOI8-R/share/xml/catalog ============================================================================== --- head/release/doc/ru_RU.KOI8-R/share/xml/catalog Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ru_RU.KOI8-R/share/xml/catalog Sun May 19 05:49:21 2013 (r250805) @@ -9,4 +9,4 @@ PUBLIC "-//FreeBSD//DOCUMENT Release Notes DocBook Stylesheet//EN" "release.dsl" PUBLIC "-//FreeBSD//ENTITIES Auto Generated Device Lists//RU" - "dev-auto-ru.xml" + "dev-auto-ru.ent" Modified: head/release/doc/ru_RU.KOI8-R/share/xml/catalog.xml ============================================================================== --- head/release/doc/ru_RU.KOI8-R/share/xml/catalog.xml Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/ru_RU.KOI8-R/share/xml/catalog.xml Sun May 19 05:49:21 2013 (r250805) @@ -7,5 +7,5 @@ + uri="dev-auto-ru.ent"/> Copied: head/release/doc/ru_RU.KOI8-R/share/xml/dev-auto-ru.ent (from r250804, head/release/doc/ru_RU.KOI8-R/share/xml/dev-auto-ru.xml) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/doc/ru_RU.KOI8-R/share/xml/dev-auto-ru.ent Sun May 19 05:49:21 2013 (r250805, copy of r250804, head/release/doc/ru_RU.KOI8-R/share/xml/dev-auto-ru.xml) @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + +W</quote>, C</quote>, S</quote> A</quote>, 嗜徑途塢踊 範嘖 祖双堙燮 SCSI:'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: head/release/doc/zh_CN.GB2312/hardware/Makefile ============================================================================== --- head/release/doc/zh_CN.GB2312/hardware/Makefile Sun May 19 04:10:34 2013 (r250804) +++ head/release/doc/zh_CN.GB2312/hardware/Makefile Sun May 19 05:49:21 2013 (r250805) @@ -21,7 +21,7 @@ JADEFLAGS+= -V %generate-article-toc% # SGML content SRCS+= article.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent CATALOGS+= -c ${DEV-AUTODIR}/catalog-auto From owner-svn-src-all@FreeBSD.ORG Sun May 19 07:44:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 96DC4399; Sun, 19 May 2013 07:44:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8911CD46; Sun, 19 May 2013 07:44:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4J7i222055068; Sun, 19 May 2013 07:44:02 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4J7i2FD055067; Sun, 19 May 2013 07:44:02 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305190744.r4J7i2FD055067@svn.freebsd.org> From: Ed Schouten Date: Sun, 19 May 2013 07:44:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250806 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 07:44:02 -0000 Author: ed Date: Sun May 19 07:44:01 2013 New Revision: 250806 URL: http://svnweb.freebsd.org/changeset/base/250806 Log: Remove lint case for _Thread_local. I added this block, knowing that lint does not support _Thread_local. When linting, we could argue that we don't care about TLS (yet). It seems, however, that external pieces of software also sometimes do a -Dlint, regex the output and compile it again. Reported by: swills Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun May 19 05:49:21 2013 (r250805) +++ head/sys/sys/cdefs.h Sun May 19 07:44:01 2013 (r250806) @@ -292,8 +292,6 @@ #if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \ __has_extension(cxx_thread_local) #define _Thread_local thread_local -#elif defined(lint) -#define _Thread_local #else #define _Thread_local __thread #endif From owner-svn-src-all@FreeBSD.ORG Sun May 19 09:48:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4BFA4ED8; Sun, 19 May 2013 09:48:24 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep16.mx.upcmail.net (fep16.mx.upcmail.net [62.179.121.36]) by mx1.freebsd.org (Postfix) with ESMTP id 13FF5FC2; Sun, 19 May 2013 09:48:22 +0000 (UTC) Received: from edge01.upcmail.net ([192.168.13.236]) by viefep16-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20130519094815.GKCF4685.viefep16-int.chello.at@edge01.upcmail.net>; Sun, 19 May 2013 11:48:15 +0200 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge01.upcmail.net with edge id dloE1l00p2xdvHc01loEl6; Sun, 19 May 2013 11:48:15 +0200 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 465306D449; Sun, 19 May 2013 11:48:14 +0200 (CEST) Date: Sun, 19 May 2013 11:48:14 +0200 From: Stefan Farfeleder To: Ed Schouten Subject: Re: svn commit: r250806 - head/sys/sys Message-ID: <20130519094813.GA1465@mole.fafoe.narf.at> References: <201305190744.r4J7i2FD055067@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305190744.r4J7i2FD055067@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 09:48:24 -0000 On Sun, May 19, 2013 at 07:44:02AM +0000, Ed Schouten wrote: > Author: ed > Date: Sun May 19 07:44:01 2013 > New Revision: 250806 > URL: http://svnweb.freebsd.org/changeset/base/250806 > > Log: > Remove lint case for _Thread_local. > > I added this block, knowing that lint does not support _Thread_local. > When linting, we could argue that we don't care about TLS (yet). It > seems, however, that external pieces of software also sometimes do a > -Dlint, regex the output and compile it again. Shouldn't we fix lint and our headers to use a different macro name? One starting with __? Stefan From owner-svn-src-all@FreeBSD.ORG Sun May 19 16:06:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1D64E5A3; Sun, 19 May 2013 16:06:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 10228EEB; Sun, 19 May 2013 16:06:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4JG6hvY032155; Sun, 19 May 2013 16:06:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4JG6hNR032154; Sun, 19 May 2013 16:06:43 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201305191606.r4JG6hNR032154@svn.freebsd.org> From: Michael Tuexen Date: Sun, 19 May 2013 16:06:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250809 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 16:06:44 -0000 Author: tuexen Date: Sun May 19 16:06:43 2013 New Revision: 250809 URL: http://svnweb.freebsd.org/changeset/base/250809 Log: Initialize the fibnum for outgoing packets to 0. This avoids crashing due to the usage of uninitialized fibnum. This bugs became visiable after http://svnweb.freebsd.org/changeset/base/250700 MFC after: 2 weeks Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Sun May 19 15:26:15 2013 (r250808) +++ head/sys/netinet/sctp_os_bsd.h Sun May 19 16:06:43 2013 (r250809) @@ -435,6 +435,7 @@ typedef struct rtentry sctp_rtentry_t; { \ int o_flgs = IP_RAWOUTPUT; \ struct sctp_tcb *local_stcb = stcb; \ + M_SETFIB(o_pak, 0); \ if (local_stcb && \ local_stcb->sctp_ep && \ local_stcb->sctp_ep->sctp_socket) \ @@ -445,6 +446,7 @@ typedef struct rtentry sctp_rtentry_t; #define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \ { \ struct sctp_tcb *local_stcb = stcb; \ + M_SETFIB(o_pak, 0); \ if (local_stcb && local_stcb->sctp_ep) \ result = ip6_output(o_pak, \ ((struct in6pcb *)(local_stcb->sctp_ep))->in6p_outputopts, \ From owner-svn-src-all@FreeBSD.ORG Sun May 19 16:25:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4707E95A; Sun, 19 May 2013 16:25:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39514F7A; Sun, 19 May 2013 16:25:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4JGPAmd038925; Sun, 19 May 2013 16:25:10 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4JGPA0o038924; Sun, 19 May 2013 16:25:10 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201305191625.r4JGPA0o038924@svn.freebsd.org> From: Andrew Turner Date: Sun, 19 May 2013 16:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250810 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 16:25:10 -0000 Author: andrew Date: Sun May 19 16:25:09 2013 New Revision: 250810 URL: http://svnweb.freebsd.org/changeset/base/250810 Log: Add a comment explaining why stack_capture is empty for EABI and clang. While here add a comment pointing out that, while r11 is not the frame pointer on EABI as there is no frame pointer, it's value is unused so is safe. Modified: head/sys/arm/arm/stack_machdep.c Modified: head/sys/arm/arm/stack_machdep.c ============================================================================== --- head/sys/arm/arm/stack_machdep.c Sun May 19 16:06:43 2013 (r250809) +++ head/sys/arm/arm/stack_machdep.c Sun May 19 16:25:09 2013 (r250810) @@ -36,6 +36,13 @@ __FBSDID("$FreeBSD$"); #include #include +/* + * This code makes assumptions about the stack layout. These are correct + * when using APCS (the old ABI), but are no longer true with AAPCS and the + * ARM EABI. There is also an issue with clang and llvm when building for + * APCS where it lays out the stack incorrectly. Because of this we disable + * this when building for ARM EABI or when building with clang. + */ static void stack_capture(struct stack *st, u_int32_t *frame) { @@ -61,6 +68,11 @@ stack_save_td(struct stack *st, struct t if (TD_IS_RUNNING(td)) panic("stack_save_td: running"); + /* + * This register, the frame pointer, is incorrect for the ARM EABI + * as it doesn't have a frame pointer, however it's value is not used + * when building for EABI. + */ frame = (u_int32_t *)td->td_pcb->un_32.pcb32_r11; stack_zero(st); stack_capture(st, frame); From owner-svn-src-all@FreeBSD.ORG Sun May 19 16:45:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B3855DFE; Sun, 19 May 2013 16:45:17 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 94B0EFE3; Sun, 19 May 2013 16:45:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4JGjHQS046230; Sun, 19 May 2013 16:45:17 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4JGjHMv046229; Sun, 19 May 2013 16:45:17 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201305191645.r4JGjHMv046229@svn.freebsd.org> From: "Simon J. Gerraty" Date: Sun, 19 May 2013 16:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250811 - vendor/NetBSD/bmake X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 16:45:17 -0000 Author: sjg Date: Sun May 19 16:45:17 2013 New Revision: 250811 URL: http://svnweb.freebsd.org/changeset/base/250811 Log: Automate import dance Modified: vendor/NetBSD/bmake/do-update.sh Modified: vendor/NetBSD/bmake/do-update.sh ============================================================================== --- vendor/NetBSD/bmake/do-update.sh Sun May 19 16:25:09 2013 (r250810) +++ vendor/NetBSD/bmake/do-update.sh Sun May 19 16:45:17 2013 (r250811) @@ -8,7 +8,6 @@ ECHO= SVN=${SVN:-/usr/local/bin/svn} SITE=${SITE:-ftp://ftp.netbsd.org/pub/NetBSD/misc/sjg} - # For consistency... Error() { echo ERROR: ${1+"$@"} >&2 @@ -56,51 +55,31 @@ option_parsing() { return $(($_shift - $#)) } -# Call this function after all argument parsing has been done. -sanity_checks() { - # Do we have a working Subversion client? - ${SVN} --version -q >/dev/null || \ - Error "Cannot find a working subversion client." - - # Verify that a PR number and reviewer(s) were specified on the - # command line. - [ "$VERSION" ] || Error "We will a version \"number\" (can be a string). Use VERSION=." - # Need one (and only one) of ${url} or ${TARBALL} set. - [ "${url:-$TARBALL}" -a "${url:-$TARBALL}" != "${TARBALL:-$url}" ] && Error "Please set either \"url\" or \"TARBALL\" (not both) in your import script." - [ -d dist ] || Error "The directory dist/ does not exist." -} - ### option_parsing "$@" shift $? -sanity_checks -fetch $SITE/bmake-${VERSION}.tar.gz.sha1 -fetch $SITE/bmake-${VERSION}.tar.gz +Cd `dirname $0` +test -s ${TARBALL:-/dev/null} || Error need TARBALL +rm -rf bmake +TF=/tmp/.$USER.$$ -HAVE=`sha1 bmake-${VERSION}.tar.gz` -WANT=`cat bmake-${VERSION}.tar.gz.sha1` -if [ x"$HAVE" != x"$WANT" ]; then - Error "Fetched distfile does not have the expected SHA1 hash." -fi - -tar xf bmake-${VERSION}.tar.gz +tar zxf $TARBALL +MAKE_VERSION=`grep '^MAKE_VERSION' bmake/Makefile | sed 's,.*=[[:space:]]*,,'` rm -rf bmake/missing - -svn-vendorimport.sh bmake dist -${SVN} stat dist - -rm -f bmake-${VERSION}.tar.gz bmake-${VERSION}.tar.gz.sha1 - -echo "Import the ${VERSION} release of the \"Portable\" BSD make tool (from NetBSD). - -Submitted by: Simon Gerraty " > /tmp/commit-log - -${ECHO} ${SVN} ci -F /tmp/commit-log dist - -SVNURL=$(${SVN} info | grep URL: | awk '{print $2}') - -${ECHO} ${SVN} copy \ - -m "\"Tag\" the ${VERSION} Portable BSD make import." \ - ${SVNURL}/dist ${SVNURL}/${VERSION} +('cd' dist && $SVN list -R) | grep -v '/$' | sort > $TF.old +('cd' bmake && find . -type f ) | cut -c 3- | sort > $TF.new +comm -23 $TF.old $TF.new > $TF.rmlist +comm -13 $TF.old $TF.new > $TF.addlist +[ -s $TF.rmlist ] && { echo rm:; cat $TF.rmlist; } +[ -s $TF.addlist ] && { echo add:; cat $TF.addlist; } +('cd' bmake && tar cf - . | tar xf - -C ../dist) +('cd' dist +test -s $TF.rmlist && xargs $SVN rm < $TF.rmlist +test -s $TF.addlist && xargs $SVN --parents add < $TF.addlist +) + +url=`$SVN info | sed -n '/URL:/s,URL: ,,p'` +echo After committing dist... +echo $SVN cp $url/dist $url/$MAKE_VERSION From owner-svn-src-all@FreeBSD.ORG Sun May 19 17:14:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 86DD22C4; Sun, 19 May 2013 17:14:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6A176F1; Sun, 19 May 2013 17:14:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4JHEc5w057399; Sun, 19 May 2013 17:14:38 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4JHEbJ1057384; Sun, 19 May 2013 17:14:37 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305191714.r4JHEbJ1057384@svn.freebsd.org> From: Mark Johnston Date: Sun, 19 May 2013 17:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250812 - in head/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/cg lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 17:14:38 -0000 Author: markj Date: Sun May 19 17:14:36 2013 New Revision: 250812 URL: http://svnweb.freebsd.org/changeset/base/250812 Log: Re-introduce another part of r249367. This commit fixes a register leak in dt_cg_ptrsize() and generally cleans up some of the error handling around register allocation. This change corresponds to part of illumos-gate commit e5803b76927480: 3025 register leak in D code generation Reviewed by: pfg Obtained from: illumos MFC after: 1 month Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/ - copied from r250811, vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/ Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.h Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c Sun May 19 16:45:17 2013 (r250811) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c Sun May 19 17:14:36 2013 (r250812) @@ -19,12 +19,15 @@ * * CDDL HEADER END */ + /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #include #include @@ -193,9 +196,6 @@ dt_cg_ptrsize(dt_node_t *dnp, dt_irlist_ ssize_t size; int sreg; - if ((sreg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); - type = ctf_type_resolve(ctfp, dnp->dn_type); kind = ctf_type_kind(ctfp, type); assert(kind == CTF_K_POINTER || kind == CTF_K_ARRAY); @@ -212,6 +212,7 @@ dt_cg_ptrsize(dt_node_t *dnp, dt_irlist_ if ((size = ctf_type_size(ctfp, type)) == 1) return; /* multiply or divide by one can be omitted */ + sreg = dt_regset_alloc(drp); dt_cg_setx(dlp, sreg, size); instr = DIF_INSTR_FMT(op, dreg, sreg, dreg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); @@ -251,9 +252,7 @@ dt_cg_field_get(dt_node_t *dnp, dt_irlis assert(dnp->dn_op == DT_TOK_PTR || dnp->dn_op == DT_TOK_DOT); r1 = dnp->dn_left->dn_reg; - - if ((r2 = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + r2 = dt_regset_alloc(drp); /* * On little-endian architectures, ctm_offset counts from the right so @@ -356,10 +355,9 @@ dt_cg_field_set(dt_node_t *src, dt_irlis "bits %u\n", m.ctm_offset, m.ctm_type, e.cte_bits); } - if ((r1 = dt_regset_alloc(drp)) == -1 || - (r2 = dt_regset_alloc(drp)) == -1 || - (r3 = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + r1 = dt_regset_alloc(drp); + r2 = dt_regset_alloc(drp); + r3 = dt_regset_alloc(drp); /* * Compute shifts and masks. We need to compute "shift" as the amount @@ -423,8 +421,7 @@ dt_cg_store(dt_node_t *src, dt_irlist_t size = dt_node_type_size(src); if (src->dn_flags & DT_NF_REF) { - if ((reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + reg = dt_regset_alloc(drp); dt_cg_setx(dlp, reg, size); instr = DIF_INSTR_COPYS(src->dn_reg, reg, dst->dn_reg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); @@ -474,30 +471,58 @@ dt_cg_typecast(const dt_node_t *src, con size_t dstsize = dt_node_type_size(dst); dif_instr_t instr; - int reg, n; + int rg; - if (dt_node_is_scalar(dst) && (dstsize < srcsize || - (src->dn_flags & DT_NF_SIGNED) ^ (dst->dn_flags & DT_NF_SIGNED))) { - if ((reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + if (!dt_node_is_scalar(dst)) + return; /* not a scalar */ + if (dstsize == srcsize && + ((src->dn_flags ^ dst->dn_flags) & DT_NF_SIGNED) != 0) + return; /* not narrowing or changing signed-ness */ + if (dstsize > srcsize && (src->dn_flags & DT_NF_SIGNED) == 0) + return; /* nothing to do in this case */ - if (dstsize < srcsize) - n = sizeof (uint64_t) * NBBY - dstsize * NBBY; - else - n = sizeof (uint64_t) * NBBY - srcsize * NBBY; + rg = dt_regset_alloc(drp); + + if (dstsize > srcsize) { + int n = sizeof (uint64_t) * NBBY - srcsize * NBBY; + int s = (dstsize - srcsize) * NBBY; - dt_cg_setx(dlp, reg, n); + dt_cg_setx(dlp, rg, n); - instr = DIF_INSTR_FMT(DIF_OP_SLL, - src->dn_reg, reg, dst->dn_reg); + instr = DIF_INSTR_FMT(DIF_OP_SLL, src->dn_reg, rg, dst->dn_reg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); - instr = DIF_INSTR_FMT((dst->dn_flags & DT_NF_SIGNED) ? - DIF_OP_SRA : DIF_OP_SRL, dst->dn_reg, reg, dst->dn_reg); + if ((dst->dn_flags & DT_NF_SIGNED) || n == s) { + instr = DIF_INSTR_FMT(DIF_OP_SRA, + dst->dn_reg, rg, dst->dn_reg); + dt_irlist_append(dlp, + dt_cg_node_alloc(DT_LBL_NONE, instr)); + } else { + dt_cg_setx(dlp, rg, s); + instr = DIF_INSTR_FMT(DIF_OP_SRA, + dst->dn_reg, rg, dst->dn_reg); + dt_irlist_append(dlp, + dt_cg_node_alloc(DT_LBL_NONE, instr)); + dt_cg_setx(dlp, rg, n - s); + instr = DIF_INSTR_FMT(DIF_OP_SRL, + dst->dn_reg, rg, dst->dn_reg); + dt_irlist_append(dlp, + dt_cg_node_alloc(DT_LBL_NONE, instr)); + } + } else if (dstsize != sizeof (uint64_t)) { + int n = sizeof (uint64_t) * NBBY - dstsize * NBBY; + + dt_cg_setx(dlp, rg, n); + instr = DIF_INSTR_FMT(DIF_OP_SLL, src->dn_reg, rg, dst->dn_reg); + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + + instr = DIF_INSTR_FMT((dst->dn_flags & DT_NF_SIGNED) ? + DIF_OP_SRA : DIF_OP_SRL, dst->dn_reg, rg, dst->dn_reg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); - dt_regset_free(drp, reg); } + + dt_regset_free(drp, rg); } /* @@ -523,8 +548,7 @@ dt_cg_arglist(dt_ident_t *idp, dt_node_t for (dnp = args; dnp != NULL; dnp = dnp->dn_list) dt_cg_node(dnp, dlp, drp); - dt_irlist_append(dlp, - dt_cg_node_alloc(DT_LBL_NONE, DIF_INSTR_FLUSHTS)); + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, DIF_INSTR_FLUSHTS)); for (dnp = args; dnp != NULL; dnp = dnp->dn_list, i++) { dtrace_diftype_t t; @@ -538,17 +562,18 @@ dt_cg_arglist(dt_ident_t *idp, dt_node_t dt_cg_typecast(dnp, &isp->dis_args[i], dlp, drp); isp->dis_args[i].dn_reg = -1; - if (t.dtdt_flags & DIF_TF_BYREF) + if (t.dtdt_flags & DIF_TF_BYREF) { op = DIF_OP_PUSHTR; - else + if (t.dtdt_size != 0) { + reg = dt_regset_alloc(drp); + dt_cg_setx(dlp, reg, t.dtdt_size); + } else { + reg = DIF_REG_R0; + } + } else { op = DIF_OP_PUSHTV; - - if (t.dtdt_size != 0) { - if ((reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); - dt_cg_setx(dlp, reg, t.dtdt_size); - } else reg = DIF_REG_R0; + } instr = DIF_INSTR_PUSHTS(op, t.dtdt_kind, reg, dnp->dn_reg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); @@ -629,9 +654,7 @@ dt_cg_prearith_op(dt_node_t *dnp, dt_irl dt_cg_node(dnp->dn_child, dlp, drp); dnp->dn_reg = dnp->dn_child->dn_reg; - if ((reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); - + reg = dt_regset_alloc(drp); dt_cg_setx(dlp, reg, size); instr = DIF_INSTR_FMT(op, dnp->dn_reg, reg, dnp->dn_reg); @@ -688,9 +711,7 @@ dt_cg_postarith_op(dt_node_t *dnp, dt_ir dt_cg_node(dnp->dn_child, dlp, drp); dnp->dn_reg = dnp->dn_child->dn_reg; - if ((nreg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); - + nreg = dt_regset_alloc(drp); dt_cg_setx(dlp, nreg, size); instr = DIF_INSTR_FMT(op, dnp->dn_reg, nreg, nreg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); @@ -1008,9 +1029,7 @@ dt_cg_asgn_op(dt_node_t *dnp, dt_irlist_ * set it to the size of our data structure, and then replace * it with the result of an allocs of the specified size. */ - if ((r1 = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); - + r1 = dt_regset_alloc(drp); dt_cg_setx(dlp, r1, ctf_type_size(dxp->dx_dst_ctfp, dxp->dx_dst_base)); @@ -1054,8 +1073,7 @@ dt_cg_asgn_op(dt_node_t *dnp, dt_irlist_ * and add r1 to it before storing the result. */ if (ctm.ctm_offset != 0) { - if ((r2 = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + r2 = dt_regset_alloc(drp); /* * Add the member offset rounded down to the @@ -1142,8 +1160,7 @@ dt_cg_assoc_op(dt_node_t *dnp, dt_irlist dt_cg_arglist(dnp->dn_ident, dnp->dn_args, dlp, drp); - if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + dnp->dn_reg = dt_regset_alloc(drp); if (dnp->dn_ident->di_flags & DT_IDFLG_TLS) op = DIF_OP_LDTAA; @@ -1273,9 +1290,7 @@ dt_cg_array_op(dt_node_t *dnp, dt_irlist if ((size = dt_node_type_size(dnp)) == sizeof (uint64_t)) return; - if ((reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); - + reg = dt_regset_alloc(drp); assert(size < sizeof (uint64_t)); n = sizeof (uint64_t) * NBBY - size * NBBY; @@ -1384,7 +1399,6 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * dt_ident_t *idp; ssize_t stroff; uint_t op; - int reg; switch (dnp->dn_op) { case DT_TOK_COMMA: @@ -1622,10 +1636,7 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * case DT_TOK_SIZEOF: { size_t size = dt_node_sizeof(dnp->dn_child); - - if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); - + dnp->dn_reg = dt_regset_alloc(drp); assert(size != 0); dt_cg_setx(dlp, dnp->dn_reg, size); break; @@ -1650,8 +1661,7 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * assert(dxp->dx_ident->di_flags & DT_IDFLG_CGREG); assert(dxp->dx_ident->di_id != 0); - if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + dnp->dn_reg = dt_regset_alloc(drp); if (dxp->dx_arg == -1) { instr = DIF_INSTR_MOV( @@ -1735,8 +1745,9 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * } if (m.ctm_offset != 0) { - if ((reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + int reg; + + reg = dt_regset_alloc(drp); /* * If the offset is not aligned on a byte boundary, it @@ -1782,8 +1793,7 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * break; case DT_TOK_STRING: - if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + dnp->dn_reg = dt_regset_alloc(drp); assert(dnp->dn_kind == DT_NODE_STRING); stroff = dt_strtab_insert(yypcb->pcb_strtab, dnp->dn_string); @@ -1806,8 +1816,7 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * */ if (dnp->dn_kind == DT_NODE_VAR && (dnp->dn_ident->di_flags & DT_IDFLG_CGREG)) { - if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + dnp->dn_reg = dt_regset_alloc(drp); instr = DIF_INSTR_MOV(dnp->dn_ident->di_id, dnp->dn_reg); dt_irlist_append(dlp, @@ -1848,11 +1857,9 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * dt_cg_arglist(dnp->dn_ident, dnp->dn_args, dlp, drp); - if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); - - instr = DIF_INSTR_CALL( - dnp->dn_ident->di_id, dnp->dn_reg); + dnp->dn_reg = dt_regset_alloc(drp); + instr = DIF_INSTR_CALL(dnp->dn_ident->di_id, + dnp->dn_reg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); @@ -1880,8 +1887,7 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * break; } - if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + dnp->dn_reg = dt_regset_alloc(drp); if (dnp->dn_ident->di_flags & DT_IDFLG_LOCAL) op = DIF_OP_LDLS; @@ -1911,9 +1917,7 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * dtrace_errmsg(dtp, dtrace_errno(dtp))); } - if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); - + dnp->dn_reg = dt_regset_alloc(drp); dt_cg_xsetx(dlp, dnp->dn_ident, DT_LBL_NONE, dnp->dn_reg, sym.st_value); @@ -1933,9 +1937,7 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * break; case DT_TOK_INT: - if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1) - longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); - + dnp->dn_reg = dt_regset_alloc(drp); dt_cg_setx(dlp, dnp->dn_reg, dnp->dn_value); break; @@ -1950,6 +1952,7 @@ dt_cg(dt_pcb_t *pcb, dt_node_t *dnp) { dif_instr_t instr; dt_xlator_t *dxp; + dt_ident_t *idp; if (pcb->pcb_regs == NULL && (pcb->pcb_regs = dt_regset_create(pcb->pcb_hdl->dt_conf.dtc_difintregs)) == NULL) @@ -1976,9 +1979,9 @@ dt_cg(dt_pcb_t *pcb, dt_node_t *dnp) assert(pcb->pcb_dret == NULL); pcb->pcb_dret = dnp; - if (dt_node_is_dynamic(dnp)) { + if (dt_node_resolve(dnp, DT_IDENT_XLPTR) != NULL) { dnerror(dnp, D_CG_DYN, "expression cannot evaluate to result " - "of dynamic type\n"); + "of a translated pointer\n"); } /* @@ -1994,6 +1997,14 @@ dt_cg(dt_pcb_t *pcb, dt_node_t *dnp) } dt_cg_node(dnp, &pcb->pcb_ir, pcb->pcb_regs); + + if ((idp = dt_node_resolve(dnp, DT_IDENT_XLSOU)) != NULL) { + int reg = dt_cg_xlate_expand(dnp, idp, + &pcb->pcb_ir, pcb->pcb_regs); + dt_regset_free(pcb->pcb_regs, dnp->dn_reg); + dnp->dn_reg = reg; + } + instr = DIF_INSTR_RET(dnp->dn_reg); dt_regset_free(pcb->pcb_regs, dnp->dn_reg); dt_irlist_append(&pcb->pcb_ir, dt_cg_node_alloc(DT_LBL_NONE, instr)); @@ -2003,4 +2014,7 @@ dt_cg(dt_pcb_t *pcb, dt_node_t *dnp) dxp->dx_ident->di_id = 0; dxp->dx_ident->di_flags &= ~DT_IDFLG_CGREG; } + + dt_regset_free(pcb->pcb_regs, 0); + dt_regset_assert_free(pcb->pcb_regs); } Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c Sun May 19 16:45:17 2013 (r250811) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c Sun May 19 17:14:36 2013 (r250812) @@ -19,12 +19,15 @@ * * CDDL HEADER END */ + /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #include #include @@ -212,12 +215,22 @@ dt_dis_pushts(const dtrace_difo_t *dp, { static const char *const tnames[] = { "D type", "string" }; uint_t type = DIF_INSTR_TYPE(in); + const char *pad; - (void) fprintf(fp, "%-4s DT_TYPE(%u), %%r%u, %%r%u", - name, type, DIF_INSTR_R2(in), DIF_INSTR_RS(in)); + if (DIF_INSTR_OP(in) == DIF_OP_PUSHTV) { + (void) fprintf(fp, "%-4s DT_TYPE(%u), %%r%u", + name, type, DIF_INSTR_RS(in)); + pad = "\t\t"; + } else { + (void) fprintf(fp, "%-4s DT_TYPE(%u), %%r%u, %%r%u", + name, type, DIF_INSTR_R2(in), DIF_INSTR_RS(in)); + pad = "\t"; + } - if (type < sizeof (tnames) / sizeof (tnames[0])) - (void) fprintf(fp, "\t! DT_TYPE(%u) = %s", type, tnames[type]); + if (type < sizeof (tnames) / sizeof (tnames[0])) { + (void) fprintf(fp, "%s! DT_TYPE(%u) = %s", pad, + type, tnames[type]); + } } static void Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c Sun May 19 16:45:17 2013 (r250811) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c Sun May 19 17:14:36 2013 (r250812) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #include #include #include @@ -37,7 +41,6 @@ static const struct { { EDT_VERSREDUCED, "Requested version conflicts with earlier setting" }, { EDT_CTF, "Unexpected libctf error" }, { EDT_COMPILER, "Error in D program compilation" }, - { EDT_NOREG, "Insufficient registers to generate code" }, { EDT_NOTUPREG, "Insufficient tuple registers to generate code" }, { EDT_NOMEM, "Memory allocation failure" }, { EDT_INT2BIG, "Integer constant table limit exceeded" }, Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Sun May 19 16:45:17 2013 (r250811) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Sun May 19 17:14:36 2013 (r250812) @@ -26,7 +26,7 @@ /* * Copyright (c) 2011, Joyent, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _DT_ERRTAGS_H @@ -260,6 +260,7 @@ typedef enum { D_LLQUANT_FACTOREVEN, /* llquantize() bad # steps/factor */ D_LLQUANT_FACTORSMALL, /* llquantize() magnitude too small */ D_LLQUANT_MAGTOOBIG, /* llquantize() high mag too large */ + D_NOREG, /* no available internal registers */ D_PRINTM_ADDR, /* printm() memref bad type */ D_PRINTM_SIZE, /* printm() size bad type */ D_PRINTT_ADDR, /* printt() typeref bad type */ Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c Sun May 19 16:45:17 2013 (r250811) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c Sun May 19 17:14:36 2013 (r250812) @@ -19,12 +19,15 @@ * * CDDL HEADER END */ + /* * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #include #include @@ -33,18 +36,19 @@ #include #include +#include dt_regset_t * -dt_regset_create(ulong_t size) +dt_regset_create(ulong_t nregs) { - ulong_t n = BT_BITOUL(size + 1); /* + 1 for %r0 */ + ulong_t n = BT_BITOUL(nregs); dt_regset_t *drp = malloc(sizeof (dt_regset_t)); if (drp == NULL) return (NULL); drp->dr_bitmap = malloc(sizeof (ulong_t) * n); - drp->dr_size = size + 1; + drp->dr_size = nregs; if (drp->dr_bitmap == NULL) { dt_regset_destroy(drp); @@ -68,6 +72,25 @@ dt_regset_reset(dt_regset_t *drp) bzero(drp->dr_bitmap, sizeof (ulong_t) * BT_BITOUL(drp->dr_size)); } +void +dt_regset_assert_free(dt_regset_t *drp) +{ + int reg; + boolean_t fail = B_FALSE; + for (reg = 0; reg < drp->dr_size; reg++) { + if (BT_TEST(drp->dr_bitmap, reg) != 0) { + dt_dprintf("%%r%d was left allocated\n", reg); + fail = B_TRUE; + } + } + + /* + * We set this during dtest runs to check for register leaks. + */ + if (fail && getenv("DTRACE_DEBUG_REGSET") != NULL) + abort(); +} + int dt_regset_alloc(dt_regset_t *drp) { @@ -95,13 +118,15 @@ dt_regset_alloc(dt_regset_t *drp) } } - return (-1); /* no available registers */ + xyerror(D_NOREG, "Insufficient registers to generate code"); + /*NOTREACHED*/ + return (-1); } void dt_regset_free(dt_regset_t *drp, int reg) { - assert(reg > 0 && reg < drp->dr_size); + assert(reg >= 0 && reg < drp->dr_size); assert(BT_TEST(drp->dr_bitmap, reg) != 0); BT_CLEAR(drp->dr_bitmap, reg); } Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.h Sun May 19 16:45:17 2013 (r250811) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.h Sun May 19 17:14:36 2013 (r250812) @@ -19,16 +19,19 @@ * * CDDL HEADER END */ + /* * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _DT_REGSET_H #define _DT_REGSET_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef __cplusplus @@ -45,6 +48,7 @@ extern void dt_regset_destroy(dt_regset_ extern void dt_regset_reset(dt_regset_t *); extern int dt_regset_alloc(dt_regset_t *); extern void dt_regset_free(dt_regset_t *, int); +extern void dt_regset_assert_free(dt_regset_t *); #ifdef __cplusplus } From owner-svn-src-all@FreeBSD.ORG Sun May 19 19:19:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 519D45C4; Sun, 19 May 2013 19:19:02 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 428A1652; Sun, 19 May 2013 19:19:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4JJJ29W001081; Sun, 19 May 2013 19:19:02 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4JJJ2QO001080; Sun, 19 May 2013 19:19:02 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201305191919.r4JJJ2QO001080@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 19 May 2013 19:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250813 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 19:19:02 -0000 Author: melifaro Date: Sun May 19 19:19:01 2013 New Revision: 250813 URL: http://svnweb.freebsd.org/changeset/base/250813 Log: Finish r85740 : Make IPv6 netmask has address family set. This pleases routing daemons like bird. MFC after: 2 weeks Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun May 19 17:14:36 2013 (r250812) +++ head/sys/netinet6/in6.c Sun May 19 19:19:01 2013 (r250813) @@ -1140,6 +1140,7 @@ in6_update_ifa(struct ifnet *ifp, struct ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr; ia->ia_addr.sin6_family = AF_INET6; ia->ia_addr.sin6_len = sizeof(ia->ia_addr); + ia->ia_prefixmask.sin6_family = AF_INET6; ia->ia6_createtime = time_second; if ((ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) != 0) { /* From owner-svn-src-all@FreeBSD.ORG Sun May 19 19:42:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 584A5B5C; Sun, 19 May 2013 19:42:47 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4A8C0751; Sun, 19 May 2013 19:42:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4JJglH5010779; Sun, 19 May 2013 19:42:47 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4JJgl2D010778; Sun, 19 May 2013 19:42:47 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201305191942.r4JJgl2D010778@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 19 May 2013 19:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250815 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 19:42:47 -0000 Author: melifaro Date: Sun May 19 19:42:46 2013 New Revision: 250815 URL: http://svnweb.freebsd.org/changeset/base/250815 Log: Really fix netmask address family this time. MFC with: r250813 Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun May 19 19:19:58 2013 (r250814) +++ head/sys/netinet6/in6.c Sun May 19 19:42:46 2013 (r250815) @@ -1140,7 +1140,6 @@ in6_update_ifa(struct ifnet *ifp, struct ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr; ia->ia_addr.sin6_family = AF_INET6; ia->ia_addr.sin6_len = sizeof(ia->ia_addr); - ia->ia_prefixmask.sin6_family = AF_INET6; ia->ia6_createtime = time_second; if ((ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) != 0) { /* @@ -1187,6 +1186,7 @@ in6_update_ifa(struct ifnet *ifp, struct goto unlink; } ia->ia_prefixmask = ifra->ifra_prefixmask; + ia->ia_prefixmask.sin6_family = AF_INET6; } /* From owner-svn-src-all@FreeBSD.ORG Sun May 19 23:28:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2B99CF65; Sun, 19 May 2013 23:28:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1CD46E2D; Sun, 19 May 2013 23:28:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4JNSSKu091079; Sun, 19 May 2013 23:28:28 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4JNSSHM091078; Sun, 19 May 2013 23:28:28 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305192328.r4JNSSHM091078@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 19 May 2013 23:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250816 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 23:28:29 -0000 Author: pjd Date: Sun May 19 23:28:28 2013 New Revision: 250816 URL: http://svnweb.freebsd.org/changeset/base/250816 Log: Protect SDT_PROBE() with do { } while (0) loop. Modified: head/sys/sys/sdt.h Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Sun May 19 19:42:46 2013 (r250815) +++ head/sys/sys/sdt.h Sun May 19 23:28:28 2013 (r250816) @@ -184,11 +184,12 @@ struct sdt_provider { #define SDT_PROBE_DECLARE(prov, mod, func, name) \ extern struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1] -#define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \ +#define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) do { \ if (sdt_##prov##_##mod##_##func##_##name->id) \ (*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id, \ (uintptr_t) arg0, (uintptr_t) arg1, (uintptr_t) arg2, \ - (uintptr_t) arg3, (uintptr_t) arg4) + (uintptr_t) arg3, (uintptr_t) arg4); \ +} while (0) #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type) \ static struct sdt_argtype sdt_##prov##_##mod##_##func##_##name##num[1] \ From owner-svn-src-all@FreeBSD.ORG Sun May 19 23:29:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BF44315F; Sun, 19 May 2013 23:29:22 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 81910E33; Sun, 19 May 2013 23:29:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4JNTMtv091262; Sun, 19 May 2013 23:29:22 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4JNTM4F091261; Sun, 19 May 2013 23:29:22 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305192329.r4JNTM4F091261@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 19 May 2013 23:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250817 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 23:29:22 -0000 Author: pjd Date: Sun May 19 23:29:22 2013 New Revision: 250817 URL: http://svnweb.freebsd.org/changeset/base/250817 Log: Use SDT_PROBE1() instead of SDT_PROBE(). Modified: head/sys/kern/kern_priv.c Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Sun May 19 23:28:28 2013 (r250816) +++ head/sys/kern/kern_priv.c Sun May 19 23:29:22 2013 (r250817) @@ -159,13 +159,10 @@ priv_check_cred(struct ucred *cred, int */ error = EPERM; out: - if (error) { - SDT_PROBE(priv, kernel, priv_check, priv_err, priv, 0, 0, 0, - 0); - } else { - SDT_PROBE(priv, kernel, priv_check, priv_ok, priv, 0, 0, 0, - 0); - } + if (error) + SDT_PROBE1(priv, kernel, priv_check, priv_err, priv); + else + SDT_PROBE1(priv, kernel, priv_check, priv_ok, priv); return (error); } From owner-svn-src-all@FreeBSD.ORG Sun May 19 23:30:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AC1A92E3; Sun, 19 May 2013 23:30:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9EC36E3F; Sun, 19 May 2013 23:30:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4JNUOqd091709; Sun, 19 May 2013 23:30:24 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4JNUOvA091707; Sun, 19 May 2013 23:30:24 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305192330.r4JNUOvA091707@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 19 May 2013 23:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250818 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 23:30:24 -0000 Author: pjd Date: Sun May 19 23:30:24 2013 New Revision: 250818 URL: http://svnweb.freebsd.org/changeset/base/250818 Log: Style nits. Modified: head/sys/kern/kern_priv.c Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Sun May 19 23:29:22 2013 (r250817) +++ head/sys/kern/kern_priv.c Sun May 19 23:30:24 2013 (r250818) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); * uid 0 is offered no special privilege in the kernel security policy. * Setting it to zero may seriously impact the functionality of many existing * userland programs, and should not be done without careful consideration of - * the consequences. + * the consequences. */ static int suser_enabled = 1; SYSCTL_INT(_security_bsd, OID_AUTO, suser_enabled, CTLFLAG_RW, @@ -104,10 +104,10 @@ priv_check_cred(struct ucred *cred, int * mlockall(2)/munlockall(2). */ switch (priv) { - case PRIV_VM_MLOCK: - case PRIV_VM_MUNLOCK: - error = 0; - goto out; + case PRIV_VM_MLOCK: + case PRIV_VM_MUNLOCK: + error = 0; + goto out; } } @@ -132,7 +132,6 @@ priv_check_cred(struct ucred *cred, int goto out; } break; - default: if (cred->cr_uid == 0) { error = 0; From owner-svn-src-all@FreeBSD.ORG Mon May 20 00:33:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 856C9942; Mon, 20 May 2013 00:33:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 74DE9FC9; Mon, 20 May 2013 00:33:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4K0Xs0E014493; Mon, 20 May 2013 00:33:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4K0XspA014492; Mon, 20 May 2013 00:33:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305200033.r4K0XspA014492@svn.freebsd.org> From: Alexander Motin Date: Mon, 20 May 2013 00:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250819 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 00:33:55 -0000 Author: mav Date: Mon May 20 00:33:54 2013 New Revision: 250819 URL: http://svnweb.freebsd.org/changeset/base/250819 Log: Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit. In some cases it could cause kernel panic during failed drive replacement. Reported by: trasz MFC after: 1 week Modified: head/sys/geom/raid/md_ddf.c Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Sun May 19 23:30:24 2013 (r250818) +++ head/sys/geom/raid/md_ddf.c Mon May 20 00:33:54 2013 (r250819) @@ -515,7 +515,7 @@ ddf_meta_find_disk(struct ddf_vol_meta * int i, bvd, pos; i = 0; - for (bvd = 0; bvd < GET16(vmeta, vdc->Secondary_Element_Count); bvd++) { + for (bvd = 0; bvd < GET8(vmeta, vdc->Secondary_Element_Count); bvd++) { if (vmeta->bvdc[bvd] == NULL) { i += GET16(vmeta, vdc->Primary_Element_Count); // XXX continue; From owner-svn-src-all@FreeBSD.ORG Mon May 20 02:10:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5C66BD0; Mon, 20 May 2013 02:10:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A900C2CB; Mon, 20 May 2013 02:10:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4K2AIRI048309; Mon, 20 May 2013 02:10:18 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4K2AIec048307; Mon, 20 May 2013 02:10:18 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305200210.r4K2AIec048307@svn.freebsd.org> From: Mark Johnston Date: Mon, 20 May 2013 02:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250820 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 02:10:19 -0000 Author: markj Date: Mon May 20 02:10:18 2013 New Revision: 250820 URL: http://svnweb.freebsd.org/changeset/base/250820 Log: Remove a block of code that was not intended to be part of the previous revision. X-MFC with: r250812 Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c Mon May 20 00:33:54 2013 (r250819) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c Mon May 20 02:10:18 2013 (r250820) @@ -1998,13 +1998,6 @@ dt_cg(dt_pcb_t *pcb, dt_node_t *dnp) dt_cg_node(dnp, &pcb->pcb_ir, pcb->pcb_regs); - if ((idp = dt_node_resolve(dnp, DT_IDENT_XLSOU)) != NULL) { - int reg = dt_cg_xlate_expand(dnp, idp, - &pcb->pcb_ir, pcb->pcb_regs); - dt_regset_free(pcb->pcb_regs, dnp->dn_reg); - dnp->dn_reg = reg; - } - instr = DIF_INSTR_RET(dnp->dn_reg); dt_regset_free(pcb->pcb_regs, dnp->dn_reg); dt_irlist_append(&pcb->pcb_ir, dt_cg_node_alloc(DT_LBL_NONE, instr)); From owner-svn-src-all@FreeBSD.ORG Mon May 20 02:21:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 00F01EA3; Mon, 20 May 2013 02:21:00 +0000 (UTC) Date: Mon, 20 May 2013 02:21:00 +0000 From: Alexey Dokuchaev To: Warner Losh Subject: Re: svn commit: r247086 - head/sys/x86/isa Message-ID: <20130520022100.GA82181@FreeBSD.org> References: <201302210638.r1L6cOVx006678@svn.freebsd.org> <20130221064912.GA20360@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130221064912.GA20360@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 02:21:01 -0000 On Thu, Feb 21, 2013 at 06:49:12AM +0000, Alexey Dokuchaev wrote: > On Thu, Feb 21, 2013 at 06:38:24AM +0000, Warner Losh wrote: > > New Revision: 247086 > > URL: http://svnweb.freebsd.org/changeset/base/247086 > > > > Log: > > Correct comment about use of pmtimer, and the real reason it isn't > > used or desirable for amd64. > > Thanks! > > > + * pmtimer is used only with the old APM power management, and not with > > + * acpi, which is required for amd64, so skip it in that case. > > Does it also mean it should be removed from ACPI-driven i386 machines kernel > configs? Apparently not: I've been running FreeBSD 8.4-PRERELEASE without pmtimer for a while, and noticed that my laptop stops keeping time during suspend. I've never noticed that behavior before (presumably, with pmtimer). I've found this old thread [1] on -current@ from Jan 2001 where src/UPDATING is quoted: The new pmtimer device is necessary for laptops. Failure to include the device will cause suspended laptops losing time when they resume. I will soon rebuild the kernel and put pmtimer back to see it fixes time keeping for me. If it will, apparently it is still useful for i386, and not just for APM, but ACPI as well... ./danfe [1] http://www.mail-archive.com/freebsd-current@freebsd.org/msg23642.html From owner-svn-src-all@FreeBSD.ORG Mon May 20 02:34:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A77734AF; Mon, 20 May 2013 02:34:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 99CAB38F; Mon, 20 May 2013 02:34:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4K2Ykk5059104; Mon, 20 May 2013 02:34:46 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4K2YkpD059098; Mon, 20 May 2013 02:34:46 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201305200234.r4K2YkpD059098@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 20 May 2013 02:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250821 - stable/9/gnu/usr.bin/grep X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 02:34:46 -0000 Author: pfg Date: Mon May 20 02:34:45 2013 New Revision: 250821 URL: http://svnweb.freebsd.org/changeset/base/250821 Log: grep: change some int types. Change several int variables to size_t, ssize_t, or ptrdiff_t. This should fix the bug described in CVE-2012-5667 when an input line is so long that its length cannot be stored in an int variable. This is based on NetBSD's revision which says: This change to NetBSD's version of GNU grep 2.5.1 (licenced under GPLv2) was made without direct reference to any code licenced under GPLv3. Obtained from: NetBSD MFC after: 3 days Modified: stable/9/gnu/usr.bin/grep/dfa.c stable/9/gnu/usr.bin/grep/grep.c stable/9/gnu/usr.bin/grep/search.c Modified: stable/9/gnu/usr.bin/grep/dfa.c ============================================================================== --- stable/9/gnu/usr.bin/grep/dfa.c Mon May 20 02:10:18 2013 (r250820) +++ stable/9/gnu/usr.bin/grep/dfa.c Mon May 20 02:34:45 2013 (r250821) @@ -334,9 +334,10 @@ static int hard_LC_COLLATE; /* Nonzero i #ifdef MBS_SUPPORT /* These variables are used only if (MB_CUR_MAX > 1). */ static mbstate_t mbs; /* Mbstate for mbrlen(). */ -static int cur_mb_len; /* Byte length of the current scanning - multibyte character. */ -static int cur_mb_index; /* Byte index of the current scanning multibyte +static ssize_t cur_mb_len; /* Byte length of the current scanning + multibyte character. Must also handle + negative result from mbrlen(). */ +static ssize_t cur_mb_index; /* Byte index of the current scanning multibyte character. singlebyte character : cur_mb_index = 0 @@ -369,7 +370,7 @@ static unsigned char const *buf_end; /* /* This function update cur_mb_len, and cur_mb_index. p points current lexptr, len is the remaining buffer length. */ static void -update_mb_len_index (unsigned char const *p, int len) +update_mb_len_index (unsigned char const *p, size_t len) { /* If last character is a part of a multibyte character, we update cur_mb_index. */ @@ -2463,7 +2464,7 @@ match_mb_charset (struct dfa *d, int s, int match; /* Flag which represent that matching succeed. */ int match_len; /* Length of the character (or collating element) with which this operator match. */ - int op_len; /* Length of the operator. */ + size_t op_len; /* Length of the operator. */ char buffer[128]; wchar_t wcbuf[6]; Modified: stable/9/gnu/usr.bin/grep/grep.c ============================================================================== --- stable/9/gnu/usr.bin/grep/grep.c Mon May 20 02:10:18 2013 (r250820) +++ stable/9/gnu/usr.bin/grep/grep.c Mon May 20 02:34:45 2013 (r250821) @@ -1346,9 +1346,9 @@ int main (int argc, char **argv) { char *keys; - size_t keycc, oldcc, keyalloc; + size_t cc, keycc, oldcc, keyalloc; int with_filenames; - int opt, cc, status; + int opt, status; int default_context; FILE *fp; extern char *optarg; Modified: stable/9/gnu/usr.bin/grep/search.c ============================================================================== --- stable/9/gnu/usr.bin/grep/search.c Mon May 20 02:10:18 2013 (r250820) +++ stable/9/gnu/usr.bin/grep/search.c Mon May 20 02:34:45 2013 (r250821) @@ -112,7 +112,7 @@ static void kwsinit (void) { static char trans[NCHAR]; - int i; + size_t i; if (match_icase) for (i = 0; i < NCHAR; ++i) @@ -326,7 +326,8 @@ EGexecute (char const *buf, size_t size, { register char const *buflim, *beg, *end; char eol = eolbyte; - int backref, start, len; + int backref; + ptrdiff_t start, len; struct kwsmatch kwsm; size_t i, ret_val; static int use_dfa; From owner-svn-src-all@FreeBSD.ORG Mon May 20 03:03:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DAA68947; Mon, 20 May 2013 03:03:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD4DE7CD; Mon, 20 May 2013 03:03:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4K33On2070356; Mon, 20 May 2013 03:03:24 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4K33OJi070350; Mon, 20 May 2013 03:03:24 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201305200303.r4K33OJi070350@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 20 May 2013 03:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250822 - stable/9/gnu/usr.bin/grep X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 03:03:24 -0000 Author: pfg Date: Mon May 20 03:03:23 2013 New Revision: 250822 URL: http://svnweb.freebsd.org/changeset/base/250822 Log: Revert r250821 - This was not meant to be a direct commit. (wrong tree) Pointy hat: me Modified: stable/9/gnu/usr.bin/grep/dfa.c stable/9/gnu/usr.bin/grep/grep.c stable/9/gnu/usr.bin/grep/search.c Modified: stable/9/gnu/usr.bin/grep/dfa.c ============================================================================== --- stable/9/gnu/usr.bin/grep/dfa.c Mon May 20 02:34:45 2013 (r250821) +++ stable/9/gnu/usr.bin/grep/dfa.c Mon May 20 03:03:23 2013 (r250822) @@ -334,10 +334,9 @@ static int hard_LC_COLLATE; /* Nonzero i #ifdef MBS_SUPPORT /* These variables are used only if (MB_CUR_MAX > 1). */ static mbstate_t mbs; /* Mbstate for mbrlen(). */ -static ssize_t cur_mb_len; /* Byte length of the current scanning - multibyte character. Must also handle - negative result from mbrlen(). */ -static ssize_t cur_mb_index; /* Byte index of the current scanning multibyte +static int cur_mb_len; /* Byte length of the current scanning + multibyte character. */ +static int cur_mb_index; /* Byte index of the current scanning multibyte character. singlebyte character : cur_mb_index = 0 @@ -370,7 +369,7 @@ static unsigned char const *buf_end; /* /* This function update cur_mb_len, and cur_mb_index. p points current lexptr, len is the remaining buffer length. */ static void -update_mb_len_index (unsigned char const *p, size_t len) +update_mb_len_index (unsigned char const *p, int len) { /* If last character is a part of a multibyte character, we update cur_mb_index. */ @@ -2464,7 +2463,7 @@ match_mb_charset (struct dfa *d, int s, int match; /* Flag which represent that matching succeed. */ int match_len; /* Length of the character (or collating element) with which this operator match. */ - size_t op_len; /* Length of the operator. */ + int op_len; /* Length of the operator. */ char buffer[128]; wchar_t wcbuf[6]; Modified: stable/9/gnu/usr.bin/grep/grep.c ============================================================================== --- stable/9/gnu/usr.bin/grep/grep.c Mon May 20 02:34:45 2013 (r250821) +++ stable/9/gnu/usr.bin/grep/grep.c Mon May 20 03:03:23 2013 (r250822) @@ -1346,9 +1346,9 @@ int main (int argc, char **argv) { char *keys; - size_t cc, keycc, oldcc, keyalloc; + size_t keycc, oldcc, keyalloc; int with_filenames; - int opt, status; + int opt, cc, status; int default_context; FILE *fp; extern char *optarg; Modified: stable/9/gnu/usr.bin/grep/search.c ============================================================================== --- stable/9/gnu/usr.bin/grep/search.c Mon May 20 02:34:45 2013 (r250821) +++ stable/9/gnu/usr.bin/grep/search.c Mon May 20 03:03:23 2013 (r250822) @@ -112,7 +112,7 @@ static void kwsinit (void) { static char trans[NCHAR]; - size_t i; + int i; if (match_icase) for (i = 0; i < NCHAR; ++i) @@ -326,8 +326,7 @@ EGexecute (char const *buf, size_t size, { register char const *buflim, *beg, *end; char eol = eolbyte; - int backref; - ptrdiff_t start, len; + int backref, start, len; struct kwsmatch kwsm; size_t i, ret_val; static int use_dfa; From owner-svn-src-all@FreeBSD.ORG Mon May 20 03:15:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 37776E0B; Mon, 20 May 2013 03:15:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 292A0889; Mon, 20 May 2013 03:15:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4K3FQ7I074580; Mon, 20 May 2013 03:15:26 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4K3FPQc074576; Mon, 20 May 2013 03:15:25 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201305200315.r4K3FPQc074576@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 20 May 2013 03:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250823 - head/gnu/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 03:15:26 -0000 Author: pfg Date: Mon May 20 03:15:25 2013 New Revision: 250823 URL: http://svnweb.freebsd.org/changeset/base/250823 Log: grep: change some int types. Change several int variables to size_t, ssize_t, or ptrdiff_t. This should fix the bug described in CVE-2012-5667 when an input line is so long that its length cannot be stored in an int variable. This is based on NetBSD's revision which says: This change to NetBSD's version of GNU grep 2.5.1 (licenced under GPLv2) was made without direct reference to any code licenced under GPLv3. Obtained from: NetBSD MFC after: 3 days Modified: head/gnu/usr.bin/grep/dfa.c head/gnu/usr.bin/grep/grep.c head/gnu/usr.bin/grep/search.c Modified: head/gnu/usr.bin/grep/dfa.c ============================================================================== --- head/gnu/usr.bin/grep/dfa.c Mon May 20 03:03:23 2013 (r250822) +++ head/gnu/usr.bin/grep/dfa.c Mon May 20 03:15:25 2013 (r250823) @@ -334,9 +334,10 @@ static int hard_LC_COLLATE; /* Nonzero i #ifdef MBS_SUPPORT /* These variables are used only if (MB_CUR_MAX > 1). */ static mbstate_t mbs; /* Mbstate for mbrlen(). */ -static int cur_mb_len; /* Byte length of the current scanning - multibyte character. */ -static int cur_mb_index; /* Byte index of the current scanning multibyte +static ssize_t cur_mb_len; /* Byte length of the current scanning + multibyte character. Must also handle + negative result from mbrlen(). */ +static ssize_t cur_mb_index; /* Byte index of the current scanning multibyte character. singlebyte character : cur_mb_index = 0 @@ -369,7 +370,7 @@ static unsigned char const *buf_end; /* /* This function update cur_mb_len, and cur_mb_index. p points current lexptr, len is the remaining buffer length. */ static void -update_mb_len_index (unsigned char const *p, int len) +update_mb_len_index (unsigned char const *p, size_t len) { /* If last character is a part of a multibyte character, we update cur_mb_index. */ @@ -2463,7 +2464,7 @@ match_mb_charset (struct dfa *d, int s, int match; /* Flag which represent that matching succeed. */ int match_len; /* Length of the character (or collating element) with which this operator match. */ - int op_len; /* Length of the operator. */ + size_t op_len; /* Length of the operator. */ char buffer[128]; wchar_t wcbuf[6]; Modified: head/gnu/usr.bin/grep/grep.c ============================================================================== --- head/gnu/usr.bin/grep/grep.c Mon May 20 03:03:23 2013 (r250822) +++ head/gnu/usr.bin/grep/grep.c Mon May 20 03:15:25 2013 (r250823) @@ -1350,9 +1350,9 @@ int main (int argc, char **argv) { char *keys; - size_t keycc, oldcc, keyalloc; + size_t cc, keycc, oldcc, keyalloc; int with_filenames; - int opt, cc, status; + int opt, status; int default_context; FILE *fp; extern char *optarg; Modified: head/gnu/usr.bin/grep/search.c ============================================================================== --- head/gnu/usr.bin/grep/search.c Mon May 20 03:03:23 2013 (r250822) +++ head/gnu/usr.bin/grep/search.c Mon May 20 03:15:25 2013 (r250823) @@ -112,7 +112,7 @@ static void kwsinit (void) { static char trans[NCHAR]; - int i; + size_t i; if (match_icase) for (i = 0; i < NCHAR; ++i) @@ -326,7 +326,8 @@ EGexecute (char const *buf, size_t size, { register char const *buflim, *beg, *end; char eol = eolbyte; - int backref, start, len; + int backref; + ptrdiff_t start, len; struct kwsmatch kwsm; size_t i, ret_val; static int use_dfa; From owner-svn-src-all@FreeBSD.ORG Mon May 20 07:10:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 456785FD; Mon, 20 May 2013 07:10:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 38487A7; Mon, 20 May 2013 07:10:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4K7Ahwt055265; Mon, 20 May 2013 07:10:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4K7AhhG055264; Mon, 20 May 2013 07:10:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305200710.r4K7AhhG055264@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 May 2013 07:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250824 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 07:10:44 -0000 Author: adrian Date: Mon May 20 07:10:43 2013 New Revision: 250824 URL: http://svnweb.freebsd.org/changeset/base/250824 Log: Make the HT rate duration calculation work for MCS rates > 15. Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Mon May 20 03:15:25 2013 (r250823) +++ head/sys/dev/ath/ath_hal/ah.c Mon May 20 07:10:43 2013 (r250824) @@ -327,9 +327,9 @@ ath_computedur_ht(uint32_t frameLen, uin KASSERT((rate &~ IEEE80211_RATE_MCS) < 31, ("bad mcs 0x%x", rate)); if (isht40) - bitsPerSymbol = ht40_bps[rate & 0xf]; + bitsPerSymbol = ht40_bps[rate & 0x1f]; else - bitsPerSymbol = ht20_bps[rate & 0xf]; + bitsPerSymbol = ht20_bps[rate & 0x1f]; numBits = OFDM_PLCP_BITS + (frameLen << 3); numSymbols = howmany(numBits, bitsPerSymbol); if (isShortGI) From owner-svn-src-all@FreeBSD.ORG Mon May 20 11:06:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 725925DA; Mon, 20 May 2013 11:06:51 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-ve0-x232.google.com (mail-ve0-x232.google.com [IPv6:2607:f8b0:400c:c01::232]) by mx1.freebsd.org (Postfix) with ESMTP id 01C44DBA; Mon, 20 May 2013 11:06:50 +0000 (UTC) Received: by mail-ve0-f178.google.com with SMTP id d10so3999219vea.23 for ; Mon, 20 May 2013 04:06:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=zZyBxbT+PcQIsdADy00NOPoyyh60UAyIuPAE7/5WT+4=; b=CFwF1BzJdROjaomZ19/dfxAgrRMfA5QhJWhReVBtlwopZSDAyU26Q+T3Q3ANHxru6h qBAxUV4L5jSQIqvm7kTNzZXlMeAl1cmrvFsv7OmzzuUusBftoeD88ExC+ltHgV0xHJRj xKX0QfbolphkdLd7DBbc/8oDb44Psy26E0mvFwVUz0EvnGz5TDBy4Qrg0MFQvaiDdw9W hhrCHTM5SZW4nej4X32Km+AB6Ht/CLR+dVonO/gpXerg5cbCwlRLswFp1gsw3vKkGPW7 jIRGNuy7nz4wVmNq68UjLueIa8fvYt4xN4y1nc9qYiJMFvUEekPatnZKsATnOcB0svqp o9cg== MIME-Version: 1.0 X-Received: by 10.52.185.164 with SMTP id fd4mr4361095vdc.19.1369048010500; Mon, 20 May 2013 04:06:50 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.220.72.7 with HTTP; Mon, 20 May 2013 04:06:50 -0700 (PDT) In-Reply-To: <20130519094813.GA1465@mole.fafoe.narf.at> References: <201305190744.r4J7i2FD055067@svn.freebsd.org> <20130519094813.GA1465@mole.fafoe.narf.at> Date: Mon, 20 May 2013 13:06:50 +0200 X-Google-Sender-Auth: S5jEnNCcxayxokggwv1l6iZp1P0 Message-ID: Subject: Re: svn commit: r250806 - head/sys/sys From: Ed Schouten To: Stefan Farfeleder Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 11:06:51 -0000 Hi Stefan, 2013/5/19 Stefan Farfeleder : > Shouldn't we fix lint and our headers to use a different macro name? One > starting with __? Fixing lint: yes. Changing our macros to use a different name: no. The reason why we had __volatile, __inline, etc. in the first place, was because adding definitions for volatile and inline directly would be against the standard, as these words can be used freely in From owner-svn-src-all@FreeBSD.ORG Mon May 20 13:05:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1952EA0F; Mon, 20 May 2013 13:05:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F0BFF7C3; Mon, 20 May 2013 13:05:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KD5pDi080150; Mon, 20 May 2013 13:05:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KD5pDp080148; Mon, 20 May 2013 13:05:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305201305.r4KD5pDp080148@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 20 May 2013 13:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250825 - head/tools/regression/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 13:05:52 -0000 Author: jilles Date: Mon May 20 13:05:51 2013 New Revision: 250825 URL: http://svnweb.freebsd.org/changeset/base/250825 Log: Add a test program for popen(). Added: head/tools/regression/lib/libc/gen/test-popen.c (contents, props changed) Modified: head/tools/regression/lib/libc/gen/Makefile Modified: head/tools/regression/lib/libc/gen/Makefile ============================================================================== --- head/tools/regression/lib/libc/gen/Makefile Mon May 20 07:10:43 2013 (r250824) +++ head/tools/regression/lib/libc/gen/Makefile Mon May 20 13:05:51 2013 (r250825) @@ -1,7 +1,7 @@ # $FreeBSD$ TESTS= test-arc4random test-fmtcheck test-fmtmsg test-fnmatch \ - test-fpclassify test-ftw test-posix_spawn test-wordexp + test-fpclassify test-ftw test-popen test-posix_spawn test-wordexp .PHONY: tests tests: ${TESTS} Added: head/tools/regression/lib/libc/gen/test-popen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/gen/test-popen.c Mon May 20 13:05:51 2013 (r250825) @@ -0,0 +1,227 @@ +/*- + * Copyright (c) 2013 Jilles Tjoelker + * 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. + */ + +/* + * Limited test program for popen() as specified by IEEE Std. 1003.1-2008, + * with BSD extensions. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include + +static int failures; +static volatile sig_atomic_t got_sigpipe; + +static void +sigpipe_handler(int sig __unused) +{ + got_sigpipe = 1; +} + +static void +check_cloexec(FILE *fp, const char *mode) +{ + int flags; + + flags = fcntl(fileno(fp), F_GETFD); + if (flags == -1) + fprintf(stderr, "fcntl(F_GETFD) failed\n"), failures++; + else if ((flags & FD_CLOEXEC) != + (strchr(mode, 'e') != NULL ? FD_CLOEXEC : 0)) + fprintf(stderr, "Bad cloexec flag\n"), failures++; +} + +int +main(int argc, char *argv[]) +{ + FILE *fp, *fp2; + int i, j, status; + const char *mode; + const char *allmodes[] = { "r", "w", "r+" }; + const char *rmodes[] = { "r", "r+" }; + const char *wmodes[] = { "w", "r+" }; + const char *rwmodes[] = { "r+" }; + char buf[80]; + struct sigaction act, oact; + + for (i = 0; i < sizeof(allmodes) / sizeof(allmodes[0]); i++) { + mode = allmodes[i]; + fp = popen("exit 7", mode); + if (fp == NULL) { + fprintf(stderr, "popen(, \"%s\") failed", mode); + failures++; + continue; + } + check_cloexec(fp, mode); + status = pclose(fp); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 7) + fprintf(stderr, "Bad exit status (no I/O)\n"), failures++; + } + + for (i = 0; i < sizeof(rmodes) / sizeof(rmodes[0]); i++) { + mode = rmodes[i]; + fp = popen("exit 9", mode); + if (fp == NULL) { + fprintf(stderr, "popen(, \"%s\") failed", mode); + failures++; + continue; + } + check_cloexec(fp, mode); + if (fgetc(fp) != EOF || !feof(fp) || ferror(fp)) + fprintf(stderr, "Input error 1\n"), failures++; + status = pclose(fp); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 9) + fprintf(stderr, "Bad exit status (input)\n"), failures++; + } + + for (i = 0; i < sizeof(rmodes) / sizeof(rmodes[0]); i++) { + mode = rmodes[i]; + fp = popen("echo hi there", mode); + if (fp == NULL) { + fprintf(stderr, "popen(, \"%s\") failed", mode); + failures++; + continue; + } + check_cloexec(fp, mode); + if (fgets(buf, sizeof(buf), fp) == NULL) + fprintf(stderr, "Input error 2\n"), failures++; + else if (strcmp(buf, "hi there\n") != 0) + fprintf(stderr, "Bad input 1\n"), failures++; + status = pclose(fp); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + fprintf(stderr, "Bad exit status (input)\n"), failures++; + } + + for (i = 0; i < sizeof(wmodes) / sizeof(wmodes[0]); i++) { + mode = wmodes[i]; + fp = popen("read x && [ \"$x\" = abcd ]", mode); + if (fp == NULL) { + fprintf(stderr, "popen(, \"%s\") failed", mode); + failures++; + continue; + } + check_cloexec(fp, mode); + if (fputs("abcd\n", fp) == EOF) + fprintf(stderr, "Output error 1\n"), failures++; + status = pclose(fp); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + fprintf(stderr, "Bad exit status (output)\n"), failures++; + } + + act.sa_handler = sigpipe_handler; + act.sa_flags = SA_RESTART; + sigemptyset(&act.sa_mask); + if (sigaction(SIGPIPE, &act, &oact) == -1) + fprintf(stderr, "sigaction() failed\n"), failures++; + for (i = 0; i < sizeof(wmodes) / sizeof(wmodes[0]); i++) { + mode = wmodes[i]; + fp = popen("exit 88", mode); + if (fp == NULL) { + fprintf(stderr, "popen(, \"%s\") failed", mode); + failures++; + continue; + } + check_cloexec(fp, mode); + got_sigpipe = 0; + while (fputs("abcd\n", fp) != EOF) + ; + if (!ferror(fp) || errno != EPIPE) + fprintf(stderr, "Expected EPIPE\n"), failures++; + if (!got_sigpipe) + fprintf(stderr, "Expected SIGPIPE\n"), failures++; + status = pclose(fp); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 88) + fprintf(stderr, "Bad exit status (EPIPE)\n"), failures++; + } + if (sigaction(SIGPIPE, &oact, NULL) == -1) + fprintf(stderr, "sigaction() failed\n"), failures++; + + for (i = 0; i < sizeof(rwmodes) / sizeof(rwmodes[0]); i++) { + mode = rwmodes[i]; + fp = popen("read x && printf '%s\\n' \"Q${x#a}\"", mode); + if (fp == NULL) { + fprintf(stderr, "popen(, \"%s\") failed", mode); + failures++; + continue; + } + check_cloexec(fp, mode); + if (fputs("abcd\n", fp) == EOF) + fprintf(stderr, "Output error 2\n"), failures++; + if (fgets(buf, sizeof(buf), fp) == NULL) + fprintf(stderr, "Input error 3\n"), failures++; + else if (strcmp(buf, "Qbcd\n") != 0) + fprintf(stderr, "Bad input 2\n"), failures++; + status = pclose(fp); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + fprintf(stderr, "Bad exit status (I/O)\n"), failures++; + } + + for (i = 0; i < sizeof(wmodes) / sizeof(wmodes[0]); i++) { + for (j = 0; j < sizeof(wmodes) / sizeof(wmodes[0]); j++) { + mode = wmodes[i]; + fp = popen("read x", mode); + if (fp == NULL) { + fprintf(stderr, "popen(, \"%s\") failed", mode); + failures++; + continue; + } + mode = wmodes[j]; + fp2 = popen("read x", mode); + if (fp2 == NULL) { + fprintf(stderr, "popen(, \"%s\") failed", mode); + failures++; + pclose(fp); + continue; + } + /* If fp2 inherits fp's pipe, we will deadlock here. */ + status = pclose(fp); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 1) { + fprintf(stderr, "Bad exit status (2 pipes)\n"); + failures++; + } + status = pclose(fp2); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 1) { + fprintf(stderr, "Bad exit status (2 pipes)\n"); + failures++; + } + } + } + + if (failures == 0) + printf("PASS popen()\n"); + + return (failures != 0); +} From owner-svn-src-all@FreeBSD.ORG Mon May 20 13:21:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3DD8CE05 for ; Mon, 20 May 2013 13:21:00 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by mx1.freebsd.org (Postfix) with ESMTP id 19DE287E for ; Mon, 20 May 2013 13:20:59 +0000 (UTC) Received: by mail-pd0-f173.google.com with SMTP id v10so5388936pde.32 for ; Mon, 20 May 2013 06:20:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=HF7Xfkqil7aBibElnZExaw9mU4zDgTMoyp8QCByWGi4=; b=dhBxwU64yNLpbLAyCLVw5yrtNL6hyHQ6WvZo+DYXGO5X5BICA2rGQrk4MM9VjkK54o C72pIxlFFZJscAQkFH8t1Ph6rpclBOirucJM5/i80kQS8LyjhI7rBAzEtgZwxew3i8CK Q2Z70fDDWxIfs2eoa4r1jrdsOzI+MDqiMrp5aroak9rEKJzTa6gbVNXJc+nuVEeiCn4i 8gXZyjNqIqam0wP8X0pDSWTBFk2iAQTNsguE+U7rucKrLd8SlpmwpBACoFi7fXKSD7qP TFGt0GJ0aPQXuHesIVx+VYUDG6N7lhogZ7BlbRck8833tQuco9R2ntIZ9pICv4VZhuax wuxA== X-Received: by 10.66.220.197 with SMTP id py5mr28569192pac.86.1369056052988; Mon, 20 May 2013 06:20:52 -0700 (PDT) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id ya4sm24130382pbb.24.2013.05.20.06.20.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 May 2013 06:20:51 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r247086 - head/sys/x86/isa Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20130520022100.GA82181@FreeBSD.org> Date: Mon, 20 May 2013 07:20:48 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <73F6A8D9-3366-47AB-9DE9-E570006E3A3F@bsdimp.com> References: <201302210638.r1L6cOVx006678@svn.freebsd.org> <20130221064912.GA20360@FreeBSD.org> <20130520022100.GA82181@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQmOZ4u1UchKk3YDwcRIUUYUk4+BCgjE4nyXjoM30wErJxTvkmP8HsrSjioXpMHtytxLCT++ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 13:21:00 -0000 On May 19, 2013, at 8:21 PM, Alexey Dokuchaev wrote: > On Thu, Feb 21, 2013 at 06:49:12AM +0000, Alexey Dokuchaev wrote: >> On Thu, Feb 21, 2013 at 06:38:24AM +0000, Warner Losh wrote: >>> New Revision: 247086 >>> URL: http://svnweb.freebsd.org/changeset/base/247086 >>>=20 >>> Log: >>> Correct comment about use of pmtimer, and the real reason it isn't >>> used or desirable for amd64. >>=20 >> Thanks! >>=20 >>> + * pmtimer is used only with the old APM power management, and not = with >>> + * acpi, which is required for amd64, so skip it in that case. >>=20 >> Does it also mean it should be removed from ACPI-driven i386 machines = kernel >> configs? >=20 > Apparently not: I've been running FreeBSD 8.4-PRERELEASE without = pmtimer for > a while, and noticed that my laptop stops keeping time during suspend. = I've > never noticed that behavior before (presumably, with pmtimer). >=20 > I've found this old thread [1] on -current@ from Jan 2001 where = src/UPDATING > is quoted: >=20 > The new pmtimer device is necessary for laptops. Failure to > include the device will cause suspended laptops losing time > when they resume. >=20 > I will soon rebuild the kernel and put pmtimer back to see it fixes = time > keeping for me. If it will, apparently it is still useful for i386, = and > not just for APM, but ACPI as well... It fights ACPI in what it does... It was needed for APM... Let me know = how it turns out... Warner > ./danfe >=20 > [1] = http://www.mail-archive.com/freebsd-current@freebsd.org/msg23642.html From owner-svn-src-all@FreeBSD.ORG Mon May 20 14:03:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 72083ADC; Mon, 20 May 2013 14:03:08 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep17.mx.upcmail.net (fep17.mx.upcmail.net [62.179.121.37]) by mx1.freebsd.org (Postfix) with ESMTP id 655EDB3B; Mon, 20 May 2013 14:03:07 +0000 (UTC) Received: from edge01.upcmail.net ([192.168.13.236]) by viefep17-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20130520140305.RZB11712.viefep17-int.chello.at@edge01.upcmail.net>; Mon, 20 May 2013 16:03:05 +0200 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge01.upcmail.net with edge id eE351l00Z2xdvHc01E35ej; Mon, 20 May 2013 16:03:05 +0200 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 175E56D449; Mon, 20 May 2013 16:03:05 +0200 (CEST) Date: Mon, 20 May 2013 16:03:04 +0200 From: Stefan Farfeleder To: Ed Schouten Subject: Re: svn commit: r250806 - head/sys/sys Message-ID: <20130520140304.GA1429@mole.fafoe.narf.at> References: <201305190744.r4J7i2FD055067@svn.freebsd.org> <20130519094813.GA1465@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 14:03:08 -0000 On Mon, May 20, 2013 at 01:06:50PM +0200, Ed Schouten wrote: > Hi Stefan, > > 2013/5/19 Stefan Farfeleder : > > Shouldn't we fix lint and our headers to use a different macro name? One > > starting with __? > > Fixing lint: yes. Changing our macros to use a different name: no. > The reason why we had __volatile, __inline, etc. in the first place, > was because adding definitions for volatile and inline directly would > be against the standard, as these words can be used freely in C11 only added keywords starting with _[A-Z], which is reserved by all > the older standards, meaning we are completely free to define them in > any way we like. > > This specific breakage was unrelated to the naming of the keyword. The > breakage existed, because existing tools do a build with -Dlint set. > Because we use _Thread_local in our own header files already > (runetype.h, I think), this caused a variable declared in a header > file to be of the wrong kind (TLS vs non-TLS). > > In my opinion we should not add __[a-z] definitions for things that > are part of C11. Doing this only makes our code less easily exportable > to other systems. Hi Ed, I think you misunderstood what I meant. We now have quiet a few occurrences of `#ifdef lint' or equivalent in /usr/include. I think those should be changed to `#ifdef __lint' to allow application code to do #define lint foo #include which is perfectly fine POSIX code (at least to my knowledge) and should not change the behaviour of the included header. Stefan From owner-svn-src-all@FreeBSD.ORG Mon May 20 15:11:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 506A8AA7; Mon, 20 May 2013 15:11:31 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 42EAFFB3; Mon, 20 May 2013 15:11:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KFBUL7025192; Mon, 20 May 2013 15:11:30 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KFBUgh025191; Mon, 20 May 2013 15:11:30 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201305201511.r4KFBUgh025191@svn.freebsd.org> From: Maxim Konovalov Date: Mon, 20 May 2013 15:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250826 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 15:11:31 -0000 Author: maxim Date: Mon May 20 15:11:30 2013 New Revision: 250826 URL: http://svnweb.freebsd.org/changeset/base/250826 Log: NetBSD 6.1 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon May 20 13:05:51 2013 (r250825) +++ head/share/misc/bsd-family-tree Mon May 20 15:11:30 2013 (r250826) @@ -262,7 +262,7 @@ FreeBSD 5.2 | | | 9.1 | | | | | | | | | | | | OpenBSD 5.3 DragonFly 3.4.1 - | | | | | + | | NetBSD 6.1 | | | | | | | | | | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | @@ -567,6 +567,7 @@ DragonFly 3.2.1 2012-11-02 [DFB] FreeBSD 9.1 2012-12-30 [FBD] DragonFly 3.4.1 2013-04-29 [DFB] OpenBSD 5.3 2013-05-01 [OBD] +NetBSD 6.1 2013-05-18 [NBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Mon May 20 15:36:01 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6507241A; Mon, 20 May 2013 15:36:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 28DC1139; Mon, 20 May 2013 15:36:00 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 4DC9B12339C; Tue, 21 May 2013 01:15:12 +1000 (EST) Date: Tue, 21 May 2013 01:15:11 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Stefan Farfeleder Subject: Re: svn commit: r250806 - head/sys/sys In-Reply-To: <20130520140304.GA1429@mole.fafoe.narf.at> Message-ID: <20130521004803.K8511@besplex.bde.org> References: <201305190744.r4J7i2FD055067@svn.freebsd.org> <20130519094813.GA1465@mole.fafoe.narf.at> <20130520140304.GA1429@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=BPvrNysG c=1 sm=1 a=ScYog2KUUbcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=FSHVhTTuonsA:10 a=6I5d2MoRAAAA:8 a=3jfGjxefYG8Su_c3qMsA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, Ed Schouten , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 15:36:01 -0000 On Mon, 20 May 2013, Stefan Farfeleder wrote: > On Mon, May 20, 2013 at 01:06:50PM +0200, Ed Schouten wrote: >> Hi Stefan, >> >> 2013/5/19 Stefan Farfeleder : >>> Shouldn't we fix lint and our headers to use a different macro name? One >>> starting with __? >> >> Fixing lint: yes. Changing our macros to use a different name: no. > >> The reason why we had __volatile, __inline, etc. in the first place, >> was because adding definitions for volatile and inline directly would >> be against the standard, as these words can be used freely in > C11 only added keywords starting with _[A-Z], which is reserved by all >> the older standards, meaning we are completely free to define them in >> any way we like. Except when C11 or the compiler defines them. >> This specific breakage was unrelated to the naming of the keyword. The >> breakage existed, because existing tools do a build with -Dlint set. >> Because we use _Thread_local in our own header files already >> (runetype.h, I think), this caused a variable declared in a header >> file to be of the wrong kind (TLS vs non-TLS). Isn't this a bug in the tools too (if they define lint to get linting)? lint itself predefines lint, so defining it in source code seems wrong. Since it is not reserved, they can define it for their own purposes, but then it might interfere with actually running lint. >> In my opinion we should not add __[a-z] definitions for things that >> are part of C11. Doing this only makes our code less easily exportable >> to other systems. Only using reserved words (including new ones in C11) in applications gives unportability. Ones like __FBSDID() that are meant to be used shouldn't exist. > I think you misunderstood what I meant. We now have quiet a few > occurrences of `#ifdef lint' or equivalent in /usr/include. I think those > should be changed to `#ifdef __lint' to allow application code to do > > #define lint foo > #include > > which is perfectly fine POSIX code (at least to my knowledge) and should > not change the behaviour of the included header. lint actually predefines __LINT__, not __lint. Of course it is a bug that system headers depend on symbols in the application namespace like lint. My version never had the lint ifdef(s) in sys/cdefs.h. I don't like them for other reasons. They results in lint checking different source code to what the compiler sees. FreeBSD's lint barely supports C90, but C99 features like C99 initializers are now used extensively, at least in the kernel. Use of features like this can't be hidden from lint using a few ifdefs in headers. Bruce From owner-svn-src-all@FreeBSD.ORG Mon May 20 15:51:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BAA1AA40; Mon, 20 May 2013 15:51:04 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep18.mx.upcmail.net (fep18.mx.upcmail.net [62.179.121.38]) by mx1.freebsd.org (Postfix) with ESMTP id AC1F11E0; Mon, 20 May 2013 15:51:03 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep18-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20130520155056.SGPY2186.viefep18-int.chello.at@edge04.upcmail.net>; Mon, 20 May 2013 17:50:56 +0200 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge04.upcmail.net with edge id eFqu1l01H2xdvHc03FquZq; Mon, 20 May 2013 17:50:56 +0200 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id B89F96D449; Mon, 20 May 2013 17:50:54 +0200 (CEST) Date: Mon, 20 May 2013 17:50:54 +0200 From: Stefan Farfeleder To: Bruce Evans Subject: Re: svn commit: r250806 - head/sys/sys Message-ID: <20130520155053.GC1429@mole.fafoe.narf.at> References: <201305190744.r4J7i2FD055067@svn.freebsd.org> <20130519094813.GA1465@mole.fafoe.narf.at> <20130520140304.GA1429@mole.fafoe.narf.at> <20130521004803.K8511@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20130521004803.K8511@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Ed Schouten , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 15:51:04 -0000 On Tue, May 21, 2013 at 01:15:11AM +1000, Bruce Evans wrote: > On Mon, 20 May 2013, Stefan Farfeleder wrote: > > > I think you misunderstood what I meant. We now have quiet a few > > occurrences of `#ifdef lint' or equivalent in /usr/include. I think those > > should be changed to `#ifdef __lint' to allow application code to do > > > > #define lint foo > > #include > > > > which is perfectly fine POSIX code (at least to my knowledge) and should > > not change the behaviour of the included header. > > lint actually predefines __LINT__, not __lint. __LINT__ is fine with me. I didn't bother to read lint's source, but the man page states: "The lint utility runs the C preprocessor as its first phase, with the preprocessor symbol lint defined to allow certain questionable code to be altered or skipped by lint. Therefore, this symbol should be thought of as a reserved word for all code that is to be checked by lint." > Of course it is a bug that system headers depend on symbols in the > application namespace like lint. My version never had the lint ifdef(s) > in sys/cdefs.h. I don't like them for other reasons. They results in > lint checking different source code to what the compiler sees. FreeBSD's > lint barely supports C90, but C99 features like C99 initializers are now > used extensively, at least in the kernel. Use of features like this > can't be hidden from lint using a few ifdefs in headers. Since nobody wants to update lint to recent C standards, maybe it's time to remove it? Stefan From owner-svn-src-all@FreeBSD.ORG Mon May 20 16:20:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CE26D43D; Mon, 20 May 2013 16:20:03 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-qa0-x236.google.com (mail-qa0-x236.google.com [IPv6:2607:f8b0:400d:c00::236]) by mx1.freebsd.org (Postfix) with ESMTP id 5E069336; Mon, 20 May 2013 16:20:03 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id hu16so1637265qab.13 for ; Mon, 20 May 2013 09:20:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=qG4rkxI4Xs8XFh+oIDKQInKMyXSe925OR3mJn/78NQo=; b=y/xBrLEatpKNE/a1m0s3NrVyIKkfyao7dNvvKXh4JVgImgofKuDJcDLiGqiNkAABSK 9GtamLc4rL8/cjJDHnIyVMvcPB1RDpnQUxI9acYH2iKrNa5qUw9MQAnyOP8XsLIUYoim ARofgBOCv0/9TcC83xavHco/27QQHE51vGr3UH9tLj2Xx1y1qa6yCc6IxrNLIPOf9Sug wfElWFk0xh3cClAv2D2P7HWWfGJn5wxXXV5mmRAgS5MLn0bAALMd8A6nuayYduAoZSLA tSFLTZRAc7XamT8ve0gHVk0k4T2MghaNs1byK7ueBxeAobT0MqpNH2k1iqMhjdmG4BfA 5bDA== MIME-Version: 1.0 X-Received: by 10.229.158.73 with SMTP id e9mr7497838qcx.116.1369066801143; Mon, 20 May 2013 09:20:01 -0700 (PDT) Received: by 10.49.3.193 with HTTP; Mon, 20 May 2013 09:20:01 -0700 (PDT) In-Reply-To: <20130520155053.GC1429@mole.fafoe.narf.at> References: <201305190744.r4J7i2FD055067@svn.freebsd.org> <20130519094813.GA1465@mole.fafoe.narf.at> <20130520140304.GA1429@mole.fafoe.narf.at> <20130521004803.K8511@besplex.bde.org> <20130520155053.GC1429@mole.fafoe.narf.at> Date: Mon, 20 May 2013 12:20:01 -0400 Message-ID: Subject: Re: svn commit: r250806 - head/sys/sys From: Benjamin Kaduk To: Stefan Farfeleder Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , Ed Schouten , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 16:20:03 -0000 On Mon, May 20, 2013 at 11:50 AM, Stefan Farfeleder wrote: > Since nobody wants to update lint to recent C standards, maybe it's time to > remove it? > It does seem like compilers can do a better job of finding lint-like things than lint itself, these days (especially clang). -Ben From owner-svn-src-all@FreeBSD.ORG Mon May 20 17:31:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 647FF455; Mon, 20 May 2013 17:31:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5675386B; Mon, 20 May 2013 17:31:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KHVJgc074034; Mon, 20 May 2013 17:31:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KHVIpT074031; Mon, 20 May 2013 17:31:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305201731.r4KHVIpT074031@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 20 May 2013 17:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250827 - in head: lib/libc/gen tools/regression/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 17:31:19 -0000 Author: jilles Date: Mon May 20 17:31:18 2013 New Revision: 250827 URL: http://svnweb.freebsd.org/changeset/base/250827 Log: popen(): Add 'e' mode character to set close-on-exec on the new fd. If 'e' is used, the kernel must support the recently added pipe2() system call. The use of pipe2() with O_CLOEXEC also fixes race conditions between concurrent popen() calls from different threads, even if the close-on-exec flag on the fd of the returned FILE is later cleared (because popen() closes all file descriptors from earlier popen() calls in the child process). Therefore, this approach should be used in all cases when pipe2() can be assumed present. The old version of popen() rejects "re" and "we" but treats "r+e" like "r+". Modified: head/lib/libc/gen/popen.3 head/lib/libc/gen/popen.c head/tools/regression/lib/libc/gen/test-popen.c Modified: head/lib/libc/gen/popen.3 ============================================================================== --- head/lib/libc/gen/popen.3 Mon May 20 15:11:30 2013 (r250826) +++ head/lib/libc/gen/popen.3 Mon May 20 17:31:18 2013 (r250827) @@ -28,7 +28,7 @@ .\" @(#)popen.3 8.2 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd May 3, 1995 +.Dd May 20, 2013 .Dt POPEN 3 .Os .Sh NAME @@ -79,6 +79,11 @@ for writing, or .Ql r+ for reading and writing. .Pp +A letter +.Ql e +may be appended to that to request that the underlying file descriptor +be set close-on-exec. +.Pp The .Fa command argument is a pointer to a null-terminated string Modified: head/lib/libc/gen/popen.c ============================================================================== --- head/lib/libc/gen/popen.c Mon May 20 15:11:30 2013 (r250826) +++ head/lib/libc/gen/popen.c Mon May 20 17:31:18 2013 (r250827) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -71,10 +72,11 @@ popen(command, type) { struct pid *cur; FILE *iop; - int pdes[2], pid, twoway; + int pdes[2], pid, twoway, cloexec; char *argv[4]; struct pid *p; + cloexec = strchr(type, 'e') != NULL; /* * Lite2 introduced two-way popen() pipes using _socketpair(). * FreeBSD's pipe() is bidirectional, so we use that. @@ -84,10 +86,11 @@ popen(command, type) type = "r+"; } else { twoway = 0; - if ((*type != 'r' && *type != 'w') || type[1]) + if ((*type != 'r' && *type != 'w') || + (type[1] && (type[1] != 'e' || type[2]))) return (NULL); } - if (pipe(pdes) < 0) + if ((cloexec ? pipe2(pdes, O_CLOEXEC) : pipe(pdes)) < 0) return (NULL); if ((cur = malloc(sizeof(struct pid))) == NULL) { @@ -120,20 +123,29 @@ popen(command, type) * the compiler is free to corrupt all the local * variables. */ - (void)_close(pdes[0]); + if (!cloexec) + (void)_close(pdes[0]); if (pdes[1] != STDOUT_FILENO) { (void)_dup2(pdes[1], STDOUT_FILENO); - (void)_close(pdes[1]); + if (!cloexec) + (void)_close(pdes[1]); if (twoway) (void)_dup2(STDOUT_FILENO, STDIN_FILENO); - } else if (twoway && (pdes[1] != STDIN_FILENO)) + } else if (twoway && (pdes[1] != STDIN_FILENO)) { (void)_dup2(pdes[1], STDIN_FILENO); + if (cloexec) + (void)_fcntl(pdes[1], F_SETFD, 0); + } else if (cloexec) + (void)_fcntl(pdes[1], F_SETFD, 0); } else { if (pdes[0] != STDIN_FILENO) { (void)_dup2(pdes[0], STDIN_FILENO); - (void)_close(pdes[0]); - } - (void)_close(pdes[1]); + if (!cloexec) + (void)_close(pdes[0]); + } else if (cloexec) + (void)_fcntl(pdes[0], F_SETFD, 0); + if (!cloexec) + (void)_close(pdes[1]); } SLIST_FOREACH(p, &pidlist, next) (void)_close(fileno(p->fp)); Modified: head/tools/regression/lib/libc/gen/test-popen.c ============================================================================== --- head/tools/regression/lib/libc/gen/test-popen.c Mon May 20 15:11:30 2013 (r250826) +++ head/tools/regression/lib/libc/gen/test-popen.c Mon May 20 17:31:18 2013 (r250827) @@ -70,10 +70,10 @@ main(int argc, char *argv[]) FILE *fp, *fp2; int i, j, status; const char *mode; - const char *allmodes[] = { "r", "w", "r+" }; - const char *rmodes[] = { "r", "r+" }; - const char *wmodes[] = { "w", "r+" }; - const char *rwmodes[] = { "r+" }; + const char *allmodes[] = { "r", "w", "r+", "re", "we", "r+e", "re+" }; + const char *rmodes[] = { "r", "r+", "re", "r+e", "re+" }; + const char *wmodes[] = { "w", "r+", "we", "r+e", "re+" }; + const char *rwmodes[] = { "r+", "r+e", "re+" }; char buf[80]; struct sigaction act, oact; From owner-svn-src-all@FreeBSD.ORG Mon May 20 19:41:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9417E6CE; Mon, 20 May 2013 19:41:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 867301896; Mon, 20 May 2013 19:41:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KJfYRc021408; Mon, 20 May 2013 19:41:34 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KJfYeK021407; Mon, 20 May 2013 19:41:34 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305201941.r4KJfYeK021407@svn.freebsd.org> From: Brooks Davis Date: Mon, 20 May 2013 19:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250828 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 19:41:34 -0000 Author: brooks Date: Mon May 20 19:41:34 2013 New Revision: 250828 URL: http://svnweb.freebsd.org/changeset/base/250828 Log: Spell extensions correctly. Submitted by: dim Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Mon May 20 17:31:18 2013 (r250827) +++ head/sys/conf/kern.mk Mon May 20 19:41:34 2013 (r250828) @@ -5,7 +5,7 @@ # CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ - -Wundef -Wno-pointer-sign ${FORMAT_EXTENTIONS} \ + -Wundef -Wno-pointer-sign ${FORMAT_EXTENSIONS} \ -Wmissing-include-dirs -fdiagnostics-show-option \ ${CWARNEXTRA} # @@ -37,7 +37,7 @@ CWARNEXTRA?= -Wno-error-tautological-com .if ${MK_FORMAT_EXTENSIONS} == "no" NO_WFORMAT= -Wno-format .else -FORMAT_EXTENTIONS= -fformat-extensions +FORMAT_EXTENSIONS= -fformat-extensions .endif # From owner-svn-src-all@FreeBSD.ORG Mon May 20 19:43:25 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 895E095D; Mon, 20 May 2013 19:43:25 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id CAD6518B1; Mon, 20 May 2013 19:43:24 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4KJhNWX004064; Mon, 20 May 2013 14:43:23 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4KJhNmC004063; Mon, 20 May 2013 14:43:23 -0500 (CDT) (envelope-from brooks) Date: Mon, 20 May 2013 14:43:23 -0500 From: Brooks Davis To: Dimitry Andric Subject: Re: svn commit: r250658 - in head: share/mk sys/conf tools/build/options Message-ID: <20130520194323.GD2630@lor.one-eyed-alien.net> References: <201305151304.r4FD4B1i032146@svn.freebsd.org> <519390B6.2060500@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EY/WZ/HvNxOox07X" Content-Disposition: inline In-Reply-To: <519390B6.2060500@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 19:43:25 -0000 --EY/WZ/HvNxOox07X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 15, 2013 at 03:42:14PM +0200, Dimitry Andric wrote: > On 2013-05-15 15:04, Brooks Davis wrote: > > Author: brooks > > Date: Wed May 15 13:04:10 2013 > > New Revision: 250658 > > URL: http://svnweb.freebsd.org/changeset/base/250658 > > > > Log: > > Add a new option WITHOUT_FORMAT_EXTENSIONS to disable flags related = to > > checking our kernel printf extensions. This is useful to allow > > compilers without these extensions to build kernels. >=20 > As I have written before, please let us consider this to be a band-aid, > and aim to remove non-standard printf specifiers from our kernel > sources. Otherwise we will lose most of the advantages of format > checking... :-( Yes, we either need to remove them or add a sufficiently standard way to extend printf format checking. I'm definitely not doing either of them. I've fixed the spelling of extensions in kern.mk in r250828. Thanks, Brooks --EY/WZ/HvNxOox07X Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRmnzbXY6L6fI4GtQRAhlIAJ9I/EZG1eQyuKYO5VcHEd3AfhBYlgCfYsDm yrhDMssXe8EMKHWju/oCdLs= =akH8 -----END PGP SIGNATURE----- --EY/WZ/HvNxOox07X-- From owner-svn-src-all@FreeBSD.ORG Mon May 20 19:51:16 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B59C1BC8; Mon, 20 May 2013 19:51:16 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 6FDD0192F; Mon, 20 May 2013 19:51:15 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4KJpE6X004102; Mon, 20 May 2013 14:51:14 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4KJpEbF004101; Mon, 20 May 2013 14:51:14 -0500 (CDT) (envelope-from brooks) Date: Mon, 20 May 2013 14:51:14 -0500 From: Brooks Davis To: Andreas Tobler Subject: Re: svn commit: r250659 - in head: . share/mk tools/build/options tools/tools/makeroot Message-ID: <20130520195114.GE2630@lor.one-eyed-alien.net> References: <201305151430.r4FEU31J061480@svn.freebsd.org> <51955849.4020503@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zjcmjzIkjQU2rmur" Content-Disposition: inline In-Reply-To: <51955849.4020503@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 19:51:16 -0000 --zjcmjzIkjQU2rmur Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 17, 2013 at 12:06:01AM +0200, Andreas Tobler wrote: > On 15.05.13 16:30, Brooks Davis wrote: > > Author: brooks > > Date: Wed May 15 14:30:03 2013 > > New Revision: 250659 > > URL: http://svnweb.freebsd.org/changeset/base/250659 > >=20 > > Log: > > Add support for an external cross compiler. The cross compiler is > > specified by passing the XCC, XCXX, and XCPP variables (corresponding= to > > CC, CXX, and CPP) to buildworld/buildkernel. The compiler must be cl= ang > > or be configured to target the appropriate architecture. > > =20 > > To speed build times, if XCC is an absolute path or > > WITHOUT_CROSS_COMPILER is defined then no cross compiler will be built > > during the cross-tools stage. > > =20 > > Limited documentation of this feature can currently be found at: > > =20 > > https://wiki.freebsd.org/ExternalToolchain > > =20 > > This functionality should be considered experimental and is subject to > > change without notice. > > =20 > > Sponsored by: DARPA, AFRL > > Discussed with: imp, sjg >=20 > I had to revert this commit to be able to build world and kernel with > WITHOUT_CLANG_IS_CC in /etc/src.conf >=20 > It did not find the headers (like math.h) when building the 32-bit part > on amd64. I'll need more information to do any useful debugging. How is the host configured? If it's not 100% stock, I need to know what WITH/WITHOUT options were set to build it. Are you setting any options other than WITHOUT_CLANG_IS_CC during this build? -- Brooks --zjcmjzIkjQU2rmur Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRmn6yXY6L6fI4GtQRAuAoAKCxl0jL2XSk7pT7O/jQerL1IkgXhQCdE0w9 p+3NZbKT5FsTbfHJOW4vzGI= =HeY1 -----END PGP SIGNATURE----- --zjcmjzIkjQU2rmur-- From owner-svn-src-all@FreeBSD.ORG Mon May 20 19:56:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ADEF1E76; Mon, 20 May 2013 19:56:10 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 666AA1A67; Mon, 20 May 2013 19:56:09 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4KJu8qE004143; Mon, 20 May 2013 14:56:08 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4KJu8Al004142; Mon, 20 May 2013 14:56:08 -0500 (CDT) (envelope-from brooks) Date: Mon, 20 May 2013 14:56:08 -0500 From: Brooks Davis To: Garrett Cooper Subject: Re: svn commit: r250659 - in head: . share/mk tools/build/options tools/tools/makeroot Message-ID: <20130520195608.GF2630@lor.one-eyed-alien.net> References: <201305151430.r4FEU31J061480@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="27ZtN5FSuKKSZcBU" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 19:56:10 -0000 --27ZtN5FSuKKSZcBU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 15, 2013 at 10:10:13AM -0500, Garrett Cooper wrote: > On May 15, 2013, at 9:30 AM, Brooks Davis wrote: >=20 > > Author: brooks > > Date: Wed May 15 14:30:03 2013 > > New Revision: 250659 > > URL: http://svnweb.freebsd.org/changeset/base/250659 > >=20 > > Log: > > Add support for an external cross compiler. The cross compiler is > > specified by passing the XCC, XCXX, and XCPP variables (corresponding = to > > CC, CXX, and CPP) to buildworld/buildkernel. The compiler must be cla= ng > > or be configured to target the appropriate architecture. > >=20 > > To speed build times, if XCC is an absolute path or > > WITHOUT_CROSS_COMPILER is defined then no cross compiler will be built > > during the cross-tools stage. > >=20 > > Limited documentation of this feature can currently be found at: > >=20 > > https://wiki.freebsd.org/ExternalToolchain > >=20 > > This functionality should be considered experimental and is subject to > > change without notice. >=20 > Seems like this code could/should be integrated in with conf/163778 (in = particular the bits that Warner provided to share/mk/sys.mk that I integrat= ed in my larger patch). >=20 The patch in conf/163778 seems to combine several unrelated things. I don't know what the usecase is for ${AWK}, but it should certainly be committed on it's own if it is committed. The reason I rejected the ${__X} approach is that it requires a=20 fixed naming convention that doesn't work at all for compilers. I think it's a somewhat better idea for binutils, but we'll probably break the convention at least initially with mclinker. -- Brooks --27ZtN5FSuKKSZcBU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRmn/XXY6L6fI4GtQRAo6hAKDF0ksJOho/D1Bqa39S8b380fG1MQCgzgtt ALIj8Oppg8XexZKMkOhn04c= =KjQP -----END PGP SIGNATURE----- --27ZtN5FSuKKSZcBU-- From owner-svn-src-all@FreeBSD.ORG Mon May 20 19:59:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 741A7123; Mon, 20 May 2013 19:59:19 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 2F9371A92; Mon, 20 May 2013 19:59:18 +0000 (UTC) Received: from Julian-MBP3.local (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id r4KJxBPv060669 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 20 May 2013 12:59:12 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <519A808A.3050104@freebsd.org> Date: Mon, 20 May 2013 12:59:06 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Michael Tuexen Subject: Re: svn commit: r250809 - head/sys/netinet References: <201305191606.r4JG6hNR032154@svn.freebsd.org> In-Reply-To: <201305191606.r4JG6hNR032154@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 19:59:19 -0000 On 5/19/13 9:06 AM, Michael Tuexen wrote: > crashing due to the usage of uninitialized fibnum. > This bugs became visiable after I don't pretend to know the context, but do you want 0, or the fib of the active process? From owner-svn-src-all@FreeBSD.ORG Mon May 20 19:59:41 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 970EB294; Mon, 20 May 2013 19:59:41 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 1468D1A9B; Mon, 20 May 2013 19:59:40 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id r4KJxZFq003390; Mon, 20 May 2013 21:59:38 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <519A80A7.8080905@FreeBSD.org> Date: Mon, 20 May 2013 21:59:35 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Brooks Davis Subject: Re: svn commit: r250659 - in head: . share/mk tools/build/options tools/tools/makeroot References: <201305151430.r4FEU31J061480@svn.freebsd.org> <51955849.4020503@FreeBSD.org> <20130520195114.GE2630@lor.one-eyed-alien.net> In-Reply-To: <20130520195114.GE2630@lor.one-eyed-alien.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 19:59:41 -0000 On 20.05.13 21:51, Brooks Davis wrote: > On Fri, May 17, 2013 at 12:06:01AM +0200, Andreas Tobler wrote: >> On 15.05.13 16:30, Brooks Davis wrote: >>> Author: brooks >>> Date: Wed May 15 14:30:03 2013 >>> New Revision: 250659 >>> URL: http://svnweb.freebsd.org/changeset/base/250659 >>> >>> Log: >>> Add support for an external cross compiler. The cross compiler is >>> specified by passing the XCC, XCXX, and XCPP variables (corresponding to >>> CC, CXX, and CPP) to buildworld/buildkernel. The compiler must be clang >>> or be configured to target the appropriate architecture. >>> >>> To speed build times, if XCC is an absolute path or >>> WITHOUT_CROSS_COMPILER is defined then no cross compiler will be built >>> during the cross-tools stage. >>> >>> Limited documentation of this feature can currently be found at: >>> >>> https://wiki.freebsd.org/ExternalToolchain >>> >>> This functionality should be considered experimental and is subject to >>> change without notice. >>> >>> Sponsored by: DARPA, AFRL >>> Discussed with: imp, sjg >> >> I had to revert this commit to be able to build world and kernel with >> WITHOUT_CLANG_IS_CC in /etc/src.conf >> >> It did not find the headers (like math.h) when building the 32-bit part >> on amd64. > > I'll need more information to do any useful debugging. How is the host > configured? If it's not 100% stock, I need to know what WITH/WITHOUT > options were set to build it. Are you setting any options other than > WITHOUT_CLANG_IS_CC during this build? Source is svn -CURRENT. There is no other option set than WITHOUT_CLANG_IS_CC. Beside I use MALLOC_PRODUCTION=1 This happens on both 32-capable targets, amd64 and powerpc64. I figured that there are at least three headers 'missing' so far in src/lib32/usr/include: - math.h - fenv.h - libutil.h If I manually copy them to this location I can continue building until /usr/bin/ld complains about not being configured for sysroots. I just restarted the whole worldbuild again with the above mentionend headers in place. I'll take a few minutes ;) TIA for your help! Andreas From owner-svn-src-all@FreeBSD.ORG Mon May 20 20:10:08 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 65E9A52E; Mon, 20 May 2013 20:10:08 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 9EE301B10; Mon, 20 May 2013 20:10:06 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4KKA6ZL004218; Mon, 20 May 2013 15:10:06 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4KKA6TG004217; Mon, 20 May 2013 15:10:06 -0500 (CDT) (envelope-from brooks) Date: Mon, 20 May 2013 15:10:06 -0500 From: Brooks Davis To: Andreas Tobler Subject: Re: svn commit: r250659 - in head: . share/mk tools/build/options tools/tools/makeroot Message-ID: <20130520201006.GG2630@lor.one-eyed-alien.net> References: <201305151430.r4FEU31J061480@svn.freebsd.org> <51955849.4020503@FreeBSD.org> <20130520195114.GE2630@lor.one-eyed-alien.net> <519A80A7.8080905@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2E/hm+v6kSLEYT3h" Content-Disposition: inline In-Reply-To: <519A80A7.8080905@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 20:10:08 -0000 --2E/hm+v6kSLEYT3h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 20, 2013 at 09:59:35PM +0200, Andreas Tobler wrote: > On 20.05.13 21:51, Brooks Davis wrote: > > On Fri, May 17, 2013 at 12:06:01AM +0200, Andreas Tobler wrote: > >> On 15.05.13 16:30, Brooks Davis wrote: > >>> Author: brooks > >>> Date: Wed May 15 14:30:03 2013 > >>> New Revision: 250659 > >>> URL: http://svnweb.freebsd.org/changeset/base/250659 > >>> > >>> Log: > >>> Add support for an external cross compiler. The cross compiler is > >>> specified by passing the XCC, XCXX, and XCPP variables (correspondi= ng to > >>> CC, CXX, and CPP) to buildworld/buildkernel. The compiler must be = clang > >>> or be configured to target the appropriate architecture. > >>> =20 > >>> To speed build times, if XCC is an absolute path or > >>> WITHOUT_CROSS_COMPILER is defined then no cross compiler will be bu= ilt > >>> during the cross-tools stage. > >>> =20 > >>> Limited documentation of this feature can currently be found at: > >>> =20 > >>> https://wiki.freebsd.org/ExternalToolchain > >>> =20 > >>> This functionality should be considered experimental and is subject= to > >>> change without notice. > >>> =20 > >>> Sponsored by: DARPA, AFRL > >>> Discussed with: imp, sjg > >> > >> I had to revert this commit to be able to build world and kernel with > >> WITHOUT_CLANG_IS_CC in /etc/src.conf > >> > >> It did not find the headers (like math.h) when building the 32-bit part > >> on amd64. > >=20 > > I'll need more information to do any useful debugging. How is the host > > configured? If it's not 100% stock, I need to know what WITH/WITHOUT > > options were set to build it. Are you setting any options other than > > WITHOUT_CLANG_IS_CC during this build? >=20 > Source is svn -CURRENT. There is no other option set than > WITHOUT_CLANG_IS_CC. Beside I use MALLOC_PRODUCTION=3D1 Is /usr/bin/cc gcc or clang? Just to be sure. Are you setting CC anywhere? > This happens on both 32-capable targets, amd64 and powerpc64. >=20 > I figured that there are at least three headers 'missing' so far in > src/lib32/usr/include: > - math.h > - fenv.h > - libutil.h >=20 > If I manually copy them to this location I can continue building until > /usr/bin/ld complains about not being configured for sysroots. > I just restarted the whole worldbuild again with the above mentionend > headers in place. Hmm, this is really weird. /usr/bin/ld should never run after the bootstrap phase unless you actually use the X* variables. -- Brooks P.S. Sorry for the delayed response. The university of ottawa wifi network and my home network interact bizarrely so I'm way behind on email. --2E/hm+v6kSLEYT3h Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRmoMdXY6L6fI4GtQRAmolAJ4uXEJoIG6RotkE2k6dcxSgjEdqpwCgsyUR IZlZBb17coUqUL9gxXsOzXw= =SI1t -----END PGP SIGNATURE----- --2E/hm+v6kSLEYT3h-- From owner-svn-src-all@FreeBSD.ORG Mon May 20 20:14:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AEAE0888; Mon, 20 May 2013 20:14:12 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A1B2A1B44; Mon, 20 May 2013 20:14:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KKEC2p032824; Mon, 20 May 2013 20:14:12 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KKECKn032823; Mon, 20 May 2013 20:14:12 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201305202014.r4KKECKn032823@svn.freebsd.org> From: Julian Elischer Date: Mon, 20 May 2013 20:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250829 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 20:14:12 -0000 Author: julian Date: Mon May 20 20:14:12 2013 New Revision: 250829 URL: http://svnweb.freebsd.org/changeset/base/250829 Log: Remove accidentally included line.. No effect as it wasn't used but was a) wrong b) clutter Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon May 20 19:41:34 2013 (r250828) +++ head/sys/sys/mbuf.h Mon May 20 20:14:12 2013 (r250829) @@ -173,7 +173,6 @@ struct mbuf { #define m_type m_hdr.mh_type #define m_flags m_hdr.mh_flags #define m_nextpkt m_hdr.mh_nextpkt -#define m_fibnum m_hdr.mh_nextpkt #define m_act m_nextpkt #define m_pkthdr M_dat.MH.MH_pkthdr #define m_ext M_dat.MH.MH_dat.MH_ext From owner-svn-src-all@FreeBSD.ORG Mon May 20 20:17:41 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 16903D7C; Mon, 20 May 2013 20:17:41 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id AC5931BC0; Mon, 20 May 2013 20:17:40 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id r4KKHXAk034102; Mon, 20 May 2013 22:17:38 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <519A84DD.8030804@FreeBSD.org> Date: Mon, 20 May 2013 22:17:33 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Brooks Davis Subject: Re: svn commit: r250659 - in head: . share/mk tools/build/options tools/tools/makeroot References: <201305151430.r4FEU31J061480@svn.freebsd.org> <51955849.4020503@FreeBSD.org> <20130520195114.GE2630@lor.one-eyed-alien.net> <519A80A7.8080905@FreeBSD.org> <20130520201006.GG2630@lor.one-eyed-alien.net> In-Reply-To: <20130520201006.GG2630@lor.one-eyed-alien.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 20:17:41 -0000 On 20.05.13 22:10, Brooks Davis wrote: > On Mon, May 20, 2013 at 09:59:35PM +0200, Andreas Tobler wrote: >> On 20.05.13 21:51, Brooks Davis wrote: >>> On Fri, May 17, 2013 at 12:06:01AM +0200, Andreas Tobler wrote: >>>> On 15.05.13 16:30, Brooks Davis wrote: >>>>> Author: brooks >>>>> Date: Wed May 15 14:30:03 2013 >>>>> New Revision: 250659 >>>>> URL: http://svnweb.freebsd.org/changeset/base/250659 >>>>> >>>>> Log: >>>>> Add support for an external cross compiler. The cross compiler is >>>>> specified by passing the XCC, XCXX, and XCPP variables (corresponding to >>>>> CC, CXX, and CPP) to buildworld/buildkernel. The compiler must be clang >>>>> or be configured to target the appropriate architecture. >>>>> >>>>> To speed build times, if XCC is an absolute path or >>>>> WITHOUT_CROSS_COMPILER is defined then no cross compiler will be built >>>>> during the cross-tools stage. >>>>> >>>>> Limited documentation of this feature can currently be found at: >>>>> >>>>> https://wiki.freebsd.org/ExternalToolchain >>>>> >>>>> This functionality should be considered experimental and is subject to >>>>> change without notice. >>>>> >>>>> Sponsored by: DARPA, AFRL >>>>> Discussed with: imp, sjg >>>> >>>> I had to revert this commit to be able to build world and kernel with >>>> WITHOUT_CLANG_IS_CC in /etc/src.conf >>>> >>>> It did not find the headers (like math.h) when building the 32-bit part >>>> on amd64. >>> >>> I'll need more information to do any useful debugging. How is the host >>> configured? If it's not 100% stock, I need to know what WITH/WITHOUT >>> options were set to build it. Are you setting any options other than >>> WITHOUT_CLANG_IS_CC during this build? >> >> Source is svn -CURRENT. There is no other option set than >> WITHOUT_CLANG_IS_CC. Beside I use MALLOC_PRODUCTION=1 > > Is /usr/bin/cc gcc or clang? /usr/bin/cc -v Using built-in specs. Target: amd64-undermydesk-freebsd Configured with: FreeBSD/amd64 system compiler Thread model: posix gcc version 4.2.1 20070831 patched [FreeBSD] > Just to be sure. Are you setting CC anywhere? > >> This happens on both 32-capable targets, amd64 and powerpc64. >> >> I figured that there are at least three headers 'missing' so far in >> src/lib32/usr/include: >> - math.h >> - fenv.h >> - libutil.h >> >> If I manually copy them to this location I can continue building until >> /usr/bin/ld complains about not being configured for sysroots. >> I just restarted the whole worldbuild again with the above mentionend >> headers in place. > > Hmm, this is really weird. /usr/bin/ld should never run after the > bootstrap phase unless you actually use the X* variables. Well, it might be that I did something in a hurry, that's why I restarted the whole build. What I did, I cleaned the whole obj dir and did a 'make build32' in /usr/src (to save some time), then I got the exact same failures as when I started from scratch. Now I tried to find all the headers which the compiler was complaining about, copied them to /usr/obj/****/src/lib32/usr/include, finished the compilation stage and at the linker stage 'ld' complained. Now I'm waiting for the build from beginning with copied headers to see what happens. > P.S. Sorry for the delayed response. The university of ottawa wifi network > and my home network interact bizarrely so I'm way behind on email. Np, I should have known that you're all at BSDcan ;) Thanks, Andreas From owner-svn-src-all@FreeBSD.ORG Mon May 20 20:32:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A377CFEE; Mon, 20 May 2013 20:32:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9542DEFF; Mon, 20 May 2013 20:32:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KKWx2A039376; Mon, 20 May 2013 20:32:59 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KKWx7e039375; Mon, 20 May 2013 20:32:59 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305202032.r4KKWx7e039375@svn.freebsd.org> From: Brooks Davis Date: Mon, 20 May 2013 20:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250830 - head/tools/tools/makeroot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 20:32:59 -0000 Author: brooks Date: Mon May 20 20:32:58 2013 New Revision: 250830 URL: http://svnweb.freebsd.org/changeset/base/250830 Log: Cleanups and markup improvements suggested by trociny and joel. Modified: head/tools/tools/makeroot/makeroot.8 Modified: head/tools/tools/makeroot/makeroot.8 ============================================================================== --- head/tools/tools/makeroot/makeroot.8 Mon May 20 20:14:12 2013 (r250829) +++ head/tools/tools/makeroot/makeroot.8 Mon May 20 20:32:58 2013 (r250830) @@ -28,7 +28,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd May 16, 2013 +.Dd May 20, 2013 .Dt MAKEROOT 8 .Os .Sh NAME @@ -52,12 +52,11 @@ script creates a UFS filesystem image in .Ar imagefile . By default, all filesystem objects listed in the -METALOG file contained in the -.Pa Ar rootdir +.Pa METALOG +file contained in the +.Ar rootdir directory will be placed in the root of the UFS image .Ar image-file . -will be placed in the root of the UFS image -.Ar image-file . .Pp Images can be customized with a number of different flags: .Bl -tag -width indent @@ -111,6 +110,14 @@ argument is passed directly to .El .Sh EXAMPLES .Dl $ makeroot.sh -k keys -K ctsrd -p extras/etc/master.passwd -g extras/etc/group -e extras/mdroot.mtree -e demo/demo.mtree -e extras/ctsrd.mtree -s 26112k -f demo.files cheribsd-demo.img /path/to/dist +.Sh FILES +.Bl -tag -width METALOG -compact +.It Pa METALOG +.Xr mtree 5 +2.0 format manifest of permissions and ownership for files in the root +directory. +This file is generated by installworld, distribution, and installkernel. +.El .Sh SEE ALSO .Xr mtree 5 , .Xr makefs 8 , From owner-svn-src-all@FreeBSD.ORG Mon May 20 20:47:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 09D1EB4C; Mon, 20 May 2013 20:47:41 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F096267; Mon, 20 May 2013 20:47:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KKleUh043714; Mon, 20 May 2013 20:47:40 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KKledk043713; Mon, 20 May 2013 20:47:40 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201305202047.r4KKledk043713@svn.freebsd.org> From: Julian Elischer Date: Mon, 20 May 2013 20:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250831 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 20:47:41 -0000 Author: julian Date: Mon May 20 20:47:40 2013 New Revision: 250831 URL: http://svnweb.freebsd.org/changeset/base/250831 Log: Update the setfib man page to reflect recent changes. Modified: head/lib/libc/sys/setfib.2 Modified: head/lib/libc/sys/setfib.2 ============================================================================== --- head/lib/libc/sys/setfib.2 Mon May 20 20:32:58 2013 (r250830) +++ head/lib/libc/sys/setfib.2 Mon May 20 20:47:40 2013 (r250831) @@ -64,10 +64,13 @@ with where .Em N is an integer. -However, this maximum is capped at 16 due to the implementation storing -the fib number in a 4-bit field in +This maximum is capped at 65536 due to the implementation storing +the fib number in a 16-bit field in the .Xr mbuf 9 -flags. +packet header, however it is not suggested that one use such a large number +as memory is allocated for every FIB regardless of whether it is used, and +there are places where all FIBs are iterated over. +.Pp The default fib of the process will be applied to all protocol families that support multiple fibs, and ignored by those that do not. The default fib for a process may be overridden for a socket with the use From owner-svn-src-all@FreeBSD.ORG Mon May 20 21:16:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 358237CF; Mon, 20 May 2013 21:16:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 257131747; Mon, 20 May 2013 21:16:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KLGdq9054500; Mon, 20 May 2013 21:16:39 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KLGcxq054499; Mon, 20 May 2013 21:16:38 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305202116.r4KLGcxq054499@svn.freebsd.org> From: Brooks Davis Date: Mon, 20 May 2013 21:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250832 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 21:16:39 -0000 Author: brooks Date: Mon May 20 21:16:38 2013 New Revision: 250832 URL: http://svnweb.freebsd.org/changeset/base/250832 Log: Fix distributekernel in the non NO_ROOT case. PR: conf/178775 Submitted by: Garrett Cooper Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon May 20 20:47:40 2013 (r250831) +++ head/Makefile.inc1 Mon May 20 21:16:38 2013 (r250832) @@ -1032,8 +1032,10 @@ distributekernel distributekernel.debug: ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ DESTDIR=${INSTALL_DDIR:S://:/:g:C:/$::}/kernel \ ${.TARGET:S/distributekernel/install/} +.if defined(NO_ROOT) sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ ${DESTDIR}/${DISTDIR}/kernel.meta +.endif .for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} .if defined(NO_ROOT) echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta From owner-svn-src-all@FreeBSD.ORG Mon May 20 22:10:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A09EA3B0; Mon, 20 May 2013 22:10:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 79CE3627; Mon, 20 May 2013 22:10:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KMA1cN072380; Mon, 20 May 2013 22:10:01 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KMA1Pa072379; Mon, 20 May 2013 22:10:01 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305202210.r4KMA1Pa072379@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 20 May 2013 22:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250833 - head/sys/dev/acpica/Osd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 22:10:01 -0000 Author: jkim Date: Mon May 20 22:10:01 2013 New Revision: 250833 URL: http://svnweb.freebsd.org/changeset/base/250833 Log: Fix white spaces. Modified: head/sys/dev/acpica/Osd/OsdTable.c Modified: head/sys/dev/acpica/Osd/OsdTable.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdTable.c Mon May 20 21:16:38 2013 (r250832) +++ head/sys/dev/acpica/Osd/OsdTable.c Mon May 20 22:10:01 2013 (r250833) @@ -50,51 +50,49 @@ AcpiOsPredefinedOverride(const ACPI_PRED ACPI_STRING *NewVal) { - if (InitVal == NULL || NewVal == NULL) - return (AE_BAD_PARAMETER); + if (InitVal == NULL || NewVal == NULL) + return (AE_BAD_PARAMETER); - *NewVal = NULL; - if (strncmp(InitVal->Name, "_OS_", ACPI_NAME_SIZE) == 0 && - strlen(acpi_osname) > 0) { - printf("ACPI: Overriding _OS definition with \"%s\"\n", acpi_osname); - *NewVal = acpi_osname; - } - - return (AE_OK); + *NewVal = NULL; + if (strncmp(InitVal->Name, "_OS_", ACPI_NAME_SIZE) == 0 && + strlen(acpi_osname) > 0) { + printf("ACPI: Overriding _OS definition with \"%s\"\n", + acpi_osname); + *NewVal = acpi_osname; + } + return (AE_OK); } ACPI_STATUS AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable) { - char modname[] = "acpi_dsdt"; - caddr_t acpi_table; - ACPI_TABLE_HEADER *hdr; - size_t sz; + char modname[] = "acpi_dsdt"; + caddr_t acpi_table; + ACPI_TABLE_HEADER *hdr; + size_t sz; - if (ExistingTable == NULL || NewTable == NULL) - return (AE_BAD_PARAMETER); + if (ExistingTable == NULL || NewTable == NULL) + return (AE_BAD_PARAMETER); - *NewTable = NULL; + *NewTable = NULL; #ifdef notyet - for (int i = 0; i < ACPI_NAME_SIZE; i++) - modname[i + 5] = tolower(ExistingTable->Signature[i]); + for (int i = 0; i < ACPI_NAME_SIZE; i++) + modname[i + 5] = tolower(ExistingTable->Signature[i]); #else - /* If we're not overriding the DSDT, just return. */ - if (strncmp(ExistingTable->Signature, ACPI_SIG_DSDT, ACPI_NAME_SIZE) != 0) - return (AE_OK); + /* If we're not overriding the DSDT, just return. */ + if (strncmp(ExistingTable->Signature, ACPI_SIG_DSDT, + ACPI_NAME_SIZE) != 0) + return (AE_OK); #endif - - acpi_table = preload_search_by_type(modname); - if (acpi_table == NULL) + acpi_table = preload_search_by_type(modname); + if (acpi_table == NULL) + return (AE_OK); + hdr = preload_fetch_addr(acpi_table); + sz = preload_fetch_size(acpi_table); + if (hdr != NULL && sz != 0) + *NewTable = hdr; return (AE_OK); - - hdr = preload_fetch_addr(acpi_table); - sz = preload_fetch_size(acpi_table); - if (hdr != NULL && sz != 0) - *NewTable = hdr; - - return (AE_OK); } ACPI_STATUS From owner-svn-src-all@FreeBSD.ORG Mon May 20 22:18:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B31D6610; Mon, 20 May 2013 22:18:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5B2A808; Mon, 20 May 2013 22:18:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KMIIe3075614; Mon, 20 May 2013 22:18:18 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KMII2J075613; Mon, 20 May 2013 22:18:18 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305202218.r4KMII2J075613@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 20 May 2013 22:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250834 - head/sys/dev/acpica/Osd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 22:18:18 -0000 Author: jkim Date: Mon May 20 22:18:18 2013 New Revision: 250834 URL: http://svnweb.freebsd.org/changeset/base/250834 Log: - Prefer ACPI_COMPARE_NAME(a, b) macro over strncmp(a, b, ACPI_NAME_SIZE). - Make sure the predefined name is a string type. - Return slightly more useful errors. Modified: head/sys/dev/acpica/Osd/OsdTable.c Modified: head/sys/dev/acpica/Osd/OsdTable.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdTable.c Mon May 20 22:10:01 2013 (r250833) +++ head/sys/dev/acpica/Osd/OsdTable.c Mon May 20 22:18:18 2013 (r250834) @@ -54,8 +54,8 @@ AcpiOsPredefinedOverride(const ACPI_PRED return (AE_BAD_PARAMETER); *NewVal = NULL; - if (strncmp(InitVal->Name, "_OS_", ACPI_NAME_SIZE) == 0 && - strlen(acpi_osname) > 0) { + if (ACPI_COMPARE_NAME(InitVal->Name, "_OS_") && + InitVal->Type == ACPI_TYPE_STRING && strlen(acpi_osname) > 0) { printf("ACPI: Overriding _OS definition with \"%s\"\n", acpi_osname); *NewVal = acpi_osname; @@ -80,18 +80,17 @@ AcpiOsTableOverride(ACPI_TABLE_HEADER *E for (int i = 0; i < ACPI_NAME_SIZE; i++) modname[i + 5] = tolower(ExistingTable->Signature[i]); #else - /* If we're not overriding the DSDT, just return. */ - if (strncmp(ExistingTable->Signature, ACPI_SIG_DSDT, - ACPI_NAME_SIZE) != 0) - return (AE_OK); + if (!ACPI_COMPARE_NAME(ExistingTable->Signature, ACPI_SIG_DSDT)) + return (AE_SUPPORT); #endif acpi_table = preload_search_by_type(modname); if (acpi_table == NULL) - return (AE_OK); + return (AE_NOT_FOUND); hdr = preload_fetch_addr(acpi_table); sz = preload_fetch_size(acpi_table); - if (hdr != NULL && sz != 0) - *NewTable = hdr; + if (hdr == NULL || sz == 0) + return (AE_ERROR); + *NewTable = hdr; return (AE_OK); } From owner-svn-src-all@FreeBSD.ORG Mon May 20 22:35:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E7534948; Mon, 20 May 2013 22:35:35 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D6D8EB62; Mon, 20 May 2013 22:35:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KMZZ1d081865; Mon, 20 May 2013 22:35:35 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KMZWBH081842; Mon, 20 May 2013 22:35:32 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201305202235.r4KMZWBH081842@svn.freebsd.org> From: "Simon J. Gerraty" Date: Mon, 20 May 2013 22:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250835 - in vendor/NetBSD/bmake/dist: . mk X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 22:35:36 -0000 Author: sjg Date: Mon May 20 22:35:32 2013 New Revision: 250835 URL: http://svnweb.freebsd.org/changeset/base/250835 Log: Import bmake-20130520 to keep us in sync. Added: vendor/NetBSD/bmake/dist/mk/stage-install.sh (contents, props changed) Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/FILES vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/FILES vendor/NetBSD/bmake/dist/mk/gendirdeps.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/meta.stage.mk vendor/NetBSD/bmake/dist/mk/meta2deps.py vendor/NetBSD/bmake/dist/mk/meta2deps.sh vendor/NetBSD/bmake/dist/mk/options.mk vendor/NetBSD/bmake/dist/mk/progs.mk vendor/NetBSD/bmake/dist/suff.c vendor/NetBSD/bmake/dist/var.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/ChangeLog Mon May 20 22:35:32 2013 (r250835) @@ -1,3 +1,17 @@ +2013-05-20 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20130520 + generate manifest from component FILES rather than have to + update FILES when mk/FILES changes. + +2013-05-18 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20130518 + Merge with NetBSD make, pick up + o suff.c: don't skip all processsing for .PHONY targets + else wildcard srcs do not get expanded. + o var.c: expand name of variable to delete if necessary. + 2013-03-30 Simon J. Gerraty * Makefile (MAKE_VERSION): 20130330 Modified: vendor/NetBSD/bmake/dist/FILES ============================================================================== --- vendor/NetBSD/bmake/dist/FILES Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/FILES Mon May 20 22:35:32 2013 (r250835) @@ -1,29 +1,26 @@ -FILES ChangeLog -bmake.cat1 -boot-strap -bsd.after-import.mk -os.sh -makefile.in +FILES Makefile Makefile.config.in PSD.doc/Makefile PSD.doc/tutorial.ms README +aclocal.m4 arch.c +bmake.1 +bmake.cat1 +boot-strap +bsd.after-import.mk buf.c buf.h compat.c cond.c -make-conf.h -make_malloc.c -make_malloc.h config.h.in configure -aclocal.m4 configure.in dir.c dir.h +dirname.c find_lib.sh for.c getopt.c @@ -32,16 +29,6 @@ hash.h install-sh job.c job.h -meta.c -meta.h -dirname.c -realpath.c -strlcpy.c -strlist.c -strlist.h -stresep.c -trace.c -trace.h lst.h lst.lib/Makefile lst.lib/lstAppend.c @@ -74,26 +61,36 @@ lst.lib/lstReplace.c lst.lib/lstSucc.c machine.sh main.c +make-bootstrap.sh.in +make-conf.h make.1 -bmake.1 make.c make.h -make-bootstrap.sh.in +make_malloc.c +make_malloc.h +makefile.in +meta.c +meta.h missing/sys/cdefs.h mkdeps.sh nonints.h +os.sh parse.c pathnames.h ranlib.h +realpath.c setenv.c sigcompat.c sprite.h str.c +stresep.c +strlcpy.c +strlist.c +strlist.h suff.c targ.c -util.c -var.c -wait.h +trace.c +trace.h unit-tests/Makefile.in unit-tests/comment unit-tests/cond1 @@ -123,63 +120,6 @@ unit-tests/test.exp unit-tests/unexport unit-tests/unexport-env unit-tests/varcmd -mk/ChangeLog -mk/FILES -mk/README -mk/auto.obj.mk -mk/autoconf.mk -mk/autodep.mk -mk/auto.dep.mk -mk/dep.mk -mk/doc.mk -mk/dpadd.mk -mk/final.mk -mk/host-target.mk -mk/host.libnames.mk -mk/inc.mk -mk/init.mk -mk/install-mk -mk/java.mk -mk/lib.mk -mk/libnames.mk -mk/libs.mk -mk/links.mk -mk/man.mk -mk/mk-files.txt -mk/nls.mk -mk/obj.mk -mk/options.mk -mk/own.mk -mk/prlist.mk -mk/prog.mk -mk/progs.mk -mk/rst2htm.mk -mk/scripts.mk -mk/srctop.mk -mk/subdir.mk -mk/sys.mk -mk/sys.clean-env.mk -mk/sys.dependfile.mk -mk/sys/AIX.mk -mk/sys/Darwin.mk -mk/sys/Generic.mk -mk/sys/HP-UX.mk -mk/sys/IRIX.mk -mk/sys/Linux.mk -mk/sys/NetBSD.mk -mk/sys/OSF1.mk -mk/sys/OpenBSD.mk -mk/sys/SunOS.mk -mk/sys/UnixWare.mk -mk/target-flags.mk -mk/warnings.mk -mk/yacc.mk -mk/dirdeps.mk -mk/gendirdeps.mk -mk/install-new.mk -mk/meta2deps.py -mk/meta2deps.sh -mk/meta.sys.mk -mk/meta.autodep.mk -mk/meta.stage.mk -mk/meta.subdir.mk +util.c +var.c +wait.h Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/Makefile Mon May 20 22:35:32 2013 (r250835) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.10 2013/03/31 05:57:19 sjg Exp $ +# $Id: Makefile,v 1.12 2013/05/20 16:05:10 sjg Exp $ # Base version on src date -MAKE_VERSION= 20130330 +MAKE_VERSION= 20130520 PROG= bmake Modified: vendor/NetBSD/bmake/dist/meta.c ============================================================================== --- vendor/NetBSD/bmake/dist/meta.c Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/meta.c Mon May 20 22:35:32 2013 (r250835) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.29 2013/03/31 05:49:51 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.30 2013/05/16 21:56:56 sjg Exp $ */ /* * Implement 'meta' mode. @@ -543,7 +543,7 @@ boolValue(char *s) * Initialization we need before reading makefiles. */ void -meta_init() +meta_init(void) { #ifdef USE_FILEMON /* this allows makefiles to test if we have filemon support */ Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Mon May 20 22:35:32 2013 (r250835) @@ -1,3 +1,23 @@ +2013-05-10 Simon J. Gerraty + + * install-mk (MK_VERSION): 20130505 + * gendirdeps.mk, meta2deps.py, meta2deps.sh: handle $TARGET_SPEC + for when $MACHINE isn't enough for objdir distinction. + Bring meta2deps.sh closer to par with meta2deps.py. + +2013-04-18 Simon J. Gerraty + + * meta.stage.mk: set INSTALL to STAGE_INSTALL when making 'all' + also if the target 'beforeinstall' exists, make it depend on + .dirdep (incase it uses STAGE_INSTALL). + +2013-04-17 Simon J. Gerraty + + * install-mk (MK_VERSION): 20130401 ;-) + * meta.stage.mk (STAGE_INSTALL_SH): add stage-install.sh as + wrapper around install(1). + * options.mk (OPTION_PREFIX): Allow a prefix other than MK_ + 2013-03-30 Simon J. Gerraty * meta2deps.py (MetaFile.__init__): ensure self.cwd is initialized. Modified: vendor/NetBSD/bmake/dist/mk/FILES ============================================================================== --- vendor/NetBSD/bmake/dist/mk/FILES Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/mk/FILES Mon May 20 22:35:32 2013 (r250835) @@ -31,6 +31,7 @@ progs.mk rst2htm.mk scripts.mk srctop.mk +stage-install.sh subdir.mk sys.mk sys.clean-env.mk Modified: vendor/NetBSD/bmake/dist/mk/gendirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/gendirdeps.mk Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/mk/gendirdeps.mk Mon May 20 22:35:32 2013 (r250835) @@ -1,4 +1,4 @@ -# $Id: gendirdeps.mk,v 1.21 2013/03/28 20:01:05 sjg Exp $ +# $Id: gendirdeps.mk,v 1.22 2013/05/11 05:16:26 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -111,13 +111,24 @@ _py_d = .if ${META2DEPS:E} == "py" # we can afford to do this all the time. DPDEPS ?= no -META2DEPS_CMD = ${_time} ${PYTHON} ${META2DEPS} ${_py_d} \ - -R ${RELDIR} -H ${HOST_TARGET} \ - ${M2D_OBJROOTS:O:u:@o@-O $o@} - +META2DEPS_CMD = ${_time} ${PYTHON} ${META2DEPS} ${_py_d} .if ${DPDEPS:tl} != "no" META2DEPS_CMD += -D ${DPDEPS} .endif +META2DEPS_FILTER = sed 's,^src:,${SRCTOP}/,;s,^\([^/]\),${OBJTOP}/\1,' | +.elif ${META2DEPS:E} == "sh" +META2DEPS_CMD = ${_time} ${_sh_x} ${META2DEPS} OBJTOP=${_OBJTOP} +.else +META2DEPS_CMD ?= ${META2DEPS} +.endif + +.if ${TARGET_OBJ_SPEC:U${MACHINE}} != ${MACHINE} +META2DEPS_CMD += -T ${TARGET_OBJ_SPEC} +.endif +META2DEPS_CMD += \ + -R ${RELDIR} -H ${HOST_TARGET} \ + ${M2D_OBJROOTS:O:u:@o@-O $o@} + M2D_OBJROOTS += ${OBJTOP} ${_OBJROOT} ${_objroot} .if defined(SB_OBJROOT) @@ -133,13 +144,6 @@ META2DEPS_ARGS += MACHINE=none META2DEPS_CMD += -S ${SB_BACKING_SB}/src M2D_OBJROOTS += ${SB_BACKING_SB}/${SB_OBJPREFIX} .endif -META2DEPS_FILTER = sed 's,^src:,${SRCTOP}/,;s,^\([^/]\),${OBJTOP}/\1,' | -.elif ${META2DEPS:E} == "sh" -META2DEPS_CMD = ${_time} ${_sh_x} ${META2DEPS} \ - OBJTOP=${_objtop} SB_OBJROOT=${_objroot} -.else -META2DEPS_CMD ?= ${META2DEPS} -.endif # we are only interested in the dirs # sepecifically those we read something from. Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/mk/install-mk Mon May 20 22:35:32 2013 (r250835) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.88 2013/03/31 22:31:59 sjg Exp $ +# $Id: install-mk,v 1.90 2013/05/11 05:16:26 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20130330 +MK_VERSION=20130505 OWNER= GROUP= MODE=444 Modified: vendor/NetBSD/bmake/dist/mk/meta.stage.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.stage.mk Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/mk/meta.stage.mk Mon May 20 22:35:32 2013 (r250835) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.24 2013/03/23 02:25:19 sjg Exp $ +# $Id: meta.stage.mk,v 1.30 2013/04/19 16:32:57 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -228,4 +228,17 @@ STAGING_WAIT ?= .WAIT all: ${STAGING_WAIT} staging +.if exists(${.PARSEDIR}/stage-install.sh) && !defined(STAGE_INSTALL) +# this will run install(1) and then followup with .dirdep files. +STAGE_INSTALL := sh ${.PARSEDIR:tA}/stage-install.sh INSTALL="${INSTALL}" OBJDIR=${.OBJDIR:tA} +.endif + +# if ${INSTALL} gets run during 'all' assume it is for staging? +.if ${.TARGETS:Nall} == "" && defined(STAGE_INSTALL) +INSTALL := ${STAGE_INSTALL} +.if target(beforeinstall) +beforeinstall: .dirdep +.endif +.endif + .endif Modified: vendor/NetBSD/bmake/dist/mk/meta2deps.py ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta2deps.py Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/mk/meta2deps.py Mon May 20 22:35:32 2013 (r250835) @@ -35,7 +35,7 @@ We only pay attention to a subset of the """ RCSid: - $Id: meta2deps.py,v 1.12 2013/03/31 22:31:59 sjg Exp $ + $Id: meta2deps.py,v 1.13 2013/05/11 05:16:26 sjg Exp $ Copyright (c) 2011-2013, Juniper Networks, Inc. All rights reserved. @@ -124,6 +124,12 @@ def sort_unique(list, cmp=None, key=None nl.append(e) return nl +def add_trims(x): + return ['/' + x + '/', + '/' + x, + x + '/', + x] + class MetaFile: """class to parse meta files generated by bmake.""" @@ -152,6 +158,9 @@ class MetaFile: set to 'none' if we are not cross-building. More specifically if machine cannot be deduced from objdirs. + TARGET_SPEC + Sometimes MACHINE isn't enough. + HOST_TARGET when we build for the psuedo machine 'host' the object tree uses HOST_TARGET rather than MACHINE. @@ -177,6 +186,8 @@ class MetaFile: self.debug_out = getv(conf, 'debug_out', sys.stderr) self.machine = getv(conf, 'MACHINE', '') + self.machine_arch = getv(conf, 'MACHINE_ARCH', '') + self.target_spec = getv(conf, 'TARGET_SPEC', '') self.curdir = getv(conf, 'CURDIR') self.reldir = getv(conf, 'RELDIR') self.dpdeps = getv(conf, 'DPDEPS') @@ -196,16 +207,11 @@ class MetaFile: if not _srctop in self.srctops: self.srctops.append(_srctop) - trim_list = ['/' + self.machine + '/', - '/' + self.machine, - self.machine + '/', - self.machine] - + trim_list = add_trims(self.machine) if self.machine == 'host': - trim_list += ['/' + self.host_target + '/', - '/' + self.host_target, - self.host_target + '/', - self.host_target] + trim_list += add_trims(self.host_target) + if self.target_spec: + trim_list += add_trims(self.target_spec) for objroot in getv(conf, 'OBJROOTS', []): for e in trim_list: @@ -303,6 +309,8 @@ class MetaFile: print >> self.debug_out, "found %s: %s\n" % (ddepf, ddep) if ddep.endswith(self.machine): ddep = ddep[0:-(1+len(self.machine))] + elif self.target_spec and ddep.endswith(self.target_spec): + ddep = ddep[0:-(1+len(self.target_spec))] if not ddep: # no .dirdeps, so remember that we've seen the raw input @@ -520,6 +528,8 @@ def main(argv, klass=MetaFile, xopts='', -m "MACHINE" + -a "MACHINE_ARCH" + -H "HOST_TARGET" -D "DPDEPS" @@ -548,6 +558,9 @@ def main(argv, klass=MetaFile, xopts='', machine = os.environ['MACHINE'] if machine: conf['MACHINE'] = machine + machine_arch = os.environ['MACHINE_ARCH'] + if machine_arch: + conf['MACHINE_ARCH'] = machine_arch srctop = os.environ['SB_SRC'] if srctop: conf['SRCTOPS'].append(srctop) @@ -560,9 +573,11 @@ def main(argv, klass=MetaFile, xopts='', debug = 0 output = True - opts, args = getopt.getopt(argv[1:], 'dS:C:O:R:m:D:H:q' + xopts) + opts, args = getopt.getopt(argv[1:], 'a:dS:C:O:R:m:D:H:qT:' + xopts) for o, a in opts: - if o == '-d': + if o == '-a': + conf['MACHINE_ARCH'] = a + elif o == '-d': debug += 1 elif o == '-q': output = False @@ -582,6 +597,8 @@ def main(argv, klass=MetaFile, xopts='', conf['DPDEPS'] = a elif o == '-m': conf['MACHINE'] = a + elif o == '-T': + conf['TARGET_SPEC'] = a elif xoptf: xoptf(o, a, conf) Modified: vendor/NetBSD/bmake/dist/mk/meta2deps.sh ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta2deps.sh Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/mk/meta2deps.sh Mon May 20 22:35:32 2013 (r250835) @@ -49,8 +49,8 @@ # The output, is a set of absolute paths with "SB" like: #.nf # -# $SB/obj-i386/junos/gnu/lib/csu -# $SB/obj-i386/junos/gnu/lib/libgcc +# $SB/obj-i386/bsd/gnu/lib/csu +# $SB/obj-i386/bsd/gnu/lib/libgcc # $SB/obj-i386/bsd/include # $SB/obj-i386/bsd/lib/csu/i386-elf # $SB/obj-i386/bsd/lib/libc @@ -77,9 +77,9 @@ # RCSid: -# $Id: meta2deps.sh,v 1.5 2013/02/10 19:21:46 sjg Exp $ +# $Id: meta2deps.sh,v 1.6 2013/05/11 05:16:26 sjg Exp $ -# Copyright (c) 2010-2012, Juniper Networks, Inc. +# Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -115,16 +115,89 @@ meta2dirs() { sort -u } +add_list() { + sep=' ' + suffix= + while : + do + case "$1" in + "|") sep="$1"; shift;; + -s) suffix="$2"; shift 2;; + *) break;; + esac + done + name=$1 + shift + eval list="\$$name" + for top in "$@" + do + case "$sep$list$sep" in + *"$sep$top$suffix$sep"*) continue;; + esac + list="${list:+$list$sep}$top$suffix" + done + eval "$name=\"$list\"" +} + meta2deps() { DPDEPS= + SRCTOPS=$SRCTOP + OBJROOTS= while : do case "$1" in *=*) eval export "$1"; shift;; + -a) MACHINE_ARCH=$2; shift 2;; + -m) MACHINE=$2; shift 2;; + -C) CURDIR=$2; shift 2;; + -H) HOST_TARGET=$2; shift 2;; + -S) add_list SRCTOPS $2; shift 2;; + -O) add_list OBJROOTS $2; shift 2;; + -R) RELDIR=$2; shift 2;; + -T) TARGET_SPEC=$2; shift 2;; *) break;; esac done + _th= _o= + case "$MACHINE" in + host) _ht=$HOST_TARGET;; + esac + + for o in $OBJROOTS + do + case "$MACHINE,/$o/" in + host,*$HOST_TARGET*) ;; + *$MACHINE*|*${TARGET_SPEC:-$MACHINE}*) ;; + *) add_list _o $o; continue;; + esac + for x in $_ht $TARGET_SPEC $MACHINE + do + case "$o" in + "") continue;; + */$x/) add_list _o ${o%$x/}; o=;; + */$x) add_list _o ${o%$x}; o=;; + *$x/) add_list _o ${o%$x/}; o=;; + *$x) add_list _o ${o%$x}; o=;; + esac + done + done + OBJROOTS="$_o" + + case "$OBJTOP" in + "") + for o in $OBJROOTS + do + OBJTOP=$o${TARGET_SPEC:-$MACHINE} + break + done + ;; + esac + src_re= + obj_re= + add_list '|' -s '/*' src_re $SRCTOPS + add_list '|' -s '*' obj_re $OBJROOTS + [ -z "$RELDIR" ] && unset DPDEPS tf=/tmp/m2d$$-$USER rm -f $tf.* @@ -166,8 +239,7 @@ meta2deps() { esac case "$op,$path" in - *.dirdep) continue;; - W,*srcrel) continue;; + W,*srcrel|*.dirdep) continue;; C,*) case "$path" in /*) cwd=$path;; @@ -182,8 +254,7 @@ meta2deps() { ;; *) dir=${path%/*} case "$path" in - $SB/*|${SB_BACKING_SB:-$SB}/*) ;; - $SB_OBJROOT*) ;; + $src_re|$obj_re) ;; /*/stage/*) ;; /*) continue;; *) for path in $ldir/$path $cwd/$path @@ -215,7 +286,7 @@ meta2deps() { esac case "$dir" in ${CURDIR:-.}|${CURDIR:-.}/*|"") continue;; - $SRCTOP/*|${SB_BACKING_SB:-$SB}/src/*) + $src_re) # avoid repeating ourselves... case "$DPDEPS,$seensrc," in ,*) @@ -241,7 +312,7 @@ meta2deps() { [ -f $path ] || continue case "$dir" in $CWD) continue;; # ignore - $SRCTOP/*|${SB_BACKING_SB:-$SB}/src/*) + $src_re) seenit="$seenit,$seen" echo $dir >> $tf.srcdep case "$DPDEPS,$reldir,$seensrc," in @@ -267,7 +338,7 @@ meta2deps() { fi seenit="$seenit,$seen" case "$dir" in - $SB/*|${SB_OBJROOT:-$SB/}*|${SB_BACKING_SB:-$SB}/*) + $obj_re) echo $dir;; esac done > $tf.dirdep @@ -283,7 +354,7 @@ meta2deps() { # qualified with . as needed. # We strip .$MACHINE though xargs cat < $f | sort -u | - sed "s,^# ,,;s,^,$OBJTOP/,;s,\.$MACHINE\$,," + sed "s,^# ,,;s,^,$OBJTOP/,;s,\.${TARGET_SPEC:-$MACHINE}\$,,;s,\.$MACHINE\$,," ;; *) sort -u $f;; esac Modified: vendor/NetBSD/bmake/dist/mk/options.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/options.mk Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/mk/options.mk Mon May 20 22:35:32 2013 (r250835) @@ -1,4 +1,4 @@ -# $Id: options.mk,v 1.6 2013/01/28 19:28:52 sjg Exp $ +# $Id: options.mk,v 1.7 2013/04/17 20:32:38 sjg Exp $ # # @(#) Copyright (c) 2012, Simon J. Gerraty # @@ -13,7 +13,7 @@ # sjg@crufty.net # -# Inspired by FreeBSD bsd.own.mk, but intentionally simpler. +# Inspired by FreeBSD bsd.own.mk, but intentionally simpler and more flexible. # Options are normally listed in either OPTIONS_DEFAULT_{YES,NO} # We convert these to ${OPTION}/{yes,no} in OPTIONS_DEFAULT_VALUES. @@ -24,35 +24,36 @@ # ${OPTION}/yes in OPTIONS_DEFAULT_VALUES. # A makefile may set NO_* (or NO*) to indicate it cannot do something. # User sets WITH_* and WITHOUT_* to indicate what they want. -# We set MK_* which is then all we need care about. +# We set ${OPTION_PREFIX:UMK_}* which is then all we need care about. OPTIONS_DEFAULT_VALUES += \ ${OPTIONS_DEFAULT_NO:O:u:S,$,/no,} \ ${OPTIONS_DEFAULT_YES:O:u:S,$,/yes,} +OPTION_PREFIX ?= MK_ .for o in ${OPTIONS_DEFAULT_VALUES:M*/*} .if ${o:T:tl} == "no" .if defined(WITH_${o:H}) && !defined(NO_${o:H}) && !defined(NO${o:H}) -MK_${o:H} ?= yes +${OPTION_PREFIX}${o:H} ?= yes .else -MK_${o:H} ?= no +${OPTION_PREFIX}${o:H} ?= no .endif .else .if defined(WITHOUT_${o:H}) || defined(NO_${o:H}) || defined(NO${o:H}) -MK_${o:H} ?= no +${OPTION_PREFIX}${o:H} ?= no .else -MK_${o:H} ?= yes +${OPTION_PREFIX}${o:H} ?= yes .endif .endif .endfor # OPTIONS_DEFAULT_DEPENDENT += FOO_UTILS/FOO -# if neither WITH[OUT]_FOO_UTILS is set, use value of MK_FOO +# if neither WITH[OUT]_FOO_UTILS is set, use value of ${OPTION_PREFIX}FOO .for o in ${OPTIONS_DEFAULT_DEPENDENT:M*/*:O:u} .if defined(WITH_${o:H}) && !defined(NO_${o:H}) && !defined(NO${o:H}) -MK_${o:H} ?= yes +${OPTION_PREFIX}${o:H} ?= yes .elif defined(WITHOUT_${o:H}) || defined(NO_${o:H}) || defined(NO${o:H}) -MK_${o:H} ?= no +${OPTION_PREFIX}${o:H} ?= no .else -MK_${o:H} ?= ${MK_${o:T}} +${OPTION_PREFIX}${o:H} ?= ${${OPTION_PREFIX}${o:T}} .endif .endfor Modified: vendor/NetBSD/bmake/dist/mk/progs.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/progs.mk Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/mk/progs.mk Mon May 20 22:35:32 2013 (r250835) @@ -1,4 +1,4 @@ -# $Id: progs.mk,v 1.11 2012/11/06 17:18:54 sjg Exp $ +# $Id: progs.mk,v 1.12 2013/04/22 18:10:04 sjg Exp $ # # @(#) Copyright (c) 2006, Simon J. Gerraty # @@ -35,9 +35,11 @@ PROG ?= $t .if defined(PROG) # just one of many -PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS +PROG_VARS += BINDIR CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS .for v in ${PROG_VARS:O:u} +.if defined(${v}.${PROG}) $v += ${${v}_${PROG}:U${${v}.${PROG}}} +.endif .endfor # for meta mode, there can be only one! @@ -63,7 +65,8 @@ UPDATE_DEPENDFILE = NO .include <${.PARSEFILE:S,progs,prog,}> .ifndef PROG -PROGS_TARGETS += clean +# tell progs.mk we might want to install things +PROGS_TARGETS+= cleandepend cleandir cleanobj depend install .for p in ${PROGS} .if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p) Added: vendor/NetBSD/bmake/dist/mk/stage-install.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/bmake/dist/mk/stage-install.sh Mon May 20 22:35:32 2013 (r250835) @@ -0,0 +1,98 @@ +#!/bin/sh + +# NAME: +# stage-install.sh - wrapper around install +# +# SYNOPSIS: +# stage-install.sh [variable="value"] "args" "dest" +# +# DESCRIPTION: +# This script is a wrapper around the normal install(1). +# Its role is to add '.dirdep' files to the destination. +# The variables we might use are: +# +# INSTALL +# Path to actual install(1), default is +# $REAL_INSTALL +# +# OBJDIR +# Path to the dir where '.dirdep' was generated, +# default is '.' +# +# _DIRDEP +# Path to actual '.dirdep' file, default is +# $OBJDIR/.dirdep +# +# The "args" and "dest" are passed as is to install(1), and if a +# '.dirdep' file exists it will be linked or copied to each +# "file".dirdep placed in "dest" or "dest".dirdep if it happed +# to be a file rather than a directory. +# +# SEE ALSO: +# meta.stage.mk +# + +# RCSid: +# $Id: stage-install.sh,v 1.5 2013/04/19 16:32:24 sjg Exp $ +# +# @(#) Copyright (c) 2013, Simon J. Gerraty +# +# This file is provided in the hope that it will +# be of use. There is absolutely NO WARRANTY. +# Permission to copy, redistribute or otherwise +# use this file is hereby granted provided that +# the above copyright notice and this notice are +# left intact. +# +# Please send copies of changes and bug-fixes to: +# sjg@crufty.net +# + +INSTALL=${REAL_INSTALL:-install} +OBJDIR=. + +while : +do + case "$1" in + *=*) eval "$1"; shift;; + *) break;; + esac +done + +# if .dirdep doesn't exist, just run install and be done +_DIRDEP=${_DIRDEP:-$OBJDIR/.dirdep} +[ -s $_DIRDEP ] && EXEC= || EXEC=exec +$EXEC $INSTALL "$@" || exit 1 + +# from meta.stage.mk +LnCp() { + rm -f $2 2> /dev/null + ln $1 $2 2> /dev/null || cp -p $1 $2 +} + +StageDirdep() { + t=$1 + if [ -s $t.dirdep ]; then + cmp -s $_DIRDEP $t.dirdep && return + echo "ERROR: $t installed by `cat $t.dirdep` not `cat $_DIRDEP`" >&2 + exit 1 + fi + LnCp $_DIRDEP $t.dirdep || exit 1 +} + +args="$@" +while [ $# -gt 8 ] +do + shift 8 +done +eval dest=\$$# +if [ -f $dest ]; then + # a file, there can be only one .dirdep needed + StageDirdep $dest +elif [ -d $dest ]; then + for f in $args + do + test -f $f || continue + StageDirdep $dest/${f##*/} + done +fi Modified: vendor/NetBSD/bmake/dist/suff.c ============================================================================== --- vendor/NetBSD/bmake/dist/suff.c Mon May 20 22:18:18 2013 (r250834) +++ vendor/NetBSD/bmake/dist/suff.c Mon May 20 22:35:32 2013 (r250835) @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.69 2011/09/29 23:38:04 sjg Exp $ */ +/* $NetBSD: suff.c,v 1.70 2013/05/18 13:13:34 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.69 2011/09/29 23:38:04 sjg Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.70 2013/05/18 13:13:34 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.69 2011/09/29 23:38:04 sjg Exp $"); +__RCSID("$NetBSD: suff.c,v 1.70 2013/05/18 13:13:34 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -2058,118 +2058,124 @@ SuffFindNormalDeps(GNode *gn, Lst slst) * children, then look for any overriding transformations they imply. * Should we find one, we discard the one we found before. */ + bottom = NULL; + targ = NULL; - while (ln != NULL) { - /* - * Look for next possible suffix... - */ - ln = Lst_FindFrom(sufflist, ln, &sd, SuffSuffIsSuffixP); - - if (ln != NULL) { - int prefLen; /* Length of the prefix */ + if (!(gn->type & OP_PHONY)) { + while (ln != NULL) { /* - * Allocate a Src structure to which things can be transformed + * Look for next possible suffix... */ + ln = Lst_FindFrom(sufflist, ln, &sd, SuffSuffIsSuffixP); + + if (ln != NULL) { + int prefLen; /* Length of the prefix */ + + /* + * Allocate a Src structure to which things can be transformed + */ + targ = bmake_malloc(sizeof(Src)); + targ->file = bmake_strdup(gn->name); + targ->suff = (Suff *)Lst_Datum(ln); + targ->suff->refCount++; + targ->node = gn; + targ->parent = NULL; + targ->children = 0; +#ifdef DEBUG_SRC + targ->cp = Lst_Init(FALSE); +#endif + + /* + * Allocate room for the prefix, whose end is found by + * subtracting the length of the suffix from + * the end of the name. + */ + prefLen = (eoname - targ->suff->nameLen) - sopref; + targ->pref = bmake_malloc(prefLen + 1); + memcpy(targ->pref, sopref, prefLen); + targ->pref[prefLen] = '\0'; + + /* + * Add nodes from which the target can be made + */ + SuffAddLevel(srcs, targ); + + /* + * Record the target so we can nuke it + */ + (void)Lst_AtEnd(targs, targ); + + /* + * Search from this suffix's successor... + */ + ln = Lst_Succ(ln); + } + } + + /* + * Handle target of unknown suffix... + */ + if (Lst_IsEmpty(targs) && suffNull != NULL) { + if (DEBUG(SUFF)) { + fprintf(debug_file, "\tNo known suffix on %s. Using .NULL suffix\n", gn->name); + } + targ = bmake_malloc(sizeof(Src)); targ->file = bmake_strdup(gn->name); - targ->suff = (Suff *)Lst_Datum(ln); + targ->suff = suffNull; targ->suff->refCount++; targ->node = gn; targ->parent = NULL; targ->children = 0; + targ->pref = bmake_strdup(sopref); #ifdef DEBUG_SRC targ->cp = Lst_Init(FALSE); #endif /* - * Allocate room for the prefix, whose end is found by subtracting - * the length of the suffix from the end of the name. + * Only use the default suffix rules if we don't have commands + * defined for this gnode; traditional make programs used to + * not define suffix rules if the gnode had children but we + * don't do this anymore. */ - prefLen = (eoname - targ->suff->nameLen) - sopref; - targ->pref = bmake_malloc(prefLen + 1); - memcpy(targ->pref, sopref, prefLen); - targ->pref[prefLen] = '\0'; + if (Lst_IsEmpty(gn->commands)) + SuffAddLevel(srcs, targ); + else { + if (DEBUG(SUFF)) + fprintf(debug_file, "not "); + } - /* - * Add nodes from which the target can be made - */ - SuffAddLevel(srcs, targ); + if (DEBUG(SUFF)) + fprintf(debug_file, "adding suffix rules\n"); - /* - * Record the target so we can nuke it - */ (void)Lst_AtEnd(targs, targ); - - /* - * Search from this suffix's successor... - */ - ln = Lst_Succ(ln); - } - } - - /* - * Handle target of unknown suffix... - */ - if (Lst_IsEmpty(targs) && suffNull != NULL) { - if (DEBUG(SUFF)) { - fprintf(debug_file, "\tNo known suffix on %s. Using .NULL suffix\n", gn->name); } - targ = bmake_malloc(sizeof(Src)); - targ->file = bmake_strdup(gn->name); - targ->suff = suffNull; - targ->suff->refCount++; - targ->node = gn; - targ->parent = NULL; - targ->children = 0; - targ->pref = bmake_strdup(sopref); -#ifdef DEBUG_SRC - targ->cp = Lst_Init(FALSE); -#endif - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon May 20 22:37:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0FDABABD; Mon, 20 May 2013 22:37:11 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DBD9AC12; Mon, 20 May 2013 22:37:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KMbARu082176; Mon, 20 May 2013 22:37:10 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KMbAwx082175; Mon, 20 May 2013 22:37:10 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201305202237.r4KMbAwx082175@svn.freebsd.org> From: "Simon J. Gerraty" Date: Mon, 20 May 2013 22:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250836 - vendor/NetBSD/bmake/20130520 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 22:37:11 -0000 Author: sjg Date: Mon May 20 22:37:10 2013 New Revision: 250836 URL: http://svnweb.freebsd.org/changeset/base/250836 Log: Tag bmake-20130520 Added: vendor/NetBSD/bmake/20130520/ - copied from r250835, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@FreeBSD.ORG Mon May 20 22:51:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F105BF8F; Mon, 20 May 2013 22:51:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DFFC3F1E; Mon, 20 May 2013 22:51:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KMpEES087981; Mon, 20 May 2013 22:51:14 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KMpBXB087953; Mon, 20 May 2013 22:51:11 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201305202251.r4KMpBXB087953@svn.freebsd.org> From: "Simon J. Gerraty" Date: Mon, 20 May 2013 22:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250837 - in head: contrib/bmake contrib/bmake/mk usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 22:51:15 -0000 Author: sjg Date: Mon May 20 22:51:11 2013 New Revision: 250837 URL: http://svnweb.freebsd.org/changeset/base/250837 Log: Sync with upstream version (20130520) that includes same fixes made last week. Added: head/contrib/bmake/mk/stage-install.sh - copied unchanged from r250836, vendor/NetBSD/bmake/dist/mk/stage-install.sh Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/FILES head/contrib/bmake/Makefile head/contrib/bmake/meta.c head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/FILES head/contrib/bmake/mk/gendirdeps.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/meta.stage.mk head/contrib/bmake/mk/meta2deps.py head/contrib/bmake/mk/meta2deps.sh head/contrib/bmake/mk/options.mk head/contrib/bmake/mk/progs.mk head/contrib/bmake/suff.c head/contrib/bmake/var.c head/usr.bin/bmake/Makefile Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/ChangeLog Mon May 20 22:51:11 2013 (r250837) @@ -1,3 +1,17 @@ +2013-05-20 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20130520 + generate manifest from component FILES rather than have to + update FILES when mk/FILES changes. + +2013-05-18 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20130518 + Merge with NetBSD make, pick up + o suff.c: don't skip all processsing for .PHONY targets + else wildcard srcs do not get expanded. + o var.c: expand name of variable to delete if necessary. + 2013-03-30 Simon J. Gerraty * Makefile (MAKE_VERSION): 20130330 Modified: head/contrib/bmake/FILES ============================================================================== --- head/contrib/bmake/FILES Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/FILES Mon May 20 22:51:11 2013 (r250837) @@ -1,29 +1,26 @@ -FILES ChangeLog -bmake.cat1 -boot-strap -bsd.after-import.mk -os.sh -makefile.in +FILES Makefile Makefile.config.in PSD.doc/Makefile PSD.doc/tutorial.ms README +aclocal.m4 arch.c +bmake.1 +bmake.cat1 +boot-strap +bsd.after-import.mk buf.c buf.h compat.c cond.c -make-conf.h -make_malloc.c -make_malloc.h config.h.in configure -aclocal.m4 configure.in dir.c dir.h +dirname.c find_lib.sh for.c getopt.c @@ -32,16 +29,6 @@ hash.h install-sh job.c job.h -meta.c -meta.h -dirname.c -realpath.c -strlcpy.c -strlist.c -strlist.h -stresep.c -trace.c -trace.h lst.h lst.lib/Makefile lst.lib/lstAppend.c @@ -74,26 +61,36 @@ lst.lib/lstReplace.c lst.lib/lstSucc.c machine.sh main.c +make-bootstrap.sh.in +make-conf.h make.1 -bmake.1 make.c make.h -make-bootstrap.sh.in +make_malloc.c +make_malloc.h +makefile.in +meta.c +meta.h missing/sys/cdefs.h mkdeps.sh nonints.h +os.sh parse.c pathnames.h ranlib.h +realpath.c setenv.c sigcompat.c sprite.h str.c +stresep.c +strlcpy.c +strlist.c +strlist.h suff.c targ.c -util.c -var.c -wait.h +trace.c +trace.h unit-tests/Makefile.in unit-tests/comment unit-tests/cond1 @@ -123,63 +120,6 @@ unit-tests/test.exp unit-tests/unexport unit-tests/unexport-env unit-tests/varcmd -mk/ChangeLog -mk/FILES -mk/README -mk/auto.obj.mk -mk/autoconf.mk -mk/autodep.mk -mk/auto.dep.mk -mk/dep.mk -mk/doc.mk -mk/dpadd.mk -mk/final.mk -mk/host-target.mk -mk/host.libnames.mk -mk/inc.mk -mk/init.mk -mk/install-mk -mk/java.mk -mk/lib.mk -mk/libnames.mk -mk/libs.mk -mk/links.mk -mk/man.mk -mk/mk-files.txt -mk/nls.mk -mk/obj.mk -mk/options.mk -mk/own.mk -mk/prlist.mk -mk/prog.mk -mk/progs.mk -mk/rst2htm.mk -mk/scripts.mk -mk/srctop.mk -mk/subdir.mk -mk/sys.mk -mk/sys.clean-env.mk -mk/sys.dependfile.mk -mk/sys/AIX.mk -mk/sys/Darwin.mk -mk/sys/Generic.mk -mk/sys/HP-UX.mk -mk/sys/IRIX.mk -mk/sys/Linux.mk -mk/sys/NetBSD.mk -mk/sys/OSF1.mk -mk/sys/OpenBSD.mk -mk/sys/SunOS.mk -mk/sys/UnixWare.mk -mk/target-flags.mk -mk/warnings.mk -mk/yacc.mk -mk/dirdeps.mk -mk/gendirdeps.mk -mk/install-new.mk -mk/meta2deps.py -mk/meta2deps.sh -mk/meta.sys.mk -mk/meta.autodep.mk -mk/meta.stage.mk -mk/meta.subdir.mk +util.c +var.c +wait.h Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/Makefile Mon May 20 22:51:11 2013 (r250837) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.10 2013/03/31 05:57:19 sjg Exp $ +# $Id: Makefile,v 1.12 2013/05/20 16:05:10 sjg Exp $ # Base version on src date -MAKE_VERSION= 20130330 +MAKE_VERSION= 20130520 PROG= bmake Modified: head/contrib/bmake/meta.c ============================================================================== --- head/contrib/bmake/meta.c Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/meta.c Mon May 20 22:51:11 2013 (r250837) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.29 2013/03/31 05:49:51 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.30 2013/05/16 21:56:56 sjg Exp $ */ /* * Implement 'meta' mode. @@ -543,7 +543,7 @@ boolValue(char *s) * Initialization we need before reading makefiles. */ void -meta_init() +meta_init(void) { #ifdef USE_FILEMON /* this allows makefiles to test if we have filemon support */ Modified: head/contrib/bmake/mk/ChangeLog ============================================================================== --- head/contrib/bmake/mk/ChangeLog Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/mk/ChangeLog Mon May 20 22:51:11 2013 (r250837) @@ -1,3 +1,23 @@ +2013-05-10 Simon J. Gerraty + + * install-mk (MK_VERSION): 20130505 + * gendirdeps.mk, meta2deps.py, meta2deps.sh: handle $TARGET_SPEC + for when $MACHINE isn't enough for objdir distinction. + Bring meta2deps.sh closer to par with meta2deps.py. + +2013-04-18 Simon J. Gerraty + + * meta.stage.mk: set INSTALL to STAGE_INSTALL when making 'all' + also if the target 'beforeinstall' exists, make it depend on + .dirdep (incase it uses STAGE_INSTALL). + +2013-04-17 Simon J. Gerraty + + * install-mk (MK_VERSION): 20130401 ;-) + * meta.stage.mk (STAGE_INSTALL_SH): add stage-install.sh as + wrapper around install(1). + * options.mk (OPTION_PREFIX): Allow a prefix other than MK_ + 2013-03-30 Simon J. Gerraty * meta2deps.py (MetaFile.__init__): ensure self.cwd is initialized. Modified: head/contrib/bmake/mk/FILES ============================================================================== --- head/contrib/bmake/mk/FILES Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/mk/FILES Mon May 20 22:51:11 2013 (r250837) @@ -31,6 +31,7 @@ progs.mk rst2htm.mk scripts.mk srctop.mk +stage-install.sh subdir.mk sys.mk sys.clean-env.mk Modified: head/contrib/bmake/mk/gendirdeps.mk ============================================================================== --- head/contrib/bmake/mk/gendirdeps.mk Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/mk/gendirdeps.mk Mon May 20 22:51:11 2013 (r250837) @@ -1,4 +1,4 @@ -# $Id: gendirdeps.mk,v 1.21 2013/03/28 20:01:05 sjg Exp $ +# $Id: gendirdeps.mk,v 1.22 2013/05/11 05:16:26 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -111,13 +111,24 @@ _py_d = .if ${META2DEPS:E} == "py" # we can afford to do this all the time. DPDEPS ?= no -META2DEPS_CMD = ${_time} ${PYTHON} ${META2DEPS} ${_py_d} \ - -R ${RELDIR} -H ${HOST_TARGET} \ - ${M2D_OBJROOTS:O:u:@o@-O $o@} - +META2DEPS_CMD = ${_time} ${PYTHON} ${META2DEPS} ${_py_d} .if ${DPDEPS:tl} != "no" META2DEPS_CMD += -D ${DPDEPS} .endif +META2DEPS_FILTER = sed 's,^src:,${SRCTOP}/,;s,^\([^/]\),${OBJTOP}/\1,' | +.elif ${META2DEPS:E} == "sh" +META2DEPS_CMD = ${_time} ${_sh_x} ${META2DEPS} OBJTOP=${_OBJTOP} +.else +META2DEPS_CMD ?= ${META2DEPS} +.endif + +.if ${TARGET_OBJ_SPEC:U${MACHINE}} != ${MACHINE} +META2DEPS_CMD += -T ${TARGET_OBJ_SPEC} +.endif +META2DEPS_CMD += \ + -R ${RELDIR} -H ${HOST_TARGET} \ + ${M2D_OBJROOTS:O:u:@o@-O $o@} + M2D_OBJROOTS += ${OBJTOP} ${_OBJROOT} ${_objroot} .if defined(SB_OBJROOT) @@ -133,13 +144,6 @@ META2DEPS_ARGS += MACHINE=none META2DEPS_CMD += -S ${SB_BACKING_SB}/src M2D_OBJROOTS += ${SB_BACKING_SB}/${SB_OBJPREFIX} .endif -META2DEPS_FILTER = sed 's,^src:,${SRCTOP}/,;s,^\([^/]\),${OBJTOP}/\1,' | -.elif ${META2DEPS:E} == "sh" -META2DEPS_CMD = ${_time} ${_sh_x} ${META2DEPS} \ - OBJTOP=${_objtop} SB_OBJROOT=${_objroot} -.else -META2DEPS_CMD ?= ${META2DEPS} -.endif # we are only interested in the dirs # sepecifically those we read something from. Modified: head/contrib/bmake/mk/install-mk ============================================================================== --- head/contrib/bmake/mk/install-mk Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/mk/install-mk Mon May 20 22:51:11 2013 (r250837) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.88 2013/03/31 22:31:59 sjg Exp $ +# $Id: install-mk,v 1.90 2013/05/11 05:16:26 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20130330 +MK_VERSION=20130505 OWNER= GROUP= MODE=444 Modified: head/contrib/bmake/mk/meta.stage.mk ============================================================================== --- head/contrib/bmake/mk/meta.stage.mk Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/mk/meta.stage.mk Mon May 20 22:51:11 2013 (r250837) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.24 2013/03/23 02:25:19 sjg Exp $ +# $Id: meta.stage.mk,v 1.30 2013/04/19 16:32:57 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -228,4 +228,17 @@ STAGING_WAIT ?= .WAIT all: ${STAGING_WAIT} staging +.if exists(${.PARSEDIR}/stage-install.sh) && !defined(STAGE_INSTALL) +# this will run install(1) and then followup with .dirdep files. +STAGE_INSTALL := sh ${.PARSEDIR:tA}/stage-install.sh INSTALL="${INSTALL}" OBJDIR=${.OBJDIR:tA} +.endif + +# if ${INSTALL} gets run during 'all' assume it is for staging? +.if ${.TARGETS:Nall} == "" && defined(STAGE_INSTALL) +INSTALL := ${STAGE_INSTALL} +.if target(beforeinstall) +beforeinstall: .dirdep +.endif +.endif + .endif Modified: head/contrib/bmake/mk/meta2deps.py ============================================================================== --- head/contrib/bmake/mk/meta2deps.py Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/mk/meta2deps.py Mon May 20 22:51:11 2013 (r250837) @@ -35,7 +35,7 @@ We only pay attention to a subset of the """ RCSid: - $Id: meta2deps.py,v 1.12 2013/03/31 22:31:59 sjg Exp $ + $Id: meta2deps.py,v 1.13 2013/05/11 05:16:26 sjg Exp $ Copyright (c) 2011-2013, Juniper Networks, Inc. All rights reserved. @@ -124,6 +124,12 @@ def sort_unique(list, cmp=None, key=None nl.append(e) return nl +def add_trims(x): + return ['/' + x + '/', + '/' + x, + x + '/', + x] + class MetaFile: """class to parse meta files generated by bmake.""" @@ -152,6 +158,9 @@ class MetaFile: set to 'none' if we are not cross-building. More specifically if machine cannot be deduced from objdirs. + TARGET_SPEC + Sometimes MACHINE isn't enough. + HOST_TARGET when we build for the psuedo machine 'host' the object tree uses HOST_TARGET rather than MACHINE. @@ -177,6 +186,8 @@ class MetaFile: self.debug_out = getv(conf, 'debug_out', sys.stderr) self.machine = getv(conf, 'MACHINE', '') + self.machine_arch = getv(conf, 'MACHINE_ARCH', '') + self.target_spec = getv(conf, 'TARGET_SPEC', '') self.curdir = getv(conf, 'CURDIR') self.reldir = getv(conf, 'RELDIR') self.dpdeps = getv(conf, 'DPDEPS') @@ -196,16 +207,11 @@ class MetaFile: if not _srctop in self.srctops: self.srctops.append(_srctop) - trim_list = ['/' + self.machine + '/', - '/' + self.machine, - self.machine + '/', - self.machine] - + trim_list = add_trims(self.machine) if self.machine == 'host': - trim_list += ['/' + self.host_target + '/', - '/' + self.host_target, - self.host_target + '/', - self.host_target] + trim_list += add_trims(self.host_target) + if self.target_spec: + trim_list += add_trims(self.target_spec) for objroot in getv(conf, 'OBJROOTS', []): for e in trim_list: @@ -303,6 +309,8 @@ class MetaFile: print >> self.debug_out, "found %s: %s\n" % (ddepf, ddep) if ddep.endswith(self.machine): ddep = ddep[0:-(1+len(self.machine))] + elif self.target_spec and ddep.endswith(self.target_spec): + ddep = ddep[0:-(1+len(self.target_spec))] if not ddep: # no .dirdeps, so remember that we've seen the raw input @@ -520,6 +528,8 @@ def main(argv, klass=MetaFile, xopts='', -m "MACHINE" + -a "MACHINE_ARCH" + -H "HOST_TARGET" -D "DPDEPS" @@ -548,6 +558,9 @@ def main(argv, klass=MetaFile, xopts='', machine = os.environ['MACHINE'] if machine: conf['MACHINE'] = machine + machine_arch = os.environ['MACHINE_ARCH'] + if machine_arch: + conf['MACHINE_ARCH'] = machine_arch srctop = os.environ['SB_SRC'] if srctop: conf['SRCTOPS'].append(srctop) @@ -560,9 +573,11 @@ def main(argv, klass=MetaFile, xopts='', debug = 0 output = True - opts, args = getopt.getopt(argv[1:], 'dS:C:O:R:m:D:H:q' + xopts) + opts, args = getopt.getopt(argv[1:], 'a:dS:C:O:R:m:D:H:qT:' + xopts) for o, a in opts: - if o == '-d': + if o == '-a': + conf['MACHINE_ARCH'] = a + elif o == '-d': debug += 1 elif o == '-q': output = False @@ -582,6 +597,8 @@ def main(argv, klass=MetaFile, xopts='', conf['DPDEPS'] = a elif o == '-m': conf['MACHINE'] = a + elif o == '-T': + conf['TARGET_SPEC'] = a elif xoptf: xoptf(o, a, conf) Modified: head/contrib/bmake/mk/meta2deps.sh ============================================================================== --- head/contrib/bmake/mk/meta2deps.sh Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/mk/meta2deps.sh Mon May 20 22:51:11 2013 (r250837) @@ -49,8 +49,8 @@ # The output, is a set of absolute paths with "SB" like: #.nf # -# $SB/obj-i386/junos/gnu/lib/csu -# $SB/obj-i386/junos/gnu/lib/libgcc +# $SB/obj-i386/bsd/gnu/lib/csu +# $SB/obj-i386/bsd/gnu/lib/libgcc # $SB/obj-i386/bsd/include # $SB/obj-i386/bsd/lib/csu/i386-elf # $SB/obj-i386/bsd/lib/libc @@ -77,9 +77,9 @@ # RCSid: -# $Id: meta2deps.sh,v 1.5 2013/02/10 19:21:46 sjg Exp $ +# $Id: meta2deps.sh,v 1.6 2013/05/11 05:16:26 sjg Exp $ -# Copyright (c) 2010-2012, Juniper Networks, Inc. +# Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -115,16 +115,89 @@ meta2dirs() { sort -u } +add_list() { + sep=' ' + suffix= + while : + do + case "$1" in + "|") sep="$1"; shift;; + -s) suffix="$2"; shift 2;; + *) break;; + esac + done + name=$1 + shift + eval list="\$$name" + for top in "$@" + do + case "$sep$list$sep" in + *"$sep$top$suffix$sep"*) continue;; + esac + list="${list:+$list$sep}$top$suffix" + done + eval "$name=\"$list\"" +} + meta2deps() { DPDEPS= + SRCTOPS=$SRCTOP + OBJROOTS= while : do case "$1" in *=*) eval export "$1"; shift;; + -a) MACHINE_ARCH=$2; shift 2;; + -m) MACHINE=$2; shift 2;; + -C) CURDIR=$2; shift 2;; + -H) HOST_TARGET=$2; shift 2;; + -S) add_list SRCTOPS $2; shift 2;; + -O) add_list OBJROOTS $2; shift 2;; + -R) RELDIR=$2; shift 2;; + -T) TARGET_SPEC=$2; shift 2;; *) break;; esac done + _th= _o= + case "$MACHINE" in + host) _ht=$HOST_TARGET;; + esac + + for o in $OBJROOTS + do + case "$MACHINE,/$o/" in + host,*$HOST_TARGET*) ;; + *$MACHINE*|*${TARGET_SPEC:-$MACHINE}*) ;; + *) add_list _o $o; continue;; + esac + for x in $_ht $TARGET_SPEC $MACHINE + do + case "$o" in + "") continue;; + */$x/) add_list _o ${o%$x/}; o=;; + */$x) add_list _o ${o%$x}; o=;; + *$x/) add_list _o ${o%$x/}; o=;; + *$x) add_list _o ${o%$x}; o=;; + esac + done + done + OBJROOTS="$_o" + + case "$OBJTOP" in + "") + for o in $OBJROOTS + do + OBJTOP=$o${TARGET_SPEC:-$MACHINE} + break + done + ;; + esac + src_re= + obj_re= + add_list '|' -s '/*' src_re $SRCTOPS + add_list '|' -s '*' obj_re $OBJROOTS + [ -z "$RELDIR" ] && unset DPDEPS tf=/tmp/m2d$$-$USER rm -f $tf.* @@ -166,8 +239,7 @@ meta2deps() { esac case "$op,$path" in - *.dirdep) continue;; - W,*srcrel) continue;; + W,*srcrel|*.dirdep) continue;; C,*) case "$path" in /*) cwd=$path;; @@ -182,8 +254,7 @@ meta2deps() { ;; *) dir=${path%/*} case "$path" in - $SB/*|${SB_BACKING_SB:-$SB}/*) ;; - $SB_OBJROOT*) ;; + $src_re|$obj_re) ;; /*/stage/*) ;; /*) continue;; *) for path in $ldir/$path $cwd/$path @@ -215,7 +286,7 @@ meta2deps() { esac case "$dir" in ${CURDIR:-.}|${CURDIR:-.}/*|"") continue;; - $SRCTOP/*|${SB_BACKING_SB:-$SB}/src/*) + $src_re) # avoid repeating ourselves... case "$DPDEPS,$seensrc," in ,*) @@ -241,7 +312,7 @@ meta2deps() { [ -f $path ] || continue case "$dir" in $CWD) continue;; # ignore - $SRCTOP/*|${SB_BACKING_SB:-$SB}/src/*) + $src_re) seenit="$seenit,$seen" echo $dir >> $tf.srcdep case "$DPDEPS,$reldir,$seensrc," in @@ -267,7 +338,7 @@ meta2deps() { fi seenit="$seenit,$seen" case "$dir" in - $SB/*|${SB_OBJROOT:-$SB/}*|${SB_BACKING_SB:-$SB}/*) + $obj_re) echo $dir;; esac done > $tf.dirdep @@ -283,7 +354,7 @@ meta2deps() { # qualified with . as needed. # We strip .$MACHINE though xargs cat < $f | sort -u | - sed "s,^# ,,;s,^,$OBJTOP/,;s,\.$MACHINE\$,," + sed "s,^# ,,;s,^,$OBJTOP/,;s,\.${TARGET_SPEC:-$MACHINE}\$,,;s,\.$MACHINE\$,," ;; *) sort -u $f;; esac Modified: head/contrib/bmake/mk/options.mk ============================================================================== --- head/contrib/bmake/mk/options.mk Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/mk/options.mk Mon May 20 22:51:11 2013 (r250837) @@ -1,4 +1,4 @@ -# $Id: options.mk,v 1.6 2013/01/28 19:28:52 sjg Exp $ +# $Id: options.mk,v 1.7 2013/04/17 20:32:38 sjg Exp $ # # @(#) Copyright (c) 2012, Simon J. Gerraty # @@ -13,7 +13,7 @@ # sjg@crufty.net # -# Inspired by FreeBSD bsd.own.mk, but intentionally simpler. +# Inspired by FreeBSD bsd.own.mk, but intentionally simpler and more flexible. # Options are normally listed in either OPTIONS_DEFAULT_{YES,NO} # We convert these to ${OPTION}/{yes,no} in OPTIONS_DEFAULT_VALUES. @@ -24,35 +24,36 @@ # ${OPTION}/yes in OPTIONS_DEFAULT_VALUES. # A makefile may set NO_* (or NO*) to indicate it cannot do something. # User sets WITH_* and WITHOUT_* to indicate what they want. -# We set MK_* which is then all we need care about. +# We set ${OPTION_PREFIX:UMK_}* which is then all we need care about. OPTIONS_DEFAULT_VALUES += \ ${OPTIONS_DEFAULT_NO:O:u:S,$,/no,} \ ${OPTIONS_DEFAULT_YES:O:u:S,$,/yes,} +OPTION_PREFIX ?= MK_ .for o in ${OPTIONS_DEFAULT_VALUES:M*/*} .if ${o:T:tl} == "no" .if defined(WITH_${o:H}) && !defined(NO_${o:H}) && !defined(NO${o:H}) -MK_${o:H} ?= yes +${OPTION_PREFIX}${o:H} ?= yes .else -MK_${o:H} ?= no +${OPTION_PREFIX}${o:H} ?= no .endif .else .if defined(WITHOUT_${o:H}) || defined(NO_${o:H}) || defined(NO${o:H}) -MK_${o:H} ?= no +${OPTION_PREFIX}${o:H} ?= no .else -MK_${o:H} ?= yes +${OPTION_PREFIX}${o:H} ?= yes .endif .endif .endfor # OPTIONS_DEFAULT_DEPENDENT += FOO_UTILS/FOO -# if neither WITH[OUT]_FOO_UTILS is set, use value of MK_FOO +# if neither WITH[OUT]_FOO_UTILS is set, use value of ${OPTION_PREFIX}FOO .for o in ${OPTIONS_DEFAULT_DEPENDENT:M*/*:O:u} .if defined(WITH_${o:H}) && !defined(NO_${o:H}) && !defined(NO${o:H}) -MK_${o:H} ?= yes +${OPTION_PREFIX}${o:H} ?= yes .elif defined(WITHOUT_${o:H}) || defined(NO_${o:H}) || defined(NO${o:H}) -MK_${o:H} ?= no +${OPTION_PREFIX}${o:H} ?= no .else -MK_${o:H} ?= ${MK_${o:T}} +${OPTION_PREFIX}${o:H} ?= ${${OPTION_PREFIX}${o:T}} .endif .endfor Modified: head/contrib/bmake/mk/progs.mk ============================================================================== --- head/contrib/bmake/mk/progs.mk Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/mk/progs.mk Mon May 20 22:51:11 2013 (r250837) @@ -1,4 +1,4 @@ -# $Id: progs.mk,v 1.11 2012/11/06 17:18:54 sjg Exp $ +# $Id: progs.mk,v 1.12 2013/04/22 18:10:04 sjg Exp $ # # @(#) Copyright (c) 2006, Simon J. Gerraty # @@ -35,9 +35,11 @@ PROG ?= $t .if defined(PROG) # just one of many -PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS +PROG_VARS += BINDIR CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS .for v in ${PROG_VARS:O:u} +.if defined(${v}.${PROG}) $v += ${${v}_${PROG}:U${${v}.${PROG}}} +.endif .endfor # for meta mode, there can be only one! @@ -63,7 +65,8 @@ UPDATE_DEPENDFILE = NO .include <${.PARSEFILE:S,progs,prog,}> .ifndef PROG -PROGS_TARGETS += clean +# tell progs.mk we might want to install things +PROGS_TARGETS+= cleandepend cleandir cleanobj depend install .for p in ${PROGS} .if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p) Copied: head/contrib/bmake/mk/stage-install.sh (from r250836, vendor/NetBSD/bmake/dist/mk/stage-install.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/bmake/mk/stage-install.sh Mon May 20 22:51:11 2013 (r250837, copy of r250836, vendor/NetBSD/bmake/dist/mk/stage-install.sh) @@ -0,0 +1,98 @@ +#!/bin/sh + +# NAME: +# stage-install.sh - wrapper around install +# +# SYNOPSIS: +# stage-install.sh [variable="value"] "args" "dest" +# +# DESCRIPTION: +# This script is a wrapper around the normal install(1). +# Its role is to add '.dirdep' files to the destination. +# The variables we might use are: +# +# INSTALL +# Path to actual install(1), default is +# $REAL_INSTALL +# +# OBJDIR +# Path to the dir where '.dirdep' was generated, +# default is '.' +# +# _DIRDEP +# Path to actual '.dirdep' file, default is +# $OBJDIR/.dirdep +# +# The "args" and "dest" are passed as is to install(1), and if a +# '.dirdep' file exists it will be linked or copied to each +# "file".dirdep placed in "dest" or "dest".dirdep if it happed +# to be a file rather than a directory. +# +# SEE ALSO: +# meta.stage.mk +# + +# RCSid: +# $Id: stage-install.sh,v 1.5 2013/04/19 16:32:24 sjg Exp $ +# +# @(#) Copyright (c) 2013, Simon J. Gerraty +# +# This file is provided in the hope that it will +# be of use. There is absolutely NO WARRANTY. +# Permission to copy, redistribute or otherwise +# use this file is hereby granted provided that +# the above copyright notice and this notice are +# left intact. +# +# Please send copies of changes and bug-fixes to: +# sjg@crufty.net +# + +INSTALL=${REAL_INSTALL:-install} +OBJDIR=. + +while : +do + case "$1" in + *=*) eval "$1"; shift;; + *) break;; + esac +done + +# if .dirdep doesn't exist, just run install and be done +_DIRDEP=${_DIRDEP:-$OBJDIR/.dirdep} +[ -s $_DIRDEP ] && EXEC= || EXEC=exec +$EXEC $INSTALL "$@" || exit 1 + +# from meta.stage.mk +LnCp() { + rm -f $2 2> /dev/null + ln $1 $2 2> /dev/null || cp -p $1 $2 +} + +StageDirdep() { + t=$1 + if [ -s $t.dirdep ]; then + cmp -s $_DIRDEP $t.dirdep && return + echo "ERROR: $t installed by `cat $t.dirdep` not `cat $_DIRDEP`" >&2 + exit 1 + fi + LnCp $_DIRDEP $t.dirdep || exit 1 +} + +args="$@" +while [ $# -gt 8 ] +do + shift 8 +done +eval dest=\$$# +if [ -f $dest ]; then + # a file, there can be only one .dirdep needed + StageDirdep $dest +elif [ -d $dest ]; then + for f in $args + do + test -f $f || continue + StageDirdep $dest/${f##*/} + done +fi Modified: head/contrib/bmake/suff.c ============================================================================== --- head/contrib/bmake/suff.c Mon May 20 22:37:10 2013 (r250836) +++ head/contrib/bmake/suff.c Mon May 20 22:51:11 2013 (r250837) @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.69 2011/09/29 23:38:04 sjg Exp $ */ +/* $NetBSD: suff.c,v 1.70 2013/05/18 13:13:34 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.69 2011/09/29 23:38:04 sjg Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.70 2013/05/18 13:13:34 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.69 2011/09/29 23:38:04 sjg Exp $"); +__RCSID("$NetBSD: suff.c,v 1.70 2013/05/18 13:13:34 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -2063,118 +2063,119 @@ SuffFindNormalDeps(GNode *gn, Lst slst) if (!(gn->type & OP_PHONY)) { - while (ln != NULL) { + while (ln != NULL) { + /* + * Look for next possible suffix... + */ + ln = Lst_FindFrom(sufflist, ln, &sd, SuffSuffIsSuffixP); + + if (ln != NULL) { + int prefLen; /* Length of the prefix */ + + /* + * Allocate a Src structure to which things can be transformed + */ + targ = bmake_malloc(sizeof(Src)); + targ->file = bmake_strdup(gn->name); + targ->suff = (Suff *)Lst_Datum(ln); + targ->suff->refCount++; + targ->node = gn; + targ->parent = NULL; + targ->children = 0; +#ifdef DEBUG_SRC + targ->cp = Lst_Init(FALSE); +#endif + + /* + * Allocate room for the prefix, whose end is found by + * subtracting the length of the suffix from + * the end of the name. + */ + prefLen = (eoname - targ->suff->nameLen) - sopref; + targ->pref = bmake_malloc(prefLen + 1); + memcpy(targ->pref, sopref, prefLen); + targ->pref[prefLen] = '\0'; + + /* + * Add nodes from which the target can be made + */ + SuffAddLevel(srcs, targ); + + /* + * Record the target so we can nuke it + */ + (void)Lst_AtEnd(targs, targ); + + /* + * Search from this suffix's successor... + */ + ln = Lst_Succ(ln); + } + } + /* - * Look for next possible suffix... + * Handle target of unknown suffix... */ - ln = Lst_FindFrom(sufflist, ln, &sd, SuffSuffIsSuffixP); - - if (ln != NULL) { - int prefLen; /* Length of the prefix */ + if (Lst_IsEmpty(targs) && suffNull != NULL) { + if (DEBUG(SUFF)) { + fprintf(debug_file, "\tNo known suffix on %s. Using .NULL suffix\n", gn->name); + } - /* - * Allocate a Src structure to which things can be transformed - */ targ = bmake_malloc(sizeof(Src)); targ->file = bmake_strdup(gn->name); - targ->suff = (Suff *)Lst_Datum(ln); + targ->suff = suffNull; targ->suff->refCount++; targ->node = gn; targ->parent = NULL; targ->children = 0; + targ->pref = bmake_strdup(sopref); #ifdef DEBUG_SRC targ->cp = Lst_Init(FALSE); #endif /* - * Allocate room for the prefix, whose end is found by subtracting - * the length of the suffix from the end of the name. + * Only use the default suffix rules if we don't have commands + * defined for this gnode; traditional make programs used to + * not define suffix rules if the gnode had children but we + * don't do this anymore. */ - prefLen = (eoname - targ->suff->nameLen) - sopref; - targ->pref = bmake_malloc(prefLen + 1); - memcpy(targ->pref, sopref, prefLen); - targ->pref[prefLen] = '\0'; + if (Lst_IsEmpty(gn->commands)) + SuffAddLevel(srcs, targ); + else { + if (DEBUG(SUFF)) + fprintf(debug_file, "not "); + } - /* - * Add nodes from which the target can be made - */ - SuffAddLevel(srcs, targ); + if (DEBUG(SUFF)) + fprintf(debug_file, "adding suffix rules\n"); - /* - * Record the target so we can nuke it - */ (void)Lst_AtEnd(targs, targ); - - /* - * Search from this suffix's successor... - */ - ln = Lst_Succ(ln); - } - } - - /* - * Handle target of unknown suffix... - */ - if (Lst_IsEmpty(targs) && suffNull != NULL) { - if (DEBUG(SUFF)) { - fprintf(debug_file, "\tNo known suffix on %s. Using .NULL suffix\n", gn->name); } - targ = bmake_malloc(sizeof(Src)); - targ->file = bmake_strdup(gn->name); - targ->suff = suffNull; - targ->suff->refCount++; - targ->node = gn; - targ->parent = NULL; - targ->children = 0; - targ->pref = bmake_strdup(sopref); -#ifdef DEBUG_SRC - targ->cp = Lst_Init(FALSE); -#endif - /* - * Only use the default suffix rules if we don't have commands - * defined for this gnode; traditional make programs used to - * not define suffix rules if the gnode had children but we - * don't do this anymore. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon May 20 23:02:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 64DEB339; Mon, 20 May 2013 23:02:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by mx1.freebsd.org (Postfix) with ESMTP id 2A90EFB7; Mon, 20 May 2013 23:02:15 +0000 (UTC) Received: by mail-pd0-f181.google.com with SMTP id p11so5799489pdj.40 for ; Mon, 20 May 2013 16:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:subject:mime-version:content-type:from:in-reply-to:date :cc:content-transfer-encoding:message-id:references:to:x-mailer; bh=j87KbnicvUQrKa/YXIalOC1KFBc/5dk8/OkDUw8vVdA=; b=Low7gzo9eDS7kEmFKoErQ0SynZinjZuVMx9zyzXAaWFSt6xzDuH2q8u8raHD3DiEaN i1juGynBkBT2xjE9EzJMUMdESs9aQhzbRCMadLmSoFFGLqUkQ347aXXncPRHHsRaeFi3 HBIfNjQnDx1hdQh0fTNL6Hqavz/QSW5PR4MRXHYgLINOl83ixdSl/vzf7MOTcQztg6a6 Hu2g3NBx6BpD75DxHct3GkGi+wGP6AwhNKr0nGg2OnfHiyWeJcc6tgRP2+pCG8P7KSLx 3WKZ7TmWORWBjm3TG1LvI8tVJJiGBgQwrIN6YJbPQDch1jjCLAULI9KNVBXk3mC537Vt +WHQ== X-Received: by 10.68.236.70 with SMTP id us6mr40477260pbc.119.1369090934677; Mon, 20 May 2013 16:02:14 -0700 (PDT) Received: from [192.168.20.5] (c-98-203-241-95.hsd1.wa.comcast.net. [98.203.241.95]) by mx.google.com with ESMTPSA id gi2sm25838414pbb.2.2013.05.20.16.02.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 May 2013 16:02:13 -0700 (PDT) Subject: Re: svn commit: r250719 - in head: . usr.bin/make Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <201305162126.r4GLQk8Q021290@svn.freebsd.org> Date: Mon, 20 May 2013 16:02:11 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <4FEA9E51-475D-494C-83BB-9CBA90990770@gmail.com> References: <201305162126.r4GLQk8Q021290@svn.freebsd.org> To: Simon J. Gerraty X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-toolchain@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 23:02:15 -0000 On May 16, 2013, at 2:26 PM, Simon J. Gerraty wrote: > Author: sjg > Date: Thu May 16 21:26:46 2013 > New Revision: 250719 > URL: http://svnweb.freebsd.org/changeset/base/250719 >=20 > Log: > Reverse the sense of the test wrt bmake, and guard against > MK_BMAKE not being defined. I forgot to request this earlier, but could you please document = bmake becoming the default system make in UPDATING and some of the = associated caveats? It's particularly important to note that set -e is = not being implicitly set on the command line (like before) and this is = going to potentially confuse some people as cd ; ${MAKE} was the pattern = that was done all over the place previously (like we discussed at YOW = after BSDCan, stuff where people weren't using set -e and were using = semicolons, needs to be fixed in Makefile, Makefile.inc1, etc in order = for builds to not silently fail as they will today). Thanks! -Garrett= From owner-svn-src-all@FreeBSD.ORG Mon May 20 23:52:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5702DEDF; Mon, 20 May 2013 23:52:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 443771A1; Mon, 20 May 2013 23:52:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4KNqqvx008971; Mon, 20 May 2013 23:52:52 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4KNqnUd008954; Mon, 20 May 2013 23:52:49 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305202352.r4KNqnUd008954@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 20 May 2013 23:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250838 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 23:52:52 -0000 Author: jkim Date: Mon May 20 23:52:49 2013 New Revision: 250838 URL: http://svnweb.freebsd.org/changeset/base/250838 Log: Merge ACPICA 20130517. Added: head/sys/contrib/dev/acpica/compiler/asloptions.c - copied, changed from r250758, vendor-sys/acpica/dist/source/compiler/asloptions.c head/sys/contrib/dev/acpica/components/tables/tbprint.c - copied, changed from r250758, vendor-sys/acpica/dist/source/components/tables/tbprint.c head/sys/contrib/dev/acpica/components/utilities/utbuffer.c - copied, changed from r250758, vendor-sys/acpica/dist/source/components/utilities/utbuffer.c head/sys/contrib/dev/acpica/components/utilities/uterror.c - copied, changed from r250758, vendor-sys/acpica/dist/source/components/utilities/uterror.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt (contents, props changed) head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslhex.c head/sys/contrib/dev/acpica/compiler/asllength.c head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/asllistsup.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/aslnamesp.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslrestype1i.c head/sys/contrib/dev/acpica/compiler/aslrestype2s.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/aslwalks.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbconvert.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbhistry.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbstats.c head/sys/contrib/dev/acpica/components/debugger/dbutils.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/disassembler/dmobject.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c head/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/events/evglock.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evgpeblk.c head/sys/contrib/dev/acpica/components/events/evgpeinit.c head/sys/contrib/dev/acpica/components/events/evhandler.c head/sys/contrib/dev/acpica/components/events/evmisc.c head/sys/contrib/dev/acpica/components/events/evrgnini.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/events/evxfregn.c head/sys/contrib/dev/acpica/components/executer/exconfig.c head/sys/contrib/dev/acpica/components/executer/exconvrt.c head/sys/contrib/dev/acpica/components/executer/excreate.c head/sys/contrib/dev/acpica/components/executer/exdebug.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/executer/exfield.c head/sys/contrib/dev/acpica/components/executer/exfldio.c head/sys/contrib/dev/acpica/components/executer/exmisc.c head/sys/contrib/dev/acpica/components/executer/exnames.c head/sys/contrib/dev/acpica/components/executer/exoparg1.c head/sys/contrib/dev/acpica/components/executer/exoparg2.c head/sys/contrib/dev/acpica/components/executer/exoparg3.c head/sys/contrib/dev/acpica/components/executer/exoparg6.c head/sys/contrib/dev/acpica/components/executer/exprep.c head/sys/contrib/dev/acpica/components/executer/exregion.c head/sys/contrib/dev/acpica/components/executer/exresnte.c head/sys/contrib/dev/acpica/components/executer/exresolv.c head/sys/contrib/dev/acpica/components/executer/exresop.c head/sys/contrib/dev/acpica/components/executer/exstore.c head/sys/contrib/dev/acpica/components/executer/exstoren.c head/sys/contrib/dev/acpica/components/hardware/hwacpi.c head/sys/contrib/dev/acpica/components/hardware/hwgpe.c head/sys/contrib/dev/acpica/components/hardware/hwregs.c head/sys/contrib/dev/acpica/components/hardware/hwxface.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsconvert.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c head/sys/contrib/dev/acpica/components/namespace/nsrepair.c head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/parser/pstree.c head/sys/contrib/dev/acpica/components/resources/rscalc.c head/sys/contrib/dev/acpica/components/resources/rscreate.c head/sys/contrib/dev/acpica/components/resources/rsdump.c head/sys/contrib/dev/acpica/components/resources/rsmisc.c head/sys/contrib/dev/acpica/components/resources/rsutils.c head/sys/contrib/dev/acpica/components/resources/rsxface.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/utilities/utcopy.c head/sys/contrib/dev/acpica/components/utilities/utdebug.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/uteval.c head/sys/contrib/dev/acpica/components/utilities/utexcep.c head/sys/contrib/dev/acpica/components/utilities/utids.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utobject.c head/sys/contrib/dev/acpica/components/utilities/utstring.c head/sys/contrib/dev/acpica/components/utilities/uttrack.c head/sys/contrib/dev/acpica/components/utilities/utxferror.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c head/sys/dev/acpica/Osd/OsdTable.c head/sys/modules/acpi/acpi/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/disassembler/ (props changed) head/sys/contrib/dev/acpica/components/dispatcher/ (props changed) head/sys/contrib/dev/acpica/components/events/ (props changed) head/sys/contrib/dev/acpica/components/executer/ (props changed) head/sys/contrib/dev/acpica/components/hardware/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) head/sys/contrib/dev/acpica/components/parser/ (props changed) head/sys/contrib/dev/acpica/components/resources/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) head/sys/contrib/dev/acpica/os_specific/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 20 22:51:11 2013 (r250837) +++ head/sys/conf/files Mon May 20 23:52:49 2013 (r250838) @@ -421,17 +421,20 @@ contrib/dev/acpica/components/resources/ contrib/dev/acpica/components/tables/tbfadt.c optional acpi contrib/dev/acpica/components/tables/tbfind.c optional acpi contrib/dev/acpica/components/tables/tbinstal.c optional acpi +contrib/dev/acpica/components/tables/tbprint.c optional acpi contrib/dev/acpica/components/tables/tbutils.c optional acpi contrib/dev/acpica/components/tables/tbxface.c optional acpi contrib/dev/acpica/components/tables/tbxfload.c optional acpi contrib/dev/acpica/components/tables/tbxfroot.c optional acpi contrib/dev/acpica/components/utilities/utaddress.c optional acpi contrib/dev/acpica/components/utilities/utalloc.c optional acpi +contrib/dev/acpica/components/utilities/utbuffer.c optional acpi contrib/dev/acpica/components/utilities/utcache.c optional acpi contrib/dev/acpica/components/utilities/utcopy.c optional acpi contrib/dev/acpica/components/utilities/utdebug.c optional acpi contrib/dev/acpica/components/utilities/utdecode.c optional acpi contrib/dev/acpica/components/utilities/utdelete.c optional acpi +contrib/dev/acpica/components/utilities/uterror.c optional acpi contrib/dev/acpica/components/utilities/uteval.c optional acpi contrib/dev/acpica/components/utilities/utexcep.c optional acpi contrib/dev/acpica/components/utilities/utglobal.c optional acpi Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Mon May 20 22:51:11 2013 (r250837) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Mon May 20 23:52:49 2013 (r250838) @@ -19,9 +19,9 @@ fulldirs="common compiler components inc # files to remove stripdirs="generate libraries tests tools" stripfiles="Makefile README accygwin.h acefi.h achaiku.h acintel.h \ - aclinux.h acmsvc.h acnetbsd.h acos2.h acwin.h acwin64.h \ - new_table.txt osunixdir.c oswindir.c oswintbl.c oswinxf.c \ - readme.txt utclib.c" + aclinux.h acmacosx.h acmsvc.h acnetbsd.h acos2.h acwin.h \ + acwin64.h new_table.txt oslinuxtbl.c osunixdir.c oswindir.c \ + oswintbl.c oswinxf.c readme.txt utclib.c" # include files to canonify src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \ Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Mon May 20 22:51:11 2013 (r250837) +++ head/sys/contrib/dev/acpica/changes.txt Mon May 20 23:52:49 2013 (r250838) @@ -1,8 +1,108 @@ ---------------------------------------- -18 April 2013. Summary of changes for version 20130418: +17 May 2013. Summary of changes for version 20130517: + +1) ACPICA kernel-resident subsystem: -This release is available at https://acpica.org/downloads +Fixed a regression introduced in version 20130328 for _INI methods. This +change fixes a problem introduced in 20130328 where _INI methods are no +longer executed properly because of a memory block that was not +initialized correctly. ACPICA BZ 1016. Tomasz Nowicki +. + +Fixed a possible problem with the new extended sleep registers in the ACPI +5.0 FADT. Do not use these registers (even if populated) unless the HW- +reduced bit is set in the FADT (as per the ACPI specification). ACPICA BZ +1020. Lv Zheng. + +Implemented return value repair code for _CST predefined objects: Sort the +list and detect/remove invalid entries. ACPICA BZ 890. Lv Zheng. + +Implemented a debug-only option to disable loading of SSDTs from the +RSDT/XSDT during ACPICA initialization. This can be useful for debugging +ACPI problems on some machines. Set AcpiGbl_DisableSsdtTableLoad in +acglobal.h - ACPICA BZ 1005. Lv Zheng. + +Fixed some issues in the ACPICA initialization and termination code: +Tomasz Nowicki +1) Clear events initialized flag upon event component termination. ACPICA +BZ 1013. +2) Fixed a possible memory leak in GPE init error path. ACPICA BZ 1018. +3) Delete global lock pending lock during termination. ACPICA BZ 1012. +4) Clear debug buffer global on termination to prevent possible multiple +delete. ACPICA BZ 1010. + +Standardized all switch() blocks across the entire source base. After many +years, different formatting for switch() had crept in. This change makes +the formatting of every switch block identical. ACPICA BZ 997. Chao Guan. + +Split some files to enhance ACPICA modularity and configurability: +1) Split buffer dump routines into utilities/utbuffer.c +2) Split internal error message routines into utilities/uterror.c +3) Split table print utilities into tables/tbprint.c +4) Split iASL command-line option processing into asloptions.c + +Makefile enhancements: +1) Support for all new files above. +2) Abort make on errors from any subcomponent. Chao Guan. +3) Add build support for Apple Mac OS X. Liang Qi. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + Current Release: + Non-Debug Version: 96.0K Code, 27.0K Data, 123.0K Total + Debug Version: 184.1K Code, 76.8K Data, 260.9K Total + Previous Release: + Non-Debug Version: 95.6K Code, 26.8K Data, 122.4K Total + Debug Version: 183.5K Code, 76.6K Data, 260.1K Total + + +2) iASL Compiler/Disassembler and Tools: + +New utility: Implemented an easily portable version of the acpidump +utility to extract ACPI tables from the system (or a file) in an ASCII hex +dump format. The top-level code implements the various command line +options, file I/O, and table dump routines. To port to a new host, only +three functions need to be implemented to get tables -- since this +functionality is OS-dependent. See the tools/acpidump/apmain.c module and +the ACPICA reference for porting instructions. ACPICA BZ 859. Notes: +1) The Windows version obtains the ACPI tables from the Registry. +2) The Linux version is under development. +3) Other hosts - If an OS-dependent module is submitted, it will be +distributed with ACPICA. + +iASL: Fixed a regression for -D preprocessor option (define symbol). A +restructuring/change to the initialization sequence caused this option to +no longer work properly. + +iASL: Implemented a mechanism to disable specific warnings and remarks. +Adds a new command line option, "-vw as well as "#pragma +disable ". ACPICA BZ 989. Chao Guan, Bob Moore. + +iASL: Fix for too-strict package object validation. The package object +validation for return values from the predefined names is a bit too +strict, it does not allow names references within the package (which will +be resolved at runtime.) These types of references cannot be validated at +compile time. This change ignores named references within package objects +for names that return or define static packages. + +Debugger: Fixed the 80-character command line limitation for the History +command. Now allows lines of arbitrary length. ACPICA BZ 1000. Chao Guan. + +iASL: Added control method and package support for the -so option +(generates AML offset table for BIOS support.) + +iASL: issue a remark if a non-serialized method creates named objects. If +a thread blocks within the method for any reason, and another thread +enters the method, the method will fail because an attempt will be made to +create the same (named) object twice. In this case, issue a remark that +the method should be marked serialized. NOTE: may become a warning later. +ACPICA BZ 909. + +---------------------------------------- +18 April 2013. Summary of changes for version 20130418: 1) ACPICA kernel-resident subsystem: Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Mon May 20 22:51:11 2013 (r250837) +++ head/sys/contrib/dev/acpica/common/adisasm.c Mon May 20 23:52:49 2013 (r250838) @@ -628,10 +628,12 @@ AdCreateTableHeader ( switch (Table->Revision) { case 0: + AcpiOsPrintf (" **** Invalid Revision"); break; case 1: + /* Revision of DSDT controls the ACPI integer width */ if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT)) @@ -641,6 +643,7 @@ AdCreateTableHeader ( break; default: + break; } AcpiOsPrintf ("\n"); Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Mon May 20 22:51:11 2013 (r250837) +++ head/sys/contrib/dev/acpica/common/adwalk.c Mon May 20 23:52:49 2013 (r250838) @@ -375,14 +375,17 @@ AcpiDmDumpDescending ( case AML_BYTE_OP: case AML_WORD_OP: case AML_DWORD_OP: + AcpiOsPrintf ("%X", (UINT32) Op->Common.Value.Integer); break; case AML_QWORD_OP: + AcpiOsPrintf ("%8.8X%8.8X", ACPI_FORMAT_UINT64 (Op->Common.Value.Integer)); break; case AML_INT_NAMEPATH_OP: + if (Op->Common.Value.String) { AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String, @@ -400,10 +403,12 @@ AcpiDmDumpDescending ( case AML_METHOD_OP: case AML_DEVICE_OP: case AML_INT_NAMEDFIELD_OP: + AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name)); break; default: + break; } @@ -450,6 +455,7 @@ AcpiDmFindOrphanDescending ( { #ifdef ACPI_UNDER_DEVELOPMENT case AML_ADD_OP: + ChildOp = Op->Common.Value.Arg; if ((ChildOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) && !ChildOp->Common.Node) @@ -556,6 +562,7 @@ AcpiDmFindOrphanDescending ( break; default: + break; } Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Mon May 20 22:51:11 2013 (r250837) +++ head/sys/contrib/dev/acpica/common/dmextern.c Mon May 20 23:52:49 2013 (r250838) @@ -594,6 +594,7 @@ AcpiDmAddExternalsToNamespace ( break; default: + break; } Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Mon May 20 22:51:11 2013 (r250837) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Mon May 20 23:52:49 2013 (r250838) @@ -798,7 +798,6 @@ AcpiDmGetResourceTag ( case ACPI_RESOURCE_NAME_ADDRESS32: case ACPI_RESOURCE_NAME_ADDRESS64: case ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64: - /* * Subtype differentiation is the flags. * Kindof brute force, but just blindly search for an index match @@ -846,6 +845,7 @@ AcpiDmGetResourceTag ( break; default: + break; } Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Mon May 20 22:51:11 2013 (r250837) +++ head/sys/contrib/dev/acpica/common/dmtable.c Mon May 20 23:52:49 2013 (r250838) @@ -697,48 +697,71 @@ AcpiDmDumpTable ( case ACPI_DMT_EINJINST: case ACPI_DMT_ERSTACT: case ACPI_DMT_ERSTINST: + ByteLength = 1; break; + case ACPI_DMT_UINT16: case ACPI_DMT_DMAR: case ACPI_DMT_HEST: + ByteLength = 2; break; + case ACPI_DMT_UINT24: + ByteLength = 3; break; + case ACPI_DMT_UINT32: case ACPI_DMT_NAME4: case ACPI_DMT_SIG: case ACPI_DMT_SLIC: + ByteLength = 4; break; + case ACPI_DMT_UINT40: + ByteLength = 5; break; + case ACPI_DMT_UINT48: case ACPI_DMT_NAME6: + ByteLength = 6; break; + case ACPI_DMT_UINT56: case ACPI_DMT_BUF7: + ByteLength = 7; break; + case ACPI_DMT_UINT64: case ACPI_DMT_NAME8: + ByteLength = 8; break; + case ACPI_DMT_BUF16: case ACPI_DMT_UUID: + ByteLength = 16; break; + case ACPI_DMT_BUF128: + ByteLength = 128; break; + case ACPI_DMT_STRING: + ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1; break; + case ACPI_DMT_GAS: + if (!LastOutputBlankLine) { AcpiOsPrintf ("\n"); @@ -746,7 +769,9 @@ AcpiDmDumpTable ( } ByteLength = sizeof (ACPI_GENERIC_ADDRESS); break; + case ACPI_DMT_HESTNTFY: + if (!LastOutputBlankLine) { AcpiOsPrintf ("\n"); @@ -754,7 +779,9 @@ AcpiDmDumpTable ( } ByteLength = sizeof (ACPI_HEST_NOTIFY); break; + default: + ByteLength = 0; break; } @@ -837,7 +864,6 @@ AcpiDmDumpTable ( case ACPI_DMT_BUF7: case ACPI_DMT_BUF16: case ACPI_DMT_BUF128: - /* * Buffer: Size depends on the opcode and was set above. * Each hex byte is separated with a space. @@ -1146,16 +1172,19 @@ AcpiDmDumpTable ( switch (Temp8) { case ACPI_IVRS_TYPE_HARDWARE: + Name = AcpiDmIvrsSubnames[0]; break; case ACPI_IVRS_TYPE_MEMORY1: case ACPI_IVRS_TYPE_MEMORY2: case ACPI_IVRS_TYPE_MEMORY3: + Name = AcpiDmIvrsSubnames[1]; break; default: + Name = AcpiDmIvrsSubnames[2]; break; } @@ -1164,9 +1193,11 @@ AcpiDmDumpTable ( break; case ACPI_DMT_EXIT: + return (AE_OK); default: + ACPI_ERROR ((AE_INFO, "**** Invalid table opcode [0x%X] ****\n", Info->Opcode)); return (AE_SUPPORT); Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Mon May 20 22:51:11 2013 (r250837) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Mon May 20 23:52:49 2013 (r250838) @@ -349,27 +349,33 @@ AcpiDmValidateFadtLength ( switch (Revision) { case 0: + AcpiOsPrintf ("// ACPI Warning: Invalid FADT revision: 0\n"); return; case 1: + ExpectedLength = ACPI_FADT_V1_SIZE; break; case 2: + ExpectedLength = ACPI_FADT_V2_SIZE; break; case 3: case 4: + ExpectedLength = ACPI_FADT_V3_SIZE; break; case 5: + ExpectedLength = ACPI_FADT_V5_SIZE; break; default: + return; } @@ -434,10 +440,12 @@ AcpiDmDumpAsf ( switch (Type) { case ACPI_ASF_TYPE_INFO: + InfoTable = AcpiDmTableInfoAsf0; break; case ACPI_ASF_TYPE_ALERT: + InfoTable = AcpiDmTableInfoAsf1; DataInfoTable = AcpiDmTableInfoAsf1a; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT)); @@ -447,6 +455,7 @@ AcpiDmDumpAsf ( break; case ACPI_ASF_TYPE_CONTROL: + InfoTable = AcpiDmTableInfoAsf2; DataInfoTable = AcpiDmTableInfoAsf2a; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE)); @@ -456,10 +465,12 @@ AcpiDmDumpAsf ( break; case ACPI_ASF_TYPE_BOOT: + InfoTable = AcpiDmTableInfoAsf3; break; case ACPI_ASF_TYPE_ADDRESS: + InfoTable = AcpiDmTableInfoAsf4; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS)); DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices; @@ -467,6 +478,7 @@ AcpiDmDumpAsf ( break; default: + AcpiOsPrintf ("\n**** Unknown ASF sub-table type 0x%X\n", SubTable->Header.Type); return; } @@ -523,6 +535,7 @@ AcpiDmDumpAsf ( break; default: + break; } @@ -863,22 +876,31 @@ AcpiDmDumpDmar ( switch (SubTable->Type) { case ACPI_DMAR_TYPE_HARDWARE_UNIT: + InfoTable = AcpiDmTableInfoDmar0; ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT); break; + case ACPI_DMAR_TYPE_RESERVED_MEMORY: + InfoTable = AcpiDmTableInfoDmar1; ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY); break; + case ACPI_DMAR_TYPE_ATSR: + InfoTable = AcpiDmTableInfoDmar2; ScopeOffset = sizeof (ACPI_DMAR_ATSR); break; + case ACPI_DMAR_HARDWARE_AFFINITY: + InfoTable = AcpiDmTableInfoDmar3; ScopeOffset = sizeof (ACPI_DMAR_RHSA); break; + default: + AcpiOsPrintf ("\n**** Unknown DMAR sub-table type 0x%X\n\n", SubTable->Type); return; } @@ -1086,12 +1108,17 @@ AcpiDmDumpFpdt ( switch (SubTable->Type) { case ACPI_FPDT_TYPE_BOOT: + InfoTable = AcpiDmTableInfoFpdt0; break; + case ACPI_FPDT_TYPE_S3PERF: + InfoTable = AcpiDmTableInfoFpdt1; break; + default: + AcpiOsPrintf ("\n**** Unknown FPDT sub-table type 0x%X\n\n", SubTable->Type); /* Attempt to continue */ @@ -1164,6 +1191,7 @@ AcpiDmDumpHest ( switch (SubTable->Type) { case ACPI_HEST_TYPE_IA32_CHECK: + InfoTable = AcpiDmTableInfoHest0; SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK); BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK, @@ -1171,6 +1199,7 @@ AcpiDmDumpHest ( break; case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: + InfoTable = AcpiDmTableInfoHest1; SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED); BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED, @@ -1178,31 +1207,37 @@ AcpiDmDumpHest ( break; case ACPI_HEST_TYPE_IA32_NMI: + InfoTable = AcpiDmTableInfoHest2; SubTableLength = sizeof (ACPI_HEST_IA_NMI); break; case ACPI_HEST_TYPE_AER_ROOT_PORT: + InfoTable = AcpiDmTableInfoHest6; SubTableLength = sizeof (ACPI_HEST_AER_ROOT); break; case ACPI_HEST_TYPE_AER_ENDPOINT: + InfoTable = AcpiDmTableInfoHest7; SubTableLength = sizeof (ACPI_HEST_AER); break; case ACPI_HEST_TYPE_AER_BRIDGE: + InfoTable = AcpiDmTableInfoHest8; SubTableLength = sizeof (ACPI_HEST_AER_BRIDGE); break; case ACPI_HEST_TYPE_GENERIC_ERROR: + InfoTable = AcpiDmTableInfoHest9; SubTableLength = sizeof (ACPI_HEST_GENERIC); break; default: + /* Cannot continue on unknown type - no length */ AcpiOsPrintf ("\n**** Unknown HEST sub-table type 0x%X\n", SubTable->Type); @@ -1304,14 +1339,19 @@ AcpiDmDumpIvrs ( switch (SubTable->Type) { case ACPI_IVRS_TYPE_HARDWARE: + InfoTable = AcpiDmTableInfoIvrs0; break; + case ACPI_IVRS_TYPE_MEMORY1: case ACPI_IVRS_TYPE_MEMORY2: case ACPI_IVRS_TYPE_MEMORY3: + InfoTable = AcpiDmTableInfoIvrs1; break; + default: + AcpiOsPrintf ("\n**** Unknown IVRS sub-table type 0x%X\n", SubTable->Type); @@ -1473,45 +1513,72 @@ AcpiDmDumpMadt ( switch (SubTable->Type) { case ACPI_MADT_TYPE_LOCAL_APIC: + InfoTable = AcpiDmTableInfoMadt0; break; + case ACPI_MADT_TYPE_IO_APIC: + InfoTable = AcpiDmTableInfoMadt1; break; + case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE: + InfoTable = AcpiDmTableInfoMadt2; break; + case ACPI_MADT_TYPE_NMI_SOURCE: + InfoTable = AcpiDmTableInfoMadt3; break; + case ACPI_MADT_TYPE_LOCAL_APIC_NMI: + InfoTable = AcpiDmTableInfoMadt4; break; + case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: + InfoTable = AcpiDmTableInfoMadt5; break; + case ACPI_MADT_TYPE_IO_SAPIC: + InfoTable = AcpiDmTableInfoMadt6; break; + case ACPI_MADT_TYPE_LOCAL_SAPIC: + InfoTable = AcpiDmTableInfoMadt7; break; + case ACPI_MADT_TYPE_INTERRUPT_SOURCE: + InfoTable = AcpiDmTableInfoMadt8; break; + case ACPI_MADT_TYPE_LOCAL_X2APIC: + InfoTable = AcpiDmTableInfoMadt9; break; + case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI: + InfoTable = AcpiDmTableInfoMadt10; break; + case ACPI_MADT_TYPE_GENERIC_INTERRUPT: + InfoTable = AcpiDmTableInfoMadt11; break; + case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR: + InfoTable = AcpiDmTableInfoMadt12; break; + default: + AcpiOsPrintf ("\n**** Unknown MADT sub-table type 0x%X\n\n", SubTable->Type); /* Attempt to continue */ @@ -2152,12 +2219,17 @@ AcpiDmDumpS3pt ( switch (SubTable->Type) { case ACPI_S3PT_TYPE_RESUME: + InfoTable = AcpiDmTableInfoS3pt0; break; + case ACPI_S3PT_TYPE_SUSPEND: + InfoTable = AcpiDmTableInfoS3pt1; break; + default: + AcpiOsPrintf ("\n**** Unknown S3PT sub-table type 0x%X\n", SubTable->Type); /* Attempt to continue */ @@ -2229,12 +2301,17 @@ AcpiDmDumpSlic ( switch (SubTable->Type) { case ACPI_SLIC_TYPE_PUBLIC_KEY: + InfoTable = AcpiDmTableInfoSlic0; break; + case ACPI_SLIC_TYPE_WINDOWS_MARKER: + InfoTable = AcpiDmTableInfoSlic1; break; + default: + AcpiOsPrintf ("\n**** Unknown SLIC sub-table type 0x%X\n", SubTable->Type); /* Attempt to continue */ @@ -2390,14 +2467,20 @@ AcpiDmDumpSrat ( switch (SubTable->Type) { case ACPI_SRAT_TYPE_CPU_AFFINITY: + InfoTable = AcpiDmTableInfoSrat0; break; + case ACPI_SRAT_TYPE_MEMORY_AFFINITY: + InfoTable = AcpiDmTableInfoSrat1; break; + case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY: + InfoTable = AcpiDmTableInfoSrat2; break; + default: AcpiOsPrintf ("\n**** Unknown SRAT sub-table type 0x%X\n", SubTable->Type); Modified: head/sys/contrib/dev/acpica/common/getopt.c ============================================================================== --- head/sys/contrib/dev/acpica/common/getopt.c Mon May 20 22:51:11 2013 (r250837) +++ head/sys/contrib/dev/acpica/common/getopt.c Mon May 20 23:52:49 2013 (r250838) @@ -41,6 +41,15 @@ * POSSIBILITY OF SUCH DAMAGES. */ +/* + * ACPICA getopt() implementation + * + * Option strings: + * "f" - Option has no arguments + * "f:" - Option requires an argument + * "f^" - Option has optional single-char sub-options + * "f|" - Option has required single-char sub-options + */ #include #include @@ -52,9 +61,59 @@ if (AcpiGbl_Opterr) {fprintf (stderr, "%s%c\n", msg, badchar);} -int AcpiGbl_Opterr = 1; -int AcpiGbl_Optind = 1; -char *AcpiGbl_Optarg; +int AcpiGbl_Opterr = 1; +int AcpiGbl_Optind = 1; +int AcpiGbl_SubOptChar = 0; +char *AcpiGbl_Optarg; + +static int CurrentCharPtr = 1; + + +/******************************************************************************* + * + * FUNCTION: AcpiGetoptArgument + * + * PARAMETERS: argc, argv - from main + * + * RETURN: 0 if an argument was found, -1 otherwise. Sets AcpiGbl_Optarg + * to point to the next argument. + * + * DESCRIPTION: Get the next argument. Used to obtain arguments for the + * two-character options after the original call to AcpiGetopt. + * Note: Either the argument starts at the next character after + * the option, or it is pointed to by the next argv entry. + * (After call to AcpiGetopt, we need to backup to the previous + * argv entry). + * + ******************************************************************************/ + +int +AcpiGetoptArgument ( + int argc, + char **argv) +{ + AcpiGbl_Optind--; + CurrentCharPtr++; + + if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') + { + AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][(int) (CurrentCharPtr+1)]; + } + else if (++AcpiGbl_Optind >= argc) + { + ACPI_OPTION_ERROR ("Option requires an argument: -", 'v'); + + CurrentCharPtr = 1; + return (-1); + } + else + { + AcpiGbl_Optarg = argv[AcpiGbl_Optind++]; + } + + CurrentCharPtr = 1; + return (0); +} /******************************************************************************* @@ -76,7 +135,6 @@ AcpiGetopt( char **argv, char *opts) { - static int CurrentCharPtr = 1; int CurrentChar; char *OptsPtr; @@ -152,6 +210,7 @@ AcpiGetopt( AcpiGbl_Optarg = "^"; } + AcpiGbl_SubOptChar = AcpiGbl_Optarg[0]; AcpiGbl_Optind++; CurrentCharPtr = 1; } @@ -172,6 +231,7 @@ AcpiGetopt( return ('?'); } + AcpiGbl_SubOptChar = AcpiGbl_Optarg[0]; AcpiGbl_Optind++; CurrentCharPtr = 1; } Modified: head/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslanalyze.c Mon May 20 22:51:11 2013 (r250837) +++ head/sys/contrib/dev/acpica/compiler/aslanalyze.c Mon May 20 23:52:49 2013 (r250838) @@ -381,6 +381,7 @@ AnIsResultUsed ( return (TRUE); default: + break; } @@ -411,6 +412,7 @@ AnIsResultUsed ( return (FALSE); default: + /* Any other type of parent means that the result is used */ return (TRUE); Modified: head/sys/contrib/dev/acpica/compiler/aslbtypes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslbtypes.c Mon May 20 22:51:11 2013 (r250837) +++ head/sys/contrib/dev/acpica/compiler/aslbtypes.c Mon May 20 23:52:49 2013 (r250838) @@ -83,15 +83,19 @@ AnMapArgTypeToBtype ( /* Simple types */ case ARGI_ANYTYPE: + return (ACPI_BTYPE_OBJECTS_AND_REFS); case ARGI_PACKAGE: + return (ACPI_BTYPE_PACKAGE); case ARGI_EVENT: + return (ACPI_BTYPE_EVENT); case ARGI_MUTEX: + return (ACPI_BTYPE_MUTEX); case ARGI_DDBHANDLE: @@ -111,31 +115,36 @@ AnMapArgTypeToBtype ( case ARGI_BUFFER: case ARGI_BUFFER_OR_STRING: case ARGI_COMPUTEDATA: + return (ACPI_BTYPE_COMPUTE_DATA); /* References */ case ARGI_INTEGER_REF: + return (ACPI_BTYPE_INTEGER); case ARGI_OBJECT_REF: + return (ACPI_BTYPE_ALL_OBJECTS); case ARGI_DEVICE_REF: + return (ACPI_BTYPE_DEVICE_OBJECTS); case ARGI_REFERENCE: + return (ACPI_BTYPE_REFERENCE); case ARGI_TARGETREF: case ARGI_FIXED_TARGET: case ARGI_SIMPLE_TARGET: + return (ACPI_BTYPE_OBJECTS_AND_REFS); /* Complex types */ case ARGI_DATAOBJECT: - /* * Buffer, string, package or reference to a Op - * Used only by SizeOf operator @@ -150,6 +159,7 @@ AnMapArgTypeToBtype ( return (ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | ACPI_BTYPE_PACKAGE); case ARGI_REF_OR_STRING: + return (ACPI_BTYPE_STRING | ACPI_BTYPE_REFERENCE); case ARGI_REGION_OR_BUFFER: @@ -159,10 +169,12 @@ AnMapArgTypeToBtype ( return (ACPI_BTYPE_REGION | ACPI_BTYPE_BUFFER | ACPI_BTYPE_FIELD_UNIT); case ARGI_DATAREFOBJ: + return (ACPI_BTYPE_INTEGER |ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | ACPI_BTYPE_PACKAGE | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE); default: + break; } @@ -207,22 +219,28 @@ AnMapEtypeToBtype ( switch (Etype) { case ACPI_TYPE_INTEGER: + return (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_DDB_HANDLE); case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: + return (ACPI_BTYPE_COMPUTE_DATA); case ACPI_TYPE_PACKAGE: + return (ACPI_BTYPE_PACKAGE); case ACPI_TYPE_FIELD_UNIT: + return (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_FIELD_UNIT); case ACPI_TYPE_BUFFER_FIELD: + return (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_BUFFER_FIELD); case ACPI_TYPE_DDB_HANDLE: + return (ACPI_BTYPE_INTEGER | ACPI_BTYPE_DDB_HANDLE); case ACPI_BTYPE_DEBUG_OBJECT: @@ -232,6 +250,7 @@ AnMapEtypeToBtype ( return (0); default: + return (1 << (Etype - 1)); } } @@ -259,6 +278,7 @@ AnMapEtypeToBtype ( return (ACPI_BTYPE_REFERENCE); default: + printf ("Unhandled encoded type: %X\n", Etype); return (0); } @@ -438,51 +458,67 @@ AnMapObjTypeToBtype ( switch (Op->Asl.ParseOpcode) { case PARSEOP_OBJECTTYPE_BFF: /* "BuffFieldObj" */ + return (ACPI_BTYPE_BUFFER_FIELD); case PARSEOP_OBJECTTYPE_BUF: /* "BuffObj" */ + return (ACPI_BTYPE_BUFFER); case PARSEOP_OBJECTTYPE_DDB: /* "DDBHandleObj" */ + return (ACPI_BTYPE_DDB_HANDLE); case PARSEOP_OBJECTTYPE_DEV: /* "DeviceObj" */ + return (ACPI_BTYPE_DEVICE); case PARSEOP_OBJECTTYPE_EVT: /* "EventObj" */ + return (ACPI_BTYPE_EVENT); case PARSEOP_OBJECTTYPE_FLD: /* "FieldUnitObj" */ + return (ACPI_BTYPE_FIELD_UNIT); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 21 00:41:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 00F944F8; Tue, 21 May 2013 00:41:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E6E502BB; Tue, 21 May 2013 00:41:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4L0fnme026300; Tue, 21 May 2013 00:41:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4L0fnlZ026299; Tue, 21 May 2013 00:41:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305210041.r4L0fnlZ026299@svn.freebsd.org> From: Xin LI Date: Tue, 21 May 2013 00:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250839 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 00:41:50 -0000 Author: delphij Date: Tue May 21 00:41:49 2013 New Revision: 250839 URL: http://svnweb.freebsd.org/changeset/base/250839 Log: BMAKE is now being built by default. Added: head/tools/build/options/WITHOUT_BMAKE - copied, changed from r250838, head/tools/build/options/WITH_BMAKE Deleted: head/tools/build/options/WITH_BMAKE Copied and modified: head/tools/build/options/WITHOUT_BMAKE (from r250838, head/tools/build/options/WITH_BMAKE) ============================================================================== --- head/tools/build/options/WITH_BMAKE Mon May 20 23:52:49 2013 (r250838, copy source) +++ head/tools/build/options/WITHOUT_BMAKE Tue May 21 00:41:49 2013 (r250839) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Build and install the portable BSD make (bmake) as +Set to not build and install the portable BSD make (bmake) as .Xr make 1 instead of the traditional FreeBSD make. This build option is temporary. From owner-svn-src-all@FreeBSD.ORG Tue May 21 03:05:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E5731969; Tue, 21 May 2013 03:05:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C6B379E9; Tue, 21 May 2013 03:05:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4L35sCG077307; Tue, 21 May 2013 03:05:54 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4L35oOq077272; Tue, 21 May 2013 03:05:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305210305.r4L35oOq077272@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 21 May 2013 03:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250840 - in head/sys: amd64/amd64 amd64/include conf dev/fdt dev/uart i386/i386 i386/include x86/include x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 03:05:55 -0000 Author: marcel Date: Tue May 21 03:05:49 2013 New Revision: 250840 URL: http://svnweb.freebsd.org/changeset/base/250840 Log: Add basic support for FDT to i386 & amd64. This change includes: 1. Common headers for fdt.h and ofw_machdep.h under x86/include with indirections under i386/include and amd64/include. 2. New modinfo for loader provided FDT blob. 3. Common x86_init_fdt() called from hammer_time() on amd64 and init386() on i386. 4. Split-off FDT specific low-level console functions from FDT bus methods for the uart(4) driver. The low-level console logic has been moved to uart_cpu_fdt.c and is used for arm, mips & powerpc only. The FDT bus methods are shared across all architectures. 5. Add dev/fdt/fdt_x86.c to hold the fdt_fixup_table[] and the fdt_pic_table[] arrays. Both are empty right now. FDT addresses are I/O ports on x86. Since the core FDT code does not handle different address spaces, adding support for both I/O ports and memory addresses requires some thought and discussion. It may be better to use a compile-time option that controls this. Obtained from: Juniper Networks, Inc. Added: head/sys/amd64/include/fdt.h (contents, props changed) head/sys/amd64/include/ofw_machdep.h (contents, props changed) head/sys/dev/fdt/fdt_x86.c (contents, props changed) head/sys/dev/uart/uart_cpu_fdt.c (contents, props changed) head/sys/i386/include/fdt.h (contents, props changed) head/sys/i386/include/ofw_machdep.h (contents, props changed) head/sys/x86/include/fdt.h (contents, props changed) head/sys/x86/include/ofw_machdep.h (contents, props changed) head/sys/x86/x86/fdt_machdep.c (contents, props changed) Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/metadata.h head/sys/conf/Makefile.amd64 head/sys/conf/Makefile.i386 head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.i386 head/sys/conf/files.mips head/sys/conf/files.powerpc head/sys/dev/uart/uart_bus_fdt.c head/sys/i386/i386/machdep.c head/sys/i386/include/metadata.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue May 21 00:41:49 2013 (r250839) +++ head/sys/amd64/amd64/machdep.c Tue May 21 03:05:49 2013 (r250840) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include "opt_maxmem.h" #include "opt_mp_watchdog.h" #include "opt_perfmon.h" +#include "opt_platform.h" #include "opt_sched.h" #include "opt_kdtrace.h" @@ -133,6 +134,9 @@ __FBSDID("$FreeBSD$"); #ifdef SMP #include #endif +#ifdef FDT +#include +#endif #ifdef DEV_ATPIC #include @@ -1886,6 +1890,10 @@ hammer_time(u_int64_t modulep, u_int64_t cpu_probe_amdc1e(); +#ifdef FDT + x86_init_fdt(); +#endif + /* Location of kernel stack for locore */ return ((u_int64_t)thread0.td_pcb); } Added: head/sys/amd64/include/fdt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/include/fdt.h Tue May 21 03:05:49 2013 (r250840) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Modified: head/sys/amd64/include/metadata.h ============================================================================== --- head/sys/amd64/include/metadata.h Tue May 21 00:41:49 2013 (r250839) +++ head/sys/amd64/include/metadata.h Tue May 21 03:05:49 2013 (r250840) @@ -31,5 +31,6 @@ #define MODINFOMD_SMAP 0x1001 #define MODINFOMD_SMAP_XATTR 0x1002 +#define MODINFOMD_DTBP 0x1003 #endif /* !_MACHINE_METADATA_H_ */ Added: head/sys/amd64/include/ofw_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/include/ofw_machdep.h Tue May 21 03:05:49 2013 (r250840) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Modified: head/sys/conf/Makefile.amd64 ============================================================================== --- head/sys/conf/Makefile.amd64 Tue May 21 00:41:49 2013 (r250839) +++ head/sys/conf/Makefile.amd64 Tue May 21 03:05:49 2013 (r250840) @@ -31,6 +31,8 @@ S= ../../.. .endif .include "$S/conf/kern.pre.mk" +INCLUDES+= -I$S/contrib/libfdt + .if !empty(DDB_ENABLED) || !empty(DTR_ENABLED) || !empty(HWPMC_ENABLED) CFLAGS+= -fno-omit-frame-pointer .endif Modified: head/sys/conf/Makefile.i386 ============================================================================== --- head/sys/conf/Makefile.i386 Tue May 21 00:41:49 2013 (r250839) +++ head/sys/conf/Makefile.i386 Tue May 21 03:05:49 2013 (r250840) @@ -30,6 +30,8 @@ S= ../../.. .endif .include "$S/conf/kern.pre.mk" +INCLUDES+= -I$S/contrib/libfdt + MACHINE=i386 MKMODULESENV+= MACHINE=${MACHINE} Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 21 00:41:49 2013 (r250839) +++ head/sys/conf/files Tue May 21 03:05:49 2013 (r250840) @@ -2903,6 +2903,7 @@ libkern/inet_pton.c standard libkern/jenkins_hash.c standard libkern/mcount.c optional profiling-routine libkern/memcchr.c standard +libkern/memchr.c optional fdt libkern/memcmp.c standard libkern/qsort.c standard libkern/qsort_r.c standard Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue May 21 00:41:49 2013 (r250839) +++ head/sys/conf/files.amd64 Tue May 21 03:05:49 2013 (r250840) @@ -189,6 +189,7 @@ dev/fdc/fdc.c optional fdc dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard +dev/fdt/fdt_x86.c optional fdt dev/hpt27xx/os_bsd.c optional hpt27xx dev/hpt27xx/osm_bsd.c optional hpt27xx dev/hpt27xx/hpt27xx_config.c optional hpt27xx @@ -501,6 +502,7 @@ x86/pci/pci_bus.c optional pci x86/pci/qpi.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard +x86/x86/fdt_machdep.c optional fdt x86/x86/intr_machdep.c standard x86/x86/io_apic.c standard x86/x86/legacy.c standard Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Tue May 21 00:41:49 2013 (r250839) +++ head/sys/conf/files.arm Tue May 21 03:05:49 2013 (r250840) @@ -66,6 +66,8 @@ dev/kbd/kbd.c optional sc dev/syscons/scgfbrndr.c optional sc dev/syscons/scterm-teken.c optional sc dev/syscons/scvtb.c optional sc +dev/uart/uart_cpu_fdt.c optional uart fdt + font.h optional sc \ compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ no-obj no-implicit-rule before-depend \ @@ -87,7 +89,6 @@ libkern/ffsl.c standard libkern/fls.c standard libkern/flsl.c standard libkern/lshrdi3.c standard -libkern/memchr.c optional fdt libkern/moddi3.c standard libkern/qdivrem.c standard libkern/ucmpdi2.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue May 21 00:41:49 2013 (r250839) +++ head/sys/conf/files.i386 Tue May 21 03:05:49 2013 (r250840) @@ -176,6 +176,7 @@ dev/fdc/fdc.c optional fdc dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard +dev/fdt/fdt_x86.c optional fdt dev/fe/if_fe_isa.c optional fe isa dev/glxiic/glxiic.c optional glxiic dev/glxsb/glxsb.c optional glxsb @@ -545,6 +546,7 @@ x86/pci/pci_bus.c optional pci x86/pci/qpi.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard +x86/x86/fdt_machdep.c optional fdt x86/x86/intr_machdep.c standard x86/x86/io_apic.c optional apic x86/x86/legacy.c optional native Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Tue May 21 00:41:49 2013 (r250839) +++ head/sys/conf/files.mips Tue May 21 03:05:49 2013 (r250840) @@ -53,7 +53,6 @@ kern/subr_dummy_vdso_tc.c standard libkern/ffsl.c standard libkern/fls.c standard libkern/flsl.c standard -libkern/memchr.c optional fdt libkern/memmove.c standard libkern/ucmpdi2.c optional mips | mipsel @@ -72,6 +71,7 @@ mips/mips/sc_machdep.c optional sc # FDT support dev/fdt/fdt_mips.c optional fdt +dev/uart/uart_cpu_fdt.c optional uart fdt # crypto support -- use generic crypto/blowfish/bf_enc.c optional crypto | ipsec Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue May 21 00:41:49 2013 (r250839) +++ head/sys/conf/files.powerpc Tue May 21 03:05:49 2013 (r250840) @@ -61,6 +61,7 @@ dev/syscons/scterm-teken.c optional sc dev/syscons/scvtb.c optional sc dev/tsec/if_tsec.c optional tsec dev/tsec/if_tsec_fdt.c optional tsec fdt +dev/uart/uart_cpu_fdt.c optional uart fdt dev/uart/uart_cpu_powerpc.c optional uart aim dev/usb/controller/ehci_fsl.c optional ehci mpc85xx kern/kern_clocksource.c standard @@ -76,7 +77,6 @@ libkern/ffsl.c standard libkern/fls.c standard libkern/flsl.c standard libkern/lshrdi3.c optional powerpc -libkern/memchr.c optional fdt libkern/memmove.c standard libkern/memset.c standard libkern/moddi3.c optional powerpc Added: head/sys/dev/fdt/fdt_x86.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/fdt/fdt_x86.c Tue May 21 03:05:49 2013 (r250840) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2013 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "ofw_bus_if.h" +#include "fdt_common.h" + +struct fdt_fixup_entry fdt_fixup_table[] = { + { NULL, NULL } +}; + +fdt_pic_decode_t fdt_pic_table[] = { + NULL +}; Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Tue May 21 00:41:49 2013 (r250839) +++ head/sys/dev/uart/uart_bus_fdt.c Tue May 21 03:05:49 2013 (r250840) @@ -124,101 +124,3 @@ uart_fdt_probe(device_t dev) } DRIVER_MODULE(uart, simplebus, uart_fdt_driver, uart_devclass, 0, 0); - -/* - * UART console routines. - */ -bus_space_tag_t uart_bus_space_io; -bus_space_tag_t uart_bus_space_mem; - -int -uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) -{ - - return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0); -} - -int -uart_cpu_getdev(int devtype, struct uart_devinfo *di) -{ - char buf[64]; - struct uart_class *class; - phandle_t node, chosen; - pcell_t shift, br, rclk; - u_long start, size, pbase, psize; - int err; - - uart_bus_space_mem = fdtbus_bs_tag; - uart_bus_space_io = NULL; - - /* Allow overriding the FDT uning the environment. */ - class = &uart_ns8250_class; - err = uart_getenv(devtype, di, class); - if (!err) - return (0); - - if (devtype != UART_DEV_CONSOLE) - return (ENXIO); - - /* - * Retrieve /chosen/std{in,out}. - */ - if ((chosen = OF_finddevice("/chosen")) == -1) - return (ENXIO); - if (OF_getprop(chosen, "stdin", buf, sizeof(buf)) <= 0) - return (ENXIO); - if ((node = OF_finddevice(buf)) == -1) - return (ENXIO); - if (OF_getprop(chosen, "stdout", buf, sizeof(buf)) <= 0) - return (ENXIO); - if (OF_finddevice(buf) != node) - /* Only stdin == stdout is supported. */ - return (ENXIO); - /* - * Retrieve serial attributes. - */ - uart_fdt_get_shift(node, &shift); - - if (OF_getprop(node, "current-speed", &br, sizeof(br)) <= 0) - br = 0; - br = fdt32_to_cpu(br); - - if ((err = uart_fdt_get_clock(node, &rclk)) != 0) - return (err); - /* - * Finalize configuration. - */ - if (fdt_is_compatible(node, "fsl,imx-uart")) - class = &uart_imx_class; - if (fdt_is_compatible(node, "quicc")) - class = &uart_quicc_class; - if (fdt_is_compatible(node, "lpc")) - class = &uart_lpc_class; - if (fdt_is_compatible(node, "ns16550")) - class = &uart_ns8250_class; - if (fdt_is_compatible(node, "arm,pl011")) - class = &uart_pl011_class; - if (fdt_is_compatible(node, "cadence,uart")) - class = &uart_cdnc_class; - - di->bas.chan = 0; - di->bas.regshft = (u_int)shift; - di->baudrate = br; - di->bas.rclk = (u_int)rclk; - di->ops = uart_getops(class); - di->databits = 8; - di->stopbits = 1; - di->parity = UART_PARITY_NONE; - di->bas.bst = uart_bus_space_mem; - - err = fdt_regsize(node, &start, &size); - if (err) - return (ENXIO); - err = fdt_get_range(OF_parent(node), 0, &pbase, &psize); - if (err) - pbase = 0; - - start += pbase; - - return (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh)); -} Added: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_cpu_fdt.c Tue May 21 03:05:49 2013 (r250840) @@ -0,0 +1,175 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +/* + * UART console routines. + */ +bus_space_tag_t uart_bus_space_io; +bus_space_tag_t uart_bus_space_mem; + +static int +uart_fdt_get_clock(phandle_t node, pcell_t *cell) +{ + pcell_t clock; + + if ((OF_getprop(node, "clock-frequency", &clock, + sizeof(clock))) <= 0) + return (ENXIO); + + if (clock == 0) + /* Try to retrieve parent 'bus-frequency' */ + /* XXX this should go to simple-bus fixup or so */ + if ((OF_getprop(OF_parent(node), "bus-frequency", &clock, + sizeof(clock))) <= 0) + clock = 0; + + *cell = fdt32_to_cpu(clock); + return (0); +} + +static int +uart_fdt_get_shift(phandle_t node, pcell_t *cell) +{ + pcell_t shift; + + if ((OF_getprop(node, "reg-shift", &shift, sizeof(shift))) <= 0) + shift = 0; + *cell = fdt32_to_cpu(shift); + return (0); +} + +int +uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) +{ + + return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0); +} + +int +uart_cpu_getdev(int devtype, struct uart_devinfo *di) +{ + char buf[64]; + struct uart_class *class; + phandle_t node, chosen; + pcell_t shift, br, rclk; + u_long start, size, pbase, psize; + int err; + + uart_bus_space_mem = fdtbus_bs_tag; + uart_bus_space_io = NULL; + + /* Allow overriding the FDT uning the environment. */ + class = &uart_ns8250_class; + err = uart_getenv(devtype, di, class); + if (!err) + return (0); + + if (devtype != UART_DEV_CONSOLE) + return (ENXIO); + + /* + * Retrieve /chosen/std{in,out}. + */ + if ((chosen = OF_finddevice("/chosen")) == -1) + return (ENXIO); + if (OF_getprop(chosen, "stdin", buf, sizeof(buf)) <= 0) + return (ENXIO); + if ((node = OF_finddevice(buf)) == -1) + return (ENXIO); + if (OF_getprop(chosen, "stdout", buf, sizeof(buf)) <= 0) + return (ENXIO); + if (OF_finddevice(buf) != node) + /* Only stdin == stdout is supported. */ + return (ENXIO); + /* + * Retrieve serial attributes. + */ + uart_fdt_get_shift(node, &shift); + + if (OF_getprop(node, "current-speed", &br, sizeof(br)) <= 0) + br = 0; + br = fdt32_to_cpu(br); + + if ((err = uart_fdt_get_clock(node, &rclk)) != 0) + return (err); + /* + * Finalize configuration. + */ + if (fdt_is_compatible(node, "fsl,imx-uart")) + class = &uart_imx_class; + if (fdt_is_compatible(node, "quicc")) + class = &uart_quicc_class; + if (fdt_is_compatible(node, "lpc")) + class = &uart_lpc_class; + if (fdt_is_compatible(node, "ns16550")) + class = &uart_ns8250_class; + if (fdt_is_compatible(node, "arm,pl011")) + class = &uart_pl011_class; + if (fdt_is_compatible(node, "cadence,uart")) + class = &uart_cdnc_class; + + di->bas.chan = 0; + di->bas.regshft = (u_int)shift; + di->baudrate = br; + di->bas.rclk = (u_int)rclk; + di->ops = uart_getops(class); + di->databits = 8; + di->stopbits = 1; + di->parity = UART_PARITY_NONE; + di->bas.bst = uart_bus_space_mem; + + err = fdt_regsize(node, &start, &size); + if (err) + return (ENXIO); + err = fdt_get_range(OF_parent(node), 0, &pbase, &psize); + if (err) + pbase = 0; + + start += pbase; + + return (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh)); +} Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue May 21 00:41:49 2013 (r250839) +++ head/sys/i386/i386/machdep.c Tue May 21 03:05:49 2013 (r250840) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_mp_watchdog.h" #include "opt_npx.h" #include "opt_perfmon.h" +#include "opt_platform.h" #include "opt_xbox.h" #include "opt_kdtrace.h" @@ -138,6 +139,9 @@ __FBSDID("$FreeBSD$"); #ifdef SMP #include #endif +#ifdef FDT +#include +#endif #ifdef DEV_APIC #include @@ -3113,6 +3117,10 @@ init386(first) cpu_probe_amdc1e(); cpu_probe_cmpxchg8b(); + +#ifdef FDT + x86_init_fdt(); +#endif } #endif Added: head/sys/i386/include/fdt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/include/fdt.h Tue May 21 03:05:49 2013 (r250840) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Modified: head/sys/i386/include/metadata.h ============================================================================== --- head/sys/i386/include/metadata.h Tue May 21 00:41:49 2013 (r250839) +++ head/sys/i386/include/metadata.h Tue May 21 03:05:49 2013 (r250840) @@ -31,5 +31,6 @@ #define MODINFOMD_SMAP 0x1001 #define MODINFOMD_SMAP_XATTR 0x1002 +#define MODINFOMD_DTBP 0x1003 #endif /* !_MACHINE_METADATA_H_ */ Added: head/sys/i386/include/ofw_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/include/ofw_machdep.h Tue May 21 03:05:49 2013 (r250840) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Added: head/sys/x86/include/fdt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/fdt.h Tue May 21 03:05:49 2013 (r250840) @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2013 Juniper Networks, Inc. + * 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_FDT_H_ +#define _MACHINE_FDT_H_ + +#include +#include + +/* Max interrupt number. */ +#define FDT_INTR_MAX NUM_IO_INTS + +/* Map phandle/intpin pair to global IRQ number */ +#define FDT_MAP_IRQ(node, pin) \ + (panic("%s: FDT_MAP_IRQ(%#x, %#x)", __func__, node, pin), -1) + +/* Bus space tag. XXX we only support I/O port space this way. */ +#define fdtbus_bs_tag X86_BUS_SPACE_IO + +struct mem_region { + vm_offset_t mr_start; + vm_size_t mr_size; +}; + +__BEGIN_DECLS +int x86_init_fdt(void); +__END_DECLS + +#endif /* _MACHINE_FDT_H_ */ Added: head/sys/x86/include/ofw_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/ofw_machdep.h Tue May 21 03:05:49 2013 (r250840) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2013 Juniper Networks, Inc. + * 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_OFW_MACHDEP_H_ +#define _MACHINE_OFW_MACHDEP_H_ + +#include + +typedef uint32_t cell_t; + +#endif /* _MACHINE_OFW_MACHDEP_H_ */ Added: head/sys/x86/x86/fdt_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/x86/fdt_machdep.c Tue May 21 03:05:49 2013 (r250840) @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 2013 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include + +#include +#include + +#include +#include + +int +x86_init_fdt(void) +{ + void *dtbp, *mdp; + int error; + + if (OF_install(OFW_FDT, 0) == FALSE) { + error = ENXIO; + goto out; + } + + mdp = preload_search_by_type("elf kernel"); + if (mdp == NULL) + mdp = preload_search_by_type("elf32 kernel"); + dtbp = (mdp != NULL) ? MD_FETCH(mdp, MODINFOMD_DTBP, void *) : NULL; + +#if defined(FDT_DTB_STATIC) + /* + * In case the device tree blob was not retrieved (from metadata) try + * to use the statically embedded one. + */ + if (dtbp == NULL) + dtbp = &fdt_static_dtb; +#endif + + if (dtbp == NULL) { + error = ENOENT; + goto out; + } + + error = OF_init(dtbp) ? ENXIO : 0; + + out: + return (error); +} From owner-svn-src-all@FreeBSD.ORG Tue May 21 05:19:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F2468E39; Tue, 21 May 2013 05:19:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id B947B69; Tue, 21 May 2013 05:19:08 +0000 (UTC) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r4L5DLLb010836; Tue, 21 May 2013 15:13:21 +1000 Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r4L5D3gJ007462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 21 May 2013 15:13:04 +1000 Date: Tue, 21 May 2013 15:13:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Benjamin Kaduk Subject: Re: svn commit: r250806 - head/sys/sys In-Reply-To: Message-ID: <20130521133211.K1076@besplex.bde.org> References: <201305190744.r4J7i2FD055067@svn.freebsd.org> <20130519094813.GA1465@mole.fafoe.narf.at> <20130520140304.GA1429@mole.fafoe.narf.at> <20130521004803.K8511@besplex.bde.org> <20130520155053.GC1429@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=e/de0tV/ c=1 sm=1 a=ScYog2KUUbcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=FSHVhTTuonsA:10 a=6I5d2MoRAAAA:8 a=ZcqdbxB7iuFx4hsxRWAA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=zLKHno5kb_5U-owg:21 a=E4v2DjiuGyRwmpjJ:21 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: Ed Schouten , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Stefan Farfeleder , Bruce Evans , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 05:19:10 -0000 On Mon, 20 May 2013, Benjamin Kaduk wrote: > On Mon, May 20, 2013 at 11:50 AM, Stefan Farfeleder wrote: > >> Since nobody wants to update lint to recent C standards, maybe it's time to >> remove it? I'm not going to defend it. At first I thought it was useful for checking for old sources, but with system headers using new features it works poorly even for that. > It does seem like compilers can do a better job of finding lint-like things > than lint itself, these days (especially clang). I checked what lint and compilers do on dusty decks (Kahan paranoia.c from ~1987 and SGI ttcp.c from ~1991). lint was worst since it is broken. clang was next worst because its output format is bad (even without colorization): lint -cghapbxu: I used the default LINTFLAGS from sys.mk. Obviously no one uses lint, since using these flags exposes even more bitrot in the tool chain and/or system headers: @l paranoia.c: @l warning: unknown warning option '-Wtraditional' [-Wunknown-warning-option] @l 1 warning generated. This is added (to CFLAGS) when -p is in the lint flags. The addition is undocumented. This used to work, but now it doesn't due to bitrot in the tool chain -- apparently lint uses part of clang (the preprocessor), and clang's support for -Wtraditional is broken (missing). @l paranoia.c(332): warning: argument has incompatible pointer type, arg #2 [153] @l paranoia.c(366): warning: argument has incompatible pointer type, arg #2 [153] @l paranoia.c(1847): warning: automatic hides external declaration: ch [86] @l paranoia.c(1886): warning: automatic hides external declaration: X [86] @l paranoia.c(1886): warning: automatic hides external declaration: Y [86] Last 5 lines useful. @l _types.h(62): warning: struct __timer never defined [233] @l _types.h(63): warning: struct __mq never defined [233] @l stdio.h(142): warning: struct pthread_mutex never defined [233] @l stdio.h(143): warning: struct pthread never defined [233] @l signal.h(90): warning: struct timespec never defined [233] @l signal.h(117): warning: struct __ucontext never defined [233] Lint doesn't understand C90 yet, so it emits many spurious warnings about forward declarations of structs. -p also causes -Wno-system-headers to be added to CFLAGS. This breaks detection by the compiler of some (non-) errors in system headers. However, lint itself doesn't understand -Wno-system-headers, so it it still warns about these non-errors in system headers. That's all for paranoia.c. Not too bad. @l ttcp.c: @l warning: unknown warning option '-Wtraditional' [-Wunknown-warning-option] @l ttcp.c:205:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] @l #endif cray @l ^ @l // @l ttcp.c:251:7: warning: extra tokens at end of #else directive [-Wextra-tokens] @l #else BSD43 @l ^ @l // @l ttcp.c:275:7: warning: extra tokens at end of #else directive [-Wextra-tokens] @l #else BSD43 @l ^ @l // @l ttcp.c:441:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] @l #endif SYSV @l ^ @l // @l ttcp.c:590:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] @l #endif !SYSV @l ^ @l // @l 6 warnings generated. I forget if these extra tokens are syntax errors. The warnings for them are apparently printed in a different format by clang's cpp. The misprinting makes the output ungreppable. @l _ctype.h(52): syntax error [249] @l _ctype.h(105): runes undefined [99] @l _ctype.h(105): left operand of '=' must be lvalue [114] ctype support for C11 (?) added mounds of style bugs and perhaps a few bugs. It is at least incompatible with lint, as shown by the above. There is a more fundamental error with the reporting of the header name. One of the largest style bugs in the new ctype code is its convoluted include nested include structure. _ctype.h isn't /usr/include/_ctype.h, but /usr/include/xlocale/_ctype.h. There are many obvious style bugs in lines 52 and 105 of the latter, but no obvious bugs. The syntax errors here seem to be due to convoluted ifdefs which result in some types not being declared when this is compiled by lint (or just cpp?). In fact, the convoluted ifdefs not even in new ctype code break the toolchain for not even lint: 1. cpp -P ttcp.c >z.c; lint -c... z.c # horribly broken 2. cpp -P -Dlint ttcp.c >z.c; lint -c... z.c # not quite so broken 3. cpp -P ttcp.c >z.c; gcc -c z.c # broken 4. cpp -P ttcp.c >z.c; cc -c z.c # works 5. cpp -P ttcp.c >z.c; gcc -c -std=c99 z.c # works (3) is broken mainly because -std=c99 is now the default for cpp but it is not the default for gcc, so the 'restrict' keyword is not anulled. (5) fixes this by supporting the 'restrict' keyword for gcc. (1) is also broken main by -std=c99 in cpp exposing the 'restrict' keyword to lint. (2) fixes this by killing the 'restrict' keyword at the cpp level. @l _ctype.h(107): undefined struct/union member: __runetype [101] @l _ctype.h(107): warning: function __sbmaskrune_l expects to return value [214] @l _ctype.h(102): warning: argument __c unused in function __sbmaskrune_l [231] @l _ctype.h(102): warning: argument __f unused in function __sbmaskrune_l [231] @l _ctype.h(102): warning: argument __loc unused in function __sbmaskrune_l [231] @l _ctype.h(185): warning: conversion to 'unsigned long' due to prototype, arg #2 [259] @l _ctype.h(190): __runes undefined [99] @l _ctype.h(190): left operand of '=' must be lvalue [114] @l _ctype.h(192): undefined struct/union member: __maplower [101] @l _ctype.h(192): warning: function tolower_l expects to return value [214] @l _ctype.h(187): warning: argument __c unused in function tolower_l [231] @l _ctype.h(187): warning: argument __l unused in function tolower_l [231] @l _ctype.h(197): __runes undefined [99] @l _ctype.h(197): left operand of '=' must be lvalue [114] @l _ctype.h(199): undefined struct/union member: __mapupper [101] @l _ctype.h(199): warning: function toupper_l expects to return value [214] @l _ctype.h(194): warning: argument __c unused in function toupper_l [231] @l _ctype.h(194): warning: argument __l unused in function toupper_l [231] Cascade of errors in ctype. @l endian.h(95): warning: bitwise operation on signed value possibly nonportable [117] Again it won't tell us where the header is, and the system headers are excessively convoluted, with several named endian.h. This seems to be in . The warning is a bug in lint. Lint doesn't understand C90's broken value-preserving extension rules. Here we start with an unsigned 16-bit value, but the broken extension rules convert it to a signed 32-bit value when it is used in expressions. Only the lower 24 bits are used in the expression in this case, so there is no portability problem. Compilers and lints must understand the details of this to avoid emitting lots of spurious warnings, but lint doesn't. @l endian.h(122): warning: extra bits set to 0 in conversion of 'unsigned int' to 'unsigned long long', op & [309] Bogus warning. @l endian.h(122): warning: conversion to 'unsigned int' due to prototype, arg #1 [259] @l endian.h(122): warning: conversion from 'unsigned long long' may lose accuracy, arg #1 [298] @l endian.h(122): warning: conversion to 'unsigned int' due to prototype, arg #1 [259] @l endian.h(122): warning: conversion from 'unsigned long long' may lose accuracy, arg #1 [298] The code is intentionally using the prototype to do the conversion. This is convenient, but perhaps we should use a cast to make the conversion explicit, or better tell lint to not warn about such "missing" casts ever in system headers and optionally in applications. @l tcp.h(56): warning: nonportable bit-field type [34] @l tcp.h(57): warning: nonportable bit-field type [34] @l tcp.h(199): warning: nonportable bit-field type [34] @l tcp.h(200): warning: nonportable bit-field type [34] These are plain bugs. I fixed them in tcp.h and many other places in the kernel back in 1998 after finding such bugs by compiling with various portability options but someone broke tcp.h, so it now uses u_char for bit-fields there again :-(. Bit-fields can only have type bool, signed int and unsigned int in C99. Bit-fields of type u_char are a gcc extension. They have arcane undocmented effects on the packing and alignment of structs. IIRC, for gcc using u_char instead of u_int has no effect on the packing near the fields, but it prevents the struct having to have the alignment of u_int or greater (just because there is a bit-field of type u_int in it). The bugs are in struct tcphdr. This struct has a u_int elsewhere in it, so using u_int for the bit-field has no effect for gcc. Perhaps the u_char is to work around mis-packing by a broken compiler. Packing and alignment are delicate in struct tcphdr, and this is not "fixed" even more unportably using __packed and __aligned(2) like it is done in too many networking headers (mainly !ipv4 ones). @l time.h(101): warning: conversion from 'unsigned long long' may lose accuracy [132] @l time.h(111): warning: conversion from 'unsigned long long' may lose accuracy [132] @l time.h(116): warning: bitwise operation on signed value possibly nonportable [117] @l time.h(137): warning: bitwise operation on signed value possibly nonportable [117] @l time.h(137): warning: conversion from 'long long' may lose accuracy [132] @l time.h(152): warning: bitwise operation on signed value possibly nonportable [117] @l time.h(152): warning: conversion from 'long long' may lose accuracy [132] @l time.h(176): warning: conversion from 'unsigned long long' may lose accuracy [132] @l time.h(193): warning: conversion from 'unsigned long long' may lose accuracy [132] @l time.h(210): warning: bitwise operation on signed value possibly nonportable [117] @l time.h(210): warning: conversion from 'long long' may lose accuracy [132] @l time.h(211): warning: conversion from 'unsigned long long' may lose accuracy [132] @l time.h(228): warning: bitwise operation on signed value possibly nonportable [117] @l time.h(228): warning: conversion from 'long long' may lose accuracy [132] @l time.h(229): warning: conversion from 'unsigned long long' may lose accuracy [132] Mostly non-problems like the ones in endian.h, but casts to say that they are non-problems are more needed now. Oops, this isn't clear. E.g., some of the warnings are for conversions from bintimes with 64-bit integer parts to sbintimes with 32-bit integer parts. These depend on sbintimes being relative or the date being before 2038, else blind overflow occurs. @l ttcp.c(185): warning: pointer casts may be troublesome [247] @l ttcp.c(200): warning: pointer casts may be troublesome [247] @l ttcp.c(204): warning: conversion from 'unsigned long' may lose accuracy [132] @l ttcp.c(222): warning: conversion of pointer to 'int' loses bits [133] @l ttcp.c(241): warning: argument has incompatible pointer type, arg #2 [153] @l ttcp.c(241): warning: conversion to 'unsigned int' due to prototype, arg #3 [259] @l ttcp.c(252): warning: conversion to 'unsigned int' due to prototype, arg #5 [259] @l ttcp.c(260): warning: conversion to 'unsigned int' due to prototype, arg #5 [259] @l ttcp.c(264): warning: argument has incompatible pointer type, arg #2 [153] @l ttcp.c(264): warning: conversion to 'unsigned int' due to prototype, arg #3 [259] @l ttcp.c(276): warning: conversion to 'unsigned int' due to prototype, arg #5 [259] @l ttcp.c(282): warning: argument has incompatible pointer type, arg #2 [153] @l ttcp.c(282): warning: argument has incompatible pointer type, arg #3 [153] @l ttcp.c(287): warning: argument has incompatible pointer type, arg #2 [153] @l ttcp.c(287): warning: argument has incompatible pointer type, arg #3 [153] @l ttcp.c(460): warning: argument type defaults to 'int': len [32] @l ttcp.c(500): warning: conversion from 'long' may lose accuracy [132] @l ttcp.c(501): warning: conversion from 'long' may lose accuracy [132] @l ttcp.c(538): warning: conversion from 'long' may lose accuracy [132] @l ttcp.c(625): warning: conversion from 'long' may lose accuracy [132] @l ttcp.c(629): warning: conversion from 'long' may lose accuracy [132] @l ttcp.c(633): warning: conversion from 'long' may lose accuracy [132] @l ttcp.c(646): warning: argument type defaults to 'int': fd [32] @l ttcp.c(646): warning: argument type defaults to 'int': buf [32] @l ttcp.c(646): warning: argument type defaults to 'int': count [32] @l ttcp.c(651): warning: illegal combination of pointer and integer, arg #2 [154] @l ttcp.c(651): warning: conversion to 'unsigned int' due to prototype, arg #3 [259] @l ttcp.c(651): warning: argument has incompatible pointer type, arg #5 [153] @l ttcp.c(651): warning: argument has incompatible pointer type, arg #6 [153] @l ttcp.c(668): warning: argument type defaults to 'int': fd [32] @l ttcp.c(668): warning: argument type defaults to 'int': buf [32] @l ttcp.c(668): warning: argument type defaults to 'int': count [32] @l ttcp.c(672): warning: illegal combination of pointer and integer, arg #2 [154] @l ttcp.c(672): warning: conversion to 'unsigned int' due to prototype, arg #3 [259] @l ttcp.c(672): warning: argument has incompatible pointer type, arg #5 [153] @l ttcp.c(672): warning: conversion to 'unsigned int' due to prototype, arg #6 [259] @l ttcp.c(689): warning: argument type defaults to 'int': us [32] @l ttcp.c(694): warning: argument has incompatible pointer type, arg #2 [153] @l ttcp.c(694): warning: argument has incompatible pointer type, arg #3 [153] @l ttcp.c(694): warning: argument has incompatible pointer type, arg #4 [153] Mostly useful warnings for ttcp.c itself. @l _types.h(62): warning: struct __timer never defined [233] @l _types.h(63): warning: struct __mq never defined [233] @l stdio.h(142): warning: struct pthread_mutex never defined [233] @l stdio.h(143): warning: struct pthread never defined [233] @l signal.h(117): warning: struct __ucontext never defined [233] @l _ctype.h(44): warning: struct _xlocale never defined [233] @l endian.h(111): warning: static function __bswap64_var unused [236] @l _pthreadtypes.h(45): warning: struct pthread_attr never defined [233] @l _pthreadtypes.h(46): warning: struct pthread_cond never defined [233] @l _pthreadtypes.h(47): warning: struct pthread_cond_attr never defined [233] @l _pthreadtypes.h(49): warning: struct pthread_mutex_attr never defined [233] @l _pthreadtypes.h(51): warning: struct pthread_rwlock never defined [233] @l _pthreadtypes.h(52): warning: struct pthread_rwlockattr never defined [233] @l _pthreadtypes.h(53): warning: struct pthread_barrier never defined [233] @l _pthreadtypes.h(54): warning: struct pthread_barrier_attr never defined [233] @l _pthreadtypes.h(55): warning: struct pthread_spinlock never defined [233] @l _pthreadtypes.h(78): warning: struct pthread_barrierattr never defined [233] @l in6.h(377): warning: struct rtentry never defined [233] @l in6.h(378): warning: struct llentry never defined [233] @l time.h(59): warning: static function bintime_addx unused [236] @l time.h(70): warning: static function bintime_add unused [236] @l time.h(82): warning: static function bintime_sub unused [236] @l time.h(94): warning: static function bintime_mul unused [236] @l time.h(106): warning: static function bintime_shift unused [236] @l time.h(134): warning: static function sbintime_getsec unused [236] @l time.h(141): warning: static function bttosbt unused [236] @l time.h(148): warning: static function sbttobt unused [236] @l time.h(172): warning: static function bintime2timespec unused [236] @l time.h(180): warning: static function timespec2bintime unused [236] @l time.h(189): warning: static function bintime2timeval unused [236] @l time.h(197): warning: static function timeval2bintime unused [236] @l time.h(206): warning: static function sbttots unused [236] @l time.h(216): warning: static function tstosbt unused [236] @l time.h(224): warning: static function sbttotv unused [236] @l time.h(234): warning: static function tvtosbt unused [236] The usual lint bug for forward declarations of structs, except for 1 warning about a static inline function. It's surprising that there aren't mmore of the latter. gcc: -Wall @g paranoia.c:326: warning: return type defaults to 'int' @g paranoia.c: In function 'sigfpe': @g paranoia.c:332: warning: passing argument 2 of 'signal' from incompatible pointer type @g paranoia.c:337: warning: implicit declaration of function 'abort' @g paranoia.c:337: warning: incompatible implicit declaration of built-in function 'abort' @g paranoia.c: At top level: @g paranoia.c:341: warning: return type defaults to 'int' @g paranoia.c: In function 'main': @g paranoia.c:366: warning: passing argument 2 of 'signal' from incompatible pointer type @g paranoia.c:368: warning: implicit declaration of function 'Instructions' @g paranoia.c:369: warning: implicit declaration of function 'Pause' @g paranoia.c:370: warning: implicit declaration of function 'Heading' @g paranoia.c:372: warning: implicit declaration of function 'Characteristics' @g paranoia.c:374: warning: implicit declaration of function 'History' @g paranoia.c:381: warning: implicit declaration of function 'TstCond' @g paranoia.c:390: warning: implicit declaration of function 'TstPtUf' @g paranoia.c:579: warning: implicit declaration of function 'BadCond' @g paranoia.c:583: warning: implicit declaration of function 'notify' @g paranoia.c:984: warning: implicit declaration of function 'SqXMinX' @g paranoia.c:1140: warning: implicit declaration of function 'NewD' @g paranoia.c:1148: warning: implicit declaration of function 'SR3750' @g paranoia.c:1209: warning: implicit declaration of function 'SR3980' @g paranoia.c:1217: warning: implicit declaration of function 'PrintIfNPositive' @g paranoia.c:1580: warning: implicit declaration of function 'IsYeqX' @g paranoia.c:1741: warning: implicit declaration of function 'read' @g paranoia.c:1831: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:1846: warning: return type defaults to 'int' @g paranoia.c: In function 'Pause': @g paranoia.c:1858: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:1863: warning: return type defaults to 'int' @g paranoia.c: In function 'TstCond': @g paranoia.c:1865: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:1868: warning: return type defaults to 'int' @g paranoia.c: In function 'BadCond': @g paranoia.c:1875: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:1900: warning: return type defaults to 'int' @g paranoia.c: In function 'SqXMinX': @g paranoia.c:1915: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:1920: warning: return type defaults to 'int' @g paranoia.c: In function 'NewD': @g paranoia.c:1930: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:1935: warning: return type defaults to 'int' @g paranoia.c: In function 'SR3750': @g paranoia.c:1947: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:1952: warning: return type defaults to 'int' @g paranoia.c: In function 'IsYeqX': @g paranoia.c:1966: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:1971: warning: return type defaults to 'int' @g paranoia.c: In function 'SR3980': @g paranoia.c:1979: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:1984: warning: return type defaults to 'int' @g paranoia.c: In function 'PrintIfNPositive': @g paranoia.c:1986: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:1991: warning: return type defaults to 'int' @g paranoia.c: In function 'TstPtUf': @g paranoia.c:2046: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:2049: warning: return type defaults to 'int' @g paranoia.c: In function 'notify': @g paranoia.c:2053: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:2060: warning: return type defaults to 'int' @g paranoia.c: In function 'msglist': @g paranoia.c:2061: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:2064: warning: return type defaults to 'int' @g paranoia.c: In function 'Instructions': @g paranoia.c:2078: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:2083: warning: return type defaults to 'int' @g paranoia.c: In function 'Heading': @g paranoia.c:2106: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:2111: warning: return type defaults to 'int' @g paranoia.c: In function 'Characteristics': @g paranoia.c:2135: warning: control reaches end of non-void function @g paranoia.c: At top level: @g paranoia.c:2139: warning: return type defaults to 'int' @g paranoia.c: In function 'History': @g paranoia.c:2164: warning: control reaches end of non-void function @g ttcp.c:127: warning: return type defaults to 'int' @g ttcp.c: In function 'main': @g ttcp.c:154: warning: implicit declaration of function 'atoi' @g ttcp.c:185: warning: implicit declaration of function 'bzero' @g ttcp.c:185: warning: incompatible implicit declaration of built-in function 'bzero' @g ttcp.c:194: warning: implicit declaration of function 'inet_addr' @g ttcp.c:198: warning: implicit declaration of function 'err' @g ttcp.c:200: warning: implicit declaration of function 'bcopy' @g ttcp.c:200: warning: incompatible implicit declaration of built-in function 'bcopy' @g ttcp.c:205:8: warning: extra tokens at end of #endif directive @g ttcp.c:219: warning: implicit declaration of function 'malloc' @g ttcp.c:219: warning: incompatible implicit declaration of built-in function 'malloc' @g ttcp.c:222: warning: cast from pointer to integer of different size @g ttcp.c:239: warning: implicit declaration of function 'mes' @g ttcp.c:241: warning: passing argument 2 of 'bind' from incompatible pointer type @g ttcp.c:251:7: warning: extra tokens at end of #else directive @g ttcp.c:264: warning: passing argument 2 of 'connect' from incompatible pointer type @g ttcp.c:275:7: warning: extra tokens at end of #else directive @g ttcp.c:282: warning: passing argument 2 of 'accept' from incompatible pointer type @g ttcp.c:282: warning: pointer targets in passing argument 3 of 'accept' differ in signedness @g ttcp.c:287: warning: passing argument 2 of 'getpeername' from incompatible pointer type @g ttcp.c:287: warning: pointer targets in passing argument 3 of 'getpeername' differ in signedness @g ttcp.c:291: warning: implicit declaration of function 'inet_ntoa' @g ttcp.c:291: warning: format '%s' expects type 'char *', but argument 3 has type 'int' @g ttcp.c:300: warning: implicit declaration of function 'pattern' @g ttcp.c:301: warning: implicit declaration of function 'Nwrite' @g ttcp.c:307: warning: implicit declaration of function 'Nread' @g ttcp.c:327: warning: implicit declaration of function 'read' @g ttcp.c:332: warning: implicit declaration of function 'write' @g ttcp.c:361: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int' @g ttcp.c:367: warning: format '%#x' expects type 'unsigned int', but argument 4 has type 'char *' @g ttcp.c:369: warning: implicit declaration of function 'exit' @g ttcp.c:369: warning: incompatible implicit declaration of built-in function 'exit' @g ttcp.c: At top level: @g ttcp.c:377: warning: return type defaults to 'int' @g ttcp.c: In function 'err': @g ttcp.c:382: warning: incompatible implicit declaration of built-in function 'exit' @g ttcp.c: At top level: @g ttcp.c:386: warning: return type defaults to 'int' @g ttcp.c: In function 'mes': @g ttcp.c:389: warning: control reaches end of non-void function @g ttcp.c: At top level: @g ttcp.c:392: warning: return type defaults to 'int' @g ttcp.c: In function 'pattern': @g ttcp.c:401: warning: control reaches end of non-void function @g ttcp.c:441:8: warning: extra tokens at end of #endif directive @g ttcp.c: In function 'read_timer': @g ttcp.c:470: warning: implicit declaration of function 'strncpy' @g ttcp.c:470: warning: incompatible implicit declaration of built-in function 'strncpy' @g ttcp.c: In function 'prusage': @g ttcp.c:516: warning: format '%d' expects type 'int', but argument 3 has type 'time_t' @g ttcp.c:516: warning: format '%01d' expects type 'int', but argument 4 has type 'suseconds_t' @g ttcp.c:522: warning: format '%d' expects type 'int', but argument 3 has type 'time_t' @g ttcp.c:522: warning: format '%01d' expects type 'int', but argument 4 has type 'suseconds_t' @g ttcp.c:544: warning: format '%d' expects type 'int', but argument 3 has type 'long int' @g ttcp.c:550: warning: format '%d' expects type 'int', but argument 3 has type 'long int' @g ttcp.c:557: warning: format '%d' expects type 'int', but argument 3 has type 'long int' @g ttcp.c:562: warning: format '%d' expects type 'int', but argument 3 has type 'long int' @g ttcp.c:567: warning: format '%d' expects type 'int', but argument 3 has type 'long int' @g ttcp.c:572: warning: format '%d' expects type 'int', but argument 3 has type 'long int' @g ttcp.c:577: warning: format '%d' expects type 'int', but argument 3 has type 'long int' @g ttcp.c:582: warning: format '%d' expects type 'int', but argument 3 has type 'long int' @g ttcp.c:587: warning: format '%d' expects type 'int', but argument 3 has type 'long int' @g ttcp.c:587: warning: format '%d' expects type 'int', but argument 4 has type 'long int' @g ttcp.c:590:8: warning: extra tokens at end of #endif directive @g ttcp.c: At top level: @g ttcp.c:646: warning: return type defaults to 'int' @g ttcp.c: In function 'Nread': @g ttcp.c:651: warning: passing argument 2 of 'recvfrom' makes pointer from integer without a cast @g ttcp.c:651: warning: passing argument 5 of 'recvfrom' from incompatible pointer type @g ttcp.c:651: warning: pointer targets in passing argument 6 of 'recvfrom' differ in signedness @g ttcp.c:655: warning: implicit declaration of function 'mread' @g ttcp.c: At top level: @g ttcp.c:668: warning: return type defaults to 'int' @g ttcp.c: In function 'Nwrite': @g ttcp.c:672: warning: passing argument 2 of 'sendto' makes pointer from integer without a cast @g ttcp.c:672: warning: passing argument 5 of 'sendto' from incompatible pointer type @g ttcp.c: At top level: @g ttcp.c:689: warning: return type defaults to 'int' @g ttcp.c: In function 'delay': @g ttcp.c:694: warning: passing argument 2 of 'select' from incompatible pointer type @g ttcp.c:694: warning: passing argument 3 of 'select' from incompatible pointer type @g ttcp.c:694: warning: passing argument 4 of 'select' from incompatible pointer type @g ttcp.c: At top level: @g ttcp.c:32: warning: 'RCSid' defined but not used Mostly useful. gcc finds more problems than lint, but not all the ones found by lint. The output format is worse. clang -Wall: c@ paranoia.c:325:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ sigfpe() c@ ^~~~~~ c@ paranoia.c:332:18: warning: incompatible pointer types passing 'Sig_type' (aka 'int (*)()') to parameter of type '__sighandler_t *' (aka 'void (*)(int)') [-Wincompatible-pointer-types] c@ signal(SIGFPE, sigsave); c@ ^~~~~~~ c@ /usr/include/sys/signal.h:441:45: note: passing argument to parameter here c@ __sighandler_t *signal(int, __sighandler_t *); c@ ^ c@ paranoia.c:337:2: warning: implicitly declaring library function 'abort' with type 'void (void) __attribute__((noreturn))' c@ abort(); c@ ^ c@ paranoia.c:337:2: note: please include the header or explicitly provide a declaration for 'abort' c@ paranoia.c:340:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ main() c@ ^~~~ c@ paranoia.c:366:17: warning: incompatible pointer types passing 'int ()' to parameter of type '__sighandler_t *' (aka 'void (*)(int)') [-Wincompatible-pointer-types] c@ signal(SIGFPE, sigfpe); c@ ^~~~~~ c@ /usr/include/sys/signal.h:441:45: note: passing argument to parameter here c@ __sighandler_t *signal(int, __sighandler_t *); c@ ^ c@ paranoia.c:368:2: warning: implicit declaration of function 'Instructions' is invalid in C99 [-Wimplicit-function-declaration] c@ Instructions(); c@ ^ c@ paranoia.c:369:2: warning: implicit declaration of function 'Pause' is invalid in C99 [-Wimplicit-function-declaration] c@ Pause(); c@ ^ c@ paranoia.c:370:2: warning: implicit declaration of function 'Heading' is invalid in C99 [-Wimplicit-function-declaration] c@ Heading(); c@ ^ c@ paranoia.c:372:2: warning: implicit declaration of function 'Characteristics' is invalid in C99 [-Wimplicit-function-declaration] c@ Characteristics(); c@ ^ c@ paranoia.c:374:2: warning: implicit declaration of function 'History' is invalid in C99 [-Wimplicit-function-declaration] c@ History(); c@ ^ c@ paranoia.c:381:2: warning: implicit declaration of function 'TstCond' is invalid in C99 [-Wimplicit-function-declaration] c@ TstCond (Failure, (Zero + Zero == Zero) && (One - One == Zero) c@ ^ c@ paranoia.c:390:3: warning: implicit declaration of function 'TstPtUf' is invalid in C99 [-Wimplicit-function-declaration] c@ TstPtUf(); c@ ^ c@ paranoia.c:579:3: warning: implicit declaration of function 'BadCond' is invalid in C99 [-Wimplicit-function-declaration] c@ BadCond(Serious, "Disagreements among the values X1, Y1, Z1,\n"); c@ ^ c@ paranoia.c:583:3: warning: implicit declaration of function 'notify' is invalid in C99 [-Wimplicit-function-declaration] c@ notify("Possibly some part of this"); c@ ^ c@ paranoia.c:984:2: warning: implicit declaration of function 'SqXMinX' is invalid in C99 [-Wimplicit-function-declaration] c@ SqXMinX (Serious); c@ ^ c@ paranoia.c:1140:7: warning: implicit declaration of function 'NewD' is invalid in C99 [-Wimplicit-function-declaration] c@ NewD(); c@ ^ c@ paranoia.c:1148:7: warning: implicit declaration of function 'SR3750' is invalid in C99 [-Wimplicit-function-declaration] c@ SR3750(); c@ ^ c@ paranoia.c:1209:3: warning: implicit declaration of function 'SR3980' is invalid in C99 [-Wimplicit-function-declaration] c@ SR3980(); c@ ^ c@ paranoia.c:1217:4: warning: implicit declaration of function 'PrintIfNPositive' is invalid in C99 [-Wimplicit-function-declaration] c@ PrintIfNPositive(); c@ ^ c@ paranoia.c:1415:5: warning: explicitly assigning a variable of type 'double' to itself [-Wself-assign] c@ X = X; c@ ~ ^ ~ c@ paranoia.c:1580:3: warning: implicit declaration of function 'IsYeqX' is invalid in C99 [-Wimplicit-function-declaration] c@ IsYeqX(); c@ ^ c@ paranoia.c:1741:2: warning: implicit declaration of function 'read' is invalid in C99 [-Wimplicit-function-declaration] c@ read (KEYBOARD, ch, 8); c@ ^ c@ paranoia.c:1845:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ Pause() c@ ^~~~~ c@ paranoia.c:1858:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:1862:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ TstCond (K, Valid, T) c@ ^~~~~~~ c@ paranoia.c:1865:49: warning: control reaches end of non-void function [-Wreturn-type] c@ { if (! Valid) { BadCond(K,T); printf(".\n"); } } c@ ^ c@ paranoia.c:1867:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ BadCond(K, T) c@ ^~~~~~~ c@ paranoia.c:1875:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:1899:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ SqXMinX (ErrKind) c@ ^~~~~~~ c@ paranoia.c:1915:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:1919:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ NewD() c@ ^~~~ c@ paranoia.c:1930:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:1934:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ SR3750() c@ ^~~~~~ c@ paranoia.c:1947:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:1951:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ IsYeqX() c@ ^~~~~~ c@ paranoia.c:1966:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:1970:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ SR3980() c@ ^~~~~~ c@ paranoia.c:1979:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:1983:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ PrintIfNPositive() c@ ^~~~~~~~~~~~~~~~ c@ paranoia.c:1986:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:1990:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ TstPtUf() c@ ^~~~~~~ c@ paranoia.c:2046:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:2048:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ notify(s) c@ ^~~~~~ c@ paranoia.c:2053:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:2059:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ msglist(s) c@ ^~~~~~~ c@ paranoia.c:2061:35: warning: control reaches end of non-void function [-Wreturn-type] c@ { while(*s) printf("%s\n", *s++); } c@ ^ c@ paranoia.c:2063:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ Instructions() c@ ^~~~~~~~~~~~ c@ paranoia.c:2078:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:2082:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ Heading() c@ ^~~~~~~ c@ paranoia.c:2106:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:2110:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ Characteristics() c@ ^~~~~~~~~~~~~~~ c@ paranoia.c:2135:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ paranoia.c:2137:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ History() c@ ^~~~~~~ c@ paranoia.c:2164:2: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ 54 warnings generated. c@ ttcp.c:126:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ main(argc,argv) c@ ^~~~ c@ ttcp.c:154:11: warning: implicit declaration of function 'atoi' is invalid in C99 [-Wimplicit-function-declaration] c@ nbuf = atoi(&argv[0][2]); c@ ^ c@ ttcp.c:185:3: warning: implicitly declaring library function 'bzero' with type 'void (void *, unsigned long)' c@ bzero((char *)&sinhim, sizeof(sinhim)); c@ ^ c@ ttcp.c:185:3: note: please include the header or explicitly provide a declaration for 'bzero' c@ ttcp.c:194:29: warning: implicit declaration of function 'inet_addr' is invalid in C99 [-Wimplicit-function-declaration] c@ sinhim.sin_addr.s_addr = inet_addr(host); c@ ^ c@ ttcp.c:198:5: warning: implicit declaration of function 'err' is invalid in C99 [-Wimplicit-function-declaration] c@ err("bad hostname"); c@ ^ c@ ttcp.c:200:4: warning: implicit declaration of function 'bcopy' is invalid in C99 [-Wimplicit-function-declaration] c@ bcopy(addr->h_addr,(char*)&addr_tmp, addr->h_length); c@ ^ c@ ttcp.c:205:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] c@ #endif cray c@ ^ c@ // c@ ttcp.c:219:22: warning: implicitly declaring library function 'malloc' with type 'void *(unsigned long)' c@ if ( (buf = (char *)malloc(buflen+bufalign)) == (char *)NULL) c@ ^ c@ ttcp.c:219:22: note: please include the header or explicitly provide a declaration for 'malloc' c@ ttcp.c:239:2: warning: implicit declaration of function 'mes' is invalid in C99 [-Wimplicit-function-declaration] c@ mes("socket"); c@ ^ c@ ttcp.c:241:15: warning: incompatible pointer types passing 'struct sockaddr_in *' to parameter of type 'const struct sockaddr *' [-Wincompatible-pointer-types] c@ if (bind(fd, &sinme, sizeof(sinme)) < 0) c@ ^~~~~~ c@ /usr/include/sys/socket.h:634:38: note: passing argument to parameter here c@ int bind(int, const struct sockaddr *, socklen_t); c@ ^ c@ ttcp.c:251:7: warning: extra tokens at end of #else directive [-Wextra-tokens] c@ #else BSD43 c@ ^ c@ // c@ ttcp.c:264:18: warning: incompatible pointer types passing 'struct sockaddr_in *' to parameter of type 'const struct sockaddr *' [-Wincompatible-pointer-types] c@ if(connect(fd, &sinhim, sizeof(sinhim) ) < 0) c@ ^~~~~~~ c@ /usr/include/sys/socket.h:635:41: note: passing argument to parameter here c@ int connect(int, const struct sockaddr *, socklen_t); c@ ^ c@ ttcp.c:275:7: warning: extra tokens at end of #else directive [-Wextra-tokens] c@ #else BSD43 c@ ^ c@ // c@ ttcp.c:282:21: warning: incompatible pointer types passing 'struct sockaddr_in *' to parameter of type 'struct sockaddr *' [-Wincompatible-pointer-types] c@ if((fd=accept(fd, &frominet, &fromlen) ) < 0) c@ ^~~~~~~~~ c@ /usr/include/sys/socket.h:633:45: note: passing argument to parameter here c@ int accept(int, struct sockaddr * __restrict, socklen_t * __restrict); c@ ^ c@ ttcp.c:282:32: warning: passing 'int *' to parameter of type 'socklen_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign] c@ if((fd=accept(fd, &frominet, &fromlen) ) < 0) c@ ^~~~~~~~ c@ /usr/include/sys/socket.h:633:69: note: passing argument to parameter here c@ int accept(int, struct sockaddr * __restrict, socklen_t * __restrict); c@ ^ c@ ttcp.c:286:25: warning: incompatible pointer types passing 'struct sockaddr_in *' to parameter of type 'struct sockaddr *' [-Wincompatible-pointer-types] c@ if (getpeername(fd, (struct sockaddr_in *) &peer, c@ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ c@ /usr/include/sys/socket.h:641:50: note: passing argument to parameter here c@ int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict); c@ ^ c@ ttcp.c:287:5: warning: passing 'int *' to parameter of type 'socklen_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign] c@ &peerlen) < 0) { c@ ^~~~~~~~ c@ /usr/include/sys/socket.h:641:74: note: passing argument to parameter here c@ int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict); c@ ^ c@ ttcp.c:291:4: warning: implicit declaration of function 'inet_ntoa' is invalid in C99 [-Wimplicit-function-declaration] c@ inet_ntoa(peer.sin_addr)); c@ ^ c@ ttcp.c:291:4: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat] c@ inet_ntoa(peer.sin_addr)); c@ ^~~~~~~~~~~~~~~~~~~~~~~~ c@ ttcp.c:300:4: warning: implicit declaration of function 'pattern' is invalid in C99 [-Wimplicit-function-declaration] c@ pattern( buf, buflen ); c@ ^ c@ ttcp.c:301:19: warning: implicit declaration of function 'Nwrite' is invalid in C99 [-Wimplicit-function-declaration] c@ if(udp) (void)Nwrite( fd, buf, 4 ); /* rcvr start */ c@ ^ c@ ttcp.c:307:20: warning: implicit declaration of function 'Nread' is invalid in C99 [-Wimplicit-function-declaration] c@ while ((cnt=Nread(fd,buf,buflen)) > 0) { c@ ^ c@ ttcp.c:327:15: warning: implicit declaration of function 'read' is invalid in C99 [-Wimplicit-function-declaration] c@ while((cnt=read(0,buf,buflen)) > 0 && c@ ^ c@ ttcp.c:332:8: warning: implicit declaration of function 'write' is invalid in C99 [-Wimplicit-function-declaration] c@ write(1,buf,cnt) == cnt) c@ ^ c@ ttcp.c:359:3: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat] c@ numCalls, c@ ^~~~~~~~ c@ ttcp.c:367:3: warning: format specifies type 'unsigned int' but the argument has type 'char *' [-Wformat] c@ buf); c@ ^~~ c@ ttcp.c:369:2: warning: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' c@ exit(0); c@ ^ c@ ttcp.c:369:2: note: please include the header or explicitly provide a declaration for 'exit' c@ ttcp.c:372:17: warning: format string is not a string literal (potentially insecure) [-Wformat-security] c@ fprintf(stderr,Usage); c@ ^~~~~ c@ ttcp.c:376:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ err(s) c@ ^~~ c@ ttcp.c:385:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ mes(s) c@ ^~~ c@ ttcp.c:389:1: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ ttcp.c:391:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ pattern( cp, cnt ) c@ ^~~~~~~ c@ ttcp.c:401:1: warning: control reaches end of non-void function [-Wreturn-type] c@ } c@ ^ c@ ttcp.c:441:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] c@ #endif SYSV c@ ^ c@ // c@ ttcp.c:470:8: warning: implicitly declaring library function 'strncpy' with type 'char *(char *, const char *, unsigned long)' c@ (void)strncpy( str, line, len ); c@ ^ c@ ttcp.c:470:8: note: please include the header or explicitly provide a declaration for 'strncpy' c@ ttcp.c:516:28: warning: format specifies type 'int' but the argument has type 'time_t' (aka 'long') [-Wformat] c@ sprintf(outp,"%d.%01d", tdiff.tv_sec, tdiff.tv_usec/100000); c@ ~~ ^~~~~~~~~~~~ c@ %ld c@ ttcp.c:516:42: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ sprintf(outp,"%d.%01d", tdiff.tv_sec, tdiff.tv_usec/100000); c@ ~~~~ ^~~~~~~~~~~~~~~~~~~~ c@ %01ld c@ ttcp.c:522:28: warning: format specifies type 'int' but the argument has type 'time_t' (aka 'long') [-Wformat] c@ sprintf(outp,"%d.%01d", tdiff.tv_sec, tdiff.tv_usec/100000); c@ ~~ ^~~~~~~~~~~~ c@ %ld c@ ttcp.c:522:42: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ sprintf(outp,"%d.%01d", tdiff.tv_sec, tdiff.tv_usec/100000); c@ ~~~~ ^~~~~~~~~~~~~~~~~~~~ c@ %01ld c@ ttcp.c:544:23: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ sprintf(outp,"%d", t == 0 ? 0 : (r1->ru_ixrss-r0->ru_ixrss)/t); c@ ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c@ %ld c@ ttcp.c:549:23: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ sprintf(outp,"%d", t == 0 ? 0 : c@ ~~ ^~~~~~~~~~~~ c@ %ld c@ ttcp.c:555:23: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ sprintf(outp,"%d", t == 0 ? 0 : c@ ~~ ^~~~~~~~~~~~ c@ %ld c@ ttcp.c:562:23: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ sprintf(outp,"%d", r1->ru_maxrss/2); c@ ~~ ^~~~~~~~~~~~~~~ c@ %ld c@ ttcp.c:567:23: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ sprintf(outp,"%d", r1->ru_majflt-r0->ru_majflt); c@ ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~ c@ %ld c@ ttcp.c:572:23: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ sprintf(outp,"%d", r1->ru_minflt-r0->ru_minflt); c@ ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~ c@ %ld c@ ttcp.c:577:23: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ sprintf(outp,"%d", r1->ru_inblock-r0->ru_inblock); c@ ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c@ %ld c@ ttcp.c:582:23: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ sprintf(outp,"%d", r1->ru_oublock-r0->ru_oublock); c@ ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c@ %ld c@ ttcp.c:586:26: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ sprintf(outp,"%d+%d", r1->ru_nvcsw-r0->ru_nvcsw, c@ ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~ c@ %ld c@ ttcp.c:587:5: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] c@ r1->ru_nivcsw-r0->ru_nivcsw ); c@ ^~~~~~~~~~~~~~~~~~~~~~~~~~~ c@ ttcp.c:590:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] c@ #endif !SYSV c@ ^ c@ // c@ ttcp.c:645:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ Nread( fd, buf, count ) c@ ^~~~~ c@ ttcp.c:651:23: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'void *' [-Wint-conversion] c@ cnt = recvfrom( fd, buf, count, 0, &from, &len ); c@ ^~~ c@ /usr/include/sys/socket.h:646:29: note: passing argument to parameter here c@ ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict); c@ ^ c@ ttcp.c:651:38: warning: incompatible pointer types passing 'struct sockaddr_in *' to parameter of type 'struct sockaddr *' [-Wincompatible-pointer-types] c@ cnt = recvfrom( fd, buf, count, 0, &from, &len ); c@ ^~~~~ c@ /usr/include/sys/socket.h:646:72: note: passing argument to parameter here c@ ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict); c@ ^ c@ ttcp.c:651:45: warning: passing 'int *' to parameter of type 'socklen_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign] c@ cnt = recvfrom( fd, buf, count, 0, &from, &len ); c@ ^~~~ c@ /usr/include/sys/socket.h:646:96: note: passing argument to parameter here c@ ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict); c@ ^ c@ ttcp.c:655:10: warning: implicit declaration of function 'mread' is invalid in C99 [-Wimplicit-function-declaration] c@ cnt = mread( fd, buf, count ); /* fill buf */ c@ ^ c@ ttcp.c:667:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ Nwrite( fd, buf, count ) c@ ^~~~~~ c@ ttcp.c:672:21: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *' [-Wint-conversion] c@ cnt = sendto( fd, buf, count, 0, &sinhim, sizeof(sinhim) ); c@ ^~~ c@ /usr/include/sys/socket.h:649:33: note: passing argument to parameter here c@ ssize_t sendto(int, const void *, c@ ^ c@ ttcp.c:672:36: warning: incompatible pointer types passing 'struct sockaddr_in *' to parameter of type 'const struct sockaddr *' [-Wincompatible-pointer-types] c@ cnt = sendto( fd, buf, count, 0, &sinhim, sizeof(sinhim) ); c@ ^~~~~~~ c@ /usr/include/sys/socket.h:650:42: note: passing argument to parameter here c@ size_t, int, const struct sockaddr *, socklen_t); c@ ^ c@ ttcp.c:688:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] c@ delay(us) c@ ^~~~~ c@ ttcp.c:694:19: warning: incompatible pointer types passing 'char *' to parameter of type 'fd_set *' (aka 'struct fd_set *') [-Wincompatible-pointer-types] c@ (void)select( 1, (char *)0, (char *)0, (char *)0, &tv ); c@ ^~~~~~~~~ c@ /usr/include/sys/select.h:103:25: note: passing argument to parameter here c@ int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); c@ ^ c@ ttcp.c:694:30: warning: incompatible pointer types passing 'char *' to parameter of type 'fd_set *' (aka 'struct fd_set *') [-Wincompatible-pointer-types] c@ (void)select( 1, (char *)0, (char *)0, (char *)0, &tv ); c@ ^~~~~~~~~ c@ /usr/include/sys/select.h:103:35: note: passing argument to parameter here c@ int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); c@ ^ c@ ttcp.c:694:41: warning: incompatible pointer types passing 'char *' to parameter of type 'fd_set *' (aka 'struct fd_set *') [-Wincompatible-pointer-types] c@ (void)select( 1, (char *)0, (char *)0, (char *)0, &tv ); c@ ^~~~~~~~~ c@ /usr/include/sys/select.h:103:45: note: passing argument to parameter here c@ int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); c@ ^ c@ ttcp.c:32:13: warning: unused variable 'RCSid' [-Wunused-variable] c@ static char RCSid[] = "ttcp.c $Revision: 1.4 $"; c@ ^ c@ 63 warnings generated. Mostly useful. clang finds more problems than lint, but not all the ones found by lint. The output format is much worse, except occasionally its verboseness makes the problem obvious without you having to read the source files. Many more errors can be found using more compiler flags, but I think lint can find a few more using different flags too -- at least all of the undeclared functions, which should be fixed first. Bruce From owner-svn-src-all@FreeBSD.ORG Tue May 21 05:51:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9F27083F; Tue, 21 May 2013 05:51:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91555176; Tue, 21 May 2013 05:51:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4L5pnr8035935; Tue, 21 May 2013 05:51:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4L5pn3h035934; Tue, 21 May 2013 05:51:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305210551.r4L5pn3h035934@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 May 2013 05:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250841 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 05:51:49 -0000 Author: adrian Date: Tue May 21 05:51:49 2013 New Revision: 250841 URL: http://svnweb.freebsd.org/changeset/base/250841 Log: Extend the TXOP enforce capability to support checking whether it's supported. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue May 21 03:05:49 2013 (r250840) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue May 21 05:51:49 2013 (r250841) @@ -466,6 +466,10 @@ ar5416GetCapability(struct ath_hal *ah, case HAL_CAP_DIVERSITY: /* disable classic fast diversity */ return HAL_ENXIO; case HAL_CAP_ENFORCE_TXOP: + if (capability == 0) + return (HAL_OK); + if (capability != 1) + return (HAL_ENOTSUPP); (*result) = !! (AH5212(ah)->ah_miscMode & AR_PCU_TXOP_TBTT_LIMIT_ENA); return (HAL_OK); @@ -499,6 +503,8 @@ ar5416SetCapability(struct ath_hal *ah, pCap->halTxStreams = 1; return AH_TRUE; case HAL_CAP_ENFORCE_TXOP: + if (capability != 1) + return (HAL_ENOTSUPP); if (setting) { AH5212(ah)->ah_miscMode |= AR_PCU_TXOP_TBTT_LIMIT_ENA; From owner-svn-src-all@FreeBSD.ORG Tue May 21 06:01:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9AEBAB55; Tue, 21 May 2013 06:01:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB451D2; Tue, 21 May 2013 06:01:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4L61fG1039492; Tue, 21 May 2013 06:01:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4L61fwg039491; Tue, 21 May 2013 06:01:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305210601.r4L61fwg039491@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 May 2013 06:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250842 - stable/9/sys/dev/usb/wlan X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 06:01:41 -0000 Author: hselasky Date: Tue May 21 06:01:41 2013 New Revision: 250842 URL: http://svnweb.freebsd.org/changeset/base/250842 Log: MFC r248566: Add new USB ID. PR: usb/177173 Modified: stable/9/sys/dev/usb/wlan/if_rum.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_rum.c Tue May 21 05:51:49 2013 (r250841) +++ stable/9/sys/dev/usb/wlan/if_rum.c Tue May 21 06:01:41 2013 (r250842) @@ -120,6 +120,7 @@ static const STRUCT_USB_HOST_ID rum_devs RUM_DEV(HUAWEI3COM, WUB320G), RUM_DEV(MELCO, G54HP), RUM_DEV(MELCO, SG54HP), + RUM_DEV(MELCO, SG54HG), RUM_DEV(MELCO, WLIUCG), RUM_DEV(MELCO, WLRUCG), RUM_DEV(MELCO, WLRUCGAOSS), From owner-svn-src-all@FreeBSD.ORG Tue May 21 06:03:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 35067CD0; Tue, 21 May 2013 06:03:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26D5A1DF; Tue, 21 May 2013 06:03:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4L63Wlv039964; Tue, 21 May 2013 06:03:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4L63WcQ039963; Tue, 21 May 2013 06:03:32 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305210603.r4L63WcQ039963@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 May 2013 06:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250843 - stable/8/sys/dev/usb/wlan X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 06:03:33 -0000 Author: hselasky Date: Tue May 21 06:03:32 2013 New Revision: 250843 URL: http://svnweb.freebsd.org/changeset/base/250843 Log: Add new USB ID. PR: usb/177173 Modified: stable/8/sys/dev/usb/wlan/if_rum.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Tue May 21 06:01:41 2013 (r250842) +++ stable/8/sys/dev/usb/wlan/if_rum.c Tue May 21 06:03:32 2013 (r250843) @@ -120,6 +120,7 @@ static const STRUCT_USB_HOST_ID rum_devs RUM_DEV(HUAWEI3COM, WUB320G), RUM_DEV(MELCO, G54HP), RUM_DEV(MELCO, SG54HP), + RUM_DEV(MELCO, SG54HG), RUM_DEV(MELCO, WLIUCG), RUM_DEV(MELCO, WLRUCG), RUM_DEV(MELCO, WLRUCGAOSS), From owner-svn-src-all@FreeBSD.ORG Tue May 21 06:06:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CFB05E52; Tue, 21 May 2013 06:06:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C09E51F3; Tue, 21 May 2013 06:06:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4L66GgR040619; Tue, 21 May 2013 06:06:16 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4L66GuA040617; Tue, 21 May 2013 06:06:16 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305210606.r4L66GuA040617@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 May 2013 06:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250844 - in stable/8/sys/dev/usb: . serial X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 06:06:16 -0000 Author: hselasky Date: Tue May 21 06:06:16 2013 New Revision: 250844 URL: http://svnweb.freebsd.org/changeset/base/250844 Log: MFC r248499: Add new USB ID. PR: usb/177105 Modified: stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Tue May 21 06:03:32 2013 (r250843) +++ stable/8/sys/dev/usb/serial/u3g.c Tue May 21 06:06:16 2013 (r250844) @@ -238,6 +238,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(DELL, U5730_2, 0), U3G_DEV(DELL, U5730_3, 0), U3G_DEV(DELL, U740, 0), + U3G_DEV(DLINK, DWR510_CD, U3GINIT_SCSIEJECT), + U3G_DEV(DLINK, DWR510, 0), U3G_DEV(DLINK3, DWM652, 0), U3G_DEV(HP, EV2200, 0), U3G_DEV(HP, HS2300, 0), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Tue May 21 06:03:32 2013 (r250843) +++ stable/8/sys/dev/usb/usbdevs Tue May 21 06:06:16 2013 (r250844) @@ -1510,6 +1510,8 @@ product DLINK DSB650TX3 0x400b 10/100 E product DLINK DSB650TX2 0x4102 10/100 Ethernet product DLINK DSB650 0xabc1 10/100 Ethernet product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub +product DLINK DWR510_CD 0xa805 DWR-510 CD-ROM Mode +product DLINK DWR510 0x7e12 DWR-510 product DLINK2 DWA120 0x3a0c DWA-120 product DLINK2 DWA120_NF 0x3a0d DWA-120 (no firmware) product DLINK2 DWLG122C1 0x3c03 DWL-G122 c1 From owner-svn-src-all@FreeBSD.ORG Tue May 21 06:06:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6674EDD; Tue, 21 May 2013 06:06:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5896C202; Tue, 21 May 2013 06:06:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4L66rs3040779; Tue, 21 May 2013 06:06:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4L66rrm040777; Tue, 21 May 2013 06:06:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305210606.r4L66rrm040777@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 May 2013 06:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250845 - in stable/9/sys/dev/usb: . serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 06:06:53 -0000 Author: hselasky Date: Tue May 21 06:06:52 2013 New Revision: 250845 URL: http://svnweb.freebsd.org/changeset/base/250845 Log: MFC r248499: Add new USB ID. PR: usb/177105 Modified: stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Tue May 21 06:06:16 2013 (r250844) +++ stable/9/sys/dev/usb/serial/u3g.c Tue May 21 06:06:52 2013 (r250845) @@ -242,6 +242,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(DELL, U5730_2, 0), U3G_DEV(DELL, U5730_3, 0), U3G_DEV(DELL, U740, 0), + U3G_DEV(DLINK, DWR510_CD, U3GINIT_SCSIEJECT), + U3G_DEV(DLINK, DWR510, 0), U3G_DEV(DLINK3, DWM652, 0), U3G_DEV(HP, EV2200, 0), U3G_DEV(HP, HS2300, 0), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Tue May 21 06:06:16 2013 (r250844) +++ stable/9/sys/dev/usb/usbdevs Tue May 21 06:06:52 2013 (r250845) @@ -1509,6 +1509,8 @@ product DLINK DSB650TX3 0x400b 10/100 E product DLINK DSB650TX2 0x4102 10/100 Ethernet product DLINK DSB650 0xabc1 10/100 Ethernet product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub +product DLINK DWR510_CD 0xa805 DWR-510 CD-ROM Mode +product DLINK DWR510 0x7e12 DWR-510 product DLINK2 DWA120 0x3a0c DWA-120 product DLINK2 DWA120_NF 0x3a0d DWA-120 (no firmware) product DLINK2 DWLG122C1 0x3c03 DWL-G122 c1 From owner-svn-src-all@FreeBSD.ORG Tue May 21 06:09:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2ED79258; Tue, 21 May 2013 06:09:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1F505211; Tue, 21 May 2013 06:09:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4L69KN1041362; Tue, 21 May 2013 06:09:20 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4L69JWr041360; Tue, 21 May 2013 06:09:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305210609.r4L69JWr041360@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 May 2013 06:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250846 - in stable/8/sys/dev/usb: . wlan X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 06:09:20 -0000 Author: hselasky Date: Tue May 21 06:09:19 2013 New Revision: 250846 URL: http://svnweb.freebsd.org/changeset/base/250846 Log: MFC r248458: Add new USB ID. PR: usb/177013 Modified: stable/8/sys/dev/usb/usbdevs stable/8/sys/dev/usb/wlan/if_run.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Tue May 21 06:06:52 2013 (r250845) +++ stable/8/sys/dev/usb/usbdevs Tue May 21 06:09:19 2013 (r250846) @@ -2493,6 +2493,7 @@ product LOGITEC RT2870_2 0x0163 RT2870 product LOGITEC RT2870_3 0x0164 RT2870 product LOGITEC LANW300NU2 0x0166 LAN-W300N/U2 product LOGITEC LANW150NU2 0x0168 LAN-W150N/U2 +product LOGITEC LANW300NU2S 0x0169 LAN-W300N/U2S /* Longcheer Holdings, Ltd. products */ product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA Modified: stable/8/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_run.c Tue May 21 06:06:52 2013 (r250845) +++ stable/8/sys/dev/usb/wlan/if_run.c Tue May 21 06:09:19 2013 (r250846) @@ -209,6 +209,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(LOGITEC, RT2870_2), RUN_DEV(LOGITEC, RT2870_3), RUN_DEV(LOGITEC, LANW300NU2), + RUN_DEV(LOGITEC, LANW300NU2S), RUN_DEV(MELCO, RT2870_1), RUN_DEV(MELCO, RT2870_2), RUN_DEV(MELCO, WLIUCAG300N), From owner-svn-src-all@FreeBSD.ORG Tue May 21 06:10:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 619A54C3; Tue, 21 May 2013 06:10:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 546AD22B; Tue, 21 May 2013 06:10:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4L6AR7J041906; Tue, 21 May 2013 06:10:27 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4L6AQGC041903; Tue, 21 May 2013 06:10:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305210610.r4L6AQGC041903@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 May 2013 06:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250847 - in stable/9/sys/dev/usb: . wlan X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 06:10:27 -0000 Author: hselasky Date: Tue May 21 06:10:26 2013 New Revision: 250847 URL: http://svnweb.freebsd.org/changeset/base/250847 Log: MFC r248458: Add new USB ID. PR: usb/177013 Modified: stable/9/sys/dev/usb/usbdevs stable/9/sys/dev/usb/wlan/if_run.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Tue May 21 06:09:19 2013 (r250846) +++ stable/9/sys/dev/usb/usbdevs Tue May 21 06:10:26 2013 (r250847) @@ -2491,6 +2491,7 @@ product LOGITEC RT2870_2 0x0163 RT2870 product LOGITEC RT2870_3 0x0164 RT2870 product LOGITEC LANW300NU2 0x0166 LAN-W300N/U2 product LOGITEC LANW150NU2 0x0168 LAN-W150N/U2 +product LOGITEC LANW300NU2S 0x0169 LAN-W300N/U2S /* Longcheer Holdings, Ltd. products */ product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA Modified: stable/9/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_run.c Tue May 21 06:09:19 2013 (r250846) +++ stable/9/sys/dev/usb/wlan/if_run.c Tue May 21 06:10:26 2013 (r250847) @@ -211,6 +211,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(LOGITEC, RT2870_3), RUN_DEV(LOGITEC, LANW300NU2), RUN_DEV(LOGITEC, LANW150NU2), + RUN_DEV(LOGITEC, LANW300NU2S), RUN_DEV(MELCO, RT2870_1), RUN_DEV(MELCO, RT2870_2), RUN_DEV(MELCO, WLIUCAG300N), From owner-svn-src-all@FreeBSD.ORG Tue May 21 06:10:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id D0B3162F; Tue, 21 May 2013 06:10:51 +0000 (UTC) Date: Tue, 21 May 2013 06:10:51 +0000 From: Alexey Dokuchaev To: Warner Losh Subject: Re: svn commit: r247086 - head/sys/x86/isa Message-ID: <20130521061051.GA51568@FreeBSD.org> References: <201302210638.r1L6cOVx006678@svn.freebsd.org> <20130221064912.GA20360@FreeBSD.org> <20130520022100.GA82181@FreeBSD.org> <73F6A8D9-3366-47AB-9DE9-E570006E3A3F@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73F6A8D9-3366-47AB-9DE9-E570006E3A3F@bsdimp.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 06:10:51 -0000 On Mon, May 20, 2013 at 07:20:48AM -0600, Warner Losh wrote: > On May 19, 2013, at 8:21 PM, Alexey Dokuchaev wrote: > > Apparently not: I've been running FreeBSD 8.4-PRERELEASE without pmtimer > > for a while, and noticed that my laptop stops keeping time during suspend. > > I've never noticed that behavior before (presumably, with pmtimer). > > > > I will soon rebuild the kernel and put pmtimer back to see it fixes time > > keeping for me. If it will, apparently it is still useful for i386, and > > not just for APM, but ACPI as well... > > It fights ACPI in what it does... It was needed for APM... Let me know how > it turns out... Just rebuilt vanilla r250824; timekeeping works fine (with pmtimer now). My kernel config and loader.conf for reference: http://193.124.210.26/{DARIA,loader.conf} ./danfe From owner-svn-src-all@FreeBSD.ORG Tue May 21 06:13:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D8CAC891; Tue, 21 May 2013 06:13:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA240240; Tue, 21 May 2013 06:13:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4L6DcaO044176; Tue, 21 May 2013 06:13:38 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4L6DcRF044173; Tue, 21 May 2013 06:13:38 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305210613.r4L6DcRF044173@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 May 2013 06:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250848 - in head/sys/dev/usb: . quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 06:13:38 -0000 Author: hselasky Date: Tue May 21 06:13:38 2013 New Revision: 250848 URL: http://svnweb.freebsd.org/changeset/base/250848 Log: Add new USB quirk. MFC after: 1 week PR: usb/178771 Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Tue May 21 06:10:26 2013 (r250847) +++ head/sys/dev/usb/quirk/usb_quirk.c Tue May 21 06:13:38 2013 (r250848) @@ -427,6 +427,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY_EVPD, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(WESTERN, MYPASSWORD, 0x0000, 0xffff, UQ_MSC_FORCE_SHORT_INQ), + USB_QUIRK(WESTERN, MYPASSPORT, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(WINMAXGROUP, FLASH64MC, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(YANO, FW800HD, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue May 21 06:10:26 2013 (r250847) +++ head/sys/dev/usb/usbdevs Tue May 21 06:13:38 2013 (r250848) @@ -4219,6 +4219,7 @@ product WESTERN EXTHDD 0x0400 External product WESTERN HUB 0x0500 USB HUB product WESTERN MYBOOK 0x0901 MyBook External HDD product WESTERN MYPASSWORD 0x0704 MyPassword External HDD +product WESTERN MYPASSPORT 0x0748 MyPassport External HDD /* WeTelecom products */ product WETELECOM WM_D200 0x6801 WM-D200 From owner-svn-src-all@FreeBSD.ORG Tue May 21 09:18:51 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 37A631F3; Tue, 21 May 2013 09:18:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id CAA2D179; Tue, 21 May 2013 09:18:50 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 4C0CD121705; Tue, 21 May 2013 19:18:48 +1000 (EST) Date: Tue, 21 May 2013 19:18:46 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexey Dokuchaev Subject: Re: svn commit: r247086 - head/sys/x86/isa In-Reply-To: <20130521061051.GA51568@FreeBSD.org> Message-ID: <20130521172744.U1667@besplex.bde.org> References: <201302210638.r1L6cOVx006678@svn.freebsd.org> <20130221064912.GA20360@FreeBSD.org> <20130520022100.GA82181@FreeBSD.org> <73F6A8D9-3366-47AB-9DE9-E570006E3A3F@bsdimp.com> <20130521061051.GA51568@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=BPvrNysG c=1 sm=1 a=veOrmfVdeEAA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=P-gUh28lWcoA:10 a=z3FYMwRjAAAA:8 a=TB0Zl0TkxG4NnGQe0RUA:9 a=CjuIK1q_8ugA:10 a=gJBkaRRBgjcA:10 a=jujCPBD-nosA:10 a=KnEk7YGZndkA:10 a=qiWi7Edwir4A:10 a=NWVoK91CQyQA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Warner Losh , Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 09:18:51 -0000 On Tue, 21 May 2013, Alexey Dokuchaev wrote: > On Mon, May 20, 2013 at 07:20:48AM -0600, Warner Losh wrote: >> On May 19, 2013, at 8:21 PM, Alexey Dokuchaev wrote: >>> Apparently not: I've been running FreeBSD 8.4-PRERELEASE without pmtimer >>> for a while, and noticed that my laptop stops keeping time during suspend. >>> I've never noticed that behavior before (presumably, with pmtimer). >>> >>> I will soon rebuild the kernel and put pmtimer back to see it fixes time >>> keeping for me. If it will, apparently it is still useful for i386, and >>> not just for APM, but ACPI as well... >> >> It fights ACPI in what it does... It was needed for APM... Let me know how >> it turns out... > > Just rebuilt vanilla r250824; timekeeping works fine (with pmtimer now). My > kernel config and loader.conf for reference: > > http://193.124.210.26/{DARIA,loader.conf} In theory, acpi should handle this, but I've never been able to find where acpi either reads an acpi clock that gives the time or sets the time to the current time on resume after reading it from some other clock. Now I just found acpi_resync_clock() in dev/acpica/acpi.c. This if under an amd64 ifdef, so it can't work for i386, and its quality is much lower than that of pmtimer's already low quality (PS: actually it is equally low in a different way): @ static void @ acpi_resync_clock(struct acpi_softc *sc) @ { @ #ifdef __amd64__ @ if (!acpi_reset_clock) @ return; Since the code has not been tested (according to the comment on the sysctl), there is a sysctl to clear this variable to turn it off. The variable defaults to on. @ @ /* @ * Warm up timecounter again and reset system clock. @ */ @ (void)timecounter->tc_get_timecount(timecounter); @ (void)timecounter->tc_get_timecount(timecounter); @ inittodr(time_second + sc->acpi_sleep_delay); @ #endif @ } The parameter to the inittodr() is confusing and not much better than garbage. I think time_second is normally the time at which the system was suspended. sc->acpi_sleep_delay is just a short delay (default 1 second) and we add it to compensate for resume sleeping for that long. So the arg is usually much earlier than the current time. inittodr() only using it when reading the time from a hardware clock (always the RTC on x86?) fails; then inittodr() sets the time to that value. Here it might as well do nothing, since the time is already set to the old value (not quite, since setting the time also syncs with the hardware timecounter). Locking for inittodr() is broken (almost nonexistent), but that is not this code's problem. So the result of the above should be that the time is set to that of the RTC on x86. pmtimer is (PS: was) much more careful than this. On resume, it adjusts the time by the amount that the RTC time differed from the system time at the time of the suspend. This handles all drift between the clocks that occured before the suspend. There can be a further significantly large drift during long sleeps. Also, inittodr() is buggy, at least for the x86 RTC version -- it adds an error of up to 1 second by not syncing with the RTC seconds rollover. The last bug is fixed in my version (my inittodr() busy-waits for the rollover, but I have a better method in rtcintr() that reduces the error to < 10 usec plus the drift less the average drift. I only use the rtcintr() fixup after pseudo- suspensions by ddb)). @ static struct timeval suspend_time; @ static struct timeval diff_time; @ @ static int @ pmtimer_suspend(device_t dev) @ { @ @ microtime(&diff_time); @ inittodr(0); This inittodr(0) is a hack to read the RTC. Originally there was no API for this, but now CLOCK_GETTIME() is correct, at least if you can find the relevant clock. pmtimer can probablu assume the RTC, but acpi can't. This clobbers the current time, but we don't care since we are going to sleep. @ microtime(&suspend_time); This reads the current (clobbered) current time. This completes the hack for reading the RTC. @ timevalsub(&diff_time, &suspend_time); The fixup to add later. The RTC only has seconds granularity, but other clocks moght have more. microtime() gives us microseconds granularity but only seconds accuracy for the RTC due to the granularity in inittodr(). Locking is missing for all of this, and now it is not just inittodr()'s fault. The error of up to ~1 second may be increased by races, but not by another 1 second (unless the races in inittodr() gave a corrupt value), so we don't care. This last pretended to do locking in FreeBSD-4. splsoftclock() was used. This didn't actually work, since splhigh() was needed. When spl became null, the splsoftclock() was left as a reminder to fix the locking, but someone removed it without fixing the locking :-(. Intermediate versions with everything Giant locked had a better chance of working than even the ones mis-locked by splsoftclock(). @ return (0); @ } @ @ static int @ pmtimer_resume(device_t dev) @ { @ u_int second, minute, hour; @ struct timeval resume_time, tmp_time; @ @ /* modified for adjkerntz */ The comment is cryptic. I think it means that the fixup is much more necessary than might first appear, since adjkerntz can adjust the RTC by an hour or so for DST changes. The current time must not be changed in this case, but without a fixup that takes into account the RTC adjustment before the suspend, the error might be a full hour or so. This might depend on how smart inittodr() is. It will need to add an an even larger adjustment if the RTC is not on UTC. The DST adjustment should be folded into this, so perhaps the comment no longer applies. @ timer_restore(); /* restore the all timers */ @ inittodr(0); /* adjust time to RTC */ This gives the current RTC time, hopefully adjusted to UTC including DST. @ microtime(&resume_time); @ getmicrotime(&tmp_time); @ timevaladd(&tmp_time, &diff_time); Adjust, with the usual races. @ @ #ifdef FIXME @ /* XXX THIS DOESN'T WORK!!! */ @ time = tmp_time; @ #endif Bah, the adjustment isn't even applied. This rotted with timecounters even before FreeBSD-4. The current time used to be the simple variable 'time', but timecounters added lots of state to set. Timecounters also added the tc_setclock() API to set it. This should be used here. It is racy, but inittodr() has already just used it. @ @ #ifdef PMTIMER_FIXUP_CALLTODO @ /* Calculate the delta time suspended */ @ timevalsub(&resume_time, &suspend_time); @ /* Fixup the calltodo list with the delta time. */ @ adjust_timeout_calltodo(&resume_time); @ /* @ * We've already calculated resume_time to be the delta between @ * the suspend and the resume. @ */ @ second = resume_time.tv_sec; @ #else /* !PMTIMER_FIXUP_CALLTODO */ @ second = resume_time.tv_sec - suspend_time.tv_sec; @ #endif /* PMTIMER_FIXUP_CALLTODO */ The PMTIMER_FIXUP_CALLTODO garbage is purer. It stopped working before it was committed. @ hour = second / 3600; @ second %= 3600; @ minute = second / 60; @ second %= 60; @ log(LOG_NOTICE, "wakeup from sleeping state (slept %02d:%02d:%02d)\n", @ hour, minute, second); @ return (0); @ } So it seems that pmtimer has a lot of dead code and reduces to not much more than an inittodr(0) and usually acts like the inittodr(!0) in the acpi amd64 resume code. acpi amd64 resume also seems to be missing the verbose logging of the suspension time, but maybe acpi utilities give that. Bruce From owner-svn-src-all@FreeBSD.ORG Tue May 21 11:04:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E6897DCB; Tue, 21 May 2013 11:04:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D8BEE8D7; Tue, 21 May 2013 11:04:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LB40Ww046301; Tue, 21 May 2013 11:04:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LB40FW046300; Tue, 21 May 2013 11:04:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305211104.r4LB40FW046300@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 21 May 2013 11:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250849 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 11:04:01 -0000 Author: kib Date: Tue May 21 11:04:00 2013 New Revision: 250849 URL: http://svnweb.freebsd.org/changeset/base/250849 Log: Add ddb command 'show pginfo' which provides useful information about a vm page, denoted either by an address of the struct vm_page, or, if the '/p' modifier is specified, by a physical address of the corresponding frame. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue May 21 06:13:38 2013 (r250848) +++ head/sys/vm/vm_page.c Tue May 21 11:04:00 2013 (r250849) @@ -2884,4 +2884,27 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pag *vm_pagequeues[PQ_ACTIVE].pq_cnt, *vm_pagequeues[PQ_INACTIVE].pq_cnt); } + +DB_SHOW_COMMAND(pginfo, vm_page_print_pginfo) +{ + vm_page_t m; + boolean_t phys; + + if (!have_addr) { + db_printf("show pginfo addr\n"); + return; + } + + phys = strchr(modif, 'p') != NULL; + if (phys) + m = PHYS_TO_VM_PAGE(addr); + else + m = (vm_page_t)addr; + db_printf( + "page %p obj %p pidx 0x%jx phys 0x%jx q %d hold %d wire %d\n" + " af 0x%x of 0x%x f 0x%x act %d busy %d valid 0x%x dirty 0x%x\n", + m, m->object, (uintmax_t)m->pindex, (uintmax_t)m->phys_addr, + m->queue, m->hold_count, m->wire_count, m->aflags, m->oflags, + m->flags, m->act_count, m->busy, m->valid, m->dirty); +} #endif /* DDB */ From owner-svn-src-all@FreeBSD.ORG Tue May 21 11:07:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 87DC6F84; Tue, 21 May 2013 11:07:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 79ACF8F7; Tue, 21 May 2013 11:07:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LB7ClO047040; Tue, 21 May 2013 11:07:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LB7Cdt047039; Tue, 21 May 2013 11:07:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305211107.r4LB7Cdt047039@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 21 May 2013 11:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250850 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 11:07:12 -0000 Author: kib Date: Tue May 21 11:07:12 2013 New Revision: 250850 URL: http://svnweb.freebsd.org/changeset/base/250850 Log: Add amd64-specific ddb command 'show phys2dmap', which calculates the address in the direct map corresponding to the given physical address. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue May 21 11:04:00 2013 (r250849) +++ head/sys/amd64/amd64/pmap.c Tue May 21 11:07:12 2013 (r250850) @@ -5535,4 +5535,16 @@ DB_SHOW_COMMAND(pte, pmap_print_pte) pte = pmap_pde_to_pte(pde, va); db_printf(" pte %#016lx\n", *pte); } + +DB_SHOW_COMMAND(phys2dmap, pmap_phys2dmap) +{ + vm_paddr_t a; + + if (have_addr) { + a = (vm_paddr_t)addr; + db_printf("0x%jx\n", (uintmax_t)PHYS_TO_DMAP(a)); + } else { + db_printf("show phys2dmap addr\n"); + } +} #endif From owner-svn-src-all@FreeBSD.ORG Tue May 21 11:24:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5AD39339; Tue, 21 May 2013 11:24:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C523989; Tue, 21 May 2013 11:24:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LBOX2D053576; Tue, 21 May 2013 11:24:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LBOWlY053572; Tue, 21 May 2013 11:24:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305211124.r4LBOWlY053572@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 21 May 2013 11:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250851 - in head/sys/amd64: amd64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 11:24:33 -0000 Author: kib Date: Tue May 21 11:24:32 2013 New Revision: 250851 URL: http://svnweb.freebsd.org/changeset/base/250851 Log: Fix the hardware watchpoints on SMP amd64. Load the updated %dr registers also on other CPUs, besides the CPU which happens to execute the ddb. The debugging registers are stored in the pcpu area, together with the command which is executed by the IPI stop handler upon resume. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/db_trace.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/md_var.h head/sys/amd64/include/pcpu.h Modified: head/sys/amd64/amd64/db_trace.c ============================================================================== --- head/sys/amd64/amd64/db_trace.c Tue May 21 11:07:12 2013 (r250850) +++ head/sys/amd64/amd64/db_trace.c Tue May 21 11:24:32 2013 (r250851) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -63,6 +64,8 @@ static db_varfcn_t db_frame; static db_varfcn_t db_rsp; static db_varfcn_t db_ss; +CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); + /* * Machine register set. */ @@ -591,64 +594,82 @@ db_md_set_watchpoint(addr, size) db_expr_t addr; db_expr_t size; { - struct dbreg d; - int avail, i, wsize; + struct dbreg *d; + struct pcpu *pc; + int avail, c, cpu, i, wsize; - fill_dbregs(NULL, &d); + d = (struct dbreg *)PCPU_PTR(dbreg); + cpu = PCPU_GET(cpuid); + fill_dbregs(NULL, d); avail = 0; - for(i = 0; i < 4; i++) { - if (!DBREG_DR7_ENABLED(d.dr[7], i)) + for (i = 0; i < 4; i++) { + if (!DBREG_DR7_ENABLED(d->dr[7], i)) avail++; } if (avail * 8 < size) return (-1); - for (i = 0; i < 4 && (size > 0); i++) { - if (!DBREG_DR7_ENABLED(d.dr[7], i)) { + for (i = 0; i < 4 && size > 0; i++) { + if (!DBREG_DR7_ENABLED(d->dr[7], i)) { if (size >= 8 || (avail == 1 && size > 4)) wsize = 8; else if (size > 2) wsize = 4; else wsize = size; - amd64_set_watch(i, addr, wsize, - DBREG_DR7_WRONLY, &d); + amd64_set_watch(i, addr, wsize, DBREG_DR7_WRONLY, d); addr += wsize; size -= wsize; avail--; } } - set_dbregs(NULL, &d); + set_dbregs(NULL, d); + CPU_FOREACH(c) { + if (c == cpu) + continue; + pc = pcpu_find(c); + memcpy(pc->pc_dbreg, d, sizeof(*d)); + pc->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; + } - return(0); + return (0); } - int db_md_clr_watchpoint(addr, size) db_expr_t addr; db_expr_t size; { - struct dbreg d; - int i; + struct dbreg *d; + struct pcpu *pc; + int i, c, cpu; - fill_dbregs(NULL, &d); + d = (struct dbreg *)PCPU_PTR(dbreg); + cpu = PCPU_GET(cpuid); + fill_dbregs(NULL, d); - for(i = 0; i < 4; i++) { - if (DBREG_DR7_ENABLED(d.dr[7], i)) { - if ((DBREG_DRX((&d), i) >= addr) && - (DBREG_DRX((&d), i) < addr+size)) - amd64_clr_watch(i, &d); + for (i = 0; i < 4; i++) { + if (DBREG_DR7_ENABLED(d->dr[7], i)) { + if (DBREG_DRX((d), i) >= addr && + DBREG_DRX((d), i) < addr + size) + amd64_clr_watch(i, d); } } - set_dbregs(NULL, &d); + set_dbregs(NULL, d); + CPU_FOREACH(c) { + if (c == cpu) + continue; + pc = pcpu_find(c); + memcpy(pc->pc_dbreg, d, sizeof(*d)); + pc->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; + } - return(0); + return (0); } @@ -699,3 +720,17 @@ db_md_list_watchpoints() } db_printf("\n"); } + +void +amd64_db_resume_dbreg(void) +{ + struct dbreg *d; + + switch (PCPU_GET(dbreg_cmd)) { + case PC_DBREG_CMD_LOAD: + d = (struct dbreg *)PCPU_PTR(dbreg); + set_dbregs(NULL, d); + PCPU_SET(dbreg_cmd, PC_DBREG_CMD_NONE); + break; + } +} Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Tue May 21 11:07:12 2013 (r250850) +++ head/sys/amd64/amd64/mp_machdep.c Tue May 21 11:24:32 2013 (r250851) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" +#include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_sched.h" #include "opt_smp.h" @@ -1396,6 +1397,10 @@ cpustop_handler(void) CPU_CLR_ATOMIC(cpu, &started_cpus); CPU_CLR_ATOMIC(cpu, &stopped_cpus); +#ifdef DDB + amd64_db_resume_dbreg(); +#endif + if (cpu == 0 && cpustop_restartfunc != NULL) { cpustop_restartfunc(); cpustop_restartfunc = NULL; Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Tue May 21 11:07:12 2013 (r250850) +++ head/sys/amd64/include/md_var.h Tue May 21 11:24:32 2013 (r250851) @@ -117,5 +117,6 @@ void minidumpsys(struct dumperinfo *); struct savefpu *get_pcb_user_save_td(struct thread *td); struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb); struct pcb *get_pcb_td(struct thread *td); +void amd64_db_resume_dbreg(void); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Tue May 21 11:07:12 2013 (r250850) +++ head/sys/amd64/include/pcpu.h Tue May 21 11:24:32 2013 (r250851) @@ -78,9 +78,14 @@ struct system_segment_descriptor *pc_tss; \ u_int pc_cmci_mask /* MCx banks for CMCI */ \ PCPU_XEN_FIELDS; \ - char __pad[293] /* be divisor of PAGE_SIZE \ + uint64_t pc_dbreg[16]; /* ddb debugging regs */ \ + int pc_dbreg_cmd; /* ddb debugging reg cmd */ \ + char __pad[161] /* be divisor of PAGE_SIZE \ after cache alignment */ +#define PC_DBREG_CMD_NONE 0 +#define PC_DBREG_CMD_LOAD 1 + #ifdef _KERNEL #ifdef lint From owner-svn-src-all@FreeBSD.ORG Tue May 21 11:31:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2366B5B7; Tue, 21 May 2013 11:31:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15F339CA; Tue, 21 May 2013 11:31:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LBVu99056491; Tue, 21 May 2013 11:31:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LBVu9x056490; Tue, 21 May 2013 11:31:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305211131.r4LBVu9x056490@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 21 May 2013 11:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250852 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 11:31:57 -0000 Author: kib Date: Tue May 21 11:31:56 2013 New Revision: 250852 URL: http://svnweb.freebsd.org/changeset/base/250852 Log: Do not leak the NULLV_NOUNLOCK flag from the nullfs_unlink_lowervp(), for the case when the nullfs vnode is not reclaimed. Otherwise, later reclamation would not unlock the lower vnode. Reported by: antoine Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nullfs/null_vfsops.c Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Tue May 21 11:24:32 2013 (r250851) +++ head/sys/fs/nullfs/null_vfsops.c Tue May 21 11:31:56 2013 (r250852) @@ -409,16 +409,28 @@ nullfs_unlink_lowervp(struct mount *mp, vhold(vp); vunref(vp); - /* - * If vunref() dropped the last use reference on the nullfs - * vnode, it must be reclaimed, and its lock was split from - * the lower vnode lock. Need to do extra unlock before - * allowing the final vdrop() to free the vnode. - */ if (vp->v_usecount == 0) { + /* + * If vunref() dropped the last use reference on the + * nullfs vnode, it must be reclaimed, and its lock + * was split from the lower vnode lock. Need to do + * extra unlock before allowing the final vdrop() to + * free the vnode. + */ KASSERT((vp->v_iflag & VI_DOOMED) != 0, - ("not reclaimed %p", vp)); + ("not reclaimed nullfs vnode %p", vp)); VOP_UNLOCK(vp, 0); + } else { + /* + * Otherwise, the nullfs vnode still shares the lock + * with the lower vnode, and must not be unlocked. + * Also clear the NULLV_NOUNLOCK, the flag is not + * relevant for future reclamations. + */ + ASSERT_VOP_ELOCKED(vp, "unlink_lowervp"); + KASSERT((vp->v_iflag & VI_DOOMED) == 0, + ("reclaimed nullfs vnode %p", vp)); + xp->null_flags &= ~NULLV_NOUNLOCK; } vdrop(vp); } From owner-svn-src-all@FreeBSD.ORG Tue May 21 11:40:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3CE9DAC4; Tue, 21 May 2013 11:40:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DFE1A21; Tue, 21 May 2013 11:40:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LBeHla059774; Tue, 21 May 2013 11:40:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LBeGSi059770; Tue, 21 May 2013 11:40:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305211140.r4LBeGSi059770@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 21 May 2013 11:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250853 - in head/sys: compat/freebsd32 kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 11:40:17 -0000 Author: kib Date: Tue May 21 11:40:16 2013 New Revision: 250853 URL: http://svnweb.freebsd.org/changeset/base/250853 Log: Fix the wait6(2) on 32bit architectures and for the compat32, by using the right type for the argument in syscalls.master. Also fix the posix_fallocate(2) and posix_fadvise(2) compat32 syscalls on the architectures which require padding of the 64bit argument. Noted and reviewed by: jhb Pointy hat to: kib MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue May 21 11:31:56 2013 (r250852) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue May 21 11:40:16 2013 (r250853) @@ -198,8 +198,8 @@ freebsd32_wait6(struct thread *td, struc bzero(sip, sizeof(*sip)); } else sip = NULL; - error = kern_wait6(td, uap->idtype, uap->id, &status, uap->options, - wrup, sip); + error = kern_wait6(td, uap->idtype, PAIR32TO64(id_t, uap->id), + &status, uap->options, wrup, sip); if (error != 0) return (error); if (uap->status != NULL) Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Tue May 21 11:31:56 2013 (r250852) +++ head/sys/compat/freebsd32/syscalls.master Tue May 21 11:40:16 2013 (r250853) @@ -994,6 +994,22 @@ 529 AUE_NULL NOPROTO { int rctl_remove_rule(const void *inbufp, \ size_t inbuflen, void *outbufp, \ size_t outbuflen); } +#ifdef PAD64_REQUIRED +530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd, \ + int pad, \ + uint32_t offset1, uint32_t offset2,\ + uint32_t len1, uint32_t len2); } +531 AUE_NULL STD { int freebsd32_posix_fadvise(int fd, \ + int pad, \ + uint32_t offset1, uint32_t offset2,\ + uint32_t len1, uint32_t len2, \ + int advice); } +532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, int pad, \ + uint32_t id1, uint32_t id2, \ + int *status, int options, \ + struct wrusage32 *wrusage, \ + siginfo_t *info); } +#else 530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd,\ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2); } @@ -1001,11 +1017,12 @@ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2, \ int advice); } -532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, int id, \ +532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, \ + uint32_t id1, uint32_t id2, \ int *status, int options, \ struct wrusage32 *wrusage, \ siginfo_t *info); } - +#endif 533 AUE_CAP_RIGHTS_LIMIT NOPROTO { int cap_rights_limit(int fd, \ uint64_t rights); } 534 AUE_CAP_IOCTLS_LIMIT NOPROTO { int cap_ioctls_limit(int fd, \ Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Tue May 21 11:31:56 2013 (r250852) +++ head/sys/kern/syscalls.master Tue May 21 11:40:16 2013 (r250853) @@ -952,7 +952,7 @@ off_t offset, off_t len); } 531 AUE_NULL STD { int posix_fadvise(int fd, off_t offset, \ off_t len, int advice); } -532 AUE_WAIT6 STD { int wait6(int idtype, int id, \ +532 AUE_WAIT6 STD { int wait6(int idtype, id_t id, \ int *status, int options, \ struct __wrusage *wrusage, \ siginfo_t *info); } From owner-svn-src-all@FreeBSD.ORG Tue May 21 11:41:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CF779C43; Tue, 21 May 2013 11:41:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C0FFBA2E; Tue, 21 May 2013 11:41:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LBfALx060131; Tue, 21 May 2013 11:41:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LBf82R060120; Tue, 21 May 2013 11:41:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305211141.r4LBf82R060120@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 21 May 2013 11:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250854 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 11:41:10 -0000 Author: kib Date: Tue May 21 11:41:08 2013 New Revision: 250854 URL: http://svnweb.freebsd.org/changeset/base/250854 Log: Regenerate. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Tue May 21 11:40:16 2013 (r250853) +++ head/sys/compat/freebsd32/freebsd32_proto.h Tue May 21 11:41:08 2013 (r250854) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250853 2013-05-21 11:40:16Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -574,8 +574,10 @@ struct freebsd32_pselect_args { char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)]; char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; }; +#ifdef PAD64_REQUIRED struct freebsd32_posix_fallocate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; @@ -583,6 +585,7 @@ struct freebsd32_posix_fallocate_args { }; struct freebsd32_posix_fadvise_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; @@ -591,12 +594,40 @@ struct freebsd32_posix_fadvise_args { }; struct freebsd32_wait6_args { char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; - char id_l_[PADL_(int)]; int id; char id_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; char wrusage_r_[PADR_(struct wrusage32 *)]; char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; }; +#else +struct freebsd32_posix_fallocate_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; +}; +struct freebsd32_posix_fadvise_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; +}; +struct freebsd32_wait6_args { + char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; + char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; + char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; char wrusage_r_[PADR_(struct wrusage32 *)]; + char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; +}; +#endif #if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) #define PAD64_REQUIRED #endif @@ -706,9 +737,15 @@ int freebsd32_semctl(struct thread *, st int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *); int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); int freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); +#ifdef PAD64_REQUIRED int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); int freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); int freebsd32_wait6(struct thread *, struct freebsd32_wait6_args *); +#else +int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); +int freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); +int freebsd32_wait6(struct thread *, struct freebsd32_wait6_args *); +#endif #ifdef COMPAT_43 @@ -777,6 +814,9 @@ struct ofreebsd32_getdirentries_args { #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int ofreebsd32_lseek(struct thread *, struct ofreebsd32_lseek_args *); int ofreebsd32_stat(struct thread *, struct ofreebsd32_stat_args *); int ofreebsd32_lstat(struct thread *, struct ofreebsd32_lstat_args *); @@ -842,6 +882,9 @@ struct freebsd4_freebsd32_sigreturn_args #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd4_freebsd32_getfsstat(struct thread *, struct freebsd4_freebsd32_getfsstat_args *); int freebsd4_freebsd32_statfs(struct thread *, struct freebsd4_freebsd32_statfs_args *); int freebsd4_freebsd32_fstatfs(struct thread *, struct freebsd4_freebsd32_fstatfs_args *); @@ -909,6 +952,9 @@ struct freebsd6_freebsd32_ftruncate_args #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd6_freebsd32_pread(struct thread *, struct freebsd6_freebsd32_pread_args *); int freebsd6_freebsd32_pwrite(struct thread *, struct freebsd6_freebsd32_pwrite_args *); int freebsd6_freebsd32_mmap(struct thread *, struct freebsd6_freebsd32_mmap_args *); @@ -946,6 +992,9 @@ struct freebsd7_freebsd32_shmctl_args { #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd7_freebsd32_semctl(struct thread *, struct freebsd7_freebsd32_semctl_args *); int freebsd7_freebsd32_msgctl(struct thread *, struct freebsd7_freebsd32_msgctl_args *); int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_args *); @@ -1086,6 +1135,9 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 +#define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 #undef PAD_ #undef PADL_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Tue May 21 11:40:16 2013 (r250853) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Tue May 21 11:41:08 2013 (r250854) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250853 2013-05-21 11:40:16Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -430,6 +430,9 @@ #define FREEBSD32_SYS_freebsd32_posix_fallocate 530 #define FREEBSD32_SYS_freebsd32_posix_fadvise 531 #define FREEBSD32_SYS_freebsd32_wait6 532 +#define FREEBSD32_SYS_freebsd32_posix_fallocate 530 +#define FREEBSD32_SYS_freebsd32_posix_fadvise 531 +#define FREEBSD32_SYS_freebsd32_wait6 532 #define FREEBSD32_SYS_cap_rights_limit 533 #define FREEBSD32_SYS_cap_ioctls_limit 534 #define FREEBSD32_SYS_cap_ioctls_get 535 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Tue May 21 11:40:16 2013 (r250853) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Tue May 21 11:41:08 2013 (r250854) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250853 2013-05-21 11:40:16Z kib */ const char *freebsd32_syscallnames[] = { @@ -553,9 +553,15 @@ const char *freebsd32_syscallnames[] = { "rctl_get_limits", /* 527 = rctl_get_limits */ "rctl_add_rule", /* 528 = rctl_add_rule */ "rctl_remove_rule", /* 529 = rctl_remove_rule */ +#ifdef PAD64_REQUIRED + "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ + "freebsd32_posix_fadvise", /* 531 = freebsd32_posix_fadvise */ + "freebsd32_wait6", /* 532 = freebsd32_wait6 */ +#else "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ "freebsd32_posix_fadvise", /* 531 = freebsd32_posix_fadvise */ "freebsd32_wait6", /* 532 = freebsd32_wait6 */ +#endif "cap_rights_limit", /* 533 = cap_rights_limit */ "cap_ioctls_limit", /* 534 = cap_ioctls_limit */ "cap_ioctls_get", /* 535 = cap_ioctls_get */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Tue May 21 11:40:16 2013 (r250853) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Tue May 21 11:41:08 2013 (r250854) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250853 2013-05-21 11:40:16Z kib */ #include "opt_compat.h" @@ -590,9 +590,15 @@ struct sysent freebsd32_sysent[] = { { AS(rctl_get_limits_args), (sy_call_t *)sys_rctl_get_limits, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 527 = rctl_get_limits */ { AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 528 = rctl_add_rule */ { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ +#ifdef PAD64_REQUIRED + { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ + { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ + { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ +#else { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ +#endif { AS(cap_rights_limit_args), (sy_call_t *)sys_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 533 = cap_rights_limit */ { AS(cap_ioctls_limit_args), (sy_call_t *)sys_cap_ioctls_limit, AUE_CAP_IOCTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 534 = cap_ioctls_limit */ { AS(cap_ioctls_get_args), (sy_call_t *)sys_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 535 = cap_ioctls_get */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue May 21 11:40:16 2013 (r250853) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue May 21 11:41:08 2013 (r250854) @@ -3053,6 +3053,47 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } +#ifdef PAD64_REQUIRED + /* freebsd32_posix_fallocate */ + case 530: { + struct freebsd32_posix_fallocate_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->pad; /* int */ + uarg[2] = p->offset1; /* uint32_t */ + uarg[3] = p->offset2; /* uint32_t */ + uarg[4] = p->len1; /* uint32_t */ + uarg[5] = p->len2; /* uint32_t */ + *n_args = 6; + break; + } + /* freebsd32_posix_fadvise */ + case 531: { + struct freebsd32_posix_fadvise_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->pad; /* int */ + uarg[2] = p->offset1; /* uint32_t */ + uarg[3] = p->offset2; /* uint32_t */ + uarg[4] = p->len1; /* uint32_t */ + uarg[5] = p->len2; /* uint32_t */ + iarg[6] = p->advice; /* int */ + *n_args = 7; + break; + } + /* freebsd32_wait6 */ + case 532: { + struct freebsd32_wait6_args *p = params; + iarg[0] = p->idtype; /* int */ + iarg[1] = p->pad; /* int */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ + uarg[4] = (intptr_t) p->status; /* int * */ + iarg[5] = p->options; /* int */ + uarg[6] = (intptr_t) p->wrusage; /* struct wrusage32 * */ + uarg[7] = (intptr_t) p->info; /* siginfo_t * */ + *n_args = 8; + break; + } +#else /* freebsd32_posix_fallocate */ case 530: { struct freebsd32_posix_fallocate_args *p = params; @@ -3080,14 +3121,16 @@ systrace_args(int sysnum, void *params, case 532: { struct freebsd32_wait6_args *p = params; iarg[0] = p->idtype; /* int */ - iarg[1] = p->id; /* int */ - uarg[2] = (intptr_t) p->status; /* int * */ - iarg[3] = p->options; /* int */ - uarg[4] = (intptr_t) p->wrusage; /* struct wrusage32 * */ - uarg[5] = (intptr_t) p->info; /* siginfo_t * */ - *n_args = 6; + uarg[1] = p->id1; /* uint32_t */ + uarg[2] = p->id2; /* uint32_t */ + uarg[3] = (intptr_t) p->status; /* int * */ + iarg[4] = p->options; /* int */ + uarg[5] = (intptr_t) p->wrusage; /* struct wrusage32 * */ + uarg[6] = (intptr_t) p->info; /* siginfo_t * */ + *n_args = 7; break; } +#endif /* cap_rights_limit */ case 533: { struct cap_rights_limit_args *p = params; @@ -8261,6 +8304,7 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; +#ifdef PAD64_REQUIRED /* freebsd32_posix_fallocate */ case 530: switch(ndx) { @@ -8268,7 +8312,7 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 1: - p = "uint32_t"; + p = "int"; break; case 2: p = "uint32_t"; @@ -8279,6 +8323,9 @@ systrace_entry_setargdesc(int sysnum, in case 4: p = "uint32_t"; break; + case 5: + p = "uint32_t"; + break; default: break; }; @@ -8290,7 +8337,7 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 1: - p = "uint32_t"; + p = "int"; break; case 2: p = "uint32_t"; @@ -8302,6 +8349,9 @@ systrace_entry_setargdesc(int sysnum, in p = "uint32_t"; break; case 5: + p = "uint32_t"; + break; + case 6: p = "int"; break; default: @@ -8318,21 +8368,104 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 2: + p = "uint32_t"; + break; + case 3: + p = "uint32_t"; + break; + case 4: p = "int *"; break; + case 5: + p = "int"; + break; + case 6: + p = "struct wrusage32 *"; + break; + case 7: + p = "siginfo_t *"; + break; + default: + break; + }; + break; +#else + /* freebsd32_posix_fallocate */ + case 530: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; + break; case 3: + p = "uint32_t"; + break; + case 4: + p = "uint32_t"; + break; + default: + break; + }; + break; + /* freebsd32_posix_fadvise */ + case 531: + switch(ndx) { + case 0: p = "int"; break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "uint32_t"; + break; case 4: - p = "struct wrusage32 *"; + p = "uint32_t"; + break; + case 5: + p = "int"; + break; + default: + break; + }; + break; + /* freebsd32_wait6 */ + case 532: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "int *"; + break; + case 4: + p = "int"; break; case 5: + p = "struct wrusage32 *"; + break; + case 6: p = "siginfo_t *"; break; default: break; }; break; +#endif /* cap_rights_limit */ case 533: switch(ndx) { @@ -10240,6 +10373,23 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; +#ifdef PAD64_REQUIRED + /* freebsd32_posix_fallocate */ + case 530: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_posix_fadvise */ + case 531: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_wait6 */ + case 532: + if (ndx == 0 || ndx == 1) + p = "int"; + break; +#else /* freebsd32_posix_fallocate */ case 530: if (ndx == 0 || ndx == 1) @@ -10255,6 +10405,7 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; +#endif /* cap_rights_limit */ case 533: if (ndx == 0 || ndx == 1) Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Tue May 21 11:40:16 2013 (r250853) +++ head/sys/kern/init_sysent.c Tue May 21 11:41:08 2013 (r250854) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250853 2013-05-21 11:40:16Z kib */ #include "opt_compat.h" Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Tue May 21 11:40:16 2013 (r250853) +++ head/sys/kern/syscalls.c Tue May 21 11:41:08 2013 (r250854) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250853 2013-05-21 11:40:16Z kib */ const char *syscallnames[] = { Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Tue May 21 11:40:16 2013 (r250853) +++ head/sys/kern/systrace_args.c Tue May 21 11:41:08 2013 (r250854) @@ -3278,7 +3278,7 @@ systrace_args(int sysnum, void *params, case 532: { struct wait6_args *p = params; iarg[0] = p->idtype; /* int */ - iarg[1] = p->id; /* int */ + iarg[1] = p->id; /* id_t */ uarg[2] = (intptr_t) p->status; /* int * */ iarg[3] = p->options; /* int */ uarg[4] = (intptr_t) p->wrusage; /* struct __wrusage * */ @@ -8817,7 +8817,7 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 1: - p = "int"; + p = "id_t"; break; case 2: p = "int *"; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Tue May 21 11:40:16 2013 (r250853) +++ head/sys/sys/syscall.h Tue May 21 11:41:08 2013 (r250854) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250853 2013-05-21 11:40:16Z kib */ #define SYS_syscall 0 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Tue May 21 11:40:16 2013 (r250853) +++ head/sys/sys/syscall.mk Tue May 21 11:41:08 2013 (r250854) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles +# created from FreeBSD: head/sys/kern/syscalls.master 250853 2013-05-21 11:40:16Z kib MIASM = \ syscall.o \ exit.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Tue May 21 11:40:16 2013 (r250853) +++ head/sys/sys/sysproto.h Tue May 21 11:41:08 2013 (r250854) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250853 2013-05-21 11:40:16Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -1756,7 +1756,7 @@ struct posix_fadvise_args { }; struct wait6_args { char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; - char id_l_[PADL_(int)]; int id; char id_r_[PADR_(int)]; + char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)]; char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; char wrusage_l_[PADL_(struct __wrusage *)]; struct __wrusage * wrusage; char wrusage_r_[PADR_(struct __wrusage *)]; From owner-svn-src-all@FreeBSD.ORG Tue May 21 14:28:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 069C5BF2; Tue, 21 May 2013 14:28:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ED0DD61F; Tue, 21 May 2013 14:28:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LES5ca018988; Tue, 21 May 2013 14:28:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LES5L8018987; Tue, 21 May 2013 14:28:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305211428.r4LES5L8018987@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 May 2013 14:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250856 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 14:28:06 -0000 Author: adrian Date: Tue May 21 14:28:05 2013 New Revision: 250856 URL: http://svnweb.freebsd.org/changeset/base/250856 Log: Fix build break - the SetCapability calls return HAL_BOOL, not HAL_STATUS. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue May 21 13:02:37 2013 (r250855) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue May 21 14:28:05 2013 (r250856) @@ -504,7 +504,7 @@ ar5416SetCapability(struct ath_hal *ah, return AH_TRUE; case HAL_CAP_ENFORCE_TXOP: if (capability != 1) - return (HAL_ENOTSUPP); + return AH_FALSE; if (setting) { AH5212(ah)->ah_miscMode |= AR_PCU_TXOP_TBTT_LIMIT_ENA; From owner-svn-src-all@FreeBSD.ORG Tue May 21 14:48:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9BA7D797; Tue, 21 May 2013 14:48:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6E8317ED; Tue, 21 May 2013 14:48:03 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B85D8B980; Tue, 21 May 2013 10:48:02 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r250853 - in head/sys: compat/freebsd32 kern Date: Tue, 21 May 2013 10:41:30 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305211140.r4LBeGSi059770@svn.freebsd.org> In-Reply-To: <201305211140.r4LBeGSi059770@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305211041.30702.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 21 May 2013 10:48:02 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 14:48:03 -0000 On Tuesday, May 21, 2013 7:40:16 am Konstantin Belousov wrote: > Author: kib > Date: Tue May 21 11:40:16 2013 > New Revision: 250853 > URL: http://svnweb.freebsd.org/changeset/base/250853 > > Log: > Fix the wait6(2) on 32bit architectures and for the compat32, by using > the right type for the argument in syscalls.master. Also fix the > posix_fallocate(2) and posix_fadvise(2) compat32 syscalls on the > architectures which require padding of the 64bit argument. > > Noted and reviewed by: jhb > Pointy hat to: kib I get to share the pointy hat as I missed the padding requirement for the posix_f*() compat32 shims. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue May 21 16:42:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D38C2AA9; Tue, 21 May 2013 16:42:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with ESMTP id ABCF9DC2; Tue, 21 May 2013 16:42:09 +0000 (UTC) Received: from glenbarber.us (static-108-16-252-210.phlapa.fios.verizon.net [108.16.252.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 6A1E423F804; Tue, 21 May 2013 12:42:02 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 6A1E423F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Tue, 21 May 2013 12:42:00 -0400 From: Glen Barber To: Adrian Chadd Subject: Re: svn commit: r250856 - head/sys/dev/ath/ath_hal/ar5416 Message-ID: <20130521164200.GA1643@glenbarber.us> References: <201305211428.r4LES5L8018987@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <201305211428.r4LES5L8018987@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 16:42:09 -0000 --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 21, 2013 at 02:28:05PM +0000, Adrian Chadd wrote: > Author: adrian > Date: Tue May 21 14:28:05 2013 > New Revision: 250856 > URL: http://svnweb.freebsd.org/changeset/base/250856 >=20 > Log: > Fix build break - the SetCapability calls return HAL_BOOL, > not HAL_STATUS. >=20 > Modified: > head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c >=20 > Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue May 21 13:02:37 201= 3 (r250855) > +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue May 21 14:28:05 201= 3 (r250856) > @@ -504,7 +504,7 @@ ar5416SetCapability(struct ath_hal *ah,=20 > return AH_TRUE; > case HAL_CAP_ENFORCE_TXOP: > if (capability !=3D 1) > - return (HAL_ENOTSUPP); > + return AH_FALSE; > if (setting) { > AH5212(ah)->ah_miscMode > |=3D AR_PCU_TXOP_TBTT_LIMIT_ENA; This breaks tinderbox. /src/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c -I/src/sys/dev/ath -I/src/sys/dev/ath/ath_hal /src/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c:507:12: error: implicit conversion from enumeration type 'HAL_STATUS' to different enumeration type 'HAL_BOOL' [-Werror,-Wenum-conversion] return (HAL_ENOTSUPP); ~~~~~~ ^~~~~~~~~~~~ 1 error generated. *** Error code 1 Stop. make: stopped in /obj/arm.arm/src/sys/LINT Glen --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJRm6PYAAoJEFJPDDeguUajknoIAKoUi5itujDDFqX6gpj2pASm Ktt2DkxQuDndO9oYvbfVhIlvRGOyPqTJQNYXEBGRJ53SlgISiF0/gATeP4rt27x1 XFAmPmlW+ZdW5txyr7oN/cu06AehuxaXeKyhi8jgOF6s7OinBCKnY/2nmAuzBQnF wHTThIraWyTkkiBG6mTCjq8CT66YaQ+F9Pw4wjmFaZ3NFwX9UmzmcX04nZ3QpxNi RsCMZgqDuP7C6RNZsFtCbAOAkeHdev+MALQFx4ks4SQqPudja2dHR0Eqf3pe+5sN wXf26k9Rz4z1LSQhafdO4a8MgHL6jhzobxwjjFurOYmAmwZ8JfytTwyFL0/d9SQ= =j70v -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e-- From owner-svn-src-all@FreeBSD.ORG Tue May 21 16:58:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A249FDC; Tue, 21 May 2013 16:58:24 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95295E86; Tue, 21 May 2013 16:58:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LGwNjW070772; Tue, 21 May 2013 16:58:23 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LGwNgl070771; Tue, 21 May 2013 16:58:23 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305211658.r4LGwNgl070771@svn.freebsd.org> From: Brooks Davis Date: Tue, 21 May 2013 16:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250859 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 16:58:24 -0000 Author: brooks Date: Tue May 21 16:58:23 2013 New Revision: 250859 URL: http://svnweb.freebsd.org/changeset/base/250859 Log: Restore the ability to build on systems with 32-bit compat when the system compiler is not clang. clang and gcc appear to differ signficantly in their interpretation of -isystem and --sysroot. Further work is likely required to support an external gcc. Reported by: andreast, fidaj@ukr.net, sergey.dyatko@gmail.com Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 21 16:34:44 2013 (r250858) +++ head/Makefile.inc1 Tue May 21 16:58:23 2013 (r250859) @@ -366,10 +366,12 @@ LIB32WMAKEFLAGS= \ LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -DCOMPAT_32BIT \ - --sysroot=${WORLDTMP} \ -isystem ${LIB32TMP}/usr/include/ \ -L${LIB32TMP}/usr/lib32 \ -B${LIB32TMP}/usr/lib32 +.if ${XCC:M/*} +LIB32FLAGS+= --sysroot=${WORLDTMP} +.endif # Yes, the flags are redundant. LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ From owner-svn-src-all@FreeBSD.ORG Tue May 21 17:00:09 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2E1F7296; Tue, 21 May 2013 17:00:09 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id D39C0E95; Tue, 21 May 2013 17:00:06 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4LH00bp014267; Tue, 21 May 2013 12:00:00 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4LH00tt014266; Tue, 21 May 2013 12:00:00 -0500 (CDT) (envelope-from brooks) Date: Tue, 21 May 2013 12:00:00 -0500 From: Brooks Davis To: Andreas Tobler Subject: Re: svn commit: r250659 - in head: . share/mk tools/build/options tools/tools/makeroot Message-ID: <20130521170000.GC12757@lor.one-eyed-alien.net> References: <201305151430.r4FEU31J061480@svn.freebsd.org> <51955849.4020503@FreeBSD.org> <20130520195114.GE2630@lor.one-eyed-alien.net> <519A80A7.8080905@FreeBSD.org> <20130520201006.GG2630@lor.one-eyed-alien.net> <519A84DD.8030804@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="St7VIuEGZ6dlpu13" Content-Disposition: inline In-Reply-To: <519A84DD.8030804@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Brooks Davis , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 17:00:09 -0000 --St7VIuEGZ6dlpu13 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 20, 2013 at 10:17:33PM +0200, Andreas Tobler wrote: > On 20.05.13 22:10, Brooks Davis wrote: > > On Mon, May 20, 2013 at 09:59:35PM +0200, Andreas Tobler wrote: > >> On 20.05.13 21:51, Brooks Davis wrote: > >>> On Fri, May 17, 2013 at 12:06:01AM +0200, Andreas Tobler wrote: > >>>> On 15.05.13 16:30, Brooks Davis wrote: > >>>>> Author: brooks > >>>>> Date: Wed May 15 14:30:03 2013 > >>>>> New Revision: 250659 > >>>>> URL: http://svnweb.freebsd.org/changeset/base/250659 > >>>>> > >>>>> Log: > >>>>> Add support for an external cross compiler. The cross compiler is > >>>>> specified by passing the XCC, XCXX, and XCPP variables (correspon= ding to > >>>>> CC, CXX, and CPP) to buildworld/buildkernel. The compiler must b= e clang > >>>>> or be configured to target the appropriate architecture. > >>>>> =20 > >>>>> To speed build times, if XCC is an absolute path or > >>>>> WITHOUT_CROSS_COMPILER is defined then no cross compiler will be = built > >>>>> during the cross-tools stage. > >>>>> =20 > >>>>> Limited documentation of this feature can currently be found at: > >>>>> =20 > >>>>> https://wiki.freebsd.org/ExternalToolchain > >>>>> =20 > >>>>> This functionality should be considered experimental and is subje= ct to > >>>>> change without notice. > >>>>> =20 > >>>>> Sponsored by: DARPA, AFRL > >>>>> Discussed with: imp, sjg > >>>> > >>>> I had to revert this commit to be able to build world and kernel with > >>>> WITHOUT_CLANG_IS_CC in /etc/src.conf > >>>> > >>>> It did not find the headers (like math.h) when building the 32-bit p= art > >>>> on amd64. > >>> > >>> I'll need more information to do any useful debugging. How is the ho= st > >>> configured? If it's not 100% stock, I need to know what WITH/WITHOUT > >>> options were set to build it. Are you setting any options other than > >>> WITHOUT_CLANG_IS_CC during this build? > >> > >> Source is svn -CURRENT. There is no other option set than > >> WITHOUT_CLANG_IS_CC. Beside I use MALLOC_PRODUCTION=3D1 > >=20 > > Is /usr/bin/cc gcc or clang? >=20 > /usr/bin/cc -v > Using built-in specs. > Target: amd64-undermydesk-freebsd > Configured with: FreeBSD/amd64 system compiler > Thread model: posix > gcc version 4.2.1 20070831 patched [FreeBSD] >=20 > > Just to be sure. Are you setting CC anywhere? > >=20 > >> This happens on both 32-capable targets, amd64 and powerpc64. > >> > >> I figured that there are at least three headers 'missing' so far in > >> src/lib32/usr/include: > >> - math.h > >> - fenv.h > >> - libutil.h > >> > >> If I manually copy them to this location I can continue building until > >> /usr/bin/ld complains about not being configured for sysroots. > >> I just restarted the whole worldbuild again with the above mentionend > >> headers in place. > >=20 > > Hmm, this is really weird. /usr/bin/ld should never run after the > > bootstrap phase unless you actually use the X* variables. >=20 > Well, it might be that I did something in a hurry, that's why I > restarted the whole build. > What I did, I cleaned the whole obj dir and did a 'make build32' in > /usr/src (to save some time), then I got the exact same failures as when > I started from scratch. Now I tried to find all the headers which the > compiler was complaining about, copied them to > /usr/obj/****/src/lib32/usr/include, finished the compilation stage and > at the linker stage 'ld' complained. >=20 > Now I'm waiting for the build from beginning with copied headers to see > what happens. The problem seems to be that clang and gcc don't agree about the meaning of -isystem and --sysroot. I've committed a change that I belive restores the status quo. -- Brooks --St7VIuEGZ6dlpu13 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRm6gPXY6L6fI4GtQRApTJAKDbFoVDMhPkLeQA6P98BfYkfgx3UwCgruXu bM4vaNZ5CwdcsMraTqEMLFw= =UaWU -----END PGP SIGNATURE----- --St7VIuEGZ6dlpu13-- From owner-svn-src-all@FreeBSD.ORG Tue May 21 17:28:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E076EF4D; Tue, 21 May 2013 17:28:19 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D1EFA7A; Tue, 21 May 2013 17:28:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LHSJBc081410; Tue, 21 May 2013 17:28:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LHSJci081409; Tue, 21 May 2013 17:28:19 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305211728.r4LHSJci081409@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 21 May 2013 17:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250860 - head/gnu/usr.bin/diff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 17:28:20 -0000 Author: marcel Date: Tue May 21 17:28:19 2013 New Revision: 250860 URL: http://svnweb.freebsd.org/changeset/base/250860 Log: Don't look for headers outside of the source or object directories. In particular, don't use DESTDIR. Such creates an unnecessary dependency on the build machine. Obtained from: Juniper Networks, Inc. Modified: head/gnu/usr.bin/diff/Makefile Modified: head/gnu/usr.bin/diff/Makefile ============================================================================== --- head/gnu/usr.bin/diff/Makefile Tue May 21 16:58:23 2013 (r250859) +++ head/gnu/usr.bin/diff/Makefile Tue May 21 17:28:19 2013 (r250860) @@ -17,10 +17,10 @@ CFLAGS+=-funsigned-char CFLAGS+=-DHAVE_CONFIG_H CFLAGS+=-DPR_PROGRAM=\"/usr/bin/pr\" -CFLAGS+=-I${DESTDIR}/usr/include/gnu CFLAGS+=-I${.CURDIR}/../../../contrib/diff CFLAGS+=-I${.CURDIR}/../../../contrib/diff/src CFLAGS+=-I${.CURDIR}/../../../contrib/diff/lib +CFLAGS+=-I${.CURDIR}/../../lib/libregex SUBDIR+=doc From owner-svn-src-all@FreeBSD.ORG Tue May 21 17:30:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 62B37176; Tue, 21 May 2013 17:30:28 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 54CB195; Tue, 21 May 2013 17:30:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LHUSqp082036; Tue, 21 May 2013 17:30:28 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LHUSeJ082035; Tue, 21 May 2013 17:30:28 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305211730.r4LHUSeJ082035@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 21 May 2013 17:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250861 - head/gnu/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 17:30:28 -0000 Author: marcel Date: Tue May 21 17:30:27 2013 New Revision: 250861 URL: http://svnweb.freebsd.org/changeset/base/250861 Log: Don't look for headers outside of the source or object directories. In particular, don't use DESTDIR. Such creates an unnecessary dependency on the build machine. Obtained from: Juniper Networks, Inc. Modified: head/gnu/usr.bin/grep/Makefile Modified: head/gnu/usr.bin/grep/Makefile ============================================================================== --- head/gnu/usr.bin/grep/Makefile Tue May 21 17:28:19 2013 (r250860) +++ head/gnu/usr.bin/grep/Makefile Tue May 21 17:30:27 2013 (r250861) @@ -13,7 +13,7 @@ SRCS= closeout.c dfa.c error.c exclude.c isdir.c kwset.c obstack.c quotearg.c savedir.c search.c xmalloc.c \ xstrtoumax.c -CFLAGS+=-I${.CURDIR} -I${DESTDIR}/usr/include/gnu -DHAVE_CONFIG_H +CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../../lib/libregex -DHAVE_CONFIG_H .if ${MK_BSD_GREP} != "yes" LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \ From owner-svn-src-all@FreeBSD.ORG Tue May 21 17:31:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id 3A793362; Tue, 21 May 2013 17:31:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Message-ID: <519BAEB6.9040903@FreeBSD.org> Date: Tue, 21 May 2013 13:28:22 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130517 Thunderbird/17.0.6 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r247086 - head/sys/x86/isa References: <201302210638.r1L6cOVx006678@svn.freebsd.org> <20130221064912.GA20360@FreeBSD.org> <20130520022100.GA82181@FreeBSD.org> <73F6A8D9-3366-47AB-9DE9-E570006E3A3F@bsdimp.com> <20130521061051.GA51568@FreeBSD.org> <20130521172744.U1667@besplex.bde.org> In-Reply-To: <20130521172744.U1667@besplex.bde.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Warner Losh , Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 17:31:52 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2013-05-21 05:18:46 -0400, Bruce Evans wrote: ... > So it seems that pmtimer has a lot of dead code and reduces to not > much more than an inittodr(0) and usually acts like the > inittodr(!0) in the acpi amd64 resume code. When I wrote the resume code for amd64, I studied the pmtimer and realized the same problems, of course. So, I simply reduced the code and embedded it in acpi.c (without fixing underlying problems) because a) I didn't want the dead code in pmtimer, b) acpi is mandatory for amd64, and c) I didn't want to disturb i386 (or ia64) code paths. In fact, my evil plan was a) deprecate apm and pmtimer for i386, b) improve the code in acpi.c, and c) fix "calcru: runtime went backwards" problem for good. But I never found free time to do that. :-( > acpi amd64 resume also seems to be missing the verbose logging of > the suspension time, but maybe acpi utilities give that. /etc/rc.{suspend,resume} already do that. So, yes, the "feature" is redundant. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBAgAGBQJRm662AAoJECXpabHZMqHO+fgH/iEGdzAXeZuG6F4+fGBk9wCi nEyz/RoJeQ7OwdR8vVIcs3z9TwZT58QVOipt5Tgh6cr77fRWfTrBhdZEWDSInXcb wpnFXeXNe0MVNHduuq3QIpmpHxJLHUMLKTdaBJhaVixATcQovYhMZUljq0AxVKDs VJw346YrdXI3IaAzXbm1OonGNgV48N2ACXCJvOKv1qwtYhx9UMIUkbXoWxGkT6rb i5hWj3VsVPBG/E4vvKPvZAwmieU7TaUY8/BOjyyWh4kAsRW5N4ZmRY9W0v5EyRid 5qDEfUrW6liVFh+4O4HOL3G0NDY6KCQpoBue91Dp5cOaHl3lzGlBUGQ9/9932nM= =MldY -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Tue May 21 17:47:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C55AC75A; Tue, 21 May 2013 17:47:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B86A1137; Tue, 21 May 2013 17:47:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LHlsgs088186; Tue, 21 May 2013 17:47:54 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LHls80088185; Tue, 21 May 2013 17:47:54 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305211747.r4LHls80088185@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 21 May 2013 17:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250863 - head/lib/csu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 17:47:54 -0000 Author: marcel Date: Tue May 21 17:47:53 2013 New Revision: 250863 URL: http://svnweb.freebsd.org/changeset/base/250863 Log: Add a makefle that recurses into the right architecture-specific sub-directory. This to allow simpler logic outside of the csu directory. Obtained from: Juniper Networks, Inc. Added: head/lib/csu/Makefile (contents, props changed) Added: head/lib/csu/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/Makefile Tue May 21 17:47:53 2013 (r250863) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +ARCH= ${MACHINE_ARCH:S/i386/i386-elf/} +.if exists(${.CURDIR}/${ARCH}) +SUBDIR+= ${ARCH} +.else +SUBDIR+= ${MACHINE_CPUARCH} +.endif + +.include From owner-svn-src-all@FreeBSD.ORG Tue May 21 18:00:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 631F9A80; Tue, 21 May 2013 18:00:48 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 562611D6; Tue, 21 May 2013 18:00:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LI0lwK093765; Tue, 21 May 2013 18:00:47 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LI0lKh093764; Tue, 21 May 2013 18:00:47 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305211800.r4LI0lKh093764@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 21 May 2013 18:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250864 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 18:00:48 -0000 Author: marcel Date: Tue May 21 18:00:47 2013 New Revision: 250864 URL: http://svnweb.freebsd.org/changeset/base/250864 Log: Fix the PowerPC Book-E register definitions used by the remote GDB protocol. Obtained from: Juniper Networks, Inc. Modified: head/sys/powerpc/include/gdb_machdep.h Modified: head/sys/powerpc/include/gdb_machdep.h ============================================================================== --- head/sys/powerpc/include/gdb_machdep.h Tue May 21 17:47:53 2013 (r250863) +++ head/sys/powerpc/include/gdb_machdep.h Tue May 21 18:00:47 2013 (r250864) @@ -29,11 +29,20 @@ #ifndef _MACHINE_GDB_MACHDEP_H_ #define _MACHINE_GDB_MACHDEP_H_ +#ifdef BOOKE +#define PPC_GDB_NREGS0 1 +#define PPC_GDB_NREGS4 (70 + 1) +#define PPC_GDB_NREGS8 (1 + 32) +#define PPC_GDB_NREGS16 0 +#else +#define PPC_GDB_NREGS0 0 #define PPC_GDB_NREGS4 (32 + 7 + 2) #define PPC_GDB_NREGS8 32 #define PPC_GDB_NREGS16 32 +#endif -#define GDB_NREGS (PPC_GDB_NREGS4 + PPC_GDB_NREGS8 + PPC_GDB_NREGS16) +#define GDB_NREGS (PPC_GDB_NREGS0 + PPC_GDB_NREGS4 + \ + PPC_GDB_NREGS8 + PPC_GDB_NREGS16) #define GDB_REG_PC 64 #define GDB_BUFSZ (PPC_GDB_NREGS4 * 8 + \ @@ -44,10 +53,17 @@ static __inline size_t gdb_cpu_regsz(int regnum) { +#ifdef BOOKE + if (regnum == 70) + return (0); + if (regnum == 71 || regnum >= 73) + return (8); +#else if (regnum >= 32 && regnum <= 63) return (8); if (regnum >= 71 && regnum <= 102) return (16); +#endif return (4); } From owner-svn-src-all@FreeBSD.ORG Tue May 21 18:02:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9AC70C47; Tue, 21 May 2013 18:02:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7CF56209; Tue, 21 May 2013 18:02:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LI2tSh094277; Tue, 21 May 2013 18:02:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LI2sIi094273; Tue, 21 May 2013 18:02:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305211802.r4LI2sIi094273@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 May 2013 18:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250865 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 18:02:55 -0000 Author: adrian Date: Tue May 21 18:02:54 2013 New Revision: 250865 URL: http://svnweb.freebsd.org/changeset/base/250865 Log: Enable the use of TDMA on an 802.11n channel (with aggregation disabled, of course.) There's a few things that needed to happen: * In case someone decides to set the beacon transmission rate to be at an MCS rate, use the MCS-aware version of the duration calculation to figure out how long the received beacon frame was. * If TxOP enforcing is available on the hardware and we're doing TDMA, enable it after a reset and set the TDMA guard interval to zero. This seems to behave fine. TODO: * Although I haven't yet seen packet loss, the PHY errors that would be triggered (specifically Transmit-Override-Receive) aren't enabled by the 11n HAL. I'll have to do some work to enable these PHY errors for debugging. What broke: * My recent changes to the TX queue handling has resulted in the driver not keeping the hardware queue properly filled when doing non-aggregate traffic. I have a patch to commit soon which fixes this situation (albeit by reminding me about how my ath driver locking isn't working out, sigh.) So if you want to test this without updating to the next set of patches that I commit, just bump the sysctl dev.ath.X.hwq_limit from 2 to 32. Tested: * AR5416 <-> AR5416, with ampdu disabled, HT40, 5GHz, MCS12+Short-GI. I saw 30mbit/sec in both directions using a bidirectional UDP test. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tdma.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue May 21 18:00:47 2013 (r250864) +++ head/sys/dev/ath/if_ath.c Tue May 21 18:02:54 2013 (r250865) @@ -670,6 +670,7 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_hastsfadd = ath_hal_hastsfadjust(ah); sc->sc_rxslink = ath_hal_self_linked_final_rxdesc(ah); sc->sc_rxtsf32 = ath_hal_has_long_rxdesc_tsf(ah); + sc->sc_hasenforcetxop = ath_hal_hasenforcetxop(ah); if (ath_hal_hasfastframes(ah)) ic->ic_caps |= IEEE80211_C_FF; wmodes = ath_hal_getwirelessmodes(ah); @@ -1586,6 +1587,15 @@ ath_resume(struct ath_softc *sc) /* Let spectral at in case spectral is enabled */ ath_spectral_enable(sc, ic->ic_curchan); + /* + * If we're doing TDMA, enforce the TXOP limitation for chips that + * support it. + */ + if (sc->sc_hasenforcetxop && sc->sc_tdma) + ath_hal_setenforcetxop(sc->sc_ah, 1); + else + ath_hal_setenforcetxop(sc->sc_ah, 0); + /* Restore the LED configuration */ ath_led_config(sc); ath_hal_setledstate(ah, HAL_LED_INIT); @@ -2034,6 +2044,15 @@ ath_init(void *arg) ath_spectral_enable(sc, ic->ic_curchan); /* + * If we're doing TDMA, enforce the TXOP limitation for chips that + * support it. + */ + if (sc->sc_hasenforcetxop && sc->sc_tdma) + ath_hal_setenforcetxop(sc->sc_ah, 1); + else + ath_hal_setenforcetxop(sc->sc_ah, 0); + + /* * Likewise this is set during reset so update * state cached in the driver. */ @@ -2348,6 +2367,15 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T /* Let spectral at in case spectral is enabled */ ath_spectral_enable(sc, ic->ic_curchan); + /* + * If we're doing TDMA, enforce the TXOP limitation for chips that + * support it. + */ + if (sc->sc_hasenforcetxop && sc->sc_tdma) + ath_hal_setenforcetxop(sc->sc_ah, 1); + else + ath_hal_setenforcetxop(sc->sc_ah, 0); + if (ath_startrecv(sc) != 0) /* restart recv */ if_printf(ifp, "%s: unable to start recv logic\n", __func__); /* @@ -4869,6 +4897,15 @@ ath_chan_set(struct ath_softc *sc, struc ath_spectral_enable(sc, chan); /* + * If we're doing TDMA, enforce the TXOP limitation for chips + * that support it. + */ + if (sc->sc_hasenforcetxop && sc->sc_tdma) + ath_hal_setenforcetxop(sc->sc_ah, 1); + else + ath_hal_setenforcetxop(sc->sc_ah, 0); + + /* * Re-enable rx framework. */ if (ath_startrecv(sc) != 0) { Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Tue May 21 18:00:47 2013 (r250864) +++ head/sys/dev/ath/if_ath_tdma.c Tue May 21 18:02:54 2013 (r250865) @@ -277,9 +277,19 @@ ath_tdma_config(struct ath_softc *sc, st rix = ath_tx_findrix(sc, tp->ucastrate); else rix = ath_tx_findrix(sc, tp->mcastrate); - /* XXX short preamble assumed */ - sc->sc_tdmaguard = ath_hal_computetxtime(ah, sc->sc_currates, - ifp->if_mtu + IEEE80211_MAXOVERHEAD, rix, AH_TRUE); + + /* + * If the chip supports enforcing TxOP on transmission, + * we can just delete the guard window. It isn't at all required. + */ + if (sc->sc_hasenforcetxop) { + sc->sc_tdmaguard = 0; + } else { + /* XXX short preamble assumed */ + /* XXX non-11n rate assumed */ + sc->sc_tdmaguard = ath_hal_computetxtime(ah, sc->sc_currates, + ifp->if_mtu + IEEE80211_MAXOVERHEAD, rix, AH_TRUE); + } ath_hal_intrset(ah, 0); @@ -392,8 +402,35 @@ ath_tdma_update(struct ieee80211_node *n * the packet just received. */ rix = rt->rateCodeToIndex[rs->rs_rate]; - txtime = ath_hal_computetxtime(ah, rt, rs->rs_datalen, rix, - rt->info[rix].shortPreamble); + + /* + * To calculate the packet duration for legacy rates, we + * only need the rix and preamble. + * + * For 11n non-aggregate frames, we also need the channel + * width and short/long guard interval. + * + * For 11n aggregate frames, the required hacks are a little + * more subtle. You need to figure out the frame duration + * for each frame, including the delimiters. However, when + * a frame isn't received successfully, we won't hear it + * (unless you enable reception of CRC errored frames), so + * your duration calculation is going to be off. + * + * However, we can assume that the beacon frames won't be + * transmitted as aggregate frames, so we should be okay. + * Just add a check to ensure that we aren't handed something + * bad. + * + * For ath_hal_pkt_txtime() - for 11n rates, shortPreamble is + * actually short guard interval. For legacy rates, + * it's short preamble. + */ + txtime = ath_hal_pkt_txtime(ah, rt, rs->rs_datalen, + rix, + !! (rs->rs_flags & HAL_RX_2040), + (rix & 0x80) ? + (! (rs->rs_flags & HAL_RX_GI)) : rt->info[rix].shortPreamble); /* NB: << 9 is to cvt to TU and /2 */ nextslot = (rstamp - txtime) + (sc->sc_tdmabintval << 9); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue May 21 18:00:47 2013 (r250864) +++ head/sys/dev/ath/if_athvar.h Tue May 21 18:02:54 2013 (r250865) @@ -627,7 +627,8 @@ struct ath_softc { */ u_int32_t sc_use_ent : 1, sc_rx_stbc : 1, - sc_tx_stbc : 1; + sc_tx_stbc : 1, + sc_hasenforcetxop : 1; /* support enforce TxOP */ int sc_cabq_enable; /* Enable cabq transmission */ @@ -1256,6 +1257,14 @@ void ath_intr(void *); ath_hal_setcapability(_ah, HAL_CAP_INTMIT, \ HAL_CAP_INTMIT_ENABLE, _v, NULL) +#define ath_hal_hasenforcetxop(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_ENFORCE_TXOP, 0, NULL) == HAL_OK) +#define ath_hal_getenforcetxop(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_ENFORCE_TXOP, 1, NULL) == HAL_OK) +#define ath_hal_setenforcetxop(_ah, _v) \ + ath_hal_setcapability(_ah, HAL_CAP_ENFORCE_TXOP, 1, _v, NULL) + + /* EDMA definitions */ #define ath_hal_hasedma(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_ENHANCED_DMA_SUPPORT, \ From owner-svn-src-all@FreeBSD.ORG Tue May 21 18:13:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F79A18B; Tue, 21 May 2013 18:13:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 41EB62B5; Tue, 21 May 2013 18:13:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LIDxko098294; Tue, 21 May 2013 18:13:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LIDwpN098289; Tue, 21 May 2013 18:13:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305211813.r4LIDwpN098289@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 May 2013 18:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250866 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 18:13:59 -0000 Author: adrian Date: Tue May 21 18:13:57 2013 New Revision: 250866 URL: http://svnweb.freebsd.org/changeset/base/250866 Log: Implement a separate hardware queue threshold for aggregate and non-aggr traffic. When transmitting non-aggregate traffic, we need to keep the hardware busy whilst transmitting or small bursts in txdone/tx latency will kill us. This restores non-aggregate iperf performance, especially when doing TDMA. Tested: * AR5416<->AR5416, TDMA * AR5416 STA <-> AR9280 AP Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue May 21 18:02:54 2013 (r250865) +++ head/sys/dev/ath/if_ath.c Tue May 21 18:13:57 2013 (r250866) @@ -839,7 +839,8 @@ ath_attach(u_int16_t devid, struct ath_s /* * Initial aggregation settings. */ - sc->sc_hwq_limit = ATH_AGGR_MIN_QDEPTH; + sc->sc_hwq_limit_aggr = ATH_AGGR_MIN_QDEPTH; + sc->sc_hwq_limit_nonaggr = ATH_NONAGGR_MIN_QDEPTH; sc->sc_tid_hwq_lo = ATH_AGGR_SCHED_LOW; sc->sc_tid_hwq_hi = ATH_AGGR_SCHED_HIGH; sc->sc_aggr_limit = ATH_AGGR_MAXSIZE; Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue May 21 18:02:54 2013 (r250865) +++ head/sys/dev/ath/if_ath_sysctl.c Tue May 21 18:13:57 2013 (r250866) @@ -722,8 +722,11 @@ ath_sysctlattach(struct ath_softc *sc) "mask of error frames to pass when monitoring"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "hwq_limit", CTLFLAG_RW, &sc->sc_hwq_limit, 0, - "Hardware queue depth before software-queuing TX frames"); + "hwq_limit_nonaggr", CTLFLAG_RW, &sc->sc_hwq_limit_nonaggr, 0, + "Hardware non-AMPDU queue depth before software-queuing TX frames"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "hwq_limit_aggr", CTLFLAG_RW, &sc->sc_hwq_limit_aggr, 0, + "Hardware AMPDU queue depth before software-queuing TX frames"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "tid_hwq_lo", CTLFLAG_RW, &sc->sc_tid_hwq_lo, 0, ""); Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue May 21 18:02:54 2013 (r250865) +++ head/sys/dev/ath/if_ath_tx.c Tue May 21 18:13:57 2013 (r250866) @@ -3108,9 +3108,15 @@ ath_tx_swq(struct ath_softc *sc, struct * the head frame in the list. Don't schedule the * TID - let it build some more frames first? * + * When running A-MPDU, always just check the hardware + * queue depth against the aggregate frame limit. + * We don't want to burst a large number of single frames + * out to the hardware; we want to aggressively hold back. + * * Otherwise, schedule the TID. */ - if (txq->axq_depth + txq->fifo.axq_depth < sc->sc_hwq_limit) { + /* XXX TXQ locking */ + if (txq->axq_depth + txq->fifo.axq_depth < sc->sc_hwq_limit_aggr) { bf = ATH_TID_FIRST(atid); ATH_TID_REMOVE(atid, bf, bf_list); @@ -3134,7 +3140,22 @@ ath_tx_swq(struct ath_softc *sc, struct ath_tx_tid_sched(sc, atid); } - } else if (txq->axq_depth + txq->fifo.axq_depth < sc->sc_hwq_limit) { + /* + * If we're not doing A-MPDU, be prepared to direct dispatch + * up to both limits if possible. This particular corner + * case may end up with packet starvation between aggregate + * traffic and non-aggregate traffic: we wnat to ensure + * that non-aggregate stations get a few frames queued to the + * hardware before the aggregate station(s) get their chance. + * + * So if you only ever see a couple of frames direct dispatched + * to the hardware from a non-AMPDU client, check both here + * and in the software queue dispatcher to ensure that those + * non-AMPDU stations get a fair chance to transmit. + */ + /* XXX TXQ locking */ + } else if ((txq->axq_depth + txq->fifo.axq_depth < sc->sc_hwq_limit_nonaggr) && + (txq->axq_aggr_depth < sc->sc_hwq_limit_aggr)) { /* AMPDU not running, attempt direct dispatch */ DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: xmit_normal\n", __func__); /* See if clrdmask needs to be set */ @@ -5339,7 +5360,8 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft * * XXX locking on txq here? */ - if (txq->axq_aggr_depth >= sc->sc_hwq_limit || + /* XXX TXQ locking */ + if (txq->axq_aggr_depth >= sc->sc_hwq_limit_aggr || (status == ATH_AGGR_BAW_CLOSED || status == ATH_AGGR_LEAK_CLOSED)) break; @@ -5348,6 +5370,15 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft /* * Schedule some packets from the given node/TID to the hardware. + * + * XXX TODO: this routine doesn't enforce the maximum TXQ depth. + * It just dumps frames into the TXQ. We should limit how deep + * the transmit queue can grow for frames dispatched to the given + * TXQ. + * + * To avoid locking issues, either we need to own the TXQ lock + * at this point, or we need to pass in the maximum frame count + * from the caller. */ void ath_tx_tid_hw_queue_norm(struct ath_softc *sc, struct ath_node *an, @@ -5452,8 +5483,16 @@ ath_txq_sched(struct ath_softc *sc, stru * Don't schedule if the hardware queue is busy. * This (hopefully) gives some more time to aggregate * some packets in the aggregation queue. + * + * XXX It doesn't stop a parallel sender from sneaking + * in transmitting a frame! */ - if (txq->axq_aggr_depth >= sc->sc_hwq_limit) { + /* XXX TXQ locking */ + if (txq->axq_aggr_depth + txq->fifo.axq_depth >= sc->sc_hwq_limit_aggr) { + sc->sc_aggr_stats.aggr_sched_nopkt++; + return; + } + if (txq->axq_depth >= sc->sc_hwq_limit_nonaggr) { sc->sc_aggr_stats.aggr_sched_nopkt++; return; } @@ -5489,7 +5528,11 @@ ath_txq_sched(struct ath_softc *sc, stru * packets. If we aren't running aggregation then * we should still limit the hardware queue depth. */ - if (txq->axq_depth >= sc->sc_hwq_limit) { + /* XXX TXQ locking */ + if (txq->axq_aggr_depth + txq->fifo.axq_depth >= sc->sc_hwq_limit_aggr) { + break; + } + if (txq->axq_depth >= sc->sc_hwq_limit_nonaggr) { break; } Modified: head/sys/dev/ath/if_ath_tx.h ============================================================================== --- head/sys/dev/ath/if_ath_tx.h Tue May 21 18:02:54 2013 (r250865) +++ head/sys/dev/ath/if_ath_tx.h Tue May 21 18:13:57 2013 (r250866) @@ -47,6 +47,7 @@ * How 'busy' to try and keep the hardware txq */ #define ATH_AGGR_MIN_QDEPTH 2 +#define ATH_NONAGGR_MIN_QDEPTH 32 /* * Watermark for scheduling TIDs in order to maximise aggregation. Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue May 21 18:02:54 2013 (r250865) +++ head/sys/dev/ath/if_athvar.h Tue May 21 18:13:57 2013 (r250866) @@ -814,16 +814,21 @@ struct ath_softc { int sc_txq_node_psq_maxdepth; /* - * Aggregation twiddles + * Software queue twiddles * - * hwq_limit: how busy to keep the hardware queue - don't schedule - * further packets to the hardware, regardless of the TID + * hwq_limit_nonaggr: + * when to begin limiting non-aggregate frames to the + * hardware queue, regardless of the TID. + * hwq_limit_aggr: + * when to begin limiting A-MPDU frames to the + * hardware queue, regardless of the TID. * tid_hwq_lo: how low the per-TID hwq count has to be before the * TID will be scheduled again * tid_hwq_hi: how many frames to queue to the HWQ before the TID * stops being scheduled. */ - int sc_hwq_limit; + int sc_hwq_limit_nonaggr; + int sc_hwq_limit_aggr; int sc_tid_hwq_lo; int sc_tid_hwq_hi; From owner-svn-src-all@FreeBSD.ORG Tue May 21 18:16:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 26A5C3C3; Tue, 21 May 2013 18:16:54 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) by mx1.freebsd.org (Postfix) with ESMTP id 420802DD; Tue, 21 May 2013 18:16:53 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id hr14so3087249wib.9 for ; Tue, 21 May 2013 11:16:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=hm5i1Z8yt1SIzJiUZNKDRmRmOVJvtiwmXytmew/U/v4=; b=ANFcNHTjQSOs0rMoVQ1NrPNqA5X6/AysQpEvUSlAeqXmQ5EaiJtPz9aS0GCPNgJ4PL N0mF0ir1sNFxUhzwcqXoAOXS3JofVM8ba4azhEQ/TH6hU8P+Fm7qyfTYg5GCf7lnJJFB Dg82v88ChmdcNrgSpUONbRsJ78KlUOM6t0PtIXHMkjPSloGBFmwZ5vqU4rp9BXbiB4cF AMsJImaFGGOE8MQh0AmZm0Q5ED7jhjmRYoCv7moumrOMzyP8pJG51X4Hy+11hx2bEIh6 UbV9fxCwWLrWEoX3oYD0UOmbkQJmzZCn2XPX/AMjJJ5jFsxpiro+gaOC/b/hI2DOP3Vo BWGA== MIME-Version: 1.0 X-Received: by 10.180.189.41 with SMTP id gf9mr7278518wic.32.1369160212223; Tue, 21 May 2013 11:16:52 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.107.9 with HTTP; Tue, 21 May 2013 11:16:51 -0700 (PDT) In-Reply-To: <20130521164200.GA1643@glenbarber.us> References: <201305211428.r4LES5L8018987@svn.freebsd.org> <20130521164200.GA1643@glenbarber.us> Date: Tue, 21 May 2013 11:16:51 -0700 X-Google-Sender-Auth: u4HXEBbt-gSy02wezg44QwVUMUg Message-ID: Subject: Re: svn commit: r250856 - head/sys/dev/ath/ath_hal/ar5416 From: Adrian Chadd To: Glen Barber Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 18:16:54 -0000 Yup, this should be fixed, thanks! Adrian On 21 May 2013 09:42, Glen Barber wrote: > On Tue, May 21, 2013 at 02:28:05PM +0000, Adrian Chadd wrote: >> Author: adrian >> Date: Tue May 21 14:28:05 2013 >> New Revision: 250856 >> URL: http://svnweb.freebsd.org/changeset/base/250856 >> >> Log: >> Fix build break - the SetCapability calls return HAL_BOOL, >> not HAL_STATUS. >> >> Modified: >> head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c >> >> Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c >> ============================================================================== >> --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue May 21 13:02:37 2013 (r250855) >> +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue May 21 14:28:05 2013 (r250856) >> @@ -504,7 +504,7 @@ ar5416SetCapability(struct ath_hal *ah, >> return AH_TRUE; >> case HAL_CAP_ENFORCE_TXOP: >> if (capability != 1) >> - return (HAL_ENOTSUPP); >> + return AH_FALSE; >> if (setting) { >> AH5212(ah)->ah_miscMode >> |= AR_PCU_TXOP_TBTT_LIMIT_ENA; > > This breaks tinderbox. > > /src/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c -I/src/sys/dev/ath > -I/src/sys/dev/ath/ath_hal > /src/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c:507:12: error: implicit > conversion from enumeration type 'HAL_STATUS' to different enumeration > type 'HAL_BOOL' [-Werror,-Wenum-conversion] > return (HAL_ENOTSUPP); > ~~~~~~ ^~~~~~~~~~~~ > 1 error generated. > *** Error code 1 > > Stop. > make: stopped in /obj/arm.arm/src/sys/LINT > > Glen > From owner-svn-src-all@FreeBSD.ORG Tue May 21 18:38:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B6493AA1; Tue, 21 May 2013 18:38:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A82233DD; Tue, 21 May 2013 18:38:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LIc9TU005951; Tue, 21 May 2013 18:38:09 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LIc9CL005950; Tue, 21 May 2013 18:38:09 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201305211838.r4LIc9CL005950@svn.freebsd.org> From: "Simon J. Gerraty" Date: Tue, 21 May 2013 18:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250867 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 18:38:09 -0000 Author: sjg Date: Tue May 21 18:38:09 2013 New Revision: 250867 URL: http://svnweb.freebsd.org/changeset/base/250867 Log: Mention the switch to bmake by default. Reviewed by: obrien Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue May 21 18:13:57 2013 (r250866) +++ head/UPDATING Tue May 21 18:38:09 2013 (r250867) @@ -31,6 +31,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130516: + Use bmake by default. + Whereas before one could choose to build with bmake via + -DWITH_BMAKE one must now use -DWITHOUT_BMAKE to use the old + make. The goal is to remove these knobs for 10-RELEASE. + + It is worth noting that bmake (like gmake) treats the command + line as the unit of failure, rather than statements within the + command line. Thus '(cd some/where && dosomething)' is safer + than 'cd some/where; dosomething'. The '()' allows consistent + behavior in parallel build. + 20130429: Fix a bug that allows NFS clients to issue READDIR on files. From owner-svn-src-all@FreeBSD.ORG Tue May 21 18:40:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 888CECB5; Tue, 21 May 2013 18:40:54 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7BC0B3FA; Tue, 21 May 2013 18:40:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LIesps008033; Tue, 21 May 2013 18:40:54 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LIesMk008032; Tue, 21 May 2013 18:40:54 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201305211840.r4LIesMk008032@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 21 May 2013 18:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250868 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 18:40:54 -0000 Author: jh Date: Tue May 21 18:40:54 2013 New Revision: 250868 URL: http://svnweb.freebsd.org/changeset/base/250868 Log: Remove an extra semicolon from the DOT language output. PR: kern/178540 Submitted by: Trond Endrestol MFC after: 1 week Modified: head/sys/geom/geom_dump.c Modified: head/sys/geom/geom_dump.c ============================================================================== --- head/sys/geom/geom_dump.c Tue May 21 18:38:09 2013 (r250867) +++ head/sys/geom/geom_dump.c Tue May 21 18:40:54 2013 (r250868) @@ -105,7 +105,7 @@ g_confdot(void *p, int flag ) sbuf_printf(sb, "digraph geom {\n"); LIST_FOREACH(mp, &g_classes, class) g_confdot_class(sb, mp); - sbuf_printf(sb, "};\n"); + sbuf_printf(sb, "}\n"); sbuf_finish(sb); } From owner-svn-src-all@FreeBSD.ORG Tue May 21 18:52:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 119C1FD5; Tue, 21 May 2013 18:52:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E8D7D647; Tue, 21 May 2013 18:52:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LIqbpX011805; Tue, 21 May 2013 18:52:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LIqb2M011804; Tue, 21 May 2013 18:52:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305211852.r4LIqb2M011804@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 May 2013 18:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250869 - vendor/flex/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 18:52:38 -0000 Author: jkim Date: Tue May 21 18:52:37 2013 New Revision: 250869 URL: http://svnweb.freebsd.org/changeset/base/250869 Log: Disable keyword expansion. Modified: Directory Properties: vendor/flex/dist/ABOUT-NLS (props changed) vendor/flex/dist/AUTHORS (props changed) vendor/flex/dist/COPYING (props changed) vendor/flex/dist/ChangeLog (props changed) vendor/flex/dist/FlexLexer.h (props changed) vendor/flex/dist/INSTALL (props changed) vendor/flex/dist/Makefile.am (props changed) vendor/flex/dist/Makefile.in (props changed) vendor/flex/dist/NEWS (props changed) vendor/flex/dist/ONEWS (props changed) vendor/flex/dist/README (props changed) vendor/flex/dist/README-alpha (props changed) vendor/flex/dist/README.cvs (props changed) vendor/flex/dist/THANKS (props changed) vendor/flex/dist/TODO (props changed) vendor/flex/dist/autogen.sh (props changed) vendor/flex/dist/buf.c (props changed) vendor/flex/dist/ccl.c (props changed) vendor/flex/dist/compile (props changed) vendor/flex/dist/conf.in (props changed) vendor/flex/dist/config.guess (props changed) vendor/flex/dist/config.rpath (props changed) vendor/flex/dist/config.sub (props changed) vendor/flex/dist/configure (props changed) vendor/flex/dist/configure.in (props changed) vendor/flex/dist/depcomp (props changed) vendor/flex/dist/dfa.c (props changed) vendor/flex/dist/ecs.c (props changed) vendor/flex/dist/filter.c (props changed) vendor/flex/dist/flex.skl (props changed) vendor/flex/dist/flexdef.h (props changed) vendor/flex/dist/flexint.h (props changed) vendor/flex/dist/gen.c (props changed) vendor/flex/dist/gettext.h (props changed) vendor/flex/dist/install-sh (props changed) vendor/flex/dist/libmain.c (props changed) vendor/flex/dist/libyywrap.c (props changed) vendor/flex/dist/main.c (props changed) vendor/flex/dist/misc.c (props changed) vendor/flex/dist/missing (props changed) vendor/flex/dist/mkinstalldirs (props changed) vendor/flex/dist/mkskel.sh (props changed) vendor/flex/dist/nfa.c (props changed) vendor/flex/dist/options.c (props changed) vendor/flex/dist/options.h (props changed) vendor/flex/dist/parse.c (props changed) vendor/flex/dist/parse.h (props changed) vendor/flex/dist/parse.y (props changed) vendor/flex/dist/regex.c (props changed) vendor/flex/dist/scan.c (props changed) vendor/flex/dist/scan.l (props changed) vendor/flex/dist/scanflags.c (props changed) vendor/flex/dist/scanopt.c (props changed) vendor/flex/dist/scanopt.h (props changed) vendor/flex/dist/skel.c (props changed) vendor/flex/dist/sym.c (props changed) vendor/flex/dist/tables.c (props changed) vendor/flex/dist/tables.h (props changed) vendor/flex/dist/tables_shared.c (props changed) vendor/flex/dist/tables_shared.h (props changed) vendor/flex/dist/tblcmp.c (props changed) vendor/flex/dist/version.h (props changed) vendor/flex/dist/ylwrap (props changed) vendor/flex/dist/yylex.c (props changed) From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:04:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A30AC5EA; Tue, 21 May 2013 19:04:18 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9477275D; Tue, 21 May 2013 19:04:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJ4Ij4015813; Tue, 21 May 2013 19:04:18 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJ4HpW015804; Tue, 21 May 2013 19:04:17 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305211904.r4LJ4HpW015804@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 21 May 2013 19:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250870 - in stable/9: . lib/libprocstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:04:18 -0000 Author: trociny Date: Tue May 21 19:04:16 2013 New Revision: 250870 URL: http://svnweb.freebsd.org/changeset/base/250870 Log: MFC r249666, r249667, r249670, r249672, r249674, r249676, r249677, r249679, r249681, r249684, r249688, r249711, r249731, r250146 r249666, r249682: Make libprocstat(3) extract procstat notes from a process core file. PR: kern/173723 Suggested by: jhb Glanced by: kib r249667: Add procstat_getvmmap function to get VM layout of a process. r249670: Add procstat_getgroups function to retrieve process groups. r249672: Add procstat_getumask function to retrieve a process umask. r249674: Add procstat_getrlimit function to retrieve a process resource limits info. r249676: Add procstat_getpathname function to retrieve a process executable. r249677: Add procstat_getosrel function to retrieve a process osrel info. r249679: Extend libprocstat with functions to retrieve process command line arguments and environment variables. Suggested by: stas Reviewed by: jhb and stas (initial version) r249681: Add procstat_getauxv function to retrieve a process auxiliary vector. r249684: Add procstat_getkstack function to dump kernel stacks of a process. r249688: Bump date. r249711 (joel): mdoc: end function context properly. r249731: Embed revision id in the library. r250146: KVM method support for procstat_getgroups, procstat_getumask, procstat_getrlimit, and procstat_getosrel. Added: stable/9/lib/libprocstat/core.c - copied, changed from r249666, head/lib/libprocstat/core.c stable/9/lib/libprocstat/core.h - copied, changed from r249666, head/lib/libprocstat/core.h Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/lib/libprocstat/Makefile stable/9/lib/libprocstat/Symbol.map stable/9/lib/libprocstat/libprocstat.3 stable/9/lib/libprocstat/libprocstat.c stable/9/lib/libprocstat/libprocstat.h stable/9/lib/libprocstat/libprocstat_internal.h Directory Properties: stable/9/lib/libprocstat/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Tue May 21 18:52:37 2013 (r250869) +++ stable/9/Makefile.inc1 Tue May 21 19:04:16 2013 (r250870) @@ -1371,7 +1371,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ ${_kerberos5_lib_libroken} \ lib/libbz2 lib/libcom_err lib/libcrypt \ - lib/libexpat \ + lib/libelf lib/libexpat \ ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ Modified: stable/9/lib/libprocstat/Makefile ============================================================================== --- stable/9/lib/libprocstat/Makefile Tue May 21 18:52:37 2013 (r250869) +++ stable/9/lib/libprocstat/Makefile Tue May 21 19:04:16 2013 (r250870) @@ -6,6 +6,7 @@ LIB= procstat SRCS= cd9660.c \ common_kvm.c \ + core.c \ libprocstat.c \ msdosfs.c \ ntfs.c \ @@ -19,8 +20,8 @@ INCS= libprocstat.h CFLAGS+= -I. -I${.CURDIR} -D_KVM_VNODE SHLIB_MAJOR= 1 -DPADD= ${LIBKVM} ${LIBUTIL} -LDADD= -lkvm -lutil +DPADD= ${LIBELF} ${LIBKVM} ${LIBUTIL} +LDADD= -lelf -lkvm -lutil MAN= libprocstat.3 Modified: stable/9/lib/libprocstat/Symbol.map ============================================================================== --- stable/9/lib/libprocstat/Symbol.map Tue May 21 18:52:37 2013 (r250869) +++ stable/9/lib/libprocstat/Symbol.map Tue May 21 19:04:16 2013 (r250870) @@ -16,5 +16,22 @@ FBSD_1.2 { }; FBSD_1.3 { + procstat_freeargv; + procstat_freeauxv; + procstat_freeenvv; + procstat_freegroups; + procstat_freekstack; + procstat_freevmmap; procstat_get_shm_info; + procstat_getargv; + procstat_getauxv; + procstat_getenvv; + procstat_getgroups; + procstat_getkstack; + procstat_getosrel; + procstat_getpathname; + procstat_getrlimit; + procstat_getumask; + procstat_getvmmap; + procstat_open_core; }; Copied and modified: stable/9/lib/libprocstat/core.c (from r249666, head/lib/libprocstat/core.c) ============================================================================== --- head/lib/libprocstat/core.c Sat Apr 20 07:47:26 2013 (r249666, copy source) +++ stable/9/lib/libprocstat/core.c Tue May 21 19:04:16 2013 (r250870) @@ -22,12 +22,14 @@ * 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 +__FBSDID("$FreeBSD$"); + #include #include +#include #include #include @@ -56,6 +58,10 @@ struct procstat_core static bool core_offset(struct procstat_core *core, off_t offset); static bool core_read(struct procstat_core *core, void *buf, size_t len); +static ssize_t core_read_mem(struct procstat_core *core, void *buf, + size_t len, vm_offset_t addr, bool readall); +static void *get_args(struct procstat_core *core, vm_offset_t psstrings, + enum psc_type type, void *buf, size_t *lenp); struct procstat_core * procstat_core_open(const char *filename) @@ -146,6 +152,7 @@ procstat_core_get(struct procstat_core * { Elf_Note nhdr; off_t offset, eoffset; + vm_offset_t psstrings; void *freebuf; size_t len; u_int32_t n_type; @@ -167,6 +174,32 @@ procstat_core_get(struct procstat_core * n_type = NT_PROCSTAT_VMMAP; structsize = sizeof(struct kinfo_vmentry); break; + case PSC_TYPE_GROUPS: + n_type = NT_PROCSTAT_GROUPS; + structsize = sizeof(gid_t); + break; + case PSC_TYPE_UMASK: + n_type = NT_PROCSTAT_UMASK; + structsize = sizeof(u_short); + break; + case PSC_TYPE_RLIMIT: + n_type = NT_PROCSTAT_RLIMIT; + structsize = sizeof(struct rlimit) * RLIM_NLIMITS; + break; + case PSC_TYPE_OSREL: + n_type = NT_PROCSTAT_OSREL; + structsize = sizeof(int); + break; + case PSC_TYPE_PSSTRINGS: + case PSC_TYPE_ARGV: + case PSC_TYPE_ENVV: + n_type = NT_PROCSTAT_PSSTRINGS; + structsize = sizeof(vm_offset_t); + break; + case PSC_TYPE_AUXV: + n_type = NT_PROCSTAT_AUXV; + structsize = sizeof(Elf_Auxinfo); + break; default: warnx("unknown core stat type: %d", type); return (NULL); @@ -222,6 +255,19 @@ procstat_core_get(struct procstat_core * free(freebuf); return (NULL); } + if (type == PSC_TYPE_ARGV || type == PSC_TYPE_ENVV) { + if (len < sizeof(psstrings)) { + free(freebuf); + return (NULL); + } + psstrings = *(vm_offset_t *)buf; + if (freebuf == NULL) + len = *lenp; + else + buf = NULL; + free(freebuf); + buf = get_args(core, psstrings, type, buf, &len); + } *lenp = len; return (buf); } @@ -260,3 +306,128 @@ core_read(struct procstat_core *core, vo } return (true); } + +static ssize_t +core_read_mem(struct procstat_core *core, void *buf, size_t len, + vm_offset_t addr, bool readall) +{ + GElf_Phdr phdr; + off_t offset; + int i; + + assert(core->pc_magic == PROCSTAT_CORE_MAGIC); + + for (i = 0; i < core->pc_ehdr.e_phnum; i++) { + if (gelf_getphdr(core->pc_elf, i, &phdr) != &phdr) { + warnx("gelf_getphdr: %s", elf_errmsg(-1)); + return (-1); + } + if (phdr.p_type != PT_LOAD) + continue; + if (addr < phdr.p_vaddr || addr > phdr.p_vaddr + phdr.p_memsz) + continue; + offset = phdr.p_offset + (addr - phdr.p_vaddr); + if ((phdr.p_vaddr + phdr.p_memsz) - addr < len) { + if (readall) { + warnx("format error: " + "attempt to read out of segment"); + return (-1); + } + len = (phdr.p_vaddr + phdr.p_memsz) - addr; + } + if (!core_offset(core, offset)) + return (-1); + if (!core_read(core, buf, len)) + return (-1); + return (len); + } + warnx("format error: address %ju not found", (uintmax_t)addr); + return (-1); +} + +#define ARGS_CHUNK_SZ 256 /* Chunk size (bytes) for get_args operations. */ + +static void * +get_args(struct procstat_core *core, vm_offset_t psstrings, enum psc_type type, + void *args, size_t *lenp) +{ + struct ps_strings pss; + void *freeargs; + vm_offset_t addr; + char **argv, *p; + size_t chunksz, done, len, nchr, size; + ssize_t n; + u_int i, nstr; + + assert(type == PSC_TYPE_ARGV || type == PSC_TYPE_ENVV); + + if (core_read_mem(core, &pss, sizeof(pss), psstrings, true) == -1) + return (NULL); + if (type == PSC_TYPE_ARGV) { + addr = (vm_offset_t)pss.ps_argvstr; + nstr = pss.ps_nargvstr; + } else /* type == PSC_TYPE_ENVV */ { + addr = (vm_offset_t)pss.ps_envstr; + nstr = pss.ps_nenvstr; + } + if (addr == 0 || nstr == 0) + return (NULL); + if (nstr > ARG_MAX) { + warnx("format error"); + return (NULL); + } + size = nstr * sizeof(char *); + argv = malloc(size); + if (argv == NULL) { + warn("malloc(%zu)", size); + return (NULL); + } + done = 0; + freeargs = NULL; + if (core_read_mem(core, argv, size, addr, true) == -1) + goto fail; + if (args != NULL) { + nchr = MIN(ARG_MAX, *lenp); + } else { + nchr = ARG_MAX; + freeargs = args = malloc(nchr); + if (args == NULL) { + warn("malloc(%zu)", nchr); + goto fail; + } + } + p = args; + for (i = 0; ; i++) { + if (i == nstr) + goto done; + /* + * The program may have scribbled into its argv array, e.g. to + * remove some arguments. If that has happened, break out + * before trying to read from NULL. + */ + if (argv[i] == NULL) + goto done; + for (addr = (vm_offset_t)argv[i]; ; addr += chunksz) { + chunksz = MIN(ARGS_CHUNK_SZ, nchr - 1 - done); + if (chunksz <= 0) + goto done; + n = core_read_mem(core, p, chunksz, addr, false); + if (n == -1) + goto fail; + len = strnlen(p, chunksz); + p += len; + done += len; + if (len != chunksz) + break; + } + *p++ = '\0'; + done++; + } +fail: + free(freeargs); + args = NULL; +done: + *lenp = done; + free(argv); + return (args); +} Copied and modified: stable/9/lib/libprocstat/core.h (from r249666, head/lib/libprocstat/core.h) ============================================================================== --- head/lib/libprocstat/core.h Sat Apr 20 07:47:26 2013 (r249666, copy source) +++ stable/9/lib/libprocstat/core.h Tue May 21 19:04:16 2013 (r250870) @@ -33,6 +33,14 @@ enum psc_type { PSC_TYPE_PROC, PSC_TYPE_FILES, PSC_TYPE_VMMAP, + PSC_TYPE_GROUPS, + PSC_TYPE_UMASK, + PSC_TYPE_RLIMIT, + PSC_TYPE_OSREL, + PSC_TYPE_PSSTRINGS, + PSC_TYPE_ARGV, + PSC_TYPE_ENVV, + PSC_TYPE_AUXV, }; struct procstat_core; Modified: stable/9/lib/libprocstat/libprocstat.3 ============================================================================== --- stable/9/lib/libprocstat/libprocstat.3 Tue May 21 18:52:37 2013 (r250869) +++ stable/9/lib/libprocstat/libprocstat.3 Tue May 21 19:04:16 2013 (r250870) @@ -24,17 +24,33 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2012 +.Dd April 20, 2013 .Dt LIBPROCSTAT 3 .Os .Sh NAME +.Nm procstat_open_core , .Nm procstat_open_kvm , .Nm procstat_open_sysctl , .Nm procstat_close , +.Nm procstat_getargv , +.Nm procstat_getauxv , +.Nm procstat_getenvv , .Nm procstat_getfiles , +.Nm procstat_getgroups , +.Nm procstat_getkstack , +.Nm procstat_getosrel , +.Nm procstat_getpathname , .Nm procstat_getprocs , +.Nm procstat_getumask , +.Nm procstat_getvmmap , +.Nm procstat_freeargv , +.Nm procstat_freeauxv , +.Nm procstat_freeenvv , .Nm procstat_freefiles , +.Nm procstat_freegroups , +.Nm procstat_freekstack , .Nm procstat_freeprocs , +.Nm procstat_freevmmap , .Nm procstat_get_pipe_info , .Nm procstat_get_pts_info , .Nm procstat_get_shm_info , @@ -50,12 +66,40 @@ .Ft void .Fn procstat_close "struct procstat *procstat" .Ft void +.Fo procstat_freeargv +.Fa "struct procstat *procstat" +.Fc +.Ft void +.Fo procstat_freeauxv +.Fa "struct procstat *procstat" +.Fa "Elf_Auxinfo *auxv" +.Fc +.Ft void +.Fo procstat_freeenvv +.Fa "struct procstat *procstat" +.Fc +.Ft void .Fo procstat_freefiles .Fa "struct procstat *procstat" .Fa "struct filestat_list *head" .Fc .Ft void +.Fo procstat_freegroups +.Fa "struct procstat *procstat" +.Fa "gid_t *groups" +.Fc +.Ft void +.Fo procstat_freekstack +.Fa "struct procstat *procstat" +.Fa "struct kinfo_kstack *kkstp" +.Fc +.Ft void .Fn procstat_freeprocs "struct procstat *procstat" "struct kinfo_proc *p" +.Ft void +.Fo procstat_freevmmap +.Fa "struct procstat *procstat" +.Fa "struct kinfo_vmentry *vmmap" +.Fc .Ft int .Fo procstat_get_pipe_info .Fa "struct procstat *procstat" @@ -91,12 +135,50 @@ .Fa "struct vnstat *vn" .Fa "char *errbuf" .Fc +.Ft "char **" +.Fo procstat_getargv +.Fa "struct procstat *procstat" +.Fa "const struct kinfo_proc *kp" +.Fa "size_t nchr" +.Fa "char *errbuf" +.Fc +.Ft "Elf_Auxinfo *" +.Fo procstat_getauxv +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "unsigned int *count" +.Fc +.Ft "char **" +.Fo procstat_getenvv +.Fa "struct procstat *procstat" +.Fa "const struct kinfo_proc *kp" +.Fa "size_t nchr" +.Fa "char *errbuf" +.Fc .Ft "struct filestat_list *" .Fo procstat_getfiles .Fa "struct procstat *procstat" .Fa "struct kinfo_proc *kp" .Fa "int mmapped" .Fc +.Ft "gid_t *" +.Fo procstat_getgroups +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "unsigned int *count" +.Fc +.Ft int +.Fo procstat_getosrel +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "int *osrelp" +.Fc +.Ft "struct kinfo_kstack *" +.Fo procstat_getkstack +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "unsigned int *count" +.Fc .Ft "struct kinfo_proc *" .Fo procstat_getprocs .Fa "struct procstat *procstat" @@ -104,6 +186,34 @@ .Fa "int arg" .Fa "unsigned int *count" .Fc +.Ft "int" +.Fo procstat_getpathname +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "char *pathname" +.Fa "size_t maxlen" +.Fc +.Ft "int" +.Fo procstat_getrlimit +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "int which" +.Fa "struct rlimit* rlimit" +.Fc +.Ft "int" +.Fo procstat_getumask +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "unsigned short *maskp" +.Fc +.Ft "struct kinfo_vmentry *" +.Fo procstat_getvmmap +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "unsigned int *count" +.Fc +.Ft "struct procstat *" +.Fn procstat_open_core "const char *filename" .Ft "struct procstat *" .Fn procstat_open_kvm "const char *nlistf" "const char *memf" .Ft "struct procstat *" @@ -116,7 +226,11 @@ retrieval from the running kernel via th .Xr sysctl 3 library backend, and for post-mortem analysis via the .Xr kvm 3 -library backend. +library backend, or from the process +.Xr core 5 +file, searching for statistics in special +.Xr elf 3 +note sections. .Pp The .Fn procstat_open_kvm @@ -129,6 +243,16 @@ or library routines, respectively, to access kernel state information used to retrieve processes and files states. The +.Fn procstat_open_core +uses +.Xr elf 3 +routines to access statistics stored as a set of notes in a process +.Xr core 5 +file, written by the kernel at the moment of the process abnormal termination. +The +.Fa filename +argument is the process core file name. +The .Fa nlistf argument is the executable image of the kernel being examined. If this argument is @@ -145,7 +269,7 @@ is assumed. See .Xr kvm_open 3 for more details. -Both functions dynamically allocate and return a +The functions dynamically allocate and return a .Vt procstat structure pointer used in the rest of the .Nm libprocstat @@ -179,6 +303,63 @@ The caller is responsible to free the al function call. .Pp The +.Fn procstat_getargv +function gets a pointer to the +.Vt procstat +structure from one of the +.Fn procstat_open_* +functions, a pointer to +.Vt kinfo_proc +structure from the array obtained from the +.Fn kvm_getprocs +function, and returns a null-terminated argument vector that corresponds to +the command line arguments passed to the process. +The +.Fa nchr +argument indicates the maximum number of characters, including null bytes, +to use in building the strings. +If this amount is exceeded, the string causing the overflow is truncated and +the partial result is returned. +This is handy for programs that print only a one line summary of a +command and should not copy out large amounts of text only to ignore it. +If +.Fa nchr +is zero, no limit is imposed and all argument strings are returned. +The values of the returned argument vector refer the strings stored +in the +.Vt procstat +internal buffer. +A subsequent call of the function with the same +.Vt procstat +argument will reuse the buffer. +To free the allocated memory +.Fn procstat_freeargv +function call can be used, or it will be released on +.Fn procstat_close . +.Pp +The +.Fn procstat_getenvv +function is similar to +.Fn procstat_getargv +but returns the vector of environment strings. +The caller may free the allocated memory with a subsequent +.Fn procstat_freeenv +function call. +.Pp +The +.Fn procstat_getauxv +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, and returns the auxiliary vector as a dynamically allocated array of +.Vt Elf_Auxinfo +elements. +The caller is responsible to free the allocated memory with a subsequent +.Fn procstat_freeauxv +function call. +.Pp +The .Fn procstat_getfiles function gets a pointer to the .Vt procstat @@ -197,6 +378,89 @@ The caller is responsible to free the al function call. .Pp The +.Fn procstat_getgroups +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, and returns the process groups as a dynamically allocated array of +.Vt gid_t +elements. +The caller is responsible to free the allocated memory with a subsequent +.Fn procstat_freegroups +function call. +.Pp +The +.Fn procstat_getkstack +function gets a pointer to the +.Vt procstat +structure initialized with one of the +.Fn procstat_open_* +functions, a pointer to +.Vt kinfo_proc +structure, and returns kernel stacks of the process as a dynamically allocated +array of +.Vt kinfo_kstack +structures. +The caller is responsible to free the allocated memory with a subsequent +.Fn procstat_freekstack +function call. +.Pp +The +.Fn procstat_getosrel +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, and returns osrel date in the 3rd reference parameter. +.Pp +The +.Fn procstat_getpathname +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, and copies the path of the process executable to +.Fa pathname +buffer, limiting to +.Fa maxlen +characters. +.Pp +The +.Fn procstat_getrlimit +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, resource index +.Fa which , +and returns the actual resource limit in the 4th reference parameter. +.Pp +The +.Fn procstat_getumask +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, and returns the process umask in the 3rd reference parameter. +.Pp +The +.Fn procstat_getvmmap +function gets a pointer to the +.Vt procstat +structure initialized with one of the +.Fn procstat_open_* +functions, a pointer to +.Vt kinfo_proc +structure, and returns VM layout of the process as a dynamically allocated +array of +.Vt kinfo_vmentry +structures. +The caller is responsible to free the allocated memory with a subsequent +.Fn procstat_freevmmap +function call. +.Pp +The .Fn procstat_get_pipe_info , .Fn procstat_get_pts_info , .Fn procstat_get_shm_info , @@ -250,10 +514,12 @@ argument indicates an actual error messa .Xr pipe 2 , .Xr shm_open 2 , .Xr socket 2 , +.Xr elf 3 , .Xr kvm 3 , .Xr queue 3 , .Xr sysctl 3 , .Xr pts 4 , +.Xr core 5 , .Xr vnode 9 .Sh HISTORY The Modified: stable/9/lib/libprocstat/libprocstat.c ============================================================================== --- stable/9/lib/libprocstat/libprocstat.c Tue May 21 18:52:37 2013 (r250869) +++ stable/9/lib/libprocstat/libprocstat.c Tue May 21 19:04:16 2013 (r250870) @@ -36,7 +36,12 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#include +#define _WANT_UCRED +#include +#undef _WANT_UCRED #include #include #include @@ -96,13 +101,22 @@ __FBSDID("$FreeBSD$"); #include #include "libprocstat_internal.h" #include "common_kvm.h" +#include "core.h" int statfs(const char *, struct statfs *); /* XXX */ #define PROCSTAT_KVM 1 #define PROCSTAT_SYSCTL 2 +#define PROCSTAT_CORE 3 +static char **getargv(struct procstat *procstat, struct kinfo_proc *kp, + size_t nchr, int env); static char *getmnton(kvm_t *kd, struct mount *m); +static struct kinfo_vmentry * kinfo_getvmmap_core(struct procstat_core *core, + int *cntp); +static Elf_Auxinfo *procstat_getauxv_core(struct procstat_core *core, + unsigned int *cntp); +static Elf_Auxinfo *procstat_getauxv_sysctl(pid_t pid, unsigned int *cntp); static struct filestat_list *procstat_getfiles_kvm( struct procstat *procstat, struct kinfo_proc *kp, int mmapped); static struct filestat_list *procstat_getfiles_sysctl( @@ -128,6 +142,33 @@ static int procstat_get_vnode_info_kvm(k struct vnstat *vn, char *errbuf); static int procstat_get_vnode_info_sysctl(struct filestat *fst, struct vnstat *vn, char *errbuf); +static gid_t *procstat_getgroups_core(struct procstat_core *core, + unsigned int *count); +static gid_t * procstat_getgroups_kvm(kvm_t *kd, struct kinfo_proc *kp, + unsigned int *count); +static gid_t *procstat_getgroups_sysctl(pid_t pid, unsigned int *count); +static struct kinfo_kstack *procstat_getkstack_sysctl(pid_t pid, + int *cntp); +static int procstat_getosrel_core(struct procstat_core *core, + int *osrelp); +static int procstat_getosrel_kvm(kvm_t *kd, struct kinfo_proc *kp, + int *osrelp); +static int procstat_getosrel_sysctl(pid_t pid, int *osrelp); +static int procstat_getpathname_core(struct procstat_core *core, + char *pathname, size_t maxlen); +static int procstat_getpathname_sysctl(pid_t pid, char *pathname, + size_t maxlen); +static int procstat_getrlimit_core(struct procstat_core *core, int which, + struct rlimit* rlimit); +static int procstat_getrlimit_kvm(kvm_t *kd, struct kinfo_proc *kp, + int which, struct rlimit* rlimit); +static int procstat_getrlimit_sysctl(pid_t pid, int which, + struct rlimit* rlimit); +static int procstat_getumask_core(struct procstat_core *core, + unsigned short *maskp); +static int procstat_getumask_kvm(kvm_t *kd, struct kinfo_proc *kp, + unsigned short *maskp); +static int procstat_getumask_sysctl(pid_t pid, unsigned short *maskp); static int vntype2psfsttype(int type); void @@ -137,6 +178,10 @@ procstat_close(struct procstat *procstat assert(procstat); if (procstat->type == PROCSTAT_KVM) kvm_close(procstat->kd); + else if (procstat->type == PROCSTAT_CORE) + procstat_core_close(procstat->core); + procstat_freeargv(procstat); + procstat_freeenvv(procstat); free(procstat); } @@ -177,6 +222,27 @@ procstat_open_kvm(const char *nlistf, co return (procstat); } +struct procstat * +procstat_open_core(const char *filename) +{ + struct procstat *procstat; + struct procstat_core *core; + + procstat = calloc(1, sizeof(*procstat)); + if (procstat == NULL) { + warn("malloc()"); + return (NULL); + } + core = procstat_core_open(filename); + if (core == NULL) { + free(procstat); + return (NULL); + } + procstat->type = PROCSTAT_CORE; + procstat->core = core; + return (procstat); +} + struct kinfo_proc * procstat_getprocs(struct procstat *procstat, int what, int arg, unsigned int *count) @@ -231,6 +297,15 @@ procstat_getprocs(struct procstat *procs } /* Perform simple consistency checks. */ if ((len % sizeof(*p)) != 0 || p->ki_structsize != sizeof(*p)) { + warnx("kinfo_proc structure size mismatch (len = %zu)", len); + goto fail; + } + *count = len / sizeof(*p); + return (p); + } else if (procstat->type == PROCSTAT_CORE) { + p = procstat_core_get(procstat->core, PSC_TYPE_PROC, NULL, + &len); + if ((len % sizeof(*p)) != 0 || p->ki_structsize != sizeof(*p)) { warnx("kinfo_proc structure size mismatch"); goto fail; } @@ -258,13 +333,17 @@ procstat_freeprocs(struct procstat *proc struct filestat_list * procstat_getfiles(struct procstat *procstat, struct kinfo_proc *kp, int mmapped) { - - if (procstat->type == PROCSTAT_SYSCTL) - return (procstat_getfiles_sysctl(procstat, kp, mmapped)); - else if (procstat->type == PROCSTAT_KVM) + + switch(procstat->type) { + case PROCSTAT_KVM: return (procstat_getfiles_kvm(procstat, kp, mmapped)); - else + case PROCSTAT_SYSCTL: + case PROCSTAT_CORE: + return (procstat_getfiles_sysctl(procstat, kp, mmapped)); + default: + warnx("unknown access method: %d", procstat->type); return (NULL); + } } void @@ -647,8 +726,62 @@ kinfo_uflags2fst(int fd) return (0); } +static struct kinfo_file * +kinfo_getfile_core(struct procstat_core *core, int *cntp) +{ + int cnt; + size_t len; + char *buf, *bp, *eb; + struct kinfo_file *kif, *kp, *kf; + + buf = procstat_core_get(core, PSC_TYPE_FILES, NULL, &len); + if (buf == NULL) + return (NULL); + /* + * XXXMG: The code below is just copy&past from libutil. + * The code duplication can be avoided if libutil + * is extended to provide something like: + * struct kinfo_file *kinfo_getfile_from_buf(const char *buf, + * size_t len, int *cntp); + */ + + /* Pass 1: count items */ + cnt = 0; + bp = buf; + eb = buf + len; + while (bp < eb) { + kf = (struct kinfo_file *)(uintptr_t)bp; + bp += kf->kf_structsize; + cnt++; + } + + kif = calloc(cnt, sizeof(*kif)); + if (kif == NULL) { + free(buf); + return (NULL); + } + bp = buf; + eb = buf + len; + kp = kif; + /* Pass 2: unpack */ + while (bp < eb) { + kf = (struct kinfo_file *)(uintptr_t)bp; + /* Copy/expand into pre-zeroed buffer */ + memcpy(kp, kf, kf->kf_structsize); + /* Advance to next packed record */ + bp += kf->kf_structsize; + /* Set field size to fixed length, advance */ + kp->kf_structsize = sizeof(*kp); + kp++; + } + free(buf); + *cntp = cnt; + return (kif); /* Caller must free() return value */ +} + static struct filestat_list * -procstat_getfiles_sysctl(struct procstat *procstat, struct kinfo_proc *kp, int mmapped) +procstat_getfiles_sysctl(struct procstat *procstat, struct kinfo_proc *kp, + int mmapped) { struct kinfo_file *kif, *files; struct kinfo_vmentry *kve, *vmentries; @@ -664,8 +797,16 @@ procstat_getfiles_sysctl(struct procstat assert(kp); if (kp->ki_fd == NULL) return (NULL); - - files = kinfo_getfile(kp->ki_pid, &cnt); + switch(procstat->type) { + case PROCSTAT_SYSCTL: + files = kinfo_getfile(kp->ki_pid, &cnt); + break; + case PROCSTAT_CORE: + files = kinfo_getfile_core(procstat->core, &cnt); + break; + default: + assert(!"invalid type"); + } if (files == NULL && errno != EPERM) { warn("kinfo_getfile()"); return (NULL); @@ -703,7 +844,7 @@ procstat_getfiles_sysctl(struct procstat STAILQ_INSERT_TAIL(head, entry, next); } if (mmapped != 0) { - vmentries = kinfo_getvmmap(kp->ki_pid, &cnt); + vmentries = procstat_getvmmap(procstat, kp, &cnt); procstat->vmentries = vmentries; if (vmentries == NULL || cnt == 0) goto fail; @@ -743,7 +884,8 @@ procstat_get_pipe_info(struct procstat * if (procstat->type == PROCSTAT_KVM) { return (procstat_get_pipe_info_kvm(procstat->kd, fst, ps, errbuf)); - } else if (procstat->type == PROCSTAT_SYSCTL) { + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { return (procstat_get_pipe_info_sysctl(fst, ps, errbuf)); } else { warnx("unknown access method: %d", procstat->type); @@ -807,7 +949,8 @@ procstat_get_pts_info(struct procstat *p if (procstat->type == PROCSTAT_KVM) { return (procstat_get_pts_info_kvm(procstat->kd, fst, pts, errbuf)); - } else if (procstat->type == PROCSTAT_SYSCTL) { + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { return (procstat_get_pts_info_sysctl(fst, pts, errbuf)); } else { warnx("unknown access method: %d", procstat->type); @@ -869,7 +1012,8 @@ procstat_get_shm_info(struct procstat *p if (procstat->type == PROCSTAT_KVM) { return (procstat_get_shm_info_kvm(procstat->kd, fst, shm, errbuf)); - } else if (procstat->type == PROCSTAT_SYSCTL) { + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { return (procstat_get_shm_info_sysctl(fst, shm, errbuf)); } else { warnx("unknown access method: %d", procstat->type); @@ -949,7 +1093,8 @@ procstat_get_vnode_info(struct procstat if (procstat->type == PROCSTAT_KVM) { return (procstat_get_vnode_info_kvm(procstat->kd, fst, vn, errbuf)); - } else if (procstat->type == PROCSTAT_SYSCTL) { + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { return (procstat_get_vnode_info_sysctl(fst, vn, errbuf)); } else { warnx("unknown access method: %d", procstat->type); @@ -1156,7 +1301,8 @@ procstat_get_socket_info(struct procstat if (procstat->type == PROCSTAT_KVM) { return (procstat_get_socket_info_kvm(procstat->kd, fst, sock, errbuf)); - } else if (procstat->type == PROCSTAT_SYSCTL) { + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { return (procstat_get_socket_info_sysctl(fst, sock, errbuf)); } else { warnx("unknown access method: %d", procstat->type); @@ -1407,3 +1553,866 @@ getmnton(kvm_t *kd, struct mount *m) mhead = mt; return (mt->mntonname); } + +/* + * Auxiliary structures and functions to get process environment or + * command line arguments. + */ +struct argvec { + char *buf; + size_t bufsize; + char **argv; + size_t argc; +}; + +static struct argvec * +argvec_alloc(size_t bufsize) +{ + struct argvec *av; + + av = malloc(sizeof(*av)); + if (av == NULL) + return (NULL); + av->bufsize = bufsize; + av->buf = malloc(av->bufsize); + if (av->buf == NULL) { + free(av); + return (NULL); + } + av->argc = 32; + av->argv = malloc(sizeof(char *) * av->argc); + if (av->argv == NULL) { + free(av->buf); + free(av); + return (NULL); + } + return av; +} + +static void +argvec_free(struct argvec * av) +{ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:05:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9089C769; Tue, 21 May 2013 19:05:30 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 824CB76A; Tue, 21 May 2013 19:05:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJ5U6h016174; Tue, 21 May 2013 19:05:30 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJ5SU6016158; Tue, 21 May 2013 19:05:28 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305211905.r4LJ5SU6016158@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 21 May 2013 19:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250871 - stable/9/usr.bin/procstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:05:30 -0000 Author: trociny Date: Tue May 21 19:05:27 2013 New Revision: 250871 URL: http://svnweb.freebsd.org/changeset/base/250871 Log: MFC r249668, r249669, r249671, r249673, r249675, r249678, r249680, r249683, r249685, r249686: r249668: Use procstat_getprocs(3) for retrieving thread information instead of direct sysctl calls. r249669: Use more generic procstat_getvmmap(3) for retrieving VM layout of a process. r249671: Use procstat_getgroups(3) for retrieving groups information instead of direct sysctl. r249673: Use procstat_getumask(3) for retrieving umaks information instead of direct sysctl. r249675: Use procstat_getrlimit(3) for retrieving rlimit information instead of direct sysctl calls. r249678: Use libprocstat(3) when retrieving binary information for a process. r249680: Use libprocstat(3) to retrieve process command line arguments and environment variables. r249683: Use libprocstat(3) to retrieve ELF auxiliary vector. r249685: Use procstat_getkstack(3) for retrieving process kernel stacks instead of direct sysctl calls. r249686: Make use of newly added libprocstat(3) ability to extract procstat info from a process core file. So now one can run procstat(1) on a process core e.g. to get a list of files opened by a process when it crashed: root@lisa:/ # procstat -f /root/vi.core PID COMM FD T V FLAGS REF OFFSET PRO NAME 658 vi text v r r-------- - - - /usr/bin/vi 658 vi ctty v c rw------- - - - /dev/pts/0 658 vi cwd v d r-------- - - - /root 658 vi root v d r-------- - - - / 658 vi 0 v c rw------- 11 3208 - /dev/pts/0 658 vi 1 v c rw------- 11 3208 - /dev/pts/0 658 vi 2 v c rw------- 11 3208 - /dev/pts/0 658 vi 3 v r r----n-l- 1 0 - /tmp/vi.0AYKz3Lps7 658 vi 4 v r rw------- 1 0 - /var/tmp/vi.recover/vi.GaGYsz 658 vi 5 v r rw------- 1 0 - - PR: kern/173723 Suggested by: jhb Modified: stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat.c stable/9/usr.bin/procstat/procstat.h stable/9/usr.bin/procstat/procstat_args.c stable/9/usr.bin/procstat/procstat_auxv.c stable/9/usr.bin/procstat/procstat_bin.c stable/9/usr.bin/procstat/procstat_cred.c stable/9/usr.bin/procstat/procstat_kstack.c stable/9/usr.bin/procstat/procstat_rlimit.c stable/9/usr.bin/procstat/procstat_sigs.c stable/9/usr.bin/procstat/procstat_threads.c stable/9/usr.bin/procstat/procstat_vm.c Directory Properties: stable/9/usr.bin/procstat/ (props changed) Modified: stable/9/usr.bin/procstat/procstat.1 ============================================================================== --- stable/9/usr.bin/procstat/procstat.1 Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat.1 Tue May 21 19:05:27 2013 (r250871) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 11, 2012 +.Dd April 20, 2013 .Dt PROCSTAT 1 .Os .Sh NAME @@ -38,7 +38,7 @@ .Op Fl C .Op Fl w Ar interval .Op Fl b | c | e | f | i | j | k | l | s | t | v | x -.Op Fl a | Ar pid ... +.Op Fl a | Ar pid | Ar core ... .Sh DESCRIPTION The .Nm @@ -47,6 +47,8 @@ utility displays detailed information ab arguments, or if the .Fl a flag is used, all processes. +It can also display information extracted from a process core file, if +the core file is specified as the argument. .Pp By default, basic process statistics are printed; one of the following options may be specified in order to select more detailed process information Modified: stable/9/usr.bin/procstat/procstat.c ============================================================================== --- stable/9/usr.bin/procstat/procstat.c Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat.c Tue May 21 19:05:27 2013 (r250871) @@ -50,7 +50,7 @@ usage(void) fprintf(stderr, "usage: procstat [-h] [-C] [-M core] [-N system] " "[-w interval] \n"); fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " - "-l | -s | -t | -v | -x] [-a | pid ...]\n"); + "-l | -s | -t | -v | -x] [-a | pid | core ...]\n"); exit(EX_USAGE); } @@ -59,11 +59,11 @@ procstat(struct procstat *prstat, struct { if (bflag) - procstat_bin(kipp); + procstat_bin(prstat, kipp); else if (cflag) - procstat_args(kipp); + procstat_args(prstat, kipp); else if (eflag) - procstat_env(kipp); + procstat_env(prstat, kipp); else if (fflag) procstat_files(prstat, kipp); else if (iflag) @@ -71,17 +71,17 @@ procstat(struct procstat *prstat, struct else if (jflag) procstat_threads_sigs(prstat, kipp); else if (kflag) - procstat_kstack(kipp, kflag); + procstat_kstack(prstat, kipp, kflag); else if (lflag) - procstat_rlimit(kipp); + procstat_rlimit(prstat, kipp); else if (sflag) - procstat_cred(kipp); + procstat_cred(prstat, kipp); else if (tflag) - procstat_threads(kipp); + procstat_threads(prstat, kipp); else if (vflag) - procstat_vm(kipp); + procstat_vm(prstat, kipp); else if (xflag) - procstat_auxv(kipp); + procstat_auxv(prstat, kipp); else procstat_basic(kipp); } @@ -116,7 +116,7 @@ main(int argc, char *argv[]) int ch, interval, tmp; int i; struct kinfo_proc *p; - struct procstat *prstat; + struct procstat *prstat, *cprstat; long l; pid_t pid; char *dummy; @@ -255,19 +255,32 @@ main(int argc, char *argv[]) } for (i = 0; i < argc; i++) { l = strtol(argv[i], &dummy, 10); - if (*dummy != '\0') - usage(); - if (l < 0) - usage(); - pid = l; - - p = procstat_getprocs(prstat, KERN_PROC_PID, pid, &cnt); - if (p == NULL) - errx(1, "procstat_getprocs()"); - if (cnt != 0) - procstat(prstat, p); - procstat_freeprocs(prstat, p); - + if (*dummy == '\0') { + if (l < 0) + usage(); + pid = l; + + p = procstat_getprocs(prstat, KERN_PROC_PID, pid, &cnt); + if (p == NULL) + errx(1, "procstat_getprocs()"); + if (cnt != 0) + procstat(prstat, p); + procstat_freeprocs(prstat, p); + } else { + cprstat = procstat_open_core(argv[i]); + if (cprstat == NULL) { + warnx("procstat_open()"); + continue; + } + p = procstat_getprocs(cprstat, KERN_PROC_PID, + -1, &cnt); + if (p == NULL) + errx(1, "procstat_getprocs()"); + if (cnt != 0) + procstat(cprstat, p); + procstat_freeprocs(cprstat, p); + procstat_close(cprstat); + } /* Suppress header after first process. */ hflag = 1; } Modified: stable/9/usr.bin/procstat/procstat.h ============================================================================== --- stable/9/usr.bin/procstat/procstat.h Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat.h Tue May 21 19:05:27 2013 (r250871) @@ -34,18 +34,19 @@ extern int hflag, nflag, Cflag; struct kinfo_proc; void kinfo_proc_sort(struct kinfo_proc *kipp, int count); -void procstat_args(struct kinfo_proc *kipp); -void procstat_auxv(struct kinfo_proc *kipp); +void procstat_args(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_auxv(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_basic(struct kinfo_proc *kipp); -void procstat_bin(struct kinfo_proc *kipp); -void procstat_cred(struct kinfo_proc *kipp); -void procstat_env(struct kinfo_proc *kipp); +void procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_cred(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_env(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_kstack(struct kinfo_proc *kipp, int kflag); -void procstat_rlimit(struct kinfo_proc *kipp); +void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp, + int kflag); +void procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_threads(struct kinfo_proc *kipp); +void procstat_threads(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads_sigs(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_vm(struct kinfo_proc *kipp); +void procstat_vm(struct procstat *prstat, struct kinfo_proc *kipp); #endif /* !PROCSTAT_H */ Modified: stable/9/usr.bin/procstat/procstat_args.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_args.c Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat_args.c Tue May 21 19:05:27 2013 (r250871) @@ -40,52 +40,40 @@ #include "procstat.h" -static char args[ARG_MAX]; - static void -do_args(struct kinfo_proc *kipp, int env) +do_args(struct procstat *procstat, struct kinfo_proc *kipp, int env) { - int error, name[4]; - size_t len; - char *cp; + int i; + char **args; - if (!hflag) + if (!hflag) { printf("%5s %-16s %-53s\n", "PID", "COMM", env ? "ENVIRONMENT" : "ARGS"); - - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; - name[3] = kipp->ki_pid; - len = sizeof(args); - error = sysctl(name, 4, args, &len, NULL, 0); - if (error < 0 && errno != ESRCH && errno != EPERM) { - warn("sysctl: kern.proc.%s: %d: %d", env ? "env" : "args", - kipp->ki_pid, errno); - return; } - if (error < 0) + + args = env ? procstat_getenvv(procstat, kipp, 0) : + procstat_getargv(procstat, kipp, 0); + + printf("%5d %-16s", kipp->ki_pid, kipp->ki_comm); + + if (args == NULL) { + printf(" -\n"); return; - if (len == 0 || strlen(args) == 0) { - strcpy(args, "-"); - len = strlen(args) + 1; } - printf("%5d ", kipp->ki_pid); - printf("%-16s ", kipp->ki_comm); - for (cp = args; cp < args + len; cp += strlen(cp) + 1) - printf("%s%s", cp != args ? " " : "", cp); + for (i = 0; args[i] != NULL; i++) + printf(" %s", args[i]); printf("\n"); } void -procstat_args(struct kinfo_proc *kipp) +procstat_args(struct procstat *procstat, struct kinfo_proc *kipp) { - do_args(kipp, 0); + do_args(procstat, kipp, 0); } void -procstat_env(struct kinfo_proc *kipp) +procstat_env(struct procstat *procstat, struct kinfo_proc *kipp) { - do_args(kipp, 1); + do_args(procstat, kipp, 1); } Modified: stable/9/usr.bin/procstat/procstat_auxv.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_auxv.c Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat_auxv.c Tue May 21 19:05:27 2013 (r250871) @@ -43,113 +43,26 @@ #include "procstat.h" -#define PROC_AUXV_MAX 256 - -static Elf_Auxinfo auxv[PROC_AUXV_MAX]; -static char prefix[256]; - -#if __ELF_WORD_SIZE == 64 -static Elf32_Auxinfo auxv32[PROC_AUXV_MAX]; - -static const char *elf32_sv_names[] = { - "Linux ELF32", - "FreeBSD ELF32", -}; - -static int -is_elf32(pid_t pid) -{ - int error, name[4]; - size_t len, i; - static char sv_name[256]; - - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_SV_NAME; - name[3] = pid; - len = sizeof(sv_name); - error = sysctl(name, 4, sv_name, &len, NULL, 0); - if (error != 0 || len == 0) - return (0); - for (i = 0; i < sizeof(elf32_sv_names) / sizeof(*elf32_sv_names); i++) { - if (strncmp(sv_name, elf32_sv_names[i], sizeof(sv_name)) == 0) - return (1); - } - return (0); -} - -static size_t -retrieve_auxv32(pid_t pid) -{ - int name[4]; - size_t len, i; - void *ptr; - - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_AUXV; - name[3] = pid; - len = sizeof(auxv32); - if (sysctl(name, 4, auxv32, &len, NULL, 0) == -1) { - if (errno != ESRCH && errno != EPERM) - warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); - return (0); - } - for (i = 0; i < len; i++) { - /* - * XXX: We expect that values for a_type on a 32-bit platform - * are directly mapped to those on 64-bit one, which is not - * necessarily true. - */ - auxv[i].a_type = auxv32[i].a_type; - ptr = &auxv32[i].a_un; - auxv[i].a_un.a_val = *((uint32_t *)ptr); - } - return (len); -} -#endif /* __ELF_WORD_SIZE == 64 */ - #define PRINT(name, spec, val) \ printf("%s %-16s " #spec "\n", prefix, #name, (val)) #define PRINT_UNKNOWN(type, val) \ printf("%s %16ld %#lx\n", prefix, (long)type, (u_long)(val)) -static size_t -retrieve_auxv(pid_t pid) -{ - int name[4]; - size_t len; - -#if __ELF_WORD_SIZE == 64 - if (is_elf32(pid)) - return (retrieve_auxv32(pid)); -#endif - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_AUXV; - name[3] = pid; - len = sizeof(auxv); - if (sysctl(name, 4, auxv, &len, NULL, 0) == -1) { - if (errno != ESRCH && errno != EPERM) - warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); - return (0); - } - return (len); -} - void -procstat_auxv(struct kinfo_proc *kipp) +procstat_auxv(struct procstat *procstat, struct kinfo_proc *kipp) { - size_t len, i; + Elf_Auxinfo *auxv; + u_int count, i; + static char prefix[256]; if (!hflag) printf("%5s %-16s %-16s %-16s\n", "PID", "COMM", "AUXV", "VALUE"); - len = retrieve_auxv(kipp->ki_pid); - if (len == 0) + auxv = procstat_getauxv(procstat, kipp, &count); + if (auxv == NULL) return; snprintf(prefix, sizeof(prefix), "%5d %-16s", kipp->ki_pid, kipp->ki_comm); - for (i = 0; i < len; i++) { + for (i = 0; i < count; i++) { switch(auxv[i].a_type) { case AT_NULL: return; @@ -242,5 +155,6 @@ procstat_auxv(struct kinfo_proc *kipp) } } printf("\n"); + procstat_freeauxv(procstat, auxv); } Modified: stable/9/usr.bin/procstat/procstat_bin.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_bin.c Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat_bin.c Tue May 21 19:05:27 2013 (r250871) @@ -40,40 +40,19 @@ #include "procstat.h" void -procstat_bin(struct kinfo_proc *kipp) +procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp) { - char pathname[PATH_MAX]; - int error, osrel, name[4]; - size_t len; + int osrel; + static char pathname[PATH_MAX]; if (!hflag) printf("%5s %-16s %8s %s\n", "PID", "COMM", "OSREL", "PATH"); - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PATHNAME; - name[3] = kipp->ki_pid; - - len = sizeof(pathname); - error = sysctl(name, 4, pathname, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.pathname: %d", kipp->ki_pid); - return; - } - if (error < 0) + if (procstat_getpathname(prstat, kipp, pathname, sizeof(pathname)) != 0) return; - if (len == 0 || strlen(pathname) == 0) + if (strlen(pathname) == 0) strcpy(pathname, "-"); - - name[2] = KERN_PROC_OSREL; - - len = sizeof(osrel); - error = sysctl(name, 4, &osrel, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.osrel: %d", kipp->ki_pid); - return; - } - if (error < 0) + if (procstat_getosrel(prstat, kipp, &osrel) != 0) return; printf("%5d ", kipp->ki_pid); Modified: stable/9/usr.bin/procstat/procstat_cred.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_cred.c Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat_cred.c Tue May 21 19:05:27 2013 (r250871) @@ -38,16 +38,14 @@ #include "procstat.h" -static const char *get_umask(struct kinfo_proc *kipp); +static const char *get_umask(struct procstat *procstat, + struct kinfo_proc *kipp); void -procstat_cred(struct kinfo_proc *kipp) +procstat_cred(struct procstat *procstat, struct kinfo_proc *kipp) { - int i; - int mib[4]; - int ngroups; - size_t len; - gid_t *groups = NULL; + unsigned int i, ngroups; + gid_t *groups; if (!hflag) printf("%5s %-16s %5s %5s %5s %5s %5s %5s %5s %5s %-15s\n", @@ -62,34 +60,18 @@ procstat_cred(struct kinfo_proc *kipp) printf("%5d ", kipp->ki_groups[0]); printf("%5d ", kipp->ki_rgid); printf("%5d ", kipp->ki_svgid); - printf("%5s ", get_umask(kipp)); + printf("%5s ", get_umask(procstat, kipp)); printf("%s", kipp->ki_cr_flags & CRED_FLAG_CAPMODE ? "C" : "-"); printf(" "); + groups = NULL; /* * We may have too many groups to fit in kinfo_proc's statically - * sized storage. If that occurs, attempt to retrieve them via - * sysctl. + * sized storage. If that occurs, attempt to retrieve them using + * libprocstat. */ - if (kipp->ki_cr_flags & KI_CRF_GRP_OVERFLOW) { - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_GROUPS; - mib[3] = kipp->ki_pid; - - ngroups = sysconf(_SC_NGROUPS_MAX) + 1; - len = ngroups * sizeof(gid_t); - if((groups = malloc(len)) == NULL) - err(-1, "malloc"); - - if (sysctl(mib, 4, groups, &len, NULL, 0) == -1) { - warn("sysctl: kern.proc.groups: %d " - "group list truncated", kipp->ki_pid); - free(groups); - groups = NULL; - } - ngroups = len / sizeof(gid_t); - } + if (kipp->ki_cr_flags & KI_CRF_GRP_OVERFLOW) + groups = procstat_getgroups(procstat, kipp, &ngroups); if (groups == NULL) { ngroups = kipp->ki_ngroups; groups = kipp->ki_groups; @@ -97,27 +79,18 @@ procstat_cred(struct kinfo_proc *kipp) for (i = 0; i < ngroups; i++) printf("%s%d", (i > 0) ? "," : "", groups[i]); if (groups != kipp->ki_groups) - free(groups); + procstat_freegroups(procstat, groups); printf("\n"); } static const char * -get_umask(struct kinfo_proc *kipp) +get_umask(struct procstat *procstat, struct kinfo_proc *kipp) { - int error; - int mib[4]; - size_t len; u_short fd_cmask; static char umask[4]; - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_UMASK; - mib[3] = kipp->ki_pid; - len = sizeof(fd_cmask); - error = sysctl(mib, 4, &fd_cmask, &len, NULL, 0); - if (error == 0) { + if (procstat_getumask(procstat, kipp, &fd_cmask) == 0) { snprintf(umask, 4, "%03o", fd_cmask); return (umask); } else { Modified: stable/9/usr.bin/procstat/procstat_kstack.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_kstack.c Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat_kstack.c Tue May 21 19:05:27 2013 (r250871) @@ -125,76 +125,35 @@ kinfo_kstack_sort(struct kinfo_kstack *k void -procstat_kstack(struct kinfo_proc *kipp, int kflag) +procstat_kstack(struct procstat *procstat, struct kinfo_proc *kipp, int kflag) { struct kinfo_kstack *kkstp, *kkstp_free; struct kinfo_proc *kip, *kip_free; char trace[KKST_MAXLEN]; - int error, name[4]; unsigned int i, j; - size_t kip_len, kstk_len; + unsigned int kip_count, kstk_count; if (!hflag) printf("%5s %6s %-16s %-16s %-29s\n", "PID", "TID", "COMM", "TDNAME", "KSTACK"); - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_KSTACK; - name[3] = kipp->ki_pid; - - kstk_len = 0; - error = sysctl(name, 4, NULL, &kstk_len, NULL, 0); - if (error < 0 && errno != ESRCH && errno != EPERM && errno != ENOENT) { - warn("sysctl: kern.proc.kstack: %d", kipp->ki_pid); - return; - } - if (error < 0 && errno == ENOENT) { - warnx("sysctl: kern.proc.kstack unavailable"); - errx(-1, "options DDB or options STACK required in kernel"); - } - if (error < 0) - return; - - kkstp = kkstp_free = malloc(kstk_len); + kkstp = kkstp_free = procstat_getkstack(procstat, kipp, &kstk_count); if (kkstp == NULL) - err(-1, "malloc"); - - if (sysctl(name, 4, kkstp, &kstk_len, NULL, 0) < 0) { - warn("sysctl: kern.proc.pid: %d", kipp->ki_pid); - free(kkstp); return; - } /* * We need to re-query for thread information, so don't use *kipp. */ - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; - name[3] = kipp->ki_pid; - - kip_len = 0; - error = sysctl(name, 4, NULL, &kip_len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.pid: %d", kipp->ki_pid); - return; - } - if (error < 0) - return; + kip = kip_free = procstat_getprocs(procstat, + KERN_PROC_PID | KERN_PROC_INC_THREAD, kipp->ki_pid, &kip_count); - kip = kip_free = malloc(kip_len); - if (kip == NULL) - err(-1, "malloc"); - - if (sysctl(name, 4, kip, &kip_len, NULL, 0) < 0) { - warn("sysctl: kern.proc.pid: %d", kipp->ki_pid); - free(kip); + if (kip == NULL) { + procstat_freekstack(procstat, kkstp_free); return; } - kinfo_kstack_sort(kkstp, kstk_len / sizeof(*kkstp)); - for (i = 0; i < kstk_len / sizeof(*kkstp); i++) { + kinfo_kstack_sort(kkstp, kstk_count); + for (i = 0; i < kstk_count; i++) { kkstp = &kkstp_free[i]; /* @@ -202,7 +161,7 @@ procstat_kstack(struct kinfo_proc *kipp, * display the per-thread command line. */ kipp = NULL; - for (j = 0; j < kip_len / sizeof(*kipp); j++) { + for (j = 0; j < kip_count; j++) { kipp = &kip_free[j]; if (kkstp->kkst_tid == kipp->ki_tid) break; @@ -242,6 +201,6 @@ procstat_kstack(struct kinfo_proc *kipp, kstack_cleanup(kkstp->kkst_trace, trace, kflag); printf("%-29s\n", trace); } - free(kip_free); - free(kkstp_free); + procstat_freekstack(procstat, kkstp_free); + procstat_freeprocs(procstat, kip_free); } Modified: stable/9/usr.bin/procstat/procstat_rlimit.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_rlimit.c Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat_rlimit.c Tue May 21 19:05:27 2013 (r250871) @@ -86,31 +86,18 @@ humanize_rlimit(int indx, rlim_t limit) } void -procstat_rlimit(struct kinfo_proc *kipp) +procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp) { struct rlimit rlimit; - int error, i, name[5]; - size_t len; + int i; if (!hflag) { printf("%5s %-16s %-16s %16s %16s\n", "PID", "COMM", "RLIMIT", "SOFT ", "HARD "); } - len = sizeof(struct rlimit); - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_RLIMIT; - name[3] = kipp->ki_pid; for (i = 0; i < RLIM_NLIMITS; i++) { - name[4] = i; - error = sysctl(name, 5, &rlimit, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.rlimit: %d", kipp->ki_pid); + if (procstat_getrlimit(prstat, kipp, i, &rlimit) == -1) return; - } - if (error < 0 || len != sizeof(struct rlimit)) - return; - printf("%5d %-16s %-16s ", kipp->ki_pid, kipp->ki_comm, rlimit_param[i].name); printf("%16s ", humanize_rlimit(i, rlimit.rlim_cur)); Modified: stable/9/usr.bin/procstat/procstat_sigs.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_sigs.c Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat_sigs.c Tue May 21 19:05:27 2013 (r250871) @@ -86,48 +86,24 @@ procstat_sigs(struct procstat *prstat __ } void -procstat_threads_sigs(struct procstat *prstat __unused, struct kinfo_proc *kipp) +procstat_threads_sigs(struct procstat *procstat, struct kinfo_proc *kipp) { struct kinfo_proc *kip; pid_t pid; - int error, name[4], j; - unsigned int i; - size_t len; + int j; + unsigned int count, i; pid = kipp->ki_pid; if (!hflag) printf("%5s %6s %-16s %-7s %4s\n", "PID", "TID", "COMM", "SIG", "FLAGS"); - /* - * We need to re-query for thread information, so don't use *kipp. - */ - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; - name[3] = pid; - - len = 0; - error = sysctl(name, 4, NULL, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.pid: %d", pid); - return; - } - if (error < 0) - return; - - kip = malloc(len); + kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD, + pid, &count); if (kip == NULL) - err(-1, "malloc"); - - if (sysctl(name, 4, kip, &len, NULL, 0) < 0) { - warn("sysctl: kern.proc.pid: %d", pid); - free(kip); return; - } - - kinfo_proc_sort(kip, len / sizeof(*kipp)); - for (i = 0; i < len / sizeof(*kipp); i++) { + kinfo_proc_sort(kip, count); + for (i = 0; i < count; i++) { kipp = &kip[i]; for (j = 1; j <= _SIG_MAXSIG; j++) { printf("%5d ", pid); @@ -140,5 +116,5 @@ procstat_threads_sigs(struct procstat *p printf("\n"); } } - free(kip); + procstat_freeprocs(procstat, kip); } Modified: stable/9/usr.bin/procstat/procstat_threads.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_threads.c Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat_threads.c Tue May 21 19:05:27 2013 (r250871) @@ -40,47 +40,22 @@ #include "procstat.h" void -procstat_threads(struct kinfo_proc *kipp) +procstat_threads(struct procstat *procstat, struct kinfo_proc *kipp) { struct kinfo_proc *kip; - int error, name[4]; - unsigned int i; + unsigned int count, i; const char *str; - size_t len; if (!hflag) printf("%5s %6s %-16s %-16s %2s %4s %-7s %-9s\n", "PID", "TID", "COMM", "TDNAME", "CPU", "PRI", "STATE", "WCHAN"); - /* - * We need to re-query for thread information, so don't use *kipp. - */ - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; - name[3] = kipp->ki_pid; - - len = 0; - error = sysctl(name, 4, NULL, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.pid: %d", kipp->ki_pid); - return; - } - if (error < 0) - return; - - kip = malloc(len); + kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD, + kipp->ki_pid, &count); if (kip == NULL) - err(-1, "malloc"); - - if (sysctl(name, 4, kip, &len, NULL, 0) < 0) { - warn("sysctl: kern.proc.pid: %d", kipp->ki_pid); - free(kip); return; - } - - kinfo_proc_sort(kip, len / sizeof(*kipp)); - for (i = 0; i < len / sizeof(*kipp); i++) { + kinfo_proc_sort(kip, count); + for (i = 0; i < count; i++) { kipp = &kip[i]; printf("%5d ", kipp->ki_pid); printf("%6d ", kipp->ki_tid); @@ -139,5 +114,5 @@ procstat_threads(struct kinfo_proc *kipp } printf("\n"); } - free(kip); + procstat_freeprocs(procstat, kip); } Modified: stable/9/usr.bin/procstat/procstat_vm.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_vm.c Tue May 21 19:04:16 2013 (r250870) +++ stable/9/usr.bin/procstat/procstat_vm.c Tue May 21 19:05:27 2013 (r250871) @@ -41,7 +41,7 @@ #include "procstat.h" void -procstat_vm(struct kinfo_proc *kipp) +procstat_vm(struct procstat *procstat, struct kinfo_proc *kipp) { struct kinfo_vmentry *freep, *kve; int ptrwidth; @@ -54,7 +54,7 @@ procstat_vm(struct kinfo_proc *kipp) "PID", ptrwidth, "START", ptrwidth, "END", "PRT", "RES", "PRES", "REF", "SHD", "FL", "TP", "PATH"); - freep = kinfo_getvmmap(kipp->ki_pid, &cnt); + freep = procstat_getvmmap(procstat, kipp, &cnt); if (freep == NULL) return; for (i = 0; i < cnt; i++) { From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:06:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 15BB6906; Tue, 21 May 2013 19:06:18 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 07A16782; Tue, 21 May 2013 19:06:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJ6IXC016384; Tue, 21 May 2013 19:06:18 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJ6Hng016382; Tue, 21 May 2013 19:06:17 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305211906.r4LJ6Hng016382@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 21 May 2013 19:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250872 - stable/9/usr.bin/gcore X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:06:18 -0000 Author: trociny Date: Tue May 21 19:06:17 2013 New Revision: 250872 URL: http://svnweb.freebsd.org/changeset/base/250872 Log: MFC r249687, r249704, r250511: r249687, r249704: Sync gcore(1) with the recent changes in kernel code aimed at adding procstat notes to a process core file. Suggested by: jhb r250511 (antoine): Add some missing DPADD. Modified: stable/9/usr.bin/gcore/Makefile stable/9/usr.bin/gcore/elfcore.c Directory Properties: stable/9/usr.bin/gcore/ (props changed) Modified: stable/9/usr.bin/gcore/Makefile ============================================================================== --- stable/9/usr.bin/gcore/Makefile Tue May 21 19:05:27 2013 (r250871) +++ stable/9/usr.bin/gcore/Makefile Tue May 21 19:06:17 2013 (r250872) @@ -3,8 +3,8 @@ PROG= gcore SRCS= elfcore.c gcore.c -DPADD= ${LIBUTIL} -LDADD= -lutil +DPADD= ${LIBSBUF} ${LIBUTIL} +LDADD= -lsbuf -lutil WARNS?= 1 Modified: stable/9/usr.bin/gcore/elfcore.c ============================================================================== --- stable/9/usr.bin/gcore/elfcore.c Tue May 21 19:05:27 2013 (r250871) +++ stable/9/usr.bin/gcore/elfcore.c Tue May 21 19:06:17 2013 (r250872) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -41,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -71,16 +73,33 @@ struct sseg_closure { size_t size; /* Total size of all writable segments. */ }; +typedef void* (*notefunc_t)(void *, size_t *); + static void cb_put_phdr(vm_map_entry_t, void *); static void cb_size_segment(vm_map_entry_t, void *); static void each_writable_segment(vm_map_entry_t, segment_callback, void *closure); static void elf_detach(void); /* atexit() handler. */ -static void elf_puthdr(pid_t, vm_map_entry_t, void *, size_t *, int numsegs); -static void elf_putnote(void *dst, size_t *off, const char *name, int type, - const void *desc, size_t descsz); +static void *elf_note_fpregset(void *, size_t *); +static void *elf_note_prpsinfo(void *, size_t *); +static void *elf_note_prstatus(void *, size_t *); +static void *elf_note_thrmisc(void *, size_t *); +static void *elf_note_procstat_auxv(void *, size_t *); +static void *elf_note_procstat_files(void *, size_t *); +static void *elf_note_procstat_groups(void *, size_t *); +static void *elf_note_procstat_osrel(void *, size_t *); +static void *elf_note_procstat_proc(void *, size_t *); +static void *elf_note_procstat_psstrings(void *, size_t *); +static void *elf_note_procstat_rlimit(void *, size_t *); +static void *elf_note_procstat_umask(void *, size_t *); +static void *elf_note_procstat_vmmap(void *, size_t *); +static void elf_puthdr(pid_t, vm_map_entry_t, void *, size_t, size_t, size_t, + int); +static void elf_putnote(int, notefunc_t, void *, struct sbuf *); +static void elf_putnotes(pid_t, struct sbuf *, size_t *); static void freemap(vm_map_entry_t); static vm_map_entry_t readmap(pid_t); +static void *procstat_sysctl(void *, int, size_t, size_t *sizep); static pid_t g_pid; /* Pid being dumped, global for elf_detach */ @@ -114,8 +133,10 @@ elf_coredump(int efd __unused, int fd, p { vm_map_entry_t map; struct sseg_closure seginfo; + struct sbuf *sb; void *hdr; - size_t hdrsize; + size_t hdrsize, notesz, segoff; + ssize_t n, old_len; Elf_Phdr *php; int i; @@ -139,27 +160,32 @@ elf_coredump(int efd __unused, int fd, p each_writable_segment(map, cb_size_segment, &seginfo); /* - * Calculate the size of the core file header area by making - * a dry run of generating it. Nothing is written, but the - * size is calculated. + * Build the header and the notes using sbuf and write to the file. */ - hdrsize = 0; - elf_puthdr(pid, map, NULL, &hdrsize, seginfo.count); - - /* - * Allocate memory for building the header, fill it up, - * and write it out. - */ - if ((hdr = calloc(1, hdrsize)) == NULL) - errx(1, "out of memory"); - + sb = sbuf_new_auto(); + hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count); + /* Start header + notes section. */ + sbuf_start_section(sb, NULL); + /* Make empty header subsection. */ + sbuf_start_section(sb, &old_len); + sbuf_putc(sb, 0); + sbuf_end_section(sb, old_len, hdrsize, 0); + /* Put notes. */ + elf_putnotes(pid, sb, ¬esz); + /* Align up to a page boundary for the program segments. */ + sbuf_end_section(sb, -1, PAGE_SIZE, 0); + if (sbuf_finish(sb) != 0) + err(1, "sbuf_finish"); + hdr = sbuf_data(sb); + segoff = sbuf_len(sb); /* Fill in the header. */ - hdrsize = 0; - elf_puthdr(pid, map, hdr, &hdrsize, seginfo.count); + elf_puthdr(pid, map, hdr, hdrsize, notesz, segoff, seginfo.count); - /* Write it to the core file. */ - if (write(fd, hdr, hdrsize) == -1) + n = write(fd, hdr, segoff); + if (n == -1) err(1, "write"); + if (n < segoff) + errx(1, "short write"); /* Write the contents of all of the writable segments. */ php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1; @@ -195,7 +221,7 @@ elf_coredump(int efd __unused, int fd, p } php++; } - free(hdr); + sbuf_delete(sb); freemap(map); } @@ -257,209 +283,136 @@ each_writable_segment(vm_map_entry_t map } static void -elf_getstatus(pid_t pid, prpsinfo_t *psinfo) -{ - struct kinfo_proc kobj; - int name[4]; - size_t len; - - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PID; - name[3] = pid; - - len = sizeof(kobj); - if (sysctl(name, 4, &kobj, &len, NULL, 0) == -1) - err(1, "error accessing kern.proc.pid.%u sysctl", pid); - if (kobj.ki_pid != pid) - err(1, "error accessing kern.proc.pid.%u sysctl datas", pid); - strncpy(psinfo->pr_fname, kobj.ki_comm, MAXCOMLEN); - strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); -} - -/* - * Generate the ELF coredump header into the buffer at "dst". "dst" may - * be NULL, in which case the header is sized but not actually generated. - */ -static void -elf_puthdr(pid_t pid, vm_map_entry_t map, void *dst, size_t *off, int numsegs) +elf_putnotes(pid_t pid, struct sbuf *sb, size_t *sizep) { - struct ptrace_lwpinfo lwpinfo; - struct { - prstatus_t status; - prfpregset_t fpregset; - prpsinfo_t psinfo; - thrmisc_t thrmisc; - } *tempdata; - size_t ehoff; - size_t phoff; - size_t noteoff; - size_t notesz; - size_t threads; lwpid_t *tids; + size_t threads, old_len; + ssize_t size; int i; - prstatus_t *status; - prfpregset_t *fpregset; - prpsinfo_t *psinfo; - thrmisc_t *thrmisc; - - ehoff = *off; - *off += sizeof(Elf_Ehdr); - - phoff = *off; - *off += (numsegs + 1) * sizeof(Elf_Phdr); - - noteoff = *off; - - if (dst != NULL) { - if ((tempdata = calloc(1, sizeof(*tempdata))) == NULL) - errx(1, "out of memory"); - status = &tempdata->status; - fpregset = &tempdata->fpregset; - psinfo = &tempdata->psinfo; - thrmisc = &tempdata->thrmisc; - } else { - tempdata = NULL; - status = NULL; - fpregset = NULL; - psinfo = NULL; - thrmisc = NULL; - } - errno = 0; threads = ptrace(PT_GETNUMLWPS, pid, NULL, 0); if (errno) err(1, "PT_GETNUMLWPS"); + tids = malloc(threads * sizeof(*tids)); + if (tids == NULL) + errx(1, "out of memory"); + errno = 0; + ptrace(PT_GETLWPLIST, pid, (void *)tids, threads); + if (errno) + err(1, "PT_GETLWPLIST"); - if (dst != NULL) { - psinfo->pr_version = PRPSINFO_VERSION; - psinfo->pr_psinfosz = sizeof(prpsinfo_t); - elf_getstatus(pid, psinfo); - - } - elf_putnote(dst, off, "FreeBSD", NT_PRPSINFO, psinfo, - sizeof *psinfo); + sbuf_start_section(sb, &old_len); + elf_putnote(NT_PRPSINFO, elf_note_prpsinfo, &pid, sb); - if (dst != NULL) { - tids = malloc(threads * sizeof(*tids)); - if (tids == NULL) - errx(1, "out of memory"); - errno = 0; - ptrace(PT_GETLWPLIST, pid, (void *)tids, threads); - if (errno) - err(1, "PT_GETLWPLIST"); - } for (i = 0; i < threads; ++i) { - if (dst != NULL) { - status->pr_version = PRSTATUS_VERSION; - status->pr_statussz = sizeof(prstatus_t); - status->pr_gregsetsz = sizeof(gregset_t); - status->pr_fpregsetsz = sizeof(fpregset_t); - status->pr_osreldate = __FreeBSD_version; - status->pr_pid = tids[i]; - - ptrace(PT_GETREGS, tids[i], (void *)&status->pr_reg, 0); - ptrace(PT_GETFPREGS, tids[i], (void *)fpregset, 0); - ptrace(PT_LWPINFO, tids[i], (void *)&lwpinfo, - sizeof(lwpinfo)); - memset(&thrmisc->_pad, 0, sizeof(thrmisc->_pad)); - strcpy(thrmisc->pr_tname, lwpinfo.pl_tdname); - } - elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, - sizeof *status); - elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, - sizeof *fpregset); - elf_putnote(dst, off, "FreeBSD", NT_THRMISC, thrmisc, - sizeof *thrmisc); - } - - notesz = *off - noteoff; - - if (dst != NULL) { - free(tids); - free(tempdata); + elf_putnote(NT_PRSTATUS, elf_note_prstatus, tids + i, sb); + elf_putnote(NT_FPREGSET, elf_note_fpregset, tids + i, sb); + elf_putnote(NT_THRMISC, elf_note_thrmisc, tids + i, sb); } - /* Align up to a page boundary for the program segments. */ - *off = round_page(*off); - - if (dst != NULL) { - Elf_Ehdr *ehdr; - Elf_Phdr *phdr; - struct phdr_closure phc; - - /* - * Fill in the ELF header. - */ - ehdr = (Elf_Ehdr *)((char *)dst + ehoff); - ehdr->e_ident[EI_MAG0] = ELFMAG0; - ehdr->e_ident[EI_MAG1] = ELFMAG1; - ehdr->e_ident[EI_MAG2] = ELFMAG2; - ehdr->e_ident[EI_MAG3] = ELFMAG3; - ehdr->e_ident[EI_CLASS] = ELF_CLASS; - ehdr->e_ident[EI_DATA] = ELF_DATA; - ehdr->e_ident[EI_VERSION] = EV_CURRENT; - ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; - ehdr->e_ident[EI_ABIVERSION] = 0; - ehdr->e_ident[EI_PAD] = 0; - ehdr->e_type = ET_CORE; - ehdr->e_machine = ELF_ARCH; - ehdr->e_version = EV_CURRENT; - ehdr->e_entry = 0; - ehdr->e_phoff = phoff; - ehdr->e_flags = 0; - ehdr->e_ehsize = sizeof(Elf_Ehdr); - ehdr->e_phentsize = sizeof(Elf_Phdr); - ehdr->e_phnum = numsegs + 1; - ehdr->e_shentsize = sizeof(Elf_Shdr); - ehdr->e_shnum = 0; - ehdr->e_shstrndx = SHN_UNDEF; - - /* - * Fill in the program header entries. - */ - phdr = (Elf_Phdr *)((char *)dst + phoff); - - /* The note segment. */ - phdr->p_type = PT_NOTE; - phdr->p_offset = noteoff; - phdr->p_vaddr = 0; - phdr->p_paddr = 0; - phdr->p_filesz = notesz; - phdr->p_memsz = 0; - phdr->p_flags = 0; - phdr->p_align = 0; - phdr++; - - /* All the writable segments from the program. */ - phc.phdr = phdr; - phc.offset = *off; - each_writable_segment(map, cb_put_phdr, &phc); - } + elf_putnote(NT_PROCSTAT_PROC, elf_note_procstat_proc, &pid, sb); + elf_putnote(NT_PROCSTAT_FILES, elf_note_procstat_files, &pid, sb); + elf_putnote(NT_PROCSTAT_VMMAP, elf_note_procstat_vmmap, &pid, sb); + elf_putnote(NT_PROCSTAT_GROUPS, elf_note_procstat_groups, &pid, sb); + elf_putnote(NT_PROCSTAT_UMASK, elf_note_procstat_umask, &pid, sb); + elf_putnote(NT_PROCSTAT_RLIMIT, elf_note_procstat_rlimit, &pid, sb); + elf_putnote(NT_PROCSTAT_OSREL, elf_note_procstat_osrel, &pid, sb); + elf_putnote(NT_PROCSTAT_PSSTRINGS, elf_note_procstat_psstrings, &pid, + sb); + elf_putnote(NT_PROCSTAT_AUXV, elf_note_procstat_auxv, &pid, sb); + + size = sbuf_end_section(sb, old_len, 1, 0); + if (size == -1) + err(1, "sbuf_end_section"); + free(tids); + *sizep = size; } /* - * Emit one note section to "dst", or just size it if "dst" is NULL. + * Emit one note section to sbuf. */ static void -elf_putnote(void *dst, size_t *off, const char *name, int type, - const void *desc, size_t descsz) +elf_putnote(int type, notefunc_t notefunc, void *arg, struct sbuf *sb) { Elf_Note note; + size_t descsz; + ssize_t old_len; + void *desc; - note.n_namesz = strlen(name) + 1; + desc = notefunc(arg, &descsz); + note.n_namesz = 8; /* strlen("FreeBSD") + 1 */ note.n_descsz = descsz; note.n_type = type; - if (dst != NULL) - bcopy(¬e, (char *)dst + *off, sizeof note); - *off += sizeof note; - if (dst != NULL) - bcopy(name, (char *)dst + *off, note.n_namesz); - *off += roundup2(note.n_namesz, sizeof(Elf_Size)); - if (dst != NULL) - bcopy(desc, (char *)dst + *off, note.n_descsz); - *off += roundup2(note.n_descsz, sizeof(Elf_Size)); + + sbuf_bcat(sb, ¬e, sizeof(note)); + sbuf_start_section(sb, &old_len); + sbuf_bcat(sb, "FreeBSD", note.n_namesz); + sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); + if (descsz == 0) + return; + sbuf_start_section(sb, &old_len); + sbuf_bcat(sb, desc, descsz); + sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); + free(desc); +} + +/* + * Generate the ELF coredump header. + */ +static void +elf_puthdr(pid_t pid, vm_map_entry_t map, void *hdr, size_t hdrsize, + size_t notesz, size_t segoff, int numsegs) +{ + Elf_Ehdr *ehdr; + Elf_Phdr *phdr; + struct phdr_closure phc; + + ehdr = (Elf_Ehdr *)hdr; + phdr = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)); + + ehdr->e_ident[EI_MAG0] = ELFMAG0; + ehdr->e_ident[EI_MAG1] = ELFMAG1; + ehdr->e_ident[EI_MAG2] = ELFMAG2; + ehdr->e_ident[EI_MAG3] = ELFMAG3; + ehdr->e_ident[EI_CLASS] = ELF_CLASS; + ehdr->e_ident[EI_DATA] = ELF_DATA; + ehdr->e_ident[EI_VERSION] = EV_CURRENT; + ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; + ehdr->e_ident[EI_ABIVERSION] = 0; + ehdr->e_ident[EI_PAD] = 0; + ehdr->e_type = ET_CORE; + ehdr->e_machine = ELF_ARCH; + ehdr->e_version = EV_CURRENT; + ehdr->e_entry = 0; + ehdr->e_phoff = sizeof(Elf_Ehdr); + ehdr->e_flags = 0; + ehdr->e_ehsize = sizeof(Elf_Ehdr); + ehdr->e_phentsize = sizeof(Elf_Phdr); + ehdr->e_phnum = numsegs + 1; + ehdr->e_shentsize = sizeof(Elf_Shdr); + ehdr->e_shnum = 0; + ehdr->e_shstrndx = SHN_UNDEF; + + /* + * Fill in the program header entries. + */ + + /* The note segement. */ + phdr->p_type = PT_NOTE; + phdr->p_offset = hdrsize; + phdr->p_vaddr = 0; + phdr->p_paddr = 0; + phdr->p_filesz = notesz; + phdr->p_memsz = 0; + phdr->p_flags = PF_R; + phdr->p_align = sizeof(Elf32_Size); + phdr++; + + /* All the writable segments from the program. */ + phc.phdr = phdr; + phc.offset = segoff; + each_writable_segment(map, cb_put_phdr, &phc); } /* @@ -530,5 +483,222 @@ readmap(pid_t pid) return (map); } +/* + * Miscellaneous note out functions. + */ + +static void * +elf_note_prpsinfo(void *arg, size_t *sizep) +{ + pid_t pid; + prpsinfo_t *psinfo; + struct kinfo_proc kip; + size_t len; + int name[4]; + + pid = *(pid_t *)arg; + psinfo = calloc(1, sizeof(*psinfo)); + if (psinfo == NULL) + errx(1, "out of memory"); + psinfo->pr_version = PRPSINFO_VERSION; + psinfo->pr_psinfosz = sizeof(prpsinfo_t); + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PID; + name[3] = pid; + len = sizeof(kip); + if (sysctl(name, 4, &kip, &len, NULL, 0) == -1) + err(1, "kern.proc.pid.%u", pid); + if (kip.ki_pid != pid) + err(1, "kern.proc.pid.%u", pid); + strncpy(psinfo->pr_fname, kip.ki_comm, MAXCOMLEN); + strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); + + *sizep = sizeof(*psinfo); + return (psinfo); +} + +static void * +elf_note_prstatus(void *arg, size_t *sizep) +{ + lwpid_t tid; + prstatus_t *status; + + tid = *(lwpid_t *)arg; + status = calloc(1, sizeof(*status)); + if (status == NULL) + errx(1, "out of memory"); + status->pr_version = PRSTATUS_VERSION; + status->pr_statussz = sizeof(prstatus_t); + status->pr_gregsetsz = sizeof(gregset_t); + status->pr_fpregsetsz = sizeof(fpregset_t); + status->pr_osreldate = __FreeBSD_version; + status->pr_pid = tid; + ptrace(PT_GETREGS, tid, (void *)&status->pr_reg, 0); + + *sizep = sizeof(*status); + return (status); +} + +static void * +elf_note_fpregset(void *arg, size_t *sizep) +{ + lwpid_t tid; + prfpregset_t *fpregset; + + tid = *(lwpid_t *)arg; + fpregset = calloc(1, sizeof(*fpregset)); + if (fpregset == NULL) + errx(1, "out of memory"); + ptrace(PT_GETFPREGS, tid, (void *)fpregset, 0); + + *sizep = sizeof(*fpregset); + return (fpregset); +} + +static void * +elf_note_thrmisc(void *arg, size_t *sizep) +{ + lwpid_t tid; + struct ptrace_lwpinfo lwpinfo; + thrmisc_t *thrmisc; + + tid = *(lwpid_t *)arg; + thrmisc = calloc(1, sizeof(*thrmisc)); + if (thrmisc == NULL) + errx(1, "out of memory"); + ptrace(PT_LWPINFO, tid, (void *)&lwpinfo, + sizeof(lwpinfo)); + memset(&thrmisc->_pad, 0, sizeof(thrmisc->_pad)); + strcpy(thrmisc->pr_tname, lwpinfo.pl_tdname); + + *sizep = sizeof(*thrmisc); + return (thrmisc); +} + +static void * +procstat_sysctl(void *arg, int what, size_t structsz, size_t *sizep) +{ + size_t len, oldlen; + pid_t pid; + int name[4], structsize; + void *buf, *p; + + pid = *(pid_t *)arg; + structsize = structsz; + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = what; + name[3] = pid; + len = 0; + if (sysctl(name, 4, NULL, &len, NULL, 0) == -1) + err(1, "kern.proc.%d.%u", what, pid); + buf = calloc(1, sizeof(structsize) + len * 4 / 3); + if (buf == NULL) + errx(1, "out of memory"); + bcopy(&structsize, buf, sizeof(structsize)); + p = (char *)buf + sizeof(structsize); + if (sysctl(name, 4, p, &len, NULL, 0) == -1) + err(1, "kern.proc.%d.%u", what, pid); + + *sizep = sizeof(structsize) + len; + return (buf); +} + +static void * +elf_note_procstat_proc(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_PID | KERN_PROC_INC_THREAD, + sizeof(struct kinfo_proc), sizep)); +} + +static void * +elf_note_procstat_files(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_FILEDESC, + sizeof(struct kinfo_file), sizep)); +} + +static void * +elf_note_procstat_vmmap(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_VMMAP, + sizeof(struct kinfo_vmentry), sizep)); +} + +static void * +elf_note_procstat_groups(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_GROUPS, sizeof(gid_t), sizep)); +} + +static void * +elf_note_procstat_umask(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_UMASK, sizeof(u_short), sizep)); +} + +static void * +elf_note_procstat_osrel(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_OSREL, sizeof(int), sizep)); +} + +static void * +elf_note_procstat_psstrings(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_PS_STRINGS, + sizeof(vm_offset_t), sizep)); +} + +static void * +elf_note_procstat_auxv(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_AUXV, + sizeof(Elf_Auxinfo), sizep)); +} + +static void * +elf_note_procstat_rlimit(void *arg, size_t *sizep) +{ + pid_t pid; + size_t len; + int i, name[5], structsize; + void *buf, *p; + + pid = *(pid_t *)arg; + structsize = sizeof(struct rlimit) * RLIM_NLIMITS; + buf = calloc(1, sizeof(structsize) + structsize); + if (buf == NULL) + errx(1, "out of memory"); + bcopy(&structsize, buf, sizeof(structsize)); + p = (char *)buf + sizeof(structsize); + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_RLIMIT; + name[3] = pid; + len = sizeof(struct rlimit); + for (i = 0; i < RLIM_NLIMITS; i++) { + name[4] = i; + if (sysctl(name, 5, p, &len, NULL, 0) == -1) + err(1, "kern.proc.rlimit.%u", pid); + if (len != sizeof(struct rlimit)) + errx(1, "kern.proc.rlimit.%u: short read", pid); + p += len; + } + + *sizep = sizeof(structsize) + structsize; + return (buf); +} + struct dumpers elfdump = { elf_ident, elf_coredump }; TEXT_SET(dumpset, elfdump); From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:09:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D39D0B91; Tue, 21 May 2013 19:09:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C5D167A3; Tue, 21 May 2013 19:09:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJ9Ubl017150; Tue, 21 May 2013 19:09:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJ9Uwp017149; Tue, 21 May 2013 19:09:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305211909.r4LJ9Uwp017149@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 May 2013 19:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250873 - head/contrib/flex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:09:30 -0000 Author: jkim Date: Tue May 21 19:09:30 2013 New Revision: 250873 URL: http://svnweb.freebsd.org/changeset/base/250873 Log: Add flex 2.5.37 from flex.sourceforge.net to contrib. Added: head/contrib/flex/ - copied from r250869, vendor/flex/dist/ Deleted: head/contrib/flex/ABOUT-NLS head/contrib/flex/AUTHORS head/contrib/flex/INSTALL head/contrib/flex/Makefile.am head/contrib/flex/Makefile.in head/contrib/flex/README-alpha head/contrib/flex/README.cvs head/contrib/flex/THANKS head/contrib/flex/TODO head/contrib/flex/autogen.sh head/contrib/flex/compile head/contrib/flex/conf.in head/contrib/flex/config.guess head/contrib/flex/config.rpath head/contrib/flex/config.sub head/contrib/flex/configure head/contrib/flex/configure.in head/contrib/flex/depcomp head/contrib/flex/gettext.h head/contrib/flex/install-sh head/contrib/flex/missing head/contrib/flex/mkinstalldirs head/contrib/flex/parse.c head/contrib/flex/parse.h head/contrib/flex/scan.c head/contrib/flex/skel.c head/contrib/flex/ylwrap From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:11:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AFBEBD26; Tue, 21 May 2013 19:11:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9331B7B7; Tue, 21 May 2013 19:11:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJBEMB019239; Tue, 21 May 2013 19:11:14 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJBCXu019215; Tue, 21 May 2013 19:11:12 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305211911.r4LJBCXu019215@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 May 2013 19:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250874 - head/contrib/flex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:11:14 -0000 Author: jkim Date: Tue May 21 19:11:11 2013 New Revision: 250874 URL: http://svnweb.freebsd.org/changeset/base/250874 Log: Apply still relevant local changes. r124183: Work around a `label defined but not used' warning. r179549: De-register declarations. r179657: De-register declarations in non-dot-c files. r181269: Mark yy_fatal_error() as __dead2. r228992: Spelling fixes. r240518: Correct double "the the". Modified: head/contrib/flex/ONEWS head/contrib/flex/ccl.c head/contrib/flex/dfa.c head/contrib/flex/ecs.c head/contrib/flex/flex.skl head/contrib/flex/flexdef.h head/contrib/flex/gen.c head/contrib/flex/misc.c head/contrib/flex/nfa.c head/contrib/flex/parse.y head/contrib/flex/scan.l head/contrib/flex/sym.c head/contrib/flex/tblcmp.c Modified: head/contrib/flex/ONEWS ============================================================================== --- head/contrib/flex/ONEWS Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/ONEWS Tue May 21 19:11:11 2013 (r250874) @@ -613,7 +613,7 @@ Changes between release 2.4.3 (03Dec93) sources. One side-effect of this change is that -+ and -CF are now incompatible. - - libfl.a now supplies private versions of the the / + - libfl.a now supplies private versions of the / string routines needed by flex and the scanners it generates, to enhance portability to some BSD systems. @@ -944,7 +944,7 @@ User-visible: given. To specify an end-of-file action for just the initial state, use <>. - - -d debug output is now contigent on the global yy_flex_debug + - -d debug output is now contingent on the global yy_flex_debug being set to a non-zero value, which it is by default. - A new macro, YY_USER_INIT, is provided for the user to specify @@ -987,7 +987,7 @@ Things which didn't used to be documente - yy_switch_to_buffer() can be used in the yywrap() macro/routine. - flex scanners do not use stdio for their input, and hence when - writing an interactive scanner one must explictly call fflush() + writing an interactive scanner one must explicitly call fflush() after writing out a prompt. - flex scanner can be made reentrant (after a fashion) by using Modified: head/contrib/flex/ccl.c ============================================================================== --- head/contrib/flex/ccl.c Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/ccl.c Tue May 21 19:11:11 2013 (r250874) @@ -92,13 +92,13 @@ void ccladd (cclp, ch) static void dump_cclp (FILE* file, int cclp) { - register int i; + int i; putc ('[', file); for (i = 0; i < csize; ++i) { if (ccl_contains(cclp, i)){ - register int start_char = i; + int start_char = i; putc (' ', file); @@ -244,13 +244,13 @@ void list_character_set (file, cset) FILE *file; int cset[]; { - register int i; + int i; putc ('[', file); for (i = 0; i < csize; ++i) { if (cset[i]) { - register int start_char = i; + int start_char = i; putc (' ', file); Modified: head/contrib/flex/dfa.c ============================================================================== --- head/contrib/flex/dfa.c Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/dfa.c Tue May 21 19:11:11 2013 (r250874) @@ -101,12 +101,12 @@ void check_trailing_context (nfa_states, int *accset; int nacc; { - register int i, j; + int i, j; for (i = 1; i <= num_states; ++i) { int ns = nfa_states[i]; - register int type = state_type[ns]; - register int ar = assoc_rule[ns]; + int type = state_type[ns]; + int ar = assoc_rule[ns]; if (type == STATE_NORMAL || rule_type[ar] != RULE_VARIABLE) { /* do nothing */ } @@ -141,14 +141,14 @@ void dump_associated_rules (file, ds) FILE *file; int ds; { - register int i, j; - register int num_associated_rules = 0; + int i, j; + int num_associated_rules = 0; int rule_set[MAX_ASSOC_RULES + 1]; int *dset = dss[ds]; int size = dfasiz[ds]; for (i = 1; i <= size; ++i) { - register int rule_num = rule_linenum[assoc_rule[dset[i]]]; + int rule_num = rule_linenum[assoc_rule[dset[i]]]; for (j = 1; j <= num_associated_rules; ++j) if (rule_num == rule_set[j]) @@ -191,7 +191,7 @@ void dump_transitions (file, state) FILE *file; int state[]; { - register int i, ec; + int i, ec; int out_char_set[CSIZE]; for (i = 0; i < csize; ++i) { @@ -238,7 +238,7 @@ void dump_transitions (file, state) int *epsclosure (t, ns_addr, accset, nacc_addr, hv_addr) int *t, *ns_addr, accset[], *nacc_addr, *hv_addr; { - register int stkpos, ns, tsp; + int stkpos, ns, tsp; int numstates = *ns_addr, nacc, hashval, transsym, nfaccnum; int stkend, nstate; static int did_stk_init = false, *stk; @@ -824,7 +824,7 @@ int snstods (sns, numstates, accset, nac int sns[], numstates, accset[], nacc, hashval, *newds_addr; { int didsort = 0; - register int i, j; + int i, j; int newds, *oldsns; for (i = 1; i <= lastdfa; ++i) Modified: head/contrib/flex/ecs.c ============================================================================== --- head/contrib/flex/ecs.c Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/ecs.c Tue May 21 19:11:11 2013 (r250874) @@ -139,7 +139,7 @@ void mkeccl (ccls, lenccl, fwd, bck, for (i = fwd[cclm]; i != NIL && i <= llsiz; i = fwd[i]) { /* look for the symbol in the character class */ for (; j < lenccl; ++j) { - register int ccl_char; + int ccl_char; if (NUL_mapping && ccls[j] == 0) ccl_char = NUL_mapping; Modified: head/contrib/flex/flex.skl ============================================================================== --- head/contrib/flex/flex.skl Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/flex.skl Tue May 21 19:11:11 2013 (r250874) @@ -195,6 +195,12 @@ m4_ifdef( [[M4_YY_TABLES_EXTERNAL]], /* First, we deal with platform-specific or compiler-specific issues. */ +#if defined(__FreeBSD__) +#include +#else +#define __dead2 +#endif + /* begin standard C headers. */ %if-c-only #include @@ -739,7 +745,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], static yy_state_type yy_get_previous_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); static yy_state_type yy_try_NUL_trans M4_YY_PARAMS( yy_state_type current_state M4_YY_PROTO_LAST_ARG); static int yy_get_next_buffer M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); -static void yy_fatal_error M4_YY_PARAMS( yyconst char msg[] M4_YY_PROTO_LAST_ARG ); +static void yy_fatal_error M4_YY_PARAMS( yyconst char msg[] M4_YY_PROTO_LAST_ARG ) __dead2; ]]) %endif @@ -1260,9 +1266,9 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; M4_YY_DECL_GUTS_VAR(); m4_ifdef( [[M4_YY_NOT_REENTRANT]], @@ -1610,9 +1616,9 @@ int yyFlexLexer::yy_get_next_buffer() %endif { M4_YY_DECL_GUTS_VAR(); - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = YY_G(yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = YY_G(yytext_ptr); + int number_to_move, i; int ret_val; if ( YY_G(yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] ) @@ -1758,8 +1764,8 @@ m4_ifdef( [[M4_YY_USES_REJECT]], yy_state_type yyFlexLexer::yy_get_previous_state() %endif { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; M4_YY_DECL_GUTS_VAR(); %% [15.0] code to get the start state into yy_current_state goes here @@ -1785,7 +1791,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]], yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) %endif { - register int yy_is_jam; + int yy_is_jam; M4_YY_DECL_GUTS_VAR(); /* This var may be unused depending upon options. */ %% [17.0] code to find the next state, and perhaps do backing up, goes here @@ -1797,13 +1803,13 @@ m4_ifdef( [[M4_YY_USES_REJECT]], %if-c-only m4_ifdef( [[M4_YY_NO_UNPUT]],, [[ - static void yyunput YYFARGS2( int,c, register char *,yy_bp) + static void yyunput YYFARGS2( int,c, char *,yy_bp) %endif %if-c++-only - void yyFlexLexer::yyunput( int c, register char* yy_bp) + void yyFlexLexer::yyunput( int c, char* yy_bp) %endif { - register char *yy_cp; + char *yy_cp; M4_YY_DECL_GUTS_VAR(); yy_cp = YY_G(yy_c_buf_p); @@ -1814,10 +1820,10 @@ m4_ifdef( [[M4_YY_NO_UNPUT]],, if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = YY_G(yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + yy_size_t number_to_move = YY_G(yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -2951,7 +2957,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], #ifndef yytext_ptr static void yy_flex_strncpy YYFARGS3( char*,s1, yyconst char *,s2, int,n) { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -2963,7 +2969,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], #ifdef YY_NEED_STRLEN static int yy_flex_strlen YYFARGS1( yyconst char *,s) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; Modified: head/contrib/flex/flexdef.h ============================================================================== --- head/contrib/flex/flexdef.h Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/flexdef.h Tue May 21 19:11:11 2013 (r250874) @@ -380,7 +380,7 @@ char *alloca (); * use_read - if true (-f, -F, or -Cr) then use read() for scanner input; * otherwise, use fread(). * yytext_is_array - if true (i.e., %array directive), then declare - * yytext as a array instead of a character pointer. Nice and inefficient. + * yytext as an array instead of a character pointer. Nice and inefficient. * do_yywrap - do yywrap() processing on EOF. If false, EOF treated as * "no more files". * csize - size of character set for the scanner we're generating; @@ -843,10 +843,10 @@ extern void action_define PROTO ((const extern void add_action PROTO ((const char *new_text)); /* True if a string is all lower case. */ -extern int all_lower PROTO ((register char *)); +extern int all_lower PROTO ((char *)); /* True if a string is all upper case. */ -extern int all_upper PROTO ((register char *)); +extern int all_upper PROTO ((char *)); /* Compare two integers for use by qsort. */ extern int intcmp PROTO ((const void *, const void *)); @@ -858,10 +858,10 @@ extern void check_char PROTO ((int c)); extern Char clower PROTO ((int)); /* Returns a dynamically allocated copy of a string. */ -extern char *copy_string PROTO ((register const char *)); +extern char *copy_string PROTO ((const char *)); /* Returns a dynamically allocated copy of a (potentially) unsigned string. */ -extern Char *copy_unsigned_string PROTO ((register Char *)); +extern Char *copy_unsigned_string PROTO ((Char *)); /* Compare two characters for use by qsort with '\0' sorting last. */ extern int cclcmp PROTO ((const void *, const void *)); @@ -922,7 +922,7 @@ extern void mark_defs1 PROTO ((void)); /* Mark the current position in the action array as the end of the prolog. */ extern void mark_prolog PROTO ((void)); -/* Generate a data statment for a two-dimensional array. */ +/* Generate a data statement for a two-dimensional array. */ extern void mk2data PROTO ((int)); extern void mkdata PROTO ((int)); /* generate a data statement */ @@ -987,7 +987,7 @@ extern int link_machines PROTO ((int, in /* Mark each "beginning" state in a machine as being a "normal" (i.e., * not trailing context associated) state. */ -extern void mark_beginning_as_normal PROTO ((register int)); +extern void mark_beginning_as_normal PROTO ((int)); /* Make a machine that branches to two machines. */ extern int mkbranch PROTO ((int, int)); Modified: head/contrib/flex/gen.c ============================================================================== --- head/contrib/flex/gen.c Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/gen.c Tue May 21 19:11:11 2013 (r250874) @@ -81,7 +81,7 @@ static const char *get_state_decl (void) void do_indent () { - register int i = indent_level * 8; + int i = indent_level * 8; while (i >= 8) { outc ('\t'); @@ -201,7 +201,7 @@ void gen_bu_action () static struct yytbl_data *mkctbl (void) { - register int i; + int i; struct yytbl_data *tbl = 0; flex_int32_t *tdata = 0, curr = 0; int end_of_buffer_action = num_rules + 1; @@ -332,7 +332,7 @@ static struct yytbl_data *mkssltbl (void void genctbl () { - register int i; + int i; int end_of_buffer_action = num_rules + 1; /* Table of verify for transition and offset to next state. */ @@ -433,7 +433,7 @@ void genctbl () struct yytbl_data *mkecstbl (void) { - register int i; + int i; struct yytbl_data *tbl = 0; flex_int32_t *tdata = 0; @@ -462,7 +462,7 @@ struct yytbl_data *mkecstbl (void) void genecs () { - register int i, j; + int i, j; int numrows; out_str_dec (get_int32_decl (), "yy_ec", csize); @@ -507,6 +507,7 @@ void gen_find_action () indent_puts ("yy_current_state = *--YY_G(yy_state_ptr);"); indent_puts ("YY_G(yy_lp) = yy_accept[yy_current_state];"); + outn ("goto find_rule; /* avoid `defined but not used' warning */"); outn ("find_rule: /* we branch to this label when backing up */"); indent_puts @@ -637,7 +638,7 @@ void gen_find_action () struct yytbl_data *mkftbl (void) { - register int i; + int i; int end_of_buffer_action = num_rules + 1; struct yytbl_data *tbl; flex_int32_t *tdata = 0; @@ -654,7 +655,7 @@ struct yytbl_data *mkftbl (void) dfaacc[end_of_buffer_state].dfaacc_state = end_of_buffer_action; for (i = 1; i <= lastdfa; ++i) { - register int anum = dfaacc[i].dfaacc_state; + int anum = dfaacc[i].dfaacc_state; tdata[i] = anum; @@ -674,7 +675,7 @@ struct yytbl_data *mkftbl (void) void genftbl () { - register int i; + int i; int end_of_buffer_action = num_rules + 1; out_str_dec (long_align ? get_int32_decl () : get_int16_decl (), @@ -683,7 +684,7 @@ void genftbl () dfaacc[end_of_buffer_state].dfaacc_state = end_of_buffer_action; for (i = 1; i <= lastdfa; ++i) { - register int anum = dfaacc[i].dfaacc_state; + int anum = dfaacc[i].dfaacc_state; mkdata (anum); @@ -708,7 +709,7 @@ void genftbl () void gen_next_compressed_state (char_map) char *char_map; { - indent_put2s ("register YY_CHAR yy_c = %s;", char_map); + indent_put2s ("YY_CHAR yy_c = %s;", char_map); /* Save the backing-up info \before/ computing the next state * because we always compute one more state than needed - we @@ -794,8 +795,8 @@ void gen_next_match () else if (fullspd) { indent_puts ("{"); indent_puts - ("register yyconst struct yy_trans_info *yy_trans_info;\n"); - indent_puts ("register YY_CHAR yy_c;\n"); + ("yyconst struct yy_trans_info *yy_trans_info;\n"); + indent_puts ("YY_CHAR yy_c;\n"); indent_put2s ("for ( yy_c = %s;", char_map); indent_puts (" (yy_trans_info = &yy_current_state[(unsigned int) yy_c])->"); @@ -938,7 +939,7 @@ void gen_NUL_trans () /* We're going to need yy_cp lying around for the call * below to gen_backing_up(). */ - indent_puts ("register char *yy_cp = YY_G(yy_c_buf_p);"); + indent_puts ("char *yy_cp = YY_G(yy_c_buf_p);"); outc ('\n'); @@ -959,10 +960,10 @@ void gen_NUL_trans () else if (fullspd) { do_indent (); - out_dec ("register int yy_c = %d;\n", NUL_ec); + out_dec ("int yy_c = %d;\n", NUL_ec); indent_puts - ("register yyconst struct yy_trans_info *yy_trans_info;\n"); + ("yyconst struct yy_trans_info *yy_trans_info;\n"); indent_puts ("yy_trans_info = &yy_current_state[(unsigned int) yy_c];"); indent_puts ("yy_current_state += yy_trans_info->yy_nxt;"); @@ -1319,7 +1320,7 @@ void gentabs () yybase_curr = 1; for (i = 1; i <= lastdfa; ++i) { - register int d = def[i]; + int d = def[i]; if (base[i] == JAMSTATE) base[i] = jambase; @@ -1501,7 +1502,7 @@ void indent_puts (str) void make_tables () { - register int i; + int i; int did_eof_rule = false; struct yytbl_data *yynultrans_tbl; Modified: head/contrib/flex/misc.c ============================================================================== --- head/contrib/flex/misc.c Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/misc.c Tue May 21 19:11:11 2013 (r250874) @@ -168,7 +168,7 @@ void *allocate_array (size, element_si int size; size_t element_size; { - register void *mem; + void *mem; size_t num_bytes = element_size * size; mem = flex_alloc (num_bytes); @@ -183,7 +183,7 @@ void *allocate_array (size, element_si /* all_lower - true if a string is all lower-case */ int all_lower (str) - register char *str; + char *str; { while (*str) { if (!isascii ((Char) * str) || !islower ((Char) * str)) @@ -198,7 +198,7 @@ int all_lower (str) /* all_upper - true if a string is all upper-case */ int all_upper (str) - register char *str; + char *str; { while (*str) { if (!isascii ((Char) * str) || !isupper ((Char) * str)) @@ -241,7 +241,7 @@ void check_char (c) /* clower - replace upper-case letter to lower-case */ Char clower (c) - register int c; + int c; { return (Char) ((isascii (c) && isupper (c)) ? tolower (c) : c); } @@ -250,10 +250,10 @@ Char clower (c) /* copy_string - returns a dynamically allocated copy of a string */ char *copy_string (str) - register const char *str; + const char *str; { - register const char *c1; - register char *c2; + const char *c1; + char *c2; char *copy; unsigned int size; @@ -278,9 +278,9 @@ char *copy_string (str) */ Char *copy_unsigned_string (str) - register Char *str; + Char *str; { - register Char *c; + Char *c; Char *copy; /* find length */ @@ -740,13 +740,13 @@ void out_m4_define (const char* def, con } -/* readable_form - return the the human-readable form of a character +/* readable_form - return the human-readable form of a character * * The returned string is in static storage. */ char *readable_form (c) - register int c; + int c; { static char rform[10]; @@ -795,7 +795,7 @@ void *reallocate_array (array, size, e int size; size_t element_size; { - register void *new_array; + void *new_array; size_t num_bytes = element_size * size; new_array = flex_realloc (array, num_bytes); @@ -991,7 +991,7 @@ void zero_out (region_ptr, size_in_bytes char *region_ptr; size_t size_in_bytes; { - register char *rp, *rp_end; + char *rp, *rp_end; rp = region_ptr; rp_end = region_ptr + size_in_bytes; Modified: head/contrib/flex/nfa.c ============================================================================== --- head/contrib/flex/nfa.c Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/nfa.c Tue May 21 19:11:11 2013 (r250874) @@ -329,7 +329,7 @@ int link_machines (first, last) */ void mark_beginning_as_normal (mach) - register int mach; + int mach; { switch (state_type[mach]) { case STATE_NORMAL: Modified: head/contrib/flex/parse.y ============================================================================== --- head/contrib/flex/parse.y Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/parse.y Tue May 21 19:11:11 2013 (r250874) @@ -953,7 +953,7 @@ string : string CHAR void build_eof_action() { - register int i; + int i; char action_text[MAXLINE]; for ( i = 1; i <= scon_stk_ptr; ++i ) Modified: head/contrib/flex/scan.l ============================================================================== --- head/contrib/flex/scan.l Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/scan.l Tue May 21 19:11:11 2013 (r250874) @@ -661,7 +661,7 @@ M4QEND "]]" * context. */ "{"{NAME}"}"[[:space:]]? { - register Char *nmdefptr; + Char *nmdefptr; int end_is_ws, end_ch; end_ch = yytext[yyleng-1]; Modified: head/contrib/flex/sym.c ============================================================================== --- head/contrib/flex/sym.c Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/sym.c Tue May 21 19:11:11 2013 (r250874) @@ -59,12 +59,12 @@ static struct hash_entry *ccltab[CCL_HAS /* declare functions that have forward references */ -static int addsym PROTO ((register char[], char *, int, hash_table, int)); -static struct hash_entry *findsym PROTO ((register const char *sym, +static int addsym PROTO ((char[], char *, int, hash_table, int)); +static struct hash_entry *findsym PROTO ((const char *sym, hash_table table, int table_size)); -static int hashfunct PROTO ((register const char *, int)); +static int hashfunct PROTO ((const char *, int)); /* addsym - add symbol and definitions to symbol table @@ -73,16 +73,16 @@ static int hashfunct PROTO ((register co */ static int addsym (sym, str_def, int_def, table, table_size) - register char sym[]; + char sym[]; char *str_def; int int_def; hash_table table; int table_size; { int hash_val = hashfunct (sym, table_size); - register struct hash_entry *sym_entry = table[hash_val]; - register struct hash_entry *new_entry; - register struct hash_entry *successor; + struct hash_entry *sym_entry = table[hash_val]; + struct hash_entry *new_entry; + struct hash_entry *successor; while (sym_entry) { if (!strcmp (sym, sym_entry->name)) { /* entry already exists */ @@ -147,7 +147,7 @@ int ccllookup (ccltxt) /* findsym - find symbol in symbol table */ static struct hash_entry *findsym (sym, table, table_size) - register const char *sym; + const char *sym; hash_table table; int table_size; { @@ -155,7 +155,7 @@ static struct hash_entry *findsym (sym, (struct hash_entry *) 0, (struct hash_entry *) 0, (char *) 0, (char *) 0, 0, }; - register struct hash_entry *sym_entry = + struct hash_entry *sym_entry = table[hashfunct (sym, table_size)]; @@ -171,11 +171,11 @@ static struct hash_entry *findsym (sym, /* hashfunct - compute the hash value for "str" and hash size "hash_size" */ static int hashfunct (str, hash_size) - register const char *str; + const char *str; int hash_size; { - register int hashval; - register int locstr; + int hashval; + int locstr; hashval = 0; locstr = 0; Modified: head/contrib/flex/tblcmp.c ============================================================================== --- head/contrib/flex/tblcmp.c Tue May 21 19:09:30 2013 (r250873) +++ head/contrib/flex/tblcmp.c Tue May 21 19:11:11 2013 (r250874) @@ -36,7 +36,7 @@ /* declarations for functions that have forward references */ -void mkentry PROTO ((register int *, int, int, int, int)); +void mkentry PROTO ((int *, int, int, int, int)); void mkprot PROTO ((int[], int, int)); void mktemplate PROTO ((int[], int, int)); void mv2front PROTO ((int)); @@ -224,7 +224,7 @@ void bldtbl (state, statenum, totaltr void cmptmps () { int tmpstorage[CSIZE + 1]; - register int *tmp = tmpstorage, i, j; + int *tmp = tmpstorage, i, j; int totaltrans, trans; peakpairs = numtemps * numecs + tblend; @@ -291,7 +291,7 @@ void cmptmps () void expand_nxt_chk () { - register int old_max = current_max_xpairs; + int old_max = current_max_xpairs; current_max_xpairs += MAX_XPAIRS_INCREMENT; @@ -330,9 +330,9 @@ int find_table_space (state, numtran /* Firstfree is the position of the first possible occurrence of two * consecutive unused records in the chk and nxt arrays. */ - register int i; - register int *state_ptr, *chk_ptr; - register int *ptr_to_last_entry_in_state; + int i; + int *state_ptr, *chk_ptr; + int *ptr_to_last_entry_in_state; /* If there are too many out-transitions, put the state at the end of * nxt and chk. @@ -421,7 +421,7 @@ int find_table_space (state, numtran */ void inittbl () { - register int i; + int i; zero_out ((char *) chk, @@ -494,17 +494,17 @@ void mkdeftbl () * (i.e., jam entries) into the table. It is assumed that by linking to * "JAMSTATE" they will be taken care of. In any case, entries in "state" * marking transitions to "SAME_TRANS" are treated as though they will be - * taken care of by whereever "deflink" points. "totaltrans" is the total + * taken care of by wherever "deflink" points. "totaltrans" is the total * number of transitions out of the state. If it is below a certain threshold, * the tables are searched for an interior spot that will accommodate the * state array. */ void mkentry (state, numchars, statenum, deflink, totaltrans) - register int *state; + int *state; int numchars, statenum, deflink, totaltrans; { - register int minec, maxec, i, baseaddr; + int minec, maxec, i, baseaddr; int tblbase, tbllast; if (totaltrans == 0) { /* there are no out-transitions */ @@ -762,8 +762,8 @@ void mv2front (qelm) void place_state (state, statenum, transnum) int *state, statenum, transnum; { - register int i; - register int *state_ptr; + int i; + int *state_ptr; int position = find_table_space (state, transnum); /* "base" is the table of start positions. */ @@ -835,8 +835,8 @@ void stack1 (statenum, sym, nextstate int tbldiff (state, pr, ext) int state[], pr, ext[]; { - register int i, *sp = state, *ep = ext, *protp; - register int numdiff = 0; + int i, *sp = state, *ep = ext, *protp; + int numdiff = 0; protp = &protsave[numecs * (pr - 1)]; From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:17:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BFF99F23; Tue, 21 May 2013 19:17:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A29BE7F7; Tue, 21 May 2013 19:17:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJH4St020445; Tue, 21 May 2013 19:17:04 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJH2xg020432; Tue, 21 May 2013 19:17:02 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305211917.r4LJH2xg020432@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 May 2013 19:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250875 - head/contrib/flex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:17:04 -0000 Author: jkim Date: Tue May 21 19:17:02 2013 New Revision: 250875 URL: http://svnweb.freebsd.org/changeset/base/250875 Log: Reduce compiler warnings. Modified: head/contrib/flex/buf.c head/contrib/flex/filter.c head/contrib/flex/flex.skl head/contrib/flex/flexint.h head/contrib/flex/gen.c head/contrib/flex/libyywrap.c head/contrib/flex/main.c head/contrib/flex/misc.c head/contrib/flex/scanflags.c Modified: head/contrib/flex/buf.c ============================================================================== --- head/contrib/flex/buf.c Tue May 21 19:11:11 2013 (r250874) +++ head/contrib/flex/buf.c Tue May 21 19:17:02 2013 (r250875) @@ -90,7 +90,8 @@ struct Buf *buf_prints (struct Buf *buf, */ struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno) { - char *dst, *src, *t; + char *dst, *t; + const char *src; t = flex_alloc (strlen ("#line \"\"\n") + /* constant parts */ 2 * strlen (filename) + /* filename with possibly all backslashes escaped */ Modified: head/contrib/flex/filter.c ============================================================================== --- head/contrib/flex/filter.c Tue May 21 19:11:11 2013 (r250874) +++ head/contrib/flex/filter.c Tue May 21 19:17:02 2013 (r250875) @@ -135,9 +135,6 @@ struct filter *filter_create_int (struct bool filter_apply_chain (struct filter * chain) { int pid, pipes[2]; - int r; - const int readsz = 512; - char *buf; /* Tricky recursion, since we want to begin the chain Modified: head/contrib/flex/flex.skl ============================================================================== --- head/contrib/flex/flex.skl Tue May 21 19:11:11 2013 (r250874) +++ head/contrib/flex/flex.skl Tue May 21 19:17:02 2013 (r250875) @@ -196,7 +196,11 @@ m4_ifdef( [[M4_YY_TABLES_EXTERNAL]], /* First, we deal with platform-specific or compiler-specific issues. */ #if defined(__FreeBSD__) +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif #include +#include #else #define __dead2 #endif Modified: head/contrib/flex/flexint.h ============================================================================== --- head/contrib/flex/flexint.h Tue May 21 19:11:11 2013 (r250874) +++ head/contrib/flex/flexint.h Tue May 21 19:17:02 2013 (r250875) @@ -5,7 +5,8 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#if defined(__FreeBSD__) || \ + (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. Modified: head/contrib/flex/gen.c ============================================================================== --- head/contrib/flex/gen.c Tue May 21 19:11:11 2013 (r250874) +++ head/contrib/flex/gen.c Tue May 21 19:17:02 2013 (r250875) @@ -121,7 +121,7 @@ static struct yytbl_data *mkeoltbl (void } /* Generate the table for possible eol matches. */ -static void geneoltbl () +static void geneoltbl (void) { int i; @@ -431,7 +431,7 @@ void genctbl () /* mkecstbl - Make equivalence-class tables. */ -struct yytbl_data *mkecstbl (void) +static struct yytbl_data *mkecstbl (void) { int i; struct yytbl_data *tbl = 0; Modified: head/contrib/flex/libyywrap.c ============================================================================== --- head/contrib/flex/libyywrap.c Tue May 21 19:11:11 2013 (r250874) +++ head/contrib/flex/libyywrap.c Tue May 21 19:17:02 2013 (r250875) @@ -21,6 +21,7 @@ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ /* PURPOSE. */ +int yywrap (void); int yywrap (void) { return 1; Modified: head/contrib/flex/main.c ============================================================================== --- head/contrib/flex/main.c Tue May 21 19:11:11 2013 (r250874) +++ head/contrib/flex/main.c Tue May 21 19:17:02 2013 (r250875) @@ -1575,11 +1575,12 @@ void readin () } if (!do_yywrap) { - if (!C_plus_plus) + if (!C_plus_plus) { if (reentrant) outn ("\n#define yywrap(yyscanner) 1"); else outn ("\n#define yywrap() 1"); + } outn ("#define YY_SKIP_YYWRAP"); } Modified: head/contrib/flex/misc.c ============================================================================== --- head/contrib/flex/misc.c Tue May 21 19:11:11 2013 (r250874) +++ head/contrib/flex/misc.c Tue May 21 19:17:02 2013 (r250875) @@ -113,6 +113,7 @@ void action_define (defname, value) } +#ifdef notdef /** Append "m4_define([[defname]],[[value]])m4_dnl\n" to the running buffer. * @param defname The macro name. * @param value The macro value, can be NULL, which is the same as the empty string. @@ -133,6 +134,7 @@ void action_m4_define (const char *defna snprintf (buf, sizeof(buf), "m4_define([[%s]],[[%s]])m4_dnl\n", defname, value?value:""); add_action (buf); } +#endif /* Append "new_text" to the running buffer. */ void add_action (new_text) Modified: head/contrib/flex/scanflags.c ============================================================================== --- head/contrib/flex/scanflags.c Tue May 21 19:11:11 2013 (r250874) +++ head/contrib/flex/scanflags.c Tue May 21 19:17:02 2013 (r250875) @@ -62,7 +62,7 @@ sf_init (void) _sf_stk = (scanflags_t*) flex_alloc ( sizeof(scanflags_t) * (_sf_max = 32)); if (!_sf_stk) lerrsf_fatal(_("Unable to allocate %ld of stack"), - (long)sizeof(scanflags_t)); + (void *)(uintptr_t)sizeof(scanflags_t)); _sf_stk[_sf_top_ix] = 0; } From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:20:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 926BC264; Tue, 21 May 2013 19:20:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6C267830; Tue, 21 May 2013 19:20:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJK42F021028; Tue, 21 May 2013 19:20:04 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJK3Qs021022; Tue, 21 May 2013 19:20:03 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305211920.r4LJK3Qs021022@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 May 2013 19:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250876 - head/contrib/flex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:20:04 -0000 Author: jkim Date: Tue May 21 19:20:03 2013 New Revision: 250876 URL: http://svnweb.freebsd.org/changeset/base/250876 Log: Do not use log10(3) to get rid of libm dependency. It is really not useful. Modified: head/contrib/flex/buf.c head/contrib/flex/flexdef.h head/contrib/flex/main.c Modified: head/contrib/flex/buf.c ============================================================================== --- head/contrib/flex/buf.c Tue May 21 19:17:02 2013 (r250875) +++ head/contrib/flex/buf.c Tue May 21 19:20:03 2013 (r250876) @@ -95,7 +95,7 @@ struct Buf *buf_linedir (struct Buf *buf t = flex_alloc (strlen ("#line \"\"\n") + /* constant parts */ 2 * strlen (filename) + /* filename with possibly all backslashes escaped */ - (int) (1 + log10 (abs (lineno))) + /* line number */ + NUMCHARLINES + /* line number */ 1); /* NUL */ if (!t) flexfatal (_("Allocation of buffer for line directive failed")); Modified: head/contrib/flex/flexdef.h ============================================================================== --- head/contrib/flex/flexdef.h Tue May 21 19:17:02 2013 (r250875) +++ head/contrib/flex/flexdef.h Tue May 21 19:20:03 2013 (r250876) @@ -61,7 +61,6 @@ char *alloca (); #include #include #include -#include #endif #ifdef HAVE_ASSERT_H #include @@ -171,6 +170,9 @@ char *alloca (); */ #define NUMDATALINES 10 +/* Number of characters to print a line number, i.e., 1 + log10(INT_MAX) */ +#define NUMCHARLINES 10 + /* transition_struct_out() definitions. */ #define TRANS_STRUCT_PRINT_LENGTH 14 Modified: head/contrib/flex/main.c ============================================================================== --- head/contrib/flex/main.c Tue May 21 19:17:02 2013 (r250875) +++ head/contrib/flex/main.c Tue May 21 19:20:03 2013 (r250876) @@ -451,7 +451,7 @@ void check_options () char *str, *fmt = "#define %s %d\n"; size_t strsz; - str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(scname[i]) + (int)(1 + log10(i)) + 2); + str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(scname[i]) + NUMCHARLINES + 2); if (!str) flexfatal(_("allocation of macro definition failed")); snprintf(str, strsz, fmt, scname[i], i - 1); From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:21:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3BB1C3EA; Tue, 21 May 2013 19:21:27 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E26E840; Tue, 21 May 2013 19:21:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJLRYr022868; Tue, 21 May 2013 19:21:27 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJLRpM022867; Tue, 21 May 2013 19:21:27 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305211921.r4LJLRpM022867@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 May 2013 19:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250877 - head/contrib/flex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:21:27 -0000 Author: jkim Date: Tue May 21 19:21:26 2013 New Revision: 250877 URL: http://svnweb.freebsd.org/changeset/base/250877 Log: Define yy_current_buffer for backward compatibility. Modified: head/contrib/flex/flex.skl Modified: head/contrib/flex/flex.skl ============================================================================== --- head/contrib/flex/flex.skl Tue May 21 19:20:03 2013 (r250876) +++ head/contrib/flex/flex.skl Tue May 21 19:21:26 2013 (r250877) @@ -638,6 +638,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], #define YY_CURRENT_BUFFER ( YY_G(yy_buffer_stack) \ ? YY_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)] \ : NULL) +#define yy_current_buffer YY_CURRENT_BUFFER ]]) m4_ifdef( [[M4_YY_NOT_IN_HEADER]], From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:22:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7C72A581; Tue, 21 May 2013 19:22:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6ED3D853; Tue, 21 May 2013 19:22:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJMhuP023172; Tue, 21 May 2013 19:22:43 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJMhYc023171; Tue, 21 May 2013 19:22:43 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305211922.r4LJMhYc023171@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 May 2013 19:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250878 - head/contrib/flex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:22:43 -0000 Author: jkim Date: Tue May 21 19:22:42 2013 New Revision: 250878 URL: http://svnweb.freebsd.org/changeset/base/250878 Log: Allow YY_NO_UNPUT to disable unput() for backward compatibility. Modified: head/contrib/flex/flex.skl Modified: head/contrib/flex/flex.skl ============================================================================== --- head/contrib/flex/flex.skl Tue May 21 19:21:26 2013 (r250877) +++ head/contrib/flex/flex.skl Tue May 21 19:22:42 2013 (r250878) @@ -1032,7 +1032,9 @@ extern int yywrap M4_YY_PARAMS( M4_YY_PR %not-for-header m4_ifdef( [[M4_YY_NO_UNPUT]],, [[ +#ifndef YY_NO_UNPUT static void yyunput M4_YY_PARAMS( int c, char *buf_ptr M4_YY_PROTO_LAST_ARG); +#endif ]]) %ok-for-header %endif @@ -1808,9 +1810,11 @@ m4_ifdef( [[M4_YY_USES_REJECT]], %if-c-only m4_ifdef( [[M4_YY_NO_UNPUT]],, [[ +#ifndef YY_NO_UNPUT static void yyunput YYFARGS2( int,c, char *,yy_bp) %endif %if-c++-only +#ifndef YY_NO_UNPUT void yyFlexLexer::yyunput( int c, char* yy_bp) %endif { @@ -1857,6 +1861,7 @@ m4_ifdef( [[M4_YY_USE_LINENO]], YY_G(yy_hold_char) = *yy_cp; YY_G(yy_c_buf_p) = yy_cp; } +#endif /* ifndef YY_NO_UNPUT */ %if-c-only ]]) %endif From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:23:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 252A970E; Tue, 21 May 2013 19:23:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 178D3865; Tue, 21 May 2013 19:23:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJNnxe023390; Tue, 21 May 2013 19:23:49 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJNnDL023389; Tue, 21 May 2013 19:23:49 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305211923.r4LJNnDL023389@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 May 2013 19:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250879 - head/contrib/flex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:23:50 -0000 Author: jkim Date: Tue May 21 19:23:49 2013 New Revision: 250879 URL: http://svnweb.freebsd.org/changeset/base/250879 Log: Enable GNU m4 compatibility mode. Modified: head/contrib/flex/main.c Modified: head/contrib/flex/main.c ============================================================================== --- head/contrib/flex/main.c Tue May 21 19:22:42 2013 (r250878) +++ head/contrib/flex/main.c Tue May 21 19:23:49 2013 (r250879) @@ -364,7 +364,7 @@ void check_options () output_chain = filter_create_int(NULL, filter_tee_header, headerfilename); if ( !(m4 = getenv("M4"))) m4 = M4; - filter_create_ext(output_chain, m4, "-P", 0); + filter_create_ext(output_chain, m4, "-gP", 0); filter_create_int(output_chain, filter_fix_linedirs, NULL); /* For debugging, only run the requested number of filters. */ From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:25:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D256B984; Tue, 21 May 2013 19:25:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C4BD487C; Tue, 21 May 2013 19:25:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJPK7s023724; Tue, 21 May 2013 19:25:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJPK1q023718; Tue, 21 May 2013 19:25:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305211925.r4LJPK1q023718@svn.freebsd.org> From: John Baldwin Date: Tue, 21 May 2013 19:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250880 - in stable/8/sys/amd64: amd64 include X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:25:20 -0000 Author: jhb Date: Tue May 21 19:25:19 2013 New Revision: 250880 URL: http://svnweb.freebsd.org/changeset/base/250880 Log: MFC 238450,250152-250153,250415: - Add support for the XSAVEOPT instruction use. - The check to ensure that xstate_bv always has XFEATURE_ENABLED_X87 and XFEATURE_ENABLED_SSE bits set is not needed. CPU correctly handles any bitmask which is subset of the enabled bits in %XCR0. - Partially saved extended state must be handled always, i.e. for both fpu-owned context, and for pcb-saved one. - Correct the type for the literal used on the left side of the shift up to 63 bit positions. Do not fill the save area and do not set the saved bit in the xstate bit vector for the state which is not marked as enabled in xsave_mask. Modified: stable/8/sys/amd64/amd64/cpu_switch.S stable/8/sys/amd64/amd64/fpu.c stable/8/sys/amd64/include/md_var.h stable/8/sys/amd64/include/specialreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/x86/ (props changed) Modified: stable/8/sys/amd64/amd64/cpu_switch.S ============================================================================== --- stable/8/sys/amd64/amd64/cpu_switch.S Tue May 21 19:23:49 2013 (r250879) +++ stable/8/sys/amd64/amd64/cpu_switch.S Tue May 21 19:25:19 2013 (r250880) @@ -122,6 +122,9 @@ done_store_dr: 1: movq %rdx,%rcx movl xsave_mask,%eax movl xsave_mask+4,%edx + .globl ctx_switch_xsave +ctx_switch_xsave: + /* This is patched to xsaveopt if supported, see fpuinit_bsp1() */ /* xsave (%r8) */ .byte 0x41,0x0f,0xae,0x20 movq %rcx,%rdx Modified: stable/8/sys/amd64/amd64/fpu.c ============================================================================== --- stable/8/sys/amd64/amd64/fpu.c Tue May 21 19:23:49 2013 (r250879) +++ stable/8/sys/amd64/amd64/fpu.c Tue May 21 19:25:19 2013 (r250880) @@ -154,6 +154,11 @@ int use_xsave; /* non-static for cpu_s uint64_t xsave_mask; /* the same */ static struct savefpu *fpu_initialstate; +struct xsave_area_elm_descr { + u_int offset; + u_int size; +} *xsave_area_desc; + void fpusave(void *addr) { @@ -200,6 +205,16 @@ fpuinit_bsp1(void) TUNABLE_ULONG_FETCH("hw.xsave_mask", &xsave_mask_user); xsave_mask_user |= XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; xsave_mask &= xsave_mask_user; + + cpuid_count(0xd, 0x1, cp); + if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) { + /* + * Patch the XSAVE instruction in the cpu_switch code + * to XSAVEOPT. We assume that XSAVE encoding used + * REX byte, and set the bit 4 of the r/m byte. + */ + ctx_switch_xsave[3] |= 0x10; + } } /* @@ -270,6 +285,7 @@ static void fpuinitstate(void *arg __unused) { register_t saveintr; + int cp[4], i, max_ext_n; fpu_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF, M_WAITOK | M_ZERO); @@ -291,6 +307,28 @@ fpuinitstate(void *arg __unused) */ bzero(&fpu_initialstate->sv_xmm[0], sizeof(struct xmmacc)); + /* + * Create a table describing the layout of the CPU Extended + * Save Area. + */ + if (use_xsave) { + max_ext_n = flsl(xsave_mask); + xsave_area_desc = malloc(max_ext_n * sizeof(struct + xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO); + /* x87 state */ + xsave_area_desc[0].offset = 0; + xsave_area_desc[0].size = 160; + /* XMM */ + xsave_area_desc[1].offset = 160; + xsave_area_desc[1].size = 288 - 160; + + for (i = 2; i < max_ext_n; i++) { + cpuid_count(0xd, i, cp); + xsave_area_desc[i].offset = cp[1]; + xsave_area_desc[i].size = cp[0]; + } + } + start_emulating(); intr_restore(saveintr); } @@ -578,8 +616,14 @@ fpudna(void) * This is the first time this thread has used the FPU or * the PCB doesn't contain a clean FPU state. Explicitly * load an initial state. + * + * We prefer to restore the state from the actual save + * area in PCB instead of directly loading from + * fpu_initialstate, to ignite the XSAVEOPT + * tracking engine. */ - fpurestore(fpu_initialstate); + bcopy(fpu_initialstate, pcb->pcb_save, cpu_max_ext_state_size); + fpurestore(pcb->pcb_save); if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) fldcw(pcb->pcb_initial_fpucw); if (PCB_USER_FPU(pcb)) @@ -614,6 +658,9 @@ int fpugetregs(struct thread *td) { struct pcb *pcb; + uint64_t *xstate_bv, bit; + char *sa; + int max_ext_n, i, owned; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { @@ -627,12 +674,31 @@ fpugetregs(struct thread *td) critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { fpusave(get_pcb_user_save_pcb(pcb)); - critical_exit(); - return (_MC_FPOWNED_FPU); + owned = _MC_FPOWNED_FPU; } else { - critical_exit(); - return (_MC_FPOWNED_PCB); + owned = _MC_FPOWNED_PCB; } + critical_exit(); + if (use_xsave) { + /* + * Handle partially saved state. + */ + sa = (char *)get_pcb_user_save_pcb(pcb); + xstate_bv = (uint64_t *)(sa + sizeof(struct savefpu) + + offsetof(struct xstate_hdr, xstate_bv)); + max_ext_n = flsl(xsave_mask); + for (i = 0; i < max_ext_n; i++) { + bit = 1ULL << i; + if ((xsave_mask & bit) == 0 || (*xstate_bv & bit) != 0) + continue; + bcopy((char *)fpu_initialstate + + xsave_area_desc[i].offset, + sa + xsave_area_desc[i].offset, + xsave_area_desc[i].size); + *xstate_bv |= bit; + } + } + return (owned); } void @@ -676,9 +742,6 @@ fpusetxstate(struct thread *td, char *xf */ if (bv & ~xsave_mask) return (EINVAL); - if ((bv & (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) != - (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) - return (EINVAL); hdr = (struct xstate_hdr *)(get_pcb_user_save_td(td) + 1); Modified: stable/8/sys/amd64/include/md_var.h ============================================================================== --- stable/8/sys/amd64/include/md_var.h Tue May 21 19:23:49 2013 (r250879) +++ stable/8/sys/amd64/include/md_var.h Tue May 21 19:25:19 2013 (r250880) @@ -57,6 +57,7 @@ extern u_int cpu_procinfo; extern u_int cpu_procinfo2; extern char cpu_vendor[]; extern u_int cpu_vendor_id; +extern char ctx_switch_xsave[]; extern char kstack[]; extern char sigcode[]; extern int szsigcode; Modified: stable/8/sys/amd64/include/specialreg.h ============================================================================== --- stable/8/sys/amd64/include/specialreg.h Tue May 21 19:23:49 2013 (r250879) +++ stable/8/sys/amd64/include/specialreg.h Tue May 21 19:25:19 2013 (r250880) @@ -230,6 +230,11 @@ #define CPUID_TYPE_CORE 2 /* + * CPUID instruction 0xd Processor Extended State Enumeration Sub-leaf 1 + */ +#define CPUID_EXTSTATE_XSAVEOPT 0x00000001 + +/* * AMD extended function 8000_0007h edx info */ #define AMDPM_TS 0x00000001 From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:32:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 25D46B74; Tue, 21 May 2013 19:32:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17FAB8C7; Tue, 21 May 2013 19:32:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJWbPI026665; Tue, 21 May 2013 19:32:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJWahf026659; Tue, 21 May 2013 19:32:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305211932.r4LJWahf026659@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 May 2013 19:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250881 - in head: . sys/sys usr.bin/lex usr.bin/lex/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:32:37 -0000 Author: jkim Date: Tue May 21 19:32:35 2013 New Revision: 250881 URL: http://svnweb.freebsd.org/changeset/base/250881 Log: Connect flex 2.5.37 to the build and bump __FreeBSD_version. Added: head/usr.bin/lex/initparse.c (contents, props changed) head/usr.bin/lex/initparse.h (contents, props changed) head/usr.bin/lex/initskel.c (contents, props changed) head/usr.bin/lex/version.awk (contents, props changed) Deleted: head/usr.bin/lex/COPYING head/usr.bin/lex/FlexLexer.h head/usr.bin/lex/NEWS head/usr.bin/lex/README head/usr.bin/lex/ccl.c head/usr.bin/lex/dfa.c head/usr.bin/lex/ecs.c head/usr.bin/lex/flex.skl head/usr.bin/lex/flexdef.h head/usr.bin/lex/gen.c head/usr.bin/lex/lib/libmain.c head/usr.bin/lex/lib/libyywrap.c head/usr.bin/lex/main.c head/usr.bin/lex/misc.c head/usr.bin/lex/mkskel.sh head/usr.bin/lex/nfa.c head/usr.bin/lex/parse.y head/usr.bin/lex/scan.l head/usr.bin/lex/sym.c head/usr.bin/lex/tblcmp.c head/usr.bin/lex/version.h head/usr.bin/lex/yylex.c Modified: head/Makefile.inc1 head/sys/sys/param.h head/usr.bin/lex/Makefile head/usr.bin/lex/config.h head/usr.bin/lex/initscan.c head/usr.bin/lex/lex.1 head/usr.bin/lex/lib/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 21 19:25:19 2013 (r250880) +++ head/Makefile.inc1 Tue May 21 19:32:35 2013 (r250881) @@ -1206,6 +1206,10 @@ _sed= usr.bin/sed _lex= usr.bin/lex .endif +.if ${BOOTSTRAPPING} < 1000002 +_m4= usr.bin/m4 +.endif + .if ${BOOTSTRAPPING} < 1000013 _yacc= lib/liby \ usr.bin/yacc @@ -1283,6 +1287,7 @@ bootstrap-tools: usr.bin/rpcgen \ ${_sed} \ ${_yacc} \ + ${_m4} \ ${_lex} \ lib/libmd \ usr.bin/xinstall \ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue May 21 19:25:19 2013 (r250880) +++ head/sys/sys/param.h Tue May 21 19:32:35 2013 (r250881) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000032 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000033 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/usr.bin/lex/Makefile ============================================================================== --- head/usr.bin/lex/Makefile Tue May 21 19:25:19 2013 (r250880) +++ head/usr.bin/lex/Makefile Tue May 21 19:32:35 2013 (r250881) @@ -14,37 +14,51 @@ LINKS+= ${BINDIR}/lex ${BINDIR}/lex++ LINKS+= ${BINDIR}/lex ${BINDIR}/flex LINKS+= ${BINDIR}/lex ${BINDIR}/flex++ -SRCS= scan.c ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \ - skel.c sym.c tblcmp.c yylex.c +FLEXDIR= ${.CURDIR}/../../contrib/flex + +.PATH: ${FLEXDIR} + +SRCS= buf.c ccl.c dfa.c ecs.c filter.c gen.c main.c misc.c \ + nfa.c options.c parse.y regex.c scan.c scanflags.c \ + scanopt.c skel.c sym.c tables.c tables_shared.c \ + tblcmp.c yylex.c LFLAGS+= -is -CFLAGS+= -I. -I${.CURDIR} +CFLAGS+= -I. -I${.CURDIR} -I${FLEXDIR} -DHAVE_CONFIG_H INCS= FlexLexer.h INCSDIR= ${INCLUDEDIR} MLINKS+= lex.1 flex.1 MLINKS+= lex.1 flex++.1 MLINKS+= lex.1 lex++.1 -WARNS?= 2 +WARNS?= 3 CLEANFILES= scan.c skel.c +GENFILES= parse.c parse.h scan.c skel.c SUBDIR= lib -skel.c: mkskel.sh flex.skl - sh ${.CURDIR}/mkskel.sh ${.CURDIR}/flex.skl > skel.c +FLEX_VERSION= `awk -f ${.CURDIR}/version.awk ${.CURDIR}/config.h` -bootstrap: initscan.c - @cmp -s ${.CURDIR}/initscan.c scan.c || { \ - echo "Bootstrapping flex" ; \ - rm -f scan.c ; \ - cp -f ${.CURDIR}/initscan.c scan.c ; \ +skel.c: config.h mkskel.sh flex.skl version.awk + sed 's/m4_/m4postproc_/g; s/m4preproc_/m4_/g' \ + ${FLEXDIR}/flex.skl | \ + m4 -I${FLEXDIR} -P ${FLEX_VERSION} | \ + sed 's/m4postproc_/m4_/g' | \ + sh ${FLEXDIR}/mkskel.sh > ${.TARGET} + +bootstrap: ${GENFILES:S/^/init/g} +.for _f in ${GENFILES} + @diff -I '^#line ' -I '\$$FreeBS[D]: .*\$$' -q \ + ${.CURDIR}/init${_f} ${_f} 2> /dev/null || { \ + echo "Bootstrapping ${_f}" ; \ + cp -f ${.CURDIR}/init${_f} ${_f} ; \ } +.endfor test: check -check: $(PROG) - ./$(PROG) $(LFLAGS) -t $(COMPRESSION) $(.CURDIR)/scan.l \ - | sed s,\"$(.CURDIR)/scan.l",\"scan.l", \ - | diff -I '\$$FreeBS[D]:.*\$$' $(.CURDIR)/initscan.c - +check: ${PROG} + ./${PROG} ${LFLAGS} -t ${COMPRESSION} ${FLEXDIR}/scan.l | \ + diff -I '^#line ' -I '\$$FreeBS[D]: .*\$$' ${.CURDIR}/initscan.c - @echo "Check successful" .include Modified: head/usr.bin/lex/config.h ============================================================================== --- head/usr.bin/lex/config.h Tue May 21 19:25:19 2013 (r250880) +++ head/usr.bin/lex/config.h Tue May 21 19:32:35 2013 (r250881) @@ -1,26 +1,208 @@ -/* config.h. Generated automatically by configure. */ +/* config.h. Generated from conf.in by configure. */ +/* conf.in. Generated from configure.in by autoheader. */ /* $FreeBSD$ */ -/* Define to empty if the keyword does not work. */ -/* #undef const */ +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if you have the `dup2' function. */ +#define HAVE_DUP2 1 + +/* Define to 1 if you have the `fork' function. */ +#define HAVE_FORK 1 + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define if you have the iconv() function. */ +/* #undef HAVE_ICONV */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isascii' function. */ +#define HAVE_ISASCII 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBINTL_H */ + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* pthread library */ +#define HAVE_LIBPTHREAD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 -/* Define if you have the header file. */ +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#define HAVE_MALLOC 1 + +/* Define to 1 if you have the header file. */ /* #undef HAVE_MALLOC_H */ -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the `pow' function. */ +#define HAVE_POW 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PTHREAD_H 1 + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#define HAVE_REALLOC 1 + +/* Define to 1 if you have the `regcomp' function. */ +#define HAVE_REGCOMP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_REGEX_H 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if stdbool.h conforms to C99. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 -/* Define if you have the header file. */ +/* Define to 1 if you have the `strtol' function. */ +#define HAVE_STRTOL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 -/* Define if you have and it should be used (not on Ultrix). */ -/* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vfork' function. */ +#define HAVE_VFORK 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_VFORK_H */ + +/* Define to 1 if `fork' works. */ +#define HAVE_WORKING_FORK 1 + +/* Define to 1 if `vfork' works. */ +#define HAVE_WORKING_VFORK 1 + +/* Define to 1 if the system has the type `_Bool'. */ +#define HAVE__BOOL 1 + +/* Define to the m4 executable name. */ +#define M4 "m4" + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "flex" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "flex-help@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "the fast lexical analyser generator" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "the fast lexical analyser generator 2.5.37" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "flex" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.5.37" + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "2.5.37" + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#define YYTEXT_POINTER 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to `int' if does not define. */ +/* #undef pid_t */ + +/* Define to rpl_realloc if the replacement function should be used. */ +/* #undef realloc */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ -/* Define if platform-specific command line handling is necessary. */ -/* #undef NEED_ARGV_FIXUP */ +/* Define as `fork' if `vfork' does not work. */ +/* #undef vfork */ Added: head/usr.bin/lex/initparse.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/lex/initparse.c Tue May 21 19:32:35 2013 (r250881) @@ -0,0 +1,1849 @@ +/* $FreeBSD$ */ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + +#define YYPREFIX "yy" + +#define YYPURE 0 + +#line 35 "parse.y" +/* Copyright (c) 1990 The Regents of the University of California. */ +/* All rights reserved. */ + +/* This code is derived from software contributed to Berkeley by */ +/* Vern Paxson. */ + +/* The United States Government has rights in this work pursuant */ +/* to contract no. DE-AC03-76SF00098 between the United States */ +/* Department of Energy and the University of California. */ + +/* This file is part of flex. */ + +/* 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. */ + +/* Neither the name of the University nor the names of its contributors */ +/* may be used to endorse or promote products derived from this software */ +/* without specific prior written permission. */ + +/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ +/* PURPOSE. */ + +#include "flexdef.h" +#include "tables.h" + +int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen; +int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule; + +int *scon_stk; +int scon_stk_ptr; + +static int madeany = false; /* whether we've made the '.' character class */ +static int ccldot, cclany; +int previous_continued_action; /* whether the previous rule's action was '|' */ + +#define format_warn3(fmt, a1, a2) \ + do{ \ + char fw3_msg[MAXLINE];\ + snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\ + warn( fw3_msg );\ + }while(0) + +/* Expand a POSIX character class expression. */ +#define CCL_EXPR(func) \ + do{ \ + int c; \ + for ( c = 0; c < csize; ++c ) \ + if ( isascii(c) && func(c) ) \ + ccladd( currccl, c ); \ + }while(0) + +/* negated class */ +#define CCL_NEG_EXPR(func) \ + do{ \ + int c; \ + for ( c = 0; c < csize; ++c ) \ + if ( !func(c) ) \ + ccladd( currccl, c ); \ + }while(0) + +/* While POSIX defines isblank(), it's not ANSI C. */ +#define IS_BLANK(c) ((c) == ' ' || (c) == '\t') + +/* On some over-ambitious machines, such as DEC Alpha's, the default + * token type is "long" instead of "int"; this leads to problems with + * declaring yylval in flexdef.h. But so far, all the yacc's I've seen + * wrap their definitions of YYSTYPE with "#ifndef YYSTYPE"'s, so the + * following should ensure that the default token type is "int". + */ +#define YYSTYPE int + +#line 99 "parse.c" + +#ifndef YYSTYPE +typedef int YYSTYPE; +#endif + +/* compatibility with bison */ +#ifdef YYPARSE_PARAM +/* compatibility with FreeBSD */ +# ifdef YYPARSE_PARAM_TYPE +# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) +# else +# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) +# endif +#else +# define YYPARSE_DECL() yyparse(void) +#endif + +/* Parameters sent to lex. */ +#ifdef YYLEX_PARAM +# define YYLEX_DECL() yylex(void *YYLEX_PARAM) +# define YYLEX yylex(YYLEX_PARAM) +#else +# define YYLEX_DECL() yylex(void) +# define YYLEX yylex() +#endif + +/* Parameters sent to yyerror. */ +#ifndef YYERROR_DECL +#define YYERROR_DECL() yyerror(const char *s) +#endif +#ifndef YYERROR_CALL +#define YYERROR_CALL(msg) yyerror(msg) +#endif + +extern int YYPARSE_DECL(); + +#define CHAR 257 +#define NUMBER 258 +#define SECTEND 259 +#define SCDECL 260 +#define XSCDECL 261 +#define NAME 262 +#define PREVCCL 263 +#define EOF_OP 264 +#define OPTION_OP 265 +#define OPT_OUTFILE 266 +#define OPT_PREFIX 267 +#define OPT_YYCLASS 268 +#define OPT_HEADER 269 +#define OPT_EXTRA_TYPE 270 +#define OPT_TABLES 271 +#define CCE_ALNUM 272 +#define CCE_ALPHA 273 +#define CCE_BLANK 274 +#define CCE_CNTRL 275 +#define CCE_DIGIT 276 +#define CCE_GRAPH 277 +#define CCE_LOWER 278 +#define CCE_PRINT 279 +#define CCE_PUNCT 280 +#define CCE_SPACE 281 +#define CCE_UPPER 282 +#define CCE_XDIGIT 283 +#define CCE_NEG_ALNUM 284 +#define CCE_NEG_ALPHA 285 +#define CCE_NEG_BLANK 286 +#define CCE_NEG_CNTRL 287 +#define CCE_NEG_DIGIT 288 +#define CCE_NEG_GRAPH 289 +#define CCE_NEG_LOWER 290 +#define CCE_NEG_PRINT 291 +#define CCE_NEG_PUNCT 292 +#define CCE_NEG_SPACE 293 +#define CCE_NEG_UPPER 294 +#define CCE_NEG_XDIGIT 295 +#define CCL_OP_DIFF 296 +#define CCL_OP_UNION 297 +#define BEGIN_REPEAT_POSIX 298 +#define END_REPEAT_POSIX 299 +#define BEGIN_REPEAT_FLEX 300 +#define END_REPEAT_FLEX 301 +#define YYERRCODE 256 +static const short yylhs[] = { -1, + 0, 1, 2, 2, 2, 2, 3, 6, 6, 7, + 7, 7, 8, 9, 9, 10, 10, 10, 10, 10, + 10, 4, 4, 4, 5, 12, 12, 12, 12, 14, + 11, 11, 11, 15, 15, 15, 16, 13, 13, 13, + 13, 18, 18, 17, 19, 19, 19, 19, 19, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 21, 21, 21, 23, 23, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 22, 22, +}; +static const short yylen[] = { 2, + 5, 0, 3, 2, 0, 1, 1, 1, 1, 2, + 1, 1, 2, 2, 0, 3, 3, 3, 3, 3, + 3, 5, 5, 0, 0, 2, 1, 1, 1, 0, + 4, 3, 0, 3, 1, 1, 1, 2, 3, 2, + 1, 3, 1, 2, 2, 1, 6, 5, 4, 2, + 2, 2, 6, 5, 4, 1, 1, 1, 3, 3, + 1, 3, 3, 1, 3, 4, 4, 2, 2, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 0, +}; +static const short yydefred[] = { 2, + 0, 0, 6, 0, 7, 8, 9, 15, 24, 0, + 4, 0, 0, 12, 11, 0, 0, 0, 0, 0, + 0, 0, 14, 0, 1, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 24, 0, 16, 18, 19, + 20, 17, 21, 32, 36, 37, 0, 35, 0, 29, + 61, 58, 28, 0, 56, 96, 0, 0, 0, 27, + 0, 0, 0, 0, 0, 64, 31, 0, 23, 26, + 0, 0, 70, 0, 22, 0, 40, 0, 44, 0, + 0, 0, 50, 51, 52, 0, 0, 34, 95, 59, + 60, 0, 0, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 82, 81, 83, 84, 85, 86, 87, + 88, 93, 89, 90, 91, 94, 92, 65, 69, 39, + 0, 0, 0, 62, 63, 66, 0, 49, 0, 55, + 0, 67, 0, 48, 0, 54, 47, 53, +}; +static const short yydgoto[] = { 1, + 2, 4, 9, 13, 25, 10, 16, 11, 12, 23, + 26, 59, 60, 35, 47, 48, 61, 62, 63, 64, + 65, 71, 66, 74, 119, +}; +static const short yysindex[] = { 0, + 0, -222, 0, -155, 0, 0, 0, 0, 0, -215, + 0, -123, 6, 0, 0, -193, 10, 21, 26, 31, + 35, 37, 0, 59, 0, -44, 0, -147, -145, -140, + -133, -132, -129, 75, -214, 0, -19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 23, 0, -48, 0, + 0, 0, 0, -17, 0, 0, -17, 27, 128, 0, + -17, -1, -30, -41, -189, 0, 0, -121, 0, 0, + -31, -34, 0, -87, 0, -25, 0, -17, 0, -109, + -41, -108, 0, 0, 0, 60, 60, 0, 0, 0, + 0, 46, 107, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -30, -36, -39, 0, 0, 0, -104, 0, -219, 0, + -238, 0, -144, 0, -143, 0, 0, 0, +}; +static const short yyrindex[] = { 0, + 0, -141, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -134, 9, 0, 0, -125, 0, 0, 0, 0, + 0, 0, 0, -178, 0, 22, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -21, 0, + 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, + 0, 144, 47, 4, -10, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 124, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; +static const short yygindex[] = { 0, + 0, 0, 0, 121, 133, 0, 0, 0, 0, 0, + 0, 0, 106, 0, 0, 93, 0, 32, 84, -45, + 0, 0, 25, 90, 0, +}; +#define YYTABLESIZE 419 +static const short yytable[] = { 57, + 83, 84, 90, 56, 131, 118, 91, 129, 25, 57, + 120, 24, 33, 46, 56, 55, 56, 81, 33, 135, + 57, 85, 57, 57, 33, 57, 55, 45, 55, 57, + 57, 57, 57, 3, 77, 57, 57, 46, 133, 46, + 14, 45, 33, 46, 46, 79, 15, 46, 33, 46, + 46, 45, 57, 45, 33, 25, 43, 45, 45, 42, + 58, 25, 136, 45, 45, 24, 68, 25, 27, 33, + 28, 58, 33, 58, 54, 81, 69, 30, 36, 134, + 57, 29, 43, 30, 67, 42, 30, 43, 72, 78, + 42, 31, 76, 43, 46, 32, 42, 33, 78, 33, + 34, 33, 33, 5, 6, 7, 86, 87, 45, 8, + 124, 125, 25, 57, 38, 25, 39, 5, 5, 5, + 73, 40, 78, 5, 13, 13, 13, 46, 41, 42, + 13, 33, 43, 3, 3, 3, 44, 75, 126, 3, + 46, 45, 17, 18, 19, 20, 21, 22, 122, 123, + 58, 127, 132, 41, 137, 38, 49, 138, 37, 70, + 88, 121, 92, 0, 0, 0, 0, 0, 0, 93, + 43, 0, 0, 42, 0, 0, 0, 70, 0, 0, + 0, 0, 0, 0, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 0, 0, + 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 89, 51, 0, 0, 0, + 0, 0, 52, 0, 33, 33, 50, 51, 0, 51, + 0, 33, 33, 52, 53, 52, 57, 0, 0, 0, + 0, 0, 57, 0, 0, 0, 0, 0, 82, 0, + 46, 130, 128, 0, 33, 33, 46, 80, 0, 0, + 0, 33, 33, 0, 45, 0, 0, 25, 25, 0, + 45, 0, 0, 0, 25, 25, 0, 57, 0, 57, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 46, 93, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 45, 0, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 70, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, +}; +static const short yycheck[] = { 10, + 42, 43, 34, 34, 44, 93, 41, 44, 0, 40, + 36, 60, 34, 10, 34, 46, 34, 63, 40, 258, + 40, 63, 40, 34, 46, 36, 46, 10, 46, 40, + 41, 42, 43, 256, 36, 46, 47, 34, 258, 36, + 256, 256, 34, 40, 41, 47, 262, 262, 40, 46, + 47, 34, 63, 36, 46, 34, 10, 40, 41, 10, + 91, 40, 301, 46, 47, 60, 44, 46, 262, 91, + 61, 91, 94, 91, 94, 121, 125, 256, 123, 299, + 91, 61, 36, 262, 62, 36, 61, 41, 57, 124, + 41, 61, 61, 47, 91, 61, 47, 61, 124, 91, + 42, 123, 94, 259, 260, 261, 296, 297, 91, 265, + 86, 87, 91, 124, 262, 94, 262, 259, 260, 261, + 94, 262, 124, 265, 259, 260, 261, 124, 262, 262, + 265, 123, 262, 259, 260, 261, 62, 10, 93, 265, + 262, 124, 266, 267, 268, 269, 270, 271, 258, 258, + 91, 45, 257, 10, 299, 10, 36, 301, 26, 54, + 68, 78, 73, -1, -1, -1, -1, -1, -1, 257, + 124, -1, -1, 124, -1, -1, -1, 93, -1, -1, + -1, -1, -1, -1, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, -1, -1, + -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, + -1, -1, -1, -1, -1, 257, 257, -1, -1, -1, + -1, -1, 263, -1, 256, 257, 256, 257, -1, 257, + -1, 263, 264, 263, 264, 263, 257, -1, -1, -1, + -1, -1, 263, -1, -1, -1, -1, -1, 300, -1, + 257, 301, 299, -1, 256, 257, 263, 298, -1, -1, + -1, 263, 264, -1, 257, -1, -1, 256, 257, -1, + 263, -1, -1, -1, 263, 264, -1, 298, -1, 300, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 298, 257, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 298, -1, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 257, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 257, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, +}; +#define YYFINAL 1 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 301 +#if YYDEBUG +static const char *yyname[] = { + +"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,"'\"'",0,"'$'",0,0,0,"'('","')'","'*'","'+'","','","'-'","'.'","'/'",0,0, +0,0,0,0,0,0,0,0,0,0,"'<'","'='","'>'","'?'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,"'['",0,"']'","'^'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,"'{'","'|'","'}'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"CHAR","NUMBER","SECTEND", +"SCDECL","XSCDECL","NAME","PREVCCL","EOF_OP","OPTION_OP","OPT_OUTFILE", +"OPT_PREFIX","OPT_YYCLASS","OPT_HEADER","OPT_EXTRA_TYPE","OPT_TABLES", +"CCE_ALNUM","CCE_ALPHA","CCE_BLANK","CCE_CNTRL","CCE_DIGIT","CCE_GRAPH", +"CCE_LOWER","CCE_PRINT","CCE_PUNCT","CCE_SPACE","CCE_UPPER","CCE_XDIGIT", +"CCE_NEG_ALNUM","CCE_NEG_ALPHA","CCE_NEG_BLANK","CCE_NEG_CNTRL","CCE_NEG_DIGIT", +"CCE_NEG_GRAPH","CCE_NEG_LOWER","CCE_NEG_PRINT","CCE_NEG_PUNCT","CCE_NEG_SPACE", +"CCE_NEG_UPPER","CCE_NEG_XDIGIT","CCL_OP_DIFF","CCL_OP_UNION", +"BEGIN_REPEAT_POSIX","END_REPEAT_POSIX","BEGIN_REPEAT_FLEX","END_REPEAT_FLEX", +}; +static const char *yyrule[] = { +"$accept : goal", +"goal : initlex sect1 sect1end sect2 initforrule", +"initlex :", +"sect1 : sect1 startconddecl namelist1", +"sect1 : sect1 options", +"sect1 :", +"sect1 : error", +"sect1end : SECTEND", +"startconddecl : SCDECL", +"startconddecl : XSCDECL", +"namelist1 : namelist1 NAME", +"namelist1 : NAME", +"namelist1 : error", +"options : OPTION_OP optionlist", +"optionlist : optionlist option", +"optionlist :", +"option : OPT_OUTFILE '=' NAME", +"option : OPT_EXTRA_TYPE '=' NAME", +"option : OPT_PREFIX '=' NAME", +"option : OPT_YYCLASS '=' NAME", +"option : OPT_HEADER '=' NAME", +"option : OPT_TABLES '=' NAME", +"sect2 : sect2 scon initforrule flexrule '\\n'", +"sect2 : sect2 scon '{' sect2 '}'", +"sect2 :", +"initforrule :", +"flexrule : '^' rule", +"flexrule : rule", +"flexrule : EOF_OP", +"flexrule : error", +"scon_stk_ptr :", +"scon : '<' scon_stk_ptr namelist2 '>'", +"scon : '<' '*' '>'", +"scon :", +"namelist2 : namelist2 ',' sconname", +"namelist2 : sconname", +"namelist2 : error", +"sconname : NAME", +"rule : re2 re", +"rule : re2 re '$'", +"rule : re '$'", +"rule : re", +"re : re '|' series", +"re : series", +"re2 : re '/'", +"series : series singleton", +"series : singleton", +"series : series BEGIN_REPEAT_POSIX NUMBER ',' NUMBER END_REPEAT_POSIX", +"series : series BEGIN_REPEAT_POSIX NUMBER ',' END_REPEAT_POSIX", +"series : series BEGIN_REPEAT_POSIX NUMBER END_REPEAT_POSIX", +"singleton : singleton '*'", +"singleton : singleton '+'", +"singleton : singleton '?'", +"singleton : singleton BEGIN_REPEAT_FLEX NUMBER ',' NUMBER END_REPEAT_FLEX", +"singleton : singleton BEGIN_REPEAT_FLEX NUMBER ',' END_REPEAT_FLEX", +"singleton : singleton BEGIN_REPEAT_FLEX NUMBER END_REPEAT_FLEX", +"singleton : '.'", +"singleton : fullccl", +"singleton : PREVCCL", +"singleton : '\"' string '\"'", +"singleton : '(' re ')'", +"singleton : CHAR", +"fullccl : fullccl CCL_OP_DIFF braceccl", +"fullccl : fullccl CCL_OP_UNION braceccl", +"fullccl : braceccl", +"braceccl : '[' ccl ']'", +"braceccl : '[' '^' ccl ']'", +"ccl : ccl CHAR '-' CHAR", +"ccl : ccl CHAR", +"ccl : ccl ccl_expr", +"ccl :", +"ccl_expr : CCE_ALNUM", +"ccl_expr : CCE_ALPHA", +"ccl_expr : CCE_BLANK", +"ccl_expr : CCE_CNTRL", +"ccl_expr : CCE_DIGIT", +"ccl_expr : CCE_GRAPH", +"ccl_expr : CCE_LOWER", +"ccl_expr : CCE_PRINT", +"ccl_expr : CCE_PUNCT", +"ccl_expr : CCE_SPACE", +"ccl_expr : CCE_XDIGIT", +"ccl_expr : CCE_UPPER", +"ccl_expr : CCE_NEG_ALNUM", +"ccl_expr : CCE_NEG_ALPHA", +"ccl_expr : CCE_NEG_BLANK", +"ccl_expr : CCE_NEG_CNTRL", +"ccl_expr : CCE_NEG_DIGIT", +"ccl_expr : CCE_NEG_GRAPH", +"ccl_expr : CCE_NEG_PRINT", +"ccl_expr : CCE_NEG_PUNCT", +"ccl_expr : CCE_NEG_SPACE", +"ccl_expr : CCE_NEG_XDIGIT", +"ccl_expr : CCE_NEG_LOWER", +"ccl_expr : CCE_NEG_UPPER", +"string : string CHAR", +"string :", + +}; +#endif + +int yydebug; +int yynerrs; + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; + +/* define the initial stack-sizes */ +#ifdef YYSTACKSIZE +#undef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 500 +#define YYMAXDEPTH 500 +#endif +#endif + +#define YYINITSTACKSIZE 500 + +typedef struct { + unsigned stacksize; + short *s_base; + short *s_mark; + short *s_last; + YYSTYPE *l_base; + YYSTYPE *l_mark; +} YYSTACKDATA; +/* variables for the parser stack */ +static YYSTACKDATA yystack; +#line 948 "parse.y" + + +/* build_eof_action - build the "<>" action for the active start + * conditions + */ + +void build_eof_action() + { + int i; + char action_text[MAXLINE]; + + for ( i = 1; i <= scon_stk_ptr; ++i ) + { + if ( sceof[scon_stk[i]] ) + format_pinpoint_message( + "multiple <> rules for start condition %s", + scname[scon_stk[i]] ); + + else + { + sceof[scon_stk[i]] = true; + + if (previous_continued_action /* && previous action was regular */) + add_action("YY_RULE_SETUP\n"); + + snprintf( action_text, sizeof(action_text), "case YY_STATE_EOF(%s):\n", + scname[scon_stk[i]] ); + add_action( action_text ); + } + } + + line_directive_out( (FILE *) 0, 1 ); + + /* This isn't a normal rule after all - don't count it as + * such, so we don't have any holes in the rule numbering + * (which make generating "rule can never match" warnings + * more difficult. + */ + --num_rules; + ++num_eof_rules; + } + + +/* format_synerr - write out formatted syntax error */ + +void format_synerr( msg, arg ) +const char *msg, arg[]; + { + char errmsg[MAXLINE]; + + (void) snprintf( errmsg, sizeof(errmsg), msg, arg ); + synerr( errmsg ); + } + + +/* synerr - report a syntax error */ + +void synerr( str ) +const char *str; + { + syntaxerror = true; + pinpoint_message( str ); + } + + +/* format_warn - write out formatted warning */ + +void format_warn( msg, arg ) +const char *msg, arg[]; + { + char warn_msg[MAXLINE]; + + snprintf( warn_msg, sizeof(warn_msg), msg, arg ); + warn( warn_msg ); + } + + +/* warn - report a warning, unless -w was given */ + +void warn( str ) +const char *str; + { + line_warning( str, linenum ); + } + +/* format_pinpoint_message - write out a message formatted with one string, + * pinpointing its location + */ + +void format_pinpoint_message( msg, arg ) +const char *msg, arg[]; + { + char errmsg[MAXLINE]; + + snprintf( errmsg, sizeof(errmsg), msg, arg ); + pinpoint_message( errmsg ); + } + + +/* pinpoint_message - write out a message, pinpointing its location */ + +void pinpoint_message( str ) +const char *str; + { + line_pinpoint( str, linenum ); + } + + +/* line_warning - report a warning at a given line, unless -w was given */ + +void line_warning( str, line ) +const char *str; +int line; + { + char warning[MAXLINE]; + + if ( ! nowarn ) + { + snprintf( warning, sizeof(warning), "warning, %s", str ); + line_pinpoint( warning, line ); + } + } + + +/* line_pinpoint - write out a message, pinpointing it at the given line */ + +void line_pinpoint( str, line ) +const char *str; +int line; + { + fprintf( stderr, "%s:%d: %s\n", infilename, line, str ); + } + + +/* yyerror - eat up an error message from the parser; + * currently, messages are ignore + */ + +void yyerror( msg ) +const char *msg; + { + } +#line 656 "parse.c" + +#if YYDEBUG +#include /* needed for printf */ +#endif + +#include /* needed for malloc, etc */ +#include /* needed for memset */ + +/* allocate initial stack or double stack size, up to YYMAXDEPTH */ +static int yygrowstack(YYSTACKDATA *data) +{ + int i; + unsigned newsize; + short *newss; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:56:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 25A3D5E6; Tue, 21 May 2013 19:56:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 18D779F6; Tue, 21 May 2013 19:56:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJu3Iw034092; Tue, 21 May 2013 19:56:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJu3mE034091; Tue, 21 May 2013 19:56:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305211956.r4LJu3mE034091@svn.freebsd.org> From: Eitan Adler Date: Tue, 21 May 2013 19:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250882 - head/usr.bin/split X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:56:04 -0000 Author: eadler Date: Tue May 21 19:56:03 2013 New Revision: 250882 URL: http://svnweb.freebsd.org/changeset/base/250882 Log: Avoid signed overflow in error handling code. Reviewed by: cperciva, bjk Modified: head/usr.bin/split/split.c Modified: head/usr.bin/split/split.c ============================================================================== --- head/usr.bin/split/split.c Tue May 21 19:32:35 2013 (r250881) +++ head/usr.bin/split/split.c Tue May 21 19:56:03 2013 (r250882) @@ -379,8 +379,10 @@ newfile(void) /* maxfiles = pattlen^sufflen, but don't use libm. */ for (maxfiles = 1, i = 0; i < sufflen; i++) - if ((maxfiles *= pattlen) <= 0) + if (LONG_MAX / pattlen < maxfiles) errx(EX_USAGE, "suffix is too long (max %ld)", i); + else + maxfiles *= pattlen; if (fnum == maxfiles) errx(EX_DATAERR, "too many files"); From owner-svn-src-all@FreeBSD.ORG Tue May 21 19:59:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 553077AC; Tue, 21 May 2013 19:59:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 457CAA23; Tue, 21 May 2013 19:59:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LJxfc0034742; Tue, 21 May 2013 19:59:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LJxbLx034714; Tue, 21 May 2013 19:59:37 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305211959.r4LJxbLx034714@svn.freebsd.org> From: Ed Schouten Date: Tue, 21 May 2013 19:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250883 - in head: include include/xlocale lib/libc/locale sys/sys tools/regression/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:59:41 -0000 Author: ed Date: Tue May 21 19:59:37 2013 New Revision: 250883 URL: http://svnweb.freebsd.org/changeset/base/250883 Log: Add . The header, part of C11, adds a small number of utility functions for 16/32-bit "universal" characters, which may or may not be UTF-16/32. As our wchar_t is already ISO 10646, simply add light-weight wrappers around wcrtomb() and mbrtowc(). While there, also add (non-yet-standard) _l functions, similar to the ones we already have for the other locale-dependent functions. Reviewed by: theraven Added: head/include/uchar.h (contents, props changed) head/include/xlocale/_uchar.h (contents, props changed) head/lib/libc/locale/c16rtomb.c (contents, props changed) head/lib/libc/locale/c32rtomb.c (contents, props changed) head/lib/libc/locale/mbrtoc16.c (contents, props changed) head/lib/libc/locale/mbrtoc32.c (contents, props changed) head/tools/regression/lib/libc/locale/test-c16rtomb.c (contents, props changed) head/tools/regression/lib/libc/locale/test-mbrtoc16.c (contents, props changed) Modified: head/include/Makefile head/include/stdatomic.h head/include/xlocale/Makefile head/lib/libc/locale/Makefile.inc head/lib/libc/locale/Symbol.map head/lib/libc/locale/mbrtowc.3 head/lib/libc/locale/wcrtomb.3 head/lib/libc/locale/xlocale_private.h head/sys/sys/_types.h head/tools/regression/lib/libc/locale/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Tue May 21 19:56:03 2013 (r250882) +++ head/include/Makefile Tue May 21 19:59:37 2013 (r250883) @@ -23,7 +23,7 @@ INCS= a.out.h ar.h assert.h bitstring.h stdnoreturn.h stdio.h stdlib.h string.h stringlist.h \ strings.h sysexits.h tar.h termios.h tgmath.h \ time.h timeconv.h timers.h ttyent.h \ - ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h \ + uchar.h ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h \ wchar.h wctype.h wordexp.h xlocale.h .PATH: ${.CURDIR}/../contrib/libc-vis Modified: head/include/stdatomic.h ============================================================================== --- head/include/stdatomic.h Tue May 21 19:56:03 2013 (r250882) +++ head/include/stdatomic.h Tue May 21 19:59:37 2013 (r250883) @@ -145,10 +145,8 @@ typedef _Atomic(long) atomic_long; typedef _Atomic(unsigned long) atomic_ulong; typedef _Atomic(long long) atomic_llong; typedef _Atomic(unsigned long long) atomic_ullong; -#if 0 typedef _Atomic(__char16_t) atomic_char16_t; typedef _Atomic(__char32_t) atomic_char32_t; -#endif typedef _Atomic(__wchar_t) atomic_wchar_t; typedef _Atomic(__int_least8_t) atomic_int_least8_t; typedef _Atomic(__uint_least8_t) atomic_uint_least8_t; Added: head/include/uchar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/uchar.h Tue May 21 19:59:37 2013 (r250883) @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 2013 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _UCHAR_H_ +#define _UCHAR_H_ + +#include +#include + +#ifndef _MBSTATE_T_DECLARED +typedef __mbstate_t mbstate_t; +#define _MBSTATE_T_DECLARED +#endif + +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif + +typedef __char16_t char16_t; +typedef __char32_t char32_t; + +__BEGIN_DECLS +size_t c16rtomb(char * __restrict, char16_t, mbstate_t * __restrict); +size_t c32rtomb(char * __restrict, char32_t, mbstate_t * __restrict); +size_t mbrtoc16(char16_t * __restrict, const char * __restrict, size_t, + mbstate_t * __restrict); +size_t mbrtoc32(char32_t * __restrict, const char * __restrict, size_t, + mbstate_t * __restrict); +#if __BSD_VISIBLE || defined(_XLOCALE_H_) +#include +#endif +__END_DECLS + +#endif /* !_UCHAR_H_ */ Modified: head/include/xlocale/Makefile ============================================================================== --- head/include/xlocale/Makefile Tue May 21 19:56:03 2013 (r250882) +++ head/include/xlocale/Makefile Tue May 21 19:59:37 2013 (r250883) @@ -2,7 +2,7 @@ NO_OBJ= INCS= _ctype.h _inttypes.h _langinfo.h _locale.h _monetary.h _stdio.h\ - _stdlib.h _string.h _time.h _wchar.h + _stdlib.h _string.h _time.h _uchar.h _wchar.h INCSDIR=${INCLUDEDIR}/xlocale .include Added: head/include/xlocale/_uchar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/xlocale/_uchar.h Tue May 21 19:59:37 2013 (r250883) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2013 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LOCALE_T_DEFINED +#define _LOCALE_T_DEFINED +typedef struct _xlocale *locale_t; +#endif + +#ifndef _XLOCALE_UCHAR_H_ +#define _XLOCALE_UCHAR_H_ + +size_t c16rtomb_l(char * __restrict, char16_t, mbstate_t * __restrict, + locale_t); +size_t c32rtomb_l(char * __restrict, char32_t, mbstate_t * __restrict, + locale_t); +size_t mbrtoc16_l(char16_t * __restrict, const char * __restrict, size_t, + mbstate_t * __restrict, locale_t); +size_t mbrtoc32_l(char32_t * __restrict, const char * __restrict, size_t, + mbstate_t * __restrict, locale_t); + +#endif /* _XLOCALE_UCHAR_H_ */ Modified: head/lib/libc/locale/Makefile.inc ============================================================================== --- head/lib/libc/locale/Makefile.inc Tue May 21 19:56:03 2013 (r250882) +++ head/lib/libc/locale/Makefile.inc Tue May 21 19:59:37 2013 (r250883) @@ -4,11 +4,11 @@ # locale sources .PATH: ${.CURDIR}/${LIBC_ARCH}/locale ${.CURDIR}/locale -SRCS+= ascii.c big5.c btowc.c collate.c collcmp.c euc.c fix_grouping.c \ - gb18030.c gb2312.c gbk.c ctype.c isctype.c iswctype.c \ +SRCS+= ascii.c big5.c btowc.c c16rtomb.c c32rtomb.c collate.c collcmp.c euc.c \ + fix_grouping.c gb18030.c gb2312.c gbk.c ctype.c isctype.c iswctype.c \ ldpart.c lmessages.c lmonetary.c lnumeric.c localeconv.c mblen.c \ mbrlen.c \ - mbrtowc.c mbsinit.c mbsnrtowcs.c \ + mbrtoc16.c mbrtoc32.c mbrtowc.c mbsinit.c mbsnrtowcs.c \ mbsrtowcs.c mbtowc.c mbstowcs.c \ mskanji.c nextwctype.c nl_langinfo.c nomacros.c none.c rpmatch.c \ rune.c \ @@ -72,7 +72,9 @@ MLINKS+=iswalnum_l.3 iswalpha_l.3 iswaln iswalnum_l.3 iswspecial_l.3 iswalnum_l.3 nextwctype_l.3 \ iswalnum_l.3 towctrans_l.3 iswalnum_l.3 wctrans_l.3 MLINKS+=isxdigit.3 ishexnumber.3 +MLINKS+=mbrtowc.3 mbrtoc16.3 mbrtowc.3 mbrtoc32.3 MLINKS+=mbsrtowcs.3 mbsnrtowcs.3 +MLINKS+=wcrtomb.3 c16rtomb.3 wcrtomb.3 c32rtomb.3 MLINKS+=wcsrtombs.3 wcsnrtombs.3 MLINKS+=wcstod.3 wcstof.3 wcstod.3 wcstold.3 MLINKS+=wcstol.3 wcstoul.3 wcstol.3 wcstoll.3 wcstol.3 wcstoull.3 \ Modified: head/lib/libc/locale/Symbol.map ============================================================================== --- head/lib/libc/locale/Symbol.map Tue May 21 19:56:03 2013 (r250882) +++ head/lib/libc/locale/Symbol.map Tue May 21 19:59:37 2013 (r250883) @@ -199,6 +199,14 @@ FBSD_1.3 { __istype_l; __runes_for_locale; _ThreadRuneLocale; + c16rtomb; + c16rtomb_l; + c32rtomb; + c32rtomb_l; + mbrtoc16; + mbrtoc16_l; + mbrtoc32; + mbrtoc32_l; }; FBSDprivate_1.0 { Added: head/lib/libc/locale/c16rtomb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/locale/c16rtomb.c Tue May 21 19:59:37 2013 (r250883) @@ -0,0 +1,81 @@ +/*- + * Copyright (c) 2013 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include "xlocale_private.h" + +typedef struct { + char16_t lead_surrogate; + mbstate_t c32_mbstate; +} _Char16State; + +size_t +c16rtomb_l(char * __restrict s, char16_t c16, mbstate_t * __restrict ps, + locale_t locale) +{ + _Char16State *cs; + char32_t c32; + + FIX_LOCALE(locale); + if (ps == NULL) + ps = &locale->c16rtomb; + cs = (_Char16State *)ps; + + /* If s is a null pointer, the value of parameter c16 is ignored. */ + if (s == NULL) { + c32 = 0; + } else if (cs->lead_surrogate >= 0xd800 && + cs->lead_surrogate <= 0xdbff) { + /* We should see a trail surrogate now. */ + if (c16 < 0xdc00 || c16 > 0xdfff) { + errno = EILSEQ; + return ((size_t)-1); + } + c32 = 0x10000 + ((cs->lead_surrogate & 0x3ff) << 10 | + (c16 & 0x3ff)); + } else if (c16 >= 0xd800 && c16 <= 0xdbff) { + /* Store lead surrogate for next invocation. */ + cs->lead_surrogate = c16; + return (0); + } else { + /* Regular character. */ + c32 = c16; + } + cs->lead_surrogate = 0; + + return (c32rtomb_l(s, c32, &cs->c32_mbstate, locale)); +} + +size_t +c16rtomb(char * __restrict s, char16_t c16, mbstate_t * __restrict ps) +{ + + return (c16rtomb_l(s, c16, ps, __get_locale())); +} Added: head/lib/libc/locale/c32rtomb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/locale/c32rtomb.c Tue May 21 19:59:37 2013 (r250883) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2013 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include "xlocale_private.h" + +size_t +c32rtomb_l(char * __restrict s, char32_t c32, mbstate_t * __restrict ps, + locale_t locale) +{ + + /* Unicode Standard 5.0, D90: ill-formed characters. */ + if ((c32 >= 0xd800 && c32 <= 0xdfff) || c32 > 0x10ffff) { + errno = EILSEQ; + return ((size_t)-1); + } + + FIX_LOCALE(locale); + if (ps == NULL) + ps = &locale->c32rtomb; + + /* Assume wchar_t uses UTF-32. */ + return (wcrtomb_l(s, c32, ps, locale)); +} + +size_t +c32rtomb(char * __restrict s, char32_t c32, mbstate_t * __restrict ps) +{ + + return (c32rtomb_l(s, c32, ps, __get_locale())); +} Added: head/lib/libc/locale/mbrtoc16.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/locale/mbrtoc16.c Tue May 21 19:59:37 2013 (r250883) @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 2013 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include "xlocale_private.h" + +typedef struct { + char16_t trail_surrogate; + mbstate_t c32_mbstate; +} _Char16State; + +size_t +mbrtoc16_l(char16_t * __restrict pc16, const char * __restrict s, size_t n, + mbstate_t * __restrict ps, locale_t locale) +{ + _Char16State *cs; + char32_t c32; + ssize_t len; + + FIX_LOCALE(locale); + if (ps == NULL) + ps = &locale->mbrtoc16; + cs = (_Char16State *)ps; + + /* + * Call straight into mbrtoc32_l() if we don't need to return a + * character value. According to the spec, if s is a null + * pointer, the value of parameter pc16 is also ignored. + */ + if (pc16 == NULL || s == NULL) { + cs->trail_surrogate = 0; + return (mbrtoc32_l(NULL, s, n, &cs->c32_mbstate, locale)); + } + + /* Return the trail surrogate from the previous invocation. */ + if (cs->trail_surrogate >= 0xdc00 && cs->trail_surrogate <= 0xdfff) { + *pc16 = cs->trail_surrogate; + cs->trail_surrogate = 0; + return ((size_t)-3); + } + + len = mbrtoc32_l(&c32, s, n, &cs->c32_mbstate, locale); + if (len >= 0) { + if (c32 < 0x10000) { + /* Fits in one UTF-16 character. */ + *pc16 = c32; + } else { + /* Split up in a surrogate pair. */ + c32 -= 0x10000; + *pc16 = 0xd800 | (c32 >> 10); + cs->trail_surrogate = 0xdc00 | (c32 & 0x3ff); + } + } + return (len); +} + +size_t +mbrtoc16(char16_t * __restrict pc16, const char * __restrict s, size_t n, + mbstate_t * __restrict ps) +{ + + return (mbrtoc16_l(pc16, s, n, ps, __get_locale())); +} Added: head/lib/libc/locale/mbrtoc32.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/locale/mbrtoc32.c Tue May 21 19:59:37 2013 (r250883) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2013 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include "xlocale_private.h" + +size_t +mbrtoc32_l(char32_t * __restrict pc32, const char * __restrict s, size_t n, + mbstate_t * __restrict ps, locale_t locale) +{ + + FIX_LOCALE(locale); + if (ps == NULL) + ps = &locale->mbrtoc32; + + /* Assume wchar_t uses UTF-32. */ + return (mbrtowc_l(pc32, s, n, ps, locale)); +} + +size_t +mbrtoc32(char32_t * __restrict pc32, const char * __restrict s, size_t n, + mbstate_t * __restrict ps) +{ + + return (mbrtoc32_l(pc32, s, n, ps, __get_locale())); +} Modified: head/lib/libc/locale/mbrtowc.3 ============================================================================== --- head/lib/libc/locale/mbrtowc.3 Tue May 21 19:56:03 2013 (r250882) +++ head/lib/libc/locale/mbrtowc.3 Tue May 21 19:59:37 2013 (r250883) @@ -24,11 +24,13 @@ .\" .\" $FreeBSD$ .\" -.Dd April 8, 2004 +.Dd May 21, 2013 .Dt MBRTOWC 3 .Os .Sh NAME -.Nm mbrtowc +.Nm mbrtowc , +.Nm mbrtoc16 , +.Nm mbrtoc32 .Nd "convert a character to a wide-character code (restartable)" .Sh LIBRARY .Lb libc @@ -36,35 +38,51 @@ .In wchar.h .Ft size_t .Fo mbrtowc -.Fa "wchar_t * restrict pwc" "const char * restrict s" "size_t n" +.Fa "wchar_t * restrict pc" "const char * restrict s" "size_t n" +.Fa "mbstate_t * restrict ps" +.Fc +.In uchar.h +.Ft size_t +.Fo mbrtoc16 +.Fa "char16_t * restrict pc" "const char * restrict s" "size_t n" +.Fa "mbstate_t * restrict ps" +.Fc +.Ft size_t +.Fo mbrtoc32 +.Fa "char32_t * restrict pc" "const char * restrict s" "size_t n" .Fa "mbstate_t * restrict ps" .Fc .Sh DESCRIPTION The -.Fn mbrtowc -function inspects at most +.Fn mbrtowc , +.Fn mbrtoc16 +and +.Fn mbrtoc32 +functions inspect at most .Fa n bytes pointed to by .Fa s to determine the number of bytes needed to complete the next multibyte character. If a character can be completed, and -.Fa pwc +.Fa pc is not .Dv NULL , the wide character which is represented by .Fa s is stored in the -.Vt wchar_t +.Vt wchar_t , +.Vt char16_t +or +.Vt char32_t it points to. .Pp If .Fa s is .Dv NULL , -.Fn mbrtowc -behaves as if -.Fa pwc +these functions behave as if +.Fa pc was .Dv NULL , .Fa s @@ -81,15 +99,24 @@ argument, is used to keep track of the shift state. If it is .Dv NULL , -.Fn mbrtowc -uses an internal, static +these functions use an internal, static .Vt mbstate_t object, which is initialized to the initial conversion state at program startup. +.Pp +As a single +.Vt char16_t +is not large enough to represent certain multibyte characters, the +.Fn mbrtoc16 +function may need to be invoked multiple times to convert a single +multibyte character sequence. .Sh RETURN VALUES The -.Fn mbrtowc -functions returns: +.Fn mbrtowc , +.Fn mbrtoc16 +and +.Fn mbrtoc32 +functions return: .Bl -tag -width indent .It 0 The next @@ -100,10 +127,13 @@ represent the null wide character .It >0 The next .Fa n -or fewer bytes -represent a valid character, -.Fn mbrtowc -returns the number of bytes used to complete the multibyte character. +or fewer bytes represent a valid character, these functions +return the number of bytes used to complete the multibyte character. +.It Po Vt size_t Pc Ns \-1 +An encoding error has occurred. +The next +.Fa n +or fewer bytes do not contribute to a valid multibyte character. .It Po Vt size_t Pc Ns \-2 The next .Fa n @@ -111,16 +141,23 @@ contribute to, but do not complete, a va and all .Fa n bytes have been processed. -.It Po Vt size_t Pc Ns \-1 -An encoding error has occurred. -The next -.Fa n -or fewer bytes do not contribute to a valid multibyte character. +.El +.Pp +The +.Fn mbrtoc16 +function also returns: +.Bl -tag -width indent +.It Po Vt size_t Pc Ns \-3 +The next character resulting from a previous call has been stored. +No bytes from the input have been consumed. .El .Sh ERRORS The -.Fn mbrtowc -function will fail if: +.Fn mbrtowc , +.Fn mbrtoc16 +and +.Fn mbrtoc32 +functions will fail if: .Bl -tag -width Er .It Bq Er EILSEQ An invalid multibyte sequence was detected. @@ -134,6 +171,9 @@ The conversion state is invalid. .Xr wcrtomb 3 .Sh STANDARDS The -.Fn mbrtowc -function conforms to -.St -isoC-99 . +.Fn mbrtowc , +.Fn mbrtoc16 +and +.Fn mbrtoc32 +functions conform to +.St -isoC-2011 . Modified: head/lib/libc/locale/wcrtomb.3 ============================================================================== --- head/lib/libc/locale/wcrtomb.3 Tue May 21 19:56:03 2013 (r250882) +++ head/lib/libc/locale/wcrtomb.3 Tue May 21 19:59:37 2013 (r250883) @@ -24,24 +24,34 @@ .\" .\" $FreeBSD$ .\" -.Dd April 8, 2004 +.Dd May 21, 2013 .Dt WCRTOMB 3 .Os .Sh NAME -.Nm wcrtomb +.Nm wcrtomb , +.Nm c16rtomb , +.Nm c32rtomb .Nd "convert a wide-character code to a character (restartable)" .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In wchar.h .Ft size_t -.Fn wcrtomb "char * restrict s" "wchar_t wc" "mbstate_t * restrict ps" +.Fn wcrtomb "char * restrict s" "wchar_t c" "mbstate_t * restrict ps" +.In uchar.h +.Ft size_t +.Fn c16rtomb "char * restrict s" "char16_t c" "mbstate_t * restrict ps" +.Ft size_t +.Fn c32rtomb "char * restrict s" "char32_t c" "mbstate_t * restrict ps" .Sh DESCRIPTION The -.Fn wcrtomb -function stores a multibyte sequence representing the +.Fn wcrtomb , +.Fn c16rtomb +and +.Fn c32rtomb +functions store a multibyte sequence representing the wide character -.Fa wc , +.Fa c , including any necessary shift sequences, to the character array .Fa s , @@ -53,11 +63,10 @@ If .Fa s is .Dv NULL , -.Fn wcrtomb -behaves as if +these functions behave as if .Fa s pointed to an internal buffer and -.Fa wc +.Fa c was a null wide character (L'\e0'). .Pp The @@ -67,26 +76,32 @@ argument, is used to keep track of the shift state. If it is .Dv NULL , -.Fn wcrtomb -uses an internal, static +these functions use an internal, static .Vt mbstate_t object, which is initialized to the initial conversion state at program startup. +.Pp +As certain multibyte characters may only be represented by a series of +16-bit characters, the +.Fn c16rtomb +may need to invoked multiple times before a multibyte sequence is +returned. .Sh RETURN VALUES -The -.Fn wcrtomb -functions returns the length (in bytes) of the multibyte sequence +These functions return the length (in bytes) of the multibyte sequence needed to represent -.Fa wc , +.Fa c , or .Po Vt size_t Pc Ns \-1 if -.Fa wc +.Fa c is not a valid wide character code. .Sh ERRORS The -.Fn wcrtomb -function will fail if: +.Fn wcrtomb , +.Fn c16rtomb +and +.Fn c32rtomb +functions will fail if: .Bl -tag -width Er .It Bq Er EILSEQ An invalid wide character code was specified. @@ -100,6 +115,9 @@ The conversion state is invalid. .Xr wctomb 3 .Sh STANDARDS The -.Fn wcrtomb -function conforms to -.St -isoC-99 . +.Fn wcrtomb , +.Fn c16rtomb +and +.Fn c32rtomb +functions conform to +.St -isoC-2011 . Modified: head/lib/libc/locale/xlocale_private.h ============================================================================== --- head/lib/libc/locale/xlocale_private.h Tue May 21 19:56:03 2013 (r250882) +++ head/lib/libc/locale/xlocale_private.h Tue May 21 19:59:37 2013 (r250883) @@ -109,6 +109,10 @@ struct _xlocale { __mbstate_t mblen; /** Persistent state used by mbrlen() calls. */ __mbstate_t mbrlen; + /** Persistent state used by mbrtoc16() calls. */ + __mbstate_t mbrtoc16; + /** Persistent state used by mbrtoc32() calls. */ + __mbstate_t mbrtoc32; /** Persistent state used by mbrtowc() calls. */ __mbstate_t mbrtowc; /** Persistent state used by mbsnrtowcs() calls. */ @@ -117,6 +121,10 @@ struct _xlocale { __mbstate_t mbsrtowcs; /** Persistent state used by mbtowc() calls. */ __mbstate_t mbtowc; + /** Persistent state used by c16rtomb() calls. */ + __mbstate_t c16rtomb; + /** Persistent state used by c32rtomb() calls. */ + __mbstate_t c32rtomb; /** Persistent state used by wcrtomb() calls. */ __mbstate_t wcrtomb; /** Persistent state used by wcsnrtombs() calls. */ Modified: head/sys/sys/_types.h ============================================================================== --- head/sys/sys/_types.h Tue May 21 19:56:03 2013 (r250882) +++ head/sys/sys/_types.h Tue May 21 19:59:37 2013 (r250883) @@ -89,6 +89,12 @@ typedef int __ct_rune_t; /* arg type fo typedef __ct_rune_t __rune_t; /* rune_t (see above) */ typedef __ct_rune_t __wint_t; /* wint_t (see above) */ +/* Clang already provides these types as built-ins, but only in C++ mode. */ +#if !defined(__clang__) || !defined(__cplusplus) +typedef __uint_least16_t __char16_t; +typedef __uint_least32_t __char32_t; +#endif + typedef __uint32_t __dev_t; /* device number */ typedef __uint32_t __fixpt_t; /* fixed point number */ Modified: head/tools/regression/lib/libc/locale/Makefile ============================================================================== --- head/tools/regression/lib/libc/locale/Makefile Tue May 21 19:56:03 2013 (r250882) +++ head/tools/regression/lib/libc/locale/Makefile Tue May 21 19:59:37 2013 (r250883) @@ -14,7 +14,9 @@ TESTS= test-mbrtowc \ test-wcstombs \ test-mblen \ test-iswctype \ - test-towctrans + test-towctrans \ + test-c16rtomb \ + test-mbrtoc16 .PHONY: tests tests: ${TESTS} Added: head/tools/regression/lib/libc/locale/test-c16rtomb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/locale/test-c16rtomb.c Tue May 21 19:59:37 2013 (r250883) @@ -0,0 +1,115 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Copyright (c) 2013 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * Test program for c16rtomb() as specified by ISO/IEC 9899:2011. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + mbstate_t s; + char buf[MB_LEN_MAX + 1]; + + /* + * C/POSIX locale. + */ + + printf("1..1\n"); + + /* + * If the buffer argument is NULL, c16 is implicitly 0, + * c16rtomb() resets its internal state. + */ + assert(c16rtomb(NULL, L'\0', NULL) == 1); + assert(c16rtomb(NULL, 0xdc00, NULL) == 1); + + /* Null wide character. */ + memset(&s, 0, sizeof(s)); + memset(buf, 0xcc, sizeof(buf)); + assert(c16rtomb(buf, 0, &s) == 1); + assert((unsigned char)buf[0] == 0 && (unsigned char)buf[1] == 0xcc); + + /* Latin letter A, internal state. */ + assert(c16rtomb(NULL, L'\0', NULL) == 1); + assert(c16rtomb(NULL, L'A', NULL) == 1); + + /* Latin letter A. */ + memset(&s, 0, sizeof(s)); + memset(buf, 0xcc, sizeof(buf)); + assert(c16rtomb(buf, L'A', &s) == 1); + assert((unsigned char)buf[0] == 'A' && (unsigned char)buf[1] == 0xcc); + + /* Unicode character 'Pile of poo'. */ + memset(&s, 0, sizeof(s)); + memset(buf, 0xcc, sizeof(buf)); + assert(c16rtomb(buf, 0xd83d, &s) == 0); + assert(c16rtomb(buf, 0xdca9, &s) == (size_t)-1); + assert(errno == EILSEQ); + + /* + * UTF-8. + */ + + assert(strcmp(setlocale(LC_CTYPE, "en_US.UTF-8"), "en_US.UTF-8") == 0); + + /* Unicode character 'Pile of poo'. */ + memset(&s, 0, sizeof(s)); + memset(buf, 0xcc, sizeof(buf)); + assert(c16rtomb(buf, 0xd83d, &s) == 0); + assert(c16rtomb(buf, 0xdca9, &s) == 4); + assert((unsigned char)buf[0] == 0xf0 && (unsigned char)buf[1] == 0x9f && + (unsigned char)buf[2] == 0x92 && (unsigned char)buf[3] == 0xa9 && + (unsigned char)buf[4] == 0xcc); + + /* Invalid code; 'Pile of poo' without the trail surrogate. */ + memset(&s, 0, sizeof(s)); + memset(buf, 0xcc, sizeof(buf)); + assert(c16rtomb(buf, 0xd83d, &s) == 0); + assert(c16rtomb(buf, L'A', &s) == (size_t)-1); + assert(errno == EILSEQ); + + /* Invalid code; 'Pile of poo' without the lead surrogate. */ + memset(&s, 0, sizeof(s)); + memset(buf, 0xcc, sizeof(buf)); + assert(c16rtomb(buf, 0xdca9, &s) == (size_t)-1); + assert(errno == EILSEQ); + + printf("ok 1 - c16rtomb()\n"); +} Added: head/tools/regression/lib/libc/locale/test-mbrtoc16.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/locale/test-mbrtoc16.c Tue May 21 19:59:37 2013 (r250883) @@ -0,0 +1,150 @@ +/*- + * Copyright (c) 2002 Tim J. Robbins + * All rights reserved. + * + * Copyright (c) 2013 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * Test program for mbrtoc16() as specified by ISO/IEC 9899:2011. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + mbstate_t s; + size_t len; + char16_t c16; + + /* + * C/POSIX locale. + */ + + printf("1..1\n"); + + /* Null wide character, internal state. */ + assert(mbrtoc16(&c16, "", 1, NULL) == 0); + assert(c16 == 0); + + /* Null wide character. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 21 20:38:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 401467E3; Tue, 21 May 2013 20:38:23 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 301D4C2D; Tue, 21 May 2013 20:38:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LKcNxo048909; Tue, 21 May 2013 20:38:23 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LKcK6N048891; Tue, 21 May 2013 20:38:20 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305212038.r4LKcK6N048891@svn.freebsd.org> From: Attilio Rao Date: Tue, 21 May 2013 20:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250884 - in head/sys: amd64/amd64 arm/arm i386/i386 i386/xen ia64/ia64 mips/mips powerpc/aim powerpc/booke sparc64/sparc64 vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 20:38:23 -0000 Author: attilio Date: Tue May 21 20:38:19 2013 New Revision: 250884 URL: http://svnweb.freebsd.org/changeset/base/250884 Log: o Relax locking assertions for vm_page_find_least() o Relax locking assertions for pmap_enter_object() and add them also to architectures that currently don't have any o Introduce VM_OBJECT_LOCK_DOWNGRADE() which is basically a downgrade operation on the per-object rwlock o Use all the mechanisms above to make vm_map_pmap_enter() to work mostl of the times only with readlocks. Sponsored by: EMC / Isilon storage division Reviewed by: alc Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/vm/vm_map.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/amd64/amd64/pmap.c Tue May 21 20:38:19 2013 (r250884) @@ -3722,7 +3722,8 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_page_t m, mpte; vm_pindex_t diff, psize; - VM_OBJECT_ASSERT_WLOCKED(m_start->object); + VM_OBJECT_ASSERT_LOCKED(m_start->object); + psize = atop(end - start); mpte = NULL; m = m_start; Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/arm/arm/pmap-v6.c Tue May 21 20:38:19 2013 (r250884) @@ -2931,6 +2931,8 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_page_t m; vm_pindex_t diff, psize; + VM_OBJECT_ASSERT_LOCKED(m_start->object); + psize = atop(end - start); m = m_start; rw_wlock(&pvh_global_lock); Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/arm/arm/pmap.c Tue May 21 20:38:19 2013 (r250884) @@ -3587,6 +3587,8 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_page_t m; vm_pindex_t diff, psize; + VM_OBJECT_ASSERT_LOCKED(m_start->object); + psize = atop(end - start); m = m_start; rw_wlock(&pvh_global_lock); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/i386/i386/pmap.c Tue May 21 20:38:19 2013 (r250884) @@ -3677,7 +3677,8 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_page_t m, mpte; vm_pindex_t diff, psize; - VM_OBJECT_ASSERT_WLOCKED(m_start->object); + VM_OBJECT_ASSERT_LOCKED(m_start->object); + psize = atop(end - start); mpte = NULL; m = m_start; Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/i386/xen/pmap.c Tue May 21 20:38:19 2013 (r250884) @@ -2871,7 +2871,8 @@ pmap_enter_object(pmap_t pmap, vm_offset multicall_entry_t *mclp = mcl; int error, count = 0; - VM_OBJECT_ASSERT_WLOCKED(m_start->object); + VM_OBJECT_ASSERT_LOCKED(m_start->object); + psize = atop(end - start); mpte = NULL; m = m_start; Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/ia64/ia64/pmap.c Tue May 21 20:38:19 2013 (r250884) @@ -1802,7 +1802,8 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_page_t m; vm_pindex_t diff, psize; - VM_OBJECT_ASSERT_WLOCKED(m_start->object); + VM_OBJECT_ASSERT_LOCKED(m_start->object); + psize = atop(end - start); m = m_start; rw_wlock(&pvh_global_lock); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/mips/mips/pmap.c Tue May 21 20:38:19 2013 (r250884) @@ -2399,7 +2399,8 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_page_t m, mpte; vm_pindex_t diff, psize; - VM_OBJECT_ASSERT_WLOCKED(m_start->object); + VM_OBJECT_ASSERT_LOCKED(m_start->object); + psize = atop(end - start); mpte = NULL; m = m_start; Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/powerpc/aim/mmu_oea.c Tue May 21 20:38:19 2013 (r250884) @@ -1217,6 +1217,8 @@ moea_enter_object(mmu_t mmu, pmap_t pm, vm_page_t m; vm_pindex_t diff, psize; + VM_OBJECT_ASSERT_LOCKED(m_start->object); + psize = atop(end - start); m = m_start; rw_wlock(&pvh_global_lock); Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/powerpc/aim/mmu_oea64.c Tue May 21 20:38:19 2013 (r250884) @@ -1360,6 +1360,8 @@ moea64_enter_object(mmu_t mmu, pmap_t pm vm_page_t m; vm_pindex_t diff, psize; + VM_OBJECT_ASSERT_LOCKED(m_start->object); + psize = atop(end - start); m = m_start; while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/powerpc/booke/pmap.c Tue May 21 20:38:19 2013 (r250884) @@ -1716,6 +1716,8 @@ mmu_booke_enter_object(mmu_t mmu, pmap_t vm_page_t m; vm_pindex_t diff, psize; + VM_OBJECT_ASSERT_LOCKED(m_start->object); + psize = atop(end - start); m = m_start; rw_wlock(&pvh_global_lock); Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/sparc64/sparc64/pmap.c Tue May 21 20:38:19 2013 (r250884) @@ -1632,6 +1632,8 @@ pmap_enter_object(pmap_t pm, vm_offset_t vm_page_t m; vm_pindex_t diff, psize; + VM_OBJECT_ASSERT_LOCKED(m_start->object); + psize = atop(end - start); m = m_start; rw_wlock(&tte_list_global_lock); Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/vm/vm_map.c Tue May 21 20:38:19 2013 (r250884) @@ -1806,18 +1806,27 @@ vm_map_pmap_enter(vm_map_t map, vm_offse if ((prot & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 || object == NULL) return; - VM_OBJECT_WLOCK(object); + VM_OBJECT_RLOCK(object); if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { - pmap_object_init_pt(map->pmap, addr, object, pindex, size); - goto unlock_return; + VM_OBJECT_RUNLOCK(object); + VM_OBJECT_WLOCK(object); + if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { + pmap_object_init_pt(map->pmap, addr, object, pindex, + size); + VM_OBJECT_WUNLOCK(object); + return; + } + VM_OBJECT_LOCK_DOWNGRADE(object); } psize = atop(size); if (psize > MAX_INIT_PT && (flags & MAP_PREFAULT_PARTIAL) != 0) psize = MAX_INIT_PT; if (psize + pindex > object->size) { - if (object->size < pindex) - goto unlock_return; + if (object->size < pindex) { + VM_OBJECT_RUNLOCK(object); + return; + } psize = object->size - pindex; } @@ -1856,8 +1865,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse if (p_start != NULL) pmap_enter_object(map->pmap, start, addr + ptoa(psize), p_start, prot); -unlock_return: - VM_OBJECT_WUNLOCK(object); + VM_OBJECT_RUNLOCK(object); } /* Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Tue May 21 19:59:37 2013 (r250883) +++ head/sys/vm/vm_object.h Tue May 21 20:38:19 2013 (r250884) @@ -223,6 +223,8 @@ extern struct vm_object kmem_object_stor rw_assert(&(object)->lock, RA_RLOCKED) #define VM_OBJECT_ASSERT_WLOCKED(object) \ rw_assert(&(object)->lock, RA_WLOCKED) +#define VM_OBJECT_LOCK_DOWNGRADE(object) \ + rw_downgrade(&(object)->lock) #define VM_OBJECT_RLOCK(object) \ rw_rlock(&(object)->lock) #define VM_OBJECT_RUNLOCK(object) \ Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue May 21 19:59:37 2013 (r250883) +++ head/sys/vm/vm_page.c Tue May 21 20:38:19 2013 (r250884) @@ -959,7 +959,7 @@ vm_page_find_least(vm_object_t object, v { vm_page_t m; - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_LOCKED(object); if ((m = TAILQ_FIRST(&object->memq)) != NULL && m->pindex < pindex) m = vm_radix_lookup_ge(&object->rtree, pindex); return (m); From owner-svn-src-all@FreeBSD.ORG Tue May 21 20:54:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 91B7CF7D; Tue, 21 May 2013 20:54:03 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 84D0EDAF; Tue, 21 May 2013 20:54:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LKs3QS054886; Tue, 21 May 2013 20:54:03 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LKs3Nv054885; Tue, 21 May 2013 20:54:03 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305212054.r4LKs3Nv054885@svn.freebsd.org> From: Attilio Rao Date: Tue, 21 May 2013 20:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250885 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 20:54:03 -0000 Author: attilio Date: Tue May 21 20:54:03 2013 New Revision: 250885 URL: http://svnweb.freebsd.org/changeset/base/250885 Log: vm_object locking is not needed there as pages are already wired. Sponsored by: EMC / Isilon storage division Submitted by: alc Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue May 21 20:38:19 2013 (r250884) +++ head/sys/kern/vfs_bio.c Tue May 21 20:54:03 2013 (r250885) @@ -4211,7 +4211,6 @@ vfs_bio_bzero_buf(struct buf *bp, int ba } else { BUF_CHECK_UNMAPPED(bp); n = PAGE_SIZE - (base & PAGE_MASK); - VM_OBJECT_WLOCK(bp->b_bufobj->bo_object); for (i = base / PAGE_SIZE; size > 0 && i < bp->b_npages; ++i) { m = bp->b_pages[i]; if (n > size) @@ -4221,7 +4220,6 @@ vfs_bio_bzero_buf(struct buf *bp, int ba size -= n; n = PAGE_SIZE; } - VM_OBJECT_WUNLOCK(bp->b_bufobj->bo_object); } } From owner-svn-src-all@FreeBSD.ORG Tue May 21 21:20:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 454A67CF; Tue, 21 May 2013 21:20:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 374D9F3E; Tue, 21 May 2013 21:20:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LLKBDI063573; Tue, 21 May 2013 21:20:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LLKAY8063568; Tue, 21 May 2013 21:20:10 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305212120.r4LLKAY8063568@svn.freebsd.org> From: Ed Schouten Date: Tue, 21 May 2013 21:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250887 - in head: include include/arpa sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 21:20:11 -0000 Author: ed Date: Tue May 21 21:20:10 2013 New Revision: 250887 URL: http://svnweb.freebsd.org/changeset/base/250887 Log: Allow certain headers to be included more easily. Spotted by: http://hacks.owlfolio.org/header-survey/ Modified: head/include/arpa/tftp.h head/include/fts.h head/include/ifaddrs.h head/sys/net/ppp_defs.h Modified: head/include/arpa/tftp.h ============================================================================== --- head/include/arpa/tftp.h Tue May 21 20:56:27 2013 (r250886) +++ head/include/arpa/tftp.h Tue May 21 21:20:10 2013 (r250887) @@ -33,6 +33,8 @@ #ifndef _ARPA_TFTP_H_ #define _ARPA_TFTP_H_ +#include + /* * Trivial File Transfer Protocol (IEN-133) */ Modified: head/include/fts.h ============================================================================== --- head/include/fts.h Tue May 21 20:56:27 2013 (r250886) +++ head/include/fts.h Tue May 21 21:20:10 2013 (r250887) @@ -33,15 +33,17 @@ #ifndef _FTS_H_ #define _FTS_H_ +#include + typedef struct { struct _ftsent *fts_cur; /* current node */ struct _ftsent *fts_child; /* linked list of children */ struct _ftsent **fts_array; /* sort array */ - dev_t fts_dev; /* starting device # */ + __dev_t fts_dev; /* starting device # */ char *fts_path; /* path for this descent */ int fts_rfd; /* fd for root */ - size_t fts_pathlen; /* sizeof(path) */ - size_t fts_nitems; /* elements in the sort array */ + __size_t fts_pathlen; /* sizeof(path) */ + __size_t fts_nitems; /* elements in the sort array */ int (*fts_compar) /* compare function */ (const struct _ftsent * const *, const struct _ftsent * const *); @@ -72,12 +74,12 @@ typedef struct _ftsent { char *fts_path; /* root path */ int fts_errno; /* errno for this node */ int fts_symfd; /* fd for symlink */ - size_t fts_pathlen; /* strlen(fts_path) */ - size_t fts_namelen; /* strlen(fts_name) */ + __size_t fts_pathlen; /* strlen(fts_path) */ + __size_t fts_namelen; /* strlen(fts_name) */ - ino_t fts_ino; /* inode */ - dev_t fts_dev; /* device */ - nlink_t fts_nlink; /* link count */ + __ino_t fts_ino; /* inode */ + __dev_t fts_dev; /* device */ + __nlink_t fts_nlink; /* link count */ #define FTS_ROOTPARENTLEVEL -1 #define FTS_ROOTLEVEL 0 Modified: head/include/ifaddrs.h ============================================================================== --- head/include/ifaddrs.h Tue May 21 20:56:27 2013 (r250886) +++ head/include/ifaddrs.h Tue May 21 21:20:10 2013 (r250887) @@ -31,7 +31,7 @@ struct ifaddrs { struct ifaddrs *ifa_next; char *ifa_name; - u_int ifa_flags; + unsigned int ifa_flags; struct sockaddr *ifa_addr; struct sockaddr *ifa_netmask; struct sockaddr *ifa_dstaddr; Modified: head/sys/net/ppp_defs.h ============================================================================== --- head/sys/net/ppp_defs.h Tue May 21 20:56:27 2013 (r250886) +++ head/sys/net/ppp_defs.h Tue May 21 21:20:10 2013 (r250887) @@ -31,6 +31,8 @@ #ifndef _PPP_DEFS_H_ #define _PPP_DEFS_H_ +#include + /* * The basic PPP frame. */ @@ -83,7 +85,7 @@ /* * Extended asyncmap - allows any character to be escaped. */ -typedef u_int32_t ext_accm[8]; +typedef __uint32_t ext_accm[8]; /* * What to do with network protocol (NP) packets. @@ -143,8 +145,8 @@ struct ppp_comp_stats { * the last NP packet was sent or received. */ struct ppp_idle { - time_t xmit_idle; /* time since last NP packet sent */ - time_t recv_idle; /* time since last NP packet received */ + __time_t xmit_idle; /* time since last NP packet sent */ + __time_t recv_idle; /* time since last NP packet received */ }; #ifndef __P From owner-svn-src-all@FreeBSD.ORG Tue May 21 21:31:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D51A2A22 for ; Tue, 21 May 2013 21:31:53 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-da0-x22d.google.com (mail-da0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) by mx1.freebsd.org (Postfix) with ESMTP id AF313FB1 for ; Tue, 21 May 2013 21:31:53 +0000 (UTC) Received: by mail-da0-f45.google.com with SMTP id w3so686966dad.32 for ; Tue, 21 May 2013 14:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=YX5gMyCPHrh76wxNRun6SMYZJwu/rG1JqLu4ChxE6nM=; b=VmaO31N4HJWniPpnU987HZ6zk1FTz8oVH+qb21PA3EtF7kWGSum+OMAQObluuBhc1I xAfZvyRxnot4KsNIYx2l00m5lFSdIj9iyrH/C7Krs7p2C6O4UZDMQBjphsEIGZ2HpSqM D2Et/8xejuJ21heQoqXm72Mos2fVlDFjlRxh0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=YX5gMyCPHrh76wxNRun6SMYZJwu/rG1JqLu4ChxE6nM=; b=BAprZPaOma8Sii4twUEvjJRPYc8LM6v2Wl/i5FaqT7gY1poJArMGzV7lZ9Jfavbrjg vCJcq91S1OMlqkswttAHXBvlxv2GeP32IwalTR7J4+QiKhVb9RFbSpDNSF+/RbiXZts5 SFR7Q+y6KfMWhF0a4z4z2qtJe/jPXEMhke9nduD0VGn69+4Z3O+Fds5qzKYIFYyFi82w 5oS1DQqeF/xoP4VJr5ZyoimVVIasL0hCzMv2XSwrZWi965siK21ktkAN9WlPdIQBkte5 zxmacvDekluxiW05KtU1bc7z2ZSpze2iG1zC5DJh4vnO2MUPb8KuDnRF3fFBd/My/Wr7 HiUw== X-Received: by 10.68.163.4 with SMTP id ye4mr4559665pbb.207.1369171913127; Tue, 21 May 2013 14:31:53 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.70.12.97 with HTTP; Tue, 21 May 2013 14:31:23 -0700 (PDT) In-Reply-To: <201305212120.r4LLKAY8063568@svn.freebsd.org> References: <201305212120.r4LLKAY8063568@svn.freebsd.org> From: Eitan Adler Date: Tue, 21 May 2013 23:31:23 +0200 X-Google-Sender-Auth: z1d71Af-rLAp0ySoZxbjdN_5XKM Message-ID: Subject: Re: svn commit: r250887 - in head: include include/arpa sys/net To: Ed Schouten Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlfzdLjn6oi2/hppGjOVq2nEZQQ4H5AnWrS6/LXZKCaQf1HOwf41uT7AHzlgCdFn9RjJsrX Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 21:31:53 -0000 On 21 May 2013 23:20, Ed Schouten wrote: > Author: ed > Date: Tue May 21 21:20:10 2013 > New Revision: 250887 > URL: http://svnweb.freebsd.org/changeset/base/250887 > > Log: > Allow certain headers to be included more easily. > > Spotted by: http://hacks.owlfolio.org/header-survey/ Thank you. Do the man pages need to be updated as well? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Tue May 21 21:39:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D7A58CA1; Tue, 21 May 2013 21:39:19 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AFF3A1000; Tue, 21 May 2013 21:39:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LLdJTY070096; Tue, 21 May 2013 21:39:19 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LLdJG1070088; Tue, 21 May 2013 21:39:19 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305212139.r4LLdJG1070088@svn.freebsd.org> From: Ed Schouten Date: Tue, 21 May 2013 21:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250888 - in head/lib/libc: gen net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 21:39:19 -0000 Author: ed Date: Tue May 21 21:39:18 2013 New Revision: 250888 URL: http://svnweb.freebsd.org/changeset/base/250888 Log: Update manpages for r250887. Remove the lists of unneeded header files. Requested by: eadler Modified: head/lib/libc/gen/fts.3 head/lib/libc/net/getifaddrs.3 head/lib/libc/net/getifmaddrs.3 Modified: head/lib/libc/gen/fts.3 ============================================================================== --- head/lib/libc/gen/fts.3 Tue May 21 21:20:10 2013 (r250887) +++ head/lib/libc/gen/fts.3 Tue May 21 21:39:18 2013 (r250888) @@ -28,7 +28,7 @@ .\" @(#)fts.3 8.5 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd March 18, 2012 +.Dd May 21, 2013 .Dt FTS 3 .Os .Sh NAME @@ -37,8 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h -.In sys/stat.h .In fts.h .Ft FTS * .Fn fts_open "char * const *path_argv" "int options" "int (*compar)(const FTSENT * const *, const FTSENT * const *)" Modified: head/lib/libc/net/getifaddrs.3 ============================================================================== --- head/lib/libc/net/getifaddrs.3 Tue May 21 21:20:10 2013 (r250887) +++ head/lib/libc/net/getifaddrs.3 Tue May 21 21:39:18 2013 (r250888) @@ -24,15 +24,13 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 1995 +.Dd May 21, 2013 .Dt GETIFADDRS 3 .Os .Sh NAME .Nm getifaddrs .Nd get interface addresses .Sh SYNOPSIS -.In sys/types.h -.In sys/socket.h .In ifaddrs.h .Ft int .Fn getifaddrs "struct ifaddrs **ifap" Modified: head/lib/libc/net/getifmaddrs.3 ============================================================================== --- head/lib/libc/net/getifmaddrs.3 Tue May 21 21:20:10 2013 (r250887) +++ head/lib/libc/net/getifmaddrs.3 Tue May 21 21:39:18 2013 (r250888) @@ -20,15 +20,13 @@ .\" .\" $FreeBSD$ .\" -.Dd November 14, 2003 +.Dd May 21, 2013 .Dt GETIFMADDRS 3 .Os .Sh NAME .Nm getifmaddrs .Nd get multicast group memberships .Sh SYNOPSIS -.In sys/types.h -.In sys/socket.h .In ifaddrs.h .Ft int .Fn getifmaddrs "struct ifmaddrs **ifmap" From owner-svn-src-all@FreeBSD.ORG Tue May 21 21:39:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9E858E11; Tue, 21 May 2013 21:39:49 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-vb0-x22e.google.com (mail-vb0-x22e.google.com [IPv6:2607:f8b0:400c:c02::22e]) by mx1.freebsd.org (Postfix) with ESMTP id 2C76929; Tue, 21 May 2013 21:39:49 +0000 (UTC) Received: by mail-vb0-f46.google.com with SMTP id 11so803137vbe.5 for ; Tue, 21 May 2013 14:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=CfhZT8m+OkbKAUZ3gmsjVCzfBIOsU3urnSoLkD53CtE=; b=L2pV+1m4RJh3IIkALoxjiHj5ouFon5AM6vX0lnKCAxsXNrdtqV2DcOFqLrpqC71l44 2pLu1EwfW3DKGFqRin9tqOP2Kl5Anoec30DaZ3hdonRgAUkf14O/lWWXJHFrT6+WsSZS 4IlT7k0RYRKKUIr7IPkB12aKaxkCpQd/3cpdvo7f1etPpNLS/b8h58SqrZ++qfa68gS9 QvO18uybFTt7PJaxIJQJOtdYfhsGqd/p39SMFWo9lP2tasr94cJSoiNS1c3GNDnuypk/ EjKZnbeZYiRAxSKvTcWA1EA3zfNbjNl6WBaceo+baozdrpY+ggWw1VIGWdJnjTXnDL00 chNQ== MIME-Version: 1.0 X-Received: by 10.220.143.71 with SMTP id t7mr1710493vcu.64.1369172388707; Tue, 21 May 2013 14:39:48 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.220.72.7 with HTTP; Tue, 21 May 2013 14:39:48 -0700 (PDT) In-Reply-To: References: <201305212120.r4LLKAY8063568@svn.freebsd.org> Date: Tue, 21 May 2013 23:39:48 +0200 X-Google-Sender-Auth: A5Xx44FsMp7N8gVYXWxpf57wytw Message-ID: Subject: Re: svn commit: r250887 - in head: include include/arpa sys/net From: Ed Schouten To: Eitan Adler Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 21:39:49 -0000 2013/5/21 Eitan Adler : > Do the man pages need to be updated as well? Sure. I've updated the manpages for the functions listed in these header files. -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Tue May 21 21:50:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 86CF413F; Tue, 21 May 2013 21:50:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 78459C1; Tue, 21 May 2013 21:50:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LLoCWD075059; Tue, 21 May 2013 21:50:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LLoCXR075057; Tue, 21 May 2013 21:50:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305212150.r4LLoCXR075057@svn.freebsd.org> From: Ed Schouten Date: Tue, 21 May 2013 21:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250889 - in head: include/protocols sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 21:50:12 -0000 Author: ed Date: Tue May 21 21:50:11 2013 New Revision: 250889 URL: http://svnweb.freebsd.org/changeset/base/250889 Log: Add proper prerequisites for even two more headers. Spotted by: http://hacks.owlfolio.org/header-survey/ Modified: head/include/protocols/rwhod.h head/sys/sys/timex.h Modified: head/include/protocols/rwhod.h ============================================================================== --- head/include/protocols/rwhod.h Tue May 21 21:39:18 2013 (r250888) +++ head/include/protocols/rwhod.h Tue May 21 21:50:11 2013 (r250889) @@ -34,13 +34,15 @@ #ifndef _PROTOCOLS_RWHOD_H_ #define _PROTOCOLS_RWHOD_H_ +#include + /* * rwho protocol packet format. */ struct outmp { char out_line[8]; /* tty name */ char out_name[8]; /* user id */ - int32_t out_time; /* time on */ + __int32_t out_time; /* time on */ }; struct whod { Modified: head/sys/sys/timex.h ============================================================================== --- head/sys/sys/timex.h Tue May 21 21:39:18 2013 (r250888) +++ head/sys/sys/timex.h Tue May 21 21:50:11 2013 (r250889) @@ -97,6 +97,9 @@ #define _SYS_TIMEX_H_ 1 #define NTP_API 4 /* NTP API version */ +#ifdef __FreeBSD__ +#include +#endif /* __FreeBSD__ */ #ifndef MSDOS /* Microsoft specific */ #include #endif /* MSDOS */ From owner-svn-src-all@FreeBSD.ORG Tue May 21 21:58:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6422534E; Tue, 21 May 2013 21:58:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5602A112; Tue, 21 May 2013 21:58:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4LLw1p5076596; Tue, 21 May 2013 21:58:01 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4LLw1Ed076595; Tue, 21 May 2013 21:58:01 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201305212158.r4LLw1Ed076595@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 21 May 2013 21:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250890 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 21:58:02 -0000 Author: mjg Date: Tue May 21 21:58:00 2013 New Revision: 250890 URL: http://svnweb.freebsd.org/changeset/base/250890 Log: passing fd over unix socket: fix a corner case where caller wants to pass no descriptors. Previously the kernel would leak memory and try to free a potentially arbitrary pointer. Reviewed by: pjd Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue May 21 21:50:11 2013 (r250889) +++ head/sys/kern/uipc_usrreq.c Tue May 21 21:58:00 2013 (r250890) @@ -1686,6 +1686,8 @@ unp_freerights(struct filedescent **fdep struct file *fp; int i; + if (fdcount == 0) + return; for (i = 0; i < fdcount; i++) { fp = fdep[i]->fde_file; filecaps_free(&fdep[i]->fde_caps); @@ -1768,7 +1770,8 @@ unp_externalize(struct mbuf *control, st unp_externalize_fp(fde->fde_file); } FILEDESC_XUNLOCK(fdesc); - free(fdep[0], M_FILECAPS); + if (newfds != 0) + free(fdep[0], M_FILECAPS); } else { /* We can just copy anything else across. */ if (error || controlp == NULL) @@ -1925,6 +1928,10 @@ unp_internalize(struct mbuf **controlp, error = E2BIG; goto out; } + if (oldfds == 0) { + FILEDESC_SUNLOCK(fdesc); + break; + } fdp = data; fdep = (struct filedescent **) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); From owner-svn-src-all@FreeBSD.ORG Tue May 21 22:00:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 64685500; Tue, 21 May 2013 22:00:06 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id E91D1132; Tue, 21 May 2013 22:00:05 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C085935930D; Wed, 22 May 2013 00:00:03 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id AD00228493; Wed, 22 May 2013 00:00:03 +0200 (CEST) Date: Wed, 22 May 2013 00:00:03 +0200 From: Jilles Tjoelker To: Ed Schouten Subject: Re: svn commit: r250883 - in head: include include/xlocale lib/libc/locale sys/sys tools/regression/lib/libc/locale Message-ID: <20130521220003.GB58299@stack.nl> References: <201305211959.r4LJxbLx034714@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305211959.r4LJxbLx034714@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 22:00:06 -0000 On Tue, May 21, 2013 at 07:59:37PM +0000, Ed Schouten wrote: > Author: ed > Date: Tue May 21 19:59:37 2013 > New Revision: 250883 > URL: http://svnweb.freebsd.org/changeset/base/250883 > Log: > Add . Looks like an interesting approach to make applications LC_CTYPE locale aware. > The header, part of C11, adds a small number of utility > functions for 16/32-bit "universal" characters, which may or may not be > UTF-16/32. As our wchar_t is already ISO 10646, simply add light-weight > wrappers around wcrtomb() and mbrtowc(). Our wchar_t is only ISO 10646 for UTF-8 and possibly US-ASCII and ISO8859-1 (subset) locales. However, we support various other charsets such as ISO8859-2 and even some non-Unicode multibyte encodings (although I have no idea how complete the support for the latter is). Using the new functions with such locales is likely to produce garbage. Some sort of iconv is necessary to avoid this mojibake and we do not have it in base. I encountered the same issue when implementing $'\uXXXX' and $'\UXXXXXXXX' for /bin/sh. I decided to implement full support only for UTF-8 locales and restrict the rest to US-ASCII, converting all other (valid) characters to question marks. I did not see a reason to treat Western Europe preferentially by adding a simple ISO8859-1 mapping. For these functions, it is probably best to fail (such as with [EILSEQ]) when a character is encountered for which the conversion is not implemented. > While there, also add (non-yet-standard) _l functions, similar to the > ones we already have for the other locale-dependent functions. This makes sense. > [snip] > Added: head/lib/libc/locale/c16rtomb.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libc/locale/c16rtomb.c Tue May 21 19:59:37 2013 (r250883) > [snip] > +typedef struct { > + char16_t lead_surrogate; > + mbstate_t c32_mbstate; > +} _Char16State; > + > +size_t > +c16rtomb_l(char * __restrict s, char16_t c16, mbstate_t * __restrict ps, > + locale_t locale) > +{ > + _Char16State *cs; > + char32_t c32; > + > + FIX_LOCALE(locale); > + if (ps == NULL) > + ps = &locale->c16rtomb; > + cs = (_Char16State *)ps; > + > + /* If s is a null pointer, the value of parameter c16 is ignored. */ > + if (s == NULL) { > + c32 = 0; > + } else if (cs->lead_surrogate >= 0xd800 && > + cs->lead_surrogate <= 0xdbff) { > + /* We should see a trail surrogate now. */ > + if (c16 < 0xdc00 || c16 > 0xdfff) { > + errno = EILSEQ; > + return ((size_t)-1); > + } > + c32 = 0x10000 + ((cs->lead_surrogate & 0x3ff) << 10 | > + (c16 & 0x3ff)); > + } else if (c16 >= 0xd800 && c16 <= 0xdbff) { > + /* Store lead surrogate for next invocation. */ > + cs->lead_surrogate = c16; > + return (0); > + } else { > + /* Regular character. */ > + c32 = c16; > + } > + cs->lead_surrogate = 0; > + > + return (c32rtomb_l(s, c32, &cs->c32_mbstate, locale)); > +} You can probably avoid the potential buffer overflow by copying the trailing 126 bytes of the _Char16State into a new mbstate_t object, and back after calling c32rtomb_l(). Likewise for mbrtoc16_l(). (The committed code allows using 120 bytes which should still be more than enough.) There may also be a strict-aliasing violation if ps == NULL, as the mbstate_t objects in __xlocale_C_locale and __xlocale_global_locale have a declared type. If ps != NULL, it is OK as long as the object is a separate compilation unit. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Tue May 21 22:20:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A4127B2E; Tue, 21 May 2013 22:20:23 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx1.freebsd.org (Postfix) with ESMTP id 45547208; Tue, 21 May 2013 22:20:22 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id hz10so838334vcb.38 for ; Tue, 21 May 2013 15:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=4rKzMyLqBOD8keB28MG2zlqkihn1PIseTB4ram+cxcw=; b=JOH0Ld2RvqGGbd1Fe5V0DM7mtAH/5SYxEZPmLfPKJr1BzWLfSGrar5/M07fjUKt3WD PCHzwmlIvy88x1vOo/xM1DiUvFPY9bd72VMumnOE1xxa9y99z8iZu4cF98gfyCQjNTWI AnKG0P4QbchhdwZJoHJUiz/e5yiidFpkmnR5jC4yN9qzXEmC6Yr0+v85YnRVxfihyGA6 TRDZmbK5KY5yAM5Cwhd5P6vZeQcA2giHjByFf5kNsK9/qJKYO+03wTjitg3NQRB0uDc2 0lKYPoDxkm8UIfvIiUx/dDMboJE9KZe6m47sYFzpaZcOkEvLYe9sa20dhLDVT7ls472c 5Mbw== MIME-Version: 1.0 X-Received: by 10.52.165.76 with SMTP id yw12mr1481255vdb.93.1369174815946; Tue, 21 May 2013 15:20:15 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.220.72.7 with HTTP; Tue, 21 May 2013 15:20:15 -0700 (PDT) In-Reply-To: <20130521220003.GB58299@stack.nl> References: <201305211959.r4LJxbLx034714@svn.freebsd.org> <20130521220003.GB58299@stack.nl> Date: Wed, 22 May 2013 00:20:15 +0200 X-Google-Sender-Auth: 7hcD-BUSdfBT5PfqUnuO_1WyE2U Message-ID: Subject: Re: svn commit: r250883 - in head: include include/xlocale lib/libc/locale sys/sys tools/regression/lib/libc/locale From: Ed Schouten To: Jilles Tjoelker Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 22:20:23 -0000 2013/5/22 Jilles Tjoelker : > Our wchar_t is only ISO 10646 for UTF-8 and possibly US-ASCII and > ISO8859-1 (subset) locales. Oh, the horror! I thought on FreeBSD, we used the LC_CTYPE files to do a mapping to ISO 10646. Unfortunately, it seems to be the case that these files are only used to do mappings to uppercase/lowercase/runetype. Bummer. I'll see what I can do to fix this. I'll likely implement something like you suggested, that we return EILSEQ if the locale is not ASCII, ISO8859-1 or UTF-8. -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Wed May 22 00:17:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9FCA4A2B; Wed, 22 May 2013 00:17:50 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91E0CA14; Wed, 22 May 2013 00:17:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M0HotH027096; Wed, 22 May 2013 00:17:50 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M0HoFJ027094; Wed, 22 May 2013 00:17:50 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201305220017.r4M0HoFJ027094@svn.freebsd.org> From: Kirk McKusick Date: Wed, 22 May 2013 00:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250891 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 00:17:50 -0000 Author: mckusick Date: Wed May 22 00:17:50 2013 New Revision: 250891 URL: http://svnweb.freebsd.org/changeset/base/250891 Log: Properly spell sentinel (not sintenel or sentinal). No functional changes. Spotted by: kib MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue May 21 21:58:00 2013 (r250890) +++ head/sys/ufs/ffs/ffs_softdep.c Wed May 22 00:17:50 2013 (r250891) @@ -656,8 +656,8 @@ FEATURE(softupdates, "FFS soft-updates s #define D_SBDEP 24 #define D_JTRUNC 25 #define D_JFSYNC 26 -#define D_SENTINAL 27 -#define D_LAST D_SENTINAL +#define D_SENTINEL 27 +#define D_LAST D_SENTINEL unsigned long dep_current[D_LAST + 1]; unsigned long dep_total[D_LAST + 1]; @@ -1718,7 +1718,7 @@ process_worklist_item(mp, target, flags) int target; int flags; { - struct worklist sintenel; + struct worklist sentinel; struct worklist *wk; struct ufsmount *ump; int matchcnt; @@ -1736,14 +1736,14 @@ process_worklist_item(mp, target, flags) PHOLD(curproc); /* Don't let the stack go away. */ ump = VFSTOUFS(mp); matchcnt = 0; - sintenel.wk_mp = NULL; - sintenel.wk_type = D_SENTINAL; - LIST_INSERT_HEAD(&ump->softdep_workitem_pending, &sintenel, wk_list); - for (wk = LIST_NEXT(&sintenel, wk_list); wk != NULL; - wk = LIST_NEXT(&sintenel, wk_list)) { - if (wk->wk_type == D_SENTINAL) { - LIST_REMOVE(&sintenel, wk_list); - LIST_INSERT_AFTER(wk, &sintenel, wk_list); + sentinel.wk_mp = NULL; + sentinel.wk_type = D_SENTINEL; + LIST_INSERT_HEAD(&ump->softdep_workitem_pending, &sentinel, wk_list); + for (wk = LIST_NEXT(&sentinel, wk_list); wk != NULL; + wk = LIST_NEXT(&sentinel, wk_list)) { + if (wk->wk_type == D_SENTINEL) { + LIST_REMOVE(&sentinel, wk_list); + LIST_INSERT_AFTER(wk, &sentinel, wk_list); continue; } if (wk->wk_state & INPROGRESS) @@ -1800,11 +1800,11 @@ process_worklist_item(mp, target, flags) wake_worklist(wk); add_to_worklist(wk, WK_HEAD); } - LIST_REMOVE(&sintenel, wk_list); + LIST_REMOVE(&sentinel, wk_list); /* Sentinal could've become the tail from remove_from_worklist. */ - if (ump->softdep_worklist_tail == &sintenel) + if (ump->softdep_worklist_tail == &sentinel) ump->softdep_worklist_tail = - (struct worklist *)sintenel.wk_list.le_prev; + (struct worklist *)sentinel.wk_list.le_prev; PRELE(curproc); return (matchcnt); } @@ -12127,7 +12127,7 @@ restart: /* * Sync all cylinder groups that were dirty at the time this function is - * called. Newly dirtied cgs will be inserted before the sintenel. This + * called. Newly dirtied cgs will be inserted before the sentinel. This * is used to flush freedep activity that may be holding up writes to a * indirect block. */ @@ -12137,25 +12137,25 @@ sync_cgs(mp, waitfor) int waitfor; { struct bmsafemap *bmsafemap; - struct bmsafemap *sintenel; + struct bmsafemap *sentinel; struct ufsmount *ump; struct buf *bp; int error; - sintenel = malloc(sizeof(*sintenel), M_BMSAFEMAP, M_ZERO | M_WAITOK); - sintenel->sm_cg = -1; + sentinel = malloc(sizeof(*sentinel), M_BMSAFEMAP, M_ZERO | M_WAITOK); + sentinel->sm_cg = -1; ump = VFSTOUFS(mp); error = 0; ACQUIRE_LOCK(&lk); - LIST_INSERT_HEAD(&ump->softdep_dirtycg, sintenel, sm_next); - for (bmsafemap = LIST_NEXT(sintenel, sm_next); bmsafemap != NULL; - bmsafemap = LIST_NEXT(sintenel, sm_next)) { - /* Skip sintenels and cgs with no work to release. */ + LIST_INSERT_HEAD(&ump->softdep_dirtycg, sentinel, sm_next); + for (bmsafemap = LIST_NEXT(sentinel, sm_next); bmsafemap != NULL; + bmsafemap = LIST_NEXT(sentinel, sm_next)) { + /* Skip sentinels and cgs with no work to release. */ if (bmsafemap->sm_cg == -1 || (LIST_EMPTY(&bmsafemap->sm_freehd) && LIST_EMPTY(&bmsafemap->sm_freewr))) { - LIST_REMOVE(sintenel, sm_next); - LIST_INSERT_AFTER(bmsafemap, sintenel, sm_next); + LIST_REMOVE(sentinel, sm_next); + LIST_INSERT_AFTER(bmsafemap, sentinel, sm_next); continue; } /* @@ -12165,8 +12165,8 @@ sync_cgs(mp, waitfor) bp = getdirtybuf(bmsafemap->sm_buf, &lk, waitfor); if (bp == NULL && waitfor == MNT_WAIT) continue; - LIST_REMOVE(sintenel, sm_next); - LIST_INSERT_AFTER(bmsafemap, sintenel, sm_next); + LIST_REMOVE(sentinel, sm_next); + LIST_INSERT_AFTER(bmsafemap, sentinel, sm_next); if (bp == NULL) continue; FREE_LOCK(&lk); @@ -12178,9 +12178,9 @@ sync_cgs(mp, waitfor) if (error) break; } - LIST_REMOVE(sintenel, sm_next); + LIST_REMOVE(sentinel, sm_next); FREE_LOCK(&lk); - free(sintenel, M_BMSAFEMAP); + free(sentinel, M_BMSAFEMAP); return (error); } From owner-svn-src-all@FreeBSD.ORG Wed May 22 00:30:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 23BC9E18; Wed, 22 May 2013 00:30:35 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15F65AA7; Wed, 22 May 2013 00:30:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M0UYYp031247; Wed, 22 May 2013 00:30:34 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M0UYef031246; Wed, 22 May 2013 00:30:34 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201305220030.r4M0UYef031246@svn.freebsd.org> From: Kirk McKusick Date: Wed, 22 May 2013 00:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250892 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 00:30:35 -0000 Author: mckusick Date: Wed May 22 00:30:34 2013 New Revision: 250892 URL: http://svnweb.freebsd.org/changeset/base/250892 Log: Remove a bogus check for a NULL buffer pointer. Add a KASSERT that it is not NULL. Found by: Coverity Scan, CID 1009114 Reviewed by: kib MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed May 22 00:17:50 2013 (r250891) +++ head/sys/ufs/ffs/ffs_softdep.c Wed May 22 00:30:34 2013 (r250892) @@ -4984,13 +4984,14 @@ bmsafemap_lookup(mp, bp, cg, newbmsafema struct fs *fs; mtx_assert(&lk, MA_OWNED); - if (bp) - LIST_FOREACH(wk, &bp->b_dep, wk_list) - if (wk->wk_type == D_BMSAFEMAP) { - if (newbmsafemap) - WORKITEM_FREE(newbmsafemap,D_BMSAFEMAP); - return (WK_BMSAFEMAP(wk)); - } + KASSERT(bp != NULL, ("bmsafemap_lookup: missing buffer")); + LIST_FOREACH(wk, &bp->b_dep, wk_list) { + if (wk->wk_type == D_BMSAFEMAP) { + if (newbmsafemap) + WORKITEM_FREE(newbmsafemap, D_BMSAFEMAP); + return (WK_BMSAFEMAP(wk)); + } + } fs = VFSTOUFS(mp)->um_fs; bmsafemaphd = BMSAFEMAP_HASH(fs, cg); if (bmsafemap_find(bmsafemaphd, mp, cg, &bmsafemap) == 1) { From owner-svn-src-all@FreeBSD.ORG Wed May 22 00:31:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 245CBF9F; Wed, 22 May 2013 00:31:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EFEE7AB4; Wed, 22 May 2013 00:31:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M0VXcp032880; Wed, 22 May 2013 00:31:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M0VXlR032879; Wed, 22 May 2013 00:31:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305220031.r4M0VXlR032879@svn.freebsd.org> From: Xin LI Date: Wed, 22 May 2013 00:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250893 - stable/9/sys/ofed/include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 00:31:34 -0000 Author: delphij Date: Wed May 22 00:31:33 2013 New Revision: 250893 URL: http://svnweb.freebsd.org/changeset/base/250893 Log: MFC r250374: According to the documentation, on Linux, cancel_delayed_work() does not do drain (flush_workqueue() in Linux terms) but instead returns true if the work was removed before it is run, or false otherwise. Simulate this by removing the taskqueue_drain() and return the value derived from taskqueue_cancel()'s return value. This would solve a witness warning caused by calling taskqueue_drain() with a non-sleepable lock held, like: taskqueue_drain with the following non-sleepable locks held: exclusive rw lle (lle) r = 0 (0xfffffe001450b410) locked @ /usr/src/sys/netinet/in.c:1484 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffff848d4f7690 kdb_backtrace() at kdb_backtrace+0x39/frame 0xffffff848d4f7740 witness_warn() at witness_warn+0x4a8/frame 0xffffff848d4f7800 taskqueue_drain() at taskqueue_drain+0x3a/frame 0xffffff848d4f7840 set_timeout() at set_timeout+0x4a/frame 0xffffff848d4f7860 netevent_callback() at netevent_callback+0x16/frame 0xffffff848d4f7870 arpintr() at arpintr+0x9b5/frame 0xffffff848d4f7930 This do not affect kernel without OFED compiled in. Reported by: Garrett Cooper Modified: stable/9/sys/ofed/include/linux/workqueue.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/include/linux/workqueue.h ============================================================================== --- stable/9/sys/ofed/include/linux/workqueue.h Wed May 22 00:30:34 2013 (r250892) +++ stable/9/sys/ofed/include/linux/workqueue.h Wed May 22 00:31:33 2013 (r250893) @@ -184,9 +184,9 @@ cancel_delayed_work(struct delayed_work { callout_stop(&work->timer); - if (work->work.taskqueue && - taskqueue_cancel(work->work.taskqueue, &work->work.work_task, NULL)) - taskqueue_drain(work->work.taskqueue, &work->work.work_task); + if (work->work.taskqueue) + return (taskqueue_cancel(work->work.taskqueue, + &work->work.work_task, NULL) == 0); return 0; } From owner-svn-src-all@FreeBSD.ORG Wed May 22 00:40:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B86DC4BB; Wed, 22 May 2013 00:40:27 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AAFE0B1D; Wed, 22 May 2013 00:40:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M0eRG1036082; Wed, 22 May 2013 00:40:27 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M0eRUT036079; Wed, 22 May 2013 00:40:27 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201305220040.r4M0eRUT036079@svn.freebsd.org> From: Kirk McKusick Date: Wed, 22 May 2013 00:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250894 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 00:40:27 -0000 Author: mckusick Date: Wed May 22 00:40:26 2013 New Revision: 250894 URL: http://svnweb.freebsd.org/changeset/base/250894 Log: Null a pointer after it is freed so that when it is returned the return value is NULL. Based on the returned flags, the return value should never be inspected in the case where NULL is returned, but it is good coding practice not to return a pointer to freed memory. Found by: Coverity Scan, CID 1006096 Reviewed by: kib MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed May 22 00:31:33 2013 (r250893) +++ head/sys/ufs/ffs/ffs_softdep.c Wed May 22 00:40:26 2013 (r250894) @@ -8150,6 +8150,7 @@ setup_newdir(dap, newinum, dinum, newdir (inodedep->id_state & ALLCOMPLETE) == ALLCOMPLETE) { dap->da_state &= ~MKDIR_PARENT; WORKITEM_FREE(mkdir2, D_MKDIR); + mkdir2 = NULL; } else { LIST_INSERT_HEAD(&mkdirlisthd, mkdir2, md_mkdirs); WORKLIST_INSERT(&inodedep->id_bufwait, &mkdir2->md_list); From owner-svn-src-all@FreeBSD.ORG Wed May 22 00:48:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CF48D68D; Wed, 22 May 2013 00:48:24 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C0DCAB55; Wed, 22 May 2013 00:48:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M0mO8o037571; Wed, 22 May 2013 00:48:24 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M0mOxQ037570; Wed, 22 May 2013 00:48:24 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201305220048.r4M0mOxQ037570@svn.freebsd.org> From: Kirk McKusick Date: Wed, 22 May 2013 00:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250895 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 00:48:24 -0000 Author: mckusick Date: Wed May 22 00:48:24 2013 New Revision: 250895 URL: http://svnweb.freebsd.org/changeset/base/250895 Log: Add missing 28th element to softdep types name array. Found by: Coverity Scan, CID 1007621 Reviewed by: kib MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed May 22 00:40:26 2013 (r250894) +++ head/sys/ufs/ffs/ffs_softdep.c Wed May 22 00:48:24 2013 (r250895) @@ -711,6 +711,8 @@ SOFTDEP_TYPE(SBDEP, sbdep, "Superblock w SOFTDEP_TYPE(JTRUNC, jtrunc, "Journal inode truncation"); SOFTDEP_TYPE(JFSYNC, jfsync, "Journal fsync complete"); +static MALLOC_DEFINE(M_SENTINEL, "sentinal", "Worklist sentinal"); + static MALLOC_DEFINE(M_SAVEDINO, "savedino", "Saved inodes"); static MALLOC_DEFINE(M_JBLOCKS, "jblocks", "Journal block locations"); @@ -745,7 +747,8 @@ static struct malloc_type *memtype[] = { M_JSEGDEP, M_SBDEP, M_JTRUNC, - M_JFSYNC + M_JFSYNC, + M_SENTINEL }; static LIST_HEAD(mkdirlist, mkdir) mkdirlisthd; From owner-svn-src-all@FreeBSD.ORG Wed May 22 00:57:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7F833995; Wed, 22 May 2013 00:57:23 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 71638BE4; Wed, 22 May 2013 00:57:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M0vN04040881; Wed, 22 May 2013 00:57:23 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M0vNMg040880; Wed, 22 May 2013 00:57:23 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201305220057.r4M0vNMg040880@svn.freebsd.org> From: Kirk McKusick Date: Wed, 22 May 2013 00:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250897 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 00:57:23 -0000 Author: mckusick Date: Wed May 22 00:57:22 2013 New Revision: 250897 URL: http://svnweb.freebsd.org/changeset/base/250897 Log: Add missing buffer releases (brelse) after bread calls that return an error. One could argue that returning a buffer even when it is not valid is incorrect, but bread has always returned a buffer valid or not. Reviewed by: kib MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed May 22 00:54:57 2013 (r250896) +++ head/sys/ufs/ffs/ffs_softdep.c Wed May 22 00:57:22 2013 (r250897) @@ -9362,13 +9362,16 @@ clear_unlinked_inodedep(inodedep) if (idp && (idp->id_state & UNLINKNEXT)) pino = idp->id_ino; FREE_LOCK(&lk); - if (pino == 0) + if (pino == 0) { bp = getblk(ump->um_devvp, btodb(fs->fs_sblockloc), (int)fs->fs_sbsize, 0, 0, 0); - else + } else { error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, pino)), (int)fs->fs_bsize, NOCRED, &bp); + if (error) + brelse(bp); + } ACQUIRE_LOCK(&lk); if (error) break; @@ -13183,6 +13186,7 @@ softdep_inode_append(ip, cred, wkhd) error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), (int)fs->fs_bsize, cred, &bp); if (error) { + bqrelse(bp); softdep_freework(wkhd); return; } From owner-svn-src-all@FreeBSD.ORG Wed May 22 01:03:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5807AD69; Wed, 22 May 2013 01:03:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4A798C27; Wed, 22 May 2013 01:03:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M13g4U043993; Wed, 22 May 2013 01:03:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M13gfl043992; Wed, 22 May 2013 01:03:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305220103.r4M13gfl043992@svn.freebsd.org> From: Adrian Chadd Date: Wed, 22 May 2013 01:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250899 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 01:03:42 -0000 Author: adrian Date: Wed May 22 01:03:41 2013 New Revision: 250899 URL: http://svnweb.freebsd.org/changeset/base/250899 Log: Implement beacon event debugging in athalq. Modified: head/tools/tools/ath/athalq/main.c Modified: head/tools/tools/ath/athalq/main.c ============================================================================== --- head/tools/tools/ath/athalq/main.c Wed May 22 00:58:03 2013 (r250898) +++ head/tools/tools/ath/athalq/main.c Wed May 22 01:03:41 2013 (r250899) @@ -75,6 +75,36 @@ ath_alq_print_intr_status(struct if_ath_ be32toh(is.intr_status)); } +static void +ath_alq_print_beacon_miss(struct if_ath_alq_payload *a) +{ + + printf("[%u.%06u] [%llu] BMISS\n", + (unsigned int) be32toh(a->hdr.tstamp_sec), + (unsigned int) be32toh(a->hdr.tstamp_usec), + (unsigned long long) be64toh(a->hdr.threadid)); +} + +static void +ath_alq_print_beacon_stuck(struct if_ath_alq_payload *a) +{ + + printf("[%u.%06u] [%llu] BSTUCK\n", + (unsigned int) be32toh(a->hdr.tstamp_sec), + (unsigned int) be32toh(a->hdr.tstamp_usec), + (unsigned long long) be64toh(a->hdr.threadid)); +} + +static void +ath_alq_print_beacon_resume(struct if_ath_alq_payload *a) +{ + + printf("[%u.%06u] [%llu] BRESUME\n", + (unsigned int) be32toh(a->hdr.tstamp_sec), + (unsigned int) be32toh(a->hdr.tstamp_usec), + (unsigned long long) be64toh(a->hdr.threadid)); +} + int main(int argc, const char *argv[]) { @@ -147,6 +177,15 @@ main(int argc, const char *argv[]) case ATH_ALQ_INTR_STATUS: ath_alq_print_intr_status(a); break; + case ATH_ALQ_MISSED_BEACON: + ath_alq_print_beacon_miss(a); + break; + case ATH_ALQ_STUCK_BEACON: + ath_alq_print_beacon_stuck(a); + break; + case ATH_ALQ_RESUME_BEACON: + ath_alq_print_beacon_resume(a); + break; default: if (be32toh(hdr.sc_hal_magic) == AR5210_MAGIC) ar5210_alq_payload(a); From owner-svn-src-all@FreeBSD.ORG Wed May 22 02:15:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A154C8C4; Wed, 22 May 2013 02:15:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93684E40; Wed, 22 May 2013 02:15:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M2F8tZ069335; Wed, 22 May 2013 02:15:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M2F8sI069334; Wed, 22 May 2013 02:15:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305220215.r4M2F8sI069334@svn.freebsd.org> From: Alexander Motin Date: Wed, 22 May 2013 02:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250900 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 02:15:08 -0000 Author: mav Date: Wed May 22 02:15:07 2013 New Revision: 250900 URL: http://svnweb.freebsd.org/changeset/base/250900 Log: Fix NULL-dereference kernel panic in case of mps_attach() failure. MFC after: 1 week Modified: head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Wed May 22 01:03:41 2013 (r250899) +++ head/sys/dev/mps/mps_user.c Wed May 22 02:15:07 2013 (r250900) @@ -208,8 +208,8 @@ mps_detach_user(struct mps_softc *sc) { /* XXX: do a purge of pending requests? */ - destroy_dev(sc->mps_cdev); - + if (sc->mps_cdev != NULL) + destroy_dev(sc->mps_cdev); } static int From owner-svn-src-all@FreeBSD.ORG Wed May 22 03:43:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 73F6CE09 for ; Wed, 22 May 2013 03:43:56 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx1.freebsd.org (Postfix) with ESMTP id 028F95E6 for ; Wed, 22 May 2013 03:43:55 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id r11so1536855lbv.24 for ; Tue, 21 May 2013 20:43:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=FNeXZjLhopoYR2I6by0FvzCthBdW5X9OvXqdCvPpLnY=; b=HHz/HJ56vuUUqhi8dWeQdjquboPcQKH0QxIA/aiH2YC82bfjQt0Bugg2O9PZ9dvbIE mUNefkM2pOwtv7F0uCNnai+Au/qKPNKrsGpribj5S48CIwqqGR8F7kv3TprTGvHO7DjS yiBU7XxW3eoU7pWKcc4TygLJoVK3rqqXg4djN5xH0/IXheDa+DUq54TvHOzHfMi2/Mif Z4WkIkX0H11VvozquZyKNCX5m/XJUj7C3zqeo3Ah5gZDq79/HSFOOaepNyqsJSj3bwMI 0CEsD+05Zd93CEzu9imZKwiE0FikejtUSYgVTTP15TUiuvSkOY+OW77t4k9LAw+584AE HCaw== X-Received: by 10.112.218.39 with SMTP id pd7mr3058490lbc.13.1369194229288; Tue, 21 May 2013 20:43:49 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id c5sm2160655lbe.1.2013.05.21.20.43.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 May 2013 20:43:48 -0700 (PDT) Message-ID: <519C3EE7.1000800@freebsd.org> Date: Wed, 22 May 2013 07:43:35 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Ed Schouten Subject: Re: svn commit: r250883 - in head: include include/xlocale lib/libc/locale sys/sys tools/regression/lib/libc/locale References: <201305211959.r4LJxbLx034714@svn.freebsd.org> <20130521220003.GB58299@stack.nl> In-Reply-To: OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkiK89XNozWxWGNRf0TbR4nKHx8vXKrd8/Gu4Jh8sgaSm+GEB9uPKYS1a+hBG5zNrWqm6dS Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 03:43:56 -0000 On 22.05.2013 2:20, Ed Schouten wrote: > 2013/5/22 Jilles Tjoelker : >> Our wchar_t is only ISO 10646 for UTF-8 and possibly US-ASCII and >> ISO8859-1 (subset) locales. > > Oh, the horror! I thought on FreeBSD, we used the LC_CTYPE files to do > a mapping to ISO 10646. Unfortunately, it seems to be the case that > these files are only used to do mappings to > uppercase/lowercase/runetype. Bummer. > > I'll see what I can do to fix this. I'll likely implement something > like you suggested, that we return EILSEQ if the locale is not ASCII, > ISO8859-1 or UTF-8. Yes, non UTF-8 and its subsets locales are not encoded in ISO 10646 internally but have their own internal encoding. Returning EILSEQ will broke them all at once, so I see no point to add new functions such way, because GNU configure will sense them, and then they doesn't work. Proper way is ether to not add them or use lib/libc/iconv for them (adding a lot of missing locales into lib/libiconv_modules). -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Wed May 22 05:07:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D95A0791; Wed, 22 May 2013 05:07:55 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB1188AB; Wed, 22 May 2013 05:07:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M57tEO029265; Wed, 22 May 2013 05:07:55 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M57tPI029264; Wed, 22 May 2013 05:07:55 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201305220507.r4M57tPI029264@svn.freebsd.org> From: Kirk McKusick Date: Wed, 22 May 2013 05:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250901 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 05:07:55 -0000 Author: mckusick Date: Wed May 22 05:07:55 2013 New Revision: 250901 URL: http://svnweb.freebsd.org/changeset/base/250901 Log: Properly spell sentinel (missed in 250891) No functional changes. Spotted by: Navdeep Parhar and Alexey Dokuchaev MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed May 22 02:15:07 2013 (r250900) +++ head/sys/ufs/ffs/ffs_softdep.c Wed May 22 05:07:55 2013 (r250901) @@ -711,7 +711,7 @@ SOFTDEP_TYPE(SBDEP, sbdep, "Superblock w SOFTDEP_TYPE(JTRUNC, jtrunc, "Journal inode truncation"); SOFTDEP_TYPE(JFSYNC, jfsync, "Journal fsync complete"); -static MALLOC_DEFINE(M_SENTINEL, "sentinal", "Worklist sentinal"); +static MALLOC_DEFINE(M_SENTINEL, "sentinel", "Worklist sentinel"); static MALLOC_DEFINE(M_SAVEDINO, "savedino", "Saved inodes"); static MALLOC_DEFINE(M_JBLOCKS, "jblocks", "Journal block locations"); From owner-svn-src-all@FreeBSD.ORG Wed May 22 05:16:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8EC39A6F; Wed, 22 May 2013 05:16:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6F5748FB; Wed, 22 May 2013 05:16:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M5G8DX032639; Wed, 22 May 2013 05:16:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M5G8JJ032638; Wed, 22 May 2013 05:16:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305220516.r4M5G8JJ032638@svn.freebsd.org> From: Xin LI Date: Wed, 22 May 2013 05:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250902 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 05:16:08 -0000 Author: delphij Date: Wed May 22 05:16:07 2013 New Revision: 250902 URL: http://svnweb.freebsd.org/changeset/base/250902 Log: Regenerate with manual fixup for WITH_LDNS_UTILS inheriting WITHOUT_BIND_UTILS. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed May 22 05:07:55 2013 (r250901) +++ head/share/man/man5/src.conf.5 Wed May 22 05:16:07 2013 (r250902) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd February 15, 2013 +.Dd May 21, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -223,9 +223,9 @@ toolchain is enabled. .It Va WITHOUT_BLUETOOTH .\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru Set to not build Bluetooth related kernel modules, programs and libraries. -.It Va WITH_BMAKE -.\" from FreeBSD: head/tools/build/options/WITH_BMAKE 241279 2012-10-06 19:19:21Z marcel -Build and install the portable BSD make (bmake) as +.It Va WITHOUT_BMAKE +.\" from FreeBSD: head/tools/build/options/WITHOUT_BMAKE 250839 2013-05-21 00:41:49Z delphij +Set to not build and install the portable BSD make (bmake) as .Xr make 1 instead of the traditional FreeBSD make. This build option is temporary. @@ -302,6 +302,12 @@ When set, it also enforces the following .It .Va WITHOUT_CLANG_IS_CC .El +.It Va WITH_CLANG +.\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru +Set to build the Clang C/C++ compiler. +.Pp +It is a default setting on +amd64/amd64, arm/arm, arm/armv6, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITH_CLANG_EXTRAS .\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim Set to build additional clang and llvm tools, such as bugpoint. @@ -328,7 +334,7 @@ and .Pa /usr/bin/cpp . .Pp It is a default setting on -arm/arm, arm/armeb, arm/armv6, arm/armv6eb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +arm/armeb, arm/armv6eb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_CLANG_IS_CC .\" from FreeBSD: head/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb Set to install the Clang C/C++ compiler as @@ -338,7 +344,7 @@ and .Pa /usr/bin/cpp . .Pp It is a default setting on -amd64/amd64, i386/i386 and pc98/i386. +amd64/amd64, arm/arm, arm/armv6, i386/i386 and pc98/i386. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build @@ -433,6 +439,13 @@ This includes the device tree compiler ( .Pp It is a default setting on amd64/amd64, i386/i386, ia64/ia64, pc98/i386 and sparc64/sparc64. +.It Va WITH_FDT +.\" from FreeBSD: head/tools/build/options/WITH_FDT 221730 2011-05-10 11:14:40Z ru +Set to build Flattened Device Tree support as part of the base system. +This includes the device tree compiler (dtc) and libfdt support library. +.Pp +It is a default setting on +arm/arm, arm/armeb, arm/armv6, arm/armv6eb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_FLOPPY .\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru Set to not build or install programs @@ -523,13 +536,6 @@ Set to not build HTML docs. .It Va WITH_ICONV .\" from FreeBSD: head/tools/build/options/WITH_ICONV 219020 2011-02-25 00:10:26Z gabor Set to build iconv as part of libc. -.It Va WITH_IDEA -.\" from FreeBSD: head/tools/build/options/WITH_IDEA 156932 2006-03-21 07:50:50Z ru -Set to build the IDEA encryption code. -This code is patented in the USA and many European countries. -It is -.Em "YOUR RESPONSIBILITY" -to determine if you can legally use IDEA. .It Va WITHOUT_INET .\" from FreeBSD: head/tools/build/options/WITHOUT_INET 221266 2011-04-30 17:58:28Z bz Set to not build programs and libraries related to IPv4 networking. @@ -595,8 +601,8 @@ When set, it also enforces the following .\" from FreeBSD: head/tools/build/options/WITHOUT_IPX_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without IPX support. .It Va WITHOUT_JAIL -.\" from FreeBSD: head/tools/build/options/WITHOUT_JAIL 183242 2008-09-21 22:02:26Z sam -Set to not build tools for the support of jails; e.g. +.\" from FreeBSD: head/tools/build/options/WITHOUT_JAIL 249966 2013-04-27 04:09:09Z eadler +Set to not build tools for the support of jails; e.g., .Xr jail 8 . .It Va WITHOUT_KDUMP .\" from FreeBSD: head/tools/build/options/WITHOUT_KDUMP 240690 2012-09-19 11:38:37Z zeising @@ -671,14 +677,14 @@ Setting this variable will enable the LD .Xr dig 1 and .Xr host 1 . -When set, the following options are also in effect: +-When set, the following options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_BIND_UTILS .El .It Va WITHOUT_LEGACY_CONSOLE -.\" from FreeBSD: head/tools/build/options/WITHOUT_LEGACY_CONSOLE 183242 2008-09-21 22:02:26Z sam -Set to not build programs that support a legacy PC console; e.g. +.\" from FreeBSD: head/tools/build/options/WITHOUT_LEGACY_CONSOLE 249966 2013-04-27 04:09:09Z eadler +Set to not build programs that support a legacy PC console; e.g., .Xr kbdcontrol 8 and .Xr vidcontrol 8 . From owner-svn-src-all@FreeBSD.ORG Wed May 22 05:21:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 336F5C49; Wed, 22 May 2013 05:21:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2543092C; Wed, 22 May 2013 05:21:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M5LKHJ035151; Wed, 22 May 2013 05:21:20 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M5LJei035150; Wed, 22 May 2013 05:21:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305220521.r4M5LJei035150@svn.freebsd.org> From: Xin LI Date: Wed, 22 May 2013 05:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250903 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 05:21:20 -0000 Author: delphij Date: Wed May 22 05:21:19 2013 New Revision: 250903 URL: http://svnweb.freebsd.org/changeset/base/250903 Log: Fix a copy-and-paste typo. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed May 22 05:16:07 2013 (r250902) +++ head/share/man/man5/src.conf.5 Wed May 22 05:21:19 2013 (r250903) @@ -677,7 +677,7 @@ Setting this variable will enable the LD .Xr dig 1 and .Xr host 1 . --When set, the following options are also in effect: +When set, the following options are also in effect: .Pp .Bl -inset -compact .It Va WITHOUT_BIND_UTILS From owner-svn-src-all@FreeBSD.ORG Wed May 22 07:52:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8CE47B1A; Wed, 22 May 2013 07:52:42 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7BD57FC5; Wed, 22 May 2013 07:52:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M7qgNZ086789; Wed, 22 May 2013 07:52:42 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M7qgsj086786; Wed, 22 May 2013 07:52:42 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201305220752.r4M7qgsj086786@svn.freebsd.org> From: Greg Lehey Date: Wed, 22 May 2013 07:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250905 - stable/9/usr.bin/locale X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 07:52:42 -0000 Author: grog Date: Wed May 22 07:52:41 2013 New Revision: 250905 URL: http://svnweb.freebsd.org/changeset/base/250905 Log: MFH revisions 242743 to 243202: Make parameters to -c and -k options optional. If no parameters are supplied, print information for all keywords. Improve output of -c option, in particular in conjunction with -k option. Complete man page. Add comment on standards conformity. Modified: stable/9/usr.bin/locale/locale.1 stable/9/usr.bin/locale/locale.c Directory Properties: stable/9/usr.bin/locale/ (props changed) Modified: stable/9/usr.bin/locale/locale.1 ============================================================================== --- stable/9/usr.bin/locale/locale.1 Wed May 22 05:43:14 2013 (r250904) +++ stable/9/usr.bin/locale/locale.1 Wed May 22 07:52:41 2013 (r250905) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2005 +.Dd November 18, 2012 .Dt LOCALE 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Op Ar prefix .Nm .Op Fl ck -.Ar keyword ... +.Op Ar keyword ... .Sh DESCRIPTION The .Nm @@ -70,12 +70,16 @@ will respect the .Ev PATH_LOCALE environment variable, and use it instead of the system's default locale directory. -.It Fl m -Print names of all available charmaps. -.It Fl k -Print the names and values of all selected keywords. .It Fl c Print the category name for all selected keywords. +If no keywords are selected, print the category name for all defined +keywords. +.It Fl k +Print the names and values of all selected keywords. +If no keywords are selected, print the names and values of all defined +keywords. +.It Fl m +Print names of all available charmaps. .El .Sh IMPLEMENTATION NOTES The special @@ -89,6 +93,17 @@ a prefix string can be defined to limit .Ex -std .Sh SEE ALSO .Xr setlocale 3 +.Sh STANDARDS +The +.Nm +utility conforms to +.St -p1003.1-2004 . +The +.Ev LC_CTYPE , +.Ev LC_MESSAGES +and +.Ev NLSPATH +environment variables are not interpreted. .Sh BUGS Since .Fx Modified: stable/9/usr.bin/locale/locale.c ============================================================================== --- stable/9/usr.bin/locale/locale.c Wed May 22 05:43:14 2013 (r250904) +++ stable/9/usr.bin/locale/locale.c Wed May 22 07:52:41 2013 (r250905) @@ -31,7 +31,7 @@ * nl_langinfo(3) extensions) * * XXX: correctly handle reserved 'charmap' keyword and '-m' option (require - * localedef(1) implementation). Currently it's handled via + * localedef(1) implementation). Currently it's handled via * nl_langinfo(CODESET). */ @@ -79,32 +79,32 @@ struct _lcinfo { { "LC_MONETARY", LC_MONETARY }, { "LC_MESSAGES", LC_MESSAGES } }; -#define NLCINFO (sizeof(lcinfo)/sizeof(lcinfo[0])) +#define NLCINFO (sizeof(lcinfo)/sizeof(lcinfo[0])) /* ids for values not referenced by nl_langinfo() */ #define KW_ZERO 10000 #define KW_GROUPING (KW_ZERO+1) -#define KW_INT_CURR_SYMBOL (KW_ZERO+2) -#define KW_CURRENCY_SYMBOL (KW_ZERO+3) -#define KW_MON_DECIMAL_POINT (KW_ZERO+4) -#define KW_MON_THOUSANDS_SEP (KW_ZERO+5) -#define KW_MON_GROUPING (KW_ZERO+6) -#define KW_POSITIVE_SIGN (KW_ZERO+7) -#define KW_NEGATIVE_SIGN (KW_ZERO+8) -#define KW_INT_FRAC_DIGITS (KW_ZERO+9) -#define KW_FRAC_DIGITS (KW_ZERO+10) -#define KW_P_CS_PRECEDES (KW_ZERO+11) -#define KW_P_SEP_BY_SPACE (KW_ZERO+12) -#define KW_N_CS_PRECEDES (KW_ZERO+13) -#define KW_N_SEP_BY_SPACE (KW_ZERO+14) -#define KW_P_SIGN_POSN (KW_ZERO+15) -#define KW_N_SIGN_POSN (KW_ZERO+16) -#define KW_INT_P_CS_PRECEDES (KW_ZERO+17) -#define KW_INT_P_SEP_BY_SPACE (KW_ZERO+18) -#define KW_INT_N_CS_PRECEDES (KW_ZERO+19) -#define KW_INT_N_SEP_BY_SPACE (KW_ZERO+20) -#define KW_INT_P_SIGN_POSN (KW_ZERO+21) -#define KW_INT_N_SIGN_POSN (KW_ZERO+22) +#define KW_INT_CURR_SYMBOL (KW_ZERO+2) +#define KW_CURRENCY_SYMBOL (KW_ZERO+3) +#define KW_MON_DECIMAL_POINT (KW_ZERO+4) +#define KW_MON_THOUSANDS_SEP (KW_ZERO+5) +#define KW_MON_GROUPING (KW_ZERO+6) +#define KW_POSITIVE_SIGN (KW_ZERO+7) +#define KW_NEGATIVE_SIGN (KW_ZERO+8) +#define KW_INT_FRAC_DIGITS (KW_ZERO+9) +#define KW_FRAC_DIGITS (KW_ZERO+10) +#define KW_P_CS_PRECEDES (KW_ZERO+11) +#define KW_P_SEP_BY_SPACE (KW_ZERO+12) +#define KW_N_CS_PRECEDES (KW_ZERO+13) +#define KW_N_SEP_BY_SPACE (KW_ZERO+14) +#define KW_P_SIGN_POSN (KW_ZERO+15) +#define KW_N_SIGN_POSN (KW_ZERO+16) +#define KW_INT_P_CS_PRECEDES (KW_ZERO+17) +#define KW_INT_P_SEP_BY_SPACE (KW_ZERO+18) +#define KW_INT_N_CS_PRECEDES (KW_ZERO+19) +#define KW_INT_N_SEP_BY_SPACE (KW_ZERO+20) +#define KW_INT_P_SIGN_POSN (KW_ZERO+21) +#define KW_INT_N_SIGN_POSN (KW_ZERO+22) struct _kwinfo { const char *name; @@ -218,7 +218,7 @@ struct _kwinfo { "(POSIX legacy)" } /* compat */ }; -#define NKWINFO (sizeof(kwinfo)/sizeof(kwinfo[0])) +#define NKWINFO (sizeof(kwinfo)/sizeof(kwinfo[0])) const char *boguslocales[] = { "UTF-8" }; #define NBOGUS (sizeof(boguslocales)/sizeof(boguslocales[0])) @@ -253,12 +253,10 @@ main(int argc, char *argv[]) /* validate arguments */ if (all_locales && all_charmaps) usage(); - if ((all_locales || all_charmaps) && argc > 0) + if ((all_locales || all_charmaps) && argc > 0) usage(); if ((all_locales || all_charmaps) && (prt_categories || prt_keywords)) usage(); - if ((prt_categories || prt_keywords) && argc <= 0) - usage(); /* process '-a' */ if (all_locales) { @@ -281,13 +279,19 @@ main(int argc, char *argv[]) exit(0); } - /* process '-c' and/or '-k' */ + /* process '-c', '-k', or command line arguments. */ if (prt_categories || prt_keywords || argc > 0) { - setlocale(LC_ALL, ""); - while (argc > 0) { - showdetails(*argv); - argv++; - argc--; + if (argc > 0) { + setlocale(LC_ALL, ""); + while (argc > 0) { + showdetails(*argv); + argv++; + argc--; + } + } else { + uint i; + for (i = 0; i < sizeof (kwinfo) / sizeof (struct _kwinfo); i++) + showdetails ((char *)kwinfo [i].name); } exit(0); } @@ -302,8 +306,8 @@ void usage(void) { printf("Usage: locale [ -a | -m ]\n" - " locale -k list [prefix]\n" - " locale [ -ck ] keyword ...\n"); + " locale -k list [prefix]\n" + " locale [ -ck ] [keyword ...]\n"); exit(1); } @@ -423,10 +427,10 @@ init_locales_list(void) } closedir(dirp); - /* make sure that 'POSIX' and 'C' locales are present in the list. + /* make sure that 'POSIX' and 'C' locales are present in the list. * POSIX 1003.1-2001 requires presence of 'POSIX' name only here, but - * we also list 'C' for constistency - */ + * we also list 'C' for constistency + */ if (sl_find(locales, "POSIX") == NULL) sl_add(locales, "POSIX"); @@ -612,7 +616,10 @@ showdetails(char *kw) } if (prt_categories) { - printf("%s\n", lookup_localecat(cat)); + if (prt_keywords) + printf("%-20s ", lookup_localecat(cat)); + else + printf("%-20s\t%s\n", kw, lookup_localecat(cat)); } if (prt_keywords) { @@ -657,7 +664,7 @@ showkeywordslist(char *substring) { size_t i; -#define FMT "%-20s %-12s %-7s %-20s\n" +#define FMT "%-20s %-12s %-7s %-20s\n" if (substring == NULL) printf("List of available keywords\n\n"); From owner-svn-src-all@FreeBSD.ORG Wed May 22 08:44:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0D7D4AEE; Wed, 22 May 2013 08:44:22 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D6E6D2F1; Wed, 22 May 2013 08:44:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4M8iL0h005149; Wed, 22 May 2013 08:44:21 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4M8iLWJ005148; Wed, 22 May 2013 08:44:21 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305220844.r4M8iLWJ005148@svn.freebsd.org> From: Scott Long Date: Wed, 22 May 2013 08:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250906 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 08:44:22 -0000 Author: scottl Date: Wed May 22 08:44:21 2013 New Revision: 250906 URL: http://svnweb.freebsd.org/changeset/base/250906 Log: MFC r250327 Add a sysctl vfs.read_min to complement the exiting vfs.read_max. It defaults to 1, meaning that it's off. When read-ahead is enabled on a file, the vfs cluster code deliberately breaks a read into 2 I/O transactions; one to satisfy the actual read, and one to perform read-ahead. This makes sense in low-latency circumstances, but often produces unbalanced i/o transactions that penalize disks. By setting vfs.read_min, we can tell the algorithm to fetch a larger transaction that what we asked for, achieving the same effect as the read-ahead but without the doubled, unbalanced transaction and the slightly lower latency. This significantly helps our workloads with video streaming. Submitted by: emax Reviewed by: kib Obtained from: Netflix Modified: stable/9/sys/kern/vfs_cluster.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_cluster.c ============================================================================== --- stable/9/sys/kern/vfs_cluster.c Wed May 22 07:52:41 2013 (r250905) +++ stable/9/sys/kern/vfs_cluster.c Wed May 22 08:44:21 2013 (r250906) @@ -75,6 +75,10 @@ static int read_max = 64; SYSCTL_INT(_vfs, OID_AUTO, read_max, CTLFLAG_RW, &read_max, 0, "Cluster read-ahead max block count"); +static int read_min = 1; +SYSCTL_INT(_vfs, OID_AUTO, read_min, CTLFLAG_RW, &read_min, 0, + "Cluster read min block count"); + /* Page expended to mark partially backed buffers */ extern vm_page_t bogus_page; @@ -169,6 +173,7 @@ cluster_read(vp, filesize, lblkno, size, } else { off_t firstread = bp->b_offset; int nblks; + long minread; KASSERT(bp->b_offset != NOOFFSET, ("cluster_read: no buffer offset")); @@ -176,6 +181,13 @@ cluster_read(vp, filesize, lblkno, size, ncontig = 0; /* + * Adjust totread if needed + */ + minread = read_min * size; + if (minread > totread) + totread = minread; + + /* * Compute the total number of blocks that we should read * synchronously. */ From owner-svn-src-all@FreeBSD.ORG Wed May 22 09:21:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 77A6352B; Wed, 22 May 2013 09:21:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 63DF66C2; Wed, 22 May 2013 09:21:56 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r4M9LmtT082143; Wed, 22 May 2013 13:21:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r4M9LmBj082142; Wed, 22 May 2013 13:21:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 22 May 2013 13:21:48 +0400 From: Gleb Smirnoff To: Mateusz Guzik , pjd@FreeBSD.org Subject: Re: svn commit: r250890 - head/sys/kern Message-ID: <20130522092148.GM67170@FreeBSD.org> References: <201305212158.r4LLw1Ed076595@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="gj572EiMnwbLXET9" Content-Disposition: inline In-Reply-To: <201305212158.r4LLw1Ed076595@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 09:21:57 -0000 --gj572EiMnwbLXET9 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline On Tue, May 21, 2013 at 09:58:01PM +0000, Mateusz Guzik wrote: M> Author: mjg M> Date: Tue May 21 21:58:00 2013 M> New Revision: 250890 M> URL: http://svnweb.freebsd.org/changeset/base/250890 M> M> Log: M> passing fd over unix socket: fix a corner case where caller M> wants to pass no descriptors. M> M> Previously the kernel would leak memory and try to free a potentially M> arbitrary pointer. M> M> Reviewed by: pjd Is it possible to make code more strict: assert that fdcount > 0, and do not perform any processing if number of fds is 0? Prototype patch against r250890 attached. -- Totus tuus, Glebius. --gj572EiMnwbLXET9 Content-Type: text/x-diff; charset=koi8-r Content-Disposition: attachment; filename="uipc_usrreq.c.diff" Index: uipc_usrreq.c =================================================================== --- uipc_usrreq.c (revision 250906) +++ uipc_usrreq.c (working copy) @@ -1686,8 +1686,8 @@ unp_freerights(struct filedescent **fdep, int fdco struct file *fp; int i; - if (fdcount == 0) - return; + KASSERT(fdcount > 0, ("%s: fdcount %d", __func__, fdcount)); + for (i = 0; i < fdcount; i++) { fp = fdep[i]->fde_file; filecaps_free(&fdep[i]->fde_caps); @@ -1725,6 +1725,8 @@ unp_externalize(struct mbuf *control, struct mbuf if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_RIGHTS) { newfds = datalen / sizeof(*fdep); + if (newfds == 0) + goto next; fdep = data; /* If we're not outputting the descriptors free them. */ @@ -1770,8 +1772,7 @@ unp_externalize(struct mbuf *control, struct mbuf unp_externalize_fp(fde->fde_file); } FILEDESC_XUNLOCK(fdesc); - if (newfds != 0) - free(fdep[0], M_FILECAPS); + free(fdep[0], M_FILECAPS); } else { /* We can just copy anything else across. */ if (error || controlp == NULL) @@ -1894,6 +1895,8 @@ unp_internalize(struct mbuf **controlp, struct thr case SCM_RIGHTS: oldfds = datalen / sizeof (int); + if (oldfds == 0) + break; /* * Check that all the FDs passed in refer to legal * files. If not, reject the entire operation. @@ -1928,10 +1931,6 @@ unp_internalize(struct mbuf **controlp, struct thr error = E2BIG; goto out; } - if (oldfds == 0) { - FILEDESC_SUNLOCK(fdesc); - break; - } fdp = data; fdep = (struct filedescent **) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); --gj572EiMnwbLXET9-- From owner-svn-src-all@FreeBSD.ORG Wed May 22 10:37:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34FA9948; Wed, 22 May 2013 10:37:29 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1675AAEC; Wed, 22 May 2013 10:37:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MAbSKs044945; Wed, 22 May 2013 10:37:28 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MAbSIq044944; Wed, 22 May 2013 10:37:28 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305221037.r4MAbSIq044944@svn.freebsd.org> From: Scott Long Date: Wed, 22 May 2013 10:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250907 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 10:37:29 -0000 Author: scottl Date: Wed May 22 10:37:28 2013 New Revision: 250907 URL: http://svnweb.freebsd.org/changeset/base/250907 Log: MFC r248830, r250027, r250409 Submitted by: gibbs, andre, kib Obtained from: Netflix Modified: stable/9/sys/kern/uipc_syscalls.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_syscalls.c ============================================================================== --- stable/9/sys/kern/uipc_syscalls.c Wed May 22 08:44:21 2013 (r250906) +++ stable/9/sys/kern/uipc_syscalls.c Wed May 22 10:37:28 2013 (r250907) @@ -1835,9 +1835,11 @@ kern_sendfile(struct thread *td, struct struct mbuf *m = NULL; struct sf_buf *sf; struct vm_page *pg; + struct vattr va; off_t off, xfsize, fsbytes = 0, sbytes = 0, rem = 0; int error, hdrlen = 0, mnw = 0; int vfslocked; + int bsize; struct sendfile_sync *sfs = NULL; /* @@ -1852,6 +1854,18 @@ kern_sendfile(struct thread *td, struct vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); if (vp->v_type == VREG) { + bsize = vp->v_mount->mnt_stat.f_iosize; + if (uap->nbytes == 0) { + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) { + VOP_UNLOCK(vp, 0); + VFS_UNLOCK_GIANT(vfslocked); + obj = NULL; + goto out; + } + rem = va.va_size; + } else + rem = uap->nbytes; obj = vp->v_object; if (obj != NULL) { /* @@ -1869,7 +1883,8 @@ kern_sendfile(struct thread *td, struct obj = NULL; } } - } + } else + bsize = 0; /* silence gcc */ VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); if (obj == NULL) { @@ -1962,11 +1977,20 @@ kern_sendfile(struct thread *td, struct * The outer loop checks the state and available space of the socket * and takes care of the overall progress. */ - for (off = uap->offset, rem = uap->nbytes; ; ) { - struct mbuf *mtail = NULL; - int loopbytes = 0; - int space = 0; - int done = 0; + for (off = uap->offset; ; ) { + struct mbuf *mtail; + int loopbytes; + int space; + int done; + + if ((uap->nbytes != 0 && uap->nbytes == fsbytes) || + (uap->nbytes == 0 && va.va_size == fsbytes)) + break; + + mtail = NULL; + loopbytes = 0; + space = 0; + done = 0; /* * Check the socket state for ongoing connection, @@ -2034,6 +2058,20 @@ retry_space: */ space -= hdrlen; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + error = vn_lock(vp, LK_SHARED); + if (error != 0) { + VFS_UNLOCK_GIANT(vfslocked); + goto done; + } + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0 || off >= va.va_size) { + VOP_UNLOCK(vp, 0); + VFS_UNLOCK_GIANT(vfslocked); + goto done; + } + VFS_UNLOCK_GIANT(vfslocked); + /* * Loop and construct maximum sized mbuf chain to be bulk * dumped into socket buffer. @@ -2043,25 +2081,20 @@ retry_space: vm_offset_t pgoff; struct mbuf *m0; - VM_OBJECT_LOCK(obj); /* * Calculate the amount to transfer. * Not to exceed a page, the EOF, * or the passed in nbytes. */ pgoff = (vm_offset_t)(off & PAGE_MASK); - xfsize = omin(PAGE_SIZE - pgoff, - obj->un_pager.vnp.vnp_size - uap->offset - - fsbytes - loopbytes); if (uap->nbytes) rem = (uap->nbytes - fsbytes - loopbytes); else - rem = obj->un_pager.vnp.vnp_size - + rem = va.va_size - uap->offset - fsbytes - loopbytes; - xfsize = omin(rem, xfsize); + xfsize = omin(PAGE_SIZE - pgoff, rem); xfsize = omin(space - loopbytes, xfsize); if (xfsize <= 0) { - VM_OBJECT_UNLOCK(obj); done = 1; /* all data sent */ break; } @@ -2071,6 +2104,7 @@ retry_space: * if not found or wait and loop if busy. */ pindex = OFF_TO_IDX(off); + VM_OBJECT_LOCK(obj); pg = vm_page_grab(obj, pindex, VM_ALLOC_NOBUSY | VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_RETRY); @@ -2088,7 +2122,6 @@ retry_space: else if (uap->flags & SF_NODISKIO) error = EBUSY; else { - int bsize; ssize_t resid; /* @@ -2100,25 +2133,16 @@ retry_space: /* * Get the page from backing store. - */ - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - error = vn_lock(vp, LK_SHARED); - if (error != 0) - goto after_read; - bsize = vp->v_mount->mnt_stat.f_iosize; - - /* * XXXMAC: Because we don't have fp->f_cred * here, we pass in NOCRED. This is probably * wrong, but is consistent with our original * implementation. */ + vfslocked = VFS_LOCK_GIANT(vp->v_mount); error = vn_rdwr(UIO_READ, vp, NULL, MAXBSIZE, trunc_page(off), UIO_NOCOPY, IO_NODELOCKED | IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT), td->td_ucred, NOCRED, &resid, td); - VOP_UNLOCK(vp, 0); - after_read: VFS_UNLOCK_GIANT(vfslocked); VM_OBJECT_LOCK(obj); vm_page_io_finish(pg); @@ -2174,7 +2198,7 @@ retry_space: m0 = m_get((mnw ? M_NOWAIT : M_WAITOK), MT_DATA); if (m0 == NULL) { error = (mnw ? EAGAIN : ENOBUFS); - sf_buf_mext((void *)sf_buf_kva(sf), sf); + sf_buf_mext(NULL, sf); break; } MEXTADD(m0, sf_buf_kva(sf), PAGE_SIZE, sf_buf_mext, @@ -2202,6 +2226,8 @@ retry_space: } } + VOP_UNLOCK(vp, 0); + /* Add the buffer chain to the socket buffer. */ if (m != NULL) { int mlen, err; From owner-svn-src-all@FreeBSD.ORG Wed May 22 11:12:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EE5333B8; Wed, 22 May 2013 11:12:38 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [IPv6:2a00:1450:400c:c03::22e]) by mx1.freebsd.org (Postfix) with ESMTP id E0587E60; Wed, 22 May 2013 11:12:37 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id x53so1101531wes.19 for ; Wed, 22 May 2013 04:12:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=UIoPTVAGeJ617ITYxw54m9FvWnBAqEgnEc9P6JVymio=; b=SqzGTcgVYpASfmZcJajwkP7tgPrZpxSER/gcrgFHnG20wRh21hAAMdw3yD5JocqE7K 78Bj+OyDAxDvnVOA+04EzZznLjQjNBvjynLeKS1KoWhUUwXJiOB3kEWwsa6MwX6OjfPj DvHhigWLxz+r47t0wW2VJh/HTuphoWFQgeBJg/s6BafSLmFJPjeBHX8nkz89NvM0BVyR O9CyaEN+pTl2gU0dFKT9a1p5Asdi2C/JUa+hCU5OY2Tn3pPihv01PW3wN1uUqWz3Iuwu U2mgbJUqxGpmtdLl1oD7MQCEOZRPWh+e8eLi/L6y6yTw/eT9MU/fJdwRrLd+PWC8hYar 7bJQ== X-Received: by 10.180.105.161 with SMTP id gn1mr13816085wib.5.1369221156966; Wed, 22 May 2013 04:12:36 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id fz8sm28167989wib.2.2013.05.22.04.12.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 22 May 2013 04:12:35 -0700 (PDT) Date: Wed, 22 May 2013 13:12:32 +0200 From: Mateusz Guzik To: Gleb Smirnoff Subject: Re: svn commit: r250890 - head/sys/kern Message-ID: <20130522111232.GB11792@dft-labs.eu> References: <201305212158.r4LLw1Ed076595@svn.freebsd.org> <20130522092148.GM67170@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20130522092148.GM67170@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, pjd@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 11:12:39 -0000 On Wed, May 22, 2013 at 01:21:48PM +0400, Gleb Smirnoff wrote: > On Tue, May 21, 2013 at 09:58:01PM +0000, Mateusz Guzik wrote: > M> Author: mjg > M> Date: Tue May 21 21:58:00 2013 > M> New Revision: 250890 > M> URL: http://svnweb.freebsd.org/changeset/base/250890 > M> > M> Log: > M> passing fd over unix socket: fix a corner case where caller > M> wants to pass no descriptors. > M> > M> Previously the kernel would leak memory and try to free a potentially > M> arbitrary pointer. > M> > M> Reviewed by: pjd > > Is it possible to make code more strict: assert that fdcount > 0, and > do not perform any processing if number of fds is 0? > stable/9 returns with a non-zero length message in such cases and your patch changes it. Apparently with your patch we would get behaviour present in Linux. Whether it matters in practice I don't know. That being said I have no strong opinion either way. If you want, please go ahead and change this. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Wed May 22 15:11:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 493201CA; Wed, 22 May 2013 15:11:01 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C62FB5A; Wed, 22 May 2013 15:11:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MFB12B041213; Wed, 22 May 2013 15:11:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MFB1gg041211; Wed, 22 May 2013 15:11:01 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305221511.r4MFB1gg041211@svn.freebsd.org> From: Attilio Rao Date: Wed, 22 May 2013 15:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250909 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 15:11:01 -0000 Author: attilio Date: Wed May 22 15:11:00 2013 New Revision: 250909 URL: http://svnweb.freebsd.org/changeset/base/250909 Log: Acquire read lock on the src object for vm_fault_copy_entry(). Sponsored by: EMC / Isilon storage division Reviewed by: alc Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed May 22 12:59:39 2013 (r250908) +++ head/sys/vm/vm_fault.c Wed May 22 15:11:00 2013 (r250909) @@ -1318,7 +1318,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm * (Because the source is wired down, the page will be in * memory.) */ - VM_OBJECT_WLOCK(src_object); + VM_OBJECT_RLOCK(src_object); object = src_object; pindex = src_pindex + dst_pindex; while ((src_m = vm_page_lookup(object, pindex)) == NULL && @@ -1327,15 +1327,15 @@ vm_fault_copy_entry(vm_map_t dst_map, vm /* * Allow fallback to backing objects if we are reading. */ - VM_OBJECT_WLOCK(backing_object); + VM_OBJECT_RLOCK(backing_object); pindex += OFF_TO_IDX(object->backing_object_offset); - VM_OBJECT_WUNLOCK(object); + VM_OBJECT_RUNLOCK(object); object = backing_object; } if (src_m == NULL) panic("vm_fault_copy_wired: page missing"); pmap_copy_page(src_m, dst_m); - VM_OBJECT_WUNLOCK(object); + VM_OBJECT_RUNLOCK(object); dst_m->valid = VM_PAGE_BITS_ALL; dst_m->dirty = VM_PAGE_BITS_ALL; VM_OBJECT_WUNLOCK(dst_object); From owner-svn-src-all@FreeBSD.ORG Wed May 22 15:17:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B9688897; Wed, 22 May 2013 15:17:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8C898CDF; Wed, 22 May 2013 15:17:16 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3303BB97D; Wed, 22 May 2013 11:17:15 -0400 (EDT) From: John Baldwin To: Scott Long Subject: Re: svn commit: r250907 - stable/9/sys/kern Date: Wed, 22 May 2013 11:07:36 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305221037.r4MAbSIq044944@svn.freebsd.org> In-Reply-To: <201305221037.r4MAbSIq044944@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305221107.36948.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 22 May 2013 11:17:15 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 15:17:16 -0000 On Wednesday, May 22, 2013 6:37:28 am Scott Long wrote: > Author: scottl > Date: Wed May 22 10:37:28 2013 > New Revision: 250907 > URL: http://svnweb.freebsd.org/changeset/base/250907 > > Log: > MFC r248830, r250027, r250409 > > Submitted by: gibbs, andre, kib > Obtained from: Netflix What does it do? (Perhaps a forced commit to include the missing bits of the commit message?) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed May 22 16:32:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 213B13EA; Wed, 22 May 2013 16:32:19 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1366C287; Wed, 22 May 2013 16:32:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MGWIFS069434; Wed, 22 May 2013 16:32:18 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MGWIjK069433; Wed, 22 May 2013 16:32:18 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305221632.r4MGWIjK069433@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 22 May 2013 16:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250911 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 16:32:19 -0000 Author: luigi Date: Wed May 22 16:32:18 2013 New Revision: 250911 URL: http://svnweb.freebsd.org/changeset/base/250911 Log: Increase the (arbitrary) limit for the number of packets per tick from 1k to 20k The previous value was good 10 years ago, but not anymore now. More importantly, lots of good surprises: polling is incredibly effective under virtualization, and not only prevents livelock but also saves most of the VM exit overhead in receive mode. Using polling, a FreeBSD instance under qemu-kvm remains perfectly responsive even when bombed with 10 Mpps over an emulated e1000, and happily processes 1.7 Mpps through ipfw. Note that some incompatibilities still remain: e.g. polling is not (yet) compatible with netmap, and seems to freeze the guest when kern.polling.idle_poll=1 MFC after: 3 days Modified: head/sys/kern/kern_poll.c Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Wed May 22 15:15:05 2013 (r250910) +++ head/sys/kern/kern_poll.c Wed May 22 16:32:18 2013 (r250911) @@ -87,12 +87,11 @@ static struct mtx poll_mtx; * The following constraints hold * * 1 <= poll_each_burst <= poll_burst <= poll_burst_max - * 0 <= poll_each_burst * MIN_POLL_BURST_MAX <= poll_burst_max <= MAX_POLL_BURST_MAX */ #define MIN_POLL_BURST_MAX 10 -#define MAX_POLL_BURST_MAX 1000 +#define MAX_POLL_BURST_MAX 20000 static uint32_t poll_burst = 5; static uint32_t poll_burst_max = 150; /* good for 100Mbit net and HZ=1000 */ From owner-svn-src-all@FreeBSD.ORG Wed May 22 16:33:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A34CD626; Wed, 22 May 2013 16:33:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95EAD2A1; Wed, 22 May 2013 16:33:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MGXTDb069714; Wed, 22 May 2013 16:33:29 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MGXT9e069713; Wed, 22 May 2013 16:33:29 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305221633.r4MGXT9e069713@svn.freebsd.org> From: Ed Maste Date: Wed, 22 May 2013 16:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250912 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 16:33:29 -0000 Author: emaste Date: Wed May 22 16:33:28 2013 New Revision: 250912 URL: http://svnweb.freebsd.org/changeset/base/250912 Log: Remove reference to removed !MPSAFE filesystem support Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Wed May 22 16:32:18 2013 (r250911) +++ head/share/man/man9/locking.9 Wed May 22 16:33:28 2013 (r250912) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2012 +.Dd May 22, 2013 .Dt LOCKING 9 .Os .Sh NAME @@ -167,7 +167,7 @@ Giant is an instance of a mutex, with so .It It is recursive. .It -Drivers and filesystems can request that Giant be locked around them +Drivers can request that Giant be locked around them by not marking themselves MPSAFE. Note that infrastructure to do this is slowly going away as non-MPSAFE drivers either became properly locked or disappear. From owner-svn-src-all@FreeBSD.ORG Wed May 22 17:13:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1293E102; Wed, 22 May 2013 17:13:04 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04CAC77E; Wed, 22 May 2013 17:13:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MHD3LI083574; Wed, 22 May 2013 17:13:03 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MHD3n7083573; Wed, 22 May 2013 17:13:03 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305221713.r4MHD3n7083573@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 22 May 2013 17:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250913 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 17:13:04 -0000 Author: gibbs Date: Wed May 22 17:13:03 2013 New Revision: 250913 URL: http://svnweb.freebsd.org/changeset/base/250913 Log: Correct panic on detach of Xen PV network interfaces. dev/xen/netfront: In netif_free(), properly stop the interface and drain any pending timers prior to disconnecting from the backend device. Remove all media and detach our interface object from the system prior to deleting it. PR: kern/176471 Submitted by: Roger Pau Monne Reviewed by: gibbs MFC after: 1 week Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Wed May 22 16:33:28 2013 (r250912) +++ head/sys/dev/xen/netfront/netfront.c Wed May 22 17:13:03 2013 (r250913) @@ -2171,10 +2171,14 @@ netfront_detach(device_t dev) static void netif_free(struct netfront_info *info) { + XN_LOCK(info); + xn_stop(info); + XN_UNLOCK(info); + callout_drain(&info->xn_stat_ch); netif_disconnect_backend(info); -#if 0 - close_netdev(info); -#endif + ifmedia_removeall(&info->sc_media); + ether_ifdetach(info->xn_ifp); + if_free(info->xn_ifp); } static void From owner-svn-src-all@FreeBSD.ORG Wed May 22 17:46:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CF654C05; Wed, 22 May 2013 17:46:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with ESMTP id AD803976; Wed, 22 May 2013 17:46:00 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 8D91123F804; Wed, 22 May 2013 13:45:59 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 8D91123F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 22 May 2013 13:45:57 -0400 From: Glen Barber To: Jung-uk Kim Subject: Re: svn commit: r250881 - in head: . sys/sys usr.bin/lex usr.bin/lex/lib Message-ID: <20130522174557.GL77347@glenbarber.us> References: <201305211932.r4LJWahf026659@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sMZCuqyhuhd4ycTi" Content-Disposition: inline In-Reply-To: <201305211932.r4LJWahf026659@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 17:46:00 -0000 --sMZCuqyhuhd4ycTi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 21, 2013 at 07:32:36PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Tue May 21 19:32:35 2013 > New Revision: 250881 > URL: http://svnweb.freebsd.org/changeset/base/250881 >=20 > Log: > Connect flex 2.5.37 to the build and bump __FreeBSD_version. >=20 I think this commit breaks head/. cc -O2 -pipe -I/src/sbin/hastctl/../hastd -DHAVE_CAPSICUM -DINET -DINET6 -DYY_NO_UNPUT -DYY_NO_INPUT -DHAVE_CRYPTO -std=3Dgnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-format -c t= oken.c cc1: warnings being treated as errors :753: warning: redundant redeclaration of 'yylex' /src/sbin/hastctl/../hastd/hast.h:263: warning: previous declaration of 'yy= lex' was here *** Error code 1 Stop. make: stopped in /src/sbin/hastctl *** Error code 1 http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-powerpc-powerpc.full Glen --sMZCuqyhuhd4ycTi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJRnQRVAAoJEFJPDDeguUajBO0IAKGcmFeE/1njNPcg/ijozeeJ queeRDfKoXUqJgQV9A8FtsCJpUVsLeLppMOaJ+e0fd/NL+i9rlCnZ5/bsQRoaNU2 2okzS/niCv6HrUeKjXeAr38lJQnCykazAFkvcmwZa3RPQsP3xvZdlErlPYU4oXmE K8e2EMX/+HuqyaFA8aBEFt4+1JugQ3CJf2eRDeMUGb30frIRj/KUSv0d8ogBY3+4 ojjbOaBO84gXwHsmZScCqTTNta445S/uJngOvmGmNIvIJ77QoIzShWzmGigU41mK NfPF36B5fME29UUDb6QCNSjqtb1uVf55+5d95aUlCm99DliyKeI822YLTfpILdI= =dHu9 -----END PGP SIGNATURE----- --sMZCuqyhuhd4ycTi-- From owner-svn-src-all@FreeBSD.ORG Wed May 22 17:47:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B8C11DAF; Wed, 22 May 2013 17:47:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA88C992; Wed, 22 May 2013 17:47:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MHlkJ1094570; Wed, 22 May 2013 17:47:46 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MHlkMD094567; Wed, 22 May 2013 17:47:46 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305221747.r4MHlkMD094567@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 22 May 2013 17:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250914 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 17:47:46 -0000 Author: jkim Date: Wed May 22 17:47:45 2013 New Revision: 250914 URL: http://svnweb.freebsd.org/changeset/base/250914 Log: Improve compatibility with old flex and fix build with GCC. Modified: head/sbin/hastd/hast.h head/sbin/hastd/parse.y head/sbin/hastd/token.l Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Wed May 22 17:13:03 2013 (r250913) +++ head/sbin/hastd/hast.h Wed May 22 17:47:45 2013 (r250914) @@ -259,7 +259,4 @@ struct hast_resource { struct hastd_config *yy_config_parse(const char *config, bool exitonerror); void yy_config_free(struct hastd_config *config); -void yyerror(const char *); -int yylex(void); - #endif /* !_HAST_H_ */ Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Wed May 22 17:13:03 2013 (r250913) +++ head/sbin/hastd/parse.y Wed May 22 17:47:45 2013 (r250914) @@ -75,6 +75,8 @@ static char depth1_provname[PATH_MAX]; static char depth1_localpath[PATH_MAX]; static int depth1_metaflush; +extern void yyerror(const char *); +extern int yylex(void); extern void yyrestart(FILE *); static int isitme(const char *name); Modified: head/sbin/hastd/token.l ============================================================================== --- head/sbin/hastd/token.l Wed May 22 17:13:03 2013 (r250913) +++ head/sbin/hastd/token.l Wed May 22 17:47:45 2013 (r250914) @@ -42,6 +42,9 @@ int depth; int lineno; #define DP do { } while (0) +#define YY_DECL int yylex(void) + +extern int yylex(void); %} %option noinput From owner-svn-src-all@FreeBSD.ORG Wed May 22 17:49:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id 0B0C7F5B; Wed, 22 May 2013 17:49:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Message-ID: <519D0446.4050108@FreeBSD.org> Date: Wed, 22 May 2013 13:45:42 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130517 Thunderbird/17.0.6 MIME-Version: 1.0 To: Glen Barber Subject: Re: svn commit: r250881 - in head: . sys/sys usr.bin/lex usr.bin/lex/lib References: <201305211932.r4LJWahf026659@svn.freebsd.org> <20130522174557.GL77347@glenbarber.us> In-Reply-To: <20130522174557.GL77347@glenbarber.us> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 17:49:14 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2013-05-22 13:45:57 -0400, Glen Barber wrote: > On Tue, May 21, 2013 at 07:32:36PM +0000, Jung-uk Kim wrote: >> Author: jkim Date: Tue May 21 19:32:35 2013 New Revision: 250881 >> URL: http://svnweb.freebsd.org/changeset/base/250881 >> >> Log: Connect flex 2.5.37 to the build and bump >> __FreeBSD_version. >> > > I think this commit breaks head/. > > cc -O2 -pipe -I/src/sbin/hastctl/../hastd -DHAVE_CAPSICUM -DINET > -DINET6 -DYY_NO_UNPUT -DYY_NO_INPUT -DHAVE_CRYPTO -std=gnu99 > -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k > -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch > -Wshadow -Wunused-parameter -Wchar-subscripts -Winline > -Wnested-externs -Wredundant-decls -Wold-style-definition > -Wno-pointer-sign -Wno-format -c token.c cc1: warnings being > treated as errors :753: warning: redundant redeclaration of > 'yylex' /src/sbin/hastctl/../hastd/hast.h:263: warning: previous > declaration of 'yylex' was here *** Error code 1 > > Stop. make: stopped in /src/sbin/hastctl *** Error code 1 > > http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-powerpc-powerpc.full It > should be fixed with r250914. Sorry for the breakage. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBAgAGBQJRnQRGAAoJECXpabHZMqHOzJoH/ivn5nGSL7LJd5pf4ORfYrN4 ru+YVHqGve3SDBEmuz//3jjqqzs9ovg54pm6EBSEFv2HP3uzzslX4kgRqFWPlI6j rEunbwrmv8Dz4+P1oVXzJuzCOAFh0nTZVM1PRV4RCcH5DyAaEU80fcO5DcCsapdj O4PCpcFmXkoDFSa5w4sVe8IRyAbsExsi8DQuM+ThoAshtEGhfm7PwRx8TfRkYzeQ CUpQ+MwmoqqFRZUGwF/Ny3OUNBwBEzhXKWsrB8PsE1jKsw7nujhnbWhm6c/K1E5/ rkKFhc1QhQzn3LzNzq9B4ncUo+ygCUaoSsQquFHRXSIeAs29lwVdXr54riouosM= =LAn1 -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Wed May 22 18:26:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DB093227; Wed, 22 May 2013 18:26:13 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CBCCBCD5; Wed, 22 May 2013 18:26:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MIQDka008756; Wed, 22 May 2013 18:26:13 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MIQCTM008747; Wed, 22 May 2013 18:26:12 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201305221826.r4MIQCTM008747@svn.freebsd.org> From: Jamie Gritton Date: Wed, 22 May 2013 18:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250915 - in stable/9: etc etc/rc.d sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 18:26:13 -0000 Author: jamie Date: Wed May 22 18:26:12 2013 New Revision: 250915 URL: http://svnweb.freebsd.org/changeset/base/250915 Log: MFC r250804: Refine the "nojail" rc keyword, adding "nojailvnet" for files that don't apply to most jails but do apply to vnet jails. This includes adding a new sysctl "security.jail.vnet" to identify vnet jails. PR: conf/149050 Submitted by: mdodd Modified: stable/9/etc/rc stable/9/etc/rc.d/ipfw stable/9/etc/rc.d/netif stable/9/etc/rc.d/routing stable/9/etc/rc.shutdown stable/9/sys/kern/kern_jail.c Directory Properties: stable/9/etc/ (props changed) stable/9/etc/rc.d/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/etc/rc ============================================================================== --- stable/9/etc/rc Wed May 22 17:47:45 2013 (r250914) +++ stable/9/etc/rc Wed May 22 18:26:12 2013 (r250915) @@ -77,6 +77,9 @@ if [ `/sbin/sysctl -n security.jail.jail if [ "$early_late_divider" = "FILESYSTEMS" ]; then early_late_divider=NETWORKING fi + if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + skip="$skip -s nojailvnet" + fi fi # Do a first pass to get everything up to $early_late_divider so that Modified: stable/9/etc/rc.d/ipfw ============================================================================== --- stable/9/etc/rc.d/ipfw Wed May 22 17:47:45 2013 (r250914) +++ stable/9/etc/rc.d/ipfw Wed May 22 18:26:12 2013 (r250915) @@ -5,7 +5,7 @@ # PROVIDE: ipfw # REQUIRE: ppp -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr . /etc/network.subr Modified: stable/9/etc/rc.d/netif ============================================================================== --- stable/9/etc/rc.d/netif Wed May 22 17:47:45 2013 (r250914) +++ stable/9/etc/rc.d/netif Wed May 22 18:26:12 2013 (r250915) @@ -28,7 +28,7 @@ # PROVIDE: netif # REQUIRE: atm1 FILESYSTEMS serial sppp sysctl # REQUIRE: ipfilter ipfs -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr . /etc/network.subr Modified: stable/9/etc/rc.d/routing ============================================================================== --- stable/9/etc/rc.d/routing Wed May 22 17:47:45 2013 (r250914) +++ stable/9/etc/rc.d/routing Wed May 22 18:26:12 2013 (r250915) @@ -7,7 +7,7 @@ # PROVIDE: routing # REQUIRE: faith netif ppp stf -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr . /etc/network.subr Modified: stable/9/etc/rc.shutdown ============================================================================== --- stable/9/etc/rc.shutdown Wed May 22 17:47:45 2013 (r250914) +++ stable/9/etc/rc.shutdown Wed May 22 18:26:12 2013 (r250915) @@ -81,7 +81,12 @@ fi # and perform the operation # rcorder_opts="-k shutdown" -[ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && rcorder_opts="$rcorder_opts -s nojail" +if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then + rcorder_opts="$rcorder_opts -s nojail" + if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + rcorder_opts="$rcorder_opts -s nojailvnet" + fi +fi case ${local_startup} in [Nn][Oo] | '') ;; Modified: stable/9/sys/kern/kern_jail.c ============================================================================== --- stable/9/sys/kern/kern_jail.c Wed May 22 17:47:45 2013 (r250914) +++ stable/9/sys/kern/kern_jail.c Wed May 22 18:26:12 2013 (r250915) @@ -4147,6 +4147,26 @@ SYSCTL_PROC(_security_jail, OID_AUTO, ja CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_jail_jailed, "I", "Process in jail?"); +static int +sysctl_jail_vnet(SYSCTL_HANDLER_ARGS) +{ + int error, havevnet; +#ifdef VIMAGE + struct ucred *cred = req->td->td_ucred; + + havevnet = jailed(cred) && prison_owns_vnet(cred); +#else + havevnet = 0; +#endif + error = SYSCTL_OUT(req, &havevnet, sizeof(havevnet)); + + return (error); +} + +SYSCTL_PROC(_security_jail, OID_AUTO, vnet, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_jail_vnet, "I", "Jail owns VNET?"); + #if defined(INET) || defined(INET6) SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, &jail_max_af_ips, 0, From owner-svn-src-all@FreeBSD.ORG Wed May 22 19:00:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0E3F2D8C; Wed, 22 May 2013 19:00:06 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0065CF0B; Wed, 22 May 2013 19:00:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MJ05kL019979; Wed, 22 May 2013 19:00:05 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MJ05eT019978; Wed, 22 May 2013 19:00:05 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201305221900.r4MJ05eT019978@svn.freebsd.org> From: Peter Wemm Date: Wed, 22 May 2013 19:00:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250916 - head/usr.sbin/mergemaster X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 19:00:06 -0000 Author: peter Date: Wed May 22 19:00:05 2013 New Revision: 250916 URL: http://svnweb.freebsd.org/changeset/base/250916 Log: Don't mess with /etc/localtime if it is a symlink. Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Wed May 22 18:26:12 2013 (r250915) +++ head/usr.sbin/mergemaster/mergemaster.sh Wed May 22 19:00:05 2013 (r250916) @@ -1327,7 +1327,7 @@ case "${NEED_PWD_MKDB}" in ;; esac -if [ -e "${DESTDIR}/etc/localtime" -a -z "${PRE_WORLD}" ]; then # Ignore if TZ == UTC +if [ -e "${DESTDIR}/etc/localtime" -a ! -L "${DESTDIR}/etc/localtime" -a -z "${PRE_WORLD}" ]; then # Ignore if TZ == UTC echo '' [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}" if [ -f "${DESTDIR}/var/db/zoneinfo" ]; then From owner-svn-src-all@FreeBSD.ORG Wed May 22 19:22:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E37D659; Wed, 22 May 2013 19:22:45 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 607CC1BD; Wed, 22 May 2013 19:22:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MJMjHu029355; Wed, 22 May 2013 19:22:45 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MJMjDA029354; Wed, 22 May 2013 19:22:45 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201305221922.r4MJMjDA029354@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 22 May 2013 19:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250917 - head/sys/xen/xenbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 19:22:45 -0000 Author: gibbs Date: Wed May 22 19:22:44 2013 New Revision: 250917 URL: http://svnweb.freebsd.org/changeset/base/250917 Log: Fix loss of the emulated keyboard on Xen PV HVM domains. xen/xenbus/xenbusb.c: In xenbusb_probe_children(), do not modify the XenBus state of devices for which we have no PV driver support. An emulated device we do support may share this backend. Hide the node from XenBus instead. This prevents closing the vkbd device, which Qemu's emulated keyboard device is using as the source for keyboard events. Tested with qemu-xen-traditional, qemu-xen and qemu stubdomains, all working as expected. Submitted by: Roger Pau Monne Reviewed by: gibbs MFC after: 1 week Modified: head/sys/xen/xenbus/xenbusb.c Modified: head/sys/xen/xenbus/xenbusb.c ============================================================================== --- head/sys/xen/xenbus/xenbusb.c Wed May 22 19:00:05 2013 (r250916) +++ head/sys/xen/xenbus/xenbusb.c Wed May 22 19:22:44 2013 (r250917) @@ -404,6 +404,31 @@ xenbusb_device_sysctl_init(device_t dev) } /** + * \brief Decrement the number of XenBus child devices in the + * connecting state by one and release the xbs_attch_ch + * interrupt configuration hook if the connecting count + * drops to zero. + * + * \param xbs XenBus Bus device softc of the owner of the bus to enumerate. + */ +static void +xenbusb_release_confighook(struct xenbusb_softc *xbs) +{ + mtx_lock(&xbs->xbs_lock); + KASSERT(xbs->xbs_connecting_children > 0, + ("Connecting device count error\n")); + xbs->xbs_connecting_children--; + if (xbs->xbs_connecting_children == 0 + && (xbs->xbs_flags & XBS_ATTACH_CH_ACTIVE) != 0) { + xbs->xbs_flags &= ~XBS_ATTACH_CH_ACTIVE; + mtx_unlock(&xbs->xbs_lock); + config_intrhook_disestablish(&xbs->xbs_attach_ch); + } else { + mtx_unlock(&xbs->xbs_lock); + } +} + +/** * \brief Verify the existance of attached device instances and perform * probe/attach processing for newly arrived devices. * @@ -417,7 +442,7 @@ xenbusb_probe_children(device_t dev) { device_t *kids; struct xenbus_device_ivars *ivars; - int i, count; + int i, count, error; if (device_get_children(dev, &kids, &count) == 0) { for (i = 0; i < count; i++) { @@ -430,7 +455,30 @@ xenbusb_probe_children(device_t dev) continue; } - if (device_probe_and_attach(kids[i])) { + error = device_probe_and_attach(kids[i]); + if (error == ENXIO) { + struct xenbusb_softc *xbs; + + /* + * We don't have a PV driver for this device. + * However, an emulated device we do support + * may share this backend. Hide the node from + * XenBus until the next rescan, but leave it's + * state unchanged so we don't inadvertently + * prevent attachment of any emulated device. + */ + xenbusb_delete_child(dev, kids[i]); + + /* + * Since the XenStore state of this device + * still indicates a pending attach, manually + * release it's hold on the boot process. + */ + xbs = device_get_softc(dev); + xenbusb_release_confighook(xbs); + + continue; + } else if (error) { /* * Transition device to the closed state * so the world knows that attachment will @@ -579,31 +627,6 @@ xenbusb_nop_confighook_cb(void *arg __un { } -/** - * \brief Decrement the number of XenBus child devices in the - * connecting state by one and release the xbs_attch_ch - * interrupt configuration hook if the connecting count - * drops to zero. - * - * \param xbs XenBus Bus device softc of the owner of the bus to enumerate. - */ -static void -xenbusb_release_confighook(struct xenbusb_softc *xbs) -{ - mtx_lock(&xbs->xbs_lock); - KASSERT(xbs->xbs_connecting_children > 0, - ("Connecting device count error\n")); - xbs->xbs_connecting_children--; - if (xbs->xbs_connecting_children == 0 - && (xbs->xbs_flags & XBS_ATTACH_CH_ACTIVE) != 0) { - xbs->xbs_flags &= ~XBS_ATTACH_CH_ACTIVE; - mtx_unlock(&xbs->xbs_lock); - config_intrhook_disestablish(&xbs->xbs_attach_ch); - } else { - mtx_unlock(&xbs->xbs_lock); - } -} - /*--------------------------- Public Functions -------------------------------*/ /*--------- API comments for these methods can be found in xenbusb.h ---------*/ void From owner-svn-src-all@FreeBSD.ORG Wed May 22 19:41:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B710DFF5; Wed, 22 May 2013 19:41:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with ESMTP id 7E99D62E; Wed, 22 May 2013 19:41:28 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 4FD1523F804; Wed, 22 May 2013 15:41:27 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 4FD1523F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 22 May 2013 15:41:25 -0400 From: Glen Barber To: Ed Schouten Subject: Re: svn commit: r250883 - in head: include include/xlocale lib/libc/locale sys/sys tools/regression/lib/libc/locale Message-ID: <20130522194125.GM77347@glenbarber.us> References: <201305211959.r4LJxbLx034714@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bZ2MuwyI/0uB8yuJ" Content-Disposition: inline In-Reply-To: <201305211959.r4LJxbLx034714@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 19:41:28 -0000 --bZ2MuwyI/0uB8yuJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 21, 2013 at 07:59:37PM +0000, Ed Schouten wrote: > Author: ed > Date: Tue May 21 19:59:37 2013 > New Revision: 250883 > URL: http://svnweb.freebsd.org/changeset/base/250883 >=20 > Log: > Add . > =20 > The header, part of C11, adds a small number of utility > functions for 16/32-bit "universal" characters, which may or may not be > UTF-16/32. As our wchar_t is already ISO 10646, simply add light-weight > wrappers around wcrtomb() and mbrtowc(). > =20 > While there, also add (non-yet-standard) _l functions, similar to the > ones we already have for the other locale-dependent functions. > =20 > Reviewed by: theraven >=20 > Added: > head/include/uchar.h (contents, props changed) > head/include/xlocale/_uchar.h (contents, props changed) > head/lib/libc/locale/c16rtomb.c (contents, props changed) > head/lib/libc/locale/c32rtomb.c (contents, props changed) > head/lib/libc/locale/mbrtoc16.c (contents, props changed) > head/lib/libc/locale/mbrtoc32.c (contents, props changed) > head/tools/regression/lib/libc/locale/test-c16rtomb.c (contents, prop= s changed) > head/tools/regression/lib/libc/locale/test-mbrtoc16.c (contents, prop= s changed) > Modified: > head/include/Makefile > head/include/stdatomic.h > head/include/xlocale/Makefile > head/lib/libc/locale/Makefile.inc > head/lib/libc/locale/Symbol.map > head/lib/libc/locale/mbrtowc.3 > head/lib/libc/locale/wcrtomb.3 > head/lib/libc/locale/xlocale_private.h > head/sys/sys/_types.h > head/tools/regression/lib/libc/locale/Makefile >=20 This fails to build for me with GCC. /usr/src/lib/libc/locale/c16rtomb.c:73: error: too many arguments to functi= on 'c32rtomb[21/1924] /usr/src/lib/libc/locale/c16rtomb.c: At top level: /usr/src/lib/libc/locale/c16rtomb.c:77: error: expected declaration specifi= ers or '...' before ' char16_t' /usr/src/lib/libc/locale/c16rtomb.c: In function 'c16rtomb': /usr/src/lib/l= ibc/locale/c16rtomb.c:80: error: 'c16' undeclared (first use in this functi= on) /usr/src/lib/libc/locale/c16rtomb.c:80: warning: passing argument 3 of 'c16= rtomb_l' from incompa tible pointer type /usr/src/lib/libc/locale/c16rtomb.c:80: error: too many arguments to functi= on 'c16rtomb_l' *** Error code 1 Stop. make: stopped in /usr/src/lib/libc *** Error code 1 Glen --bZ2MuwyI/0uB8yuJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJRnR9lAAoJEFJPDDeguUajcFcH/ipTIIYF+Afgvx4kIr+Np0ia vrUQ0Nud/KKP04I38piXAdniCG/4nWAXDQjhbV35rrHAUpK/EqFRQq4WAtk72J0s KNoUVpbloRaZ79ajTQW43WfW+J5MpoF7M5h4s2BTBNde4J77c3UMVE6BAUJiY0Py ngGM9b/bQJEK1pf6mp/lvDu+hfmzESfoOQ5+C3VhrdYZ5YwjznkZ4O169S6k89wM CLvmSFaqIoxJtSvRBDb+JYW/9gQyEGVDLPguAr/ii8t1NZ2R7XJMDJJpK04DACXV rToZ6N056B1BqlqUilyJxTDb30dvUgcDCof8EhbffWNmUn+7GpCKEtxI/5AgXno= =onj0 -----END PGP SIGNATURE----- --bZ2MuwyI/0uB8yuJ-- From owner-svn-src-all@FreeBSD.ORG Wed May 22 20:14:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 39311D4B; Wed, 22 May 2013 20:14:07 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx1.freebsd.org (Postfix) with ESMTP id BB5F5A23; Wed, 22 May 2013 20:14:06 +0000 (UTC) Received: by mail-vc0-f169.google.com with SMTP id kw10so1642741vcb.0 for ; Wed, 22 May 2013 13:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=XJ6x1J4ZfAhjHkh/WEXXv8KW6BQzLcH/Ht4J/T6unq0=; b=mziwhb0YjCSPX38YfuHIvsn7MxM0yHOlqPDbhYr1CqeAHGGlECpWnnKkDewKo+QVAe 72Hd3l57poAFvyJb2Cat/EeGzS9yOIpehQWQiwb7en4LoY6HyCHMiUFT5WW4+G0HpLdL iLoloeXBYAF9cb4ct6KySkdFu27VOj9CQMoh5E4WscXyqwpVswQKBhTXZkYVTyCSmh6T Ss0IifILm7aHzzSf7MTePaexBbj0GUfMpZIcfccdEnUwkwtAYpDcf0h+aiDlkRTcpHBE aWpNT9h5yuEZ7WSvj8tqHlHY5Bhfv+E2LK8mNS2Tm0JveZxMOoGHjpXX1l9ssOjeCD5i zowA== MIME-Version: 1.0 X-Received: by 10.220.92.195 with SMTP id s3mr3429238vcm.9.1369253640570; Wed, 22 May 2013 13:14:00 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.220.72.7 with HTTP; Wed, 22 May 2013 13:14:00 -0700 (PDT) In-Reply-To: <20130522194125.GM77347@glenbarber.us> References: <201305211959.r4LJxbLx034714@svn.freebsd.org> <20130522194125.GM77347@glenbarber.us> Date: Wed, 22 May 2013 22:14:00 +0200 X-Google-Sender-Auth: X_yHNvEBIsjPTV43StMz0OaRmc4 Message-ID: Subject: Re: svn commit: r250883 - in head: include include/xlocale lib/libc/locale sys/sys tools/regression/lib/libc/locale From: Ed Schouten To: Glen Barber Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 20:14:07 -0000 Hi Glen, 2013/5/22 Glen Barber : > This fails to build for me with GCC. > > /usr/src/lib/libc/locale/c16rtomb.c:73: error: too many arguments to function 'c32rtomb[21/1924] > /usr/src/lib/libc/locale/c16rtomb.c: At top level: > /usr/src/lib/libc/locale/c16rtomb.c:77: error: expected declaration specifiers or '...' before ' char16_t' > /usr/src/lib/libc/locale/c16rtomb.c: In function 'c16rtomb': /usr/src/lib/libc/locale/c16rtomb.c:80: error: 'c16' undeclared (first use in this function) > /usr/src/lib/libc/locale/c16rtomb.c:80: warning: passing argument 3 of 'c16rtomb_l' from incompa > tible pointer type > /usr/src/lib/libc/locale/c16rtomb.c:80: error: too many arguments to function 'c16rtomb_l' Sorry, but it seems I cannot reproduce this. On my FreeBSD 9.1-STABLE box I ran the following: make buildworld WITHOUT_CLANG= Could you pleae let me know a bit more about your setup? (P.S.: In the mean time I'm looking for a way to elegantly solve the character set issues. More on that later.) Thanks, -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Wed May 22 20:18:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7DC6AEC; Wed, 22 May 2013 20:18:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id B2CF6AC6; Wed, 22 May 2013 20:18:10 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 7F1BC23F804; Wed, 22 May 2013 16:18:09 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 7F1BC23F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 22 May 2013 16:18:07 -0400 From: Glen Barber To: Ed Schouten Subject: Re: svn commit: r250883 - in head: include include/xlocale lib/libc/locale sys/sys tools/regression/lib/libc/locale Message-ID: <20130522201807.GN77347@glenbarber.us> References: <201305211959.r4LJxbLx034714@svn.freebsd.org> <20130522194125.GM77347@glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TXIPBuAs4GDcsx9K" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 20:18:11 -0000 --TXIPBuAs4GDcsx9K Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Ed, On Wed, May 22, 2013 at 10:14:00PM +0200, Ed Schouten wrote: > Hi Glen, >=20 > 2013/5/22 Glen Barber : > > This fails to build for me with GCC. > > > > /usr/src/lib/libc/locale/c16rtomb.c:73: error: too many arguments to fu= nction 'c32rtomb[21/1924] > > /usr/src/lib/libc/locale/c16rtomb.c: At top level: > > /usr/src/lib/libc/locale/c16rtomb.c:77: error: expected declaration spe= cifiers or '...' before ' char16_t' > > /usr/src/lib/libc/locale/c16rtomb.c: In function 'c16rtomb': /usr/src/l= ib/libc/locale/c16rtomb.c:80: error: 'c16' undeclared (first use in this fu= nction) > > /usr/src/lib/libc/locale/c16rtomb.c:80: warning: passing argument 3 of = 'c16rtomb_l' from incompa > > tible pointer type > > /usr/src/lib/libc/locale/c16rtomb.c:80: error: too many arguments to fu= nction 'c16rtomb_l' >=20 > Sorry, but it seems I cannot reproduce this. On my FreeBSD 9.1-STABLE > box I ran the following: >=20 > make buildworld WITHOUT_CLANG=3D >=20 > Could you pleae let me know a bit more about your setup? >=20 > (P.S.: In the mean time I'm looking for a way to elegantly solve the > character set issues. More on that later.) >=20 I have a feeling this is ccache-related. Taking my ccache entries from src.conf allows the build to continue. Sorry for the noise. :( Glen --TXIPBuAs4GDcsx9K Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJRnSf/AAoJEFJPDDeguUajsf0H+gIL53Da+WYAJI0GJe72sy59 cFxqsiTtgP0cdUg/utrT2iFGq8xywemLWhqJ6KTVwGY/7DS0Zjq25z0eqBQZDxRd xSLoHh2KcyaRVjP9TsNL1kTNC3lY3PWF4l2czCR0ToLdqNz2CNRAkgC4u1EMYGjw YJKuJ5fzMp0oXYZgHHFYU7pOz0bHVqQ5sMWsK3qiKbg3IqUfTYQILuulx13IXS3H eI7ANBrZDu7Y1chenlHJHdQBqzSgfV+QgFzen9HYbpMqkdUZJiKc7yzTQcG+pGYJ pjFGrYi6Li7ZJe5omZWqDhgNvLIPpg+bDiYWgRSfm1YpCw2boAlk8w6vlsj4BeU= =e53e -----END PGP SIGNATURE----- --TXIPBuAs4GDcsx9K-- From owner-svn-src-all@FreeBSD.ORG Wed May 22 22:34:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A35D5BC1; Wed, 22 May 2013 22:34:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95780D3F; Wed, 22 May 2013 22:34:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MMYnbn098160; Wed, 22 May 2013 22:34:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MMYni9098158; Wed, 22 May 2013 22:34:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305222234.r4MMYni9098158@svn.freebsd.org> From: Ed Schouten Date: Wed, 22 May 2013 22:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250919 - in head/share/i18n: csmapper esdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 22:34:49 -0000 Author: ed Date: Wed May 22 22:34:48 2013 New Revision: 250919 URL: http://svnweb.freebsd.org/changeset/base/250919 Log: Don't depend on the touch binary being present. We can simply create an empty file by doing a no-op and redirecting stdout. Modified: head/share/i18n/csmapper/Makefile head/share/i18n/esdb/Makefile Modified: head/share/i18n/csmapper/Makefile ============================================================================== --- head/share/i18n/csmapper/Makefile Wed May 22 22:34:09 2013 (r250918) +++ head/share/i18n/csmapper/Makefile Wed May 22 22:34:48 2013 (r250919) @@ -7,7 +7,7 @@ SUBDIR= APPLE AST BIG5 CNS CP EBCDIC GB KAZAKH KOI KS MISC TCVN mapper.dir: ${SUBDIR} - touch ${.TARGET} + > ${.TARGET} .for i in ${SUBDIR} cat ${i}/mapper.dir.${i} >> ${.TARGET} .endfor @@ -18,7 +18,7 @@ FILES+= mapper.dir mapper.dir.db CLEANFILES+= mapper.dir mapper.dir.db charset.pivot: ${SUBDIR} - touch ${.TARGET} + > ${.TARGET} .for i in ${SUBDIR} cat ${i}/charset.pivot.${i} >> ${.TARGET} .endfor Modified: head/share/i18n/esdb/Makefile ============================================================================== --- head/share/i18n/esdb/Makefile Wed May 22 22:34:09 2013 (r250918) +++ head/share/i18n/esdb/Makefile Wed May 22 22:34:48 2013 (r250919) @@ -10,7 +10,7 @@ FILES+= esdb.dir esdb.dir.db esdb.alias CLEANFILES= ${FILES} esdb.dir: ${SUBDIR} - touch $@ + > $@ .for i in ${SUBDIR} cat ${i}/esdb.dir.${i} >>${.TARGET} .endfor @@ -18,7 +18,7 @@ esdb.dir.db: esdb.dir ${MKESDB} -m -o ${.TARGET} ${.ALLSRC} esdb.alias: ${SUBDIR} - touch $@ + > $@ .for i in ${SUBDIR} cat ${i}/esdb.alias.${i} >>${.TARGET} .endfor From owner-svn-src-all@FreeBSD.ORG Wed May 22 23:55:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 50414430; Wed, 22 May 2013 23:55:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 6CD45AF; Wed, 22 May 2013 23:55:52 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id n12so1790777wgh.12 for ; Wed, 22 May 2013 16:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=BFX2GjhmAnGl3MsnVCwCo+MymIdgwYyKXpTL9dUWeqw=; b=KzP8jeZe+jyp/vmKxpjMleEQ2+TZktg8RaSl3Lt6pjNvgBc3cWD5TGLXbjwnJmxRkk W8TVPzQz/MJRH8Ao9YeQ8sszIICjsQH/o8vAClrPlD336JSo7RjsWAkyQ0W5kByDn8VQ VuhvEUj1bk2H/JRy3ZwVMjDUNoTB53pSYi842rvKytZiuKkCSqef2x/zyCIZ/WqhzGd8 Ezxw7O7r96NzB7bFTqXb/x2eVCbsYni+RsrYu9aCCJu8+QKTNzAmHMPHyf24YwA1noie YOnXBrx7j/TC3gOnRU0ijqVWgDEA90rBrTa3K6MEneVmpEPLEpGmmo9TiZUf2m2xX9OE c2NQ== MIME-Version: 1.0 X-Received: by 10.180.90.164 with SMTP id bx4mr38035931wib.13.1369266951615; Wed, 22 May 2013 16:55:51 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.48.74 with HTTP; Wed, 22 May 2013 16:55:51 -0700 (PDT) In-Reply-To: <201305221632.r4MGWIjK069433@svn.freebsd.org> References: <201305221632.r4MGWIjK069433@svn.freebsd.org> Date: Wed, 22 May 2013 16:55:51 -0700 X-Google-Sender-Auth: OdVVjNHdLAEeODsvP0PxnL9LaBs Message-ID: Subject: Re: svn commit: r250911 - head/sys/kern From: Adrian Chadd To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 23:55:53 -0000 Odd, this reads like one of those things that's better off being time-capped, rather than packet-count capped. Good find, though. Adrian On 22 May 2013 09:32, Luigi Rizzo wrote: > Author: luigi > Date: Wed May 22 16:32:18 2013 > New Revision: 250911 > URL: http://svnweb.freebsd.org/changeset/base/250911 > > Log: > Increase the (arbitrary) limit for the number of packets per tick > from 1k to 20k The previous value was good 10 years ago, but not > anymore now. > > More importantly, lots of good surprises: > polling is incredibly effective under virtualization, and not only > prevents livelock but also saves most of the VM exit overhead in > receive mode. > > Using polling, a FreeBSD instance under qemu-kvm remains perfectly > responsive even when bombed with 10 Mpps over an emulated e1000, > and happily processes 1.7 Mpps through ipfw. > > Note that some incompatibilities still remain: e.g. polling is not > (yet) compatible with netmap, and seems to freeze the guest when > kern.polling.idle_poll=1 > > MFC after: 3 days > > Modified: > head/sys/kern/kern_poll.c > > Modified: head/sys/kern/kern_poll.c > ============================================================================== > --- head/sys/kern/kern_poll.c Wed May 22 15:15:05 2013 (r250910) > +++ head/sys/kern/kern_poll.c Wed May 22 16:32:18 2013 (r250911) > @@ -87,12 +87,11 @@ static struct mtx poll_mtx; > * The following constraints hold > * > * 1 <= poll_each_burst <= poll_burst <= poll_burst_max > - * 0 <= poll_each_burst > * MIN_POLL_BURST_MAX <= poll_burst_max <= MAX_POLL_BURST_MAX > */ > > #define MIN_POLL_BURST_MAX 10 > -#define MAX_POLL_BURST_MAX 1000 > +#define MAX_POLL_BURST_MAX 20000 > > static uint32_t poll_burst = 5; > static uint32_t poll_burst_max = 150; /* good for 100Mbit net and HZ=1000 */ From owner-svn-src-all@FreeBSD.ORG Thu May 23 02:08:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 552C47B7; Thu, 23 May 2013 02:08:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id 2B16491E; Thu, 23 May 2013 02:08:15 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 65BD523F804; Wed, 22 May 2013 22:08:14 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 65BD523F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 22 May 2013 22:08:12 -0400 From: Glen Barber To: Jung-uk Kim Subject: Re: svn commit: r250881 - in head: . sys/sys usr.bin/lex usr.bin/lex/lib Message-ID: <20130523020812.GE1598@glenbarber.us> References: <201305211932.r4LJWahf026659@svn.freebsd.org> <20130522174557.GL77347@glenbarber.us> <519D0446.4050108@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <519D0446.4050108@FreeBSD.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 02:08:15 -0000 On Wed, May 22, 2013 at 01:45:42PM -0400, Jung-uk Kim wrote: > > I think this commit breaks head/. > > > > http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-powerpc-powerpc.full > > It should be fixed with r250914. > > Sorry for the breakage. > There are more... ===> usr.bin/ar (all) cc -O -pipe -G0 -I. -I/src/usr.bin/ar -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /src/usr.bin/ar/ar.c cc -O -pipe -G0 -I. -I/src/usr.bin/ar -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c acplex.c cc1: warnings being treated as errors :752: warning: redundant redeclaration of 'yylex' /src/usr.bin/ar/acplex.l:41: warning: previous declaration of 'yylex' was here *** Error code 1 http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-mips64-mips.full Glen From owner-svn-src-all@FreeBSD.ORG Thu May 23 05:42:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4D3D97BC; Thu, 23 May 2013 05:42:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3E7B92D2; Thu, 23 May 2013 05:42:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4N5gbH3050976; Thu, 23 May 2013 05:42:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4N5gZnU050965; Thu, 23 May 2013 05:42:35 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305230542.r4N5gZnU050965@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 23 May 2013 05:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250926 - in head: contrib/openbsm/bin/auditdistd usr.bin/ar usr.bin/bc usr.bin/m4 usr.bin/mklocale usr.sbin/bluetooth/bthidd usr.sbin/config usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 05:42:37 -0000 Author: jkim Date: Thu May 23 05:42:35 2013 New Revision: 250926 URL: http://svnweb.freebsd.org/changeset/base/250926 Log: Work around build breakages with GCC 4.2. Reported by: tinderbox Modified: head/contrib/openbsm/bin/auditdistd/token.l head/usr.bin/ar/acplex.l head/usr.bin/bc/scan.l head/usr.bin/m4/tokenizer.l head/usr.bin/mklocale/lex.l head/usr.sbin/bluetooth/bthidd/lexer.l head/usr.sbin/config/lang.l head/usr.sbin/jail/jaillex.l Modified: head/contrib/openbsm/bin/auditdistd/token.l ============================================================================== --- head/contrib/openbsm/bin/auditdistd/token.l Thu May 23 01:37:34 2013 (r250925) +++ head/contrib/openbsm/bin/auditdistd/token.l Thu May 23 05:42:35 2013 (r250926) @@ -52,6 +52,7 @@ int depth; int lineno; #define DP do { } while (0) +#define YY_DECL int yylex(void) %} %option noinput Modified: head/usr.bin/ar/acplex.l ============================================================================== --- head/usr.bin/ar/acplex.l Thu May 23 01:37:34 2013 (r250925) +++ head/usr.bin/ar/acplex.l Thu May 23 05:42:35 2013 (r250926) @@ -40,6 +40,8 @@ int lineno = 1; int yylex(void); +#define YY_DECL int yylex(void) + %} %option nounput Modified: head/usr.bin/bc/scan.l ============================================================================== --- head/usr.bin/bc/scan.l Thu May 23 01:37:34 2013 (r250925) +++ head/usr.bin/bc/scan.l Thu May 23 05:42:35 2013 (r250926) @@ -46,6 +46,7 @@ static void init_strbuf(void); static void add_str(const char *); static int bc_yyinput(char *, int); +#define YY_DECL int yylex(void) #define YY_NO_INPUT #undef YY_INPUT #define YY_INPUT(buf,retval,max) \ Modified: head/usr.bin/m4/tokenizer.l ============================================================================== --- head/usr.bin/m4/tokenizer.l Thu May 23 01:37:34 2013 (r250925) +++ head/usr.bin/m4/tokenizer.l Thu May 23 05:42:35 2013 (r250926) @@ -31,6 +31,8 @@ extern int32_t yylval; int32_t number(void); int32_t parse_radix(void); extern int yylex(void); + +#define YY_DECL int yylex(void) %} delim [ \t\n] Modified: head/usr.bin/mklocale/lex.l ============================================================================== --- head/usr.bin/mklocale/lex.l Thu May 23 01:37:34 2013 (r250925) +++ head/usr.bin/mklocale/lex.l Thu May 23 05:42:35 2013 (r250926) @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include "ldef.h" #include "y.tab.h" #include "extern.h" + +#define YY_DECL int yylex(void) %} ODIGIT [0-7] Modified: head/usr.sbin/bluetooth/bthidd/lexer.l ============================================================================== --- head/usr.sbin/bluetooth/bthidd/lexer.l Thu May 23 01:37:34 2013 (r250925) +++ head/usr.sbin/bluetooth/bthidd/lexer.l Thu May 23 05:42:35 2013 (r250926) @@ -37,6 +37,8 @@ #include "parser.h" int yylex (void); + +#define YY_DECL int yylex(void) %} %option yylineno noyywrap nounput noinput Modified: head/usr.sbin/config/lang.l ============================================================================== --- head/usr.sbin/config/lang.l Thu May 23 01:37:34 2013 (r250925) +++ head/usr.sbin/config/lang.l Thu May 23 05:42:35 2013 (r250926) @@ -93,6 +93,7 @@ unsigned int octal(const char *); unsigned int hex(const char *); int yyerror(const char *); +#define YY_DECL int yylex(void) %} %option nounput Modified: head/usr.sbin/jail/jaillex.l ============================================================================== --- head/usr.sbin/jail/jaillex.l Thu May 23 01:37:34 2013 (r250925) +++ head/usr.sbin/jail/jaillex.l Thu May 23 05:42:35 2013 (r250926) @@ -42,6 +42,8 @@ static ssize_t text2lval(size_t triml, s static int instr; static int lineno = 1; + +#define YY_DECL int yylex(void) %} %option noinput From owner-svn-src-all@FreeBSD.ORG Thu May 23 06:13:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F128CB3C; Thu, 23 May 2013 06:13:25 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id B5994663; Thu, 23 May 2013 06:13:25 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id E2FC87300A; Thu, 23 May 2013 08:16:00 +0200 (CEST) Date: Thu, 23 May 2013 08:16:00 +0200 From: Luigi Rizzo To: Adrian Chadd Subject: Re: svn commit: r250911 - head/sys/kern Message-ID: <20130523061600.GB6430@onelab2.iet.unipi.it> References: <201305221632.r4MGWIjK069433@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 06:13:26 -0000 On Wed, May 22, 2013 at 04:55:51PM -0700, Adrian Chadd wrote: > Odd, this reads like one of those things that's better off being > time-capped, rather than packet-count capped. this is in fact how it works: the control loop in the polling code dynamically adjusts the actual number of packets so that the fraction of CPU cycles spent in the polling routine does not exceed the threshold (100 - kern.polling.user_frac). Working in batches avoids reading the clock and calling the poll method at every packet, which would be too expensive. cheers luigi From owner-svn-src-all@FreeBSD.ORG Thu May 23 11:29:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 65B2C4DE; Thu, 23 May 2013 11:29:29 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 57891885; Thu, 23 May 2013 11:29:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NBTT8b072514; Thu, 23 May 2013 11:29:29 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NBTSg8072511; Thu, 23 May 2013 11:29:28 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201305231129.r4NBTSg8072511@svn.freebsd.org> From: Oleg Bulyzhin Date: Thu, 23 May 2013 11:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250927 - in stable/9/sys: net netinet netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 11:29:29 -0000 Author: oleg Date: Thu May 23 11:29:28 2013 New Revision: 250927 URL: http://svnweb.freebsd.org/changeset/base/250927 Log: MFC: r249628, r249742 - recover missing arp_ifinit() call. - plug static llentry leak (ipv4 & ipv6 were affected). PR: kern/172985 Modified: stable/9/sys/net/if_vlan.c stable/9/sys/netinet/in.c stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_vlan.c ============================================================================== --- stable/9/sys/net/if_vlan.c Thu May 23 05:42:35 2013 (r250926) +++ stable/9/sys/net/if_vlan.c Thu May 23 11:29:28 2013 (r250927) @@ -41,6 +41,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" #include "opt_vlan.h" #include @@ -66,6 +67,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef INET +#include +#include +#endif + #define VLANNAME "vlan" #define VLAN_DEF_HWIDTH 4 #define VLAN_IFFLAGS (IFF_BROADCAST | IFF_MULTICAST) Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Thu May 23 05:42:35 2013 (r250926) +++ stable/9/sys/netinet/in.c Thu May 23 11:29:28 2013 (r250927) @@ -1528,10 +1528,14 @@ in_lltable_lookup(struct lltable *llt, u LLE_WLOCK(lle); lle->la_flags |= LLE_DELETED; EVENTHANDLER_INVOKE(arp_update_event, lle); - LLE_WUNLOCK(lle); #ifdef DIAGNOSTIC - log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); #endif + if ((lle->la_flags & + (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC) + llentry_free(lle); + else + LLE_WUNLOCK(lle); } lle = (void *)-1; Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Thu May 23 05:42:35 2013 (r250926) +++ stable/9/sys/netinet6/in6.c Thu May 23 11:29:28 2013 (r250927) @@ -194,10 +194,10 @@ in6_ifremloop(struct ifaddr *ifa) ia = ifa2ia6(ifa); ifp = ifa->ifa_ifp; - IF_AFDATA_LOCK(ifp); - lla_lookup(LLTABLE6(ifp), (LLE_DELETE | LLE_IFADDR), - (struct sockaddr *)&ia->ia_addr); - IF_AFDATA_UNLOCK(ifp); + memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr)); + memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask)); + lltable_prefix_free(AF_INET6, (struct sockaddr *)&addr, + (struct sockaddr *)&mask, LLE_STATIC); /* * initialize for rtmsg generation @@ -209,8 +209,6 @@ in6_ifremloop(struct ifaddr *ifa) gateway.sdl_alen = ifp->if_addrlen; bzero(&rt0, sizeof(rt0)); rt0.rt_gateway = (struct sockaddr *)&gateway; - memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask)); - memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr)); rt_mask(&rt0) = (struct sockaddr *)&mask; rt_key(&rt0) = (struct sockaddr *)&addr; rt0.rt_flags = RTF_HOST | RTF_STATIC; @@ -2581,10 +2579,14 @@ in6_lltable_lookup(struct lltable *llt, if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) { LLE_WLOCK(lle); lle->la_flags |= LLE_DELETED; - LLE_WUNLOCK(lle); #ifdef DIAGNOSTIC - log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); #endif + if ((lle->la_flags & + (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC) + llentry_free(lle); + else + LLE_WUNLOCK(lle); } lle = (void *)-1; } From owner-svn-src-all@FreeBSD.ORG Thu May 23 12:07:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3A3125CD; Thu, 23 May 2013 12:07:43 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8B9B07; Thu, 23 May 2013 12:07:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NC7hAr086167; Thu, 23 May 2013 12:07:43 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NC7gNb086160; Thu, 23 May 2013 12:07:42 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305231207.r4NC7gNb086160@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 23 May 2013 12:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250928 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 12:07:43 -0000 Author: gber Date: Thu May 23 12:07:41 2013 New Revision: 250928 URL: http://svnweb.freebsd.org/changeset/base/250928 Log: Switch to AP[2:1] access permissions model. Store "referenced" bit in PTE. Enable Access Flag in CPU control. With AF enabled each valid mapping needs to have referenced bit in PTE set in order to be able to cache it in the TLB. AP[0] bit is to be used as reference flag. All access permissions are encoded by AP[2:1] wherein AP[1] is in fact "user enable" and AP[2](APX) is "write disable". All mappings are always set to be valid. Reference emulation is performed by setting/clearing reference flag in PTE. md.pvh_attrs are no longer necessary however pv_flags are still being used for now. Marking vm_page as "dirty" or "referenced" is being performed on: - page or flag fault servicing in pmap_fault_fixup(), basing on the fault type - vm_fault servicing in pmap_enter() according to the desired protections and faulty access type Redundant page marking has been removed as on ARM we know exactly when the particular page is referenced or is going to be written. Submitted by: Zbigniew Bodek Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/locore.S head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/trap.c head/sys/arm/include/armreg.h head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Thu May 23 11:29:28 2013 (r250927) +++ head/sys/arm/arm/locore.S Thu May 23 12:07:41 2013 (r250928) @@ -188,6 +188,7 @@ Lunmapped: #ifdef _ARM_ARCH_6 orr r0, r0, #(CPU_CONTROL_V6_EXTPAGE | CPU_CONTROL_UNAL_ENABLE) orr r2, r2, #(CPU_CONTROL_AFLT_ENABLE) + orr r0, r0, #(CPU_CONTROL_AF_ENABLE) #endif orr r0, r0, #(CPU_CONTROL_MMU_ENABLE) mcr p15, 0, r0, c1, c0, 0 Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Thu May 23 11:29:28 2013 (r250927) +++ head/sys/arm/arm/pmap-v6.c Thu May 23 12:07:41 2013 (r250928) @@ -220,8 +220,8 @@ static void pmap_free_pv_entry(pmap_t p static pv_entry_t pmap_get_pv_entry(pmap_t pmap, boolean_t try); static vm_page_t pmap_pv_reclaim(pmap_t locked_pmap); -static void pmap_enter_locked(pmap_t, vm_offset_t, vm_page_t, - vm_prot_t, boolean_t, int); +static void pmap_enter_locked(pmap_t, vm_offset_t, vm_prot_t, + vm_page_t, vm_prot_t, boolean_t, int); static vm_paddr_t pmap_extract_locked(pmap_t pmap, vm_offset_t va); static void pmap_alloc_l1(pmap_t); static void pmap_free_l1(pmap_t); @@ -902,10 +902,6 @@ pmap_clearbit(struct vm_page *pg, u_int if (maskbits & PVF_WRITE) maskbits |= PVF_MOD; - /* - * Clear saved attributes (modify, reference) - */ - pg->md.pvh_attrs &= ~(maskbits & (PVF_MOD | PVF_REF)); if (TAILQ_EMPTY(&pg->md.pv_list)) { rw_wunlock(&pvh_global_lock); @@ -935,14 +931,13 @@ pmap_clearbit(struct vm_page *pg, u_int npte |= L2_APX; } - if (maskbits & PVF_REF) { + if ((maskbits & PVF_REF) && L2_S_REFERENCED(opte)) { /* - * Make the PTE invalid so that we will take a - * page fault the next time the mapping is - * referenced. + * Clear referenced flag in PTE so that we + * will take a flag fault the next time the mapping + * is referenced. */ - npte &= ~L2_TYPE_MASK; - npte |= L2_TYPE_INV; + npte &= ~L2_S_REF; } CTR4(KTR_PMAP,"clearbit: pmap:%p bits:%x pte:%x->%x", @@ -998,7 +993,6 @@ pmap_enter_pv(struct vm_page *pg, struct pve->pv_flags = flags; TAILQ_INSERT_HEAD(&pg->md.pv_list, pve, pv_list); - pg->md.pvh_attrs |= flags & (PVF_REF | PVF_MOD); if (pve->pv_flags & PVF_WIRED) ++pm->pm_stats.wired_count; vm_page_aflag_set(pg, PGA_REFERENCED); @@ -1036,6 +1030,12 @@ vector_page_setprot(int prot) l2b = pmap_get_l2_bucket(pmap_kernel(), vector_page); ptep = &l2b->l2b_kva[l2pte_index(vector_page)]; + /* + * Set referenced flag. + * Vectors' page is always desired + * to be allowed to reside in TLB. + */ + *ptep |= L2_S_REF; pmap_set_prot(ptep, prot|VM_PROT_EXECUTE, 0); @@ -1052,16 +1052,15 @@ pmap_set_prot(pt_entry_t *ptep, vm_prot_ if (!(prot & VM_PROT_EXECUTE)) *ptep |= L2_XN; + /* Set defaults first - kernel read access */ *ptep |= L2_APX; *ptep |= L2_S_PROT_R; - + /* Now tune APs as desired */ if (user) *ptep |= L2_S_PROT_U; if (prot & VM_PROT_WRITE) *ptep &= ~(L2_APX); - else if (user) - *ptep &= ~(L2_S_PROT_R); } /* @@ -1087,20 +1086,11 @@ pmap_nuke_pv(struct vm_page *pg, pmap_t if (pve->pv_flags & PVF_WIRED) --pm->pm_stats.wired_count; - if (pg->md.pvh_attrs & PVF_MOD) - vm_page_dirty(pg); - - if (TAILQ_FIRST(&pg->md.pv_list) == NULL) - pg->md.pvh_attrs &= ~PVF_REF; - else - vm_page_aflag_set(pg, PGA_REFERENCED); - if (pve->pv_flags & PVF_WRITE) { TAILQ_FOREACH(pve, &pg->md.pv_list, pv_list) if (pve->pv_flags & PVF_WRITE) break; if (!pve) { - pg->md.pvh_attrs &= ~PVF_MOD; vm_page_aflag_clear(pg, PGA_WRITEABLE); } } @@ -1150,10 +1140,6 @@ pmap_modify_pv(struct vm_page *pg, pmap_ /* * There is at least one VA mapping this page. */ - - if (clr_mask & (PVF_REF | PVF_MOD)) - pg->md.pvh_attrs |= set_mask & (PVF_REF | PVF_MOD); - oflags = npv->pv_flags; npv->pv_flags = flags = (oflags & ~clr_mask) | set_mask; @@ -1168,10 +1154,8 @@ pmap_modify_pv(struct vm_page *pg, pmap_ if (npv->pv_flags & PVF_WRITE) break; } - if (!npv) { - pg->md.pvh_attrs &= ~PVF_MOD; + if (!npv) vm_page_aflag_clear(pg, PGA_WRITEABLE); - } } return (oflags); @@ -1350,7 +1334,8 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t pa = l2pte_pa(pte); CTR5(KTR_PMAP, "pmap_fault_fix: pmap:%p va:%x pte:0x%x ftype:%x user:%x", pm, va, pte, ftype, user); - if ((ftype & VM_PROT_WRITE) && !(L2_S_WRITABLE(pte))) { + if ((ftype & VM_PROT_WRITE) && !(L2_S_WRITABLE(pte)) && + L2_S_REFERENCED(pte)) { /* * This looks like a good candidate for "page modified" * emulation... @@ -1379,17 +1364,16 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t if ((pv->pv_flags & PVF_WRITE) == 0) { goto out; } - pg->md.pvh_attrs |= PVF_REF | PVF_MOD; + vm_page_dirty(pg); pv->pv_flags |= PVF_REF | PVF_MOD; /* Re-enable write permissions for the page */ - *ptep = (pte & ~L2_TYPE_MASK) | L2_S_PROTO; pmap_set_prot(ptep, VM_PROT_WRITE, *ptep & L2_S_PROT_U); CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", pte); PTE_SYNC(ptep); rv = 1; - } else if ((pte & L2_TYPE_MASK) == L2_TYPE_INV) { + } else if (!L2_S_REFERENCED(pte)) { /* * This looks like a good candidate for "page referenced" * emulation. @@ -1401,16 +1385,15 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t if ((pg = PHYS_TO_VM_PAGE(pa)) == NULL) goto out; /* Get the current flags for this page. */ - pv = pmap_find_pv(pg, pm, va); if (pv == NULL) goto out; - pg->md.pvh_attrs |= PVF_REF; + vm_page_aflag_set(pg, PGA_REFERENCED); pv->pv_flags |= PVF_REF; - - *ptep = (pte & ~L2_TYPE_MASK) | L2_S_PROTO; + /* Mark the page "referenced" */ + *ptep = pte | L2_S_REF; PTE_SYNC(ptep); rv = 1; } @@ -1901,7 +1884,7 @@ pmap_grow_map(vm_offset_t va, pt_entry_t l2b = pmap_get_l2_bucket(pmap_kernel(), va); ptep = &l2b->l2b_kva[l2pte_index(va)]; - *ptep = L2_S_PROTO | pa | cache_mode; + *ptep = L2_S_PROTO | pa | cache_mode | L2_S_REF; pmap_set_prot(ptep, VM_PROT_READ | VM_PROT_WRITE, 0); PTE_SYNC(ptep); @@ -2208,11 +2191,11 @@ pmap_kenter_internal(vm_offset_t va, vm_ } if (flags & KENTER_CACHE) { - *pte = L2_S_PROTO | pa | pte_l2_s_cache_mode; + *pte = L2_S_PROTO | pa | pte_l2_s_cache_mode | L2_S_REF; pmap_set_prot(pte, VM_PROT_READ | VM_PROT_WRITE, flags & KENTER_USER); } else { - *pte = L2_S_PROTO | pa; + *pte = L2_S_PROTO | pa | L2_S_REF; pmap_set_prot(pte, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, 0); } @@ -2476,8 +2459,6 @@ pmap_remove_all(vm_page_t m) l2b = pmap_get_l2_bucket(pmap, pv->pv_va); KASSERT(l2b != NULL, ("No l2 bucket")); ptep = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; - if (L2_S_WRITABLE(*ptep)) - vm_page_dirty(m); *ptep = 0; if (pmap_is_current(pmap)) PTE_SYNC(ptep); @@ -2488,7 +2469,6 @@ pmap_remove_all(vm_page_t m) pmap_free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); } - m->md.pvh_attrs &= ~(PVF_MOD | PVF_REF); if (flush) { if (PV_BEEN_EXECD(flags)) @@ -2620,8 +2600,6 @@ pmap_protect(pmap_t pm, vm_offset_t sva, f = pmap_modify_pv(pg, pm, sva, PVF_WRITE, 0); - if (f & PVF_WRITE) - vm_page_dirty(pg); if (flush >= 0) { flush++; @@ -2673,7 +2651,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); - pmap_enter_locked(pmap, va, m, prot, wired, M_WAITOK); + pmap_enter_locked(pmap, va, access, m, prot, wired, M_WAITOK); PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); } @@ -2682,8 +2660,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * The pvh global and pmap locks must be held. */ static void -pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, - boolean_t wired, int flags) +pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, + vm_prot_t prot, boolean_t wired, int flags) { struct l2_bucket *l2b = NULL; struct vm_page *opg; @@ -2763,8 +2741,7 @@ do_l2b_alloc: } else opg = NULL; - if ((prot & (VM_PROT_ALL)) || - (!m || m->md.pvh_attrs & PVF_REF)) { + if ((prot & (VM_PROT_ALL)) || !m) { /* * - The access type indicates that we don't need * to do referenced emulation. @@ -2772,48 +2749,47 @@ do_l2b_alloc: * - The physical page has already been referenced * so no need to re-do referenced emulation here. */ - npte |= L2_S_PROTO; -#ifdef SMP - npte |= L2_SHARED; -#endif - + npte |= L2_S_REF; nflags |= PVF_REF; - if (m && ((prot & VM_PROT_WRITE) != 0 || - (m->md.pvh_attrs & PVF_MOD))) { - /* - * This is a writable mapping, and the - * page's mod state indicates it has - * already been modified. Make it - * writable from the outset. - */ - nflags |= PVF_MOD; - if (!(m->md.pvh_attrs & PVF_MOD)) - vm_page_dirty(m); - } - if (m && opte) + if (m != NULL && + (m->oflags & VPO_UNMANAGED) == 0) vm_page_aflag_set(m, PGA_REFERENCED); } else { /* * Need to do page referenced emulation. */ - npte &= ~L2_TYPE_MASK; - npte |= L2_TYPE_INV; + npte &= ~L2_S_REF; } + /* Make the new PTE valid */ + npte |= L2_S_PROTO; +#ifdef SMP + npte |= L2_SHARED; +#endif + /* Set defaults first - kernel read access */ npte |= L2_APX; npte |= L2_S_PROT_R; + + /* Now tune APs as desired */ if (user) npte |= L2_S_PROT_U; if (prot & VM_PROT_WRITE) { npte &= ~(L2_APX); - if (m != NULL && - (m->oflags & VPO_UNMANAGED) == 0) + if (m != NULL && (m->oflags & VPO_UNMANAGED) == 0) { vm_page_aflag_set(m, PGA_WRITEABLE); - } else if (user) - npte &= ~(L2_S_PROT_R); + /* + * The access type and permissions indicate + * that the page will be written as soon as returned + * from fault service. + * Mark it dirty from the outset. + */ + if ((access & VM_PROT_WRITE) != 0) + vm_page_dirty(m); + } + } if (!(prot & VM_PROT_EXECUTE) && m) npte |= L2_XN; @@ -2930,16 +2906,18 @@ pmap_enter_object(pmap_t pmap, vm_offset { vm_page_t m; vm_pindex_t diff, psize; + vm_prot_t access; VM_OBJECT_ASSERT_LOCKED(m_start->object); psize = atop(end - start); m = m_start; + access = prot = prot & (VM_PROT_READ | VM_PROT_EXECUTE); rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { - pmap_enter_locked(pmap, start + ptoa(diff), m, prot & - (VM_PROT_READ | VM_PROT_EXECUTE), FALSE, M_NOWAIT); + pmap_enter_locked(pmap, start + ptoa(diff), access, m, prot, + FALSE, M_NOWAIT); m = TAILQ_NEXT(m, listq); } PMAP_UNLOCK(pmap); @@ -2958,11 +2936,12 @@ pmap_enter_object(pmap_t pmap, vm_offset void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { + vm_prot_t access; + access = prot = prot & (VM_PROT_READ | VM_PROT_EXECUTE); rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); - pmap_enter_locked(pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), - FALSE, M_NOWAIT); + pmap_enter_locked(pmap, va, access, m, prot, FALSE, M_NOWAIT); PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); } @@ -3567,7 +3546,7 @@ pmap_zero_page_gen(vm_page_t pg, int off * Note the temporary zero-page mapping must be a non-cached page in * order to work without corruption when write-allocate is enabled. */ - *cdst_pte = L2_S_PROTO | phys | pte_l2_s_cache_mode; + *cdst_pte = L2_S_PROTO | phys | pte_l2_s_cache_mode | L2_S_REF; pmap_set_prot(cdst_pte, VM_PROT_WRITE, 0); PTE_SYNC(cdst_pte); cpu_tlb_flushD_SE(cdstp); @@ -3659,11 +3638,11 @@ pmap_copy_page_generic(vm_paddr_t src, v * bits set to 0x0 makes page not accessible. csrc_pte is mapped * read/write until proper mapping defines are created for ARMv6. */ - *csrc_pte = L2_S_PROTO | src | pte_l2_s_cache_mode; + *csrc_pte = L2_S_PROTO | src | pte_l2_s_cache_mode | L2_S_REF; pmap_set_prot(csrc_pte, VM_PROT_READ, 0); PTE_SYNC(csrc_pte); - *cdst_pte = L2_S_PROTO | dst | pte_l2_s_cache_mode; + *cdst_pte = L2_S_PROTO | dst | pte_l2_s_cache_mode | L2_S_REF; pmap_set_prot(cdst_pte, VM_PROT_READ | VM_PROT_WRITE, 0); PTE_SYNC(cdst_pte); @@ -3705,11 +3684,11 @@ pmap_copy_pages(vm_page_t ma[], vm_offse b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); *csrc_pte = L2_S_PROTO | VM_PAGE_TO_PHYS(a_pg) | - pte_l2_s_cache_mode; + pte_l2_s_cache_mode | L2_S_REF; pmap_set_prot(csrc_pte, VM_PROT_READ, 0); PTE_SYNC(csrc_pte); *cdst_pte = L2_S_PROTO | VM_PAGE_TO_PHYS(b_pg) | - pte_l2_s_cache_mode; + pte_l2_s_cache_mode | L2_S_REF; pmap_set_prot(cdst_pte, VM_PROT_READ | VM_PROT_WRITE, 0); PTE_SYNC(cdst_pte); cpu_tlb_flushD_SE(csrcp); @@ -3800,10 +3779,28 @@ pmap_page_wired_mappings(vm_page_t m) boolean_t pmap_is_referenced(vm_page_t m) { + struct l2_bucket *l2b; + pv_entry_t pv; + pt_entry_t *pte; + pmap_t pmap; + boolean_t rv; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); - return ((m->md.pvh_attrs & PVF_REF) != 0); + rv = FALSE; + rw_wlock(&pvh_global_lock); + TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + pmap = PV_PMAP(pv); + PMAP_LOCK(pmap); + l2b = pmap_get_l2_bucket(pmap, pv->pv_va); + pte = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; + rv = L2_S_REFERENCED(*pte); + PMAP_UNLOCK(pmap); + if (rv) + break; + } + rw_wunlock(&pvh_global_lock); + return (rv); } /* @@ -3824,13 +3821,37 @@ pmap_ts_referenced(vm_page_t m) boolean_t pmap_is_modified(vm_page_t m) { + struct l2_bucket *l2b; + pv_entry_t pv; + pt_entry_t *pte; + pmap_t pmap; + boolean_t rv; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_modified: page %p is not managed", m)); - if (m->md.pvh_attrs & PVF_MOD) - return (TRUE); - - return(FALSE); + rv = FALSE; + /* + * If the page is not VPO_BUSY, then PGA_WRITEABLE cannot be + * concurrently set while the object is locked. Thus, if PGA_WRITEABLE + * is clear, no PTEs can have PG_M set. + */ + VM_OBJECT_ASSERT_WLOCKED(m->object); + if ((m->oflags & VPO_BUSY) == 0 && + (m->aflags & PGA_WRITEABLE) == 0) + return (rv); + rw_wlock(&pvh_global_lock); + TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + pmap = PV_PMAP(pv); + PMAP_LOCK(pmap); + l2b = pmap_get_l2_bucket(pmap, pv->pv_va); + pte = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; + rv = (L2_S_WRITABLE(*pte)); + PMAP_UNLOCK(pmap); + if (rv) + break; + } + rw_wunlock(&pvh_global_lock); + return (rv); } @@ -3854,8 +3875,7 @@ pmap_clear_modify(vm_page_t m) */ if ((m->aflags & PGA_WRITEABLE) == 0) return; - - if (m->md.pvh_attrs & PVF_MOD) + if (pmap_is_modified(m)) pmap_clearbit(m, PVF_MOD); } @@ -3871,7 +3891,7 @@ pmap_clear_reference(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_reference: page %p is not managed", m)); - if (m->md.pvh_attrs & PVF_REF) + if (pmap_is_referenced(m)) pmap_clearbit(m, PVF_REF); } @@ -3932,18 +3952,7 @@ retry: if (m != NULL && (m->oflags & VPO_UNMANAGED) == 0) managed = TRUE; if (managed) { - /* - * The ARM pmap tries to maintain a per-mapping - * reference bit. The trouble is that it's kept in - * the PV entry, not the PTE, so it's costly to access - * here. You would need to acquire the pvh global - * lock, call pmap_find_pv(), and introduce a custom - * version of vm_page_pa_tryrelock() that releases and - * reacquires the pvh global lock. In the end, I - * doubt it's worthwhile. This may falsely report - * the given address as referenced. - */ - if ((m->md.pvh_attrs & PVF_REF) != 0) + if (L2_S_REFERENCED(pte)) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; } if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != @@ -4074,7 +4083,7 @@ pmap_map_entry(vm_offset_t l1pt, vm_offs if (pte == NULL) panic("pmap_map_entry: can't find L2 table for VA 0x%08x", va); - pte[l2pte_index(va)] = L2_S_PROTO | pa | fl; + pte[l2pte_index(va)] = L2_S_PROTO | pa | fl | L2_S_REF; pmap_set_prot(&pte[l2pte_index(va)], prot, 0); PTE_SYNC(&pte[l2pte_index(va)]); } @@ -4161,7 +4170,7 @@ pmap_map_chunk(vm_offset_t l1pt, vm_offs #ifdef VERBOSE_INIT_ARM printf("P"); #endif - pte[l2pte_index(va)] = L2_S_PROTO | pa | f2s; + pte[l2pte_index(va)] = L2_S_PROTO | pa | f2s | L2_S_REF; pmap_set_prot(&pte[l2pte_index(va)], prot, 0); PTE_SYNC(&pte[l2pte_index(va)]); va += PAGE_SIZE; Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Thu May 23 11:29:28 2013 (r250927) +++ head/sys/arm/arm/trap.c Thu May 23 12:07:41 2013 (r250928) @@ -160,7 +160,11 @@ static const struct data_abort data_abor {dab_align, "Alignment Fault 3"}, {dab_buserr, "External Linefetch Abort (S)"}, {NULL, "Translation Fault (S)"}, +#if (ARM_MMU_V6 + ARM_MMU_V7) != 0 + {NULL, "Translation Flag Fault"}, +#else {dab_buserr, "External Linefetch Abort (P)"}, +#endif {NULL, "Translation Fault (P)"}, {dab_buserr, "External Non-Linefetch Abort (S)"}, {NULL, "Domain Fault (S)"}, Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Thu May 23 11:29:28 2013 (r250927) +++ head/sys/arm/include/armreg.h Thu May 23 12:07:41 2013 (r250928) @@ -290,6 +290,7 @@ #define CPU_CONTROL_UNAL_ENABLE 0x00400000 /* U: unaligned data access */ #define CPU_CONTROL_V6_EXTPAGE 0x00800000 /* XP: ARMv6 extended page tables */ #define CPU_CONTROL_L2_ENABLE 0x04000000 /* L2 Cache enabled */ +#define CPU_CONTROL_AF_ENABLE 0x20000000 /* Access Flag enable */ #define CPU_CONTROL_IDC_ENABLE CPU_CONTROL_DC_ENABLE @@ -395,6 +396,7 @@ #define FAULT_ALIGN_0 0x01 /* Alignment */ #define FAULT_ALIGN_1 0x03 /* Alignment */ #define FAULT_TRANS_S 0x05 /* Translation -- Section */ +#define FAULT_TRANS_F 0x06 /* Translation -- Flag */ #define FAULT_TRANS_P 0x07 /* Translation -- Page */ #define FAULT_DOMAIN_S 0x09 /* Domain -- Section */ #define FAULT_DOMAIN_P 0x0b /* Domain -- Page */ Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Thu May 23 11:29:28 2013 (r250927) +++ head/sys/arm/include/pmap.h Thu May 23 12:07:41 2013 (r250928) @@ -373,12 +373,27 @@ extern int pmap_needs_pte_sync; #define L2_S_PROTO L2_S_PROTO_xscale #elif (ARM_MMU_V6 + ARM_MMU_V7) != 0 - -#define L2_S_PROT_U (L2_AP0(2)) /* user access */ -#define L2_S_PROT_R (L2_AP0(1)) /* read access */ +/* + * AP[2:1] access permissions model: + * + * AP[2](APX) - Write Disable + * AP[1] - User Enable + * AP[0] - Reference Flag + * + * AP[2] AP[1] Kernel User + * 0 0 R/W N + * 0 1 R/W R/W + * 1 0 R N + * 1 1 R R + * + */ +#define L2_S_PROT_R (0) /* kernel read */ +#define L2_S_PROT_U (L2_AP0(2)) /* user read */ +#define L2_S_REF (L2_AP0(1)) /* reference flag */ #define L2_S_PROT_MASK (L2_S_PROT_U|L2_S_PROT_R) #define L2_S_WRITABLE(pte) (!(pte & L2_APX)) +#define L2_S_REFERENCED(pte) (!!(pte & L2_S_REF)) #ifndef SMP #define L1_S_CACHE_MASK (L1_S_TEX_MASK|L1_S_B|L1_S_C) From owner-svn-src-all@FreeBSD.ORG Thu May 23 12:15:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB2AE8C4; Thu, 23 May 2013 12:15:23 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CAB2BB67; Thu, 23 May 2013 12:15:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NCFNf2089444; Thu, 23 May 2013 12:15:23 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NCFNWZ089442; Thu, 23 May 2013 12:15:23 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305231215.r4NCFNWZ089442@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 23 May 2013 12:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250929 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 12:15:23 -0000 Author: gber Date: Thu May 23 12:15:23 2013 New Revision: 250929 URL: http://svnweb.freebsd.org/changeset/base/250929 Log: Improve, optimize and clean-up ARMv6/v7 memory management related code. Use pmap_find_pv if needed instead of multiplying its code throughout pmap-v6. Avoid possible NULL pointer dereference in pmap_enter_locked() When trying to get m->md.pv_memattr, make sure that m != NULL, in particular that vector_page is set to be NULL. Do not set PGA_REFERENCED flag in pmap_enter_pv(). On ARM any new page reference will result in either entering the new mapping by calling pmap_enter, etc. or fixing-up the existing mapping in pmap_fault_fixup(). Therefore we set PGA_REFERENCED flag in the earlier mentioned cases and setting it later in pmap_enter_pv() is just waste of cycles. Delete unused pm_pdir pointer from the pmap structure. Rearrange brackets in the fault cause detection in trap.c Place the brackets correctly in order to see course of the conditions instantaneously. Unify naming in pmap-v6.c and improve style Use naming common for whole pmap and compatible with other pmaps, improve style where possible: pm -> pmap pg -> m opg -> om *pt -> *ptep *pte -> *ptep *pde -> *pdep Submitted by: Zbigniew Bodek Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/arm/arm/trap.c head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Thu May 23 12:07:41 2013 (r250928) +++ head/sys/arm/arm/pmap-v6.c Thu May 23 12:15:23 2013 (r250929) @@ -563,7 +563,7 @@ pmap_pte_init_mmu_v6(void) * This is called at pmap creation time. */ static void -pmap_alloc_l1(pmap_t pm) +pmap_alloc_l1(pmap_t pmap) { struct l1_ttable *l1; u_int8_t domain; @@ -594,8 +594,8 @@ pmap_alloc_l1(pmap_t pm) /* * Fix up the relevant bits in the pmap structure */ - pm->pm_l1 = l1; - pm->pm_domain = domain + 1; + pmap->pm_l1 = l1; + pmap->pm_domain = domain + 1; } /* @@ -603,9 +603,9 @@ pmap_alloc_l1(pmap_t pm) * This is called at pmap destruction time. */ static void -pmap_free_l1(pmap_t pm) +pmap_free_l1(pmap_t pmap) { - struct l1_ttable *l1 = pm->pm_l1; + struct l1_ttable *l1 = pmap->pm_l1; mtx_lock(&l1_lru_lock); @@ -618,8 +618,8 @@ pmap_free_l1(pmap_t pm) /* * Free up the domain number which was allocated to the pmap */ - l1->l1_domain_free[pm->pm_domain - 1] = l1->l1_domain_first; - l1->l1_domain_first = pm->pm_domain - 1; + l1->l1_domain_free[pmap->pm_domain - 1] = l1->l1_domain_first; + l1->l1_domain_first = pmap->pm_domain - 1; l1->l1_domain_use_count--; /* @@ -641,7 +641,7 @@ pmap_free_l1(pmap_t pm) * and VA, or NULL if no L2 bucket exists for the address. */ static PMAP_INLINE struct l2_bucket * -pmap_get_l2_bucket(pmap_t pm, vm_offset_t va) +pmap_get_l2_bucket(pmap_t pmap, vm_offset_t va) { struct l2_dtable *l2; struct l2_bucket *l2b; @@ -649,7 +649,7 @@ pmap_get_l2_bucket(pmap_t pm, vm_offset_ l1idx = L1_IDX(va); - if ((l2 = pm->pm_l2[L2_IDX(l1idx)]) == NULL || + if ((l2 = pmap->pm_l2[L2_IDX(l1idx)]) == NULL || (l2b = &l2->l2_bucket[L2_BUCKET(l1idx)])->l2b_kva == NULL) return (NULL); @@ -669,7 +669,7 @@ pmap_get_l2_bucket(pmap_t pm, vm_offset_ * the bucket/page in the meantime. */ static struct l2_bucket * -pmap_alloc_l2_bucket(pmap_t pm, vm_offset_t va) +pmap_alloc_l2_bucket(pmap_t pmap, vm_offset_t va) { struct l2_dtable *l2; struct l2_bucket *l2b; @@ -677,36 +677,36 @@ pmap_alloc_l2_bucket(pmap_t pm, vm_offse l1idx = L1_IDX(va); - PMAP_ASSERT_LOCKED(pm); + PMAP_ASSERT_LOCKED(pmap); rw_assert(&pvh_global_lock, RA_WLOCKED); - if ((l2 = pm->pm_l2[L2_IDX(l1idx)]) == NULL) { + if ((l2 = pmap->pm_l2[L2_IDX(l1idx)]) == NULL) { /* * No mapping at this address, as there is * no entry in the L1 table. * Need to allocate a new l2_dtable. */ - PMAP_UNLOCK(pm); + PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); if ((l2 = uma_zalloc(l2table_zone, M_NOWAIT)) == NULL) { rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); + PMAP_LOCK(pmap); return (NULL); } rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); - if (pm->pm_l2[L2_IDX(l1idx)] != NULL) { + PMAP_LOCK(pmap); + if (pmap->pm_l2[L2_IDX(l1idx)] != NULL) { /* * Someone already allocated the l2_dtable while * we were doing the same. */ uma_zfree(l2table_zone, l2); - l2 = pm->pm_l2[L2_IDX(l1idx)]; + l2 = pmap->pm_l2[L2_IDX(l1idx)]; } else { bzero(l2, sizeof(*l2)); /* * Link it into the parent pmap */ - pm->pm_l2[L2_IDX(l1idx)] = l2; + pmap->pm_l2[L2_IDX(l1idx)] = l2; } } @@ -722,11 +722,11 @@ pmap_alloc_l2_bucket(pmap_t pm, vm_offse * No L2 page table has been allocated. Chances are, this * is because we just allocated the l2_dtable, above. */ - PMAP_UNLOCK(pm); + PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); ptep = uma_zalloc(l2zone, M_NOWAIT); rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); + PMAP_LOCK(pmap); if (l2b->l2b_kva != 0) { /* We lost the race. */ uma_zfree(l2zone, ptep); @@ -740,7 +740,7 @@ pmap_alloc_l2_bucket(pmap_t pm, vm_offse * if we allocated a new one above. */ if (l2->l2_occupancy == 0) { - pm->pm_l2[L2_IDX(l1idx)] = NULL; + pmap->pm_l2[L2_IDX(l1idx)] = NULL; uma_zfree(l2table_zone, l2); } return (NULL); @@ -769,7 +769,7 @@ pmap_free_l2_ptp(pt_entry_t *l2) * for the kernel pmap). */ static void -pmap_free_l2_bucket(pmap_t pm, struct l2_bucket *l2b, u_int count) +pmap_free_l2_bucket(pmap_t pmap, struct l2_bucket *l2b, u_int count) { struct l2_dtable *l2; pd_entry_t *pl1pd, l1pd; @@ -797,7 +797,7 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 * to a performance win over time as we don't need to continually * alloc/free. */ - if (l2b->l2b_occupancy > 0 || pm == pmap_kernel()) + if (l2b->l2b_occupancy > 0 || pmap == pmap_kernel()) return; /* @@ -809,14 +809,14 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 ptep = l2b->l2b_kva; l2b->l2b_kva = NULL; - pl1pd = &pm->pm_l1->l1_kva[l1idx]; + pl1pd = &pmap->pm_l1->l1_kva[l1idx]; /* * If the L1 slot matches the pmap's domain * number, then invalidate it. */ l1pd = *pl1pd & (L1_TYPE_MASK | L1_C_DOM_MASK); - if (l1pd == (L1_C_DOM(pm->pm_domain) | L1_TYPE_C)) { + if (l1pd == (L1_C_DOM(pmap->pm_domain) | L1_TYPE_C)) { *pl1pd = 0; PTE_SYNC(pl1pd); } @@ -829,7 +829,7 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 /* * Update the reference count in the associated l2_dtable */ - l2 = pm->pm_l2[L2_IDX(l1idx)]; + l2 = pmap->pm_l2[L2_IDX(l1idx)]; if (--l2->l2_occupancy > 0) return; @@ -838,7 +838,7 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 * slots managed by this l2_dtable. Go ahead and NULL-out * the pointer in the parent pmap and free the l2_dtable. */ - pm->pm_l2[L2_IDX(l1idx)] = NULL; + pmap->pm_l2[L2_IDX(l1idx)] = NULL; uma_zfree(l2table_zone, l2); } @@ -888,12 +888,12 @@ pmap_l2ptp_ctor(void *mem, int size, voi * constants and the latter would require an extra inversion at run-time. */ static int -pmap_clearbit(struct vm_page *pg, u_int maskbits) +pmap_clearbit(struct vm_page *m, u_int maskbits) { struct l2_bucket *l2b; struct pv_entry *pv; pt_entry_t *ptep, npte, opte; - pmap_t pm; + pmap_t pmap; vm_offset_t va; u_int oflags; int count = 0; @@ -903,7 +903,7 @@ pmap_clearbit(struct vm_page *pg, u_int if (maskbits & PVF_WRITE) maskbits |= PVF_MOD; - if (TAILQ_EMPTY(&pg->md.pv_list)) { + if (TAILQ_EMPTY(&m->md.pv_list)) { rw_wunlock(&pvh_global_lock); return (0); } @@ -911,21 +911,21 @@ pmap_clearbit(struct vm_page *pg, u_int /* * Loop over all current mappings setting/clearing as appropos */ - TAILQ_FOREACH(pv, &pg->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { va = pv->pv_va; - pm = PV_PMAP(pv); + pmap = PV_PMAP(pv); oflags = pv->pv_flags; pv->pv_flags &= ~maskbits; - PMAP_LOCK(pm); + PMAP_LOCK(pmap); - l2b = pmap_get_l2_bucket(pm, va); + l2b = pmap_get_l2_bucket(pmap, va); ptep = &l2b->l2b_kva[l2pte_index(va)]; npte = opte = *ptep; if ((maskbits & (PVF_WRITE|PVF_MOD)) && L2_S_WRITABLE(opte)) { - vm_page_dirty(pg); + vm_page_dirty(m); /* make the pte read only */ npte |= L2_APX; @@ -941,7 +941,7 @@ pmap_clearbit(struct vm_page *pg, u_int } CTR4(KTR_PMAP,"clearbit: pmap:%p bits:%x pte:%x->%x", - pm, maskbits, opte, npte); + pmap, maskbits, opte, npte); if (npte != opte) { count++; *ptep = npte; @@ -953,12 +953,12 @@ pmap_clearbit(struct vm_page *pg, u_int cpu_tlb_flushD_SE(pv->pv_va); } - PMAP_UNLOCK(pm); + PMAP_UNLOCK(pmap); } if (maskbits & PVF_WRITE) - vm_page_aflag_clear(pg, PGA_WRITEABLE); + vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(&pvh_global_lock); return (count); } @@ -982,20 +982,19 @@ pmap_clearbit(struct vm_page *pg, u_int * => caller should not adjust pmap's wire_count */ static void -pmap_enter_pv(struct vm_page *pg, struct pv_entry *pve, pmap_t pm, +pmap_enter_pv(struct vm_page *m, struct pv_entry *pve, pmap_t pmap, vm_offset_t va, u_int flags) { rw_assert(&pvh_global_lock, RA_WLOCKED); - PMAP_ASSERT_LOCKED(pm); + PMAP_ASSERT_LOCKED(pmap); pve->pv_va = va; pve->pv_flags = flags; - TAILQ_INSERT_HEAD(&pg->md.pv_list, pve, pv_list); + TAILQ_INSERT_HEAD(&m->md.pv_list, pve, pv_list); if (pve->pv_flags & PVF_WIRED) - ++pm->pm_stats.wired_count; - vm_page_aflag_set(pg, PGA_REFERENCED); + ++pmap->pm_stats.wired_count; } /* @@ -1005,13 +1004,13 @@ pmap_enter_pv(struct vm_page *pg, struct * => caller should hold lock on vm_page */ static PMAP_INLINE struct pv_entry * -pmap_find_pv(struct vm_page *pg, pmap_t pm, vm_offset_t va) +pmap_find_pv(struct vm_page *m, pmap_t pmap, vm_offset_t va) { struct pv_entry *pv; rw_assert(&pvh_global_lock, RA_WLOCKED); - TAILQ_FOREACH(pv, &pg->md.pv_list, pv_list) - if (pm == PV_PMAP(pv) && va == pv->pv_va) + TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) + if (pmap == PV_PMAP(pv) && va == pv->pv_va) break; return (pv); } @@ -1075,42 +1074,37 @@ pmap_set_prot(pt_entry_t *ptep, vm_prot_ */ static void -pmap_nuke_pv(struct vm_page *pg, pmap_t pm, struct pv_entry *pve) +pmap_nuke_pv(struct vm_page *m, pmap_t pmap, struct pv_entry *pve) { rw_assert(&pvh_global_lock, RA_WLOCKED); - PMAP_ASSERT_LOCKED(pm); + PMAP_ASSERT_LOCKED(pmap); - TAILQ_REMOVE(&pg->md.pv_list, pve, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pve, pv_list); if (pve->pv_flags & PVF_WIRED) - --pm->pm_stats.wired_count; + --pmap->pm_stats.wired_count; if (pve->pv_flags & PVF_WRITE) { - TAILQ_FOREACH(pve, &pg->md.pv_list, pv_list) + TAILQ_FOREACH(pve, &m->md.pv_list, pv_list) if (pve->pv_flags & PVF_WRITE) break; if (!pve) { - vm_page_aflag_clear(pg, PGA_WRITEABLE); + vm_page_aflag_clear(m, PGA_WRITEABLE); } } } static struct pv_entry * -pmap_remove_pv(struct vm_page *pg, pmap_t pm, vm_offset_t va) +pmap_remove_pv(struct vm_page *m, pmap_t pmap, vm_offset_t va) { struct pv_entry *pve; rw_assert(&pvh_global_lock, RA_WLOCKED); - pve = TAILQ_FIRST(&pg->md.pv_list); - while (pve) { - if (PV_PMAP(pve) == pm && pve->pv_va == va) { /* match? */ - pmap_nuke_pv(pg, pm, pve); - break; - } - pve = TAILQ_NEXT(pve, pv_list); - } + pve = pmap_find_pv(m, pmap, va); /* find corresponding pve */ + if (pve != NULL) + pmap_nuke_pv(m, pmap, pve); return(pve); /* return removed pve */ } @@ -1126,15 +1120,15 @@ pmap_remove_pv(struct vm_page *pg, pmap_ * Modify a physical-virtual mapping in the pv table */ static u_int -pmap_modify_pv(struct vm_page *pg, pmap_t pm, vm_offset_t va, +pmap_modify_pv(struct vm_page *m, pmap_t pmap, vm_offset_t va, u_int clr_mask, u_int set_mask) { struct pv_entry *npv; u_int flags, oflags; - PMAP_ASSERT_LOCKED(pm); + PMAP_ASSERT_LOCKED(pmap); rw_assert(&pvh_global_lock, RA_WLOCKED); - if ((npv = pmap_find_pv(pg, pm, va)) == NULL) + if ((npv = pmap_find_pv(m, pmap, va)) == NULL) return (0); /* @@ -1145,17 +1139,17 @@ pmap_modify_pv(struct vm_page *pg, pmap_ if ((flags ^ oflags) & PVF_WIRED) { if (flags & PVF_WIRED) - ++pm->pm_stats.wired_count; + ++pmap->pm_stats.wired_count; else - --pm->pm_stats.wired_count; + --pmap->pm_stats.wired_count; } if ((oflags & PVF_WRITE) && !(flags & PVF_WRITE)) { - TAILQ_FOREACH(npv, &pg->md.pv_list, pv_list) { + TAILQ_FOREACH(npv, &m->md.pv_list, pv_list) { if (npv->pv_flags & PVF_WRITE) break; } if (!npv) - vm_page_aflag_clear(pg, PGA_WRITEABLE); + vm_page_aflag_clear(m, PGA_WRITEABLE); } return (oflags); @@ -1176,8 +1170,6 @@ pmap_pinit0(struct pmap *pmap) { PDEBUG(1, printf("pmap_pinit0: pmap = %08x\n", (u_int32_t) pmap)); - dprintf("pmap_pinit0: pmap = %08x, pm_pdir = %08x\n", - (u_int32_t) pmap, (u_int32_t) pmap->pm_pdir); bcopy(kernel_pmap, pmap, sizeof(*pmap)); bzero(&pmap->pm_mtx, sizeof(pmap->pm_mtx)); PMAP_LOCK_INIT(pmap); @@ -1283,7 +1275,7 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, shpgperpr "Page share factor per proc"); int -pmap_fault_fixup(pmap_t pm, vm_offset_t va, vm_prot_t ftype, int user) +pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t ftype, int user) { struct l2_dtable *l2; struct l2_bucket *l2b; @@ -1295,7 +1287,7 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t l1idx = L1_IDX(va); rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); + PMAP_LOCK(pmap); /* * If there is no l2_dtable for this address, then the process @@ -1304,7 +1296,7 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t * Note: This will catch userland processes trying to access * kernel addresses. */ - l2 = pm->pm_l2[L2_IDX(l1idx)]; + l2 = pmap->pm_l2[L2_IDX(l1idx)]; if (l2 == NULL) goto out; @@ -1333,7 +1325,7 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t pa = l2pte_pa(pte); CTR5(KTR_PMAP, "pmap_fault_fix: pmap:%p va:%x pte:0x%x ftype:%x user:%x", - pm, va, pte, ftype, user); + pmap, va, pte, ftype, user); if ((ftype & VM_PROT_WRITE) && !(L2_S_WRITABLE(pte)) && L2_S_REFERENCED(pte)) { /* @@ -1341,15 +1333,15 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t * emulation... */ struct pv_entry *pv; - struct vm_page *pg; + struct vm_page *m; /* Extract the physical address of the page */ - if ((pg = PHYS_TO_VM_PAGE(pa)) == NULL) { + if ((m = PHYS_TO_VM_PAGE(pa)) == NULL) { goto out; } /* Get the current flags for this page. */ - pv = pmap_find_pv(pg, pm, va); + pv = pmap_find_pv(m, pmap, va); if (pv == NULL) { goto out; } @@ -1365,7 +1357,7 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t goto out; } - vm_page_dirty(pg); + vm_page_dirty(m); pv->pv_flags |= PVF_REF | PVF_MOD; /* Re-enable write permissions for the page */ @@ -1379,17 +1371,17 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t * emulation. */ struct pv_entry *pv; - struct vm_page *pg; + struct vm_page *m; /* Extract the physical address of the page */ - if ((pg = PHYS_TO_VM_PAGE(pa)) == NULL) + if ((m = PHYS_TO_VM_PAGE(pa)) == NULL) goto out; /* Get the current flags for this page. */ - pv = pmap_find_pv(pg, pm, va); + pv = pmap_find_pv(m, pmap, va); if (pv == NULL) goto out; - vm_page_aflag_set(pg, PGA_REFERENCED); + vm_page_aflag_set(m, PGA_REFERENCED); pv->pv_flags |= PVF_REF; /* Mark the page "referenced" */ @@ -1402,8 +1394,8 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t * We know there is a valid mapping here, so simply * fix up the L1 if necessary. */ - pl1pd = &pm->pm_l1->l1_kva[l1idx]; - l1pd = l2b->l2b_phys | L1_C_DOM(pm->pm_domain) | L1_C_PROTO; + pl1pd = &pmap->pm_l1->l1_kva[l1idx]; + l1pd = l2b->l2b_phys | L1_C_DOM(pmap->pm_domain) | L1_C_PROTO; if (*pl1pd != l1pd) { *pl1pd = l1pd; PTE_SYNC(pl1pd); @@ -1438,9 +1430,9 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t * that other parts of the pmap are not doing their job WRT managing * the TLB. */ - if (rv == 0 && pm->pm_l1->l1_domain_use_count == 1) { - printf("fixup: pm %p, va 0x%08x, ftype %d - nothing to do!\n", - pm, va, ftype); + if (rv == 0 && pmap->pm_l1->l1_domain_use_count == 1) { + printf("fixup: pmap %p, va 0x%08x, ftype %d - nothing to do!\n", + pmap, va, ftype); printf("fixup: l2 %p, l2b %p, ptep %p, pl1pd %p\n", l2, l2b, ptep, pl1pd); printf("fixup: pte 0x%x, l1pd 0x%x, last code 0x%x\n", @@ -1458,7 +1450,7 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t out: rw_wunlock(&pvh_global_lock); - PMAP_UNLOCK(pm); + PMAP_UNLOCK(pmap); return (rv); } @@ -1511,19 +1503,19 @@ pmap_postinit(void) * can be accessed quickly from cpu_switch() et al. */ void -pmap_set_pcb_pagedir(pmap_t pm, struct pcb *pcb) +pmap_set_pcb_pagedir(pmap_t pmap, struct pcb *pcb) { struct l2_bucket *l2b; - pcb->pcb_pagedir = pm->pm_l1->l1_physaddr; + pcb->pcb_pagedir = pmap->pm_l1->l1_physaddr; pcb->pcb_dacr = (DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | - (DOMAIN_CLIENT << (pm->pm_domain * 2)); + (DOMAIN_CLIENT << (pmap->pm_domain * 2)); if (vector_page < KERNBASE) { - pcb->pcb_pl1vec = &pm->pm_l1->l1_kva[L1_IDX(vector_page)]; - l2b = pmap_get_l2_bucket(pm, vector_page); + pcb->pcb_pl1vec = &pmap->pm_l1->l1_kva[L1_IDX(vector_page)]; + l2b = pmap_get_l2_bucket(pmap, vector_page); pcb->pcb_l1vec = l2b->l2b_phys | L1_C_PROTO | - L1_C_DOM(pm->pm_domain) | L1_C_DOM(PMAP_DOMAIN_KERNEL); + L1_C_DOM(pmap->pm_domain) | L1_C_DOM(PMAP_DOMAIN_KERNEL); } else pcb->pcb_pl1vec = NULL; } @@ -1531,14 +1523,14 @@ pmap_set_pcb_pagedir(pmap_t pm, struct p void pmap_activate(struct thread *td) { - pmap_t pm; + pmap_t pmap; struct pcb *pcb; - pm = vmspace_pmap(td->td_proc->p_vmspace); + pmap = vmspace_pmap(td->td_proc->p_vmspace); pcb = td->td_pcb; critical_enter(); - pmap_set_pcb_pagedir(pm, pcb); + pmap_set_pcb_pagedir(pmap, pcb); if (td == curthread) { u_int cur_dacr, cur_ttb; @@ -1871,12 +1863,12 @@ pmap_grow_map(vm_offset_t va, pt_entry_t struct l2_bucket *l2b; pt_entry_t *ptep; vm_paddr_t pa; - struct vm_page *pg; + struct vm_page *m; - pg = vm_page_alloc(NULL, 0, VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); - if (pg == NULL) + m = vm_page_alloc(NULL, 0, VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + if (m == NULL) return (1); - pa = VM_PAGE_TO_PHYS(pg); + pa = VM_PAGE_TO_PHYS(m); if (pap) *pap = pa; @@ -1896,7 +1888,7 @@ pmap_grow_map(vm_offset_t va, pt_entry_t * used by pmap_growkernel(). */ static __inline struct l2_bucket * -pmap_grow_l2_bucket(pmap_t pm, vm_offset_t va) +pmap_grow_l2_bucket(pmap_t pmap, vm_offset_t va) { struct l2_dtable *l2; struct l2_bucket *l2b; @@ -1907,7 +1899,7 @@ pmap_grow_l2_bucket(pmap_t pm, vm_offset l1idx = L1_IDX(va); - if ((l2 = pm->pm_l2[L2_IDX(l1idx)]) == NULL) { + if ((l2 = pmap->pm_l2[L2_IDX(l1idx)]) == NULL) { /* * No mapping at this address, as there is * no entry in the L1 table. @@ -1940,7 +1932,7 @@ pmap_grow_l2_bucket(pmap_t pm, vm_offset /* * Link it into the parent pmap */ - pm->pm_l2[L2_IDX(l1idx)] = l2; + pmap->pm_l2[L2_IDX(l1idx)] = l2; memset(l2, 0, sizeof(*l2)); } @@ -1994,7 +1986,7 @@ pmap_grow_l2_bucket(pmap_t pm, vm_offset void pmap_growkernel(vm_offset_t addr) { - pmap_t kpm = pmap_kernel(); + pmap_t kpmap = pmap_kernel(); if (addr <= pmap_curmaxkvaddr) return; /* we are OK */ @@ -2005,7 +1997,7 @@ pmap_growkernel(vm_offset_t addr) /* Map 1MB at a time */ for (; pmap_curmaxkvaddr < addr; pmap_curmaxkvaddr += L1_S_SIZE) - pmap_grow_l2_bucket(kpm, pmap_curmaxkvaddr); + pmap_grow_l2_bucket(kpmap, pmap_curmaxkvaddr); /* * flush out the cache, expensive but growkernel will happen so @@ -2033,7 +2025,7 @@ pmap_remove_pages(pmap_t pmap) struct pv_entry *pv; struct l2_bucket *l2b = NULL; vm_page_t m; - pt_entry_t *pt; + pt_entry_t *ptep; struct pv_chunk *pc, *npc; uint32_t inuse, bitmask; int allfree, bit, field, idx; @@ -2057,12 +2049,15 @@ pmap_remove_pages(pmap_t pmap) continue; } l2b = pmap_get_l2_bucket(pmap, pv->pv_va); - KASSERT(l2b != NULL, ("No L2 bucket in pmap_remove_pages")); - pt = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; - m = PHYS_TO_VM_PAGE(*pt & L2_ADDR_MASK); - KASSERT((vm_offset_t)m >= KERNBASE, ("Trying to access non-existent page va %x pte %x", pv->pv_va, *pt)); - *pt = 0; - PTE_SYNC(pt); + KASSERT(l2b != NULL, + ("No L2 bucket in pmap_remove_pages")); + ptep = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; + m = PHYS_TO_VM_PAGE(*ptep & L2_ADDR_MASK); + KASSERT((vm_offset_t)m >= KERNBASE, + ("Trying to access non-existent page " + "va %x pte %x", pv->pv_va, *ptep)); + *ptep = 0; + PTE_SYNC(ptep); /* Mark free */ PV_STAT(pv_entry_frees++); @@ -2168,7 +2163,7 @@ static PMAP_INLINE void pmap_kenter_internal(vm_offset_t va, vm_offset_t pa, int flags) { struct l2_bucket *l2b; - pt_entry_t *pte; + pt_entry_t *ptep; pt_entry_t opte; PDEBUG(1, printf("pmap_kenter: va = %08x, pa = %08x\n", @@ -2180,8 +2175,8 @@ pmap_kenter_internal(vm_offset_t va, vm_ l2b = pmap_grow_l2_bucket(pmap_kernel(), va); KASSERT(l2b != NULL, ("No L2 Bucket")); - pte = &l2b->l2b_kva[l2pte_index(va)]; - opte = *pte; + ptep = &l2b->l2b_kva[l2pte_index(va)]; + opte = *ptep; if (l2pte_valid(opte)) { cpu_tlb_flushD_SE(va); cpu_cpwait(); @@ -2191,18 +2186,18 @@ pmap_kenter_internal(vm_offset_t va, vm_ } if (flags & KENTER_CACHE) { - *pte = L2_S_PROTO | pa | pte_l2_s_cache_mode | L2_S_REF; - pmap_set_prot(pte, VM_PROT_READ | VM_PROT_WRITE, + *ptep = L2_S_PROTO | pa | pte_l2_s_cache_mode | L2_S_REF; + pmap_set_prot(ptep, VM_PROT_READ | VM_PROT_WRITE, flags & KENTER_USER); } else { - *pte = L2_S_PROTO | pa | L2_S_REF; - pmap_set_prot(pte, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, + *ptep = L2_S_PROTO | pa | L2_S_REF; + pmap_set_prot(ptep, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, 0); } PDEBUG(1, printf("pmap_kenter: pte = %08x, opte = %08x, npte = %08x\n", - (uint32_t) pte, opte, *pte)); - PTE_SYNC(pte); + (uint32_t) ptep, opte, *ptep)); + PTE_SYNC(ptep); cpu_cpwait(); } @@ -2246,20 +2241,20 @@ void pmap_kremove(vm_offset_t va) { struct l2_bucket *l2b; - pt_entry_t *pte, opte; + pt_entry_t *ptep, opte; l2b = pmap_get_l2_bucket(pmap_kernel(), va); if (!l2b) return; KASSERT(l2b != NULL, ("No L2 Bucket")); - pte = &l2b->l2b_kva[l2pte_index(va)]; - opte = *pte; + ptep = &l2b->l2b_kva[l2pte_index(va)]; + opte = *ptep; if (l2pte_valid(opte)) { va = va & ~PAGE_MASK; cpu_tlb_flushD_SE(va); cpu_cpwait(); - *pte = 0; - PTE_SYNC(pte); + *ptep = 0; + PTE_SYNC(ptep); } } @@ -2359,13 +2354,13 @@ pmap_object_init_pt(pmap_t pmap, vm_offs boolean_t pmap_is_prefaultable(pmap_t pmap, vm_offset_t addr) { - pd_entry_t *pde; - pt_entry_t *pte; + pd_entry_t *pdep; + pt_entry_t *ptep; - if (!pmap_get_pde_pte(pmap, addr, &pde, &pte)) + if (!pmap_get_pde_pte(pmap, addr, &pdep, &ptep)) return (FALSE); - KASSERT(pte != NULL, ("Valid mapping but no pte ?")); - if (*pte == 0) + KASSERT(ptep != NULL, ("Valid mapping but no pte ?")); + if (*ptep == 0) return (TRUE); return (FALSE); } @@ -2386,18 +2381,19 @@ pmap_is_prefaultable(pmap_t pmap, vm_off * a "section" mapping. */ boolean_t -pmap_get_pde_pte(pmap_t pm, vm_offset_t va, pd_entry_t **pdp, pt_entry_t **ptp) +pmap_get_pde_pte(pmap_t pmap, vm_offset_t va, pd_entry_t **pdp, + pt_entry_t **ptp) { struct l2_dtable *l2; pd_entry_t *pl1pd, l1pd; pt_entry_t *ptep; u_short l1idx; - if (pm->pm_l1 == NULL) + if (pmap->pm_l1 == NULL) return (FALSE); l1idx = L1_IDX(va); - *pdp = pl1pd = &pm->pm_l1->l1_kva[l1idx]; + *pdp = pl1pd = &pmap->pm_l1->l1_kva[l1idx]; l1pd = *pl1pd; if (l1pte_section_p(l1pd)) { @@ -2405,10 +2401,10 @@ pmap_get_pde_pte(pmap_t pm, vm_offset_t return (TRUE); } - if (pm->pm_l2 == NULL) + if (pmap->pm_l2 == NULL) return (FALSE); - l2 = pm->pm_l2[L2_IDX(l1idx)]; + l2 = pmap->pm_l2[L2_IDX(l1idx)]; if (l2 == NULL || (ptep = l2->l2_bucket[L2_BUCKET(l1idx)].l2b_kva) == NULL) { @@ -2439,7 +2435,7 @@ pmap_remove_all(vm_page_t m) pt_entry_t *ptep; struct l2_bucket *l2b; boolean_t flush = FALSE; - pmap_t curpm; + pmap_t curpmap; int flags = 0; KASSERT((m->flags & PG_FICTITIOUS) == 0, @@ -2448,10 +2444,10 @@ pmap_remove_all(vm_page_t m) if (TAILQ_EMPTY(&m->md.pv_list)) return; rw_wlock(&pvh_global_lock); - curpm = vmspace_pmap(curproc->p_vmspace); + curpmap = vmspace_pmap(curproc->p_vmspace); while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); - if (flush == FALSE && (pmap == curpm || + if (flush == FALSE && (pmap == curpmap || pmap == pmap_kernel())) flush = TRUE; @@ -2544,7 +2540,7 @@ pmap_change_attr(vm_offset_t sva, vm_siz * specified range of this map as requested. */ void -pmap_protect(pmap_t pm, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) +pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { struct l2_bucket *l2b; pt_entry_t *ptep, pte; @@ -2553,7 +2549,7 @@ pmap_protect(pmap_t pm, vm_offset_t sva, int flush; if ((prot & VM_PROT_READ) == 0) { - pmap_remove(pm, sva, eva); + pmap_remove(pmap, sva, eva); return; } @@ -2566,7 +2562,7 @@ pmap_protect(pmap_t pm, vm_offset_t sva, } rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); + PMAP_LOCK(pmap); /* * OK, at this point, we know we're doing write-protect operation. @@ -2581,7 +2577,7 @@ pmap_protect(pmap_t pm, vm_offset_t sva, if (next_bucket > eva) next_bucket = eva; - l2b = pmap_get_l2_bucket(pm, sva); + l2b = pmap_get_l2_bucket(pmap, sva); if (l2b == NULL) { sva = next_bucket; continue; @@ -2591,14 +2587,15 @@ pmap_protect(pmap_t pm, vm_offset_t sva, while (sva < next_bucket) { if ((pte = *ptep) != 0 && L2_S_WRITABLE(pte)) { - struct vm_page *pg; + struct vm_page *m; u_int f; - pg = PHYS_TO_VM_PAGE(l2pte_pa(pte)); - pmap_set_prot(ptep, prot, !(pm == pmap_kernel())); + m = PHYS_TO_VM_PAGE(l2pte_pa(pte)); + pmap_set_prot(ptep, prot, + !(pmap == pmap_kernel())); PTE_SYNC(ptep); - f = pmap_modify_pv(pg, pm, sva, + f = pmap_modify_pv(m, pmap, sva, PVF_WRITE, 0); if (flush >= 0) { @@ -2627,7 +2624,7 @@ pmap_protect(pmap_t pm, vm_offset_t sva, } rw_wunlock(&pvh_global_lock); - PMAP_UNLOCK(pm); + PMAP_UNLOCK(pmap); } @@ -2664,7 +2661,7 @@ pmap_enter_locked(pmap_t pmap, vm_offset vm_prot_t prot, boolean_t wired, int flags) { struct l2_bucket *l2b = NULL; - struct vm_page *opg; + struct vm_page *om; struct pv_entry *pve = NULL; pt_entry_t *ptep, npte, opte; u_int nflags; @@ -2700,8 +2697,9 @@ pmap_enter_locked(pmap_t pmap, vm_offset if (wired) nflags |= PVF_WIRED; - PDEBUG(1, printf("pmap_enter: pmap = %08x, va = %08x, m = %08x, prot = %x, " - "wired = %x\n", (uint32_t) pmap, va, (uint32_t) m, prot, wired)); + PDEBUG(1, printf("pmap_enter: pmap = %08x, va = %08x, m = %08x, " + "prot = %x, wired = %x\n", (uint32_t) pmap, va, (uint32_t) m, + prot, wired)); if (pmap == pmap_kernel()) { l2b = pmap_get_l2_bucket(pmap, va); @@ -2735,11 +2733,11 @@ do_l2b_alloc: * vm_page. */ if (l2pte_pa(opte) != pa) - opg = PHYS_TO_VM_PAGE(l2pte_pa(opte)); + om = PHYS_TO_VM_PAGE(l2pte_pa(opte)); else - opg = m; + om = m; } else - opg = NULL; + om = NULL; if ((prot & (VM_PROT_ALL)) || !m) { /* @@ -2794,10 +2792,10 @@ do_l2b_alloc: if (!(prot & VM_PROT_EXECUTE) && m) npte |= L2_XN; - if (m->md.pv_memattr != VM_MEMATTR_UNCACHEABLE) + if (m && (m->md.pv_memattr != VM_MEMATTR_UNCACHEABLE)) npte |= pte_l2_s_cache_mode; - if (m && m == opg) { + if (m && m == om) { /* * We're changing the attrs of an existing mapping. */ @@ -2809,13 +2807,13 @@ do_l2b_alloc: * New mapping, or changing the backing page * of an existing mapping. */ - if (opg) { + if (om) { /* * Replacing an existing mapping with a new one. * It is part of our managed memory so we * must remove it from the PV list */ - if ((pve = pmap_remove_pv(opg, pmap, va))) { + if ((pve = pmap_remove_pv(om, pmap, va))) { oflags = pve->pv_flags; if (m && ((m->oflags & VPO_UNMANAGED))) @@ -2824,7 +2822,8 @@ do_l2b_alloc: } if ((m && !(m->oflags & VPO_UNMANAGED))) { - if ((!pve) && (pve = pmap_get_pv_entry(pmap, FALSE)) == NULL) + if ((!pve) && + (pve = pmap_get_pv_entry(pmap, FALSE)) == NULL) panic("pmap_enter: no pv entries"); KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, @@ -2869,8 +2868,8 @@ do_l2b_alloc: pd_entry_t *pl1pd, l1pd; pl1pd = &pmap->pm_l1->l1_kva[L1_IDX(va)]; - l1pd = l2b->l2b_phys | L1_C_DOM(pmap->pm_domain) | - L1_C_PROTO; + l1pd = l2b->l2b_phys | + L1_C_DOM(pmap->pm_domain) | L1_C_PROTO; if (*pl1pd != l1pd) { *pl1pd = l1pd; PTE_SYNC(pl1pd); @@ -2958,7 +2957,7 @@ pmap_change_wiring(pmap_t pmap, vm_offse { struct l2_bucket *l2b; pt_entry_t *ptep, pte; - vm_page_t pg; + vm_page_t m; rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); @@ -2966,9 +2965,9 @@ pmap_change_wiring(pmap_t pmap, vm_offse KASSERT(l2b, ("No l2b bucket in pmap_change_wiring")); ptep = &l2b->l2b_kva[l2pte_index(va)]; pte = *ptep; - pg = PHYS_TO_VM_PAGE(l2pte_pa(pte)); - if (pg) - pmap_modify_pv(pg, pmap, va, PVF_WIRED, wired); + m = PHYS_TO_VM_PAGE(l2pte_pa(pte)); + if (m != NULL) + pmap_modify_pv(m, pmap, va, PVF_WIRED, wired); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3179,7 +3178,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) struct pv_chunk *pc; struct l2_bucket *l2b = NULL; pmap_t pmap; - pt_entry_t *pt; + pt_entry_t *ptep; pv_entry_t pv; vm_offset_t va; vm_page_t free, m, m_pc; @@ -3227,13 +3226,13 @@ pmap_pv_reclaim(pmap_t locked_pmap) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu May 23 12:23:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23D13D6F; Thu, 23 May 2013 12:23:19 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 07798CB3; Thu, 23 May 2013 12:23:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NCNIk4092459; Thu, 23 May 2013 12:23:18 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NCNIjv092457; Thu, 23 May 2013 12:23:18 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305231223.r4NCNIjv092457@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 23 May 2013 12:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250930 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 12:23:19 -0000 Author: gber Date: Thu May 23 12:23:18 2013 New Revision: 250930 URL: http://svnweb.freebsd.org/changeset/base/250930 Log: Stop using PVF_MOD, PVF_REF & PVF_EXEC flags in pv_entry, use PTE. Using PVF_MOD, PVF_REF and PVF_EXEC is redundant as we can get the proper info from PTE bits. When the mapping is marked as executable and has been referenced we assume that it has been executed. Similarly, when the mapping is set to be writable and is referenced, it must have been due to write access to it. PVF_MOD and PVF_REF flags are kept just for pmap_clearbit() usage, to pass the information on which bit should be cleared. Submitted by: Zbigniew Bodek Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Thu May 23 12:15:23 2013 (r250929) +++ head/sys/arm/arm/pmap-v6.c Thu May 23 12:23:18 2013 (r250930) @@ -383,13 +383,13 @@ int pmap_needs_pte_sync; * Macro to determine if a mapping might be resident in the * instruction cache and/or TLB */ -#define PV_BEEN_EXECD(f) (((f) & (PVF_REF | PVF_EXEC)) == (PVF_REF | PVF_EXEC)) +#define PTE_BEEN_EXECD(pte) (L2_S_EXECUTABLE(pte) && L2_S_REFERENCED(pte)) /* * Macro to determine if a mapping might be resident in the * data cache and/or TLB */ -#define PV_BEEN_REFD(f) (((f) & PVF_REF) != 0) +#define PTE_BEEN_REFD(pte) (L2_S_REFERENCED(pte)) #ifndef PMAP_SHPGPERPROC #define PMAP_SHPGPERPROC 200 @@ -947,9 +947,9 @@ pmap_clearbit(struct vm_page *m, u_int m *ptep = npte; PTE_SYNC(ptep); /* Flush the TLB entry if a current pmap. */ - if (PV_BEEN_EXECD(oflags)) + if (PTE_BEEN_EXECD(opte)) cpu_tlb_flushID_SE(pv->pv_va); - else if (PV_BEEN_REFD(oflags)) + else if (PTE_BEEN_REFD(opte)) cpu_tlb_flushD_SE(pv->pv_va); } @@ -1358,7 +1358,6 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_ } vm_page_dirty(m); - pv->pv_flags |= PVF_REF | PVF_MOD; /* Re-enable write permissions for the page */ pmap_set_prot(ptep, VM_PROT_WRITE, *ptep & L2_S_PROT_U); @@ -1382,7 +1381,6 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_ goto out; vm_page_aflag_set(m, PGA_REFERENCED); - pv->pv_flags |= PVF_REF; /* Mark the page "referenced" */ *ptep = pte | L2_S_REF; @@ -2436,7 +2434,7 @@ pmap_remove_all(vm_page_t m) struct l2_bucket *l2b; boolean_t flush = FALSE; pmap_t curpmap; - int flags = 0; + u_int is_exec = 0; KASSERT((m->flags & PG_FICTITIOUS) == 0, ("pmap_remove_all: page %p is fictitious", m)); @@ -2455,19 +2453,19 @@ pmap_remove_all(vm_page_t m) l2b = pmap_get_l2_bucket(pmap, pv->pv_va); KASSERT(l2b != NULL, ("No l2 bucket")); ptep = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; + is_exec |= PTE_BEEN_EXECD(*ptep); *ptep = 0; if (pmap_is_current(pmap)) PTE_SYNC(ptep); pmap_free_l2_bucket(pmap, l2b, 1); pmap->pm_stats.resident_count--; - flags |= pv->pv_flags; pmap_nuke_pv(m, pmap, pv); pmap_free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); } if (flush) { - if (PV_BEEN_EXECD(flags)) + if (is_exec) cpu_tlb_flushID(); else cpu_tlb_flushD(); @@ -2545,7 +2543,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv struct l2_bucket *l2b; pt_entry_t *ptep, pte; vm_offset_t next_bucket; - u_int flags; + u_int is_exec, is_refd; int flush; if ((prot & VM_PROT_READ) == 0) { @@ -2570,7 +2568,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv */ flush = ((eva - sva) >= (PAGE_SIZE * 4)) ? 0 : -1; - flags = 0; + is_exec = is_refd = 0; while (sva < eva) { next_bucket = L2_NEXT_BUCKET(sva); @@ -2588,25 +2586,24 @@ pmap_protect(pmap_t pmap, vm_offset_t sv while (sva < next_bucket) { if ((pte = *ptep) != 0 && L2_S_WRITABLE(pte)) { struct vm_page *m; - u_int f; m = PHYS_TO_VM_PAGE(l2pte_pa(pte)); pmap_set_prot(ptep, prot, !(pmap == pmap_kernel())); PTE_SYNC(ptep); - f = pmap_modify_pv(m, pmap, sva, - PVF_WRITE, 0); + pmap_modify_pv(m, pmap, sva, PVF_WRITE, 0); if (flush >= 0) { flush++; - flags |= f; - } else - if (PV_BEEN_EXECD(f)) - cpu_tlb_flushID_SE(sva); - else - if (PV_BEEN_REFD(f)) - cpu_tlb_flushD_SE(sva); + is_exec |= PTE_BEEN_EXECD(pte); + is_refd |= PTE_BEEN_REFD(pte); + } else { + if (PTE_BEEN_EXECD(pte)) + cpu_tlb_flushID_SE(sva); + else if (PTE_BEEN_REFD(pte)) + cpu_tlb_flushD_SE(sva); + } } sva += PAGE_SIZE; @@ -2616,10 +2613,10 @@ pmap_protect(pmap_t pmap, vm_offset_t sv if (flush) { - if (PV_BEEN_EXECD(flags)) + if (is_exec) cpu_tlb_flushID(); else - if (PV_BEEN_REFD(flags)) + if (is_refd) cpu_tlb_flushD(); } rw_wunlock(&pvh_global_lock); @@ -2665,7 +2662,7 @@ pmap_enter_locked(pmap_t pmap, vm_offset struct pv_entry *pve = NULL; pt_entry_t *ptep, npte, opte; u_int nflags; - u_int oflags; + u_int is_exec, is_refd; vm_paddr_t pa; u_char user; @@ -2692,8 +2689,6 @@ pmap_enter_locked(pmap_t pmap, vm_offset if (prot & VM_PROT_WRITE) nflags |= PVF_WRITE; - if (prot & VM_PROT_EXECUTE) - nflags |= PVF_EXEC; if (wired) nflags |= PVF_WIRED; @@ -2725,7 +2720,8 @@ do_l2b_alloc: opte = *ptep; npte = pa; - oflags = 0; + is_exec = is_refd = 0; + if (opte) { /* * There is already a mapping at this address. @@ -2748,7 +2744,6 @@ do_l2b_alloc: * so no need to re-do referenced emulation here. */ npte |= L2_S_REF; - nflags |= PVF_REF; if (m != NULL && (m->oflags & VPO_UNMANAGED) == 0) @@ -2799,9 +2794,9 @@ do_l2b_alloc: /* * We're changing the attrs of an existing mapping. */ - oflags = pmap_modify_pv(m, pmap, va, - PVF_WRITE | PVF_EXEC | PVF_WIRED | - PVF_MOD | PVF_REF, nflags); + pmap_modify_pv(m, pmap, va, PVF_WRITE | PVF_WIRED, nflags); + is_exec |= PTE_BEEN_EXECD(opte); + is_refd |= PTE_BEEN_REFD(opte); } else { /* * New mapping, or changing the backing page @@ -2814,7 +2809,8 @@ do_l2b_alloc: * must remove it from the PV list */ if ((pve = pmap_remove_pv(om, pmap, va))) { - oflags = pve->pv_flags; + is_exec |= PTE_BEEN_EXECD(opte); + is_refd |= PTE_BEEN_REFD(opte); if (m && ((m->oflags & VPO_UNMANAGED))) pmap_free_pv_entry(pmap, pve); @@ -2877,9 +2873,9 @@ do_l2b_alloc: } } - if (PV_BEEN_EXECD(oflags)) + if (is_exec) cpu_tlb_flushID_SE(va); - else if (PV_BEEN_REFD(oflags)) + else if (is_refd) cpu_tlb_flushD_SE(va); } @@ -3488,8 +3484,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva pve = pmap_remove_pv(m, pmap, sva); if (pve) { - is_exec = PV_BEEN_EXECD(pve->pv_flags); - is_refd = PV_BEEN_REFD(pve->pv_flags); + is_exec = PTE_BEEN_EXECD(pte); + is_refd = PTE_BEEN_REFD(pte); pmap_free_pv_entry(pmap, pve); } } Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Thu May 23 12:15:23 2013 (r250929) +++ head/sys/arm/include/pmap.h Thu May 23 12:23:18 2013 (r250930) @@ -391,6 +391,7 @@ extern int pmap_needs_pte_sync; #define L2_S_REF (L2_AP0(1)) /* reference flag */ #define L2_S_PROT_MASK (L2_S_PROT_U|L2_S_PROT_R) +#define L2_S_EXECUTABLE(pte) (!(pte & L2_XN)) #define L2_S_WRITABLE(pte) (!(pte & L2_APX)) #define L2_S_REFERENCED(pte) (!!(pte & L2_S_REF)) From owner-svn-src-all@FreeBSD.ORG Thu May 23 12:24:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 381B7F02; Thu, 23 May 2013 12:24:47 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A35CCCA; Thu, 23 May 2013 12:24:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NCOkDM092732; Thu, 23 May 2013 12:24:46 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NCOksf092731; Thu, 23 May 2013 12:24:46 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305231224.r4NCOksf092731@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 23 May 2013 12:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250931 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 12:24:47 -0000 Author: gber Date: Thu May 23 12:24:46 2013 New Revision: 250931 URL: http://svnweb.freebsd.org/changeset/base/250931 Log: Rework and organize pmap_enter_locked() function. pmap_enter_locked() implementation was very ambiguous and confusing. Rearrange it so that each part of the mapping creation is separated. Avoid walking through the redundant conditions. Extract vector_page specific PTE setup from normal PTE setting. Submitted by: Zbigniew Bodek Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Thu May 23 12:23:18 2013 (r250930) +++ head/sys/arm/arm/pmap-v6.c Thu May 23 12:24:46 2013 (r250931) @@ -2723,38 +2723,54 @@ do_l2b_alloc: is_exec = is_refd = 0; if (opte) { - /* - * There is already a mapping at this address. - * If the physical address is different, lookup the - * vm_page. - */ - if (l2pte_pa(opte) != pa) - om = PHYS_TO_VM_PAGE(l2pte_pa(opte)); - else - om = m; - } else - om = NULL; - - if ((prot & (VM_PROT_ALL)) || !m) { - /* - * - The access type indicates that we don't need - * to do referenced emulation. - * OR - * - The physical page has already been referenced - * so no need to re-do referenced emulation here. - */ - npte |= L2_S_REF; + if (l2pte_pa(opte) == pa) { + /* + * We're changing the attrs of an existing mapping. + */ + if (m != NULL) + pmap_modify_pv(m, pmap, va, + PVF_WRITE | PVF_WIRED, nflags); + is_exec |= PTE_BEEN_EXECD(opte); + is_refd |= PTE_BEEN_REFD(opte); + goto validate; + } + if ((om = PHYS_TO_VM_PAGE(l2pte_pa(opte)))) { + /* + * Replacing an existing mapping with a new one. + * It is part of our managed memory so we + * must remove it from the PV list + */ + if ((pve = pmap_remove_pv(om, pmap, va))) { + is_exec |= PTE_BEEN_EXECD(opte); + is_refd |= PTE_BEEN_REFD(opte); + + if (m && ((m->oflags & VPO_UNMANAGED))) + pmap_free_pv_entry(pmap, pve); + } + } - if (m != NULL && - (m->oflags & VPO_UNMANAGED) == 0) - vm_page_aflag_set(m, PGA_REFERENCED); } else { /* - * Need to do page referenced emulation. + * Keep the stats up to date */ - npte &= ~L2_S_REF; + l2b->l2b_occupancy++; + pmap->pm_stats.resident_count++; } + /* + * Enter on the PV list if part of our managed memory. + */ + if ((m && !(m->oflags & VPO_UNMANAGED))) { + if ((!pve) && (pve = pmap_get_pv_entry(pmap, FALSE)) == NULL) + panic("pmap_enter: no pv entries"); + + KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, + ("pmap_enter: managed mapping within the clean submap")); + KASSERT(pve != NULL, ("No pv")); + pmap_enter_pv(m, pve, pmap, va, nflags); + } + +validate: /* Make the new PTE valid */ npte |= L2_S_PROTO; #ifdef SMP @@ -2763,78 +2779,48 @@ do_l2b_alloc: /* Set defaults first - kernel read access */ npte |= L2_APX; npte |= L2_S_PROT_R; + /* Set "referenced" flag */ + npte |= L2_S_REF; /* Now tune APs as desired */ if (user) npte |= L2_S_PROT_U; - - if (prot & VM_PROT_WRITE) { - npte &= ~(L2_APX); - - if (m != NULL && (m->oflags & VPO_UNMANAGED) == 0) { - vm_page_aflag_set(m, PGA_WRITEABLE); + /* + * If this is not a vector_page + * then continue setting mapping parameters + */ + if (m != NULL) { + if (prot & (VM_PROT_ALL)) { + if ((m->oflags & VPO_UNMANAGED) == 0) + vm_page_aflag_set(m, PGA_REFERENCED); + } else { /* - * The access type and permissions indicate - * that the page will be written as soon as returned - * from fault service. - * Mark it dirty from the outset. + * Need to do page referenced emulation. */ - if ((access & VM_PROT_WRITE) != 0) - vm_page_dirty(m); + npte &= ~L2_S_REF; } - } - - if (!(prot & VM_PROT_EXECUTE) && m) - npte |= L2_XN; - if (m && (m->md.pv_memattr != VM_MEMATTR_UNCACHEABLE)) - npte |= pte_l2_s_cache_mode; + if (prot & VM_PROT_WRITE) { + /* Write enable */ + npte &= ~(L2_APX); - if (m && m == om) { - /* - * We're changing the attrs of an existing mapping. - */ - pmap_modify_pv(m, pmap, va, PVF_WRITE | PVF_WIRED, nflags); - is_exec |= PTE_BEEN_EXECD(opte); - is_refd |= PTE_BEEN_REFD(opte); - } else { - /* - * New mapping, or changing the backing page - * of an existing mapping. - */ - if (om) { - /* - * Replacing an existing mapping with a new one. - * It is part of our managed memory so we - * must remove it from the PV list - */ - if ((pve = pmap_remove_pv(om, pmap, va))) { - is_exec |= PTE_BEEN_EXECD(opte); - is_refd |= PTE_BEEN_REFD(opte); - - if (m && ((m->oflags & VPO_UNMANAGED))) - pmap_free_pv_entry(pmap, pve); + if ((m->oflags & VPO_UNMANAGED) == 0) { + vm_page_aflag_set(m, PGA_WRITEABLE); + /* + * The access type and permissions indicate + * that the page will be written as soon as + * returned from fault service. + * Mark it dirty from the outset. + */ + if ((access & VM_PROT_WRITE) != 0) + vm_page_dirty(m); } } + if (!(prot & VM_PROT_EXECUTE)) + npte |= L2_XN; - if ((m && !(m->oflags & VPO_UNMANAGED))) { - if ((!pve) && - (pve = pmap_get_pv_entry(pmap, FALSE)) == NULL) - panic("pmap_enter: no pv entries"); - - KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, - ("pmap_enter: managed mapping within the clean submap")); - KASSERT(pve != NULL, ("No pv")); - pmap_enter_pv(m, pve, pmap, va, nflags); - } - } - - /* - * Keep the stats up to date - */ - if (opte == 0) { - l2b->l2b_occupancy++; - pmap->pm_stats.resident_count++; + if (m->md.pv_memattr != VM_MEMATTR_UNCACHEABLE) + npte |= pte_l2_s_cache_mode; } CTR5(KTR_PMAP,"enter: pmap:%p va:%x prot:%x pte:%x->%x", From owner-svn-src-all@FreeBSD.ORG Thu May 23 15:41:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC903240; Thu, 23 May 2013 15:41:09 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEC45C2F; Thu, 23 May 2013 15:41:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NFf9YN062578; Thu, 23 May 2013 15:41:09 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NFf9x1062577; Thu, 23 May 2013 15:41:09 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <201305231541.r4NFf9x1062577@svn.freebsd.org> From: Jens Schweikhardt Date: Thu, 23 May 2013 15:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250935 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 15:41:09 -0000 Author: schweikh Date: Thu May 23 15:41:09 2013 New Revision: 250935 URL: http://svnweb.freebsd.org/changeset/base/250935 Log: Correct typo s/with/wish. Spaces to tabs at SOL while I'm here. Modified: stable/9/UPDATING Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Thu May 23 14:37:08 2013 (r250934) +++ stable/9/UPDATING Thu May 23 15:41:09 2013 (r250935) @@ -24,7 +24,7 @@ Items affecting the ports and packages s Due to the use of the new -l option to install(1) during build and install, you must take care not to directly set the INSTALL make variable in your /etc/make.conf, /etc/src.conf, or on the - command line. If you with to use the -C flag for all installs + command line. If you wish to use the -C flag for all installs you may be able to add INSTALL+=-C to /etc/make.conf or /etc/src.conf. @@ -68,8 +68,8 @@ Items affecting the ports and packages s pools. The first two read-only compatible "feature flags" for ZFS pools are "com.delphix:async_destroy" and "com.delphix:empty_bpobj". For more information read the new zpool-features(7) manual page. - Please refer to the "ZFS notes" section of this file for information - on upgrading boot ZFS pools. + Please refer to the "ZFS notes" section of this file for information + on upgrading boot ZFS pools. 20121114: The commit introducing bsd.compiler.mk breaks the traditional From owner-svn-src-all@FreeBSD.ORG Thu May 23 16:37:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 726AD293; Thu, 23 May 2013 16:37:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63D2DF57; Thu, 23 May 2013 16:37:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NGbidp082644; Thu, 23 May 2013 16:37:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NGbi4c082643; Thu, 23 May 2013 16:37:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305231637.r4NGbi4c082643@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 23 May 2013 16:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250936 - head/sys/dev/tws X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 16:37:44 -0000 Author: kib Date: Thu May 23 16:37:43 2013 New Revision: 250936 URL: http://svnweb.freebsd.org/changeset/base/250936 Log: Fix typo in the definition of the TWS_DATA_CCB. Submitted by: Andreas Turriff Modified: head/sys/dev/tws/tws.h Modified: head/sys/dev/tws/tws.h ============================================================================== --- head/sys/dev/tws/tws.h Thu May 23 15:41:09 2013 (r250935) +++ head/sys/dev/tws/tws.h Thu May 23 16:37:43 2013 (r250936) @@ -137,7 +137,7 @@ enum tws_req_flags { TWS_DIR_IN = 0x2, TWS_DIR_OUT = 0x4, TWS_DIR_NONE = 0x8, - TWS_DATA_CCB = 0x16, + TWS_DATA_CCB = 0x10, }; enum tws_intrs { From owner-svn-src-all@FreeBSD.ORG Thu May 23 16:39:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF8B455A; Thu, 23 May 2013 16:39:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B15CFF87; Thu, 23 May 2013 16:39:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NGdhTQ083167; Thu, 23 May 2013 16:39:43 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NGdhDB083160; Thu, 23 May 2013 16:39:43 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201305231639.r4NGdhDB083160@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 23 May 2013 16:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250937 - stable/9/gnu/usr.bin/grep X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 16:39:43 -0000 Author: pfg Date: Thu May 23 16:39:42 2013 New Revision: 250937 URL: http://svnweb.freebsd.org/changeset/base/250937 Log: MFC r250823: grep: change some int types. Change several int variables to size_t, ssize_t, or ptrdiff_t. This should fix the bug described in CVE-2012-5667 when an input line is so long that its length cannot be stored in an int variable. Obtained from: NetBSD Modified: stable/9/gnu/usr.bin/grep/dfa.c stable/9/gnu/usr.bin/grep/grep.c stable/9/gnu/usr.bin/grep/search.c Directory Properties: stable/9/ (props changed) Modified: stable/9/gnu/usr.bin/grep/dfa.c ============================================================================== --- stable/9/gnu/usr.bin/grep/dfa.c Thu May 23 16:37:43 2013 (r250936) +++ stable/9/gnu/usr.bin/grep/dfa.c Thu May 23 16:39:42 2013 (r250937) @@ -334,9 +334,10 @@ static int hard_LC_COLLATE; /* Nonzero i #ifdef MBS_SUPPORT /* These variables are used only if (MB_CUR_MAX > 1). */ static mbstate_t mbs; /* Mbstate for mbrlen(). */ -static int cur_mb_len; /* Byte length of the current scanning - multibyte character. */ -static int cur_mb_index; /* Byte index of the current scanning multibyte +static ssize_t cur_mb_len; /* Byte length of the current scanning + multibyte character. Must also handle + negative result from mbrlen(). */ +static ssize_t cur_mb_index; /* Byte index of the current scanning multibyte character. singlebyte character : cur_mb_index = 0 @@ -369,7 +370,7 @@ static unsigned char const *buf_end; /* /* This function update cur_mb_len, and cur_mb_index. p points current lexptr, len is the remaining buffer length. */ static void -update_mb_len_index (unsigned char const *p, int len) +update_mb_len_index (unsigned char const *p, size_t len) { /* If last character is a part of a multibyte character, we update cur_mb_index. */ @@ -2463,7 +2464,7 @@ match_mb_charset (struct dfa *d, int s, int match; /* Flag which represent that matching succeed. */ int match_len; /* Length of the character (or collating element) with which this operator match. */ - int op_len; /* Length of the operator. */ + size_t op_len; /* Length of the operator. */ char buffer[128]; wchar_t wcbuf[6]; Modified: stable/9/gnu/usr.bin/grep/grep.c ============================================================================== --- stable/9/gnu/usr.bin/grep/grep.c Thu May 23 16:37:43 2013 (r250936) +++ stable/9/gnu/usr.bin/grep/grep.c Thu May 23 16:39:42 2013 (r250937) @@ -1346,9 +1346,9 @@ int main (int argc, char **argv) { char *keys; - size_t keycc, oldcc, keyalloc; + size_t cc, keycc, oldcc, keyalloc; int with_filenames; - int opt, cc, status; + int opt, status; int default_context; FILE *fp; extern char *optarg; Modified: stable/9/gnu/usr.bin/grep/search.c ============================================================================== --- stable/9/gnu/usr.bin/grep/search.c Thu May 23 16:37:43 2013 (r250936) +++ stable/9/gnu/usr.bin/grep/search.c Thu May 23 16:39:42 2013 (r250937) @@ -112,7 +112,7 @@ static void kwsinit (void) { static char trans[NCHAR]; - int i; + size_t i; if (match_icase) for (i = 0; i < NCHAR; ++i) @@ -326,7 +326,8 @@ EGexecute (char const *buf, size_t size, { register char const *buflim, *beg, *end; char eol = eolbyte; - int backref, start, len; + int backref; + ptrdiff_t start, len; struct kwsmatch kwsm; size_t i, ret_val; static int use_dfa; From owner-svn-src-all@FreeBSD.ORG Thu May 23 18:07:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 55EF4779; Thu, 23 May 2013 18:07:03 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47AB9760; Thu, 23 May 2013 18:07:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NI73sB015209; Thu, 23 May 2013 18:07:03 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NI72P9015201; Thu, 23 May 2013 18:07:02 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305231807.r4NI72P9015201@svn.freebsd.org> From: Ed Schouten Date: Thu, 23 May 2013 18:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250938 - in head: lib/libc/iconv usr.bin/iconv usr.bin/mkcsmapper usr.bin/mkesdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 18:07:03 -0000 Author: ed Date: Thu May 23 18:07:01 2013 New Revision: 250938 URL: http://svnweb.freebsd.org/changeset/base/250938 Log: Let iconv build on -HEAD properly. - Add NO_WMISSING_VARIABLE_DECLARATIONS where we use Yacc/Lex. - Add variable declarations where possible. - Add missing static keyword. Modified: head/lib/libc/iconv/citrus_iconv_local.h head/lib/libc/iconv/citrus_mapper_local.h head/lib/libc/iconv/citrus_stdenc_local.h head/usr.bin/iconv/iconv.c head/usr.bin/mkcsmapper/Makefile head/usr.bin/mkesdb/Makefile Modified: head/lib/libc/iconv/citrus_iconv_local.h ============================================================================== --- head/lib/libc/iconv/citrus_iconv_local.h Thu May 23 16:39:42 2013 (r250937) +++ head/lib/libc/iconv/citrus_iconv_local.h Thu May 23 18:07:01 2013 (r250938) @@ -57,6 +57,7 @@ static void _citrus_##_m_##_iconv_unini #define _CITRUS_ICONV_DEF_OPS(_m_) \ +extern struct _citrus_iconv_ops _citrus_##_m_##_iconv_ops; \ struct _citrus_iconv_ops _citrus_##_m_##_iconv_ops = { \ /* io_init_shared */ &_citrus_##_m_##_iconv_init_shared, \ /* io_uninit_shared */ &_citrus_##_m_##_iconv_uninit_shared, \ Modified: head/lib/libc/iconv/citrus_mapper_local.h ============================================================================== --- head/lib/libc/iconv/citrus_mapper_local.h Thu May 23 16:39:42 2013 (r250937) +++ head/lib/libc/iconv/citrus_mapper_local.h Thu May 23 18:07:01 2013 (r250938) @@ -52,6 +52,7 @@ static void _citrus_##_m_##_mapper_init (void); #define _CITRUS_MAPPER_DEF_OPS(_m_) \ +extern struct _citrus_mapper_ops _citrus_##_m_##_mapper_ops; \ struct _citrus_mapper_ops _citrus_##_m_##_mapper_ops = { \ /* mo_init */ &_citrus_##_m_##_mapper_init, \ /* mo_uninit */ &_citrus_##_m_##_mapper_uninit, \ Modified: head/lib/libc/iconv/citrus_stdenc_local.h ============================================================================== --- head/lib/libc/iconv/citrus_stdenc_local.h Thu May 23 16:39:42 2013 (r250937) +++ head/lib/libc/iconv/citrus_stdenc_local.h Thu May 23 18:07:01 2013 (r250938) @@ -84,6 +84,7 @@ static int _citrus_##_e_##_stdenc_get_s struct _citrus_stdenc_state_desc * __restrict) #define _CITRUS_STDENC_DEF_OPS(_e_) \ +extern struct _citrus_stdenc_ops _citrus_##_e_##_stdenc_ops; \ struct _citrus_stdenc_ops _citrus_##_e_##_stdenc_ops = { \ /* eo_init */ &_citrus_##_e_##_stdenc_init, \ /* eo_uninit */ &_citrus_##_e_##_stdenc_uninit, \ Modified: head/usr.bin/iconv/iconv.c ============================================================================== --- head/usr.bin/iconv/iconv.c Thu May 23 16:39:42 2013 (r250937) +++ head/usr.bin/iconv/iconv.c Thu May 23 18:07:01 2013 (r250938) @@ -47,8 +47,7 @@ static void do_conv(FILE *, const char static int do_list(unsigned int, const char * const *, void *); static void usage(void); -struct option long_options[] = -{ +static struct option long_options[] = { {"from-code", required_argument, NULL, 'f'}, {"list", no_argument, NULL, 'l'}, {"silent", no_argument, NULL, 's'}, Modified: head/usr.bin/mkcsmapper/Makefile ============================================================================== --- head/usr.bin/mkcsmapper/Makefile Thu May 23 16:39:42 2013 (r250937) +++ head/usr.bin/mkcsmapper/Makefile Thu May 23 18:07:01 2013 (r250938) @@ -5,5 +5,7 @@ PROG= mkcsmapper LDFLAGS+= -L${.CURDIR}/../../lib/libc +NO_WMISSING_VARIABLE_DECLARATIONS= + .include "${.CURDIR}/Makefile.inc" .include Modified: head/usr.bin/mkesdb/Makefile ============================================================================== --- head/usr.bin/mkesdb/Makefile Thu May 23 16:39:42 2013 (r250937) +++ head/usr.bin/mkesdb/Makefile Thu May 23 18:07:01 2013 (r250938) @@ -5,5 +5,7 @@ PROG= mkesdb LDFLAGS+= -L${.OBJDIR}/../../lib/libc +NO_WMISSING_VARIABLE_DECLARATIONS= + .include "${.CURDIR}/Makefile.inc" .include From owner-svn-src-all@FreeBSD.ORG Thu May 23 19:47:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2BECE8BB; Thu, 23 May 2013 19:47:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E54ED2D; Thu, 23 May 2013 19:47:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NJlaLO051225; Thu, 23 May 2013 19:47:36 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NJlZF6051224; Thu, 23 May 2013 19:47:35 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305231947.r4NJlZF6051224@svn.freebsd.org> From: Mark Johnston Date: Thu, 23 May 2013 19:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250939 - head/usr.sbin/rtsold X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 19:47:36 -0000 Author: markj Date: Thu May 23 19:47:35 2013 New Revision: 250939 URL: http://svnweb.freebsd.org/changeset/base/250939 Log: Correct the description of the -a option: rtsol(d) -a will in fact send out router solicitations on multiple interfaces. Reviewed by: hrs MFC after: 1 week Modified: head/usr.sbin/rtsold/rtsold.8 Modified: head/usr.sbin/rtsold/rtsold.8 ============================================================================== --- head/usr.sbin/rtsold/rtsold.8 Thu May 23 18:07:01 2013 (r250938) +++ head/usr.sbin/rtsold/rtsold.8 Thu May 23 19:47:35 2013 (r250939) @@ -163,13 +163,8 @@ The options are as follows: .It Fl a Autoprobe outgoing interface. .Nm -will try to find a non-loopback, non-point-to-point, IPv6-capable interface. -If -.Nm -finds multiple interfaces, -.Nm -will exit with error. -.\" +will try to find non-loopback, non-point-to-point, IPv6-capable interfaces +and send router solicitation messages on all of them. .It Fl d Enable debugging. .It Fl D From owner-svn-src-all@FreeBSD.ORG Thu May 23 19:47:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 457908BD; Thu, 23 May 2013 19:47:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E329D2F; Thu, 23 May 2013 19:47:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NJlbuv051274; Thu, 23 May 2013 19:47:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NJlb0P051273; Thu, 23 May 2013 19:47:37 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305231947.r4NJlb0P051273@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 23 May 2013 19:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250940 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 19:47:38 -0000 Author: marcel Date: Thu May 23 19:47:37 2013 New Revision: 250940 URL: http://svnweb.freebsd.org/changeset/base/250940 Log: Change the copyright notice to a standard BSD 2-clause license and assign ownership to the FreeBSD foundation for the years this file has been in the FreeBSD repository. This file was originally created by Juniper as part of upgrading to FreeBSD 4.10 (which had no MIPS support) and held functions found on other machines It grew actual functionality over time. The functionaliy was copied from other architectures and ported to MIPS on a as-needed basis. Approved by: Mark Baushke (Juniper IP) Approved by: Megan Sugiyama (Juniper legal) Pointed out by: jmallett@ Requested by: core (jhb@) Modified: head/sys/mips/mips/db_trace.c Modified: head/sys/mips/mips/db_trace.c ============================================================================== --- head/sys/mips/mips/db_trace.c Thu May 23 19:47:35 2013 (r250939) +++ head/sys/mips/mips/db_trace.c Thu May 23 19:47:37 2013 (r250940) @@ -1,7 +1,29 @@ /*- + * Copyright (c) 2008-2013 The FreeBSD Foundation * Copyright (c) 2004-2005, Juniper Networks, Inc. * 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. + * * JNPR: db_trace.c,v 1.8 2007/08/09 11:23:32 katta */ From owner-svn-src-all@FreeBSD.ORG Thu May 23 19:50:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8D23BD00; Thu, 23 May 2013 19:50:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7F974D74; Thu, 23 May 2013 19:50:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NJoaSW052382; Thu, 23 May 2013 19:50:36 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NJoaQM052348; Thu, 23 May 2013 19:50:36 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305231950.r4NJoaQM052348@svn.freebsd.org> From: Mark Johnston Date: Thu, 23 May 2013 19:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250941 - head/usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 19:50:36 -0000 Author: markj Date: Thu May 23 19:50:36 2013 New Revision: 250941 URL: http://svnweb.freebsd.org/changeset/base/250941 Log: Include descriptions of the flags and fields printed when dumping the IPv6 prefix list. Reviewed by: hrs MFC after: 1 week Modified: head/usr.sbin/ndp/ndp.8 Modified: head/usr.sbin/ndp/ndp.8 ============================================================================== --- head/usr.sbin/ndp/ndp.8 Thu May 23 19:47:37 2013 (r250940) +++ head/usr.sbin/ndp/ndp.8 Thu May 23 19:50:36 2013 (r250941) @@ -222,6 +222,36 @@ Specify the Cur Hop Limit on the interfa Do not try to resolve numeric addresses to hostnames. .It Fl p Show prefix list. +The following information will be printed: +.Bl -tag -width indent +.It Cm if +The network interface associated with this prefix. +.It Cm flags +The status of the prefix, expressed by a combination of the following +letters: +.Pp +.Bl -tag -width indent -compact +.It Cm A +This prefix can be used for stateless address autoconfiguration. +.It Cm L, Cm O +This prefix can be used for on-link determination; that is, it can be +used to determine whether a given destination address is on-link. +.It Cm D +There are no reachable routers advertising this prefix. +.El +.It Cm vltime +Valid lifetime; the length of time for which the prefix and a stateless +autoconfigured address generated from this prefix can be used for the +source or destination address of a packet. +.It Cm pltime +Preferred lifetime; the length of time for which the prefix and a stateless +autoconfigured address generated from this prefix can be used by upper-layer +protocols unrestrictedly. +.It Cm expire +This is the remaining time that the prefix is in the valid state. +.It Cm ref +The number of kernel references held for this prefix. +.El .It Fl P Flush all the entries in the prefix list. .It Fl r From owner-svn-src-all@FreeBSD.ORG Thu May 23 19:53:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 74809EA3 for ; Thu, 23 May 2013 19:53:00 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [IPv6:2a00:1450:4010:c03::234]) by mx1.freebsd.org (Postfix) with ESMTP id F333FD8E for ; Thu, 23 May 2013 19:52:59 +0000 (UTC) Received: by mail-la0-f52.google.com with SMTP id fo13so3663270lab.39 for ; Thu, 23 May 2013 12:52:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=99hnOzDcNZtEFF/01QstArmGS2jaQOy92vyXXDm1JIk=; b=FU0f6Encvj0S9M+Sy9VKJNOxdyGLHU1IhECaOwDDjxbl5tUuivZEPi1dkFnx4cLqDm +mC01aACpOPczGsiSOepCgDmbAaVAKvrqkYtcaK8ecRRteojpOnlRZ9giyKtjN6/2rtF vgaaxX0SxU8roo1WXz+FLY3gA276/lM3t+Xf81msN8mYbWDViEKt87z4TkOTYsIYMtfF XO7A7LZ6cHXFG0KwTsHBAzpiH73UD4zC7f619V4NaUT8jdEb8Bly+PRjB44O6DA9LPnu LV8FwE9lQG+MPZYrkTJb7BXiB/ARXzVLWvv43x50xKj+XHvE9QQrIuM8/jifp0mOy8qb vudw== X-Received: by 10.112.180.232 with SMTP id dr8mr7296344lbc.67.1369338778844; Thu, 23 May 2013 12:52:58 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.129.195 with HTTP; Thu, 23 May 2013 12:52:38 -0700 (PDT) In-Reply-To: <201305231947.r4NJlb0P051273@svn.freebsd.org> References: <201305231947.r4NJlb0P051273@svn.freebsd.org> From: Juli Mallett Date: Thu, 23 May 2013 12:52:38 -0700 X-Google-Sender-Auth: l8LTxC235FczAtIqrhJxGgGaVYU Message-ID: Subject: Re: svn commit: r250940 - head/sys/mips/mips To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnnO3PuDeZ1yJ21Jim4b/u9pFHbZ4TEOGYWcCSXm4Y3E54g/NvzF5J9aBcxLCWruRS94I6S Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 19:53:00 -0000 Thanks very much, Marcel, and everyone involved at Juniper! On Thu, May 23, 2013 at 12:47 PM, Marcel Moolenaar wrote: > Author: marcel > Date: Thu May 23 19:47:37 2013 > New Revision: 250940 > URL: http://svnweb.freebsd.org/changeset/base/250940 > > Log: > Change the copyright notice to a standard BSD 2-clause license and assign > ownership to the FreeBSD foundation for the years this file has been in > the FreeBSD repository. > > This file was originally created by Juniper as part of upgrading to FreeBSD > 4.10 (which had no MIPS support) and held functions found on other machines > It grew actual functionality over time. The functionaliy was copied from > other architectures and ported to MIPS on a as-needed basis. > > Approved by: Mark Baushke (Juniper IP) > Approved by: Megan Sugiyama (Juniper legal) > Pointed out by: jmallett@ > Requested by: core (jhb@) > > Modified: > head/sys/mips/mips/db_trace.c > > Modified: head/sys/mips/mips/db_trace.c > ============================================================================== > --- head/sys/mips/mips/db_trace.c Thu May 23 19:47:35 2013 (r250939) > +++ head/sys/mips/mips/db_trace.c Thu May 23 19:47:37 2013 (r250940) > @@ -1,7 +1,29 @@ > /*- > + * Copyright (c) 2008-2013 The FreeBSD Foundation > * Copyright (c) 2004-2005, Juniper Networks, Inc. > * 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. > + * > * JNPR: db_trace.c,v 1.8 2007/08/09 11:23:32 katta > */ > From owner-svn-src-all@FreeBSD.ORG Thu May 23 20:52:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 13189FD4; Thu, 23 May 2013 20:52:31 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04DD5FBF; Thu, 23 May 2013 20:52:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NKqUV1076254; Thu, 23 May 2013 20:52:30 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NKqUcx076252; Thu, 23 May 2013 20:52:30 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201305232052.r4NKqUcx076252@svn.freebsd.org> From: Guy Helmer Date: Thu, 23 May 2013 20:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250942 - head/usr.bin/getent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 20:52:31 -0000 Author: ghelmer Date: Thu May 23 20:52:30 2013 New Revision: 250942 URL: http://svnweb.freebsd.org/changeset/base/250942 Log: Add support for netgroup, based on patch in the PR but made consistent with existing style. PR: bin/132692 Modified: head/usr.bin/getent/getent.c Modified: head/usr.bin/getent/getent.c ============================================================================== --- head/usr.bin/getent/getent.c Thu May 23 19:50:36 2013 (r250941) +++ head/usr.bin/getent/getent.c Thu May 23 20:52:30 2013 (r250942) @@ -61,6 +61,7 @@ static int parsenum(const char *, unsign static int ethers(int, char *[]); static int group(int, char *[]); static int hosts(int, char *[]); +static int netgroup(int, char *[]); static int networks(int, char *[]); static int passwd(int, char *[]); static int protocols(int, char *[]); @@ -89,6 +90,7 @@ static struct getentdb { { "rpc", rpc, }, { "services", services, }, { "shells", shells, }, + { "netgroup", netgroup, }, { "utmpx", utmpx, }, { NULL, NULL, }, @@ -571,6 +573,47 @@ shells(int argc, char *argv[]) } /* + * netgroup + */ +static int +netgroup(int argc, char *argv[]) +{ + char *host, *user, *domain; + int first; + int rv, i; + + assert(argc > 1); + assert(argv != NULL); + +#define NETGROUPPRINT(s) (((s) != NULL) ? (s) : "") + + rv = RV_OK; + if (argc == 2) { + fprintf(stderr, "Enumeration not supported on netgroup\n"); + rv = RV_NOENUM; + } else { + for (i = 2; i < argc; i++) { + setnetgrent(argv[i]); + first = 1; + while (getnetgrent(&host, &user, &domain) != 0) { + if (first) { + first = 0; + (void)fputs(argv[i], stdout); + } + (void)printf(" (%s,%s,%s)", + NETGROUPPRINT(host), + NETGROUPPRINT(user), + NETGROUPPRINT(domain)); + } + if (!first) + (void)putchar('\n'); + endnetgrent(); + } + } + return rv; +} + +/* * utmpx */ From owner-svn-src-all@FreeBSD.ORG Thu May 23 20:57:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6B2C247E; Thu, 23 May 2013 20:57:21 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DE9985; Thu, 23 May 2013 20:57:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NKvLGx077331; Thu, 23 May 2013 20:57:21 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NKvLtB077330; Thu, 23 May 2013 20:57:21 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201305232057.r4NKvLtB077330@svn.freebsd.org> From: Stefan Esser Date: Thu, 23 May 2013 20:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250943 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 20:57:21 -0000 Author: se Date: Thu May 23 20:57:20 2013 New Revision: 250943 URL: http://svnweb.freebsd.org/changeset/base/250943 Log: Fix target selection logic, which did not comply with the man page. Instead of using the file with the least order of path name components, shortest filename and finally the shortest basename (with the search stopping as soon as one of these conditions is true), the first filename checked was used as the reference, and another filename was only selected if all of the above comparisons are in favour of the latter file. This was wrong, because filenames with path less components were only considered, if both of the other conditions were true as well. In fact, the first filename to be checked had good chances to be selected in the end, since it only needed to be better with regard to any one of the three criteria ... Reviewed by: delphij@freebsd.org Modified: head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Thu May 23 20:52:30 2013 (r250942) +++ head/usr.bin/patch/pch.c Thu May 23 20:57:20 2013 (r250943) @@ -1537,10 +1537,16 @@ best_name(const struct file_name *names, continue; if ((tmp = num_components(names[i].path)) > min_components) continue; - min_components = tmp; + if (tmp < min_components) { + min_components = tmp; + best = names[i].path; + } if ((tmp = strlen(basename(names[i].path))) > min_baselen) continue; - min_baselen = tmp; + if (tmp < min_baselen) { + min_baselen = tmp; + best = names[i].path; + } if ((tmp = strlen(names[i].path)) > min_len) continue; min_len = tmp; From owner-svn-src-all@FreeBSD.ORG Thu May 23 21:07:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3768A82F; Thu, 23 May 2013 21:07:27 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2169113E; Thu, 23 May 2013 21:07:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NL7RQW081146; Thu, 23 May 2013 21:07:27 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NL7Q5x081145; Thu, 23 May 2013 21:07:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201305232107.r4NL7Q5x081145@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 May 2013 21:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250944 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 21:07:27 -0000 Author: pjd Date: Thu May 23 21:07:26 2013 New Revision: 250944 URL: http://svnweb.freebsd.org/changeset/base/250944 Log: Use proper malloc type for ioctls white-list. Reported by: pho Tested by: pho Modified: head/sys/kern/sys_capability.c Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Thu May 23 20:57:20 2013 (r250943) +++ head/sys/kern/sys_capability.c Thu May 23 21:07:26 2013 (r250944) @@ -144,6 +144,8 @@ sys_cap_getmode(struct thread *td, struc FEATURE(security_capabilities, "Capsicum Capabilities"); +MALLOC_DECLARE(M_FILECAPS); + static inline int _cap_check(cap_rights_t have, cap_rights_t need, enum ktr_cap_fail_type type) { @@ -229,7 +231,7 @@ sys_cap_rights_limit(struct thread *td, if (error == 0) { fdp->fd_ofiles[fd].fde_rights = rights; if ((rights & CAP_IOCTL) == 0) { - free(fdp->fd_ofiles[fd].fde_ioctls, M_TEMP); + free(fdp->fd_ofiles[fd].fde_ioctls, M_FILECAPS); fdp->fd_ofiles[fd].fde_ioctls = NULL; fdp->fd_ofiles[fd].fde_nioctls = 0; } @@ -344,10 +346,10 @@ sys_cap_ioctls_limit(struct thread *td, if (ncmds == 0) { cmds = NULL; } else { - cmds = malloc(sizeof(cmds[0]) * ncmds, M_TEMP, M_WAITOK); + cmds = malloc(sizeof(cmds[0]) * ncmds, M_FILECAPS, M_WAITOK); error = copyin(uap->cmds, cmds, sizeof(cmds[0]) * ncmds); if (error != 0) { - free(cmds, M_TEMP); + free(cmds, M_FILECAPS); return (error); } } @@ -372,7 +374,7 @@ sys_cap_ioctls_limit(struct thread *td, error = 0; out: FILEDESC_XUNLOCK(fdp); - free(cmds, M_TEMP); + free(cmds, M_FILECAPS); return (error); } @@ -548,7 +550,7 @@ sys_cap_new(struct thread *td, struct ca */ fdp->fd_ofiles[newfd].fde_rights = rights; if ((rights & CAP_IOCTL) == 0) { - free(fdp->fd_ofiles[newfd].fde_ioctls, M_TEMP); + free(fdp->fd_ofiles[newfd].fde_ioctls, M_FILECAPS); fdp->fd_ofiles[newfd].fde_ioctls = NULL; fdp->fd_ofiles[newfd].fde_nioctls = 0; } From owner-svn-src-all@FreeBSD.ORG Thu May 23 21:33:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5FA0F05; Thu, 23 May 2013 21:33:11 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98F86248; Thu, 23 May 2013 21:33:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NLXAR4091166; Thu, 23 May 2013 21:33:10 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NLXAGp091165; Thu, 23 May 2013 21:33:10 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201305232133.r4NLXAGp091165@svn.freebsd.org> From: Guy Helmer Date: Thu, 23 May 2013 21:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250945 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 21:33:11 -0000 Author: ghelmer Date: Thu May 23 21:33:10 2013 New Revision: 250945 URL: http://svnweb.freebsd.org/changeset/base/250945 Log: While waiting for the bpf hold buffer to become idle, check the return value from mtx_sleep() and exit bpfread() on errors such as EINTR. Reviewed by: jhb Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Thu May 23 21:07:26 2013 (r250944) +++ head/sys/net/bpf.c Thu May 23 21:33:10 2013 (r250945) @@ -856,9 +856,14 @@ bpfread(struct cdev *dev, struct uio *ui callout_stop(&d->bd_callout); timed_out = (d->bd_state == BPF_TIMED_OUT); d->bd_state = BPF_IDLE; - while (d->bd_hbuf_in_use) - mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + while (d->bd_hbuf_in_use) { + error = mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, PRINET|PCATCH, "bd_hbuf", 0); + if (error != 0) { + BPFD_UNLOCK(d); + return (error); + } + } /* * If the hold buffer is empty, then do a timed sleep, which * ends when the timeout expires or when enough packets From owner-svn-src-all@FreeBSD.ORG Thu May 23 21:37:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 904D3191; Thu, 23 May 2013 21:37:23 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id 4B221276; Thu, 23 May 2013 21:37:23 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id AD56025D3A05; Thu, 23 May 2013 21:37:21 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id CC67ABE8578; Thu, 23 May 2013 21:37:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id dY3w9d9a6SNY; Thu, 23 May 2013 21:37:19 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 64E1BBE8577; Thu, 23 May 2013 21:37:19 +0000 (UTC) Date: Thu, 23 May 2013 21:37:18 +0000 (UTC) From: "Bjoern A. Zeeb" To: Michael Tuexen Subject: Re: svn commit: r250809 - head/sys/netinet In-Reply-To: <201305191606.r4JG6hNR032154@svn.freebsd.org> Message-ID: References: <201305191606.r4JG6hNR032154@svn.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 21:37:23 -0000 On Sun, 19 May 2013, Michael Tuexen wrote: > Author: tuexen > Date: Sun May 19 16:06:43 2013 > New Revision: 250809 > URL: http://svnweb.freebsd.org/changeset/base/250809 > > Log: > Initialize the fibnum for outgoing packets to 0. This avoids > crashing due to the usage of uninitialized fibnum. > This bugs became visiable after > http://svnweb.freebsd.org/changeset/base/250700 That just masks the real bug, please back it out. > MFC after: 2 weeks > > Modified: > head/sys/netinet/sctp_os_bsd.h > > Modified: head/sys/netinet/sctp_os_bsd.h > ============================================================================== > --- head/sys/netinet/sctp_os_bsd.h Sun May 19 15:26:15 2013 (r250808) > +++ head/sys/netinet/sctp_os_bsd.h Sun May 19 16:06:43 2013 (r250809) > @@ -435,6 +435,7 @@ typedef struct rtentry sctp_rtentry_t; > { \ > int o_flgs = IP_RAWOUTPUT; \ > struct sctp_tcb *local_stcb = stcb; \ > + M_SETFIB(o_pak, 0); \ > if (local_stcb && \ > local_stcb->sctp_ep && \ > local_stcb->sctp_ep->sctp_socket) \ > @@ -445,6 +446,7 @@ typedef struct rtentry sctp_rtentry_t; > #define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \ > { \ > struct sctp_tcb *local_stcb = stcb; \ > + M_SETFIB(o_pak, 0); \ > if (local_stcb && local_stcb->sctp_ep) \ > result = ip6_output(o_pak, \ > ((struct in6pcb *)(local_stcb->sctp_ep))->in6p_outputopts, \ > -- Bjoern A. Zeeb ????????? ??? ??????? ??????: '??? ??? ???? ?????? ??????? ?? ?? ??????? ??????? ??? ????? ????? ???? ?????? ?? ????? ????', ????????? ?????????, "??? ????? ?? ?????", ?.??? From owner-svn-src-all@FreeBSD.ORG Thu May 23 22:45:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B7C0D2CF; Thu, 23 May 2013 22:45:59 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9874B6D0; Thu, 23 May 2013 22:45:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NMjxPP016597; Thu, 23 May 2013 22:45:59 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NMjwtf016592; Thu, 23 May 2013 22:45:58 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305232245.r4NMjwtf016592@svn.freebsd.org> From: Scott Long Date: Thu, 23 May 2013 22:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250947 - in stable/9/sys: kern ufs/ffs vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 22:45:59 -0000 Author: scottl Date: Thu May 23 22:45:58 2013 New Revision: 250947 URL: http://svnweb.freebsd.org/changeset/base/250947 Log: MFC r248283: Some style fixes Submitted by: kib Obtained from: Netflix Modified: stable/9/sys/kern/vfs_bio.c stable/9/sys/kern/vfs_cluster.c stable/9/sys/ufs/ffs/ffs_balloc.c stable/9/sys/vm/vnode_pager.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Thu May 23 22:11:57 2013 (r250946) +++ stable/9/sys/kern/vfs_bio.c Thu May 23 22:45:58 2013 (r250947) @@ -855,9 +855,8 @@ breadn(struct vnode * vp, daddr_t blkno, * getblk(). Also starts asynchronous I/O on read-ahead blocks. */ int -breadn_flags(struct vnode * vp, daddr_t blkno, int size, - daddr_t * rablkno, int *rabsize, int cnt, - struct ucred * cred, int flags, struct buf **bpp) +breadn_flags(struct vnode *vp, daddr_t blkno, int size, daddr_t *rablkno, + int *rabsize, int cnt, struct ucred *cred, int flags, struct buf **bpp) { struct buf *bp; int rv = 0, readwait = 0; @@ -1844,7 +1843,7 @@ vfs_bio_awrite(struct buf *bp) nwritten = bp->b_bufsize; (void) bwrite(bp); - return nwritten; + return (nwritten); } /* @@ -2678,7 +2677,7 @@ vfs_setdirty_locked_object(struct buf *b * prior to issuing the READ. biodone() will *not* clear B_INVAL. */ struct buf * -getblk(struct vnode * vp, daddr_t blkno, int size, int slpflag, int slptimeo, +getblk(struct vnode *vp, daddr_t blkno, int size, int slpflag, int slptimeo, int flags) { struct buf *bp; @@ -2752,9 +2751,8 @@ loop: BO_UNLOCK(bo); /* - * check for size inconsistancies for non-VMIO case. + * check for size inconsistencies for non-VMIO case. */ - if (bp->b_bcount != size) { if ((bp->b_flags & B_VMIO) == 0 || (size > bp->b_kvasize)) { Modified: stable/9/sys/kern/vfs_cluster.c ============================================================================== --- stable/9/sys/kern/vfs_cluster.c Thu May 23 22:11:57 2013 (r250946) +++ stable/9/sys/kern/vfs_cluster.c Thu May 23 22:45:58 2013 (r250947) @@ -581,7 +581,7 @@ cluster_wbuild_wb(struct vnode *vp, long { int r = 0; - switch(write_behind) { + switch (write_behind) { case 2: if (start_lbn < len) break; Modified: stable/9/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_balloc.c Thu May 23 22:11:57 2013 (r250946) +++ stable/9/sys/ufs/ffs/ffs_balloc.c Thu May 23 22:45:58 2013 (r250947) @@ -681,9 +681,9 @@ ffs_balloc_ufs2(struct vnode *vp, off_t if (osize < fs->fs_bsize && osize > 0) { UFS_LOCK(ump); error = ffs_realloccg(ip, nb, dp->di_db[nb], - ffs_blkpref_ufs2(ip, lastlbn, (int)nb, - &dp->di_db[0]), osize, (int)fs->fs_bsize, - flags, cred, &bp); + ffs_blkpref_ufs2(ip, lastlbn, (int)nb, + &dp->di_db[0]), osize, (int)fs->fs_bsize, + flags, cred, &bp); if (error) return (error); if (DOINGSOFTDEP(vp)) @@ -735,7 +735,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t UFS_LOCK(ump); error = ffs_realloccg(ip, lbn, dp->di_db[lbn], ffs_blkpref_ufs2(ip, lbn, (int)lbn, - &dp->di_db[0]), osize, nsize, flags, + &dp->di_db[0]), osize, nsize, flags, cred, &bp); if (error) return (error); Modified: stable/9/sys/vm/vnode_pager.c ============================================================================== --- stable/9/sys/vm/vnode_pager.c Thu May 23 22:11:57 2013 (r250946) +++ stable/9/sys/vm/vnode_pager.c Thu May 23 22:45:58 2013 (r250947) @@ -908,7 +908,7 @@ vnode_pager_generic_getpages(vp, m, byte } bp = getpbuf(&vnode_pbuf_freecnt); - kva = (vm_offset_t) bp->b_data; + kva = (vm_offset_t)bp->b_data; /* * and map the pages to be read into the kva From owner-svn-src-all@FreeBSD.ORG Thu May 23 22:48:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 24E54464; Thu, 23 May 2013 22:48:41 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15EAF6ED; Thu, 23 May 2013 22:48:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NMmeW0017124; Thu, 23 May 2013 22:48:40 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NMmeUc017123; Thu, 23 May 2013 22:48:40 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305232248.r4NMmeUc017123@svn.freebsd.org> From: Scott Long Date: Thu, 23 May 2013 22:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250948 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 22:48:41 -0000 Author: scottl Date: Thu May 23 22:48:40 2013 New Revision: 250948 URL: http://svnweb.freebsd.org/changeset/base/250948 Log: MFC 248501: Assert that a ccb passed to cam_periph_mapmem() for XPT_SCSI_IO and XPT_ATA_IO holds virtual buffer address. Submitted by: kib Obtained from: Netflix Modified: stable/9/sys/cam/cam_periph.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Thu May 23 22:45:58 2013 (r250947) +++ stable/9/sys/cam/cam_periph.c Thu May 23 22:48:40 2013 (r250948) @@ -733,6 +733,8 @@ cam_periph_mapmem(union ccb *ccb, struct case XPT_CONT_TARGET_IO: if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) return(0); + KASSERT((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR, + ("not VADDR for SCSI_IO %p %x\n", ccb, ccb->ccb_h.flags)); data_ptrs[0] = &ccb->csio.data_ptr; lengths[0] = ccb->csio.dxfer_len; @@ -742,6 +744,8 @@ cam_periph_mapmem(union ccb *ccb, struct case XPT_ATA_IO: if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) return(0); + KASSERT((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR, + ("not VADDR for ATA_IO %p %x\n", ccb, ccb->ccb_h.flags)); data_ptrs[0] = &ccb->ataio.data_ptr; lengths[0] = ccb->ataio.dxfer_len; From owner-svn-src-all@FreeBSD.ORG Thu May 23 22:51:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 152FE620; Thu, 23 May 2013 22:51:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 07AA6769; Thu, 23 May 2013 22:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NMpugp019380; Thu, 23 May 2013 22:51:56 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NMpuh2019379; Thu, 23 May 2013 22:51:56 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201305232251.r4NMpuh2019379@svn.freebsd.org> From: Martin Matuska Date: Thu, 23 May 2013 22:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250949 - vendor-sys/illumos/dist/uts/common X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 22:51:57 -0000 Author: mm Date: Thu May 23 22:51:56 2013 New Revision: 250949 URL: http://svnweb.freebsd.org/changeset/base/250949 Log: Update vendor-sys/illumos/dist to illumos-gate 14029:11aad50aea32 No FreeBSD-related changes Modified: vendor-sys/illumos/dist/uts/common/Makefile.files Modified: vendor-sys/illumos/dist/uts/common/Makefile.files ============================================================================== --- vendor-sys/illumos/dist/uts/common/Makefile.files Thu May 23 22:48:40 2013 (r250948) +++ vendor-sys/illumos/dist/uts/common/Makefile.files Thu May 23 22:51:56 2013 (r250949) @@ -1880,6 +1880,19 @@ CH_COM_OBJS = ch_mac.o ch_subr.o cspi.o vsc7321.o vsc7326.o xpak.o # +# Chelsio Terminator 4 10G NIC nexus driver module +# +CXGBE_FW_OBJS = t4_fw.o t4_cfg.o +CXGBE_COM_OBJS = t4_hw.o common.o +CXGBE_NEX_OBJS = t4_nexus.o t4_sge.o t4_mac.o t4_ioctl.o shared.o \ + t4_l2t.o adapter.o osdep.o + +# +# Chelsio Terminator 4 10G NIC driver module +# +CXGBE_OBJS = cxgbe.o + +# # PCI strings file # PCI_STRING_OBJS = pci_strings.o From owner-svn-src-all@FreeBSD.ORG Thu May 23 22:52:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A1C05787; Thu, 23 May 2013 22:52:22 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93F2876F; Thu, 23 May 2013 22:52:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NMqMlP019502; Thu, 23 May 2013 22:52:22 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NMqMnj019500; Thu, 23 May 2013 22:52:22 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201305232252.r4NMqMnj019500@svn.freebsd.org> From: Martin Matuska Date: Thu, 23 May 2013 22:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250950 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 22:52:22 -0000 Author: mm Date: Thu May 23 22:52:21 2013 New Revision: 250950 URL: http://svnweb.freebsd.org/changeset/base/250950 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 14031:e4eb37f33d60 Illumos ZFS issues: 3699 zfs hold or release of a non-existent snapshot does not output error 3739 cannot set zfs quota or reservation on pool version < 22 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Thu May 23 22:51:56 2013 (r250949) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Thu May 23 22:52:21 2013 (r250950) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013 Martin Matuska. All rights reserved. */ #include @@ -967,12 +968,18 @@ dsl_dir_set_quota_sync(void *arg, dmu_tx VERIFY0(dsl_dataset_hold(dp, ddsqra->ddsqra_name, FTAG, &ds)); - dsl_prop_set_sync_impl(ds, zfs_prop_to_name(ZFS_PROP_QUOTA), - ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1, - &ddsqra->ddsqra_value, tx); + if (spa_version(dp->dp_spa) >= SPA_VERSION_RECVD_PROPS) { + dsl_prop_set_sync_impl(ds, zfs_prop_to_name(ZFS_PROP_QUOTA), + ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1, + &ddsqra->ddsqra_value, tx); - VERIFY0(dsl_prop_get_int_ds(ds, - zfs_prop_to_name(ZFS_PROP_QUOTA), &newval)); + VERIFY0(dsl_prop_get_int_ds(ds, + zfs_prop_to_name(ZFS_PROP_QUOTA), &newval)); + } else { + newval = ddsqra->ddsqra_value; + spa_history_log_internal_ds(ds, "set", tx, "%s=%lld", + zfs_prop_to_name(ZFS_PROP_QUOTA), (longlong_t)newval); + } dmu_buf_will_dirty(ds->ds_dir->dd_dbuf, tx); mutex_enter(&ds->ds_dir->dd_lock); @@ -1083,12 +1090,20 @@ dsl_dir_set_reservation_sync(void *arg, VERIFY0(dsl_dataset_hold(dp, ddsqra->ddsqra_name, FTAG, &ds)); - dsl_prop_set_sync_impl(ds, zfs_prop_to_name(ZFS_PROP_RESERVATION), - ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1, - &ddsqra->ddsqra_value, tx); + if (spa_version(dp->dp_spa) >= SPA_VERSION_RECVD_PROPS) { + dsl_prop_set_sync_impl(ds, + zfs_prop_to_name(ZFS_PROP_RESERVATION), + ddsqra->ddsqra_source, sizeof (ddsqra->ddsqra_value), 1, + &ddsqra->ddsqra_value, tx); - VERIFY0(dsl_prop_get_int_ds(ds, - zfs_prop_to_name(ZFS_PROP_RESERVATION), &newval)); + VERIFY0(dsl_prop_get_int_ds(ds, + zfs_prop_to_name(ZFS_PROP_RESERVATION), &newval)); + } else { + newval = ddsqra->ddsqra_value; + spa_history_log_internal_ds(ds, "set", tx, "%s=%lld", + zfs_prop_to_name(ZFS_PROP_RESERVATION), + (longlong_t)newval); + } dsl_dir_set_reservation_sync_impl(ds->ds_dir, newval, tx); dsl_dataset_rele(ds, FTAG); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c Thu May 23 22:51:56 2013 (r250949) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c Thu May 23 22:52:21 2013 (r250950) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013 Martin Matuska. All rights reserved. */ #include @@ -557,10 +558,6 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds } if (version < SPA_VERSION_RECVD_PROPS) { - zfs_prop_t prop = zfs_name_to_prop(propname); - if (prop == ZFS_PROP_QUOTA || prop == ZFS_PROP_RESERVATION) - return; - if (source & ZPROP_SRC_NONE) source = ZPROP_SRC_NONE; else if (source & ZPROP_SRC_RECEIVED) From owner-svn-src-all@FreeBSD.ORG Thu May 23 22:52:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 132F1788; Thu, 23 May 2013 22:52:23 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EA097770; Thu, 23 May 2013 22:52:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4NMqMdG019509; Thu, 23 May 2013 22:52:22 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4NMqMrZ019508; Thu, 23 May 2013 22:52:22 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201305232252.r4NMqMrZ019508@svn.freebsd.org> From: Martin Matuska Date: Thu, 23 May 2013 22:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250950 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 22:52:23 -0000 Author: mm Date: Thu May 23 22:52:21 2013 New Revision: 250950 URL: http://svnweb.freebsd.org/changeset/base/250950 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 14031:e4eb37f33d60 Illumos ZFS issues: 3699 zfs hold or release of a non-existent snapshot does not output error 3739 cannot set zfs quota or reservation on pool version < 22 Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Thu May 23 22:51:56 2013 (r250949) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Thu May 23 22:52:21 2013 (r250950) @@ -24,6 +24,7 @@ * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright 2012 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2013 Martin Matuska. All rights reserved. */ #include @@ -4116,6 +4117,20 @@ zfs_hold(zfs_handle_t *zhp, const char * ha.tag = tag; ha.recursive = recursive; (void) zfs_hold_one(zfs_handle_dup(zhp), &ha); + + if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + fnvlist_free(ha.nvl); + ret = ENOENT; + if (!enoent_ok) { + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, + "cannot hold snapshot '%s@%s'"), + zhp->zfs_name, snapname); + (void) zfs_standard_error(hdl, ret, errbuf); + } + return (ret); + } + ret = lzc_hold(ha.nvl, cleanup_fd, &errors); fnvlist_free(ha.nvl); @@ -4217,12 +4232,25 @@ zfs_release(zfs_handle_t *zhp, const cha nvlist_t *errors; nvpair_t *elem; libzfs_handle_t *hdl = zhp->zfs_hdl; + char errbuf[1024]; ha.nvl = fnvlist_alloc(); ha.snapname = snapname; ha.tag = tag; ha.recursive = recursive; (void) zfs_release_one(zfs_handle_dup(zhp), &ha); + + if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + fnvlist_free(ha.nvl); + ret = ENOENT; + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, + "cannot release hold from snapshot '%s@%s'"), + zhp->zfs_name, snapname); + (void) zfs_standard_error(hdl, ret, errbuf); + return (ret); + } + ret = lzc_release(ha.nvl, &errors); fnvlist_free(ha.nvl); @@ -4231,8 +4259,6 @@ zfs_release(zfs_handle_t *zhp, const cha if (nvlist_next_nvpair(errors, NULL) == NULL) { /* no hold-specific errors */ - char errbuf[1024]; - (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release")); switch (errno) { @@ -4249,8 +4275,6 @@ zfs_release(zfs_handle_t *zhp, const cha for (elem = nvlist_next_nvpair(errors, NULL); elem != NULL; elem = nvlist_next_nvpair(errors, elem)) { - char errbuf[1024]; - (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release hold from snapshot '%s'"), From owner-svn-src-all@FreeBSD.ORG Fri May 24 00:49:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 08B52432; Fri, 24 May 2013 00:49:13 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EE004B59; Fri, 24 May 2013 00:49:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4O0nC1n059317; Fri, 24 May 2013 00:49:12 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4O0nCrw059316; Fri, 24 May 2013 00:49:12 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201305240049.r4O0nCrw059316@svn.freebsd.org> From: Lawrence Stewart Date: Fri, 24 May 2013 00:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250951 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 00:49:13 -0000 Author: lstewart Date: Fri May 24 00:49:12 2013 New Revision: 250951 URL: http://svnweb.freebsd.org/changeset/base/250951 Log: Ensure alq's shutdown_pre_sync event handler is deregistered on module unload to avoid a dangling pointer and eventual panic on system shutdown. Reported by: Ali Tested by: Ali MFC after: 1 week Modified: head/sys/kern/kern_alq.c Modified: head/sys/kern/kern_alq.c ============================================================================== --- head/sys/kern/kern_alq.c Thu May 23 22:52:21 2013 (r250950) +++ head/sys/kern/kern_alq.c Fri May 24 00:49:12 2013 (r250951) @@ -99,6 +99,7 @@ static LIST_HEAD(, alq) ald_active; static int ald_shutingdown = 0; struct thread *ald_thread; static struct proc *ald_proc; +static eventhandler_tag alq_eventhandler_tag = NULL; #define ALD_LOCK() mtx_lock(&ald_mtx) #define ALD_UNLOCK() mtx_unlock(&ald_mtx) @@ -194,8 +195,8 @@ ald_daemon(void) ald_thread = FIRST_THREAD_IN_PROC(ald_proc); - EVENTHANDLER_REGISTER(shutdown_pre_sync, ald_shutdown, NULL, - SHUTDOWN_PRI_FIRST); + alq_eventhandler_tag = EVENTHANDLER_REGISTER(shutdown_pre_sync, + ald_shutdown, NULL, SHUTDOWN_PRI_FIRST); ALD_LOCK(); @@ -228,6 +229,8 @@ ald_shutdown(void *arg, int howto) { struct alq *alq; + EVENTHANDLER_DEREGISTER(shutdown_pre_sync, alq_eventhandler_tag); + ALD_LOCK(); /* Ensure no new queues can be created. */ From owner-svn-src-all@FreeBSD.ORG Fri May 24 02:18:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4E2FE743; Fri, 24 May 2013 02:18:38 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 40AD8F29; Fri, 24 May 2013 02:18:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4O2IbJ9090910; Fri, 24 May 2013 02:18:37 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4O2IbIV090909; Fri, 24 May 2013 02:18:37 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201305240218.r4O2IbIV090909@svn.freebsd.org> From: Julian Elischer Date: Fri, 24 May 2013 02:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250952 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 02:18:38 -0000 Author: julian Date: Fri May 24 02:18:37 2013 New Revision: 250952 URL: http://svnweb.freebsd.org/changeset/base/250952 Log: Initialising the new fibnum field to a known value turns out to be a GOOD IDEA (TM). Apparently MOST users set this (e.g. tcp and friends) but there are a few users that just assume that it is a sensible value but then go on to read it. These include SCTP, pf and the FLOWTABLE option (and maybe others). Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Fri May 24 00:49:12 2013 (r250951) +++ head/sys/kern/kern_mbuf.c Fri May 24 02:18:37 2013 (r250952) @@ -470,6 +470,7 @@ mb_ctor_mbuf(void *mem, int size, void * m->m_pkthdr.tso_segsz = 0; m->m_pkthdr.ether_vtag = 0; m->m_pkthdr.flowid = 0; + m->m_pkthdr.fibnum = 0; SLIST_INIT(&m->m_pkthdr.tags); #ifdef MAC /* If the label init fails, fail the alloc */ @@ -695,6 +696,7 @@ mb_ctor_pack(void *mem, int size, void * m->m_pkthdr.tso_segsz = 0; m->m_pkthdr.ether_vtag = 0; m->m_pkthdr.flowid = 0; + m->m_pkthdr.fibnum = 0; SLIST_INIT(&m->m_pkthdr.tags); #ifdef MAC /* If the label init fails, fail the alloc */ @@ -720,6 +722,7 @@ m_pkthdr_init(struct mbuf *m, int how) m->m_pkthdr.header = NULL; m->m_pkthdr.len = 0; m->m_pkthdr.flowid = 0; + m->m_pkthdr.fibnum = 0; m->m_pkthdr.csum_flags = 0; m->m_pkthdr.csum_data = 0; m->m_pkthdr.tso_segsz = 0; From owner-svn-src-all@FreeBSD.ORG Fri May 24 03:29:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 73D29AEC; Fri, 24 May 2013 03:29:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 549AF363; Fri, 24 May 2013 03:29:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4O3TWax016250; Fri, 24 May 2013 03:29:32 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4O3TWnU016249; Fri, 24 May 2013 03:29:32 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305240329.r4O3TWnU016249@svn.freebsd.org> From: Mark Johnston Date: Fri, 24 May 2013 03:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250953 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 03:29:33 -0000 Author: markj Date: Fri May 24 03:29:32 2013 New Revision: 250953 URL: http://svnweb.freebsd.org/changeset/base/250953 Log: The fasttrap provider cleans up probes asynchronously when a process with USDT probes exits. This was previously done with a callout; however, it is possible to sleep while holding the DTrace mutexes, so a panic will occur on INVARIANTS kernels if the callout handler can't immediately acquire one of these mutexes. This panic will be frequently triggered on systems where a USDT-enabled program (perl, for instance) is often run. This revision changes the fasttrap cleanup mechanism so that a dedicated thread is used instead of a callout. The old behaviour is otherwise preserved. Reviewed by: rpaulo MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri May 24 02:18:37 2013 (r250952) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri May 24 03:29:32 2013 (r250953) @@ -155,9 +155,9 @@ static struct cdevsw fasttrap_cdevsw = { static struct cdev *fasttrap_cdev; static dtrace_meta_provider_id_t fasttrap_meta_id; -static struct callout fasttrap_timeout; +static struct proc *fasttrap_cleanup_proc; static struct mtx fasttrap_cleanup_mtx; -static uint_t fasttrap_cleanup_work; +static uint_t fasttrap_cleanup_work, fasttrap_cleanup_drain, fasttrap_cleanup_cv; /* * Generation count on modifications to the global tracepoint lookup table. @@ -310,8 +310,11 @@ fasttrap_mod_barrier(uint64_t gen) } /* - * This is the timeout's callback for cleaning up the providers and their - * probes. + * This function performs asynchronous cleanup of fasttrap providers. The + * Solaris implementation of this mechanism use a timeout that's activated in + * fasttrap_pid_cleanup(), but this doesn't work in FreeBSD: one may sleep while + * holding the DTrace mutexes, but it is unsafe to sleep in a callout handler. + * Thus we use a dedicated process to perform the cleanup when requested. */ /*ARGSUSED*/ static void @@ -322,11 +325,8 @@ fasttrap_pid_cleanup_cb(void *data) dtrace_provider_id_t provid; int i, later = 0, rval; - static volatile int in = 0; - ASSERT(in == 0); - in = 1; - - while (fasttrap_cleanup_work) { + mtx_lock(&fasttrap_cleanup_mtx); + while (!fasttrap_cleanup_drain || later > 0) { fasttrap_cleanup_work = 0; mtx_unlock(&fasttrap_cleanup_mtx); @@ -397,39 +397,32 @@ fasttrap_pid_cleanup_cb(void *data) } mutex_exit(&bucket->ftb_mtx); } - mtx_lock(&fasttrap_cleanup_mtx); - } -#if 0 - ASSERT(fasttrap_timeout != 0); -#endif + /* + * If we were unable to retire a provider, try again after a + * second. This situation can occur in certain circumstances + * where providers cannot be unregistered even though they have + * no probes enabled because of an execution of dtrace -l or + * something similar. + */ + if (later > 0 || fasttrap_cleanup_work || + fasttrap_cleanup_drain) { + mtx_unlock(&fasttrap_cleanup_mtx); + pause("ftclean", hz); + mtx_lock(&fasttrap_cleanup_mtx); + } else + mtx_sleep(&fasttrap_cleanup_cv, &fasttrap_cleanup_mtx, + 0, "ftcl", 0); + } /* - * If we were unable to remove a retired provider, try again after - * a second. This situation can occur in certain circumstances where - * providers cannot be unregistered even though they have no probes - * enabled because of an execution of dtrace -l or something similar. - * If the timeout has been disabled (set to 1 because we're trying - * to detach), we set fasttrap_cleanup_work to ensure that we'll - * get a chance to do that work if and when the timeout is reenabled - * (if detach fails). - */ - if (later > 0) { - if (callout_active(&fasttrap_timeout)) { - callout_reset(&fasttrap_timeout, hz, - &fasttrap_pid_cleanup_cb, NULL); - } - - else if (later > 0) - fasttrap_cleanup_work = 1; - } else { -#if !defined(sun) - /* Nothing to be done for FreeBSD */ -#endif - } + * Wake up the thread in fasttrap_unload() now that we're done. + */ + wakeup(&fasttrap_cleanup_drain); + mtx_unlock(&fasttrap_cleanup_mtx); - in = 0; + kthread_exit(); } /* @@ -440,8 +433,10 @@ fasttrap_pid_cleanup(void) { mtx_lock(&fasttrap_cleanup_mtx); - fasttrap_cleanup_work = 1; - callout_reset(&fasttrap_timeout, 1, &fasttrap_pid_cleanup_cb, NULL); + if (!fasttrap_cleanup_work) { + fasttrap_cleanup_work = 1; + wakeup(&fasttrap_cleanup_cv); + } mtx_unlock(&fasttrap_cleanup_mtx); } @@ -991,7 +986,6 @@ fasttrap_pid_enable(void *arg, dtrace_id proc_t *p = NULL; int i, rc; - ASSERT(probe != NULL); ASSERT(!probe->ftp_enabled); ASSERT(id == probe->ftp_id); @@ -2272,17 +2266,23 @@ static int fasttrap_load(void) { ulong_t nent; - int i; + int i, ret; /* Create the /dev/dtrace/fasttrap entry. */ fasttrap_cdev = make_dev(&fasttrap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "dtrace/fasttrap"); mtx_init(&fasttrap_cleanup_mtx, "fasttrap clean", "dtrace", MTX_DEF); - callout_init_mtx(&fasttrap_timeout, &fasttrap_cleanup_mtx, 0); mutex_init(&fasttrap_count_mtx, "fasttrap count mtx", MUTEX_DEFAULT, NULL); + ret = kproc_create(fasttrap_pid_cleanup_cb, NULL, + &fasttrap_cleanup_proc, 0, 0, "ftcleanup"); + if (ret != 0) { + destroy_dev(fasttrap_cdev); + return (ret); + } + /* * Install our hooks into fork(2), exec(2), and exit(2). */ @@ -2389,15 +2389,6 @@ fasttrap_unload(void) return (-1); /* - * Prevent any new timeouts from running by setting fasttrap_timeout - * to a non-zero value, and wait for the current timeout to complete. - */ - mtx_lock(&fasttrap_cleanup_mtx); - fasttrap_cleanup_work = 0; - callout_drain(&fasttrap_timeout); - mtx_unlock(&fasttrap_cleanup_mtx); - - /* * Iterate over all of our providers. If there's still a process * that corresponds to that pid, fail to detach. */ @@ -2431,26 +2422,20 @@ fasttrap_unload(void) } if (fail) { - uint_t work; - /* - * If we're failing to detach, we need to unblock timeouts - * and start a new timeout if any work has accumulated while - * we've been unsuccessfully trying to detach. - */ - mtx_lock(&fasttrap_cleanup_mtx); - work = fasttrap_cleanup_work; - callout_drain(&fasttrap_timeout); - mtx_unlock(&fasttrap_cleanup_mtx); - - if (work) - fasttrap_pid_cleanup(); - (void) dtrace_meta_register("fasttrap", &fasttrap_mops, NULL, &fasttrap_meta_id); return (-1); } + mtx_lock(&fasttrap_cleanup_mtx); + fasttrap_cleanup_drain = 1; + /* Wait for the cleanup thread to finish up and signal us. */ + wakeup(&fasttrap_cleanup_cv); + mtx_sleep(&fasttrap_cleanup_drain, &fasttrap_cleanup_mtx, 0, "ftcld", + 0); + fasttrap_cleanup_proc = NULL; + #ifdef DEBUG mutex_enter(&fasttrap_count_mtx); ASSERT(fasttrap_pid_count == 0); From owner-svn-src-all@FreeBSD.ORG Fri May 24 05:26:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 49FEBEC9; Fri, 24 May 2013 05:26:42 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with ESMTP id 29CB5AF2; Fri, 24 May 2013 05:26:41 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 0EBA523F804; Fri, 24 May 2013 01:26:41 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 0EBA523F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 24 May 2013 01:26:39 -0400 From: Glen Barber To: Scott Long Subject: Re: svn commit: r250948 - stable/9/sys/cam Message-ID: <20130524052639.GG28865@glenbarber.us> References: <201305232248.r4NMmeUc017123@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7lMq7vMTJT4tNk0a" Content-Disposition: inline In-Reply-To: <201305232248.r4NMmeUc017123@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 05:26:42 -0000 --7lMq7vMTJT4tNk0a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 23, 2013 at 10:48:40PM +0000, Scott Long wrote: > Author: scottl > Date: Thu May 23 22:48:40 2013 > New Revision: 250948 > URL: http://svnweb.freebsd.org/changeset/base/250948 >=20 > Log: > MFC 248501: > =20 > Assert that a ccb passed to cam_periph_mapmem() for XPT_SCSI_IO and > XPT_ATA_IO holds virtual buffer address. > =20 > Submitted by: kib > Obtained from: Netflix >=20 > Modified: > stable/9/sys/cam/cam_periph.c > Directory Properties: > stable/9/sys/ (props changed) >=20 I think this breaks stable/9 build... http://tinderbox.freebsd.org/tinderbox-freebsd9-build-RELENG_9-arm-arm.full Glen --7lMq7vMTJT4tNk0a Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJRnvoPAAoJEFJPDDeguUajp90IAJ585xUcLibTNNQugIxiyVGc 3IAi5IbB2wU2g9ykvjMbHdwg3t43Nj1PEb5J0VvQBpBBcUXZhRbt4PguNp3ErOmD X0Zhn8UupfCh4+KjLqBCUA1zPHWjhgKhe7MUlH9EG/eQhTUwANolmB+kPUFjNwG+ RXj475Sp1jME61tiRobSppbq33aw2WB3++TqLoMBXr+RiOSiY/qKRmP5WOEN43YK w0XMJEM0nO2+LTVNWp8kBkG9oSLL8DlEI3bqh61V+XYQ4W0rb72744tzL1FUzrN8 FRsy+7FWWIcpqylz4WTFYcsrr8AZLFyCIgAIvJ6S6K/uTucfYqiQ8Wjxnt+fmus= =E32B -----END PGP SIGNATURE----- --7lMq7vMTJT4tNk0a-- From owner-svn-src-all@FreeBSD.ORG Fri May 24 06:07:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 95B37BC; Fri, 24 May 2013 06:07:00 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 5222FE4A; Fri, 24 May 2013 06:07:00 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id x12so11226572ief.12 for ; Thu, 23 May 2013 23:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=yJWI4xR4raljbr+wW9noPiqppmhQuXaZpUZHqXUIwYQ=; b=udWUmMRh55F6bhKD9VkAtE6OKfXGAXbcBDg/Usc5vY3NFiJaz+yGNlgIp6AbfDBWcH V+QOIxi207EnceRjfRtzjHHZWBicMynDz7fUAqhah1aSYZ79hZRMo3/HBDB3om6THwZd KkyyBSNhRFRYRZ6yAd21Wtvuafu7WGpSB++aqsRsql1C1ZHcnNPI23sOCP7zli6vRvDO 7iFn5ljSZ5UKzDMn1JkyBjA4iTLblzWvw1YNUUlGGMFMc1Wvw7YH2AWY7qETZcCljbxK MekWMhOexn3e4zVuNsYkDL4kuc2GEsX3EkV57p8A/9JwEMqzAPFTMBZTJECZmeEiouXv BIGw== MIME-Version: 1.0 X-Received: by 10.50.60.41 with SMTP id e9mr2899121igr.94.1369375620014; Thu, 23 May 2013 23:07:00 -0700 (PDT) Sender: antoine.brodin.freebsd@gmail.com Received: by 10.64.126.10 with HTTP; Thu, 23 May 2013 23:06:59 -0700 (PDT) In-Reply-To: <201305211728.r4LHSJci081409@svn.freebsd.org> References: <201305211728.r4LHSJci081409@svn.freebsd.org> Date: Fri, 24 May 2013 06:06:59 +0000 X-Google-Sender-Auth: RE1Khu144wrsr1f0VJx2Mr6rezU Message-ID: Subject: Re: svn commit: r250860 - head/gnu/usr.bin/diff From: Antoine Brodin To: Marcel Moolenaar Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 06:07:00 -0000 On Tue, May 21, 2013 at 5:28 PM, Marcel Moolenaar wrote: > Author: marcel > Date: Tue May 21 17:28:19 2013 > New Revision: 250860 > URL: http://svnweb.freebsd.org/changeset/base/250860 > > Log: > Don't look for headers outside of the source or object directories. In > particular, don't use DESTDIR. Such creates an unnecessary dependency > on the build machine. > > Obtained from: Juniper Networks, Inc. Actually during world stage, WMAKE=${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP} So I think it was picking up headers from the correct place. Cheers, Antoine From owner-svn-src-all@FreeBSD.ORG Fri May 24 06:13:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B1E18513; Fri, 24 May 2013 06:13:36 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A2561EAF; Fri, 24 May 2013 06:13:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4O6DaYZ074088; Fri, 24 May 2013 06:13:36 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4O6Dade074087; Fri, 24 May 2013 06:13:36 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305240613.r4O6Dade074087@svn.freebsd.org> From: Scott Long Date: Fri, 24 May 2013 06:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250961 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 06:13:36 -0000 Author: scottl Date: Fri May 24 06:13:36 2013 New Revision: 250961 URL: http://svnweb.freebsd.org/changeset/base/250961 Log: Revert r250948, it was merged too soon. Modified: stable/9/sys/cam/cam_periph.c Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Fri May 24 04:03:04 2013 (r250960) +++ stable/9/sys/cam/cam_periph.c Fri May 24 06:13:36 2013 (r250961) @@ -733,8 +733,6 @@ cam_periph_mapmem(union ccb *ccb, struct case XPT_CONT_TARGET_IO: if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) return(0); - KASSERT((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR, - ("not VADDR for SCSI_IO %p %x\n", ccb, ccb->ccb_h.flags)); data_ptrs[0] = &ccb->csio.data_ptr; lengths[0] = ccb->csio.dxfer_len; @@ -744,8 +742,6 @@ cam_periph_mapmem(union ccb *ccb, struct case XPT_ATA_IO: if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) return(0); - KASSERT((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR, - ("not VADDR for ATA_IO %p %x\n", ccb, ccb->ccb_h.flags)); data_ptrs[0] = &ccb->ataio.data_ptr; lengths[0] = ccb->ataio.dxfer_len; From owner-svn-src-all@FreeBSD.ORG Fri May 24 06:50:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BD55CAFA; Fri, 24 May 2013 06:50:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id 569FE74; Fri, 24 May 2013 06:50:35 +0000 (UTC) Received: from [192.168.1.200] (p508F0DA0.dip0.t-ipconnect.de [80.143.13.160]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 2FA481C0B2D79; Fri, 24 May 2013 08:50:33 +0200 (CEST) Subject: Re: svn commit: r250809 - head/sys/netinet Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Michael Tuexen In-Reply-To: Date: Fri, 24 May 2013 08:50:36 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201305191606.r4JG6hNR032154@svn.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 06:50:35 -0000 On May 23, 2013, at 11:37 PM, Bjoern A. Zeeb wrote: > On Sun, 19 May 2013, Michael Tuexen wrote: >=20 >> Author: tuexen >> Date: Sun May 19 16:06:43 2013 >> New Revision: 250809 >> URL: http://svnweb.freebsd.org/changeset/base/250809 >>=20 >> Log: >> Initialize the fibnum for outgoing packets to 0. This avoids >> crashing due to the usage of uninitialized fibnum. >> This bugs became visiable after >> http://svnweb.freebsd.org/changeset/base/250700 >=20 >=20 > That just masks the real bug, please back it out. And the real bug is that SCTP doesn't support multiple fibs, right? That would mean the system crashes on reception of an out of the blue SCTP packet... Best regards Michael >=20 >=20 >> MFC after: 2 weeks >>=20 >> Modified: >> head/sys/netinet/sctp_os_bsd.h >>=20 >> Modified: head/sys/netinet/sctp_os_bsd.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_os_bsd.h Sun May 19 15:26:15 2013 = (r250808) >> +++ head/sys/netinet/sctp_os_bsd.h Sun May 19 16:06:43 2013 = (r250809) >> @@ -435,6 +435,7 @@ typedef struct rtentry sctp_rtentry_t; >> { \ >> int o_flgs =3D IP_RAWOUTPUT; \ >> struct sctp_tcb *local_stcb =3D stcb; \ >> + M_SETFIB(o_pak, 0); \ >> if (local_stcb && \ >> local_stcb->sctp_ep && \ >> local_stcb->sctp_ep->sctp_socket) \ >> @@ -445,6 +446,7 @@ typedef struct rtentry sctp_rtentry_t; >> #define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \ >> { \ >> struct sctp_tcb *local_stcb =3D stcb; \ >> + M_SETFIB(o_pak, 0); \ >> if (local_stcb && local_stcb->sctp_ep) \ >> result =3D ip6_output(o_pak, \ >> ((struct in6pcb = *)(local_stcb->sctp_ep))->in6p_outputopts, \ >>=20 >=20 > --=20 > Bjoern A. Zeeb ????????? ??? ??????? = ??????: > '??? ??? ???? ?????? ??????? ?? ?? ??????? ??????? ??? ????? ????? = ???? > ?????? ?? ????? ????', ????????? ?????????, "??? ????? ?? ?????", = ?.??? >=20 From owner-svn-src-all@FreeBSD.ORG Fri May 24 06:52:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1767DC97; Fri, 24 May 2013 06:52:54 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id CF9F990; Fri, 24 May 2013 06:52:53 +0000 (UTC) Received: from [192.168.1.200] (p508F0DA0.dip0.t-ipconnect.de [80.143.13.160]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id C0F6A1C0B384B; Fri, 24 May 2013 08:52:52 +0200 (CEST) Subject: Re: svn commit: r250809 - head/sys/netinet Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Michael Tuexen In-Reply-To: Date: Fri, 24 May 2013 08:52:55 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201305191606.r4JG6hNR032154@svn.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 06:52:54 -0000 On May 24, 2013, at 8:50 AM, Michael Tuexen wrote: > On May 23, 2013, at 11:37 PM, Bjoern A. Zeeb wrote: >=20 >> On Sun, 19 May 2013, Michael Tuexen wrote: >>=20 >>> Author: tuexen >>> Date: Sun May 19 16:06:43 2013 >>> New Revision: 250809 >>> URL: http://svnweb.freebsd.org/changeset/base/250809 >>>=20 >>> Log: >>> Initialize the fibnum for outgoing packets to 0. This avoids >>> crashing due to the usage of uninitialized fibnum. >>> This bugs became visiable after >>> http://svnweb.freebsd.org/changeset/base/250700 >>=20 >>=20 >> That just masks the real bug, please back it out. > And the real bug is that SCTP doesn't support multiple fibs, right? > That would mean the system crashes on reception of an out of the blue > SCTP packet... OK. I just saw http://svnweb.freebsd.org/changeset/base/250952 I'll back out http://svnweb.freebsd.org/changeset/base/250809 later today. Best regards Michael >=20 > Best regards > Michael >>=20 >>=20 >>> MFC after: 2 weeks >>>=20 >>> Modified: >>> head/sys/netinet/sctp_os_bsd.h >>>=20 >>> Modified: head/sys/netinet/sctp_os_bsd.h >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/netinet/sctp_os_bsd.h Sun May 19 15:26:15 2013 = (r250808) >>> +++ head/sys/netinet/sctp_os_bsd.h Sun May 19 16:06:43 2013 = (r250809) >>> @@ -435,6 +435,7 @@ typedef struct rtentry sctp_rtentry_t; >>> { \ >>> int o_flgs =3D IP_RAWOUTPUT; \ >>> struct sctp_tcb *local_stcb =3D stcb; \ >>> + M_SETFIB(o_pak, 0); \ >>> if (local_stcb && \ >>> local_stcb->sctp_ep && \ >>> local_stcb->sctp_ep->sctp_socket) \ >>> @@ -445,6 +446,7 @@ typedef struct rtentry sctp_rtentry_t; >>> #define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \ >>> { \ >>> struct sctp_tcb *local_stcb =3D stcb; \ >>> + M_SETFIB(o_pak, 0); \ >>> if (local_stcb && local_stcb->sctp_ep) \ >>> result =3D ip6_output(o_pak, \ >>> ((struct in6pcb = *)(local_stcb->sctp_ep))->in6p_outputopts, \ >>>=20 >>=20 >> --=20 >> Bjoern A. Zeeb ????????? ??? ??????? = ??????: >> '??? ??? ???? ?????? ??????? ?? ?? ??????? ??????? ??? ????? ????? = ???? >> ?????? ?? ????? ????', ????????? ?????????, "??? ????? ?? ?????", = ?.??? >>=20 >=20 >=20 From owner-svn-src-all@FreeBSD.ORG Fri May 24 07:23:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B05BE9B7; Fri, 24 May 2013 07:23:59 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 6984E20C; Fri, 24 May 2013 07:23:59 +0000 (UTC) Received: from jre-mbp.elischer.org (ppp121-45-237-17.lns20.per1.internode.on.net [121.45.237.17]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id r4O7Noal078238 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 24 May 2013 00:23:53 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <519F1581.6070900@freebsd.org> Date: Fri, 24 May 2013 15:23:45 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Michael Tuexen Subject: Re: svn commit: r250809 - head/sys/netinet References: <201305191606.r4JG6hNR032154@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 07:23:59 -0000 On 5/24/13 2:52 PM, Michael Tuexen wrote: > On May 24, 2013, at 8:50 AM, Michael Tuexen wrote: > >> On May 23, 2013, at 11:37 PM, Bjoern A. Zeeb wrote: >> >>> On Sun, 19 May 2013, Michael Tuexen wrote: >>> >>>> Author: tuexen >>>> Date: Sun May 19 16:06:43 2013 >>>> New Revision: 250809 >>>> URL: http://svnweb.freebsd.org/changeset/base/250809 >>>> >>>> Log: >>>> Initialize the fibnum for outgoing packets to 0. This avoids >>>> crashing due to the usage of uninitialized fibnum. >>>> This bugs became visiable after >>>> http://svnweb.freebsd.org/changeset/base/250700 >>> >>> That just masks the real bug, please back it out. >> And the real bug is that SCTP doesn't support multiple fibs, right? >> That would mean the system crashes on reception of an out of the blue >> SCTP packet... > OK. I just saw > http://svnweb.freebsd.org/changeset/base/250952 > > I'll back out > http://svnweb.freebsd.org/changeset/base/250809 > later today. yeah. sorry about that... > > Best regards > Michael >> Best regards >> Michael >>> >>>> MFC after: 2 weeks >>>> >>>> Modified: >>>> head/sys/netinet/sctp_os_bsd.h >>>> >>>> Modified: head/sys/netinet/sctp_os_bsd.h >>>> ============================================================================== >>>> --- head/sys/netinet/sctp_os_bsd.h Sun May 19 15:26:15 2013 (r250808) >>>> +++ head/sys/netinet/sctp_os_bsd.h Sun May 19 16:06:43 2013 (r250809) >>>> @@ -435,6 +435,7 @@ typedef struct rtentry sctp_rtentry_t; >>>> { \ >>>> int o_flgs = IP_RAWOUTPUT; \ >>>> struct sctp_tcb *local_stcb = stcb; \ >>>> + M_SETFIB(o_pak, 0); \ >>>> if (local_stcb && \ >>>> local_stcb->sctp_ep && \ >>>> local_stcb->sctp_ep->sctp_socket) \ >>>> @@ -445,6 +446,7 @@ typedef struct rtentry sctp_rtentry_t; >>>> #define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \ >>>> { \ >>>> struct sctp_tcb *local_stcb = stcb; \ >>>> + M_SETFIB(o_pak, 0); \ >>>> if (local_stcb && local_stcb->sctp_ep) \ >>>> result = ip6_output(o_pak, \ >>>> ((struct in6pcb *)(local_stcb->sctp_ep))->in6p_outputopts, \ >>>> >>> -- >>> Bjoern A. Zeeb ????????? ??? ??????? ??????: >>> '??? ??? ???? ?????? ??????? ?? ?? ??????? ??????? ??? ????? ????? ???? >>> ?????? ?? ????? ????', ????????? ?????????, "??? ????? ?? ?????", ?.??? >>> >> > > > From owner-svn-src-all@FreeBSD.ORG Fri May 24 09:21:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BC400EF2; Fri, 24 May 2013 09:21:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AE7E8D29; Fri, 24 May 2013 09:21:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4O9LIFb040863; Fri, 24 May 2013 09:21:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4O9LI7B040862; Fri, 24 May 2013 09:21:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201305240921.r4O9LI7B040862@svn.freebsd.org> From: Michael Tuexen Date: Fri, 24 May 2013 09:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250962 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 09:21:18 -0000 Author: tuexen Date: Fri May 24 09:21:18 2013 New Revision: 250962 URL: http://svnweb.freebsd.org/changeset/base/250962 Log: Withdraw http://svnweb.freebsd.org/changeset/base/250809 since the real fix is in http://svnweb.freebsd.org/changeset/base/250952. Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Fri May 24 06:13:36 2013 (r250961) +++ head/sys/netinet/sctp_os_bsd.h Fri May 24 09:21:18 2013 (r250962) @@ -435,7 +435,6 @@ typedef struct rtentry sctp_rtentry_t; { \ int o_flgs = IP_RAWOUTPUT; \ struct sctp_tcb *local_stcb = stcb; \ - M_SETFIB(o_pak, 0); \ if (local_stcb && \ local_stcb->sctp_ep && \ local_stcb->sctp_ep->sctp_socket) \ @@ -446,7 +445,6 @@ typedef struct rtentry sctp_rtentry_t; #define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \ { \ struct sctp_tcb *local_stcb = stcb; \ - M_SETFIB(o_pak, 0); \ if (local_stcb && local_stcb->sctp_ep) \ result = ip6_output(o_pak, \ ((struct in6pcb *)(local_stcb->sctp_ep))->in6p_outputopts, \ From owner-svn-src-all@FreeBSD.ORG Fri May 24 09:22:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DA03F19B; Fri, 24 May 2013 09:22:44 +0000 (UTC) (envelope-from achim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C9244D52; Fri, 24 May 2013 09:22:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4O9MiNi041203; Fri, 24 May 2013 09:22:44 GMT (envelope-from achim@svn.freebsd.org) Received: (from achim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4O9MhQL041192; Fri, 24 May 2013 09:22:43 GMT (envelope-from achim@svn.freebsd.org) Message-Id: <201305240922.r4O9MhQL041192@svn.freebsd.org> From: Achim Leubner Date: Fri, 24 May 2013 09:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250963 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/aacraid sys/i386/conf sys/ia64/conf sys/modules sys/modules/aacraid sys/modules/aacraid/aacraid_linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 09:22:44 -0000 Author: achim Date: Fri May 24 09:22:43 2013 New Revision: 250963 URL: http://svnweb.freebsd.org/changeset/base/250963 Log: Driver 'aacraid' added. Supports Adaptec by PMC RAID controller families Series 6, 7, 8 and upcoming products. Older Adaptec RAID controller families are supported by the 'aac' driver. Approved by: scottl (mentor) Added: head/share/man/man4/aacraid.4 (contents, props changed) head/sys/dev/aacraid/ head/sys/dev/aacraid/aacraid.c (contents, props changed) head/sys/dev/aacraid/aacraid_cam.c (contents, props changed) head/sys/dev/aacraid/aacraid_debug.c (contents, props changed) head/sys/dev/aacraid/aacraid_debug.h (contents, props changed) head/sys/dev/aacraid/aacraid_linux.c (contents, props changed) head/sys/dev/aacraid/aacraid_pci.c (contents, props changed) head/sys/dev/aacraid/aacraid_reg.h (contents, props changed) head/sys/dev/aacraid/aacraid_var.h (contents, props changed) head/sys/modules/aacraid/ head/sys/modules/aacraid/Makefile (contents, props changed) head/sys/modules/aacraid/Makefile.inc (contents, props changed) head/sys/modules/aacraid/aacraid_linux/ head/sys/modules/aacraid/aacraid_linux/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES head/sys/ia64/conf/GENERIC head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 24 09:21:18 2013 (r250962) +++ head/share/man/man4/Makefile Fri May 24 09:22:43 2013 (r250963) @@ -4,6 +4,7 @@ .include MAN= aac.4 \ + aacraid.4 \ acpi.4 \ ${_acpi_asus.4} \ ${_acpi_asus_wmi.4} \ Added: head/share/man/man4/aacraid.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/aacraid.4 Fri May 24 09:22:43 2013 (r250963) @@ -0,0 +1,139 @@ +.\" Copyright (c) 2013 Achim Leubner +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.Dd April 09, 2013 +.Dt AACRAID 4 +.Os +.Sh NAME +.Nm aacraid +.Nd Adaptec AACRAID Controller driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd device pci +.Cd device aacraid +.Pp +To compile in debugging code: +.Cd options AACRAID_DEBUG=N +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +aacraid_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Adaptec by PMC RAID controllers, +including Series 6/7/8 and upcoming families. +.Pp +The RAID containers are handled via the +.Nm aacraidp0 +bus. +The physical buses are represented by the +.Nm aacraidp? +devices (beginning with aacraidp1). These devices enable the +SCSI pass-thru interface and allows devices connected +to the card such as CD-ROMs to be available via the CAM +.Xr scsi 4 +subsystem. +Note that not all cards allow this interface to be enabled. +.Pp +The +.Pa /dev/aacraid? +device nodes provide access to the management interface of the controller. +One node exists per installed card. +If the kernel is compiled with the +.Dv COMPAT_LINUX +option, or the +.Pa aacraid_linux.ko +and +.Pa linux.ko +modules are loaded, the +Linux-compatible +.Xr ioctl 2 +interface for the management device will be enabled and will allow +Linux-based management applications to control the card. +.Sh HARDWARE +Controllers supported by the +.Nm +driver include: +.Pp +.Bl -bullet -compact +.It +Adaptec ASR-6405(T|E) +.It +Adaptec ASR-6445 +.It +Adaptec ASR-6805(T|E|Q|TQ) +.It +Adaptec ASR-7085 +.It +Adaptec ASR-7805(Q) +.It +Adaptec ASR-70165 +.It +Adaptec ASR-71605(E|Q) +.It +Adaptec ASR-71685 +.It +Adaptec ASR-72405 +.It +Adaptec Series 8 cards +.El +.Sh FILES +.Bl -tag -width /boot/kernel/aacraid.ko -compact +.It Pa /dev/aacraid? +aacraid management interface +.El +.Sh DIAGNOSTICS +Compiling with +.Dv AACRAID_DEBUG +set to a number between 0 and 3 +will enable increasingly verbose debug messages. +.Pp +The adapter can send status and alert messages asynchronously +to the driver. +These messages are printed on the system console, +and are also queued for retrieval by a management application. +.Sh SEE ALSO +.Xr kld 4 , +.Xr linux 4 , +.Xr scsi 4 , +.Xr kldload 8 +.Sh AUTHORS +.An Achim Leubner +.Aq achim@FreeBSD.org +.An Ed Maste +.Aq emaste@FreeBSD.org +.An Scott Long +.Aq scottl@FreeBSD.org +.Sh BUGS +.Pp +The controller is not actually paused on suspend/resume. Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri May 24 09:21:18 2013 (r250962) +++ head/sys/amd64/conf/GENERIC Fri May 24 09:22:43 2013 (r250963) @@ -158,6 +158,7 @@ device tws # LSI 3ware 9750 SATA+SAS 6 # RAID controllers device aac # Adaptec FSA RAID device aacp # SCSI passthrough for aac (requires CAM) +device aacraid # Adaptec by PMC RAID device ida # Compaq Smart RAID device mfi # LSI MegaRAID SAS device mlx # Mylex DAC960 family Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri May 24 09:21:18 2013 (r250962) +++ head/sys/amd64/conf/NOTES Fri May 24 09:22:43 2013 (r250963) @@ -406,6 +406,10 @@ device aac device aacp # SCSI Passthrough interface (optional, CAM required) # +# Adaptec by PMC RAID controllers, Series 6/7/8 and upcoming families +device aacraid # Container interface, CAM required + +# # Highpoint RocketRAID 27xx. device hpt27xx Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 24 09:21:18 2013 (r250962) +++ head/sys/conf/files Fri May 24 09:22:43 2013 (r250963) @@ -573,6 +573,11 @@ dev/aac/aac_debug.c optional aac dev/aac/aac_disk.c optional aac dev/aac/aac_linux.c optional aac compat_linux dev/aac/aac_pci.c optional aac pci +dev/aacraid/aacraid.c optional aacraid +dev/aacraid/aacraid_cam.c optional aacraid scbus +dev/aacraid/aacraid_debug.c optional aacraid +dev/aacraid/aacraid_linux.c optional aacraid compat_linux +dev/aacraid/aacraid_pci.c optional aacraid pci dev/acpi_support/acpi_wmi.c optional acpi_wmi acpi dev/acpi_support/acpi_asus.c optional acpi_asus acpi dev/acpi_support/acpi_asus_wmi.c optional acpi_asus_wmi acpi Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri May 24 09:21:18 2013 (r250962) +++ head/sys/conf/options Fri May 24 09:22:43 2013 (r250963) @@ -31,6 +31,7 @@ # opt_.h AAC_DEBUG opt_aac.h +AACRAID_DEBUG opt_aacraid.h AHC_ALLOW_MEMIO opt_aic7xxx.h AHC_TMODE_ENABLE opt_aic7xxx.h AHC_DUMP_EEPROM opt_aic7xxx.h Added: head/sys/dev/aacraid/aacraid.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/aacraid/aacraid.c Fri May 24 09:22:43 2013 (r250963) @@ -0,0 +1,3501 @@ +/*- + * Copyright (c) 2000 Michael Smith + * Copyright (c) 2001 Scott Long + * Copyright (c) 2000 BSDi + * Copyright (c) 2001-2010 Adaptec, Inc. + * Copyright (c) 2010-2012 PMC-Sierra, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for the Adaptec by PMC Series 6,7,8,... families of RAID controllers + */ +#define AAC_DRIVERNAME "aacraid" + +#include "opt_aacraid.h" + +/* #include */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#ifndef FILTER_HANDLED +#define FILTER_HANDLED 0x02 +#endif + +static void aac_add_container(struct aac_softc *sc, + struct aac_mntinforesp *mir, int f, + u_int32_t uid); +static void aac_get_bus_info(struct aac_softc *sc); +static void aac_container_bus(struct aac_softc *sc); +static void aac_daemon(void *arg); +static int aac_convert_sgraw2(struct aac_softc *sc, struct aac_raw_io2 *raw, + int pages, int nseg, int nseg_new); + +/* Command Processing */ +static void aac_timeout(struct aac_softc *sc); +static void aac_command_thread(struct aac_softc *sc); +static int aac_sync_fib(struct aac_softc *sc, u_int32_t command, + u_int32_t xferstate, struct aac_fib *fib, + u_int16_t datasize); +/* Command Buffer Management */ +static void aac_map_command_helper(void *arg, bus_dma_segment_t *segs, + int nseg, int error); +static int aac_alloc_commands(struct aac_softc *sc); +static void aac_free_commands(struct aac_softc *sc); +static void aac_unmap_command(struct aac_command *cm); + +/* Hardware Interface */ +static int aac_alloc(struct aac_softc *sc); +static void aac_common_map(void *arg, bus_dma_segment_t *segs, int nseg, + int error); +static int aac_check_firmware(struct aac_softc *sc); +static int aac_init(struct aac_softc *sc); +static int aac_setup_intr(struct aac_softc *sc); + +/* PMC SRC interface */ +static int aac_src_get_fwstatus(struct aac_softc *sc); +static void aac_src_qnotify(struct aac_softc *sc, int qbit); +static int aac_src_get_istatus(struct aac_softc *sc); +static void aac_src_clear_istatus(struct aac_softc *sc, int mask); +static void aac_src_set_mailbox(struct aac_softc *sc, u_int32_t command, + u_int32_t arg0, u_int32_t arg1, + u_int32_t arg2, u_int32_t arg3); +static int aac_src_get_mailbox(struct aac_softc *sc, int mb); +static void aac_src_set_interrupts(struct aac_softc *sc, int enable); +static int aac_src_send_command(struct aac_softc *sc, struct aac_command *cm); +static int aac_src_get_outb_queue(struct aac_softc *sc); +static void aac_src_set_outb_queue(struct aac_softc *sc, int index); + +struct aac_interface aacraid_src_interface = { + aac_src_get_fwstatus, + aac_src_qnotify, + aac_src_get_istatus, + aac_src_clear_istatus, + aac_src_set_mailbox, + aac_src_get_mailbox, + aac_src_set_interrupts, + aac_src_send_command, + aac_src_get_outb_queue, + aac_src_set_outb_queue +}; + +/* PMC SRCv interface */ +static void aac_srcv_set_mailbox(struct aac_softc *sc, u_int32_t command, + u_int32_t arg0, u_int32_t arg1, + u_int32_t arg2, u_int32_t arg3); +static int aac_srcv_get_mailbox(struct aac_softc *sc, int mb); + +struct aac_interface aacraid_srcv_interface = { + aac_src_get_fwstatus, + aac_src_qnotify, + aac_src_get_istatus, + aac_src_clear_istatus, + aac_srcv_set_mailbox, + aac_srcv_get_mailbox, + aac_src_set_interrupts, + aac_src_send_command, + aac_src_get_outb_queue, + aac_src_set_outb_queue +}; + +/* Debugging and Diagnostics */ +static struct aac_code_lookup aac_cpu_variant[] = { + {"i960JX", CPUI960_JX}, + {"i960CX", CPUI960_CX}, + {"i960HX", CPUI960_HX}, + {"i960RX", CPUI960_RX}, + {"i960 80303", CPUI960_80303}, + {"StrongARM SA110", CPUARM_SA110}, + {"PPC603e", CPUPPC_603e}, + {"XScale 80321", CPU_XSCALE_80321}, + {"MIPS 4KC", CPU_MIPS_4KC}, + {"MIPS 5KC", CPU_MIPS_5KC}, + {"Unknown StrongARM", CPUARM_xxx}, + {"Unknown PowerPC", CPUPPC_xxx}, + {NULL, 0}, + {"Unknown processor", 0} +}; + +static struct aac_code_lookup aac_battery_platform[] = { + {"required battery present", PLATFORM_BAT_REQ_PRESENT}, + {"REQUIRED BATTERY NOT PRESENT", PLATFORM_BAT_REQ_NOTPRESENT}, + {"optional battery present", PLATFORM_BAT_OPT_PRESENT}, + {"optional battery not installed", PLATFORM_BAT_OPT_NOTPRESENT}, + {"no battery support", PLATFORM_BAT_NOT_SUPPORTED}, + {NULL, 0}, + {"unknown battery platform", 0} +}; +static void aac_describe_controller(struct aac_softc *sc); +static char *aac_describe_code(struct aac_code_lookup *table, + u_int32_t code); + +/* Management Interface */ +static d_open_t aac_open; +static d_ioctl_t aac_ioctl; +static d_poll_t aac_poll; +#if __FreeBSD_version >= 702000 +static void aac_cdevpriv_dtor(void *arg); +#else +static d_close_t aac_close; +#endif +static int aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib); +static int aac_ioctl_send_raw_srb(struct aac_softc *sc, caddr_t arg); +static void aac_handle_aif(struct aac_softc *sc, struct aac_fib *fib); +static void aac_request_aif(struct aac_softc *sc); +static int aac_rev_check(struct aac_softc *sc, caddr_t udata); +static int aac_open_aif(struct aac_softc *sc, caddr_t arg); +static int aac_close_aif(struct aac_softc *sc, caddr_t arg); +static int aac_getnext_aif(struct aac_softc *sc, caddr_t arg); +static int aac_return_aif(struct aac_softc *sc, + struct aac_fib_context *ctx, caddr_t uptr); +static int aac_query_disk(struct aac_softc *sc, caddr_t uptr); +static int aac_get_pci_info(struct aac_softc *sc, caddr_t uptr); +static int aac_supported_features(struct aac_softc *sc, caddr_t uptr); +static void aac_ioctl_event(struct aac_softc *sc, + struct aac_event *event, void *arg); +static int aac_reset_adapter(struct aac_softc *sc); +static int aac_get_container_info(struct aac_softc *sc, + struct aac_fib *fib, int cid, + struct aac_mntinforesp *mir, + u_int32_t *uid); +static u_int32_t + aac_check_adapter_health(struct aac_softc *sc, u_int8_t *bled); + +static struct cdevsw aacraid_cdevsw = { + .d_version = D_VERSION, + .d_flags = D_NEEDGIANT, + .d_open = aac_open, +#if __FreeBSD_version < 702000 + .d_close = aac_close, +#endif + .d_ioctl = aac_ioctl, + .d_poll = aac_poll, + .d_name = "aacraid", +}; + +MALLOC_DEFINE(M_AACRAIDBUF, "aacraid_buf", "Buffers for the AACRAID driver"); + +/* sysctl node */ +SYSCTL_NODE(_hw, OID_AUTO, aacraid, CTLFLAG_RD, 0, "AACRAID driver parameters"); + +/* + * Device Interface + */ + +/* + * Initialize the controller and softc + */ +int +aacraid_attach(struct aac_softc *sc) +{ + int error, unit; + struct aac_fib *fib; + struct aac_mntinforesp mir; + int count = 0, i = 0; + u_int32_t uid; + + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + sc->hint_flags = device_get_flags(sc->aac_dev); + /* + * Initialize per-controller queues. + */ + aac_initq_free(sc); + aac_initq_ready(sc); + aac_initq_busy(sc); + + /* mark controller as suspended until we get ourselves organised */ + sc->aac_state |= AAC_STATE_SUSPEND; + + /* + * Check that the firmware on the card is supported. + */ + if ((error = aac_check_firmware(sc)) != 0) + return(error); + + /* + * Initialize locks + */ + mtx_init(&sc->aac_io_lock, "AACRAID I/O lock", NULL, MTX_DEF); + TAILQ_INIT(&sc->aac_container_tqh); + TAILQ_INIT(&sc->aac_ev_cmfree); + +#if __FreeBSD_version >= 800000 + /* Initialize the clock daemon callout. */ + callout_init_mtx(&sc->aac_daemontime, &sc->aac_io_lock, 0); +#endif + /* + * Initialize the adapter. + */ + if ((error = aac_alloc(sc)) != 0) + return(error); + if (!(sc->flags & AAC_FLAGS_SYNC_MODE)) { + if ((error = aac_init(sc)) != 0) + return(error); + } + + /* + * Allocate and connect our interrupt. + */ + if ((error = aac_setup_intr(sc)) != 0) + return(error); + + /* + * Print a little information about the controller. + */ + aac_describe_controller(sc); + + /* + * Make the control device. + */ + unit = device_get_unit(sc->aac_dev); + sc->aac_dev_t = make_dev(&aacraid_cdevsw, unit, UID_ROOT, GID_OPERATOR, + 0640, "aacraid%d", unit); + sc->aac_dev_t->si_drv1 = sc; + + /* Create the AIF thread */ + if (aac_kthread_create((void(*)(void *))aac_command_thread, sc, + &sc->aifthread, 0, 0, "aacraid%daif", unit)) + panic("Could not create AIF thread"); + + /* Register the shutdown method to only be called post-dump */ + if ((sc->eh = EVENTHANDLER_REGISTER(shutdown_final, aacraid_shutdown, + sc->aac_dev, SHUTDOWN_PRI_DEFAULT)) == NULL) + device_printf(sc->aac_dev, + "shutdown event registration failed\n"); + + /* Find containers */ + mtx_lock(&sc->aac_io_lock); + aac_alloc_sync_fib(sc, &fib); + /* loop over possible containers */ + do { + if ((aac_get_container_info(sc, fib, i, &mir, &uid)) != 0) + continue; + if (i == 0) + count = mir.MntRespCount; + aac_add_container(sc, &mir, 0, uid); + i++; + } while ((i < count) && (i < AAC_MAX_CONTAINERS)); + aac_release_sync_fib(sc); + mtx_unlock(&sc->aac_io_lock); + + /* Register with CAM for the containers */ + TAILQ_INIT(&sc->aac_sim_tqh); + aac_container_bus(sc); + /* Register with CAM for the non-DASD devices */ + if ((sc->flags & AAC_FLAGS_ENABLE_CAM) != 0) + aac_get_bus_info(sc); + + /* poke the bus to actually attach the child devices */ + bus_generic_attach(sc->aac_dev); + + /* mark the controller up */ + sc->aac_state &= ~AAC_STATE_SUSPEND; + + /* enable interrupts now */ + AAC_UNMASK_INTERRUPTS(sc); + +#if __FreeBSD_version >= 800000 + mtx_lock(&sc->aac_io_lock); + callout_reset(&sc->aac_daemontime, 60 * hz, aac_daemon, sc); + mtx_unlock(&sc->aac_io_lock); +#else + { + struct timeval tv; + tv.tv_sec = 60; + tv.tv_usec = 0; + sc->timeout_id = timeout(aac_daemon, (void *)sc, tvtohz(&tv)); + } +#endif + + return(0); +} + +static void +aac_daemon(void *arg) +{ + struct aac_softc *sc; + struct timeval tv; + struct aac_command *cm; + struct aac_fib *fib; + + sc = arg; + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + +#if __FreeBSD_version >= 800000 + mtx_assert(&sc->aac_io_lock, MA_OWNED); + if (callout_pending(&sc->aac_daemontime) || + callout_active(&sc->aac_daemontime) == 0) + return; +#else + mtx_lock(&sc->aac_io_lock); +#endif + getmicrotime(&tv); + + if (!aacraid_alloc_command(sc, &cm)) { + fib = cm->cm_fib; + cm->cm_timestamp = time_uptime; + cm->cm_datalen = 0; + cm->cm_flags |= AAC_CMD_WAIT; + + fib->Header.Size = + sizeof(struct aac_fib_header) + sizeof(u_int32_t); + fib->Header.XferState = + AAC_FIBSTATE_HOSTOWNED | + AAC_FIBSTATE_INITIALISED | + AAC_FIBSTATE_EMPTY | + AAC_FIBSTATE_FROMHOST | + AAC_FIBSTATE_REXPECTED | + AAC_FIBSTATE_NORM | + AAC_FIBSTATE_ASYNC | + AAC_FIBSTATE_FAST_RESPONSE; + fib->Header.Command = SendHostTime; + *(uint32_t *)fib->data = tv.tv_sec; + + aacraid_map_command_sg(cm, NULL, 0, 0); + aacraid_release_command(cm); + } + +#if __FreeBSD_version >= 800000 + callout_schedule(&sc->aac_daemontime, 30 * 60 * hz); +#else + mtx_unlock(&sc->aac_io_lock); + tv.tv_sec = 30 * 60; + tv.tv_usec = 0; + sc->timeout_id = timeout(aac_daemon, (void *)sc, tvtohz(&tv)); +#endif +} + +void +aacraid_add_event(struct aac_softc *sc, struct aac_event *event) +{ + + switch (event->ev_type & AAC_EVENT_MASK) { + case AAC_EVENT_CMFREE: + TAILQ_INSERT_TAIL(&sc->aac_ev_cmfree, event, ev_links); + break; + default: + device_printf(sc->aac_dev, "aac_add event: unknown event %d\n", + event->ev_type); + break; + } + + return; +} + +/* + * Request information of container #cid + */ +static int +aac_get_container_info(struct aac_softc *sc, struct aac_fib *sync_fib, int cid, + struct aac_mntinforesp *mir, u_int32_t *uid) +{ + struct aac_command *cm; + struct aac_fib *fib; + struct aac_mntinfo *mi; + struct aac_cnt_config *ccfg; + + if (sync_fib == NULL) { + if (aacraid_alloc_command(sc, &cm)) { + device_printf(sc->aac_dev, + "Warning, no free command available\n"); + return (-1); + } + fib = cm->cm_fib; + } else { + fib = sync_fib; + } + + mi = (struct aac_mntinfo *)&fib->data[0]; + /* 4KB support?, 64-bit LBA? */ + if (sc->aac_support_opt2 & AAC_SUPPORTED_VARIABLE_BLOCK_SIZE) + mi->Command = VM_NameServeAllBlk; + else if (sc->flags & AAC_FLAGS_LBA_64BIT) + mi->Command = VM_NameServe64; + else + mi->Command = VM_NameServe; + mi->MntType = FT_FILESYS; + mi->MntCount = cid; + + if (sync_fib) { + if (aac_sync_fib(sc, ContainerCommand, 0, fib, + sizeof(struct aac_mntinfo))) { + device_printf(sc->aac_dev, "Error probing container %d\n", cid); + return (-1); + } + } else { + cm->cm_timestamp = time_uptime; + cm->cm_datalen = 0; + + fib->Header.Size = + sizeof(struct aac_fib_header) + sizeof(struct aac_mntinfo); + fib->Header.XferState = + AAC_FIBSTATE_HOSTOWNED | + AAC_FIBSTATE_INITIALISED | + AAC_FIBSTATE_EMPTY | + AAC_FIBSTATE_FROMHOST | + AAC_FIBSTATE_REXPECTED | + AAC_FIBSTATE_NORM | + AAC_FIBSTATE_ASYNC | + AAC_FIBSTATE_FAST_RESPONSE; + fib->Header.Command = ContainerCommand; + if (aacraid_wait_command(cm) != 0) { + device_printf(sc->aac_dev, "Error probing container %d\n", cid); + aacraid_release_command(cm); + return (-1); + } + } + bcopy(&fib->data[0], mir, sizeof(struct aac_mntinforesp)); + + /* UID */ + *uid = cid; + if (mir->MntTable[0].VolType != CT_NONE && + !(mir->MntTable[0].ContentState & AAC_FSCS_HIDDEN)) { + if (!(sc->aac_support_opt2 & AAC_SUPPORTED_VARIABLE_BLOCK_SIZE)) + mir->MntTable[0].ObjExtension.BlockSize = 0x200; + + ccfg = (struct aac_cnt_config *)&fib->data[0]; + bzero(ccfg, sizeof (*ccfg) - CT_PACKET_SIZE); + ccfg->Command = VM_ContainerConfig; + ccfg->CTCommand.command = CT_CID_TO_32BITS_UID; + ccfg->CTCommand.param[0] = cid; + + if (sync_fib) { + if (aac_sync_fib(sc, ContainerCommand, 0, fib, + sizeof(struct aac_cnt_config) == 0) && + ccfg->CTCommand.param[0] == ST_OK && + mir->MntTable[0].VolType != CT_PASSTHRU) + *uid = ccfg->CTCommand.param[1]; + } else { + fib->Header.Size = + sizeof(struct aac_fib_header) + sizeof(struct aac_cnt_config); + fib->Header.XferState = + AAC_FIBSTATE_HOSTOWNED | + AAC_FIBSTATE_INITIALISED | + AAC_FIBSTATE_EMPTY | + AAC_FIBSTATE_FROMHOST | + AAC_FIBSTATE_REXPECTED | + AAC_FIBSTATE_NORM | + AAC_FIBSTATE_ASYNC | + AAC_FIBSTATE_FAST_RESPONSE; + fib->Header.Command = ContainerCommand; + if (aacraid_wait_command(cm) == 0 && + ccfg->CTCommand.param[0] == ST_OK && + mir->MntTable[0].VolType != CT_PASSTHRU) + *uid = ccfg->CTCommand.param[1]; + aacraid_release_command(cm); + } + } + + return (0); +} + +/* + * Create a device to represent a new container + */ +static void +aac_add_container(struct aac_softc *sc, struct aac_mntinforesp *mir, int f, + u_int32_t uid) +{ + struct aac_container *co; + + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + + /* + * Check container volume type for validity. Note that many of + * the possible types may never show up. + */ + if ((mir->Status == ST_OK) && (mir->MntTable[0].VolType != CT_NONE)) { + co = (struct aac_container *)malloc(sizeof *co, M_AACRAIDBUF, + M_NOWAIT | M_ZERO); + if (co == NULL) { + panic("Out of memory?!"); + } + + co->co_found = f; + bcopy(&mir->MntTable[0], &co->co_mntobj, + sizeof(struct aac_mntobj)); + co->co_uid = uid; + TAILQ_INSERT_TAIL(&sc->aac_container_tqh, co, co_link); + } +} + +/* + * Allocate resources associated with (sc) + */ +static int +aac_alloc(struct aac_softc *sc) +{ + bus_size_t maxsize; + + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + + /* + * Create DMA tag for mapping buffers into controller-addressable space. + */ + if (bus_dma_tag_create(sc->aac_parent_dmat, /* parent */ + 1, 0, /* algnmnt, boundary */ + (sc->flags & AAC_FLAGS_SG_64BIT) ? + BUS_SPACE_MAXADDR : + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MAXBSIZE, /* maxsize */ + sc->aac_sg_tablesize, /* nsegments */ + MAXBSIZE, /* maxsegsize */ + BUS_DMA_ALLOCNOW, /* flags */ + busdma_lock_mutex, /* lockfunc */ + &sc->aac_io_lock, /* lockfuncarg */ + &sc->aac_buffer_dmat)) { + device_printf(sc->aac_dev, "can't allocate buffer DMA tag\n"); + return (ENOMEM); + } + + /* + * Create DMA tag for mapping FIBs into controller-addressable space.. + */ + if (sc->flags & AAC_FLAGS_NEW_COMM_TYPE1) + maxsize = sc->aac_max_fibs_alloc * (sc->aac_max_fib_size + + sizeof(struct aac_fib_xporthdr) + 31); + else + maxsize = sc->aac_max_fibs_alloc * (sc->aac_max_fib_size + 31); + if (bus_dma_tag_create(sc->aac_parent_dmat, /* parent */ + 1, 0, /* algnmnt, boundary */ + (sc->flags & AAC_FLAGS_4GB_WINDOW) ? + BUS_SPACE_MAXADDR_32BIT : + 0x7fffffff, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + maxsize, /* maxsize */ + 1, /* nsegments */ + maxsize, /* maxsize */ + 0, /* flags */ + NULL, NULL, /* No locking needed */ + &sc->aac_fib_dmat)) { + device_printf(sc->aac_dev, "can't allocate FIB DMA tag\n"); + return (ENOMEM); + } + + /* + * Create DMA tag for the common structure and allocate it. + */ + maxsize = sizeof(struct aac_common); + maxsize += sc->aac_max_fibs * sizeof(u_int32_t); + if (bus_dma_tag_create(sc->aac_parent_dmat, /* parent */ + 1, 0, /* algnmnt, boundary */ + (sc->flags & AAC_FLAGS_4GB_WINDOW) ? + BUS_SPACE_MAXADDR_32BIT : + 0x7fffffff, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + maxsize, /* maxsize */ + 1, /* nsegments */ + maxsize, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* No locking needed */ + &sc->aac_common_dmat)) { + device_printf(sc->aac_dev, + "can't allocate common structure DMA tag\n"); + return (ENOMEM); + } + if (bus_dmamem_alloc(sc->aac_common_dmat, (void **)&sc->aac_common, + BUS_DMA_NOWAIT, &sc->aac_common_dmamap)) { + device_printf(sc->aac_dev, "can't allocate common structure\n"); + return (ENOMEM); + } + + (void)bus_dmamap_load(sc->aac_common_dmat, sc->aac_common_dmamap, + sc->aac_common, maxsize, + aac_common_map, sc, 0); + bzero(sc->aac_common, maxsize); + + /* Allocate some FIBs and associated command structs */ + TAILQ_INIT(&sc->aac_fibmap_tqh); + sc->aac_commands = malloc(sc->aac_max_fibs * sizeof(struct aac_command), + M_AACRAIDBUF, M_WAITOK|M_ZERO); + mtx_lock(&sc->aac_io_lock); + while (sc->total_fibs < sc->aac_max_fibs) { + if (aac_alloc_commands(sc) != 0) + break; + } + mtx_unlock(&sc->aac_io_lock); + if (sc->total_fibs == 0) + return (ENOMEM); + + return (0); +} + +/* + * Free all of the resources associated with (sc) + * + * Should not be called if the controller is active. + */ +void +aacraid_free(struct aac_softc *sc) +{ + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + + /* remove the control device */ + if (sc->aac_dev_t != NULL) + destroy_dev(sc->aac_dev_t); + + /* throw away any FIB buffers, discard the FIB DMA tag */ + aac_free_commands(sc); + if (sc->aac_fib_dmat) + bus_dma_tag_destroy(sc->aac_fib_dmat); + + free(sc->aac_commands, M_AACRAIDBUF); + + /* destroy the common area */ + if (sc->aac_common) { + bus_dmamap_unload(sc->aac_common_dmat, sc->aac_common_dmamap); + bus_dmamem_free(sc->aac_common_dmat, sc->aac_common, + sc->aac_common_dmamap); + } + if (sc->aac_common_dmat) + bus_dma_tag_destroy(sc->aac_common_dmat); + + /* disconnect the interrupt handler */ + if (sc->aac_intr) + bus_teardown_intr(sc->aac_dev, sc->aac_irq, sc->aac_intr); + if (sc->aac_irq != NULL) + bus_release_resource(sc->aac_dev, SYS_RES_IRQ, sc->aac_irq_rid, + sc->aac_irq); + + /* destroy data-transfer DMA tag */ + if (sc->aac_buffer_dmat) + bus_dma_tag_destroy(sc->aac_buffer_dmat); + + /* destroy the parent DMA tag */ + if (sc->aac_parent_dmat) + bus_dma_tag_destroy(sc->aac_parent_dmat); + + /* release the register window mapping */ + if (sc->aac_regs_res0 != NULL) + bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, + sc->aac_regs_rid0, sc->aac_regs_res0); + if (sc->aac_regs_res1 != NULL) + bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, + sc->aac_regs_rid1, sc->aac_regs_res1); +} + +/* + * Disconnect from the controller completely, in preparation for unload. + */ +int +aacraid_detach(device_t dev) +{ + struct aac_softc *sc; + struct aac_container *co; + struct aac_sim *sim; + int error; + + sc = device_get_softc(dev); + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + +#if __FreeBSD_version >= 800000 + callout_drain(&sc->aac_daemontime); +#else + untimeout(aac_daemon, (void *)sc, sc->timeout_id); +#endif + /* Remove the child containers */ + while ((co = TAILQ_FIRST(&sc->aac_container_tqh)) != NULL) { + TAILQ_REMOVE(&sc->aac_container_tqh, co, co_link); + free(co, M_AACRAIDBUF); + } + + /* Remove the CAM SIMs */ + while ((sim = TAILQ_FIRST(&sc->aac_sim_tqh)) != NULL) { + TAILQ_REMOVE(&sc->aac_sim_tqh, sim, sim_link); + error = device_delete_child(dev, sim->sim_dev); + if (error) + return (error); + free(sim, M_AACRAIDBUF); + } + + if (sc->aifflags & AAC_AIFFLAGS_RUNNING) { + sc->aifflags |= AAC_AIFFLAGS_EXIT; + wakeup(sc->aifthread); + tsleep(sc->aac_dev, PUSER | PCATCH, "aac_dch", 30 * hz); + } + + if (sc->aifflags & AAC_AIFFLAGS_RUNNING) + panic("Cannot shutdown AIF thread"); + + if ((error = aacraid_shutdown(dev))) + return(error); + + EVENTHANDLER_DEREGISTER(shutdown_final, sc->eh); + + aacraid_free(sc); + + mtx_destroy(&sc->aac_io_lock); + + return(0); +} + +/* + * Bring the controller down to a dormant state and detach all child devices. + * + * This function is called before detach or system shutdown. + * + * Note that we can assume that the bioq on the controller is empty, as we won't + * allow shutdown if any device is open. + */ +int +aacraid_shutdown(device_t dev) +{ + struct aac_softc *sc; + struct aac_fib *fib; + struct aac_close_command *cc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 24 09:30:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0F25A66D; Fri, 24 May 2013 09:30:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F40DADE7; Fri, 24 May 2013 09:30:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4O9UAkW042696; Fri, 24 May 2013 09:30:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4O9UAgb042695; Fri, 24 May 2013 09:30:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305240930.r4O9UAgb042695@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 24 May 2013 09:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250964 - stable/9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 09:30:11 -0000 Author: kib Date: Fri May 24 09:30:10 2013 New Revision: 250964 URL: http://svnweb.freebsd.org/changeset/base/250964 Log: MFC r250740: Add new capability types encodings from HyperTransport I/O Link Specification revisions 3.00 and 3.10. Modified: stable/9/sys/dev/pci/pcireg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/pci/pcireg.h ============================================================================== --- stable/9/sys/dev/pci/pcireg.h Fri May 24 09:22:43 2013 (r250963) +++ stable/9/sys/dev/pci/pcireg.h Fri May 24 09:30:10 2013 (r250964) @@ -612,6 +612,10 @@ #define PCIM_HTCAP_VCSET 0xb800 /* 10111 */ #define PCIM_HTCAP_RETRY_MODE 0xc000 /* 11000 */ #define PCIM_HTCAP_X86_ENCODING 0xc800 /* 11001 */ +#define PCIM_HTCAP_GEN3 0xd000 /* 11010 */ +#define PCIM_HTCAP_FLE 0xd800 /* 11011 */ +#define PCIM_HTCAP_PM 0xe000 /* 11100 */ +#define PCIM_HTCAP_HIGH_NODE_COUNT 0xe800 /* 11101 */ /* HT MSI Mapping Capability definitions. */ #define PCIM_HTCMD_MSI_ENABLE 0x0001 From owner-svn-src-all@FreeBSD.ORG Fri May 24 09:33:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C09CF9C5; Fri, 24 May 2013 09:33:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B22F4E20; Fri, 24 May 2013 09:33:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4O9Xu1i044848; Fri, 24 May 2013 09:33:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4O9XuA6044847; Fri, 24 May 2013 09:33:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305240933.r4O9XuA6044847@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 24 May 2013 09:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250965 - stable/9/usr.sbin/pciconf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 09:33:56 -0000 Author: kib Date: Fri May 24 09:33:55 2013 New Revision: 250965 URL: http://svnweb.freebsd.org/changeset/base/250965 Log: MFC r250741: Decode new HT 3.00 and 3.10 capabilities. Modified: stable/9/usr.sbin/pciconf/cap.c Directory Properties: stable/9/usr.sbin/pciconf/ (props changed) Modified: stable/9/usr.sbin/pciconf/cap.c ============================================================================== --- stable/9/usr.sbin/pciconf/cap.c Fri May 24 09:30:10 2013 (r250964) +++ stable/9/usr.sbin/pciconf/cap.c Fri May 24 09:33:55 2013 (r250965) @@ -276,6 +276,18 @@ cap_ht(int fd, struct pci_conf *p, uint8 case PCIM_HTCAP_X86_ENCODING: printf("X86 encoding"); break; + case PCIM_HTCAP_GEN3: + printf("Gen3"); + break; + case PCIM_HTCAP_FLE: + printf("function-level extension"); + break; + case PCIM_HTCAP_PM: + printf("power management"); + break; + case PCIM_HTCAP_HIGH_NODE_COUNT: + printf("high node count"); + break; default: printf("unknown %02x", command); break; From owner-svn-src-all@FreeBSD.ORG Fri May 24 09:48:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 31EE236D; Fri, 24 May 2013 09:48:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 22B3BF04; Fri, 24 May 2013 09:48:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4O9mhbs049399; Fri, 24 May 2013 09:48:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4O9mhUm049398; Fri, 24 May 2013 09:48:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305240948.r4O9mhUm049398@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 24 May 2013 09:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250966 - head/sys/dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 09:48:43 -0000 Author: kib Date: Fri May 24 09:48:42 2013 New Revision: 250966 URL: http://svnweb.freebsd.org/changeset/base/250966 Log: Fix the data corruption on the swap-backed md. Assign the rv variable a success code if the pager was not asked for the page. Using an error code from the previous processed page caused zeroing of the valid page, when e.g. the previous page was not available in the pager. Reported by: lstewart Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Fri May 24 09:33:55 2013 (r250965) +++ head/sys/dev/md/md.c Fri May 24 09:48:42 2013 (r250966) @@ -829,7 +829,9 @@ mdstart_swap(struct md_s *sc, struct bio m = vm_page_grab(sc->object, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (bp->bio_cmd == BIO_READ) { - if (m->valid != VM_PAGE_BITS_ALL) + if (m->valid == VM_PAGE_BITS_ALL) + rv = VM_PAGER_OK; + else rv = vm_pager_get_pages(sc->object, &m, 1, 0); if (rv == VM_PAGER_ERROR) { vm_page_wakeup(m); @@ -854,6 +856,8 @@ mdstart_swap(struct md_s *sc, struct bio } else if (bp->bio_cmd == BIO_WRITE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); + else + rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { vm_page_wakeup(m); break; @@ -868,6 +872,8 @@ mdstart_swap(struct md_s *sc, struct bio } else if (bp->bio_cmd == BIO_DELETE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); + else + rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { vm_page_wakeup(m); break; From owner-svn-src-all@FreeBSD.ORG Fri May 24 11:27:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 115E8430; Fri, 24 May 2013 11:27:07 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 031A17BB; Fri, 24 May 2013 11:27:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4OBR6tW085129; Fri, 24 May 2013 11:27:06 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4OBR6Wh085128; Fri, 24 May 2013 11:27:06 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305241127.r4OBR6Wh085128@svn.freebsd.org> From: Steven Hartland Date: Fri, 24 May 2013 11:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250967 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 11:27:07 -0000 Author: smh Date: Fri May 24 11:27:06 2013 New Revision: 250967 URL: http://svnweb.freebsd.org/changeset/base/250967 Log: Enforce validation on the selected delete method via sysctl. This prevents users from selecting a delete method which may cause corruption e.g. MPS WS16 on pre P14 firmware. Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 2 days Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri May 24 09:48:42 2013 (r250966) +++ head/sys/cam/scsi/scsi_da.c Fri May 24 11:27:06 2013 (r250967) @@ -1780,7 +1780,8 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS if (error != 0 || req->newptr == NULL) return (error); for (i = 0; i <= DA_DELETE_MAX; i++) { - if (strcmp(buf, da_delete_method_names[i]) != 0) + if (!(softc->delete_available & (1 << i)) || + strcmp(buf, da_delete_method_names[i]) != 0) continue; dadeletemethodset(softc, i); return (0); From owner-svn-src-all@FreeBSD.ORG Fri May 24 14:57:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A7D9C778; Fri, 24 May 2013 14:57:38 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98B43798; Fri, 24 May 2013 14:57:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4OEvce6058992; Fri, 24 May 2013 14:57:38 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4OEvcA1058991; Fri, 24 May 2013 14:57:38 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201305241457.r4OEvcA1058991@svn.freebsd.org> From: Jamie Gritton Date: Fri, 24 May 2013 14:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250968 - head/share/man/man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 14:57:38 -0000 Author: jamie Date: Fri May 24 14:57:38 2013 New Revision: 250968 URL: http://svnweb.freebsd.org/changeset/base/250968 Log: Mention the "nojailvnet" keyword. MFC after: 3 days Modified: head/share/man/man8/rc.8 Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Fri May 24 11:27:06 2013 (r250967) +++ head/share/man/man8/rc.8 Fri May 24 14:57:38 2013 (r250968) @@ -124,7 +124,9 @@ Load the configuration files. Determine if booting in a jail, and add .Dq Li nojail -to the list of KEYWORDS to skip in +(no jails allowed) or +.Dq Li nojailvnet +(only allow vnet-enabled jails) to the list of KEYWORDS to skip in .Xr rcorder 8 . .It Invoke From owner-svn-src-all@FreeBSD.ORG Fri May 24 15:53:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8A08BFB0; Fri, 24 May 2013 15:53:13 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7CD7CAA0; Fri, 24 May 2013 15:53:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4OFrDEZ079388; Fri, 24 May 2013 15:53:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4OFrDi3079387; Fri, 24 May 2013 15:53:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305241553.r4OFrDi3079387@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 24 May 2013 15:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250969 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 15:53:13 -0000 Author: marcel Date: Fri May 24 15:53:13 2013 New Revision: 250969 URL: http://svnweb.freebsd.org/changeset/base/250969 Log: Fix building on slightly older -current and stable systems after the switch to bmake. The rescue bits are built via crunchgen, which didn't respect the MAKE environment variable until r237574 (i.e. ~11 months ago). This resulted in a failure due to bmake's internal -J flag being passed around and not being understood by the standard (i.e. host's) make. Note that the failure is conditional upon having the jobServer feature enabled within bmake. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri May 24 14:57:38 2013 (r250968) +++ head/Makefile.inc1 Fri May 24 15:53:13 2013 (r250969) @@ -1215,6 +1215,10 @@ _yacc= lib/liby \ usr.bin/yacc .endif +.if ${BOOTSTRAPPING} < 1000014 +_crunch= usr.sbin/crunch +.endif + .if ${BOOTSTRAPPING} < 1000026 _nmtree= lib/libnetbsd \ usr.sbin/nmtree @@ -1293,6 +1297,7 @@ bootstrap-tools: usr.bin/xinstall \ ${_gensnmptree} \ usr.sbin/config \ + ${_crunch} \ ${_nmtree} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool}; \ From owner-svn-src-all@FreeBSD.ORG Fri May 24 16:07:47 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 70EF0659; Fri, 24 May 2013 16:07:47 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id A9DF8B6E; Fri, 24 May 2013 16:07:46 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4OG7dFb045678; Fri, 24 May 2013 11:07:39 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4OG7dDH045677; Fri, 24 May 2013 11:07:39 -0500 (CDT) (envelope-from brooks) Date: Fri, 24 May 2013 11:07:39 -0500 From: Brooks Davis To: Antoine Brodin Subject: Re: svn commit: r250860 - head/gnu/usr.bin/diff Message-ID: <20130524160739.GA45194@lor.one-eyed-alien.net> References: <201305211728.r4LHSJci081409@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Marcel Moolenaar , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 16:07:47 -0000 --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 24, 2013 at 06:06:59AM +0000, Antoine Brodin wrote: > On Tue, May 21, 2013 at 5:28 PM, Marcel Moolenaar wr= ote: > > Author: marcel > > Date: Tue May 21 17:28:19 2013 > > New Revision: 250860 > > URL: http://svnweb.freebsd.org/changeset/base/250860 > > > > Log: > > Don't look for headers outside of the source or object directories. In > > particular, don't use DESTDIR. Such creates an unnecessary dependency > > on the build machine. > > > > Obtained from: Juniper Networks, Inc. >=20 > Actually during world stage, > WMAKE=3D${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=3D${W= ORLDTMP} > So I think it was picking up headers from the correct place. During the build, headers should either be found directly in the source tree, or in WORLDTMP because it is specified as the compiler's sysroot, not because the path is hardcoded. -- Brooks --tThc/1wpZn/ma/RB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRn5BLXY6L6fI4GtQRApOPAKC9tuU45uomNg9eX33eagLJXqVhhACgx8hk YZVcr49l9DC0yZig7HgsAg4= =BREG -----END PGP SIGNATURE----- --tThc/1wpZn/ma/RB-- From owner-svn-src-all@FreeBSD.ORG Fri May 24 18:26:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E5FB4D47; Fri, 24 May 2013 18:26:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D666E819; Fri, 24 May 2013 18:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4OIQCSq033558; Fri, 24 May 2013 18:26:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4OIQCsc033557; Fri, 24 May 2013 18:26:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305241826.r4OIQCsc033557@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 24 May 2013 18:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250970 - stable/8/sys/dev/pci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 18:26:13 -0000 Author: kib Date: Fri May 24 18:26:12 2013 New Revision: 250970 URL: http://svnweb.freebsd.org/changeset/base/250970 Log: MFC r250740: Add new capability types encodings from HyperTransport I/O Link Specification revisions 3.00 and 3.10. Modified: stable/8/sys/dev/pci/pcireg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) Modified: stable/8/sys/dev/pci/pcireg.h ============================================================================== --- stable/8/sys/dev/pci/pcireg.h Fri May 24 15:53:13 2013 (r250969) +++ stable/8/sys/dev/pci/pcireg.h Fri May 24 18:26:12 2013 (r250970) @@ -609,6 +609,10 @@ #define PCIM_HTCAP_VCSET 0xb800 /* 10111 */ #define PCIM_HTCAP_RETRY_MODE 0xc000 /* 11000 */ #define PCIM_HTCAP_X86_ENCODING 0xc800 /* 11001 */ +#define PCIM_HTCAP_GEN3 0xd000 /* 11010 */ +#define PCIM_HTCAP_FLE 0xd800 /* 11011 */ +#define PCIM_HTCAP_PM 0xe000 /* 11100 */ +#define PCIM_HTCAP_HIGH_NODE_COUNT 0xe800 /* 11101 */ /* HT MSI Mapping Capability definitions. */ #define PCIM_HTCMD_MSI_ENABLE 0x0001 From owner-svn-src-all@FreeBSD.ORG Fri May 24 18:28:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9801AFBA; Fri, 24 May 2013 18:28:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8837C836; Fri, 24 May 2013 18:28:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4OISRUw034038; Fri, 24 May 2013 18:28:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4OISRCa034037; Fri, 24 May 2013 18:28:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305241828.r4OISRCa034037@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 24 May 2013 18:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250971 - stable/8/usr.sbin/pciconf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 18:28:27 -0000 Author: kib Date: Fri May 24 18:28:27 2013 New Revision: 250971 URL: http://svnweb.freebsd.org/changeset/base/250971 Log: MFC r250741: Decode new HT 3.00 and 3.10 capabilities. Modified: stable/8/usr.sbin/pciconf/cap.c Directory Properties: stable/8/usr.sbin/pciconf/ (props changed) Modified: stable/8/usr.sbin/pciconf/cap.c ============================================================================== --- stable/8/usr.sbin/pciconf/cap.c Fri May 24 18:26:12 2013 (r250970) +++ stable/8/usr.sbin/pciconf/cap.c Fri May 24 18:28:27 2013 (r250971) @@ -276,6 +276,18 @@ cap_ht(int fd, struct pci_conf *p, uint8 case PCIM_HTCAP_X86_ENCODING: printf("X86 encoding"); break; + case PCIM_HTCAP_GEN3: + printf("Gen3"); + break; + case PCIM_HTCAP_FLE: + printf("function-level extension"); + break; + case PCIM_HTCAP_PM: + printf("power management"); + break; + case PCIM_HTCAP_HIGH_NODE_COUNT: + printf("high node count"); + break; default: printf("unknown %02x", command); break; From owner-svn-src-all@FreeBSD.ORG Fri May 24 18:54:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C9416A8A; Fri, 24 May 2013 18:54:52 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9E5598F; Fri, 24 May 2013 18:54:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4OIsq1b043688; Fri, 24 May 2013 18:54:52 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4OIsqdU043683; Fri, 24 May 2013 18:54:52 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201305241854.r4OIsqdU043683@svn.freebsd.org> From: Stefan Esser Date: Fri, 24 May 2013 18:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250972 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 18:54:52 -0000 Author: se Date: Fri May 24 18:54:52 2013 New Revision: 250972 URL: http://svnweb.freebsd.org/changeset/base/250972 Log: The error handling for writes to the target file could lead to the final fclose() being skipped. Fix this by using boolean "&" and "|" instead of short-cut operators "&&" and "||". While here, increment the last part of the version string. The reason is the fixed output file selection logic in pch.c, which was committed as r250943, yesterday. Reviewed by: pfg Modified: head/usr.bin/patch/patch.c head/usr.bin/patch/util.c Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Fri May 24 18:28:27 2013 (r250971) +++ head/usr.bin/patch/patch.c Fri May 24 18:54:52 2013 (r250972) @@ -303,7 +303,7 @@ main(int argc, char *argv[]) ++fuzz <= mymaxfuzz); if (skip_rest_of_patch) { /* just got decided */ - if (ferror(ofp) || fclose(ofp)) { + if (ferror(ofp) | fclose(ofp)) { say("Error writing %s\n", TMPOUTNAME); error = 1; @@ -385,7 +385,7 @@ main(int argc, char *argv[]) } } } - if (ferror(rejfp) || fclose(rejfp)) { + if (ferror(rejfp) | fclose(rejfp)) { say("Error writing %s\n", rejname); error = 1; } @@ -977,7 +977,7 @@ spew_output(void) #endif if (input_lines) copy_till(input_lines, true); /* dump remainder of file */ - rv = ferror(ofp) == 0 && fclose(ofp) == 0; + rv = ferror(ofp) == 0 & fclose(ofp) == 0; ofp = NULL; return rv; } Modified: head/usr.bin/patch/util.c ============================================================================== --- head/usr.bin/patch/util.c Fri May 24 18:28:27 2013 (r250971) +++ head/usr.bin/patch/util.c Fri May 24 18:54:52 2013 (r250972) @@ -412,7 +412,7 @@ checked_in(char *file) void version(void) { - fprintf(stderr, "patch 2.0-12u8 FreeBSD\n"); + fprintf(stderr, "patch 2.0-12u9 FreeBSD\n"); my_exit(EXIT_SUCCESS); } From owner-svn-src-all@FreeBSD.ORG Fri May 24 18:59:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BEDB9D81; Fri, 24 May 2013 18:59:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 947269DF; Fri, 24 May 2013 18:59:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4OIxjJu044602; Fri, 24 May 2013 18:59:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4OIxjT7044598; Fri, 24 May 2013 18:59:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305241859.r4OIxjT7044598@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 24 May 2013 18:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250973 - in stable/9: lib/libc/sys sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 18:59:45 -0000 Author: jilles Date: Fri May 24 18:59:44 2013 New Revision: 250973 URL: http://svnweb.freebsd.org/changeset/base/250973 Log: MFC r248593: Allow O_CLOEXEC in posix_openpt() flags. PR: kern/162374 Modified: stable/9/lib/libc/sys/posix_openpt.2 stable/9/sys/kern/tty_pts.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/lib/libc/sys/posix_openpt.2 ============================================================================== --- stable/9/lib/libc/sys/posix_openpt.2 Fri May 24 18:54:52 2013 (r250972) +++ stable/9/lib/libc/sys/posix_openpt.2 Fri May 24 18:59:44 2013 (r250973) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd March 21, 2013 .Dt POSIX_OPENPT 2 .Os .Sh NAME @@ -71,7 +71,7 @@ Values for are constructed by a bitwise-inclusive OR of flags from the following list, defined in .In fcntl.h : -.Bl -tag -width ".Dv O_NOCTTY" +.Bl -tag -width ".Dv O_CLOEXEC" .It Dv O_RDWR Open for reading and writing. .It Dv O_NOCTTY @@ -79,6 +79,8 @@ If set .Fn posix_openpt shall not cause the terminal device to become the controlling terminal for the process. +.It Dv O_CLOEXEC +Set the close-on-exec flag for the new file descriptor. .El .Pp The @@ -116,6 +118,9 @@ The .Fn posix_openpt function conforms to .St -p1003.1-2001 . +The ability to use +.Dv O_CLOEXEC +is an extension to the standard. .Sh HISTORY The .Fn posix_openpt Modified: stable/9/sys/kern/tty_pts.c ============================================================================== --- stable/9/sys/kern/tty_pts.c Fri May 24 18:54:52 2013 (r250972) +++ stable/9/sys/kern/tty_pts.c Fri May 24 18:59:44 2013 (r250973) @@ -825,10 +825,10 @@ sys_posix_openpt(struct thread *td, stru * POSIX states it's unspecified when other flags are passed. We * don't allow this. */ - if (uap->flags & ~(O_RDWR|O_NOCTTY)) + if (uap->flags & ~(O_RDWR|O_NOCTTY|O_CLOEXEC)) return (EINVAL); - error = falloc(td, &fp, &fd, 0); + error = falloc(td, &fp, &fd, uap->flags); if (error) return (error); From owner-svn-src-all@FreeBSD.ORG Sat May 25 04:31:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7703B152; Sat, 25 May 2013 04:31:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id ACC10CDE; Sat, 25 May 2013 04:31:23 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id BF95B3C0F89; Sat, 25 May 2013 14:31:13 +1000 (EST) Date: Sat, 25 May 2013 14:31:12 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Stefan Esser Subject: Re: svn commit: r250972 - head/usr.bin/patch In-Reply-To: <201305241854.r4OIsqdU043683@svn.freebsd.org> Message-ID: <20130525122811.I837@besplex.bde.org> References: <201305241854.r4OIsqdU043683@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=e4Ne0tV/ c=1 sm=1 a=0a0yn1FGu_gA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=LFobCLJwE3wA:10 a=XiyeFtOnGEAfIyXm6x0A:9 a=CjuIK1q_8ugA:10 a=g5uRMmmX2DZn2s7N:21 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 04:31:24 -0000 On Fri, 24 May 2013, Stefan Esser wrote: > ... > Log: > The error handling for writes to the target file could lead to the final > fclose() being skipped. Fix this by using boolean "&" and "|" instead of > short-cut operators "&&" and "||". > While here, increment the last part of the version string. The reason is > the fixed output file selection logic in pch.c, which was committed as > r250943, yesterday. > > Reviewed by: pfg > ... > Modified: head/usr.bin/patch/patch.c > ============================================================================== > --- head/usr.bin/patch/patch.c Fri May 24 18:28:27 2013 (r250971) > +++ head/usr.bin/patch/patch.c Fri May 24 18:54:52 2013 (r250972) > @@ -303,7 +303,7 @@ main(int argc, char *argv[]) > ++fuzz <= mymaxfuzz); > > if (skip_rest_of_patch) { /* just got decided */ > - if (ferror(ofp) || fclose(ofp)) { > + if (ferror(ofp) | fclose(ofp)) { > say("Error writing %s\n", > TMPOUTNAME); > error = 1; This is more broken than before. Now the order of operations is indeterminate, so the behaviour is undefined if fclose(ofp) is evaluated before ferror(ofp) (then ferror(ofp) is passed an invalid pointer). Now even the usual case when there is no error initially is broken. According to C99 6.5: [#3] The grouping of operators and operands is indicated by the syntax.61) Except as specified later (for the function- call (), &&, ||, ?:, and comma operators), the order of evaluation of subexpressions and the order in which side effects take place are both unspecified. The && and || operators are often abused slightly, as here, to get a particular order of evaluation in a largish subexpression. > @@ -385,7 +385,7 @@ main(int argc, char *argv[]) > } > } > } > - if (ferror(rejfp) || fclose(rejfp)) { > + if (ferror(rejfp) | fclose(rejfp)) { > say("Error writing %s\n", rejname); > error = 1; > } Similarly. > @@ -977,7 +977,7 @@ spew_output(void) > #endif > if (input_lines) > copy_till(input_lines, true); /* dump remainder of file */ > - rv = ferror(ofp) == 0 && fclose(ofp) == 0; > + rv = ferror(ofp) == 0 & fclose(ofp) == 0; > ofp = NULL; > return rv; > } SImilarly. > ... Error handling is very rarely correct in utilities that use stdio. patch at least checks for errors. The easiest way to improve it (not just for patch) is to sprinkle fflush()es. Blindly doing voided fflush()es before every ferror() check ensures that output gets done and checked even if you neglect to do fclose() or check for errors in it (provided you have enough ferror() checks). This is especially important and especially mostly not done for stdout and stderr, since it is best to never close these (it may be impossible to report errors on stdout or stderr on themself, especially for stderr, but it doesn't hurt to try, except this may inhibit more correct error handling like logging the error to another file). patch/pch.c has another ferror() || fclose() that wasn't touched by this commit. It is almost OK, since the file was just opened successfully so ferror() on it "can't happen". But this means that the normal broken idiom 'ferror() || fclose()' is not even wrong. I think ferror() in 'ferror() || fclose()' should never be necessary unless you actually want to keep the file open if ferror(), and then you should normally use clearerr() in the error handling. C99 is almost clear that fclose() must fail if ferror() was true when it was called. It says that fclose() returns EOF iff any errors were detected, and it would take a weaselish reading of this to not allow detection of errors that are already present when it was called. patch might be using 'ferror() || fclose() because it doesn't trust pre-C90 stdio. It is also a style bug to use the bitwise boolean operations for logical boolean operations. When we need sequential evaluation, this becomes a bug. We want sequential evaluation, and that should be written normally using sequence points (which are easiest to get using separate statements) if the logical boolean operations aren't suitable. So to combine the errors from ferror() and fclose() so as to support buggy fclose()'s, and to do this without sprinkling ferror(), we must write something like: locerror = 0; if (ferror(ofp) locerror = 1; if (fclose(ofp) locerror = 1; if (locerror) { say("Error writing %s\n", TMPOUTNAME); error = 1; This is too ugly. I prefer to depend on fclose() being non-broken. Unfortunately, fclose() seems to be broken in FreeBSD: @ #include @ @ int @ main(void) @ { @ FILE *fp; @ @ remove("test.dat"); @ fp = fopen("test.dat", "a"); @ fclose(fp); @ fp = fopen("test.dat", "r"); @ (void)fwrite("", 1, 1, fp); @ fprintf(stderr, "ferror %d\n", ferror(fp)); @ fprintf(stderr, "fclose %d\n", fclose(fp)); @ return (0); @ } This finds ferror(), but then fclose() succeeds. Setting ferror() without having any real i/o problems isn't easy, and this example is contrived since the file is only open for input, so fclose() cannot have any buffered output to flush. However, there points to a general problem with ferror() -- the error flag is shared between input and output, so if fclose() always checked the flag and failed if it is set, then its failure wouldn't be useful for detecting output errors. Neither would ferror(). So if the stream is open for both reading and writing, the application should do something like clearerr() before all fflush() and fclose() operations so as to detect only write errors. fclose() in FreeBSD doesn't seem to check the flag at all. I can't see exactly what it does. The low level function __sflush() mainly tries to write all buffered i/o. It sets ferror() and returns an error if any of the writes fails, but it doesn't return an error if ferror() is already true. Bruce From owner-svn-src-all@FreeBSD.ORG Sat May 25 05:11:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A47BC759; Sat, 25 May 2013 05:11:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with ESMTP id 6E519E44; Sat, 25 May 2013 05:11:30 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 14A0723F804; Sat, 25 May 2013 01:11:28 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 14A0723F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Sat, 25 May 2013 01:11:27 -0400 From: Glen Barber To: Stefan Esser Subject: Re: svn commit: r250972 - head/usr.bin/patch Message-ID: <20130525051127.GP1756@glenbarber.us> References: <201305241854.r4OIsqdU043683@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FYef6pHvFBuPZp1D" Content-Disposition: inline In-Reply-To: <201305241854.r4OIsqdU043683@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 05:11:30 -0000 --FYef6pHvFBuPZp1D Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 24, 2013 at 06:54:52PM +0000, Stefan Esser wrote: > Author: se > Date: Fri May 24 18:54:52 2013 > New Revision: 250972 > URL: http://svnweb.freebsd.org/changeset/base/250972 >=20 > [...] > @@ -977,7 +977,7 @@ spew_output(void) > #endif > if (input_lines) > copy_till(input_lines, true); /* dump remainder of file */ > - rv =3D ferror(ofp) =3D=3D 0 && fclose(ofp) =3D=3D 0; > + rv =3D ferror(ofp) =3D=3D 0 & fclose(ofp) =3D=3D 0; > ofp =3D NULL; > return rv; > } >=20 This breaks head/. =3D=3D=3D> usr.bin/patch (all) cc -O2 -pipe -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-paramete r -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-str ings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-exter ns -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /src/usr.bin/patch/backupfile.c cc -O2 -pipe -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-paramete r -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-str ings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-exter ns -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /src/usr.bin/patch/inp.c cc -O2 -pipe -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-paramete r -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-str ings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-exter ns -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /src/usr.bin/patch/mkpath.c cc -O2 -pipe -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-paramete r -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-str ings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-exter ns -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /src/usr.bin/patch/patch.c cc1: warnings being treated as errors /src/usr.bin/patch/patch.c: In function 'spew_output': /src/usr.bin/patch/patch.c:980: warning: suggest parentheses around compari= son in operand of & *** Error code 1 Stop. make: stopped in /src/usr.bin/patch *** Error code 1 Stop. make: stopped in /src/usr.bin *** Error code 1 Glen --FYef6pHvFBuPZp1D Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJRoEf/AAoJEFJPDDeguUajNvQIALnu9zMPNnLx0cBE8zb3kBiL sZL0L/T35j6x8KwDgrVVDZrPdsMvQGAH3YRiOv4aWZr2n61qJWrQOWed2GmCmVmc fgNTrhJQdFRmFq0fNuQCybgkoMKOXzOGe2tujR8hcrRVcpUQW2WrdpRGNDYal8oa NHTNNg0+bKOOoV8fDhZkXlJMXJBWQylI5VwXcX/D482zR8LJacW6kUKu+ErxPmeN oSmpaZDuUkjCWKp/BIRFIfe8CdbUy2cI5k1JDmWX8932wM0n8Qfl04qxSH78XsZx HeVxJYqwCMkbKGW6/ntbmyYnjgN6qu3Oxsksctgcne2tawk5Av531p70ouE1w/0= =0MlY -----END PGP SIGNATURE----- --FYef6pHvFBuPZp1D-- From owner-svn-src-all@FreeBSD.ORG Sat May 25 06:28:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0E5C2867; Sat, 25 May 2013 06:28:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA4A3E9; Sat, 25 May 2013 06:28:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4P6SUnA085328; Sat, 25 May 2013 06:28:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4P6SUIe085327; Sat, 25 May 2013 06:28:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305250628.r4P6SUIe085327@svn.freebsd.org> From: Adrian Chadd Date: Sat, 25 May 2013 06:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250974 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 06:28:31 -0000 Author: adrian Date: Sat May 25 06:28:30 2013 New Revision: 250974 URL: http://svnweb.freebsd.org/changeset/base/250974 Log: Fix net80211 fragment creation. When creating fragment frames, the header length should honour the DATAPAD flag. This fixes the fragments that are queued to the ath(4) driver but it doesn't yet fix fragment transmission. That requires further changes to the ath(4) transmit path. Well, strictly speaking, it requires further changes to _all_ wifi driver transmit paths, but this is at least a start. Tested: * AR5416, STA mode, w/ fragthreshold set to 256. Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri May 24 18:59:44 2013 (r250973) +++ head/sys/net80211/ieee80211_output.c Sat May 25 06:28:30 2013 (r250974) @@ -1495,18 +1495,28 @@ static int ieee80211_fragment(struct ieee80211vap *vap, struct mbuf *m0, u_int hdrsize, u_int ciphdrsize, u_int mtu) { + struct ieee80211com *ic = vap->iv_ic; struct ieee80211_frame *wh, *whf; struct mbuf *m, *prev, *next; u_int totalhdrsize, fragno, fragsize, off, remainder, payload; + u_int hdrspace; KASSERT(m0->m_nextpkt == NULL, ("mbuf already chained?")); KASSERT(m0->m_pkthdr.len > mtu, ("pktlen %u mtu %u", m0->m_pkthdr.len, mtu)); + /* + * Honor driver DATAPAD requirement. + */ + if (ic->ic_flags & IEEE80211_F_DATAPAD) + hdrspace = roundup(hdrsize, sizeof(uint32_t)); + else + hdrspace = hdrsize; + wh = mtod(m0, struct ieee80211_frame *); /* NB: mark the first frag; it will be propagated below */ wh->i_fc[1] |= IEEE80211_FC1_MORE_FRAG; - totalhdrsize = hdrsize + ciphdrsize; + totalhdrsize = hdrspace + ciphdrsize; fragno = 1; off = mtu - ciphdrsize; remainder = m0->m_pkthdr.len - off; @@ -1553,9 +1563,10 @@ ieee80211_fragment(struct ieee80211vap * payload = fragsize - totalhdrsize; /* NB: destination is known to be contiguous */ - m_copydata(m0, off, payload, mtod(m, uint8_t *) + hdrsize); - m->m_len = hdrsize + payload; - m->m_pkthdr.len = hdrsize + payload; + + m_copydata(m0, off, payload, mtod(m, uint8_t *) + hdrspace); + m->m_len = hdrspace + payload; + m->m_pkthdr.len = hdrspace + payload; m->m_flags |= M_FRAG; /* chain up the fragment */ From owner-svn-src-all@FreeBSD.ORG Sat May 25 07:17:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D47AA2A4; Sat, 25 May 2013 07:17:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C6E93275; Sat, 25 May 2013 07:17:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4P7HGAj002517; Sat, 25 May 2013 07:17:16 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4P7HG5x002515; Sat, 25 May 2013 07:17:16 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201305250717.r4P7HG5x002515@svn.freebsd.org> From: Glen Barber Date: Sat, 25 May 2013 07:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250975 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 07:17:16 -0000 Author: gjb (doc,ports committer) Date: Sat May 25 07:17:16 2013 New Revision: 250975 URL: http://svnweb.freebsd.org/changeset/base/250975 Log: Revert r250972 to fix build. Modified: head/usr.bin/patch/patch.c head/usr.bin/patch/util.c Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Sat May 25 06:28:30 2013 (r250974) +++ head/usr.bin/patch/patch.c Sat May 25 07:17:16 2013 (r250975) @@ -303,7 +303,7 @@ main(int argc, char *argv[]) ++fuzz <= mymaxfuzz); if (skip_rest_of_patch) { /* just got decided */ - if (ferror(ofp) | fclose(ofp)) { + if (ferror(ofp) || fclose(ofp)) { say("Error writing %s\n", TMPOUTNAME); error = 1; @@ -385,7 +385,7 @@ main(int argc, char *argv[]) } } } - if (ferror(rejfp) | fclose(rejfp)) { + if (ferror(rejfp) || fclose(rejfp)) { say("Error writing %s\n", rejname); error = 1; } @@ -977,7 +977,7 @@ spew_output(void) #endif if (input_lines) copy_till(input_lines, true); /* dump remainder of file */ - rv = ferror(ofp) == 0 & fclose(ofp) == 0; + rv = ferror(ofp) == 0 && fclose(ofp) == 0; ofp = NULL; return rv; } Modified: head/usr.bin/patch/util.c ============================================================================== --- head/usr.bin/patch/util.c Sat May 25 06:28:30 2013 (r250974) +++ head/usr.bin/patch/util.c Sat May 25 07:17:16 2013 (r250975) @@ -412,7 +412,7 @@ checked_in(char *file) void version(void) { - fprintf(stderr, "patch 2.0-12u9 FreeBSD\n"); + fprintf(stderr, "patch 2.0-12u8 FreeBSD\n"); my_exit(EXIT_SUCCESS); } From owner-svn-src-all@FreeBSD.ORG Sat May 25 09:47:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC67C151; Sat, 25 May 2013 09:47:33 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD576919; Sat, 25 May 2013 09:47:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4P9lXwJ054882; Sat, 25 May 2013 09:47:33 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4P9lX4m054881; Sat, 25 May 2013 09:47:33 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201305250947.r4P9lX4m054881@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 25 May 2013 09:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250976 - stable/9/usr.sbin/ctladm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 09:47:33 -0000 Author: jh Date: Sat May 25 09:47:33 2013 New Revision: 250976 URL: http://svnweb.freebsd.org/changeset/base/250976 Log: MFC r250443: Check the return value of sbuf_finish(). Modified: stable/9/usr.sbin/ctladm/ctladm.c Directory Properties: stable/9/usr.sbin/ctladm/ (props changed) Modified: stable/9/usr.sbin/ctladm/ctladm.c ============================================================================== --- stable/9/usr.sbin/ctladm/ctladm.c Sat May 25 07:17:16 2013 (r250975) +++ stable/9/usr.sbin/ctladm/ctladm.c Sat May 25 09:47:33 2013 (r250976) @@ -545,7 +545,8 @@ retry: } if (xml != 0) { sbuf_printf(sb, "\n"); - sbuf_finish(sb); + if (sbuf_finish(sb) != 0) + err(1, "%s: sbuf_finish", __func__); printf("%s", sbuf_data(sb)); sbuf_delete(sb); } @@ -3492,7 +3493,8 @@ cctl_end_element(void *user_data, const errx(1, "%s: no valid sbuf at level %d (name %s)", __func__, devlist->level, name); - sbuf_finish(devlist->cur_sb[devlist->level]); + if (sbuf_finish(devlist->cur_sb[devlist->level]) != 0) + err(1, "%s: sbuf_finish", __func__); str = strdup(sbuf_data(devlist->cur_sb[devlist->level])); if (str == NULL) err(1, "%s can't allocate %zd bytes for string", __func__, From owner-svn-src-all@FreeBSD.ORG Sat May 25 11:05:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EB1C8FA7; Sat, 25 May 2013 11:05:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB63DB5C; Sat, 25 May 2013 11:05:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PB51n2082281; Sat, 25 May 2013 11:05:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PB50hs082255; Sat, 25 May 2013 11:05:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305251105.r4PB50hs082255@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 25 May 2013 11:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250978 - in stable/9/sys: fs/nullfs kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 11:05:02 -0000 Author: kib Date: Sat May 25 11:05:00 2013 New Revision: 250978 URL: http://svnweb.freebsd.org/changeset/base/250978 Log: MFC r250505: - Fix nullfs vnode reference leak in nullfs_reclaim_lowervp(). The null_hashget() obtains the reference on the nullfs vnode, which must be dropped. - Fix a wart which existed from the introduction of the nullfs caching, do not unlock lower vnode in the nullfs_reclaim_lowervp(). It should be innocent, but now it is also formally safe. Inform the nullfs_reclaim() about this using the NULLV_NOUNLOCK flag set on nullfs inode. - Add a callback to the upper filesystems for the lower vnode unlinking. When inactivating a nullfs vnode, check if the lower vnode was unlinked, indicated by nullfs flag NULLV_DROP or VV_NOSYNC on the lower vnode, and reclaim upper vnode if so. This allows nullfs to purge cached vnodes for the unlinked lower vnode, avoiding excessive caching. MFC r250852: Do not leak the NULLV_NOUNLOCK flag from the nullfs_unlink_lowervp(), for the case when the nullfs vnode is not reclaimed. Otherwise, later reclamation would not unlock the lower vnode. Modified: stable/9/sys/fs/nullfs/null.h stable/9/sys/fs/nullfs/null_subr.c stable/9/sys/fs/nullfs/null_vfsops.c stable/9/sys/fs/nullfs/null_vnops.c stable/9/sys/kern/vfs_subr.c stable/9/sys/kern/vfs_syscalls.c stable/9/sys/sys/mount.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/fs/nullfs/null.h ============================================================================== --- stable/9/sys/fs/nullfs/null.h Sat May 25 10:35:05 2013 (r250977) +++ stable/9/sys/fs/nullfs/null.h Sat May 25 11:05:00 2013 (r250978) @@ -53,8 +53,12 @@ struct null_node { LIST_ENTRY(null_node) null_hash; /* Hash list */ struct vnode *null_lowervp; /* VREFed once */ struct vnode *null_vnode; /* Back pointer */ + u_int null_flags; }; +#define NULLV_NOUNLOCK 0x0001 +#define NULLV_DROP 0x0002 + #define MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data)) #define VTONULL(vp) ((struct null_node *)(vp)->v_data) #define NULLTOV(xp) ((xp)->null_vnode) Modified: stable/9/sys/fs/nullfs/null_subr.c ============================================================================== --- stable/9/sys/fs/nullfs/null_subr.c Sat May 25 10:35:05 2013 (r250977) +++ stable/9/sys/fs/nullfs/null_subr.c Sat May 25 11:05:00 2013 (r250978) @@ -251,6 +251,7 @@ null_nodeget(mp, lowervp, vpp) xp->null_vnode = vp; xp->null_lowervp = lowervp; + xp->null_flags = 0; vp->v_type = lowervp->v_type; vp->v_data = xp; vp->v_vnlock = lowervp->v_vnlock; Modified: stable/9/sys/fs/nullfs/null_vfsops.c ============================================================================== --- stable/9/sys/fs/nullfs/null_vfsops.c Sat May 25 10:35:05 2013 (r250977) +++ stable/9/sys/fs/nullfs/null_vfsops.c Sat May 25 11:05:00 2013 (r250978) @@ -65,7 +65,6 @@ static vfs_statfs_t nullfs_statfs; static vfs_unmount_t nullfs_unmount; static vfs_vget_t nullfs_vget; static vfs_extattrctl_t nullfs_extattrctl; -static vfs_reclaim_lowervp_t nullfs_reclaim_lowervp; /* * Mount null layer @@ -390,8 +389,49 @@ nullfs_reclaim_lowervp(struct mount *mp, vp = null_hashget(mp, lowervp); if (vp == NULL) return; + VTONULL(vp)->null_flags |= NULLV_NOUNLOCK; vgone(vp); - vn_lock(lowervp, LK_EXCLUSIVE | LK_RETRY); + vput(vp); +} + +static void +nullfs_unlink_lowervp(struct mount *mp, struct vnode *lowervp) +{ + struct vnode *vp; + struct null_node *xp; + + vp = null_hashget(mp, lowervp); + if (vp == NULL) + return; + xp = VTONULL(vp); + xp->null_flags |= NULLV_DROP | NULLV_NOUNLOCK; + vhold(vp); + vunref(vp); + + if (vp->v_usecount == 0) { + /* + * If vunref() dropped the last use reference on the + * nullfs vnode, it must be reclaimed, and its lock + * was split from the lower vnode lock. Need to do + * extra unlock before allowing the final vdrop() to + * free the vnode. + */ + KASSERT((vp->v_iflag & VI_DOOMED) != 0, + ("not reclaimed nullfs vnode %p", vp)); + VOP_UNLOCK(vp, 0); + } else { + /* + * Otherwise, the nullfs vnode still shares the lock + * with the lower vnode, and must not be unlocked. + * Also clear the NULLV_NOUNLOCK, the flag is not + * relevant for future reclamations. + */ + ASSERT_VOP_ELOCKED(vp, "unlink_lowervp"); + KASSERT((vp->v_iflag & VI_DOOMED) == 0, + ("reclaimed nullfs vnode %p", vp)); + xp->null_flags &= ~NULLV_NOUNLOCK; + } + vdrop(vp); } static struct vfsops null_vfsops = { @@ -407,6 +447,7 @@ static struct vfsops null_vfsops = { .vfs_unmount = nullfs_unmount, .vfs_vget = nullfs_vget, .vfs_reclaim_lowervp = nullfs_reclaim_lowervp, + .vfs_unlink_lowervp = nullfs_unlink_lowervp, }; VFS_SET(null_vfsops, nullfs, VFCF_LOOPBACK | VFCF_JAIL); Modified: stable/9/sys/fs/nullfs/null_vnops.c ============================================================================== --- stable/9/sys/fs/nullfs/null_vnops.c Sat May 25 10:35:05 2013 (r250977) +++ stable/9/sys/fs/nullfs/null_vnops.c Sat May 25 11:05:00 2013 (r250978) @@ -692,18 +692,24 @@ null_unlock(struct vop_unlock_args *ap) static int null_inactive(struct vop_inactive_args *ap __unused) { - struct vnode *vp; + struct vnode *vp, *lvp; + struct null_node *xp; struct mount *mp; struct null_mount *xmp; vp = ap->a_vp; + xp = VTONULL(vp); + lvp = NULLVPTOLOWERVP(vp); mp = vp->v_mount; xmp = MOUNTTONULLMOUNT(mp); - if ((xmp->nullm_flags & NULLM_CACHE) == 0) { + if ((xmp->nullm_flags & NULLM_CACHE) == 0 || + (xp->null_flags & NULLV_DROP) != 0 || + (lvp->v_vflag & VV_NOSYNC) != 0) { /* * If this is the last reference and caching of the - * nullfs vnodes is not enabled, then free up the - * vnode so as not to tie up the lower vnodes. + * nullfs vnodes is not enabled, or the lower vnode is + * deleted, then free up the vnode so as not to tie up + * the lower vnodes. */ vp->v_object = NULL; vrecycle(vp, curthread); @@ -748,7 +754,10 @@ null_reclaim(struct vop_reclaim_args *ap */ if (vp->v_writecount > 0) VOP_ADD_WRITECOUNT(lowervp, -1); - vput(lowervp); + if ((xp->null_flags & NULLV_NOUNLOCK) != 0) + vunref(lowervp); + else + vput(lowervp); free(xp, M_NULLFSNODE); return (0); Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Sat May 25 10:35:05 2013 (r250977) +++ stable/9/sys/kern/vfs_subr.c Sat May 25 11:05:00 2013 (r250978) @@ -2756,19 +2756,20 @@ vgone(struct vnode *vp) } static void -vgonel_reclaim_lowervp_vfs(struct mount *mp __unused, +notify_lowervp_vfs_dummy(struct mount *mp __unused, struct vnode *lowervp __unused) { } /* - * Notify upper mounts about reclaimed vnode. + * Notify upper mounts about reclaimed or unlinked vnode. */ -static void -vgonel_reclaim_lowervp(struct vnode *vp) +void +vfs_notify_upper(struct vnode *vp, int event) { static struct vfsops vgonel_vfsops = { - .vfs_reclaim_lowervp = vgonel_reclaim_lowervp_vfs + .vfs_reclaim_lowervp = notify_lowervp_vfs_dummy, + .vfs_unlink_lowervp = notify_lowervp_vfs_dummy, }; struct mount *mp, *ump, *mmp; @@ -2792,7 +2793,17 @@ vgonel_reclaim_lowervp(struct vnode *vp) } TAILQ_INSERT_AFTER(&mp->mnt_uppers, ump, mmp, mnt_upper_link); MNT_IUNLOCK(mp); - VFS_RECLAIM_LOWERVP(ump, vp); + switch (event) { + case VFS_NOTIFY_UPPER_RECLAIM: + VFS_RECLAIM_LOWERVP(ump, vp); + break; + case VFS_NOTIFY_UPPER_UNLINK: + VFS_UNLINK_LOWERVP(ump, vp); + break; + default: + KASSERT(0, ("invalid event %d", event)); + break; + } MNT_ILOCK(mp); ump = TAILQ_NEXT(mmp, mnt_upper_link); TAILQ_REMOVE(&mp->mnt_uppers, mmp, mnt_upper_link); @@ -2839,7 +2850,7 @@ vgonel(struct vnode *vp) active = vp->v_usecount; oweinact = (vp->v_iflag & VI_OWEINACT); VI_UNLOCK(vp); - vgonel_reclaim_lowervp(vp); + vfs_notify_upper(vp, VFS_NOTIFY_UPPER_RECLAIM); /* * Clean out any buffers associated with the vnode. Modified: stable/9/sys/kern/vfs_syscalls.c ============================================================================== --- stable/9/sys/kern/vfs_syscalls.c Sat May 25 10:35:05 2013 (r250977) +++ stable/9/sys/kern/vfs_syscalls.c Sat May 25 11:05:00 2013 (r250978) @@ -1949,6 +1949,7 @@ restart: if (error) goto out; #endif + vfs_notify_upper(vp, VFS_NOTIFY_UPPER_UNLINK); error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); #ifdef MAC out: @@ -3947,6 +3948,7 @@ restart: return (error); goto restart; } + vfs_notify_upper(vp, VFS_NOTIFY_UPPER_UNLINK); error = VOP_RMDIR(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd); vn_finished_write(mp); out: Modified: stable/9/sys/sys/mount.h ============================================================================== --- stable/9/sys/sys/mount.h Sat May 25 10:35:05 2013 (r250977) +++ stable/9/sys/sys/mount.h Sat May 25 11:05:00 2013 (r250978) @@ -630,7 +630,7 @@ typedef int vfs_mount_t(struct mount *mp typedef int vfs_sysctl_t(struct mount *mp, fsctlop_t op, struct sysctl_req *req); typedef void vfs_susp_clean_t(struct mount *mp); -typedef void vfs_reclaim_lowervp_t(struct mount *mp, struct vnode *lowervp); +typedef void vfs_notify_lowervp_t(struct mount *mp, struct vnode *lowervp); struct vfsops { vfs_mount_t *vfs_mount; @@ -648,7 +648,8 @@ struct vfsops { vfs_extattrctl_t *vfs_extattrctl; vfs_sysctl_t *vfs_sysctl; vfs_susp_clean_t *vfs_susp_clean; - vfs_reclaim_lowervp_t *vfs_reclaim_lowervp; + vfs_notify_lowervp_t *vfs_reclaim_lowervp; + vfs_notify_lowervp_t *vfs_unlink_lowervp; }; vfs_statfs_t __vfs_statfs; @@ -713,6 +714,12 @@ vfs_statfs_t __vfs_statfs; mtx_assert(&Giant, MA_OWNED); \ } while (0) +#define VFS_UNLINK_LOWERVP(MP, VP) do { \ + if (*(MP)->mnt_op->vfs_unlink_lowervp != NULL) { \ + (*(MP)->mnt_op->vfs_unlink_lowervp)((MP), (VP)); \ + } \ +} while (0) + #define VFS_KNOTE_LOCKED(vp, hint) do \ { \ if (((vp)->v_vflag & VV_NOKNOTE) == 0) \ @@ -725,6 +732,9 @@ vfs_statfs_t __vfs_statfs; VN_KNOTE((vp), (hint), 0); \ } while (0) +#define VFS_NOTIFY_UPPER_RECLAIM 1 +#define VFS_NOTIFY_UPPER_UNLINK 2 + #include /* @@ -803,6 +813,7 @@ int vfs_modevent(module_t, int, void *); void vfs_mount_error(struct mount *, const char *, ...); void vfs_mountroot(void); /* mount our root filesystem */ void vfs_mountedfrom(struct mount *, const char *from); +void vfs_notify_upper(struct vnode *, int); void vfs_oexport_conv(const struct oexport_args *oexp, struct export_args *exp); void vfs_ref(struct mount *); From owner-svn-src-all@FreeBSD.ORG Sat May 25 12:11:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A166113C; Sat, 25 May 2013 12:11:21 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9411DEEE; Sat, 25 May 2013 12:11:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PCBLl6006157; Sat, 25 May 2013 12:11:21 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PCBLWb006156; Sat, 25 May 2013 12:11:21 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305251211.r4PCBLWb006156@svn.freebsd.org> From: Ed Schouten Date: Sat, 25 May 2013 12:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250980 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 12:11:21 -0000 Author: ed Date: Sat May 25 12:11:20 2013 New Revision: 250980 URL: http://svnweb.freebsd.org/changeset/base/250980 Log: Only call free() on something we allocated. If we were already provided a struct _citrus_iconv (e.g. through iconv_open_into()), we should not call free() in case io_init_context() fails. Instead, call it on the pointer of the allocated object, which will be NULL in case of iconv_open_into(). Modified: head/lib/libc/iconv/citrus_iconv.c Modified: head/lib/libc/iconv/citrus_iconv.c ============================================================================== --- head/lib/libc/iconv/citrus_iconv.c Sat May 25 11:42:25 2013 (r250979) +++ head/lib/libc/iconv/citrus_iconv.c Sat May 25 12:11:20 2013 (r250980) @@ -258,7 +258,7 @@ int _citrus_iconv_open(struct _citrus_iconv * __restrict * __restrict rcv, const char * __restrict src, const char * __restrict dst) { - struct _citrus_iconv *cv; + struct _citrus_iconv *cv = NULL; struct _citrus_iconv_shared *ci = NULL; char realdst[PATH_MAX], realsrc[PATH_MAX]; char buf[PATH_MAX], path[PATH_MAX]; @@ -301,7 +301,7 @@ _citrus_iconv_open(struct _citrus_iconv ret = (*ci->ci_ops->io_init_context)(*rcv); if (ret) { release_shared(ci); - free(*rcv); + free(cv); return (ret); } return (0); From owner-svn-src-all@FreeBSD.ORG Sat May 25 12:13:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6D9F431E; Sat, 25 May 2013 12:13:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48055F01; Sat, 25 May 2013 12:13:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PCDtR6006760; Sat, 25 May 2013 12:13:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PCDtGu006759; Sat, 25 May 2013 12:13:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305251213.r4PCDtGu006759@svn.freebsd.org> From: Ed Schouten Date: Sat, 25 May 2013 12:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250981 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 12:13:55 -0000 Author: ed Date: Sat May 25 12:13:54 2013 New Revision: 250981 URL: http://svnweb.freebsd.org/changeset/base/250981 Log: Make some tiny improvements to iconv_open(). - Remove an unneeded variable. - Fix whitespace bugs. - Fix typoes in comment. - Improve string handling a bit. Don't handroll strstr() and don't terminate a strdup()'ed string. Instead, simply strndup() the part we need. Modified: head/lib/libc/iconv/iconv.c Modified: head/lib/libc/iconv/iconv.c ============================================================================== --- head/lib/libc/iconv/iconv.c Sat May 25 12:11:20 2013 (r250980) +++ head/lib/libc/iconv/iconv.c Sat May 25 12:13:54 2013 (r250981) @@ -66,37 +66,31 @@ iconv_t _iconv_open(const char *out, c struct _citrus_iconv *prealloc); iconv_t -_iconv_open(const char *out, const char *in, struct _citrus_iconv *prealloc) +_iconv_open(const char *out, const char *in, struct _citrus_iconv *handle) { - struct _citrus_iconv *handle; - char *out_truncated, *p; + const char *out_slashes; + char *out_noslashes; int ret; - handle = prealloc; - /* * Remove anything following a //, as these are options (like * //ignore, //translate, etc) and we just don't handle them. - * This is for compatibilty with software that uses thees + * This is for compatibility with software that uses these * blindly. */ - out_truncated = strdup(out); - if (out_truncated == NULL) { - errno = ENOMEM; - return ((iconv_t)-1); + out_slashes = strstr(out, "//"); + if (out_slashes != NULL) { + out_noslashes = strndup(out, out_slashes - out); + if (out_noslashes == NULL) { + errno = ENOMEM; + return ((iconv_t)-1); + } + ret = _citrus_iconv_open(&handle, in, out_noslashes); + free(out_noslashes); + } else { + ret = _citrus_iconv_open(&handle, in, out); } - p = out_truncated; - while (*p != 0) { - if (p[0] == '/' && p[1] == '/') { - *p = '\0'; - break; - } - p++; - } - - ret = _citrus_iconv_open(&handle, in, out_truncated); - free(out_truncated); if (ret) { errno = ret == ENOENT ? EINVAL : ret; return ((iconv_t)-1); From owner-svn-src-all@FreeBSD.ORG Sat May 25 13:59:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 724ED443; Sat, 25 May 2013 13:59:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6502E23F; Sat, 25 May 2013 13:59:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PDxfj6042404; Sat, 25 May 2013 13:59:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PDxfon042403; Sat, 25 May 2013 13:59:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305251359.r4PDxfon042403@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 25 May 2013 13:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250982 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 13:59:41 -0000 Author: jilles Date: Sat May 25 13:59:40 2013 New Revision: 250982 URL: http://svnweb.freebsd.org/changeset/base/250982 Log: sigreturn(2): Remove ancient compatibility warning about 4.2BSD. The HISTORY subsection still says that sigreturn() was added in 4.3BSD. Modified: head/lib/libc/sys/sigreturn.2 Modified: head/lib/libc/sys/sigreturn.2 ============================================================================== --- head/lib/libc/sys/sigreturn.2 Sat May 25 12:13:54 2013 (r250981) +++ head/lib/libc/sys/sigreturn.2 Sat May 25 13:59:40 2013 (r250982) @@ -56,10 +56,6 @@ Execution resumes at the specified pc. This system call is used by the trampoline code and .Xr longjmp 3 when returning from a signal to the previously executing program. -.Sh NOTES -This system call is not available in -.Bx 4.2 -hence it should not be used if backward compatibility is needed. .Sh RETURN VALUES If successful, the system call does not return. Otherwise, a value of -1 is returned and From owner-svn-src-all@FreeBSD.ORG Sat May 25 14:00:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 031976BC; Sat, 25 May 2013 14:00:46 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-vb0-x232.google.com (mail-vb0-x232.google.com [IPv6:2607:f8b0:400c:c02::232]) by mx1.freebsd.org (Postfix) with ESMTP id 84D9D253; Sat, 25 May 2013 14:00:45 +0000 (UTC) Received: by mail-vb0-f50.google.com with SMTP id w16so3745984vbb.37 for ; Sat, 25 May 2013 07:00:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=QMYV0tEPvAK5tHDOfGYTrWPw3QuQy1Nut9oyZkRPMao=; b=XTsKewLAFJ5IiahbMjMS5uxrWfpuD7IUTP7O9mSITOSMIg2Pjp7Lt4Ejdz6HBN2FB7 DN+GtGRHbiWZ618vdD9vYUWtFzAnm4BQWDgER79BRuYXWDYhYsoMJI/7S5alUf9LMb34 9e6inmbXgp0LCRCgDOAVloapTvhG4dDhQl6EcSJXw41afIujSZrkRX5KkhNSkVsdwseI nCJze9QoztZjbUD3h/bpSx8NtdWB2sUucFT9S3DoEtYjBHNUxjVoQUP4Ia5sRIhZTGT6 q/3dtuk35OE2qE5mg8sgNDWvPmzdo4UpSUuf3TdaqXCZ8GQsWArBXHT4vi2W7O5cQd9y YnaQ== MIME-Version: 1.0 X-Received: by 10.52.68.11 with SMTP id r11mr5043405vdt.93.1369490444715; Sat, 25 May 2013 07:00:44 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.220.72.7 with HTTP; Sat, 25 May 2013 07:00:44 -0700 (PDT) In-Reply-To: References: <201305211959.r4LJxbLx034714@svn.freebsd.org> <20130521220003.GB58299@stack.nl> Date: Sat, 25 May 2013 16:00:44 +0200 X-Google-Sender-Auth: Wyc2JXeo_Bd4L5UXbUjeQH7vEC0 Message-ID: Subject: Re: svn commit: r250883 - in head: include include/xlocale lib/libc/locale sys/sys tools/regression/lib/libc/locale From: Ed Schouten To: Jilles Tjoelker , gabor@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 14:00:46 -0000 Hello all, [ +gabor ] 2013/5/22 Ed Schouten : > Oh, the horror! I thought on FreeBSD, we used the LC_CTYPE files to do > a mapping to ISO 10646. Unfortunately, it seems to be the case that > these files are only used to do mappings to > uppercase/lowercase/runetype. Bummer. So I think the solution to this problem is twofold. First, let's look at the case where people have built world with WITH_ICONV=. Instead of implementing the *c32* functions on top of the *wc* variants, we can simply use libiconv. The following patch adds two new variants of the *c32* functions, implemented on top of libiconv. At first I tried implementing these functions on top of iconv_open_into(), but unfortunately it seems to be the case that the iconv_allocation_t is larger than the mbstate_t, meaning we cannot safely embed one into the other. To work around this, I'm using the internal _citrus_* API. http://80386.nl/pub/uchar-iconv.txt Jilles, Gabor, could you please take a look at the patch, whether it's any good? Now we still have the case where the system is built WITHOUT_ICONV=. I think it really depends on the future of iconv in base how complete we should attempt to make it. Gabor, is there a chance WITH_ICONV= will become the default in FreeBSD 10? -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Sat May 25 15:17:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1BF9B53F; Sat, 25 May 2013 15:17:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0C61F663; Sat, 25 May 2013 15:17:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PFHwWb076462; Sat, 25 May 2013 15:17:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PFHwgl076459; Sat, 25 May 2013 15:17:58 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305251517.r4PFHwgl076459@svn.freebsd.org> From: Eitan Adler Date: Sat, 25 May 2013 15:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250983 - in stable/9: etc/periodic/daily tools/build/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 15:17:59 -0000 Author: eadler Date: Sat May 25 15:17:58 2013 New Revision: 250983 URL: http://svnweb.freebsd.org/changeset/base/250983 Log: MFC r250533: Unconditionally install 210.backup-aliases as many MTAs other than sendmail support the use of /etc/aliases. PR: conf/176098 Modified: stable/9/etc/periodic/daily/Makefile stable/9/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/9/etc/ (props changed) stable/9/tools/build/ (props changed) Modified: stable/9/etc/periodic/daily/Makefile ============================================================================== --- stable/9/etc/periodic/daily/Makefile Sat May 25 13:59:40 2013 (r250982) +++ stable/9/etc/periodic/daily/Makefile Sat May 25 15:17:58 2013 (r250983) @@ -6,6 +6,7 @@ FILES= 100.clean-disks \ 110.clean-tmps \ 120.clean-preserve \ 200.backup-passwd \ + 210.backup-aliases \ 220.backup-pkgdb \ 330.news \ 400.status-disks \ @@ -51,7 +52,6 @@ FILES+= 140.clean-rwho \ .if ${MK_SENDMAIL} != "no" FILES+= 150.clean-hoststat \ - 210.backup-aliases \ 440.status-mailq \ 460.status-mail-rejects \ 500.queuerun Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat May 25 13:59:40 2013 (r250982) +++ stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat May 25 15:17:58 2013 (r250983) @@ -3415,7 +3415,6 @@ OLD_FILES+=usr/share/man/man8/rtquery.8. .if ${MK_SENDMAIL} == no OLD_FILES+=etc/periodic/daily/150.clean-hoststat -OLD_FILES+=etc/periodic/daily/210.backup-aliases OLD_FILES+=etc/periodic/daily/440.status-mailq OLD_FILES+=etc/periodic/daily/460.status-mail-rejects OLD_FILES+=etc/periodic/daily/500.queuerun From owner-svn-src-all@FreeBSD.ORG Sat May 25 15:36:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F442B65; Sat, 25 May 2013 15:36:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5185C75E; Sat, 25 May 2013 15:36:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PFaHpT082904; Sat, 25 May 2013 15:36:17 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PFaGAW082893; Sat, 25 May 2013 15:36:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305251536.r4PFaGAW082893@svn.freebsd.org> From: Ed Schouten Date: Sat, 25 May 2013 15:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250984 - in head/usr.bin: mkcsmapper mkesdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 15:36:17 -0000 Author: ed Date: Sat May 25 15:36:15 2013 New Revision: 250984 URL: http://svnweb.freebsd.org/changeset/base/250984 Log: Prevent shadowing. The name line_number seems to be used as a function parameter name for one of the Lex functions. Change the name to linenumber. Modified: head/usr.bin/mkcsmapper/ldef.h head/usr.bin/mkcsmapper/lex.l head/usr.bin/mkcsmapper/yacc.y head/usr.bin/mkesdb/ldef.h head/usr.bin/mkesdb/lex.l head/usr.bin/mkesdb/yacc.y Modified: head/usr.bin/mkcsmapper/ldef.h ============================================================================== --- head/usr.bin/mkcsmapper/ldef.h Sat May 25 15:17:58 2013 (r250983) +++ head/usr.bin/mkcsmapper/ldef.h Sat May 25 15:36:15 2013 (r250984) @@ -36,6 +36,6 @@ typedef struct { } linear_zone_t; extern int debug; -extern int line_number; +extern int linenumber; extern int yyerror(const char *); extern int yylex(void); Modified: head/usr.bin/mkcsmapper/lex.l ============================================================================== --- head/usr.bin/mkcsmapper/lex.l Sat May 25 15:17:58 2013 (r250983) +++ head/usr.bin/mkcsmapper/lex.l Sat May 25 15:36:15 2013 (r250984) @@ -41,7 +41,7 @@ #include "ldef.h" #include "yacc.h" -int line_number = 1; +int linenumber = 1; %} %option noinput %option nounput @@ -51,11 +51,11 @@ int line_number = 1; %% [ \t]+ { } -#.*[\n]|"//".*[\n]|[\n] { line_number++; return (R_LN); } +#.*[\n]|"//".*[\n]|[\n] { linenumber++; return (R_LN); } "/*" { BEGIN COMMENT; } "*/" { BEGIN 0; } -[\n] { line_number++; } +[\n] { linenumber++; } . { } <> { yyerror("unexpected file end (unterminated comment)\n"); Modified: head/usr.bin/mkcsmapper/yacc.y ============================================================================== --- head/usr.bin/mkcsmapper/yacc.y Sat May 25 15:17:58 2013 (r250983) +++ head/usr.bin/mkcsmapper/yacc.y Sat May 25 15:36:15 2013 (r250984) @@ -203,7 +203,7 @@ static void warning(const char *s) { - fprintf(stderr, "%s in %d\n", s, line_number); + fprintf(stderr, "%s in %d\n", s, linenumber); } int Modified: head/usr.bin/mkesdb/ldef.h ============================================================================== --- head/usr.bin/mkesdb/ldef.h Sat May 25 15:17:58 2013 (r250983) +++ head/usr.bin/mkesdb/ldef.h Sat May 25 15:36:15 2013 (r250984) @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ -extern int line_number; +extern int linenumber; extern int yyerror(const char *); extern int yylex(void); Modified: head/usr.bin/mkesdb/lex.l ============================================================================== --- head/usr.bin/mkesdb/lex.l Sat May 25 15:17:58 2013 (r250983) +++ head/usr.bin/mkesdb/lex.l Sat May 25 15:36:15 2013 (r250984) @@ -43,7 +43,7 @@ #include "ldef.h" #include "yacc.h" -int line_number = 1; +int linenumber = 1; %} %option noinput %option nounput @@ -53,11 +53,11 @@ int line_number = 1; %% [ \t]+ { } -#.*[\n]|"//".*[\n]|[\n] { line_number++; return (R_LN); } +#.*[\n]|"//".*[\n]|[\n] { linenumber++; return (R_LN); } "/*" { BEGIN COMMENT; } "*/" { BEGIN 0; } -[\n] { line_number++; } +[\n] { linenumber++; } . { } <> { yyerror("unexpected file end (unterminated comment)\n"); Modified: head/usr.bin/mkesdb/yacc.y ============================================================================== --- head/usr.bin/mkesdb/yacc.y Sat May 25 15:17:58 2013 (r250983) +++ head/usr.bin/mkesdb/yacc.y Sat May 25 15:36:15 2013 (r250984) @@ -114,7 +114,7 @@ int yyerror(const char *s) { - fprintf(stderr, "%s in %d\n", s, line_number); + fprintf(stderr, "%s in %d\n", s, linenumber); return (0); } From owner-svn-src-all@FreeBSD.ORG Sat May 25 16:58:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 476ECFB6; Sat, 25 May 2013 16:58:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1FE979E1; Sat, 25 May 2013 16:58:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PGwDIv011109; Sat, 25 May 2013 16:58:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PGwChD011107; Sat, 25 May 2013 16:58:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305251658.r4PGwChD011107@svn.freebsd.org> From: Ed Schouten Date: Sat, 25 May 2013 16:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250985 - in head: include sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 16:58:13 -0000 Author: ed Date: Sat May 25 16:58:12 2013 New Revision: 250985 URL: http://svnweb.freebsd.org/changeset/base/250985 Log: Fix in for C++11. It turns out that in C++11, char16_t and char32_t are built-in types; language keywords. Just fix this by putting traditional _*_T_DECLARED blocks around the definitions. We'll just predefine these in . This also opens up the possibility to define char16_t in other header files, if ever needed (e.g. if we would gain a for char16_t/char32_t). Modified: head/include/uchar.h head/sys/sys/_types.h Modified: head/include/uchar.h ============================================================================== --- head/include/uchar.h Sat May 25 15:36:15 2013 (r250984) +++ head/include/uchar.h Sat May 25 16:58:12 2013 (r250985) @@ -32,6 +32,16 @@ #include #include +#ifndef _CHAR16_T_DECLARED +typedef __char16_t char16_t; +#define _CHAR16_T_DECLARED +#endif + +#ifndef _CHAR32_T_DECLARED +typedef __char32_t char32_t; +#define _CHAR32_T_DECLARED +#endif + #ifndef _MBSTATE_T_DECLARED typedef __mbstate_t mbstate_t; #define _MBSTATE_T_DECLARED @@ -42,9 +52,6 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif -typedef __char16_t char16_t; -typedef __char32_t char32_t; - __BEGIN_DECLS size_t c16rtomb(char * __restrict, char16_t, mbstate_t * __restrict); size_t c32rtomb(char * __restrict, char32_t, mbstate_t * __restrict); Modified: head/sys/sys/_types.h ============================================================================== --- head/sys/sys/_types.h Sat May 25 15:36:15 2013 (r250984) +++ head/sys/sys/_types.h Sat May 25 16:58:12 2013 (r250985) @@ -94,6 +94,11 @@ typedef __ct_rune_t __wint_t; /* wint_t typedef __uint_least16_t __char16_t; typedef __uint_least32_t __char32_t; #endif +/* In C++11, char16_t and char32_t are built-in types. */ +#if defined(__cplusplus) && __cplusplus >= 201103L +#define _CHAR16_T_DECLARED +#define _CHAR32_T_DECLARED +#endif typedef __uint32_t __dev_t; /* device number */ From owner-svn-src-all@FreeBSD.ORG Sat May 25 17:09:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D978B51C; Sat, 25 May 2013 17:09:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB863AAC; Sat, 25 May 2013 17:09:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PH9xij015289; Sat, 25 May 2013 17:09:59 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PH9xfv015285; Sat, 25 May 2013 17:09:59 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305251709.r4PH9xfv015285@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 25 May 2013 17:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250986 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 17:09:59 -0000 Author: hselasky Date: Sat May 25 17:09:58 2013 New Revision: 250986 URL: http://svnweb.freebsd.org/changeset/base/250986 Log: Fix some statical clang analyzer warnings. Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_msctest.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sat May 25 16:58:12 2013 (r250985) +++ head/sys/dev/usb/usb_device.c Sat May 25 17:09:58 2013 (r250986) @@ -799,9 +799,6 @@ usb_config_parse(struct usb_device *udev /* find maximum number of endpoints */ if (ep_max < temp) ep_max = temp; - - /* optimalisation */ - id = (struct usb_interface_descriptor *)ed; } } Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sat May 25 16:58:12 2013 (r250985) +++ head/sys/dev/usb/usb_hub.c Sat May 25 17:09:58 2013 (r250986) @@ -341,7 +341,6 @@ uhub_reattach_port(struct uhub_softc *sc DPRINTF("reattaching port %d\n", portno); - err = 0; timeout = 0; udev = sc->sc_udev; child = usb_bus_port_get_device(udev->bus, Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Sat May 25 16:58:12 2013 (r250985) +++ head/sys/dev/usb/usb_msctest.c Sat May 25 17:09:58 2013 (r250986) @@ -802,7 +802,6 @@ usb_msc_eject(struct usb_device *udev, u if (sc == NULL) return (USB_ERR_INVAL); - err = 0; switch (method) { case MSC_EJECT_STOPUNIT: err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, @@ -844,6 +843,7 @@ usb_msc_eject(struct usb_device *udev, u break; default: DPRINTF("Unknown eject method (%d)\n", method); + err = 0; break; } DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); From owner-svn-src-all@FreeBSD.ORG Sat May 25 17:16:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 14A537F8; Sat, 25 May 2013 17:16:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E1266AFA; Sat, 25 May 2013 17:16:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PHGV18018370; Sat, 25 May 2013 17:16:31 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PHGVSD018369; Sat, 25 May 2013 17:16:31 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305251716.r4PHGVSD018369@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 25 May 2013 17:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250987 - stable/9/sys/dev/sound/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 17:16:32 -0000 Author: hselasky Date: Sat May 25 17:16:31 2013 New Revision: 250987 URL: http://svnweb.freebsd.org/changeset/base/250987 Log: MFC r250763 and r250765: Fix some USB audio device issues. PR: usb/178722 Modified: stable/9/sys/dev/sound/usb/uaudio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Sat May 25 17:09:58 2013 (r250986) +++ stable/9/sys/dev/sound/usb/uaudio.c Sat May 25 17:16:31 2013 (r250987) @@ -868,6 +868,7 @@ uaudio_attach(device_t dev) struct usb_attach_arg *uaa = device_get_ivars(dev); struct uaudio_softc *sc = device_get_softc(dev); struct usb_interface_descriptor *id; + usb_error_t err; device_t child; sc->sc_play_chan.priv_sc = sc; @@ -925,6 +926,19 @@ uaudio_attach(device_t dev) if (sc->sc_play_chan.num_alt > 0) { uint8_t x; + + /* + * Need to set a default alternate interface, else + * some USB audio devices might go into an infinte + * re-enumeration loop: + */ + err = usbd_set_alt_interface_index(sc->sc_udev, + sc->sc_play_chan.usb_alt[0].iface_index, + sc->sc_play_chan.usb_alt[0].iface_alt_index); + if (err) { + DPRINTF("setting of alternate index failed: %s!\n", + usbd_errstr(err)); + } for (x = 0; x != sc->sc_play_chan.num_alt; x++) { device_printf(dev, "Play: %d Hz, %d ch, %s format, " "2x8ms buffer.\n", @@ -938,6 +952,19 @@ uaudio_attach(device_t dev) if (sc->sc_rec_chan.num_alt > 0) { uint8_t x; + + /* + * Need to set a default alternate interface, else + * some USB audio devices might go into an infinte + * re-enumeration loop: + */ + err = usbd_set_alt_interface_index(sc->sc_udev, + sc->sc_rec_chan.usb_alt[0].iface_index, + sc->sc_rec_chan.usb_alt[0].iface_alt_index); + if (err) { + DPRINTF("setting of alternate index failed: %s!\n", + usbd_errstr(err)); + } for (x = 0; x != sc->sc_rec_chan.num_alt; x++) { device_printf(dev, "Record: %d Hz, %d ch, %s format, " "2x8ms buffer.\n", @@ -5565,7 +5592,6 @@ umidi_open(struct usb_fifo *fifo, int ff } /* clear stall first */ mtx_lock(&chan->mtx); - usbd_xfer_set_stall(chan->xfer[UMIDI_TX_TRANSFER]); chan->write_open_refcount++; sub->write_open = 1; @@ -5664,9 +5690,6 @@ umidi_probe(device_t dev) mtx_lock(&chan->mtx); - /* clear stall first */ - usbd_xfer_set_stall(chan->xfer[UMIDI_RX_TRANSFER]); - /* * NOTE: At least one device will not work properly unless the * BULK IN pipe is open all the time. This might have to do @@ -5771,8 +5794,11 @@ tr_setup: break; default: /* Error */ + + DPRINTF("error=%s\n", usbd_errstr(error)); + if (error != USB_ERR_CANCELLED) { - /* try clear stall first */ + /* try to clear stall first */ usbd_xfer_set_stall(xfer); goto tr_setup; } From owner-svn-src-all@FreeBSD.ORG Sat May 25 17:19:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6A87F9A8; Sat, 25 May 2013 17:19:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC41B16; Sat, 25 May 2013 17:19:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PHJ7Zb018865; Sat, 25 May 2013 17:19:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PHJ7th018863; Sat, 25 May 2013 17:19:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305251719.r4PHJ7th018863@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 25 May 2013 17:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250988 - stable/8/sys/dev/sound/usb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 17:19:07 -0000 Author: hselasky Date: Sat May 25 17:19:06 2013 New Revision: 250988 URL: http://svnweb.freebsd.org/changeset/base/250988 Log: MFC r250763 and r250765: Fix some USB audio device issues. PR: usb/178722 Modified: stable/8/sys/dev/sound/usb/uaudio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/usb/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Sat May 25 17:16:31 2013 (r250987) +++ stable/8/sys/dev/sound/usb/uaudio.c Sat May 25 17:19:06 2013 (r250988) @@ -868,6 +868,7 @@ uaudio_attach(device_t dev) struct usb_attach_arg *uaa = device_get_ivars(dev); struct uaudio_softc *sc = device_get_softc(dev); struct usb_interface_descriptor *id; + usb_error_t err; device_t child; sc->sc_play_chan.priv_sc = sc; @@ -925,6 +926,19 @@ uaudio_attach(device_t dev) if (sc->sc_play_chan.num_alt > 0) { uint8_t x; + + /* + * Need to set a default alternate interface, else + * some USB audio devices might go into an infinte + * re-enumeration loop: + */ + err = usbd_set_alt_interface_index(sc->sc_udev, + sc->sc_play_chan.usb_alt[0].iface_index, + sc->sc_play_chan.usb_alt[0].iface_alt_index); + if (err) { + DPRINTF("setting of alternate index failed: %s!\n", + usbd_errstr(err)); + } for (x = 0; x != sc->sc_play_chan.num_alt; x++) { device_printf(dev, "Play: %d Hz, %d ch, %s format, " "2x8ms buffer.\n", @@ -938,6 +952,19 @@ uaudio_attach(device_t dev) if (sc->sc_rec_chan.num_alt > 0) { uint8_t x; + + /* + * Need to set a default alternate interface, else + * some USB audio devices might go into an infinte + * re-enumeration loop: + */ + err = usbd_set_alt_interface_index(sc->sc_udev, + sc->sc_rec_chan.usb_alt[0].iface_index, + sc->sc_rec_chan.usb_alt[0].iface_alt_index); + if (err) { + DPRINTF("setting of alternate index failed: %s!\n", + usbd_errstr(err)); + } for (x = 0; x != sc->sc_rec_chan.num_alt; x++) { device_printf(dev, "Record: %d Hz, %d ch, %s format, " "2x8ms buffer.\n", @@ -5565,7 +5592,6 @@ umidi_open(struct usb_fifo *fifo, int ff } /* clear stall first */ mtx_lock(&chan->mtx); - usbd_xfer_set_stall(chan->xfer[UMIDI_TX_TRANSFER]); chan->write_open_refcount++; sub->write_open = 1; @@ -5664,9 +5690,6 @@ umidi_probe(device_t dev) mtx_lock(&chan->mtx); - /* clear stall first */ - usbd_xfer_set_stall(chan->xfer[UMIDI_RX_TRANSFER]); - /* * NOTE: At least one device will not work properly unless the * BULK IN pipe is open all the time. This might have to do @@ -5771,8 +5794,11 @@ tr_setup: break; default: /* Error */ + + DPRINTF("error=%s\n", usbd_errstr(error)); + if (error != USB_ERR_CANCELLED) { - /* try clear stall first */ + /* try to clear stall first */ usbd_xfer_set_stall(xfer); goto tr_setup; } From owner-svn-src-all@FreeBSD.ORG Sat May 25 18:04:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2435C37E; Sat, 25 May 2013 18:04:25 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 16968D71; Sat, 25 May 2013 18:04:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PI4OmE035180; Sat, 25 May 2013 18:04:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PI4OX3035174; Sat, 25 May 2013 18:04:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305251804.r4PI4OX3035174@svn.freebsd.org> From: Ed Schouten Date: Sat, 25 May 2013 18:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250989 - head/tools/regression/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 18:04:25 -0000 Author: ed Date: Sat May 25 18:04:24 2013 New Revision: 250989 URL: http://svnweb.freebsd.org/changeset/base/250989 Log: Add missing #includes, to keep Clang silent. Modified: head/tools/regression/lib/libc/locale/test-btowc.c head/tools/regression/lib/libc/locale/test-iswctype.c head/tools/regression/lib/libc/locale/test-towctrans.c Modified: head/tools/regression/lib/libc/locale/test-btowc.c ============================================================================== --- head/tools/regression/lib/libc/locale/test-btowc.c Sat May 25 17:19:06 2013 (r250988) +++ head/tools/regression/lib/libc/locale/test-btowc.c Sat May 25 18:04:24 2013 (r250989) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include int Modified: head/tools/regression/lib/libc/locale/test-iswctype.c ============================================================================== --- head/tools/regression/lib/libc/locale/test-iswctype.c Sat May 25 17:19:06 2013 (r250988) +++ head/tools/regression/lib/libc/locale/test-iswctype.c Sat May 25 18:04:24 2013 (r250989) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/tools/regression/lib/libc/locale/test-towctrans.c ============================================================================== --- head/tools/regression/lib/libc/locale/test-towctrans.c Sat May 25 17:19:06 2013 (r250988) +++ head/tools/regression/lib/libc/locale/test-towctrans.c Sat May 25 18:04:24 2013 (r250989) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Sat May 25 18:11:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 816175F2; Sat, 25 May 2013 18:11:20 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qe0-f43.google.com (mail-qe0-f43.google.com [209.85.128.43]) by mx1.freebsd.org (Postfix) with ESMTP id 129E8DCD; Sat, 25 May 2013 18:11:19 +0000 (UTC) Received: by mail-qe0-f43.google.com with SMTP id k5so3142156qej.16 for ; Sat, 25 May 2013 11:11:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ZQrP8WL3cGyFNwGMOsmDDjNYz/ZrhS1K0PrK3oDcOW0=; b=FWdyJQINP5T2vt60ykaNqZ357DUv7c4J0LVPJ1zG4BE7W4tCGpszUOsKheDZ3uuCDN UVu7/sE88ZDR+L17w8BKKICzkiCtwWCWZEaK/W3qTCE5pqPtNpc/eGU8f8wIwPjtrZwb HIZ9P75HJn38VHEeEq8xVufy8dYknYt4IrV8OcRc4NRQy6gF8nzWb2EO8RaIOB1LXYJz IkH38+pHmebTS/K54sY1V8gBWJrQZFexQZqR0XHE1Mzyh0HVczQ7JO4QYoZXXz71qHYg VqCjqtuWny1XFFcDN00XA+SP5VTra39quBlNgQOD1zk3ROEtgqtwqCLTbkAKfmm4Byyr 2s4A== MIME-Version: 1.0 X-Received: by 10.224.60.73 with SMTP id o9mr20520949qah.90.1369505016799; Sat, 25 May 2013 11:03:36 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.229.142.11 with HTTP; Sat, 25 May 2013 11:03:36 -0700 (PDT) In-Reply-To: <201305251709.r4PH9xfv015285@svn.freebsd.org> References: <201305251709.r4PH9xfv015285@svn.freebsd.org> Date: Sat, 25 May 2013 11:03:36 -0700 X-Google-Sender-Auth: zTmcRdVZcR8EVeBKbm4pQ8eOeDI Message-ID: Subject: Re: svn commit: r250986 - head/sys/dev/usb From: mdf@FreeBSD.org To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 18:11:20 -0000 On Sat, May 25, 2013 at 10:09 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat May 25 17:09:58 2013 > New Revision: 250986 > URL: http://svnweb.freebsd.org/changeset/base/250986 > > Log: > Fix some statical clang analyzer warnings. > > Modified: > head/sys/dev/usb/usb_device.c > head/sys/dev/usb/usb_hub.c > head/sys/dev/usb/usb_msctest.c > > Modified: head/sys/dev/usb/usb_device.c > > ============================================================================== > --- head/sys/dev/usb/usb_device.c Sat May 25 16:58:12 2013 > (r250985) > +++ head/sys/dev/usb/usb_device.c Sat May 25 17:09:58 2013 > (r250986) > @@ -799,9 +799,6 @@ usb_config_parse(struct usb_device *udev > /* find maximum number of endpoints */ > if (ep_max < temp) > ep_max = temp; > - > - /* optimalisation */ > - id = (struct usb_interface_descriptor *)ed; > } > } > > > Modified: head/sys/dev/usb/usb_hub.c > > ============================================================================== > --- head/sys/dev/usb/usb_hub.c Sat May 25 16:58:12 2013 (r250985) > +++ head/sys/dev/usb/usb_hub.c Sat May 25 17:09:58 2013 (r250986) > @@ -341,7 +341,6 @@ uhub_reattach_port(struct uhub_softc *sc > > DPRINTF("reattaching port %d\n", portno); > > - err = 0; > timeout = 0; > udev = sc->sc_udev; > child = usb_bus_port_get_device(udev->bus, > > Modified: head/sys/dev/usb/usb_msctest.c > > ============================================================================== > --- head/sys/dev/usb/usb_msctest.c Sat May 25 16:58:12 2013 > (r250985) > +++ head/sys/dev/usb/usb_msctest.c Sat May 25 17:09:58 2013 > (r250986) > @@ -802,7 +802,6 @@ usb_msc_eject(struct usb_device *udev, u > if (sc == NULL) > return (USB_ERR_INVAL); > > - err = 0; > switch (method) { > case MSC_EJECT_STOPUNIT: > err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, > @@ -844,6 +843,7 @@ usb_msc_eject(struct usb_device *udev, u > break; > default: > DPRINTF("Unknown eject method (%d)\n", method); > + err = 0; > break; > } > DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); > I don't know about the top one, but the bottom two are the safer way to code, and should not have been changed. Unless we feel guaranteed the compiler can detect all uninitialized use and will break the build, an early initialization to a sane value is absolutely the right thing to do, even if it will be overwritten. If the compiler feels sure the initialization isn't needed, it does not have to emit the code. But any coding change after the (missing) initialization can create a bug now (well, it depends on how the code is structured, but from the three lines of context svn diff provides it's not clear a bug couldn't easily be introduced). Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Sat May 25 18:53:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0054C1A7; Sat, 25 May 2013 18:53:14 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 8C321F97; Sat, 25 May 2013 18:53:14 +0000 (UTC) Received: from mail.bitfrost.no (mail.bitfrost.no [46.29.221.36]) by mta.bitpro.no (Postfix) with ESMTP id 0963A7A11D; Sat, 25 May 2013 20:53:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bitfrost.no Received: from laptop015.hselasky.homeunix.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: hanspetter) by mail.bitfrost.no (Postfix) with ESMTPSA id 9FCAC20551; Sat, 25 May 2013 20:52:52 +0200 (CEST) Message-ID: <51A108DE.7090003@bitfrost.no> Date: Sat, 25 May 2013 20:54:22 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S MIME-Version: 1.0 To: mdf@FreeBSD.org Subject: Re: svn commit: r250986 - head/sys/dev/usb References: <201305251709.r4PH9xfv015285@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 18:53:15 -0000 On 05/25/13 20:03, mdf@FreeBSD.org wrote: > On Sat, May 25, 2013 at 10:09 AM, Hans Petter Selasky > wrote: > >> Author: hselasky >> Date: Sat May 25 17:09:58 2013 >> New Revision: 250986 >> URL: http://svnweb.freebsd.org/changeset/base/250986 >> >> Log: >> Fix some statical clang analyzer warnings. >> >> Modified: >> head/sys/dev/usb/usb_device.c >> head/sys/dev/usb/usb_hub.c >> head/sys/dev/usb/usb_msctest.c >> >> Modified: head/sys/dev/usb/usb_device.c >> >> ============================================================================== >> --- head/sys/dev/usb/usb_device.c Sat May 25 16:58:12 2013 >> (r250985) >> +++ head/sys/dev/usb/usb_device.c Sat May 25 17:09:58 2013 >> (r250986) >> @@ -799,9 +799,6 @@ usb_config_parse(struct usb_device *udev >> /* find maximum number of endpoints */ >> if (ep_max < temp) >> ep_max = temp; >> - >> - /* optimalisation */ >> - id = (struct usb_interface_descriptor *)ed; >> } >> } >> >> >> Modified: head/sys/dev/usb/usb_hub.c >> >> ============================================================================== >> --- head/sys/dev/usb/usb_hub.c Sat May 25 16:58:12 2013 (r250985) >> +++ head/sys/dev/usb/usb_hub.c Sat May 25 17:09:58 2013 (r250986) >> @@ -341,7 +341,6 @@ uhub_reattach_port(struct uhub_softc *sc >> >> DPRINTF("reattaching port %d\n", portno); >> >> - err = 0; >> timeout = 0; >> udev = sc->sc_udev; >> child = usb_bus_port_get_device(udev->bus, >> >> Modified: head/sys/dev/usb/usb_msctest.c >> >> ============================================================================== >> --- head/sys/dev/usb/usb_msctest.c Sat May 25 16:58:12 2013 >> (r250985) >> +++ head/sys/dev/usb/usb_msctest.c Sat May 25 17:09:58 2013 >> (r250986) >> @@ -802,7 +802,6 @@ usb_msc_eject(struct usb_device *udev, u >> if (sc == NULL) >> return (USB_ERR_INVAL); >> >> - err = 0; >> switch (method) { >> case MSC_EJECT_STOPUNIT: >> err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, >> @@ -844,6 +843,7 @@ usb_msc_eject(struct usb_device *udev, u >> break; >> default: >> DPRINTF("Unknown eject method (%d)\n", method); >> + err = 0; >> break; >> } >> DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); >> > > I don't know about the top one, but the bottom two are the safer way to > code, and should not have been changed. Unless we feel guaranteed the > compiler can detect all uninitialized use and will break the build, an > early initialization to a sane value is absolutely the right thing to do, > even if it will be overwritten. If the compiler feels sure the > initialization isn't needed, it does not have to emit the code. But any > coding change after the (missing) initialization can create a bug now > (well, it depends on how the code is structured, but from the three lines > of context svn diff provides it's not clear a bug couldn't easily be > introduced). Hi, The last case is a switch case, and "err" must be set in all cases. In the second case, "err =" was used two times in a row. First case is OK. It is leftover code after some earlier patches. Thanks for the review! --HPS From owner-svn-src-all@FreeBSD.ORG Sat May 25 18:55:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AA7E0374; Sat, 25 May 2013 18:55:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D2F4FAE; Sat, 25 May 2013 18:55:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PIttCQ052696; Sat, 25 May 2013 18:55:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PIttB7052695; Sat, 25 May 2013 18:55:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201305251855.r4PIttB7052695@svn.freebsd.org> From: Ed Schouten Date: Sat, 25 May 2013 18:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250990 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 18:55:55 -0000 Author: ed Date: Sat May 25 18:55:55 2013 New Revision: 250990 URL: http://svnweb.freebsd.org/changeset/base/250990 Log: Add C11 macros CMPLX(), CMPLXF() and CMPLXL(). Clang allows us to initialize complex numbers using an array initializer, casted to a complex type. GCC has a builtin called __builtin_complex(). Modified: head/include/complex.h Modified: head/include/complex.h ============================================================================== --- head/include/complex.h Sat May 25 18:04:24 2013 (r250989) +++ head/include/complex.h Sat May 25 18:55:55 2013 (r250990) @@ -46,6 +46,18 @@ _Static_assert(__generic(_Complex_I, flo #define complex _Complex #define I _Complex_I +#if __ISO_C_VISIBLE >= 2011 +#ifdef __clang__ +#define CMPLX(x, y) ((double complex){ x, y }) +#define CMPLXF(x, y) ((float complex){ x, y }) +#define CMPLXL(x, y) ((long double complex){ x, y }) +#elif __GNUC_PREREQ__(4, 7) +#define CMPLX(x, y) __builtin_complex((double)(x), (double)(y)) +#define CMPLXF(x, y) __builtin_complex((float)(x), (float)(y)) +#define CMPLXL(x, y) __builtin_complex((long double)(x), (long double)(y)) +#endif +#endif /* __ISO_C_VISIBLE >= 2011 */ + __BEGIN_DECLS double cabs(double complex); From owner-svn-src-all@FreeBSD.ORG Sat May 25 18:59:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C5DA16E9; Sat, 25 May 2013 18:59:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B61B1FE4; Sat, 25 May 2013 18:59:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PIxCKM053348; Sat, 25 May 2013 18:59:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PIxChc053341; Sat, 25 May 2013 18:59:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305251859.r4PIxChc053341@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 May 2013 18:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250991 - in head: contrib/jemalloc/include/jemalloc include lib/libc/stdlib/jemalloc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 18:59:12 -0000 Author: marcel Date: Sat May 25 18:59:11 2013 New Revision: 250991 URL: http://svnweb.freebsd.org/changeset/base/250991 Log: Make the malloc(3) family of functions weak and make their non-weak implementations visible for use by applications. The functions $F that are now weak symbols are: allocm, calloc, dallocm, free, malloc, malloc_usable_size, nallocm, posix_memalign, rallocm, realloc, sallocm The non-weak implementations of $F are exported as __$F. Submitted by: stevek@juniper.net Reviewed by: jasone@, kib@ Approved by: jasone@ (jemalloc) Obtained from: juniper Networks, Inc Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h head/include/malloc_np.h head/lib/libc/stdlib/jemalloc/Symbol.map Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Sat May 25 18:55:55 2013 (r250990) +++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Sat May 25 18:59:11 2013 (r250991) @@ -68,9 +68,50 @@ extern int __isthreaded; #define isthreaded ((bool)__isthreaded) /* Mangle. */ +#undef je_malloc +#undef je_calloc +#undef je_realloc +#undef je_free +#undef je_posix_memalign +#undef je_malloc_usable_size +#undef je_allocm +#undef je_rallocm +#undef je_sallocm +#undef je_dallocm +#undef je_nallocm +#define je_malloc __malloc +#define je_calloc __calloc +#define je_realloc __realloc +#define je_free __free +#define je_posix_memalign __posix_memalign +#define je_malloc_usable_size __malloc_usable_size +#define je_allocm __allocm +#define je_rallocm __rallocm +#define je_sallocm __sallocm +#define je_dallocm __dallocm +#define je_nallocm __nallocm #define open _open #define read _read #define write _write #define close _close #define pthread_mutex_lock _pthread_mutex_lock #define pthread_mutex_unlock _pthread_mutex_unlock + +#ifdef JEMALLOC_C_ +/* + * Define 'weak' symbols so that an application can have its own versions + * of malloc, calloc, realloc, free, et al. + */ +__weak_reference(__malloc, malloc); +__weak_reference(__calloc, calloc); +__weak_reference(__realloc, realloc); +__weak_reference(__free, free); +__weak_reference(__posix_memalign, posix_memalign); +__weak_reference(__malloc_usable_size, malloc_usable_size); +__weak_reference(__allocm, allocm); +__weak_reference(__rallocm, rallocm); +__weak_reference(__sallocm, sallocm); +__weak_reference(__dallocm, dallocm); +__weak_reference(__nallocm, nallocm); +#endif + Modified: head/include/malloc_np.h ============================================================================== --- head/include/malloc_np.h Sat May 25 18:55:55 2013 (r250990) +++ head/include/malloc_np.h Sat May 25 18:59:11 2013 (r250991) @@ -61,6 +61,18 @@ int rallocm(void **ptr, size_t *rsize, s int sallocm(const void *ptr, size_t *rsize, int flags) __nonnull(1); int dallocm(void *ptr, int flags) __nonnull(1); int nallocm(size_t *rsize, size_t size, int flags); + +void * __calloc(size_t, size_t) __malloc_like; +void * __malloc(size_t) __malloc_like; +void * __realloc(void *, size_t); +void __free(void *); +int __posix_memalign(void **, size_t, size_t); +size_t __malloc_usable_size(const void *); +int __allocm(void **, size_t *, size_t, int) __nonnull(1); +int __rallocm(void **, size_t *, size_t, size_t, int) __nonnull(1); +int __sallocm(const void *, size_t *, int) __nonnull(1); +int __dallocm(void *, int) __nonnull(1); +int __nallocm(size_t *, size_t, int); __END_DECLS #endif /* _MALLOC_NP_H_ */ Modified: head/lib/libc/stdlib/jemalloc/Symbol.map ============================================================================== --- head/lib/libc/stdlib/jemalloc/Symbol.map Sat May 25 18:55:55 2013 (r250990) +++ head/lib/libc/stdlib/jemalloc/Symbol.map Sat May 25 18:59:11 2013 (r250991) @@ -26,6 +26,17 @@ FBSD_1.3 { sallocm; dallocm; nallocm; + __malloc; + __calloc; + __realloc; + __free; + __posix_memalign; + __malloc_usable_size; + __allocm; + __rallocm; + __sallocm; + __dallocm; + __nallocm; }; FBSDprivate_1.0 { From owner-svn-src-all@FreeBSD.ORG Sat May 25 19:16:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E6FE2BAF; Sat, 25 May 2013 19:16:16 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-ve0-x22d.google.com (mail-ve0-x22d.google.com [IPv6:2607:f8b0:400c:c01::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 6C7DC107; Sat, 25 May 2013 19:16:16 +0000 (UTC) Received: by mail-ve0-f173.google.com with SMTP id cy12so4220795veb.4 for ; Sat, 25 May 2013 12:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=KGouzFGwZw6pSh8eiMX9FGOOTDtfCU6U1Ax/+5EDUrg=; b=Yu7jPj0mvjZi0Hq/KILEFcQJ0vOSeiXUc8f6GHmGbt25r3JBSBr/ZzCqXwjhJYeJ5e VJQlOh8a05zciRcS0qI9FXefNORydneMhFL0+2VU9ucnw4zVBWwmUhK37+54fw0yGl3n a9+s2JcNkw82Ahr8Kfsq+qeUVZY1z0OgBceMsouLUF4DDvgR4uQN87J0/y67VIKLGndT P/qISyhQPWIsHdAEr8xJ91XUZSGAykohFp+fha0lIKYe1ronPxQJSfTzx7uUC/yve2nD zGwnExEKNkbT9dFJsYPCfNOOjjXcTivO4RFqsCRMfwzWIjGXIyYV4QFfXlyQuMnKsbbR ZR0g== X-Received: by 10.52.163.69 with SMTP id yg5mr10072676vdb.38.1369509375124; Sat, 25 May 2013 12:16:15 -0700 (PDT) Received: from kan.dyndns.org (c-24-63-226-98.hsd1.ma.comcast.net. [24.63.226.98]) by mx.google.com with ESMTPSA id aq10sm13640425ved.2.2013.05.25.12.16.13 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sat, 25 May 2013 12:16:14 -0700 (PDT) Date: Sat, 25 May 2013 15:16:00 -0400 From: Alexander Kabaev To: Marcel Moolenaar Subject: Re: svn commit: r250991 - in head: contrib/jemalloc/include/jemalloc include lib/libc/stdlib/jemalloc Message-ID: <20130525151600.147432e6@kan.dyndns.org> In-Reply-To: <201305251859.r4PIxChc053341@svn.freebsd.org> References: <201305251859.r4PIxChc053341@svn.freebsd.org> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.17; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/HldmvvB1T3IDiv4sLFIaP9w"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 19:16:17 -0000 --Sig_/HldmvvB1T3IDiv4sLFIaP9w Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sat, 25 May 2013 18:59:12 +0000 (UTC) Marcel Moolenaar wrote: > Make the malloc(3) family of functions weak and make their non-weak > implementations visible for use by applications. The functions $F > that are now weak symbols are: > allocm, calloc, dallocm, free, malloc, malloc_usable_size, > nallocm, posix_memalign, rallocm, realloc, sallocm > =20 > The non-weak implementations of $F are exported as __$F. > =20 > Submitted by: stevek@juniper.net > Reviewed by: jasone@, kib@ > Approved by: jasone@ (jemalloc) Don't we use namespace.h/unnamespace.h for this?=20 --=20 Alexander Kabaev --Sig_/HldmvvB1T3IDiv4sLFIaP9w Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iD8DBQFRoQ39Q6z1jMm+XZYRAofPAKCELfKJpjsePU5fZLIGxPJcchZhlACgqf3J 73nofFyfyXF1+V+/seZlYfY= =0QBo -----END PGP SIGNATURE----- --Sig_/HldmvvB1T3IDiv4sLFIaP9w-- From owner-svn-src-all@FreeBSD.ORG Sat May 25 19:46:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3917E1BF; Sat, 25 May 2013 19:46:25 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id 035AA1FF; Sat, 25 May 2013 19:46:25 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id F15121203B1; Sat, 25 May 2013 21:46:10 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id AF51328493; Sat, 25 May 2013 21:46:10 +0200 (CEST) Date: Sat, 25 May 2013 21:46:10 +0200 From: Jilles Tjoelker To: Marcel Moolenaar Subject: Re: svn commit: r250991 - in head: contrib/jemalloc/include/jemalloc include lib/libc/stdlib/jemalloc Message-ID: <20130525194610.GA26980@stack.nl> References: <201305251859.r4PIxChc053341@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305251859.r4PIxChc053341@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 19:46:25 -0000 On Sat, May 25, 2013 at 06:59:12PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Sat May 25 18:59:11 2013 > New Revision: 250991 > URL: http://svnweb.freebsd.org/changeset/base/250991 > Log: > Make the malloc(3) family of functions weak and make their non-weak > implementations visible for use by applications. The functions $F that > are now weak symbols are: > allocm, calloc, dallocm, free, malloc, malloc_usable_size, > nallocm, posix_memalign, rallocm, realloc, sallocm > The non-weak implementations of $F are exported as __$F. > Submitted by: stevek@juniper.net > Reviewed by: jasone@, kib@ > Approved by: jasone@ (jemalloc) > Obtained from: juniper Networks, Inc Is it deliberate that the same treatment is not applied to aligned_alloc? -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sat May 25 19:57:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D8D77588; Sat, 25 May 2013 19:57:11 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id 9E32B284; Sat, 25 May 2013 19:57:11 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 8347812013A; Sat, 25 May 2013 21:56:59 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 5B7F728493; Sat, 25 May 2013 21:56:59 +0200 (CEST) Date: Sat, 25 May 2013 21:56:59 +0200 From: Jilles Tjoelker To: Ed Schouten Subject: Re: svn commit: r250883 - in head: include include/xlocale lib/libc/locale sys/sys tools/regression/lib/libc/locale Message-ID: <20130525195659.GB26980@stack.nl> References: <201305211959.r4LJxbLx034714@svn.freebsd.org> <20130521220003.GB58299@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, gabor@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 19:57:11 -0000 On Sat, May 25, 2013 at 04:00:44PM +0200, Ed Schouten wrote: > [ +gabor ] > 2013/5/22 Ed Schouten : > > Oh, the horror! I thought on FreeBSD, we used the LC_CTYPE files to do > > a mapping to ISO 10646. Unfortunately, it seems to be the case that > > these files are only used to do mappings to > > uppercase/lowercase/runetype. Bummer. > So I think the solution to this problem is twofold. First, let's look > at the case where people have built world with WITH_ICONV=. Instead of > implementing the *c32* functions on top of the *wc* variants, we can > simply use libiconv. The following patch adds two new variants of the > *c32* functions, implemented on top of libiconv. > At first I tried implementing these functions on top of > iconv_open_into(), but unfortunately it seems to be the case that the > iconv_allocation_t is larger than the mbstate_t, meaning we cannot > safely embed one into the other. To work around this, I'm using the > internal _citrus_* API. > http://80386.nl/pub/uchar-iconv.txt > Jilles, Gabor, could you please take a look at the patch, whether it's > any good? The idea seems good. I have not tested it, though. It seems better to implement c16rtomb_l() and mbrtoc16_l() in the same way, rather than duplicating the UTF-16 coding and passing a pointer to a mbstate_t which actually has only 120 bytes of storage rather than the required 128 bytes. > Now we still have the case where the system is built WITHOUT_ICONV=. I > think it really depends on the future of iconv in base how complete we > should attempt to make it. Gabor, is there a chance WITH_ICONV= will > become the default in FreeBSD 10? If ache@ is right about configure scripts, it is an option to expose the new functions only for WITH_ICONV=. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sat May 25 22:17:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5E1A1E7; Sat, 25 May 2013 22:17:15 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D002B47; Sat, 25 May 2013 22:17:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PMHFOx022831; Sat, 25 May 2013 22:17:15 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PMHFSI022830; Sat, 25 May 2013 22:17:15 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201305252217.r4PMHFSI022830@svn.freebsd.org> From: Jeremie Le Hen Date: Sat, 25 May 2013 22:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250992 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 22:17:15 -0000 Author: jlh Date: Sat May 25 22:17:14 2013 New Revision: 250992 URL: http://svnweb.freebsd.org/changeset/base/250992 Log: Rework the comment I initially wrote when SHLIB_LDSCRIPT was introduced. The build system is really intricate and I had a hard time to remind the whole picture even when reading my own words. This one will hopefully be better. Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Sat May 25 18:59:11 2013 (r250991) +++ head/share/mk/bsd.lib.mk Sat May 25 22:17:14 2013 (r250992) @@ -294,16 +294,21 @@ _libinstall: .if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory -# prefix where shared objects will be installed. ${_LDSCRIPTROOT} is the -# directory prefix that will be used in generated ld(1) scripts. They cannot -# be coalesced because of the way ld(1) handles the sysroot prefix (used in the -# cross-toolchain): -# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty. +# prefix where shared objects will be installed by the install target. +# +# ${_LDSCRIPTROOT} is the directory prefix that will be used when generating +# ld(1) scripts. The crosstools' ld is configured to lookup libraries in an +# alternative directory which is called "sysroot", so during buildworld binaries +# won't be linked against the running system libraries but against the ones of +# the current source tree. ${_LDSCRIPTROOT} behavior is twisted because of +# the location where we store them: +# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty +# because ld(1) will manage to find them from sysroot; # - 32 bits shims are not, so ${_LDSCRIPTROOT} is used to specify their full -# path. Note that ld(1) scripts are generated both during buildworld and -# installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty. -# On the other hand, the use of ${_SHLIBDIRPREFIX} is more consistent since it -# does not involve the logic of a tool we do not own. +# path, outside of sysroot. +# Note that ld(1) scripts are generated both during buildworld and +# installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty +# because on the target system, libraries are meant to be looked up from /. .if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT}) sed -e 's,@@SHLIB@@,${_LDSCRIPTROOT}${SHLIBDIR}/${SHLIB_NAME},g' \ -e 's,@@LIBDIR@@,${_LDSCRIPTROOT}${LIBDIR},g' \